diff --git a/doc/contributions.txt b/doc/contributions.txt index 31ea1bbc5b1f2c9930aa5a6484e2885bb5b8cabb..a4647f005dfdd2c291fd86ca90ff261628634201 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -197,6 +197,7 @@ Feep Larsson VWR-4444 Flemming Congrejo CT-193 + CT-318 Fluf Fredriksson VWR-3450 Fremont Cunningham @@ -274,6 +275,9 @@ Jacek Antonelli VWR-597 VWR-2054 VWR-2448 + VWR-2896 + VWR-2947 + VWR-2948 VWR-3605 JB Kraft VWR-5283 @@ -350,6 +354,7 @@ Michelle2 Zenovka Mm Alder VWR-3777 VWR-4794 + VWR-13578 Mr Greggan VWR-445 Nicholaz Beresford diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 7f4c2c33c138bd200324b7ab82f0a56e77f7bc22..1010b199a17fb8f4f83a973a6732ae39e6aca909 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -1,3 +1,4 @@ + # -*- cmake -*- # cmake_minimum_required should appear before any @@ -110,3 +111,7 @@ if (SERVER) add_subdirectory(${SERVER_PREFIX}tools) endif (WINDOWS) endif (SERVER) + +# Define after the custom viewer and server targets are created so individual +# apps can add themselves as dependencies +add_subdirectory(${INTEGRATION_TESTS_PREFIX}integration_tests) diff --git a/indra/cmake/GooglePerfTools.cmake b/indra/cmake/GooglePerfTools.cmake index aff65cb53e55c86f640426ab7cfdef45d8daf96a..355ecb58f09474e8db97e3621a75f748e7735dfc 100644 --- a/indra/cmake/GooglePerfTools.cmake +++ b/indra/cmake/GooglePerfTools.cmake @@ -6,9 +6,11 @@ if (STANDALONE) else (STANDALONE) use_prebuilt_binary(google) if (WINDOWS) + use_prebuilt_binary(google-perftools) set(TCMALLOC_LIBRARIES debug libtcmalloc_minimal-debug - optimized libtcmalloc_minimal-debug) + optimized libtcmalloc_minimal) + set(GOOGLE_PERFTOOLS_FOUND "YES") endif (WINDOWS) if (LINUX) set(TCMALLOC_LIBRARIES tcmalloc) @@ -27,6 +29,10 @@ endif (GOOGLE_PERFTOOLS_FOUND) # XXX Disable temporarily, until we have compilation issues on 64-bit # Etch sorted. set(USE_GOOGLE_PERFTOOLS OFF) +if (WINDOWS) + # *TODO -reenable this once we get server usage sorted out + #set(USE_GOOGLE_PERFTOOLS ON) +endif (WINDOWS) if (USE_GOOGLE_PERFTOOLS) set(TCMALLOC_FLAG -DLL_USE_TCMALLOC=1) diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake index 410766e4f9428a71817ca3c7844f10fc577b036c..ef202dd8796b5ee750aefd092db9160aac541931 100644 --- a/indra/cmake/LLCommon.cmake +++ b/indra/cmake/LLCommon.cmake @@ -4,6 +4,7 @@ include(APR) include(Boost) include(EXPAT) include(ZLIB) +include(GooglePerfTools) set(LLCOMMON_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llcommon @@ -13,3 +14,6 @@ set(LLCOMMON_INCLUDE_DIRS ) set(LLCOMMON_LIBRARIES llcommon) + +add_definitions(${TCMALLOC_FLAG}) + diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 2bddb95178908fcd585e1416c82770104c98b05f..eaa8a6dc2915ce82a4d488e9da155c82ae15a7c1 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -42,6 +42,7 @@ if (WINDOWS) wldap32 gdi32 user32 + dbghelp ) else (WINDOWS) set(WINDOWS_LIBRARIES "") diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 75b66a85daff83c34b2c2ec05cfdfc0474d0bb38..6559051b5abbe0bc3ac66901fe5dad362ebb07c8 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -23,6 +23,7 @@ set(LIBS_SERVER_PREFIX) set(SCRIPTS_PREFIX ../scripts) set(SERVER_PREFIX) set(VIEWER_PREFIX) +set(INTEGRATION_TESTS_PREFIX) set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX}) set(LIBS_OPEN_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX}) diff --git a/indra/integration_tests/CMakeLists.txt b/indra/integration_tests/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..67e8fbf1f2c0cd6fbaf6d9d7c9076a8281c6494a --- /dev/null +++ b/indra/integration_tests/CMakeLists.txt @@ -0,0 +1,3 @@ +# -*- cmake -*- + +add_subdirectory(llui_libtest) diff --git a/indra/integration_tests/llui_libtest/CMakeLists.txt b/indra/integration_tests/llui_libtest/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..68556ac4ab4e771c37891c02dcfd698762e842ad --- /dev/null +++ b/indra/integration_tests/llui_libtest/CMakeLists.txt @@ -0,0 +1,97 @@ +# -*- cmake -*- + +project (llui_libtest) + +include(00-Common) +include(LLCommon) +include(LLImage) +include(LLImageJ2COJ) # ugh, needed for images +include(LLMath) +include(LLRender) +include(LLWindow) +include(LLUI) +include(LLVFS) # ugh, needed for LLDir +include(LLXML) +include(Linking) +# include(Tut) + +include_directories( + ${FREETYPE_INCLUDE_DIRS} + ${LLCOMMON_INCLUDE_DIRS} + ${LLIMAGE_INCLUDE_DIRS} + ${LLMATH_INCLUDE_DIRS} + ${LLRENDER_INCLUDE_DIRS} + ${LLUI_INCLUDE_DIRS} + ${LLVFS_INCLUDE_DIRS} + ${LLWINDOW_INCLUDE_DIRS} + ${LLXML_INCLUDE_DIRS} + ) + +set(llui_libtest_SOURCE_FILES + llui_libtest.cpp + llwidgetreg.cpp + ) + +set(llui_libtest_HEADER_FILES + CMakeLists.txt + llui_libtest.h + llwidgetreg.h + ) + +set_source_files_properties(${llui_libtest_HEADER_FILES} + PROPERTIES HEADER_FILE_ONLY TRUE) + +list(APPEND llui_libtest_SOURCE_FILES ${llui_libtest_HEADER_FILES}) + +add_executable(llui_libtest ${llui_libtest_SOURCE_FILES}) + +# Link with OS-specific libraries for LLWindow dependency +if (DARWIN) + find_library(COCOA_LIBRARY Cocoa) + set(OS_LIBRARIES ${COCOA_LIBRARY}) +elseif (WINDOWS) + set(OS_LIBRARIES ${WINDOWS_LIBRARIES}) +elseif (LINUX) + set(OS_LIBRARIES) +else (DARWIN) + message(FATAL_ERROR "unknown platform") +endif (DARWIN) + +# Libraries on which this library depends, needed for Linux builds +# Sort by high-level to low-level +target_link_libraries(llui_libtest + llui + ${OS_LIBRARIES} + ${GOOGLE_PERFTOOLS_LIBRARIES} + ) + +if (WINDOWS) + set_target_properties(llui_libtest + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:LIBCMT" + LINK_FLAGS_DEBUG "/NODEFAULTLIB:MSVCRT /NODEFAULTLIB:LIBCMTD" + ) + + # Copy over OpenJPEG.dll + # *NOTE: On Windows with VS2005, only the first comment prints + set(OPENJPEG_RELEASE + "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release/openjpeg.dll") + add_custom_command( TARGET llui_libtest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${OPENJPEG_RELEASE} ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Copying OpenJPEG DLLs to binary directory" + ) + set(OPENJPEG_DEBUG + "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug/openjpegd.dll") + add_custom_command( TARGET llui_libtest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${OPENJPEG_DEBUG} ${CMAKE_CURRENT_BINARY_DIR} + ) +endif (WINDOWS) + +if (VIEWER) + # Ensure people working on the viewer don't break this library + # *NOTE: This could be removed, or only built by Parabuild, if the build + # and link times become too long. JC + add_dependencies(viewer llui_libtest) +endif (VIEWER) diff --git a/indra/integration_tests/llui_libtest/llui_libtest.cpp b/indra/integration_tests/llui_libtest/llui_libtest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f8caa7990b3516aa3fe02101827466f42af2641b --- /dev/null +++ b/indra/integration_tests/llui_libtest/llui_libtest.cpp @@ -0,0 +1,196 @@ +/** + * @file llui_libtest.cpp + * @brief Integration test for the LLUI library + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "llui_libtest.h" + +// project includes +#include "llwidgetreg.h" + +// linden library includes +#include "llcontrol.h" // LLControlGroup +#include "lldir.h" +#include "llerrorcontrol.h" +#include "llfloater.h" +#include "llfontgl.h" +#include "lltrans.h" +#include "llui.h" +#include "lluictrlfactory.h" + +#include <iostream> + +// *TODO: switch to using TUT +// *TODO: teach Parabuild about this program, run automatically after full builds + +// We can't create LLImageGL objects because we have no window or rendering +// context. Provide enough of an LLUIImage to test the LLUI library without +// an underlying image. +class TestUIImage : public LLUIImage +{ +public: + TestUIImage() + : LLUIImage( std::string(), NULL ) // NULL ImageGL, don't deref! + { } + + /*virtual*/ S32 getWidth() const + { + return 16; + } + + /*virtual*/ S32 getHeight() const + { + return 16; + } +}; + +// We need to supply dummy images +class TestImageProvider : public LLImageProviderInterface +{ +public: + /*virtual*/ LLPointer<LLUIImage> getUIImage(const std::string& name) + { + return makeImage(); + } + + /*virtual*/ LLPointer<LLUIImage> getUIImageByID(const LLUUID& id) + { + return makeImage(); + } + + /*virtual*/ void cleanUp() + { + } + + LLPointer<LLUIImage> makeImage() + { + LLPointer<LLImageGL> image_gl; + LLPointer<LLUIImage> image = new LLUIImage( std::string(), image_gl); + return image; + } +}; + +static std::string get_xui_dir() +{ + std::string delim = gDirUtilp->getDirDelimiter(); + return gDirUtilp->getAppRODataDir() + delim + std::string("skins") + delim + "default" + delim + "xui" + delim; +} + +int main(int argc, char** argv) +{ + // Must init LLError for llerrs to actually cause errors. + LLError::initForApplication("."); + + // Font lookup needs directory support + gDirUtilp->initAppDirs("SecondLife", "../../../newview"); + gDirUtilp->setSkinFolder("default"); + + std::string config_filename = gDirUtilp->getExpandedFilename( + LL_PATH_APP_SETTINGS, "settings.xml"); + LLControlGroup config_group("config"); + config_group.loadFromFile(config_filename); + + std::string color_filename = gDirUtilp->getExpandedFilename( + LL_PATH_DEFAULT_SKIN, "colors.xml"); + LLControlGroup color_group("color"); + color_group.loadFromFile(color_filename); + + LLControlGroup floater_group("floater"); + LLControlGroup ignores_group("ignores"); + LLUI::settings_map_t settings; + settings["config"] = &config_group; + settings["color"] = &color_group; + settings["floater"] = &floater_group; + settings["ignores"] = &ignores_group; + + // Don't use real images as we don't have a GL context + TestImageProvider image_provider; + LLUI::initClass(settings, &image_provider); + + const bool no_register_widgets = false; + LLWidgetReg::initClass( no_register_widgets ); + + // Unclear if this is needed + LLUI::setupPaths(); + // Otherwise we get translation warnings when setting up floaters + // (tooltips for buttons) + std::set<std::string> default_args; + LLTrans::parseStrings("strings.xml", default_args); + + LLFontManager::initClass(); + + // Creating widgets apparently requires fonts to be initialized, + // otherwise it crashes. + LLFontGL::initClass(96.f, 1.f, 1.f, + gDirUtilp->getAppRODataDir(), + LLUI::getXUIPaths(), + false ); // don't create gl textures + + LLFloaterView::Params fvparams; + fvparams.name("Floater View"); + fvparams.rect( LLRect(0,480,640,0) ); + fvparams.mouse_opaque(false); + fvparams.follows.flags(FOLLOWS_ALL); + fvparams.tab_stop(false); + gFloaterView = LLUICtrlFactory::create<LLFloaterView> (fvparams); + + // Convert all test floaters to new XML format + std::string delim = gDirUtilp->getDirDelimiter(); + std::string xui_dir = get_xui_dir() + "en" + delim; + std::string filename; + while (gDirUtilp->getNextFileInDir(xui_dir, "floater_test_*.xml", filename, false)) + { + if (filename.find("_new.xml") != std::string::npos) + { + // don't re-export other test floaters + continue; + } + llinfos << "Converting " << filename << llendl; + // Build a floater and output new attributes + LLXMLNodePtr output_node = new LLXMLNode(); + LLFloater* floater = new LLFloater(); + LLUICtrlFactory::getInstance()->buildFloater(floater, + filename, + FALSE, // don't open floater + output_node); + std::string out_filename = xui_dir + filename; + std::string::size_type extension_pos = out_filename.rfind(".xml"); + out_filename.resize(extension_pos); + out_filename += "_new.xml"; + + llinfos << "Output: " << out_filename << llendl; + LLFILE* floater_file = LLFile::fopen(out_filename.c_str(), "w"); + LLXMLNode::writeHeaderToFile(floater_file); + output_node->writeToFile(floater_file); + fclose(floater_file); + } + return 0; +} diff --git a/indra/integration_tests/llui_libtest/llui_libtest.h b/indra/integration_tests/llui_libtest/llui_libtest.h new file mode 100644 index 0000000000000000000000000000000000000000..a84d57dba956e34db706f84933cb8e80465b6583 --- /dev/null +++ b/indra/integration_tests/llui_libtest/llui_libtest.h @@ -0,0 +1,36 @@ +/** + * @file llui_libtest.h + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLUI_LIBTEST_H +#define LLUI_LIBTEST_H + +// TODO + +#endif diff --git a/indra/integration_tests/llui_libtest/llwidgetreg.cpp b/indra/integration_tests/llui_libtest/llwidgetreg.cpp new file mode 100644 index 0000000000000000000000000000000000000000..417f3059d6c8097c38ed89fc4cab2d73306e9ec9 --- /dev/null +++ b/indra/integration_tests/llui_libtest/llwidgetreg.cpp @@ -0,0 +1,106 @@ +/** + * @file llwidgetreg.cpp + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "llwidgetreg.h" + +#include "llbutton.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "llcontainerview.h" +#include "lliconctrl.h" +#include "llmenugl.h" +#include "llmultislider.h" +#include "llmultisliderctrl.h" +#include "llprogressbar.h" +#include "llradiogroup.h" +#include "llscrollcontainer.h" +#include "llscrollingpanellist.h" +#include "llscrolllistctrl.h" +#include "llslider.h" +#include "llsliderctrl.h" +#include "llspinctrl.h" +#include "llstatview.h" +#include "lltabcontainer.h" +#include "lltextbox.h" +#include "lltexteditor.h" +#include "llflyoutbutton.h" +#include "llsearcheditor.h" +#include "lllayoutstack.h" + +void LLWidgetReg::initClass(bool register_widgets) +{ + // Only need to register if the Windows linker has optimized away the + // references to the object files. + if (register_widgets) + { + LLDefaultWidgetRegistry::Register<LLButton> button("button"); + LLDefaultWidgetRegistry::Register<LLCheckBoxCtrl> check_box("check_box"); + LLDefaultWidgetRegistry::Register<LLComboBox> combo_box("combo_box"); + LLDefaultWidgetRegistry::Register<LLFlyoutButton> flyout_button("flyout_button"); + LLDefaultWidgetRegistry::Register<LLContainerView> container_view("container_view"); + LLDefaultWidgetRegistry::Register<LLIconCtrl> icon("icon"); + LLDefaultWidgetRegistry::Register<LLLineEditor> line_editor("line_editor"); + LLDefaultWidgetRegistry::Register<LLSearchEditor> search_editor("search_editor"); + LLDefaultWidgetRegistry::Register<LLMenuItemSeparatorGL> menu_item_separator("menu_item_separator"); + LLDefaultWidgetRegistry::Register<LLMenuItemCallGL> menu_item_call_gl("menu_item_call"); + LLDefaultWidgetRegistry::Register<LLMenuItemCheckGL> menu_item_check_gl("menu_item_check"); + LLDefaultWidgetRegistry::Register<LLMenuGL> menu("menu"); + LLDefaultWidgetRegistry::Register<LLMenuBarGL> menu_bar("menu_bar"); + LLDefaultWidgetRegistry::Register<LLContextMenu> context_menu("context_menu"); + LLDefaultWidgetRegistry::Register<LLMultiSlider> multi_slider_bar("multi_slider_bar"); + LLDefaultWidgetRegistry::Register<LLMultiSliderCtrl> multi_slider("multi_slider"); + LLDefaultWidgetRegistry::Register<LLPanel> panel("panel", &LLPanel::fromXML); + LLDefaultWidgetRegistry::Register<LLLayoutStack> layout_stack("layout_stack", &LLLayoutStack::fromXML); + LLDefaultWidgetRegistry::Register<LLProgressBar> progress_bar("progress_bar"); + LLDefaultWidgetRegistry::Register<LLRadioGroup> radio_group("radio_group"); + LLDefaultWidgetRegistry::Register<LLRadioCtrl> radio_item("radio_item"); + LLDefaultWidgetRegistry::Register<LLScrollContainer> scroll_container("scroll_container"); + LLDefaultWidgetRegistry::Register<LLScrollingPanelList> scrolling_panel_list("scrolling_panel_list"); + LLDefaultWidgetRegistry::Register<LLScrollListCtrl> scroll_list("scroll_list"); + LLDefaultWidgetRegistry::Register<LLSlider> slider_bar("slider_bar"); + LLDefaultWidgetRegistry::Register<LLSliderCtrl> slider("slider"); + LLDefaultWidgetRegistry::Register<LLSpinCtrl> spinner("spinner"); + LLDefaultWidgetRegistry::Register<LLStatBar> stat_bar("stat_bar"); + //LLDefaultWidgetRegistry::Register<LLPlaceHolderPanel> placeholder("placeholder"); + LLDefaultWidgetRegistry::Register<LLTabContainer> tab_container("tab_container"); + LLDefaultWidgetRegistry::Register<LLTextBox> text("text"); + LLDefaultWidgetRegistry::Register<LLTextEditor> simple_text_editor("simple_text_editor"); + LLDefaultWidgetRegistry::Register<LLUICtrl> ui_ctrl("ui_ctrl"); + LLDefaultWidgetRegistry::Register<LLStatView> stat_view("stat_view"); + //LLDefaultWidgetRegistry::Register<LLUICtrlLocate> locate("locate"); + //LLDefaultWidgetRegistry::Register<LLUICtrlLocate> pad("pad"); + LLDefaultWidgetRegistry::Register<LLViewBorder> view_border("view_border"); + } + + // *HACK: Usually this is registered as a viewer text editor + LLDefaultWidgetRegistry::Register<LLTextEditor> text_editor("text_editor"); +} diff --git a/indra/integration_tests/llui_libtest/llwidgetreg.h b/indra/integration_tests/llui_libtest/llwidgetreg.h new file mode 100644 index 0000000000000000000000000000000000000000..eac818608d2163e0ebb10cfb6783f042631eec53 --- /dev/null +++ b/indra/integration_tests/llui_libtest/llwidgetreg.h @@ -0,0 +1,43 @@ +/** + * @file llwidgetreg.h + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLWIDGETREG_H +#define LLWIDGETREG_H + +// Register all widgets with the builder registry. +// Useful on Windows where linker discards all references to the +// static LLDefaultWidgetRegistry::Register<> calls. +class LLWidgetReg +{ +public: + static void initClass(bool register_widgets); +}; + +#endif diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index 5b6db3bd8703b817cf8af99b5cd0e0e83b6c87c3..6a494d198376348f7cd42c6c5960f8b4c592d4b8 100644 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -40,8 +40,8 @@ #include "llstring.h" #include "lldir.h" #include "llendianswizzle.h" -#include "audioengine.h" #include "llassetstorage.h" +#include "llrefcount.h" #include "vorbis/codec.h" #include "vorbis/vorbisfile.h" diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index e1f8ce53fb9972a30f3c63f637bb00132bedfa12..24391eb8f321f439e697bade3bf3e44556f25498 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -56,7 +56,7 @@ const F32 ROTATION_MOTION_THRESHOLD = 0.001f; char gInFile[1024]; /* Flawfinder: ignore */ char gOutFile[1024]; /* Flawfinder: ignore */ - +/* //------------------------------------------------------------------------ // Status Codes //------------------------------------------------------------------------ @@ -91,7 +91,7 @@ const char *LLBVHLoader::ST_NO_XLT_EASEIN = "Can't get easeIn values."; const char *LLBVHLoader::ST_NO_XLT_EASEOUT = "Can't get easeOut values."; const char *LLBVHLoader::ST_NO_XLT_HAND = "Can't get hand morph value."; const char *LLBVHLoader::ST_NO_XLT_EMOTE = "Can't read emote name."; - +*/ //------------------------------------------------------------------------ // find_next_whitespace() //------------------------------------------------------------------------ @@ -124,7 +124,9 @@ LLQuaternion::Order bvhStringToOrder( char *str ) //----------------------------------------------------------------------------- // LLBVHLoader() //----------------------------------------------------------------------------- -LLBVHLoader::LLBVHLoader(const char* buffer) + +/* + LLBVHLoader::LLBVHLoader(const char* buffer) { reset(); @@ -144,7 +146,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer) } } - char error_text[128]; /* Flawfinder: ignore */ + char error_text[128]; // Flawfinder: ignore S32 error_line; mStatus = loadBVHFile(buffer, error_text, error_line); if (mStatus != LLBVHLoader::ST_OK) @@ -158,6 +160,49 @@ LLBVHLoader::LLBVHLoader(const char* buffer) mInitialized = TRUE; } +*/ +LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine) +{ + reset(); + errorLine = 0; + mStatus = loadTranslationTable("anim.ini"); + loadStatus = mStatus; + llinfos<<"Load Status 00 : "<< loadStatus << llendl; + if (mStatus == E_ST_NO_XLT_FILE) + { + //llwarns << "NOTE: No translation table found." << llendl; + loadStatus = mStatus; + return; + } + else + { + if (mStatus != E_ST_OK) + { + //llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl; + errorLine = getLineNumber(); + loadStatus = mStatus; + return; + } + } + + char error_text[128]; /* Flawfinder: ignore */ + S32 error_line; + mStatus = loadBVHFile(buffer, error_text, error_line); + + if (mStatus != E_ST_OK) + { + //llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl; + loadStatus = mStatus; + errorLine = getLineNumber(); + return; + } + + applyTranslations(); + optimize(); + + mInitialized = TRUE; +} + LLBVHLoader::~LLBVHLoader() { @@ -167,7 +212,7 @@ LLBVHLoader::~LLBVHLoader() //------------------------------------------------------------------------ // LLBVHLoader::loadTranslationTable() //------------------------------------------------------------------------ -LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) +ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName) { mLineNumber = 0; mTranslations.clear(); @@ -182,7 +227,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) infile.open(path, LL_APR_R); apr_file_t *fp = infile.getFileHandle(); if (!fp) - return ST_NO_XLT_FILE; + return E_ST_NO_XLT_FILE; llinfos << "NOTE: Loading translation table: " << fileName << llendl; @@ -194,9 +239,9 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) // load header //-------------------------------------------------------------------- if ( ! getLine(fp) ) - return ST_EOF; + return E_ST_EOF; if ( strncmp(mLine, "Translations 1.0", 16) ) - return ST_NO_XLT_HEADER; + return E_ST_NO_XLT_HEADER; //-------------------------------------------------------------------- // load data one line at a time @@ -222,7 +267,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) { char name[128]; /* Flawfinder: ignore */ if ( sscanf(mLine, " [%127[^]]", name) != 1 ) - return ST_NO_XLT_NAME; + return E_ST_NO_XLT_NAME; if (strcmp(name, "GLOBALS")==0) { @@ -245,7 +290,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) { char emote_str[1024]; /* Flawfinder: ignore */ if ( sscanf(mLine, " %*s = %1023s", emote_str) != 1 ) /* Flawfinder: ignore */ - return ST_NO_XLT_EMOTE; + return E_ST_NO_XLT_EMOTE; mEmoteName.assign( emote_str ); // llinfos << "NOTE: Emote: " << mEmoteName.c_str() << llendl; @@ -260,7 +305,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) { S32 priority; if ( sscanf(mLine, " %*s = %d", &priority) != 1 ) - return ST_NO_XLT_PRIORITY; + return E_ST_NO_XLT_PRIORITY; mPriority = priority; // llinfos << "NOTE: Priority: " << mPriority << llendl; @@ -288,7 +333,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) } else { - return ST_NO_XLT_LOOP; + return E_ST_NO_XLT_LOOP; } mLoopInPoint = loop_in * mDuration; @@ -305,7 +350,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) F32 duration; char type[128]; /* Flawfinder: ignore */ if ( sscanf(mLine, " %*s = %f %127s", &duration, type) != 2 ) /* Flawfinder: ignore */ - return ST_NO_XLT_EASEIN; + return E_ST_NO_XLT_EASEIN; mEaseIn = duration; continue; @@ -319,7 +364,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) F32 duration; char type[128]; /* Flawfinder: ignore */ if ( sscanf(mLine, " %*s = %f %127s", &duration, type) != 2 ) /* Flawfinder: ignore */ - return ST_NO_XLT_EASEOUT; + return E_ST_NO_XLT_EASEOUT; mEaseOut = duration; continue; @@ -332,7 +377,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) { S32 handMorph; if (sscanf(mLine, " %*s = %d", &handMorph) != 1) - return ST_NO_XLT_HAND; + return E_ST_NO_XLT_HAND; mHand = handMorph; continue; @@ -380,7 +425,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) &constraint.mTargetOffset.mV[VY], &constraint.mTargetOffset.mV[VZ]) != 13) { - return ST_NO_CONSTRAINT; + return E_ST_NO_CONSTRAINT; } } else @@ -440,7 +485,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) &constraint.mTargetOffset.mV[VY], &constraint.mTargetOffset.mV[VZ]) != 13) { - return ST_NO_CONSTRAINT; + return E_ST_NO_CONSTRAINT; } } else @@ -463,7 +508,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) // at this point there must be a valid trans pointer //---------------------------------------------------------------- if ( ! trans ) - return ST_NO_XLT_NAME; + return E_ST_NO_XLT_NAME; //---------------------------------------------------------------- // check for ignore flag @@ -472,7 +517,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) { char trueFalse[128]; /* Flawfinder: ignore */ if ( sscanf(mLine, " %*s = %127s", trueFalse) != 1 ) /* Flawfinder: ignore */ - return ST_NO_XLT_IGNORE; + return E_ST_NO_XLT_IGNORE; trans->mIgnore = (LLStringUtil::compareInsensitive(trueFalse, "true")==0); continue; @@ -497,12 +542,12 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) } else { - return ST_NO_XLT_RELATIVE; + return E_ST_NO_XLT_RELATIVE; } } else { - return ST_NO_XLT_RELATIVE; + return E_ST_NO_XLT_RELATIVE; } continue; @@ -523,12 +568,12 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) } else { - return ST_NO_XLT_RELATIVE; + return E_ST_NO_XLT_RELATIVE; } } else { - return ST_NO_XLT_RELATIVE; + return E_ST_NO_XLT_RELATIVE; } continue; @@ -541,7 +586,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) { char outName[128]; /* Flawfinder: ignore */ if ( sscanf(mLine, " %*s = %127s", outName) != 1 ) /* Flawfinder: ignore */ - return ST_NO_XLT_OUTNAME; + return E_ST_NO_XLT_OUTNAME; trans->mOutName = outName; continue; @@ -557,7 +602,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) &fm.mMatrix[0][0], &fm.mMatrix[0][1], &fm.mMatrix[0][2], &fm.mMatrix[1][0], &fm.mMatrix[1][1], &fm.mMatrix[1][2], &fm.mMatrix[2][0], &fm.mMatrix[2][1], &fm.mMatrix[2][2] ) != 9 ) - return ST_NO_XLT_MATRIX; + return E_ST_NO_XLT_MATRIX; trans->mFrameMatrix = fm; continue; @@ -573,7 +618,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) &om.mMatrix[0][0], &om.mMatrix[0][1], &om.mMatrix[0][2], &om.mMatrix[1][0], &om.mMatrix[1][1], &om.mMatrix[1][2], &om.mMatrix[2][0], &om.mMatrix[2][1], &om.mMatrix[2][2] ) != 9 ) - return ST_NO_XLT_MATRIX; + return E_ST_NO_XLT_MATRIX; trans->mOffsetMatrix = om; continue; @@ -586,7 +631,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) { char mergeParentName[128]; /* Flawfinder: ignore */ if ( sscanf(mLine, " %*s = %127s", mergeParentName) != 1 ) /* Flawfinder: ignore */ - return ST_NO_XLT_MERGEPARENT; + return E_ST_NO_XLT_MERGEPARENT; trans->mMergeParentName = mergeParentName; continue; @@ -599,7 +644,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) { char mergeChildName[128]; /* Flawfinder: ignore */ if ( sscanf(mLine, " %*s = %127s", mergeChildName) != 1 ) /* Flawfinder: ignore */ - return ST_NO_XLT_MERGECHILD; + return E_ST_NO_XLT_MERGECHILD; trans->mMergeChildName = mergeChildName; continue; @@ -612,7 +657,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) { S32 priority; if ( sscanf(mLine, " %*s = %d", &priority) != 1 ) - return ST_NO_XLT_PRIORITY; + return E_ST_NO_XLT_PRIORITY; trans->mPriorityModifier = priority; continue; @@ -621,14 +666,14 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) } infile.close() ; - return ST_OK; + return E_ST_OK; } //------------------------------------------------------------------------ // LLBVHLoader::loadBVHFile() //------------------------------------------------------------------------ -LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 &err_line) +ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 &err_line) { std::string line; @@ -650,14 +695,14 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex // consume hierarchy //-------------------------------------------------------------------- if (iter == tokens.end()) - return ST_EOF; + return E_ST_EOF; line = (*(iter++)); err_line++; if ( !strstr(line.c_str(), "HIERARCHY") ) { // llinfos << line << llendl; - return ST_NO_HIER; + return E_ST_NO_HIER; } //-------------------------------------------------------------------- @@ -669,7 +714,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex // get next line //---------------------------------------------------------------- if (iter == tokens.end()) - return ST_EOF; + return E_ST_EOF; line = (*(iter++)); err_line++; @@ -719,7 +764,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex else { strncpy(error_text, line.c_str(), 127); /* Flawfinder: ignore */ - return ST_NO_JOINT; + return E_ST_NO_JOINT; } //---------------------------------------------------------------- @@ -729,7 +774,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex if ( sscanf(line.c_str(), "%*s %79s", jointName) != 1 ) /* Flawfinder: ignore */ { strncpy(error_text, line.c_str(), 127); /* Flawfinder: ignore */ - return ST_NO_NAME; + return E_ST_NO_NAME; } //---------------------------------------------------------------- @@ -754,7 +799,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex //---------------------------------------------------------------- if (iter == tokens.end()) { - return ST_EOF; + return E_ST_EOF; } line = (*(iter++)); err_line++; @@ -765,7 +810,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex if ( !strstr(line.c_str(), "{") ) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_OFFSET; + return E_ST_NO_OFFSET; } else { @@ -777,7 +822,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex //---------------------------------------------------------------- if (iter == tokens.end()) { - return ST_EOF; + return E_ST_EOF; } line = (*(iter++)); err_line++; @@ -788,7 +833,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex if ( !strstr(line.c_str(), "OFFSET") ) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_OFFSET; + return E_ST_NO_OFFSET; } //---------------------------------------------------------------- @@ -796,7 +841,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex //---------------------------------------------------------------- if (iter == tokens.end()) { - return ST_EOF; + return E_ST_EOF; } line = (*(iter++)); err_line++; @@ -807,7 +852,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex if ( !strstr(line.c_str(), "CHANNELS") ) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_CHANNELS; + return E_ST_NO_CHANNELS; } //---------------------------------------------------------------- @@ -820,14 +865,14 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex if (!p) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_ROTATION; + return E_ST_NO_ROTATION; } const char axis = *(p - 1); if ((axis != 'X') && (axis != 'Y') && (axis != 'Z')) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_AXIS; + return E_ST_NO_AXIS; } joint->mOrder[i] = axis; @@ -842,7 +887,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex if ( !strstr(line.c_str(), "MOTION") ) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_MOTION; + return E_ST_NO_MOTION; } //-------------------------------------------------------------------- @@ -850,7 +895,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex //-------------------------------------------------------------------- if (iter == tokens.end()) { - return ST_EOF; + return E_ST_EOF; } line = (*(iter++)); err_line++; @@ -858,13 +903,13 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex if ( !strstr(line.c_str(), "Frames:") ) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_FRAMES; + return E_ST_NO_FRAMES; } if ( sscanf(line.c_str(), "Frames: %d", &mNumFrames) != 1 ) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_FRAMES; + return E_ST_NO_FRAMES; } //-------------------------------------------------------------------- @@ -872,7 +917,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex //-------------------------------------------------------------------- if (iter == tokens.end()) { - return ST_EOF; + return E_ST_EOF; } line = (*(iter++)); err_line++; @@ -880,13 +925,13 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex if ( !strstr(line.c_str(), "Frame Time:") ) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_FRAME_TIME; + return E_ST_NO_FRAME_TIME; } if ( sscanf(line.c_str(), "Frame Time: %f", &mFrameTime) != 1 ) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_FRAME_TIME; + return E_ST_NO_FRAME_TIME; } mDuration = (F32)mNumFrames * mFrameTime; @@ -903,7 +948,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex // get next line if (iter == tokens.end()) { - return ST_EOF; + return E_ST_EOF; } line = (*(iter++)); err_line++; @@ -922,7 +967,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex if ( sscanf(p, "%f %f %f", key.mPos, key.mPos+1, key.mPos+2) != 3 ) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_POS; + return E_ST_NO_POS; } } @@ -931,19 +976,19 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex if (!p) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_ROT; + return E_ST_NO_ROT; } p = find_next_whitespace(++p); if (!p) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_ROT; + return E_ST_NO_ROT; } p = find_next_whitespace(++p); if (!p) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_ROT; + return E_ST_NO_ROT; } // get 3 rot values for joint @@ -951,7 +996,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex if ( sscanf(p, " %f %f %f", rot, rot+1, rot+2) != 3 ) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ - return ST_NO_ROT; + return E_ST_NO_ROT; } p++; @@ -962,7 +1007,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex } } - return ST_OK; + return E_ST_OK; } diff --git a/indra/llcharacter/llbvhloader.h b/indra/llcharacter/llbvhloader.h index 6937b9d835b96bc5f91e8e58cf311ed728f75cdf..ecdfc95478e631734401ec0ba2daf9504b5a7672 100644 --- a/indra/llcharacter/llbvhloader.h +++ b/indra/llcharacter/llbvhloader.h @@ -184,6 +184,41 @@ public: S32 mPriorityModifier; }; +typedef enum e_load_status + { + E_ST_OK, + E_ST_EOF, + E_ST_NO_CONSTRAINT, + E_ST_NO_FILE, + E_ST_NO_HIER, + E_ST_NO_JOINT, + E_ST_NO_NAME, + E_ST_NO_OFFSET, + E_ST_NO_CHANNELS, + E_ST_NO_ROTATION, + E_ST_NO_AXIS, + E_ST_NO_MOTION, + E_ST_NO_FRAMES, + E_ST_NO_FRAME_TIME, + E_ST_NO_POS, + E_ST_NO_ROT, + E_ST_NO_XLT_FILE, + E_ST_NO_XLT_HEADER, + E_ST_NO_XLT_NAME, + E_ST_NO_XLT_IGNORE, + E_ST_NO_XLT_RELATIVE, + E_ST_NO_XLT_OUTNAME, + E_ST_NO_XLT_MATRIX, + E_ST_NO_XLT_MERGECHILD, + E_ST_NO_XLT_MERGEPARENT, + E_ST_NO_XLT_PRIORITY, + E_ST_NO_XLT_LOOP, + E_ST_NO_XLT_EASEIN, + E_ST_NO_XLT_EASEOUT, + E_ST_NO_XLT_HAND, + E_ST_NO_XLT_EMOTE + } ELoadStatus; + //------------------------------------------------------------------------ // TranslationMap //------------------------------------------------------------------------ @@ -194,9 +229,11 @@ class LLBVHLoader friend class LLKeyframeMotion; public: // Constructor - LLBVHLoader(const char* buffer); +// LLBVHLoader(const char* buffer); + LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine); ~LLBVHLoader(); - + +/* // Status Codes typedef const char *Status; static const char *ST_OK; @@ -230,13 +267,13 @@ public: static const char *ST_NO_XLT_EASEOUT; static const char *ST_NO_XLT_HAND; static const char *ST_NO_XLT_EMOTE; - +*/ // Loads the specified translation table. - Status loadTranslationTable(const char *fileName); + ELoadStatus loadTranslationTable(const char *fileName); // Load the specified BVH file. // Returns status code. - Status loadBVHFile(const char *buffer, char *error_text, S32 &error_line); + ELoadStatus loadBVHFile(const char *buffer, char *error_text, S32 &error_line); // Applies translations to BVH data loaded. void applyTranslations(); @@ -260,7 +297,7 @@ public: BOOL isInitialized() { return mInitialized; } - Status getStatus() { return mStatus; } + ELoadStatus getStatus() { return mStatus; } protected: // Consumes one line of input from file. @@ -287,7 +324,7 @@ protected: std::string mEmoteName; BOOL mInitialized; - Status mStatus; + ELoadStatus mStatus; // computed values F32 mDuration; }; diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index 0112788884045611abe459364dc582fdab17d5cb..cd8f9e63fb966d1c57c20f472470b495e36bc855 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -42,7 +42,7 @@ #include "llmotioncontroller.h" #include "llvisualparam.h" #include "string_table.h" -#include "llmemory.h" +#include "llpointer.h" #include "llthread.h" class LLPolyMesh; @@ -169,7 +169,7 @@ public: void updateMotions(e_update_t update_type); LLAnimPauseRequest requestPause(); - BOOL areAnimationsPaused() { return mMotionController.isPaused(); } + BOOL areAnimationsPaused() const { return mMotionController.isPaused(); } void setAnimTimeFactor(F32 factor) { mMotionController.setTimeFactor(factor); } void setTimeStep(F32 time_step) { mMotionController.setTimeStep(time_step); } @@ -231,9 +231,9 @@ public: return (mCurIterator++)->second; } - LLVisualParam* getVisualParam(S32 id) + LLVisualParam* getVisualParam(S32 id) const { - VisualParamIndexMap_t::iterator iter = mVisualParamIndexMap.find(id); + VisualParamIndexMap_t::const_iterator iter = mVisualParamIndexMap.find(id); return (iter == mVisualParamIndexMap.end()) ? 0 : iter->second; } S32 getVisualParamID(LLVisualParam *id) @@ -246,11 +246,11 @@ public: } return 0; } - S32 getVisualParamCount() { return (S32)mVisualParamIndexMap.size(); } + S32 getVisualParamCount() const { return (S32)mVisualParamIndexMap.size(); } LLVisualParam* getVisualParam(const char *name); - ESex getSex() { return mSex; } + ESex getSex() const { return mSex; } void setSex( ESex sex ) { mSex = sex; } U32 getAppearanceSerialNum() const { return mAppearanceSerialNum; } diff --git a/indra/llcharacter/lljointstate.h b/indra/llcharacter/lljointstate.h index 16ad0e1200279957465d98a999230d9a6d4130ad..e40cf2673fc0aa7985617cebd25cd27ffd7070e3 100644 --- a/indra/llcharacter/lljointstate.h +++ b/indra/llcharacter/lljointstate.h @@ -37,7 +37,7 @@ // Header Files //----------------------------------------------------------------------------- #include "lljoint.h" -#include "llmemory.h" +#include "llrefcount.h" //----------------------------------------------------------------------------- // class LLJointState diff --git a/indra/llcharacter/llkeyframemotionparam.cpp b/indra/llcharacter/llkeyframemotionparam.cpp index 622405a5e13daea245e7f6fbd8bb87d4f54930d7..c4333fc0fd936e96a91ce20cff062ec167c73ee6 100644 --- a/indra/llcharacter/llkeyframemotionparam.cpp +++ b/indra/llcharacter/llkeyframemotionparam.cpp @@ -347,8 +347,11 @@ BOOL LLKeyframeMotionParam::loadMotions() // Load named file by concatenating the character prefix with the motion name. // Load data into a buffer to be parsed. //------------------------------------------------------------------------- - std::string path = gDirUtilp->getExpandedFilename(LL_PATH_MOTIONS,mCharacter->getAnimationPrefix()) - + "_" + getName() + ".llp"; + //std::string path = gDirUtilp->getExpandedFilename(LL_PATH_MOTIONS,mCharacter->getAnimationPrefix()) + // + "_" + getName() + ".llp"; + //RN: deprecated unused reference to "motion" directory + std::string path; + //------------------------------------------------------------------------- // open the file diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index 006d2b5f62dc90081e67336ab7f225107f191569..bb9625b2bd5451c4b2ca83cb1b1a0d7a09188704 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -1019,9 +1019,9 @@ bool LLMotionController::isMotionLoading(LLMotion* motion) //----------------------------------------------------------------------------- // findMotion() //----------------------------------------------------------------------------- -LLMotion* LLMotionController::findMotion(const LLUUID& id) +LLMotion* LLMotionController::findMotion(const LLUUID& id) const { - motion_map_t::iterator iter = mAllMotions.find(id); + motion_map_t::const_iterator iter = mAllMotions.find(id); if(iter == mAllMotions.end()) { return NULL; diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h index 9271483a252bec9aeeacda2110744aeb2aca95f5..5c3ec223cb0e1484c2598eee992a10fd2d0f2bdc 100644 --- a/indra/llcharacter/llmotioncontroller.h +++ b/indra/llcharacter/llmotioncontroller.h @@ -153,12 +153,12 @@ public: // pause and continue all motions void pauseAllMotions(); void unpauseAllMotions(); - BOOL isPaused() { return mPaused; } + BOOL isPaused() const { return mPaused; } void setTimeStep(F32 step); void setTimeFactor(F32 time_factor); - F32 getTimeFactor() { return mTimeFactor; } + F32 getTimeFactor() const { return mTimeFactor; } motion_list_t& getActiveMotions() { return mActiveMotions; } @@ -167,7 +167,7 @@ public: //protected: bool isMotionActive( LLMotion *motion ); bool isMotionLoading( LLMotion *motion ); - LLMotion *findMotion( const LLUUID& id ); + LLMotion *findMotion( const LLUUID& id ) const; protected: // internal operations act on motion instances directly diff --git a/indra/llcharacter/llmultigesture.cpp b/indra/llcharacter/llmultigesture.cpp index 7fe21dbc9369670e4e9c835301198293398916a0..701d6889ca73e5a130030e4bfe4f235ff14df891 100644 --- a/indra/llcharacter/llmultigesture.cpp +++ b/indra/llcharacter/llmultigesture.cpp @@ -243,7 +243,7 @@ void LLMultiGesture::dump() //--------------------------------------------------------------------------- LLGestureStepAnimation::LLGestureStepAnimation() : LLGestureStep(), - mAnimName("None"), + mAnimName("None"), mAnimAssetID(), mFlags(0x0) { } @@ -292,20 +292,27 @@ BOOL LLGestureStepAnimation::deserialize(LLDataPacker& dp) dp.unpackU32(mFlags, "flags"); return TRUE; } - -std::string LLGestureStepAnimation::getLabel() const +// *TODO: Translate +std::vector<std::string> LLGestureStepAnimation::getLabel() const { - std::string label; + std::vector<std::string> strings; + +// std::string label; if (mFlags & ANIM_FLAG_STOP) { - label = "Stop Animation: "; + strings.push_back( "AnimFlagStop"); + +// label = "Stop Animation: "; } else { - label = "Start Animation: "; + strings.push_back( "AnimFlagStart"); + +// label = "Start Animation: "; } - label += mAnimName; - return label; + strings.push_back( mAnimName); +// label += mAnimName; + return strings; } void LLGestureStepAnimation::dump() @@ -359,12 +366,15 @@ BOOL LLGestureStepSound::deserialize(LLDataPacker& dp) dp.unpackU32(mFlags, "flags"); return TRUE; } - -std::string LLGestureStepSound::getLabel() const +// *TODO: Translate +std::vector<std::string> LLGestureStepSound::getLabel() const { - std::string label("Sound: "); - label += mSoundName; - return label; + std::vector<std::string> strings; + strings.push_back( "Sound"); + strings.push_back( mSoundName); +// std::string label("Sound: "); +// label += mSoundName; + return strings; } void LLGestureStepSound::dump() @@ -414,12 +424,13 @@ BOOL LLGestureStepChat::deserialize(LLDataPacker& dp) dp.unpackU32(mFlags, "flags"); return TRUE; } - -std::string LLGestureStepChat::getLabel() const +// *TODO: Translate +std::vector<std::string> LLGestureStepChat::getLabel() const { - std::string label("Chat: "); - label += mChatText; - return label; + std::vector<std::string> strings; + strings.push_back("Chat"); + strings.push_back(mChatText); + return strings; } void LLGestureStepChat::dump() @@ -467,22 +478,27 @@ BOOL LLGestureStepWait::deserialize(LLDataPacker& dp) dp.unpackU32(mFlags, "flags"); return TRUE; } - -std::string LLGestureStepWait::getLabel() const +// *TODO: Translate +std::vector<std::string> LLGestureStepWait::getLabel() const { - std::string label("--- Wait: "); + std::vector<std::string> strings; + strings.push_back( "Wait" ); + +// std::string label("--- Wait: "); if (mFlags & WAIT_FLAG_TIME) { char buffer[64]; /* Flawfinder: ignore */ snprintf(buffer, sizeof(buffer), "%.1f seconds", (double)mWaitSeconds); /* Flawfinder: ignore */ - label += buffer; + strings.push_back(buffer); +// label += buffer; } else if (mFlags & WAIT_FLAG_ALL_ANIM) { - label += "until animations are done"; + strings.push_back("until animations are done"); + // label += "until animations are done"; } - return label; + return strings; } diff --git a/indra/llcharacter/llmultigesture.h b/indra/llcharacter/llmultigesture.h index eb15f600ca915ef1dfcde5fa8bb0b735212dc48c..fdffb35c31b3652820b59a596d34899d8705326d 100644 --- a/indra/llcharacter/llmultigesture.h +++ b/indra/llcharacter/llmultigesture.h @@ -130,7 +130,7 @@ public: virtual EStepType getType() = 0; // Return a user-readable label for this step - virtual std::string getLabel() const = 0; + virtual std::vector<std::string> getLabel() const = 0; virtual S32 getMaxSerialSize() const = 0; virtual BOOL serialize(LLDataPacker& dp) const = 0; @@ -152,7 +152,7 @@ public: virtual EStepType getType() { return STEP_ANIMATION; } - virtual std::string getLabel() const; + virtual std::vector<std::string> getLabel() const; virtual S32 getMaxSerialSize() const; virtual BOOL serialize(LLDataPacker& dp) const; @@ -175,7 +175,7 @@ public: virtual EStepType getType() { return STEP_SOUND; } - virtual std::string getLabel() const; + virtual std::vector<std::string> getLabel() const; virtual S32 getMaxSerialSize() const; virtual BOOL serialize(LLDataPacker& dp) const; @@ -198,7 +198,7 @@ public: virtual EStepType getType() { return STEP_CHAT; } - virtual std::string getLabel() const; + virtual std::vector<std::string> getLabel() const; virtual S32 getMaxSerialSize() const; virtual BOOL serialize(LLDataPacker& dp) const; @@ -223,7 +223,7 @@ public: virtual EStepType getType() { return STEP_WAIT; } - virtual std::string getLabel() const; + virtual std::vector<std::string> getLabel() const; virtual S32 getMaxSerialSize() const; virtual BOOL serialize(LLDataPacker& dp) const; diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h index 5698f2161425e620d8b257e651071569ded6ade1..2b976b219d794e0645c4da97eeba4943b78daabb 100644 --- a/indra/llcharacter/llpose.h +++ b/indra/llcharacter/llpose.h @@ -36,12 +36,14 @@ //----------------------------------------------------------------------------- // Header Files //----------------------------------------------------------------------------- -#include <string> -#include "llmap.h" #include "lljointstate.h" #include "lljoint.h" +#include "llmap.h" +#include "llpointer.h" + #include <map> +#include <string> //----------------------------------------------------------------------------- diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index 3a0c1bbc77168c0cd4fffd8a9c91990cd7a6f3a1..25c41e8509ea39f614a8f8ab1157b32d17177fa7 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -112,7 +112,7 @@ public: virtual void stopAnimating(BOOL set_by_user); // Interface methods - S32 getID() { return mID; } + S32 getID() const { return mID; } void setID(S32 id) { llassert(!mInfo); mID = id; } const std::string& getName() const { return mInfo->mName; } @@ -124,22 +124,22 @@ public: void setMaxDisplayName(const std::string& s) { mInfo->mMaxName = s; } void setMinDisplayName(const std::string& s) { mInfo->mMinName = s; } - EVisualParamGroup getGroup() { return mInfo->mGroup; } - F32 getMinWeight() { return mInfo->mMinWeight; } - F32 getMaxWeight() { return mInfo->mMaxWeight; } - F32 getDefaultWeight() { return mInfo->mDefaultWeight; } - ESex getSex() { return mInfo->mSex; } + EVisualParamGroup getGroup() const { return mInfo->mGroup; } + F32 getMinWeight() const { return mInfo->mMinWeight; } + F32 getMaxWeight() const { return mInfo->mMaxWeight; } + F32 getDefaultWeight() const { return mInfo->mDefaultWeight; } + ESex getSex() const { return mInfo->mSex; } - F32 getWeight() { return mIsAnimating ? mTargetWeight : mCurWeight; } - F32 getCurrentWeight() { return mCurWeight; } - F32 getLastWeight() { return mLastWeight; } - BOOL isAnimating() { return mIsAnimating; } + F32 getWeight() const { return mIsAnimating ? mTargetWeight : mCurWeight; } + F32 getCurrentWeight() const { return mCurWeight; } + F32 getLastWeight() const { return mLastWeight; } + BOOL isAnimating() const { return mIsAnimating; } LLVisualParam* getNextParam() { return mNext; } void setNextParam( LLVisualParam *next ); virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating; } - BOOL getAnimating() { return mIsAnimating; } + BOOL getAnimating() const { return mIsAnimating; } protected: F32 mCurWeight; // current weight diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index beac8df636036563d2bc25ec1da36869590584b3..bf46c2c038ec8ebed46584cdac9115318052064e 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -3,7 +3,9 @@ project(llcommon) include(00-Common) +include(LLAddBuildTest) include(LLCommon) +include(Boost) include_directories( ${EXPAT_INCLUDE_DIRS} @@ -11,7 +13,14 @@ include_directories( ${ZLIB_INCLUDE_DIRS} ) +# add_executable(lltreeiterators lltreeiterators.cpp) +# +# target_link_libraries(lltreeiterators +# ${LLCOMMON_LIBRARIES}) + set(llcommon_SOURCE_FILES + llallocator.cpp + llallocator_heap_profile.cpp llapp.cpp llapr.cpp llassettype.cpp @@ -40,11 +49,14 @@ set(llcommon_SOURCE_FILES llmd5.cpp llmemory.cpp llmemorystream.cpp + llmemtype.cpp llmetrics.cpp llmortician.cpp + llptrto.cpp llprocessor.cpp llqueuedthread.cpp llrand.cpp + llrefcount.cpp llrun.cpp llsd.cpp llsdserialize.cpp @@ -52,6 +64,7 @@ set(llcommon_SOURCE_FILES llsdutil.cpp llsecondlifeurls.cpp llstat.cpp + llstacktrace.cpp llstreamtools.cpp llstring.cpp llstringtable.cpp @@ -78,6 +91,8 @@ set(llcommon_HEADER_FILES indra_constants.h linden_common.h linked_lists.h + llallocator.h + llallocator_heap_profile.h llagentconstants.h llapp.h llapr.h @@ -98,8 +113,11 @@ set(llcommon_HEADER_FILES lldate.h lldefs.h lldependencies.h + lldeleteutils.h lldepthstack.h + lldictionary.h lldlinked.h + lldoubledispatch.h lldqueueptr.h llendianswizzle.h llenum.h @@ -121,6 +139,7 @@ set(llcommon_HEADER_FILES llheartbeat.h llhttpstatuscodes.h llindexedqueue.h + llinstancetracker.h llkeythrottle.h lllazy.h lllinkedqueue.h @@ -137,23 +156,30 @@ set(llcommon_HEADER_FILES llmetrics.h llmortician.h llnametable.h + llpointer.h llpreprocessor.h llpriqueuemap.h llprocessor.h llptrskiplist.h llptrskipmap.h + llptrto.h llqueuedthread.h llrand.h + llrefcount.h llrun.h + llrefcount.h + llsafehandle.h llsd.h llsdserialize.h llsdserialize_xml.h llsdutil.h llsecondlifeurls.h llsimplehash.h + llsingleton.h llskiplist.h llskipmap.h llstack.h + llstacktrace.h llstat.h llstatenums.h llstl.h @@ -164,6 +190,7 @@ set(llcommon_HEADER_FILES llsys.h llthread.h lltimer.h + lltreeiterators.h lluri.h lluuid.h lluuidhashmap.h @@ -199,6 +226,8 @@ target_link_libraries( ${APR_LIBRARIES} ${EXPAT_LIBRARIES} ${ZLIB_LIBRARIES} + ${BOOST_PROGRAM_OPTIONS_LIBRARY} + ${BOOST_REGEX_LIBRARY} ) include(LLAddBuildTest) @@ -208,3 +237,8 @@ SET(llcommon_TEST_SOURCE_FILES ) LL_ADD_PROJECT_UNIT_TESTS(llcommon "${llcommon_TEST_SOURCE_FILES}") +# *TODO - reenable these once tcmalloc libs no longer break the build. +#ADD_BUILD_TEST(llallocator llcommon) +#ADD_BUILD_TEST(llallocator_heap_profile llcommon) +#ADD_BUILD_TEST(llmemtype llcommon) + diff --git a/indra/llcommon/is_approx_equal_fraction.h b/indra/llcommon/is_approx_equal_fraction.h index f95b148590a1598010dd486c6d94a10909e94c47..d369fbc5b30bb844a3946d92ce68629966bc70e0 100644 --- a/indra/llcommon/is_approx_equal_fraction.h +++ b/indra/llcommon/is_approx_equal_fraction.h @@ -7,7 +7,30 @@ * making llcommon depend on llmath. * * $LicenseInfo:firstyear=2009&license=viewergpl$ + * * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ diff --git a/indra/llcommon/linden_common.h b/indra/llcommon/linden_common.h index f9d5877ab26fd61f6911b9f238b925e1aee1659f..9adf24a492677a8d805af3653145db92b98140dc 100644 --- a/indra/llcommon/linden_common.h +++ b/indra/llcommon/linden_common.h @@ -33,6 +33,11 @@ #ifndef LL_LINDEN_COMMON_H #define LL_LINDEN_COMMON_H +// *NOTE: Please keep includes here to a minimum! +// +// Files included here are included in every library .cpp file and +// are not precompiled. + #if defined(LL_WINDOWS) && defined(_DEBUG) # if _MSC_VER >= 1400 // Visual C++ 2005 or later # define _CRTDBG_MAP_ALLOC @@ -51,23 +56,22 @@ #include <cstdio> #include <cstdlib> #include <ctime> -#include <iostream> -#include <fstream> +#include <iosfwd> -// Work Microsoft compiler warnings +// Work around Microsoft compiler warnings in STL headers #ifdef LL_WINDOWS #pragma warning (disable : 4702) // unreachable code #pragma warning (disable : 4244) // conversion from time_t to S32 #endif // LL_WINDOWS -#include <algorithm> #include <list> #include <map> #include <vector> #include <string> #ifdef LL_WINDOWS -#pragma warning (3 : 4702) // we like level 3, not 4 +// Reenable warnings we disabled above +#pragma warning (3 : 4702) // unreachable code, we like level 3, not 4 // level 4 warnings that we need to disable: #pragma warning (disable : 4100) // unreferenced formal parameter #pragma warning (disable : 4127) // conditional expression is constant (e.g. while(1) ) @@ -78,6 +82,7 @@ #endif // LL_WINDOWS // Linden only libs in alpha-order other than stdtypes.h +// *NOTE: Please keep includes here to a minimum, see above. #include "stdtypes.h" #include "lldefs.h" #include "llerror.h" @@ -85,8 +90,5 @@ #include "llfasttimer.h" #include "llfile.h" #include "llformat.h" -#include "llstring.h" -#include "llsys.h" -#include "lltimer.h" #endif diff --git a/indra/llcommon/llallocator.cpp b/indra/llcommon/llallocator.cpp new file mode 100644 index 0000000000000000000000000000000000000000..eed9d1e7db47bce5282a65f3734a1f81634ef052 --- /dev/null +++ b/indra/llcommon/llallocator.cpp @@ -0,0 +1,140 @@ +/** + * @file llallocator.cpp + * @brief Implementation of the LLAllocator class. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" +#include "llallocator.h" + +#if LL_USE_TCMALLOC + +#include "google/heap-profiler.h" +#include "google/commandlineflags_public.h" + +DECLARE_bool(heap_profile_use_stack_trace); +//DECLARE_double(tcmalloc_release_rate); + +// static +void LLAllocator::pushMemType(S32 type) +{ + if(isProfiling()) + { + PushMemType(type); + } +} + +// static +S32 LLAllocator::popMemType() +{ + if (isProfiling()) + { + return PopMemType(); + } + else + { + return -1; + } +} + +void LLAllocator::setProfilingEnabled(bool should_enable) +{ + // NULL disables dumping to disk + static char const * const PREFIX = NULL; + if(should_enable) + { + HeapProfilerSetUseStackTrace(false); + HeapProfilerStart(PREFIX); + } + else + { + HeapProfilerStop(); + } +} + +// static +bool LLAllocator::isProfiling() +{ + return IsHeapProfilerRunning(); +} + +std::string LLAllocator::getRawProfile() +{ + // *TODO - fix google-perftools to accept an buffer to avoid this + // malloc-copy-free cycle. + char * buffer = GetHeapProfile(); + std::string ret = buffer; + free(buffer); + return ret; +} + +#else // LL_USE_TCMALLOC + +// +// stub implementations for when tcmalloc is disabled +// + +// static +void LLAllocator::pushMemType(S32 type) +{ +} + +// static +S32 LLAllocator::popMemType() +{ + return -1; +} + +void LLAllocator::setProfilingEnabled(bool should_enable) +{ +} + +// static +bool LLAllocator::isProfiling() +{ + return false; +} + +std::string LLAllocator::getRawProfile() +{ + return std::string(); +} + +#endif // LL_USE_TCMALLOC + +LLAllocatorHeapProfile const & LLAllocator::getProfile() +{ + mProf.mLines.clear(); + + // *TODO - avoid making all these extra copies of things... + std::string prof_text = getRawProfile(); + //std::cout << prof_text << std::endl; + mProf.parse(prof_text); + return mProf; +} diff --git a/indra/llcommon/llallocator.h b/indra/llcommon/llallocator.h new file mode 100644 index 0000000000000000000000000000000000000000..2b70fee0b8f9d6dd94b7b42c0aac0364305703f3 --- /dev/null +++ b/indra/llcommon/llallocator.h @@ -0,0 +1,63 @@ +/** + * @file llallocator.h + * @brief Declaration of the LLAllocator class. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLALLOCATOR_H +#define LL_LLALLOCATOR_H + +#include <string> + +#include "llmemtype.h" +#include "llallocator_heap_profile.h" + +class LLAllocator { + friend class LLMemoryView; + friend class LLMemType; + +private: + static void pushMemType(S32 type); + static S32 popMemType(); + +public: + void setProfilingEnabled(bool should_enable); + + static bool isProfiling(); + + LLAllocatorHeapProfile const & getProfile(); + +private: + std::string getRawProfile(); + +private: + LLAllocatorHeapProfile mProf; +}; + +#endif // LL_LLALLOCATOR_H diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d82ee9ed81bc25c43fea886a95abe558bd19d07e --- /dev/null +++ b/indra/llcommon/llallocator_heap_profile.cpp @@ -0,0 +1,149 @@ +/** + * @file llallocator_heap_profile.cpp + * @brief Implementation of the parser for tcmalloc heap profile data. + * @author Brad Kittenbrink + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" +#include "llallocator_heap_profile.h" + +#if LL_MSVC +// disable warning about boost::lexical_cast returning uninitialized data +// when it fails to parse the string +#pragma warning (disable:4701) +#endif + +#include <boost/algorithm/string/split.hpp> +#include <boost/bind.hpp> +#include <boost/lexical_cast.hpp> +#include <boost/range/iterator_range.hpp> + +static const std::string HEAP_PROFILE_MAGIC_STR = "heap profile:"; + +static bool is_separator(char c) +{ + return isspace(c) || c == '[' || c == ']' || c == ':'; +} + +void LLAllocatorHeapProfile::parse(std::string const & prof_text) +{ + // a typedef for handling a token in the string buffer + // it's a begin/end pair of string::const_iterators + typedef boost::iterator_range<std::string::const_iterator> range_t; + + mLines.clear(); + + if(prof_text.compare(0, HEAP_PROFILE_MAGIC_STR.length(), HEAP_PROFILE_MAGIC_STR) != 0) + { + // *TODO - determine if there should be some better error state than + // mLines being empty. -brad + llwarns << "invalid heap profile data passed into parser." << llendl; + return; + } + + std::vector< range_t > prof_lines; + + std::string::const_iterator prof_begin = prof_text.begin() + HEAP_PROFILE_MAGIC_STR.length(); + + range_t prof_range(prof_begin, prof_text.end()); + boost::algorithm::split(prof_lines, + prof_range, + boost::bind(std::equal_to<llwchar>(), '\n', _1)); + + std::vector< range_t >::const_iterator i; + for(i = prof_lines.begin(); i != prof_lines.end() && !i->empty(); ++i) + { + range_t const & line_text = *i; + + std::vector<range_t> line_elems; + + boost::algorithm::split(line_elems, + line_text, + is_separator); + + std::vector< range_t >::iterator j; + j = line_elems.begin(); + + while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens + llassert_always(j != line_elems.end()); + U32 live_count = boost::lexical_cast<U32>(*j); + ++j; + + while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens + llassert_always(j != line_elems.end()); + U64 live_size = boost::lexical_cast<U64>(*j); + ++j; + + while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens + llassert_always(j != line_elems.end()); + U32 tot_count = boost::lexical_cast<U32>(*j); + ++j; + + while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens + llassert_always(j != line_elems.end()); + U64 tot_size = boost::lexical_cast<U64>(*j); + ++j; + + while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens + llassert_always(j != line_elems.end()); + ++j; // skip the '@' + + mLines.push_back(line(live_count, live_size, tot_count, tot_size)); + line & current_line = mLines.back(); + + for(; j != line_elems.end(); ++j) + { + if(!j->empty()) { + U32 marker = boost::lexical_cast<U32>(*j); + current_line.mTrace.push_back(marker); + } + } + } + + // *TODO - parse MAPPED_LIBRARIES section here if we're ever interested in it +} + +void LLAllocatorHeapProfile::dump(std::ostream & out) const +{ + lines_t::const_iterator i; + for(i = mLines.begin(); i != mLines.end(); ++i) + { + out << i->mLiveCount << ": " << i->mLiveSize << '[' << i->mTotalCount << ": " << i->mTotalSize << "] @"; + + stack_trace::const_iterator j; + for(j = i->mTrace.begin(); j != i->mTrace.end(); ++j) + { + out << ' ' << *j; + } + out << '\n'; + } + out.flush(); +} + diff --git a/indra/llcommon/llallocator_heap_profile.h b/indra/llcommon/llallocator_heap_profile.h new file mode 100644 index 0000000000000000000000000000000000000000..19758df5441b6943a915c5763b3517219ee178c0 --- /dev/null +++ b/indra/llcommon/llallocator_heap_profile.h @@ -0,0 +1,77 @@ +/** + * @file llallocator_heap_profile.h + * @brief Declaration of the parser for tcmalloc heap profile data. + * @author Brad Kittenbrink + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLALLOCATOR_HEAP_PROFILE_H +#define LL_LLALLOCATOR_HEAP_PROFILE_H + +#include "stdtypes.h" + +#include <map> +#include <vector> + +class LLAllocatorHeapProfile +{ +public: + typedef int stack_marker; + + typedef std::vector<stack_marker> stack_trace; + + struct line { + line(U32 live_count, U64 live_size, U32 tot_count, U64 tot_size) : + mLiveSize(live_size), + mTotalSize(tot_size), + mLiveCount(live_count), + mTotalCount(tot_count) + { + } + U64 mLiveSize, mTotalSize; + U32 mLiveCount, mTotalCount; + stack_trace mTrace; + }; + + typedef std::vector<line> lines_t; + + LLAllocatorHeapProfile() + { + } + + void parse(std::string const & prof_text); + + void dump(std::ostream & out) const; + +public: + lines_t mLines; +}; + + +#endif // LL_LLALLOCATOR_HEAP_PROFILE_H diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index cf3bf89b4f7615e74d6667852d3e791f12591a38..6715b6722d33f3769ad8b10b26685766a3d081a5 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -33,145 +33,112 @@ #include "linden_common.h" #include "llassettype.h" +#include "lldictionary.h" +#include "llmemory.h" +#include "llsingleton.h" -#include "llstring.h" -#include "lltimer.h" - -// I added lookups for exact text of asset type enums in addition to the ones below, so shoot me. -Steve +///---------------------------------------------------------------------------- +/// Class LLAssetType +///---------------------------------------------------------------------------- +struct AssetEntry : public LLDictionaryEntry +{ + AssetEntry(const char *desc_name, + const char *type_name, // 8 character limit! + const char *human_name, + const char *category_name, // used by llinventorymodel when creating new categories + EDragAndDropType dad_type); + + // limited to 8 characters + const char *mTypeName; + // human readable form. Put as many printable characters you want in each one. + // (c.f. llinventory.cpp INVENTORY_TYPE_HUMAN_NAMES). + const char *mHumanName; + const char *mCategoryName; + EDragAndDropType mDadType; +}; -struct asset_info_t +class LLAssetDictionary : public LLSingleton<LLAssetDictionary>, + public LLDictionary<LLAssetType::EType, AssetEntry> { - LLAssetType::EType type; - const char* desc; +public: + LLAssetDictionary(); }; -asset_info_t asset_types[] = +LLAssetDictionary::LLAssetDictionary() { - { LLAssetType::AT_TEXTURE, "TEXTURE" }, - { LLAssetType::AT_SOUND, "SOUND" }, - { LLAssetType::AT_CALLINGCARD, "CALLINGCARD" }, - { LLAssetType::AT_LANDMARK, "LANDMARK" }, - { LLAssetType::AT_SCRIPT, "SCRIPT" }, - { LLAssetType::AT_CLOTHING, "CLOTHING" }, - { LLAssetType::AT_OBJECT, "OBJECT" }, - { LLAssetType::AT_NOTECARD, "NOTECARD" }, - { LLAssetType::AT_CATEGORY, "CATEGORY" }, - { LLAssetType::AT_ROOT_CATEGORY, "ROOT_CATEGORY" }, - { LLAssetType::AT_LSL_TEXT, "LSL_TEXT" }, - { LLAssetType::AT_LSL_BYTECODE, "LSL_BYTECODE" }, - { LLAssetType::AT_TEXTURE_TGA, "TEXTURE_TGA" }, - { LLAssetType::AT_BODYPART, "BODYPART" }, - { LLAssetType::AT_TRASH, "TRASH" }, - { LLAssetType::AT_SNAPSHOT_CATEGORY, "SNAPSHOT_CATEGORY" }, - { LLAssetType::AT_LOST_AND_FOUND, "LOST_AND_FOUND" }, - { LLAssetType::AT_SOUND_WAV, "SOUND_WAV" }, - { LLAssetType::AT_IMAGE_TGA, "IMAGE_TGA" }, - { LLAssetType::AT_IMAGE_JPEG, "IMAGE_JPEG" }, - { LLAssetType::AT_ANIMATION, "ANIMATION" }, - { LLAssetType::AT_GESTURE, "GESTURE" }, - { LLAssetType::AT_SIMSTATE, "SIMSTATE" }, - { LLAssetType::AT_NONE, "NONE" }, + addEntry(LLAssetType::AT_TEXTURE, new AssetEntry("TEXTURE", "texture", "texture", "Textures", DAD_TEXTURE)); + addEntry(LLAssetType::AT_SOUND, new AssetEntry("SOUND", "sound", "sound", "Sounds", DAD_SOUND)); + addEntry(LLAssetType::AT_CALLINGCARD, new AssetEntry("CALLINGCARD", "callcard", "calling card", "Calling Cards", DAD_CALLINGCARD)); + addEntry(LLAssetType::AT_LANDMARK, new AssetEntry("LANDMARK", "landmark", "landmark", "Landmarks", DAD_LANDMARK)); + addEntry(LLAssetType::AT_SCRIPT, new AssetEntry("SCRIPT", "script", "legacy script", "Scripts", DAD_NONE)); + addEntry(LLAssetType::AT_CLOTHING, new AssetEntry("CLOTHING", "clothing", "clothing", "Clothing", DAD_CLOTHING)); + addEntry(LLAssetType::AT_OBJECT, new AssetEntry("OBJECT", "object", "object", "Objects", DAD_OBJECT)); + addEntry(LLAssetType::AT_NOTECARD, new AssetEntry("NOTECARD", "notecard", "note card", "Notecards", DAD_NOTECARD)); + addEntry(LLAssetType::AT_CATEGORY, new AssetEntry("CATEGORY", "category", "folder", "New Folder", DAD_CATEGORY)); + addEntry(LLAssetType::AT_ROOT_CATEGORY, new AssetEntry("ROOT_CATEGORY", "root", "root", "Inventory", DAD_ROOT_CATEGORY)); + addEntry(LLAssetType::AT_LSL_TEXT, new AssetEntry("LSL_TEXT", "lsltext", "lsl2 script", "Scripts", DAD_SCRIPT)); + addEntry(LLAssetType::AT_LSL_BYTECODE, new AssetEntry("LSL_BYTECODE", "lslbyte", "lsl bytecode", "Scripts", DAD_NONE)); + addEntry(LLAssetType::AT_TEXTURE_TGA, new AssetEntry("TEXTURE_TGA", "txtr_tga", "tga texture", "Uncompressed Images", DAD_NONE)); + addEntry(LLAssetType::AT_BODYPART, new AssetEntry("BODYPART", "bodypart", "body part", "Body Parts", DAD_BODYPART)); + addEntry(LLAssetType::AT_TRASH, new AssetEntry("TRASH", "trash", "trash", "Trash", DAD_NONE)); + addEntry(LLAssetType::AT_SNAPSHOT_CATEGORY, new AssetEntry("SNAPSHOT_CATEGORY", "snapshot", "snapshot", "Photo Album", DAD_NONE)); + addEntry(LLAssetType::AT_LOST_AND_FOUND, new AssetEntry("LOST_AND_FOUND", "lstndfnd", "lost and found", "Lost And Found", DAD_NONE)); + addEntry(LLAssetType::AT_SOUND_WAV, new AssetEntry("SOUND_WAV", "snd_wav", "sound", "Uncompressed Sounds", DAD_NONE)); + addEntry(LLAssetType::AT_IMAGE_TGA, new AssetEntry("IMAGE_TGA", "img_tga", "targa image", "Uncompressed Images", DAD_NONE)); + addEntry(LLAssetType::AT_IMAGE_JPEG, new AssetEntry("IMAGE_JPEG", "jpeg", "jpeg image", "Uncompressed Images", DAD_NONE)); + addEntry(LLAssetType::AT_ANIMATION, new AssetEntry("ANIMATION", "animatn", "animation", "Animations", DAD_ANIMATION)); + addEntry(LLAssetType::AT_GESTURE, new AssetEntry("GESTURE", "gesture", "gesture", "Gestures", DAD_GESTURE)); + addEntry(LLAssetType::AT_SIMSTATE, new AssetEntry("SIMSTATE", "simstate", "simstate", "New Folder", DAD_NONE)); + addEntry(LLAssetType::AT_LINK, new AssetEntry("LINK", "link", "symbolic link", "New Folder", DAD_NONE)); + addEntry(LLAssetType::AT_FAVORITE, new AssetEntry("FAVORITE", "favorite", "favorite", "favorite", DAD_NONE)); + addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", NULL, "New Folder", DAD_NONE)); }; -LLAssetType::EType LLAssetType::getType(const std::string& sin) +AssetEntry::AssetEntry(const char *desc_name, + const char *type_name, + const char *human_name, + const char *category_name, + EDragAndDropType dad_type) : + LLDictionaryEntry(desc_name), + mTypeName(type_name), + mHumanName(human_name), + mCategoryName(category_name), + mDadType(dad_type) { - std::string s = sin; - LLStringUtil::toUpper(s); - for (S32 idx = 0; ;idx++) - { - asset_info_t* info = asset_types + idx; - if (info->type == LLAssetType::AT_NONE) - break; - if (s == info->desc) - return info->type; - } - return LLAssetType::AT_NONE; + llassert(strlen(mTypeName) <= 8); } -std::string LLAssetType::getDesc(LLAssetType::EType type) +// static +LLAssetType::EType LLAssetType::getType(const std::string& desc_name) { - for (S32 idx = 0; ;idx++) - { - asset_info_t* info = asset_types + idx; - if (type == info->type) - return info->desc; - if (info->type == LLAssetType::AT_NONE) - break; - } - return "BAD TYPE"; + std::string s = desc_name; + LLStringUtil::toUpper(s); + return LLAssetDictionary::getInstance()->lookup(s); } -//============================================================================ - -// The asset type names are limited to 8 characters. // static -const char* LLAssetType::mAssetTypeNames[LLAssetType::AT_COUNT] = -{ - "texture", - "sound", - "callcard", - "landmark", - "script", - "clothing", - "object", - "notecard", - "category", - "root", - "lsltext", - "lslbyte", - "txtr_tga",// Intentionally spelled this way. Limited to eight characters. - "bodypart", - "trash", - "snapshot", - "lstndfnd", - "snd_wav", - "img_tga", - "jpeg", - "animatn", - "gesture", - "simstate" -}; - -// This table is meant for decoding to human readable form. Put any -// and as many printable characters you want in each one. -// See also llinventory.cpp INVENTORY_TYPE_HUMAN_NAMES -const char* LLAssetType::mAssetTypeHumanNames[LLAssetType::AT_COUNT] = +const std::string &LLAssetType::getDesc(LLAssetType::EType asset_type) +{ + const AssetEntry *entry = LLAssetDictionary::getInstance()->lookup(asset_type); + if (entry) { - "texture", - "sound", - "calling card", - "landmark", - "legacy script", - "clothing", - "object", - "note card", - "folder", - "root", - "lsl2 script", - "lsl bytecode", - "tga texture", - "body part", - "trash", - "snapshot", - "lost and found", - "sound", - "targa image", - "jpeg image", - "animation", - "gesture", - "simstate" -}; - -///---------------------------------------------------------------------------- -/// class LLAssetType -///---------------------------------------------------------------------------- + return entry->mName; + } + else + { + static const std::string error_string = "BAD TYPE"; + return error_string; + } +} // static -const char* LLAssetType::lookup( LLAssetType::EType type ) +const char *LLAssetType::lookup(LLAssetType::EType asset_type) { - if( (type >= 0) && (type < AT_COUNT )) + const LLAssetDictionary *dict = LLAssetDictionary::getInstance(); + const AssetEntry *entry = dict->lookup(asset_type); + if (entry) { - return mAssetTypeNames[ S32( type ) ]; + return entry->mTypeName; } else { @@ -185,25 +152,30 @@ LLAssetType::EType LLAssetType::lookup( const char* name ) return lookup(ll_safe_string(name)); } -LLAssetType::EType LLAssetType::lookup( const std::string& name ) +LLAssetType::EType LLAssetType::lookup(const std::string& type_name) { - for( S32 i = 0; i < AT_COUNT; i++ ) + const LLAssetDictionary *dict = LLAssetDictionary::getInstance(); + for (LLAssetDictionary::const_iterator iter = dict->begin(); + iter != dict->end(); + iter++) { - if( name == mAssetTypeNames[i] ) + const AssetEntry *entry = iter->second; + if (type_name == entry->mTypeName) { - // match - return (EType)i; + return iter->first; } } return AT_NONE; } // static -const char* LLAssetType::lookupHumanReadable(LLAssetType::EType type) +const char *LLAssetType::lookupHumanReadable(LLAssetType::EType asset_type) { - if( (type >= 0) && (type < AT_COUNT )) + const LLAssetDictionary *dict = LLAssetDictionary::getInstance(); + const AssetEntry *entry = dict->lookup(asset_type); + if (entry) { - return mAssetTypeHumanNames[S32(type)]; + return entry->mHumanName; } else { @@ -217,44 +189,51 @@ LLAssetType::EType LLAssetType::lookupHumanReadable( const char* name ) return lookupHumanReadable(ll_safe_string(name)); } -LLAssetType::EType LLAssetType::lookupHumanReadable( const std::string& name ) +LLAssetType::EType LLAssetType::lookupHumanReadable(const std::string& readable_name) { - for( S32 i = 0; i < AT_COUNT; i++ ) + const LLAssetDictionary *dict = LLAssetDictionary::getInstance(); + for (LLAssetDictionary::const_iterator iter = dict->begin(); + iter != dict->end(); + iter++) { - if( name == mAssetTypeHumanNames[i] ) + const AssetEntry *entry = iter->second; + if (readable_name == entry->mHumanName) { - // match - return (EType)i; + return iter->first; } } return AT_NONE; } -EDragAndDropType LLAssetType::lookupDragAndDropType( EType asset ) +// static +const char *LLAssetType::lookupCategoryName(LLAssetType::EType asset_type) { - switch( asset ) + const LLAssetDictionary *dict = LLAssetDictionary::getInstance(); + const AssetEntry *entry = dict->lookup(asset_type); + if (entry) { - case AT_TEXTURE: return DAD_TEXTURE; - case AT_SOUND: return DAD_SOUND; - case AT_CALLINGCARD: return DAD_CALLINGCARD; - case AT_LANDMARK: return DAD_LANDMARK; - case AT_SCRIPT: return DAD_NONE; - case AT_CLOTHING: return DAD_CLOTHING; - case AT_OBJECT: return DAD_OBJECT; - case AT_NOTECARD: return DAD_NOTECARD; - case AT_CATEGORY: return DAD_CATEGORY; - case AT_ROOT_CATEGORY: return DAD_ROOT_CATEGORY; - case AT_LSL_TEXT: return DAD_SCRIPT; - case AT_BODYPART: return DAD_BODYPART; - case AT_ANIMATION: return DAD_ANIMATION; - case AT_GESTURE: return DAD_GESTURE; - default: return DAD_NONE; - }; + return entry->mCategoryName; + } + else + { + return "New Folder"; + } +} + +// static +EDragAndDropType LLAssetType::lookupDragAndDropType(EType asset_type) +{ + const LLAssetDictionary *dict = LLAssetDictionary::getInstance(); + const AssetEntry *entry = dict->lookup(asset_type); + if (entry) + return entry->mDadType; + else + return DAD_NONE; } // static. Generate a good default description -void LLAssetType::generateDescriptionFor(LLAssetType::EType type, - std::string& desc) +void LLAssetType::generateDescriptionFor(LLAssetType::EType asset_type, + std::string& description) { const S32 BUF_SIZE = 30; char time_str[BUF_SIZE]; /* Flawfinder: ignore */ @@ -262,6 +241,6 @@ void LLAssetType::generateDescriptionFor(LLAssetType::EType type, time(&now); memset(time_str, '\0', BUF_SIZE); strftime(time_str, BUF_SIZE - 1, "%Y-%m-%d %H:%M:%S ", localtime(&now)); - desc.assign(time_str); - desc.append(LLAssetType::lookupHumanReadable(type)); + description.assign(time_str); + description.append(LLAssetType::lookupHumanReadable(asset_type)); } diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h index 4077b8d2c1bbc211f9247f21b00c693358b78b48..2f5403168810cd3045587e15f90b01f955d5587e 100644 --- a/indra/llcommon/llassettype.h +++ b/indra/llcommon/llassettype.h @@ -30,8 +30,8 @@ * $/LicenseInfo$ */ -#ifndef LL_LLASSETTYPE -#define LL_LLASSETTYPE +#ifndef LL_LLASSETTYPE_H +#define LL_LLASSETTYPE_H #include <string> @@ -42,137 +42,142 @@ class LLAssetType public: enum EType { - // Used for painting the faces of geometry. - // Stored in typical j2c stream format AT_TEXTURE = 0, + // Used for painting the faces of geometry. + // Stored in typical j2c stream format. - // Used to fill the aural spectrum. AT_SOUND = 1, + // Used to fill the aural spectrum. - // Links instant message access to the user on the card. eg, a - // card for yourself, a card for linden support, a card for - // the guy you were talking to in the coliseum. AT_CALLINGCARD = 2, + // Links instant message access to the user on the card. + // : E.G. A card for yourself, for linden support, for + // : the guy you were talking to in the coliseum. - // Links to places in the world with location and a screen - // shot or image saved. eg, home, linden headquarters, the - // coliseum, or destinations where we want to increase - // traffic. AT_LANDMARK = 3, + // Links to places in the world with location and a screen shot or image saved. + // : E.G. Home, linden headquarters, the coliseum, destinations where + // : we want to increase traffic. - // Valid scripts that can be attached to an object. eg. open a - // door, jump into the air. AT_SCRIPT = 4, + // Valid scripts that can be attached to an object. + // : E.G. Open a door, jump into the air. - // A collection of textures and parameters that can be worn - // by an avatar. AT_CLOTHING = 5, + // A collection of textures and parameters that can be worn by an avatar. - // Any combination of textures, sounds, and scripts that are - // associated with a fixed piece of geometry. eg, a hot tub, a - // house with working door. AT_OBJECT = 6, + // Any combination of textures, sounds, and scripts that are + // associated with a fixed piece of geometry. + // : E.G. A hot tub, a house with working door. - // Just text AT_NOTECARD = 7, + // Just text. - // A category holds a collection of inventory items. It's - // treated as an item in the inventory, and therefore needs a - // type. AT_CATEGORY = 8, + // Holds a collection of inventory items. + // It's treated as an item in the inventory and therefore needs a type. - // A root category is a user's root inventory category. We - // decided to expose it visually, so it seems logical to fold - // it into the asset types. AT_ROOT_CATEGORY = 9, + // A user's root inventory category. + // We decided to expose it visually, so it seems logical to fold + // it into the asset types. - // The LSL is the brand spanking new scripting language. We've - // split it into a text and bytecode representation. AT_LSL_TEXT = 10, AT_LSL_BYTECODE = 11, + // The LSL is the scripting language. + // We've split it into a text and bytecode representation. - // uncompressed TGA texture AT_TEXTURE_TGA = 12, + // Uncompressed TGA texture. - // A collection of textures and parameters that can be worn - // by an avatar. AT_BODYPART = 13, + // A collection of textures and parameters that can be worn by an avatar. - // This asset type is meant to only be used as a marker for a - // category preferred type. Using this, we can throw things in - // the trash before completely deleting. AT_TRASH = 14, + // Only to be used as a marker for a category preferred type. + // Using this, we can throw things in the trash before completely deleting. - // This is a marker for a folder meant for snapshots. No - // actual assets will be snapshots, though if there were, you - // could interpret them as textures. AT_SNAPSHOT_CATEGORY = 15, + // A marker for a folder meant for snapshots. + // No actual assets will be snapshots, though if there were, you + // could interpret them as textures. - // This is used to stuff lost&found items into AT_LOST_AND_FOUND = 16, + // Used to stuff lost&found items into. - // uncompressed sound AT_SOUND_WAV = 17, + // Uncompressed sound. - // uncompressed image, non-square, and not appropriate for use - // as a texture. AT_IMAGE_TGA = 18, + // Uncompressed image, non-square. + // Not appropriate for use as a texture. - // compressed image, non-square, and not appropriate for use - // as a texture. AT_IMAGE_JPEG = 19, + // Compressed image, non-square. + // Not appropriate for use as a texture. - // animation AT_ANIMATION = 20, + // Animation. - // gesture, sequence of animations, sounds, chat, wait steps AT_GESTURE = 21, + // Gesture, sequence of animations, sounds, chat, wait steps. - // simstate file AT_SIMSTATE = 22, + // Simstate file. + + AT_LINK = 23, + // Inventory symbolic link + + AT_FAVORITE = 24, + // favorite items // +*********************************************+ // | TO ADD AN ELEMENT TO THIS ENUM: | - // +*********************************************+ + // +************************************************+ // | 1. INSERT BEFORE AT_COUNT | // | 2. INCREMENT AT_COUNT BY 1 | // | 3. ADD TO LLAssetType::mAssetTypeNames | // | 4. ADD TO LLAssetType::mAssetTypeHumanNames | // +*********************************************+ - AT_COUNT = 23, + AT_COUNT = 25, AT_NONE = -1 }; // machine transation between type and strings static EType lookup(const char* name); // safe conversion to std::string, *TODO: deprecate - static EType lookup(const std::string& name); - static const char* lookup(EType type); + static EType lookup(const std::string& type_name); + static const char* lookup(EType asset_type); // translation from a type to a human readable form. - static EType lookupHumanReadable( const char* name ); // safe conversion to std::string, *TODO: deprecate - static EType lookupHumanReadable( const std::string& name ); - static const char* lookupHumanReadable(EType type); + static EType lookupHumanReadable(const char* desc_name); // safe conversion to std::string, *TODO: deprecate + static EType lookupHumanReadable(const std::string& readable_name); + static const char* lookupHumanReadable(EType asset_type); - static EDragAndDropType lookupDragAndDropType( EType ); + static const char* lookupCategoryName(EType asset_type); // Generate a good default description. You may want to add a verb // or agent name after this depending on your application. - static void generateDescriptionFor(LLAssetType::EType type, - std::string& desc); - - static EType getType(const std::string& sin); - static std::string getDesc(EType type); + static void generateDescriptionFor(LLAssetType::EType asset_type, + std::string& description); + + static EType getType(const std::string& desc_name); + static const std::string& getDesc(EType asset_type); + static EDragAndDropType lookupDragAndDropType(EType asset_type); + + /* TODO: Change return types from "const char *" to "const std::string &". + This is fairly straightforward, but requires changing some calls to use .c_str(). + e.g.: + - fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType)); + + fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType).c_str()); + */ private: // don't instantiate or derive one of these objects - LLAssetType( void ) {} - ~LLAssetType( void ) {} - -private: - static const char* mAssetTypeNames[]; - static const char* mAssetTypeHumanNames[]; + LLAssetType() {} + ~LLAssetType() {} }; -#endif // LL_LLASSETTYPE +#endif // LL_LLASSETTYPE_H diff --git a/indra/llcommon/llboost.h b/indra/llcommon/llboost.h index 4df9dbf3bd5ad4377ba11ec340228d70f0e56c3b..f4bfc2bfa29a8ec1dca557d1f4269234a972a1b8 100644 --- a/indra/llcommon/llboost.h +++ b/indra/llcommon/llboost.h @@ -46,4 +46,19 @@ */ typedef boost::tokenizer<boost::char_separator<char> > boost_tokenizer; +// Useful combiner for boost signals that retturn a vool (e.g. validation) +// returns false if any of the callbacks return false +struct boost_boolean_combiner +{ + typedef bool result_type; + template<typename InputIterator> + bool operator()(InputIterator first, InputIterator last) const + { + bool res = true; + while (first != last) + res &= *first++; + return res; + } +}; + #endif // LL_LLBOOST_H diff --git a/indra/llcommon/llcommon.cpp b/indra/llcommon/llcommon.cpp index 2cbb71855fb2a37db6d782a6d6cdc23f8161ee32..36a0018995a84597324f1543b363d64ccc12101c 100644 --- a/indra/llcommon/llcommon.cpp +++ b/indra/llcommon/llcommon.cpp @@ -32,6 +32,8 @@ #include "linden_common.h" #include "llcommon.h" + +#include "llmemory.h" #include "llthread.h" //static diff --git a/indra/llcommon/llcommon.h b/indra/llcommon/llcommon.h index 5f77988336c42d8fb48568d56c936ea01b6687ba..a1808e8a6c2dc54b535f93952a37f7de01862778 100644 --- a/indra/llcommon/llcommon.h +++ b/indra/llcommon/llcommon.h @@ -32,9 +32,8 @@ #ifndef LL_COMMON_H #define LL_COMMON_H -#include "llmemory.h" +// *TODO: remove these? #include "llapr.h" -// #include "llframecallbackmanager.h" #include "lltimer.h" #include "llfile.h" diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index 41a3af398fe9d81e570f6e86124f309dad3c1278..7bc9e16bc98dd4556e7365df2684b34d0cefe908 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -38,10 +38,13 @@ #include "apr_time.h" #include <time.h> +#include <locale> +#include <string> #include <iomanip> #include <sstream> #include "lltimer.h" +#include "llstring.h" static const F64 DATE_EPOCH = 0.0; @@ -88,45 +91,36 @@ std::string LLDate::asString() const // is one of the standards used and the prefered format std::string LLDate::asRFC1123() const { - std::ostringstream stream; - toHTTPDateStream(stream); - return stream.str(); + return toHTTPDateString (std::string ("%A, %d %b %Y %H:%M:%S GMT")); } -void LLDate::toHTTPDateStream(std::ostream& s) const +std::string LLDate::toHTTPDateString (std::string fmt) const { - // http://apr.apache.org/docs/apr/0.9/group__apr__time.html - apr_time_t time = (apr_time_t)(mSecondsSinceEpoch * LL_APR_USEC_PER_SEC); + std::ostringstream stream; + time_t locSeconds = (time_t) mSecondsSinceEpoch; + struct tm * gmt = gmtime (&locSeconds); - apr_time_exp_t exp_time ; //Apache time module + stream.imbue (std::locale(LLStringUtil::getLocale().c_str())); + toHTTPDateStream (stream, gmt, fmt); + return stream.str(); +} - if (apr_time_exp_gmt(&exp_time, time) != APR_SUCCESS) - { - // Return Epoch UTC date - s << "Thursday, 01 Jan 1970 00:00:00 GMT" ; - return; - } +std::string LLDate::toHTTPDateString (tm * gmt, std::string fmt) +{ + std::ostringstream stream; + stream.imbue (std::locale(LLStringUtil::getLocale().c_str())); + toHTTPDateStream (stream, gmt, fmt); + return stream.str(); +} - s << std::dec << std::setfill('0'); -#if( LL_WINDOWS || __GNUC__ > 2) - s << std::right ; -#else - s.setf(ios::right); -#endif - std::string day = weekdays[exp_time.tm_wday]; - std::string month = months[exp_time.tm_mon]; - - s << std::setw(day.length()) << (day) - << ", " << std::setw(2) << (exp_time.tm_mday) - << ' ' << std::setw(month.length()) << (month) - << ' ' << std::setw(4) << (exp_time.tm_year + 1900) - << ' ' << std::setw(2) << (exp_time.tm_hour) - << ':' << std::setw(2) << (exp_time.tm_min) - << ':' << std::setw(2) << (exp_time.tm_sec) - << " GMT"; +void LLDate::toHTTPDateStream(std::ostream& s, tm * gmt, std::string fmt) +{ + using namespace std; - // RFC 1123 date does not use microseconds - //llinfos << "Date in RFC 1123 format is " << s << llendl; + const char * pBeg = fmt.c_str(); + const char * pEnd = pBeg + fmt.length(); + const time_put<char>& tp = use_facet<time_put<char> >(s.getloc()); + tp.put (s, s, s.fill(), gmt, pBeg, pEnd); } void LLDate::toStream(std::ostream& s) const diff --git a/indra/llcommon/lldate.h b/indra/llcommon/lldate.h index 7cc9c8aceb39956d7910e100433a50440004ad76..23d3b900f8c3fd66e5b7a08e6d7b66429cac8e9e 100644 --- a/indra/llcommon/lldate.h +++ b/indra/llcommon/lldate.h @@ -84,7 +84,9 @@ public: std::string asString() const; std::string asRFC1123() const; void toStream(std::ostream&) const; - void toHTTPDateStream(std::ostream&) const; + std::string toHTTPDateString (std::string fmt) const; + static std::string toHTTPDateString (tm * gmt, std::string fmt); + static void toHTTPDateStream(std::ostream&, tm *, std::string); /** * @brief Set the date from an ISO-8601 string. * diff --git a/indra/llcommon/lldeleteutils.h b/indra/llcommon/lldeleteutils.h new file mode 100644 index 0000000000000000000000000000000000000000..d6a0945e4680fb6a48f6a7b7b4e30fd60cf24b42 --- /dev/null +++ b/indra/llcommon/lldeleteutils.h @@ -0,0 +1,53 @@ +/** + * @file lldeleteutils.h + * @brief Utility functions to simplify some common pointer-munging idioms. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LL_DELETE_UTILS_H +#define LL_DELETE_UTILS_H + +// Simple utility functions to eventually replace the common 2-line +// idiom scattered throughout the viewer codebase. Note that where +// possible we would rather be using smart pointers of some sort. + +template <class T> +inline void deleteAndClear(T*& ptr) +{ + delete ptr; + ptr = NULL; +} + +template <class T> +inline void deleteAndClearArray(T*& array_ptr) +{ + delete[] array_ptr; + array_ptr = NULL; +} + +#endif diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h new file mode 100644 index 0000000000000000000000000000000000000000..856947def80ddfe89983aba2d6b375f81c7c1398 --- /dev/null +++ b/indra/llcommon/lldictionary.h @@ -0,0 +1,102 @@ +/** + * @file lldictionary.h + * @brief Lldictionary class header file + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLDICTIONARY_H +#define LL_LLDICTIONARY_H + +#include <map> + +struct LLDictionaryEntry +{ + LLDictionaryEntry(const std::string &name) : + mName(name) + { + mNameCapitalized = mName; + LLStringUtil::replaceChar(mNameCapitalized, '-', ' '); + LLStringUtil::replaceChar(mNameCapitalized, '_', ' '); + for (U32 i=0; i < mNameCapitalized.size(); i++) + { + if (i == 0 || mNameCapitalized[i-1] == ' ') // don't change ordering of this statement or crash + { + mNameCapitalized[i] = toupper(mNameCapitalized[i]); + } + } + } + virtual ~LLDictionaryEntry() {} + const std::string mName; + std::string mNameCapitalized; +}; + +template <class Index, class Entry> +class LLDictionary : public std::map<Index, Entry *> +{ +public: + typedef std::map<Index, Entry *> map_t; + typedef typename map_t::iterator iterator_t; + typedef typename map_t::const_iterator const_iterator_t; + + LLDictionary() {} + virtual ~LLDictionary() + { + for (iterator_t iter = map_t::begin(); iter != map_t::end(); ++iter) + delete (iter->second); + } + + const Entry *lookup(Index index) const + { + const_iterator_t dictionary_iter = map_t::find(index); + if (dictionary_iter == map_t::end()) return NULL; + return dictionary_iter->second; + } + const Index lookup(const std::string &name) const + { + for (const_iterator_t dictionary_iter = map_t::begin(); + dictionary_iter != map_t::end(); + dictionary_iter++) + { + const Entry *entry = dictionary_iter->second; + if (entry->mName == name) + { + return dictionary_iter->first; + } + } + llassert(false); + return Index(-1); + } + +protected: + void addEntry(Index index, Entry *entry) + { + (*this)[index] = entry; + } +}; + +#endif // LL_LLDICTIONARY_H diff --git a/indra/llcommon/lldoubledispatch.h b/indra/llcommon/lldoubledispatch.h new file mode 100755 index 0000000000000000000000000000000000000000..60678d44fb3864beeea1fafda283211921c9ca46 --- /dev/null +++ b/indra/llcommon/lldoubledispatch.h @@ -0,0 +1,332 @@ +/** + * @file lldoubledispatch.h + * @author Nat Goodspeed + * @date 2008-11-11 + * @brief function calls virtual on more than one parameter + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#if ! defined(LL_LLDOUBLEDISPATCH_H) +#define LL_LLDOUBLEDISPATCH_H + +#include <list> +#include <boost/shared_ptr.hpp> +#include <boost/function.hpp> +#include <boost/bind.hpp> +#include <boost/ref.hpp> + +/** + * This class supports function calls which are virtual on the dynamic type of + * more than one parameter. Specifically, we address a limited but useful + * subset of that problem: function calls which accept two parameters, and + * select which particular function to call depending on the dynamic type of + * both. + * + * Scott Meyers, in More Effective C++ (Item 31), talks about some of the perils + * and pitfalls lurking down this pathway. He discusses and dismisses the + * straightforward approaches of using single-dispatch virtual functions twice, + * and of using a family of single-dispatch virtual functions which each examine + * RTTI for their other parameter. He advocates using a registry in which you + * look up the actual types of both parameters (he uses the classes' string names, + * via typeid(param).name()) to obtain a pointer to a free (non-member) function + * that will accept this pair of parameters. + * + * He does point out that his approach doesn't handle inheritance. If you have a + * registry entry for SpaceShip, and you have in hand a MilitaryShip (subclass of + * SpaceShip) and an Asteroid, you'd like to call the function appropriate for + * SpaceShips and Asteroids -- but alas, his lookup fails because the class name + * for your MilitaryShip subclass isn't in the registry. + * + * This class extends his idea to build a registry whose entries can examine the + * dynamic type of the parameter in a more flexible way -- using dynamic_cast<> + * -- thereby supporting inheritance relationships. + * + * Of course we must allow for the ambiguity this permits. We choose to use a + * sequence container rather than a map, and require that the client code + * specify the order in which dispatch-table entries should be searched. The + * result resembles the semantics of the catch clauses for a try/catch block: + * you must code catch clauses in decreasing order of specificity, because if + * you catch ErrorBaseClass before you catch ErrorSubclass, then any + * ErrorSubclass exceptions thrown by the protected code will always match + * ErrorBaseClass, and you will never reach your catch(ErrorSubclass) clause. + * + * So, in a similar way, if you have a specific routine to process + * MilitaryShip and Asteroid, you'd better place that in the table @em before + * your more general routine that processes SpaceShip and Asteroid, or else + * the MilitaryShip variant will never be called. + * + * @todo This implementation doesn't attempt to deal with + * <tt>const</tt>-correctness of arguments. Our container stores templated + * objects into which the specific parameter types have been "frozen." But to + * store all these in the same container, they are all instances of a base + * class with a virtual invocation method. Naturally the base-class virtual + * method definition cannot know the <tt>const</tt>-ness of the particular + * types with which its template subclass is instantiated. + * + * One is tempted to suggest four different virtual methods, one for each + * combination of @c const and non-<tt>const</tt> arguments. Then the client + * will select the particular virtual method that best fits the + * <tt>const</tt>-ness of the arguments in hand. The trouble with that idea is + * that in order to instantiate the subclass instance, we must compile all + * four of its virtual method overrides, which means we must be prepared to + * pass all four combinations of @c const and non-<tt>const</tt> arguments to + * the registered callable. That only works when the registered callable + * accepts both parameters as @c const. + * + * Of course the virtual method overrides could use @c const_cast to force + * them to compile correctly regardless of the <tt>const</tt>-ness of the + * registered callable's parameter declarations. But if we're going to force + * the issue with @c const_cast anyway, why bother with the four different + * virtual methods? Why not just require canonical parameter + * <tt>const</tt>-ness for any callables used with this mechanism? + * + * We therefore require that your callable accept both params as + * non-<tt>const</tt>. (This is more general than @c const: you can perform @c + * const operations on a non-<tt>const</tt> parameter, but you can't perform + * non-<tt>const</tt> operations on a @c const parameter.) + * + * For ease of use, though, our invocation method accepts both params as @c + * const. Again, you can pass a non-<tt>const</tt> object to a @c const param, + * but not the other way around. We take care of the @c const_cast for you. + */ +// LLDoubleDispatch is a template because we have to assume that all parameter +// types are subclasses of some common base class -- but we don't have to +// impose that base class on client code. Instead, we let IT tell US the +// common parameter base class. +template<class ReturnType, class ParamBaseType> +class LLDoubleDispatch +{ + typedef LLDoubleDispatch<ReturnType, ParamBaseType> self_type; + +public: + LLDoubleDispatch() {} + + /** + * Call the first matching entry. If there's no registered Functor + * appropriate for this pair of parameter types, this call will do + * @em nothing! (If you want notification in this case, simply add a new + * Functor for (ParamBaseType&, ParamBaseType&) at the end of the table. + * The two base-class entries should match anything that isn't matched by + * any more specific entry.) + * + * See note in class documentation about <tt>const</tt>-correctness. + */ + inline + ReturnType operator()(const ParamBaseType& param1, const ParamBaseType& param2) const; + + // Borrow a trick from Alexandrescu: use a Type class to "wrap" a type + // for purposes of passing the type itself into a template method. + template<typename T> + struct Type {}; + + /** + * Add a new Entry for a given @a Functor. As mentioned above, the order + * in which you add these entries is very important. + * + * If you want symmetrical entries -- that is, if a B and an A can call + * the same Functor as an A and a B -- then pass @c true for the last + * parameter, and we'll add a (B, A) entry as well as an (A, B) entry. But + * your @a Functor can still be written to expect exactly the pair of types + * you've explicitly specified, because the Entry with the reversed params + * will call a special thunk that swaps params before calling your @a + * Functor. + */ + template<typename Type1, typename Type2, class Functor> + void add(const Type<Type1>& t1, const Type<Type2>& t2, Functor func, bool symmetrical=false) + { + insert(t1, t2, func); + if (symmetrical) + { + // Use boost::bind() to construct a param-swapping thunk. Don't + // forget to reverse the parameters too. + insert(t2, t1, boost::bind(func, _2, _1)); + } + } + + /** + * Add a new Entry for a given @a Functor, explicitly passing instances of + * the Functor's leaf param types to help us figure out where to insert. + * Because it can use RTTI, this add() method isn't order-sensitive like + * the other one. + * + * If you want symmetrical entries -- that is, if a B and an A can call + * the same Functor as an A and a B -- then pass @c true for the last + * parameter, and we'll add a (B, A) entry as well as an (A, B) entry. But + * your @a Functor can still be written to expect exactly the pair of types + * you've explicitly specified, because the Entry with the reversed params + * will call a special thunk that swaps params before calling your @a + * Functor. + */ + template <typename Type1, typename Type2, class Functor> + void add(const Type1& prototype1, const Type2& prototype2, Functor func, bool symmetrical=false) + { + // Because we expect our caller to pass leaf param types, we can just + // perform an ordinary search to find the first matching iterator. If + // we find an existing Entry that matches both params, either the + // param types are the same, or the existing Entry uses the base class + // for one or both params, and the new Entry must precede that. Assume + // our client won't register two callables with exactly the SAME set + // of types; in that case we'll insert the new one before any earlier + // ones, meaning the last one registered will "win." Note that if + // find() doesn't find any matching Entry, it will return end(), + // meaning the new Entry will be last, which is fine. + typename DispatchTable::iterator insertion = find(prototype1, prototype2); + insert(Type<Type1>(), Type<Type2>(), func, insertion); + if (symmetrical) + { + insert(Type<Type2>(), Type<Type1>(), boost::bind(func, _2, _1), insertion); + } + } + + /** + * Add a new Entry for a given @a Functor, specifying the Functor's leaf + * param types as explicit template arguments. This will instantiate + * temporary objects of each of these types, which requires that they have + * a lightweight default constructor. + * + * If you want symmetrical entries -- that is, if a B and an A can call + * the same Functor as an A and a B -- then pass @c true for the last + * parameter, and we'll add a (B, A) entry as well as an (A, B) entry. But + * your @a Functor can still be written to expect exactly the pair of types + * you've explicitly specified, because the Entry with the reversed params + * will call a special thunk that swaps params before calling your @a + * Functor. + */ + template <typename Type1, typename Type2, class Functor> + void add(Functor func, bool symmetrical=false) + { + // This is a convenience wrapper for the add() variant taking explicit + // instances. + add(Type1(), Type2(), func, symmetrical); + } + +private: + /// This is the base class for each entry in our dispatch table. + struct EntryBase + { + virtual ~EntryBase() {} + virtual bool matches(const ParamBaseType& param1, const ParamBaseType& param2) const = 0; + virtual ReturnType operator()(ParamBaseType& param1, ParamBaseType& param2) const = 0; + }; + + /// Here's the template subclass that actually creates each entry. + template<typename Type1, typename Type2, class Functor> + class Entry: public EntryBase + { + public: + Entry(Functor func): mFunc(func) {} + /// Is this entry appropriate for these arguments? + virtual bool matches(const ParamBaseType& param1, const ParamBaseType& param2) const + { + return (dynamic_cast<const Type1*>(¶m1) && + dynamic_cast<const Type2*>(¶m2)); + } + /// invocation + virtual ReturnType operator()(ParamBaseType& param1, ParamBaseType& param2) const + { + // We perform the downcast so callable can accept leaf param + // types, instead of accepting ParamBaseType and downcasting + // explicitly. + return mFunc(dynamic_cast<Type1&>(param1), dynamic_cast<Type2&>(param2)); + } + private: + /// Bind whatever function or function object the instantiator passed. + Functor mFunc; + }; + + /// shared_ptr manages Entry lifespan for us + typedef boost::shared_ptr<EntryBase> EntryPtr; + /// use a @c list to make it easy to insert + typedef std::list<EntryPtr> DispatchTable; + DispatchTable mDispatch; + + /// Look up the location of the first matching entry. + typename DispatchTable::const_iterator find(const ParamBaseType& param1, const ParamBaseType& param2) const + { + // We assert that it's safe to call the non-const find() method on a + // const LLDoubleDispatch instance. Cast away the const-ness of 'this'. + return const_cast<self_type*>(this)->find(param1, param2); + } + + /// Look up the location of the first matching entry. + typename DispatchTable::iterator find(const ParamBaseType& param1, const ParamBaseType& param2) + { + return std::find_if(mDispatch.begin(), mDispatch.end(), + boost::bind(&EntryBase::matches, _1, + boost::ref(param1), boost::ref(param2))); + } + + /// Look up the first matching entry. + EntryPtr lookup(const ParamBaseType& param1, const ParamBaseType& param2) const + { + typename DispatchTable::const_iterator found = find(param1, param2); + if (found != mDispatch.end()) + { + // Dereferencing the list iterator gets us an EntryPtr + return *found; + } + // not found + return EntryPtr(); + } + + // Break out the actual insert operation so the public add() template + // function can avoid calling itself recursively. See add() comments. + template<typename Type1, typename Type2, class Functor> + void insert(const Type<Type1>& param1, const Type<Type2>& param2, Functor func) + { + insert(param1, param2, func, mDispatch.end()); + } + + // Break out the actual insert operation so the public add() template + // function can avoid calling itself recursively. See add() comments. + template<typename Type1, typename Type2, class Functor> + void insert(const Type<Type1>&, const Type<Type2>&, Functor func, + typename DispatchTable::iterator where) + { + mDispatch.insert(where, EntryPtr(new Entry<Type1, Type2, Functor>(func))); + } + + /// Don't implement the copy ctor. Everyone will be happier if the + /// LLDoubleDispatch object isn't copied. + LLDoubleDispatch(const LLDoubleDispatch& src); +}; + +template <class ReturnType, class ParamBaseType> +ReturnType LLDoubleDispatch<ReturnType, ParamBaseType>::operator()(const ParamBaseType& param1, + const ParamBaseType& param2) const +{ + EntryPtr found = lookup(param1, param2); + if (found.get() == 0) + return ReturnType(); // bogus return value + + // otherwise, call the Functor we found + return (*found)(const_cast<ParamBaseType&>(param1), const_cast<ParamBaseType&>(param2)); +} + +#endif /* ! defined(LL_LLDOUBLEDISPATCH_H) */ diff --git a/indra/llcommon/llerrorthread.cpp b/indra/llcommon/llerrorthread.cpp index 4c779c58c89d5f8c60e4504a24c94bdb13c3c6ec..f0e46ae78d37bdfb43ae632d5d53457aa55ad885 100644 --- a/indra/llcommon/llerrorthread.cpp +++ b/indra/llcommon/llerrorthread.cpp @@ -31,7 +31,9 @@ #include "linden_common.h" #include "llerrorthread.h" + #include "llapp.h" +#include "lltimer.h" // ms_sleep() LLErrorThread::LLErrorThread() : LLThread("Error"), diff --git a/indra/llcommon/llevent.h b/indra/llcommon/llevent.h index a74ddbd091be54b6562fec7350ee0a4703126d38..2cc8577219da76fe1e28ef9ef096782410d70f08 100644 --- a/indra/llcommon/llevent.h +++ b/indra/llcommon/llevent.h @@ -35,7 +35,7 @@ #define LL_EVENT_H #include "llsd.h" -#include "llmemory.h" +#include "llpointer.h" #include "llthread.h" namespace LLOldEvents diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index f70d532e4c5fa1cc5e3131cdbf3e193dc07a32bb..2f6515a4cb034f3d0b8ec8da5c085bab89536b51 100644 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -38,7 +38,7 @@ #include <boost/function.hpp> #include <boost/static_assert.hpp> #include "llsd.h" -#include "llmemory.h" +#include "llsingleton.h" #include "lldependencies.h" // override this to allow binding free functions with more parameters diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 94b51119e4e1f71d3507940512b33ccc32ef504d..612068b20213f551b294fffc6befa3f442b2a1fd 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -30,229 +30,323 @@ * $/LicenseInfo$ */ -#ifndef LL_LLFASTTIMER_H -#define LL_LLFASTTIMER_H +#ifndef LL_FASTTIMER_H +#define LL_FASTTIMER_H + +#include "llinstancetracker.h" #define FAST_TIMER_ON 1 U64 get_cpu_clock_count(); +class LLMutex; + +#include <queue> +#include "llsd.h" + + class LLFastTimer { public: - enum EFastTimerType + // stores a "named" timer instance to be reused via multiple LLFastTimer stack instances + class NamedTimer + : public LLInstanceTracker<NamedTimer> { - // high level - FTM_FRAME, - FTM_UPDATE, - FTM_RENDER, - FTM_SWAP, - FTM_CLIENT_COPY, - FTM_IDLE, - FTM_SLEEP, - - // common messaging components - FTM_PUMP, - FTM_CURL, - - // common simulation components - FTM_UPDATE_ANIMATION, - FTM_UPDATE_TERRAIN, - FTM_UPDATE_PRIMITIVES, - FTM_UPDATE_PARTICLES, - FTM_SIMULATE_PARTICLES, - FTM_UPDATE_SKY, - FTM_UPDATE_TEXTURES, - FTM_UPDATE_WLPARAM, - FTM_UPDATE_WATER, - FTM_UPDATE_CLOUDS, - FTM_UPDATE_GRASS, - FTM_UPDATE_TREE, - FTM_UPDATE_AVATAR, - - // common render components - FTM_SHADOW_GEOMETRY, - FTM_SHADOW_RENDER, - FTM_SHADOW_TERRAIN, - FTM_SHADOW_AVATAR, - FTM_SHADOW_SIMPLE, - FTM_SHADOW_ALPHA, - FTM_SHADOW_TREE, - - FTM_RENDER_GEOMETRY, - FTM_RENDER_TERRAIN, - FTM_RENDER_SIMPLE, - FTM_RENDER_FULLBRIGHT, - FTM_RENDER_GLOW, - FTM_RENDER_GRASS, - FTM_RENDER_INVISIBLE, - FTM_RENDER_SHINY, - FTM_RENDER_BUMP, - FTM_RENDER_TREES, - FTM_RENDER_CHARACTERS, - FTM_RENDER_OCCLUSION, - FTM_RENDER_ALPHA, - FTM_RENDER_CLOUDS, - FTM_RENDER_HUD, - FTM_RENDER_PARTICLES, - FTM_RENDER_WATER, - FTM_RENDER_WL_SKY, - FTM_RENDER_FAKE_VBO_UPDATE, - FTM_RENDER_TIMER, - FTM_RENDER_UI, - FTM_RENDER_BLOOM, - FTM_RENDER_BLOOM_FBO, - FTM_RENDER_FONTS, - - // newview specific - FTM_MESSAGES, - FTM_MOUSEHANDLER, - FTM_KEYHANDLER, - FTM_REBUILD, - FTM_STATESORT, - FTM_STATESORT_DRAWABLE, - FTM_STATESORT_POSTSORT, - FTM_REBUILD_VBO, - FTM_REBUILD_VOLUME_VB, - FTM_REBUILD_BRIDGE_VB, - FTM_REBUILD_HUD_VB, - FTM_REBUILD_TERRAIN_VB, - FTM_REBUILD_WATER_VB, - FTM_REBUILD_TREE_VB, - FTM_REBUILD_PARTICLE_VB, - FTM_REBUILD_CLOUD_VB, - FTM_REBUILD_GRASS_VB, - FTM_REBUILD_NONE_VB, - FTM_REBUILD_OCCLUSION_VB, - FTM_POOLS, - FTM_POOLRENDER, - FTM_IDLE_CB, - FTM_WORLD_UPDATE, - FTM_UPDATE_MOVE, - FTM_OCTREE_BALANCE, - FTM_UPDATE_LIGHTS, - FTM_CULL, - FTM_CULL_REBOUND, - FTM_FRUSTUM_CULL, - FTM_GEO_UPDATE, - FTM_GEO_RESERVE, - FTM_GEO_LIGHT, - FTM_GEO_SHADOW, - FTM_GEO_SKY, - FTM_GEN_VOLUME, - FTM_GEN_TRIANGLES, - FTM_GEN_FLEX, - FTM_AUDIO_UPDATE, - FTM_RESET_DRAWORDER, - FTM_OBJECTLIST_UPDATE, - FTM_AVATAR_UPDATE, - FTM_JOINT_UPDATE, - FTM_ATTACHMENT_UPDATE, - FTM_LOD_UPDATE, - FTM_REGION_UPDATE, - FTM_CLEANUP, - FTM_NETWORK, - FTM_IDLE_NETWORK, - FTM_CREATE_OBJECT, - FTM_LOAD_AVATAR, - FTM_PROCESS_MESSAGES, - FTM_PROCESS_OBJECTS, - FTM_PROCESS_IMAGES, - FTM_IMAGE_UPDATE, - FTM_IMAGE_CREATE, - FTM_IMAGE_DECODE, - FTM_IMAGE_MARK_DIRTY, - FTM_PIPELINE, - FTM_VFILE_WAIT, - FTM_FLEXIBLE_UPDATE, - FTM_OCCLUSION_READBACK, - FTM_HUD_EFFECTS, - FTM_HUD_UPDATE, - FTM_INVENTORY, - FTM_AUTO_SELECT, - FTM_ARRANGE, - FTM_FILTER, - FTM_REFRESH, - FTM_SORT, - FTM_PICK, - - // Temp - FTM_TEMP1, - FTM_TEMP2, - FTM_TEMP3, - FTM_TEMP4, - FTM_TEMP5, - FTM_TEMP6, - FTM_TEMP7, - FTM_TEMP8, - - FTM_OTHER, // Special, used by display code + public: + ~NamedTimer(); + + enum { HISTORY_NUM = 60 }; + + const std::string& getName() { return mName; } + NamedTimer* getParent() { return mParent; } + void setParent(NamedTimer* parent); + S32 getDepth(); + std::string getToolTip(S32 history_index = -1); + + typedef std::vector<NamedTimer*>::const_iterator child_const_iter; + child_const_iter beginChildren(); + child_const_iter endChildren(); + std::vector<NamedTimer*>& getChildren(); + + void setCollapsed(bool collapsed) { mCollapsed = collapsed; } + bool getCollapsed() { return mCollapsed; } + + U64 getCountAverage() { return mCountAverage; } + U64 getCallAverage() { return mCallAverage; } + + U64 getHistoricalCount(S32 history_index = 0); + U64 getHistoricalCalls(S32 history_index = 0); + + static NamedTimer& getRootNamedTimer(); + + struct FrameState + { + FrameState(NamedTimer* timerp); + + U64 mSelfTimeCounter; + U64 mLastStartTime; // most recent time when this timer was started + U32 mCalls; + FrameState* mParent; // info for caller timer + FrameState* mLastCaller; // used to bootstrap tree construction + NamedTimer* mTimer; + U16 mActiveCount; // number of timers with this ID active on stack + bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame + }; + + FrameState& getFrameStateFast() const + { + return (*sTimerInfos)[mFrameStateIndex]; + } + + S32 getFrameStateIndex() const { return mFrameStateIndex; } + + FrameState& getFrameState() const; + + + private: + friend class LLFastTimer; + friend class NamedTimerFactory; + + // + // methods + // + NamedTimer(const std::string& name); + // recursive call to gather total time from children + static void accumulateTimings(); + + // called once per frame by LLFastTimer + static void processFrame(); + + static void buildHierarchy(); + static void resetFrame(); + static void reset(); + + typedef std::vector<FrameState> info_list_t; + static info_list_t& getFrameStateList(); + static void createFrameStateList(); // must call before any call to getFrameStateList() - FTM_NUM_TYPES + // + // members + // + S32 mFrameStateIndex; + + std::string mName; + + U64 mTotalTimeCounter; + + U64 mCountAverage; + U64 mCallAverage; + + U64* mCountHistory; + U64* mCallHistory; + + // tree structure + NamedTimer* mParent; // NamedTimer of caller(parent) + std::vector<NamedTimer*> mChildren; + bool mCollapsed; // don't show children + bool mNeedsSorting; // sort children whenever child added + + static info_list_t* sTimerInfos; }; - enum { FTM_HISTORY_NUM = 60 }; - enum { FTM_MAX_DEPTH = 64 }; - + + // used to statically declare a new named timer + class DeclareTimer + { + public: + DeclareTimer(const std::string& name, bool open); + DeclareTimer(const std::string& name); + + // convertable to NamedTimer::FrameState for convenient usage of LLFastTimer(declared_timer) + operator NamedTimer::FrameState&() { return mNamedTimer.getFrameStateFast(); } + private: + NamedTimer& mNamedTimer; + }; + + static DeclareTimer FTM_ARRANGE; + static DeclareTimer FTM_ATTACHMENT_UPDATE; + static DeclareTimer FTM_AUDIO_UPDATE; + static DeclareTimer FTM_AUTO_SELECT; + static DeclareTimer FTM_AVATAR_UPDATE; + static DeclareTimer FTM_CLEANUP; + static DeclareTimer FTM_CLIENT_COPY; + static DeclareTimer FTM_CREATE_OBJECT; + static DeclareTimer FTM_CULL; + static DeclareTimer FTM_CULL_REBOUND; + static DeclareTimer FTM_FILTER; + static DeclareTimer FTM_FLEXIBLE_UPDATE; + static DeclareTimer FTM_FRAME; + static DeclareTimer FTM_FRUSTUM_CULL; + static DeclareTimer FTM_GEN_FLEX; + static DeclareTimer FTM_GEN_TRIANGLES; + static DeclareTimer FTM_GEN_VOLUME; + static DeclareTimer FTM_GEO_SKY; + static DeclareTimer FTM_GEO_UPDATE; + static DeclareTimer FTM_HUD_EFFECTS; + static DeclareTimer FTM_HUD_UPDATE; + static DeclareTimer FTM_IDLE; + static DeclareTimer FTM_IDLE_CB; + static DeclareTimer FTM_IDLE_NETWORK; + static DeclareTimer FTM_IMAGE_CREATE; + static DeclareTimer FTM_IMAGE_MARK_DIRTY; + static DeclareTimer FTM_IMAGE_UPDATE; + static DeclareTimer FTM_INVENTORY; + static DeclareTimer FTM_JOINT_UPDATE; + static DeclareTimer FTM_KEYHANDLER; + static DeclareTimer FTM_LOAD_AVATAR; + static DeclareTimer FTM_LOD_UPDATE; + static DeclareTimer FTM_MESSAGES; + static DeclareTimer FTM_MOUSEHANDLER; + static DeclareTimer FTM_NETWORK; + static DeclareTimer FTM_OBJECTLIST_UPDATE; + static DeclareTimer FTM_OCCLUSION_READBACK; + static DeclareTimer FTM_OCTREE_BALANCE; + static DeclareTimer FTM_PICK; + static DeclareTimer FTM_PIPELINE; + static DeclareTimer FTM_POOLRENDER; + static DeclareTimer FTM_POOLS; + static DeclareTimer FTM_PROCESS_IMAGES; + static DeclareTimer FTM_PROCESS_MESSAGES; + static DeclareTimer FTM_PROCESS_OBJECTS; + static DeclareTimer FTM_PUMP; + static DeclareTimer FTM_REBUILD_GRASS_VB; + static DeclareTimer FTM_REBUILD_PARTICLE_VB; + static DeclareTimer FTM_REBUILD_TERRAIN_VB; + static DeclareTimer FTM_REBUILD_VBO; + static DeclareTimer FTM_REBUILD_VOLUME_VB; + static DeclareTimer FTM_REFRESH; + static DeclareTimer FTM_REGION_UPDATE; + static DeclareTimer FTM_RENDER; + static DeclareTimer FTM_RENDER_ALPHA; + static DeclareTimer FTM_RENDER_BLOOM; + static DeclareTimer FTM_RENDER_BLOOM_FBO; + static DeclareTimer FTM_RENDER_BUMP; + static DeclareTimer FTM_RENDER_CHARACTERS; + static DeclareTimer FTM_RENDER_FAKE_VBO_UPDATE; + static DeclareTimer FTM_RENDER_FONTS; + static DeclareTimer FTM_RENDER_FULLBRIGHT; + static DeclareTimer FTM_RENDER_GEOMETRY; + static DeclareTimer FTM_RENDER_GLOW; + static DeclareTimer FTM_RENDER_GRASS; + static DeclareTimer FTM_RENDER_INVISIBLE; + static DeclareTimer FTM_RENDER_OCCLUSION; + static DeclareTimer FTM_RENDER_SHINY; + static DeclareTimer FTM_RENDER_SIMPLE; + static DeclareTimer FTM_RENDER_TERRAIN; + static DeclareTimer FTM_RENDER_TREES; + static DeclareTimer FTM_RENDER_UI; + static DeclareTimer FTM_RENDER_WATER; + static DeclareTimer FTM_RENDER_WL_SKY; + static DeclareTimer FTM_RESET_DRAWORDER; + static DeclareTimer FTM_SHADOW_ALPHA; + static DeclareTimer FTM_SHADOW_AVATAR; + static DeclareTimer FTM_SHADOW_RENDER; + static DeclareTimer FTM_SHADOW_SIMPLE; + static DeclareTimer FTM_SHADOW_TERRAIN; + static DeclareTimer FTM_SHADOW_TREE; + static DeclareTimer FTM_SIMULATE_PARTICLES; + static DeclareTimer FTM_SLEEP; + static DeclareTimer FTM_SORT; + static DeclareTimer FTM_STATESORT; + static DeclareTimer FTM_STATESORT_DRAWABLE; + static DeclareTimer FTM_STATESORT_POSTSORT; + static DeclareTimer FTM_SWAP; + static DeclareTimer FTM_TEMP1; + static DeclareTimer FTM_TEMP2; + static DeclareTimer FTM_TEMP3; + static DeclareTimer FTM_TEMP4; + static DeclareTimer FTM_TEMP5; + static DeclareTimer FTM_TEMP6; + static DeclareTimer FTM_TEMP7; + static DeclareTimer FTM_TEMP8; + static DeclareTimer FTM_UPDATE_ANIMATION; + static DeclareTimer FTM_UPDATE_AVATAR; + static DeclareTimer FTM_UPDATE_CLOUDS; + static DeclareTimer FTM_UPDATE_GRASS; + static DeclareTimer FTM_UPDATE_MOVE; + static DeclareTimer FTM_UPDATE_PARTICLES; + static DeclareTimer FTM_UPDATE_PRIMITIVES; + static DeclareTimer FTM_UPDATE_SKY; + static DeclareTimer FTM_UPDATE_TERRAIN; + static DeclareTimer FTM_UPDATE_TEXTURES; + static DeclareTimer FTM_UPDATE_TREE; + static DeclareTimer FTM_UPDATE_WATER; + static DeclareTimer FTM_UPDATE_WLPARAM; + static DeclareTimer FTM_VFILE_WAIT; + static DeclareTimer FTM_WORLD_UPDATE; + public: - static LLFastTimer::EFastTimerType sCurType; + enum RootTimerMarker { ROOT }; + + static LLMutex* sLogLock; + static std::queue<LLSD> sLogQueue; + static BOOL sLog; + static BOOL sMetricLog; + + LLFastTimer(RootTimerMarker); - LLFastTimer(EFastTimerType type) + LLFastTimer(NamedTimer::FrameState& timer) + : mFrameState(&timer) { -#if FAST_TIMER_ON - mType = type; - sCurType = type; - // These don't get counted, because they use CPU clockticks - //gTimerBins[gCurTimerBin]++; - //LLTimer::sNumTimerCalls++; + NamedTimer::FrameState* frame_state = mFrameState; + frame_state->mLastStartTime = get_cpu_clock_count(); + mStartSelfTime = frame_state->mLastStartTime; - U64 cpu_clocks = get_cpu_clock_count(); + frame_state->mActiveCount++; + frame_state->mCalls++; + // keep current parent as long as it is active when we are + frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0); + + mLastTimer = sCurTimer; + sCurTimer = this; + } - sStart[sCurDepth] = cpu_clocks; - sCurDepth++; -#endif - }; ~LLFastTimer() { #if FAST_TIMER_ON - U64 end,delta; - int i; - - // These don't get counted, because they use CPU clockticks - //gTimerBins[gCurTimerBin]++; - //LLTimer::sNumTimerCalls++; - end = get_cpu_clock_count(); - - sCurDepth--; - delta = end - sStart[sCurDepth]; - sCounter[mType] += delta; - sCalls[mType]++; - // Subtract delta from parents - for (i=0; i<sCurDepth; i++) - sStart[i] += delta; + NamedTimer::FrameState* frame_state = mFrameState; + U64 cur_time = get_cpu_clock_count(); + frame_state->mSelfTimeCounter += cur_time - mStartSelfTime; + + frame_state->mActiveCount--; + LLFastTimer* last_timer = mLastTimer; + sCurTimer = last_timer; + + // store last caller to bootstrap tree creation + frame_state->mLastCaller = last_timer->mFrameState; + + // we are only tracking self time, so subtract our total time delta from parents + U64 total_time = cur_time - frame_state->mLastStartTime; + last_timer->mStartSelfTime += total_time; #endif } + + // call this once a frame to reset timers + static void nextFrame(); + + // call this to reset timer hierarchy, averages, etc. static void reset(); + static U64 countsPerSecond(); + static S32 getLastFrameIndex() { return sLastFrameIndex; } + static S32 getCurFrameIndex() { return sCurFrameIndex; } + + static void writeLog(std::ostream& os); public: - static int sCurDepth; - static U64 sStart[FTM_MAX_DEPTH]; - static U64 sCounter[FTM_NUM_TYPES]; - static U64 sCalls[FTM_NUM_TYPES]; - static U64 sCountAverage[FTM_NUM_TYPES]; - static U64 sCallAverage[FTM_NUM_TYPES]; - static U64 sCountHistory[FTM_HISTORY_NUM][FTM_NUM_TYPES]; - static U64 sCallHistory[FTM_HISTORY_NUM][FTM_NUM_TYPES]; - static S32 sCurFrameIndex; - static S32 sLastFrameIndex; - static int sPauseHistory; - static int sResetHistory; - static F64 sCPUClockFrequency; + static bool sPauseHistory; + static bool sResetHistory; private: - EFastTimerType mType; -}; + typedef std::vector<LLFastTimer*> timer_stack_t; + static LLFastTimer* sCurTimer; + static S32 sCurFrameIndex; + static S32 sLastFrameIndex; + static F64 sCPUClockFrequency; + U64 mStartSelfTime; // start time + time of all child timers + NamedTimer::FrameState* mFrameState; + LLFastTimer* mLastTimer; +}; #endif // LL_LLFASTTIMER_H diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h new file mode 100644 index 0000000000000000000000000000000000000000..ea50acbbc5e08008c241eb34d188ba9cbc0a1280 --- /dev/null +++ b/indra/llcommon/llinstancetracker.h @@ -0,0 +1,121 @@ +/** + * @file llinstancetracker.h + * @brief LLInstanceTracker is a mixin class that automatically tracks object + * instances with or without an associated key + * + * $LicenseInfo:firstyear=2000&license=viewergpl$ + * + * Copyright (c) 2000-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLINSTANCETRACKER_H +#define LL_LLINSTANCETRACKER_H + +#include <map> + +#include "string_table.h" +#include <boost/utility.hpp> + +// This mix-in class adds support for tracking all instances of the specified class parameter T +// The (optional) key associates a value of type KEY with a given instance of T, for quick lookup +// If KEY is not provided, then instances are stored in a simple set +// *NOTE: see explicit specialization below for default KEY==T* case +template<typename T, typename KEY = T*> +class LLInstanceTracker : boost::noncopyable +{ +public: + typedef typename std::map<KEY, T*>::iterator instance_iter; + typedef typename std::map<KEY, T*>::const_iterator instance_const_iter; + + static T* getInstance(const KEY& k) { instance_iter found = getMap().find(k); return (found == getMap().end()) ? NULL : found->second; } + + static instance_iter beginInstances() { return getMap().begin(); } + static instance_iter endInstances() { return getMap().end(); } + static S32 instanceCount() { return getMap().size(); } +protected: + LLInstanceTracker(KEY key) { add(key); } + virtual ~LLInstanceTracker() { remove(); } + virtual void setKey(KEY key) { remove(); add(key); } + virtual const KEY& getKey() const { return mKey; } + +private: + void add(KEY key) + { + mKey = key; + getMap()[key] = static_cast<T*>(this); + } + void remove() { getMap().erase(mKey); } + + static std::map<KEY, T*>& getMap() + { + if (! sInstances) + { + sInstances = new std::map<KEY, T*>; + } + return *sInstances; + } + +private: + + KEY mKey; + static std::map<KEY, T*>* sInstances; +}; + +// explicit specialization for default case where KEY is T* +// use a simple std::set<T*> +template<typename T> +class LLInstanceTracker<T, T*> +{ +public: + typedef typename std::set<T*>::iterator instance_iter; + typedef typename std::set<T*>::const_iterator instance_const_iter; + + static instance_iter beginInstances() { return getSet().begin(); } + static instance_iter endInstances() { return getSet().end(); } + static S32 instanceCount() { return getSet().size(); } + +protected: + LLInstanceTracker() { getSet().insert(static_cast<T*>(this)); } + virtual ~LLInstanceTracker() { getSet().erase(static_cast<T*>(this)); } + + LLInstanceTracker(const LLInstanceTracker& other) { getSet().insert(static_cast<T*>(this)); } + + static std::set<T*>& getSet() // called after getReady() but before go() + { + if (! sInstances) + { + sInstances = new std::set<T*>; + } + return *sInstances; + } + + static std::set<T*>* sInstances; +}; + +template <typename T, typename KEY> std::map<KEY, T*>* LLInstanceTracker<T, KEY>::sInstances = NULL; +template <typename T> std::set<T*>* LLInstanceTracker<T, T*>::sInstances = NULL; + +#endif diff --git a/indra/llcommon/llmd5.cpp b/indra/llcommon/llmd5.cpp index 14b4f9f4b0368e7b2f60d30f384dd6d81d00ac46..da9cb94e133c0c298342c646c7559035cf056cc6 100644 --- a/indra/llcommon/llmd5.cpp +++ b/indra/llcommon/llmd5.cpp @@ -83,6 +83,7 @@ documentation and/or software. #include "llmd5.h" #include <cassert> +#include <iostream> // cerr // how many bytes to grab at a time when checking files const int LLMD5::BLOCK_LEN = 4096; diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index a6de3d2d698f199bb493b04e7878de20d2561663..2a8015e26d9542e392e1219859e49ab44dcdecc2 100644 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -44,7 +44,6 @@ #endif #include "llmemory.h" -#include "llmemtype.h" //---------------------------------------------------------------------------- @@ -74,162 +73,6 @@ void LLMemory::freeReserve() reserveMem = NULL; } - -//---------------------------------------------------------------------------- - -//static -#if MEM_TRACK_TYPE -S32 LLMemType::sCurDepth = 0; -S32 LLMemType::sCurType = LLMemType::MTYPE_INIT; -S32 LLMemType::sType[LLMemType::MTYPE_MAX_DEPTH]; -S32 LLMemType::sMemCount[LLMemType::MTYPE_NUM_TYPES] = { 0 }; -S32 LLMemType::sMaxMemCount[LLMemType::MTYPE_NUM_TYPES] = { 0 }; -S32 LLMemType::sNewCount[LLMemType::MTYPE_NUM_TYPES] = { 0 }; -S32 LLMemType::sOverheadMem = 0; - -const char* LLMemType::sTypeDesc[LLMemType::MTYPE_NUM_TYPES] = -{ - "INIT", - "STARTUP", - "MAIN", - - "IMAGEBASE", - "IMAGERAW", - "IMAGEFORMATTED", - - "APPFMTIMAGE", - "APPRAWIMAGE", - "APPAUXRAWIMAGE", - - "DRAWABLE", - "OBJECT", - "PIPELINE", - "AVATAR", - "PARTICLES", - "REGIONS", - "INVENTORY", - "ANIMATION", - "NETWORK", - "PHYSICS", - "INTERESTLIST", - - "SCRIPT", - "SCRIPT_RUN", - "SCRIPT_BYTECODE", - - "IO_PUMP", - "IO_TCP", - "IO_BUFFER", - "IO_HTTP_SERVER" - "IO_SD_SERVER", - "IO_SD_CLIENT", - "IO_URL_REQUEST", - - "TEMP1", - "TEMP2", - "TEMP3", - "TEMP4", - "TEMP5", - "TEMP6", - "TEMP7", - "TEMP8", - "TEMP9" -}; - -#endif -S32 LLMemType::sTotalMem = 0; -S32 LLMemType::sMaxTotalMem = 0; - -//static -void LLMemType::printMem() -{ - S32 misc_mem = sTotalMem; -#if MEM_TRACK_TYPE - for (S32 i=0; i<MTYPE_NUM_TYPES; i++) - { - if (sMemCount[i]) - { - llinfos << llformat("MEM: % 20s %03d MB (%03d MB) in %06d News",sTypeDesc[i],sMemCount[i]>>20,sMaxMemCount[i]>>20, sNewCount[i]) << llendl; - } - misc_mem -= sMemCount[i]; - } -#endif - llinfos << llformat("MEM: % 20s %03d MB","MISC",misc_mem>>20) << llendl; - llinfos << llformat("MEM: % 20s %03d MB (Max=%d MB)","TOTAL",sTotalMem>>20,sMaxTotalMem>>20) << llendl; -} - -#if MEM_TRACK_MEM - -void* ll_allocate (size_t size) -{ - if (size == 0) - { - llwarns << "Null allocation" << llendl; - } - - size = (size+3)&~3; - S32 alloc_size = size + 4; -#if MEM_TRACK_TYPE - alloc_size += 4; -#endif - char* p = (char*)malloc(alloc_size); - if (p == NULL) - { - LLMemory::freeReserve(); - llerrs << "Out of memory Error" << llendl; - } - LLMemType::sTotalMem += size; - LLMemType::sMaxTotalMem = llmax(LLMemType::sTotalMem, LLMemType::sMaxTotalMem); - LLMemType::sOverheadMem += 4; - *(size_t*)p = size; - p += 4; -#if MEM_TRACK_TYPE - if (LLMemType::sCurType < 0 || LLMemType::sCurType >= LLMemType::MTYPE_NUM_TYPES) - { - llerrs << "Memory Type Error: new" << llendl; - } - LLMemType::sOverheadMem += 4; - *(S32*)p = LLMemType::sCurType; - p += 4; - LLMemType::sMemCount[LLMemType::sCurType] += size; - if (LLMemType::sMemCount[LLMemType::sCurType] > LLMemType::sMaxMemCount[LLMemType::sCurType]) - { - LLMemType::sMaxMemCount[LLMemType::sCurType] = LLMemType::sMemCount[LLMemType::sCurType]; - } - LLMemType::sNewCount[LLMemType::sCurType]++; -#endif - return (void*)p; -} - -void ll_release (void *pin) -{ - if (!pin) - { - return; - } - char* p = (char*)pin; -#if MEM_TRACK_TYPE - p -= 4; - S32 type = *(S32*)p; - if (type < 0 || type >= LLMemType::MTYPE_NUM_TYPES) - { - llerrs << "Memory Type Error: delete" << llendl; - } -#endif - p -= 4; - S32 size = *(size_t*)p; - LLMemType::sOverheadMem -= 4; -#if MEM_TRACK_TYPE - LLMemType::sMemCount[type] -= size; - LLMemType::sOverheadMem -= 4; - LLMemType::sNewCount[type]--; -#endif - LLMemType::sTotalMem -= size; - free(p); -} - -#else - void* ll_allocate (size_t size) { if (size == 0) @@ -250,52 +93,11 @@ void ll_release (void *p) free(p); } -#endif - -#if MEM_TRACK_MEM - -void* operator new (size_t size) -{ - return ll_allocate(size); -} - -void* operator new[] (size_t size) -{ - return ll_allocate(size); -} - -void operator delete (void *p) -{ - ll_release(p); -} - -void operator delete[] (void *p) -{ - ll_release(p); -} - -#endif - -//---------------------------------------------------------------------------- - -LLRefCount::LLRefCount() : - mRef(0) -{ -} - -LLRefCount::~LLRefCount() -{ - if (mRef != 0) - { - llerrs << "deleting non-zero reference" << llendl; - } -} - //---------------------------------------------------------------------------- #if defined(LL_WINDOWS) -U64 getCurrentRSS() +U64 LLMemory::getCurrentRSS() { HANDLE self = GetCurrentProcess(); PROCESS_MEMORY_COUNTERS counters; @@ -333,7 +135,7 @@ U64 getCurrentRSS() // } // } -U64 getCurrentRSS() +U64 LLMemory::getCurrentRSS() { U64 residentSize = 0; task_basic_info_data_t basicInfo; @@ -357,7 +159,7 @@ U64 getCurrentRSS() #elif defined(LL_LINUX) -U64 getCurrentRSS() +U64 LLMemory::getCurrentRSS() { static const char statPath[] = "/proc/self/stat"; LLFILE *fp = LLFile::fopen(statPath, "r"); @@ -396,7 +198,7 @@ bail: #define _STRUCTURED_PROC 1 #include <sys/procfs.h> -U64 getCurrentRSS() +U64 LLMemory::getCurrentRSS() { char path [LL_MAX_PATH]; /* Flawfinder: ignore */ @@ -419,7 +221,7 @@ U64 getCurrentRSS() } #else -U64 getCurrentRSS() +U64 LLMemory::getCurrentRSS() { return 0; } diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index b5c0711484dd448e940325d6ae2484ba3f7fdf95..f41da37ba649e34b72f9e167457ef19d0c7ddf4f 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -29,21 +29,17 @@ * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ -#ifndef LL_MEMORY_H -#define LL_MEMORY_H +#ifndef LLMEMORY_H +#define LLMEMORY_H -#include <new> -#include <cstdlib> -#include "llerror.h" extern S32 gTotalDAlloc; extern S32 gTotalDAUse; extern S32 gDACount; -const U32 LLREFCOUNT_SENTINEL_VALUE = 0xAAAAAAAA; - -//---------------------------------------------------------------------------- +extern void* ll_allocate (size_t size); +extern void ll_release (void *p); class LLMemory { @@ -51,422 +47,19 @@ public: static void initClass(); static void cleanupClass(); static void freeReserve(); + // Return the resident set size of the current process, in bytes. + // Return value is zero if not known. + static U64 getCurrentRSS(); private: static char* reserveMem; }; -//---------------------------------------------------------------------------- -// RefCount objects should generally only be accessed by way of LLPointer<>'s -// NOTE: LLPointer<LLFoo> x = new LLFoo(); MAY NOT BE THREAD SAFE -// if LLFoo::LLFoo() does anything like put itself in an update queue. -// The queue may get accessed before it gets assigned to x. -// The correct implementation is: -// LLPointer<LLFoo> x = new LLFoo; // constructor does not do anything interesting -// x->instantiate(); // does stuff like place x into an update queue - -// see llthread.h for LLThreadSafeRefCount - -//---------------------------------------------------------------------------- - -class LLRefCount -{ -protected: - LLRefCount(const LLRefCount&); // not implemented -private: - LLRefCount&operator=(const LLRefCount&); // not implemented - -protected: - virtual ~LLRefCount(); // use unref() - -public: - LLRefCount(); - - void ref() - { - mRef++; - } - - S32 unref() - { - llassert(mRef >= 1); - if (0 == --mRef) - { - delete this; - return 0; - } - return mRef; - } - - S32 getNumRefs() const - { - return mRef; - } - -private: - S32 mRef; -}; - -//---------------------------------------------------------------------------- - -// Note: relies on Type having ref() and unref() methods -template <class Type> class LLPointer -{ -public: - - LLPointer() : - mPointer(NULL) - { - } - - LLPointer(Type* ptr) : - mPointer(ptr) - { - ref(); - } - - LLPointer(const LLPointer<Type>& ptr) : - mPointer(ptr.mPointer) - { - ref(); - } - - // support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. - template<typename Subclass> - LLPointer(const LLPointer<Subclass>& ptr) : - mPointer(ptr.get()) - { - ref(); - } - - ~LLPointer() - { - unref(); - } - - Type* get() const { return mPointer; } - const Type* operator->() const { return mPointer; } - Type* operator->() { return mPointer; } - const Type& operator*() const { return *mPointer; } - Type& operator*() { return *mPointer; } - - operator BOOL() const { return (mPointer != NULL); } - operator bool() const { return (mPointer != NULL); } - bool operator!() const { return (mPointer == NULL); } - bool isNull() const { return (mPointer == NULL); } - bool notNull() const { return (mPointer != NULL); } - - operator Type*() const { return mPointer; } - operator const Type*() const { return mPointer; } - bool operator !=(Type* ptr) const { return (mPointer != ptr); } - bool operator ==(Type* ptr) const { return (mPointer == ptr); } - bool operator ==(const LLPointer<Type>& ptr) const { return (mPointer == ptr.mPointer); } - bool operator < (const LLPointer<Type>& ptr) const { return (mPointer < ptr.mPointer); } - bool operator > (const LLPointer<Type>& ptr) const { return (mPointer > ptr.mPointer); } - - LLPointer<Type>& operator =(Type* ptr) - { - if( mPointer != ptr ) - { - unref(); - mPointer = ptr; - ref(); - } - - return *this; - } - - LLPointer<Type>& operator =(const LLPointer<Type>& ptr) - { - if( mPointer != ptr.mPointer ) - { - unref(); - mPointer = ptr.mPointer; - ref(); - } - return *this; - } - - // support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. - template<typename Subclass> - LLPointer<Type>& operator =(const LLPointer<Subclass>& ptr) - { - if( mPointer != ptr.get() ) - { - unref(); - mPointer = ptr.get(); - ref(); - } - return *this; - } - - // Just exchange the pointers, which will not change the reference counts. - static void swap(LLPointer<Type>& a, LLPointer<Type>& b) - { - Type* temp = a.mPointer; - a.mPointer = b.mPointer; - b.mPointer = temp; - } - -protected: - void ref() - { - if (mPointer) - { - mPointer->ref(); - } - } - - void unref() - { - if (mPointer) - { - Type *tempp = mPointer; - mPointer = NULL; - tempp->unref(); - if (mPointer != NULL) - { - llwarns << "Unreference did assignment to non-NULL because of destructor" << llendl; - unref(); - } - } - } - -protected: - Type* mPointer; -}; - -//template <class Type> -//class LLPointerTraits -//{ -// static Type* null(); -//}; -// -// Expands LLPointer to return a pointer to a special instance of class Type instead of NULL. -// This is useful in instances where operations on NULL pointers are semantically safe and/or -// when error checking occurs at a different granularity or in a different part of the code -// than when referencing an object via a LLSafeHandle. -// - -template <class Type> -class LLSafeHandle -{ -public: - LLSafeHandle() : - mPointer(NULL) - { - } - - LLSafeHandle(Type* ptr) : - mPointer(NULL) - { - assign(ptr); - } - - LLSafeHandle(const LLSafeHandle<Type>& ptr) : - mPointer(NULL) - { - assign(ptr.mPointer); - } - - // support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. - template<typename Subclass> - LLSafeHandle(const LLSafeHandle<Subclass>& ptr) : - mPointer(NULL) - { - assign(ptr.get()); - } - - ~LLSafeHandle() - { - unref(); - } - - const Type* operator->() const { return nonNull(mPointer); } - Type* operator->() { return nonNull(mPointer); } - - Type* get() const { return mPointer; } - // we disallow these operations as they expose our null objects to direct manipulation - // and bypass the reference counting semantics - //const Type& operator*() const { return *nonNull(mPointer); } - //Type& operator*() { return *nonNull(mPointer); } - - operator BOOL() const { return mPointer != NULL; } - operator bool() const { return mPointer != NULL; } - bool operator!() const { return mPointer == NULL; } - bool isNull() const { return mPointer == NULL; } - bool notNull() const { return mPointer != NULL; } - - - operator Type*() const { return mPointer; } - operator const Type*() const { return mPointer; } - bool operator !=(Type* ptr) const { return (mPointer != ptr); } - bool operator ==(Type* ptr) const { return (mPointer == ptr); } - bool operator ==(const LLSafeHandle<Type>& ptr) const { return (mPointer == ptr.mPointer); } - bool operator < (const LLSafeHandle<Type>& ptr) const { return (mPointer < ptr.mPointer); } - bool operator > (const LLSafeHandle<Type>& ptr) const { return (mPointer > ptr.mPointer); } - - LLSafeHandle<Type>& operator =(Type* ptr) - { - assign(ptr); - return *this; - } - - LLSafeHandle<Type>& operator =(const LLSafeHandle<Type>& ptr) - { - assign(ptr.mPointer); - return *this; - } - - // support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. - template<typename Subclass> - LLSafeHandle<Type>& operator =(const LLSafeHandle<Subclass>& ptr) - { - assign(ptr.get()); - return *this; - } - -public: - typedef Type* (*NullFunc)(); - static const NullFunc sNullFunc; - -protected: - void ref() - { - if (mPointer) - { - mPointer->ref(); - } - } - - void unref() - { - if (mPointer) - { - Type *tempp = mPointer; - mPointer = NULL; - tempp->unref(); - if (mPointer != NULL) - { - llwarns << "Unreference did assignment to non-NULL because of destructor" << llendl; - unref(); - } - } - } - - void assign(Type* ptr) - { - if( mPointer != ptr ) - { - unref(); - mPointer = ptr; - ref(); - } - } - - static Type* nonNull(Type* ptr) - { - return ptr == NULL ? sNullFunc() : ptr; - } - -protected: - Type* mPointer; -}; - -// LLInitializedPointer is just a pointer with a default constructor that initializes it to NULL -// NOT a smart pointer like LLPointer<> -// Useful for example in std::map<int,LLInitializedPointer<LLFoo> > -// (std::map uses the default constructor for creating new entries) -template <typename T> class LLInitializedPointer -{ -public: - LLInitializedPointer() : mPointer(NULL) {} - ~LLInitializedPointer() { delete mPointer; } - - const T* operator->() const { return mPointer; } - T* operator->() { return mPointer; } - const T& operator*() const { return *mPointer; } - T& operator*() { return *mPointer; } - operator const T*() const { return mPointer; } - operator T*() { return mPointer; } - T* operator=(T* x) { return (mPointer = x); } - operator bool() const { return mPointer != NULL; } - bool operator!() const { return mPointer == NULL; } - bool operator==(T* rhs) { return mPointer == rhs; } - bool operator==(const LLInitializedPointer<T>* rhs) { return mPointer == rhs.mPointer; } - -protected: - T* mPointer; -}; - -//---------------------------------------------------------------------------- +// LLRefCount moved to llrefcount.h -// LLSingleton implements the getInstance() method part of the Singleton -// pattern. It can't make the derived class constructors protected, though, so -// you have to do that yourself. -// -// There are two ways to use LLSingleton. The first way is to inherit from it -// while using the typename that you'd like to be static as the template -// parameter, like so: -// -// class Foo: public LLSingleton<Foo>{}; -// -// Foo& instance = Foo::instance(); -// -// The second way is to use the singleton class directly, without inheritance: -// -// typedef LLSingleton<Foo> FooSingleton; -// -// Foo& instance = FooSingleton::instance(); -// -// In this case, the class being managed as a singleton needs to provide an -// initSingleton() method since the LLSingleton virtual method won't be -// available -// -// As currently written, it is not thread-safe. -template <typename T> -class LLSingleton -{ -public: - virtual ~LLSingleton() {} -#ifdef LL_MSVC7 -// workaround for VC7 compiler bug -// adapted from http://www.codeproject.com/KB/tips/VC2003MeyersSingletonBug.aspx -// our version doesn't introduce a nested struct so that you can still declare LLSingleton<MyClass> -// a friend and hide your constructor - static T* getInstance() - { - LLSingleton<T> singleton; - return singleton.vsHack(); - } - - T* vsHack() -#else - static T* getInstance() -#endif - { - static T instance; - static bool needs_init = true; - if (needs_init) - { - needs_init = false; - instance.initSingleton(); - } - return &instance; - } - - static T& instance() - { - return *getInstance(); - } - -private: - virtual void initSingleton() {} -}; +// LLPointer moved to llpointer.h -//---------------------------------------------------------------------------- +// LLSafeHandle moved to llsafehandle.h -// Return the resident set size of the current process, in bytes. -// Return value is zero if not known. -U64 getCurrentRSS(); +// LLSingleton moved to llsingleton.h #endif diff --git a/indra/llcommon/llmemtype.cpp b/indra/llcommon/llmemtype.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4e33439711593af7d5557ac904ae80315416e615 --- /dev/null +++ b/indra/llcommon/llmemtype.cpp @@ -0,0 +1,237 @@ +/** + * @file llmemtype.cpp + * @brief Simple memory allocation/deallocation tracking stuff here + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llmemtype.h" +#include "llallocator.h" + +std::vector<char const *> LLMemType::DeclareMemType::mNameList; + +LLMemType::DeclareMemType LLMemType::MTYPE_INIT("Init"); +LLMemType::DeclareMemType LLMemType::MTYPE_STARTUP("Startup"); +LLMemType::DeclareMemType LLMemType::MTYPE_MAIN("Main"); +LLMemType::DeclareMemType LLMemType::MTYPE_FRAME("Frame"); + +LLMemType::DeclareMemType LLMemType::MTYPE_GATHER_INPUT("GatherInput"); +LLMemType::DeclareMemType LLMemType::MTYPE_JOY_KEY("JoyKey"); + +LLMemType::DeclareMemType LLMemType::MTYPE_IDLE("Idle"); +LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_PUMP("IdlePump"); +LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_NETWORK("IdleNetwork"); +LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_UPDATE_REGIONS("IdleUpdateRegions"); +LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_UPDATE_VIEWER_REGION("IdleUpdateViewerRegion"); +LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_UPDATE_SURFACE("IdleUpdateSurface"); +LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_UPDATE_PARCEL_OVERLAY("IdleUpdateParcelOverlay"); +LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_AUDIO("IdleAudio"); + +LLMemType::DeclareMemType LLMemType::MTYPE_CACHE_PROCESS_PENDING("CacheProcessPending"); +LLMemType::DeclareMemType LLMemType::MTYPE_CACHE_PROCESS_PENDING_ASKS("CacheProcessPendingAsks"); +LLMemType::DeclareMemType LLMemType::MTYPE_CACHE_PROCESS_PENDING_REPLIES("CacheProcessPendingReplies"); + +LLMemType::DeclareMemType LLMemType::MTYPE_MESSAGE_CHECK_ALL("MessageCheckAll"); +LLMemType::DeclareMemType LLMemType::MTYPE_MESSAGE_PROCESS_ACKS("MessageProcessAcks"); + +LLMemType::DeclareMemType LLMemType::MTYPE_RENDER("Render"); +LLMemType::DeclareMemType LLMemType::MTYPE_SLEEP("Sleep"); + +LLMemType::DeclareMemType LLMemType::MTYPE_NETWORK("Network"); +LLMemType::DeclareMemType LLMemType::MTYPE_PHYSICS("Physics"); +LLMemType::DeclareMemType LLMemType::MTYPE_INTERESTLIST("InterestList"); + +LLMemType::DeclareMemType LLMemType::MTYPE_IMAGEBASE("ImageBase"); +LLMemType::DeclareMemType LLMemType::MTYPE_IMAGERAW("ImageRaw"); +LLMemType::DeclareMemType LLMemType::MTYPE_IMAGEFORMATTED("ImageFormatted"); + +LLMemType::DeclareMemType LLMemType::MTYPE_APPFMTIMAGE("AppFmtImage"); +LLMemType::DeclareMemType LLMemType::MTYPE_APPRAWIMAGE("AppRawImage"); +LLMemType::DeclareMemType LLMemType::MTYPE_APPAUXRAWIMAGE("AppAuxRawImage"); + +LLMemType::DeclareMemType LLMemType::MTYPE_DRAWABLE("Drawable"); + +LLMemType::DeclareMemType LLMemType::MTYPE_OBJECT("Object"); +LLMemType::DeclareMemType LLMemType::MTYPE_OBJECT_PROCESS_UPDATE("ObjectProcessUpdate"); +LLMemType::DeclareMemType LLMemType::MTYPE_OBJECT_PROCESS_UPDATE_CORE("ObjectProcessUpdateCore"); + +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY("Display"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_UPDATE("DisplayUpdate"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_UPDATE_CAMERA("DisplayUpdateCam"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_UPDATE_GEOM("DisplayUpdateGeom"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_SWAP("DisplaySwap"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_UPDATE_HUD("DisplayUpdateHud"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_GEN_REFLECTION("DisplayGenRefl"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_IMAGE_UPDATE("DisplayImageUpdate"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_STATE_SORT("DisplayStateSort"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_SKY("DisplaySky"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_RENDER_GEOM("DisplayRenderGeom"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_RENDER_FLUSH("DisplayRenderFlush"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_RENDER_UI("DisplayRenderUI"); +LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_RENDER_ATTACHMENTS("DisplayRenderAttach"); + +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_DATA("VertexData"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_CONSTRUCTOR("VertexConstr"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_DESTRUCTOR("VertexDestr"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_CREATE_VERTICES("VertexCreateVerts"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_CREATE_INDICES("VertexCreateIndices"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_DESTROY_BUFFER("VertexDestroyBuff"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_DESTROY_INDICES("VertexDestroyIndices"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_UPDATE_VERTS("VertexUpdateVerts"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_UPDATE_INDICES("VertexUpdateIndices"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_ALLOCATE_BUFFER("VertexAllocateBuffer"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_RESIZE_BUFFER("VertexResizeBuffer"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_MAP_BUFFER("VertexMapBuffer"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_MAP_BUFFER_VERTICES("VertexMapBufferVerts"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_MAP_BUFFER_INDICES("VertexMapBufferIndices"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_UNMAP_BUFFER("VertexUnmapBuffer"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_SET_STRIDE("VertexSetStride"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_SET_BUFFER("VertexSetBuffer"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_SETUP_VERTEX_BUFFER("VertexSetupVertBuff"); +LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_CLEANUP_CLASS("VertexCleanupClass"); + +LLMemType::DeclareMemType LLMemType::MTYPE_SPACE_PARTITION("SpacePartition"); + +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE("Pipeline"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_INIT("PipelineInit"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_CREATE_BUFFERS("PipelineCreateBuffs"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RESTORE_GL("PipelineRestroGL"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_UNLOAD_SHADERS("PipelineUnloadShaders"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_LIGHTING_DETAIL("PipelineLightingDetail"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_GET_POOL_TYPE("PipelineGetPoolType"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_ADD_POOL("PipelineAddPool"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_ALLOCATE_DRAWABLE("PipelineAllocDrawable"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_ADD_OBJECT("PipelineAddObj"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_CREATE_OBJECTS("PipelineCreateObjs"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_UPDATE_MOVE("PipelineUpdateMove"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_UPDATE_GEOM("PipelineUpdateGeom"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_MARK_VISIBLE("PipelineMarkVisible"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_MARK_MOVED("PipelineMarkMoved"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_MARK_SHIFT("PipelineMarkShift"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_SHIFT_OBJECTS("PipelineShiftObjs"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_MARK_TEXTURED("PipelineMarkTextured"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_MARK_REBUILD("PipelineMarkRebuild"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_UPDATE_CULL("PipelineUpdateCull"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_STATE_SORT("PipelineStateSort"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_POST_SORT("PipelinePostSort"); + +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_HUD_ELS("PipelineHudEls"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_HL("PipelineRenderHL"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_GEOM("PipelineRenderGeom"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_GEOM_DEFFERRED("PipelineRenderGeomDef"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_GEOM_POST_DEF("PipelineRenderGeomPostDef"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_GEOM_SHADOW("PipelineRenderGeomShadow"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_SELECT("PipelineRenderSelect"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_REBUILD_POOLS("PipelineRebuildPools"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_QUICK_LOOKUP("PipelineQuickLookup"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_OBJECTS("PipelineRenderObjs"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_GENERATE_IMPOSTOR("PipelineGenImpostors"); +LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_BLOOM("PipelineRenderBloom"); + +LLMemType::DeclareMemType LLMemType::MTYPE_UPKEEP_POOLS("UpkeepPools"); + +LLMemType::DeclareMemType LLMemType::MTYPE_AVATAR("Avatar"); +LLMemType::DeclareMemType LLMemType::MTYPE_AVATAR_MESH("AvatarMesh"); +LLMemType::DeclareMemType LLMemType::MTYPE_PARTICLES("Particles"); +LLMemType::DeclareMemType LLMemType::MTYPE_REGIONS("Regions"); + +LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY("Inventory"); +LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_DRAW("InventoryDraw"); +LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_BUILD_NEW_VIEWS("InventoryBuildNewViews"); +LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_DO_FOLDER("InventoryDoFolder"); +LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_POST_BUILD("InventoryPostBuild"); +LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_FROM_XML("InventoryFromXML"); +LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_CREATE_NEW_ITEM("InventoryCreateNewItem"); +LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_VIEW_INIT("InventoryViewInit"); +LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_VIEW_SHOW("InventoryViewShow"); +LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_VIEW_TOGGLE("InventoryViewToggle"); + +LLMemType::DeclareMemType LLMemType::MTYPE_ANIMATION("Animation"); +LLMemType::DeclareMemType LLMemType::MTYPE_VOLUME("Volume"); +LLMemType::DeclareMemType LLMemType::MTYPE_PRIMITIVE("Primitive"); + +LLMemType::DeclareMemType LLMemType::MTYPE_SCRIPT("Script"); +LLMemType::DeclareMemType LLMemType::MTYPE_SCRIPT_RUN("ScriptRun"); +LLMemType::DeclareMemType LLMemType::MTYPE_SCRIPT_BYTECODE("ScriptByteCode"); + +LLMemType::DeclareMemType LLMemType::MTYPE_IO_PUMP("IoPump"); +LLMemType::DeclareMemType LLMemType::MTYPE_IO_TCP("IoTCP"); +LLMemType::DeclareMemType LLMemType::MTYPE_IO_BUFFER("IoBuffer"); +LLMemType::DeclareMemType LLMemType::MTYPE_IO_HTTP_SERVER("IoHttpServer"); +LLMemType::DeclareMemType LLMemType::MTYPE_IO_SD_SERVER("IoSDServer"); +LLMemType::DeclareMemType LLMemType::MTYPE_IO_SD_CLIENT("IoSDClient"); +LLMemType::DeclareMemType LLMemType::MTYPE_IO_URL_REQUEST("IOUrlRequest"); + +LLMemType::DeclareMemType LLMemType::MTYPE_DIRECTX_INIT("DirectXInit"); + +LLMemType::DeclareMemType LLMemType::MTYPE_TEMP1("Temp1"); +LLMemType::DeclareMemType LLMemType::MTYPE_TEMP2("Temp2"); +LLMemType::DeclareMemType LLMemType::MTYPE_TEMP3("Temp3"); +LLMemType::DeclareMemType LLMemType::MTYPE_TEMP4("Temp4"); +LLMemType::DeclareMemType LLMemType::MTYPE_TEMP5("Temp5"); +LLMemType::DeclareMemType LLMemType::MTYPE_TEMP6("Temp6"); +LLMemType::DeclareMemType LLMemType::MTYPE_TEMP7("Temp7"); +LLMemType::DeclareMemType LLMemType::MTYPE_TEMP8("Temp8"); +LLMemType::DeclareMemType LLMemType::MTYPE_TEMP9("Temp9"); + +LLMemType::DeclareMemType LLMemType::MTYPE_OTHER("Other"); + + +LLMemType::DeclareMemType::DeclareMemType(char const * st) +{ + mID = (S32)mNameList.size(); + mName = st; + + mNameList.push_back(mName); +} + +LLMemType::DeclareMemType::~DeclareMemType() +{ +} + +LLMemType::LLMemType(LLMemType::DeclareMemType& dt) +{ + mTypeIndex = dt.mID; + LLAllocator::pushMemType(dt.mID); +} + +LLMemType::~LLMemType() +{ + LLAllocator::popMemType(); +} + +char const * LLMemType::getNameFromID(S32 id) +{ + if (id < 0 || id >= (S32)DeclareMemType::mNameList.size()) + { + return "INVALID"; + } + + return DeclareMemType::mNameList[id]; +} + diff --git a/indra/llcommon/llmemtype.h b/indra/llcommon/llmemtype.h index a9ebc2062f3ce2834e957143605f9a716bc3ea70..12310fcdb4fed67f4a58fddf3a68eea0deba0dec 100644 --- a/indra/llcommon/llmemtype.h +++ b/indra/llcommon/llmemtype.h @@ -36,128 +36,210 @@ //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -class LLMemType; - -extern void* ll_allocate (size_t size); -extern void ll_release (void *p); +//---------------------------------------------------------------------------- -#define MEM_TRACK_MEM 0 -#define MEM_TRACK_TYPE (1 && MEM_TRACK_MEM) +#include "linden_common.h" +//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// WARNING: Never commit with MEM_TRACK_MEM == 1 +//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#define MEM_TRACK_MEM (0 && LL_WINDOWS) -#if MEM_TRACK_TYPE -#define MEM_DUMP_DATA 1 -#define MEM_TYPE_NEW(T) \ -static void* operator new(size_t s) { LLMemType mt(T); return ll_allocate(s); } \ -static void operator delete(void* p) { ll_release(p); } +#include <vector> -#else #define MEM_TYPE_NEW(T) -#endif // MEM_TRACK_TYPE - - -//---------------------------------------------------------------------------- class LLMemType { public: - // Also update sTypeDesc in llmemory.cpp - enum EMemType - { - MTYPE_INIT, - MTYPE_STARTUP, - MTYPE_MAIN, - MTYPE_IMAGEBASE, - MTYPE_IMAGERAW, - MTYPE_IMAGEFORMATTED, - - MTYPE_APPFMTIMAGE, - MTYPE_APPRAWIMAGE, - MTYPE_APPAUXRAWIMAGE, - - MTYPE_DRAWABLE, - MTYPE_OBJECT, - MTYPE_VERTEX_DATA, - MTYPE_SPACE_PARTITION, - MTYPE_PIPELINE, - MTYPE_AVATAR, - MTYPE_AVATAR_MESH, - MTYPE_PARTICLES, - MTYPE_REGIONS, - MTYPE_INVENTORY, - MTYPE_ANIMATION, - MTYPE_VOLUME, - MTYPE_PRIMITIVE, - - MTYPE_NETWORK, - MTYPE_PHYSICS, - MTYPE_INTERESTLIST, - - MTYPE_SCRIPT, - MTYPE_SCRIPT_RUN, - MTYPE_SCRIPT_BYTECODE, - - MTYPE_IO_PUMP, - MTYPE_IO_TCP, - MTYPE_IO_BUFFER, - MTYPE_IO_HTTP_SERVER, - MTYPE_IO_SD_SERVER, - MTYPE_IO_SD_CLIENT, - MTYPE_IO_URL_REQUEST, - - MTYPE_TEMP1, - MTYPE_TEMP2, - MTYPE_TEMP3, - MTYPE_TEMP4, - MTYPE_TEMP5, - MTYPE_TEMP6, - MTYPE_TEMP7, - MTYPE_TEMP8, - MTYPE_TEMP9, - - MTYPE_OTHER, // Special, used by display code + // class we'll initialize all instances of as + // static members of MemType. Then use + // to construct any new mem type. + class DeclareMemType + { + public: + DeclareMemType(char const * st); + ~DeclareMemType(); + + S32 mID; + char const * mName; - MTYPE_NUM_TYPES + // array so we can map an index ID to Name + static std::vector<char const *> mNameList; }; - enum { MTYPE_MAX_DEPTH = 64 }; - -public: - LLMemType(EMemType type) - { -#if MEM_TRACK_TYPE - if (type < 0 || type >= MTYPE_NUM_TYPES) - llerrs << "LLMemType error" << llendl; - if (sCurDepth < 0 || sCurDepth >= MTYPE_MAX_DEPTH) - llerrs << "LLMemType error" << llendl; - sType[sCurDepth] = sCurType; - sCurDepth++; - sCurType = type; -#endif - } - ~LLMemType() - { -#if MEM_TRACK_TYPE - sCurDepth--; - sCurType = sType[sCurDepth]; -#endif - } - static void reset(); - static void printMem(); + LLMemType(DeclareMemType& dt); + ~LLMemType(); + + static char const * getNameFromID(S32 id); + + static DeclareMemType MTYPE_INIT; + static DeclareMemType MTYPE_STARTUP; + static DeclareMemType MTYPE_MAIN; + static DeclareMemType MTYPE_FRAME; + + static DeclareMemType MTYPE_GATHER_INPUT; + static DeclareMemType MTYPE_JOY_KEY; + + static DeclareMemType MTYPE_IDLE; + static DeclareMemType MTYPE_IDLE_PUMP; + static DeclareMemType MTYPE_IDLE_NETWORK; + static DeclareMemType MTYPE_IDLE_UPDATE_REGIONS; + static DeclareMemType MTYPE_IDLE_UPDATE_VIEWER_REGION; + static DeclareMemType MTYPE_IDLE_UPDATE_SURFACE; + static DeclareMemType MTYPE_IDLE_UPDATE_PARCEL_OVERLAY; + static DeclareMemType MTYPE_IDLE_AUDIO; + + static DeclareMemType MTYPE_CACHE_PROCESS_PENDING; + static DeclareMemType MTYPE_CACHE_PROCESS_PENDING_ASKS; + static DeclareMemType MTYPE_CACHE_PROCESS_PENDING_REPLIES; + + static DeclareMemType MTYPE_MESSAGE_CHECK_ALL; + static DeclareMemType MTYPE_MESSAGE_PROCESS_ACKS; + + static DeclareMemType MTYPE_RENDER; + static DeclareMemType MTYPE_SLEEP; + + static DeclareMemType MTYPE_NETWORK; + static DeclareMemType MTYPE_PHYSICS; + static DeclareMemType MTYPE_INTERESTLIST; + + static DeclareMemType MTYPE_IMAGEBASE; + static DeclareMemType MTYPE_IMAGERAW; + static DeclareMemType MTYPE_IMAGEFORMATTED; -public: -#if MEM_TRACK_TYPE - static S32 sCurDepth; - static S32 sCurType; - static S32 sType[MTYPE_MAX_DEPTH]; - static S32 sMemCount[MTYPE_NUM_TYPES]; - static S32 sMaxMemCount[MTYPE_NUM_TYPES]; - static S32 sNewCount[MTYPE_NUM_TYPES]; - static S32 sOverheadMem; - static const char* sTypeDesc[MTYPE_NUM_TYPES]; -#endif - static S32 sTotalMem; - static S32 sMaxTotalMem; + static DeclareMemType MTYPE_APPFMTIMAGE; + static DeclareMemType MTYPE_APPRAWIMAGE; + static DeclareMemType MTYPE_APPAUXRAWIMAGE; + + static DeclareMemType MTYPE_DRAWABLE; + + static DeclareMemType MTYPE_OBJECT; + static DeclareMemType MTYPE_OBJECT_PROCESS_UPDATE; + static DeclareMemType MTYPE_OBJECT_PROCESS_UPDATE_CORE; + + static DeclareMemType MTYPE_DISPLAY; + static DeclareMemType MTYPE_DISPLAY_UPDATE; + static DeclareMemType MTYPE_DISPLAY_UPDATE_CAMERA; + static DeclareMemType MTYPE_DISPLAY_UPDATE_GEOM; + static DeclareMemType MTYPE_DISPLAY_SWAP; + static DeclareMemType MTYPE_DISPLAY_UPDATE_HUD; + static DeclareMemType MTYPE_DISPLAY_GEN_REFLECTION; + static DeclareMemType MTYPE_DISPLAY_IMAGE_UPDATE; + static DeclareMemType MTYPE_DISPLAY_STATE_SORT; + static DeclareMemType MTYPE_DISPLAY_SKY; + static DeclareMemType MTYPE_DISPLAY_RENDER_GEOM; + static DeclareMemType MTYPE_DISPLAY_RENDER_FLUSH; + static DeclareMemType MTYPE_DISPLAY_RENDER_UI; + static DeclareMemType MTYPE_DISPLAY_RENDER_ATTACHMENTS; + + static DeclareMemType MTYPE_VERTEX_DATA; + static DeclareMemType MTYPE_VERTEX_CONSTRUCTOR; + static DeclareMemType MTYPE_VERTEX_DESTRUCTOR; + static DeclareMemType MTYPE_VERTEX_CREATE_VERTICES; + static DeclareMemType MTYPE_VERTEX_CREATE_INDICES; + static DeclareMemType MTYPE_VERTEX_DESTROY_BUFFER; + static DeclareMemType MTYPE_VERTEX_DESTROY_INDICES; + static DeclareMemType MTYPE_VERTEX_UPDATE_VERTS; + static DeclareMemType MTYPE_VERTEX_UPDATE_INDICES; + static DeclareMemType MTYPE_VERTEX_ALLOCATE_BUFFER; + static DeclareMemType MTYPE_VERTEX_RESIZE_BUFFER; + static DeclareMemType MTYPE_VERTEX_MAP_BUFFER; + static DeclareMemType MTYPE_VERTEX_MAP_BUFFER_VERTICES; + static DeclareMemType MTYPE_VERTEX_MAP_BUFFER_INDICES; + static DeclareMemType MTYPE_VERTEX_UNMAP_BUFFER; + static DeclareMemType MTYPE_VERTEX_SET_STRIDE; + static DeclareMemType MTYPE_VERTEX_SET_BUFFER; + static DeclareMemType MTYPE_VERTEX_SETUP_VERTEX_BUFFER; + static DeclareMemType MTYPE_VERTEX_CLEANUP_CLASS; + + static DeclareMemType MTYPE_SPACE_PARTITION; + + static DeclareMemType MTYPE_PIPELINE; + static DeclareMemType MTYPE_PIPELINE_INIT; + static DeclareMemType MTYPE_PIPELINE_CREATE_BUFFERS; + static DeclareMemType MTYPE_PIPELINE_RESTORE_GL; + static DeclareMemType MTYPE_PIPELINE_UNLOAD_SHADERS; + static DeclareMemType MTYPE_PIPELINE_LIGHTING_DETAIL; + static DeclareMemType MTYPE_PIPELINE_GET_POOL_TYPE; + static DeclareMemType MTYPE_PIPELINE_ADD_POOL; + static DeclareMemType MTYPE_PIPELINE_ALLOCATE_DRAWABLE; + static DeclareMemType MTYPE_PIPELINE_ADD_OBJECT; + static DeclareMemType MTYPE_PIPELINE_CREATE_OBJECTS; + static DeclareMemType MTYPE_PIPELINE_UPDATE_MOVE; + static DeclareMemType MTYPE_PIPELINE_UPDATE_GEOM; + static DeclareMemType MTYPE_PIPELINE_MARK_VISIBLE; + static DeclareMemType MTYPE_PIPELINE_MARK_MOVED; + static DeclareMemType MTYPE_PIPELINE_MARK_SHIFT; + static DeclareMemType MTYPE_PIPELINE_SHIFT_OBJECTS; + static DeclareMemType MTYPE_PIPELINE_MARK_TEXTURED; + static DeclareMemType MTYPE_PIPELINE_MARK_REBUILD; + static DeclareMemType MTYPE_PIPELINE_UPDATE_CULL; + static DeclareMemType MTYPE_PIPELINE_STATE_SORT; + static DeclareMemType MTYPE_PIPELINE_POST_SORT; + + static DeclareMemType MTYPE_PIPELINE_RENDER_HUD_ELS; + static DeclareMemType MTYPE_PIPELINE_RENDER_HL; + static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM; + static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_DEFFERRED; + static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_POST_DEF; + static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_SHADOW; + static DeclareMemType MTYPE_PIPELINE_RENDER_SELECT; + static DeclareMemType MTYPE_PIPELINE_REBUILD_POOLS; + static DeclareMemType MTYPE_PIPELINE_QUICK_LOOKUP; + static DeclareMemType MTYPE_PIPELINE_RENDER_OBJECTS; + static DeclareMemType MTYPE_PIPELINE_GENERATE_IMPOSTOR; + static DeclareMemType MTYPE_PIPELINE_RENDER_BLOOM; + + static DeclareMemType MTYPE_UPKEEP_POOLS; + + static DeclareMemType MTYPE_AVATAR; + static DeclareMemType MTYPE_AVATAR_MESH; + static DeclareMemType MTYPE_PARTICLES; + static DeclareMemType MTYPE_REGIONS; + + static DeclareMemType MTYPE_INVENTORY; + static DeclareMemType MTYPE_INVENTORY_DRAW; + static DeclareMemType MTYPE_INVENTORY_BUILD_NEW_VIEWS; + static DeclareMemType MTYPE_INVENTORY_DO_FOLDER; + static DeclareMemType MTYPE_INVENTORY_POST_BUILD; + static DeclareMemType MTYPE_INVENTORY_FROM_XML; + static DeclareMemType MTYPE_INVENTORY_CREATE_NEW_ITEM; + static DeclareMemType MTYPE_INVENTORY_VIEW_INIT; + static DeclareMemType MTYPE_INVENTORY_VIEW_SHOW; + static DeclareMemType MTYPE_INVENTORY_VIEW_TOGGLE; + + static DeclareMemType MTYPE_ANIMATION; + static DeclareMemType MTYPE_VOLUME; + static DeclareMemType MTYPE_PRIMITIVE; + + static DeclareMemType MTYPE_SCRIPT; + static DeclareMemType MTYPE_SCRIPT_RUN; + static DeclareMemType MTYPE_SCRIPT_BYTECODE; + + static DeclareMemType MTYPE_IO_PUMP; + static DeclareMemType MTYPE_IO_TCP; + static DeclareMemType MTYPE_IO_BUFFER; + static DeclareMemType MTYPE_IO_HTTP_SERVER; + static DeclareMemType MTYPE_IO_SD_SERVER; + static DeclareMemType MTYPE_IO_SD_CLIENT; + static DeclareMemType MTYPE_IO_URL_REQUEST; + + static DeclareMemType MTYPE_DIRECTX_INIT; + + static DeclareMemType MTYPE_TEMP1; + static DeclareMemType MTYPE_TEMP2; + static DeclareMemType MTYPE_TEMP3; + static DeclareMemType MTYPE_TEMP4; + static DeclareMemType MTYPE_TEMP5; + static DeclareMemType MTYPE_TEMP6; + static DeclareMemType MTYPE_TEMP7; + static DeclareMemType MTYPE_TEMP8; + static DeclareMemType MTYPE_TEMP9; + + static DeclareMemType MTYPE_OTHER; // Special; used by display code + + S32 mTypeIndex; }; //---------------------------------------------------------------------------- diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h new file mode 100644 index 0000000000000000000000000000000000000000..2c37eadcc65c8f91171750c4f8f72ea15c6861f6 --- /dev/null +++ b/indra/llcommon/llpointer.h @@ -0,0 +1,177 @@ +/** + * @file llpointer.h + * @brief A reference-counted pointer for objects derived from LLRefCount + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLPOINTER_H +#define LLPOINTER_H + +#include "llerror.h" // *TODO: consider eliminating this + +//---------------------------------------------------------------------------- +// RefCount objects should generally only be accessed by way of LLPointer<>'s +// NOTE: LLPointer<LLFoo> x = new LLFoo(); MAY NOT BE THREAD SAFE +// if LLFoo::LLFoo() does anything like put itself in an update queue. +// The queue may get accessed before it gets assigned to x. +// The correct implementation is: +// LLPointer<LLFoo> x = new LLFoo; // constructor does not do anything interesting +// x->instantiate(); // does stuff like place x into an update queue + +// see llthread.h for LLThreadSafeRefCount + +//---------------------------------------------------------------------------- + +// Note: relies on Type having ref() and unref() methods +template <class Type> class LLPointer +{ +public: + + LLPointer() : + mPointer(NULL) + { + } + + LLPointer(Type* ptr) : + mPointer(ptr) + { + ref(); + } + + LLPointer(const LLPointer<Type>& ptr) : + mPointer(ptr.mPointer) + { + ref(); + } + + // support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. + template<typename Subclass> + LLPointer(const LLPointer<Subclass>& ptr) : + mPointer(ptr.get()) + { + ref(); + } + + ~LLPointer() + { + unref(); + } + + Type* get() const { return mPointer; } + const Type* operator->() const { return mPointer; } + Type* operator->() { return mPointer; } + const Type& operator*() const { return *mPointer; } + Type& operator*() { return *mPointer; } + + operator BOOL() const { return (mPointer != NULL); } + operator bool() const { return (mPointer != NULL); } + bool operator!() const { return (mPointer == NULL); } + bool isNull() const { return (mPointer == NULL); } + bool notNull() const { return (mPointer != NULL); } + + operator Type*() const { return mPointer; } + operator const Type*() const { return mPointer; } + bool operator !=(Type* ptr) const { return (mPointer != ptr); } + bool operator ==(Type* ptr) const { return (mPointer == ptr); } + bool operator ==(const LLPointer<Type>& ptr) const { return (mPointer == ptr.mPointer); } + bool operator < (const LLPointer<Type>& ptr) const { return (mPointer < ptr.mPointer); } + bool operator > (const LLPointer<Type>& ptr) const { return (mPointer > ptr.mPointer); } + + LLPointer<Type>& operator =(Type* ptr) + { + if( mPointer != ptr ) + { + unref(); + mPointer = ptr; + ref(); + } + + return *this; + } + + LLPointer<Type>& operator =(const LLPointer<Type>& ptr) + { + if( mPointer != ptr.mPointer ) + { + unref(); + mPointer = ptr.mPointer; + ref(); + } + return *this; + } + + // support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. + template<typename Subclass> + LLPointer<Type>& operator =(const LLPointer<Subclass>& ptr) + { + if( mPointer != ptr.get() ) + { + unref(); + mPointer = ptr.get(); + ref(); + } + return *this; + } + + // Just exchange the pointers, which will not change the reference counts. + static void swap(LLPointer<Type>& a, LLPointer<Type>& b) + { + Type* temp = a.mPointer; + a.mPointer = b.mPointer; + b.mPointer = temp; + } + +protected: + void ref() + { + if (mPointer) + { + mPointer->ref(); + } + } + + void unref() + { + if (mPointer) + { + Type *tempp = mPointer; + mPointer = NULL; + tempp->unref(); + if (mPointer != NULL) + { + llwarns << "Unreference did assignment to non-NULL because of destructor" << llendl; + unref(); + } + } + } + +protected: + Type* mPointer; +}; + +#endif diff --git a/indra/llcommon/llptrto.cpp b/indra/llcommon/llptrto.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ce93f09489ec95b5c14b27dd0859f80cbd8a45b7 --- /dev/null +++ b/indra/llcommon/llptrto.cpp @@ -0,0 +1,108 @@ +/** + * @file llptrto.cpp + * @author Nat Goodspeed + * @date 2008-08-20 + * @brief Test for llptrto.h + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +// Precompiled header +#include "linden_common.h" +// associated header +#include "llptrto.h" +// STL headers +// std headers +// external library headers +#include <boost/type_traits/is_same.hpp> +#include <boost/static_assert.hpp> +// other Linden headers +#include "llmemory.h" + +// a refcounted class +class RCFoo: public LLRefCount +{ +public: + RCFoo() {} +}; + +// a refcounted subclass +class RCSubFoo: public RCFoo +{ +public: + RCSubFoo() {} +}; + +// a refcounted class using the other refcount base class +class TSRCFoo: public LLThreadSafeRefCount +{ +public: + TSRCFoo() {} +}; + +// a non-refcounted class +class Bar +{ +public: + Bar() {} +}; + +// a non-refcounted subclass +class SubBar: public Bar +{ +public: + SubBar() {} +}; + +int main(int argc, char *argv[]) +{ + // test LLPtrTo<> + BOOST_STATIC_ASSERT((boost::is_same<LLPtrTo<RCFoo>::type, LLPointer<RCFoo> >::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLPtrTo<RCSubFoo>::type, LLPointer<RCSubFoo> >::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLPtrTo<TSRCFoo>::type, LLPointer<TSRCFoo> >::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLPtrTo<Bar>::type, Bar*>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLPtrTo<SubBar>::type, SubBar*>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLPtrTo<int>::type, int*>::value)); + + // Test LLRemovePointer<>. Note that we remove both pointer variants from + // each kind of type, regardless of whether the variant makes sense. + BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer<RCFoo*>::type, RCFoo>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer< LLPointer<RCFoo> >::type, RCFoo>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer<RCSubFoo*>::type, RCSubFoo>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer< LLPointer<RCSubFoo> >::type, RCSubFoo>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer<TSRCFoo*>::type, TSRCFoo>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer< LLPointer<TSRCFoo> >::type, TSRCFoo>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer<Bar*>::type, Bar>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer< LLPointer<Bar> >::type, Bar>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer<SubBar*>::type, SubBar>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer< LLPointer<SubBar> >::type, SubBar>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer<int*>::type, int>::value)); + BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer< LLPointer<int> >::type, int>::value)); + + return 0; +} diff --git a/indra/llcommon/llptrto.h b/indra/llcommon/llptrto.h new file mode 100644 index 0000000000000000000000000000000000000000..74c117a7f6a286478ed0c5f24cd41c9af3ffa207 --- /dev/null +++ b/indra/llcommon/llptrto.h @@ -0,0 +1,93 @@ +/** + * @file llptrto.h + * @author Nat Goodspeed + * @date 2008-08-19 + * @brief LLPtrTo<TARGET> is a template helper to pick either TARGET* or -- when + * TARGET is a subclass of LLRefCount or LLThreadSafeRefCount -- + * LLPointer<TARGET>. LLPtrTo<> chooses whichever pointer type is best. + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#if ! defined(LL_LLPTRTO_H) +#define LL_LLPTRTO_H + +#include "llpointer.h" +#include "llrefcount.h" // LLRefCount +#include "llthread.h" // LLThreadSafeRefCount +#include <boost/type_traits/is_base_of.hpp> +#include <boost/type_traits/remove_pointer.hpp> +#include <boost/utility/enable_if.hpp> + +/** + * LLPtrTo<TARGET>::type is either of two things: + * + * * When TARGET is a subclass of either LLRefCount or LLThreadSafeRefCount, + * LLPtrTo<TARGET>::type is LLPointer<TARGET>. + * * Otherwise, LLPtrTo<TARGET>::type is TARGET*. + * + * This way, a class template can use LLPtrTo<TARGET>::type to select an + * appropriate pointer type to store. + */ +template <class T, class ENABLE=void> +struct LLPtrTo +{ + typedef T* type; +}; + +/// specialize for subclasses of LLRefCount +template <class T> +struct LLPtrTo<T, typename boost::enable_if< boost::is_base_of<LLRefCount, T> >::type> +{ + typedef LLPointer<T> type; +}; + +/// specialize for subclasses of LLThreadSafeRefCount +template <class T> +struct LLPtrTo<T, typename boost::enable_if< boost::is_base_of<LLThreadSafeRefCount, T> >::type> +{ + typedef LLPointer<T> type; +}; + +/** + * LLRemovePointer<PTRTYPE>::type gets you the underlying (pointee) type. + */ +template <typename PTRTYPE> +struct LLRemovePointer +{ + typedef typename boost::remove_pointer<PTRTYPE>::type type; +}; + +/// specialize for LLPointer<SOMECLASS> +template <typename SOMECLASS> +struct LLRemovePointer< LLPointer<SOMECLASS> > +{ + typedef SOMECLASS type; +}; + +#endif /* ! defined(LL_LLPTRTO_H) */ diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index cd53e701d252ce14c6915283ae883b19a036e89b..3db5c365454ed056156f3a773068113412acd958 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -31,7 +31,9 @@ #include "linden_common.h" #include "llqueuedthread.h" + #include "llstl.h" +#include "lltimer.h" // ms_sleep() //============================================================================ diff --git a/indra/llcommon/llrefcount.cpp b/indra/llcommon/llrefcount.cpp new file mode 100644 index 0000000000000000000000000000000000000000..33b6875fb0e65e9eb24964483717304f3ec7fddf --- /dev/null +++ b/indra/llcommon/llrefcount.cpp @@ -0,0 +1,49 @@ +/** + * @file llrefcount.cpp + * @brief Base class for reference counted objects for use with LLPointer + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "llrefcount.h" + +#include "llerror.h" + +LLRefCount::LLRefCount() : + mRef(0) +{ +} + +LLRefCount::~LLRefCount() +{ + if (mRef != 0) + { + llerrs << "deleting non-zero reference" << llendl; + } +} diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h new file mode 100644 index 0000000000000000000000000000000000000000..540a18b8a0b0d28731d125ca37231cbc6f66172b --- /dev/null +++ b/indra/llcommon/llrefcount.h @@ -0,0 +1,78 @@ +/** + * @file llrefcount.h + * @brief Base class for reference counted objects for use with LLPointer + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLREFCOUNT_H +#define LLREFCOUNT_H + +//---------------------------------------------------------------------------- +// RefCount objects should generally only be accessed by way of LLPointer<>'s +// see llthread.h for LLThreadSafeRefCount +//---------------------------------------------------------------------------- + +class LLRefCount +{ +protected: + LLRefCount(const LLRefCount&); // not implemented +private: + LLRefCount&operator=(const LLRefCount&); // not implemented + +protected: + virtual ~LLRefCount(); // use unref() + +public: + LLRefCount(); + + void ref() + { + mRef++; + } + + S32 unref() + { + llassert(mRef >= 1); + if (0 == --mRef) + { + delete this; + return 0; + } + return mRef; + } + + S32 getNumRefs() const + { + return mRef; + } + +private: + S32 mRef; +}; + +#endif diff --git a/indra/llcommon/llsafehandle.h b/indra/llcommon/llsafehandle.h new file mode 100644 index 0000000000000000000000000000000000000000..1f7c682fd1b60698cfa1f7798e14f7b450b4b74e --- /dev/null +++ b/indra/llcommon/llsafehandle.h @@ -0,0 +1,167 @@ +/** + * @file llsafehandle.h + * @brief Reference-counted object where Object() is valid, not NULL. + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLSAFEHANDLE_H +#define LLSAFEHANDLE_H + +#include "llerror.h" // *TODO: consider eliminating this + +// Expands LLPointer to return a pointer to a special instance of class Type instead of NULL. +// This is useful in instances where operations on NULL pointers are semantically safe and/or +// when error checking occurs at a different granularity or in a different part of the code +// than when referencing an object via a LLSafeHandle. + +template <class Type> +class LLSafeHandle +{ +public: + LLSafeHandle() : + mPointer(NULL) + { + } + + LLSafeHandle(Type* ptr) : + mPointer(NULL) + { + assign(ptr); + } + + LLSafeHandle(const LLSafeHandle<Type>& ptr) : + mPointer(NULL) + { + assign(ptr.mPointer); + } + + // support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. + template<typename Subclass> + LLSafeHandle(const LLSafeHandle<Subclass>& ptr) : + mPointer(NULL) + { + assign(ptr.get()); + } + + ~LLSafeHandle() + { + unref(); + } + + const Type* operator->() const { return nonNull(mPointer); } + Type* operator->() { return nonNull(mPointer); } + + Type* get() const { return mPointer; } + // we disallow these operations as they expose our null objects to direct manipulation + // and bypass the reference counting semantics + //const Type& operator*() const { return *nonNull(mPointer); } + //Type& operator*() { return *nonNull(mPointer); } + + operator BOOL() const { return mPointer != NULL; } + operator bool() const { return mPointer != NULL; } + bool operator!() const { return mPointer == NULL; } + bool isNull() const { return mPointer == NULL; } + bool notNull() const { return mPointer != NULL; } + + + operator Type*() const { return mPointer; } + operator const Type*() const { return mPointer; } + bool operator !=(Type* ptr) const { return (mPointer != ptr); } + bool operator ==(Type* ptr) const { return (mPointer == ptr); } + bool operator ==(const LLSafeHandle<Type>& ptr) const { return (mPointer == ptr.mPointer); } + bool operator < (const LLSafeHandle<Type>& ptr) const { return (mPointer < ptr.mPointer); } + bool operator > (const LLSafeHandle<Type>& ptr) const { return (mPointer > ptr.mPointer); } + + LLSafeHandle<Type>& operator =(Type* ptr) + { + assign(ptr); + return *this; + } + + LLSafeHandle<Type>& operator =(const LLSafeHandle<Type>& ptr) + { + assign(ptr.mPointer); + return *this; + } + + // support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. + template<typename Subclass> + LLSafeHandle<Type>& operator =(const LLSafeHandle<Subclass>& ptr) + { + assign(ptr.get()); + return *this; + } + +public: + typedef Type* (*NullFunc)(); + static const NullFunc sNullFunc; + +protected: + void ref() + { + if (mPointer) + { + mPointer->ref(); + } + } + + void unref() + { + if (mPointer) + { + Type *tempp = mPointer; + mPointer = NULL; + tempp->unref(); + if (mPointer != NULL) + { + llwarns << "Unreference did assignment to non-NULL because of destructor" << llendl; + unref(); + } + } + } + + void assign(Type* ptr) + { + if( mPointer != ptr ) + { + unref(); + mPointer = ptr; + ref(); + } + } + + static Type* nonNull(Type* ptr) + { + return ptr == NULL ? sNullFunc() : ptr; + } + +protected: + Type* mPointer; +}; + +#endif diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index 7a66d70d3f71f76b0dd3713dae24e1ef25d15211..cf337be1615fc7860c478d1772ebc9c6b9f14f3b 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -34,7 +34,7 @@ #include "linden_common.h" #include "llsdserialize.h" -#include "llmemory.h" +#include "llpointer.h" #include "llstreamtools.h" // for fullread #include <iostream> diff --git a/indra/llcommon/llsdserialize.h b/indra/llcommon/llsdserialize.h index bb38b75d8fdc370df794033a9fb76029355bbe7f..7463d1e5ddd345067d3ee7d2335ff9b1e84678a9 100644 --- a/indra/llcommon/llsdserialize.h +++ b/indra/llcommon/llsdserialize.h @@ -36,8 +36,9 @@ #define LL_LLSDSERIALIZE_H #include <iosfwd> +#include "llpointer.h" +#include "llrefcount.h" #include "llsd.h" -#include "llmemory.h" /** * @class LLSDParser diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index aa0e0f36969537e459aaf69f986e64f4547cc5c8..0202a033c3ccab7d5bd87f7d11701ad62f20d07c 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -171,6 +171,15 @@ char* ll_print_sd(const LLSD& sd) return buffer; } +char* ll_pretty_print_sd_ptr(const LLSD* sd) +{ + if (sd) + { + return ll_pretty_print_sd(*sd); + } + return NULL; +} + char* ll_pretty_print_sd(const LLSD& sd) { const U32 bufferSize = 10 * 1024; diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h index b67ad521ea4562808164e4f29942bbe1e9cf9fc2..501600f1d906a367c14c8b520f7bafd8062730bd 100644 --- a/indra/llcommon/llsdutil.h +++ b/indra/llcommon/llsdutil.h @@ -89,6 +89,7 @@ LLSD ll_binary_from_string(const LLSD& sd); char* ll_print_sd(const LLSD& sd); // Serializes sd to static buffer and returns pointer, using "pretty printing" mode. +char* ll_pretty_print_sd_ptr(const LLSD* sd); char* ll_pretty_print_sd(const LLSD& sd); //compares the structure of an LLSD to a template LLSD and stores the diff --git a/indra/llcommon/llsecondlifeurls.cpp b/indra/llcommon/llsecondlifeurls.cpp index 36d8e8870fe6b42a6e7c2a9346436178ccc7eeca..6323d9d36ba4e8af00393cb2aa9c87cdf30fb289 100644 --- a/indra/llcommon/llsecondlifeurls.cpp +++ b/indra/llcommon/llsecondlifeurls.cpp @@ -32,57 +32,59 @@ #include "linden_common.h" #include "llsecondlifeurls.h" - +/* const std::string CREATE_ACCOUNT_URL ( "http://secondlife.com/registration/"); const std::string MANAGE_ACCOUNT ( - "http://secondlife.com/account/"); + "http://secondlife.com/account/"); // *TODO: NOT USED const std::string AUCTION_URL ( "http://secondlife.com/auctions/auction-detail.php?id="); const std::string EVENTS_URL ( "http://secondlife.com/events/"); - +*/ const std::string TIER_UP_URL ( - "http://secondlife.com/app/landtier"); + "http://secondlife.com/app/landtier"); // *TODO: Translate (simulator) +const std::string DIRECTX_9_URL ( + "http://secondlife.com/support/"); // *TODO: NOT USED +/* const std::string LAND_URL ( - "http://secondlife.com/app/landtier"); + "http://secondlife.com/app/landtier"); // *TODO: NOT USED const std::string UPGRADE_TO_PREMIUM_URL ( - "http://secondlife.com/app/upgrade/"); - -const std::string DIRECTX_9_URL ( - "http://secondlife.com/support/"); + "http://secondlife.com/app/upgrade/"); // *TODO: NOT USED const std::string AMD_AGP_URL ( - "http://secondlife.com/support/"); + "http://secondlife.com/support/"); // *TODO: NOT USED const std::string VIA_URL ( - "http://secondlife.com/support/"); + "http://secondlife.com/support/"); // *TODO: NOT USED const std::string SUPPORT_URL ( "http://secondlife.com/support/"); const std::string INTEL_CHIPSET_URL ( - "http://secondlife.com/support/"); + "http://secondlife.com/support/"); // *TODO: NOT USED const std::string SIS_CHIPSET_URL ( - "http://secondlife.com/support/"); + "http://secondlife.com/support/"); // *TODO: NOT USED const std::string BLOGS_URL ( - "http://blog.secondlife.com/"); + "http://blog.secondlife.com/"); // *TODO: NOT USED const std::string BUY_CURRENCY_URL ( "http://secondlife.com/app/currency/"); const std::string LSL_DOC_URL ( - "http://secondlife.com/app/lsldoc/"); + "http://secondlife.com/app/lsldoc/"); // *TODO: NOT USED const std::string SL_KB_URL ( - "http://secondlife.com/knowledgebase/"); + "http://secondlife.com/knowledgebase/"); // *TODO: NOT USED const std::string RELEASE_NOTES_BASE_URL ( "http://secondlife.com/app/releasenotes/"); +*/ + diff --git a/indra/llcommon/llsecondlifeurls.h b/indra/llcommon/llsecondlifeurls.h index 9fd75c363b08b017aaf342ec84e3bbc8ca774f45..a2e5f0b9c60f6e3c385ae0a5113e675a2dfe792c 100644 --- a/indra/llcommon/llsecondlifeurls.h +++ b/indra/llcommon/llsecondlifeurls.h @@ -32,7 +32,7 @@ #ifndef LL_LLSECONDLIFEURLS_H #define LL_LLSECONDLIFEURLS_H - +/* // Account registration web page extern const std::string CREATE_ACCOUNT_URL; @@ -42,18 +42,21 @@ extern const std::string MANAGE_ACCOUNT; extern const std::string AUCTION_URL; extern const std::string EVENTS_URL; - +*/ // Tier up to a new land level. extern const std::string TIER_UP_URL; + // Tier up to a new land level. extern const std::string LAND_URL; +// How to get DirectX 9 +extern const std::string DIRECTX_9_URL; + +/* // Upgrade from basic membership to premium membership extern const std::string UPGRADE_TO_PREMIUM_URL; -// How to get DirectX 9 -extern const std::string DIRECTX_9_URL; // Out of date VIA chipset extern const std::string VIA_URL; @@ -75,5 +78,5 @@ extern const std::string SL_KB_URL; // Release Notes Redirect URL for Server and Viewer extern const std::string RELEASE_NOTES_BASE_URL; - +*/ #endif diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h new file mode 100644 index 0000000000000000000000000000000000000000..dc1457e4f726b7fbe393a5ef70d2e019e3ac47a5 --- /dev/null +++ b/indra/llcommon/llsingleton.h @@ -0,0 +1,158 @@ +/** + * @file llsingleton.h + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLSINGLETON_H +#define LLSINGLETON_H + +#include "llerror.h" // *TODO: eliminate this + +#include <boost/noncopyable.hpp> + +// LLSingleton implements the getInstance() method part of the Singleton +// pattern. It can't make the derived class constructors protected, though, so +// you have to do that yourself. +// +// There are two ways to use LLSingleton. The first way is to inherit from it +// while using the typename that you'd like to be static as the template +// parameter, like so: +// +// class Foo: public LLSingleton<Foo>{}; +// +// Foo& instance = Foo::instance(); +// +// The second way is to use the singleton class directly, without inheritance: +// +// typedef LLSingleton<Foo> FooSingleton; +// +// Foo& instance = FooSingleton::instance(); +// +// In this case, the class being managed as a singleton needs to provide an +// initSingleton() method since the LLSingleton virtual method won't be +// available +// +// As currently written, it is not thread-safe. + +template <typename DERIVED_TYPE> +class LLSingleton : private boost::noncopyable +{ + +private: + typedef enum e_init_state + { + UNINITIALIZED, + CONSTRUCTING, + INITIALIZING, + INITIALIZED, + DELETED + } EInitState; + + static void deleteSingleton() + { + delete getData().mSingletonInstance; + getData().mSingletonInstance = NULL; + } + + // stores pointer to singleton instance + // and tracks initialization state of singleton + struct SingletonInstanceData + { + EInitState mInitState; + DERIVED_TYPE* mSingletonInstance; + + SingletonInstanceData() + : mSingletonInstance(NULL), + mInitState(UNINITIALIZED) + {} + + ~SingletonInstanceData() + { + deleteSingleton(); + } + }; + +public: + virtual ~LLSingleton() + { + SingletonInstanceData& data = getData(); + data.mSingletonInstance = NULL; + data.mInitState = DELETED; + } + + static SingletonInstanceData& getData() + { + static SingletonInstanceData data; + return data; + } + + static DERIVED_TYPE* getInstance() + { + SingletonInstanceData& data = getData(); + + if (data.mInitState == CONSTRUCTING) + { + llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from singleton constructor!" << llendl; + } + + if (data.mInitState == DELETED) + { + llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << llendl; + } + + if (!data.mSingletonInstance) + { + data.mInitState = CONSTRUCTING; + data.mSingletonInstance = new DERIVED_TYPE(); + data.mInitState = INITIALIZING; + data.mSingletonInstance->initSingleton(); + data.mInitState = INITIALIZED; + } + + return data.mSingletonInstance; + } + + // Reference version of getInstance() + // Preferred over getInstance() as it disallows checking for NULL + static DERIVED_TYPE& instance() + { + return *getInstance(); + } + + // Has this singleton already been deleted? + // Use this to avoid accessing singletons from a static object's destructor + static bool destroyed() + { + return getData().mInitState == DELETED; + } + +private: + virtual void initSingleton() {} +}; + +#endif diff --git a/indra/llcommon/llstacktrace.cpp b/indra/llcommon/llstacktrace.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4be91b5b11f48b8128f5ba50b796da73b4102a99 --- /dev/null +++ b/indra/llcommon/llstacktrace.cpp @@ -0,0 +1,141 @@ +/** + * @file llstacktrace.cpp + * @brief stack tracing functionality + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llstacktrace.h" + +#ifdef LL_WINDOWS + +#include <iostream> +#include <sstream> + +#include "windows.h" +#include "Dbghelp.h" + +typedef USHORT NTAPI RtlCaptureStackBackTrace_Function( + IN ULONG frames_to_skip, + IN ULONG frames_to_capture, + OUT PVOID *backtrace, + OUT PULONG backtrace_hash); + +static RtlCaptureStackBackTrace_Function* const RtlCaptureStackBackTrace_fn = + (RtlCaptureStackBackTrace_Function*) + GetProcAddress(GetModuleHandleA("ntdll.dll"), "RtlCaptureStackBackTrace"); + +bool ll_get_stack_trace(std::vector<std::string>& lines) +{ + const S32 MAX_STACK_DEPTH = 32; + const S32 STRING_NAME_LENGTH = 200; + const S32 FRAME_SKIP = 2; + static BOOL symbolsLoaded = false; + static BOOL firstCall = true; + + HANDLE hProc = GetCurrentProcess(); + + // load the symbols if they're not loaded + if(!symbolsLoaded && firstCall) + { + symbolsLoaded = SymInitialize(hProc, NULL, true); + firstCall = false; + } + + // if loaded, get the call stack + if(symbolsLoaded) + { + // create the frames to hold the addresses + void* frames[MAX_STACK_DEPTH]; + memset(frames, 0, sizeof(void*)*MAX_STACK_DEPTH); + S32 depth = 0; + + // get the addresses + depth = RtlCaptureStackBackTrace_fn(FRAME_SKIP, MAX_STACK_DEPTH, frames, NULL); + + IMAGEHLP_LINE64 line; + memset(&line, 0, sizeof(IMAGEHLP_LINE64)); + line.SizeOfStruct = sizeof(IMAGEHLP_LINE64); + + // create something to hold address info + PIMAGEHLP_SYMBOL64 pSym; + pSym = (PIMAGEHLP_SYMBOL64)malloc(sizeof(IMAGEHLP_SYMBOL64) + STRING_NAME_LENGTH); + memset(pSym, 0, sizeof(IMAGEHLP_SYMBOL64) + STRING_NAME_LENGTH); + pSym->MaxNameLength = STRING_NAME_LENGTH; + pSym->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64); + + // get address info for each address frame + // and store + for(S32 i=0; i < depth; i++) + { + std::stringstream stack_line; + BOOL ret; + + DWORD64 addr = (DWORD64)frames[i]; + ret = SymGetSymFromAddr64(hProc, addr, 0, pSym); + if(ret) + { + stack_line << pSym->Name << " "; + } + + DWORD dummy; + ret = SymGetLineFromAddr64(hProc, addr, &dummy, &line); + if(ret) + { + std::string file_name = line.FileName; + std::string::size_type index = file_name.rfind("\\"); + stack_line << file_name.substr(index + 1, file_name.size()) << ":" << line.LineNumber; + } + + lines.push_back(stack_line.str()); + } + + free(pSym); + + // TODO: figure out a way to cleanup symbol loading + // Not hugely necessary, however. + //SymCleanup(hProc); + return true; + } + else + { + lines.push_back("Stack Trace Failed. PDB symbol info not loaded"); + } + + return false; +} + +#else + +bool ll_get_stack_trace(std::vector<std::string>& lines) +{ + return false; +} + +#endif + diff --git a/indra/llcommon/llstacktrace.h b/indra/llcommon/llstacktrace.h new file mode 100644 index 0000000000000000000000000000000000000000..609b934a9745616974c1a36934561650110e0077 --- /dev/null +++ b/indra/llcommon/llstacktrace.h @@ -0,0 +1,44 @@ +/** + * @file llstacktrace.h + * @brief stack trace functions + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#ifndef LL_LLSTACKTRACE_H +#define LL_LLSTACKTRACE_H + +#include "stdtypes.h" +#include <vector> +#include <string> + +bool ll_get_stack_trace(std::vector<std::string>& lines); + +#endif + diff --git a/indra/llcommon/llstat.cpp b/indra/llcommon/llstat.cpp index 291b019616cd4f62558920cc34b47e3301700da9..90dae117937254d03e8f2fabe78bc8ed23c6cecd 100644 --- a/indra/llcommon/llstat.cpp +++ b/indra/llcommon/llstat.cpp @@ -46,6 +46,7 @@ BOOL LLPerfBlock::sStatsEnabled = FALSE; // Flag for detailed information LLPerfBlock::stat_map_t LLPerfBlock::sStatMap; // Map full path string to LLStatTime objects, tracks all active objects std::string LLPerfBlock::sCurrentStatPath = ""; // Something like "/total_time/physics/physics step" +LLStat::stat_map_t LLStat::sStatList; //------------------------------------------------------------------------ // Live config file to trigger stats logging @@ -725,28 +726,48 @@ void LLPerfBlock::addStatsToLLSDandReset( LLSD & stats, LLTimer LLStat::sTimer; LLFrameTimer LLStat::sFrameTimer; -LLStat::LLStat(const U32 num_bins, const BOOL use_frame_timer) +void LLStat::init() { - llassert(num_bins > 0); - U32 i; - mUseFrameTimer = use_frame_timer; + llassert(mNumBins > 0); mNumValues = 0; mLastValue = 0.f; mLastTime = 0.f; - mNumBins = num_bins; mCurBin = (mNumBins-1); mNextBin = 0; mBins = new F32[mNumBins]; mBeginTime = new F64[mNumBins]; mTime = new F64[mNumBins]; mDT = new F32[mNumBins]; - for (i = 0; i < mNumBins; i++) + for (U32 i = 0; i < mNumBins; i++) { mBins[i] = 0.f; mBeginTime[i] = 0.0; mTime[i] = 0.0; mDT[i] = 0.f; } + + if (!mName.empty()) + { + stat_map_t::iterator iter = sStatList.find(mName); + if (iter != sStatList.end()) + llwarns << "LLStat with duplicate name: " << mName << llendl; + sStatList.insert(std::make_pair(mName, this)); + } +} + +LLStat::LLStat(const U32 num_bins, const BOOL use_frame_timer) + : mUseFrameTimer(use_frame_timer), + mNumBins(num_bins) +{ + init(); +} + +LLStat::LLStat(std::string name, U32 num_bins, BOOL use_frame_timer) + : mUseFrameTimer(use_frame_timer), + mNumBins(num_bins), + mName(name) +{ + init(); } LLStat::~LLStat() @@ -755,6 +776,15 @@ LLStat::~LLStat() delete[] mBeginTime; delete[] mTime; delete[] mDT; + + if (!mName.empty()) + { + // handle multiple entries with the same name + stat_map_t::iterator iter = sStatList.find(mName); + while (iter != sStatList.end() && iter->second != this) + ++iter; + sStatList.erase(iter); + } } void LLStat::reset() diff --git a/indra/llcommon/llstat.h b/indra/llcommon/llstat.h index 61aaac45bfbd552a6193a73f06175cfde6fe4b91..bad18f46a0aea70e8abfeacca42703f96a86553c 100644 --- a/indra/llcommon/llstat.h +++ b/indra/llcommon/llstat.h @@ -258,8 +258,15 @@ private: // ---------------------------------------------------------------------------- class LLStat { +private: + typedef std::multimap<std::string, LLStat*> stat_map_t; + static stat_map_t sStatList; + + void init(); + public: - LLStat(const U32 num_bins = 32, BOOL use_frame_timer = FALSE); + LLStat(U32 num_bins = 32, BOOL use_frame_timer = FALSE); + LLStat(std::string name, U32 num_bins = 32, BOOL use_frame_timer = FALSE); ~LLStat(); void reset(); @@ -322,8 +329,22 @@ private: F32 *mDT; S32 mCurBin; S32 mNextBin; + + std::string mName; + static LLTimer sTimer; static LLFrameTimer sFrameTimer; + +public: + static LLStat* getStat(const std::string& name) + { + // return the first stat that matches 'name' + stat_map_t::iterator iter = sStatList.find(name); + if (iter != sStatList.end()) + return iter->second; + else + return NULL; + } }; - + #endif // LL_STAT_ diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 1f653c159c8a06d4ecc5eb3b3b2102f79ca498b3..ec1718a8cbfde3bbf949c68e7eb1d227f7ab9380 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -71,6 +71,24 @@ U8 hex_as_nybble(char hex) return 0; // uh - oh, not hex any more... } +bool iswindividual(llwchar elem) +{ + U32 cur_char = (U32)elem; + bool result = false; + if (0x2E80<= cur_char && cur_char <= 0x9FFF) + { + result = true; + } + else if (0xAC00<= cur_char && cur_char <= 0xD7A0 ) + { + result = true; + } + else if (0xF900<= cur_char && cur_char <= 0xFA60 ) + { + result = true; + } + return result; +} bool _read_file_into_string(std::string& str, const std::string& filename) { @@ -650,6 +668,11 @@ std::string ll_convert_wide_to_string(const wchar_t* in) } #endif // LL_WINDOWS +long LLStringOps::sltOffset; +long LLStringOps::localTimeOffset; +bool LLStringOps::daylightSavings; +std::map<std::string, std::string> LLStringOps::datetimeToCodes; + S32 LLStringOps::collate(const llwchar* a, const llwchar* b) { #if LL_WINDOWS @@ -661,6 +684,59 @@ S32 LLStringOps::collate(const llwchar* a, const llwchar* b) #endif } +void LLStringOps::setupDatetimeInfo (bool daylight) +{ + time_t nowT, localT, gmtT; + struct tm * tmpT; + + nowT = time (NULL); + + tmpT = localtime (&nowT); + localT = mktime (tmpT); + + tmpT = gmtime (&nowT); + gmtT = mktime (tmpT); + + localTimeOffset = (long) (gmtT - localT); + + + daylightSavings = daylight; + sltOffset = (daylightSavings? 7 : 8 ) * 60 * 60; + + datetimeToCodes["wkday"] = "%a"; // Thu + datetimeToCodes["weekday"] = "%A"; // Thursday + datetimeToCodes["year4"] = "%Y"; // 2009 + datetimeToCodes["year"] = "%Y"; // 2009 + datetimeToCodes["year2"] = "%y"; // 09 + datetimeToCodes["mth"] = "%b"; // Aug + datetimeToCodes["month"] = "%B"; // August + datetimeToCodes["mthnum"] = "%m"; // 08 + datetimeToCodes["day"] = "%d"; // 31 + datetimeToCodes["hour24"] = "%H"; // 14 + datetimeToCodes["hour"] = "%H"; // 14 + datetimeToCodes["hour12"] = "%I"; // 02 + datetimeToCodes["min"] = "%M"; // 59 + datetimeToCodes["ampm"] = "%p"; // AM + datetimeToCodes["second"] = "%S"; // 59 + datetimeToCodes["timezone"] = "%Z"; // PST +} + +std::string LLStringOps::getDatetimeCode (std::string key) +{ + std::map<std::string, std::string>::iterator iter; + + iter = datetimeToCodes.find (key); + if (iter != datetimeToCodes.end()) + { + return iter->second; + } + else + { + return std::string(""); + } +} + + namespace LLStringFn { // NOTE - this restricts output to ascii diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 6ba665b8d21e5d3dd0cf6f274c4ebb3162331f5b..91b706a5beed161a762f75c17b17319e9cde54d5 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -34,6 +34,10 @@ #define LL_LLSTRING_H #include <string> +#include <locale> +#include <iomanip> +#include <boost/regex.hpp> +#include "llsd.h" #if LL_LINUX || LL_SOLARIS #include <wctype.h> @@ -145,6 +149,12 @@ struct char_traits<U16> class LLStringOps { +private: + static long sltOffset; + static long localTimeOffset; + static bool daylightSavings; + static std::map<std::string, std::string> datetimeToCodes; + public: static char toUpper(char elem) { return toupper((unsigned char)elem); } static llwchar toUpper(llwchar elem) { return towupper(elem); } @@ -172,6 +182,12 @@ public: static S32 collate(const char* a, const char* b) { return strcoll(a, b); } static S32 collate(const llwchar* a, const llwchar* b); + + static void setupDatetimeInfo (bool daylight); + static long getSltOffset (void) {return sltOffset;} + static long getLocalTimeOffset (void) {return localTimeOffset;} + static bool getDaylightSavings (void) {return daylightSavings;} + static std::string getDatetimeCode (std::string key); }; /** @@ -201,6 +217,9 @@ private: template <class T> class LLStringUtilBase { +private: + static std::string sLocale; + public: typedef typename std::basic_string<T>::size_type size_type; @@ -211,7 +230,14 @@ public: static std::basic_string<T> null; typedef std::map<LLFormatMapString, LLFormatMapString> format_map_t; + static void getTokens (std::basic_string<T> input, std::vector<std::basic_string<T> >& tokens); + static void formatNumber(std::basic_string<T>& numStr, std::basic_string<T> decimals); + static bool formatDatetime(std::basic_string<T>& replacement, std::basic_string<T> token, std::basic_string<T> param, const LLSD& substitutions); + static S32 format(std::basic_string<T>& s, const LLSD& substitutions); static S32 format(std::basic_string<T>& s, const format_map_t& fmt_map); + static bool simpleReplacement(std::basic_string<T>& replacement, std::basic_string<T> token, const LLSD& substitutions); + static void setLocale (std::string inLocale) {sLocale = inLocale;}; + static std::string getLocale (void) {return sLocale;}; static bool isValidIndex(const std::basic_string<T>& string, size_type i) { @@ -317,6 +343,7 @@ public: }; template<class T> std::basic_string<T> LLStringUtilBase<T>::null; +template<class T> std::string LLStringUtilBase<T>::sLocale; typedef LLStringUtilBase<char> LLStringUtil; typedef LLStringUtilBase<llwchar> LLWStringUtil; @@ -378,6 +405,7 @@ U8 hex_as_nybble(char hex); * @return Returns true on success. If false, str is unmodified. */ bool _read_file_into_string(std::string& str, const std::string& filename); +bool iswindividual(llwchar elem); /** * Unicode support @@ -564,63 +592,215 @@ namespace LLStringFn //////////////////////////////////////////////////////////// -// LLStringBase::format() -// -// This function takes a string 's' and a map 'fmt_map' of strings-to-strings. -// All occurances of strings in 's' from the left-hand side of 'fmt_map' are -// then replaced with the corresponding right-hand side of 'fmt_map', non- -// recursively. The function returns the number of substitutions made. +//static +template<class T> +void LLStringUtilBase<T>::getTokens (std::basic_string<T> input, std::vector<std::basic_string<T> >& tokens) +{ + const std::basic_string<T> delims (","); + std::basic_string<T> currToken; + size_type begIdx, endIdx; + + begIdx = input.find_first_not_of (delims); + while (begIdx != std::basic_string<T>::npos) + { + endIdx = input.find_first_of (delims, begIdx); + if (endIdx == std::basic_string<T>::npos) + { + endIdx = input.length(); + } + + currToken = input.substr(begIdx, endIdx - begIdx); + trim (currToken); + tokens.push_back(currToken); + begIdx = input.find_first_not_of (delims, endIdx); + } +} // static template<class T> S32 LLStringUtilBase<T>::format(std::basic_string<T>& s, const format_map_t& fmt_map) { - typedef typename std::basic_string<T>::size_type string_size_type_t; - string_size_type_t scanstart = 0; + LLSD llsdMap; + + for (format_map_t::const_iterator iter = fmt_map.begin(); + iter != fmt_map.end(); + ++iter) + { + llsdMap[iter->first] = iter->second; + } + + return format (s, llsdMap); +} + +//static +template<class T> +S32 LLStringUtilBase<T>::format(std::basic_string<T>& s, const LLSD& substitutions) +{ S32 res = 0; - // Look for the first match of any keyword, replace that keyword, - // repeat from the end of the replacement string. This avoids - // accidentally performing substitution on a substituted string. - while (1) + if (!substitutions.isMap()) + { + return res; + } + + std::basic_ostringstream<T> output; + // match strings like [NAME,number,3] + const boost::regex key("\\[((\\s)*([0-9_A-Za-z]+)((\\s)*,(\\s)*[0-9_A-Za-z\\s]*){0,2}(\\s)*)]"); + + + typename std::basic_string<T>::const_iterator start = s.begin(); + typename std::basic_string<T>::const_iterator end = s.end(); + boost::smatch match; + + + while (boost::regex_search(start, end, match, key, boost::match_default)) { - string_size_type_t first_match_pos = scanstart; - string_size_type_t first_match_str_length = 0; - std::basic_string<T> first_match_str_replacement; + bool found_replacement = false; + std::vector<std::basic_string<T> > tokens; + std::basic_string<T> replacement; - for (format_map_t::const_iterator iter = fmt_map.begin(); - iter != fmt_map.end(); - ++iter) + getTokens (std::basic_string<T>(match[1].first, match[1].second), tokens); + + if (tokens.size() == 1) { - string_size_type_t n = s.find(iter->first, scanstart); - if (n != std::basic_string<T>::npos && - (n < first_match_pos || - 0 == first_match_str_length)) - { - first_match_pos = n; - first_match_str_length = iter->first.length(); - first_match_str_replacement = iter->second; - } + found_replacement = simpleReplacement (replacement, tokens[0], substitutions); } + else if (tokens[1] == "number") + { + std::basic_string<T> param = "0"; - if (0 == first_match_str_length) + if (tokens.size() > 2) param = tokens[2]; + found_replacement = simpleReplacement (replacement, tokens[0], substitutions); + if (found_replacement) formatNumber (replacement, param); + } + else if (tokens[1] == "datetime") { - // no more keys found to substitute from this point - // in the string forward. - break; + std::basic_string<T> param; + if (tokens.size() > 2) param = tokens[2]; + + found_replacement = formatDatetime (replacement, tokens[0], param, substitutions); + } + + if (found_replacement) + { + output << std::basic_string<T>(start, match[0].first) << replacement; + res++; } else { - s.erase(first_match_pos, first_match_str_length); - s.insert(first_match_pos, first_match_str_replacement); - scanstart = first_match_pos + - first_match_str_replacement.length(); - ++res; + // we had no replacement, so leave the string we searched for so that it gets noticed by QA + // "hello [NAME_NOT_FOUND]" is output + output << std::basic_string<T>(start, match[0].second); } + + // update search position + start = match[0].second; } + // send the remainder of the string (with no further matches for bracketed names) + output << std::basic_string<T>(start, end); + s = output.str(); return res; } +// static +template<class T> +bool LLStringUtilBase<T>::simpleReplacement(std::basic_string<T> &replacement, std::basic_string<T> token, const LLSD &substitutions) +{ + // see if we have a replacement for the bracketed string (without the brackets) + // test first using has() because if we just look up with operator[] we get back an + // empty string even if the value is missing. We want to distinguish between + // missing replacements and deliberately empty replacement strings. + if (substitutions.has(token)) + { + replacement = substitutions[token].asString(); + return true; + } + // if not, see if there's one WITH brackets + else if (substitutions.has(std::basic_string<T>("[" + token + "]"))) + { + replacement = substitutions[std::basic_string<T>("[" + token + "]")].asString(); + return true; + } + + return false; +} + +// static +template<class T> +void LLStringUtilBase<T>::formatNumber(std::basic_string<T>& numStr, std::basic_string<T> decimals) +{ + typedef typename std::basic_string<T>::size_type string_size_type_t; + std::basic_stringstream<T> strStream; + S32 intDecimals = 0; + + convertToS32 (decimals, intDecimals); + if (!sLocale.empty()) + { + strStream.imbue (std::locale(sLocale.c_str())); + } + + if (!intDecimals) + { + S32 intStr; + + if (convertToS32(numStr, intStr)) + { + strStream << intStr; + numStr = strStream.str(); + } + } + else + { + F32 floatStr; + + if (convertToF32(numStr, floatStr)) + { + strStream << std::fixed << std::showpoint << std::setprecision(intDecimals) << floatStr; + numStr = strStream.str(); + } + } +} + +// static +template<class T> +bool LLStringUtilBase<T>::formatDatetime(std::basic_string<T>& replacement, std::basic_string<T> token, + std::basic_string<T> param, const LLSD& substitutions) +{ + S32 secFromEpoch = (long) substitutions["datetime"].asInteger(); + + if (param == "local") // local + { + secFromEpoch -= LLStringOps::getLocalTimeOffset(); + } + else if (param != "utc") // slt + { + secFromEpoch -= LLStringOps::getSltOffset(); + } + + // if never fell into those two ifs above, param must be utc + if (secFromEpoch < 0) secFromEpoch = 0; + + LLDate * datetime = new LLDate((F64)secFromEpoch); + std::string code = LLStringOps::getDatetimeCode (token); + + // special case to handle timezone + if (code == "%Z") { + if (param == "utc") replacement = "GMT"; + else if (param != "local") replacement = LLStringOps::getDaylightSavings()? "PDT" : "PST"; + return true; + } + + replacement = datetime->toHTTPDateString(code); + if (code.empty()) + { + return false; + } + else + { + return true; + } +} + // static template<class T> S32 LLStringUtilBase<T>::compareStrings(const T* lhs, const T* rhs) diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index c8c9fd4eecadc04347788f3e908b3ebc9b95ea1e..f25339f48d124ce2d8baf9d77984bcaa0afcb69e 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -35,7 +35,6 @@ #include "llapr.h" #include "llapp.h" -#include "llmemory.h" #include "apr_thread_cond.h" diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index fa6efaf38e9edafc7e166a11a8650524c36d17fb..ea5b0c03ef18e8cadf136d85d5cfbd4d2f0d1284 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -561,32 +561,27 @@ void secondsToTimecodeString(F32 current_time, std::string& tcstring) // ////////////////////////////////////////////////////////////////////////////// -std::list<LLEventTimer*> LLEventTimer::sActiveList; - LLEventTimer::LLEventTimer(F32 period) : mEventTimer() { mPeriod = period; - sActiveList.push_back(this); } LLEventTimer::LLEventTimer(const LLDate& time) : mEventTimer() { mPeriod = (F32)(time.secondsSinceEpoch() - LLDate::now().secondsSinceEpoch()); - sActiveList.push_back(this); } -LLEventTimer::~LLEventTimer() +LLEventTimer::~LLEventTimer() { - sActiveList.remove(this); } void LLEventTimer::updateClass() { std::list<LLEventTimer*> completed_timers; - for (std::list<LLEventTimer*>::iterator iter = sActiveList.begin(); iter != sActiveList.end(); ) + for (instance_iter iter = beginInstances(); iter != endInstances(); ) { LLEventTimer* timer = *iter++; F32 et = timer->mEventTimer.getElapsedTimeF32(); diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h index e2cf1c7689bfe003e8ce568c4bc36a48edfca87d..0319bec45b62f7da8d1c72c80b5502e74d718657 100644 --- a/indra/llcommon/lltimer.h +++ b/indra/llcommon/lltimer.h @@ -40,6 +40,7 @@ #include "stdtypes.h" #include "lldate.h" +#include "llinstancetracker.h" #include <string> #include <list> @@ -171,13 +172,13 @@ void microsecondsToTimecodeString(U64 current_time, std::string& tcstring); void secondsToTimecodeString(F32 current_time, std::string& tcstring); // class for scheduling a function to be called at a given frequency (approximate, inprecise) -class LLEventTimer +class LLEventTimer : protected LLInstanceTracker<LLEventTimer> { public: LLEventTimer(F32 period); // period is the amount of time between each call to tick() in seconds LLEventTimer(const LLDate& time); virtual ~LLEventTimer(); - + //function to be called at the supplied frequency // Normally return FALSE; TRUE will delete the timer after the function returns. virtual BOOL tick() = 0; @@ -187,10 +188,6 @@ public: protected: LLTimer mEventTimer; F32 mPeriod; - -private: - //list of active timers - static std::list<LLEventTimer*> sActiveList; // TODO should this be a vector }; #endif diff --git a/indra/llcommon/lltreeiterators.h b/indra/llcommon/lltreeiterators.h new file mode 100644 index 0000000000000000000000000000000000000000..c946566e842e8d66a8440e39c6dacce002bcf288 --- /dev/null +++ b/indra/llcommon/lltreeiterators.h @@ -0,0 +1,711 @@ +/** + * @file lltreeiterators.h + * @author Nat Goodspeed + * @date 2008-08-19 + * @brief This file defines iterators useful for traversing arbitrary node + * classes, potentially polymorphic, linked into strict tree + * structures. + * + * Dereferencing any one of these iterators actually yields a @em + * pointer to the node in question. For example, given an + * LLLinkedIter<MyNode> <tt>li</tt>, <tt>*li</tt> gets you a pointer + * to MyNode, and <tt>**li</tt> gets you the MyNode instance itself. + * More commonly, instead of writing <tt>li->member</tt>, you write + * <tt>(*li)->member</tt> -- as you would if you were traversing an + * STL container of MyNode pointers. + * + * It would certainly be possible to build these iterators so that + * <tt>*iterator</tt> would return a reference to the node itself + * rather than a pointer to the node, and for many purposes it would + * even be more convenient. However, that would be insufficiently + * flexible. If you want to use an iterator range to (e.g.) initialize + * a std::vector collecting results -- you rarely want to actually @em + * copy the nodes in question. You're much more likely to want to copy + * <i>pointers to</i> the traversed nodes. Hence these iterators + * produce pointers. + * + * Though you specify the actual NODE class as the template parameter, + * these iterators internally use LLPtrTo<> to discover whether to + * store and return an LLPointer<NODE> or a simple NODE*. + * + * By strict tree structures, we mean that each child must have + * exactly one parent. This forbids a child claiming any ancestor as a + * child of its own. Child nodes with multiple parents will be visited + * once for each parent. Cycles in the graph will result in either an + * infinite loop or an out-of-memory crash. You Have Been Warned. + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#if ! defined(LL_LLTREEITERATORS_H) +#define LL_LLTREEITERATORS_H + +#include "llptrto.h" +#include <vector> +#include <deque> +#include <boost/iterator/iterator_facade.hpp> +#include <boost/function.hpp> +#include <boost/static_assert.hpp> + +namespace LLTreeIter +{ + /// Discriminator between LLTreeUpIter and LLTreeDownIter + enum RootIter { UP, DOWN }; + /// Discriminator between LLTreeDFSIter, LLTreeDFSPostIter and LLTreeBFSIter + enum WalkIter { DFS_PRE, DFS_POST, BFS }; +} + +/** + * LLBaseIter defines some machinery common to all these iterators. We use + * boost::iterator_facade to define the iterator boilerplate: the conventional + * operators and methods necessary to implement a standards-conforming + * iterator. That allows us to specify the actual iterator semantics in terms + * of equal(), dereference() and increment() methods. + */ +template <class SELFTYPE, class NODE> +class LLBaseIter: public boost::iterator_facade<SELFTYPE, + // use pointer type as the + // reference type + typename LLPtrTo<NODE>::type, + boost::forward_traversal_tag> +{ +protected: + /// LLPtrTo<NODE>::type is either NODE* or LLPointer<NODE>, as appropriate + typedef typename LLPtrTo<NODE>::type ptr_type; + /// function that advances from this node to next accepts a node pointer + /// and returns another + typedef boost::function<ptr_type(const ptr_type&)> func_type; + typedef SELFTYPE self_type; +}; + +/// Functor returning NULL, suitable for an end-iterator's 'next' functor +template <class NODE> +typename LLPtrTo<NODE>::type LLNullNextFunctor(const typename LLPtrTo<NODE>::type&) +{ + return typename LLPtrTo<NODE>::type(); +} + +/** + * LLLinkedIter is an iterator over an intrusive singly-linked list. The + * beginning of the list is represented by LLLinkedIter(list head); the end is + * represented by LLLinkedIter(). + * + * The begin LLLinkedIter must be instantiated with a functor to extract the + * 'next' pointer from the current node. Supposing that the link pointer is @c + * public, something like: + * + * @code + * NODE* mNext; + * @endcode + * + * you can use (e.g.) <tt>boost::bind(&NODE::mNext, _1)</tt> for the purpose. + * Alternatively, you can bind whatever accessor method is normally used to + * advance to the next node, e.g. for: + * + * @code + * NODE* next() const; + * @endcode + * + * you can use <tt>boost::bind(&NODE::next, _1)</tt>. + */ +template <class NODE> +class LLLinkedIter: public LLBaseIter<LLLinkedIter<NODE>, NODE> +{ + typedef LLBaseIter<LLLinkedIter<NODE>, NODE> super; +protected: + /// some methods need to return a reference to self + typedef typename super::self_type self_type; + typedef typename super::ptr_type ptr_type; + typedef typename super::func_type func_type; +public: + /// Instantiate an LLLinkedIter to start a range, or to end a range before + /// a particular list entry. Pass a functor to extract the 'next' pointer + /// from the current node. + LLLinkedIter(const ptr_type& entry, const func_type& nextfunc): + mCurrent(entry), + mNextFunc(nextfunc) + {} + /// Instantiate an LLLinkedIter to end a range at the end of the list + LLLinkedIter(): + mCurrent(), + mNextFunc(LLNullNextFunctor<NODE>) + {} + +private: + /// leverage boost::iterator_facade + friend class boost::iterator_core_access; + + /// advance + void increment() + { + mCurrent = mNextFunc(mCurrent); + } + /// equality + bool equal(const self_type& that) const { return this->mCurrent == that.mCurrent; } + /// dereference + ptr_type& dereference() const { return const_cast<ptr_type&>(mCurrent); } + + ptr_type mCurrent; + func_type mNextFunc; +}; + +/** + * LLTreeUpIter walks from the node in hand to the root of the tree. The term + * "up" is applied to a tree visualized with the root at the top. + * + * LLTreeUpIter is an alias for LLLinkedIter, since any linked tree that you + * can navigate that way at all contains parent pointers. + */ +template <class NODE> +class LLTreeUpIter: public LLLinkedIter<NODE> +{ + typedef LLLinkedIter<NODE> super; +public: + /// Instantiate an LLTreeUpIter to start from a particular tree node, or + /// to end a parent traversal before reaching a particular ancestor. Pass + /// a functor to extract the 'parent' pointer from the current node. + LLTreeUpIter(const typename super::ptr_type& node, + const typename super::func_type& parentfunc): + super(node, parentfunc) + {} + /// Instantiate an LLTreeUpIter to end a range at the root of the tree + LLTreeUpIter(): + super() + {} +}; + +/** + * LLTreeDownIter walks from the root of the tree to the node in hand. The + * term "down" is applied to a tree visualized with the root at the top. + * + * Though you instantiate the begin() LLTreeDownIter with a pointer to some + * node at an arbitrary location in the tree, the root will be the first node + * you dereference and the passed node will be the last node you dereference. + * + * On construction, LLTreeDownIter walks from the current node to the root, + * capturing the path. Then in use, it replays that walk in reverse. As with + * all traversals of interesting data structures, it is actively dangerous to + * modify the tree during an LLTreeDownIter walk. + */ +template <class NODE> +class LLTreeDownIter: public LLBaseIter<LLTreeDownIter<NODE>, NODE> +{ + typedef LLBaseIter<LLTreeDownIter<NODE>, NODE> super; + typedef typename super::self_type self_type; +protected: + typedef typename super::ptr_type ptr_type; + typedef typename super::func_type func_type; +private: + typedef std::vector<ptr_type> list_type; +public: + /// Instantiate an LLTreeDownIter to end at a particular tree node. Pass a + /// functor to extract the 'parent' pointer from the current node. + LLTreeDownIter(const ptr_type& node, + const func_type& parentfunc) + { + for (ptr_type n = node; n; n = parentfunc(n)) + mParents.push_back(n); + } + /// Instantiate an LLTreeDownIter representing "here", the end of the loop + LLTreeDownIter() {} + +private: + /// leverage boost::iterator_facade + friend class boost::iterator_core_access; + + /// advance + void increment() + { + mParents.pop_back(); + } + /// equality + bool equal(const self_type& that) const { return this->mParents == that.mParents; } + /// implement dereference/indirection operators + ptr_type& dereference() const { return const_cast<ptr_type&>(mParents.back()); } + + list_type mParents; +}; + +/** + * When you want to select between LLTreeUpIter and LLTreeDownIter with a + * compile-time discriminator, use LLTreeRootIter with an LLTreeIter::RootIter + * template arg. + */ +template <LLTreeIter::RootIter DISCRIM, class NODE> +class LLTreeRootIter +{ + enum { use_a_valid_LLTreeIter_RootIter_value = false }; +public: + /// Bogus constructors for default (unrecognized discriminator) case + template <typename TYPE1, typename TYPE2> + LLTreeRootIter(TYPE1, TYPE2) + { + BOOST_STATIC_ASSERT(use_a_valid_LLTreeIter_RootIter_value); + } + LLTreeRootIter() + { + BOOST_STATIC_ASSERT(use_a_valid_LLTreeIter_RootIter_value); + } +}; + +/// Specialize for LLTreeIter::UP +template <class NODE> +class LLTreeRootIter<LLTreeIter::UP, NODE>: public LLTreeUpIter<NODE> +{ + typedef LLTreeUpIter<NODE> super; +public: + /// forward begin ctor + LLTreeRootIter(const typename super::ptr_type& node, + const typename super::func_type& parentfunc): + super(node, parentfunc) + {} + /// forward end ctor + LLTreeRootIter(): + super() + {} +}; + +/// Specialize for LLTreeIter::DOWN +template <class NODE> +class LLTreeRootIter<LLTreeIter::DOWN, NODE>: public LLTreeDownIter<NODE> +{ + typedef LLTreeDownIter<NODE> super; +public: + /// forward begin ctor + LLTreeRootIter(const typename super::ptr_type& node, + const typename super::func_type& parentfunc): + super(node, parentfunc) + {} + /// forward end ctor + LLTreeRootIter(): + super() + {} +}; + +/** + * Instantiated with a tree node, typically the root, LLTreeDFSIter "flattens" + * a depth-first tree walk through that node and all its descendants. + * + * The begin() LLTreeDFSIter must be instantiated with functors to obtain from + * a given node begin() and end() iterators for that node's children. For this + * reason, you must specify the type of the node's child iterator as an + * additional template parameter. + * + * Specifically, the begin functor must return an iterator whose dereferenced + * value is a @em pointer to a child tree node. For instance, if each node + * tracks its children in an STL container of node* pointers, you can simply + * return that container's begin() iterator. + * + * Alternatively, if a node tracks its children with a classic linked list, + * write a functor returning LLLinkedIter<NODE>. + * + * The end() LLTreeDFSIter must, of course, match the begin() iterator's + * template parameters, but is constructed without runtime parameters. + */ +template <class NODE, typename CHILDITER> +class LLTreeDFSIter: public LLBaseIter<LLTreeDFSIter<NODE, CHILDITER>, NODE> +{ + typedef LLBaseIter<LLTreeDFSIter<NODE, CHILDITER>, NODE> super; + typedef typename super::self_type self_type; +protected: + typedef typename super::ptr_type ptr_type; + // The func_type is different for this: from a NODE pointer, we must + // obtain a CHILDITER. + typedef boost::function<CHILDITER(const ptr_type&)> func_type; +private: + typedef std::vector<ptr_type> list_type; +public: + /// Instantiate an LLTreeDFSIter to start a depth-first walk. Pass + /// functors to extract the 'child begin' and 'child end' iterators from + /// each node. + LLTreeDFSIter(const ptr_type& node, const func_type& beginfunc, const func_type& endfunc): + mBeginFunc(beginfunc), + mEndFunc(endfunc), + mSkipChildren(false) + { + // Only push back this node if it's non-NULL! + if (node) + mPending.push_back(node); + } + /// Instantiate an LLTreeDFSIter to mark the end of the walk + LLTreeDFSIter() {} + + /// flags iterator logic to skip traversing children of current node on next increment + void skipDescendants(bool skip = true) { mSkipChildren = skip; } + +private: + /// leverage boost::iterator_facade + friend class boost::iterator_core_access; + + /// advance + /// This implementation is due to http://en.wikipedia.org/wiki/Depth-first_search + void increment() + { + // Capture the node we were just looking at + ptr_type current = mPending.back(); + // Remove it from mPending so we don't process it again later + mPending.pop_back(); + if (!mSkipChildren) + { + // Add all its children to mPending + addChildren(current); + } + // reset flag after each step + mSkipChildren = false; + } + /// equality + bool equal(const self_type& that) const { return this->mPending == that.mPending; } + /// implement dereference/indirection operators + ptr_type& dereference() const { return const_cast<ptr_type&>(mPending.back()); } + + /// Add the direct children of the specified node to mPending + void addChildren(const ptr_type& node) + { + // If we just use push_back() for each child in turn, we'll end up + // processing children in reverse order. We don't want to assume + // CHILDITER is reversible: some of the linked trees we'll be + // processing manage their children using singly-linked lists. So + // figure out how many children there are, grow mPending by that size + // and reverse-copy the children into the new space. + CHILDITER chi = mBeginFunc(node), chend = mEndFunc(node); + // grow mPending by the number of children + mPending.resize(mPending.size() + std::distance(chi, chend)); + // reverse-copy the children into the newly-expanded space + std::copy(chi, chend, mPending.rbegin()); + } + + /// list of the nodes yet to be processed + list_type mPending; + /// functor to extract begin() child iterator + func_type mBeginFunc; + /// functor to extract end() child iterator + func_type mEndFunc; + /// flag which controls traversal of children (skip children of current node if true) + bool mSkipChildren; +}; + +/** + * Instantiated with a tree node, typically the root, LLTreeDFSPostIter + * "flattens" a depth-first tree walk through that node and all its + * descendants. Whereas LLTreeDFSIter visits each node before visiting any of + * its children, LLTreeDFSPostIter visits all of a node's children before + * visiting the node itself. + * + * The begin() LLTreeDFSPostIter must be instantiated with functors to obtain + * from a given node begin() and end() iterators for that node's children. For + * this reason, you must specify the type of the node's child iterator as an + * additional template parameter. + * + * Specifically, the begin functor must return an iterator whose dereferenced + * value is a @em pointer to a child tree node. For instance, if each node + * tracks its children in an STL container of node* pointers, you can simply + * return that container's begin() iterator. + * + * Alternatively, if a node tracks its children with a classic linked list, + * write a functor returning LLLinkedIter<NODE>. + * + * The end() LLTreeDFSPostIter must, of course, match the begin() iterator's + * template parameters, but is constructed without runtime parameters. + */ +template <class NODE, typename CHILDITER> +class LLTreeDFSPostIter: public LLBaseIter<LLTreeDFSPostIter<NODE, CHILDITER>, NODE> +{ + typedef LLBaseIter<LLTreeDFSPostIter<NODE, CHILDITER>, NODE> super; + typedef typename super::self_type self_type; +protected: + typedef typename super::ptr_type ptr_type; + // The func_type is different for this: from a NODE pointer, we must + // obtain a CHILDITER. + typedef boost::function<CHILDITER(const ptr_type&)> func_type; +private: + // Upon reaching a given node in our pending list, we need to know whether + // we've already pushed that node's children, so we must associate a bool + // with each node pointer. + typedef std::vector< std::pair<ptr_type, bool> > list_type; +public: + /// Instantiate an LLTreeDFSPostIter to start a depth-first walk. Pass + /// functors to extract the 'child begin' and 'child end' iterators from + /// each node. + LLTreeDFSPostIter(const ptr_type& node, const func_type& beginfunc, const func_type& endfunc): + mBeginFunc(beginfunc), + mEndFunc(endfunc), + mSkipAncestors(false) + { + if (! node) + return; + mPending.push_back(typename list_type::value_type(node, false)); + makeCurrent(); + } + /// Instantiate an LLTreeDFSPostIter to mark the end of the walk + LLTreeDFSPostIter() {} + + /// flags iterator logic to skip traversing ancestors of current node on next increment + void skipAncestors(bool skip = true) { mSkipAncestors = skip; } + +private: + /// leverage boost::iterator_facade + friend class boost::iterator_core_access; + + /// advance + /// This implementation is due to http://en.wikipedia.org/wiki/Depth-first_search + void increment() + { + // Pop the previous current node + mPending.pop_back(); + makeCurrent(); + } + /// equality + bool equal(const self_type& that) const { return this->mPending == that.mPending; } + /// implement dereference/indirection operators + ptr_type& dereference() const { return const_cast<ptr_type&>(mPending.back().first); } + + struct isOpen + { + bool operator()(const typename list_type::value_type& item) + { + return item.second; + } + }; + + /// Call this each time we change mPending.back() -- that is, every time + /// we're about to change the value returned by dereference(). If we + /// haven't yet pushed the new node's children, do so now. + void makeCurrent() + { + if (mSkipAncestors) + { + mPending.erase(std::remove_if(mPending.begin(), mPending.end(), isOpen()), mPending.end()); + mSkipAncestors = false; + } + + // Once we've popped the last node, this becomes a no-op. + if (mPending.empty()) + return; + // Here mPending.back() holds the node pointer we're proposing to + // dereference next. Have we pushed that node's children yet? + if (mPending.back().second) + return; // if so, it's okay to visit this node now + // We haven't yet pushed this node's children. Do so now. Remember + // that we did -- while the node in question is still back(). + mPending.back().second = true; + addChildren(mPending.back().first); + // Now, because we've just changed mPending.back(), make that new node + // current. + makeCurrent(); + } + + /// Add the direct children of the specified node to mPending + void addChildren(const ptr_type& node) + { + // If we just use push_back() for each child in turn, we'll end up + // processing children in reverse order. We don't want to assume + // CHILDITER is reversible: some of the linked trees we'll be + // processing manage their children using singly-linked lists. So + // figure out how many children there are, grow mPending by that size + // and reverse-copy the children into the new space. + CHILDITER chi = mBeginFunc(node), chend = mEndFunc(node); + // grow mPending by the number of children + mPending.resize(mPending.size() + std::distance(chi, chend)); + // Reverse-copy the children into the newly-expanded space. We can't + // just use std::copy() because the source is a ptr_type, whereas the + // dest is a pair of (ptr_type, bool). + for (typename list_type::reverse_iterator pi = mPending.rbegin(); chi != chend; ++chi, ++pi) + { + pi->first = *chi; // copy the child pointer + pi->second = false; // we haven't yet pushed this child's chldren + } + } + + /// list of the nodes yet to be processed + list_type mPending; + /// functor to extract begin() child iterator + func_type mBeginFunc; + /// functor to extract end() child iterator + func_type mEndFunc; + /// flags logic to skip traversal of ancestors of current node + bool mSkipAncestors; +}; + +/** + * Instantiated with a tree node, typically the root, LLTreeBFSIter "flattens" + * a breadth-first tree walk through that node and all its descendants. + * + * The begin() LLTreeBFSIter must be instantiated with functors to obtain from + * a given node the begin() and end() iterators of that node's children. For + * this reason, you must specify the type of the node's child iterator as an + * additional template parameter. + * + * Specifically, the begin functor must return an iterator whose dereferenced + * value is a @em pointer to a child tree node. For instance, if each node + * tracks its children in an STL container of node* pointers, you can simply + * return that container's begin() iterator. + * + * Alternatively, if a node tracks its children with a classic linked list, + * write a functor returning LLLinkedIter<NODE>. + * + * The end() LLTreeBFSIter must, of course, match the begin() iterator's + * template parameters, but is constructed without runtime parameters. + */ +template <class NODE, typename CHILDITER> +class LLTreeBFSIter: public LLBaseIter<LLTreeBFSIter<NODE, CHILDITER>, NODE> +{ + typedef LLBaseIter<LLTreeBFSIter<NODE, CHILDITER>, NODE> super; + typedef typename super::self_type self_type; +protected: + typedef typename super::ptr_type ptr_type; + // The func_type is different for this: from a NODE pointer, we must + // obtain a CHILDITER. + typedef boost::function<CHILDITER(const ptr_type&)> func_type; +private: + // We need a FIFO queue rather than a LIFO stack. Use a deque rather than + // a vector, since vector can't implement pop_front() efficiently. + typedef std::deque<ptr_type> list_type; +public: + /// Instantiate an LLTreeBFSIter to start a depth-first walk. Pass + /// functors to extract the 'child begin' and 'child end' iterators from + /// each node. + LLTreeBFSIter(const ptr_type& node, const func_type& beginfunc, const func_type& endfunc): + mBeginFunc(beginfunc), + mEndFunc(endfunc) + { + if (node) + mPending.push_back(node); + } + /// Instantiate an LLTreeBFSIter to mark the end of the walk + LLTreeBFSIter() {} + +private: + /// leverage boost::iterator_facade + friend class boost::iterator_core_access; + + /// advance + /// This implementation is due to http://en.wikipedia.org/wiki/Breadth-first_search + void increment() + { + // Capture the node we were just looking at + ptr_type current = mPending.front(); + // Remove it from mPending so we don't process it again later + mPending.pop_front(); + // Add all its children to mPending + CHILDITER chend = mEndFunc(current); + for (CHILDITER chi = mBeginFunc(current); chi != chend; ++chi) + mPending.push_back(*chi); + } + /// equality + bool equal(const self_type& that) const { return this->mPending == that.mPending; } + /// implement dereference/indirection operators + ptr_type& dereference() const { return const_cast<ptr_type&>(mPending.front()); } + + /// list of the nodes yet to be processed + list_type mPending; + /// functor to extract begin() child iterator + func_type mBeginFunc; + /// functor to extract end() child iterator + func_type mEndFunc; +}; + +/** + * When you want to select between LLTreeDFSIter, LLTreeDFSPostIter and + * LLTreeBFSIter with a compile-time discriminator, use LLTreeWalkIter with an + * LLTreeIter::WalkIter template arg. + */ +template <LLTreeIter::WalkIter DISCRIM, class NODE, typename CHILDITER> +class LLTreeWalkIter +{ + enum { use_a_valid_LLTreeIter_WalkIter_value = false }; +public: + /// Bogus constructors for default (unrecognized discriminator) case + template <typename TYPE1, typename TYPE2> + LLTreeWalkIter(TYPE1, TYPE2) + { + BOOST_STATIC_ASSERT(use_a_valid_LLTreeIter_WalkIter_value); + } + LLTreeWalkIter() + { + BOOST_STATIC_ASSERT(use_a_valid_LLTreeIter_WalkIter_value); + } +}; + +/// Specialize for LLTreeIter::DFS_PRE +template <class NODE, typename CHILDITER> +class LLTreeWalkIter<LLTreeIter::DFS_PRE, NODE, CHILDITER>: + public LLTreeDFSIter<NODE, CHILDITER> +{ + typedef LLTreeDFSIter<NODE, CHILDITER> super; +public: + /// forward begin ctor + LLTreeWalkIter(const typename super::ptr_type& node, + const typename super::func_type& beginfunc, + const typename super::func_type& endfunc): + super(node, beginfunc, endfunc) + {} + /// forward end ctor + LLTreeWalkIter(): + super() + {} +}; + +/// Specialize for LLTreeIter::DFS_POST +template <class NODE, typename CHILDITER> +class LLTreeWalkIter<LLTreeIter::DFS_POST, NODE, CHILDITER>: + public LLTreeDFSPostIter<NODE, CHILDITER> +{ + typedef LLTreeDFSPostIter<NODE, CHILDITER> super; +public: + /// forward begin ctor + LLTreeWalkIter(const typename super::ptr_type& node, + const typename super::func_type& beginfunc, + const typename super::func_type& endfunc): + super(node, beginfunc, endfunc) + {} + /// forward end ctor + LLTreeWalkIter(): + super() + {} +}; + +/// Specialize for LLTreeIter::BFS +template <class NODE, typename CHILDITER> +class LLTreeWalkIter<LLTreeIter::BFS, NODE, CHILDITER>: + public LLTreeBFSIter<NODE, CHILDITER> +{ + typedef LLTreeBFSIter<NODE, CHILDITER> super; +public: + /// forward begin ctor + LLTreeWalkIter(const typename super::ptr_type& node, + const typename super::func_type& beginfunc, + const typename super::func_type& endfunc): + super(node, beginfunc, endfunc) + {} + /// forward end ctor + LLTreeWalkIter(): + super() + {} +}; + +#endif /* ! defined(LL_LLTREEITERATORS_H) */ diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index a28d0f72683b84bd603b9f44ada9226c317f0228..45810a101d66b711ba7b4006e7f0342234008133 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -33,11 +33,11 @@ #ifndef LL_LLVERSIONVIEWER_H #define LL_LLVERSIONVIEWER_H -const S32 LL_VERSION_MAJOR = 1; -const S32 LL_VERSION_MINOR = 24; -const S32 LL_VERSION_PATCH = 2; +const S32 LL_VERSION_MAJOR = 2; +const S32 LL_VERSION_MINOR = 0; +const S32 LL_VERSION_PATCH = 0; const S32 LL_VERSION_BUILD = 0; -const char * const LL_CHANNEL = "Second Life Release"; +const char * const LL_CHANNEL = "Second Life 2009"; #endif diff --git a/indra/llcommon/tests/llallocator_heap_profile_test.cpp b/indra/llcommon/tests/llallocator_heap_profile_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7369fdc8bcd2e503fb54a424c19156aa080b6bd2 --- /dev/null +++ b/indra/llcommon/tests/llallocator_heap_profile_test.cpp @@ -0,0 +1,150 @@ +/** + * @file llallocator_heap_profile_test.cpp + * @author Brad Kittenbrink + * @date 2008-02- + * @brief Test for llallocator_heap_profile.cpp. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "../llallocator_heap_profile.h" +#include "../test/lltut.h" + +namespace tut +{ + struct llallocator_heap_profile_data + { + LLAllocatorHeapProfile prof; + + static char const * const sample_win_profile; + // *TODO - get test output from mac/linux tcmalloc + static char const * const sample_mac_profile; + static char const * const sample_lin_profile; + + static char const * const crash_testcase; + }; + typedef test_group<llallocator_heap_profile_data> factory; + typedef factory::object object; +} +namespace +{ + tut::factory llallocator_heap_profile_test_factory("LLAllocatorHeapProfile"); +} + +namespace tut +{ + template<> template<> + void object::test<1>() + { + prof.parse(sample_win_profile); + + ensure_equals("count lines", prof.mLines.size() , 5); + ensure_equals("alloc counts", prof.mLines[0].mLiveCount, 2131854U); + ensure_equals("alloc counts", prof.mLines[0].mLiveSize, 2245710106ULL); + ensure_equals("alloc counts", prof.mLines[0].mTotalCount, 14069198U); + ensure_equals("alloc counts", prof.mLines[0].mTotalSize, 4295177308ULL); + ensure_equals("count markers", prof.mLines[0].mTrace.size(), 0); + ensure_equals("count markers", prof.mLines[1].mTrace.size(), 0); + ensure_equals("count markers", prof.mLines[2].mTrace.size(), 4); + ensure_equals("count markers", prof.mLines[3].mTrace.size(), 6); + ensure_equals("count markers", prof.mLines[4].mTrace.size(), 7); + + //prof.dump(std::cout); + } + + template<> template<> + void object::test<2>() + { + prof.parse(crash_testcase); + + ensure_equals("count lines", prof.mLines.size(), 2); + ensure_equals("alloc counts", prof.mLines[0].mLiveCount, 3U); + ensure_equals("alloc counts", prof.mLines[0].mLiveSize, 1049652ULL); + ensure_equals("alloc counts", prof.mLines[0].mTotalCount, 8U); + ensure_equals("alloc counts", prof.mLines[0].mTotalSize, 1049748ULL); + ensure_equals("count markers", prof.mLines[0].mTrace.size(), 0); + ensure_equals("count markers", prof.mLines[1].mTrace.size(), 0); + + //prof.dump(std::cout); + } + + template<> template<> + void object::test<3>() + { + // test that we don't crash on edge case data + prof.parse(""); + ensure("emtpy on error", prof.mLines.empty()); + + prof.parse("heap profile:"); + ensure("emtpy on error", prof.mLines.empty()); + } + +char const * const llallocator_heap_profile_data::sample_win_profile = +"heap profile: 2131854: 2245710106 [14069198: 4295177308] @\n" +"308592: 1073398388 [966564: 1280998739] @\n" +"462651: 375969538 [1177377: 753561247] @ 2 3 6 1\n" +"314744: 206611283 [2008722: 570934755] @ 2 3 3 7 21 32\n" +"277152: 82862770 [621961: 168503640] @ 2 3 3 7 21 32 87\n" +"\n" +"MAPPED_LIBRARIES:\n" +"00400000-02681000 r-xp 00000000 00:00 0 c:\\proj\\tcmalloc-eval-9\\indra\\build-vc80\\newview\\RelWithDebInfo\\secondlife-bin.exe\n" +"77280000-773a7000 r-xp 00000000 00:00 0 C:\\Windows\\system32\\ntdll.dll\n" +"76df0000-76ecb000 r-xp 00000000 00:00 0 C:\\Windows\\system32\\kernel32.dll\n" +"76000000-76073000 r-xp 00000000 00:00 0 C:\\Windows\\system32\\comdlg32.dll\n" +"75ee0000-75f8a000 r-xp 00000000 00:00 0 C:\\Windows\\system32\\msvcrt.dll\n" +"76c30000-76c88000 r-xp 00000000 00:00 0 C:\\Windows\\system32\\SHLWAPI.dll\n" +"75f90000-75fdb000 r-xp 00000000 00:00 0 C:\\Windows\\system32\\GDI32.dll\n" +"77420000-774bd000 r-xp 00000000 00:00 0 C:\\Windows\\system32\\USER32.dll\n" +"75e10000-75ed6000 r-xp 00000000 00:00 0 C:\\Windows\\system32\\ADVAPI32.dll\n" +"75b00000-75bc2000 r-xp 00000000 00:00 0 C:\\Windows\\system32\\RPCRT4.dll\n" +"72ca0000-72d25000 r-xp 00000000 00:00 0 C:\\Windows\\WinSxS\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.6001.18000_none_886786f450a74a05\\COMCTL32.dll\n" +"76120000-76c30000 r-xp 00000000 00:00 0 C:\\Windows\\system32\\SHELL32.dll\n" +"71ce0000-71d13000 r-xp 00000000 00:00 0 C:\\Windows\\system32\\DINPUT8.dll\n"; + + +char const * const llallocator_heap_profile_data::crash_testcase = +"heap profile: 3: 1049652 [ 8: 1049748] @\n" +" 3: 1049652 [ 8: 1049748] @\n" +"\n" +"MAPPED_LIBRARIES:\n" +"00400000-004d5000 r-xp 00000000 00:00 0 c:\\code\\linden\\tcmalloc\\indra\\build-vc80\\llcommon\\RelWithDebInfo\\llallocator_test.exe\n" +"7c900000-7c9af000 r-xp 00000000 00:00 0 C:\\WINDOWS\\system32\\ntdll.dll\n" +"7c800000-7c8f6000 r-xp 00000000 00:00 0 C:\\WINDOWS\\system32\\kernel32.dll\n" +"77dd0000-77e6b000 r-xp 00000000 00:00 0 C:\\WINDOWS\\system32\\ADVAPI32.dll\n" +"77e70000-77f02000 r-xp 00000000 00:00 0 C:\\WINDOWS\\system32\\RPCRT4.dll\n" +"77fe0000-77ff1000 r-xp 00000000 00:00 0 C:\\WINDOWS\\system32\\Secur32.dll\n" +"71ab0000-71ac7000 r-xp 00000000 00:00 0 C:\\WINDOWS\\system32\\WS2_32.dll\n" +"77c10000-77c68000 r-xp 00000000 00:00 0 C:\\WINDOWS\\system32\\msvcrt.dll\n" +"71aa0000-71aa8000 r-xp 00000000 00:00 0 C:\\WINDOWS\\system32\\WS2HELP.dll\n" +"76bf0000-76bfb000 r-xp 00000000 00:00 0 C:\\WINDOWS\\system32\\PSAPI.DLL\n" +"5b860000-5b8b5000 r-xp 00000000 00:00 0 C:\\WINDOWS\\system32\\NETAPI32.dll\n" +"10000000-10041000 r-xp 00000000 00:00 0 c:\\code\\linden\\tcmalloc\\indra\\build-vc80\\llcommon\\RelWithDebInfo\\libtcmalloc_minimal.dll\n" +"7c420000-7c4a7000 r-xp 00000000 00:00 0 C:\\WINDOWS\\WinSxS\\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.1433_x-ww_5cf844d2\\MSVCP80.dll\n" +"78130000-781cb000 r-xp 00000000 00:00 0 C:\\WINDOWS\\WinSxS\\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.1433_x-ww_5cf844d2\\MSVCR80.dll\n"; + +} diff --git a/indra/llcommon/tests/llallocator_test.cpp b/indra/llcommon/tests/llallocator_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9db95f4273245b83ca6347b0fbebc54fdc93e657 --- /dev/null +++ b/indra/llcommon/tests/llallocator_test.cpp @@ -0,0 +1,86 @@ +/** + * @file llallocator_test.cpp + * @author Brad Kittenbrink + * @date 2008-02- + * @brief Test for llallocator.cpp. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "../llallocator.h" +#include "../test/lltut.h" + +namespace tut +{ + struct llallocator_data + { + LLAllocator llallocator; + }; + typedef test_group<llallocator_data> factory; + typedef factory::object object; +} +namespace +{ + tut::factory llallocator_test_factory("LLAllocator"); +} + +namespace tut +{ + template<> template<> + void object::test<1>() + { + llallocator.setProfilingEnabled(false); + ensure("Profiler disable", !llallocator.isProfiling()); + } + +#if LL_USE_TCMALLOC + template<> template<> + void object::test<2>() + { + llallocator.setProfilingEnabled(true); + ensure("Profiler enable", llallocator.isProfiling()); + } + + template <> template <> + void object::test<3>() + { + llallocator.setProfilingEnabled(true); + + char * test_alloc = new char[1024]; + + llallocator.getProfile(); + + delete [] test_alloc; + + llallocator.getProfile(); + + // *NOTE - this test isn't ensuring anything right now other than no + // exceptions are thrown. + } +#endif // LL_USE_TCMALLOC +}; diff --git a/indra/llcommon/tests/llmemtype_test.cpp b/indra/llcommon/tests/llmemtype_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6cc5ce01ce78d7e281fafd0701940f194ecf1a83 --- /dev/null +++ b/indra/llcommon/tests/llmemtype_test.cpp @@ -0,0 +1,123 @@ +/** + * @file llmemtype_test.cpp + * @author Palmer Truelson + * @date 2008-03- + * @brief Test for llmemtype.cpp. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "../llmemtype.h" +#include "../test/lltut.h" +#include "../llallocator.h" + + +#include <stack> + +std::stack<S32> memTypeStack; + +void LLAllocator::pushMemType(S32 i) +{ + memTypeStack.push(i); +} + +S32 LLAllocator::popMemType(void) +{ + S32 ret = memTypeStack.top(); + memTypeStack.pop(); + return ret; +} + +namespace tut +{ + struct llmemtype_data + { + }; + + typedef test_group<llmemtype_data> factory; + typedef factory::object object; +} +namespace +{ + tut::factory llmemtype_test_factory("LLMemType"); +} + +namespace tut +{ + template<> template<> + void object::test<1>() + { + ensure("Simplest test ever", true); + } + + // test with no scripts + template<> template<> + void object::test<2>() + { + { + LLMemType m1(LLMemType::MTYPE_INIT); + } + ensure("Test that you can construct and destruct the mem type"); + } + + // test creation and stack testing + template<> template<> + void object::test<3>() + { + { + ensure("Test that creation and destruction properly inc/dec the stack"); + ensure_equals(memTypeStack.size(), 0); + { + LLMemType m1(LLMemType::MTYPE_INIT); + ensure_equals(memTypeStack.size(), 1); + LLMemType m2(LLMemType::MTYPE_STARTUP); + ensure_equals(memTypeStack.size(), 2); + } + ensure_equals(memTypeStack.size(), 0); + } + } + + // test with no scripts + template<> template<> + void object::test<4>() + { + // catch the begining and end + std::string test_name = LLMemType::getNameFromID(LLMemType::MTYPE_INIT.mID); + ensure_equals("Init name", test_name, "Init"); + + std::string test_name2 = LLMemType::getNameFromID(LLMemType::MTYPE_VOLUME.mID); + ensure_equals("Volume name", test_name2, "Volume"); + + std::string test_name3 = LLMemType::getNameFromID(LLMemType::MTYPE_OTHER.mID); + ensure_equals("Other name", test_name3, "Other"); + + std::string test_name4 = LLMemType::getNameFromID(-1); + ensure_equals("Invalid name", test_name4, "INVALID"); + } + +}; diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index 2fd37e848e7264009193915afa6f31a3d2ac2868..c1022c1195ec62bed7ed615276ca1da1ce3f274f 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -86,6 +86,7 @@ void LLCrashLoggerText::updateApplication(const std::string& message) LLCrashLogger::LLCrashLogger() : mCrashBehavior(CRASH_BEHAVIOR_ASK), mCrashInPreviousExec(false), + mCrashSettings("CrashSettings"), mSentCrashLogs(false), mCrashHost("") { @@ -208,7 +209,10 @@ void LLCrashLogger::gatherFiles() mFileMap["SettingsXml"] = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings.xml"); } +#if !LL_DARWIN if(mCrashInPreviousExec) +#else +#endif { // Replace the log file ext with .old, since the // instance that launched this process has overwritten diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 93ddc65f32a7b4fa40fbd1364b1c55077190d5ca..488f3bf78d60b541c14ef2b377f33cc517027366 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -152,7 +152,7 @@ void LLImageBase::deleteData() // virtual U8* LLImageBase::allocateData(S32 size) { - LLMemType mt1((LLMemType::EMemType)mMemType); + LLMemType mt1(mMemType); if (size < 0) { @@ -188,7 +188,7 @@ U8* LLImageBase::allocateData(S32 size) // virtual U8* LLImageBase::reallocateData(S32 size) { - LLMemType mt1((LLMemType::EMemType)mMemType); + LLMemType mt1(mMemType); U8 *new_datap = new U8[size]; if (!new_datap) { @@ -332,7 +332,7 @@ BOOL LLImageRaw::resize(U16 width, U16 height, S8 components) U8 * LLImageRaw::getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const { - LLMemType mt1((LLMemType::EMemType)mMemType); + LLMemType mt1(mMemType); U8 *data = new U8[width*height*getComponents()]; // Should do some simple bounds checking @@ -415,7 +415,7 @@ void LLImageRaw::clear(U8 r, U8 g, U8 b, U8 a) // Reverses the order of the rows in the image void LLImageRaw::verticalFlip() { - LLMemType mt1((LLMemType::EMemType)mMemType); + LLMemType mt1(mMemType); S32 row_bytes = getWidth() * getComponents(); llassert(row_bytes > 0); std::vector<U8> line_buffer(row_bytes); @@ -548,7 +548,7 @@ void LLImageRaw::composite( LLImageRaw* src ) // Src and dst can be any size. Src has 4 components. Dst has 3 components. void LLImageRaw::compositeScaled4onto3(LLImageRaw* src) { - LLMemType mt1((LLMemType::EMemType)mMemType); + LLMemType mt1(mMemType); llinfos << "compositeScaled4onto3" << llendl; LLImageRaw* dst = this; // Just for clarity. @@ -787,7 +787,7 @@ void LLImageRaw::copyUnscaled3onto4( LLImageRaw* src ) // Src and dst can be any size. Src and dst have same number of components. void LLImageRaw::copyScaled( LLImageRaw* src ) { - LLMemType mt1((LLMemType::EMemType)mMemType); + LLMemType mt1(mMemType); LLImageRaw* dst = this; // Just for clarity. llassert_always( (1 == src->getComponents()) || (3 == src->getComponents()) || (4 == src->getComponents()) ); @@ -819,7 +819,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data ) { - LLMemType mt1((LLMemType::EMemType)mMemType); + LLMemType mt1(mMemType); llassert((1 == getComponents()) || (3 == getComponents()) || (4 == getComponents()) ); S32 old_width = getWidth(); diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index bd609b638ccb043a655fac55a99da3cee692fe40..81085531072dc7eda16fac65930999971f96063e 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -35,8 +35,9 @@ #include "lluuid.h" #include "llstring.h" -#include "llmemory.h" +//#include "llmemory.h" #include "llthread.h" +#include "llmemtype.h" const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2 const S32 MAX_IMAGE_MIP = 11; // 2048x2048 @@ -155,7 +156,7 @@ private: BOOL mBadBufferAllocation ; public: - S16 mMemType; // debug + LLMemType::DeclareMemType& mMemType; // debug static BOOL sSizeOverride; }; diff --git a/indra/llimage/llimagedxt.h b/indra/llimage/llimagedxt.h index bc2d6522d2c70b61aed9531f93ed720774a9f09f..1a297536b4174f5249dd02fa2aa93f850f177d9b 100644 --- a/indra/llimage/llimagedxt.h +++ b/indra/llimage/llimagedxt.h @@ -33,6 +33,7 @@ #define LL_LLIMAGEDXT_H #include "llimage.h" +#include "llpointer.h" // This class decodes and encodes LL DXT files (which may unclude uncompressed RGB or RGBA mipped data) diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 1b93c219824c5974499dc6057768458174fd36fc..363486fb9c013caa8e9ec4141c412638171e9188 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -279,7 +279,7 @@ BOOL LLImageJ2C::decode(LLImageRaw *raw_imagep, F32 decode_time) BOOL LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count ) { - LLMemType mt1((LLMemType::EMemType)mMemType); + LLMemType mt1(mMemType); BOOL res = TRUE; @@ -329,7 +329,7 @@ BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, F32 encode_time) BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, const char* comment_text, F32 encode_time) { - LLMemType mt1((LLMemType::EMemType)mMemType); + LLMemType mt1(mMemType); resetLastError(); BOOL res = mImpl->encodeImpl(*this, *raw_imagep, comment_text, encode_time, mReversible); if (!mLastError.empty()) @@ -462,7 +462,7 @@ BOOL LLImageJ2C::loadAndValidate(const std::string &filename) BOOL LLImageJ2C::validate(U8 *data, U32 file_size) { - LLMemType mt1((LLMemType::EMemType)mMemType); + LLMemType mt1(mMemType); resetLastError(); diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp index a6721bfa0f9d228c22443d3e553c72b25f17448c..d8f80035936aa7aaa1a4a2836b0f3e52dda68f05 100644 --- a/indra/llimage/llimagetga.cpp +++ b/indra/llimage/llimagetga.cpp @@ -31,10 +31,12 @@ #include "linden_common.h" -#include "lldir.h" #include "llimagetga.h" + +#include "lldir.h" #include "llerror.h" #include "llmath.h" +#include "llpointer.h" // For expanding 5-bit pixel values to 8-bit with best rounding // static diff --git a/indra/llimage/llimageworker.h b/indra/llimage/llimageworker.h index 879fcf55657ec557caeb80d3ff80542f2cd56128..0d66695d6ecfc7e09c7a25a37875fd1bed295fc2 100644 --- a/indra/llimage/llimageworker.h +++ b/indra/llimage/llimageworker.h @@ -34,6 +34,7 @@ #define LL_LLIMAGEWORKER_H #include "llimage.h" +#include "llpointer.h" #include "llworkerthread.h" class LLImageWorker : public LLWorkerClass diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index be6b6c817bb4040a3bc272c667dadb5bb05fb9b3..ec6264dcf55cf7199b65e81d0a1607bfe530999e 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -37,7 +37,7 @@ #include "openjpeg.h" #include "lltimer.h" -#include "llmemory.h" +//#include "llmemory.h" const char* fallbackEngineInfoLLImageJ2CImpl() { diff --git a/indra/llinventory/lleconomy.h b/indra/llinventory/lleconomy.h index 2e2adc4d4521e10d96555cc0550514f70ad266fb..e4800854538370f06cfcd1ad319f607fd1443b60 100644 --- a/indra/llinventory/lleconomy.h +++ b/indra/llinventory/lleconomy.h @@ -32,7 +32,7 @@ #ifndef LL_LLECONOMY_H #define LL_LLECONOMY_H -#include "llmemory.h" +#include "llsingleton.h" class LLMessageSystem; class LLVector3; diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 2823cf7be981a97802ee74067ddfab96adfd7639..adc80b2ed370d083c71e482f613ee153e32af90a 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -705,8 +705,8 @@ BOOL LLInventoryItem::exportFile(LLFILE* fp, BOOL include_asset_key) const fprintf(fp, "\t\tasset_id\t%s\n", uuid_str.c_str()); } fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType)); - const char* inv_type_str = LLInventoryType::lookup(mInventoryType); - if(inv_type_str) fprintf(fp, "\t\tinv_type\t%s\n", inv_type_str); + const std::string inv_type_str = LLInventoryType::lookup(mInventoryType); + if(!inv_type_str.empty()) fprintf(fp, "\t\tinv_type\t%s\n", inv_type_str.c_str()); fprintf(fp, "\t\tflags\t%08x\n", mFlags); mSaleInfo.exportFile(fp); fprintf(fp, "\t\tname\t%s|\n", mName.c_str()); @@ -908,8 +908,8 @@ BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL inclu output_stream << "\t\tasset_id\t" << uuid_str << "\n"; } output_stream << "\t\ttype\t" << LLAssetType::lookup(mType) << "\n"; - const char* inv_type_str = LLInventoryType::lookup(mInventoryType); - if(inv_type_str) + const std::string inv_type_str = LLInventoryType::lookup(mInventoryType); + if(!inv_type_str.empty()) output_stream << "\t\tinv_type\t" << inv_type_str << "\n"; std::string buffer; buffer = llformat( "\t\tflags\t%08x\n", mFlags); @@ -951,8 +951,8 @@ void LLInventoryItem::asLLSD( LLSD& sd ) const } sd[INV_ASSET_TYPE_LABEL] = LLAssetType::lookup(mType); sd[INV_INVENTORY_TYPE_LABEL] = mInventoryType; - const char* inv_type_str = LLInventoryType::lookup(mInventoryType); - if(inv_type_str) + const std::string inv_type_str = LLInventoryType::lookup(mInventoryType); + if(!inv_type_str.empty()) { sd[INV_INVENTORY_TYPE_LABEL] = inv_type_str; } @@ -1097,109 +1097,8 @@ fail: } -LLXMLNode *LLInventoryItem::exportFileXML(BOOL include_asset_key) const -{ - LLMemType m1(LLMemType::MTYPE_INVENTORY); - LLXMLNode *ret = new LLXMLNode("item", FALSE); - - ret->createChild("uuid", TRUE)->setUUIDValue(1, &mUUID); - ret->createChild("parent_uuid", TRUE)->setUUIDValue(1, &mParentUUID); - - mPermissions.exportFileXML()->setParent(ret); - - // Check for permissions to see the asset id, and if so write it - // out as an asset id. Otherwise, apply our cheesy encryption. - if(include_asset_key) - { - U32 mask = mPermissions.getMaskBase(); - if(((mask & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) - || (mAssetUUID.isNull())) - { - ret->createChild("asset_id", FALSE)->setUUIDValue(1, &mAssetUUID); - } - else - { - LLUUID shadow_id(mAssetUUID); - LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES); - cipher.encrypt(shadow_id.mData, UUID_BYTES); - - ret->createChild("shadow_id", FALSE)->setUUIDValue(1, &shadow_id); - } - } - - std::string type_str = LLAssetType::lookup(mType); - std::string inv_type_str = LLInventoryType::lookup(mInventoryType); - - ret->createChild("asset_type", FALSE)->setStringValue(type_str); - ret->createChild("inventory_type", FALSE)->setStringValue(inv_type_str); - S32 tmp_flags = (S32) mFlags; - ret->createChild("flags", FALSE)->setByteValue(4, (U8*)(&tmp_flags), LLXMLNode::ENCODING_HEX); - - mSaleInfo.exportFileXML()->setParent(ret); - - std::string temp; - temp.assign(mName); - ret->createChild("name", FALSE)->setStringValue(temp); - temp.assign(mDescription); - ret->createChild("description", FALSE)->setStringValue(temp); - S32 date = mCreationDate; - ret->createChild("creation_date", FALSE)->setIntValue(1, &date); - - return ret; -} - -BOOL LLInventoryItem::importXML(LLXMLNode* node) -{ - BOOL success = FALSE; - if (node) - { - success = TRUE; - LLXMLNodePtr sub_node; - if (node->getChild("uuid", sub_node)) - success = (1 == sub_node->getUUIDValue(1, &mUUID)); - if (node->getChild("parent_uuid", sub_node)) - success = success && (1 == sub_node->getUUIDValue(1, &mParentUUID)); - if (node->getChild("permissions", sub_node)) - success = success && mPermissions.importXML(sub_node); - if (node->getChild("asset_id", sub_node)) - success = success && (1 == sub_node->getUUIDValue(1, &mAssetUUID)); - if (node->getChild("shadow_id", sub_node)) - { - success = success && (1 == sub_node->getUUIDValue(1, &mAssetUUID)); - LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES); - cipher.decrypt(mAssetUUID.mData, UUID_BYTES); - } - if (node->getChild("asset_type", sub_node)) - mType = LLAssetType::lookup(sub_node->getValue()); - if (node->getChild("inventory_type", sub_node)) - mInventoryType = LLInventoryType::lookup(sub_node->getValue()); - if (node->getChild("flags", sub_node)) - { - S32 tmp_flags = 0; - success = success && (1 == sub_node->getIntValue(1, &tmp_flags)); - mFlags = (U32) tmp_flags; - } - if (node->getChild("sale_info", sub_node)) - success = success && mSaleInfo.importXML(sub_node); - if (node->getChild("name", sub_node)) - mName = sub_node->getValue(); - if (node->getChild("description", sub_node)) - mDescription = sub_node->getValue(); - if (node->getChild("creation_date", sub_node)) - { - S32 date = 0; - success = success && (1 == sub_node->getIntValue(1, &date)); - mCreationDate = date; - } - - if (!success) - { - lldebugs << "LLInventory::importXML() failed for node named '" - << node->getName() << "'" << llendl; - } - } - return success; -} +// Deleted LLInventoryItem::exportFileXML() and LLInventoryItem::importXML() +// because I can't find any non-test code references to it. 2009-05-04 JC S32 LLInventoryItem::packBinaryBucket(U8* bin_bucket, LLPermissions* perm_override) const { diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index d34046c31048403e046dac7e738cbb034522663b..3f79cedc232783ab33b1ec6b61346e05c10253a5 100644 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -40,6 +40,7 @@ #include "llinventorytype.h" #include "llmemtype.h" #include "llpermissions.h" +#include "llrefcount.h" #include "llsaleinfo.h" #include "llsd.h" #include "lluuid.h" @@ -91,9 +92,9 @@ public: // accessors virtual const LLUUID& getUUID() const; const LLUUID& getParentUUID() const; - const std::string& getName() const; - LLAssetType::EType getType() const; - + virtual const std::string& getName() const; + virtual LLAssetType::EType getType() const; + LLAssetType::EType getActualType() const { return mType; } // mutators - will not call updateServer(); void setUUID(const LLUUID& new_uuid); void rename(const std::string& new_name); @@ -216,6 +217,7 @@ protected: ~LLInventoryItem(); // ref counted public: + MEM_TYPE_NEW(LLMemType::MTYPE_INVENTORY); LLInventoryItem(const LLUUID& uuid, const LLUUID& parent_uuid, @@ -240,7 +242,7 @@ public: // accessors const LLPermissions& getPermissions() const; const LLUUID& getCreatorUUID() const; - const LLUUID& getAssetUUID() const; + virtual const LLUUID& getAssetUUID() const; const std::string& getDescription() const; const LLSaleInfo& getSaleInfo() const; LLInventoryType::EType getInventoryType() const; @@ -273,9 +275,6 @@ public: virtual BOOL importLegacyStream(std::istream& input_stream); virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const; - virtual LLXMLNode *exportFileXML(BOOL include_asset_key = TRUE) const; - BOOL importXML(LLXMLNode* node); - // helper functions // pack all information needed to reconstruct this item into the given binary bucket. diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp index a161a0ee006983592c46129fb86d6d0f5679113c..ff9c6989437c86e1df756234c02933e488a9b036 100644 --- a/indra/llinventory/llinventorytype.cpp +++ b/indra/llinventory/llinventorytype.cpp @@ -33,66 +33,59 @@ #include "linden_common.h" #include "llinventorytype.h" +#include "lldictionary.h" +#include "llmemory.h" +#include "llsingleton.h" + +static const std::string empty_string; ///---------------------------------------------------------------------------- /// Class LLInventoryType ///---------------------------------------------------------------------------- - -// Unlike asset type names, not limited to 8 characters. -// Need not match asset type names. -static const char* INVENTORY_TYPE_NAMES[LLInventoryType::IT_COUNT] = -{ - "texture", // 0 - "sound", - "callcard", - "landmark", - NULL, - NULL, // 5 - "object", - "notecard", - "category", - "root", - "script", // 10 - NULL, - NULL, - NULL, - NULL, - "snapshot", // 15 - NULL, - "attach", - "wearable", - "animation", - "gesture", // 20 +struct InventoryEntry : public LLDictionaryEntry +{ + InventoryEntry(const std::string &name, + const std::string &human_name, + int num_asset_types = 0, ...); + const std::string mHumanName; + typedef std::vector<LLAssetType::EType> asset_vec_t; + asset_vec_t mAssetTypes; }; -// This table is meant for decoding to human readable form. Put any -// and as many printable characters you want in each one. -// See also LLAssetType::mAssetTypeHumanNames -static const char* INVENTORY_TYPE_HUMAN_NAMES[LLInventoryType::IT_COUNT] = -{ - "texture", // 0 - "sound", - "calling card", - "landmark", - NULL, - NULL, // 5 - "object", - "note card", - "folder", - "root", - "script", // 10 - NULL, - NULL, - NULL, - NULL, - "snapshot", // 15 - NULL, - "attachment", - "wearable", - "animation", - "gesture", // 20 +class LLInventoryDictionary : public LLSingleton<LLInventoryDictionary>, + public LLDictionary<LLInventoryType::EType, InventoryEntry> +{ +public: + LLInventoryDictionary(); }; +LLInventoryDictionary::LLInventoryDictionary() +{ + addEntry(LLInventoryType::IT_TEXTURE, new InventoryEntry("texture", "texture", 1, LLAssetType::AT_TEXTURE)); + addEntry(LLInventoryType::IT_SOUND, new InventoryEntry("sound", "sound", 1, LLAssetType::AT_SOUND)); + addEntry(LLInventoryType::IT_CALLINGCARD, new InventoryEntry("callcard", "calling card", 1, LLAssetType::AT_CALLINGCARD)); + addEntry(LLInventoryType::IT_LANDMARK, new InventoryEntry("landmark", "landmark", 1, LLAssetType::AT_LANDMARK)); + //addEntry(LLInventoryType::IT_SCRIPT, new InventoryEntry(NULL,NULL)); + //addEntry(LLInventoryType::IT_CLOTHING, new InventoryEntry(NULL,NULL)); + addEntry(LLInventoryType::IT_OBJECT, new InventoryEntry("object", "object", 1, LLAssetType::AT_OBJECT)); + addEntry(LLInventoryType::IT_NOTECARD, new InventoryEntry("notecard", "note card", 1, LLAssetType::AT_NOTECARD)); + addEntry(LLInventoryType::IT_CATEGORY, new InventoryEntry("category", "folder" )); + addEntry(LLInventoryType::IT_ROOT_CATEGORY, new InventoryEntry("root", "root" )); + addEntry(LLInventoryType::IT_LSL, new InventoryEntry("script", "script", 2, LLAssetType::AT_LSL_TEXT, LLAssetType::AT_LSL_BYTECODE)); + //addEntry(LLInventoryType::IT_LSL_BYTECODE, new InventoryEntry(NULL,NULL)); + //addEntry(LLInventoryType::IT_TEXTURE_TGA, new InventoryEntry(NULL,NULL)); + //addEntry(LLInventoryType::IT_BODYPART, new InventoryEntry(NULL,NULL)); + //addEntry(LLInventoryType::IT_TRASH, new InventoryEntry(NULL,NULL)); + addEntry(LLInventoryType::IT_SNAPSHOT, new InventoryEntry("snapshot", "snapshot", 1, LLAssetType::AT_TEXTURE)); + //addEntry(LLInventoryType::IT_LOST_AND_FOUND, new InventoryEntry(NULL,NULL, )); + addEntry(LLInventoryType::IT_ATTACHMENT, new InventoryEntry("attach", "attachment", 1, LLAssetType::AT_OBJECT)); + addEntry(LLInventoryType::IT_WEARABLE, new InventoryEntry("wearable", "wearable", 2, LLAssetType::AT_CLOTHING, LLAssetType::AT_BODYPART)); + addEntry(LLInventoryType::IT_ANIMATION, new InventoryEntry("animation", "animation", 1, LLAssetType::AT_ANIMATION)); + addEntry(LLInventoryType::IT_GESTURE, new InventoryEntry("gesture", "gesture", 1, LLAssetType::AT_GESTURE)); + addEntry(LLInventoryType::IT_FAVORITE, new InventoryEntry("favorite", "favorite", 1, LLAssetType::AT_FAVORITE)); +} + + // Maps asset types to the default inventory type for that kind of asset. // Thus, "Lost and Found" is a "Category" static const LLInventoryType::EType @@ -120,76 +113,48 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] = LLInventoryType::IT_NONE, // AT_IMAGE_JPEG LLInventoryType::IT_ANIMATION, // AT_ANIMATION LLInventoryType::IT_GESTURE, // AT_GESTURE + LLInventoryType::IT_NONE, // AT_LINK + LLInventoryType::IT_FAVORITE, // AT_FAVORITE }; -static const int MAX_POSSIBLE_ASSET_TYPES = 2; -static const LLAssetType::EType -INVENTORY_TO_ASSET_TYPE[LLInventoryType::IT_COUNT][MAX_POSSIBLE_ASSET_TYPES] = +InventoryEntry::InventoryEntry(const std::string &name, + const std::string &human_name, + int num_asset_types, ...) : + LLDictionaryEntry(name), + mHumanName(human_name) { - { LLAssetType::AT_TEXTURE, LLAssetType::AT_NONE }, // IT_TEXTURE - { LLAssetType::AT_SOUND, LLAssetType::AT_NONE }, // IT_SOUND - { LLAssetType::AT_CALLINGCARD, LLAssetType::AT_NONE }, // IT_CALLINGCARD - { LLAssetType::AT_LANDMARK, LLAssetType::AT_NONE }, // IT_LANDMARK - { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, - { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, - { LLAssetType::AT_OBJECT, LLAssetType::AT_NONE }, // IT_OBJECT - { LLAssetType::AT_NOTECARD, LLAssetType::AT_NONE }, // IT_NOTECARD - { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, // IT_CATEGORY - { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, // IT_ROOT_CATEGORY - { LLAssetType::AT_LSL_TEXT, LLAssetType::AT_LSL_BYTECODE }, // IT_LSL - { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, - { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, - { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, - { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, - { LLAssetType::AT_TEXTURE, LLAssetType::AT_NONE }, // IT_SNAPSHOT - { LLAssetType::AT_NONE, LLAssetType::AT_NONE }, - { LLAssetType::AT_OBJECT, LLAssetType::AT_NONE }, // IT_ATTACHMENT - { LLAssetType::AT_CLOTHING, LLAssetType::AT_BODYPART }, // IT_WEARABLE - { LLAssetType::AT_ANIMATION, LLAssetType::AT_NONE }, // IT_ANIMATION - { LLAssetType::AT_GESTURE, LLAssetType::AT_NONE }, // IT_GESTURE -}; + va_list argp; + va_start(argp, num_asset_types); + // Read in local textures + for (U8 i=0; i < num_asset_types; i++) + { + LLAssetType::EType t = (LLAssetType::EType)va_arg(argp,int); + mAssetTypes.push_back(t); + } +} // static -const char* LLInventoryType::lookup(EType type) +const std::string &LLInventoryType::lookup(EType type) { - if((type >= 0) && (type < IT_COUNT)) - { - return INVENTORY_TYPE_NAMES[S32(type)]; - } - else - { - return NULL; - } + const InventoryEntry *entry = LLInventoryDictionary::getInstance()->lookup(type); + if (!entry) return empty_string; + return entry->mName; } // static LLInventoryType::EType LLInventoryType::lookup(const std::string& name) { - for(S32 i = 0; i < IT_COUNT; ++i) - { - if((INVENTORY_TYPE_NAMES[i]) - && (name == INVENTORY_TYPE_NAMES[i])) - { - // match - return (EType)i; - } - } - return IT_NONE; + return LLInventoryDictionary::getInstance()->lookup(name); } // XUI:translate // translation from a type to a human readable form. // static -const char* LLInventoryType::lookupHumanReadable(EType type) +const std::string &LLInventoryType::lookupHumanReadable(EType type) { - if((type >= 0) && (type < IT_COUNT)) - { - return INVENTORY_TYPE_HUMAN_NAMES[S32(type)]; - } - else - { - return NULL; - } + const InventoryEntry *entry = LLInventoryDictionary::getInstance()->lookup(type); + if (!entry) return empty_string; + return entry->mHumanName; } // return the default inventory for the given asset type. @@ -206,21 +171,21 @@ LLInventoryType::EType LLInventoryType::defaultForAssetType(LLAssetType::EType a } } -bool inventory_and_asset_types_match( - LLInventoryType::EType inventory_type, - LLAssetType::EType asset_type) +bool inventory_and_asset_types_match(LLInventoryType::EType inventory_type, + LLAssetType::EType asset_type) { - bool rv = false; - if((inventory_type >= 0) && (inventory_type < LLInventoryType::IT_COUNT)) + const InventoryEntry *entry = LLInventoryDictionary::getInstance()->lookup(inventory_type); + if (!entry) return false; + + for (InventoryEntry::asset_vec_t::const_iterator iter = entry->mAssetTypes.begin(); + iter != entry->mAssetTypes.end(); + iter++) { - for(S32 i = 0; i < MAX_POSSIBLE_ASSET_TYPES; ++i) + const LLAssetType::EType type = (*iter); + if(type == asset_type) { - if(INVENTORY_TO_ASSET_TYPE[inventory_type][i] == asset_type) - { - rv = true; - break; - } + return true; } } - return rv; + return false; } diff --git a/indra/llinventory/llinventorytype.h b/indra/llinventory/llinventorytype.h index d3effc0e6d17e55353a712972df159fa0199750f..1aad90d51b15e9120c3e8ec73af07983b9ff0c83 100644 --- a/indra/llinventory/llinventorytype.h +++ b/indra/llinventory/llinventorytype.h @@ -67,32 +67,32 @@ public: IT_WEARABLE = 18, IT_ANIMATION = 19, IT_GESTURE = 20, - IT_COUNT = 21, + IT_FAVORITE = 21, + IT_COUNT = 22, IT_NONE = -1 }; // machine transation between type and strings static EType lookup(const std::string& name); - static const char* lookup(EType type); + static const std::string &lookup(EType type); // translation from a type to a human readable form. - static const char* lookupHumanReadable(EType type); + static const std::string &lookupHumanReadable(EType type); // return the default inventory for the given asset type. static EType defaultForAssetType(LLAssetType::EType asset_type); private: // don't instantiate or derive one of these objects - LLInventoryType( void ); - ~LLInventoryType( void ); + LLInventoryType() {} + ~LLInventoryType() {} }; -// helper function which returns true if inventory type and asset type +// helper function that returns true if inventory type and asset type // are potentially compatible. For example, an attachment must be an // object, but a wearable can be a bodypart or clothing asset. -bool inventory_and_asset_types_match( - LLInventoryType::EType inventory_type, - LLAssetType::EType asset_type); +bool inventory_and_asset_types_match(LLInventoryType::EType inventory_type, + LLAssetType::EType asset_type); #endif diff --git a/indra/llinventory/lllandmark.cpp b/indra/llinventory/lllandmark.cpp index 13a63bc7d6b289084dfe9946434e867286a919d0..83b6392ca8e3dc157aa90949107fdce647c32c9f 100644 --- a/indra/llinventory/lllandmark.cpp +++ b/indra/llinventory/lllandmark.cpp @@ -40,7 +40,7 @@ std::pair<LLUUID, U64> LLLandmark::mLocalRegion; LLLandmark::region_map_t LLLandmark::mRegions; -LLLandmark::region_callback_t LLLandmark::mRegionCallback; +LLLandmark::region_callback_map_t LLLandmark::sRegionCallbackMap; LLLandmark::LLLandmark() : mGlobalPositionKnown(false) @@ -177,7 +177,7 @@ void LLLandmark::requestRegionHandle( LLMessageSystem* msg, const LLHost& upstream_host, const LLUUID& region_id, - LLRegionHandleCallback* callback) + region_handle_callback_t callback) { if(region_id.isNull()) { @@ -186,7 +186,7 @@ void LLLandmark::requestRegionHandle( if(callback) { const U64 U64_ZERO = 0; - callback->dataReady(region_id, U64_ZERO); + callback(region_id, U64_ZERO); } } else @@ -196,7 +196,7 @@ void LLLandmark::requestRegionHandle( lldebugs << "requestRegionHandle: local" << llendl; if(callback) { - callback->dataReady(region_id, mLocalRegion.second); + callback(region_id, mLocalRegion.second); } } else @@ -207,8 +207,8 @@ void LLLandmark::requestRegionHandle( lldebugs << "requestRegionHandle: upstream" << llendl; if(callback) { - region_callback_t::value_type vt(region_id, callback); - mRegionCallback.insert(vt); + region_callback_map_t::value_type vt(region_id, callback); + sRegionCallbackMap.insert(vt); } lldebugs << "Landmark requesting information about: " << region_id << llendl; @@ -221,7 +221,7 @@ void LLLandmark::requestRegionHandle( { // we have the answer locally - just call the callack. lldebugs << "requestRegionHandle: ready" << llendl; - callback->dataReady(region_id, (*it).second.mRegionHandle); + callback(region_id, (*it).second.mRegionHandle); } } } @@ -259,11 +259,11 @@ void LLLandmark::processRegionIDAndHandle(LLMessageSystem* msg, void**) #endif // make all the callbacks here. - region_callback_t::iterator it; - while((it = mRegionCallback.find(region_id)) != mRegionCallback.end()) + region_callback_map_t::iterator it; + while((it = sRegionCallbackMap.find(region_id)) != sRegionCallbackMap.end()) { - (*it).second->dataReady(region_id, info.mRegionHandle); - mRegionCallback.erase(it); + (*it).second(region_id, info.mRegionHandle); + sRegionCallbackMap.erase(it); } } diff --git a/indra/llinventory/lllandmark.h b/indra/llinventory/lllandmark.h index cb0c11ab87ecdb77c19725800cc0057935b8d99a..feaf1a0e9c2157c8c00bb5e959d54ed21c57a651 100644 --- a/indra/llinventory/lllandmark.h +++ b/indra/llinventory/lllandmark.h @@ -35,6 +35,7 @@ #define LL_LLLANDMARK_H #include <map> +#include <boost/function.hpp> #include "llframetimer.h" #include "lluuid.h" #include "v3dmath.h" @@ -42,24 +43,12 @@ class LLMessageSystem; class LLHost; -// virutal base class used for calling back interested parties when a -// region handle comes back. -class LLRegionHandleCallback -{ -public: - LLRegionHandleCallback() {} - virtual ~LLRegionHandleCallback() {} - virtual bool dataReady( - const LLUUID& region_id, - const U64& region_handle) - { - return true; - } -}; - class LLLandmark { public: + // for calling back interested parties when a region handle comes back. + typedef boost::function<void(const LLUUID& region_id, const U64& region_handle)> region_handle_callback_t; + ~LLLandmark() {} // returns true if the position is known. @@ -90,7 +79,7 @@ public: LLMessageSystem* msg, const LLHost& upstream_host, const LLUUID& region_id, - LLRegionHandleCallback* callback); + region_handle_callback_t callback); // Call this method to create a lookup for this region. This // simplifies a lot of the code. @@ -118,8 +107,8 @@ private: static std::pair<LLUUID, U64> mLocalRegion; typedef std::map<LLUUID, CacheInfo> region_map_t; static region_map_t mRegions; - typedef std::multimap<LLUUID, LLRegionHandleCallback*> region_callback_t; - static region_callback_t mRegionCallback; + typedef std::multimap<LLUUID, region_handle_callback_t> region_callback_map_t; + static region_callback_map_t sRegionCallbackMap; }; #endif diff --git a/indra/llinventory/llnotecard.h b/indra/llinventory/llnotecard.h index b903f1fdb0c22b74994a3787aeca308c653dd5b1..092ab2ce352bd6b12c5beafc1b9347c7cc818c17 100644 --- a/indra/llinventory/llnotecard.h +++ b/indra/llinventory/llnotecard.h @@ -33,7 +33,7 @@ #ifndef LL_NOTECARD_H #define LL_NOTECARD_H -#include "llmemory.h" +#include "llpointer.h" #include "llinventory.h" class LLNotecard diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index a0b27c788fa7fffe5524f174ec427b7716909137..e115c0ef8158a0758f4d9de8d6d34b45c1dfa3fa 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -85,13 +85,13 @@ static const std::string PARCEL_CATEGORY_UI_STRING[LLParcel::C_COUNT + 1] = "None", "Linden Location", "Adult", - "Arts & Culture", + "Arts and Culture", "Business", "Educational", "Gaming", "Hangout", "Newcomer Friendly", - "Parks & Nature", + "Parks and Nature", "Residential", "Shopping", "Stage", diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index 40bbb7b2e01461114353b6efda939080ad7d2885..7b7896f74fe278c3ac9d3dff49b44580c0e13425 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -38,6 +38,7 @@ #include "lluuid.h" #include "llparcelflags.h" #include "llpermissions.h" +#include "lltimer.h" #include "v3math.h" diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp index 328ed4588bf847a1ef29a37c47dd1f0114c47037..559a5631dcf73849b939c97bc0d8377230c4b320 100644 --- a/indra/llinventory/llpermissions.cpp +++ b/indra/llinventory/llpermissions.cpp @@ -831,67 +831,8 @@ BOOL LLPermissions::exportLegacyStream(std::ostream& output_stream) const return TRUE; } - -LLXMLNode *LLPermissions::exportFileXML() const -{ - LLXMLNode *ret = new LLXMLNode("permissions", FALSE); - - ret->createChild("group_owned", TRUE)->setBoolValue(mIsGroupOwned); - - ret->createChild("base_mask", FALSE)->setByteValue(4, (U8*)&mMaskBase, LLXMLNode::ENCODING_HEX); - ret->createChild("owner_mask", FALSE)->setByteValue(4, (U8*)&mMaskOwner, LLXMLNode::ENCODING_HEX); - ret->createChild("group_mask", FALSE)->setByteValue(4, (U8*)&mMaskGroup, LLXMLNode::ENCODING_HEX); - ret->createChild("everyone_mask", FALSE)->setByteValue(4, (U8*)&mMaskEveryone, LLXMLNode::ENCODING_HEX); - ret->createChild("next_owner_mask", FALSE)->setByteValue(4, (U8*)&mMaskNextOwner, LLXMLNode::ENCODING_HEX); - - ret->createChild("creator_id", FALSE)->setUUIDValue(1, &mCreator); - ret->createChild("owner_id", FALSE)->setUUIDValue(1, &mOwner); - ret->createChild("last_owner_id", FALSE)->setUUIDValue(1, &mLastOwner); - ret->createChild("group_id", FALSE)->setUUIDValue(1, &mGroup); - - return ret; -} - -bool LLPermissions::importXML(LLXMLNode* node) -{ - bool success = false; - if (node) - { - success = true; - LLXMLNodePtr sub_node; - if (node->getChild("base_mask", sub_node)) - success = success && (4 == sub_node->getByteValue(4, (U8*)&mMaskBase)); - if (node->getChild("owner_mask", sub_node)) - success = success && (4 == sub_node->getByteValue(4, (U8*)&mMaskOwner)); - if (node->getChild("group_mask", sub_node)) - success = success && (4 == sub_node->getByteValue(4, (U8*)&mMaskGroup)); - if (node->getChild("everyone_mask", sub_node)) - success = success && (4 == sub_node->getByteValue(4, (U8*)&mMaskEveryone)); - if (node->getChild("next_owner_mask", sub_node)) - success = success && (4 == sub_node->getByteValue(4, (U8*)&mMaskNextOwner)); - - if (node->getChild("creator_id", sub_node)) - success = success && (1 == sub_node->getUUIDValue(1, &mCreator)); - if (node->getChild("owner_id", sub_node)) - success = success && (1 == sub_node->getUUIDValue(1, &mOwner)); - if (node->getChild("last_owner_id", sub_node)) - success = success && (1 == sub_node->getUUIDValue(1, &mLastOwner)); - if (node->getChild("group_id", sub_node)) - success = success && (1 == sub_node->getUUIDValue(1, &mGroup)); - if (node->getChild("group_owned", sub_node)) - { - BOOL tmpbool = FALSE; - success = success && (1 == sub_node->getBoolValue(1, &tmpbool)); - mIsGroupOwned = (bool)tmpbool; - } - if (!success) - { - lldebugs << "LLPermissions::importXML() failed for node named '" - << node->getName() << "'" << llendl; - } - } - return success; -} +// Deleted LLPermissions::exportFileXML() and LLPermissions::importXML() +// because I can't find any non-test code references to it. 2009-05-04 JC bool LLPermissions::operator==(const LLPermissions &rhs) const { diff --git a/indra/llinventory/llpermissions.h b/indra/llinventory/llpermissions.h index 5587f8c3c83d38c7611772a38a5e81810888c08a..2035b57f5c8d4356bb888c801af58713521ea771 100644 --- a/indra/llinventory/llpermissions.h +++ b/indra/llinventory/llpermissions.h @@ -314,9 +314,6 @@ public: BOOL importLegacyStream(std::istream& input_stream); BOOL exportLegacyStream(std::ostream& output_stream) const; - LLXMLNode *exportFileXML() const; - bool importXML(LLXMLNode* node); - bool operator==(const LLPermissions &rhs) const; bool operator!=(const LLPermissions &rhs) const; diff --git a/indra/llinventory/llsaleinfo.cpp b/indra/llinventory/llsaleinfo.cpp index b7afb28adf9af490984c12318dca2cd3f9f607bb..930901f309915b17a84706314d09d7adebc25d68 100644 --- a/indra/llinventory/llsaleinfo.cpp +++ b/indra/llinventory/llsaleinfo.cpp @@ -135,38 +135,8 @@ bool LLSaleInfo::fromLLSD(const LLSD& sd, BOOL& has_perm_mask, U32& perm_mask) return true; } -LLXMLNode *LLSaleInfo::exportFileXML() const -{ - LLXMLNode *ret = new LLXMLNode("sale_info", FALSE); - std::string type_str = ll_safe_string( lookup(mSaleType)); - ret->createChild("type", TRUE)->setStringValue(1, &type_str); - ret->createChild("price", TRUE)->setIntValue(1, &mSalePrice); - return ret; -} - -BOOL LLSaleInfo::importXML(LLXMLNode* node) -{ - BOOL success = FALSE; - if (node) - { - success = TRUE; - LLXMLNodePtr sub_node; - if (node->getChild("type", sub_node)) - { - mSaleType = lookup(sub_node->getValue().c_str()); - } - if (node->getChild("price", sub_node)) - { - success &= (1 == sub_node->getIntValue(1, &mSalePrice)); - } - if (!success) - { - lldebugs << "LLSaleInfo::importXML() failed for node named '" - << node->getName() << "'" << llendl; - } - } - return success; -} +// Deleted LLSaleInfo::exportFileXML() and LLSaleInfo::importXML() +// because I can't find any non-test code references to it. 2009-05-04 JC BOOL LLSaleInfo::importFile(LLFILE* fp, BOOL& has_perm_mask, U32& perm_mask) { diff --git a/indra/llinventory/llsaleinfo.h b/indra/llinventory/llsaleinfo.h index d546c49fd7e50acc30eb30d53d93f3125023ae71..3461a128beb7706cf92591babfad9a51df795026 100644 --- a/indra/llinventory/llsaleinfo.h +++ b/indra/llinventory/llsaleinfo.h @@ -101,9 +101,6 @@ public: bool fromLLSD(const LLSD& sd, BOOL& has_perm_mask, U32& perm_mask); BOOL importLegacyStream(std::istream& input_stream, BOOL& has_perm_mask, U32& perm_mask); - LLXMLNode *exportFileXML() const; - BOOL importXML(LLXMLNode* node); - LLSD packMessage() const; void unpackMessage(LLSD sales); diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index 66451b1a27d14bed97b2c7b865e8322fd622d685..f85c4f39f412d625fa5358635a4b6cf259192d30 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -36,8 +36,8 @@ #include <cmath> #include <cstdlib> #include "lldefs.h" -#include "llstl.h" // *TODO: Remove when LLString is gone -#include "llstring.h" // *TODO: Remove when LLString is gone +//#include "llstl.h" // *TODO: Remove when LLString is gone +//#include "llstring.h" // *TODO: Remove when LLString is gone // lltut.h uses is_approx_equal_fraction(). This was moved to its own header // file in llcommon so we can use lltut.h for llcommon tests without making // llcommon depend on llmath. diff --git a/indra/llmath/llrect.h b/indra/llmath/llrect.h index 9eb58dbbe941eafd287628b74fdd5782474daf29..98aceb0597afb8894251d0146d2b04d4145e96c7 100644 --- a/indra/llmath/llrect.h +++ b/indra/llmath/llrect.h @@ -271,8 +271,8 @@ public: << " W " << rect.getWidth() << " H " << rect.getHeight() << " }"; return s; } - - bool operator==(const LLRectBase &b) + + bool operator==(const LLRectBase &b) const { return ((mLeft == b.mLeft) && (mTop == b.mTop) && @@ -280,7 +280,7 @@ public: (mBottom == b.mBottom)); } - bool operator!=(const LLRectBase &b) + bool operator!=(const LLRectBase &b) const { return ((mLeft != b.mLeft) || (mTop != b.mTop) || diff --git a/indra/llmath/llsdutil_math.cpp b/indra/llmath/llsdutil_math.cpp index 073cb2e3bda69ba65ee6176b70fc365d1d344578..c5176681cef05230597fabf5c50e338b6c18b0dd 100644 --- a/indra/llmath/llsdutil_math.cpp +++ b/indra/llmath/llsdutil_math.cpp @@ -165,9 +165,6 @@ LLSD ll_sd_from_color4(const LLColor4& c) LLColor4 ll_color4_from_sd(const LLSD& sd) { LLColor4 c; - c.mV[0] = (F32)sd[0].asReal(); - c.mV[1] = (F32)sd[1].asReal(); - c.mV[2] = (F32)sd[2].asReal(); - c.mV[3] = (F32)sd[3].asReal(); + c.setValue(sd); return c; } diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index e55fe52c91ef8a35ec87445f678cfc54cbc5c5f9..af46da05d85d7afbd8e8c1f430b43307239bc7a0 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -52,7 +52,7 @@ class LLVolume; #include "llquaternion.h" #include "llstrider.h" #include "v4coloru.h" -#include "llmemory.h" +#include "llrefcount.h" #include "llfile.h" //============================================================================ diff --git a/indra/llmath/llvolumemgr.h b/indra/llmath/llvolumemgr.h index e10ad94dbaf5ba3a70e32574cbbea98b3694725d..a78ea76a1a8d05c67191b2b47e67cbe57452c133 100644 --- a/indra/llmath/llvolumemgr.h +++ b/indra/llmath/llvolumemgr.h @@ -36,7 +36,7 @@ #include <map> #include "llvolume.h" -#include "llmemory.h" +#include "llpointer.h" #include "llthread.h" class LLVolumeParams; @@ -92,8 +92,8 @@ public: // whatever calls getVolume() never owns the LLVolume* and // cannot keep references for long since it may be deleted // later. For best results hold it in an LLPointer<LLVolume>. - LLVolume *refVolume(const LLVolumeParams &volume_params, const S32 detail); - void unrefVolume(LLVolume *volumep); + virtual LLVolume *refVolume(const LLVolumeParams &volume_params, const S32 detail); + virtual void unrefVolume(LLVolume *volumep); void dump(); diff --git a/indra/llmath/v3color.cpp b/indra/llmath/v3color.cpp index fa7b61cd75fb53a3e7351773713dca0eff15c124..e76607a91f2eae8a83142c5109022b03f087ed38 100644 --- a/indra/llmath/v3color.cpp +++ b/indra/llmath/v3color.cpp @@ -75,6 +75,42 @@ std::ostream& operator<<(std::ostream& s, const LLColor3 &a) return s; } +static F32 hueToRgb ( F32 val1In, F32 val2In, F32 valHUeIn ) +{ + if ( valHUeIn < 0.0f ) valHUeIn += 1.0f; + if ( valHUeIn > 1.0f ) valHUeIn -= 1.0f; + if ( ( 6.0f * valHUeIn ) < 1.0f ) return ( val1In + ( val2In - val1In ) * 6.0f * valHUeIn ); + if ( ( 2.0f * valHUeIn ) < 1.0f ) return ( val2In ); + if ( ( 3.0f * valHUeIn ) < 2.0f ) return ( val1In + ( val2In - val1In ) * ( ( 2.0f / 3.0f ) - valHUeIn ) * 6.0f ); + return ( val1In ); +} + +void LLColor3::setHSL ( F32 hValIn, F32 sValIn, F32 lValIn) +{ + if ( sValIn < 0.00001f ) + { + mV[VRED] = lValIn; + mV[VGREEN] = lValIn; + mV[VBLUE] = lValIn; + } + else + { + F32 interVal1; + F32 interVal2; + + if ( lValIn < 0.5f ) + interVal2 = lValIn * ( 1.0f + sValIn ); + else + interVal2 = ( lValIn + sValIn ) - ( sValIn * lValIn ); + + interVal1 = 2.0f * lValIn - interVal2; + + mV[VRED] = hueToRgb ( interVal1, interVal2, hValIn + ( 1.f / 3.f ) ); + mV[VGREEN] = hueToRgb ( interVal1, interVal2, hValIn ); + mV[VBLUE] = hueToRgb ( interVal1, interVal2, hValIn - ( 1.f / 3.f ) ); + } +} + void LLColor3::calcHSL(F32* hue, F32* saturation, F32* luminance) const { F32 var_R = mV[VRED]; diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h index 179687a32e09d86d61b7b94b4fb13c01e90531dd..1915d80502cbbce35170db0814edeaf026d2366d 100644 --- a/indra/llmath/v3color.h +++ b/indra/llmath/v3color.h @@ -79,6 +79,7 @@ public: mV[2] = (F32) sd[2].asReal();; } + void setHSL(F32 hue, F32 saturation, F32 luminance); void calcHSL(F32* hue, F32* saturation, F32* luminance) const; const LLColor3& setToBlack(); // Clears LLColor3 to (0, 0, 0) diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp index 0cbfce07c9e348b0a54e5af10438b83d88001b21..219b06ec7462495aaab7e71169a1c33540ddf30c 100644 --- a/indra/llmath/v4color.cpp +++ b/indra/llmath/v4color.cpp @@ -227,6 +227,40 @@ const LLColor4& LLColor4::setVec(const LLColor3 &vec, F32 a) return (*this); } +void LLColor4::setValue(const LLSD& sd) +{ +#if 0 + // Clamping on setValue from LLSD is inconsistent with other set behavior + F32 val; + bool out_of_range = false; + val = sd[0].asReal(); + mV[0] = llclamp(val, 0.f, 1.f); + out_of_range = mV[0] != val; + + val = sd[1].asReal(); + mV[1] = llclamp(val, 0.f, 1.f); + out_of_range |= mV[1] != val; + + val = sd[2].asReal(); + mV[2] = llclamp(val, 0.f, 1.f); + out_of_range |= mV[2] != val; + + val = sd[3].asReal(); + mV[3] = llclamp(val, 0.f, 1.f); + out_of_range |= mV[3] != val; + + if (out_of_range) + { + llwarns << "LLSD color value out of range!" << llendl; + } +#else + mV[0] = (F32) sd[0].asReal(); + mV[1] = (F32) sd[1].asReal(); + mV[2] = (F32) sd[2].asReal(); + mV[3] = (F32) sd[3].asReal(); +#endif +} + const LLColor4& LLColor4::operator=(const LLColor3 &a) { mV[VX] = a.mV[VX]; @@ -271,6 +305,42 @@ LLColor4 vec3to4(const LLColor3 &vec) return temp; } +static F32 hueToRgb ( F32 val1In, F32 val2In, F32 valHUeIn ) +{ + if ( valHUeIn < 0.0f ) valHUeIn += 1.0f; + if ( valHUeIn > 1.0f ) valHUeIn -= 1.0f; + if ( ( 6.0f * valHUeIn ) < 1.0f ) return ( val1In + ( val2In - val1In ) * 6.0f * valHUeIn ); + if ( ( 2.0f * valHUeIn ) < 1.0f ) return ( val2In ); + if ( ( 3.0f * valHUeIn ) < 2.0f ) return ( val1In + ( val2In - val1In ) * ( ( 2.0f / 3.0f ) - valHUeIn ) * 6.0f ); + return ( val1In ); +} + +void LLColor4::setHSL ( F32 hValIn, F32 sValIn, F32 lValIn) +{ + if ( sValIn < 0.00001f ) + { + mV[VRED] = lValIn; + mV[VGREEN] = lValIn; + mV[VBLUE] = lValIn; + } + else + { + F32 interVal1; + F32 interVal2; + + if ( lValIn < 0.5f ) + interVal2 = lValIn * ( 1.0f + sValIn ); + else + interVal2 = ( lValIn + sValIn ) - ( sValIn * lValIn ); + + interVal1 = 2.0f * lValIn - interVal2; + + mV[VRED] = hueToRgb ( interVal1, interVal2, hValIn + ( 1.f / 3.f ) ); + mV[VGREEN] = hueToRgb ( interVal1, interVal2, hValIn ); + mV[VBLUE] = hueToRgb ( interVal1, interVal2, hValIn - ( 1.f / 3.f ) ); + } +} + void LLColor4::calcHSL(F32* hue, F32* saturation, F32* luminance) const { F32 var_R = mV[VRED]; diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index 785b47dd377ec46be82c64d854d09eb15f8d01af..7414c38847901b8650025fcfd97405ef42c910b1 100644 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -72,14 +72,9 @@ class LLColor4 return ret; } - void setValue(const LLSD& sd) - { - mV[0] = (F32) sd[0].asReal(); - mV[1] = (F32) sd[1].asReal(); - mV[2] = (F32) sd[2].asReal(); - mV[3] = (F32) sd[3].asReal(); - } + void setValue(const LLSD& sd); + void setHSL(F32 hue, F32 saturation, F32 luminance); void calcHSL(F32* hue, F32* saturation, F32* luminance) const; const LLColor4& setToBlack(); // zero LLColor4 to (0, 0, 0, 1) @@ -249,7 +244,7 @@ inline LLColor4::LLColor4(void) inline LLColor4::LLColor4(const LLSD& sd) { - *this = sd; + this->setValue(sd); } inline LLColor4::LLColor4(F32 r, F32 g, F32 b) @@ -641,10 +636,7 @@ void LLColor4::clamp() inline const LLColor4& LLColor4::operator=(const LLSD& sd) { - mV[0] = (F32) sd[0].asReal(); - mV[1] = (F32) sd[1].asReal(); - mV[2] = (F32) sd[2].asReal(); - mV[3] = (F32) sd[3].asReal(); + setValue(sd); return *this; } diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index 082d0efbb110ccbb22349cebbc780e71b02cca9b..c0390fa0b2d364710a80245f291dd2069a46b226 100644 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h @@ -138,6 +138,12 @@ public: static BOOL parseColor4U(const std::string& buf, LLColor4U* value); + // conversion + operator const LLColor4() const + { + return LLColor4(*this); + } + static LLColor4U white; static LLColor4U black; static LLColor4U red; diff --git a/indra/llmessage/llares.h b/indra/llmessage/llares.h index 96d7f6dd31017fa80d391757692c5ddd5e3d7ac4..c709a08499473b7808909934236654c7df314357 100644 --- a/indra/llmessage/llares.h +++ b/indra/llmessage/llares.h @@ -45,7 +45,8 @@ # include <ares/ares.h> #endif -#include "llmemory.h" +#include "llpointer.h" +#include "llrefcount.h" #include "lluri.h" class LLQueryResponder; diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 799bc83e2028bae719e38b8c2b3aa1ccbed448c7..b42c5237f7130e7b93bb2a518eced4e5a73d1103 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -42,11 +42,7 @@ #include "llsdserialize.h" #include "lluuid.h" #include "message.h" - -// Constants -static const std::string CN_WAITING("(Loading...)"); // *TODO: translate -static const std::string CN_NOBODY("(nobody)"); // *TODO: translate -static const std::string CN_NONE("(none)"); // *TODO: translate +#include "llmemtype.h" // llsd serialization constants static const std::string AGENTS("agents"); @@ -65,6 +61,7 @@ const S32 CN_FILE_VERSION = 2; // Globals LLCacheName* gCacheName = NULL; +std::map<std::string, std::string> LLCacheName::sCacheName; /// --------------------------------------------------------------------------- /// class LLCacheNameEntry @@ -92,17 +89,19 @@ class PendingReply { public: LLUUID mID; - LLCacheNameCallback mCallback; + LLCacheNameSignal mSignal; LLHost mHost; - void* mData; - PendingReply(const LLUUID& id, LLCacheNameCallback callback, void* data = NULL) - : mID(id), mCallback(callback), mData(data) - { } - + PendingReply(const LLUUID& id, const LLHost& host) - : mID(id), mCallback(0), mHost(host) - { } - + : mID(id), mHost(host) + { + } + + boost::signals::connection setCallback(const LLCacheNameCallback& cb) + { + return mSignal.connect(cb); + } + void done() { mID.setNull(); } bool isDone() const { return mID.isNull() != FALSE; } }; @@ -187,10 +186,9 @@ void ReplySender::flush() typedef std::set<LLUUID> AskQueue; -typedef std::vector<PendingReply> ReplyQueue; +typedef std::list<PendingReply*> ReplyQueue; typedef std::map<LLUUID,U32> PendingQueue; typedef std::map<LLUUID, LLCacheNameEntry*> Cache; -typedef std::vector<LLCacheNameCallback> Observers; class LLCacheName::Impl { @@ -211,13 +209,16 @@ public: ReplyQueue mReplyQueue; // requests awaiting replies from us - Observers mObservers; + LLCacheNameSignal mSignal; LLFrameTimer mProcessTimer; Impl(LLMessageSystem* msg); ~Impl(); - + + boost::signals::connection addPending(const LLUUID& id, const LLCacheNameCallback& callback); + void addPending(const LLUUID& id, const LLHost& host); + void processPendingAsks(); void processPendingReplies(); void sendRequest(const char* msg_name, const AskQueue& queue); @@ -231,8 +232,6 @@ public: static void handleUUIDNameReply(LLMessageSystem* msg, void** userdata); static void handleUUIDGroupNameRequest(LLMessageSystem* msg, void** userdata); static void handleUUIDGroupNameReply(LLMessageSystem* msg, void** userdata); - - void notifyObservers(const LLUUID& id, const std::string& first, const std::string& last, BOOL group); }; @@ -247,6 +246,9 @@ LLCacheName::LLCacheName(LLMessageSystem* msg) LLCacheName::LLCacheName(LLMessageSystem* msg, const LLHost& upstream_host) : impl(* new Impl(msg)) { + sCacheName["waiting"] = "(Loading...)"; + sCacheName["nobody"] = "(nobody)"; + sCacheName["none"] = "(none)"; setUpstream(upstream_host); } @@ -272,52 +274,31 @@ LLCacheName::Impl::Impl(LLMessageSystem* msg) LLCacheName::Impl::~Impl() { for_each(mCache.begin(), mCache.end(), DeletePairedPointer()); + for_each(mReplyQueue.begin(), mReplyQueue.end(), DeletePointer()); } - -void LLCacheName::setUpstream(const LLHost& upstream_host) +boost::signals::connection LLCacheName::Impl::addPending(const LLUUID& id, const LLCacheNameCallback& callback) { - impl.mUpstreamHost = upstream_host; + PendingReply* reply = new PendingReply(id, LLHost()); + boost::signals::connection res = reply->setCallback(callback); + mReplyQueue.push_back(reply); + return res; } -void LLCacheName::addObserver(LLCacheNameCallback callback) +void LLCacheName::Impl::addPending(const LLUUID& id, const LLHost& host) { - impl.mObservers.push_back(callback); + PendingReply* reply = new PendingReply(id, host); + mReplyQueue.push_back(reply); } -void LLCacheName::removeObserver(LLCacheNameCallback callback) +void LLCacheName::setUpstream(const LLHost& upstream_host) { - Observers::iterator it = impl.mObservers.begin(); - Observers::iterator end = impl.mObservers.end(); - - for ( ; it != end; ++it) - { - const LLCacheNameCallback& cb = (*it); - if (cb == callback) - { - impl.mObservers.erase(it); - return; - } - } + impl.mUpstreamHost = upstream_host; } -void LLCacheName::cancelCallback(const LLUUID& id, LLCacheNameCallback callback, void* user_data) +boost::signals::connection LLCacheName::addObserver(const LLCacheNameCallback& callback) { - ReplyQueue::iterator it = impl.mReplyQueue.begin(); - ReplyQueue::iterator end = impl.mReplyQueue.end(); - - for(; it != end; ++it) - { - const PendingReply& reply = (*it); - - if ((callback == reply.mCallback) - && (id == reply.mID) - && (user_data == reply.mData) ) - { - impl.mReplyQueue.erase(it); - return; - } - } + return impl.mSignal.connect(callback); } void LLCacheName::importFile(LLFILE* fp) @@ -493,7 +474,7 @@ BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& las { if(id.isNull()) { - first = CN_NOBODY; + first = sCacheName["nobody"]; last.clear(); return FALSE; } @@ -507,7 +488,7 @@ BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& las } else { - first = CN_WAITING; + first = sCacheName["waiting"]; last.clear(); if (!impl.isRequestPending(id)) { @@ -517,6 +498,14 @@ BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& las } } +// static +void LLCacheName::LocalizeCacheName(std::string key, std::string value) +{ + if (key!="" && value!= "" ) + sCacheName[key]=value; + else + llwarns<< " Error localizing cache key " << key << " To "<< value<<llendl; +} BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname) { @@ -530,7 +519,7 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) { if(id.isNull()) { - group = CN_NONE; + group = sCacheName["none"]; return FALSE; } @@ -551,7 +540,7 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) } else { - group = CN_WAITING; + group = sCacheName["waiting"]; if (!impl.isRequestPending(id)) { impl.mAskGroupQueue.insert(id); @@ -559,28 +548,38 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) return FALSE; } } - -// TODO: Make the cache name callback take a SINGLE std::string, -// not a separate first and last name. -void LLCacheName::get(const LLUUID& id, BOOL is_group, LLCacheNameCallback callback, void* user_data) +// This is a little bit kludgy. LLCacheNameCallback is a slot instead of a function pointer. +// The reason it is a slot is so that the legacy get() function below can bind an old callback +// and pass it as a slot. The reason it isn't a boost::function is so that trackable behavior +// deson't get lost. As a result, we have to bind the slot to a signal to call it, even when +// we call it immediately. -Steve +// NOTE: Even though passing first and last name is a bit of extra overhead, it eliminates the +// potential need for any parsing should any code need to handle first and last name independently. +boost::signals::connection LLCacheName::get(const LLUUID& id, BOOL is_group, const LLCacheNameCallback& callback) { + boost::signals::connection res; + if(id.isNull()) { - callback(id, CN_NOBODY, "", is_group, user_data); - return; + LLCacheNameSignal signal; + signal.connect(callback); + signal(id, sCacheName["nobody"], "", is_group); + return res; } LLCacheNameEntry* entry = get_ptr_in_map(impl.mCache, id ); if (entry) { + LLCacheNameSignal signal; + signal.connect(callback); // id found in map therefore we can call the callback immediately. if (entry->mIsGroup) { - callback(id, entry->mGroupName, "", entry->mIsGroup, user_data); + signal(id, entry->mGroupName, "", entry->mIsGroup); } else { - callback(id, entry->mFirstName, entry->mLastName, entry->mIsGroup, user_data); + signal(id, entry->mFirstName, entry->mLastName, entry->mIsGroup); } } else @@ -597,12 +596,19 @@ void LLCacheName::get(const LLUUID& id, BOOL is_group, LLCacheNameCallback callb impl.mAskNameQueue.insert(id); } } - impl.mReplyQueue.push_back(PendingReply(id, callback, user_data)); + res = impl.addPending(id, callback); } + return res; +} + +boost::signals::connection LLCacheName::get(const LLUUID& id, BOOL is_group, old_callback_t callback, void* user_data) +{ + return get(id, is_group, boost::bind(callback, _1, _2, _3, _4, user_data)); } void LLCacheName::processPending() { + LLMemType mt_pp(LLMemType::MTYPE_CACHE_PROCESS_PENDING); const F32 SECS_BETWEEN_PROCESS = 0.1f; if(!impl.mProcessTimer.checkExpirationAndReset(SECS_BETWEEN_PROCESS)) { @@ -684,18 +690,19 @@ void LLCacheName::dumpStats() << " AskGroup=" << impl.mAskGroupQueue.size() << " Pending=" << impl.mPendingQueue.size() << " Reply=" << impl.mReplyQueue.size() - << " Observers=" << impl.mObservers.size() +// << " Observers=" << impl.mSignal.size() << llendl; } //static std::string LLCacheName::getDefaultName() { - return CN_WAITING; + return sCacheName["waiting"]; } void LLCacheName::Impl::processPendingAsks() { + LLMemType mt_ppa(LLMemType::MTYPE_CACHE_PROCESS_PENDING_ASKS); sendRequest(_PREHASH_UUIDNameRequest, mAskNameQueue); sendRequest(_PREHASH_UUIDGroupNameRequest, mAskGroupQueue); mAskNameQueue.clear(); @@ -704,50 +711,50 @@ void LLCacheName::Impl::processPendingAsks() void LLCacheName::Impl::processPendingReplies() { - ReplyQueue::iterator it = mReplyQueue.begin(); - ReplyQueue::iterator end = mReplyQueue.end(); - + LLMemType mt_ppr(LLMemType::MTYPE_CACHE_PROCESS_PENDING_REPLIES); // First call all the callbacks, because they might send messages. - for(; it != end; ++it) + for(ReplyQueue::iterator it = mReplyQueue.begin(); it != mReplyQueue.end(); ++it) { - LLCacheNameEntry* entry = get_ptr_in_map(mCache, it->mID); + PendingReply* reply = *it; + LLCacheNameEntry* entry = get_ptr_in_map(mCache, reply->mID); if(!entry) continue; - if (it->mCallback) + if (!entry->mIsGroup) { - if (!entry->mIsGroup) - { - (it->mCallback)(it->mID, - entry->mFirstName, entry->mLastName, - FALSE, it->mData); - } - else { - (it->mCallback)(it->mID, - entry->mGroupName, "", - TRUE, it->mData); - } + (reply->mSignal)(reply->mID, entry->mFirstName, entry->mLastName, FALSE); + } + else + { + (reply->mSignal)(reply->mID, entry->mGroupName, "", TRUE); } } // Forward on all replies, if needed. ReplySender sender(mMsg); - for (it = mReplyQueue.begin(); it != end; ++it) + for(ReplyQueue::iterator it = mReplyQueue.begin(); it != mReplyQueue.end(); ++it) { - LLCacheNameEntry* entry = get_ptr_in_map(mCache, it->mID); + PendingReply* reply = *it; + LLCacheNameEntry* entry = get_ptr_in_map(mCache, reply->mID); if(!entry) continue; - if (it->mHost.isOk()) + if (reply->mHost.isOk()) { - sender.send(it->mID, *entry, it->mHost); + sender.send(reply->mID, *entry, reply->mHost); } - it->done(); + reply->done(); + } + + for(ReplyQueue::iterator it = mReplyQueue.begin(); it != mReplyQueue.end(); ) + { + ReplyQueue::iterator curit = it++; + PendingReply* reply = *curit; + if (reply->isDone()) + { + delete reply; + mReplyQueue.erase(curit); + } } - - mReplyQueue.erase( - remove_if(mReplyQueue.begin(), mReplyQueue.end(), - std::mem_fun_ref(&PendingReply::isDone)), - mReplyQueue.end()); } @@ -785,18 +792,6 @@ void LLCacheName::Impl::sendRequest( } } -void LLCacheName::Impl::notifyObservers(const LLUUID& id, - const std::string& first, const std::string& last, BOOL is_group) -{ - for (Observers::const_iterator i = mObservers.begin(), - end = mObservers.end(); - i != end; - ++i) - { - (**i)(id, first, last, is_group, NULL); - } -} - bool LLCacheName::Impl::isRequestPending(const LLUUID& id) { U32 now = (U32)time(NULL); @@ -863,7 +858,7 @@ void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup) } } - mReplyQueue.push_back(PendingReply(id, fromHost)); + addPending(id, fromHost); } } } @@ -901,11 +896,11 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup) if (!isGroup) { - notifyObservers(id, entry->mFirstName, entry->mLastName, FALSE); + mSignal(id, entry->mFirstName, entry->mLastName, FALSE); } else { - notifyObservers(id, entry->mGroupName, "", TRUE); + mSignal(id, entry->mGroupName, "", TRUE); } } } diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 2757b86a7c3468f99fe15cbe955bfb3575a95174..414b6590f6c5271c321691f3b76bb34e9c0da572 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -33,12 +33,22 @@ #ifndef LL_LLCACHENAME_H #define LL_LLCACHENAME_H +#include <boost/bind.hpp> +#include <boost/signals.hpp> + class LLMessageSystem; class LLHost; class LLUUID; -// agent_id/group_id, first_name, last_name, is_group, user_data -typedef void (*LLCacheNameCallback)(const LLUUID&, const std::string&, const std::string&, BOOL, void*); + +typedef boost::signal<void (const LLUUID& id, + const std::string& first_name, + const std::string& last_name, + BOOL is_group)> LLCacheNameSignal; +typedef LLCacheNameSignal::slot_type LLCacheNameCallback; + +// Old callback with user data for compatability +typedef void (*old_callback_t)(const LLUUID&, const std::string&, const std::string&, BOOL, void*); // Here's the theory: // If you request a name that isn't in the cache, it returns "waiting" @@ -59,10 +69,7 @@ public: // for simulators, this is the data server void setUpstream(const LLHost& upstream_host); - void addObserver(LLCacheNameCallback callback); - void removeObserver(LLCacheNameCallback callback); - - void cancelCallback(const LLUUID& id, LLCacheNameCallback callback, void* user_data = NULL); + boost::signals::connection addObserver(const LLCacheNameCallback& callback); // janky old format. Remove after a while. Phoenix. 2008-01-30 void importFile(LLFILE* fp); @@ -89,11 +96,10 @@ public: // If the data is currently available, may call the callback immediatly // otherwise, will request the data, and will call the callback when // available. There is no garuntee the callback will ever be called. - void get(const LLUUID& id, BOOL is_group, LLCacheNameCallback callback, void* user_data = NULL); + boost::signals::connection get(const LLUUID& id, BOOL is_group, const LLCacheNameCallback& callback); // LEGACY - void getName(const LLUUID& id, LLCacheNameCallback callback, void* user_data = NULL) - { get(id, FALSE, callback, user_data); } + boost::signals::connection get(const LLUUID& id, BOOL is_group, old_callback_t callback, void* user_data); // This method needs to be called from time to time to send out // requests. @@ -107,7 +113,8 @@ public: void dumpStats(); // Dumps the sizes of the cache and associated queues. static std::string getDefaultName(); - + static void LocalizeCacheName(std::string key, std::string value); + static std::map<std::string, std::string> sCacheName; private: class Impl; diff --git a/indra/llmessage/llhttpclientadapter.cpp b/indra/llmessage/llhttpclientadapter.cpp index bbb56960df8e4846d3544916571508a3dcbf3a0c..b6988224ce7356524caa73e4d37681a84a84f3bf 100644 --- a/indra/llmessage/llhttpclientadapter.cpp +++ b/indra/llmessage/llhttpclientadapter.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2001-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/llmessage/llhttpclientadapter.h b/indra/llmessage/llhttpclientadapter.h index d5f3aeaf2cf06bdeab1137b6a15447e2248a3d8f..7f76390d0c59d9a2ff2cb43966867f407ff3a86d 100644 --- a/indra/llmessage/llhttpclientadapter.h +++ b/indra/llmessage/llhttpclientadapter.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -33,7 +34,7 @@ #define LL_HTTPCLIENTADAPTER_H #include "llhttpclientinterface.h" -#include "llmemory.h" // LLSingleton<> +#include "llsingleton.h" // LLSingleton<> class LLHTTPClientAdapter : public LLHTTPClientInterface, public LLSingleton<LLHTTPClientAdapter> { diff --git a/indra/llmessage/llhttpclientinterface.h b/indra/llmessage/llhttpclientinterface.h index 1f13d46447cedde8117e02f1046426d1a71c8cb1..42a8e5cd0a9bac2068c71a12ca73569c33f949f7 100644 --- a/indra/llmessage/llhttpclientinterface.h +++ b/indra/llmessage/llhttpclientinterface.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/llmessage/llhttpnode.h b/indra/llmessage/llhttpnode.h index 17ffd66e8f95f20c21159c931cde8a6cb722c32b..3f4da69a1d1eb95843a33e04629d509dfbb3f9fa 100644 --- a/indra/llmessage/llhttpnode.h +++ b/indra/llmessage/llhttpnode.h @@ -33,7 +33,8 @@ #ifndef LL_LLHTTPNODE_H #define LL_LLHTTPNODE_H -#include "llmemory.h" +#include "llpointer.h" +#include "llrefcount.h" #include "llsd.h" class LLChainIOFactory; diff --git a/indra/llmessage/llhttpnodeadapter.h b/indra/llmessage/llhttpnodeadapter.h index 08b56641629f70a9546ea2e1d3f0f1c8c4e611ae..7c3e9d81d1adcddd813095270d06b78581610c42 100644 --- a/indra/llmessage/llhttpnodeadapter.h +++ b/indra/llmessage/llhttpnodeadapter.h @@ -3,26 +3,27 @@ * @brief Declaration of llhttpnode adapter classes * * $LicenseInfo:firstyear=2009&license=viewergpl$ - * + * * Copyright (c) 2009, Linden Research, Inc. - * + * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 - * + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception - * + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, * and agree to abide by those obligations. - * + * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. diff --git a/indra/llmessage/llinstantmessage.cpp b/indra/llmessage/llinstantmessage.cpp index 3205ddfaebc7e7917317b012ef70245fdc654cec..7c636250040c2ef54fef28556591a8c81d8fcf7e 100644 --- a/indra/llmessage/llinstantmessage.cpp +++ b/indra/llmessage/llinstantmessage.cpp @@ -41,7 +41,7 @@ #include "llsd.h" #include "llsdserialize.h" #include "llsdutil.h" -#include "llmemory.h" +#include "llpointer.h" #include "message.h" #include "message.h" diff --git a/indra/llmessage/llinstantmessage.h b/indra/llmessage/llinstantmessage.h index 9ce6a10c806a9c24ae2385a78c195f20b4172547..272e753f3cd8789a68e8f33fbe094a61bd831eec 100644 --- a/indra/llmessage/llinstantmessage.h +++ b/indra/llmessage/llinstantmessage.h @@ -36,7 +36,8 @@ #include "llhost.h" #include "lluuid.h" #include "llsd.h" -#include "llmemory.h" +#include "llrefcount.h" +#include "llpointer.h" #include "v3math.h" class LLMessageSystem; diff --git a/indra/llmessage/llmessagesenderinterface.h b/indra/llmessage/llmessagesenderinterface.h index 40826663398cc84d608a60de143aa867ea48432d..119eb1d7f73f2013e01af8ea9b711b6a7a9bbb7c 100644 --- a/indra/llmessage/llmessagesenderinterface.h +++ b/indra/llmessage/llmessagesenderinterface.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/llmessage/llregionpresenceverifier.cpp b/indra/llmessage/llregionpresenceverifier.cpp index 552cf4cbdb68ccf8c7652e51d7d373a35c4d0372..0527d5cb8debff456cbf674598a5a22a0fe944b0 100644 --- a/indra/llmessage/llregionpresenceverifier.cpp +++ b/indra/llmessage/llregionpresenceverifier.cpp @@ -4,14 +4,25 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * - * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of - * this source code is governed by the Linden Lab Source Code Disclosure - * Agreement ("Agreement") previously entered between you and Linden - * Lab. By accessing, using, copying, modifying or distributing this - * software, you acknowledge that you have been informed of your - * obligations under the Agreement and agree to abide by those obligations. + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, diff --git a/indra/llmessage/llregionpresenceverifier.h b/indra/llmessage/llregionpresenceverifier.h index d1de608ec6098b8ad6ec22e4309667cafa7fd321..10602450d8e5bf84a5bce555cf510716acd1d24d 100644 --- a/indra/llmessage/llregionpresenceverifier.h +++ b/indra/llmessage/llregionpresenceverifier.h @@ -4,14 +4,25 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * - * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of - * this source code is governed by the Linden Lab Source Code Disclosure - * Agreement ("Agreement") previously entered between you and Linden - * Lab. By accessing, using, copying, modifying or distributing this - * software, you acknowledge that you have been informed of your - * obligations under the Agreement and agree to abide by those obligations. + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, diff --git a/indra/llmessage/llstoredmessage.cpp b/indra/llmessage/llstoredmessage.cpp index 615eff405d4e61d05da495fbc9855bc697f4e198..32cbb15cb385fcf072e5e7375634fe353db704bf 100644 --- a/indra/llmessage/llstoredmessage.cpp +++ b/indra/llmessage/llstoredmessage.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2001-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/llmessage/llstoredmessage.h b/indra/llmessage/llstoredmessage.h index e817f19bd2c68c8bf97a063f8e7b5b5b896474f7..5069c2cb2e19226d283d19fe6dfefa8c02321e9e 100644 --- a/indra/llmessage/llstoredmessage.h +++ b/indra/llmessage/llstoredmessage.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2001-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/llmessage/lltemplatemessagedispatcher.cpp b/indra/llmessage/lltemplatemessagedispatcher.cpp index 3bbf3a058de61ef6949667f81fd8a7fc8e09e491..ab1beb362bd7f1e933e4283197d28b17b5b22388 100644 --- a/indra/llmessage/lltemplatemessagedispatcher.cpp +++ b/indra/llmessage/lltemplatemessagedispatcher.cpp @@ -3,26 +3,27 @@ * @brief LLTemplateMessageDispatcher class * * $LicenseInfo:firstyear=2009&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * + * Copyright (c) 2009, Linden Research, Inc. + * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 - * + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception - * + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, * and agree to abide by those obligations. - * + * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. diff --git a/indra/llmessage/lltemplatemessagedispatcher.h b/indra/llmessage/lltemplatemessagedispatcher.h index b1e74f47bb56d8e7a9ec843769ffd757505d4105..fa861e4e423b3edf7f24bb53aef687a49a2264df 100644 --- a/indra/llmessage/lltemplatemessagedispatcher.h +++ b/indra/llmessage/lltemplatemessagedispatcher.h @@ -3,26 +3,27 @@ * @brief LLTemplateMessageDispatcher class * * $LicenseInfo:firstyear=2009&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * + * Copyright (c) 2009, Linden Research, Inc. + * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 - * + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception - * + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, * and agree to abide by those obligations. - * + * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. diff --git a/indra/llmessage/lltransfersourceasset.cpp b/indra/llmessage/lltransfersourceasset.cpp index a4d59275b91f903afc3b6070cfa3e16cfd7e2b60..059c1bdfa1b8f82f4bd73186d1da0f9c12804969 100644 --- a/indra/llmessage/lltransfersourceasset.cpp +++ b/indra/llmessage/lltransfersourceasset.cpp @@ -270,6 +270,7 @@ bool is_asset_fetch_by_id_allowed(LLAssetType::EType type) case LLAssetType::AT_BODYPART: case LLAssetType::AT_ANIMATION: case LLAssetType::AT_GESTURE: + case LLAssetType::AT_FAVORITE: rv = true; break; default: @@ -292,6 +293,7 @@ bool is_asset_id_knowable(LLAssetType::EType type) case LLAssetType::AT_BODYPART: case LLAssetType::AT_ANIMATION: case LLAssetType::AT_GESTURE: + case LLAssetType::AT_FAVORITE: rv = true; break; default: diff --git a/indra/llmessage/lltrustedmessageservice.cpp b/indra/llmessage/lltrustedmessageservice.cpp index c1a6c437a7f2bb2d97a158bbe73e743d924f3f2a..505ece57b01c2c61e69b2765652e80cb1eea5dce 100644 --- a/indra/llmessage/lltrustedmessageservice.cpp +++ b/indra/llmessage/lltrustedmessageservice.cpp @@ -3,26 +3,27 @@ * @brief LLTrustedMessageService implementation * * $LicenseInfo:firstyear=2009&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * + * Copyright (c) 2009, Linden Research, Inc. + * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 - * + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception - * + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, * and agree to abide by those obligations. - * + * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. diff --git a/indra/llmessage/lltrustedmessageservice.h b/indra/llmessage/lltrustedmessageservice.h index bc824565f1917dc216772fb9984e8278dd9070da..dc37702471c97c503b548cdedffa73d94610453a 100644 --- a/indra/llmessage/lltrustedmessageservice.h +++ b/indra/llmessage/lltrustedmessageservice.h @@ -3,26 +3,27 @@ * @brief LLTrustedMessageService class * * $LicenseInfo:firstyear=2009&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * + * Copyright (c) 2009, Linden Research, Inc. + * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 - * + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception - * + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, * and agree to abide by those obligations. - * + * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 78af35bf65dae0340690521c26c37552a8740b41..e56d818d652899f9604e275709886c102f4024ae 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -86,6 +86,7 @@ #include "v3math.h" #include "v4math.h" #include "lltransfertargetvfile.h" +#include "llmemtype.h" // Constants //const char* MESSAGE_LOG_FILENAME = "message.log"; @@ -794,6 +795,7 @@ S32 LLMessageSystem::getReceiveBytes() const void LLMessageSystem::processAcks() { + LLMemType mt_pa(LLMemType::MTYPE_MESSAGE_PROCESS_ACKS); F64 mt_sec = getMessageTimeSeconds(); { gTransferManager.updateTransfers(); @@ -4020,6 +4022,7 @@ void LLMessageSystem::setTimeDecodesSpamThreshold( F32 seconds ) // TODO: babbage: move gServicePump in to LLMessageSystem? bool LLMessageSystem::checkAllMessages(S64 frame_count, LLPumpIO* http_pump) { + LLMemType mt_cam(LLMemType::MTYPE_MESSAGE_CHECK_ALL); if(checkMessages(frame_count)) { return true; diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index 0f3576732dcc9585bbd310885dee223e0ff2e20c..27482ca1af1860ca0f86750ea47efce944b17c2c 100644 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -59,10 +59,10 @@ #include "llhttpclient.h" #include "llhttpnode.h" #include "llpacketack.h" +#include "llsingleton.h" #include "message_prehash.h" #include "llstl.h" #include "llmsgvariabletype.h" -#include "llmsgvariabletype.h" #include "llmessagesenderinterface.h" #include "llstoredmessage.h" diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index 43b5f8e22469143f64f5b296886a846bc54bea99..4e657067cd8d3354d71e028456542c849d581d10 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -405,7 +405,7 @@ char* _PREHASH_GlobalX = LLMessageStringTable::getInstance()->getString("GlobalX char* _PREHASH_GlobalY = LLMessageStringTable::getInstance()->getString("GlobalY"); char* _PREHASH_CopyRotates = LLMessageStringTable::getInstance()->getString("CopyRotates"); char* _PREHASH_KickUserAck = LLMessageStringTable::getInstance()->getString("KickUserAck"); -char* _PREHASH_TopPick = LLMessageStringTable::getInstance()->getString("TopPick"); +char* _PREHASH_TopPick = LLMessageStringTable::getInstance()->getString("TopPick"); //legacy var need to be deleted -angela char* _PREHASH_SessionID = LLMessageStringTable::getInstance()->getString("SessionID"); char* _PREHASH_GlobalZ = LLMessageStringTable::getInstance()->getString("GlobalZ"); char* _PREHASH_DeclineFriendship = LLMessageStringTable::getInstance()->getString("DeclineFriendship"); diff --git a/indra/llmessage/tests/commtest.h b/indra/llmessage/tests/commtest.h index 7360230451525f2cfd0157a4512a0d3b3e3c492c..cf1461ed2b831818ed368becf837403695bed700 100644 --- a/indra/llmessage/tests/commtest.h +++ b/indra/llmessage/tests/commtest.h @@ -5,7 +5,30 @@ * @brief * * $LicenseInfo:firstyear=2009&license=viewergpl$ + * * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ diff --git a/indra/llmessage/tests/llcurl_stub.cpp b/indra/llmessage/tests/llcurl_stub.cpp index 93653e345e0190129497c1281a736f4454876367..d6be54336a4a68f40c5df52c28e7029faebc2420 100644 --- a/indra/llmessage/tests/llcurl_stub.cpp +++ b/indra/llmessage/tests/llcurl_stub.cpp @@ -3,16 +3,16 @@ * @brief stub class to allow unit testing * * $LicenseInfo:firstyear=2008&license=viewergpl$ - * - * Copyright (c) 2008, Linden Research, Inc. - * + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of * this source code is governed by the Linden Lab Source Code Disclosure - * Agreement ("Agreement") { } + * Agreement ("Agreement") previously entered between you and Linden * Lab. By accessing, using, copying, modifying or distributing this * software, you acknowledge that you have been informed of your * obligations under the Agreement and agree to abide by those obligations. - * + * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. diff --git a/indra/llmessage/tests/llhttpclientadapter_test.cpp b/indra/llmessage/tests/llhttpclientadapter_test.cpp index bde76db08b04018f92ec99b7d039aab2892c0b79..250fa100b67b7a5e7fb1e838502ea34846fda2cc 100644 --- a/indra/llmessage/tests/llhttpclientadapter_test.cpp +++ b/indra/llmessage/tests/llhttpclientadapter_test.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2001-2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/llmessage/tests/lltemplatemessagedispatcher_test.cpp b/indra/llmessage/tests/lltemplatemessagedispatcher_test.cpp index a6f5659352a5169fe43607bdb2294e85a1290c13..d57f17f270797c82b5d691690eb9b4ec3bbde853 100644 --- a/indra/llmessage/tests/lltemplatemessagedispatcher_test.cpp +++ b/indra/llmessage/tests/lltemplatemessagedispatcher_test.cpp @@ -3,26 +3,27 @@ * @brief LLTrustedMessageService unit tests * * $LicenseInfo:firstyear=2009&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * + * Copyright (c) 2009, Linden Research, Inc. + * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 - * + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception - * + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, * and agree to abide by those obligations. - * + * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. diff --git a/indra/llmessage/tests/lltesthttpclientadapter.cpp b/indra/llmessage/tests/lltesthttpclientadapter.cpp index 41ce36f3452cacfb256235f8c736d04107235b52..0cea4b57c206eadc6b101be8ecab1d3bc8a991ac 100644 --- a/indra/llmessage/tests/lltesthttpclientadapter.cpp +++ b/indra/llmessage/tests/lltesthttpclientadapter.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of * this source code is governed by the Linden Lab Source Code Disclosure diff --git a/indra/llmessage/tests/lltesthttpclientadapter.h b/indra/llmessage/tests/lltesthttpclientadapter.h index cd93bcc8c15166854849dbdc47a5291559edb27f..6f252e8510e4a7cb2c73f5dffeba32a119ab275f 100644 --- a/indra/llmessage/tests/lltesthttpclientadapter.h +++ b/indra/llmessage/tests/lltesthttpclientadapter.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of * this source code is governed by the Linden Lab Source Code Disclosure diff --git a/indra/llmessage/tests/lltestmessagesender.cpp b/indra/llmessage/tests/lltestmessagesender.cpp index 240813a4a3d26eceb083486c5c6a1b45dad380eb..3d1876ec368a69c0f66dd25c17c99417ed65840e 100644 --- a/indra/llmessage/tests/lltestmessagesender.cpp +++ b/indra/llmessage/tests/lltestmessagesender.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of * this source code is governed by the Linden Lab Source Code Disclosure diff --git a/indra/llmessage/tests/lltestmessagesender.h b/indra/llmessage/tests/lltestmessagesender.h index 00641d19136eaa34b2c67f04a69bb6f6885f16f0..d3aaee8f695199522db2934eb025d597b5ae3a1e 100644 --- a/indra/llmessage/tests/lltestmessagesender.h +++ b/indra/llmessage/tests/lltestmessagesender.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of * this source code is governed by the Linden Lab Source Code Disclosure diff --git a/indra/llmessage/tests/lltrustedmessageservice_test.cpp b/indra/llmessage/tests/lltrustedmessageservice_test.cpp index 44595391dfe723f45daf313507cfd72480979505..0a3da4b467efb9637003d2ecb51995da77349d51 100644 --- a/indra/llmessage/tests/lltrustedmessageservice_test.cpp +++ b/indra/llmessage/tests/lltrustedmessageservice_test.cpp @@ -3,26 +3,27 @@ * @brief LLTrustedMessageService unit tests * * $LicenseInfo:firstyear=2009&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * + * Copyright (c) 2009, Linden Research, Inc. + * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 - * + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception - * + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, * and agree to abide by those obligations. - * + * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. diff --git a/indra/llmessage/tests/networkio.h b/indra/llmessage/tests/networkio.h index 11c5cc07fcf4764477ecaf77e66a1cb6ba74e451..0ebe369ea2c51b123f2af2ff80b931a2ddbd68ea 100644 --- a/indra/llmessage/tests/networkio.h +++ b/indra/llmessage/tests/networkio.h @@ -5,7 +5,30 @@ * @brief * * $LicenseInfo:firstyear=2009&license=viewergpl$ + * * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ diff --git a/indra/llprimitive/llmaterialtable.cpp b/indra/llprimitive/llmaterialtable.cpp index 4c22203eb9fc3846bf3857684e4bc75b30fa33fe..18787c47c57d9d5683e3bc9bd737f9c32ae26f8b 100644 --- a/indra/llprimitive/llmaterialtable.cpp +++ b/indra/llprimitive/llmaterialtable.cpp @@ -124,6 +124,17 @@ LLMaterialTable::~LLMaterialTable() mMaterialInfoList.clear(); } +void LLMaterialTable::initTableTransNames(std::map<std::string, std::string> namemap) +{ + for (info_list_t::iterator iter = mMaterialInfoList.begin(); + iter != mMaterialInfoList.end(); ++iter) + { + LLMaterialInfo *infop = *iter; + std::string name = infop->mName; + infop->mName = namemap[name]; + } +} + void LLMaterialTable::initBasicTable() { // *TODO: Translate diff --git a/indra/llprimitive/llmaterialtable.h b/indra/llprimitive/llmaterialtable.h index ca9017abd012dda248c3ddc69e426664cec9c6c1..2c0b046fa71ea7260039470f9fa5daf89e2fc2d7 100644 --- a/indra/llprimitive/llmaterialtable.h +++ b/indra/llprimitive/llmaterialtable.h @@ -147,6 +147,8 @@ public: void initBasicTable(); + void initTableTransNames(std::map<std::string, std::string> namemap); + BOOL add(U8 mcode, const std::string& name, const LLUUID &uuid); BOOL addCollisionSound(U8 mcode, U8 mcode2, const LLUUID &uuid); BOOL addSlidingSound(U8 mcode, U8 mcode2, const LLUUID &uuid); diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 13facc0d58274ae242f6e425824146144d5814b1..33807e7545f92fca21d3bacd8a8435a79448c102 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -132,7 +132,7 @@ void LLPrimitive::setVolumeManager( LLVolumeMgr* volume_manager ) { if ( !volume_manager || sVolumeManager ) { - llerrs << "Unable to set LLPrimitive::sVolumeManager to NULL" << llendl; + llerrs << "LLPrimitive::sVolumeManager attempting to be set to NULL or it already has been set." << llendl; } sVolumeManager = volume_manager; } diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index c25df0a40f5f35d66a200553f76a22894d1ba03b..b3a337ce5dae027732bc043292c260cdf1d15054 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -37,7 +37,7 @@ #include "v3math.h" #include "xform.h" #include "message.h" -#include "llmemory.h" +#include "llpointer.h" #include "llvolume.h" #include "lltextureentry.h" #include "llprimtexturelist.h" diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp index c9632ebdad8ba22d280d29422e78e1c129ebfc82..d03150fc78b2b0873eedb452186087296679b61e 100644 --- a/indra/llprimitive/llprimtexturelist.cpp +++ b/indra/llprimitive/llprimtexturelist.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008-2007, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/llprimitive/llprimtexturelist.h b/indra/llprimitive/llprimtexturelist.h index 61285bd1bf642a756187794359ded860f4e9107f..6254878b9962e139f2425908592121a5866c24a9 100644 --- a/indra/llprimitive/llprimtexturelist.h +++ b/indra/llprimitive/llprimtexturelist.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008-2007, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/llprimitive/tests/llmessagesystem_stub.cpp b/indra/llprimitive/tests/llmessagesystem_stub.cpp new file mode 100644 index 0000000000000000000000000000000000000000..62504be3b07e5484f44a5ed7f2df342c85e52eca --- /dev/null +++ b/indra/llprimitive/tests/llmessagesystem_stub.cpp @@ -0,0 +1,42 @@ +/** + * @file llmessagesystem_stub.cpp + * @brief stub class to allow unit testing + * + * $LicenseInfo:firstyear=2008&license=internal$ + * + * Copyright (c) 2008, Linden Research, Inc. + * + * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of + * this source code is governed by the Linden Lab Source Code Disclosure + * Agreement ("Agreement") { } + * Lab. By accessing, using, copying, modifying or distributing this + * software, you acknowledge that you have been informed of your + * obligations under the Agreement and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "linden_common.h" + +char * _PREHASH_TextureEntry; + +S32 LLMessageSystem::getSizeFast(char const*, char const*) const +{ + return 0; +} + +S32 LLMessageSystem::getSizeFast(char const*, int, char const*) const +{ + return 0; +} + +void LLMessageSystem::getBinaryDataFast(char const*, char const*, void*, int, int, int) +{ +} + +void LLMessageSystem::addBinaryDataFast(char const*, void const*, int) +{ +} + diff --git a/indra/llprimitive/tests/llprimitive_test.cpp b/indra/llprimitive/tests/llprimitive_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1805a9e96854b849f01f63d34adf39353224b015 --- /dev/null +++ b/indra/llprimitive/tests/llprimitive_test.cpp @@ -0,0 +1,214 @@ +/** + * @file llprimitive_test.cpp + * @brief llprimitive tests + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * Copyright (c) 2001-2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "../test/lltut.h" + +#include "../llprimitive.h" + +#include "../../llmath/llvolumemgr.h" + +class DummyVolumeMgr : public LLVolumeMgr +{ +public: + DummyVolumeMgr() : LLVolumeMgr(), mVolumeTest(NULL), mCurrDetailTest(0) {} + ~DummyVolumeMgr() + { + } + + + virtual LLVolume *refVolume(const LLVolumeParams &volume_params, const S32 detail) + { + if (mVolumeTest.isNull() || volume_params != mCurrParamsTest || detail != mCurrDetailTest) + { + F32 volume_detail = LLVolumeLODGroup::getVolumeScaleFromDetail(detail); + mVolumeTest = new LLVolume(volume_params, volume_detail, FALSE, FALSE); + mCurrParamsTest = volume_params; + mCurrDetailTest = detail; + return mVolumeTest; + } + else + { + return mVolumeTest; + } + } + + virtual void unrefVolume(LLVolume *volumep) + { + if (mVolumeTest == volumep) + { + mVolumeTest = NULL; + } + } + +private: + LLPointer<LLVolume> mVolumeTest; + LLVolumeParams mCurrParamsTest; + S32 mCurrDetailTest; +}; + +class PRIMITIVE_TEST_SETUP +{ +public: + PRIMITIVE_TEST_SETUP() + { + volume_manager_test = new DummyVolumeMgr(); + LLPrimitive::setVolumeManager(volume_manager_test); + } + + ~PRIMITIVE_TEST_SETUP() + { + LLPrimitive::cleanupVolumeManager(); + } + DummyVolumeMgr * volume_manager_test; +}; + +namespace tut +{ + struct llprimitive + { + PRIMITIVE_TEST_SETUP setup_class; + }; + + typedef test_group<llprimitive> llprimitive_t; + typedef llprimitive_t::object llprimitive_object_t; + tut::llprimitive_t tut_llprimitive("llprimitive"); + + template<> template<> + void llprimitive_object_t::test<1>() + { + set_test_name("Test LLPrimitive Instantiation"); + LLPrimitive test; + } + + template<> template<> + void llprimitive_object_t::test<2>() + { + set_test_name("Test LLPrimitive PCode setter and getter."); + LLPrimitive test; + ensure_equals(test.getPCode(), 0); + LLPCode code = 1; + test.setPCode(code); + ensure_equals(test.getPCode(), code); + } + + template<> template<> + void llprimitive_object_t::test<3>() + { + set_test_name("Test llprimitive constructor and initer."); + LLPCode code = 1; + LLPrimitive primitive; + primitive.init_primitive(code); + ensure_equals(primitive.getPCode(), code); + } + + template<> template<> + void llprimitive_object_t::test<4>() + { + set_test_name("Test Static llprimitive constructor and initer."); + LLPCode code = 1; + LLPrimitive * primitive = LLPrimitive::createPrimitive(code); + ensure(primitive != NULL); + ensure_equals(primitive->getPCode(), code); + } + + template<> template<> + void llprimitive_object_t::test<5>() + { + set_test_name("Test setVolume creation of new unique volume."); + LLPrimitive primitive; + LLVolumeParams params; + + // Make sure volume starts off null + ensure(primitive.getVolume() == NULL); + + // Make sure we have no texture entries before setting the volume + ensure_equals(primitive.getNumTEs(), 0); + + // Test that GEOMETRY has not been flagged as changed. + ensure(!primitive.isChanged(LLXform::GEOMETRY)); + + // Make sure setVolume returns true + ensure(primitive.setVolume(params, 0, true) == TRUE); + LLVolume* new_volume = primitive.getVolume(); + + // make sure new volume was actually created + ensure(new_volume != NULL); + + // Make sure that now that we've set the volume we have texture entries + ensure_not_equals(primitive.getNumTEs(), 0); + + // Make sure that the number of texture entries equals the number of faces in the volume (should be 6) + ensure_equals(new_volume->getNumFaces(), 6); + ensure_equals(primitive.getNumTEs(), new_volume->getNumFaces()); + + // Test that GEOMETRY has been flagged as changed. + ensure(primitive.isChanged(LLXform::GEOMETRY)); + + // Run it twice to make sure it doesn't create a different one if params are the same + ensure(primitive.setVolume(params, 0, true) == FALSE); + ensure(new_volume == primitive.getVolume()); + + // Change the param definition and try setting it again. + params.setRevolutions(4); + ensure(primitive.setVolume(params, 0, true) == TRUE); + + // Ensure that we now have a different volume + ensure(new_volume != primitive.getVolume()); + } + + template<> template<> + void llprimitive_object_t::test<6>() + { + set_test_name("Test setVolume creation of new NOT-unique volume."); + LLPrimitive primitive; + LLVolumeParams params; + + // Make sure volume starts off null + ensure(primitive.getVolume() == NULL); + + // Make sure we have no texture entries before setting the volume + ensure_equals(primitive.getNumTEs(), 0); + + // Test that GEOMETRY has not been flagged as changed. + ensure(!primitive.isChanged(LLXform::GEOMETRY)); + + // Make sure setVolume returns true + ensure(primitive.setVolume(params, 0, false) == TRUE); + + LLVolume* new_volume = primitive.getVolume(); + + // make sure new volume was actually created + ensure(new_volume != NULL); + + // Make sure that now that we've set the volume we have texture entries + ensure_not_equals(primitive.getNumTEs(), 0); + + // Make sure that the number of texture entries equals the number of faces in the volume (should be 6) + ensure_equals(new_volume->getNumFaces(), 6); + ensure_equals(primitive.getNumTEs(), new_volume->getNumFaces()); + + // Test that GEOMETRY has been flagged as changed. + ensure(primitive.isChanged(LLXform::GEOMETRY)); + + // Run it twice to make sure it doesn't create a different one if params are the same + ensure(primitive.setVolume(params, 0, false) == FALSE); + ensure(new_volume == primitive.getVolume()); + + // Change the param definition and try setting it again. + params.setRevolutions(4); + ensure(primitive.setVolume(params, 0, false) == TRUE); + + // Ensure that we now have a different volume + ensure(new_volume != primitive.getVolume()); + } +} + +#include "llmessagesystem_stub.cpp" diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp index f6321b053496392fa3c1c207223c4b48f6e82cd3..052510e6ed0fecea2f2a518bea46fdba912fda24 100644 --- a/indra/llrender/llfontbitmapcache.cpp +++ b/indra/llrender/llfontbitmapcache.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/llrender/llfontbitmapcache.h b/indra/llrender/llfontbitmapcache.h index e5c09f8826c4ae3c476fc5202fb3a8864422317e..4beea0d0267de0de10520e33f477de4f151c96c1 100644 --- a/indra/llrender/llfontbitmapcache.h +++ b/indra/llrender/llfontbitmapcache.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index beecb6b7c1df76084af2265d9cde6ac0c1d8b8df..048bfe8e0df716cc44c26deea95dc4fda884f8b3 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -32,16 +32,20 @@ #include "linden_common.h" -#include <boost/tokenizer.hpp> +#include "llfontgl.h" +// Linden library includes #include "llfont.h" -#include "llfontgl.h" #include "llfontbitmapcache.h" #include "llfontregistry.h" #include "llgl.h" +#include "llimagegl.h" #include "llrender.h" -#include "v4color.h" #include "llstl.h" +#include "v4color.h" + +// Third party library includes +#include <boost/tokenizer.hpp> const S32 BOLD_OFFSET = 1; @@ -102,14 +106,6 @@ U8 LLFontGL::getStyleFromString(const std::string &style) { ret |= UNDERLINE; } - if (style.find("SHADOW") != style.npos) - { - ret |= DROP_SHADOW; - } - if (style.find("SOFT_SHADOW") != style.npos) - { - ret |= DROP_SHADOW_SOFT; - } return ret; } @@ -215,11 +211,11 @@ bool findOrCreateFont(LLFontGL*& fontp, const LLFontDescriptor& desc) } // static -BOOL LLFontGL::initDefaultFonts(F32 screen_dpi, F32 x_scale, F32 y_scale, +void LLFontGL::initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::string& app_dir, - const std::vector<std::string>& xui_paths) + const std::vector<std::string>& xui_paths, + bool create_gl_textures) { - bool succ = true; sVertDPI = (F32)llfloor(screen_dpi * y_scale); sHorizDPI = (F32)llfloor(screen_dpi * x_scale); sScaleX = x_scale; @@ -229,24 +225,30 @@ BOOL LLFontGL::initDefaultFonts(F32 screen_dpi, F32 x_scale, F32 y_scale, // Font registry init if (!sFontRegistry) { - sFontRegistry = new LLFontRegistry(xui_paths); + sFontRegistry = new LLFontRegistry(xui_paths, create_gl_textures); sFontRegistry->parseFontInfo("fonts.xml"); } else { sFontRegistry->reset(); } +} - // Force standard fonts to get generated up front. - // This is primarily for error detection purposes. - succ &= (NULL != getFontSansSerifSmall()); - succ &= (NULL != getFontSansSerif()); - succ &= (NULL != getFontSansSerifBig()); - succ &= (NULL != getFontSansSerifHuge()); - succ &= (NULL != getFontSansSerifBold()); - succ &= (NULL != getFontMonospace()); +// Force standard fonts to get generated up front. +// This is primarily for error detection purposes. +// Don't do this during initClass because it can be slow and we want to get +// the viewer window on screen first. JC +// static +bool LLFontGL::loadDefaultFonts() +{ + bool succ = true; + succ &= (NULL != getFontSansSerifSmall()); + succ &= (NULL != getFontSansSerif()); + succ &= (NULL != getFontSansSerifBig()); + succ &= (NULL != getFontSansSerifHuge()); + succ &= (NULL != getFontSansSerifBold()); + succ &= (NULL != getFontMonospace()); succ &= (NULL != getFontExtChar()); - return succ; } @@ -341,6 +343,34 @@ LLFontGL* LLFontGL::getFont(const LLFontDescriptor& desc) return sFontRegistry->getFont(desc); } +//static +LLFontGL* LLFontGL::getFontByName(const std::string& name) +{ + // check for most common fonts first + if (name == "SANSSERIF") + { + return getFontSansSerif(); + } + else if (name == "SANSSERIF_SMALL") + { + return getFontSansSerifSmall(); + } + else if (name == "SANSSERIF_BIG") + { + return getFontSansSerifBig(); + } + else if (name == "SMALL" || name == "OCRA") + { + // *BUG: Should this be "MONOSPACE"? Do we use "OCRA" anymore? + // Does "SMALL" mean "SERIF"? + return getFontMonospace(); + } + else + { + return NULL; + } +} + BOOL LLFontGL::addChar(const llwchar wch) const { if (!LLFont::addChar(wch)) @@ -364,12 +394,13 @@ S32 LLFontGL::renderUTF8(const std::string &text, const S32 offset, const LLColor4 &color, const HAlign halign, const VAlign valign, U8 style, + ShadowType shadow, const S32 max_chars, const S32 max_pixels, F32* right_x, BOOL use_ellipses) const { LLWString wstr = utf8str_to_wstring(text); - return render(wstr, offset, x, y, color, halign, valign, style, max_chars, max_pixels, right_x, FALSE, use_ellipses); + return render(wstr, offset, x, y, color, halign, valign, style, shadow, max_chars, max_pixels, right_x, FALSE, use_ellipses); } S32 LLFontGL::render(const LLWString &wstr, @@ -378,6 +409,7 @@ S32 LLFontGL::render(const LLWString &wstr, const LLColor4 &color, const HAlign halign, const VAlign valign, U8 style, + ShadowType shadow, const S32 max_chars, S32 max_pixels, F32* right_x, BOOL use_embedded, @@ -401,14 +433,14 @@ S32 LLFontGL::render(const LLWString &wstr, style = style & (~getFontDesc().getStyle()); F32 drop_shadow_strength = 0.f; - if (style & (DROP_SHADOW | DROP_SHADOW_SOFT)) + if (shadow != NO_SHADOW) { F32 luminance; color.calcHSL(NULL, NULL, &luminance); drop_shadow_strength = clamp_rescale(luminance, 0.35f, 0.6f, 0.f, 1.f); if (luminance < 0.35f) { - style = style & ~(DROP_SHADOW | DROP_SHADOW_SOFT); + shadow = NO_SHADOW; } } @@ -547,7 +579,7 @@ S32 LLFontGL::render(const LLWString &wstr, LLRectf uv_rect(0.f, 1.f, 1.f, 0.f); LLRectf screen_rect(ext_x, ext_y + ext_height, ext_x + ext_width, ext_y); - drawGlyph(screen_rect, uv_rect, LLColor4::white, style, drop_shadow_strength); + drawGlyph(screen_rect, uv_rect, LLColor4::white, style, shadow, drop_shadow_strength); if (!label.empty()) { @@ -559,7 +591,7 @@ S32 LLFontGL::render(const LLWString &wstr, /*llfloor*/((ext_x + (F32)ext_image->getWidth() + EXT_X_BEARING) / sScaleX), /*llfloor*/(cur_y / sScaleY), color, - halign, BASELINE, NORMAL, S32_MAX, S32_MAX, NULL, + halign, BASELINE, NORMAL, NO_SHADOW, S32_MAX, S32_MAX, NULL, TRUE ); gGL.popMatrix(); } @@ -613,7 +645,7 @@ S32 LLFontGL::render(const LLWString &wstr, llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth, llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight); - drawGlyph(screen_rect, uv_rect, color, style, drop_shadow_strength); + drawGlyph(screen_rect, uv_rect, color, style, shadow, drop_shadow_strength); chars_drawn++; cur_x += fgi->mXAdvance; @@ -671,6 +703,7 @@ S32 LLFontGL::render(const LLWString &wstr, color, LEFT, valign, style, + shadow, S32_MAX, max_pixels, right_x, FALSE); @@ -838,13 +871,28 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch { if (iswspace(wch)) { - in_word = FALSE; + if(wch !=(0x00A0)) + { + in_word = FALSE; + } + } + if (iswindividual(wch)) + { + if (iswpunct(wchars[i+1])) + { + in_word=TRUE; + } + else + { + in_word=FALSE; + start_of_last_word = i; + } } } else { start_of_last_word = i; - if (!iswspace(wch)) + if (!iswspace(wch)||!iswindividual(wch)) { in_word = TRUE; } @@ -1108,7 +1156,7 @@ void LLFontGL::renderQuad(const LLRectf& screen_rect, const LLRectf& uv_rect, F3 llfont_round_y(screen_rect.mBottom)); } -void LLFontGL::drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4& color, U8 style, F32 drop_shadow_strength) const +void LLFontGL::drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4& color, U8 style, ShadowType shadow, F32 drop_shadow_strength) const { F32 slant_offset; slant_offset = ((style & ITALIC) ? ( -mAscender * 0.2f) : 0.f); @@ -1128,7 +1176,7 @@ void LLFontGL::drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, con renderQuad(screen_rect_offset, uv_rect, slant_offset); } } - else if (style & DROP_SHADOW_SOFT) + else if (shadow == DROP_SHADOW_SOFT) { LLColor4 shadow_color = LLFontGL::sShadowColor; shadow_color.mV[VALPHA] = color.mV[VALPHA] * drop_shadow_strength * DROP_SHADOW_SOFT_STRENGTH; @@ -1161,7 +1209,7 @@ void LLFontGL::drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, con gGL.color4fv(color.mV); renderQuad(screen_rect, uv_rect, slant_offset); } - else if (style & DROP_SHADOW) + else if (shadow == DROP_SHADOW) { LLColor4 shadow_color = LLFontGL::sShadowColor; shadow_color.mV[VALPHA] = color.mV[VALPHA] * drop_shadow_strength; diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index 6cb1727ff4b5cc56ee568d4330a455271121359a..204c6908af75cd2d59758246574799ef7914bc1d 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -34,16 +34,15 @@ #ifndef LL_LLFONTGL_H #define LL_LLFONTGL_H -#include "llfont.h" -#include "llimagegl.h" -#include "v2math.h" #include "llcoord.h" -#include "llrect.h" - +#include "llfont.h" #include "llfontregistry.h" +#include "llpointer.h" +#include "llrect.h" +#include "v2math.h" class LLColor4; - +class LLImageGL; // Key used to request a font. class LLFontDescriptor; @@ -73,12 +72,18 @@ public: enum StyleFlags { // text style to render. May be combined (these are bit flags) + // TODO:: Maybe change the value to 0x01 << 0 for 1 0x01 << 1 for 2, 0x01 << 2 for 4 NORMAL = 0, BOLD = 1, ITALIC = 2, - UNDERLINE = 4, - DROP_SHADOW = 8, - DROP_SHADOW_SOFT = 16 + UNDERLINE = 4 + }; + + enum ShadowType + { + NO_SHADOW, + DROP_SHADOW, + DROP_SHADOW_SOFT }; // Takes a string with potentially several flags, i.e. "NORMAL|BOLD|ITALIC" @@ -93,10 +98,14 @@ public: LLFontGL &operator=(const LLFontGL &source); - static BOOL initDefaultFonts(F32 screen_dpi, F32 x_scale, F32 y_scale, + static void initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::string& app_dir, - const std::vector<std::string>& xui_paths); + const std::vector<std::string>& xui_paths, + bool create_gl_textures = true); + // Load sans-serif, sans-serif-small, etc. + // Slow, requires multiple seconds to load fonts. + static bool loadDefaultFonts(); static void destroyDefaultFonts(); static void destroyAllGL(); void destroyGL(); @@ -111,17 +120,17 @@ public: const LLColor4 &color) const { return renderUTF8(text, begin_offset, (F32)x, (F32)y, color, - LEFT, BASELINE, NORMAL, - S32_MAX, S32_MAX, NULL, FALSE); + LEFT, BASELINE, NORMAL, NO_SHADOW, + S32_MAX, S32_MAX, NULL, FALSE); } S32 renderUTF8(const std::string &text, const S32 begin_offset, S32 x, S32 y, const LLColor4 &color, - HAlign halign, VAlign valign, U8 style = NORMAL) const + HAlign halign, VAlign valign, U8 style = NORMAL, ShadowType shadow = NO_SHADOW) const { return renderUTF8(text, begin_offset, (F32)x, (F32)y, color, - halign, valign, style, + halign, valign, style, shadow, S32_MAX, S32_MAX, NULL, FALSE); } @@ -133,6 +142,7 @@ public: HAlign halign, VAlign valign, U8 style, + ShadowType shadow, S32 max_chars, S32 max_pixels, F32* right_x, @@ -143,7 +153,7 @@ public: const LLColor4 &color) const { return render(text, begin_offset, x, y, color, - LEFT, BASELINE, NORMAL, + LEFT, BASELINE, NORMAL, NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE, FALSE); } @@ -155,6 +165,7 @@ public: HAlign halign = LEFT, VAlign valign = BASELINE, U8 style = NORMAL, + ShadowType shadow = NO_SHADOW, S32 max_chars = S32_MAX, S32 max_pixels = S32_MAX, F32* right_x=NULL, @@ -220,7 +231,7 @@ protected: F32 getEmbeddedCharAdvance(const embedded_data_t* ext_data) const; void clearEmbeddedChars(); void renderQuad(const LLRectf& screen_rect, const LLRectf& uv_rect, F32 slant_amt) const; - void drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4& color, U8 style, F32 drop_shadow_fade) const; + void drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4& color, U8 style, ShadowType shadow, F32 drop_shadow_fade) const; public: static F32 sVertDPI; @@ -238,6 +249,8 @@ public: static LLFontGL* getFontSansSerifBold(); static LLFontGL* getFontExtChar(); static LLFontGL* getFont(const LLFontDescriptor& desc); + // Use with legacy names like "SANSSERIF_SMALL" or "OCRA" + static LLFontGL* getFontByName(const std::string& name); static LLColor4 sShadowColor; diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index 9b5bc5d0afc55894451df1cf6fc19ed1e9684b6c..18e4a6915d8108850e3900c6d3bba69c950ede68 100644 --- a/indra/llrender/llfontregistry.cpp +++ b/indra/llrender/llfontregistry.cpp @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -13,12 +13,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -167,7 +168,9 @@ LLFontDescriptor LLFontDescriptor::normalize() const return LLFontDescriptor(new_name,new_size,new_style,getFileNames()); } -LLFontRegistry::LLFontRegistry(const string_vec_t& xui_paths) +LLFontRegistry::LLFontRegistry(const string_vec_t& xui_paths, + bool create_gl_textures) +: mCreateGLTextures(create_gl_textures) { // Propagate this down from LLUICtrlFactory so LLRender doesn't // need an upstream dependency on LLUI. @@ -215,8 +218,8 @@ bool LLFontRegistry::parseFontInfo(const std::string& xml_filename) success = success || init_succ; } } - if (success) - dump(); + //if (success) + // dump(); return success; } @@ -426,7 +429,9 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) { LLFontGL *fontp = new LLFontGL; std::string font_path = local_path + *file_name_it; - BOOL is_fallback = !is_first_found; + // *HACK: Fallback fonts don't render, so we can use that to suppress + // creation of OpenGL textures for test apps. JC + BOOL is_fallback = !is_first_found || !mCreateGLTextures; F32 extra_scale = (is_fallback)?fallback_scale:1.0; if (!fontp->loadFace(font_path, extra_scale * point_size, LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback)) diff --git a/indra/llrender/llfontregistry.h b/indra/llrender/llfontregistry.h index ed775eeed0671850aa205201ba1eef52b70ba57c..198ca0b9205ce91a9d323b8d5f1cd74c14ea3d45 100644 --- a/indra/llrender/llfontregistry.h +++ b/indra/llrender/llfontregistry.h @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -13,12 +13,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -70,7 +71,10 @@ private: class LLFontRegistry { public: - LLFontRegistry(const string_vec_t& xui_paths); + // create_gl_textures - set to false for test apps with no OpenGL window, + // such as llui_libtest + LLFontRegistry(const string_vec_t& xui_paths, + bool create_gl_textures); ~LLFontRegistry(); // Load standard font info from XML file(s). @@ -108,6 +112,7 @@ private: string_vec_t mUltimateFallbackList; string_vec_t mXUIPaths; + bool mCreateGLTextures; }; #endif // LL_LLFONTREGISTRY_H diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 61194c4ecfa3a48f413e1d9012f5b669be659728..7e1df0e56527790ce48a9fc61d8b9ebbf8a78035 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -45,10 +45,13 @@ #include "llrender.h" #include "llerror.h" +#include "llerrorcontrol.h" #include "llquaternion.h" #include "llmath.h" #include "m4math.h" #include "llstring.h" +#include "llmemtype.h" +#include "llstacktrace.h" #include "llglheaders.h" @@ -56,9 +59,49 @@ //#define GL_STATE_VERIFY #endif + +BOOL gDebugSession = FALSE; BOOL gDebugGL = FALSE; BOOL gClothRipple = FALSE; BOOL gNoRender = FALSE; + +std::ofstream gFailLog; + +void ll_init_fail_log(std::string filename) +{ + gFailLog.open(filename.c_str()); +} + + +void ll_fail(std::string msg) +{ + + if (gDebugSession) + { + std::vector<std::string> lines; + + gFailLog << LLError::utcTime() << " " << msg << std::endl; + + gFailLog << "Stack Trace:" << std::endl; + + ll_get_stack_trace(lines); + + for(size_t i = 0; i < lines.size(); ++i) + { + gFailLog << lines[i] << std::endl; + } + + gFailLog << "End of Stack Trace." << std::endl << std::endl; + + gFailLog.flush(); + } +}; + +void ll_close_fail_log() +{ + gFailLog.close(); +} + LLMatrix4 gGLObliqueProjectionInverse; #define LL_GL_NAME_POOLING 0 @@ -596,6 +639,7 @@ void LLGLManager::initExtensions() mHasShaderObjects = FALSE; mHasVertexShader = FALSE; mHasFragmentShader = FALSE; + mHasTextureRectangle = FALSE; #else // LL_MESA_HEADLESS mHasMultitexture = glh_init_extensions("GL_ARB_multitexture"); mHasMipMapGeneration = glh_init_extensions("GL_SGIS_generate_mipmap"); @@ -612,6 +656,7 @@ void LLGLManager::initExtensions() && ExtensionExists("GL_EXT_packed_depth_stencil", gGLHExts.mSysExts); mHasFramebufferMultisample = mHasFramebufferObject && ExtensionExists("GL_EXT_framebuffer_multisample", gGLHExts.mSysExts); mHasDrawBuffers = ExtensionExists("GL_ARB_draw_buffers", gGLHExts.mSysExts); + mHasTextureRectangle = ExtensionExists("GL_ARB_texture_rectangle", gGLHExts.mSysExts); #if !LL_DARWIN mHasPointParameters = !mIsATI && ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts); #endif @@ -685,6 +730,7 @@ void LLGLManager::initExtensions() if (strchr(blacklist,'q')) mHasFramebufferObject = FALSE;//S if (strchr(blacklist,'r')) mHasDrawBuffers = FALSE;//S if (strchr(blacklist,'s')) mHasFramebufferMultisample = FALSE; + if (strchr(blacklist,'t')) mHasTextureRectangle = FALSE; } #endif // LL_LINUX || LL_SOLARIS @@ -971,6 +1017,7 @@ void assert_glerror() { return; } + if (!gGLManager.mInited) { LL_ERRS("RenderInit") << "GL not initialized" << LL_ENDL; @@ -988,12 +1035,22 @@ void assert_glerror() { LL_WARNS("RenderState") << "GL Error:" << error<< LL_ENDL; LL_WARNS("RenderState") << "GL Error String:" << gl_error_msg << LL_ENDL; + + if (gDebugSession) + { + gFailLog << "GL Error:" << gl_error_msg << std::endl; + } } else { // gluErrorString returns NULL for some extensions' error codes. // you'll probably have to grep for the number in glext.h. LL_WARNS("RenderState") << "GL Error: UNKNOWN 0x" << std::hex << error << std::dec << LL_ENDL; + + if (gDebugSession) + { + gFailLog << "GL Error: UNKNOWN 0x" << std::hex << error << std::dec << std::endl; + } } error = glGetError(); #endif @@ -1001,7 +1058,14 @@ void assert_glerror() if (quit) { - llerrs << "One or more unhandled GL errors." << llendl; + if (gDebugSession) + { + ll_fail("assert_glerror failed"); + } + else + { + llerrs << "One or more unhandled GL errors." << llendl; + } } } @@ -1087,9 +1151,19 @@ void LLGLState::checkStates(const std::string& msg) glGetIntegerv(GL_BLEND_SRC, &src); glGetIntegerv(GL_BLEND_DST, &dst); + BOOL error = FALSE; + if (src != GL_SRC_ALPHA || dst != GL_ONE_MINUS_SRC_ALPHA) { - LL_GL_ERRS << "Blend function corrupted: " << std::hex << src << " " << std::hex << dst << " " << msg << std::dec << LL_ENDL; + if (gDebugSession) + { + gFailLog << "Blend function corrupted: " << std::hex << src << " " << std::hex << dst << " " << msg << std::dec << std::endl; + error = TRUE; + } + else + { + LL_GL_ERRS << "Blend function corrupted: " << std::hex << src << " " << std::hex << dst << " " << msg << std::dec << LL_ENDL; + } } for (std::map<LLGLenum, LLGLboolean>::iterator iter = sStateMap.begin(); @@ -1101,10 +1175,22 @@ void LLGLState::checkStates(const std::string& msg) if(cur_state != gl_state) { dumpStates(); - LL_GL_ERRS << llformat("LLGLState error. State: 0x%04x",state) << LL_ENDL; + if (gDebugSession) + { + gFailLog << llformat("LLGLState error. State: 0x%04x",state) << std::endl; + error = TRUE; + } + else + { + LL_GL_ERRS << llformat("LLGLState error. State: 0x%04x",state) << LL_ENDL; + } } } + if (error) + { + ll_fail("LLGLState::checkStates failed."); + } stop_glerror(); } @@ -1115,9 +1201,12 @@ void LLGLState::checkTextureChannels(const std::string& msg) return; } + stop_glerror(); + GLint activeTexture; glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &activeTexture); - + stop_glerror(); + BOOL error = FALSE; if (activeTexture == GL_TEXTURE0_ARB) @@ -1125,15 +1214,22 @@ void LLGLState::checkTextureChannels(const std::string& msg) GLint tex_env_mode = 0; glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &tex_env_mode); + stop_glerror(); + if (tex_env_mode != GL_MODULATE) { error = TRUE; LL_WARNS("RenderState") << "GL_TEXTURE_ENV_MODE invalid: " << std::hex << tex_env_mode << std::dec << LL_ENDL; + if (gDebugSession) + { + gFailLog << "GL_TEXTURE_ENV_MODE invalid: " << std::hex << tex_env_mode << std::dec << std::endl; + } } } - GLint maxTextureUnits; + GLint maxTextureUnits = 0; glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTextureUnits); + stop_glerror(); static const char* label[] = { @@ -1169,30 +1265,48 @@ void LLGLState::checkTextureChannels(const std::string& msg) { gGL.getTexUnit(i)->activate(); glClientActiveTextureARB(GL_TEXTURE0_ARB+i); - + stop_glerror(); glGetIntegerv(GL_TEXTURE_STACK_DEPTH, &stackDepth); + stop_glerror(); if (stackDepth != 1) { error = TRUE; LL_WARNS("RenderState") << "Texture matrix stack corrupted." << LL_ENDL; + + if (gDebugSession) + { + gFailLog << "Texture matrix stack corrupted." << std::endl; + } } glGetFloatv(GL_TEXTURE_MATRIX, (GLfloat*) matrix.mMatrix); + stop_glerror(); if (matrix != identity) { error = TRUE; LL_WARNS("RenderState") << "Texture matrix in channel " << i << " corrupt." << LL_ENDL; + if (gDebugSession) + { + gFailLog << "Texture matrix in channel " << i << " corrupt." << std::endl; + } } - for (S32 j = (i == 0 ? 1 : 0); j < 9; j++) + + for (S32 j = (i == 0 ? 1 : 0); + j < (gGLManager.mHasTextureRectangle ? 9 : 8); j++) { if (glIsEnabled(value[j])) { error = TRUE; LL_WARNS("RenderState") << "Texture channel " << i << " still has " << label[j] << " enabled." << LL_ENDL; + if (gDebugSession) + { + gFailLog << "Texture channel " << i << " still has " << label[j] << " enabled." << std::endl; + } } + stop_glerror(); } glh::matrix4f mat; @@ -1200,20 +1314,33 @@ void LLGLState::checkTextureChannels(const std::string& msg) identity.identity(); glGetFloatv(GL_TEXTURE_MATRIX, mat.m); + stop_glerror(); if (mat != identity) { error = TRUE; LL_WARNS("RenderState") << "Texture matrix " << i << " is not identity." << LL_ENDL; + if (gDebugSession) + { + gFailLog << "Texture matrix " << i << " is not identity." << std::endl; + } } } gGL.getTexUnit(0)->activate(); glClientActiveTextureARB(GL_TEXTURE0_ARB); + stop_glerror(); if (error) { - LL_GL_ERRS << "GL texture state corruption detected. " << msg << LL_ENDL; + if (gDebugSession) + { + ll_fail("LLGLState::checkTextureChannels failed."); + } + else + { + LL_GL_ERRS << "GL texture state corruption detected. " << msg << LL_ENDL; + } } } @@ -1233,6 +1360,10 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) if (active_texture != GL_TEXTURE0_ARB) { llwarns << "Client active texture corrupted: " << active_texture << llendl; + if (gDebugSession) + { + gFailLog << "Client active texture corrupted: " << active_texture << std::endl; + } error = TRUE; } @@ -1240,6 +1371,10 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) if (active_texture != GL_TEXTURE0_ARB) { llwarns << "Active texture corrupted: " << active_texture << llendl; + if (gDebugSession) + { + gFailLog << "Active texture corrupted: " << active_texture << std::endl; + } error = TRUE; } @@ -1276,6 +1411,10 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) { error = TRUE; LL_WARNS("RenderState") << "GL still has " << label[j] << " enabled." << LL_ENDL; + if (gDebugSession) + { + gFailLog << "GL still has " << label[j] << " enabled." << std::endl; + } } } else @@ -1284,6 +1423,10 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) { error = TRUE; LL_WARNS("RenderState") << "GL does not have " << label[j] << " enabled." << LL_ENDL; + if (gDebugSession) + { + gFailLog << "GL does not have " << label[j] << " enabled." << std::endl; + } } } } @@ -1296,6 +1439,10 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) { error = TRUE; LL_WARNS("RenderState") << "GL still has GL_TEXTURE_COORD_ARRAY enabled on channel 1." << LL_ENDL; + if (gDebugSession) + { + gFailLog << "GL still has GL_TEXTURE_COORD_ARRAY enabled on channel 1." << std::endl; + } } } else @@ -1304,6 +1451,10 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) { error = TRUE; LL_WARNS("RenderState") << "GL does not have GL_TEXTURE_COORD_ARRAY enabled on channel 1." << LL_ENDL; + if (gDebugSession) + { + gFailLog << "GL does not have GL_TEXTURE_COORD_ARRAY enabled on channel 1." << std::endl; + } } } @@ -1313,6 +1464,10 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) { error = TRUE; LL_WARNS("RenderState") << "GL still has GL_TEXTURE_2D enabled on channel 1." << LL_ENDL; + if (gDebugSession) + { + gFailLog << "GL still has GL_TEXTURE_2D enabled on channel 1." << std::endl; + } } } else @@ -1321,6 +1476,10 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) { error = TRUE; LL_WARNS("RenderState") << "GL does not have GL_TEXTURE_2D enabled on channel 1." << LL_ENDL; + if (gDebugSession) + { + gFailLog << "GL does not have GL_TEXTURE_2D enabled on channel 1." << std::endl; + } } } @@ -1339,13 +1498,24 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) { error = TRUE; LL_WARNS("RenderState") << "GL still has vertex attrib array " << i << " enabled." << LL_ENDL; + if (gDebugSession) + { + gFailLog << "GL still has vertex attrib array " << i << " enabled." << std::endl; + } } } } if (error) { - LL_GL_ERRS << "GL client array corruption detected. " << msg << LL_ENDL; + if (gDebugSession) + { + ll_fail("LLGLState::checkClientArrays failed."); + } + else + { + LL_GL_ERRS << "GL client array corruption detected. " << msg << LL_ENDL; + } } } @@ -1396,7 +1566,17 @@ LLGLState::~LLGLState() { if (gDebugGL) { - llassert_always(sStateMap[mState] == glIsEnabled(mState)); + if (!gDebugSession) + { + llassert_always(sStateMap[mState] == glIsEnabled(mState)); + } + else + { + if (sStateMap[mState] != glIsEnabled(mState)) + { + ll_fail("GL enabled state does not match expected"); + } + } } if (mIsEnabled != mWasEnabled) @@ -1708,6 +1888,7 @@ void LLGLNamePool::release(GLuint name) //static void LLGLNamePool::upkeepPools() { + LLMemType mt(LLMemType::MTYPE_UPKEEP_POOLS); for (pool_list_t::iterator iter = sInstances.begin(); iter != sInstances.end(); ++iter) { LLGLNamePool* pool = *iter; diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 00ff1e2f53d3631a4374d433494697a99894ce6d..34dd982259c4676bcccca0021a593d991a86e7e1 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -50,9 +50,17 @@ #include "glh/glh_linear.h" extern BOOL gDebugGL; +extern BOOL gDebugSession; +extern std::ofstream gFailLog; #define LL_GL_ERRS LL_ERRS("RenderState") +void ll_init_fail_log(std::string filename); + +void ll_fail(std::string msg); + +void ll_close_fail_log(); + class LLSD; // Manage GL extensions... @@ -88,6 +96,7 @@ public: BOOL mHasOcclusionQuery; BOOL mHasPointParameters; BOOL mHasDrawBuffers; + BOOL mHasTextureRectangle; // Other extensions. BOOL mHasAnisotropic; diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 9e341446583745279a2a9bd8ba4d6d296d431600..830617063b92f413c41656435692a512a951bbb7 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -408,7 +408,15 @@ S32 LLGLSLShader::disableTexture(S32 uniform, LLTexUnit::eTextureType mode) { if (gDebugGL && gGL.getTexUnit(index)->getCurrType() != mode) { - llerrs << "Texture channel " << index << " texture type corrupted." << llendl; + if (gDebugSession) + { + gFailLog << "Texture channel " << index << " texture type corrupted." << std::endl; + ll_fail("LLGLSLShader::disableTexture failed"); + } + else + { + llerrs << "Texture channel " << index << " texture type corrupted." << llendl; + } } gGL.getTexUnit(index)->disable(); } diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index cdf626e16f97b04f84a91aa5b3d4143f362bcec1..e1231eeeb480b3b8ceba11f03e364afbe57599a2 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -54,8 +54,8 @@ LLGLuint LLImageGL::sCurrentBoundTextures[MAX_GL_TEXTURE_UNITS] = { 0 }; U32 LLImageGL::sUniqueCount = 0; U32 LLImageGL::sBindCount = 0; -S32 LLImageGL::sGlobalTextureMemory = 0; -S32 LLImageGL::sBoundTextureMemory = 0; +S32 LLImageGL::sGlobalTextureMemoryInBytes = 0; +S32 LLImageGL::sBoundTextureMemoryInBytes = 0; S32 LLImageGL::sCurBoundTextureMemory = 0; S32 LLImageGL::sCount = 0; @@ -63,6 +63,7 @@ BOOL LLImageGL::sGlobalUseAnisotropic = FALSE; F32 LLImageGL::sLastFrameTime = 0.f; std::set<LLImageGL*> LLImageGL::sImageList; + //************************************************************************************** //below are functions for debug use //do not delete them even though they are not currently being used. @@ -87,9 +88,18 @@ void LLImageGL::checkTexSize() const { GLint texname; glGetIntegerv(GL_TEXTURE_BINDING_2D, &texname); + BOOL error = FALSE; if (texname != mTexName) { - llerrs << "Invalid texture bound!" << llendl; + error = TRUE; + if (gDebugSession) + { + gFailLog << "Invalid texture bound!" << std::endl; + } + else + { + llerrs << "Invalid texture bound!" << llendl; + } } stop_glerror() ; LLGLint x = 0, y = 0 ; @@ -102,7 +112,20 @@ void LLImageGL::checkTexSize() const } if(x != (mWidth >> mCurrentDiscardLevel) || y != (mHeight >> mCurrentDiscardLevel)) { - llerrs << "wrong texture size and discard level!" << llendl ; + error = TRUE; + if (gDebugSession) + { + gFailLog << "wrong texture size and discard level!" << std::endl; + } + else + { + llerrs << "wrong texture size and discard level!" << llendl ; + } + } + + if (error) + { + ll_fail("LLImageGL::checkTexSize failed."); } } } @@ -174,7 +197,7 @@ S32 LLImageGL::dataFormatComponents(S32 dataformat) void LLImageGL::updateStats(F32 current_time) { sLastFrameTime = current_time; - sBoundTextureMemory = sCurBoundTextureMemory; + sBoundTextureMemoryInBytes = sCurBoundTextureMemory; sCurBoundTextureMemory = 0; } @@ -453,10 +476,20 @@ void LLImageGL::updateBindStats(void) const sUniqueCount++; updateBoundTexMem(mTextureMemory); mLastBindTime = sLastFrameTime; + + if(LLFastTimer::sMetricLog) + { + updateTestStats() ; + } } } } +//virtual +void LLImageGL::updateTestStats(void) const +{ +} + //virtual bool LLImageGL::bindError(const S32 stage) const { @@ -680,7 +713,6 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) } else { -// LLFastTimer t2(LLFastTimer::FTM_TEMP5); S32 w = getWidth(); S32 h = getHeight(); if (is_compressed) @@ -1013,13 +1045,13 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ if (old_name != 0) { - sGlobalTextureMemory -= mTextureMemory; + sGlobalTextureMemoryInBytes -= mTextureMemory; LLImageGL::deleteTextures(1, &old_name); stop_glerror(); } mTextureMemory = getMipBytes(discard_level); - sGlobalTextureMemory += mTextureMemory; + sGlobalTextureMemoryInBytes += mTextureMemory; setActive() ; // mark this as bound at this point, so we don't throw it out immediately @@ -1096,7 +1128,7 @@ BOOL LLImageGL::isValidForSculpt(S32 discard_level, S32 image_width, S32 image_h return glwidth >= image_width && glheight >= image_height && (GL_RGB8 == glcomponents || GL_RGBA8 == glcomponents) ; } -BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compressed_ok) +BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compressed_ok) const { llpushcallstacks ; if (discard_level < 0) @@ -1220,7 +1252,7 @@ void LLImageGL::destroyGLTexture() } } - sGlobalTextureMemory -= mTextureMemory; + sGlobalTextureMemoryInBytes -= mTextureMemory; mTextureMemory = 0; LLImageGL::deleteTextures(1, &mTexName); @@ -1377,7 +1409,6 @@ void LLImageGL::analyzeAlpha(const void* data_in, S32 w, S32 h) stride = 4; break; default: - llwarns << "Cannot analyze alpha of image with primary format " << std::hex << mFormatPrimary << std::dec << llendl; return; } diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 4f737bcaae3caf474c8a322e6430e2708ce3a797..1775ae7de982c7902f4263acb64f3260c190a633 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -37,11 +37,15 @@ #include "llimage.h" #include "llgltypes.h" -#include "llmemory.h" +#include "llpointer.h" +#include "llrefcount.h" #include "v2math.h" #include "llrender.h" +#define BYTES_TO_MEGA_BYTES(x) ((x) >> 20) +#define MEGA_BYTES_TO_BYTES(x) ((x) << 20) + //============================================================================ class LLImageGL : public LLRefCount @@ -54,6 +58,7 @@ public: static S32 dataFormatComponents(S32 dataformat); void updateBindStats(void) const; + virtual void updateTestStats(void) const; // needs to be called every frame static void updateStats(F32 current_time); @@ -107,7 +112,7 @@ public: BOOL setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_pos, S32 width, S32 height); BOOL setDiscardLevel(S32 discard_level); // Read back a raw image for this discard level, if it exists - BOOL readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compressed_ok); + BOOL readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compressed_ok) const; void destroyGLTexture(); void setExplicitFormat(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format = 0, BOOL swap_bytes = FALSE); @@ -238,12 +243,13 @@ public: static LLGLuint sCurrentBoundTextures[MAX_GL_TEXTURE_UNITS]; // Currently bound texture ID // Global memory statistics - static S32 sGlobalTextureMemory; // Tracks main memory texmem - static S32 sBoundTextureMemory; // Tracks bound texmem for last completed frame + static S32 sGlobalTextureMemoryInBytes; // Tracks main memory texmem + static S32 sBoundTextureMemoryInBytes; // Tracks bound texmem for last completed frame static S32 sCurBoundTextureMemory; // Tracks bound texmem for current frame static U32 sBindCount; // Tracks number of texture binds for current frame static U32 sUniqueCount; // Tracks number of unique texture binds for current frame static BOOL sGlobalUseAnisotropic; + #if DEBUG_MISS BOOL mMissed; // Missed on last bind? BOOL getMissed() const { return mMissed; }; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 6bb217a9c2fbebc7c3e9d3369d0872d5d0872b5c..d3a230b37b25fc2fa6a145018fa52cbd98ba3cae 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -189,7 +189,7 @@ bool LLTexUnit::bind(LLImageGL* texture, bool forceBind) llwarns << "NULL LLTexUnit::bind texture" << llendl; return false; } - + if (!texture->getTexName()) //if texture does not exist { //if deleted, will re-generate it immediately @@ -785,6 +785,9 @@ void LLRender::setSceneBlendType(eBlendType type) case BT_MULT: glBlendFunc(GL_DST_COLOR, GL_ZERO); break; + case BT_MULT_ALPHA: + glBlendFunc(GL_DST_ALPHA, GL_ZERO); + break; case BT_MULT_X2: glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR); break; diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 437c715c2f64bb7f7186081b975fae7c6acecd78..31083d8286e67521703cf4c139d8b19458342a4f 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -44,7 +44,7 @@ #include "v3math.h" #include "v4coloru.h" #include "llstrider.h" -#include "llmemory.h" +#include "llpointer.h" #include "llglheaders.h" class LLVertexBuffer; @@ -252,6 +252,7 @@ public: BT_ADD, BT_ADD_WITH_ALPHA, // Additive blend modulated by the fragment's alpha. BT_MULT, + BT_MULT_ALPHA, BT_MULT_X2, BT_REPLACE } eBlendType; diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index b7f31779ca0decd5471e378fbb1c6a184d7d7e97..dc052851ca8f576ecde4e27e4250260dc67e20a1 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -36,6 +36,9 @@ #include "llrender.h" #include "llgl.h" +LLRenderTarget* LLRenderTarget::sBoundTarget = NULL; + + void check_framebuffer_status() { @@ -46,11 +49,9 @@ void check_framebuffer_status() { case GL_FRAMEBUFFER_COMPLETE_EXT: break; - case GL_FRAMEBUFFER_UNSUPPORTED_EXT: - llerrs << "WTF?" << llendl; - break; default: - llerrs << "WTF?" << llendl; + ll_fail("check_framebuffer_status failed"); + break; } } } @@ -273,6 +274,7 @@ void LLRenderTarget::release() } mSampleBuffer = NULL; + sBoundTarget = NULL; } void LLRenderTarget::bindTarget() @@ -311,6 +313,7 @@ void LLRenderTarget::bindTarget() } glViewport(0, 0, mResX, mResY); + sBoundTarget = this; } // static @@ -320,6 +323,7 @@ void LLRenderTarget::unbindTarget() { glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); } + sBoundTarget = NULL; } void LLRenderTarget::clear(U32 mask_in) @@ -532,6 +536,7 @@ void LLMultisampleBuffer::bindTarget(LLRenderTarget* ref) glViewport(0, 0, mResX, mResY); + sBoundTarget = this; } void LLMultisampleBuffer::allocate(U32 resx, U32 resy, U32 color_fmt, BOOL depth, BOOL stencil, LLTexUnit::eTextureType usage, BOOL use_fbo ) diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h index d5d809b791da1dd2fc1679a9ba5518c018a368e1..98b608f834761aa3f17f5a66662ec6c0f6c8d407 100644 --- a/indra/llrender/llrendertarget.h +++ b/indra/llrender/llrendertarget.h @@ -140,6 +140,8 @@ public: //one renderable attachment (i.e. color buffer, depth buffer). BOOL isComplete() const; + static LLRenderTarget* getCurrentBoundTarget() { return sBoundTarget; } + protected: friend class LLMultisampleBuffer; U32 mResX; @@ -153,6 +155,8 @@ protected: LLTexUnit::eTextureType mUsage; U32 mSamples; LLMultisampleBuffer* mSampleBuffer; + + static LLRenderTarget* sBoundTarget; }; diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 5d88ea464d61192dd2a82c6b784db387de90a9dd..db4189dfea93e2f30678c76a340fc4ca096fde9e 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -37,7 +37,6 @@ #include "llvertexbuffer.h" // #include "llrender.h" #include "llglheaders.h" -#include "llmemory.h" #include "llmemtype.h" #include "llrender.h" @@ -117,6 +116,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) GL_COLOR_ARRAY, }; + BOOL error = FALSE; for (U32 i = 0; i < 4; ++i) { if (sLastMask & mask[i]) @@ -129,7 +129,15 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) { //needs to be enabled, make sure it was (DEBUG TEMPORARY) if (i > 0 && !glIsEnabled(array[i])) { - llerrs << "Bad client state! " << array[i] << " disabled." << llendl; + if (gDebugSession) + { + error = TRUE; + gFailLog << "Bad client state! " << array[i] << " disabled." << std::endl; + } + else + { + llerrs << "Bad client state! " << array[i] << " disabled." << llendl; + } } } } @@ -141,11 +149,24 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) } else if (gDebugGL && glIsEnabled(array[i])) { //needs to be disabled, make sure it was (DEBUG TEMPORARY) - llerrs << "Bad client state! " << array[i] << " enabled." << llendl; + if (gDebugSession) + { + error = TRUE; + gFailLog << "Bad client state! " << array[i] << " enabled." << std::endl; + } + else + { + llerrs << "Bad client state! " << array[i] << " enabled." << llendl; + } } } } + if (error) + { + ll_fail("LLVertexBuffer::setupClientArrays failed"); + } + U32 map_tc[] = { MAP_TEXCOORD1, @@ -315,7 +336,7 @@ void LLVertexBuffer::unbind() //static void LLVertexBuffer::cleanupClass() { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_CLEANUP_CLASS); unbind(); clientCopy(); // deletes GL buffers } @@ -342,7 +363,7 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) : mResized(FALSE), mDynamicSize(FALSE) { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_CONSTRUCTOR); if (!sEnableVBOs) { mUsage = 0 ; @@ -379,7 +400,7 @@ S32 LLVertexBuffer::calcStride(const U32& typemask, S32* offsets) //virtual LLVertexBuffer::~LLVertexBuffer() { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTRUCTOR); destroyGLBuffer(); destroyGLIndices(); sCount--; @@ -459,8 +480,8 @@ void LLVertexBuffer::releaseIndices() void LLVertexBuffer::createGLBuffer() { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); - + LLMemType mt2(LLMemType::MTYPE_VERTEX_CREATE_VERTICES); + U32 size = getSize(); if (mGLBuffer) { @@ -491,7 +512,7 @@ void LLVertexBuffer::createGLBuffer() void LLVertexBuffer::createGLIndices() { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_CREATE_INDICES); U32 size = getIndicesSize(); if (mGLIndices) @@ -523,7 +544,7 @@ void LLVertexBuffer::createGLIndices() void LLVertexBuffer::destroyGLBuffer() { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTROY_BUFFER); if (mGLBuffer) { if (useVBOs()) @@ -550,7 +571,7 @@ void LLVertexBuffer::destroyGLBuffer() void LLVertexBuffer::destroyGLIndices() { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTROY_INDICES); if (mGLIndices) { if (useVBOs()) @@ -577,7 +598,7 @@ void LLVertexBuffer::destroyGLIndices() void LLVertexBuffer::updateNumVerts(S32 nverts) { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_UPDATE_VERTS); if (nverts >= 65535) { @@ -606,7 +627,7 @@ void LLVertexBuffer::updateNumVerts(S32 nverts) void LLVertexBuffer::updateNumIndices(S32 nindices) { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_UPDATE_INDICES); mRequestedNumIndices = nindices; if (!mDynamicSize) { @@ -627,7 +648,7 @@ void LLVertexBuffer::updateNumIndices(S32 nindices) void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_ALLOCATE_BUFFER); updateNumVerts(nverts); updateNumIndices(nindices); @@ -650,7 +671,7 @@ void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices) mRequestedNumVerts = newnverts; mRequestedNumIndices = newnindices; - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_RESIZE_BUFFER); mDynamicSize = TRUE; if (mUsage == GL_STATIC_DRAW_ARB) { //always delete/allocate static buffers on resize @@ -779,7 +800,7 @@ BOOL LLVertexBuffer::useVBOs() const // Map for data access U8* LLVertexBuffer::mapBuffer(S32 access) { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_MAP_BUFFER); if (mFinal) { llerrs << "LLVertexBuffer::mapBuffer() called on a finalized buffer." << llendl; @@ -791,13 +812,19 @@ U8* LLVertexBuffer::mapBuffer(S32 access) if (!mLocked && useVBOs()) { - setBuffer(0); - mLocked = TRUE; - stop_glerror(); - mMappedData = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); - stop_glerror(); - mMappedIndexData = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); - stop_glerror(); + { + LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_VERTICES); + setBuffer(0); + mLocked = TRUE; + stop_glerror(); + mMappedData = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + stop_glerror(); + } + { + LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_INDICES); + mMappedIndexData = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + stop_glerror(); + } if (!mMappedData) { @@ -840,7 +867,7 @@ U8* LLVertexBuffer::mapBuffer(S32 access) void LLVertexBuffer::unmapBuffer() { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_UNMAP_BUFFER); if (mMappedData || mMappedIndexData) { if (useVBOs() && mLocked) @@ -962,7 +989,7 @@ bool LLVertexBuffer::getClothWeightStrider(LLStrider<LLVector4>& strider, S32 in void LLVertexBuffer::setStride(S32 type, S32 new_stride) { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_SET_STRIDE); if (mNumVerts) { llerrs << "LLVertexBuffer::setOffset called with mNumVerts = " << mNumVerts << llendl; @@ -984,7 +1011,7 @@ void LLVertexBuffer::setStride(S32 type, S32 new_stride) // Set for rendering void LLVertexBuffer::setBuffer(U32 data_mask) { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_SET_BUFFER); //set up pointers if the data mask is different ... BOOL setup = (sLastMask != data_mask); @@ -1016,19 +1043,36 @@ void LLVertexBuffer::setBuffer(U32 data_mask) sIBOActive = TRUE; } + BOOL error = FALSE; if (gDebugGL) { GLint buff; glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff); if ((GLuint)buff != mGLBuffer) { - llerrs << "Invalid GL vertex buffer bound: " << buff << llendl; + if (gDebugSession) + { + error = TRUE; + gFailLog << "Invalid GL vertex buffer bound: " << buff << std::endl; + } + else + { + llerrs << "Invalid GL vertex buffer bound: " << buff << llendl; + } } glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff); if ((GLuint)buff != mGLIndices) { - llerrs << "Invalid GL index buffer bound: " << buff << llendl; + if (gDebugSession) + { + error = TRUE; + gFailLog << "Invalid GL index buffer bound: " << buff << std::endl; + } + else + { + llerrs << "Invalid GL index buffer bound: " << buff << llendl; + } } } @@ -1040,13 +1084,29 @@ void LLVertexBuffer::setBuffer(U32 data_mask) glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff); if ((GLuint)buff != mGLBuffer) { - llerrs << "Invalid GL vertex buffer bound: " << buff << llendl; + if (gDebugSession) + { + error = TRUE; + gFailLog << "Invalid GL vertex buffer bound: " << std::endl; + } + else + { + llerrs << "Invalid GL vertex buffer bound: " << buff << llendl; + } } glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff); if ((GLuint)buff != mGLIndices) { - llerrs << "Invalid GL index buffer bound: " << buff << llendl; + if (gDebugSession) + { + error = TRUE; + gFailLog << "Invalid GL index buffer bound: "<< std::endl; + } + else + { + llerrs << "Invalid GL index buffer bound: " << buff << llendl; + } } } @@ -1068,10 +1128,22 @@ void LLVertexBuffer::setBuffer(U32 data_mask) if (data_mask != 0) { - llerrs << "Buffer set for rendering before being filled after resize." << llendl; + if (gDebugSession) + { + error = TRUE; + gFailLog << "Buffer set for rendering before being filled after resize." << std::endl; + } + else + { + llerrs << "Buffer set for rendering before being filled after resize." << llendl; + } } } + if (error) + { + ll_fail("LLVertexBuffer::mapBuffer failed"); + } unmapBuffer(); } else @@ -1122,7 +1194,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask) // virtual (default) void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const { - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); + LLMemType mt2(LLMemType::MTYPE_VERTEX_SETUP_VERTEX_BUFFER); stop_glerror(); U8* base = useVBOs() ? NULL : mMappedData; S32 stride = mStride; diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index aad948e17fd8c23a2533e3e6685bc6d454f5d965..b785a22976993b42923f0b970badb75bc00c89d4 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -39,7 +39,6 @@ #include "v4math.h" #include "v4coloru.h" #include "llstrider.h" -#include "llmemory.h" #include "llrender.h" #include <set> #include <vector> diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 5de8dc76af520b36571445e5a9f8d638bdbbbbf3..117e8e28ab3fe328cab6e15966aa0c04ba8bdaac 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -31,17 +31,25 @@ set(llui_SOURCE_FILES llcheckboxctrl.cpp llclipboard.cpp llcombobox.cpp + llconsole.cpp + llcontainerview.cpp llctrlselectioninterface.cpp lldraghandle.cpp lleditmenuhandler.cpp + llf32uictrl.cpp llfloater.cpp + llfloaterreg.cpp + llflyoutbutton.cpp llfocusmgr.cpp llfunctorregistry.cpp lliconctrl.cpp + llinitparam.cpp llkeywords.cpp + lllayoutstack.cpp lllineeditor.cpp llmenugl.cpp llmodaldialog.cpp + llmultifloater.cpp llmultislider.cpp llmultisliderctrl.cpp llnotifications.cpp @@ -51,27 +59,36 @@ set(llui_SOURCE_FILES llresizebar.cpp llresizehandle.cpp llresmgr.cpp - llrootview.cpp llscrollbar.cpp llscrollcontainer.cpp llscrollingpanellist.cpp + llscrolllistcell.cpp + llscrolllistcolumn.cpp llscrolllistctrl.cpp + llscrolllistitem.cpp + llsdparam.cpp + llsearcheditor.cpp llslider.cpp llsliderctrl.cpp llspinctrl.cpp + llstatbar.cpp + llstatgraph.cpp + llstatview.cpp llstyle.cpp lltabcontainer.cpp - lltabcontainervertical.cpp lltextbox.cpp lltexteditor.cpp lltextparser.cpp + lltrans.cpp llui.cpp + lluicolortable.cpp lluictrl.cpp lluictrlfactory.cpp + lluiimage.cpp lluistring.cpp - lluitrans.cpp llundo.cpp llviewborder.cpp + llviewmodel.cpp llview.cpp llviewquery.cpp ) @@ -85,52 +102,69 @@ set(llui_HEADER_FILES llcheckboxctrl.h llclipboard.h llcombobox.h + llconsole.h + llcontainerview.h llctrlselectioninterface.h lldraghandle.h lleditmenuhandler.h + llf32uictrl.h llfloater.h + llfloaterreg.h + llflyoutbutton.h llfocusmgr.h llfunctorregistry.h llhtmlhelp.h lliconctrl.h + llinitparam.h llkeywords.h + lllayoutstack.h + lllazyvalue.h lllineeditor.h - llmemberlistener.h llmenugl.h llmodaldialog.h + llmultifloater.h llmultisliderctrl.h llmultislider.h llnotifications.h llpanel.h llprogressbar.h llradiogroup.h + llregistry.h llresizebar.h llresizehandle.h llresmgr.h - llrootview.h + llsearcheditor.h llscrollbar.h llscrollcontainer.h llscrollingpanellist.h + llscrolllistcell.h + llscrolllistcolumn.h llscrolllistctrl.h + llscrolllistitem.h + llsdparam.h llsliderctrl.h llslider.h llspinctrl.h + llstatbar.h + llstatgraph.h + llstatview.h llstyle.h lltabcontainer.h - lltabcontainervertical.h lltextbox.h lltexteditor.h lltextparser.h + lltrans.h + lluicolortable.h lluiconstants.h lluictrlfactory.h lluictrl.h lluifwd.h llui.h + lluiimage.h lluistring.h - lluitrans.h - lluixmltags.h llundo.h llviewborder.h + llviewmodel.h llview.h llviewquery.h ) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 2c2c1c25d8655331aa901d32724be339abc6cad7..110ad8276342c2c36f59fa860dbeff7ae23c31d4 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -32,6 +32,7 @@ #include "linden_common.h" +#define INSTANTIATE_GETCHILD_BUTTON #include "llbutton.h" // Linden library includes @@ -45,183 +46,171 @@ #include "lluiconstants.h" #include "llresmgr.h" #include "llcriticaldamp.h" +#include "llfloater.h" +#include "llfloaterreg.h" #include "llfocusmgr.h" #include "llwindow.h" #include "llrender.h" +#include "lluictrlfactory.h" -static LLRegisterWidget<LLButton> r("button"); +static LLDefaultWidgetRegistry::Register<LLButton> r("button"); // globals loaded from settings.xml -S32 LLBUTTON_ORIG_H_PAD = 6; // Pre-zoomable UI S32 LLBUTTON_H_PAD = 0; S32 LLBUTTON_V_PAD = 0; S32 BTN_HEIGHT_SMALL= 0; S32 BTN_HEIGHT = 0; -S32 BTN_GRID = 12; -S32 BORDER_SIZE = 1; - -LLButton::LLButton( const std::string& name, const LLRect& rect, const std::string& control_name, void (*click_callback)(void*), void *callback_data) -: LLUICtrl(name, rect, TRUE, NULL, NULL), - mClickedCallback( click_callback ), - mMouseDownCallback( NULL ), - mMouseUpCallback( NULL ), - mHeldDownCallback( NULL ), - mGLFont( NULL ), - mMouseDownFrame( 0 ), - mHeldDownDelay( 0.5f ), // seconds until held-down callback is called - mHeldDownFrameDelay( 0 ), - mImageUnselected( NULL ), - mImageSelected( NULL ), - mImageHoverSelected( NULL ), - mImageHoverUnselected( NULL ), - mImageDisabled( NULL ), - mImageDisabledSelected( NULL ), - mToggleState( FALSE ), - mIsToggle( FALSE ), - mScaleImage( TRUE ), - mDropShadowedText( TRUE ), - mBorderEnabled( FALSE ), - mFlashing( FALSE ), - mHAlign( LLFontGL::HCENTER ), - mLeftHPad( LLBUTTON_H_PAD ), - mRightHPad( LLBUTTON_H_PAD ), - mHoverGlowStrength(0.15f), - mCurGlowStrength(0.f), - mNeedsHighlight(FALSE), - mCommitOnReturn(TRUE), - mImagep( NULL ) +template LLButton* LLView::getChild<LLButton>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const; + +LLButton::Params::Params() +: label_selected("label_selected"), // requires is_toggle true + label_dropshadow("label_shadow", true), + auto_resize("auto_resize", false), + image_unselected("image_unselected"), + image_selected("image_selected"), + image_hover_selected("image_hover_selected"), + image_hover_unselected("image_hover_unselected"), + image_disabled_selected("image_disabled_selected"), + image_disabled("image_disabled"), + image_overlay("image_overlay"), + image_overlay_alignment("image_overlay_alignment", std::string("center")), + label_color("label_color"), + label_color_selected("label_color_selected"), // requires is_toggle true + label_color_disabled("label_color_disabled"), + label_color_disabled_selected("label_color_disabled_selected"), + highlight_color("highlight_color"), + image_color("image_color"), + image_color_disabled("image_color_disabled"), + image_overlay_color("image_overlay_color", LLColor4::white), + flash_color("flash_color"), + pad_right("pad_right", LLUI::sSettingGroups["config"]->getS32("ButtonHPad")), + pad_left("pad_left", LLUI::sSettingGroups["config"]->getS32("ButtonHPad")), + click_callback("click_callback"), + mouse_down_callback("mouse_down_callback"), + mouse_up_callback("mouse_up_callback"), + mouse_held_callback("mouse_held_callback"), + is_toggle("is_toggle", false), + scale_image("scale_image", true), + help_url("help_url"), + hover_glow_amount("hover_glow_amount"), + commit_on_return("commit_on_return", true), + picture_style("picture_style", false) { - mUnselectedLabel = name; - mSelectedLabel = name; - - setImageUnselected(std::string("button_enabled_32x128.tga")); - setImageSelected(std::string("button_enabled_selected_32x128.tga")); - setImageDisabled(std::string("button_disabled_32x128.tga")); - setImageDisabledSelected(std::string("button_disabled_32x128.tga")); - - mImageColor = LLUI::sColorsGroup->getColor( "ButtonImageColor" ); - mDisabledImageColor = LLUI::sColorsGroup->getColor( "ButtonImageColor" ); - - init(click_callback, callback_data, NULL, control_name); -} - - -LLButton::LLButton(const std::string& name, const LLRect& rect, - const std::string &unselected_image_name, - const std::string &selected_image_name, - const std::string& control_name, - void (*click_callback)(void*), - void *callback_data, - const LLFontGL *font, - const std::string& unselected_label, - const std::string& selected_label ) -: LLUICtrl(name, rect, TRUE, NULL, NULL), - mClickedCallback( click_callback ), - mMouseDownCallback( NULL ), - mMouseUpCallback( NULL ), - mHeldDownCallback( NULL ), - mGLFont( NULL ), - mMouseDownFrame( 0 ), - mHeldDownDelay( 0.5f ), // seconds until held-down callback is called - mHeldDownFrameDelay( 0 ), - mImageUnselected( NULL ), - mImageSelected( NULL ), - mImageHoverSelected( NULL ), - mImageHoverUnselected( NULL ), - mImageDisabled( NULL ), - mImageDisabledSelected( NULL ), - mToggleState( FALSE ), - mIsToggle( FALSE ), - mScaleImage( TRUE ), - mDropShadowedText( TRUE ), + addSynonym(is_toggle, "toggle"); + held_down_delay.seconds = 0.5f; + initial_value.set(LLSD(false), false); +} + + +LLButton::LLButton(const LLButton::Params& p) +: LLUICtrl(p), + mMouseDownFrame(0), + mMouseHeldDownCount(0), mBorderEnabled( FALSE ), mFlashing( FALSE ), - mHAlign( LLFontGL::HCENTER ), - mLeftHPad( LLBUTTON_H_PAD ), - mRightHPad( LLBUTTON_H_PAD ), - mHoverGlowStrength(0.25f), mCurGlowStrength(0.f), mNeedsHighlight(FALSE), - mCommitOnReturn(TRUE), - mImagep( NULL ) + mImagep( NULL ), + mUnselectedLabel(p.label()), + mSelectedLabel(p.label_selected()), + mGLFont(p.font), + mHeldDownDelay(p.held_down_delay.seconds), // seconds until held-down callback is called + mHeldDownFrameDelay(p.held_down_delay.frames), + mImageUnselected(p.image_unselected), + mImageSelected(p.image_selected), + mImageDisabled(p.image_disabled), + mImageDisabledSelected(p.image_disabled_selected), + mImageHoverSelected(p.image_hover_selected), + mImageHoverUnselected(p.image_hover_unselected), + mUnselectedLabelColor(p.label_color()), + mSelectedLabelColor(p.label_color_selected()), + mDisabledLabelColor(p.label_color_disabled()), + mDisabledSelectedLabelColor(p.label_color_disabled_selected()), + mHighlightColor(p.highlight_color()), + mImageColor(p.image_color()), + mFlashBgColor(p.flash_color()), + mDisabledImageColor(p.image_color_disabled()), + mImageOverlay(p.image_overlay()), + mImageOverlayColor(p.image_overlay_color()), + mImageOverlayAlignment(LLFontGL::hAlignFromName(p.image_overlay_alignment)), + mIsToggle(p.is_toggle), + mScaleImage(p.scale_image), + mDropShadowedText(p.label_dropshadow), + mAutoResize(p.auto_resize), + mHAlign(p.font_halign), + mLeftHPad(p.pad_left), + mRightHPad(p.pad_right), + mHoverGlowStrength(p.hover_glow_amount), + mCommitOnReturn(p.commit_on_return), + mFadeWhenDisabled(FALSE) { - mUnselectedLabel = unselected_label; - mSelectedLabel = selected_label; - - // by default, disabled color is same as enabled - mImageColor = LLUI::sColorsGroup->getColor( "ButtonImageColor" ); - mDisabledImageColor = LLUI::sColorsGroup->getColor( "ButtonImageColor" ); - - if( unselected_image_name != "" ) - { - // user-specified image - don't use fixed borders unless requested - setImageUnselected(unselected_image_name); - setImageDisabled(unselected_image_name); - - mDisabledImageColor.mV[VALPHA] = 0.5f; - mScaleImage = FALSE; - } - else - { - setImageUnselected(std::string("button_enabled_32x128.tga")); - setImageDisabled(std::string("button_disabled_32x128.tga")); - } + static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0); + static LLButton::Params default_params(LLUICtrlFactory::getDefaultParams<LLButton::Params>()); - if( selected_image_name != "" ) + //if we aren't a picture_style button set label as name if not provided + if (!p.picture_style.isProvided() || !p.picture_style) { - // user-specified image - don't use fixed borders unless requested - setImageSelected(selected_image_name); - setImageDisabledSelected(selected_image_name); - - mDisabledImageColor.mV[VALPHA] = 0.5f; - mScaleImage = FALSE; - } - else - { - setImageSelected(std::string("button_enabled_selected_32x128.tga")); - setImageDisabledSelected(std::string("button_disabled_32x128.tga")); + if (!p.label.isProvided()) + { + mUnselectedLabel = p.name(); + } + if (!p.label_selected.isProvided()) + { + mSelectedLabel = mUnselectedLabel.getString(); + } } - init(click_callback, callback_data, font, control_name); -} - -void LLButton::init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const std::string& control_name) -{ - mGLFont = ( font ? font : LLFontGL::getFontSansSerif()); - // Hack to make sure there is space for at least one character if (getRect().getWidth() - (mRightHPad + mLeftHPad) < mGLFont->getWidth(std::string(" "))) { // Use old defaults - mLeftHPad = LLBUTTON_ORIG_H_PAD; - mRightHPad = LLBUTTON_ORIG_H_PAD; + mLeftHPad = llbutton_orig_h_pad; + mRightHPad = llbutton_orig_h_pad; } - mCallbackUserData = callback_data; mMouseDownTimer.stop(); - setControlName(control_name, NULL); - - mUnselectedLabelColor = ( LLUI::sColorsGroup->getColor( "ButtonLabelColor" ) ); - mSelectedLabelColor = ( LLUI::sColorsGroup->getColor( "ButtonLabelSelectedColor" ) ); - mDisabledLabelColor = ( LLUI::sColorsGroup->getColor( "ButtonLabelDisabledColor" ) ); - mDisabledSelectedLabelColor = ( LLUI::sColorsGroup->getColor( "ButtonLabelSelectedDisabledColor" ) ); - mHighlightColor = ( LLUI::sColorsGroup->getColor( "ButtonUnselectedFgColor" ) ); - mUnselectedBgColor = ( LLUI::sColorsGroup->getColor( "ButtonUnselectedBgColor" ) ); - mSelectedBgColor = ( LLUI::sColorsGroup->getColor( "ButtonSelectedBgColor" ) ); - mFlashBgColor = ( LLUI::sColorsGroup->getColor( "ButtonFlashBgColor" ) ); + if (p.help_url.isProvided()) + { + setHelpURLCallback(p.help_url); + } - mImageOverlayAlignment = LLFontGL::HCENTER; - mImageOverlayColor = LLColor4::white; -} + // if custom unselected button image provided... + if (p.image_unselected != default_params.image_unselected) + { + //...fade it out for disabled image by default... + if (p.image_disabled() == default_params.image_disabled() ) + { + mImageDisabled = p.image_unselected; + mFadeWhenDisabled = TRUE; + } + } -LLButton::~LLButton() -{ - if( hasMouseCapture() ) + // if custom selected button image provided... + if (p.image_selected != default_params.image_selected) { - gFocusMgr.setMouseCapture( NULL ); + //...fade it out for disabled image by default... + if (p.image_disabled_selected() == default_params.image_disabled_selected()) + { + mImageDisabledSelected = p.image_selected; + mFadeWhenDisabled = TRUE; + } + } + + if (mImageUnselected.isNull()) + { + llwarns << "Button: " << getName() << " with no image!" << llendl; } + + if (p.click_callback.isProvided()) + initCommitCallback(p.click_callback, mCommitSignal); // alias -> commit_callback + if (p.mouse_down_callback.isProvided()) + initCommitCallback(p.mouse_down_callback, mMouseDownSignal); + if (p.mouse_up_callback.isProvided()) + initCommitCallback(p.mouse_up_callback, mMouseUpSignal); + if (p.mouse_held_callback.isProvided()) + initCommitCallback(p.mouse_held_callback, mHeldDownSignal); } // HACK: Committing a button is the same as instantly clicking it. @@ -229,19 +218,12 @@ LLButton::~LLButton() void LLButton::onCommit() { // WARNING: Sometimes clicking a button destroys the floater or - // panel containing it. Therefore we need to call mClickedCallback + // panel containing it. Therefore we need to call LLUICtrl::onCommit() // LAST, otherwise this becomes deleted memory. - LLUICtrl::onCommit(); - if (mMouseDownCallback) - { - (*mMouseDownCallback)(mCallbackUserData); - } + mMouseDownSignal(this, LLSD()); - if (mMouseUpCallback) - { - (*mMouseUpCallback)(mCallbackUserData); - } + mMouseUpSignal(this, LLSD()); if (getSoundFlags() & MOUSE_DOWN) { @@ -259,14 +241,55 @@ void LLButton::onCommit() } // do this last, as it can result in destroying this button - if (mClickedCallback) - { - (*mClickedCallback)( mCallbackUserData ); - } + LLUICtrl::onCommit(); +} + +boost::signals::connection LLButton::setClickedCallback( const commit_signal_t::slot_type& cb ) +{ + return mCommitSignal.connect(cb); +} +boost::signals::connection LLButton::setMouseDownCallback( const commit_signal_t::slot_type& cb ) +{ + return mMouseDownSignal.connect(cb); +} +boost::signals::connection LLButton::setMouseUpCallback( const commit_signal_t::slot_type& cb ) +{ + return mMouseUpSignal.connect(cb); +} +boost::signals::connection LLButton::setHeldDownCallback( const commit_signal_t::slot_type& cb ) +{ + return mHeldDownSignal.connect(cb); +} + +boost::signals::connection LLButton::setRightClickedCallback( const commit_signal_t::slot_type& cb ) +{ + return mRightClickSignal.connect(cb); } +// *TODO: Deprecate (for backwards compatability only) +boost::signals::connection LLButton::setClickedCallback( button_callback_t cb, void* data ) +{ + return setClickedCallback(boost::bind(cb, data)); +} +boost::signals::connection LLButton::setMouseDownCallback( button_callback_t cb, void* data ) +{ + return setMouseDownCallback(boost::bind(cb, data)); +} +boost::signals::connection LLButton::setMouseUpCallback( button_callback_t cb, void* data ) +{ + return setMouseUpCallback(boost::bind(cb, data)); +} +boost::signals::connection LLButton::setHeldDownCallback( button_callback_t cb, void* data ) +{ + return setHeldDownCallback(boost::bind(cb, data)); +} +BOOL LLButton::postBuild() +{ + autoResize(); + return TRUE; +} BOOL LLButton::handleUnicodeCharHere(llwchar uni_char) { BOOL handled = FALSE; @@ -278,10 +301,8 @@ BOOL LLButton::handleUnicodeCharHere(llwchar uni_char) toggleState(); } - if (mClickedCallback) - { - (*mClickedCallback)( mCallbackUserData ); - } + LLUICtrl::onCommit(); + handled = TRUE; } return handled; @@ -299,10 +320,7 @@ BOOL LLButton::handleKeyHere(KEY key, MASK mask ) handled = TRUE; - if (mClickedCallback) - { - (*mClickedCallback)( mCallbackUserData ); - } + LLUICtrl::onCommit(); } return handled; } @@ -318,13 +336,11 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask) setFocus(TRUE); } - if (mMouseDownCallback) - { - (*mMouseDownCallback)(mCallbackUserData); - } + mMouseDownSignal(this, LLSD()); mMouseDownTimer.start(); mMouseDownFrame = (S32) LLFrameTimer::getFrameCount(); + mMouseHeldDownCount = 0; if (getSoundFlags() & MOUSE_DOWN) { @@ -344,13 +360,9 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask) gFocusMgr.setMouseCapture( NULL ); // Regardless of where mouseup occurs, handle callback - if (mMouseUpCallback) - { - (*mMouseUpCallback)(mCallbackUserData); - } + mMouseUpSignal(this, LLSD()); - mMouseDownTimer.stop(); - mMouseDownTimer.reset(); + resetMouseDownTimer(); // DO THIS AT THE VERY END to allow the button to be destroyed as a result of being clicked. // If mouseup in the widget, it's been clicked @@ -366,31 +378,65 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask) toggleState(); } - if (mClickedCallback) - { - (*mClickedCallback)( mCallbackUserData ); - } + LLUICtrl::onCommit(); } } return TRUE; } +BOOL LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + // Route future Mouse messages here preemptively. (Release on mouse up.) + gFocusMgr.setMouseCapture( this ); -BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) + if (hasTabStop() && !getIsChrome()) + { + setFocus(TRUE); + } + + + return TRUE; +} + +BOOL LLButton::handleRightMouseUp(S32 x, S32 y, MASK mask) { - LLMouseHandler* other_captor = gFocusMgr.getMouseCapture(); - mNeedsHighlight = other_captor == NULL || - other_captor == this || - // this following bit is to support modal dialogs - (other_captor->isView() && hasAncestor((LLView*)other_captor)); + // We only handle the click if the click both started and ended within us + if( hasMouseCapture() ) + { + // Always release the mouse + gFocusMgr.setMouseCapture( NULL ); - if (mMouseDownTimer.getStarted() && NULL != mHeldDownCallback) + if (pointInView(x, y)) + { + mRightClickSignal(this, getValue()); + } + } + return TRUE; +} + + +void LLButton::onMouseEnter(S32 x, S32 y, MASK mask) +{ + if (getEnabled()) + mNeedsHighlight = TRUE; +} + +void LLButton::onMouseLeave(S32 x, S32 y, MASK mask) +{ + mNeedsHighlight = FALSE; +} + +BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) +{ + if (mMouseDownTimer.getStarted()) { F32 elapsed = getHeldDownTime(); if( mHeldDownDelay <= elapsed && mHeldDownFrameDelay <= (S32)LLFrameTimer::getFrameCount() - mMouseDownFrame) { - mHeldDownCallback( mCallbackUserData ); + LLSD param; + param["count"] = mMouseHeldDownCount++; + mHeldDownSignal(this, param); } } @@ -406,12 +452,15 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) void LLButton::draw() { BOOL flash = FALSE; + static LLUICachedControl<F32> button_flash_rate("ButtonFlashRate", 0); + static LLUICachedControl<S32> button_flash_count("ButtonFlashCount", 0); + if( mFlashing ) { F32 elapsed = mFlashingTimer.getElapsedTimeF32(); - S32 flash_count = S32(elapsed * LLUI::sConfigGroup->getF32("ButtonFlashRate") * 2.f); + S32 flash_count = S32(elapsed * button_flash_rate * 2.f); // flash on or off? - flash = (flash_count % 2 == 0) || flash_count > S32((F32)LLUI::sConfigGroup->getS32("ButtonFlashCount") * 2.f); + flash = (flash_count % 2 == 0) || flash_count > S32((F32)button_flash_count * 2.f); } BOOL pressed_by_keyboard = FALSE; @@ -427,7 +476,7 @@ void LLButton::draw() BOOL pressed = pressed_by_keyboard || (hasMouseCapture() && pointInView(local_mouse_x, local_mouse_y)) - || mToggleState; + || getToggleState(); BOOL use_glow_effect = FALSE; LLColor4 glow_color = LLColor4::white; @@ -470,12 +519,14 @@ void LLButton::draw() if (mFlashing) { + LLColor4 flash_color = mFlashBgColor.get(); use_glow_effect = TRUE; glow_type = LLRender::BT_ALPHA; // blend the glow + if (mNeedsHighlight) // highlighted AND flashing - glow_color = (glow_color*0.5f + mFlashBgColor*0.5f) % 2.0f; // average between flash and highlight colour, with sum of the opacity + glow_color = (glow_color*0.5f + flash_color*0.5f) % 2.0f; // average between flash and highlight colour, with sum of the opacity else - glow_color = mFlashBgColor; + glow_color = flash_color; } // Override if more data is available @@ -508,31 +559,31 @@ void LLButton::draw() // label changes when button state changes, not when pressed if ( getEnabled() ) { - if ( mToggleState ) + if ( getToggleState() ) { - label_color = mSelectedLabelColor; + label_color = mSelectedLabelColor.get(); } else { - label_color = mUnselectedLabelColor; + label_color = mUnselectedLabelColor.get(); } } else { - if ( mToggleState ) + if ( getToggleState() ) { - label_color = mDisabledSelectedLabelColor; + label_color = mDisabledSelectedLabelColor.get(); } else { - label_color = mDisabledLabelColor; + label_color = mDisabledLabelColor.get(); } } // Unselected label assignments LLWString label; - if( mToggleState ) + if( getToggleState() ) { if( getEnabled() || mDisabledSelectedLabel.empty() ) { @@ -578,9 +629,11 @@ void LLButton::draw() // Otherwise draw basic rectangular button. if (mImagep.notNull()) { + // apply automatic 50% alpha fade to disabled image + LLColor4 disabled_color = mFadeWhenDisabled ? mDisabledImageColor.get() % 0.5f : mDisabledImageColor.get(); if ( mScaleImage) { - mImagep->draw(getLocalRect(), getEnabled() ? mImageColor : mDisabledImageColor ); + mImagep->draw(getLocalRect(), getEnabled() ? mImageColor.get() : disabled_color ); if (mCurGlowStrength > 0.01f) { gGL.setSceneBlendType(glow_type); @@ -590,7 +643,7 @@ void LLButton::draw() } else { - mImagep->draw(0, 0, getEnabled() ? mImageColor : mDisabledImageColor ); + mImagep->draw(0, 0, getEnabled() ? mImageColor.get() : disabled_color ); if (mCurGlowStrength > 0.01f) { gGL.setSceneBlendType(glow_type); @@ -602,7 +655,7 @@ void LLButton::draw() else { // no image - llwarns << "No image for button " << getName() << llendl; + lldebugs << "No image for button " << getName() << llendl; // draw it in pink so we can find it gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4::pink1, FALSE); } @@ -634,7 +687,7 @@ void LLButton::draw() } // fade out overlay images on disabled buttons - LLColor4 overlay_color = mImageOverlayColor; + LLColor4 overlay_color = mImageOverlayColor.get(); if (!getEnabled()) { overlay_color.mV[VALPHA] = 0.5f; @@ -707,23 +760,18 @@ void LLButton::draw() mGLFont->render(label, 0, (F32)x, (F32)(LLBUTTON_V_PAD + y_offset), label_color, mHAlign, LLFontGL::BOTTOM, - mDropShadowedText ? LLFontGL::DROP_SHADOW_SOFT : LLFontGL::NORMAL, + LLFontGL::NORMAL, + mDropShadowedText ? LLFontGL::DROP_SHADOW_SOFT : LLFontGL::NO_SHADOW, U32_MAX, text_width, NULL, FALSE, FALSE); } - if (sDebugRects - || (LLView::sEditingUI && this == LLView::sEditingUIView)) - { - drawDebugRect(); - } - - // reset hover status for next frame - mNeedsHighlight = FALSE; + LLView::draw(); } void LLButton::drawBorder(const LLColor4& color, S32 size) { + if (mImagep.isNull()) return; if (mScaleImage) { mImagep->drawBorder(getLocalRect(), color, size); @@ -734,22 +782,19 @@ void LLButton::drawBorder(const LLColor4& color, S32 size) } } -void LLButton::setClickedCallback(void (*cb)(void*), void* userdata) +BOOL LLButton::getToggleState() const { - mClickedCallback = cb; - if (userdata) - { - mCallbackUserData = userdata; - } + return getValue().asBoolean(); } - void LLButton::setToggleState(BOOL b) { - if( b != mToggleState ) + if( b != getToggleState() ) { setControlValue(b); // will fire LLControlVariable callbacks (if any) - mToggleState = b; // may or may not be redundant + setValue(b); // may or may not be redundant + // Unselected label assignments + autoResize(); } } @@ -764,19 +809,11 @@ void LLButton::setFlashing( BOOL b ) BOOL LLButton::toggleState() -{ - setToggleState( !mToggleState ); - return mToggleState; -} - -void LLButton::setValue(const LLSD& value ) { - mToggleState = value.asBoolean(); -} + bool flipped = ! getToggleState(); + setToggleState(flipped); -LLSD LLButton::getValue() const -{ - return mToggleState == TRUE; + return flipped; } void LLButton::setLabel( const LLStringExplicit& label ) @@ -816,8 +853,55 @@ void LLButton::setDisabledSelectedLabel( const LLStringExplicit& label ) void LLButton::setImageUnselected(LLPointer<LLUIImage> image) { mImageUnselected = image; + if (mImageUnselected.isNull()) + { + llwarns << "Setting default button image for: " << getName() << " to NULL" << llendl; + } } +void LLButton::autoResize() +{ + LLUIString label; + if(getToggleState()) + { + if( getEnabled() || mDisabledSelectedLabel.empty() ) + { + label = mSelectedLabel; + } + else + { + label = mDisabledSelectedLabel; + } + } + else + { + if( getEnabled() || mDisabledLabel.empty() ) + { + label = mUnselectedLabel; + } + else + { + label = mDisabledLabel; + } + } + resize(label); +} + +void LLButton::resize(LLUIString label) +{ + // get label length + S32 label_width = mGLFont->getWidth(label.getString()); + // get current btn length + S32 btn_width =getRect().getWidth(); + // check if it need resize + if (mAutoResize == TRUE) + { + if (btn_width - (mRightHPad + mLeftHPad) < label_width) + { + setRect(LLRect( getRect().mLeft, getRect().mTop, getRect().mLeft + label_width + mLeftHPad + mRightHPad , getRect().mBottom)); + } + } +} void LLButton::setImages( const std::string &image_name, const std::string &selected_name ) { setImageUnselected(image_name); @@ -845,14 +929,20 @@ void LLButton::setImageDisabled(LLPointer<LLUIImage> image) { mImageDisabled = image; mDisabledImageColor = mImageColor; - mDisabledImageColor.mV[VALPHA] *= 0.5f; + mFadeWhenDisabled = TRUE; } void LLButton::setImageDisabledSelected(LLPointer<LLUIImage> image) { mImageDisabledSelected = image; mDisabledImageColor = mImageColor; - mDisabledImageColor.mV[VALPHA] *= 0.5f; + mFadeWhenDisabled = TRUE; +} + +void LLButton::setDisabledImages( const std::string &image_name, const std::string &selected_name) +{ + setDisabledImages( image_name, selected_name, mImageColor.get()); + mFadeWhenDisabled = TRUE; } void LLButton::setDisabledImages( const std::string &image_name, const std::string &selected_name, const LLColor4& c ) @@ -867,13 +957,6 @@ void LLButton::setImageHoverSelected(LLPointer<LLUIImage> image) mImageHoverSelected = image; } -void LLButton::setDisabledImages( const std::string &image_name, const std::string &selected_name) -{ - LLColor4 clr = mImageColor; - clr.mV[VALPHA] *= .5f; - setDisabledImages( image_name, selected_name, clr ); -} - void LLButton::setImageHoverUnselected(LLPointer<LLUIImage> image) { mImageHoverUnselected = image; @@ -899,11 +982,9 @@ void LLButton::setImageOverlay(const std::string& image_name, LLFontGL::HAlign a } } - void LLButton::onMouseCaptureLost() { - mMouseDownTimer.stop(); - mMouseDownTimer.reset(); + resetMouseDownTimer(); } //------------------------------------------------------------------------- @@ -975,28 +1056,6 @@ void LLButton::addImageAttributeToXML(LLXMLNodePtr node, } } -// virtual -LLXMLNodePtr LLButton::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - node->createChild("label", TRUE)->setStringValue(getLabelUnselected()); - node->createChild("label_selected", TRUE)->setStringValue(getLabelSelected()); - node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mGLFont)); - node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(mHAlign)); - - addImageAttributeToXML(node,mImageUnselectedName,mImageUnselectedID,std::string("image_unselected")); - addImageAttributeToXML(node,mImageSelectedName,mImageSelectedID,std::string("image_selected")); - addImageAttributeToXML(node,mImageHoverSelectedName,mImageHoverSelectedID,std::string("image_hover_selected")); - addImageAttributeToXML(node,mImageHoverUnselectedName,mImageHoverUnselectedID,std::string("image_hover_unselected")); - addImageAttributeToXML(node,mImageDisabledName,mImageDisabledID,std::string("image_disabled")); - addImageAttributeToXML(node,mImageDisabledSelectedName,mImageDisabledSelectedID,std::string("image_disabled_selected")); - - node->createChild("scale_image", TRUE)->setBoolValue(mScaleImage); - - return node; -} - void clicked_help(void* data) { LLButton* self = (LLButton*)data; @@ -1010,114 +1069,53 @@ void clicked_help(void* data) LLUI::sHtmlHelp->show(self->getHelpURL()); } -// static -LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) +void LLButton::setHelpURLCallback(const std::string &help_url) { - std::string name("button"); - node->getAttributeString("name", name); - - std::string label = name; - node->getAttributeString("label", label); - - std::string label_selected = label; - node->getAttributeString("label_selected", label_selected); - - LLFontGL* font = selectFont(node); - - std::string image_unselected; - if (node->hasAttribute("image_unselected")) node->getAttributeString("image_unselected",image_unselected); - - std::string image_selected; - if (node->hasAttribute("image_selected")) node->getAttributeString("image_selected",image_selected); - - std::string image_hover_selected; - if (node->hasAttribute("image_hover_selected")) node->getAttributeString("image_hover_selected",image_hover_selected); - - std::string image_hover_unselected; - if (node->hasAttribute("image_hover_unselected")) node->getAttributeString("image_hover_unselected",image_hover_unselected); - - std::string image_disabled_selected; - if (node->hasAttribute("image_disabled_selected")) node->getAttributeString("image_disabled_selected",image_disabled_selected); - - std::string image_disabled; - if (node->hasAttribute("image_disabled")) node->getAttributeString("image_disabled",image_disabled); - - std::string image_overlay; - node->getAttributeString("image_overlay", image_overlay); - - LLFontGL::HAlign image_overlay_alignment = LLFontGL::HCENTER; - std::string image_overlay_alignment_string; - if (node->hasAttribute("image_overlay_alignment")) - { - node->getAttributeString("image_overlay_alignment", image_overlay_alignment_string); - image_overlay_alignment = LLFontGL::hAlignFromName(image_overlay_alignment_string); - } - - - LLButton *button = new LLButton(name, - LLRect(), - image_unselected, - image_selected, - LLStringUtil::null, - NULL, - parent, - font, - label, - label_selected); - - node->getAttributeS32("pad_right", button->mRightHPad); - node->getAttributeS32("pad_left", button->mLeftHPad); + mHelpURL = help_url; + setClickedCallback(clicked_help,this); +} - BOOL is_toggle = button->getIsToggle(); - node->getAttributeBOOL("toggle", is_toggle); - button->setIsToggle(is_toggle); +// static +void LLButton::toggleFloaterAndSetToggleState(LLUICtrl* ctrl, const LLSD& sdname) +{ + bool floater_vis = LLFloaterReg::toggleInstance(sdname.asString()); + LLButton* button = dynamic_cast<LLButton*>(ctrl); + if (button) + button->setToggleState(floater_vis); +} - if(image_hover_selected != LLStringUtil::null) button->setImageHoverSelected(image_hover_selected); - - if(image_hover_unselected != LLStringUtil::null) button->setImageHoverUnselected(image_hover_unselected); - - if(image_disabled_selected != LLStringUtil::null) button->setImageDisabledSelected(image_disabled_selected ); - - if(image_disabled != LLStringUtil::null) button->setImageDisabled(image_disabled); - - if(image_overlay != LLStringUtil::null) button->setImageOverlay(image_overlay, image_overlay_alignment); +// static +// Gets called once +void LLButton::setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname) +{ + LLButton* button = dynamic_cast<LLButton*>(ctrl); + if (!button) + return; + // Get the visibility control name for the floater + std::string vis_control_name = LLFloaterReg::declareVisibilityControl(sdname.asString()); + // Set the button control value (toggle state) to the floater visibility control (Sets the value as well) + button->setControlVariable(LLUI::sSettingGroups["floater"]->getControl(vis_control_name)); + // Set the clicked callback to toggle the floater + button->setClickedCallback(boost::bind(&LLFloaterReg::toggleFloaterInstance, sdname)); +} - if (node->hasAttribute("halign")) - { - LLFontGL::HAlign halign = selectFontHAlign(node); - button->setHAlign(halign); - } +void LLButton::resetMouseDownTimer() +{ + mMouseDownTimer.stop(); + mMouseDownTimer.reset(); +} - if (node->hasAttribute("scale_image")) - { - BOOL needsScale = FALSE; - node->getAttributeBOOL("scale_image",needsScale); - button->setScaleImage( needsScale ); - } - if(label.empty()) - { - button->setLabelUnselected(node->getTextContents()); - } - if (label_selected.empty()) - { - button->setLabelSelected(node->getTextContents()); - } - - if (node->hasAttribute("help_url")) +// *TODO: Remove this function after the initial XUI XML re-export pass. +// static +void LLButton::setupParamsForExport(Params& p, LLView* parent) +{ + std::string label = p.label; + if (label.empty()) { - std::string help_url; - node->getAttributeString("help_url",help_url); - button->setHelpURLCallback(help_url); + //if our label is empty this is a picture style button + p.picture_style = true; } - button->initFromXML(node, parent); - - return button; -} - -void LLButton::setHelpURLCallback(const std::string &help_url) -{ - mHelpURL = help_url; - setClickedCallback(clicked_help,this); + LLUICtrl::setupParamsForExport(p, parent); } diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 724b77541afa6cf10630752bb9c2ea2bfd152e70..c7969e260d16bfc8aa538084dada1d1cd1b85e32 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -39,7 +39,7 @@ #include "v4color.h" #include "llframetimer.h" #include "llfontgl.h" -#include "llimage.h" +#include "lluiimage.h" #include "lluistring.h" // @@ -53,9 +53,6 @@ extern S32 LLBUTTON_V_PAD; extern S32 BTN_HEIGHT_SMALL; extern S32 BTN_HEIGHT; -// All button widths should be rounded up to this size -extern S32 BTN_GRID; - // // Helpful functions // @@ -72,36 +69,81 @@ class LLButton : public LLUICtrl { public: - // simple button with text label - LLButton(const std::string& name, const LLRect &rect, const std::string& control_name = std::string(), - void (*on_click)(void*) = NULL, void *data = NULL); - - LLButton(const std::string& name, const LLRect& rect, - const std::string &unselected_image, - const std::string &selected_image, - const std::string& control_name, - void (*click_callback)(void*), - void *callback_data = NULL, - const LLFontGL* mGLFont = NULL, - const std::string& unselected_label = LLStringUtil::null, - const std::string& selected_label = LLStringUtil::null ); - - virtual ~LLButton(); - void init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const std::string& control_name); - + struct Params + : public LLInitParam::Block<Params, LLUICtrl::Params> + { + // text label + Optional<std::string> label_selected; + Optional<bool> label_dropshadow; + Optional<bool> auto_resize; + + // images + Optional<LLUIImage*> image_unselected, + image_selected, + image_hover_selected, + image_hover_unselected, + image_disabled_selected, + image_disabled, + image_overlay; + + Optional<std::string> image_overlay_alignment; + + // colors + Optional<LLUIColor> label_color, + label_color_selected, + label_color_disabled, + label_color_disabled_selected, + highlight_color, + image_color, + image_color_disabled, + image_overlay_color, + flash_color; + + // layout + Optional<S32> pad_right; + Optional<S32> pad_left; + + // callbacks + Optional<CommitCallbackParam> click_callback, // alias -> commit_callback + mouse_down_callback, + mouse_up_callback, + mouse_held_callback; + + // misc + Optional<bool> is_toggle, + scale_image, + commit_on_return, + picture_style; //if true, don't display label + + Optional<std::string> help_url; + Optional<F32> hover_glow_amount; + Optional<TimeIntervalParam> held_down_delay; + + Params(); + }; +protected: + friend class LLUICtrlFactory; + LLButton(const Params&); + +public: + // For backward compatability only + typedef boost::function<void(void*)> button_callback_t; + void addImageAttributeToXML(LLXMLNodePtr node, const std::string& imageName, const LLUUID& imageID,const std::string& xmlTagName) const; - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - virtual BOOL handleUnicodeCharHere(llwchar uni_char); virtual BOOL handleKeyHere(KEY key, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); + virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); virtual void draw(); + /*virtual*/ BOOL postBuild(); + virtual void onMouseEnter(S32 x, S32 y, MASK mask); + virtual void onMouseLeave(S32 x, S32 y, MASK mask); virtual void onMouseCaptureLost(); virtual void onCommit(); @@ -109,18 +151,27 @@ public: void setUnselectedLabelColor( const LLColor4& c ) { mUnselectedLabelColor = c; } void setSelectedLabelColor( const LLColor4& c ) { mSelectedLabelColor = c; } - void setClickedCallback( void (*cb)(void *data), void* data = NULL ); // mouse down and up within button - void setMouseDownCallback( void (*cb)(void *data) ) { mMouseDownCallback = cb; } // mouse down within button - void setMouseUpCallback( void (*cb)(void *data) ) { mMouseUpCallback = cb; } // mouse up, EVEN IF NOT IN BUTTON - void setHeldDownCallback( void (*cb)(void *data) ) { mHeldDownCallback = cb; } // Mouse button held down and in button - void setHeldDownDelay( F32 seconds, S32 frames = 0) { mHeldDownDelay = seconds; mHeldDownFrameDelay = frames; } + boost::signals::connection setClickedCallback( const commit_signal_t::slot_type& cb ); // mouse down and up within button + boost::signals::connection setMouseDownCallback( const commit_signal_t::slot_type& cb ); + boost::signals::connection setMouseUpCallback( const commit_signal_t::slot_type& cb ); // mouse up, EVEN IF NOT IN BUTTON + // Passes a 'count' parameter in the commit param payload, i.e. param["count"]) + boost::signals::connection setHeldDownCallback( const commit_signal_t::slot_type& cb ); // Mouse button held down and in button + boost::signals::connection setRightClickedCallback( const commit_signal_t::slot_type& cb ); // right mouse down and up within button + + + // *TODO: Deprecate (for backwards compatability only) + boost::signals::connection setClickedCallback( button_callback_t cb, void* data ); + boost::signals::connection setMouseDownCallback( button_callback_t cb, void* data ); + boost::signals::connection setMouseUpCallback( button_callback_t cb, void* data ); + boost::signals::connection setHeldDownCallback( button_callback_t cb, void* data ); + + void setHeldDownDelay( F32 seconds, S32 frames = 0) { mHeldDownDelay = seconds; mHeldDownFrameDelay = frames; } + F32 getHeldDownTime() const { return mMouseDownTimer.getElapsedTimeF32(); } - BOOL getIsToggle() const { return mIsToggle; } - void setIsToggle(BOOL is_toggle) { mIsToggle = is_toggle; } BOOL toggleState(); - BOOL getToggleState() const { return mToggleState; } + BOOL getToggleState() const; void setToggleState(BOOL b); void setFlashing( BOOL b ); @@ -150,11 +201,9 @@ public: void setImageOverlay(const std::string& image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white); LLPointer<LLUIImage> getImageOverlay() { return mImageOverlay; } - - - virtual void setValue(const LLSD& value ); - virtual LLSD getValue() const; + void autoResize(); // resize with label of current btn state + void resize(LLUIString label); // resize with label input void setLabel( const LLStringExplicit& label); virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); void setLabelUnselected(const LLStringExplicit& label); @@ -172,8 +221,6 @@ public: void setBorderEnabled(BOOL b) { mBorderEnabled = b; } - static void onHeldDown(void *userdata); // to be called by gIdleCallbacks - void setHoverGlowStrength(F32 strength) { mHoverGlowStrength = strength; } void setImageUnselected(const std::string &image_name); @@ -198,6 +245,10 @@ public: void setHelpURLCallback(const std::string &help_url); const std::string& getHelpURL() const { return mHelpURL; } + static void onHeldDown(void *userdata); // to be called by gIdleCallbacks + static void toggleFloaterAndSetToggleState(LLUICtrl* ctrl, const LLSD& sdname); + static void setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname); + protected: virtual void drawBorder(const LLColor4& color, S32 size); @@ -212,45 +263,48 @@ protected: void setImageDisabledSelectedID(const LLUUID &image_id); const LLPointer<LLUIImage>& getImageUnselected() const { return mImageUnselected; } const LLPointer<LLUIImage>& getImageSelected() const { return mImageSelected; } + void resetMouseDownTimer(); LLFrameTimer mMouseDownTimer; -private: - - void (*mClickedCallback)(void* data ); - void (*mMouseDownCallback)(void *data); - void (*mMouseUpCallback)(void *data); - void (*mHeldDownCallback)(void *data); + // If the label is empty, set the picture_style attribute + static void setupParamsForExport(Params& p, LLView* parent); +private: + commit_signal_t mMouseDownSignal; + commit_signal_t mMouseUpSignal; + commit_signal_t mHeldDownSignal; + const LLFontGL *mGLFont; S32 mMouseDownFrame; - F32 mHeldDownDelay; // seconds, after which held-down callbacks get called + S32 mMouseHeldDownCount; // Counter for parameter passed to held-down callback + F32 mHeldDownDelay; // seconds, after which held-down callbacks get called S32 mHeldDownFrameDelay; // frames, after which held-down callbacks get called - LLPointer<LLUIImage> mImageOverlay; - LLFontGL::HAlign mImageOverlayAlignment; - LLColor4 mImageOverlayColor; + LLPointer<LLUIImage> mImageOverlay; + LLFontGL::HAlign mImageOverlayAlignment; + LLUIColor mImageOverlayColor; - LLPointer<LLUIImage> mImageUnselected; - LLUIString mUnselectedLabel; - LLColor4 mUnselectedLabelColor; + LLPointer<LLUIImage> mImageUnselected; + LLUIString mUnselectedLabel; + LLUIColor mUnselectedLabelColor; - LLPointer<LLUIImage> mImageSelected; - LLUIString mSelectedLabel; - LLColor4 mSelectedLabelColor; + LLPointer<LLUIImage> mImageSelected; + LLUIString mSelectedLabel; + LLUIColor mSelectedLabelColor; - LLPointer<LLUIImage> mImageHoverSelected; + LLPointer<LLUIImage> mImageHoverSelected; - LLPointer<LLUIImage> mImageHoverUnselected; + LLPointer<LLUIImage> mImageHoverUnselected; - LLPointer<LLUIImage> mImageDisabled; - LLUIString mDisabledLabel; - LLColor4 mDisabledLabelColor; + LLPointer<LLUIImage> mImageDisabled; + LLUIString mDisabledLabel; + LLUIColor mDisabledLabelColor; - LLPointer<LLUIImage> mImageDisabledSelected; - LLUIString mDisabledSelectedLabel; - LLColor4 mDisabledSelectedLabelColor; + LLPointer<LLUIImage> mImageDisabledSelected; + LLUIString mDisabledSelectedLabel; + LLUIColor mDisabledSelectedLabelColor; LLUUID mImageUnselectedID; LLUUID mImageSelectedID; @@ -265,20 +319,17 @@ private: std::string mImageDisabledName; std::string mImageDisabledSelectedName; - LLColor4 mHighlightColor; - LLColor4 mUnselectedBgColor; - LLColor4 mSelectedBgColor; - LLColor4 mFlashBgColor; + LLUIColor mHighlightColor; + LLUIColor mFlashBgColor; - LLColor4 mImageColor; - LLColor4 mDisabledImageColor; + LLUIColor mImageColor; + LLUIColor mDisabledImageColor; BOOL mIsToggle; - BOOL mToggleState; BOOL mScaleImage; BOOL mDropShadowedText; - + BOOL mAutoResize; BOOL mBorderEnabled; BOOL mFlashing; @@ -292,6 +343,7 @@ private: BOOL mNeedsHighlight; BOOL mCommitOnReturn; + BOOL mFadeWhenDisabled; std::string mHelpURL; @@ -300,4 +352,11 @@ private: LLFrameTimer mFlashingTimer; }; +#ifdef LL_WINDOWS +#ifndef INSTANTIATE_GETCHILD_BUTTON +#pragma warning (disable : 4231) +extern template LLButton* LLView::getChild<LLButton>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const; +#endif +#endif + #endif // LL_LLBUTTON_H diff --git a/indra/llui/llcallbackmap.h b/indra/llui/llcallbackmap.h index eadb9c98f35f3a09c41af6893e128dc0ab0695ba..97b1e2fc50403dd1f959fef9eb7ebd718dbdcd8c 100644 --- a/indra/llui/llcallbackmap.h +++ b/indra/llui/llcallbackmap.h @@ -30,11 +30,11 @@ * $/LicenseInfo$ */ -#ifndef LL_CALLBACK_MAP_H -#define LL_CALLBACK_MAP_H +#ifndef LLCALLBACKMAP_H +#define LLCALLBACKMAP_H #include <map> -#include "llstring.h" +#include <string> class LLCallbackMap { @@ -45,12 +45,19 @@ public: typedef std::map<std::string, LLCallbackMap> map_t; typedef map_t::iterator map_iter_t; typedef map_t::const_iterator map_const_iter_t; - + + template <class T> + static void* buildPanel(void* data) + { + T* panel = new T(); + return (void*)panel; + } + LLCallbackMap() : mCallback(NULL), mData(NULL) { } - LLCallbackMap(callback_t callback, void* data) : mCallback(callback), mData(data) { } + LLCallbackMap(callback_t callback, void* data = NULL) : mCallback(callback), mData(data) { } callback_t mCallback; void* mData; }; -#endif // LL_CALLBACK_MAP_H +#endif // LLCALLBACKMAP_H diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index eda9467d870c753f0ac8dd7d9a96735bbf2d1824..932a1b6297b4a834108d17dae2d249e627ab1df8 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -31,6 +31,7 @@ */ // The mutants are coming! +#define INSTANTIATE_GETCHILD_CHECKBOX #include "linden_common.h" @@ -49,101 +50,88 @@ const U32 MAX_STRING_LENGTH = 10; -static LLRegisterWidget<LLCheckBoxCtrl> r("check_box"); - - -LLCheckBoxCtrl::LLCheckBoxCtrl(const std::string& name, const LLRect& rect, - const std::string& label, - const LLFontGL* font, - void (*commit_callback)(LLUICtrl* ctrl, void* userdata), - void* callback_user_data, - BOOL initial_value, - BOOL use_radio_style, - const std::string& control_which) -: LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data, FOLLOWS_LEFT | FOLLOWS_TOP), - mTextEnabledColor( LLUI::sColorsGroup->getColor( "LabelTextColor" ) ), - mTextDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ), - mRadioStyle( use_radio_style ), - mInitialValue( initial_value ), - mSetValue( initial_value ) +template LLCheckBoxCtrl* LLView::getChild<LLCheckBoxCtrl>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const; + +static LLDefaultWidgetRegistry::Register<LLCheckBoxCtrl> r("check_box"); + +LLCheckBoxCtrl::Params::Params() +: text_enabled_color("text_enabled_color"), + text_disabled_color("text_disabled_color"), + initial_value("initial_value", false), + label_text("label_text"), + check_button("check_button"), + radio_style("radio_style") +{} + + +LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p) +: LLUICtrl(p), + mTextEnabledColor(p.text_enabled_color()), + mTextDisabledColor(p.text_disabled_color()), + mFont(p.font()) { - if (font) - { - mFont = font; - } - else - { - mFont = LLFontGL::getFontSansSerifSmall(); - } + mViewModel->setValue(LLSD(p.initial_value)); + mViewModel->resetDirty(); + static LLUICachedControl<S32> llcheckboxctrl_spacing ("UICheckboxctrlSpacing", 0); + static LLUICachedControl<S32> llcheckboxctrl_hpad ("UICheckboxctrlHPad", 0); + static LLUICachedControl<S32> llcheckboxctrl_vpad ("UICheckboxctrlVPad", 0); + static LLUICachedControl<S32> llcheckboxctrl_btn_size ("UICheckboxctrlBtnSize", 0); // must be big enough to hold all children setUseBoundingRect(TRUE); - mKeyboardFocusOnClick = TRUE; - // Label (add a little space to make sure text actually renders) const S32 FUDGE = 10; - S32 text_width = mFont->getWidth( label ) + FUDGE; + S32 text_width = mFont->getWidth( p.label ) + FUDGE; S32 text_height = llround(mFont->getLineHeight()); LLRect label_rect; label_rect.setOriginAndSize( - LLCHECKBOXCTRL_HPAD + LLCHECKBOXCTRL_BTN_SIZE + LLCHECKBOXCTRL_SPACING, - LLCHECKBOXCTRL_VPAD + 1, // padding to get better alignment - text_width + LLCHECKBOXCTRL_HPAD, + llcheckboxctrl_hpad + llcheckboxctrl_btn_size + llcheckboxctrl_spacing, + llcheckboxctrl_vpad + 1, // padding to get better alignment + text_width + llcheckboxctrl_hpad, text_height ); // *HACK Get rid of this with SL-55508... // this allows blank check boxes and radio boxes for now - std::string local_label = label; + std::string local_label = p.label; if(local_label.empty()) { local_label = " "; } - mLabel = new LLTextBox( std::string("CheckboxCtrl Label"), label_rect, local_label, mFont ); - mLabel->setFollowsLeft(); - mLabel->setFollowsBottom(); + LLTextBox::Params tbparams = p.label_text; + tbparams.rect(label_rect); + tbparams.text(local_label); + if (p.font.isProvided()) + { + tbparams.font(p.font); + } + mLabel = LLUICtrlFactory::create<LLTextBox> (tbparams); + addChild(mLabel); // Button // Note: button cover the label by extending all the way to the right. LLRect btn_rect; btn_rect.setOriginAndSize( - LLCHECKBOXCTRL_HPAD, - LLCHECKBOXCTRL_VPAD, - LLCHECKBOXCTRL_BTN_SIZE + LLCHECKBOXCTRL_SPACING + text_width + LLCHECKBOXCTRL_HPAD, - llmax( text_height, LLCHECKBOXCTRL_BTN_SIZE ) + LLCHECKBOXCTRL_VPAD); + llcheckboxctrl_hpad, + llcheckboxctrl_vpad, + llcheckboxctrl_btn_size + llcheckboxctrl_spacing + text_width + llcheckboxctrl_hpad, + llmax( text_height, llcheckboxctrl_btn_size() ) + llcheckboxctrl_vpad); std::string active_true_id, active_false_id; std::string inactive_true_id, inactive_false_id; - if (mRadioStyle) - { - active_true_id = "UIImgRadioActiveSelectedUUID"; - active_false_id = "UIImgRadioActiveUUID"; - inactive_true_id = "UIImgRadioInactiveSelectedUUID"; - inactive_false_id = "UIImgRadioInactiveUUID"; - mButton = new LLButton(std::string("Radio control button"), btn_rect, - active_false_id, active_true_id, control_which, - &LLCheckBoxCtrl::onButtonPress, this, LLFontGL::getFontSansSerif() ); - mButton->setDisabledImages( inactive_false_id, inactive_true_id ); - mButton->setHoverGlowStrength(0.35f); - } - else - { - active_false_id = "UIImgCheckboxActiveUUID"; - active_true_id = "UIImgCheckboxActiveSelectedUUID"; - inactive_true_id = "UIImgCheckboxInactiveSelectedUUID"; - inactive_false_id = "UIImgCheckboxInactiveUUID"; - mButton = new LLButton(std::string("Checkbox control button"), btn_rect, - active_false_id, active_true_id, control_which, - &LLCheckBoxCtrl::onButtonPress, this, LLFontGL::getFontSansSerif() ); - mButton->setDisabledImages( inactive_false_id, inactive_true_id ); - mButton->setHoverGlowStrength(0.35f); - } - mButton->setIsToggle(TRUE); - mButton->setToggleState( initial_value ); - mButton->setFollowsLeft(); - mButton->setFollowsBottom(); - mButton->setCommitOnReturn(FALSE); + + LLButton::Params params = p.check_button; + params.rect(btn_rect); + //params.control_name(p.control_name); + params.click_callback.function(boost::bind(&LLCheckBoxCtrl::onButtonPress, this, _2)); + params.commit_on_return(false); + // Checkboxes only allow boolean initial values, but buttons can + // take any LLSD. + params.initial_value(LLSD(p.initial_value)); + params.follows.flags(FOLLOWS_LEFT | FOLLOWS_BOTTOM); + + mButton = LLUICtrlFactory::create<LLButton>(params); addChild(mButton); } @@ -154,24 +142,14 @@ LLCheckBoxCtrl::~LLCheckBoxCtrl() // static -void LLCheckBoxCtrl::onButtonPress( void *userdata ) +void LLCheckBoxCtrl::onButtonPress( const LLSD& data ) { - LLCheckBoxCtrl* self = (LLCheckBoxCtrl*) userdata; - - if (self->mRadioStyle) - { - self->setValue(TRUE); - } - - self->setControlValue(self->getValue()); - // HACK: because buttons don't normally commit - self->onCommit(); + //if (mRadioStyle) + //{ + // setValue(TRUE); + //} - if (self->mKeyboardFocusOnClick) - { - self->setFocus( TRUE ); - self->onFocusReceived(); - } + onCommit(); } void LLCheckBoxCtrl::onCommit() @@ -179,6 +157,7 @@ void LLCheckBoxCtrl::onCommit() if( getEnabled() ) { setTentative(FALSE); + setControlValue(getValue()); LLUICtrl::onCommit(); } } @@ -187,6 +166,15 @@ void LLCheckBoxCtrl::setEnabled(BOOL b) { LLView::setEnabled(b); mButton->setEnabled(b); + + if (b) + { + mLabel->setColor( mTextEnabledColor.get() ); + } + else + { + mLabel->setColor( mTextDisabledColor.get() ); + } } void LLCheckBoxCtrl::clear() @@ -197,43 +185,33 @@ void LLCheckBoxCtrl::clear() void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent) { //stretch or shrink bounding rectangle of label when rebuilding UI at new scale + static LLUICachedControl<S32> llcheckboxctrl_spacing ("UICheckboxctrlSpacing", 0); + static LLUICachedControl<S32> llcheckboxctrl_hpad ("UICheckboxctrlHPad", 0); + static LLUICachedControl<S32> llcheckboxctrl_vpad ("UICheckboxctrlVPad", 0); + static LLUICachedControl<S32> llcheckboxctrl_btn_size ("UICheckboxctrlBtnSize", 0); + const S32 FUDGE = 10; S32 text_width = mFont->getWidth( mLabel->getText() ) + FUDGE; S32 text_height = llround(mFont->getLineHeight()); LLRect label_rect; label_rect.setOriginAndSize( - LLCHECKBOXCTRL_HPAD + LLCHECKBOXCTRL_BTN_SIZE + LLCHECKBOXCTRL_SPACING, - LLCHECKBOXCTRL_VPAD, + llcheckboxctrl_hpad + llcheckboxctrl_btn_size + llcheckboxctrl_spacing, + llcheckboxctrl_vpad, text_width, text_height ); mLabel->setRect(label_rect); LLRect btn_rect; btn_rect.setOriginAndSize( - LLCHECKBOXCTRL_HPAD, - LLCHECKBOXCTRL_VPAD, - LLCHECKBOXCTRL_BTN_SIZE + LLCHECKBOXCTRL_SPACING + text_width, - llmax( text_height, LLCHECKBOXCTRL_BTN_SIZE ) ); + llcheckboxctrl_hpad, + llcheckboxctrl_vpad, + llcheckboxctrl_btn_size + llcheckboxctrl_spacing + text_width, + llmax( text_height, llcheckboxctrl_btn_size() ) ); mButton->setRect( btn_rect ); LLUICtrl::reshape(width, height, called_from_parent); } -void LLCheckBoxCtrl::draw() -{ - if (getEnabled()) - { - mLabel->setColor( mTextEnabledColor ); - } - else - { - mLabel->setColor( mTextDisabledColor ); - } - - // Draw children - LLUICtrl::draw(); -} - //virtual void LLCheckBoxCtrl::setValue(const LLSD& value ) { @@ -246,6 +224,18 @@ LLSD LLCheckBoxCtrl::getValue() const return mButton->getValue(); } +//virtual +void LLCheckBoxCtrl::setTentative(BOOL b) +{ + mButton->setTentative(b); +} + +//virtual +BOOL LLCheckBoxCtrl::getTentative() const +{ + return mButton->getTentative(); +} + void LLCheckBoxCtrl::setLabel( const LLStringExplicit& label ) { mLabel->setText( label ); @@ -264,12 +254,6 @@ BOOL LLCheckBoxCtrl::setLabelArg( const std::string& key, const LLStringExplicit return res; } -//virtual -std::string LLCheckBoxCtrl::getControlName() const -{ - return mButton->getControlName(); -} - // virtual void LLCheckBoxCtrl::setControlName(const std::string& control_name, LLView* context) { @@ -282,7 +266,7 @@ BOOL LLCheckBoxCtrl::isDirty() const { if ( mButton ) { - return (mSetValue != mButton->getToggleState()); + return mButton->isDirty(); } return FALSE; // Shouldn't get here } @@ -293,78 +277,6 @@ void LLCheckBoxCtrl::resetDirty() { if ( mButton ) { - mSetValue = mButton->getToggleState(); - } -} - - - -// virtual -LLXMLNodePtr LLCheckBoxCtrl::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - node->createChild("label", TRUE)->setStringValue(mLabel->getText()); - - std::string control_name = mButton->getControlName(); - - node->createChild("initial_value", TRUE)->setBoolValue(mInitialValue); - - node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mFont)); - - node->createChild("radio_style", TRUE)->setBoolValue(mRadioStyle); - - return node; -} - -// static -LLView* LLCheckBoxCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("checkbox"); - node->getAttributeString("name", name); - - std::string label(""); - node->getAttributeString("label", label); - - LLFontGL* font = LLView::selectFont(node); - - BOOL radio_style = FALSE; - node->getAttributeBOOL("radio_style", radio_style); - - LLUICtrlCallback callback = NULL; - - if (label.empty()) - { - label.assign(node->getTextContents()); + mButton->resetDirty(); } - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - LLCheckBoxCtrl* checkbox = new LLCheckboxCtrl(name, - rect, - label, - font, - callback, - NULL, - FALSE, - radio_style); // if true, draw radio button style icons - - BOOL initial_value = checkbox->getValue().asBoolean(); - node->getAttributeBOOL("initial_value", initial_value); - - LLColor4 color; - color = LLUI::sColorsGroup->getColor( "LabelTextColor" ); - LLUICtrlFactory::getAttributeColor(node,"text_enabled_color", color); - checkbox->setEnabledColor(color); - - color = LLUI::sColorsGroup->getColor( "LabelDisabledColor" ); - LLUICtrlFactory::getAttributeColor(node,"text_disabled_color", color); - checkbox->setDisabledColor(color); - - checkbox->setValue(initial_value); - - checkbox->initFromXML(node, parent); - - return checkbox; } diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h index ff867f5193cbf0accfa6023cc7b81d885433447c..fe719e3b6a1be5dba4b7945c9eb01bd0125b616f 100644 --- a/indra/llui/llcheckboxctrl.h +++ b/indra/llui/llcheckboxctrl.h @@ -33,24 +33,14 @@ #ifndef LL_LLCHECKBOXCTRL_H #define LL_LLCHECKBOXCTRL_H - -#include "stdtypes.h" #include "lluictrl.h" #include "llbutton.h" +#include "lltextbox.h" #include "v4color.h" -#include "llrect.h" // // Constants // -const S32 LLCHECKBOXCTRL_BTN_SIZE = 13; -const S32 LLCHECKBOXCTRL_VPAD = 2; -const S32 LLCHECKBOXCTRL_HPAD = 2; -const S32 LLCHECKBOXCTRL_SPACING = 5; -const S32 LLCHECKBOXCTRL_HEIGHT = 16; - -// Deprecated, don't use. -#define CHECKBOXCTRL_HEIGHT LLCHECKBOXCTRL_HEIGHT const BOOL RADIO_STYLE = TRUE; const BOOL CHECK_STYLE = FALSE; @@ -59,30 +49,38 @@ const BOOL CHECK_STYLE = FALSE; // Classes // class LLFontGL; -class LLTextBox; class LLViewBorder; class LLCheckBoxCtrl : public LLUICtrl { public: - LLCheckBoxCtrl(const std::string& name, const LLRect& rect, const std::string& label, - const LLFontGL* font = NULL, - void (*commit_callback)(LLUICtrl*, void*) = NULL, - void* callback_userdata = NULL, - BOOL initial_value = FALSE, - BOOL use_radio_style = FALSE, // if true, draw radio button style icons - const std::string& control_which = LLStringUtil::null); + struct Params + : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<LLUIColor> text_enabled_color; + Optional<LLUIColor> text_disabled_color; + Optional<bool> initial_value; // override LLUICtrl initial_value + + Optional<LLTextBox::Params> label_text; + Optional<LLButton::Params> check_button; + + Deprecated radio_style; + + Params(); + }; + virtual ~LLCheckBoxCtrl(); - // LLView interface +protected: + LLCheckBoxCtrl(const Params&); + friend class LLUICtrlFactory; - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); +public: + // LLView interface virtual void setEnabled( BOOL b ); - virtual void draw(); virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); // LLUICtrl interface @@ -91,8 +89,8 @@ public: BOOL get() { return (BOOL)getValue().asBoolean(); } void set(BOOL value) { setValue(value); } - virtual void setTentative(BOOL b) { mButton->setTentative(b); } - virtual BOOL getTentative() const { return mButton->getTentative(); } + virtual void setTentative(BOOL b); + virtual BOOL getTentative() const; virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); @@ -108,10 +106,11 @@ public: void setLabel( const LLStringExplicit& label ); std::string getLabel() const; + void setFont( const LLFontGL* font ) { mFont = font; } + virtual void setControlName(const std::string& control_name, LLView* context); - virtual std::string getControlName() const; - static void onButtonPress(void *userdata); + void onButtonPress(const LLSD& data); virtual BOOL isDirty() const; // Returns TRUE if the user has modified this control. virtual void resetDirty(); // Clear dirty state @@ -121,19 +120,17 @@ protected: LLButton* mButton; LLTextBox* mLabel; const LLFontGL* mFont; - LLColor4 mTextEnabledColor; - LLColor4 mTextDisabledColor; - BOOL mRadioStyle; - BOOL mInitialValue; // Value set in constructor - BOOL mSetValue; // Value set programmatically - BOOL mKeyboardFocusOnClick; - LLViewBorder* mBorder; -}; + LLUIColor mTextEnabledColor; + LLUIColor mTextDisabledColor; +}; -// HACK: fix old capitalization problem -//typedef LLCheckBoxCtrl LLCheckboxCtrl; -#define LLCheckboxCtrl LLCheckBoxCtrl +#ifdef LL_WINDOWS +#ifndef INSTANTIATE_GETCHILD_CHECKBOX +#pragma warning (disable : 4231) +extern template LLCheckBoxCtrl* LLView::getChild<LLCheckBoxCtrl>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const; +#endif +#endif #endif // LL_LLCHECKBOXCTRL_H diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 28a05c13f5519f7a145715dffbe5e3bcf1ed1541..2197d5432be5363863ad005fa3983243a68a8526 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -33,6 +33,8 @@ // A control that displays the name of the chosen item, which when // clicked shows a scrolling box of options. +#define INSTANTIATE_GETCHILD_COMBOBOX + #include "linden_common.h" // file includes @@ -48,167 +50,129 @@ #include "llwindow.h" #include "llfloater.h" #include "llscrollbar.h" +#include "llscrolllistcell.h" +#include "llscrolllistitem.h" #include "llcontrol.h" #include "llfocusmgr.h" #include "lllineeditor.h" #include "v2math.h" +#include "lluictrlfactory.h" // Globals S32 LLCOMBOBOX_HEIGHT = 0; S32 LLCOMBOBOX_WIDTH = 0; S32 MAX_COMBO_WIDTH = 500; -static LLRegisterWidget<LLComboBox> r1("combo_box"); +template LLComboBox* LLView::getChild<LLComboBox>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const; -LLComboBox::LLComboBox( const std::string& name, const LLRect &rect, const std::string& label, - void (*commit_callback)(LLUICtrl*,void*), - void *callback_userdata - ) -: LLUICtrl(name, rect, TRUE, commit_callback, callback_userdata, - FOLLOWS_LEFT | FOLLOWS_TOP), - mTextEntry(NULL), - mArrowImage(NULL), - mAllowTextEntry(FALSE), - mMaxChars(20), - mTextEntryTentative(TRUE), - mListPosition(BELOW), - mPrearrangeCallback( NULL ), - mTextEntryCallback( NULL ), - mLabel(label) -{ - // Always use text box - // Text label button - mButton = new LLButton(mLabel, - LLRect(), - LLStringUtil::null, - NULL, this); - mButton->setImageUnselected(std::string("square_btn_32x128.tga")); - mButton->setImageSelected(std::string("square_btn_selected_32x128.tga")); - mButton->setImageDisabled(std::string("square_btn_32x128.tga")); - mButton->setImageDisabledSelected(std::string("square_btn_selected_32x128.tga")); - mButton->setScaleImage(TRUE); - - mButton->setMouseDownCallback(onButtonDown); - mButton->setFont(LLFontGL::getFontSansSerifSmall()); - mButton->setFollows(FOLLOWS_LEFT | FOLLOWS_BOTTOM | FOLLOWS_RIGHT); - mButton->setHAlign( LLFontGL::LEFT ); - mButton->setRightHPad(2); - addChild(mButton); +static LLDefaultWidgetRegistry::Register<LLComboBox> register_combo_box("combo_box"); - // disallow multiple selection - mList = new LLScrollListCtrl(std::string("ComboBox"), LLRect(), - &LLComboBox::onItemSelected, this, FALSE); - mList->setVisible(FALSE); - mList->setBgWriteableColor( LLColor4(1,1,1,1) ); - mList->setCommitOnKeyboardMovement(FALSE); - addChild(mList); - - mArrowImage = LLUI::sImageProvider->getUIImage("combobox_arrow.tga"); - mButton->setImageOverlay("combobox_arrow.tga", LLFontGL::RIGHT); +void LLComboBox::PreferredPositionValues::declareValues() +{ + declare("above", ABOVE); + declare("below", BELOW); +} - updateLayout(); +LLComboBox::ItemParams::ItemParams() +: label("label") +{ } -LLComboBox::~LLComboBox() +LLComboBox::Params::Params() +: allow_text_entry("allow_text_entry", false), + show_text_as_tentative("show_text_as_tentative", true), + max_chars("max_chars", 20), + arrow_image("arrow_image"), + list_position("list_position", BELOW), + items("item"), + combo_button("combo_button"), + combo_list("combo_list"), + combo_editor("combo_editor") { - // children automatically deleted, including mMenu, mButton + addSynonym(items, "combo_item"); } -// virtual -LLXMLNodePtr LLComboBox::getXML(bool save_children) const + +LLComboBox::LLComboBox(const LLComboBox::Params& p) +: LLUICtrl(p), + mTextEntry(NULL), + mTextEntryTentative(p.show_text_as_tentative), + mHasAutocompletedText(false), + mAllowTextEntry(p.allow_text_entry), + mMaxChars(p.max_chars), + mPrearrangeCallback(p.prearrange_callback()), + mTextEntryCallback(p.text_entry_callback()), + mSelectionCallback(p.selection_callback()), + mArrowImage(p.arrow_image), + mListPosition(p.list_position) { - LLXMLNodePtr node = LLUICtrl::getXML(); + // Text label button - // Attributes + LLButton::Params button_params = p.combo_button; + button_params.mouse_down_callback.function(boost::bind(&LLComboBox::onButtonDown, this)); + button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT); + button_params.rect(p.rect); + button_params.pad_right(2); - node->createChild("allow_text_entry", TRUE)->setBoolValue(mAllowTextEntry); + mButton = LLUICtrlFactory::create<LLButton>(button_params); + mButton->setRightHPad(2); //redo to compensate for button hack that leaves space for a character + addChild(mButton); - node->createChild("max_chars", TRUE)->setIntValue(mMaxChars); + LLScrollListCtrl::Params params = p.combo_list; + params.name("ComboBox"); + params.commit_callback.function(boost::bind(&LLComboBox::onItemSelected, this, _2)); + params.visible(false); + params.commit_on_keyboard_movement(false); - // Contents + mList = LLUICtrlFactory::create<LLScrollListCtrl>(params); + addChild(mList); - std::vector<LLScrollListItem*> data_list = mList->getAllData(); - std::vector<LLScrollListItem*>::iterator data_itor; - for (data_itor = data_list.begin(); data_itor != data_list.end(); ++data_itor) + for (LLInitParam::ParamIterator<ItemParams>::const_iterator it = p.items().begin(); + it != p.items().end(); + ++it) { - LLScrollListItem* item = *data_itor; - LLScrollListCell* cell = item->getColumn(0); - if (cell) + LLScrollListItem::Params item_params = *it; + if (it->label.isProvided()) { - LLXMLNodePtr item_node = node->createChild("combo_item", FALSE); - LLSD value = item->getValue(); - item_node->createChild("value", TRUE)->setStringValue(value.asString()); - item_node->createChild("enabled", TRUE)->setBoolValue(item->getEnabled()); - item_node->setStringValue(cell->getValue().asString()); + item_params.cells.add().value(it->label()); } + + mList->addRow(item_params); } - return node; + createLineEditor(p); + + setTopLostCallback(boost::bind(&LLComboBox::hideList, this)); } -// static -LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) +void LLComboBox::initFromParams(const LLComboBox::Params& p) { - std::string name("combo_box"); - node->getAttributeString("name", name); + LLUICtrl::initFromParams(p); - std::string label(""); - node->getAttributeString("label", label); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - BOOL allow_text_entry = FALSE; - node->getAttributeBOOL("allow_text_entry", allow_text_entry); - - S32 max_chars = 20; - node->getAttributeS32("max_chars", max_chars); - - LLUICtrlCallback callback = NULL; - - LLComboBox* combo_box = new LLComboBox(name, - rect, - label, - callback, - NULL); - combo_box->setAllowTextEntry(allow_text_entry, max_chars); - - combo_box->initFromXML(node, parent); - - const std::string& contents = node->getValue(); - - if (contents.find_first_not_of(" \n\t") != contents.npos) - { - llerrs << "Legacy combo box item format used! Please convert to <combo_item> tags!" << llendl; - } - else + if (!acceptsTextInput() && mLabel.empty()) { - LLXMLNodePtr child; - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) - { - if (child->hasName("combo_item")) - { - std::string label = child->getTextContents(); - - std::string value = label; - child->getAttributeString("value", value); - - combo_box->add(label, LLSD(value) ); - } - } + selectFirstItem(); } +} - // if providing user text entry or descriptive label - // don't select an item under the hood - if (!combo_box->acceptsTextInput() && combo_box->mLabel.empty()) +// virtual +BOOL LLComboBox::postBuild() +{ + if (mControlVariable) { - combo_box->selectFirstItem(); + setValue(mControlVariable->getValue()); // selects the appropriate item } + return TRUE; +} - return combo_box; + +LLComboBox::~LLComboBox() +{ + // children automatically deleted, including mMenu, mButton } + void LLComboBox::setEnabled(BOOL enabled) { LLView::setEnabled(enabled); @@ -237,6 +201,7 @@ void LLComboBox::onCommit() mTextEntry->setValue(getSimple()); mTextEntry->setTentative(FALSE); } + setControlValue(getValue()); LLUICtrl::onCommit(); } @@ -431,6 +396,7 @@ BOOL LLComboBox::remove(S32 index) if (index < mList->getItemCount()) { mList->deleteSingleItem(index); + setLabel(mList->getSelectedItemLabel()); return TRUE; } return FALSE; @@ -448,21 +414,17 @@ void LLComboBox::onFocusLost() LLUICtrl::onFocusLost(); } -void LLComboBox::onLostTop() -{ - hideList(); -} - - void LLComboBox::setButtonVisible(BOOL visible) { + static LLUICachedControl<S32> drop_shadow_button ("DropShadowButton", 0); + mButton->setVisible(visible); if (mTextEntry) { LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0); if (visible) { - text_entry_rect.mRight -= llmax(8,mArrowImage->getWidth()) + 2 * LLUI::sConfigGroup->getS32("DropShadowButton"); + text_entry_rect.mRight -= llmax(8,mArrowImage->getWidth()) + 2 * drop_shadow_button; } //mTextEntry->setRect(text_entry_rect); mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), TRUE); @@ -498,54 +460,47 @@ S32 LLComboBox::getCurrentIndex() const } -void LLComboBox::updateLayout() +void LLComboBox::createLineEditor(const LLComboBox::Params& p) { + static LLUICachedControl<S32> drop_shadow_button ("DropShadowButton", 0); LLRect rect = getLocalRect(); if (mAllowTextEntry) { - S32 shadow_size = LLUI::sConfigGroup->getS32("DropShadowButton"); + S32 shadow_size = drop_shadow_button; mButton->setRect(LLRect( getRect().getWidth() - llmax(8,mArrowImage->getWidth()) - 2 * shadow_size, rect.mTop, rect.mRight, rect.mBottom)); mButton->setTabStop(FALSE); + mButton->setHAlign(LLFontGL::HCENTER); - if (!mTextEntry) - { - LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0); - text_entry_rect.mRight -= llmax(8,mArrowImage->getWidth()) + 2 * LLUI::sConfigGroup->getS32("DropShadowButton"); - // clear label on button - std::string cur_label = mButton->getLabelSelected(); - mTextEntry = new LLLineEditor(std::string("combo_text_entry"), - text_entry_rect, - LLStringUtil::null, - LLFontGL::getFontSansSerifSmall(), - mMaxChars, - onTextCommit, - onTextEntry, - NULL, - this); - mTextEntry->setSelectAllonFocusReceived(TRUE); - mTextEntry->setHandleEditKeysDirectly(TRUE); - mTextEntry->setCommitOnFocusLost(FALSE); - mTextEntry->setText(cur_label); - mTextEntry->setIgnoreTab(TRUE); - mTextEntry->setFollowsAll(); - addChild(mTextEntry); - } - else - { - mTextEntry->setVisible(TRUE); - mTextEntry->setMaxTextLength(mMaxChars); - } + LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0); + text_entry_rect.mRight -= llmax(8,mArrowImage->getWidth()) + 2 * drop_shadow_button; + // clear label on button + std::string cur_label = mButton->getLabelSelected(); + LLLineEditor::Params params = p.combo_editor; + params.rect(text_entry_rect); + params.default_text(LLStringUtil::null); + params.max_length_bytes(mMaxChars); + params.commit_callback.function(boost::bind(&LLComboBox::onTextCommit, this, _2)); + params.keystroke_callback(boost::bind(&LLComboBox::onTextEntry, this, _1)); + params.focus_lost_callback(NULL); + params.handle_edit_keys_directly(true); + params.commit_on_focus_lost(false); + params.follows.flags(FOLLOWS_ALL); + mTextEntry = LLUICtrlFactory::create<LLLineEditor> (params); + mTextEntry->setText(cur_label); + mTextEntry->setIgnoreTab(TRUE); + addChild(mTextEntry); // clear label on button setLabel(LLStringUtil::null); mButton->setFollows(FOLLOWS_BOTTOM | FOLLOWS_TOP | FOLLOWS_RIGHT); } - else if (!mAllowTextEntry) + else { mButton->setRect(rect); mButton->setTabStop(TRUE); + mButton->setHAlign(LLFontGL::LEFT); if (mTextEntry) { @@ -672,7 +627,7 @@ void LLComboBox::hideList() mButton->setToggleState(FALSE); mList->setVisible(FALSE); - mList->highlightNthItem(-1); + mList->mouseOverHighlightNthItem(-1); setUseBoundingRect(FALSE); if( gFocusMgr.getTopCtrl() == this ) @@ -681,74 +636,71 @@ void LLComboBox::hideList() } } -//------------------------------------------------------------------ -// static functions -//------------------------------------------------------------------ - -// static -void LLComboBox::onButtonDown(void *userdata) +void LLComboBox::onButtonDown() { - LLComboBox *self = (LLComboBox *)userdata; - - if (!self->mList->getVisible()) + if (!mList->getVisible()) { - LLScrollListItem* last_selected_item = self->mList->getLastSelectedItem(); + LLScrollListItem* last_selected_item = mList->getLastSelectedItem(); if (last_selected_item) { // highlight the original selection before potentially selecting a new item - self->mList->highlightNthItem(self->mList->getItemIndex(last_selected_item)); + mList->mouseOverHighlightNthItem(mList->getItemIndex(last_selected_item)); } - if( self->mPrearrangeCallback ) - { - self->mPrearrangeCallback( self, self->mCallbackUserData ); - } + prearrangeList(); - if (self->mList->getItemCount() != 0) + if (mList->getItemCount() != 0) { - self->showList(); + showList(); } - self->setFocus( TRUE ); + setFocus( TRUE ); // pass mouse capture on to list if button is depressed - if (self->mButton->hasMouseCapture()) + if (mButton->hasMouseCapture()) { - gFocusMgr.setMouseCapture(self->mList); + gFocusMgr.setMouseCapture(mList); } } else { - self->hideList(); + hideList(); } } -// static -void LLComboBox::onItemSelected(LLUICtrl* item, void *userdata) -{ - // Note: item is the LLScrollListCtrl - LLComboBox *self = (LLComboBox *) userdata; - const std::string name = self->mList->getSelectedItemLabel(); +//------------------------------------------------------------------ +// static functions +//------------------------------------------------------------------ + +void LLComboBox::onItemSelected(const LLSD& data) +{ + const std::string name = mList->getSelectedItemLabel(); - S32 cur_id = self->getCurrentIndex(); + S32 cur_id = getCurrentIndex(); if (cur_id != -1) { - self->setLabel(name); + setLabel(name); - if (self->mAllowTextEntry) + if (mAllowTextEntry) { - gFocusMgr.setKeyboardFocus(self->mTextEntry); - self->mTextEntry->selectAll(); + gFocusMgr.setKeyboardFocus(mTextEntry); + mTextEntry->selectAll(); } } // hiding the list reasserts the old value stored in the text editor/dropdown button - self->hideList(); + hideList(); // commit does the reverse, asserting the value in the list - self->onCommit(); + onCommit(); + + // call the callback if it exists + if(mSelectionCallback) + { + mSelectionCallback(this, data); + } } BOOL LLComboBox::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) @@ -804,7 +756,7 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask) if (last_selected_item) { // highlight the original selection before potentially selecting a new item - mList->highlightNthItem(mList->getItemIndex(last_selected_item)); + mList->mouseOverHighlightNthItem(mList->getItemIndex(last_selected_item)); } result = mList->handleKeyHere(key, mask); @@ -838,7 +790,7 @@ BOOL LLComboBox::handleUnicodeCharHere(llwchar uni_char) if (last_selected_item) { // highlight the original selection before potentially selecting a new item - mList->highlightNthItem(mList->getItemIndex(last_selected_item)); + mList->mouseOverHighlightNthItem(mList->getItemIndex(last_selected_item)); } result = mList->handleUnicodeCharHere(uni_char); if (mList->getLastSelectedItem() != last_selected_item) @@ -850,46 +802,35 @@ BOOL LLComboBox::handleUnicodeCharHere(llwchar uni_char) return result; } -void LLComboBox::setAllowTextEntry(BOOL allow, S32 max_chars, BOOL set_tentative) -{ - mAllowTextEntry = allow; - mTextEntryTentative = set_tentative; - mMaxChars = max_chars; - - updateLayout(); -} - void LLComboBox::setTextEntry(const LLStringExplicit& text) { if (mTextEntry) { mTextEntry->setText(text); + mHasAutocompletedText = FALSE; updateSelection(); } } -//static -void LLComboBox::onTextEntry(LLLineEditor* line_editor, void* user_data) +void LLComboBox::onTextEntry(LLLineEditor* line_editor) { - LLComboBox* self = (LLComboBox*)user_data; - - if (self->mTextEntryCallback) + if (mTextEntryCallback != NULL) { - (*self->mTextEntryCallback)(line_editor, self->mCallbackUserData); + (mTextEntryCallback)(line_editor, LLSD()); } KEY key = gKeyboard->currentKey(); if (key == KEY_BACKSPACE || key == KEY_DELETE) { - if (self->mList->selectItemByLabel(line_editor->getText(), FALSE)) + if (mList->selectItemByLabel(line_editor->getText(), FALSE)) { line_editor->setTentative(FALSE); } else { - line_editor->setTentative(self->mTextEntryTentative); - self->mList->deselectAllItems(); + line_editor->setTentative(mTextEntryTentative); + mList->deselectAllItems(); } return; } @@ -902,17 +843,14 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor, void* user_data) if (key == KEY_DOWN) { - self->setCurrentByIndex(llmin(self->getItemCount() - 1, self->getCurrentIndex() + 1)); - if (!self->mList->getVisible()) + setCurrentByIndex(llmin(getItemCount() - 1, getCurrentIndex() + 1)); + if (!mList->getVisible()) { - if( self->mPrearrangeCallback ) - { - self->mPrearrangeCallback( self, self->mCallbackUserData ); - } + prearrangeList(); - if (self->mList->getItemCount() != 0) + if (mList->getItemCount() != 0) { - self->showList(); + showList(); } } line_editor->selectAll(); @@ -920,17 +858,14 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor, void* user_data) } else if (key == KEY_UP) { - self->setCurrentByIndex(llmax(0, self->getCurrentIndex() - 1)); - if (!self->mList->getVisible()) + setCurrentByIndex(llmax(0, getCurrentIndex() - 1)); + if (!mList->getVisible()) { - if( self->mPrearrangeCallback ) - { - self->mPrearrangeCallback( self, self->mCallbackUserData ); - } + prearrangeList(); - if (self->mList->getItemCount() != 0) + if (mList->getItemCount() != 0) { - self->showList(); + showList(); } } line_editor->selectAll(); @@ -939,7 +874,7 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor, void* user_data) else { // RN: presumably text entry - self->updateSelection(); + updateSelection(); } } @@ -948,7 +883,7 @@ void LLComboBox::updateSelection() LLWString left_wstring = mTextEntry->getWText().substr(0, mTextEntry->getCursor()); // user-entered portion of string, based on assumption that any selected // text was a result of auto-completion - LLWString user_wstring = mTextEntry->hasSelection() ? left_wstring : mTextEntry->getWText(); + LLWString user_wstring = mHasAutocompletedText ? left_wstring : mTextEntry->getWText(); std::string full_string = mTextEntry->getText(); // go ahead and arrange drop down list on first typed character, even @@ -956,23 +891,14 @@ void LLComboBox::updateSelection() // callback to populate content if( mTextEntry->getWText().size() == 1 ) { - if (mPrearrangeCallback) - { - mPrearrangeCallback( this, mCallbackUserData ); - } + prearrangeList(mTextEntry->getText()); } if (mList->selectItemByLabel(full_string, FALSE)) { mTextEntry->setTentative(FALSE); } - else if (!mList->selectItemByPrefix(left_wstring, FALSE)) - { - mList->deselectAllItems(); - mTextEntry->setText(wstring_to_utf8str(user_wstring)); - mTextEntry->setTentative(mTextEntryTentative); - } - else + else if (mList->selectItemByPrefix(left_wstring, FALSE)) { LLWString selected_item = utf8str_to_wstring(mList->getSelectedItemLabel()); LLWString wtext = left_wstring + selected_item.substr(left_wstring.size(), selected_item.size()); @@ -980,17 +906,23 @@ void LLComboBox::updateSelection() mTextEntry->setSelection(left_wstring.size(), mTextEntry->getWText().size()); mTextEntry->endSelection(); mTextEntry->setTentative(FALSE); + mHasAutocompletedText = TRUE; + } + else // no matching items found + { + mList->deselectAllItems(); + mTextEntry->setText(wstring_to_utf8str(user_wstring)); // removes text added by autocompletion + mTextEntry->setTentative(mTextEntryTentative); + mHasAutocompletedText = FALSE; } } -//static -void LLComboBox::onTextCommit(LLUICtrl* caller, void* user_data) +void LLComboBox::onTextCommit(const LLSD& data) { - LLComboBox* self = (LLComboBox*)user_data; - std::string text = self->mTextEntry->getText(); - self->setSimple(text); - self->onCommit(); - self->mTextEntry->selectAll(); + std::string text = mTextEntry->getText(); + setSimple(text); + onCommit(); + mTextEntry->selectAll(); } void LLComboBox::setFocus(BOOL b) @@ -1007,6 +939,14 @@ void LLComboBox::setFocus(BOOL b) } } +void LLComboBox::prearrangeList(std::string filter) +{ + if (mPrearrangeCallback) + { + mPrearrangeCallback(this, LLSD(filter)); + } +} + //============================================================================ // LLCtrlListInterface functions @@ -1114,155 +1054,3 @@ BOOL LLComboBox::selectItemRange( S32 first, S32 last ) { return mList->selectItemRange(first, last); } - - -// -// LLFlyoutButton -// - -static LLRegisterWidget<LLFlyoutButton> r2("flyout_button"); - -const S32 FLYOUT_BUTTON_ARROW_WIDTH = 24; - -LLFlyoutButton::LLFlyoutButton( - const std::string& name, - const LLRect &rect, - const std::string& label, - void (*commit_callback)(LLUICtrl*, void*) , - void *callback_userdata) -: LLComboBox(name, rect, LLStringUtil::null, commit_callback, callback_userdata), - mToggleState(FALSE), - mActionButton(NULL) -{ - // Always use text box - // Text label button - mActionButton = new LLButton(label, - LLRect(), LLStringUtil::null, NULL, this); - mActionButton->setScaleImage(TRUE); - - mActionButton->setClickedCallback(onActionButtonClick); - mActionButton->setFollowsAll(); - mActionButton->setHAlign( LLFontGL::HCENTER ); - mActionButton->setLabel(label); - addChild(mActionButton); - - mActionButtonImage = LLUI::getUIImage("flyout_btn_left.tga"); - mExpanderButtonImage = LLUI::getUIImage("flyout_btn_right.tga"); - mActionButtonImageSelected = LLUI::getUIImage("flyout_btn_left_selected.tga"); - mExpanderButtonImageSelected = LLUI::getUIImage("flyout_btn_right_selected.tga"); - mActionButtonImageDisabled = LLUI::getUIImage("flyout_btn_left_disabled.tga"); - mExpanderButtonImageDisabled = LLUI::getUIImage("flyout_btn_right_disabled.tga"); - - mActionButton->setImageSelected(mActionButtonImageSelected); - mActionButton->setImageUnselected(mActionButtonImage); - mActionButton->setImageDisabled(mActionButtonImageDisabled); - mActionButton->setImageDisabledSelected(LLPointer<LLUIImage>(NULL)); - - mButton->setImageSelected(mExpanderButtonImageSelected); - mButton->setImageUnselected(mExpanderButtonImage); - mButton->setImageDisabled(mExpanderButtonImageDisabled); - mButton->setImageDisabledSelected(LLPointer<LLUIImage>(NULL)); - mButton->setRightHPad(6); - - updateLayout(); -} - -//static -LLView* LLFlyoutButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name = "flyout_button"; - node->getAttributeString("name", name); - - std::string label(""); - node->getAttributeString("label", label); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - LLUICtrlCallback callback = NULL; - - LLFlyoutButton* flyout_button = new LLFlyoutButton(name, - rect, - label, - callback, - NULL); - - std::string list_position; - node->getAttributeString("list_position", list_position); - if (list_position == "below") - { - flyout_button->mListPosition = BELOW; - } - else if (list_position == "above") - { - flyout_button->mListPosition = ABOVE; - } - - - flyout_button->initFromXML(node, parent); - - LLXMLNodePtr child; - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) - { - if (child->hasName("flyout_button_item")) - { - std::string label = child->getTextContents(); - - std::string value = label; - child->getAttributeString("value", value); - - flyout_button->add(label, LLSD(value) ); - } - } - - flyout_button->updateLayout(); - - return flyout_button; -} - -void LLFlyoutButton::updateLayout() -{ - LLComboBox::updateLayout(); - - mButton->setOrigin(getRect().getWidth() - FLYOUT_BUTTON_ARROW_WIDTH, 0); - mButton->reshape(FLYOUT_BUTTON_ARROW_WIDTH, getRect().getHeight()); - mButton->setFollows(FOLLOWS_RIGHT | FOLLOWS_TOP | FOLLOWS_BOTTOM); - mButton->setTabStop(FALSE); - mButton->setImageOverlay(mListPosition == BELOW ? "down_arrow.tga" : "up_arrow.tga", LLFontGL::RIGHT); - - mActionButton->setOrigin(0, 0); - mActionButton->reshape(getRect().getWidth() - FLYOUT_BUTTON_ARROW_WIDTH, getRect().getHeight()); -} - -//static -void LLFlyoutButton::onActionButtonClick(void *user_data) -{ - LLFlyoutButton* buttonp = (LLFlyoutButton*)user_data; - // remember last list selection? - buttonp->mList->deselect(); - buttonp->onCommit(); -} - -void LLFlyoutButton::draw() -{ - mActionButton->setToggleState(mToggleState); - mButton->setToggleState(mToggleState); - - //FIXME: this should be an attribute of comboboxes, whether they have a distinct label or - // the label reflects the last selected item, for now we have to manually remove the label - mButton->setLabel(LLStringUtil::null); - LLComboBox::draw(); -} - -void LLFlyoutButton::setEnabled(BOOL enabled) -{ - mActionButton->setEnabled(enabled); - LLComboBox::setEnabled(enabled); -} - - -void LLFlyoutButton::setToggleState(BOOL state) -{ - mToggleState = state; -} - diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index 33e1baa748945256aa6abbf9b6a7d42232bc81ab..bc98690a015f5c80a58f07f4af2485dc7940dbae 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -41,14 +41,13 @@ #include "llctrlselectioninterface.h" #include "llimagegl.h" #include "llrect.h" +#include "llscrolllistctrl.h" +#include "lllineeditor.h" +#include <boost/function.hpp> // Classes class LLFontGL; -class LLButton; -class LLSquareButton; -class LLScrollListCtrl; -class LLLineEditor; class LLViewBorder; extern S32 LLCOMBOBOX_HEIGHT; @@ -57,30 +56,62 @@ extern S32 LLCOMBOBOX_WIDTH; class LLComboBox : public LLUICtrl, public LLCtrlListInterface { -public: +public: typedef enum e_preferred_position { ABOVE, BELOW } EPreferredPosition; - LLComboBox( - const std::string& name, - const LLRect &rect, - const std::string& label, - void (*commit_callback)(LLUICtrl*, void*) = NULL, - void *callback_userdata = NULL - ); - virtual ~LLComboBox(); + struct PreferredPositionValues : public LLInitParam::TypeValuesHelper<EPreferredPosition, PreferredPositionValues> + { + static void declareValues(); + }; - // LLView interface - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); + struct ItemParams : public LLInitParam::Block<ItemParams, LLScrollListItem::Params> + { + Optional<std::string> label; + ItemParams(); + }; + + struct Params + : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<bool> allow_text_entry, + show_text_as_tentative; + Optional<S32> max_chars; + Optional<commit_callback_t> prearrange_callback, + text_entry_callback, + selection_callback; + Optional<LLUIImage*> arrow_image; + + Optional<EPreferredPosition, PreferredPositionValues> list_position; + + // components + Optional<LLButton::Params> combo_button; + Optional<LLScrollListCtrl::Params> combo_list; + Optional<LLLineEditor::Params> combo_editor; + + Multiple<ItemParams> items; + + Params(); + }; + + virtual ~LLComboBox(); + /*virtual*/ BOOL postBuild(); + +protected: + friend class LLUICtrlFactory; + LLComboBox(const Params&); + void initFromParams(const Params&); + void prearrangeList(std::string filter = ""); + +public: + // LLView interface virtual void draw(); virtual void onFocusLost(); - virtual void onLostTop(); virtual void setEnabled(BOOL enabled); @@ -105,7 +136,6 @@ public: // items, this is just the label. virtual LLSD getValue() const; - void setAllowTextEntry(BOOL allow, S32 max_chars = 50, BOOL make_tentative = TRUE); void setTextEntry(const LLStringExplicit& text); LLScrollListItem* add(const std::string& name, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); // add item "name" to menu @@ -134,7 +164,7 @@ public: BOOL setCurrentByIndex( S32 index ); S32 getCurrentIndex() const; - virtual void updateLayout(); + void createLineEditor(const Params&); //======================================================================== LLCtrlSelectionInterface* getSelectionInterface() { return (LLCtrlSelectionInterface*)this; }; @@ -170,66 +200,45 @@ public: void* getCurrentUserdata(); - void setPrearrangeCallback( void (*cb)(LLUICtrl*,void*) ) { mPrearrangeCallback = cb; } - void setTextEntryCallback( void (*cb)(LLLineEditor*, void*) ) { mTextEntryCallback = cb; } + void setPrearrangeCallback( commit_callback_t cb ) { mPrearrangeCallback = cb; } + void setTextEntryCallback( commit_callback_t cb ) { mTextEntryCallback = cb; } + void setSelectionCallback( commit_callback_t cb ) { mSelectionCallback = cb; } void setButtonVisible(BOOL visible); - static void onButtonDown(void *userdata); - static void onItemSelected(LLUICtrl* item, void *userdata); - static void onTextEntry(LLLineEditor* line_editor, void* user_data); - static void onTextCommit(LLUICtrl* caller, void* user_data); + void onButtonDown(); + void onItemSelected(const LLSD& data); + void onTextCommit(const LLSD& data); void updateSelection(); virtual void showList(); virtual void hideList(); - + + virtual void onTextEntry(LLLineEditor* line_editor); + protected: LLButton* mButton; + LLLineEditor* mTextEntry; LLScrollListCtrl* mList; EPreferredPosition mListPosition; LLPointer<LLUIImage> mArrowImage; - std::string mLabel; + LLUIString mLabel; + BOOL mHasAutocompletedText; private: - S32 mButtonPadding; - LLLineEditor* mTextEntry; BOOL mAllowTextEntry; S32 mMaxChars; BOOL mTextEntryTentative; - void (*mPrearrangeCallback)(LLUICtrl*,void*); - void (*mTextEntryCallback)(LLLineEditor*, void*); + commit_callback_t mPrearrangeCallback; + commit_callback_t mTextEntryCallback; + commit_callback_t mSelectionCallback; }; -class LLFlyoutButton : public LLComboBox -{ -public: - LLFlyoutButton( - const std::string& name, - const LLRect &rect, - const std::string& label, - void (*commit_callback)(LLUICtrl*, void*) = NULL, - void *callback_userdata = NULL); - - virtual void updateLayout(); - virtual void draw(); - virtual void setEnabled(BOOL enabled); - - void setToggleState(BOOL state); - - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - static void onActionButtonClick(void *userdata); - static void onSelectAction(LLUICtrl* ctrl, void *userdata); - -protected: - LLButton* mActionButton; - LLPointer<LLUIImage> mActionButtonImage; - LLPointer<LLUIImage> mExpanderButtonImage; - LLPointer<LLUIImage> mActionButtonImageSelected; - LLPointer<LLUIImage> mExpanderButtonImageSelected; - LLPointer<LLUIImage> mActionButtonImageDisabled; - LLPointer<LLUIImage> mExpanderButtonImageDisabled; - BOOL mToggleState; -}; +#ifdef LL_WINDOWS +#ifndef INSTANTIATE_GETCHILD_COMBOBOX +#pragma warning (disable : 4231) +extern template LLComboBox* LLView::getChild<LLComboBox>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const; +#endif +#endif #endif diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f1fc3d8f43a32c24803c9da0551cb649505cd7e0 --- /dev/null +++ b/indra/llui/llconsole.cpp @@ -0,0 +1,393 @@ +/** + * @file llconsole.cpp + * @brief a scrolling console output device + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +//#include "llviewerprecompiledheaders.h" +#include "linden_common.h" + +#include "llconsole.h" + +// linden library includes +#include "llmath.h" +//#include "llviewercontrol.h" +#include "llcriticaldamp.h" +#include "llfontgl.h" +#include "llgl.h" +#include "llui.h" +#include "lluiimage.h" +//#include "llviewerimage.h" +//#include "llviewerimagelist.h" +//#include "llviewerwindow.h" +#include "llsd.h" +#include "llfontgl.h" +#include "llmath.h" + +//#include "llstartup.h" + +// Used for LCD display +extern void AddNewDebugConsoleToLCD(const LLWString &newLine); + +LLConsole* gConsole = NULL; // Created and destroyed in LLViewerWindow. + +const F32 FADE_DURATION = 2.f; +const S32 MIN_CONSOLE_WIDTH = 200; + +LLConsole::LLConsole(const LLConsole::Params& p) +: LLView(p), + LLFixedBuffer(p.max_lines), + mLinePersistTime(p.persist_time), // seconds + mFont(p.font) +{ + if (p.font_size_index.isProvided()) + { + setFontSize(p.font_size_index); + } + mFadeTime = mLinePersistTime - FADE_DURATION; + setMaxLines(LLUI::sSettingGroups["config"]->getS32("ConsoleMaxLines")); +} + +void LLConsole::setLinePersistTime(F32 seconds) +{ + mLinePersistTime = seconds; + mFadeTime = mLinePersistTime - FADE_DURATION; +} + +void LLConsole::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + S32 new_width = llmax(50, llmin(getRect().getWidth(), width)); + S32 new_height = llmax(llfloor(mFont->getLineHeight()) + 15, llmin(getRect().getHeight(), height)); + + if ( mConsoleWidth == new_width + && mConsoleHeight == new_height ) + { + return; + } + + mConsoleWidth = new_width; + mConsoleHeight= new_height; + + LLView::reshape(new_width, new_height, called_from_parent); + + for(paragraph_t::iterator paragraph_it = mParagraphs.begin(); paragraph_it != mParagraphs.end(); paragraph_it++) + { + (*paragraph_it).updateLines((F32)getRect().getWidth(), mFont, true); + } +} + +void LLConsole::setFontSize(S32 size_index) +{ + if (-1 == size_index) + { + mFont = LLFontGL::getFontMonospace(); + } + else if (0 == size_index) + { + mFont = LLFontGL::getFontSansSerif(); + } + else if (1 == size_index) + { + mFont = LLFontGL::getFontSansSerifBig(); + } + else + { + mFont = LLFontGL::getFontSansSerifHuge(); + } + + for(paragraph_t::iterator paragraph_it = mParagraphs.begin(); paragraph_it != mParagraphs.end(); paragraph_it++) + { + (*paragraph_it).updateLines((F32)getRect().getWidth(), mFont, true); + } +} + +void LLConsole::draw() +{ + LLGLSUIDefault gls_ui; + + // skip lines added more than mLinePersistTime ago + F32 cur_time = mTimer.getElapsedTimeF32(); + + F32 skip_time = cur_time - mLinePersistTime; + F32 fade_time = cur_time - mFadeTime; + + if (mParagraphs.empty()) //No text to draw. + { + return; + } + + U32 num_lines=0; + + paragraph_t::reverse_iterator paragraph_it; + paragraph_it = mParagraphs.rbegin(); + U32 paragraph_num=mParagraphs.size(); + + while (!mParagraphs.empty() && paragraph_it != mParagraphs.rend()) + { + num_lines += (*paragraph_it).mLines.size(); + if(num_lines > mMaxLines + || ( (mLinePersistTime > (F32)0.f) && ((*paragraph_it).mAddTime - skip_time)/(mLinePersistTime - mFadeTime) <= (F32)0.f)) + { //All lines above here are done. Lose them. + for (U32 i=0;i<paragraph_num;i++) + { + if (!mParagraphs.empty()) + mParagraphs.pop_front(); + } + break; + } + paragraph_num--; + paragraph_it++; + } + + if (mParagraphs.empty()) + { + return; + } + + // draw remaining lines + F32 y_pos = 0.f; + + LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); + +// F32 console_opacity = llclamp(gSavedSettings.getF32("ConsoleBackgroundOpacity"), 0.f, 1.f); + F32 console_opacity = llclamp(LLUI::sSettingGroups["config"]->getF32("ConsoleBackgroundOpacity"), 0.f, 1.f); +// LLColor4 color = gSavedSkinSettings.getColor("ConsoleBackground"); + LLColor4 color = LLUI::sSettingGroups["color"]->getColor("ConsoleBackground"); + color.mV[VALPHA] *= console_opacity; + + F32 line_height = mFont->getLineHeight(); + + for(paragraph_it = mParagraphs.rbegin(); paragraph_it != mParagraphs.rend(); paragraph_it++) + { + S32 target_height = llfloor( (*paragraph_it).mLines.size() * line_height + 8); + S32 target_width = llfloor( (*paragraph_it).mMaxWidth +15); + + y_pos += ((*paragraph_it).mLines.size()) * line_height; + imagep->drawSolid(-14, (S32)(y_pos + line_height - target_height), target_width, target_height, color); + + F32 y_off=0; + + F32 alpha; + + if ((mLinePersistTime > 0.f) && ((*paragraph_it).mAddTime < fade_time)) + { + alpha = ((*paragraph_it).mAddTime - skip_time)/(mLinePersistTime - mFadeTime); + } + else + { + alpha = 1.0f; + } + + if( alpha > 0.f ) + { + for (lines_t::iterator line_it=(*paragraph_it).mLines.begin(); + line_it != (*paragraph_it).mLines.end(); + line_it ++) + { + for (line_color_segments_t::iterator seg_it = (*line_it).mLineColorSegments.begin(); + seg_it != (*line_it).mLineColorSegments.end(); + seg_it++) + { + mFont->render((*seg_it).mText, 0, (*seg_it).mXPosition - 8, y_pos - y_off, + LLColor4( + (*seg_it).mColor.mV[VRED], + (*seg_it).mColor.mV[VGREEN], + (*seg_it).mColor.mV[VBLUE], + (*seg_it).mColor.mV[VALPHA]*alpha), + LLFontGL::LEFT, + LLFontGL::BASELINE, + LLFontGL::NORMAL, + LLFontGL::DROP_SHADOW, + S32_MAX, + target_width + ); + } + y_off += line_height; + } + } + y_pos += 8; + } +} + +void LLConsole::addLine(const std::string& utf8line) +{ + LLWString wline = utf8str_to_wstring(utf8line); + addLine(wline, 0.f, LLColor4(1.f, 1.f, 1.f, 1.f)); +} + +void LLConsole::addLine(const LLWString& wline) +{ + addLine(wline, 0.f, LLColor4(1.f, 1.f, 1.f, 1.f)); +} + +void LLConsole::addLine(const std::string& utf8line, F32 size, const LLColor4 &color) +{ + LLWString wline = utf8str_to_wstring(utf8line); + addLine(wline, size, color); +} + +//Generate highlight color segments for this paragraph. Pass in default color of paragraph. +void LLConsole::Paragraph::makeParagraphColorSegments (const LLColor4 &color) +{ + LLSD paragraph_color_segments; + LLColor4 lcolor=color; + + paragraph_color_segments[0]["text"] =wstring_to_utf8str(mParagraphText); + LLSD color_sd = color.getValue(); + paragraph_color_segments[0]["color"]=color_sd; + + for(LLSD::array_const_iterator color_segment_it = paragraph_color_segments.beginArray(); + color_segment_it != paragraph_color_segments.endArray(); + ++color_segment_it) + { + LLSD color_llsd = (*color_segment_it)["color"]; + std::string color_str = (*color_segment_it)["text"].asString(); + + ParagraphColorSegment color_segment; + + color_segment.mColor.setValue(color_llsd); + color_segment.mNumChars = color_str.length(); + + mParagraphColorSegments.push_back(color_segment); + } +} + +//Called when a paragraph is added to the console or window is resized. +void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, bool force_resize) +{ + if ( !force_resize ) + { + if ( mMaxWidth >= 0.0f + && mMaxWidth < screen_width ) + { + return; //No resize required. + } + } + + screen_width = screen_width - 30; //Margin for small windows. + + if ( mParagraphText.empty() + || mParagraphColorSegments.empty() + || font == NULL) + { + return; //Not enough info to complete. + } + + mLines.clear(); //Chuck everything. + mMaxWidth = 0.0f; + + paragraph_color_segments_t::iterator current_color = mParagraphColorSegments.begin(); + U32 current_color_length = (*current_color).mNumChars; + + S32 paragraph_offset = 0; //Offset into the paragraph text. + + // Wrap lines that are longer than the view is wide. + while( paragraph_offset < (S32)mParagraphText.length() ) + { + S32 skip_chars; // skip '\n' + // Figure out if a word-wrapped line fits here. + LLWString::size_type line_end = mParagraphText.find_first_of(llwchar('\n'), paragraph_offset); + if (line_end != LLWString::npos) + { + skip_chars = 1; // skip '\n' + } + else + { + line_end = mParagraphText.size(); + skip_chars = 0; + } + + U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_end - paragraph_offset, TRUE); + + if (drawable != 0) + { + F32 x_position = 0; //Screen X position of text. + + mMaxWidth = llmax( mMaxWidth, (F32)font->getWidth( mParagraphText.substr( paragraph_offset, drawable ).c_str() ) ); + Line line; + + U32 left_to_draw = drawable; + U32 drawn = 0; + + while (left_to_draw >= current_color_length + && current_color != mParagraphColorSegments.end() ) + { + LLWString color_text = mParagraphText.substr( paragraph_offset + drawn, current_color_length ); + line.mLineColorSegments.push_back( LineColorSegment( color_text, //Append segment to line. + (*current_color).mColor, + x_position ) ); + + x_position += font->getWidth( color_text.c_str() ); //Set up next screen position. + + drawn += current_color_length; + left_to_draw -= current_color_length; + + current_color++; //Goto next paragraph color record. + + if (current_color != mParagraphColorSegments.end()) + { + current_color_length = (*current_color).mNumChars; + } + } + + if (left_to_draw > 0 && current_color != mParagraphColorSegments.end() ) + { + LLWString color_text = mParagraphText.substr( paragraph_offset + drawn, left_to_draw ); + + line.mLineColorSegments.push_back( LineColorSegment( color_text, //Append segment to line. + (*current_color).mColor, + x_position ) ); + + current_color_length -= left_to_draw; + } + mLines.push_back(line); //Append line to paragraph line list. + } + paragraph_offset += (drawable + skip_chars); + } +} + +//Pass in the string and the default color for this block of text. +LLConsole::Paragraph::Paragraph (LLWString str, const LLColor4 &color, F32 add_time, const LLFontGL* font, F32 screen_width) + : mParagraphText(str), mAddTime(add_time), mMaxWidth(-1) +{ + makeParagraphColorSegments(color); + updateLines( screen_width, font ); +} + +void LLConsole::addLine(const LLWString& wline, F32 size, const LLColor4 &color) +{ + Paragraph paragraph(wline, color, mTimer.getElapsedTimeF32(), mFont, (F32)getRect().getWidth() ); + + mParagraphs.push_back ( paragraph ); + +#if LL_WINDOWS && LL_LCD_COMPILE + // add to LCD screen + AddNewDebugConsoleToLCD(wline); +#endif +} diff --git a/indra/llui/llconsole.h b/indra/llui/llconsole.h new file mode 100644 index 0000000000000000000000000000000000000000..65149b217f69c49372782776c918eabae0fefcdb --- /dev/null +++ b/indra/llui/llconsole.h @@ -0,0 +1,162 @@ +/** + * @file llconsole.h + * @brief a simple console-style output device + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLCONSOLE_H +#define LL_LLCONSOLE_H + +#include "llfixedbuffer.h" +#include "llview.h" +#include "v4color.h" +#include <deque> + +class LLFontGL; +class LLSD; + +class LLConsole : public LLFixedBuffer, public LLView +{ +public: + typedef enum e_font_size + { + MONOSPACE = -1, + SMALL = 0, + BIG = 1 + } EFontSize; + + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Optional<U32> max_lines; + Optional<F32> persist_time; + Optional<S32> font_size_index; + Params() + : max_lines("max_lines", LLUI::sSettingGroups["config"]->getS32("ConsoleMaxLines")), + persist_time("persist_time", 0.f) // forever + { + mouse_opaque(false); + } + }; +protected: + LLConsole(const Params&); + friend class LLUICtrlFactory; + +public: + //A paragraph color segment defines the color of text in a line + //of text that was received for console display. It has no + //notion of line wraps, screen position, or the text it contains. + //It is only the number of characters that are a color and the + //color. + struct ParagraphColorSegment + { + S32 mNumChars; + LLColor4 mColor; + }; + + //A line color segment is a chunk of text, the color associated + //with it, and the X Position it was calculated to begin at + //on the screen. X Positions are re-calculated if the + //screen changes size. + class LineColorSegment + { + public: + LineColorSegment(LLWString text, LLColor4 color, F32 xpos) : mText(text), mColor(color), mXPosition(xpos) {} + public: + LLWString mText; + LLColor4 mColor; + F32 mXPosition; + }; + + typedef std::list<LineColorSegment> line_color_segments_t; + + //A line is composed of one or more color segments. + class Line + { + public: + line_color_segments_t mLineColorSegments; + }; + + typedef std::list<Line> lines_t; + typedef std::list<ParagraphColorSegment> paragraph_color_segments_t; + + //A paragraph is a processed element containing the entire text of the + //message (used for recalculating positions on screen resize) + //The time this message was added to the console output + //The visual screen width of the longest line in this block + //And a list of one or more lines which are used to display this message. + class Paragraph + { + public: + Paragraph (LLWString str, const LLColor4 &color, F32 add_time, const LLFontGL* font, F32 screen_width); + void makeParagraphColorSegments ( const LLColor4 &color); + void updateLines ( F32 screen_width, const LLFontGL* font, bool force_resize=false ); + public: + LLWString mParagraphText; //The entire text of the paragraph + paragraph_color_segments_t mParagraphColorSegments; + F32 mAddTime; //Time this paragraph was added to the display. + F32 mMaxWidth; //Width of the widest line of text in this paragraph. + lines_t mLines; + + }; + + //The console contains a deque of paragraphs which represent the individual messages. + typedef std::deque<Paragraph> paragraph_t; + paragraph_t mParagraphs; + + ~LLConsole(){}; + + // each line lasts this long after being added + void setLinePersistTime(F32 seconds); + + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + + // -1 = monospace, 0 means small, font size = 1 means big + void setFontSize(S32 size_index); + + void addLine(const std::string& utf8line, F32 size, const LLColor4 &color); + void addLine(const LLWString& wline, F32 size, const LLColor4 &color); + + // Overrides + /*virtual*/ void draw(); + /*virtual*/ void addLine(const std::string& utf8line); + /*virtual*/ void addLine(const LLWString& line); +private: + F32 mLinePersistTime; // Age at which to stop drawing. + F32 mFadeTime; // Age at which to start fading + const LLFontGL* mFont; + S32 mLastBoxHeight; + S32 mLastBoxWidth; + S32 mConsoleWidth; + S32 mConsoleHeight; + +}; + +extern LLConsole* gConsole; + +#endif diff --git a/indra/llui/llcontainerview.cpp b/indra/llui/llcontainerview.cpp new file mode 100644 index 0000000000000000000000000000000000000000..40cc430e2592e07925b319c8dd91a0d4b8188bfc --- /dev/null +++ b/indra/llui/llcontainerview.cpp @@ -0,0 +1,301 @@ +/** + * @file llcontainerview.cpp + * @brief Container for all statistics info + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "llcontainerview.h" + +#include "llerror.h" +#include "llfontgl.h" +#include "llgl.h" +#include "llui.h" +#include "llstring.h" +#include "llscrollcontainer.h" +#include "lluictrlfactory.h" + +static LLDefaultWidgetRegistry::Register<LLContainerView> r("container_view"); + +LLContainerView::LLContainerView(const LLContainerView::Params& p) +: LLView(p), + mShowLabel(p.show_label), + mLabel(p.label), + mDisplayChildren(p.display_children) +{ + mCollapsible = TRUE; + mScrollContainer = NULL; +} + +LLContainerView::~LLContainerView() +{ + // Children all cleaned up by default view destructor. +} + +BOOL LLContainerView::postBuild() +{ + setDisplayChildren(mDisplayChildren); + reshape(getRect().getWidth(), getRect().getHeight(), FALSE); + return TRUE; +} + +bool LLContainerView::addChild(LLView* child, S32 tab_group) +{ + bool res = LLView::addChild(child, tab_group); + if (res) + { + sendChildToBack(child); + } + return res; +} + +BOOL LLContainerView::handleMouseDown(S32 x, S32 y, MASK mask) +{ + BOOL handled = FALSE; + if (mDisplayChildren) + { + handled = (LLView::childrenHandleMouseDown(x, y, mask) != NULL); + } + if (!handled) + { + if( mCollapsible && mShowLabel && (y >= getRect().getHeight() - 10) ) + { + setDisplayChildren(!mDisplayChildren); + reshape(getRect().getWidth(), getRect().getHeight(), FALSE); + handled = TRUE; + } + } + return handled; +} + +BOOL LLContainerView::handleMouseUp(S32 x, S32 y, MASK mask) +{ + BOOL handled = FALSE; + if (mDisplayChildren) + { + handled = (LLView::childrenHandleMouseUp(x, y, mask) != NULL); + } + return handled; +} + + +void LLContainerView::draw() +{ + { + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + + gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.f, 0.f, 0.f, 0.25f)); + } + + // Draw the label + if (mShowLabel) + { + LLFontGL::getFontMonospace()->renderUTF8( + mLabel, 0, 2, getRect().getHeight() - 2, LLColor4(1,1,1,1), LLFontGL::LEFT, LLFontGL::TOP); + } + + LLView::draw(); +} + + +void LLContainerView::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + S32 desired_width = width; + S32 desired_height = height; + + if (mScrollContainer) + { + BOOL dum_bool; + mScrollContainer->calcVisibleSize(&desired_width, &desired_height, &dum_bool, &dum_bool); + } + else + { + // if we're uncontained - make height as small as possible + desired_height = 0; + } + + arrange(desired_width, desired_height, called_from_parent); + + // sometimes, after layout, our container will change size (scrollbars popping in and out) + // if so, attempt another layout + if (mScrollContainer) + { + S32 new_container_width; + S32 new_container_height; + BOOL dum_bool; + mScrollContainer->calcVisibleSize(&new_container_width, &new_container_height, &dum_bool, &dum_bool); + + if ((new_container_width != desired_width) || + (new_container_height != desired_height)) // the container size has changed, attempt to arrange again + { + arrange(new_container_width, new_container_height, called_from_parent); + } + } +} + +void LLContainerView::arrange(S32 width, S32 height, BOOL called_from_parent) +{ + // Determine the sizes and locations of all contained views + S32 total_height = 0; + S32 top, left, right, bottom; + //LLView *childp; + + // These will be used for the children + left = 4; + top = getRect().getHeight() - 4; + right = width - 2; + bottom = top; + + // Leave some space for the top label/grab handle + if (mShowLabel) + { + total_height += 20; + } + + if (mDisplayChildren) + { + // Determine total height + U32 child_height = 0; + for (child_list_const_iter_t child_iter = getChildList()->begin(); + child_iter != getChildList()->end(); ++child_iter) + { + LLView *childp = *child_iter; + if (!childp->getVisible()) + { + llwarns << "Incorrect visibility!" << llendl; + } + LLRect child_rect = childp->getRequiredRect(); + child_height += child_rect.getHeight(); + child_height += 2; + } + total_height += child_height; + } + + if (total_height < height) + total_height = height; + + if (followsTop()) + { + // HACK: casting away const. Should use setRect or some helper function instead. + const_cast<LLRect&>(getRect()).mBottom = getRect().mTop - total_height; + } + else + { + // HACK: casting away const. Should use setRect or some helper function instead. + const_cast<LLRect&>(getRect()).mTop = getRect().mBottom + total_height; + } + // HACK: casting away const. Should use setRect or some helper function instead. + const_cast<LLRect&>(getRect()).mRight = getRect().mLeft + width; + + top = total_height; + if (mShowLabel) + { + top -= 20; + } + + bottom = top; + + if (mDisplayChildren) + { + // Iterate through all children, and put in container from top down. + for (child_list_const_iter_t child_iter = getChildList()->begin(); + child_iter != getChildList()->end(); ++child_iter) + { + LLView *childp = *child_iter; + LLRect child_rect = childp->getRequiredRect(); + bottom -= child_rect.getHeight(); + LLRect r(left, bottom + child_rect.getHeight(), right, bottom); + childp->setRect(r); + childp->reshape(right - left, top - bottom); + top = bottom - 2; + bottom = top; + } + } + + if (!called_from_parent) + { + if (getParent()) + { + getParent()->reshape(getParent()->getRect().getWidth(), getParent()->getRect().getHeight(), FALSE); + } + } + +} + +LLRect LLContainerView::getRequiredRect() +{ + LLRect req_rect; + //LLView *childp; + U32 total_height = 0; + + // Determine the sizes and locations of all contained views + + // Leave some space for the top label/grab handle + + if (mShowLabel) + { + total_height = 20; + } + + + if (mDisplayChildren) + { + // Determine total height + U32 child_height = 0; + for (child_list_const_iter_t child_iter = getChildList()->begin(); + child_iter != getChildList()->end(); ++child_iter) + { + LLView *childp = *child_iter; + LLRect child_rect = childp->getRequiredRect(); + child_height += child_rect.getHeight(); + child_height += 2; + } + + total_height += child_height; + } + req_rect.mTop = total_height; + return req_rect; +} + +void LLContainerView::setLabel(const std::string& label) +{ + mLabel = label; +} + +void LLContainerView::setDisplayChildren(const BOOL displayChildren) +{ + mDisplayChildren = displayChildren; + for (child_list_const_iter_t child_iter = getChildList()->begin(); + child_iter != getChildList()->end(); ++child_iter) + { + LLView *childp = *child_iter; + childp->setVisible(mDisplayChildren); + } +} diff --git a/indra/llui/llcontainerview.h b/indra/llui/llcontainerview.h new file mode 100644 index 0000000000000000000000000000000000000000..9f3d1ac7ad94b27cbdb9d7aaca8b95bc32486f2d --- /dev/null +++ b/indra/llui/llcontainerview.h @@ -0,0 +1,92 @@ +/** + * @file llcontainerview.h + * @brief Container for all statistics info. + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLCONTAINERVIEW_H +#define LL_LLCONTAINERVIEW_H + +#include "stdtypes.h" +#include "lltextbox.h" +#include "llstatbar.h" + +class LLScrollContainer; + +class LLContainerView : public LLView +{ +public: + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Optional<std::string> label; + Optional<bool> show_label; + Optional<bool> display_children; + Params() + : label("label"), + show_label("show_label", FALSE), + display_children("display_children", TRUE) + { + mouse_opaque(false); + } + }; +protected: + LLContainerView(const Params& p); + friend class LLUICtrlFactory; +public: + ~LLContainerView(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0); + + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); + + /*virtual*/ void draw(); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + /*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options. + + void setLabel(const std::string& label); + void showLabel(BOOL show) { mShowLabel = show; } + void setDisplayChildren(const BOOL displayChildren); + BOOL getDisplayChildren() { return mDisplayChildren; } + void setScrollContainer(LLScrollContainer* scroll) {mScrollContainer = scroll;} + + private: + LLScrollContainer* mScrollContainer; + void arrange(S32 width, S32 height, BOOL called_from_parent = TRUE); + BOOL mShowLabel; + +protected: + BOOL mDisplayChildren; + std::string mLabel; +public: + BOOL mCollapsible; + +}; +#endif // LL_CONTAINERVIEW_ diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index 6c92ea1ff7ad3dbb89e94a71b08c8fe933b38c93..8ecbdb98e1d1b50240892038e534eee54f1f0451 100644 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -43,10 +43,10 @@ #include "llmenugl.h" #include "lltextbox.h" #include "llcontrol.h" -#include "llresmgr.h" #include "llfontgl.h" #include "llwindow.h" #include "llfocusmgr.h" +#include "lluictrlfactory.h" const S32 LEADING_PAD = 5; const S32 TITLE_PAD = 8; @@ -56,21 +56,33 @@ const S32 RIGHT_PAD = BORDER_PAD + 32; // HACK: space for close btn and minimize S32 LLDragHandle::sSnapMargin = 5; -LLDragHandle::LLDragHandle( const std::string& name, const LLRect& rect, const std::string& title ) -: LLView( name, rect, TRUE ), +LLDragHandle::LLDragHandle(const LLDragHandle::Params& p) +: LLView(p), mDragLastScreenX( 0 ), mDragLastScreenY( 0 ), mLastMouseScreenX( 0 ), mLastMouseScreenY( 0 ), - mDragHighlightColor( LLUI::sColorsGroup->getColor( "DefaultHighlightLight" ) ), - mDragShadowColor( LLUI::sColorsGroup->getColor( "DefaultShadowDark" ) ), mTitleBox( NULL ), mMaxTitleWidth( 0 ), - mForeground( TRUE ) + mForeground( TRUE ), + mDragHighlightColor(p.drag_highlight_color()), + mDragShadowColor(p.drag_shadow_color()) + { - sSnapMargin = LLUI::sConfigGroup->getS32("SnapMargin"); + static LLUICachedControl<S32> snap_margin ("SnapMargin", 0); + sSnapMargin = snap_margin; +} - setSaveToXML(false); +LLDragHandle::~LLDragHandle() +{ + removeChild(mTitleBox); + delete mTitleBox; +} + +void LLDragHandle::initFromParams(const LLDragHandle::Params& p) +{ + LLView::initFromParams(p); + setTitle( p.label ); } void LLDragHandle::setTitleVisible(BOOL visible) @@ -81,58 +93,47 @@ void LLDragHandle::setTitleVisible(BOOL visible) } } -void LLDragHandle::setTitleBox(LLTextBox* titlebox) -{ +void LLDragHandleTop::setTitle(const std::string& title) +{ + std::string trimmed_title = title; + LLStringUtil::trim(trimmed_title); + if( mTitleBox ) { - removeChild(mTitleBox); - delete mTitleBox; + mTitleBox->setText(trimmed_title); } - mTitleBox = titlebox; - if(mTitleBox) + else { + const LLFontGL* font = LLFontGL::getFontSansSerif(); + LLTextBox::Params params; + params.name("Drag Handle Title"); + params.rect(getRect()); + params.text(trimmed_title); + params.font(font); + params.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT); + params.font_shadow(LLFontGL::DROP_SHADOW_SOFT); + mTitleBox = LLUICtrlFactory::create<LLTextBox> (params); addChild( mTitleBox ); } -} - -LLDragHandleTop::LLDragHandleTop(const std::string& name, const LLRect &rect, const std::string& title) -: LLDragHandle(name, rect, title) -{ - setFollowsAll(); - setTitle( title ); -} - -LLDragHandleLeft::LLDragHandleLeft(const std::string& name, const LLRect &rect, const std::string& title) -: LLDragHandle(name, rect, title) -{ - setFollowsAll(); - setTitle( title ); -} - -void LLDragHandleTop::setTitle(const std::string& title) -{ - std::string trimmed_title = title; - LLStringUtil::trim(trimmed_title); - - const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); - LLTextBox* titlebox = new LLTextBox( std::string("Drag Handle Title"), getRect(), trimmed_title, font ); - titlebox->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT); - titlebox->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); - setTitleBox(titlebox); reshapeTitleBox(); } const std::string& LLDragHandleTop::getTitle() const { - return getTitleBox() == NULL ? LLStringUtil::null : getTitleBox()->getText(); + return mTitleBox == NULL ? LLStringUtil::null : mTitleBox->getText(); } void LLDragHandleLeft::setTitle(const std::string& ) { - setTitleBox(NULL); + if( mTitleBox ) + { + removeChild(mTitleBox); + delete mTitleBox; + mTitleBox = NULL; + } /* no title on left edge */ } @@ -184,9 +185,9 @@ void LLDragHandleTop::draw() */ // Colorize the text to match the frontmost state - if (getTitleBox()) + if (mTitleBox) { - getTitleBox()->setEnabled(getForeground()); + mTitleBox->setEnabled(getForeground()); } LLView::draw(); @@ -229,9 +230,9 @@ void LLDragHandleLeft::draw() */ // Colorize the text to match the frontmost state - if (getTitleBox()) + if (mTitleBox) { - getTitleBox()->setEnabled(getForeground()); + mTitleBox->setEnabled(getForeground()); } LLView::draw(); @@ -239,12 +240,12 @@ void LLDragHandleLeft::draw() void LLDragHandleTop::reshapeTitleBox() { - if( ! getTitleBox()) + if( ! mTitleBox) { return; } - const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); - S32 title_width = font->getWidth( getTitleBox()->getText() ) + TITLE_PAD; + const LLFontGL* font = LLFontGL::getFontSansSerif(); + S32 title_width = font->getWidth( mTitleBox->getText() ) + TITLE_PAD; if (getMaxTitleWidth() > 0) title_width = llmin(title_width, getMaxTitleWidth()); S32 title_height = llround(font->getLineHeight()); @@ -255,7 +256,7 @@ void LLDragHandleTop::reshapeTitleBox() getRect().getWidth() - LEFT_PAD - RIGHT_PAD, title_height); - getTitleBox()->setRect( title_rect ); + mTitleBox->setRect( title_rect ); } void LLDragHandleTop::reshape(S32 width, S32 height, BOOL called_from_parent) @@ -337,14 +338,14 @@ BOOL LLDragHandle::handleHover(S32 x, S32 y, MASK mask) LLView* snap_view = getParent()->findSnapRect(new_rect, mouse_dir, SNAP_PARENT_AND_SIBLINGS, sSnapMargin); - getParent()->snappedTo(snap_view); + getParent()->setSnappedTo(snap_view); delta_x = new_rect.mLeft - pre_snap_x; delta_y = new_rect.mBottom - pre_snap_y; translated_rect.translate(delta_x, delta_y); // restore original rect so delta are detected, then call user reshape method to handle snapped floaters, etc getParent()->setRect(original_rect); - getParent()->userSetShape(translated_rect); + getParent()->setShape(translated_rect, true); mDragLastScreenX += delta_x; mDragLastScreenY += delta_y; diff --git a/indra/llui/lldraghandle.h b/indra/llui/lldraghandle.h index 9eb3e55a6c25b03b2d5a4b5b30ae030faeb28d0c..8b53c46ae90430d765477df10f012d16e43e653b 100644 --- a/indra/llui/lldraghandle.h +++ b/indra/llui/lldraghandle.h @@ -45,8 +45,24 @@ class LLTextBox; class LLDragHandle : public LLView { public: - LLDragHandle(const std::string& name, const LLRect& rect, const std::string& title ); - virtual ~LLDragHandle() { setTitleBox(NULL); } + struct Params + : public LLInitParam::Block<Params, LLView::Params> + { + Optional<std::string> label; + Optional<LLUIColor> drag_highlight_color; + Optional<LLUIColor> drag_shadow_color; + + Params() + : drag_highlight_color("", LLUI::getCachedColorFunctor("DefaultHighlightLight")), + drag_shadow_color("", LLUI::getCachedColorFunctor("DefaultShadowDark")) + { + mouse_opaque(true); + follows.flags(FOLLOWS_ALL); + } + }; + void initFromParams(const Params&); + + virtual ~LLDragHandle(); virtual void setValue(const LLSD& value); @@ -64,18 +80,20 @@ public: virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); protected: - LLTextBox* getTitleBox() const { return mTitleBox; } - void setTitleBox(LLTextBox*); - + LLDragHandle(const Params&); + friend class LLUICtrlFactory; + +protected: + LLTextBox* mTitleBox; + private: S32 mDragLastScreenX; S32 mDragLastScreenY; S32 mLastMouseScreenX; S32 mLastMouseScreenY; LLCoordGL mLastMouseDir; - LLColor4 mDragHighlightColor; - LLColor4 mDragShadowColor; - LLTextBox* mTitleBox; + LLUIColor mDragHighlightColor; + LLUIColor mDragShadowColor; S32 mMaxTitleWidth; BOOL mForeground; @@ -88,9 +106,10 @@ private: class LLDragHandleTop : public LLDragHandle { +protected: + LLDragHandleTop(const Params& p) : LLDragHandle(p) {} + friend class LLUICtrlFactory; public: - LLDragHandleTop(const std::string& name, const LLRect& rect, const std::string& title ); - virtual void setTitle( const std::string& title ); virtual const std::string& getTitle() const; virtual void draw(); @@ -105,9 +124,10 @@ private: class LLDragHandleLeft : public LLDragHandle { +protected: + LLDragHandleLeft(const Params& p) : LLDragHandle(p) {} + friend class LLUICtrlFactory; public: - LLDragHandleLeft(const std::string& name, const LLRect& rect, const std::string& title ); - virtual void setTitle( const std::string& title ); virtual const std::string& getTitle() const; virtual void draw(); diff --git a/indra/llui/llf32uictrl.cpp b/indra/llui/llf32uictrl.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0978005b7836e9300450a5a48d6264607e64e322 --- /dev/null +++ b/indra/llui/llf32uictrl.cpp @@ -0,0 +1,57 @@ +/** + * @file llf32uictrl.cpp + * @author Nat Goodspeed + * @date 2008-09-08 + * @brief Implementation for llf32uictrl. + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +// Precompiled header +#include "linden_common.h" +// associated header +#include "llf32uictrl.h" +// STL headers +// std headers +// external library headers +// other Linden headers + +LLF32UICtrl::LLF32UICtrl(const Params& p) +: LLUICtrl(p), + mInitialValue(p.initial_value().asReal()), + mMinValue(p.min_value), + mMaxValue(p.max_value), + mIncrement(p.increment) +{ + mViewModel->setValue(p.initial_value); +} + +F32 LLF32UICtrl::getValueF32() const +{ + return mViewModel->getValue().asReal(); +} diff --git a/indra/llui/llf32uictrl.h b/indra/llui/llf32uictrl.h new file mode 100644 index 0000000000000000000000000000000000000000..0a54fe761b9881ab46d6b8089ea962e61e76df9f --- /dev/null +++ b/indra/llui/llf32uictrl.h @@ -0,0 +1,83 @@ +/** + * @file llf32uictrl.h + * @author Nat Goodspeed + * @date 2008-09-08 + * @brief Base class for float-valued LLUICtrl widgets + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#if ! defined(LL_LLF32UICTRL_H) +#define LL_LLF32UICTRL_H + +#include "lluictrl.h" + +class LLF32UICtrl: public LLUICtrl +{ +public: + struct Params: public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<F32> min_value, + max_value, + increment; + + Params() + : min_value("min_val", 0.f), + max_value("max_val", 1.f), + increment("increment", 0.1f) + {} + }; + +protected: + LLF32UICtrl(const Params& p); + +public: + virtual F32 getValueF32() const; + + virtual void setValue(const LLSD& value ) { mViewModel->setValue(value); } + virtual LLSD getValue() const { return LLSD(getValueF32()); } + + virtual void setMinValue(const LLSD& min_value) { setMinValue((F32)min_value.asReal()); } + virtual void setMaxValue(const LLSD& max_value) { setMaxValue((F32)max_value.asReal()); } + + virtual F32 getInitialValue() const { return mInitialValue; } + virtual F32 getMinValue() const { return mMinValue; } + virtual F32 getMaxValue() const { return mMaxValue; } + virtual F32 getIncrement() const { return mIncrement; } + virtual void setMinValue(F32 min_value) { mMinValue = min_value; } + virtual void setMaxValue(F32 max_value) { mMaxValue = max_value; } + virtual void setIncrement(F32 increment) { mIncrement = increment;} + +protected: + F32 mInitialValue; + F32 mMinValue; + F32 mMaxValue; + F32 mIncrement; +}; + +#endif /* ! defined(LL_LLF32UICTRL_H) */ diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 21f8f6e5f72aec9446d601c94b6e1911ba329cee..a14b99eeb74bd1165e27b7bb82f422c2a25911a7 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -43,11 +43,13 @@ #include "llbutton.h" #include "llcheckboxctrl.h" #include "lldraghandle.h" +#include "llfloaterreg.h" #include "llfocusmgr.h" #include "llresizebar.h" #include "llresizehandle.h" #include "llkeyboard.h" #include "llmenugl.h" // MENU_BAR_HEIGHT +#include "llmodaldialog.h" #include "lltextbox.h" #include "llresmgr.h" #include "llui.h" @@ -56,37 +58,37 @@ #include "llcontrol.h" #include "lltabcontainer.h" #include "v2math.h" +#include "lltrans.h" +#include "llmultifloater.h" -const S32 MINIMIZED_WIDTH = 160; -const S32 CLOSE_BOX_FROM_TOP = 1; // use this to control "jumping" behavior when Ctrl-Tabbing const S32 TABBED_FLOATER_OFFSET = 0; std::string LLFloater::sButtonActiveImageNames[BUTTON_COUNT] = { - "UIImgBtnCloseActiveUUID", //BUTTON_CLOSE - "UIImgBtnRestoreActiveUUID", //BUTTON_RESTORE - "UIImgBtnMinimizeActiveUUID", //BUTTON_MINIMIZE - "UIImgBtnTearOffActiveUUID", //BUTTON_TEAR_OFF - "UIImgBtnCloseActiveUUID", //BUTTON_EDIT + "closebox.tga", //BUTTON_CLOSE + "restore.tga", //BUTTON_RESTORE + "minimize.tga", //BUTTON_MINIMIZE + "tearoffbox.tga", //BUTTON_TEAR_OFF + "closebox.tga", //BUTTON_EDIT }; std::string LLFloater::sButtonInactiveImageNames[BUTTON_COUNT] = { - "UIImgBtnCloseInactiveUUID", //BUTTON_CLOSE - "UIImgBtnRestoreInactiveUUID", //BUTTON_RESTORE - "UIImgBtnMinimizeInactiveUUID", //BUTTON_MINIMIZE - "UIImgBtnTearOffInactiveUUID", //BUTTON_TEAR_OFF - "UIImgBtnCloseInactiveUUID", //BUTTON_EDIT + "close_inactive_blue.tga", //BUTTON_CLOSE + "restore_inactive.tga", //BUTTON_RESTORE + "minimize_inactive.tga", //BUTTON_MINIMIZE + "tearoffbox.tga", //BUTTON_TEAR_OFF + "close_inactive_blue.tga", //BUTTON_EDIT }; std::string LLFloater::sButtonPressedImageNames[BUTTON_COUNT] = { - "UIImgBtnClosePressedUUID", //BUTTON_CLOSE - "UIImgBtnRestorePressedUUID", //BUTTON_RESTORE - "UIImgBtnMinimizePressedUUID", //BUTTON_MINIMIZE - "UIImgBtnTearOffPressedUUID", //BUTTON_TEAR_OFF - "UIImgBtnClosePressedUUID", //BUTTON_EDIT + "close_in_blue.tga", //BUTTON_CLOSE + "restore_pressed.tga", //BUTTON_RESTORE + "minimize_pressed.tga", //BUTTON_MINIMIZE + "tearoff_pressed.tga", //BUTTON_TEAR_OFF + "close_in_blue.tga", //BUTTON_EDIT }; std::string LLFloater::sButtonNames[BUTTON_COUNT] = @@ -98,17 +100,20 @@ std::string LLFloater::sButtonNames[BUTTON_COUNT] = "llfloater_edit_btn", //BUTTON_EDIT }; -std::string LLFloater::sButtonToolTips[BUTTON_COUNT] = +std::string LLFloater::sButtonToolTips[BUTTON_COUNT] = {}; + + +std::string LLFloater::sButtonToolTipsIndex[BUTTON_COUNT]= { #ifdef LL_DARWIN - "Close (Cmd-W)", //BUTTON_CLOSE + "BUTTON_CLOSE_DARWIN",//LLTrans::getString("BUTTON_CLOSE_DARWIN"), //"Close (Cmd-W)", //BUTTON_CLOSE #else - "Close (Ctrl-W)", //BUTTON_CLOSE + "BUTTON_CLOSE_WIN", //LLTrans::getString("BUTTON_CLOSE_WIN"), //"Close (Ctrl-W)", //BUTTON_CLOSE #endif - "Restore", //BUTTON_RESTORE - "Minimize", //BUTTON_MINIMIZE - "Tear Off", //BUTTON_TEAR_OFF - "Edit", //BUTTON_EDIT + "BUTTON_RESTORE",//LLTrans::getString("BUTTON_RESTORE"), //"Restore", //BUTTON_RESTORE + "BUTTON_MINIMIZE",//LLTrans::getString("BUTTON_MINIMIZE"), //"Minimize", //BUTTON_MINIMIZE + "BUTTON_TEAR_OFF",//LLTrans::getString("BUTTON_TEAR_OFF"), //"Tear Off", //BUTTON_TEAR_OFF + "BUTTON_EDIT", //LLTrans::getString("BUTTON_EDIT"), // "Edit", //BUTTON_EDIT }; LLFloater::click_callback LLFloater::sButtonCallbacks[BUTTON_COUNT] = @@ -126,59 +131,118 @@ LLFloater::handle_map_t LLFloater::sFloaterMap; LLFloaterView* gFloaterView = NULL; -LLFloater::LLFloater() : - //FIXME: we should initialize *all* member variables here - LLPanel(), mAutoFocus(TRUE), - mResizable(FALSE), - mDragOnLeft(FALSE), - mMinWidth(0), - mMinHeight(0) -{ - // automatically take focus when opened - mAutoFocus = TRUE; +//static +bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b) +{ + if (a.type() != b.type()) + { + //llerrs << "Mismatched LLSD types: (" << a << ") mismatches (" << b << ")" << llendl; + return false; + } + else if (a.isUndefined()) + return false; + else if (a.isInteger()) + return a.asInteger() < b.asInteger(); + else if (a.isReal()) + return a.asReal() < b.asReal(); + else if (a.isString()) + return a.asString() < b.asString(); + else if (a.isUUID()) + return a.asUUID() < b.asUUID(); + else if (a.isDate()) + return a.asDate() < b.asDate(); + else if (a.isURI()) + return a.asString() < b.asString(); // compare URIs as strings + else if (a.isBoolean()) + return a.asBoolean() < b.asBoolean(); + else + return false; // no valid operation for Binary +} + +bool LLFloater::KeyCompare::equate(const LLSD& a, const LLSD& b) +{ + if (a.type() != b.type()) + { + //llerrs << "Mismatched LLSD types: (" << a << ") mismatches (" << b << ")" << llendl; + return false; + } + else if (a.isUndefined()) + return true; + else if (a.isInteger()) + return a.asInteger() == b.asInteger(); + else if (a.isReal()) + return a.asReal() == b.asReal(); + else if (a.isString()) + return a.asString() == b.asString(); + else if (a.isUUID()) + return a.asUUID() == b.asUUID(); + else if (a.isDate()) + return a.asDate() == b.asDate(); + else if (a.isURI()) + return a.asString() == b.asString(); // compare URIs as strings + else if (a.isBoolean()) + return a.asBoolean() == b.asBoolean(); + else + return false; // no valid operation for Binary +} + +//************************************ + +LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) + : LLPanel(), + mDragHandle(NULL), + mTitle(p.title), + mShortTitle(p.short_title), + mSingleInstance(p.single_instance), + mKey(key), + mAutoTile(p.auto_tile), + mCanTearOff(p.can_tear_off), + mCanMinimize(p.can_minimize), + mCanClose(p.can_close), + mDragOnLeft(p.can_drag_on_left), + mResizable(p.can_resize), + mMinWidth(p.min_width), + mMinHeight(p.min_height), + mMinimized(FALSE), + mForeground(FALSE), + mFirstLook(TRUE), + mEditing(FALSE), + mButtonScale(1.0f), + mAutoFocus(TRUE), // automatically take focus when opened + mHasBeenDraggedWhileMinimized(FALSE), + mPreviousMinimizedBottom(0), + mPreviousMinimizedLeft(0), + mNotificationContext(NULL) +{ + static LLUICachedControl<LLColor4> default_background_color ("FloaterDefaultBackgroundColor", *(new LLColor4)); + static LLUICachedControl<LLColor4> focus_background_color ("FloaterFocusBackgroundColor", *(new LLColor4)); + for (S32 i = 0; i < BUTTON_COUNT; i++) { - mButtonsEnabled[i] = FALSE; - mButtons[i] = NULL; + sButtonToolTips[i] =LLTrans::getString( sButtonToolTipsIndex[i]); } - for (S32 i = 0; i < 4; i++) - { - mResizeBar[i] = NULL; - mResizeHandle[i] = NULL; - } - mDragHandle = NULL; + mHandle.bind(this); mNotificationContext = new LLFloaterNotificationContext(getHandle()); -} + mBgColorAlpha = default_background_color; + mBgColorOpaque = focus_background_color; -LLFloater::LLFloater(const std::string& name) -: LLPanel(name), mAutoFocus(TRUE) // automatically take focus when opened -{ - for (S32 i = 0; i < BUTTON_COUNT; i++) - { - mButtonsEnabled[i] = FALSE; - mButtons[i] = NULL; - } for (S32 i = 0; i < 4; i++) { - mResizeBar[i] = NULL; + mResizeBar[i] = NULL; mResizeHandle[i] = NULL; } - std::string title; // null string - initFloater(title, FALSE, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, FALSE, TRUE, TRUE); // defaults -} + // Clicks stop here. + setMouseOpaque(TRUE); + + // Floaters always draw their background, unlike every other panel. + setBackgroundVisible(TRUE); -LLFloater::LLFloater(const std::string& name, const LLRect& rect, const std::string& title, - BOOL resizable, - S32 min_width, - S32 min_height, - BOOL drag_on_left, - BOOL minimizable, - BOOL close_btn, - BOOL bordered) -: LLPanel(name, rect, bordered), mAutoFocus(TRUE) // automatically take focus when opened -{ + // Floaters start not minimized. When minimized, they save their + // prior rectangle to be used on restore. + mExpandedRect.set(0,0,0,0); + for (S32 i = 0; i < BUTTON_COUNT; i++) { mButtonsEnabled[i] = FALSE; @@ -189,259 +253,176 @@ LLFloater::LLFloater(const std::string& name, const LLRect& rect, const std::str mResizeBar[i] = NULL; mResizeHandle[i] = NULL; } - initFloater( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn); -} + + initFromParams(p); + + // chrome floaters don't take focus at all + setFocusRoot(!getIsChrome()); -LLFloater::LLFloater(const std::string& name, const std::string& rect_control, const std::string& title, - BOOL resizable, - S32 min_width, - S32 min_height, - BOOL drag_on_left, - BOOL minimizable, - BOOL close_btn, - BOOL bordered) -: LLPanel(name, rect_control, bordered), mAutoFocus(TRUE) // automatically take focus when opened -{ - for (S32 i = 0; i < BUTTON_COUNT; i++) - { - mButtonsEnabled[i] = FALSE; - mButtons[i] = NULL; - } - for (S32 i = 0; i < 4; i++) - { - mResizeBar[i] = NULL; - mResizeHandle[i] = NULL; - } - initFloater( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn); + initFloater(); } - // Note: Floaters constructed from XML call init() twice! -void LLFloater::initFloater(const std::string& title, - BOOL resizable, S32 min_width, S32 min_height, - BOOL drag_on_left, BOOL minimizable, BOOL close_btn) +void LLFloater::initFloater() { - mHandle.bind(this); - mNotificationContext = new LLFloaterNotificationContext(getHandle()); - - // Init function can be called more than once, so clear out old data. - for (S32 i = 0; i < BUTTON_COUNT; i++) - { - mButtonsEnabled[i] = FALSE; - if (mButtons[i] != NULL) - { - removeChild(mButtons[i]); - delete mButtons[i]; - mButtons[i] = NULL; - } - } - mButtonScale = 1.f; + addDragHandle(); + + addResizeCtrls(); - //sjb: Thia is a bit of a hack: - BOOL need_border = hasBorder(); - // remove the border since deleteAllChildren() will also delete the border (but not clear mBorder) - removeBorder(); - // this will delete mBorder too - deleteAllChildren(); - // add the border back if we want it - if (need_border) + // Close button. + if (mCanClose) { - addBorder(); + mButtonsEnabled[BUTTON_CLOSE] = TRUE; } - // chrome floaters don't take focus at all - setFocusRoot(!getIsChrome()); - - // Reset cached pointers - mDragHandle = NULL; - for (S32 i = 0; i < 4; i++) + // Minimize button only for top draggers + if ( !mDragOnLeft && mCanMinimize ) { - mResizeBar[i] = NULL; - mResizeHandle[i] = NULL; + mButtonsEnabled[BUTTON_MINIMIZE] = TRUE; } - mCanTearOff = TRUE; - mEditing = FALSE; - // Clicks stop here. - setMouseOpaque(TRUE); + buildButtons(); - mFirstLook = TRUE; - mForeground = FALSE; - mDragOnLeft = drag_on_left == TRUE; + // Floaters are created in the invisible state + setVisible(FALSE); - // Floaters always draw their background, unlike every other panel. - setBackgroundVisible(TRUE); + // add self to handle->floater map + sFloaterMap[mHandle] = this; - // Floaters start not minimized. When minimized, they save their - // prior rectangle to be used on restore. - mMinimized = FALSE; - mExpandedRect.set(0,0,0,0); - - S32 close_pad; // space to the right of close box - S32 close_box_size; // For layout purposes, how big is the close box? - if (close_btn) - { - close_box_size = LLFLOATER_CLOSE_BOX_SIZE; - close_pad = 0; - } - else + if (!getParent()) { - close_box_size = 0; - close_pad = 0; + gFloaterView->addChild(this); } +} - S32 minimize_box_size; - S32 minimize_pad; - if (minimizable && !drag_on_left) - { - minimize_box_size = LLFLOATER_CLOSE_BOX_SIZE; - minimize_pad = 0; - } - else +void LLFloater::addDragHandle() +{ + static LLUICachedControl<S32> floater_close_box_size ("UIFloaterCloseBoxSize", 0); + S32 close_box_size = mCanClose ? floater_close_box_size : 0; + + if (!mDragHandle) { - minimize_box_size = 0; - minimize_pad = 0; + if (mDragOnLeft) + { + LLDragHandleLeft::Params p; + p.name("drag"); + p.follows.flags(FOLLOWS_ALL); + p.label(mTitle); + mDragHandle = LLUICtrlFactory::create<LLDragHandleLeft>(p); + } + else // drag on top + { + LLDragHandleTop::Params p; + p.name("Drag Handle"); + p.follows.flags(FOLLOWS_ALL); + p.label(mTitle); + mDragHandle = LLUICtrlFactory::create<LLDragHandleTop>(p); + } + addChild(mDragHandle); } - - // Drag Handle - // Add first so it's in the background. -// const S32 drag_pad = 2; - if (drag_on_left) + LLRect rect; + if (mDragOnLeft) { - LLRect drag_handle_rect; - drag_handle_rect.setOriginAndSize( - 0, 0, - DRAG_HANDLE_WIDTH, - getRect().getHeight() - LLPANEL_BORDER_WIDTH - close_box_size); - mDragHandle = new LLDragHandleLeft(std::string("drag"), drag_handle_rect, title ); + rect.setLeftTopAndSize(0, 0, DRAG_HANDLE_WIDTH, getRect().getHeight() - LLPANEL_BORDER_WIDTH - close_box_size); } else // drag on top { - LLRect drag_handle_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - mDragHandle = new LLDragHandleTop( std::string("Drag Handle"), drag_handle_rect, title ); - } - addChild(mDragHandle); - - // Resize Handle - mResizable = resizable; - mMinWidth = min_width; - mMinHeight = min_height; - - if( mResizable ) - { - // Resize bars (sides) - const S32 RESIZE_BAR_THICKNESS = 3; - mResizeBar[LLResizeBar::LEFT] = new LLResizeBar( - std::string("resizebar_left"), - this, - LLRect( 0, getRect().getHeight(), RESIZE_BAR_THICKNESS, 0), - min_width, S32_MAX, LLResizeBar::LEFT ); - addChild( mResizeBar[0] ); - - mResizeBar[LLResizeBar::TOP] = new LLResizeBar( - std::string("resizebar_top"), - this, - LLRect( 0, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_BAR_THICKNESS), - min_height, S32_MAX, LLResizeBar::TOP ); - addChild( mResizeBar[1] ); - - mResizeBar[LLResizeBar::RIGHT] = new LLResizeBar( - std::string("resizebar_right"), - this, - LLRect( getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0), - min_width, S32_MAX, LLResizeBar::RIGHT ); - addChild( mResizeBar[2] ); - - mResizeBar[LLResizeBar::BOTTOM] = new LLResizeBar( - std::string("resizebar_bottom"), - this, - LLRect( 0, RESIZE_BAR_THICKNESS, getRect().getWidth(), 0), - min_height, S32_MAX, LLResizeBar::BOTTOM ); - addChild( mResizeBar[3] ); - - - // Resize handles (corners) - mResizeHandle[0] = new LLResizeHandle( - std::string("Resize Handle"), - LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT, getRect().getWidth(), 0), - min_width, - min_height, - LLResizeHandle::RIGHT_BOTTOM); - addChild(mResizeHandle[0]); - - mResizeHandle[1] = new LLResizeHandle( - std::string("resize"), - LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_HANDLE_HEIGHT), - min_width, - min_height, - LLResizeHandle::RIGHT_TOP ); - addChild(mResizeHandle[1]); - - mResizeHandle[2] = new LLResizeHandle( std::string("resize"), - LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 ), - min_width, - min_height, - LLResizeHandle::LEFT_BOTTOM ); - addChild(mResizeHandle[2]); - - mResizeHandle[3] = new LLResizeHandle( std::string("resize"), - LLRect( 0, getRect().getHeight(), RESIZE_HANDLE_WIDTH, getRect().getHeight() - RESIZE_HANDLE_HEIGHT ), - min_width, - min_height, - LLResizeHandle::LEFT_TOP ); - addChild(mResizeHandle[3]); + rect = getLocalRect(); } + mDragHandle->setRect(rect); + updateButtons(); + applyTitle(); +} - // Close button. - if (close_btn) +void LLFloater::addResizeCtrls() +{ + for (S32 i = 0; i < 4; i++) { - mButtonsEnabled[BUTTON_CLOSE] = TRUE; + if (mResizeBar[i]) + { + removeChild(mResizeBar[i]); + delete mResizeBar[i]; + mResizeBar[i] = NULL; + } + if (mResizeHandle[i]) + { + removeChild(mResizeHandle[i]); + delete mResizeHandle[i]; + mResizeHandle[i] = NULL; + } } - - // Minimize button only for top draggers - if ( !drag_on_left && minimizable ) + if( !mResizable ) { - mButtonsEnabled[BUTTON_MINIMIZE] = TRUE; + return; } + + // Resize bars (sides) + const S32 RESIZE_BAR_THICKNESS = 3; + LLResizeBar::Params p; + p.name("resizebar_left"); + p.resizing_view(this); + p.rect(LLRect( 0, getRect().getHeight(), RESIZE_BAR_THICKNESS, 0)); + p.min_size(mMinWidth); + p.side(LLResizeBar::LEFT); + mResizeBar[LLResizeBar::LEFT] = LLUICtrlFactory::create<LLResizeBar>(p); + addChild( mResizeBar[LLResizeBar::LEFT] ); + + p.name("resizebar_top"); + p.rect(LLRect( 0, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_BAR_THICKNESS)); + p.min_size(mMinHeight); + p.side(LLResizeBar::TOP); + + mResizeBar[LLResizeBar::TOP] = LLUICtrlFactory::create<LLResizeBar>(p); + addChild( mResizeBar[LLResizeBar::TOP] ); + + p.name("resizebar_right"); + p.rect(LLRect(getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0)); + p.min_size(mMinWidth); + p.side(LLResizeBar::RIGHT); + + mResizeBar[LLResizeBar::RIGHT] = LLUICtrlFactory::create<LLResizeBar>(p); + addChild( mResizeBar[LLResizeBar::RIGHT] ); + + p.name("resizebar_bottom"); + p.rect(LLRect(0, RESIZE_BAR_THICKNESS, getRect().getWidth(), 0)); + p.min_size(mMinHeight); + p.side(LLResizeBar::BOTTOM); + mResizeBar[LLResizeBar::BOTTOM] = LLUICtrlFactory::create<LLResizeBar>(p); + addChild( mResizeBar[LLResizeBar::BOTTOM] ); + + // Resize handles (corners) + LLResizeHandle::Params handle_p; + handle_p.rect(LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT, getRect().getWidth(), 0)); + handle_p.min_width(mMinWidth); + handle_p.min_height(mMinHeight); + handle_p.corner(LLResizeHandle::RIGHT_BOTTOM); + mResizeHandle[0] = LLUICtrlFactory::create<LLResizeHandle>(handle_p); + addChild(mResizeHandle[0]); + + handle_p.rect(LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_HANDLE_HEIGHT)); + handle_p.corner(LLResizeHandle::RIGHT_TOP); + mResizeHandle[1] = LLUICtrlFactory::create<LLResizeHandle>(handle_p); + addChild(mResizeHandle[1]); + + handle_p.rect(LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 )); + handle_p.corner(LLResizeHandle::LEFT_BOTTOM); + mResizeHandle[2] = LLUICtrlFactory::create<LLResizeHandle>(handle_p); + addChild(mResizeHandle[2]); - // Keep track of whether this window has ever been dragged while it - // was minimized. If it has, we'll remember its position for the - // next time it's minimized. - mHasBeenDraggedWhileMinimized = FALSE; - mPreviousMinimizedLeft = 0; - mPreviousMinimizedBottom = 0; - - buildButtons(); - - // JC - Don't do this here, because many floaters first construct themselves, - // then show themselves. Put it in setVisibleAndFrontmost. - // make_ui_sound("UISndWindowOpen"); - - // RN: floaters are created in the invisible state - setVisible(FALSE); - - // add self to handle->floater map - sFloaterMap[mHandle] = this; - - if (!getParent()) - { - gFloaterView->addChild(this); - } + handle_p.rect(LLRect( 0, getRect().getHeight(), RESIZE_HANDLE_WIDTH, getRect().getHeight() - RESIZE_HANDLE_HEIGHT )); + handle_p.corner(LLResizeHandle::LEFT_TOP); + mResizeHandle[3] = LLUICtrlFactory::create<LLResizeHandle>(handle_p); + addChild(mResizeHandle[3]); } // virtual LLFloater::~LLFloater() { + LLFloaterReg::removeInstance(mInstanceName, mKey); + delete mNotificationContext; mNotificationContext = NULL; - control_map_t::iterator itor; - for (itor = mFloaterControls.begin(); itor != mFloaterControls.end(); ++itor) - { - delete itor->second; - } - mFloaterControls.clear(); - //// am I not hosted by another floater? //if (mHostHandle.isDead()) //{ @@ -469,8 +450,27 @@ LLFloater::~LLFloater() delete mResizeBar[i]; delete mResizeHandle[i]; } + + storeRectControl(); + setVisible(false); // We're not visible if we're destroyed + storeVisibilityControl(); +} + +void LLFloater::storeRectControl() +{ + if( mRectControl.size() > 1 ) + { + LLUI::sSettingGroups["floater"]->setRect( mRectControl, getRect() ); + } } +void LLFloater::storeVisibilityControl() +{ + if( mVisibilityControl.size() > 1 ) + { + LLUI::sSettingGroups["floater"]->setBOOL( mVisibilityControl, getVisible() ); + } +} void LLFloater::setVisible( BOOL visible ) { @@ -504,10 +504,25 @@ void LLFloater::setVisible( BOOL visible ) } ++dependent_it; } + + storeVisibilityControl(); +} + +// virtual +void LLFloater::onVisibilityChange ( BOOL new_visibility ) +{ + if (new_visibility) + { + if (getHost()) + getHost()->setFloaterFlashing(this, FALSE); + } + LLPanel::onVisibilityChange ( new_visibility ); } -void LLFloater::open() /* Flawfinder: ignore */ +void LLFloater::openFloater(const LLSD& key) { + mKey = key; // in case we need to open ourselves again + if (getSoundFlags() != SILENT // don't play open sound for hosted (tabbed) windows && !getHost() @@ -525,9 +540,11 @@ void LLFloater::open() /* Flawfinder: ignore */ // only select tabs if window they are hosted in is visible getFloaterHost()->addFloater(this, getFloaterHost()->getVisible()); } - else if (getHost() != NULL) + + if (getHost() != NULL) { - // already hosted + getHost()->setMinimized(FALSE); + getHost()->setVisibleAndFrontmost(mAutoFocus); getHost()->showFloater(this); } else @@ -536,10 +553,10 @@ void LLFloater::open() /* Flawfinder: ignore */ setVisibleAndFrontmost(mAutoFocus); } - onOpen(); + onOpen(key); } -void LLFloater::close(bool app_quitting) +void LLFloater::closeFloater(bool app_quitting) { // Always unminimize before trying to close. // Most of the time the user will never see this state. @@ -570,7 +587,7 @@ void LLFloater::close(bool app_quitting) if (floaterp) { ++dependent_it; - floaterp->close(); + floaterp->closeFloater(app_quitting); } else { @@ -597,7 +614,7 @@ void LLFloater::close(bool app_quitting) } } } - + // Let floater do cleanup. onClose(app_quitting); } @@ -607,6 +624,7 @@ void LLFloater::close(bool app_quitting) void LLFloater::reshape(S32 width, S32 height, BOOL called_from_parent) { LLPanel::reshape(width, height, called_from_parent); + storeRectControl(); } void LLFloater::releaseFocus() @@ -664,15 +682,23 @@ void LLFloater::center() centerWithin(gFloaterView->getRect()); } +LLMultiFloater* LLFloater::getHost() +{ + return (LLMultiFloater*)mHostHandle.get(); +} + void LLFloater::applyRectControl() { - if (!getRectControl().empty()) + if (mRectControl.size() > 1) { - const LLRect& rect = LLUI::sConfigGroup->getRect(getRectControl()); - translate( rect.mLeft - getRect().mLeft, rect.mBottom - getRect().mBottom); - if (mResizable) + const LLRect& rect = LLUI::sSettingGroups["floater"]->getRect(mRectControl); + if (rect.getWidth() > 0 && rect.getHeight() > 0) { - reshape(llmax(mMinWidth, rect.getWidth()), llmax(mMinHeight, rect.getHeight())); + translate( rect.mLeft - getRect().mLeft, rect.mBottom - getRect().mBottom); + if (mResizable) + { + reshape(llmax(mMinWidth, rect.getWidth()), llmax(mMinHeight, rect.getHeight())); + } } } } @@ -763,7 +789,7 @@ BOOL LLFloater::canSnapTo(const LLView* other_view) return LLPanel::canSnapTo(other_view); } -void LLFloater::snappedTo(const LLView* snap_view) +void LLFloater::setSnappedTo(const LLView* snap_view) { if (!snap_view || snap_view == getParent()) { @@ -778,10 +804,10 @@ void LLFloater::snappedTo(const LLView* snap_view) } } -void LLFloater::userSetShape(const LLRect& new_rect) +void LLFloater::handleReshape(const LLRect& new_rect, bool by_user) { const LLRect old_rect = getRect(); - LLView::userSetShape(new_rect); + LLView::handleReshape(new_rect, by_user); // if not minimized, adjust all snapped dependents to new shape if (!isMinimized()) @@ -816,7 +842,7 @@ void LLFloater::userSetShape(const LLRect& new_rect) delta_y += new_rect.mBottom - old_rect.mBottom; dependent_rect.translate(delta_x, delta_y); - floaterp->userSetShape(dependent_rect); + floaterp->setShape(dependent_rect, by_user); } } } @@ -834,6 +860,9 @@ void LLFloater::userSetShape(const LLRect& new_rect) void LLFloater::setMinimized(BOOL minimize) { + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + static LLUICachedControl<S32> minimized_width ("UIMinimizedWidth", 0); + if (minimize == mMinimized) return; if (minimize) @@ -902,7 +931,7 @@ void LLFloater::setMinimized(BOOL minimize) mMinimized = TRUE; // Reshape *after* setting mMinimized - reshape( MINIMIZED_WIDTH, LLFLOATER_HEADER_SIZE, TRUE); + reshape( minimized_width, floater_header_size, TRUE); } else { @@ -995,6 +1024,13 @@ void LLFloater::setFocus( BOOL b ) } } +// virtual +void LLFloater::setRect(const LLRect &rect) +{ + LLPanel::setRect(rect); + addDragHandle(); // re-add drag handle, sized based on rect +} + // virtual void LLFloater::setIsChrome(BOOL is_chrome) { @@ -1276,19 +1312,18 @@ void LLFloater::setEditModeEnabled(BOOL enable) // static -void LLFloater::onClickMinimize(void *userdata) +void LLFloater::onClickMinimize(LLFloater* self) { - LLFloater* self = (LLFloater*) userdata; - if (!self) return; - + if (!self) + return; self->setMinimized( !self->isMinimized() ); } -void LLFloater::onClickTearOff(void *userdata) +void LLFloater::onClickTearOff(LLFloater* self) { - LLFloater* self = (LLFloater*) userdata; - if (!self) return; - + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + if (!self) + return; LLMultiFloater* host_floater = self->getHost(); if (host_floater) //Tear off { @@ -1297,12 +1332,12 @@ void LLFloater::onClickTearOff(void *userdata) // reparent to floater view gFloaterView->addChild(self); - self->open(); /* Flawfinder: ignore */ + self->openFloater(self->getKey()); // only force position for floaters that don't have that data saved - if (self->getRectControl().empty()) + if (self->mRectControl.size() <= 1) { - new_rect.setLeftTopAndSize(host_floater->getRect().mLeft + 5, host_floater->getRect().mTop - LLFLOATER_HEADER_SIZE - 5, self->getRect().getWidth(), self->getRect().getHeight()); + new_rect.setLeftTopAndSize(host_floater->getRect().mLeft + 5, host_floater->getRect().mTop - floater_header_size - 5, self->getRect().getWidth(), self->getRect().getHeight()); self->setRect(new_rect); } gFloaterView->adjustToFitScreen(self, FALSE); @@ -1317,17 +1352,16 @@ void LLFloater::onClickTearOff(void *userdata) self->setMinimized(FALSE); // to reenable minimize button if it was minimized new_host->showFloater(self); // make sure host is visible - new_host->open(); + new_host->openFloater(new_host->getKey()); } } } // static -void LLFloater::onClickEdit(void *userdata) +void LLFloater::onClickEdit(LLFloater* self) { - LLFloater* self = (LLFloater*) userdata; - if (!self) return; - + if (!self) + return; self->mEditing = self->mEditing ? FALSE : TRUE; } @@ -1373,7 +1407,7 @@ void LLFloater::closeFocusedFloater() LLFloater* floater_to_close = LLFloater::getClosableFloaterFromFocus(); if(floater_to_close) { - floater_to_close->close(); + floater_to_close->closeFloater(); } // if nothing took focus after closing focused floater @@ -1388,12 +1422,11 @@ void LLFloater::closeFocusedFloater() // static -void LLFloater::onClickClose( void* userdata ) +void LLFloater::onClickClose( LLFloater* self ) { - LLFloater* self = (LLFloater*) userdata; - if (!self) return; - - self->close(); + if (!self) + return; + self->closeFloater(false); } @@ -1408,8 +1441,11 @@ void LLFloater::draw() S32 right = getRect().getWidth() - LLPANEL_BORDER_WIDTH; S32 bottom = LLPANEL_BORDER_WIDTH; - LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); - F32 shadow_offset = (F32)LLUI::sConfigGroup->getS32("DropShadowFloater"); + static LLUICachedControl<S32> shadow_offset_S32 ("DropShadowFloater", 0); + static LLUICachedControl<LLColor4> shadow_color_cached ("ColorDropShadow", *(new LLColor4)); + LLColor4 shadow_color = shadow_color_cached; + F32 shadow_offset = (F32)shadow_offset_S32; + if (!isBackgroundOpaque()) { shadow_offset *= 0.2f; @@ -1422,20 +1458,21 @@ void LLFloater::draw() // No transparent windows in simple UI if (isBackgroundOpaque()) { - gl_rect_2d( left, top, right, bottom, getBackgroundColor() ); + gl_rect_2d( left, top, right, bottom, mBgColorOpaque ); } else { - gl_rect_2d( left, top, right, bottom, getTransparentColor() ); + gl_rect_2d( left, top, right, bottom, mBgColorAlpha ); } if(gFocusMgr.childHasKeyboardFocus(this) && !getIsChrome() && !getCurrentTitle().empty()) { + static LLUICachedControl<LLColor4> titlebar_focus_color ("TitleBarFocusColor", *(new LLColor4)); // draw highlight on title bar to indicate focus. RDW - const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); + const LLFontGL* font = LLFontGL::getFontSansSerif(); LLRect r = getRect(); gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1, - LLUI::sColorsGroup->getColor("TitleBarFocusColor"), 0, TRUE); + titlebar_focus_color, 0, TRUE); } } @@ -1489,8 +1526,10 @@ void LLFloater::draw() { // add in a border to improve spacialized visual aclarity ;) // use lines instead of gl_rect_2d so we can round the edges as per james' recommendation + static LLUICachedControl<LLColor4> focus_border_color ("FloaterFocusBorderColor", *(new LLColor4)); + static LLUICachedControl<LLColor4> unfocus_border_color ("FloaterUnfocusBorderColor", *(new LLColor4)); LLUI::setLineWidth(1.5f); - LLColor4 outlineColor = gFocusMgr.childHasKeyboardFocus(this) ? LLUI::sColorsGroup->getColor("FloaterFocusBorderColor") : LLUI::sColorsGroup->getColor("FloaterUnfocusBorderColor"); + LLColor4 outlineColor = gFocusMgr.childHasKeyboardFocus(this) ? focus_border_color() : unfocus_border_color; gl_rect_2d_offset_local(0, getRect().getHeight() + 1, getRect().getWidth() + 1, 0, outlineColor, -LLPANEL_BORDER_WIDTH, FALSE); LLUI::setLineWidth(1.f); } @@ -1511,6 +1550,7 @@ void LLFloater::setCanMinimize(BOOL can_minimize) { // if removing minimize/restore button programmatically, // go ahead and unminimize floater + mCanMinimize = can_minimize; if (!can_minimize) { setMinimized(FALSE); @@ -1524,6 +1564,7 @@ void LLFloater::setCanMinimize(BOOL can_minimize) void LLFloater::setCanClose(BOOL can_close) { + mCanClose = can_close; mButtonsEnabled[BUTTON_CLOSE] = can_close; updateButtons(); @@ -1538,83 +1579,10 @@ void LLFloater::setCanTearOff(BOOL can_tear_off) } -void LLFloater::setCanResize(BOOL can_resize) +void LLFloater::setCanResize(BOOL can_resize) { - if (mResizable && !can_resize) - { - for (S32 i = 0; i < 4; i++) - { - removeChild(mResizeBar[i], TRUE); - mResizeBar[i] = NULL; - - removeChild(mResizeHandle[i], TRUE); - mResizeHandle[i] = NULL; - } - } - else if (!mResizable && can_resize) - { - // Resize bars (sides) - const S32 RESIZE_BAR_THICKNESS = 3; - mResizeBar[0] = new LLResizeBar( - std::string("resizebar_left"), - this, - LLRect( 0, getRect().getHeight(), RESIZE_BAR_THICKNESS, 0), - mMinWidth, S32_MAX, LLResizeBar::LEFT ); - addChild( mResizeBar[0] ); - - mResizeBar[1] = new LLResizeBar( - std::string("resizebar_top"), - this, - LLRect( 0, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_BAR_THICKNESS), - mMinHeight, S32_MAX, LLResizeBar::TOP ); - addChild( mResizeBar[1] ); - - mResizeBar[2] = new LLResizeBar( - std::string("resizebar_right"), - this, - LLRect( getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0), - mMinWidth, S32_MAX, LLResizeBar::RIGHT ); - addChild( mResizeBar[2] ); - - mResizeBar[3] = new LLResizeBar( - std::string("resizebar_bottom"), - this, - LLRect( 0, RESIZE_BAR_THICKNESS, getRect().getWidth(), 0), - mMinHeight, S32_MAX, LLResizeBar::BOTTOM ); - addChild( mResizeBar[3] ); - - - // Resize handles (corners) - mResizeHandle[0] = new LLResizeHandle( - std::string("Resize Handle"), - LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT, getRect().getWidth(), 0), - mMinWidth, - mMinHeight, - LLResizeHandle::RIGHT_BOTTOM); - addChild(mResizeHandle[0]); - - mResizeHandle[1] = new LLResizeHandle( std::string("resize"), - LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_HANDLE_HEIGHT), - mMinWidth, - mMinHeight, - LLResizeHandle::RIGHT_TOP ); - addChild(mResizeHandle[1]); - - mResizeHandle[2] = new LLResizeHandle( std::string("resize"), - LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 ), - mMinWidth, - mMinHeight, - LLResizeHandle::LEFT_BOTTOM ); - addChild(mResizeHandle[2]); - - mResizeHandle[3] = new LLResizeHandle( std::string("resize"), - LLRect( 0, getRect().getHeight(), RESIZE_HANDLE_WIDTH, getRect().getHeight() - RESIZE_HANDLE_HEIGHT ), - mMinWidth, - mMinHeight, - LLResizeHandle::LEFT_TOP ); - addChild(mResizeHandle[3]); - } mResizable = can_resize; + addResizeCtrls(); } void LLFloater::setCanDrag(BOOL can_drag) @@ -1633,6 +1601,8 @@ void LLFloater::setCanDrag(BOOL can_drag) void LLFloater::updateButtons() { + static LLUICachedControl<S32> floater_close_box_size ("UIFloaterCloseBoxSize", 0); + static LLUICachedControl<S32> close_box_from_top ("UICloseBoxFromTop", 0); S32 button_count = 0; for (S32 i = 0; i < BUTTON_COUNT; i++) { @@ -1652,17 +1622,17 @@ void LLFloater::updateButtons() { btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH, - getRect().getHeight() - CLOSE_BOX_FROM_TOP - (LLFLOATER_CLOSE_BOX_SIZE + 1) * button_count, - llround((F32)LLFLOATER_CLOSE_BOX_SIZE * mButtonScale), - llround((F32)LLFLOATER_CLOSE_BOX_SIZE * mButtonScale)); + getRect().getHeight() - close_box_from_top - (floater_close_box_size + 1) * button_count, + llround((F32)floater_close_box_size * mButtonScale), + llround((F32)floater_close_box_size * mButtonScale)); } else { btn_rect.setLeftTopAndSize( - getRect().getWidth() - LLPANEL_BORDER_WIDTH - (LLFLOATER_CLOSE_BOX_SIZE + 1) * button_count, - getRect().getHeight() - CLOSE_BOX_FROM_TOP, - llround((F32)LLFLOATER_CLOSE_BOX_SIZE * mButtonScale), - llround((F32)LLFLOATER_CLOSE_BOX_SIZE * mButtonScale)); + getRect().getWidth() - LLPANEL_BORDER_WIDTH - (floater_close_box_size + 1) * button_count, + getRect().getHeight() - close_box_from_top, + llround((F32)floater_close_box_size * mButtonScale), + llround((F32)floater_close_box_size * mButtonScale)); } mButtons[i]->setRect(btn_rect); @@ -1676,50 +1646,56 @@ void LLFloater::updateButtons() } } if (mDragHandle) - mDragHandle->setMaxTitleWidth(getRect().getWidth() - (button_count * (LLFLOATER_CLOSE_BOX_SIZE + 1))); + mDragHandle->setMaxTitleWidth(getRect().getWidth() - (button_count * (floater_close_box_size + 1))); } void LLFloater::buildButtons() { + static LLUICachedControl<S32> floater_close_box_size ("UIFloaterCloseBoxSize", 0); + static LLUICachedControl<S32> close_box_from_top ("UICloseBoxFromTop", 0); for (S32 i = 0; i < BUTTON_COUNT; i++) { + if (mButtons[i]) + { + removeChild(mButtons[i]); + delete mButtons[i]; + mButtons[i] = NULL; + } + LLRect btn_rect; if (mDragOnLeft) { btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH, - getRect().getHeight() - CLOSE_BOX_FROM_TOP - (LLFLOATER_CLOSE_BOX_SIZE + 1) * (i + 1), - llround(LLFLOATER_CLOSE_BOX_SIZE * mButtonScale), - llround(LLFLOATER_CLOSE_BOX_SIZE * mButtonScale)); + getRect().getHeight() - close_box_from_top - (floater_close_box_size + 1) * (i + 1), + llround(floater_close_box_size * mButtonScale), + llround(floater_close_box_size * mButtonScale)); } else { btn_rect.setLeftTopAndSize( - getRect().getWidth() - LLPANEL_BORDER_WIDTH - (LLFLOATER_CLOSE_BOX_SIZE + 1) * (i + 1), - getRect().getHeight() - CLOSE_BOX_FROM_TOP, - llround(LLFLOATER_CLOSE_BOX_SIZE * mButtonScale), - llround(LLFLOATER_CLOSE_BOX_SIZE * mButtonScale)); - } - - LLButton* buttonp = new LLButton( - sButtonNames[i], - btn_rect, - sButtonActiveImageNames[i], - sButtonPressedImageNames[i], - LLStringUtil::null, - sButtonCallbacks[i], - this, - LLFontGL::getFontSansSerif()); - - buttonp->setTabStop(FALSE); - buttonp->setFollowsTop(); - buttonp->setFollowsRight(); - buttonp->setToolTip( sButtonToolTips[i] ); - buttonp->setImageColor(LLUI::sColorsGroup->getColor("FloaterButtonImageColor")); - buttonp->setHoverImages(sButtonPressedImageNames[i], - sButtonPressedImageNames[i]); - buttonp->setScaleImage(TRUE); - buttonp->setSaveToXML(false); + getRect().getWidth() - LLPANEL_BORDER_WIDTH - (floater_close_box_size + 1) * (i + 1), + getRect().getHeight() - close_box_from_top, + llround(floater_close_box_size * mButtonScale), + llround(floater_close_box_size * mButtonScale)); + } + + LLButton::Params p; + p.name(sButtonNames[i]); + p.rect(btn_rect); + p.label(""); + p.image_unselected.name(sButtonActiveImageNames[i]); + p.image_selected.name(sButtonPressedImageNames[i]); + p.image_hover_selected.name(sButtonPressedImageNames[i]); + p.image_hover_unselected.name(sButtonPressedImageNames[i]); + p.click_callback.function(boost::bind(sButtonCallbacks[i], this)); + p.tab_stop(false); + p.follows.flags(FOLLOWS_TOP|FOLLOWS_RIGHT); + p.tool_tip(sButtonToolTips[i]); + p.image_color(LLUI::getCachedColorFunctor("FloaterButtonImageColor")); + p.scale_image(true); + + LLButton* buttonp = LLUICtrlFactory::create<LLButton>(p); addChild(buttonp); mButtons[i] = buttonp; } @@ -1730,13 +1706,12 @@ void LLFloater::buildButtons() ///////////////////////////////////////////////////// // LLFloaterView -LLFloaterView::LLFloaterView( const std::string& name, const LLRect& rect ) -: LLUICtrl( name, rect, FALSE, NULL, NULL, FOLLOWS_ALL ), +LLFloaterView::LLFloaterView (const Params& p) +: LLUICtrl (p), mFocusCycleMode(FALSE), mSnapOffsetBottom(0) + ,mSnapOffsetRight(0) { - setTabStop(FALSE); - resetStartingFloaterPosition(); } // By default, adjust vertical. @@ -1830,69 +1805,6 @@ void LLFloaterView::restoreAll() } -void LLFloaterView::getNewFloaterPosition(S32* left,S32* top) -{ - // Workaround: mRect may change between when this object is created and the first time it is used. - static BOOL first = TRUE; - if( first ) - { - resetStartingFloaterPosition(); - first = FALSE; - } - - const S32 FLOATER_PAD = 16; - LLCoordWindow window_size; - getWindow()->getSize(&window_size); - LLRect full_window(0, window_size.mY, window_size.mX, 0); - LLRect floater_creation_rect( - 160, - full_window.getHeight() - 2 * MENU_BAR_HEIGHT, - full_window.getWidth() * 2 / 3, - 130 ); - floater_creation_rect.stretch( -FLOATER_PAD ); - - *left = mNextLeft; - *top = mNextTop; - - const S32 STEP = 25; - S32 bottom = floater_creation_rect.mBottom + 2 * STEP; - S32 right = floater_creation_rect.mRight - 4 * STEP; - - mNextTop -= STEP; - mNextLeft += STEP; - - if( (mNextTop < bottom ) || (mNextLeft > right) ) - { - mColumn++; - mNextTop = floater_creation_rect.mTop; - mNextLeft = STEP * mColumn; - - if( (mNextTop < bottom) || (mNextLeft > right) ) - { - // Advancing the column didn't work, so start back at the beginning - resetStartingFloaterPosition(); - } - } -} - -void LLFloaterView::resetStartingFloaterPosition() -{ - const S32 FLOATER_PAD = 16; - LLCoordWindow window_size; - getWindow()->getSize(&window_size); - LLRect full_window(0, window_size.mY, window_size.mX, 0); - LLRect floater_creation_rect( - 160, - full_window.getHeight() - 2 * MENU_BAR_HEIGHT, - full_window.getWidth() * 2 / 3, - 130 ); - floater_creation_rect.stretch( -FLOATER_PAD ); - - mNextLeft = floater_creation_rect.mLeft; - mNextTop = floater_creation_rect.mTop; - mColumn = 0; -} - LLRect LLFloaterView::findNeighboringPosition( LLFloater* reference_floater, LLFloater* neighbor ) { LLRect base_rect = reference_floater->getRect(); @@ -2104,15 +2016,17 @@ void LLFloaterView::focusFrontFloater() void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom) { + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + static LLUICachedControl<S32> minimized_width ("UIMinimizedWidth", 0); S32 col = 0; LLRect snap_rect_local = getLocalSnapRect(); for(S32 row = snap_rect_local.mBottom; - row < snap_rect_local.getHeight() - LLFLOATER_HEADER_SIZE; - row += LLFLOATER_HEADER_SIZE ) //loop rows + row < snap_rect_local.getHeight() - floater_header_size; + row += floater_header_size ) //loop rows { for(col = snap_rect_local.mLeft; - col < snap_rect_local.getWidth() - MINIMIZED_WIDTH; - col += MINIMIZED_WIDTH) + col < snap_rect_local.getWidth() - minimized_width; + col += minimized_width) { bool foundGap = TRUE; for(child_list_const_iter_t child_it = getChildList()->begin(); @@ -2124,10 +2038,10 @@ void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom) if(floater->isMinimized()) { LLRect r = floater->getRect(); - if((r.mBottom < (row + LLFLOATER_HEADER_SIZE)) - && (r.mBottom > (row - LLFLOATER_HEADER_SIZE)) - && (r.mLeft < (col + MINIMIZED_WIDTH)) - && (r.mLeft > (col - MINIMIZED_WIDTH))) + if((r.mBottom < (row + floater_header_size)) + && (r.mBottom > (row - floater_header_size)) + && (r.mLeft < (col + minimized_width)) + && (r.mLeft > (col - minimized_width))) { // needs the check for off grid. can't drag, // but window resize makes them off @@ -2179,7 +2093,7 @@ void LLFloaterView::closeAllChildren(bool app_quitting) // dialogs to appear. if (floaterp->canClose() && !floaterp->isDead()) { - floaterp->close(app_quitting); + floaterp->closeFloater(app_quitting); } } } @@ -2202,14 +2116,13 @@ BOOL LLFloaterView::allChildrenClosed() return true; } - void LLFloaterView::refresh() { // Constrain children to be entirely on the screen for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { - LLFloater* floaterp = (LLFloater*)*child_it; - if( floaterp->getVisible() ) + LLFloater* floaterp = dynamic_cast<LLFloater*>(*child_it); + if (floaterp && floaterp->getVisible() ) { // minimized floaters are kept fully onscreen adjustToFitScreen(floaterp, !floaterp->isMinimized()); @@ -2302,11 +2215,12 @@ LLRect LLFloaterView::getSnapRect() const { LLRect snap_rect = getRect(); snap_rect.mBottom += mSnapOffsetBottom; + snap_rect.mRight -= mSnapOffsetRight; return snap_rect; } -LLFloater *LLFloaterView::getFocusedFloater() +LLFloater *LLFloaterView::getFocusedFloater() const { for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { @@ -2319,7 +2233,7 @@ LLFloater *LLFloaterView::getFocusedFloater() return NULL; } -LLFloater *LLFloaterView::getFrontmost() +LLFloater *LLFloaterView::getFrontmost() const { for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { @@ -2332,7 +2246,7 @@ LLFloater *LLFloaterView::getFrontmost() return NULL; } -LLFloater *LLFloaterView::getBackmost() +LLFloater *LLFloaterView::getBackmost() const { LLFloater* back_most = NULL; for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) @@ -2348,18 +2262,51 @@ LLFloater *LLFloaterView::getBackmost() void LLFloaterView::syncFloaterTabOrder() { - // bring focused floater to front - for ( child_list_const_reverse_iter_t child_it = getChildList()->rbegin(); child_it != getChildList()->rend(); ++child_it) + // look for a visible modal dialog, starting from first (should be only one) + LLModalDialog* modal_dialog = NULL; + for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { - LLFloater* floaterp = (LLFloater*)*child_it; - if (gFocusMgr.childHasKeyboardFocus(floaterp)) + LLModalDialog* dialog = dynamic_cast<LLModalDialog*>(*child_it); + if (dialog && dialog->isModal() && dialog->getVisible()) { - bringToFront(floaterp, FALSE); + modal_dialog = dialog; break; } } - // then sync draw order to tab order + if (modal_dialog) + { + // If we have a visible modal dialog, make sure that it has focus + if( gFocusMgr.getTopCtrl() != modal_dialog ) + { + gFocusMgr.setTopCtrl( modal_dialog ); + } + + if( !gFocusMgr.childHasKeyboardFocus( modal_dialog ) ) + { + modal_dialog->setFocus(TRUE); + } + + if( !gFocusMgr.childHasMouseCapture( modal_dialog ) ) + { + gFocusMgr.setMouseCapture( modal_dialog ); + } + } + else + { + // otherwise, make sure the focused floater is in the front of the child list + for ( child_list_const_reverse_iter_t child_it = getChildList()->rbegin(); child_it != getChildList()->rend(); ++child_it) + { + LLFloater* floaterp = (LLFloater*)*child_it; + if (gFocusMgr.childHasKeyboardFocus(floaterp)) + { + bringToFront(floaterp, FALSE); + break; + } + } + } + + // sync draw order to tab order for ( child_list_const_reverse_iter_t child_it = getChildList()->rbegin(); child_it != getChildList()->rend(); ++child_it) { LLFloater* floaterp = (LLFloater*)*child_it; @@ -2367,7 +2314,7 @@ void LLFloaterView::syncFloaterTabOrder() } } -LLFloater* LLFloaterView::getParentFloater(LLView* viewp) +LLFloater* LLFloaterView::getParentFloater(LLView* viewp) const { LLView* parentp = viewp->getParent(); @@ -2426,641 +2373,166 @@ void LLFloaterView::popVisibleAll(const skip_list_t& skip_list) } } -// -// LLMultiFloater -// - -LLMultiFloater::LLMultiFloater() : - mTabContainer(NULL), - mTabPos(LLTabContainer::TOP), - mAutoResize(TRUE), - mOrigMinWidth(0), - mOrigMinHeight(0) -{ - -} - -LLMultiFloater::LLMultiFloater(LLTabContainer::TabPosition tab_pos) : - mTabContainer(NULL), - mTabPos(tab_pos), - mAutoResize(TRUE), - mOrigMinWidth(0), - mOrigMinHeight(0) -{ - -} - -LLMultiFloater::LLMultiFloater(const std::string &name) : - LLFloater(name), - mTabContainer(NULL), - mTabPos(LLTabContainer::TOP), - mAutoResize(FALSE), - mOrigMinWidth(0), - mOrigMinHeight(0) -{ -} - -LLMultiFloater::LLMultiFloater( - const std::string& name, - const LLRect& rect, - LLTabContainer::TabPosition tab_pos, - BOOL auto_resize) : - LLFloater(name, rect, name), - mTabContainer(NULL), - mTabPos(LLTabContainer::TOP), - mAutoResize(auto_resize), - mOrigMinWidth(0), - mOrigMinHeight(0) -{ - mTabContainer = new LLTabContainer(std::string("Preview Tabs"), - LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - LLFLOATER_HEADER_SIZE, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0), - mTabPos, - FALSE, - FALSE); - mTabContainer->setFollowsAll(); - if (isResizable()) - { - mTabContainer->setRightTabBtnOffset(RESIZE_HANDLE_WIDTH); - } - - addChild(mTabContainer); -} - -LLMultiFloater::LLMultiFloater( - const std::string& name, - const std::string& rect_control, - LLTabContainer::TabPosition tab_pos, - BOOL auto_resize) : - LLFloater(name, rect_control, name), - mTabContainer(NULL), - mTabPos(tab_pos), - mAutoResize(auto_resize), - mOrigMinWidth(0), - mOrigMinHeight(0) -{ - mTabContainer = new LLTabContainer(std::string("Preview Tabs"), - LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - LLFLOATER_HEADER_SIZE, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0), - mTabPos, - FALSE, - FALSE); - mTabContainer->setFollowsAll(); - if (isResizable() && mTabPos == LLTabContainer::BOTTOM) - { - mTabContainer->setRightTabBtnOffset(RESIZE_HANDLE_WIDTH); - } - - addChild(mTabContainer); - -} - - -void LLMultiFloater::open() /* Flawfinder: ignore */ -{ - if (mTabContainer->getTabCount() > 0) - { - LLFloater::open(); /* Flawfinder: ignore */ - } - else - { - // for now, don't allow multifloaters - // without any child floaters - close(); - } -} - -void LLMultiFloater::onClose(bool app_quitting) +void LLFloater::setInstanceName(const std::string& name) { - if(closeAllFloaters() == TRUE) - { - LLFloater::onClose(app_quitting); - }//else not all tabs could be closed... -} - -void LLMultiFloater::draw() -{ - if (mTabContainer->getTabCount() == 0) - { - //RN: could this potentially crash in draw hierarchy? - close(); - } - else + if (name == mInstanceName) + return; + llassert_always(mInstanceName.empty()); + mInstanceName = name; + if (!mInstanceName.empty()) { - for (S32 i = 0; i < mTabContainer->getTabCount(); i++) + // save_rect and save_visibility only apply to registered floaters + if (!mRectControl.empty()) { - LLFloater* floaterp = (LLFloater*)mTabContainer->getPanelByIndex(i); - if (floaterp->getShortTitle() != mTabContainer->getPanelTitle(i)) - { - mTabContainer->setPanelTitle(i, floaterp->getShortTitle()); - } + mRectControl = LLFloaterReg::declareRectControl(mInstanceName); } - LLFloater::draw(); - } -} - -BOOL LLMultiFloater::closeAllFloaters() -{ - S32 tabToClose = 0; - S32 lastTabCount = mTabContainer->getTabCount(); - while (tabToClose < mTabContainer->getTabCount()) - { - LLFloater* first_floater = (LLFloater*)mTabContainer->getPanelByIndex(tabToClose); - first_floater->close(); - if(lastTabCount == mTabContainer->getTabCount()) - { - //Tab did not actually close, possibly due to a pending Save Confirmation dialog.. - //so try and close the next one in the list... - tabToClose++; - }else + if (!mVisibilityControl.empty()) { - //Tab closed ok. - lastTabCount = mTabContainer->getTabCount(); + mVisibilityControl = LLFloaterReg::declareVisibilityControl(mInstanceName); } } - if( mTabContainer->getTabCount() != 0 ) - return FALSE; // Couldn't close all the tabs (pending save dialog?) so return FALSE. - return TRUE; //else all tabs were successfully closed... } -void LLMultiFloater::growToFit(S32 content_width, S32 content_height) +void LLFloater::setKey(const LLSD& newkey) { - S32 new_width = llmax(getRect().getWidth(), content_width + LLPANEL_BORDER_WIDTH * 2); - S32 new_height = llmax(getRect().getHeight(), content_height + LLFLOATER_HEADER_SIZE + TABCNTR_HEADER_HEIGHT); - - if (isMinimized()) - { - LLRect newrect; - newrect.setLeftTopAndSize(getExpandedRect().mLeft, getExpandedRect().mTop, new_width, new_height); - setExpandedRect(newrect); - } - else - { - S32 old_height = getRect().getHeight(); - reshape(new_width, new_height); - // keep top left corner in same position - translate(0, old_height - new_height); - } + // Note: We don't have to do anything special with registration when we change keys + mKey = newkey; } -/** - void addFloater(LLFloater* floaterp, BOOL select_added_floater) - - Adds the LLFloater pointed to by floaterp to this. - If floaterp is already hosted by this, then it is re-added to get - new titles, etc. - If select_added_floater is true, the LLFloater pointed to by floaterp will - become the selected tab in this - - Affects: mTabContainer, floaterp -**/ -void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point) +//static +void LLFloater::setupParamsForExport(Params& p, LLView* parent) { - if (!floaterp) - { - return; - } - - if (!mTabContainer) - { - llerrs << "Tab Container used without having been initialized." << llendl; - return; - } - - if (floaterp->getHost() == this) - { - // already hosted by me, remove - // do this so we get updated title, etc. - mFloaterDataMap.erase(floaterp->getHandle()); - mTabContainer->removeTabPanel(floaterp); - } - else if (floaterp->getHost()) - { - // floaterp is hosted by somebody else and - // this is adding it, so remove it from it's old host - floaterp->getHost()->removeFloater(floaterp); - } - else if (floaterp->getParent() == gFloaterView) - { - // rehost preview floater as child panel - gFloaterView->removeChild(floaterp); - } - - // store original configuration - LLFloaterData floater_data; - floater_data.mWidth = floaterp->getRect().getWidth(); - floater_data.mHeight = floaterp->getRect().getHeight(); - floater_data.mCanMinimize = floaterp->isMinimizeable(); - floater_data.mCanResize = floaterp->isResizable(); + // Do rectangle munging to topleft layout first + LLPanel::setupParamsForExport(p, parent); - // remove minimize and close buttons - floaterp->setCanMinimize(FALSE); - floaterp->setCanResize(FALSE); - floaterp->setCanDrag(FALSE); - floaterp->storeRectControl(); - // avoid double rendering of floater background (makes it more opaque) - floaterp->setBackgroundVisible(FALSE); - - if (mAutoResize) - { - growToFit(floater_data.mWidth, floater_data.mHeight); - } + // Copy the rectangle out to apply layout constraints + LLRect rect = p.rect; - //add the panel, add it to proper maps - mTabContainer->addTabPanel(floaterp, floaterp->getShortTitle(), FALSE, onTabSelected, this, 0, FALSE, insertion_point); - mFloaterDataMap[floaterp->getHandle()] = floater_data; + // Null out other settings + p.rect.left.setProvided(false); + p.rect.top.setProvided(false); + p.rect.right.setProvided(false); + p.rect.bottom.setProvided(false); - updateResizeLimits(); + // Explicitly set width/height + p.rect.width.set( rect.getWidth(), true ); + p.rect.height.set( rect.getHeight(), true ); - if ( select_added_floater ) - { - mTabContainer->selectTabPanel(floaterp); - } - else + // If you can't resize this floater, don't export min_height + // and min_width + bool can_resize = p.can_resize; + if (!can_resize) { - // reassert visible tab (hiding new floater if necessary) - mTabContainer->selectTab(mTabContainer->getCurrentPanelIndex()); - } - - floaterp->setHost(this); - if (isMinimized()) - { - floaterp->setVisible(FALSE); + p.min_height.setProvided(false); + p.min_width.setProvided(false); } } -/** - BOOL selectFloater(LLFloater* floaterp) - - If the LLFloater pointed to by floaterp is hosted by this, - then its tab is selected and returns true. Otherwise returns false. - - Affects: mTabContainer -**/ -BOOL LLMultiFloater::selectFloater(LLFloater* floaterp) +void LLFloater::initFromParams(const LLFloater::Params& p) { - return mTabContainer->selectTabPanel(floaterp); -} + // control_name, tab_stop, focus_lost_callback, initial_value, rect, enabled, visible + LLPanel::initFromParams(p); -// virtual -void LLMultiFloater::selectNextFloater() -{ - mTabContainer->selectNextTab(); -} + mTitle = p.title; + mShortTitle = p.short_title; + applyTitle(); -// virtual -void LLMultiFloater::selectPrevFloater() -{ - mTabContainer->selectPrevTab(); -} + setCanTearOff(p.can_tear_off); + setCanMinimize(p.can_minimize); + setCanClose(p.can_close); + + mDragOnLeft = p.can_drag_on_left; + mResizable = p.can_resize; + mMinWidth = p.min_width; + mMinHeight = p.min_height; + mSingleInstance = p.single_instance; + mAutoTile = p.auto_tile; -void LLMultiFloater::showFloater(LLFloater* floaterp) -{ - // we won't select a panel that already is selected - // it is hard to do this internally to tab container - // as tab selection is handled via index and the tab at a given - // index might have changed - if (floaterp != mTabContainer->getCurrentPanel() && - !mTabContainer->selectTabPanel(floaterp)) + if (p.save_rect) { - addFloater(floaterp, TRUE); + mRectControl = "t"; // flag to build mRectControl name once mInstanceName is set } -} - -void LLMultiFloater::removeFloater(LLFloater* floaterp) -{ - if ( floaterp->getHost() != this ) - return; - - floater_data_map_t::iterator found_data_it = mFloaterDataMap.find(floaterp->getHandle()); - if (found_data_it != mFloaterDataMap.end()) + if (p.save_visibility) { - LLFloaterData& floater_data = found_data_it->second; - floaterp->setCanMinimize(floater_data.mCanMinimize); - if (!floater_data.mCanResize) - { - // restore original size - floaterp->reshape(floater_data.mWidth, floater_data.mHeight); - } - floaterp->setCanResize(floater_data.mCanResize); - mFloaterDataMap.erase(found_data_it); + mVisibilityControl = "t"; // flag to build mVisibilityControl name once mInstanceName is set } - mTabContainer->removeTabPanel(floaterp); - floaterp->setBackgroundVisible(TRUE); - floaterp->setCanDrag(TRUE); - floaterp->setHost(NULL); - floaterp->applyRectControl(); - - updateResizeLimits(); - - tabOpen((LLFloater*)mTabContainer->getCurrentPanel(), false); } -void LLMultiFloater::tabOpen(LLFloater* opened_floater, bool from_click) +void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, BOOL open_floater, LLXMLNodePtr output_node) { - // default implementation does nothing -} + Params params(LLUICtrlFactory::getDefaultParams<LLFloater::Params>()); + LLXUIParser::instance().readXUI(node, params); -void LLMultiFloater::tabClose() -{ - if (mTabContainer->getTabCount() == 0) + if (output_node) { - // no more children, close myself - close(); + Params output_params(params); + setupParamsForExport(output_params, parent); + Params default_params(LLUICtrlFactory::getDefaultParams<LLFloater::Params>()); + output_node->setName(node->getName()->mString); + LLXUIParser::instance().writeXUI( + output_node, output_params, &default_params); } -} -void LLMultiFloater::setVisible(BOOL visible) -{ - // *FIX: shouldn't have to do this, fix adding to minimized multifloater - LLFloater::setVisible(visible); + setupParams(params, parent); + initFromParams(params); + + initFloater(); - if (mTabContainer) + LLMultiFloater* last_host = LLFloater::getFloaterHost(); + if (node->hasName("multi_floater")) { - LLPanel* cur_floaterp = mTabContainer->getCurrentPanel(); + LLFloater::setFloaterHost((LLMultiFloater*) this); + } - if (cur_floaterp) - { - cur_floaterp->setVisible(visible); - } + LLUICtrlFactory::createChildren(this, node, output_node); - // if no tab selected, and we're being shown, - // select last tab to be added - if (visible && !cur_floaterp) - { - mTabContainer->selectLastTab(); - } + if (node->hasName("multi_floater")) + { + LLFloater::setFloaterHost(last_host); } -} + + BOOL result = postBuild(); -BOOL LLMultiFloater::handleKeyHere(KEY key, MASK mask) -{ - if (key == 'W' && mask == MASK_CONTROL) + if (!result) { - LLFloater* floater = getActiveFloater(); - // is user closeable and is system closeable - if (floater && floater->canClose() && floater->isCloseable()) - { - floater->close(); - } - return TRUE; + llerrs << "Failed to construct floater " << getName() << llendl; } - return LLFloater::handleKeyHere(key, mask); -} - -LLFloater* LLMultiFloater::getActiveFloater() -{ - return (LLFloater*)mTabContainer->getCurrentPanel(); -} - -S32 LLMultiFloater::getFloaterCount() -{ - return mTabContainer->getTabCount(); -} - -/** - BOOL isFloaterFlashing(LLFloater* floaterp) - - Returns true if the LLFloater pointed to by floaterp - is currently in a flashing state and is hosted by this. - False otherwise. - - Requires: floaterp != NULL -**/ -BOOL LLMultiFloater::isFloaterFlashing(LLFloater* floaterp) -{ - if ( floaterp && floaterp->getHost() == this ) - return mTabContainer->getTabPanelFlashing(floaterp); - - return FALSE; -} - -/** - BOOL setFloaterFlashing(LLFloater* floaterp, BOOL flashing) - - Sets the current flashing state of the LLFloater pointed - to by floaterp to be the BOOL flashing if the LLFloater pointed - to by floaterp is hosted by this. - - Requires: floaterp != NULL -**/ -void LLMultiFloater::setFloaterFlashing(LLFloater* floaterp, BOOL flashing) -{ - if ( floaterp && floaterp->getHost() == this ) - mTabContainer->setTabPanelFlashing(floaterp, flashing); -} - -//static -void LLMultiFloater::onTabSelected(void* userdata, bool from_click) -{ - LLMultiFloater* floaterp = (LLMultiFloater*)userdata; - - floaterp->tabOpen((LLFloater*)floaterp->mTabContainer->getCurrentPanel(), from_click); -} + applyRectControl(); // If we have a saved rect control, apply it + gFloaterView->adjustToFitScreen(this, FALSE); // Floaters loaded from XML should all fit on screen -void LLMultiFloater::setCanResize(BOOL can_resize) -{ - LLFloater::setCanResize(can_resize); - if (isResizable() && mTabContainer->getTabPosition() == LLTabContainer::BOTTOM) + if (open_floater) { - mTabContainer->setRightTabBtnOffset(RESIZE_HANDLE_WIDTH); - } - else - { - mTabContainer->setRightTabBtnOffset(0); + this->openFloater(getKey()); } + + moveResizeHandlesToFront(); } -BOOL LLMultiFloater::postBuild() +// visibility methods +bool VisibilityPolicy<LLFloater>::visible(LLFloater* instance, const LLSD& key) { - // remember any original xml minimum size - getResizeLimits(&mOrigMinWidth, &mOrigMinHeight); - - if (mTabContainer) - { - return TRUE; - } - - requires<LLTabContainer>("Preview Tabs"); - if (checkRequirements()) + if (instance) { - mTabContainer = getChild<LLTabContainer>("Preview Tabs"); - return TRUE; + return !instance->isMinimized() && instance->isInVisibleChain(); } - return FALSE; } -void LLMultiFloater::updateResizeLimits() +void VisibilityPolicy<LLFloater>::show(LLFloater* instance, const LLSD& key) { - // initialize minimum size constraint to the original xml values. - S32 new_min_width = mOrigMinWidth; - S32 new_min_height = mOrigMinHeight; - // possibly increase minimum size constraint due to children's minimums. - for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx) + if (instance) { - LLFloater* floaterp = (LLFloater*)mTabContainer->getPanelByIndex(tab_idx); - if (floaterp) + instance->openFloater(key); + if (instance->getHost()) { - new_min_width = llmax(new_min_width, floaterp->getMinWidth() + LLPANEL_BORDER_WIDTH * 2); - new_min_height = llmax(new_min_height, floaterp->getMinHeight() + LLFLOATER_HEADER_SIZE + TABCNTR_HEADER_HEIGHT); + instance->getHost()->openFloater(key); } } - setResizeLimits(new_min_width, new_min_height); - - S32 cur_height = getRect().getHeight(); - S32 new_width = llmax(getRect().getWidth(), new_min_width); - S32 new_height = llmax(getRect().getHeight(), new_min_height); - - if (isMinimized()) - { - const LLRect& expanded = getExpandedRect(); - LLRect newrect; - newrect.setLeftTopAndSize(expanded.mLeft, expanded.mTop, llmax(expanded.getWidth(), new_width), llmax(expanded.getHeight(), new_height)); - setExpandedRect(newrect); - } - else - { - reshape(new_width, new_height); - - // make sure upper left corner doesn't move - translate(0, cur_height - getRect().getHeight()); - - // make sure this window is visible on screen when it has been modified - // (tab added, etc) - gFloaterView->adjustToFitScreen(this, TRUE); - } } -// virtual -LLXMLNodePtr LLFloater::getXML(bool save_children) const +void VisibilityPolicy<LLFloater>::hide(LLFloater* instance, const LLSD& key) { - LLXMLNodePtr node = LLPanel::getXML(); - - node->createChild("title", TRUE)->setStringValue(getCurrentTitle()); - - node->createChild("can_resize", TRUE)->setBoolValue(isResizable()); - - node->createChild("can_minimize", TRUE)->setBoolValue(isMinimizeable()); - - node->createChild("can_close", TRUE)->setBoolValue(isCloseable()); - - node->createChild("can_drag_on_left", TRUE)->setBoolValue(isDragOnLeft()); - - node->createChild("min_width", TRUE)->setIntValue(getMinWidth()); - - node->createChild("min_height", TRUE)->setIntValue(getMinHeight()); - - node->createChild("can_tear_off", TRUE)->setBoolValue(mCanTearOff); - - return node; -} - -// static -LLView* LLFloater::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("floater"); - node->getAttributeString("name", name); - - LLFloater *floaterp = new LLFloater(name); - - std::string filename; - node->getAttributeString("filename", filename); - - if (filename.empty()) - { - // Load from node - floaterp->initFloaterXML(node, parent, factory); - } - else - { - // Load from file - factory->buildFloater(floaterp, filename); - } - - return floaterp; + if (instance) instance->closeFloater(); } -void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory, BOOL open) /* Flawfinder: ignore */ -{ - std::string name(getName()); - std::string title(getCurrentTitle()); - std::string short_title(getShortTitle()); - std::string rect_control(""); - BOOL resizable = isResizable(); - S32 min_width = getMinWidth(); - S32 min_height = getMinHeight(); - BOOL drag_on_left = isDragOnLeft(); - BOOL minimizable = isMinimizeable(); - BOOL close_btn = isCloseable(); - LLRect rect; - - node->getAttributeString("name", name); - node->getAttributeString("title", title); - node->getAttributeString("short_title", short_title); - node->getAttributeString("rect_control", rect_control); - node->getAttributeBOOL("can_resize", resizable); - node->getAttributeBOOL("can_minimize", minimizable); - node->getAttributeBOOL("can_close", close_btn); - node->getAttributeBOOL("can_drag_on_left", drag_on_left); - node->getAttributeS32("min_width", min_width); - node->getAttributeS32("min_height", min_height); - - if (! rect_control.empty()) - { - setRectControl(rect_control); - } - - createRect(node, rect, parent, LLRect()); - - setRect(rect); - setName(name); - - initFloater(title, - resizable, - min_width, - min_height, - drag_on_left, - minimizable, - close_btn); - - setTitle(title); - applyTitle (); - - setShortTitle(short_title); - - BOOL can_tear_off; - if (node->getAttributeBOOL("can_tear_off", can_tear_off)) - { - setCanTearOff(can_tear_off); - } - - initFromXML(node, parent); - - LLMultiFloater* last_host = LLFloater::getFloaterHost(); - if (node->hasName("multi_floater")) - { - LLFloater::setFloaterHost((LLMultiFloater*) this); - } - - initChildrenXML(node, factory); - - if (node->hasName("multi_floater")) - { - LLFloater::setFloaterHost(last_host); - } - - BOOL result = postBuild(); - - if (!result) - { - llerrs << "Failed to construct floater " << name << llendl; - } - - applyRectControl(); - if (open) /* Flawfinder: ignore */ - { - this->open(); /* Flawfinder: ignore */ - } - - moveResizeHandlesToFront(); -} diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 0e3d148b09765902bc6bd390fd1fdd6322881167..421b7f3ec1b8e5bb44465b2ddb26574cdc63e8cb 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -39,7 +39,6 @@ #include "llpanel.h" #include "lluuid.h" -#include "lltabcontainer.h" #include "llnotifications.h" #include <set> @@ -50,17 +49,10 @@ class LLButton; class LLMultiFloater; class LLFloater; -const S32 LLFLOATER_VPAD = 6; -const S32 LLFLOATER_HPAD = 6; -const S32 LLFLOATER_CLOSE_BOX_SIZE = 16; -const S32 LLFLOATER_HEADER_SIZE = 18; const BOOL RESIZE_YES = TRUE; const BOOL RESIZE_NO = FALSE; -const S32 DEFAULT_MIN_WIDTH = 100; -const S32 DEFAULT_MIN_HEIGHT = 100; - const BOOL DRAG_ON_TOP = FALSE; const BOOL DRAG_ON_LEFT = TRUE; @@ -87,11 +79,22 @@ private: LLHandle<LLFloater> mFloaterHandle; }; - class LLFloater : public LLPanel { friend class LLFloaterView; +friend class LLFloaterReg; +friend class LLMultiFloater; public: + struct KeyCompare + { + static bool compare(const LLSD& a, const LLSD& b); + static bool equate(const LLSD& a, const LLSD& b); + bool operator()(const LLSD& a, const LLSD& b) const + { + return compare(a, b); + } + }; + enum EFloaterButtons { BUTTON_CLOSE, @@ -102,49 +105,66 @@ public: BUTTON_COUNT }; - LLFloater(); - LLFloater(const std::string& name); //simple constructor for data-driven initialization - LLFloater( const std::string& name, const LLRect& rect, const std::string& title, - BOOL resizable = FALSE, - S32 min_width = DEFAULT_MIN_WIDTH, - S32 min_height = DEFAULT_MIN_HEIGHT, - BOOL drag_on_left = FALSE, - BOOL minimizable = TRUE, - BOOL close_btn = TRUE, - BOOL bordered = BORDER_NO); - - LLFloater( const std::string& name, const std::string& rect_control, const std::string& title, - BOOL resizable = FALSE, - S32 min_width = DEFAULT_MIN_WIDTH, - S32 min_height = DEFAULT_MIN_HEIGHT, - BOOL drag_on_left = FALSE, - BOOL minimizable = TRUE, - BOOL close_btn = TRUE, - BOOL bordered = BORDER_NO); + struct Params + : public LLInitParam::Block<Params, LLPanel::Params> + { + Optional<std::string> title, + short_title; + + Optional<bool> single_instance, + auto_tile, + can_resize, + can_minimize, + can_close, + can_drag_on_left, + can_tear_off, + save_rect, + save_visibility; + + Params() : + title("title"), + short_title("short_title"), + single_instance("single_instance", false), + auto_tile("auto_tile", false), + can_resize("can_resize", false), + can_minimize("can_minimize", true), + can_close("can_close", true), + can_drag_on_left("can_drag_on_left", false), + can_tear_off("can_tear_off", true), + save_rect("save_rect", false), + save_visibility("save_visibility", false) + { + name = "floater"; + // defaults that differ from LLPanel: + background_visible = true; + visible = false; + } + }; + + LLFloater(const LLSD& key = LLSD(), const LLFloater::Params& params = LLFloater::Params()); virtual ~LLFloater(); - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - void initFloaterXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory, BOOL open = TRUE); + // Don't export top/left for rect, only height/width + static void setupParamsForExport(Params& p, LLView* parent); + + void initFromParams(const LLFloater::Params& p); + void initFloaterXML(LLXMLNodePtr node, LLView *parent, BOOL open_floater = TRUE, LLXMLNodePtr output_node = NULL); - /*virtual*/ void userSetShape(const LLRect& new_rect); + /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); /*virtual*/ BOOL canSnapTo(const LLView* other_view); - /*virtual*/ void snappedTo(const LLView* snap_view); + /*virtual*/ void setSnappedTo(const LLView* snap_view); /*virtual*/ void setFocus( BOOL b ); /*virtual*/ void setIsChrome(BOOL is_chrome); + /*virtual*/ void setRect(const LLRect &rect); - // Can be called multiple times to reset floater parameters. - // Deletes all children of the floater. - virtual void initFloater(const std::string& title, BOOL resizable, - S32 min_width, S32 min_height, BOOL drag_on_left, - BOOL minimizable, BOOL close_btn); + void initFloater(); - virtual void open(); /* Flawfinder: ignore */ + void openFloater(const LLSD& key = LLSD()); // If allowed, close the floater cleanly, releasing focus. // app_quitting is passed to onClose() below. - virtual void close(bool app_quitting = false); + void closeFloater(bool app_quitting = false); /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); @@ -153,11 +173,8 @@ public: // moves to center of gFloaterView void center(); - // applies rectangle stored in mRectControl, if any - void applyRectControl(); - - LLMultiFloater* getHost() { return (LLMultiFloater*)mHostHandle.get(); } + LLMultiFloater* getHost(); void applyTitle(); const std::string& getCurrentTitle() const; @@ -185,9 +202,8 @@ public: void setResizeLimits( S32 min_width, S32 min_height ); void getResizeLimits( S32* min_width, S32* min_height ) { *min_width = mMinWidth; *min_height = mMinHeight; } - bool isMinimizeable() const{ return mButtonsEnabled[BUTTON_MINIMIZE]; } - // Does this window have a close button, NOT can we close it right now. - bool isCloseable() const{ return (mButtonsEnabled[BUTTON_CLOSE]); } + bool isMinimizeable() const{ return mCanMinimize; } + bool isCloseable() const{ return mCanClose; } bool isDragOnLeft() const{ return mDragOnLeft; } S32 getMinWidth() const{ return mMinWidth; } S32 getMinHeight() const{ return mMinHeight; } @@ -198,7 +214,7 @@ public: virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); virtual void draw(); - virtual void onOpen() {} + virtual void onOpen(const LLSD& key) {} // Call destroy() to free memory, or setVisible(FALSE) to keep it // If app_quitting, you might not want to save your visibility. @@ -210,8 +226,10 @@ public: virtual BOOL canClose() { return TRUE; } virtual void setVisible(BOOL visible); + virtual void onVisibilityChange ( BOOL curVisibilityIn ); + void setFrontmost(BOOL take_focus = TRUE); - + // Defaults to false. virtual BOOL canSaveAs() const { return FALSE; } @@ -222,6 +240,8 @@ public: LLHandle<LLFloater> getSnapTarget() const { return mSnappedTo; } LLHandle<LLFloater> getHandle() const { return mHandle; } + const LLSD& getKey() { return mKey; } + BOOL matchesKey(const LLSD& key) { return mSingleInstance || KeyCompare::equate(key, mKey); } // Return a closeable floater, if any, given the current focus. static LLFloater* getClosableFloaterFromFocus(); @@ -235,22 +255,30 @@ public: return LLNotification::Params(name).context(mNotificationContext); } - static void onClickClose(void *userdata); - static void onClickMinimize(void *userdata); - static void onClickTearOff(void *userdata); - static void onClickEdit(void *userdata); + static void onClickClose(LLFloater* floater); + static void onClickMinimize(LLFloater* floater); + static void onClickTearOff(LLFloater* floater); + static void onClickEdit(LLFloater* floater); static void setFloaterHost(LLMultiFloater* hostp) {sHostp = hostp; } static void setEditModeEnabled(BOOL enable); static BOOL getEditModeEnabled() { return sEditModeEnabled; } - static LLMultiFloater* getFloaterHost() {return sHostp; } - + static LLMultiFloater* getFloaterHost() {return sHostp; } + protected: + void setRectControl(const std::string& rectname) { mRectControl = rectname; }; + void applyRectControl(); + void storeRectControl(); + void storeVisibilityControl(); + + void setKey(const LLSD& key); + void setInstanceName(const std::string& name); + virtual void bringToFront(S32 x, S32 y); virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE); - void setExpandedRect(const LLRect& rect) { mExpandedRect = rect; } // size when not minimized + void setExpandedRect(const LLRect& rect) { mExpandedRect = rect; } // size when not minimized const LLRect& getExpandedRect() const { return mExpandedRect; } void setAutoFocus(BOOL focus) { mAutoFocus = focus; } // whether to automatically take focus when opened @@ -266,31 +294,48 @@ private: void updateButtons(); void buildButtons(); BOOL offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButtons index); - + void addResizeCtrls(); + void addDragHandle(); + +protected: + std::string mRectControl; + std::string mVisibilityControl; + + LLSD mKey; // Key used for retrieving instances; set (for now) by LLFLoaterReg + +private: LLRect mExpandedRect; LLDragHandle* mDragHandle; LLResizeBar* mResizeBar[4]; LLResizeHandle* mResizeHandle[4]; - LLButton *mMinimizeButton; + + LLUIString mTitle; + LLUIString mShortTitle; + + BOOL mSingleInstance; // TRUE if there is only ever one instance of the floater + std::string mInstanceName; // Store the instance name so we can remove ourselves from the list + BOOL mAutoTile; // TRUE if placement of new instances tiles + BOOL mCanTearOff; + BOOL mCanMinimize; + BOOL mCanClose; + BOOL mDragOnLeft; + BOOL mResizable; + + S32 mMinWidth; + S32 mMinHeight; + BOOL mMinimized; BOOL mForeground; LLHandle<LLFloater> mDependeeHandle; - std::string mTitle; - std::string mShortTitle; + BOOL mFirstLook; // TRUE if the _next_ time this floater is visible will be the first time in the session that it is visible. - - BOOL mResizable; - S32 mMinWidth; - S32 mMinHeight; - BOOL mEditing; typedef std::set<LLHandle<LLFloater> > handle_set_t; typedef std::set<LLHandle<LLFloater> >::iterator handle_set_iter_t; handle_set_t mDependents; - bool mDragOnLeft; BOOL mButtonsEnabled[BUTTON_COUNT]; LLButton* mButtons[BUTTON_COUNT]; @@ -308,7 +353,9 @@ private: static std::string sButtonPressedImageNames[BUTTON_COUNT]; static std::string sButtonNames[BUTTON_COUNT]; static std::string sButtonToolTips[BUTTON_COUNT]; - typedef void (*click_callback)(void *); + static std::string sButtonToolTipsIndex[BUTTON_COUNT]; + + typedef void(*click_callback)(LLFloater*); static click_callback sButtonCallbacks[BUTTON_COUNT]; typedef std::map<LLHandle<LLFloater>, LLFloater*> handle_map_t; @@ -320,7 +367,10 @@ private: BOOL mHasBeenDraggedWhileMinimized; S32 mPreviousMinimizedBottom; S32 mPreviousMinimizedLeft; - + + LLColor4 mBgColorAlpha; + LLColor4 mBgColorOpaque; + LLFloaterNotificationContext* mNotificationContext; LLRootHandle<LLFloater> mHandle; }; @@ -331,18 +381,18 @@ private: class LLFloaterView : public LLUICtrl { -public: - LLFloaterView( const std::string& name, const LLRect& rect ); +protected: + LLFloaterView (const Params& p); + friend class LLUICtrlFactory; +public: /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); void reshapeFloater(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical); /*virtual*/ void draw(); /*virtual*/ LLRect getSnapRect() const; - void refresh(); + /*virtual*/ void refresh(); - void getNewFloaterPosition( S32* left, S32* top ); - void resetStartingFloaterPosition(); LLRect findNeighboringPosition( LLFloater* reference_floater, LLFloater* neighbor ); // Given a child of gFloaterView, make sure this view can fit entirely onscreen. @@ -365,10 +415,10 @@ public: void closeAllChildren(bool app_quitting); BOOL allChildrenClosed(); - LLFloater* getFrontmost(); - LLFloater* getBackmost(); - LLFloater* getParentFloater(LLView* viewp); - LLFloater* getFocusedFloater(); + LLFloater* getFrontmost() const; + LLFloater* getBackmost() const; + LLFloater* getParentFloater(LLView* viewp) const; + LLFloater* getFocusedFloater() const; void syncFloaterTabOrder(); // Returns z order of child provided. 0 is closest, larger numbers @@ -377,6 +427,7 @@ public: S32 getZOrder(LLFloater* child); void setSnapOffsetBottom(S32 offset) { mSnapOffsetBottom = offset; } + void setSnapOffsetRight(S32 offset) { mSnapOffsetRight = offset; } private: S32 mColumn; @@ -384,101 +435,26 @@ private: S32 mNextTop; BOOL mFocusCycleMode; S32 mSnapOffsetBottom; + S32 mSnapOffsetRight; }; -// https://wiki.lindenlab.com/mediawiki/index.php?title=LLMultiFloater&oldid=81376 -class LLMultiFloater : public LLFloater -{ -public: - LLMultiFloater(); - LLMultiFloater(LLTabContainer::TabPosition tab_pos); - LLMultiFloater(const std::string& name); - LLMultiFloater(const std::string& name, const LLRect& rect, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = TRUE); - LLMultiFloater(const std::string& name, const std::string& rect_control, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = TRUE); - virtual ~LLMultiFloater() {}; - - virtual BOOL postBuild(); - /*virtual*/ void open(); /* Flawfinder: ignore */ - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void draw(); - /*virtual*/ void setVisible(BOOL visible); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); - - virtual void setCanResize(BOOL can_resize); - virtual void growToFit(S32 content_width, S32 content_height); - virtual void addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); - - virtual void showFloater(LLFloater* floaterp); - virtual void removeFloater(LLFloater* floaterp); - - virtual void tabOpen(LLFloater* opened_floater, bool from_click); - virtual void tabClose(); - - virtual BOOL selectFloater(LLFloater* floaterp); - virtual void selectNextFloater(); - virtual void selectPrevFloater(); - - virtual LLFloater* getActiveFloater(); - virtual BOOL isFloaterFlashing(LLFloater* floaterp); - virtual S32 getFloaterCount(); - - virtual void setFloaterFlashing(LLFloater* floaterp, BOOL flashing); - virtual BOOL closeAllFloaters(); //Returns FALSE if the floater could not be closed due to pending confirmation dialogs - void setTabContainer(LLTabContainer* tab_container) { if (!mTabContainer) mTabContainer = tab_container; } - static void onTabSelected(void* userdata, bool); - - virtual void updateResizeLimits(); - -protected: - struct LLFloaterData - { - S32 mWidth; - S32 mHeight; - BOOL mCanMinimize; - BOOL mCanResize; - }; - - LLTabContainer* mTabContainer; - - typedef std::map<LLHandle<LLFloater>, LLFloaterData> floater_data_map_t; - floater_data_map_t mFloaterDataMap; - - LLTabContainer::TabPosition mTabPos; - BOOL mAutoResize; - S32 mOrigMinWidth, mOrigMinHeight; // logically const but initialized late -}; +// singleton implementation for floaters +// https://wiki.lindenlab.com/mediawiki/index.php?title=LLFloaterSingleton&oldid=164990 +//******************************************************* +//* TO BE DEPRECATED +//******************************************************* // visibility policy specialized for floaters template<> class VisibilityPolicy<LLFloater> { public: // visibility methods - static bool visible(LLFloater* instance, const LLSD& key) - { - if (instance) - { - return !instance->isMinimized() && instance->isInVisibleChain(); - } - return FALSE; - } + static bool visible(LLFloater* instance, const LLSD& key); - static void show(LLFloater* instance, const LLSD& key) - { - if (instance) - { - instance->open(); - if (instance->getHost()) - { - instance->getHost()->open(); - } - } - } + static void show(LLFloater* instance, const LLSD& key); - static void hide(LLFloater* instance, const LLSD& key) - { - if (instance) instance->close(); - } + static void hide(LLFloater* instance, const LLSD& key); }; @@ -489,6 +465,10 @@ template <class T> class LLFloaterSingleton : public LLUISingleton<T, Visibility { }; +// +// Globals +// + extern LLFloaterView* gFloaterView; #endif // LL_FLOATER_H diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp new file mode 100644 index 0000000000000000000000000000000000000000..faa763cea97454610bbe41b22971e96fa2848266 --- /dev/null +++ b/indra/llui/llfloaterreg.cpp @@ -0,0 +1,423 @@ +/** + * @file llfloaterreg.cpp + * @brief LLFloaterReg Floater Registration Class + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "llfloaterreg.h" + +#include "llfloater.h" +#include "llmultifloater.h" + +//******************************************************* + +//static +LLFloaterReg::instance_list_t LLFloaterReg::sNullInstanceList; +LLFloaterReg::instance_map_t LLFloaterReg::sInstanceMap; +LLFloaterReg::build_map_t LLFloaterReg::sBuildMap; +std::map<std::string,std::string> LLFloaterReg::sGroupMap; + +//******************************************************* + +//static +void LLFloaterReg::add(const std::string& name, const std::string& filename, const LLFloaterBuildFunc& func, const std::string& groupname) +{ + sBuildMap[name].mFunc = func; + sBuildMap[name].mFile = filename; + sGroupMap[name] = groupname.empty() ? name : groupname; + sGroupMap[groupname] = groupname; // for referencing directly by group name +} + +//static +LLRect LLFloaterReg::getFloaterRect(const std::string& name) +{ + LLRect rect; + const std::string& groupname = sGroupMap[name]; + if (!groupname.empty()) + { + instance_list_t& list = sInstanceMap[groupname]; + if (!list.empty()) + { + static LLUICachedControl<S32> floater_offset ("UIFloaterOffset", 16); + LLFloater* last_floater = list.back(); + if (last_floater->getHost()) + { + rect = last_floater->getHost()->getRect(); + } + else + { + rect = last_floater->getRect(); + } + rect.translate(floater_offset, -floater_offset); + } + } + return rect; +} + +//static +LLFloater* LLFloaterReg::findInstance(const std::string& name, const LLSD& key) +{ + LLFloater* res = NULL; + const std::string& groupname = sGroupMap[name]; + if (!groupname.empty()) + { + instance_list_t& list = sInstanceMap[groupname]; + for (instance_list_t::iterator iter = list.begin(); iter != list.end(); ++iter) + { + LLFloater* inst = *iter; + if (inst->matchesKey(key)) + { + res = inst; + break; + } + } + } + return res; +} + +//static +LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) +{ + LLFloater* res = findInstance(name, key); + if (!res) + { + const LLFloaterBuildFunc& build_func = sBuildMap[name].mFunc; + const std::string& xui_file = sBuildMap[name].mFile; + if (build_func) + { + const std::string& groupname = sGroupMap[name]; + if (!groupname.empty()) + { + instance_list_t& list = sInstanceMap[groupname]; + int index = list.size(); + + res = build_func(key); + + const bool DONT_OPEN_FLOATER = false; + LLUICtrlFactory::getInstance()->buildFloater(res, xui_file, DONT_OPEN_FLOATER); + + // Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe + res->mKey = key; + res->setInstanceName(name); + res->applyRectControl(); // Can't apply rect control until setting instance name + if (res->mAutoTile && !res->getHost() && index > 0) + { + const LLRect& cur_rect = res->getRect(); + LLRect next_rect = getFloaterRect(groupname); + next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, cur_rect.getWidth(), cur_rect.getHeight()); + res->setRect(next_rect); + res->setRectControl(LLStringUtil::null); // don't save rect of tiled floaters + gFloaterView->adjustToFitScreen(res, true); + } + else + { + gFloaterView->adjustToFitScreen(res, false); + } + list.push_back(res); + } + } + if (!res) + { + llwarns << "Floater type: '" << name << "' not registered." << llendl; + } + } + return res; +} + +//static +LLFloater* LLFloaterReg::removeInstance(const std::string& name, const LLSD& key) +{ + LLFloater* res = NULL; + const std::string& groupname = sGroupMap[name]; + if (!groupname.empty()) + { + instance_list_t& list = sInstanceMap[groupname]; + for (instance_list_t::iterator iter = list.begin(); iter != list.end(); ++iter) + { + LLFloater* inst = *iter; + if (inst->matchesKey(key)) + { + res = inst; + list.erase(iter); + break; + } + } + } + return res; +} + +//static +// returns true if the instance existed +bool LLFloaterReg::destroyInstance(const std::string& name, const LLSD& key) +{ + LLFloater* inst = removeInstance(name, key); + if (inst) + { + delete inst; + return true; + } + else + { + return false; + } +} + +// Iterators +//static +LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::string& name) +{ + instance_map_t::iterator iter = sInstanceMap.find(name); + if (iter != sInstanceMap.end()) + { + return iter->second; + } + else + { + return sNullInstanceList; + } +} + +// Visibility Management + +//static +LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, BOOL focus) +{ + LLFloater* instance = getInstance(name, key); + if (instance) + { + instance->openFloater(key); + if (focus) + instance->setFocus(TRUE); + } + return instance; +} + +//static +// returns true if the instance exists +bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key) +{ + LLFloater* instance = findInstance(name, key); + if (instance) + { + // When toggling *visibility*, close the host instead of the floater when hosted + if (instance->getHost()) + instance->getHost()->closeFloater(); + else + instance->closeFloater(); + return true; + } + else + { + return false; + } +} + +//static +// returns true if the instance is visible when completed +bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key) +{ + LLFloater* instance = findInstance(name, key); + if (instance && !instance->isMinimized() && instance->isInVisibleChain()) + { + // When toggling *visibility*, close the host instead of the floater when hosted + if (instance->getHost()) + instance->getHost()->closeFloater(); + else + instance->closeFloater(); + return false; + } + else + { + return showInstance(name, key, TRUE) ? true : false; + } +} + +//static +// returns true if the instance exists and is visible +bool LLFloaterReg::instanceVisible(const std::string& name, const LLSD& key) +{ + LLFloater* instance = findInstance(name, key); + if (instance && !instance->isMinimized() && instance->isInVisibleChain()) + { + return true; + } + else + { + return false; + } +} + +//static +void LLFloaterReg::showInitialVisibleInstances() +{ + // Iterate through alll registered instance names and show any with a save visible state + for (build_map_t::iterator iter = sBuildMap.begin(); iter != sBuildMap.end(); ++iter) + { + const std::string& name = iter->first; + std::string controlname = getVisibilityControlName(name); + if (LLUI::sSettingGroups["floater"]->controlExists(controlname)) + { + BOOL isvis = LLUI::sSettingGroups["floater"]->getBOOL(controlname); + if (isvis) + { + showInstance(name, LLSD()); // keyed floaters shouldn't set save_vis to true + } + } + } +} + +//static +void LLFloaterReg::hideVisibleInstances(const std::set<std::string>& exceptions) +{ + // Iterate through alll active instances and hide them + for (instance_map_t::iterator iter = sInstanceMap.begin(); iter != sInstanceMap.end(); ++iter) + { + const std::string& name = iter->first; + if (exceptions.find(name) != exceptions.end()) + continue; + instance_list_t& list = iter->second; + for (instance_list_t::iterator iter = list.begin(); iter != list.end(); ++iter) + { + LLFloater* floater = *iter; + floater->pushVisible(FALSE); + } + } +} + +//static +void LLFloaterReg::restoreVisibleInstances() +{ + // Iterate through all active instances and restore visibility + for (instance_map_t::iterator iter = sInstanceMap.begin(); iter != sInstanceMap.end(); ++iter) + { + instance_list_t& list = iter->second; + for (instance_list_t::iterator iter = list.begin(); iter != list.end(); ++iter) + { + LLFloater* floater = *iter; + floater->popVisible(); + } + } +} + +//static +std::string LLFloaterReg::getRectControlName(const std::string& name) +{ + std::string res = std::string("floater_rect_") + name; + LLStringUtil::replaceChar( res, ' ', '_' ); + return res; +} + +//static +std::string LLFloaterReg::declareRectControl(const std::string& name) +{ + std::string controlname = getRectControlName(name); + LLUI::sSettingGroups["floater"]->declareRect(controlname, LLRect(), + llformat("Window Position and Size for %s", name.c_str()), + TRUE); + return controlname; +} + +//static +std::string LLFloaterReg::getVisibilityControlName(const std::string& name) +{ + std::string res = std::string("floater_vis_") + name; + LLStringUtil::replaceChar( res, ' ', '_' ); + return res; +} + +//static +std::string LLFloaterReg::declareVisibilityControl(const std::string& name) +{ + std::string controlname = getVisibilityControlName(name); + LLUI::sSettingGroups["floater"]->declareBOOL(controlname, FALSE, + llformat("Window Visibility for %s", name.c_str()), + TRUE); + return controlname; +} + +// Callbacks + +// static +// Call once (i.e use for init callbacks) +void LLFloaterReg::initUICtrlToFloaterVisibilityControl(LLUICtrl* ctrl, const LLSD& sdname) +{ + // Get the visibility control name for the floater + std::string vis_control_name = LLFloaterReg::declareVisibilityControl(sdname.asString()); + // Set the control value to the floater visibility control (Sets the value as well) + ctrl->setControlVariable(LLUI::sSettingGroups["floater"]->getControl(vis_control_name)); +} + +// callback args may use "floatername.key" format +static void parse_name_key(std::string& name, LLSD& key) +{ + std::string instname = name; + std::size_t dotpos = instname.find("."); + if (dotpos != std::string::npos) + { + name = instname.substr(0, dotpos); + key = LLSD(instname.substr(dotpos+1, std::string::npos)); + } +} + +//static +void LLFloaterReg::showFloaterInstance(const LLSD& sdname) +{ + LLSD key; + std::string name = sdname.asString(); + parse_name_key(name, key); + showInstance(name, key, TRUE); +} +//static +void LLFloaterReg::hideFloaterInstance(const LLSD& sdname) +{ + LLSD key; + std::string name = sdname.asString(); + parse_name_key(name, key); + hideInstance(name, key); +} +//static +void LLFloaterReg::toggleFloaterInstance(const LLSD& sdname) +{ + LLSD key; + std::string name = sdname.asString(); + parse_name_key(name, key); + toggleInstance(name, key); +} + +//static +bool LLFloaterReg::floaterInstanceVisible(const LLSD& sdname) +{ + LLSD key; + std::string name = sdname.asString(); + parse_name_key(name, key); + return instanceVisible(name, key); +} + diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h new file mode 100644 index 0000000000000000000000000000000000000000..ef2f71ad180ef5f065459d79cce00b428f994024 --- /dev/null +++ b/indra/llui/llfloaterreg.h @@ -0,0 +1,152 @@ +/** + * @file llfloaterreg.h + * @brief LLFloaterReg Floater Registration Class + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLFLOATERREG_H +#define LLFLOATERREG_H + +/// llcommon +#include "llboost.h" +#include "llrect.h" +#include "llstl.h" +#include "llsd.h" + +/// llui +#include "lluictrl.h" + +#include <boost/function.hpp> + +//******************************************************* +// +// Floater Class Registry +// + +class LLFloater; + +typedef boost::function<LLFloater* (const LLSD& key)> LLFloaterBuildFunc; + +class LLFloaterReg +{ +public: + // We use a list of LLFloater's instead of a set for two reasons: + // 1) With a list we have a predictable ordering, useful for finding the last opened floater of a given type. + // 2) We can change the key of a floater without altering the list. + typedef std::list<LLFloater*> instance_list_t; + typedef const instance_list_t const_instance_list_t; + typedef std::map<std::string, instance_list_t> instance_map_t; + + struct BuildData + { + LLFloaterBuildFunc mFunc; + std::string mFile; + }; + typedef std::map<std::string, BuildData> build_map_t; + +private: + static instance_list_t sNullInstanceList; + static instance_map_t sInstanceMap; + static build_map_t sBuildMap; + static std::map<std::string,std::string> sGroupMap; + +public: + // Registration + + // usage: LLFloaterClassRegistry::add("foo", (LLFloaterBuildFunc)&LLFloaterClassRegistry::build<LLFloaterFoo>); + template <class T> + static LLFloater* build(const LLSD& key) + { + T* floater = new T(key); + return floater; + } + + static void add(const std::string& name, const std::string& file, const LLFloaterBuildFunc& func, + const std::string& groupname = LLStringUtil::null); + + // Helpers + static LLRect getFloaterRect(const std::string& name); + + // Find / get (create) / remove / destroy + static LLFloater* findInstance(const std::string& name, const LLSD& key = LLSD()); + static LLFloater* getInstance(const std::string& name, const LLSD& key = LLSD()); + static LLFloater* removeInstance(const std::string& name, const LLSD& key = LLSD()); + static bool destroyInstance(const std::string& name, const LLSD& key = LLSD()); + + // Iterators + static const_instance_list_t& getFloaterList(const std::string& name); + + // Visibility Management + // return NULL if instance not found or can't create instance (no builder) + static LLFloater* showInstance(const std::string& name, const LLSD& key = LLSD(), BOOL focus = FALSE); + // Close a floater (may destroy or set invisible) + // return false if can't find instance + static bool hideInstance(const std::string& name, const LLSD& key = LLSD()); + // return true if instance is visible: + static bool toggleInstance(const std::string& name, const LLSD& key = LLSD()); + static bool instanceVisible(const std::string& name, const LLSD& key = LLSD()); + + static void showInitialVisibleInstances(); + static void hideVisibleInstances(const std::set<std::string>& exceptions = std::set<std::string>()); + static void restoreVisibleInstances(); + + // Control Variables + static std::string getRectControlName(const std::string& name); + static std::string declareRectControl(const std::string& name); + static std::string getVisibilityControlName(const std::string& name); + static std::string declareVisibilityControl(const std::string& name); + + // Callback wrappers + static void initUICtrlToFloaterVisibilityControl(LLUICtrl* ctrl, const LLSD& sdname); + static void showFloaterInstance(const LLSD& sdname); + static void hideFloaterInstance(const LLSD& sdname); + static void toggleFloaterInstance(const LLSD& sdname); + static bool floaterInstanceVisible(const LLSD& sdname); + + // Typed find / get / show + template <class T> + static T* findTypedInstance(const std::string& name, const LLSD& key = LLSD()) + { + return dynamic_cast<T*>(findInstance(name, key)); + } + + template <class T> + static T* getTypedInstance(const std::string& name, const LLSD& key = LLSD()) + { + return dynamic_cast<T*>(getInstance(name, key)); + } + + template <class T> + static T* showTypedInstance(const std::string& name, const LLSD& key = LLSD(), BOOL focus = FALSE) + { + return dynamic_cast<T*>(showInstance(name, key, focus)); + } + +}; + +#endif diff --git a/indra/llui/llflyoutbutton.cpp b/indra/llui/llflyoutbutton.cpp new file mode 100644 index 0000000000000000000000000000000000000000..62a321dc02d605334b50abe67dd427a39a91fa35 --- /dev/null +++ b/indra/llui/llflyoutbutton.cpp @@ -0,0 +1,94 @@ +/** + * @file llflyoutbutton.cpp + * @brief LLFlyoutButton base class + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +// file includes +#include "llflyoutbutton.h" + +static LLDefaultWidgetRegistry::Register<LLFlyoutButton> r2("flyout_button"); + +const S32 FLYOUT_BUTTON_ARROW_WIDTH = 24; + +LLFlyoutButton::LLFlyoutButton(const Params& p) +: LLComboBox(p), + mToggleState(FALSE), + mActionButton(NULL) +{ + // Always use text box + // Text label button + LLButton::Params bp(p.action_button); + bp.name(p.label); + bp.rect.left(0).bottom(0).width(getRect().getWidth() - FLYOUT_BUTTON_ARROW_WIDTH).height(getRect().getHeight()); + bp.click_callback.function(boost::bind(&LLFlyoutButton::onActionButtonClick, this, _2)); + bp.follows.flags(FOLLOWS_ALL); + + mActionButton = LLUICtrlFactory::create<LLButton>(bp); + addChild(mActionButton); + + mButton->setOrigin(getRect().getWidth() - FLYOUT_BUTTON_ARROW_WIDTH, 0); + mButton->reshape(FLYOUT_BUTTON_ARROW_WIDTH, getRect().getHeight()); + mButton->setFollows(FOLLOWS_RIGHT | FOLLOWS_TOP | FOLLOWS_BOTTOM); + mButton->setImageOverlay(mListPosition == BELOW ? "down_arrow.tga" : "up_arrow.tga", LLFontGL::RIGHT); +} + +void LLFlyoutButton::onActionButtonClick(const LLSD& data) +{ + // remember last list selection? + mList->deselect(); + onCommit(); +} + +void LLFlyoutButton::draw() +{ + mActionButton->setToggleState(mToggleState); + mButton->setToggleState(mToggleState); + + //FIXME: this should be an attribute of comboboxes, whether they have a distinct label or + // the label reflects the last selected item, for now we have to manually remove the label + mButton->setLabel(LLStringUtil::null); + LLComboBox::draw(); +} + +void LLFlyoutButton::setEnabled(BOOL enabled) +{ + mActionButton->setEnabled(enabled); + LLComboBox::setEnabled(enabled); +} + + +void LLFlyoutButton::setToggleState(BOOL state) +{ + mToggleState = state; +} + + diff --git a/indra/llui/llflyoutbutton.h b/indra/llui/llflyoutbutton.h new file mode 100644 index 0000000000000000000000000000000000000000..f60fe1eb3567911b56b11ed79aad5b14745dd1e4 --- /dev/null +++ b/indra/llui/llflyoutbutton.h @@ -0,0 +1,71 @@ +/** + * @file llflyoutbutton.h + * @brief LLFlyoutButton base class + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +// A control that displays the name of the chosen item, which when clicked +// shows a scrolling box of choices. + +#ifndef LL_LLFLYOUTBUTTON_H +#define LL_LLFLYOUTBUTTON_H + +#include "llcombobox.h" + +// Classes + +class LLFlyoutButton : public LLComboBox +{ +public: + struct Params : public LLInitParam::Block<Params, LLComboBox::Params> + { + Optional<LLButton::Params> action_button; + + Params() + : action_button("action_button") + {} + + }; +protected: + LLFlyoutButton(const Params&); + friend class LLUICtrlFactory; +public: + virtual void draw(); + virtual void setEnabled(BOOL enabled); + + void setToggleState(BOOL state); + + void onActionButtonClick(const LLSD& data); + +protected: + LLButton* mActionButton; + BOOL mToggleState; +}; + +#endif // LL_LLFLYOUTBUTTON_H diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 661ffdd46701540a6a72c4a6d6ce27c1c3bb9c18..9a4ec7627e79fdf4a0cbea723f6fb77f9dc97a3c 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -220,24 +220,19 @@ void LLFocusMgr::setMouseCapture( LLMouseHandler* new_captor ) { LLMouseHandler* old_captor = mMouseCaptor; mMouseCaptor = new_captor; - /* - if (new_captor) + + if (LLView::sDebugMouseHandling) { - if ( new_captor->getName() == "Stickto") + if (new_captor) { llinfos << "New mouse captor: " << new_captor->getName() << llendl; } else { - llinfos << "New mouse captor: " << new_captor->getName() << llendl; + llinfos << "New mouse captor: NULL" << llendl; } } - else - { - llinfos << "New mouse captor: NULL" << llendl; - } - */ - + if( old_captor ) { old_captor->onMouseCaptureLost(); @@ -295,7 +290,7 @@ void LLFocusMgr::setTopCtrl( LLUICtrl* new_top ) if (old_top) { - old_top->onLostTop(); + old_top->onTopLost(); } } } @@ -328,7 +323,8 @@ F32 LLFocusMgr::getFocusFlashAmt() const LLColor4 LLFocusMgr::getFocusColor() const { - LLColor4 focus_color = lerp(LLUI::sColorsGroup->getColor( "FocusColor" ), LLColor4::white, getFocusFlashAmt()); + static LLUICachedControl<LLColor4> focus_color_cached ("FocusColor", *(new LLColor4)); + LLColor4 focus_color = lerp(focus_color_cached, LLColor4::white, getFocusFlashAmt()); // de-emphasize keyboard focus when app has lost focus (to avoid typing into wrong window problem) if (!mAppHasFocus) { diff --git a/indra/llui/llfunctorregistry.h b/indra/llui/llfunctorregistry.h index 8864f7af15526b0475752a736443b991811431a1..2c0bcc6012551fc9792656003297072730f6ebd2 100644 --- a/indra/llui/llfunctorregistry.h +++ b/indra/llui/llfunctorregistry.h @@ -40,7 +40,7 @@ #include <boost/function.hpp> #include "llsd.h" -#include "llmemory.h" +#include "llsingleton.h" /** * @class LLFunctorRegistry diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index cb3b2a3a6258369ad9a5348fa16c0d4c1af394c0..eddfc7128495556b17f1472848bc9dfdf8d848ae 100644 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -40,65 +40,33 @@ #include "llcontrol.h" #include "llui.h" #include "lluictrlfactory.h" +#include "lluiimage.h" -const F32 RESOLUTION_BUMP = 1.f; +static LLDefaultWidgetRegistry::Register<LLIconCtrl> r("icon"); -static LLRegisterWidget<LLIconCtrl> r("icon"); - -LLIconCtrl::LLIconCtrl(const std::string& name, const LLRect &rect, const LLUUID &image_id) -: LLUICtrl(name, - rect, - FALSE, // mouse opaque - NULL, NULL, - FOLLOWS_LEFT | FOLLOWS_TOP), - mColor( LLColor4::white ) -{ - setImage( image_id ); - setTabStop(FALSE); -} - -LLIconCtrl::LLIconCtrl(const std::string& name, const LLRect &rect, const std::string &image_name) -: LLUICtrl(name, - rect, - FALSE, // mouse opaque - NULL, NULL, - FOLLOWS_LEFT | FOLLOWS_TOP), - mColor( LLColor4::white ), - mImageName(image_name) -{ - setImage( image_name ); - setTabStop(FALSE); -} - - -LLIconCtrl::~LLIconCtrl() +LLIconCtrl::Params::Params() +: image("image_name"), + color("color"), + scale_image("scale_image") { - mImagep = NULL; + tab_stop = false; + mouse_opaque = false; } - -void LLIconCtrl::setImage(const std::string& image_name) +LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p) +: LLUICtrl(p), + mColor(p.color()), + mImagep(p.image) { - //RN: support UUIDs masquerading as strings - if (LLUUID::validate(image_name)) - { - mImageID = LLUUID(image_name); - - setImage(mImageID); - } - else + if (mImagep.notNull()) { - mImageName = image_name; - mImagep = LLUI::sImageProvider->getUIImage(image_name); - mImageID.setNull(); + LLUICtrl::setValue(mImagep->getName()); } } -void LLIconCtrl::setImage(const LLUUID& image_id) +LLIconCtrl::~LLIconCtrl() { - mImageName.clear(); - mImagep = LLUI::sImageProvider->getUIImageByID(image_id); - mImageID = image_id; + mImagep = NULL; } @@ -106,69 +74,37 @@ void LLIconCtrl::draw() { if( mImagep.notNull() ) { - mImagep->draw(getLocalRect(), mColor ); + mImagep->draw(getLocalRect(), mColor.get() ); } LLUICtrl::draw(); } // virtual +// value might be a string or a UUID void LLIconCtrl::setValue(const LLSD& value ) { - if (value.isUUID()) + LLSD tvalue(value); + if (value.isString() && LLUUID::validate(value.asString())) { - setImage(value.asUUID()); + //RN: support UUIDs masquerading as strings + tvalue = LLSD(LLUUID(value.asString())); } - else + LLUICtrl::setValue(tvalue); + if (tvalue.isUUID()) { - setImage(value.asString()); + mImagep = LLUI::getUIImageByID(tvalue.asUUID()); } -} - -// virtual -LLSD LLIconCtrl::getValue() const -{ - LLSD ret = getImage(); - return ret; -} - -// virtual -LLXMLNodePtr LLIconCtrl::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - if (mImageName != "") + else { - node->createChild("image_name", TRUE)->setStringValue(mImageName); + mImagep = LLUI::getUIImage(tvalue.asString()); } - - node->createChild("color", TRUE)->setFloatValue(4, mColor.mV); - - return node; } -LLView* LLIconCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) +std::string LLIconCtrl::getImageName() const { - std::string name("icon"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - std::string image_name; - if (node->hasAttribute("image_name")) - { - node->getAttributeString("image_name", image_name); - } - - LLColor4 color(LLColor4::white); - LLUICtrlFactory::getAttributeColor(node,"color", color); - - LLIconCtrl* icon = new LLIconCtrl(name, rect, image_name); - - icon->setColor(color); - - icon->initFromXML(node, parent); - - return icon; + if (getValue().isString()) + return getValue().asString(); + else + return std::string(); } diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index 50778cf2267c639aaa9a51823a93c72b257ae37a..ad0f6f563f6424e2e3b4a0ee098edd209a236d38 100644 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -45,35 +45,37 @@ class LLUICtrlFactory; // // Classes // + +// class LLIconCtrl : public LLUICtrl { public: - LLIconCtrl(const std::string& name, const LLRect &rect, const LLUUID &image_id); - LLIconCtrl(const std::string& name, const LLRect &rect, const std::string &image_name); + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<LLUIImage*> image; + Optional<LLUIColor> color; + Deprecated scale_image; + Params(); + }; +protected: + LLIconCtrl(const Params&); + friend class LLUICtrlFactory; +public: virtual ~LLIconCtrl(); // llview overrides virtual void draw(); - void setImage(const std::string& image_name); - void setImage(const LLUUID& image_name); - const LLUUID &getImage() const { return mImageID; } - std::string getImageName() const { return mImageName; } - - // Takes a UUID, wraps get/setImage + // lluictrl overrides virtual void setValue(const LLSD& value ); - virtual LLSD getValue() const; - void setColor(const LLColor4& color) { mColor = color; } + std::string getImageName() const; - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); + void setColor(const LLColor4& color) { mColor = color; } private: - LLColor4 mColor; - std::string mImageName; - LLUUID mImageID; + LLUIColor mColor; LLPointer<LLUIImage> mImagep; }; diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 51ef3dbacf6c4a8d90c2a0ad946b31f56c92166f..30796a5ab97f1eb61f50bfc0fe75dc8036de19fc 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -223,8 +223,8 @@ LLColor3 LLKeywords::readColor( const std::string& s ) { F32 r, g, b; r = g = b = 0.0f; - S32 read = sscanf(s.c_str(), "%f, %f, %f]", &r, &g, &b ); - if( read != 3 ) /* Flawfinder: ignore */ + S32 values_read = sscanf(s.c_str(), "%f, %f, %f]", &r, &g, &b ); + if( values_read != 3 ) { llinfos << " poorly formed color in keyword file" << llendl; } diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp new file mode 100644 index 0000000000000000000000000000000000000000..39dac296ea913bb04b341405ad086b9107388049 --- /dev/null +++ b/indra/llui/lllayoutstack.cpp @@ -0,0 +1,740 @@ +/** + * @file lllayoutstack.cpp + * @brief LLLayout class - dynamic stacking of UI elements + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +// Opaque view with a background and a border. Can contain LLUICtrls. + +#include "linden_common.h" + +#include "lllayoutstack.h" +#include "llresizebar.h" +#include "llcriticaldamp.h" + +static LLDefaultWidgetRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack", &LLLayoutStack::fromXML); + + +// +// LLLayoutStack +// +struct LLLayoutStack::LayoutPanel +{ + LayoutPanel(LLPanel* panelp, ELayoutOrientation orientation, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize) : mPanel(panelp), + mMinWidth(min_width), + mMinHeight(min_height), + mAutoResize(auto_resize), + mUserResize(user_resize), + mOrientation(orientation), + mCollapsed(FALSE), + mCollapseAmt(0.f), + mVisibleAmt(1.f), // default to fully visible + mResizeBar(NULL) + { + LLResizeBar::Side side = (orientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM; + LLRect resize_bar_rect = panelp->getRect(); + + S32 min_dim; + if (orientation == HORIZONTAL) + { + min_dim = mMinHeight; + } + else + { + min_dim = mMinWidth; + } + LLResizeBar::Params p; + p.name("resize"); + p.resizing_view(mPanel); + p.min_size(min_dim); + p.side(side); + p.snapping_enabled(false); + mResizeBar = LLUICtrlFactory::create<LLResizeBar>(p); + // panels initialized as hidden should not start out partially visible + if (!mPanel->getVisible()) + { + mVisibleAmt = 0.f; + } + } + + ~LayoutPanel() + { + // probably not necessary, but... + delete mResizeBar; + mResizeBar = NULL; + } + + F32 getCollapseFactor() + { + if (mOrientation == HORIZONTAL) + { + F32 collapse_amt = + clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinWidth / (F32)llmax(1, mPanel->getRect().getWidth())); + return mVisibleAmt * collapse_amt; + } + else + { + F32 collapse_amt = + clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)mMinHeight / (F32)llmax(1, mPanel->getRect().getHeight()))); + return mVisibleAmt * collapse_amt; + } + } + + LLPanel* mPanel; + S32 mMinWidth; + S32 mMinHeight; + BOOL mAutoResize; + BOOL mUserResize; + BOOL mCollapsed; + LLResizeBar* mResizeBar; + ELayoutOrientation mOrientation; + F32 mVisibleAmt; + F32 mCollapseAmt; +}; + +LLLayoutStack::Params::Params() +: orientation("orientation", std::string("vertical")), + animate("animate", TRUE), + border_size("border_size", LLCachedControl<S32>(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0)) +{ + name="stack"; +} + +LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) +: LLView(p), + mMinWidth(0), + mMinHeight(0), + mPanelSpacing(p.border_size), + mOrientation((p.orientation() == "vertical") ? VERTICAL : HORIZONTAL), + mAnimate(p.animate) +{} + +LLLayoutStack::~LLLayoutStack() +{ + e_panel_list_t panels = mPanels; // copy list of panel pointers + mPanels.clear(); // clear so that removeChild() calls don't cause trouble + std::for_each(panels.begin(), panels.end(), DeletePointer()); +} + +void LLLayoutStack::draw() +{ + updateLayout(); + + e_panel_list_t::iterator panel_it; + for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) + { + // clip to layout rectangle, not bounding rectangle + LLRect clip_rect = (*panel_it)->mPanel->getRect(); + // scale clipping rectangle by visible amount + if (mOrientation == HORIZONTAL) + { + clip_rect.mRight = clip_rect.mLeft + llround((F32)clip_rect.getWidth() * (*panel_it)->getCollapseFactor()); + } + else + { + clip_rect.mBottom = clip_rect.mTop - llround((F32)clip_rect.getHeight() * (*panel_it)->getCollapseFactor()); + } + + LLPanel* panelp = (*panel_it)->mPanel; + + LLLocalClipRect clip(clip_rect); + // only force drawing invisible children if visible amount is non-zero + drawChild(panelp, 0, 0, !clip_rect.isNull()); + } +} + +void LLLayoutStack::removeChild(LLView* view) +{ + LayoutPanel* embedded_panelp = findEmbeddedPanel(dynamic_cast<LLPanel*>(view)); + + if (embedded_panelp) + { + mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp)); + delete embedded_panelp; + } + + // need to update resizebars + + calcMinExtents(); + + LLView::removeChild(view); +} + +BOOL LLLayoutStack::postBuild() +{ + updateLayout(); + return TRUE; +} + +static void get_attribute_s32_and_write(LLXMLNodePtr node, + const char* name, + S32 *value, + S32 default_value, + LLXMLNodePtr output_child) +{ + BOOL has_attr = node->getAttributeS32(name, *value); + if (has_attr && *value != default_value && output_child) + { + // create an attribute child node + LLXMLNodePtr child_attr = output_child->createChild(name, TRUE); + child_attr->setIntValue(*value); + } +} + +static void get_attribute_bool_and_write(LLXMLNodePtr node, + const char* name, + BOOL *value, + BOOL default_value, + LLXMLNodePtr output_child) +{ + BOOL has_attr = node->getAttributeBOOL(name, *value); + if (has_attr && *value != default_value && output_child) + { + LLXMLNodePtr child_attr = output_child->createChild(name, TRUE); + child_attr->setBoolValue(*value); + } +} +//static +LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) +{ + LLLayoutStack::Params p(LLUICtrlFactory::getDefaultParams<LLLayoutStack::Params>()); + LLXUIParser::instance().readXUI(node, p); + + // Export must happen before setupParams() mungles rectangles and before + // this item gets added to parent (otherwise screws up last_child_rect + // logic). JC + if (output_node) + { + Params output_params(p); + setupParamsForExport(output_params, parent); + LLLayoutStack::Params default_params(LLUICtrlFactory::getDefaultParams<LLLayoutStack::Params>()); + output_node->setName(node->getName()->mString); + LLXUIParser::instance().writeXUI( + output_node, output_params, &default_params); + } + + setupParams(p, parent); + LLLayoutStack* layout_stackp = LLUICtrlFactory::create<LLLayoutStack>(p); + + if (parent && layout_stackp) + { + S32 tab_group = p.tab_group.isProvided() ? p.tab_group() : parent->getLastTabGroup(); + + parent->addChild(layout_stackp, tab_group); + } + + for (LLXMLNodePtr child_node = node->getFirstChild(); child_node.notNull(); child_node = child_node->getNextSibling()) + { + const S32 DEFAULT_MIN_WIDTH = 0; + const S32 DEFAULT_MIN_HEIGHT = 0; + const BOOL DEFAULT_AUTO_RESIZE = TRUE; + + S32 min_width = DEFAULT_MIN_WIDTH; + S32 min_height = DEFAULT_MIN_HEIGHT; + BOOL auto_resize = DEFAULT_AUTO_RESIZE; + + LLXMLNodePtr output_child; + if (output_node) + { + output_child = output_node->createChild("", FALSE); + } + + // Layout stack allows child nodes to acquire additional attributes, + // such as "min_width" in: <button label="Foo" min_width="100"/> + // If these attributes exist and have non-default values, write them + // to the output node. + get_attribute_s32_and_write(child_node, "min_width", &min_width, + DEFAULT_MIN_WIDTH, output_child); + get_attribute_s32_and_write(child_node, "min_height", &min_height, + DEFAULT_MIN_HEIGHT, output_child); + get_attribute_bool_and_write(child_node, "auto_resize", &auto_resize, + DEFAULT_AUTO_RESIZE, output_child); + + if (child_node->hasName("layout_panel")) + { + BOOL user_resize = TRUE; + get_attribute_bool_and_write(child_node, "user_resize", &user_resize, + TRUE, output_child); + LLPanel* panelp = (LLPanel*)LLPanel::fromXML(child_node, layout_stackp, output_child); + if (panelp) + { + panelp->setFollowsNone(); + layout_stackp->addPanel(panelp, min_width, min_height, auto_resize, user_resize); + } + } + else + { + BOOL user_resize = FALSE; + get_attribute_bool_and_write(child_node, "user_resize", &user_resize, + FALSE, output_child); + + LLPanel::Params p; + LLPanel* panelp = LLUICtrlFactory::create<LLPanel>(p); + LLView* new_child = LLUICtrlFactory::getInstance()->createFromXML(child_node, panelp, LLStringUtil::null, output_child, parent ? parent->getChildRegistry() : LLDefaultWidgetRegistry::instance()); + if (new_child) + { + // put child in new embedded panel + layout_stackp->addPanel(panelp, min_width, min_height, auto_resize, user_resize); + // resize panel to contain widget and move widget to be contained in panel + panelp->setRect(new_child->getRect()); + new_child->setOrigin(0, 0); + } + else + { + panelp->die(); + } + } + + if (output_child && !output_child->mChildren && output_child->mAttributes.empty() && output_child->getValue().empty()) + { + output_node->deleteChild(output_child); + } + } + + if (!layout_stackp->postBuild()) + { + delete layout_stackp; + return NULL; + } + + return layout_stackp; +} + +S32 LLLayoutStack::getDefaultHeight(S32 cur_height) +{ + // if we are spanning our children (crude upward propagation of size) + // then don't enforce our size on our children + if (mOrientation == HORIZONTAL) + { + cur_height = llmax(mMinHeight, getRect().getHeight()); + } + + return cur_height; +} + +S32 LLLayoutStack::getDefaultWidth(S32 cur_width) +{ + // if we are spanning our children (crude upward propagation of size) + // then don't enforce our size on our children + if (mOrientation == VERTICAL) + { + cur_width = llmax(mMinWidth, getRect().getWidth()); + } + + return cur_width; +} + +void LLLayoutStack::addPanel(LLPanel* panel, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize, EAnimate animate, S32 index) +{ + // panel starts off invisible (collapsed) + if (animate == ANIMATE) + { + panel->setVisible(FALSE); + } + LayoutPanel* embedded_panel = new LayoutPanel(panel, mOrientation, min_width, min_height, auto_resize, user_resize); + + mPanels.insert(mPanels.begin() + llclamp(index, 0, (S32)mPanels.size()), embedded_panel); + + if (panel->getParent() != this) + { + addChild(panel); + } + addChild(embedded_panel->mResizeBar); + + // bring all resize bars to the front so that they are clickable even over the panels + // with a bit of overlap + for (e_panel_list_t::iterator panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) + { + LLResizeBar* resize_barp = (*panel_it)->mResizeBar; + sendChildToFront(resize_barp); + } + + // start expanding panel animation + if (animate == ANIMATE) + { + panel->setVisible(TRUE); + } +} + +void LLLayoutStack::removePanel(LLPanel* panel) +{ + removeChild(panel); +} + +void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed) +{ + LayoutPanel* panel_container = findEmbeddedPanel(panel); + if (!panel_container) return; + + panel_container->mCollapsed = collapsed; +} + +void LLLayoutStack::updateLayout(BOOL force_resize) +{ + static LLUICachedControl<S32> resize_bar_overlap ("UIResizeBarOverlap", 0); + calcMinExtents(); + + // calculate current extents + S32 total_width = 0; + S32 total_height = 0; + + const F32 ANIM_OPEN_TIME = 0.02f; + const F32 ANIM_CLOSE_TIME = 0.03f; + + e_panel_list_t::iterator panel_it; + for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) + { + LLPanel* panelp = (*panel_it)->mPanel; + if (panelp->getVisible()) + { + if (mAnimate) + { + (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(ANIM_OPEN_TIME)); + if ((*panel_it)->mVisibleAmt > 0.99f) + { + (*panel_it)->mVisibleAmt = 1.f; + } + } + else + { + (*panel_it)->mVisibleAmt = 1.f; + } + } + else // not visible + { + if (mAnimate) + { + (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); + if ((*panel_it)->mVisibleAmt < 0.001f) + { + (*panel_it)->mVisibleAmt = 0.f; + } + } + else + { + (*panel_it)->mVisibleAmt = 0.f; + } + } + + if ((*panel_it)->mCollapsed) + { + (*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 1.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); + } + else + { + (*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 0.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); + } + + if (mOrientation == HORIZONTAL) + { + // enforce minimize size constraint by default + if (panelp->getRect().getWidth() < (*panel_it)->mMinWidth) + { + panelp->reshape((*panel_it)->mMinWidth, panelp->getRect().getHeight()); + } + total_width += llround(panelp->getRect().getWidth() * (*panel_it)->getCollapseFactor()); + // want n-1 panel gaps for n panels + if (panel_it != mPanels.begin()) + { + total_width += mPanelSpacing; + } + } + else //VERTICAL + { + // enforce minimize size constraint by default + if (panelp->getRect().getHeight() < (*panel_it)->mMinHeight) + { + panelp->reshape(panelp->getRect().getWidth(), (*panel_it)->mMinHeight); + } + total_height += llround(panelp->getRect().getHeight() * (*panel_it)->getCollapseFactor()); + if (panel_it != mPanels.begin()) + { + total_height += mPanelSpacing; + } + } + } + + S32 num_resizable_panels = 0; + S32 shrink_headroom_available = 0; + S32 shrink_headroom_total = 0; + for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) + { + // panels that are not fully visible do not count towards shrink headroom + if ((*panel_it)->getCollapseFactor() < 1.f) + { + continue; + } + + // if currently resizing a panel or the panel is flagged as not automatically resizing + // only track total available headroom, but don't use it for automatic resize logic + if ((*panel_it)->mResizeBar->hasMouseCapture() + || (!(*panel_it)->mAutoResize + && !force_resize)) + { + if (mOrientation == HORIZONTAL) + { + shrink_headroom_total += (*panel_it)->mPanel->getRect().getWidth() - (*panel_it)->mMinWidth; + } + else //VERTICAL + { + shrink_headroom_total += (*panel_it)->mPanel->getRect().getHeight() - (*panel_it)->mMinHeight; + } + } + else + { + num_resizable_panels++; + if (mOrientation == HORIZONTAL) + { + shrink_headroom_available += (*panel_it)->mPanel->getRect().getWidth() - (*panel_it)->mMinWidth; + shrink_headroom_total += (*panel_it)->mPanel->getRect().getWidth() - (*panel_it)->mMinWidth; + } + else //VERTICAL + { + shrink_headroom_available += (*panel_it)->mPanel->getRect().getHeight() - (*panel_it)->mMinHeight; + shrink_headroom_total += (*panel_it)->mPanel->getRect().getHeight() - (*panel_it)->mMinHeight; + } + } + } + + // calculate how many pixels need to be distributed among layout panels + // positive means panels need to grow, negative means shrink + S32 pixels_to_distribute; + if (mOrientation == HORIZONTAL) + { + pixels_to_distribute = getRect().getWidth() - total_width; + } + else //VERTICAL + { + pixels_to_distribute = getRect().getHeight() - total_height; + } + + // now we distribute the pixels... + S32 cur_x = 0; + S32 cur_y = getRect().getHeight(); + + for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) + { + LLPanel* panelp = (*panel_it)->mPanel; + + S32 cur_width = panelp->getRect().getWidth(); + S32 cur_height = panelp->getRect().getHeight(); + S32 new_width = llmax((*panel_it)->mMinWidth, cur_width); + S32 new_height = llmax((*panel_it)->mMinHeight, cur_height); + + S32 delta_size = 0; + + // if panel can automatically resize (not animating, and resize flag set)... + if ((*panel_it)->getCollapseFactor() == 1.f + && (force_resize || (*panel_it)->mAutoResize) + && !(*panel_it)->mResizeBar->hasMouseCapture()) + { + if (mOrientation == HORIZONTAL) + { + // if we're shrinking + if (pixels_to_distribute < 0) + { + // shrink proportionally to amount over minimum + // so we can do this in one pass + delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_width - (*panel_it)->mMinWidth) / (F32)shrink_headroom_available)) : 0; + shrink_headroom_available -= (cur_width - (*panel_it)->mMinWidth); + } + else + { + // grow all elements equally + delta_size = llround((F32)pixels_to_distribute / (F32)num_resizable_panels); + num_resizable_panels--; + } + pixels_to_distribute -= delta_size; + new_width = llmax((*panel_it)->mMinWidth, cur_width + delta_size); + } + else + { + new_width = getDefaultWidth(new_width); + } + + if (mOrientation == VERTICAL) + { + if (pixels_to_distribute < 0) + { + // shrink proportionally to amount over minimum + // so we can do this in one pass + delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_height - (*panel_it)->mMinHeight) / (F32)shrink_headroom_available)) : 0; + shrink_headroom_available -= (cur_height - (*panel_it)->mMinHeight); + } + else + { + delta_size = llround((F32)pixels_to_distribute / (F32)num_resizable_panels); + num_resizable_panels--; + } + pixels_to_distribute -= delta_size; + new_height = llmax((*panel_it)->mMinHeight, cur_height + delta_size); + } + else + { + new_height = getDefaultHeight(new_height); + } + } + else + { + if (mOrientation == HORIZONTAL) + { + new_height = getDefaultHeight(new_height); + } + else // VERTICAL + { + new_width = getDefaultWidth(new_width); + } + } + + // adjust running headroom count based on new sizes + shrink_headroom_total += delta_size; + + panelp->reshape(new_width, new_height); + panelp->setOrigin(cur_x, cur_y - new_height); + + LLRect panel_rect = panelp->getRect(); + LLRect resize_bar_rect = panel_rect; + if (mOrientation == HORIZONTAL) + { + resize_bar_rect.mLeft = panel_rect.mRight - resize_bar_overlap; + resize_bar_rect.mRight = panel_rect.mRight + mPanelSpacing + resize_bar_overlap; + } + else + { + resize_bar_rect.mTop = panel_rect.mBottom + resize_bar_overlap; + resize_bar_rect.mBottom = panel_rect.mBottom - mPanelSpacing - resize_bar_overlap; + } + (*panel_it)->mResizeBar->setRect(resize_bar_rect); + + if (mOrientation == HORIZONTAL) + { + cur_x += llround(new_width * (*panel_it)->getCollapseFactor()) + mPanelSpacing; + } + else //VERTICAL + { + cur_y -= llround(new_height * (*panel_it)->getCollapseFactor()) + mPanelSpacing; + } + } + + // update resize bars with new limits + LLResizeBar* last_resize_bar = NULL; + for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) + { + LLPanel* panelp = (*panel_it)->mPanel; + + if (mOrientation == HORIZONTAL) + { + (*panel_it)->mResizeBar->setResizeLimits( + (*panel_it)->mMinWidth, + (*panel_it)->mMinWidth + shrink_headroom_total); + } + else //VERTICAL + { + (*panel_it)->mResizeBar->setResizeLimits( + (*panel_it)->mMinHeight, + (*panel_it)->mMinHeight + shrink_headroom_total); + } + + // toggle resize bars based on panel visibility, resizability, etc + BOOL resize_bar_enabled = panelp->getVisible() && (*panel_it)->mUserResize; + (*panel_it)->mResizeBar->setVisible(resize_bar_enabled); + + if (resize_bar_enabled) + { + last_resize_bar = (*panel_it)->mResizeBar; + } + } + + // hide last resize bar as there is nothing past it + // resize bars need to be in between two resizable panels + if (last_resize_bar) + { + last_resize_bar->setVisible(FALSE); + } + + // not enough room to fit existing contents + if (force_resize == FALSE + // layout did not complete by reaching target position + && ((mOrientation == VERTICAL && cur_y != -mPanelSpacing) + || (mOrientation == HORIZONTAL && cur_x != getRect().getWidth() + mPanelSpacing))) + { + // do another layout pass with all stacked elements contributing + // even those that don't usually resize + llassert_always(force_resize == FALSE); + updateLayout(TRUE); + } +} // end LLLayoutStack::updateLayout + + +LLLayoutStack::LayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const +{ + if (!panelp) return NULL; + + e_panel_list_t::const_iterator panel_it; + for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) + { + if ((*panel_it)->mPanel == panelp) + { + return *panel_it; + } + } + return NULL; +} + +// Compute sum of min_width or min_height of children +void LLLayoutStack::calcMinExtents() +{ + mMinWidth = 0; + mMinHeight = 0; + + e_panel_list_t::iterator panel_it; + for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) + { + if (mOrientation == HORIZONTAL) + { + mMinHeight = llmax( mMinHeight, + (*panel_it)->mMinHeight); + mMinWidth += (*panel_it)->mMinWidth; + if (panel_it != mPanels.begin()) + { + mMinWidth += mPanelSpacing; + } + } + else //VERTICAL + { + mMinWidth = llmax( mMinWidth, + (*panel_it)->mMinWidth); + mMinHeight += (*panel_it)->mMinHeight; + if (panel_it != mPanels.begin()) + { + mMinHeight += mPanelSpacing; + } + } + } +} diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h new file mode 100644 index 0000000000000000000000000000000000000000..480bdb5c17be7d69a805f6d0367a92a70887dcdb --- /dev/null +++ b/indra/llui/lllayoutstack.h @@ -0,0 +1,105 @@ +/** + * @file lllayoutstack.h + * @author Richard Nelson + * @brief LLLayout class - dynamic stacking of UI elements + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLLAYOUTSTACK_H +#define LL_LLLAYOUTSTACK_H + +#include "llpanel.h" + +class LLLayoutStack : public LLView +{ +public: + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Optional<std::string> orientation; + Optional<S32> border_size; + Optional<bool> animate; + // mMinWidth and mMinHeight are calculated, not set in XML + + Params(); + }; + + typedef enum e_layout_orientation + { + HORIZONTAL, + VERTICAL + } ELayoutOrientation; + + virtual ~LLLayoutStack(); + + /*virtual*/ void draw(); + /*virtual*/ void removeChild(LLView*); + /*virtual*/ BOOL postBuild(); + + static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL); + + S32 getMinWidth() const { return mMinWidth; } + S32 getMinHeight() const { return mMinHeight; } + + typedef enum e_animate + { + NO_ANIMATE, + ANIMATE + } EAnimate; + + void addPanel(LLPanel* panel, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize, EAnimate animate = NO_ANIMATE, S32 index = S32_MAX); + void removePanel(LLPanel* panel); + void collapsePanel(LLPanel* panel, BOOL collapsed = TRUE); + S32 getNumPanels() { return mPanels.size(); } + +protected: + LLLayoutStack(const Params&); + friend class LLUICtrlFactory; + +private: + struct LayoutPanel; + + void updateLayout(BOOL force_resize = FALSE); + void calcMinExtents(); + S32 getDefaultHeight(S32 cur_height); + S32 getDefaultWidth(S32 cur_width); + + const ELayoutOrientation mOrientation; + + typedef std::vector<LayoutPanel*> e_panel_list_t; + e_panel_list_t mPanels; + LayoutPanel* findEmbeddedPanel(LLPanel* panelp) const; + + S32 mMinWidth; // calculated by calcMinExtents + S32 mMinHeight; // calculated by calcMinExtents + S32 mPanelSpacing; + + bool mAnimate; +}; // end class LLLayoutStack + +#endif diff --git a/indra/llui/lllazyvalue.h b/indra/llui/lllazyvalue.h new file mode 100644 index 0000000000000000000000000000000000000000..cf45214628962a506c79a1f9f98663cd638929ef --- /dev/null +++ b/indra/llui/lllazyvalue.h @@ -0,0 +1,88 @@ +/** + * @file lllazyvalue.h + * @brief generic functor/value abstraction for lazy evaluation of a value + * parsing construction parameters from xml and LLSD + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LAZY_VALUE_H +#define LL_LAZY_VALUE_H + +#include <boost/function.hpp> + +// Holds on to a value of type T *or* calls a functor to generate a value of type T +template<typename T> +class LLLazyValue +{ +public: + typedef typename boost::add_reference<typename boost::add_const<T>::type>::type T_const_ref; + typedef typename boost::function<T_const_ref (void)> function_type; + +public: + LLLazyValue(const function_type& value) + : mValueGetter(value) + {} + LLLazyValue(T_const_ref value) + : mValue(value) + {} + LLLazyValue() + : mValue() + {} + + void set(const LLLazyValue& val) + { + mValueGetter = val.mValueGetter; + } + + void set(T_const_ref val) + { + mValue = val; + mValueGetter = NULL; + } + + T_const_ref get() const + { + if (!mValueGetter.empty()) + { + return mValueGetter(); + } + return mValue; + } + + bool isUsingFunction() const + { + return mValueGetter != NULL; + } + +private: + function_type mValueGetter; + T mValue; +}; + +#endif // LL_LAZY_VALUE_H diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 964254d93f7035ec6010b18ab061afbc39d6f01e..5ea45e13cf07cf9cfb924f032170d6268a4d194b 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -34,6 +34,8 @@ #include "linden_common.h" +#define INSTANTIATE_GETCHILD_LINEEDITOR + #include "lllineeditor.h" #include "lltexteditor.h" @@ -64,79 +66,104 @@ // Constants // -const S32 UI_LINEEDITOR_CURSOR_THICKNESS = 2; -const S32 UI_LINEEDITOR_H_PAD = 2; -const S32 UI_LINEEDITOR_V_PAD = 1; const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 SCROLL_INCREMENT_ADD = 0; // make space for typing const S32 SCROLL_INCREMENT_DEL = 4; // make space for baskspacing const F32 AUTO_SCROLL_TIME = 0.05f; +const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click. *TODO: make this equal to the double click interval? -const F32 PREEDIT_MARKER_BRIGHTNESS = 0.4f; -const S32 PREEDIT_MARKER_GAP = 1; -const S32 PREEDIT_MARKER_POSITION = 2; -const S32 PREEDIT_MARKER_THICKNESS = 1; -const F32 PREEDIT_STANDOUT_BRIGHTNESS = 0.6f; -const S32 PREEDIT_STANDOUT_GAP = 1; -const S32 PREEDIT_STANDOUT_POSITION = 2; -const S32 PREEDIT_STANDOUT_THICKNESS = 2; - -static LLRegisterWidget<LLLineEditor> r1("line_editor"); +static LLDefaultWidgetRegistry::Register<LLLineEditor> r1("line_editor"); -/* static */ LLPointer<LLUIImage> LLLineEditor::sImage; +template LLLineEditor* LLView::getChild<LLLineEditor>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const; // // Member functions // - -LLLineEditor::LLLineEditor(const std::string& name, const LLRect& rect, - const std::string& default_text, const LLFontGL* font, - S32 max_length_bytes, - void (*commit_callback)(LLUICtrl* caller, void* user_data ), - void (*keystroke_callback)(LLLineEditor* caller, void* user_data ), - void (*focus_lost_callback)(LLFocusableElement* caller, void* user_data ), - void* userdata, - LLLinePrevalidateFunc prevalidate_func, - LLViewBorder::EBevel border_bevel, - LLViewBorder::EStyle border_style, - S32 border_thickness) - : - LLUICtrl( name, rect, TRUE, commit_callback, userdata, FOLLOWS_TOP | FOLLOWS_LEFT ), - mMaxLengthBytes(max_length_bytes), - mCursorPos( 0 ), - mScrollHPos( 0 ), - mTextPadLeft(0), - mTextPadRight(0), - mCommitOnFocusLost( TRUE ), - mRevertOnEsc( TRUE ), - mKeystrokeCallback( keystroke_callback ), - mIsSelecting( FALSE ), - mSelectionStart( 0 ), - mSelectionEnd( 0 ), - mLastSelectionX(-1), - mLastSelectionY(-1), - mLastSelectionStart(-1), - mLastSelectionEnd(-1), - mPrevalidateFunc( prevalidate_func ), - mCursorColor( LLUI::sColorsGroup->getColor( "TextCursorColor" ) ), - mFgColor( LLUI::sColorsGroup->getColor( "TextFgColor" ) ), - mReadOnlyFgColor( LLUI::sColorsGroup->getColor( "TextFgReadOnlyColor" ) ), - mTentativeFgColor( LLUI::sColorsGroup->getColor( "TextFgTentativeColor" ) ), - mWriteableBgColor( LLUI::sColorsGroup->getColor( "TextBgWriteableColor" ) ), - mReadOnlyBgColor( LLUI::sColorsGroup->getColor( "TextBgReadOnlyColor" ) ), - mFocusBgColor( LLUI::sColorsGroup->getColor( "TextBgFocusColor" ) ), - mBorderThickness( border_thickness ), - mIgnoreArrowKeys( FALSE ), - mIgnoreTab( TRUE ), - mDrawAsterixes( FALSE ), - mHandleEditKeysDirectly( FALSE ), - mSelectAllonFocusReceived( FALSE ), - mPassDelete(FALSE), - mReadOnly(FALSE), - mImage( sImage ), - mReplaceNewlinesWithSpaces( TRUE ) -{ - llassert( max_length_bytes > 0 ); + +void LLLineEditor::PrevalidateNamedFuncs::declareValues() +{ + declare("ascii", LLLineEditor::prevalidateASCII); + declare("float", LLLineEditor::prevalidateFloat); + declare("int", LLLineEditor::prevalidateInt); + declare("positive_s32", LLLineEditor::prevalidatePositiveS32); + declare("non_negative_s32", LLLineEditor::prevalidateNonNegativeS32); + declare("alpha_num", LLLineEditor::prevalidateAlphaNum); + declare("alpha_num_space", LLLineEditor::prevalidateAlphaNumSpace); + declare("printable_not_pipe", LLLineEditor::prevalidatePrintableNotPipe); + declare("printable_no_space", LLLineEditor::prevalidatePrintableNoSpace); +} + +LLLineEditor::Params::Params() +: max_length_bytes("max_length", 254), + background_image("background_image"), + select_on_focus("select_on_focus", false), + handle_edit_keys_directly("handle_edit_keys_directly", false), + commit_on_focus_lost("commit_on_focus_lost", true), + ignore_tab("ignore_tab", true), + cursor_color("cursor_color"), + text_color("text_color"), + text_readonly_color("text_readonly_color"), + text_tentative_color("text_tentative_color"), + bg_readonly_color("bg_readonly_color"), + bg_writeable_color("bg_writeable_color"), + bg_focus_color("bg_focus_color"), + border(""), + is_unicode("is_unicode"), + drop_shadow_visible("drop_shadow_visible"), + border_drop_shadow_visible("border_drop_shadow_visible"), + bg_visible("bg_visible"), + text_pad_left("text_pad_left"), + text_pad_right("text_pad_right"), + default_text("default_text") +{ + mouse_opaque = true; + addSynonym(select_on_focus, "select_all_on_focus_received"); + addSynonym(border, "border"); +} + +LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) +: LLUICtrl(p), + mMaxLengthBytes(p.max_length_bytes), + mCursorPos( 0 ), + mScrollHPos( 0 ), + mTextPadLeft(p.text_pad_left), + mTextPadRight(p.text_pad_right), + mCommitOnFocusLost( p.commit_on_focus_lost ), + mRevertOnEsc( TRUE ), + mKeystrokeCallback( p.keystroke_callback() ), + mIsSelecting( FALSE ), + mSelectionStart( 0 ), + mSelectionEnd( 0 ), + mLastSelectionX(-1), + mLastSelectionY(-1), + mLastSelectionStart(-1), + mLastSelectionEnd(-1), + mBorderThickness( 0 ), + mIgnoreArrowKeys( FALSE ), + mIgnoreTab( p.ignore_tab ), + mDrawAsterixes( FALSE ), + mHandleEditKeysDirectly(p.handle_edit_keys_directly), + mSelectAllonFocusReceived( p.select_on_focus ), + mPassDelete(FALSE), + mReadOnly(FALSE), + mImage( NULL ), + mReplaceNewlinesWithSpaces( TRUE ), + mLabel(p.label), + mCursorColor(p.cursor_color()), + mFgColor(p.text_color()), + mReadOnlyFgColor(p.text_readonly_color()), + mTentativeFgColor(p.text_tentative_color()), + mWriteableBgColor(p.bg_writeable_color()), + mReadOnlyBgColor(p.bg_readonly_color()), + mFocusBgColor(p.bg_focus_color()), + mGLFont(p.font), + mGLFontStyle(LLFontGL::getStyleFromString(p.font.style)) +{ + llassert( mMaxLengthBytes > 0 ); + + mScrollTimer.reset(); + mTripleClickTimer.reset(); + setText(p.default_text()); // line history support: // - initialize line history list @@ -146,40 +173,24 @@ LLLineEditor::LLLineEditor(const std::string& name, const LLRect& rect, // - reset current history line pointer mCurrentHistoryLine = 0; - if (font) - { - mGLFont = font; - } - else - { - mGLFont = LLFontGL::getFontSansSerifSmall(); - } - - setFocusLostCallback(focus_lost_callback); - - setTextPadding(0, 0); - - mScrollTimer.reset(); + LLRect border_rect(getLocalRect()); + // adjust for gl line drawing glitch + border_rect.mTop -= 1; + border_rect.mRight -=1; + LLViewBorder::Params border_p(p.border); + border_p.rect = border_rect; + border_p.follows.flags = FOLLOWS_ALL; + border_p.bevel_type = LLViewBorder::BEVEL_IN; + mBorder = LLUICtrlFactory::create<LLViewBorder>(border_p); + addChild( mBorder ); - setText(default_text); - + // clamp text padding to current editor size + updateTextPadding(); setCursor(mText.length()); - // Scalable UI somehow made these rectangles off-by-one. - // I don't know why. JC - LLRect border_rect(0, getRect().getHeight()-1, getRect().getWidth()-1, 0); - mBorder = new LLViewBorder( std::string("line ed border"), border_rect, border_bevel, border_style, mBorderThickness ); - addChild( mBorder ); - mBorder->setFollows(FOLLOWS_LEFT|FOLLOWS_RIGHT|FOLLOWS_TOP|FOLLOWS_BOTTOM); - - if( ! sImage) - { - sImage = LLUI::getUIImage("sm_rounded_corners_simple.tga"); - } - mImage = sImage; + setPrevalidate(p.prevalidate_callback()); } - - + LLLineEditor::~LLLineEditor() { mCommitOnFocusLost = FALSE; @@ -227,6 +238,7 @@ void LLLineEditor::onCommit() // put current line into the line history updateHistory(); + setControlValue(getValue()); LLUICtrl::onCommit(); selectAll(); } @@ -255,7 +267,7 @@ void LLLineEditor::updateHistory() void LLLineEditor::reshape(S32 width, S32 height, BOOL called_from_parent) { LLUICtrl::reshape(width, height, called_from_parent); - setTextPadding(mTextPadLeft, mTextPadRight); // For clamping side-effect. + updateTextPadding(); // For clamping side-effect. setCursor(mCursorPos); // For clamping side-effect. } @@ -273,11 +285,12 @@ void LLLineEditor::setMaxTextLength(S32 max_text_length) mMaxLengthBytes = max_len; } -void LLLineEditor::setTextPadding(S32 left, S32 right) +void LLLineEditor::updateTextPadding() { - mTextPadLeft = llclamp(left, 0, getRect().getWidth()); - mTextPadRight = llclamp(right, 0, getRect().getWidth()); - mMinHPixels = UI_LINEEDITOR_H_PAD + mTextPadLeft; + static LLUICachedControl<S32> line_editor_hpad ("UILineEditorHPad", 0); + mTextPadLeft = llclamp(mTextPadLeft, 0, getRect().getWidth()); + mTextPadRight = llclamp(mTextPadRight, 0, getRect().getWidth()); + mMinHPixels = line_editor_hpad + mTextPadLeft; mMaxHPixels = getRect().getWidth() - mMinHPixels - mTextPadRight; } @@ -362,7 +375,7 @@ void LLLineEditor::setCursor( S32 pos ) { S32 width_chars_to_left = mGLFont->getWidth(mText.getWString().c_str(), 0, mScrollHPos); S32 last_visible_char = mGLFont->maxDrawableChars(mText.getWString().c_str(), llmax(0.f, (F32)(mMaxHPixels - mMinHPixels + width_chars_to_left))); - S32 min_scroll = mGLFont->firstDrawableChar(mText.getWString().c_str(), (F32)(mMaxHPixels - mMinHPixels - UI_LINEEDITOR_CURSOR_THICKNESS - UI_LINEEDITOR_H_PAD), mText.length(), getCursor()); + S32 min_scroll = mGLFont->firstDrawableChar(mText.getWString().c_str(), (F32)(mMaxHPixels - mMinHPixels), mText.length(), getCursor()); if (old_cursor_pos == last_visible_char) { mScrollHPos = llmin(mText.length(), llmax(min_scroll, mScrollHPos + SCROLL_INCREMENT_ADD)); @@ -439,6 +452,7 @@ void LLLineEditor::selectAll() BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask) { setFocus( TRUE ); + mTripleClickTimer.setTimerExpirySec(TRIPLE_CLICK_INTERVAL); if (mSelectionEnd == 0 && mSelectionStart == mText.length()) { @@ -555,14 +569,25 @@ BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) } else { - // Save selection for word/line selecting on double-click - mLastSelectionStart = mSelectionStart; - mLastSelectionEnd = mSelectionEnd; + if (mTripleClickTimer.hasExpired()) + { + // Save selection for word/line selecting on double-click + mLastSelectionStart = mSelectionStart; + mLastSelectionEnd = mSelectionEnd; - // Move cursor and deselect for regular click - setCursorAtLocalPos( x ); - deselect(); - startSelection(); + // Move cursor and deselect for regular click + setCursorAtLocalPos( x ); + deselect(); + startSelection(); + } + else // handle triple click + { + selectAll(); + // We don't want handleMouseUp() to "finish" the selection (and thereby + // set mSelectionEnd to where the mouse is), so we finish the selection + // here. + mIsSelecting = FALSE; + } } gFocusMgr.setMouseCapture( this ); @@ -936,7 +961,7 @@ void LLLineEditor::cut() else if( mKeystrokeCallback ) { - mKeystrokeCallback( this, mCallbackUserData ); + mKeystrokeCallback( this ); } } } @@ -1057,7 +1082,7 @@ void LLLineEditor::pasteHelper(bool is_primary) else if( mKeystrokeCallback ) { - mKeystrokeCallback( this, mCallbackUserData ); + mKeystrokeCallback( this ); } } } @@ -1370,7 +1395,7 @@ BOOL LLLineEditor::handleKeyHere(KEY key, MASK mask ) { if (mKeystrokeCallback) { - mKeystrokeCallback(this, mCallbackUserData); + mKeystrokeCallback(this); } } } @@ -1420,7 +1445,7 @@ BOOL LLLineEditor::handleUnicodeCharHere(llwchar uni_char) { // HACK! The only usage of this callback doesn't do anything with the character. // We'll have to do something about this if something ever changes! - Doug - mKeystrokeCallback( this, mCallbackUserData ); + mKeystrokeCallback( this ); } } } @@ -1461,7 +1486,7 @@ void LLLineEditor::doDelete() { if( mKeystrokeCallback ) { - mKeystrokeCallback( this, mCallbackUserData ); + mKeystrokeCallback( this ); } } } @@ -1471,6 +1496,16 @@ void LLLineEditor::doDelete() void LLLineEditor::draw() { S32 text_len = mText.length(); + static LLUICachedControl<S32> lineeditor_cursor_thickness ("UILineEditorCursorThickness", 0); + static LLUICachedControl<S32> lineeditor_v_pad ("UILineEditorVPad", 0); + static LLUICachedControl<F32> preedit_marker_brightness ("UIPreeditMarkerBrightness", 0); + static LLUICachedControl<S32> preedit_marker_gap ("UIPreeditMarkerGap", 0); + static LLUICachedControl<S32> preedit_marker_position ("UIPreeditMarkerPosition", 0); + static LLUICachedControl<S32> preedit_marker_thickness ("UIPreeditMarkerThickness", 0); + static LLUICachedControl<F32> preedit_standout_brightness ("UIPreeditStandoutBrightness", 0); + static LLUICachedControl<S32> preedit_standout_gap ("UIPreeditStandoutGap", 0); + static LLUICachedControl<S32> preedit_standout_position ("UIPreeditStandoutPosition", 0); + static LLUICachedControl<S32> preedit_standout_thickness ("UIPreeditStandoutThickness", 0); std::string saved_text; if (mDrawAsterixes) @@ -1488,7 +1523,7 @@ void LLLineEditor::draw() LLRect background( 0, getRect().getHeight(), getRect().getWidth(), 0 ); background.stretch( -mBorderThickness ); - LLColor4 bg_color = mReadOnlyBgColor; + LLColor4 bg_color = mReadOnlyBgColor.get(); #if 0 // for when we're ready for image art. if( hasFocus()) @@ -1505,11 +1540,11 @@ void LLLineEditor::draw() { if( gFocusMgr.getKeyboardFocus() == this ) { - bg_color = mFocusBgColor; + bg_color = mFocusBgColor.get(); } else { - bg_color = mWriteableBgColor; + bg_color = mWriteableBgColor.get(); } } gl_rect_2d(background, bg_color); @@ -1526,18 +1561,18 @@ void LLLineEditor::draw() { if (!getTentative()) { - text_color = mFgColor; + text_color = mFgColor.get(); } else { - text_color = mTentativeFgColor; + text_color = mTentativeFgColor.get(); } } else { - text_color = mReadOnlyFgColor; + text_color = mReadOnlyFgColor.get(); } - LLColor4 label_color = mTentativeFgColor; + LLColor4 label_color = mTentativeFgColor.get(); if (hasPreeditString()) { @@ -1556,19 +1591,19 @@ void LLLineEditor::draw() } if (mPreeditStandouts[i]) { - gl_rect_2d(preedit_pixels_left + PREEDIT_STANDOUT_GAP, - background.mBottom + PREEDIT_STANDOUT_POSITION, - preedit_pixels_right - PREEDIT_STANDOUT_GAP - 1, - background.mBottom + PREEDIT_STANDOUT_POSITION - PREEDIT_STANDOUT_THICKNESS, - (text_color * PREEDIT_STANDOUT_BRIGHTNESS + bg_color * (1 - PREEDIT_STANDOUT_BRIGHTNESS)).setAlpha(1.0f)); + gl_rect_2d(preedit_pixels_left + preedit_standout_gap, + background.mBottom + preedit_standout_position, + preedit_pixels_right - preedit_standout_gap - 1, + background.mBottom + preedit_standout_position - preedit_standout_thickness, + (text_color * preedit_standout_brightness + bg_color * (1 - preedit_standout_brightness)).setAlpha(1.0f)); } else { - gl_rect_2d(preedit_pixels_left + PREEDIT_MARKER_GAP, - background.mBottom + PREEDIT_MARKER_POSITION, - preedit_pixels_right - PREEDIT_MARKER_GAP - 1, - background.mBottom + PREEDIT_MARKER_POSITION - PREEDIT_MARKER_THICKNESS, - (text_color * PREEDIT_MARKER_BRIGHTNESS + bg_color * (1 - PREEDIT_MARKER_BRIGHTNESS)).setAlpha(1.0f)); + gl_rect_2d(preedit_pixels_left + preedit_marker_gap, + background.mBottom + preedit_marker_position, + preedit_pixels_right - preedit_marker_gap - 1, + background.mBottom + preedit_marker_position - preedit_marker_thickness, + (text_color * preedit_marker_brightness + bg_color * (1 - preedit_marker_brightness)).setAlpha(1.0f)); } } } @@ -1576,7 +1611,7 @@ void LLLineEditor::draw() S32 rendered_text = 0; F32 rendered_pixels_right = (F32)mMinHPixels; - F32 text_bottom = (F32)background.mBottom + (F32)UI_LINEEDITOR_V_PAD; + F32 text_bottom = (F32)background.mBottom + (F32)lineeditor_v_pad; if( (gFocusMgr.getKeyboardFocus() == this) && hasSelection() ) { @@ -1601,7 +1636,8 @@ void LLLineEditor::draw() rendered_pixels_right, text_bottom, text_color, LLFontGL::LEFT, LLFontGL::BOTTOM, - LLFontGL::NORMAL, + mGLFontStyle, + LLFontGL::NO_SHADOW, select_left - mScrollHPos, mMaxHPixels - llround(rendered_pixels_right), &rendered_pixels_right); @@ -1620,7 +1656,8 @@ void LLLineEditor::draw() rendered_pixels_right, text_bottom, LLColor4( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], 1 ), LLFontGL::LEFT, LLFontGL::BOTTOM, - LLFontGL::NORMAL, + mGLFontStyle, + LLFontGL::NO_SHADOW, select_right - mScrollHPos - rendered_text, mMaxHPixels - llround(rendered_pixels_right), &rendered_pixels_right); @@ -1634,7 +1671,8 @@ void LLLineEditor::draw() rendered_pixels_right, text_bottom, text_color, LLFontGL::LEFT, LLFontGL::BOTTOM, - LLFontGL::NORMAL, + mGLFontStyle, + LLFontGL::NO_SHADOW, S32_MAX, mMaxHPixels - llround(rendered_pixels_right), &rendered_pixels_right); @@ -1647,7 +1685,8 @@ void LLLineEditor::draw() rendered_pixels_right, text_bottom, text_color, LLFontGL::LEFT, LLFontGL::BOTTOM, - LLFontGL::NORMAL, + mGLFontStyle, + LLFontGL::NO_SHADOW, S32_MAX, mMaxHPixels - llround(rendered_pixels_right), &rendered_pixels_right); @@ -1667,8 +1706,8 @@ void LLLineEditor::draw() if( (elapsed < CURSOR_FLASH_DELAY ) || (S32(elapsed * 2) & 1) ) { S32 cursor_left = findPixelNearestPos(); - cursor_left -= UI_LINEEDITOR_CURSOR_THICKNESS / 2; - S32 cursor_right = cursor_left + UI_LINEEDITOR_CURSOR_THICKNESS; + cursor_left -= lineeditor_cursor_thickness / 2; + S32 cursor_right = cursor_left + lineeditor_cursor_thickness; if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection()) { const LLWString space(utf8str_to_wstring(std::string(" "))); @@ -1681,17 +1720,18 @@ void LLLineEditor::draw() cursor_right, cursor_bottom, text_color); if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection()) { - mGLFont->render(mText, getCursor(), (F32)(cursor_left + UI_LINEEDITOR_CURSOR_THICKNESS / 2), text_bottom, + mGLFont->render(mText, getCursor(), (F32)(cursor_left + lineeditor_cursor_thickness / 2), text_bottom, LLColor4( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], 1 ), LLFontGL::LEFT, LLFontGL::BOTTOM, - LLFontGL::NORMAL, + mGLFontStyle, + LLFontGL::NO_SHADOW, 1); } // Make sure the IME is in the right place S32 pixels_after_scroll = findPixelNearestPos(); // RCalculcate for IME position - LLRect screen_pos = getScreenRect(); - LLCoordGL ime_pos( screen_pos.mLeft + pixels_after_scroll, screen_pos.mTop - UI_LINEEDITOR_V_PAD ); + LLRect screen_pos = calcScreenRect(); + LLCoordGL ime_pos( screen_pos.mLeft + pixels_after_scroll, screen_pos.mTop - lineeditor_v_pad ); ime_pos.mX = (S32) (ime_pos.mX * LLUI::sGLScaleFactor.mV[VX]); ime_pos.mY = (S32) (ime_pos.mY * LLUI::sGLScaleFactor.mV[VY]); @@ -1709,7 +1749,8 @@ void LLLineEditor::draw() label_color, LLFontGL::LEFT, LLFontGL::BOTTOM, - LLFontGL::NORMAL, + mGLFontStyle, + LLFontGL::NO_SHADOW, S32_MAX, mMaxHPixels - llround(rendered_pixels_right), &rendered_pixels_right, FALSE); @@ -1733,7 +1774,8 @@ void LLLineEditor::draw() label_color, LLFontGL::LEFT, LLFontGL::BOTTOM, - LLFontGL::NORMAL, + mGLFontStyle, + LLFontGL::NO_SHADOW, S32_MAX, mMaxHPixels - llround(rendered_pixels_right), &rendered_pixels_right, FALSE); @@ -1849,7 +1891,7 @@ void LLLineEditor::setRect(const LLRect& rect) } } -void LLLineEditor::setPrevalidate(BOOL (*func)(const LLWString &)) +void LLLineEditor::setPrevalidate(LLLinePrevalidateFunc func) { mPrevalidateFunc = func; updateAllowingLanguageInput(); @@ -2169,244 +2211,11 @@ void LLLineEditor::setSelectAllonFocusReceived(BOOL b) } -void LLLineEditor::setKeystrokeCallback(void (*keystroke_callback)(LLLineEditor* caller, void* user_data)) -{ - mKeystrokeCallback = keystroke_callback; -} - -// virtual -LLXMLNodePtr LLLineEditor::getXML(bool save_children) const +void LLLineEditor::setKeystrokeCallback(callback_t callback, void* user_data) { - LLXMLNodePtr node = LLUICtrl::getXML(); - - node->createChild("max_length", TRUE)->setIntValue(mMaxLengthBytes); - - node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mGLFont)); - - if (mBorder) - { - std::string bevel; - switch(mBorder->getBevel()) - { - default: - case LLViewBorder::BEVEL_NONE: bevel = "none"; break; - case LLViewBorder::BEVEL_IN: bevel = "in"; break; - case LLViewBorder::BEVEL_OUT: bevel = "out"; break; - case LLViewBorder::BEVEL_BRIGHT:bevel = "bright"; break; - } - node->createChild("bevel_style", TRUE)->setStringValue(bevel); - - std::string style; - switch(mBorder->getStyle()) - { - default: - case LLViewBorder::STYLE_LINE: style = "line"; break; - case LLViewBorder::STYLE_TEXTURE: style = "texture"; break; - } - node->createChild("border_style", TRUE)->setStringValue(style); - - node->createChild("border_thickness", TRUE)->setIntValue(mBorder->getBorderWidth()); - } - - if (!mLabel.empty()) - { - node->createChild("label", TRUE)->setStringValue(mLabel.getString()); - } - - node->createChild("select_all_on_focus_received", TRUE)->setBoolValue(mSelectAllonFocusReceived); - - node->createChild("handle_edit_keys_directly", TRUE)->setBoolValue(mHandleEditKeysDirectly ); - - addColorXML(node, mCursorColor, "cursor_color", "TextCursorColor"); - addColorXML(node, mFgColor, "text_color", "TextFgColor"); - addColorXML(node, mReadOnlyFgColor, "text_readonly_color", "TextFgReadOnlyColor"); - addColorXML(node, mTentativeFgColor, "text_tentative_color", "TextFgTentativeColor"); - addColorXML(node, mReadOnlyBgColor, "bg_readonly_color", "TextBgReadOnlyColor"); - addColorXML(node, mWriteableBgColor, "bg_writeable_color", "TextBgWriteableColor"); - addColorXML(node, mFocusBgColor, "bg_focus_color", "TextBgFocusColor"); - - node->createChild("select_on_focus", TRUE)->setBoolValue(mSelectAllonFocusReceived ); - - return node; + mKeystrokeCallback = boost::bind(callback, _1, user_data); } -// static -LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("line_editor"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - S32 max_text_length = 128; - node->getAttributeS32("max_length", max_text_length); - - LLFontGL* font = LLView::selectFont(node); - - std::string text = node->getTextContents().substr(0, max_text_length - 1); - - LLViewBorder::EBevel bevel_style = LLViewBorder::BEVEL_IN; - LLViewBorder::getBevelFromAttribute(node, bevel_style); - - LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE; - std::string border_string; - node->getAttributeString("border_style", border_string); - LLStringUtil::toLower(border_string); - - if (border_string == "texture") - { - border_style = LLViewBorder::STYLE_TEXTURE; - } - - S32 border_thickness = 1; - node->getAttributeS32("border_thickness", border_thickness); - - LLUICtrlCallback commit_callback = NULL; - - LLLineEditor* line_editor = new LLLineEditor(name, - rect, - text, - font, - max_text_length, - commit_callback, - NULL, - NULL, - NULL, - NULL, - bevel_style, - border_style, - border_thickness); - - std::string label; - if(node->getAttributeString("label", label)) - { - line_editor->setLabel(label); - } - BOOL select_all_on_focus_received = FALSE; - if (node->getAttributeBOOL("select_all_on_focus_received", select_all_on_focus_received)) - { - line_editor->setSelectAllonFocusReceived(select_all_on_focus_received); - } - BOOL handle_edit_keys_directly = FALSE; - if (node->getAttributeBOOL("handle_edit_keys_directly", handle_edit_keys_directly)) - { - line_editor->setHandleEditKeysDirectly(handle_edit_keys_directly); - } - BOOL commit_on_focus_lost = TRUE; - if (node->getAttributeBOOL("commit_on_focus_lost", commit_on_focus_lost)) - { - line_editor->setCommitOnFocusLost(commit_on_focus_lost); - } - - line_editor->setColorParameters(node); - - if(node->hasAttribute("select_on_focus")) - { - BOOL selectall = FALSE; - node->getAttributeBOOL("select_on_focus", selectall); - line_editor->setSelectAllonFocusReceived(selectall); - } - - std::string prevalidate; - if(node->getAttributeString("prevalidate", prevalidate)) - { - LLStringUtil::toLower(prevalidate); - - if ("ascii" == prevalidate) - { - line_editor->setPrevalidate( LLLineEditor::prevalidateASCII ); - } - else if ("float" == prevalidate) - { - line_editor->setPrevalidate( LLLineEditor::prevalidateFloat ); - } - else if ("int" == prevalidate) - { - line_editor->setPrevalidate( LLLineEditor::prevalidateInt ); - } - else if ("positive_s32" == prevalidate) - { - line_editor->setPrevalidate( LLLineEditor::prevalidatePositiveS32 ); - } - else if ("non_negative_s32" == prevalidate) - { - line_editor->setPrevalidate( LLLineEditor::prevalidateNonNegativeS32 ); - } - else if ("alpha_num" == prevalidate) - { - line_editor->setPrevalidate( LLLineEditor::prevalidateAlphaNum ); - } - else if ("alpha_num_space" == prevalidate) - { - line_editor->setPrevalidate( LLLineEditor::prevalidateAlphaNumSpace ); - } - else if ("printable_not_pipe" == prevalidate) - { - line_editor->setPrevalidate( LLLineEditor::prevalidatePrintableNotPipe ); - } - else if ("printable_no_space" == prevalidate) - { - line_editor->setPrevalidate( LLLineEditor::prevalidatePrintableNoSpace ); - } - } - - line_editor->initFromXML(node, parent); - - return line_editor; -} - -//static -void LLLineEditor::cleanupLineEditor() -{ - sImage = NULL; -} - -/* static */ -LLPointer<LLUIImage> LLLineEditor::parseImage(std::string name, LLXMLNodePtr from, LLPointer<LLUIImage> def) -{ - std::string xml_name; - if (from->hasAttribute(name.c_str())) from->getAttributeString(name.c_str(), xml_name); - if (xml_name == LLStringUtil::null) return def; - LLPointer<LLUIImage> image = LLUI::getUIImage(xml_name); - return image.isNull() ? def : image; -} - -void LLLineEditor::setColorParameters(LLXMLNodePtr node) -{ - // overrides default image if supplied. - mImage = parseImage(std::string("image"), node, mImage); - - LLColor4 color; - if (LLUICtrlFactory::getAttributeColor(node,"cursor_color", color)) - { - setCursorColor(color); - } - if(node->hasAttribute("text_color")) - { - LLUICtrlFactory::getAttributeColor(node,"text_color", color); - setFgColor(color); - } - if(node->hasAttribute("text_readonly_color")) - { - LLUICtrlFactory::getAttributeColor(node,"text_readonly_color", color); - setReadOnlyFgColor(color); - } - if (LLUICtrlFactory::getAttributeColor(node,"text_tentative_color", color)) - { - setTentativeFgColor(color); - } - if(node->hasAttribute("bg_readonly_color")) - { - LLUICtrlFactory::getAttributeColor(node,"bg_readonly_color", color); - setReadOnlyBgColor(color); - } - if(node->hasAttribute("bg_writeable_color")) - { - LLUICtrlFactory::getAttributeColor(node,"bg_writeable_color", color); - setWriteableBgColor(color); - } -} BOOL LLLineEditor::setTextArg( const std::string& key, const LLStringExplicit& text ) { @@ -2429,13 +2238,19 @@ void LLLineEditor::updateAllowingLanguageInput() // fine on 1.15.0.2, since all prevalidate func reject any // non-ASCII characters. I'm not sure on future versions, // however... + LLWindow* window = getWindow(); + if (!window) + { + // test app, no window available + return; + } if (hasFocus() && !mReadOnly && !mDrawAsterixes && mPrevalidateFunc == NULL) { - getWindow()->allowLanguageTextInput(this, TRUE); + window->allowLanguageTextInput(this, TRUE); } else { - getWindow()->allowLanguageTextInput(this, FALSE); + window->allowLanguageTextInput(this, FALSE); } } @@ -2513,7 +2328,7 @@ void LLLineEditor::updatePreedit(const LLWString &preedit_string, mKeystrokeTimer.reset(); if( mKeystrokeCallback ) { - mKeystrokeCallback( this, mCallbackUserData ); + mKeystrokeCallback( this ); } } @@ -2656,146 +2471,19 @@ LLWString LLLineEditor::getConvertedText() const return text; } -static LLRegisterWidget<LLSearchEditor> r2("search_editor"); - - -LLSearchEditor::LLSearchEditor(const std::string& name, - const LLRect& rect, - S32 max_length_bytes, - void (*search_callback)(const std::string& search_string, void* user_data), - void* userdata) - : - LLUICtrl(name, rect, TRUE, NULL, userdata), - mSearchCallback(search_callback) +namespace LLInitParam { - LLRect search_edit_rect(0, getRect().getHeight(), getRect().getWidth(), 0); - mSearchEdit = new LLLineEditor(std::string("search edit"), - search_edit_rect, - LLStringUtil::null, - NULL, - max_length_bytes, - NULL, - onSearchEdit, - NULL, - this); - - mSearchEdit->setFollowsAll(); - mSearchEdit->setSelectAllonFocusReceived(TRUE); - - addChild(mSearchEdit); - - S32 btn_width = rect.getHeight(); // button is square, and as tall as search editor - LLRect clear_btn_rect(rect.getWidth() - btn_width, rect.getHeight(), rect.getWidth(), 0); - mClearSearchButton = new LLButton(std::string("clear search"), - clear_btn_rect, - std::string("icn_clear_lineeditor.tga"), - std::string("UIImgBtnCloseInactiveUUID"), - LLStringUtil::null, - onClearSearch, - this, - NULL, - LLStringUtil::null); - mClearSearchButton->setFollowsRight(); - mClearSearchButton->setFollowsTop(); - mClearSearchButton->setImageColor(LLUI::sColorsGroup->getColor("TextFgTentativeColor")); - mClearSearchButton->setTabStop(FALSE); - mSearchEdit->addChild(mClearSearchButton); - - mSearchEdit->setTextPadding(0, btn_width); -} - - -//virtual -void LLSearchEditor::setValue(const LLSD& value ) -{ - mSearchEdit->setValue(value); -} - -//virtual -LLSD LLSearchEditor::getValue() const -{ - return mSearchEdit->getValue(); -} - -//virtual -BOOL LLSearchEditor::setTextArg( const std::string& key, const LLStringExplicit& text ) -{ - return mSearchEdit->setTextArg(key, text); -} - -//virtual -BOOL LLSearchEditor::setLabelArg( const std::string& key, const LLStringExplicit& text ) -{ - return mSearchEdit->setLabelArg(key, text); -} - -//virtual -void LLSearchEditor::clear() -{ - if (mSearchEdit) - { - mSearchEdit->clear(); - } -} - -void LLSearchEditor::draw() -{ - mClearSearchButton->setVisible(!mSearchEdit->getWText().empty()); - - LLUICtrl::draw(); -} - - -//static -void LLSearchEditor::onSearchEdit(LLLineEditor* caller, void* user_data ) -{ - LLSearchEditor* search_editor = (LLSearchEditor*)user_data; - if (search_editor->mSearchCallback) + template<> + bool ParamCompare<LLLinePrevalidateFunc>::equals(const LLLinePrevalidateFunc &a, const LLLinePrevalidateFunc &b) { - search_editor->mSearchCallback(caller->getText(), search_editor->mCallbackUserData); + return false; } -} - -//static -void LLSearchEditor::onClearSearch(void* user_data) -{ - LLSearchEditor* search_editor = (LLSearchEditor*)user_data; - search_editor->setText(LLStringUtil::null); - if (search_editor->mSearchCallback) + template<> + bool ParamCompare<boost::function<void (LLLineEditor *)> >::equals( + const boost::function<void (LLLineEditor *)> &a, + const boost::function<void (LLLineEditor *)> &b) { - search_editor->mSearchCallback(LLStringUtil::null, search_editor->mCallbackUserData); + return false; } } - -// static -LLView* LLSearchEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("search_editor"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - S32 max_text_length = 128; - node->getAttributeS32("max_length", max_text_length); - - std::string text = node->getValue().substr(0, max_text_length - 1); - - LLSearchEditor* search_editor = new LLSearchEditor(name, - rect, - max_text_length, - NULL, NULL); - - std::string label; - if(node->getAttributeString("label", label)) - { - search_editor->mSearchEdit->setLabel(label); - } - - search_editor->setText(text); - - search_editor->initFromXML(node, parent); - - return search_editor; -} diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index fc5fcc5b905217412e2dbd6978384e526742fb79..78df7913341686f252a89e07342c3872f196c23c 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -51,39 +51,71 @@ #include "llviewborder.h" #include "llpreeditor.h" +#include <boost/function.hpp> class LLFontGL; class LLLineEditorRollback; class LLButton; -typedef BOOL (*LLLinePrevalidateFunc)(const LLWString &wstr); - +typedef boost::function<BOOL (const LLWString &wstr)> LLLinePrevalidateFunc; class LLLineEditor : public LLUICtrl, public LLEditMenuHandler, protected LLPreeditor { - public: - LLLineEditor(const std::string& name, - const LLRect& rect, - const std::string& default_text = LLStringUtil::null, - const LLFontGL* glfont = NULL, - S32 max_length_bytes = 254, - void (*commit_callback)(LLUICtrl* caller, void* user_data) = NULL, - void (*keystroke_callback)(LLLineEditor* caller, void* user_data) = NULL, - void (*focus_lost_callback)(LLFocusableElement* caller, void* user_data) = NULL, - void* userdata = NULL, - LLLinePrevalidateFunc prevalidate_func = NULL, - LLViewBorder::EBevel border_bevel = LLViewBorder::BEVEL_IN, - LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE, - S32 border_thickness = 1); - virtual ~LLLineEditor(); + struct PrevalidateNamedFuncs + : public LLInitParam::TypeValuesHelper<LLLinePrevalidateFunc, PrevalidateNamedFuncs> + + { + static void declareValues(); + }; + + typedef boost::function<void (LLLineEditor* caller)> keystroke_callback_t; + + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<std::string> default_text; + Optional<S32> max_length_bytes; + + Optional<keystroke_callback_t> keystroke_callback; + + Optional<LLLinePrevalidateFunc, PrevalidateNamedFuncs> prevalidate_callback; + + Optional<LLViewBorder::Params> border; - virtual LLXMLNodePtr getXML(bool save_children = true) const; - void setColorParameters(LLXMLNodePtr node); - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - static void cleanupLineEditor(); + Optional<LLUIImage*> background_image; + + Optional<bool> select_on_focus, + handle_edit_keys_directly, + commit_on_focus_lost, + ignore_tab; + + // colors + Optional<LLUIColor> cursor_color, + text_color, + text_readonly_color, + text_tentative_color, + bg_readonly_color, + bg_writeable_color, + bg_focus_color; + + Optional<S32> text_pad_left, + text_pad_right; + + Deprecated is_unicode, + drop_shadow_visible, + border_drop_shadow_visible, + bg_visible; + + Params(); + }; +protected: + LLLineEditor(const Params&); + friend class LLUICtrlFactory; + friend class LLFloaterEditUI; +public: + virtual ~LLLineEditor(); // mousehandler overrides /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); @@ -144,7 +176,7 @@ public: void setText(const LLStringExplicit &new_text); const std::string& getText() const { return mText.getString(); } - const LLWString& getWText() const { return mText.getWString(); } + LLWString getWText() const { return mText.getWString(); } LLWString getConvertedText() const; // trimmed text with paragraphs converted to newlines S32 getLength() const { return mText.length(); } @@ -160,7 +192,7 @@ public: void setRevertOnEsc( BOOL b ) { mRevertOnEsc = b; } void setCursorColor(const LLColor4& c) { mCursorColor = c; } - const LLColor4& getCursorColor() const { return mCursorColor; } + const LLColor4& getCursorColor() const { return mCursorColor.get(); } void setFgColor( const LLColor4& c ) { mFgColor = c; } void setReadOnlyFgColor( const LLColor4& c ) { mReadOnlyFgColor = c; } @@ -169,12 +201,12 @@ public: void setReadOnlyBgColor( const LLColor4& c ) { mReadOnlyBgColor = c; } void setFocusBgColor(const LLColor4& c) { mFocusBgColor = c; } - const LLColor4& getFgColor() const { return mFgColor; } - const LLColor4& getReadOnlyFgColor() const { return mReadOnlyFgColor; } - const LLColor4& getTentativeFgColor() const { return mTentativeFgColor; } - const LLColor4& getWriteableBgColor() const { return mWriteableBgColor; } - const LLColor4& getReadOnlyBgColor() const { return mReadOnlyBgColor; } - const LLColor4& getFocusBgColor() const { return mFocusBgColor; } + const LLColor4& getFgColor() const { return mFgColor.get(); } + const LLColor4& getReadOnlyFgColor() const { return mReadOnlyFgColor.get(); } + const LLColor4& getTentativeFgColor() const { return mTentativeFgColor.get(); } + const LLColor4& getWriteableBgColor() const { return mWriteableBgColor.get(); } + const LLColor4& getReadOnlyBgColor() const { return mReadOnlyBgColor.get(); } + const LLColor4& getFocusBgColor() const { return mFocusBgColor.get(); } void setIgnoreArrowKeys(BOOL b) { mIgnoreArrowKeys = b; } void setIgnoreTab(BOOL b) { mIgnoreTab = b; } @@ -193,14 +225,14 @@ public: void setHandleEditKeysDirectly( BOOL b ) { mHandleEditKeysDirectly = b; } void setSelectAllonFocusReceived(BOOL b); - - void setKeystrokeCallback(void (*keystroke_callback)(LLLineEditor* caller, void* user_data)); + + typedef boost::function<void (LLLineEditor* caller, void* user_data)> callback_t; + void setKeystrokeCallback(callback_t callback, void* user_data); void setMaxTextLength(S32 max_text_length); - void setTextPadding(S32 left, S32 right); // Used to specify room for children before or after text. // Prevalidation controls which keystrokes can affect the editor - void setPrevalidate( BOOL (*func)(const LLWString &) ); + void setPrevalidate( LLLinePrevalidateFunc func ); static BOOL prevalidateFloat(const LLWString &str ); static BOOL prevalidateInt(const LLWString &str ); static BOOL prevalidatePositiveS32(const LLWString &str); @@ -233,6 +265,7 @@ private: BOOL handleSelectionKey(KEY key, MASK mask); BOOL handleControlKey(KEY key, MASK mask); S32 handleCommitKey(KEY key, MASK mask); + void updateTextPadding(); // // private data members @@ -261,6 +294,7 @@ protected: LLViewBorder* mBorder; const LLFontGL* mGLFont; + U8 mGLFontStyle; S32 mMaxLengthBytes; // Max length of the UTF8 string in bytes S32 mCursorPos; // I-beam is just after the mCursorPos-th character. S32 mScrollHPos; // Horizontal offset from the start of mText. Used for scrolling. @@ -273,7 +307,7 @@ protected: BOOL mCommitOnFocusLost; BOOL mRevertOnEsc; - void (*mKeystrokeCallback)( LLLineEditor* caller, void* userdata ); + keystroke_callback_t mKeystrokeCallback; BOOL mIsSelecting; // Selection for clipboard operations S32 mSelectionStart; @@ -283,18 +317,18 @@ protected: S32 mLastSelectionStart; S32 mLastSelectionEnd; - S32 (*mPrevalidateFunc)(const LLWString &str); + LLLinePrevalidateFunc mPrevalidateFunc; LLFrameTimer mKeystrokeTimer; + LLTimer mTripleClickTimer; - LLColor4 mCursorColor; - - LLColor4 mFgColor; - LLColor4 mReadOnlyFgColor; - LLColor4 mTentativeFgColor; - LLColor4 mWriteableBgColor; - LLColor4 mReadOnlyBgColor; - LLColor4 mFocusBgColor; + LLUIColor mCursorColor; + LLUIColor mFgColor; + LLUIColor mReadOnlyFgColor; + LLUIColor mTentativeFgColor; + LLUIColor mWriteableBgColor; + LLUIColor mReadOnlyBgColor; + LLUIColor mFocusBgColor; S32 mBorderThickness; @@ -314,11 +348,6 @@ protected: LLPreeditor::standouts_t mPreeditStandouts; private: - // Utility on top of LLUI::getUIImage, looks up a named image in a given XML node and returns it if possible - // or returns a given default image if anything in the process fails. - static LLPointer<LLUIImage> parseImage(std::string name, LLXMLNodePtr from, LLPointer<LLUIImage> def); - // Global instance used as default for member instance below. - static LLPointer<LLUIImage> sImage; // Instances that by default point to the statics but can be overidden in XML. LLPointer<LLUIImage> mImage; @@ -363,45 +392,22 @@ private: }; // end class LLLineEditor +#ifdef LL_WINDOWS +#ifndef INSTANTIATE_GETCHILD_LINEEDITOR +#pragma warning (disable : 4231) +extern template LLLineEditor* LLView::getChild<LLLineEditor>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const; +#endif +#endif - -/* - * @brief A line editor with a button to clear it and a callback to call on every edit event. - */ -class LLSearchEditor : public LLUICtrl +namespace LLInitParam { -public: - LLSearchEditor(const std::string& name, - const LLRect& rect, - S32 max_length_bytes, - void (*search_callback)(const std::string& search_string, void* user_data), - void* userdata); - - virtual ~LLSearchEditor() {} - - /*virtual*/ void draw(); - - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - - void setText(const LLStringExplicit &new_text) { mSearchEdit->setText(new_text); } - - void setSearchCallback(void (*search_callback)(const std::string& search_string, void* user_data), void* data) { mSearchCallback = search_callback; mCallbackUserData = data; } - - // LLUICtrl interface - virtual void setValue(const LLSD& value ); - virtual LLSD getValue() const; - virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); - virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); - virtual void clear(); - -private: - static void onSearchEdit(LLLineEditor* caller, void* user_data ); - static void onClearSearch(void* user_data); - - LLLineEditor* mSearchEdit; - class LLButton* mClearSearchButton; - void (*mSearchCallback)(const std::string& search_string, void* user_data); - -}; + template<> + bool ParamCompare<LLLinePrevalidateFunc>::equals( + const LLLinePrevalidateFunc &a, const LLLinePrevalidateFunc &b); + + template<> + bool ParamCompare<boost::function<void (LLLineEditor *)> >::equals( + const boost::function<void (LLLineEditor *)> &a, const boost::function<void (LLLineEditor *)> &b); +} #endif // LL_LINEEDITOR_ diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index a8d06643ff16f188c56ce12efc33135a3b157557..4af1c1241b806beef90ff5646a6af055d269250a 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -59,16 +59,12 @@ #include "llresmgr.h" #include "llui.h" -#include "lluitrans.h" - #include "llstl.h" #include "v2math.h" #include <set> #include <boost/tokenizer.hpp> -using namespace LLOldEvents; - // static LLMenuHolderGL *LLMenuGL::sMenuContainer = NULL; @@ -80,7 +76,6 @@ S32 MENU_BAR_WIDTH = 0; ///============================================================================ const std::string SEPARATOR_NAME("separator"); -const std::string TEAROFF_SEPARATOR_LABEL( "~~~~~~~~~~~" ); const std::string SEPARATOR_LABEL( "-----------" ); const std::string VERTICAL_SEPARATOR_LABEL( "|" ); @@ -112,12 +107,6 @@ const F32 MAX_MOUSE_SLOPE_SUB_MENU = 0.9f; const S32 PIE_GESTURE_ACTIVATE_DISTANCE = 10; -LLColor4 LLMenuItemGL::sEnabledColor( 0.0f, 0.0f, 0.0f, 1.0f ); -LLColor4 LLMenuItemGL::sDisabledColor( 0.5f, 0.5f, 0.5f, 1.0f ); -LLColor4 LLMenuItemGL::sHighlightBackground( 0.0f, 0.0f, 0.7f, 1.0f ); -LLColor4 LLMenuItemGL::sHighlightForeground( 1.0f, 1.0f, 1.0f, 1.0f ); - -LLColor4 LLMenuGL::sDefaultBackgroundColor( 0.25f, 0.25f, 0.25f, 0.75f ); BOOL LLMenuGL::sKeyboardMode = FALSE; LLHandle<LLView> LLMenuHolderGL::sItemLastSelectedHandle; @@ -130,72 +119,75 @@ const F32 PIE_SHRINK_TIME = 0.2f; // time of transition between unbounded and bo const F32 ACTIVATE_HIGHLIGHT_TIME = 0.3f; +// widget registrars +struct MenuRegistry : public LLWidgetRegistry<MenuRegistry> +{}; + +static MenuRegistry::Register<LLMenuItemSeparatorGL> register_separator("menu_item_separator"); +static MenuRegistry::Register<LLMenuItemCallGL> register_menu_item_call("menu_item_call"); +static MenuRegistry::Register<LLMenuItemCheckGL> register_menu_item_check("menu_item_check"); +static MenuRegistry::Register<LLMenuGL> register_menu("menu"); + +static LLDefaultWidgetRegistry::Register<LLMenuGL> register_menu_default("menu"); + + + ///============================================================================ /// Class LLMenuItemGL ///============================================================================ - // Default constructor -LLMenuItemGL::LLMenuItemGL( const std::string& name, const std::string& label, KEY key, MASK mask ) : - LLView( name, TRUE ), - mJumpKey(KEY_NONE), - mAcceleratorKey( key ), - mAcceleratorMask( mask ), +LLMenuItemGL::LLMenuItemGL(const LLMenuItemGL::Params& p) +: LLUICtrl(p), + mJumpKey(p.jump_key), mAllowKeyRepeat(FALSE), mHighlight( FALSE ), mGotHover( FALSE ), mBriefItem( FALSE ), - mFont( LLFontGL::getFontSansSerif() ), - mStyle(LLFontGL::NORMAL), - mDrawTextDisabled( FALSE ) -{ - setLabel( label ); -} - -// virtual -LLXMLNodePtr LLMenuItemGL::getXML(bool save_children) const + mDrawTextDisabled( FALSE ), + mFont(p.font), + mAcceleratorKey(KEY_NONE), + mAcceleratorMask(MASK_NONE), + mLabel(p.label.isProvided() ? p.label() : p.name()), + mEnabledColor(p.enabled_color()), + mDisabledColor(p.disabled_color()), + mHighlightBackground(p.highlight_bg_color()), + mHighlightForeground(p.highlight_fg_color()) { - LLXMLNodePtr node = LLView::getXML(); - - node->createChild("type", TRUE)->setStringValue(getType()); - - node->createChild("label", TRUE)->setStringValue(mLabel); - - if (mAcceleratorKey != KEY_NONE) +#ifdef LL_DARWIN + // See if this Mac accelerator should really use the ctrl key and not get mapped to cmd + BOOL useMacCtrl = p.use_mac_ctrl; +#endif // LL_DARWIN + + std::string shortcut = p.shortcut; + if (shortcut.find("control") != shortcut.npos) { - std::stringstream out; - if (mAcceleratorMask & MASK_CONTROL) - { - out << "control|"; - } - if (mAcceleratorMask & MASK_ALT) - { - out << "alt|"; - } - if (mAcceleratorMask & MASK_SHIFT) - { - out << "shift|"; - } - out << LLKeyboard::stringFromKey(mAcceleratorKey); - - node->createChild("shortcut", TRUE)->setStringValue(out.str()); - #ifdef LL_DARWIN - // Write in special tag if this key is really a ctrl combination on the Mac - if (mAcceleratorMask & MASK_MAC_CONTROL) + if ( useMacCtrl ) { - node->createChild("useMacCtrl", TRUE)->setBoolValue( TRUE ); + mAcceleratorMask |= MASK_MAC_CONTROL; } #endif // LL_DARWIN + mAcceleratorMask |= MASK_CONTROL; + } + if (shortcut.find("alt") != shortcut.npos) + { + mAcceleratorMask |= MASK_ALT; + } + if (shortcut.find("shift") != shortcut.npos) + { + mAcceleratorMask |= MASK_SHIFT; } + S32 pipe_pos = shortcut.rfind("|"); + std::string key_str = shortcut.substr(pipe_pos+1); - return node; + LLKeyboard::keyFromString(key_str, &mAcceleratorKey); } BOOL LLMenuItemGL::handleAcceleratorKey(KEY key, MASK mask) { if( getEnabled() && (!gKeyboard->getKeyRepeated(key) || mAllowKeyRepeat) && (key == mAcceleratorKey) && (mask == (mAcceleratorMask & MASK_NORMALKEYS)) ) { - doIt(); + onCommit(); return TRUE; } return FALSE; @@ -271,24 +263,24 @@ void LLMenuItemGL::appendAcceleratorString( std::string& st ) const { if ( mAcceleratorMask & MASK_MAC_CONTROL ) { - st.append( LLUITrans::getString("accel-mac-control") ); + st.append( "Ctrl-" ); } else { - st.append( LLUITrans::getString("accel-mac-command") ); // Symbol would be "\xE2\x8C\x98" + st.append( "Cmd-" ); // Symbol would be "\xE2\x8C\x98" } } if( mAcceleratorMask & MASK_ALT ) - st.append( LLUITrans::getString("accel-mac-option") ); // Symbol would be "\xE2\x8C\xA5" + st.append( "Opt-" ); // Symbol would be "\xE2\x8C\xA5" if( mAcceleratorMask & MASK_SHIFT ) - st.append( LLUITrans::getString("accel-mac-shift") ); // Symbol would be "\xE2\x8C\xA7" + st.append( "Shift-" ); // Symbol would be "\xE2\x8C\xA7" #else if( mAcceleratorMask & MASK_CONTROL ) - st.append( LLUITrans::getString("accel-win-control") ); + st.append( "Ctrl-" ); if( mAcceleratorMask & MASK_ALT ) - st.append( LLUITrans::getString("accel-win-alt") ); + st.append( "Alt-" ); if( mAcceleratorMask & MASK_SHIFT ) - st.append( LLUITrans::getString("accel-win-shift") ); + st.append( "Shift-" ); #endif std::string keystr = LLKeyboard::stringFromKey( mAcceleratorKey ); @@ -356,7 +348,7 @@ void LLMenuItemGL::buildDrawLabel( void ) mDrawAccelLabel = st; } -void LLMenuItemGL::doIt( void ) +void LLMenuItemGL::onCommit( void ) { // close all open menus by default // if parent menu is actually visible (and we are not triggering menu item via accelerator) @@ -365,6 +357,8 @@ void LLMenuItemGL::doIt( void ) { LLMenuGL::sMenuContainer->hideMenus(); } + + LLUICtrl::onCommit(); } // set the hover status (called by it's menu) @@ -404,7 +398,7 @@ BOOL LLMenuItemGL::handleKeyHere( KEY key, MASK mask ) // switch to keyboard navigation mode LLMenuGL::setKeyboardMode(TRUE); - doIt(); + onCommit(); return TRUE; } } @@ -412,25 +406,30 @@ BOOL LLMenuItemGL::handleKeyHere( KEY key, MASK mask ) return FALSE; } -BOOL LLMenuItemGL::handleMouseUp( S32 x, S32 y, MASK ) +BOOL LLMenuItemGL::handleMouseUp( S32 x, S32 y, MASK mask) { // switch to mouse navigation mode LLMenuGL::setKeyboardMode(FALSE); - doIt(); + onCommit(); make_ui_sound("UISndClickRelease"); - return TRUE; + return LLView::handleMouseUp(x, y, mask); } -BOOL LLMenuItemGL::handleMouseDown( S32 x, S32 y, MASK ) +BOOL LLMenuItemGL::handleMouseDown( S32 x, S32 y, MASK mask) { // switch to mouse navigation mode LLMenuGL::setKeyboardMode(FALSE); setHighlight(TRUE); - return TRUE; + return LLView::handleMouseDown(x, y, mask); } +BOOL LLMenuItemGL::handleScrollWheel( S32 x, S32 y, S32 clicks ) +{ + // If the menu is scrollable let it handle the wheel event. + return !getMenu()->isScrollable(); +} void LLMenuItemGL::draw( void ) { @@ -441,55 +440,58 @@ void LLMenuItemGL::draw( void ) // let disabled items be highlighted, just don't draw them as such if( getEnabled() && getHighlight() && !mBriefItem) { - gGL.color4fv( sHighlightBackground.mV ); + int debug_count = 0; + if (dynamic_cast<LLMenuItemCallGL*>(this)) + debug_count++; + gGL.color4fv( mHighlightBackground.get().mV ); gl_rect_2d( 0, getRect().getHeight(), getRect().getWidth(), 0 ); } LLColor4 color; - U8 font_style = mStyle; + LLFontGL::ShadowType shadow_style = LLFontGL::NO_SHADOW; if (getEnabled() && !mDrawTextDisabled ) { - font_style |= LLFontGL::DROP_SHADOW_SOFT; + shadow_style = LLFontGL::DROP_SHADOW_SOFT; } if ( getEnabled() && getHighlight() ) { - color = sHighlightForeground; + color = mHighlightForeground.get(); } else if( getEnabled() && !mDrawTextDisabled ) { - color = sEnabledColor; + color = mEnabledColor.get(); } else { - color = sDisabledColor; + color = mDisabledColor.get(); } // Draw the text on top. if (mBriefItem) { mFont->render( mLabel, 0, BRIEF_PAD_PIXELS / 2, 0, color, - LLFontGL::LEFT, LLFontGL::BOTTOM, font_style ); + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, shadow_style ); } else { if( !mDrawBoolLabel.empty() ) { mFont->render( mDrawBoolLabel.getWString(), 0, (F32)LEFT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color, - LLFontGL::LEFT, LLFontGL::BOTTOM, font_style, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, shadow_style, S32_MAX, S32_MAX, NULL, FALSE ); } mFont->render( mLabel.getWString(), 0, (F32)LEFT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color, - LLFontGL::LEFT, LLFontGL::BOTTOM, font_style, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, shadow_style, S32_MAX, S32_MAX, NULL, FALSE ); if( !mDrawAccelLabel.empty() ) { mFont->render( mDrawAccelLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color, - LLFontGL::RIGHT, LLFontGL::BOTTOM, font_style, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, shadow_style, S32_MAX, S32_MAX, NULL, FALSE ); } if( !mDrawBranchLabel.empty() ) { mFont->render( mDrawBranchLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color, - LLFontGL::RIGHT, LLFontGL::BOTTOM, font_style, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, shadow_style, S32_MAX, S32_MAX, NULL, FALSE ); } } @@ -517,38 +519,39 @@ BOOL LLMenuItemGL::setLabelArg( const std::string& key, const LLStringExplicit& return TRUE; } +void LLMenuItemGL::onVisibilityChange(BOOL new_visibility) +{ + if (getMenu()) + { + getMenu()->needsArrange(); + } +} + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLMenuItemSeparatorGL // // This class represents a separator. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLMenuItemSeparatorGL : public LLMenuItemGL +LLMenuItemSeparatorGL::Params::Params() { -public: - LLMenuItemSeparatorGL( const std::string &name = SEPARATOR_NAME ); - - virtual std::string getType() const { return "separator"; } - - // doIt() - do the primary funcationality of the menu item. - virtual void doIt( void ) {} - - virtual void draw( void ); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); + name = "separator"; + label = SEPARATOR_LABEL; +} - virtual U32 getNominalHeight( void ) const { return SEPARATOR_HEIGHT_PIXELS; } -}; +LLMenuItemSeparatorGL::LLMenuItemSeparatorGL(const LLMenuItemSeparatorGL::Params& p) : + LLMenuItemGL( p ) +{ +} -LLMenuItemSeparatorGL::LLMenuItemSeparatorGL( const std::string &name ) : - LLMenuItemGL( name, SEPARATOR_LABEL ) +//virtual +U32 LLMenuItemSeparatorGL::getNominalHeight( void ) const { + return SEPARATOR_HEIGHT_PIXELS; } void LLMenuItemSeparatorGL::draw( void ) { - gGL.color4fv( getDisabledColor().mV ); + gGL.color4fv( mDisabledColor.get().mV ); const S32 y = getRect().getHeight() / 2; const S32 PAD = 6; gl_line_2d( PAD, y, getRect().getWidth() - PAD, y ); @@ -559,11 +562,13 @@ BOOL LLMenuItemSeparatorGL::handleMouseDown(S32 x, S32 y, MASK mask) LLMenuGL* parent_menu = getMenu(); if (y > getRect().getHeight() / 2) { - return parent_menu->handleMouseDown(x + getRect().mLeft, getRect().mTop + 1, mask); + LLView* prev_menu_item = parent_menu->findPrevSibling(this); + return prev_menu_item ? prev_menu_item->handleMouseDown(x, prev_menu_item->getRect().getHeight(), mask) : FALSE; } else { - return parent_menu->handleMouseDown(x + getRect().mLeft, getRect().mBottom - 1, mask); + LLView* next_menu_item = parent_menu->findNextSibling(this); + return next_menu_item ? next_menu_item->handleMouseDown(x, 0, mask) : FALSE; } } @@ -572,11 +577,13 @@ BOOL LLMenuItemSeparatorGL::handleMouseUp(S32 x, S32 y, MASK mask) LLMenuGL* parent_menu = getMenu(); if (y > getRect().getHeight() / 2) { - return parent_menu->handleMouseUp(x + getRect().mLeft, getRect().mTop + 1, mask); + LLView* prev_menu_item = parent_menu->findPrevSibling(this); + return prev_menu_item ? prev_menu_item->handleMouseUp(x, prev_menu_item->getRect().getHeight(), mask) : FALSE; } else { - return parent_menu->handleMouseUp(x + getRect().mLeft, getRect().mBottom - 1, mask); + LLView* next_menu_item = parent_menu->findNextSibling(this); + return next_menu_item ? next_menu_item->handleMouseUp(x, 0, mask) : FALSE; } } @@ -595,7 +602,6 @@ BOOL LLMenuItemSeparatorGL::handleHover(S32 x, S32 y, MASK mask) } } - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLMenuItemVerticalSeparatorGL // @@ -619,19 +625,19 @@ LLMenuItemVerticalSeparatorGL::LLMenuItemVerticalSeparatorGL( void ) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLMenuItemTearOffGL //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LLMenuItemTearOffGL::LLMenuItemTearOffGL(LLHandle<LLFloater> parent_floater_handle) : - LLMenuItemGL(std::string("tear off"), TEAROFF_SEPARATOR_LABEL), - mParentHandle(parent_floater_handle) +LLMenuItemTearOffGL::LLMenuItemTearOffGL(const LLMenuItemTearOffGL::Params& p) +: LLMenuItemGL(p), + mParentHandle(p.parent_floater_handle) { } -void LLMenuItemTearOffGL::doIt() +void LLMenuItemTearOffGL::onCommit() { if (getMenu()->getTornOff()) { LLTearOffMenu* torn_off_menu = (LLTearOffMenu*)(getMenu()->getParent()); - torn_off_menu->close(); + torn_off_menu->closeFloater(); } else { @@ -641,7 +647,7 @@ void LLMenuItemTearOffGL::doIt() getMenu()->highlightNextItem(this); } - getMenu()->arrange(); + getMenu()->needsArrange(); LLFloater* parent_floater = mParentHandle.get(); LLFloater* tear_off_menu = LLTearOffMenu::create(getMenu()); @@ -658,7 +664,7 @@ void LLMenuItemTearOffGL::doIt() tear_off_menu->setFocus(TRUE); } } - LLMenuItemGL::doIt(); + LLMenuItemGL::onCommit(); } void LLMenuItemTearOffGL::draw() @@ -666,17 +672,17 @@ void LLMenuItemTearOffGL::draw() // disabled items can be highlighted, but shouldn't render as such if( getEnabled() && getHighlight() && !isBriefItem()) { - gGL.color4fv( getHighlightBGColor().mV ); + gGL.color4fv( mHighlightBackground.get().mV ); gl_rect_2d( 0, getRect().getHeight(), getRect().getWidth(), 0 ); } if (getEnabled()) { - gGL.color4fv( getEnabledColor().mV ); + gGL.color4fv( mEnabledColor.get().mV ); } else { - gGL.color4fv( getDisabledColor().mV ); + gGL.color4fv( mDisabledColor.get().mV ); } const S32 y = getRect().getHeight() / 3; const S32 PAD = 6; @@ -699,11 +705,16 @@ U32 LLMenuItemTearOffGL::getNominalHeight( void ) const class LLMenuItemBlankGL : public LLMenuItemGL { public: - LLMenuItemBlankGL( void ) : LLMenuItemGL( LLStringUtil::null, LLStringUtil::null ) + struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params> { - setEnabled(FALSE); - } - virtual void doIt( void ) {} + Params() + { + name=""; + enabled = false; + } + }; + LLMenuItemBlankGL( const Params& p ) : LLMenuItemGL( p ) + {} virtual void draw( void ) {} }; @@ -712,238 +723,113 @@ public: /// Class LLMenuItemCallGL ///============================================================================ -LLMenuItemCallGL::LLMenuItemCallGL( const std::string& name, - const std::string& label, - menu_callback clicked_cb, - enabled_callback enabled_cb, - void* user_data, - KEY key, MASK mask, - BOOL enabled, - on_disabled_callback on_disabled_cb) : - LLMenuItemGL( name, label, key, mask ), - mCallback( clicked_cb ), - mEnabledCallback( enabled_cb ), - mLabelCallback(NULL), - mUserData( user_data ), - mOnDisabledCallback(on_disabled_cb) -{ - if(!enabled) setEnabled(FALSE); -} - -LLMenuItemCallGL::LLMenuItemCallGL( const std::string& name, - menu_callback clicked_cb, - enabled_callback enabled_cb, - void* user_data, - KEY key, MASK mask, - BOOL enabled, - on_disabled_callback on_disabled_cb) : - LLMenuItemGL( name, name, key, mask ), - mCallback( clicked_cb ), - mEnabledCallback( enabled_cb ), - mLabelCallback(NULL), - mUserData( user_data ), - mOnDisabledCallback(on_disabled_cb) -{ - if(!enabled) setEnabled(FALSE); -} - -LLMenuItemCallGL::LLMenuItemCallGL(const std::string& name, - const std::string& label, - menu_callback clicked_cb, - enabled_callback enabled_cb, - label_callback label_cb, - void* user_data, - KEY key, MASK mask, - BOOL enabled, - on_disabled_callback on_disabled_cb) : - LLMenuItemGL(name, label, key, mask), - mCallback(clicked_cb), - mEnabledCallback(enabled_cb), - mLabelCallback(label_cb), - mUserData(user_data), - mOnDisabledCallback(on_disabled_cb) -{ - if(!enabled) setEnabled(FALSE); -} - -LLMenuItemCallGL::LLMenuItemCallGL(const std::string& name, - menu_callback clicked_cb, - enabled_callback enabled_cb, - label_callback label_cb, - void* user_data, - KEY key, MASK mask, - BOOL enabled, - on_disabled_callback on_disabled_cb) : - LLMenuItemGL(name, name, key, mask), - mCallback(clicked_cb), - mEnabledCallback(enabled_cb), - mLabelCallback(label_cb), - mUserData(user_data), - mOnDisabledCallback(on_disabled_cb) -{ - if(!enabled) setEnabled(FALSE); -} - -void LLMenuItemCallGL::setEnabledControl(std::string enabled_control, LLView *context) -{ - // Register new listener - if (!enabled_control.empty()) - { - LLControlVariable *control = context->findControl(enabled_control); - if (!control) - { - context->addBoolControl(enabled_control, getEnabled()); - control = context->findControl(enabled_control); - llassert_always(control); - } - control->getSignal()->connect(boost::bind(&LLView::controlListener, _1, getHandle(), std::string("enabled"))); - setEnabled(control->getValue()); - } -} - -void LLMenuItemCallGL::setVisibleControl(std::string visible_control, LLView *context) +LLMenuItemCallGL::LLMenuItemCallGL(const LLMenuItemCallGL::Params& p) +: LLMenuItemGL(p) { - // Register new listener - if (!visible_control.empty()) - { - LLControlVariable *control = context->findControl(visible_control); - if (!control) - { - context->addBoolControl(visible_control, getVisible()); - control = context->findControl(visible_control); - llassert_always(control); - } - control->getSignal()->connect(boost::bind(&LLView::controlListener, _1, getHandle(), std::string("visible"))); - setVisible(control->getValue()); - } } -// virtual -LLXMLNodePtr LLMenuItemCallGL::getXML(bool save_children) const +void LLMenuItemCallGL::initFromParams(const Params& p) { - LLXMLNodePtr node = LLMenuItemGL::getXML(); - - // Contents - - std::vector<LLListenerEntry> listeners = mDispatcher->getListeners(); - std::vector<LLListenerEntry>::iterator itor; - for (itor = listeners.begin(); itor != listeners.end(); ++itor) + if (p.on_enable.isProvided()) { - std::string listener_name = findEventListener((LLSimpleListener*)itor->listener); - if (!listener_name.empty()) + initEnableCallback(p.on_enable, mEnableSignal); + // Set the enabled control variable (for backwards compatability) + if (p.on_enable.control_name.isProvided() && !p.on_enable.control_name().empty()) { - LLXMLNodePtr child_node = node->createChild("on_click", FALSE); - child_node->createChild("function", TRUE)->setStringValue(listener_name); - child_node->createChild("filter", TRUE)->setStringValue(itor->filter.asString()); - child_node->createChild("userdata", TRUE)->setStringValue(itor->userdata.asString()); + LLControlVariable* control = findControl(p.on_enable.control_name()); + if (control) + setEnabledControlVariable(control); } } - - return node; + if (p.on_click.isProvided()) + initCommitCallback(p.on_click, mCommitSignal); + + LLUICtrl::initFromParams(p); } -// doIt() - Call the callback provided -void LLMenuItemCallGL::doIt( void ) +void LLMenuItemCallGL::onCommit( void ) { // RN: menu item can be deleted in callback, so beware getMenu()->setItemLastSelected( this ); + + LLMenuItemGL::onCommit(); +} - if( mCallback ) +void LLMenuItemCallGL::updateEnabled( void ) +{ + if (mEnableSignal.num_slots() > 0) { - mCallback( mUserData ); + bool enabled = mEnableSignal(this, LLSD()); + if (mEnabledControlVariable) + { + if (!enabled) + mEnabledControlVariable->set(false); // callback overrides control variable; this will call setEnabled() + } + else + { + setEnabled(enabled); + } } - LLPointer<LLEvent> fired_event = new LLEvent(this); - fireEvent(fired_event, "on_click"); - LLMenuItemGL::doIt(); } void LLMenuItemCallGL::buildDrawLabel( void ) { - LLPointer<LLEvent> fired_event = new LLEvent(this); - fireEvent(fired_event, "on_build"); - if( mEnabledCallback ) - { - setEnabled( mEnabledCallback( mUserData ) ); - } - if(mLabelCallback) - { - std::string label; - mLabelCallback(label, mUserData); - mLabel = label; - } + updateEnabled(); LLMenuItemGL::buildDrawLabel(); } +BOOL LLMenuItemCallGL::handleKeyHere( KEY key, MASK mask ) +{ + return LLMenuItemGL::handleKeyHere(key, mask); +} + BOOL LLMenuItemCallGL::handleAcceleratorKey( KEY key, MASK mask ) { - if( (!gKeyboard->getKeyRepeated(key) || getAllowKeyRepeat()) && (key == mAcceleratorKey) && (mask == (mAcceleratorMask & MASK_NORMALKEYS)) ) + if( (!gKeyboard->getKeyRepeated(key) || getAllowKeyRepeat()) && (key == mAcceleratorKey) && (mask == (mAcceleratorMask & MASK_NORMALKEYS)) ) { - LLPointer<LLEvent> fired_event = new LLEvent(this); - fireEvent(fired_event, "on_build"); - if( mEnabledCallback ) - { - setEnabled( mEnabledCallback( mUserData ) ); - } - if( !getEnabled() ) + updateEnabled(); + if (getEnabled()) { - if( mOnDisabledCallback ) - { - mOnDisabledCallback( mUserData ); - } + onCommit(); + return TRUE; } } - return LLMenuItemGL::handleAcceleratorKey(key, mask); + return FALSE; } ///============================================================================ /// Class LLMenuItemCheckGL ///============================================================================ - -LLMenuItemCheckGL::LLMenuItemCheckGL ( const std::string& name, - const std::string& label, - menu_callback clicked_cb, - enabled_callback enabled_cb, - check_callback check_cb, - void* user_data, - KEY key, MASK mask ) : - LLMenuItemCallGL( name, label, clicked_cb, enabled_cb, user_data, key, mask ), - mCheckCallback( check_cb ), - mChecked(FALSE) +LLMenuItemCheckGL::LLMenuItemCheckGL (const LLMenuItemCheckGL::Params& p) +: LLMenuItemCallGL(p) { } -LLMenuItemCheckGL::LLMenuItemCheckGL ( const std::string& name, - menu_callback clicked_cb, - enabled_callback enabled_cb, - check_callback check_cb, - void* user_data, - KEY key, MASK mask ) : - LLMenuItemCallGL( name, name, clicked_cb, enabled_cb, user_data, key, mask ), - mCheckCallback( check_cb ), - mChecked(FALSE) +void LLMenuItemCheckGL::initFromParams(const Params& p) { + if (p.on_check.isProvided()) + { + initEnableCallback(p.on_check, mCheckSignal); + // Set the control name (for backwards compatability) + if (p.on_check.control_name.isProvided() && !p.on_check.control_name().empty()) + { + setControlName(p.on_check.control_name()); + } + } + + LLMenuItemCallGL::initFromParams(p); } -LLMenuItemCheckGL::LLMenuItemCheckGL ( const std::string& name, - const std::string& label, - menu_callback clicked_cb, - enabled_callback enabled_cb, - std::string control_name, - LLView *context, - void* user_data, - KEY key, MASK mask ) : - LLMenuItemCallGL( name, label, clicked_cb, enabled_cb, user_data, key, mask ), - mCheckCallback( NULL ), - mChecked(FALSE) +void LLMenuItemCheckGL::onCommit( void ) { - setControlName(control_name, context); + LLMenuItemCallGL::onCommit(); } //virtual void LLMenuItemCheckGL::setValue(const LLSD& value) { - mChecked = value.asBoolean(); - if(mChecked) + LLUICtrl::setValue(value); + if(value.asBoolean()) { mDrawBoolLabel = BOOLEAN_TRUE_PREFIX; } @@ -953,68 +839,21 @@ void LLMenuItemCheckGL::setValue(const LLSD& value) } } -void LLMenuItemCheckGL::setCheckedControl(std::string checked_control, LLView *context) -{ - // Register new listener - if (!checked_control.empty()) - { - LLControlVariable *control = context->findControl(checked_control); - if (!control) - { - context->addBoolControl(checked_control, mChecked); - control = context->findControl(checked_control); - llassert_always(control); - } - control->getSignal()->connect(boost::bind(&LLView::controlListener, _1, getHandle(), std::string("value"))); - mChecked = control->getValue(); - } -} - -// virtual -LLXMLNodePtr LLMenuItemCheckGL::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLMenuItemCallGL::getXML(); - return node; -} - // called to rebuild the draw label void LLMenuItemCheckGL::buildDrawLabel( void ) { - if(mChecked || (mCheckCallback && mCheckCallback( getUserData() ) ) ) + // Note: mCheckSignal() returns true if no callbacks are set + bool checked = mCheckSignal(this, LLSD()); + if (mControlVariable) { - mDrawBoolLabel = BOOLEAN_TRUE_PREFIX; + if (!checked) + setControlValue(false); // callback overrides control variable; this will call setValue() } else { - mDrawBoolLabel.clear(); + setValue(checked); } - LLMenuItemCallGL::buildDrawLabel(); -} - - -///============================================================================ -/// Class LLMenuItemToggleGL -///============================================================================ - -LLMenuItemToggleGL::LLMenuItemToggleGL( const std::string& name, const std::string& label, BOOL* toggle, - KEY key, MASK mask ) : - LLMenuItemGL( name, label, key, mask ), - mToggle( toggle ) -{ -} - -LLMenuItemToggleGL::LLMenuItemToggleGL( const std::string& name, BOOL* toggle, - KEY key, MASK mask ) : - LLMenuItemGL( name, name, key, mask ), - mToggle( toggle ) -{ -} - - -// called to rebuild the draw label -void LLMenuItemToggleGL::buildDrawLabel( void ) -{ - if( *mToggle ) + if(getValue().asBoolean()) { mDrawBoolLabel = BOOLEAN_TRUE_PREFIX; } @@ -1022,64 +861,48 @@ void LLMenuItemToggleGL::buildDrawLabel( void ) { mDrawBoolLabel.clear(); } - mDrawAccelLabel.clear(); - std::string st = mDrawAccelLabel; - appendAcceleratorString( st ); - mDrawAccelLabel = st; -} - -// doIt() - do the primary funcationality of the menu item. -void LLMenuItemToggleGL::doIt( void ) -{ - getMenu()->setItemLastSelected( this ); - //llinfos << "LLMenuItemToggleGL::doIt " << mLabel.c_str() << llendl; - *mToggle = !(*mToggle); - buildDrawLabel(); - LLMenuItemGL::doIt(); + LLMenuItemCallGL::buildDrawLabel(); } - -LLMenuItemBranchGL::LLMenuItemBranchGL( const std::string& name, const std::string& label, LLHandle<LLView> branch, - KEY key, MASK mask ) : - LLMenuItemGL( name, label, key, mask ), - mBranch( branch ) +///============================================================================ +/// Class LLMenuItemBranchGL +///============================================================================ +LLMenuItemBranchGL::LLMenuItemBranchGL(const LLMenuItemBranchGL::Params& p) + : LLMenuItemGL(p) { - if(!dynamic_cast<LLMenuGL*>(branch.get())) + LLMenuGL* branch = p.branch; + if (branch) { - llerrs << "Non-menu handle passed as branch reference." << llendl; - } - - if(getBranch()) - { - getBranch()->setVisible( FALSE ); - getBranch()->setParentMenuItem(this); + mBranchHandle = branch->getHandle(); + branch->setVisible(FALSE); + branch->setParentMenuItem(this); } } LLMenuItemBranchGL::~LLMenuItemBranchGL() { - LLView::deleteViewByHandle(mBranch); + LLView::deleteViewByHandle(mBranchHandle); } // virtual LLView* LLMenuItemBranchGL::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const { + LLMenuGL* branch = getBranch(); + if (!branch) + return LLView::getChildView(name, recurse, create_if_missing); + // richard: this is redundant with parent, remove - if (getBranch()) + if (branch->getName() == name) { - if(getBranch()->getName() == name) - { - return getBranch(); - } - - // Always recurse on branches - LLView* child = getBranch()->getChildView(name, recurse, FALSE); - if(child) - { - return child; - } + return branch; + } + // Always recurse on branches + LLView* child = branch->getChildView(name, recurse, FALSE); + if (!child) + { + child = LLView::getChildView(name, recurse, create_if_missing); } - return LLView::getChildView(name, recurse, create_if_missing);; + return child; } // virtual @@ -1088,49 +911,35 @@ BOOL LLMenuItemBranchGL::handleMouseUp(S32 x, S32 y, MASK mask) // switch to mouse navigation mode LLMenuGL::setKeyboardMode(FALSE); - doIt(); + onCommit(); make_ui_sound("UISndClickRelease"); return TRUE; } BOOL LLMenuItemBranchGL::handleAcceleratorKey(KEY key, MASK mask) { - if(getBranch()) - { - return getBranch()->handleAcceleratorKey(key, mask); - } - return FALSE; -} - -// virtual -LLXMLNodePtr LLMenuItemBranchGL::getXML(bool save_children) const -{ - if (getBranch()) - { - return getBranch()->getXML(); - } - - return LLMenuItemGL::getXML(); + return getBranch() && getBranch()->handleAcceleratorKey(key, mask); } - // This function checks to see if the accelerator key is already in use; // if not, it will be added to the list BOOL LLMenuItemBranchGL::addToAcceleratorList(std::list<LLKeyBinding*> *listp) { - if(getBranch()) - { - U32 item_count = getBranch()->getItemCount(); - LLMenuItemGL *item; + LLMenuGL* branch = getBranch(); + if (!branch) + return FALSE; - while (item_count--) + U32 item_count = branch->getItemCount(); + LLMenuItemGL *item; + + while (item_count--) + { + if ((item = branch->getItem(item_count))) { - if ((item = getBranch()->getItem(item_count))) - { - return item->addToAcceleratorList(listp); - } + return item->addToAcceleratorList(listp); } } + return FALSE; } @@ -1145,23 +954,24 @@ void LLMenuItemBranchGL::buildDrawLabel( void ) mDrawBranchLabel = BRANCH_SUFFIX; } -// doIt() - do the primary functionality of the menu item. -void LLMenuItemBranchGL::doIt( void ) +void LLMenuItemBranchGL::onCommit( void ) { openMenu(); // keyboard navigation automatically propagates highlight to sub-menu // to facilitate fast menu control via jump keys - if (getBranch() && LLMenuGL::getKeyboardMode() && !getBranch()->getHighlightedItem()) + if (LLMenuGL::getKeyboardMode() && getBranch()&& !getBranch()->getHighlightedItem()) { getBranch()->highlightNextItem(NULL); } + + LLUICtrl::onCommit(); } BOOL LLMenuItemBranchGL::handleKey(KEY key, MASK mask, BOOL called_from_parent) { BOOL handled = FALSE; - if (called_from_parent && getBranch()) + if (getBranch() && called_from_parent) { handled = getBranch()->handleKey(key, mask, called_from_parent); } @@ -1177,7 +987,7 @@ BOOL LLMenuItemBranchGL::handleKey(KEY key, MASK mask, BOOL called_from_parent) BOOL LLMenuItemBranchGL::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) { BOOL handled = FALSE; - if (called_from_parent && getBranch()) + if (getBranch() && called_from_parent) { handled = getBranch()->handleUnicodeChar(uni_char, TRUE); } @@ -1193,21 +1003,21 @@ BOOL LLMenuItemBranchGL::handleUnicodeChar(llwchar uni_char, BOOL called_from_pa void LLMenuItemBranchGL::setHighlight( BOOL highlight ) { - if (highlight == getHighlight()) return; + if (highlight == getHighlight()) + return; - if(!getBranch()) - { + LLMenuGL* branch = getBranch(); + if (!branch) return; - } - BOOL auto_open = getEnabled() && (!getBranch()->getVisible() || getBranch()->getTornOff()); + BOOL auto_open = getEnabled() && (!branch->getVisible() || branch->getTornOff()); // torn off menus don't open sub menus on hover unless they have focus if (getMenu()->getTornOff() && !((LLFloater*)getMenu()->getParent())->hasFocus()) { auto_open = FALSE; } // don't auto open torn off sub-menus (need to explicitly active menu item to give them focus) - if (getBranch()->getTornOff()) + if (branch->getTornOff()) { auto_open = FALSE; } @@ -1221,14 +1031,14 @@ void LLMenuItemBranchGL::setHighlight( BOOL highlight ) } else { - if (getBranch()->getTornOff()) + if (branch->getTornOff()) { - ((LLFloater*)getBranch()->getParent())->setFocus(FALSE); - getBranch()->clearHoverItem(); + ((LLFloater*)branch->getParent())->setFocus(FALSE); + branch->clearHoverItem(); } else { - getBranch()->setVisible( FALSE ); + branch->setVisible( FALSE ); } } } @@ -1262,15 +1072,19 @@ void LLMenuItemBranchGL::onVisibilityChange( BOOL new_visibility ) BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) { - if (getMenu()->getVisible() && getBranch() && getBranch()->getVisible() && key == KEY_LEFT) + LLMenuGL* branch = getBranch(); + if (!branch) + return LLMenuItemGL::handleKeyHere(key, mask); + + if (getMenu()->getVisible() && branch->getVisible() && key == KEY_LEFT) { // switch to keyboard navigation mode LLMenuGL::setKeyboardMode(TRUE); - BOOL handled = getBranch()->clearHoverItem(); - if (getBranch()->getTornOff()) + BOOL handled = branch->clearHoverItem(); + if (branch->getTornOff()) { - ((LLFloater*)getBranch()->getParent())->setFocus(FALSE); + ((LLFloater*)branch->getParent())->setFocus(FALSE); } if (handled && getMenu()->getTornOff()) { @@ -1281,12 +1095,12 @@ BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) if (getHighlight() && getMenu()->isOpen() && - key == KEY_RIGHT && getBranch() && !getBranch()->getHighlightedItem()) + key == KEY_RIGHT && !branch->getHighlightedItem()) { // switch to keyboard navigation mode LLMenuGL::setKeyboardMode(TRUE); - LLMenuItemGL* itemp = getBranch()->highlightNextItem(NULL); + LLMenuItemGL* itemp = branch->highlightNextItem(NULL); if (itemp) { return TRUE; @@ -1298,39 +1112,41 @@ BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) void LLMenuItemBranchGL::openMenu() { - if(!getBranch()) return; + LLMenuGL* branch = getBranch(); + if (!branch) + return; - if (getBranch()->getTornOff()) + if (branch->getTornOff()) { - gFloaterView->bringToFront((LLFloater*)getBranch()->getParent()); + gFloaterView->bringToFront((LLFloater*)branch->getParent()); // this might not be necessary, as torn off branches don't get focus and hence no highligth - getBranch()->highlightNextItem(NULL); + branch->highlightNextItem(NULL); } - else if( !getBranch()->getVisible() ) + else if( !branch->getVisible() ) { // get valid rectangle for menus const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getMenuRect(); - getBranch()->arrange(); + branch->arrange(); - LLRect rect = getBranch()->getRect(); + LLRect rect = branch->getRect(); // calculate root-view relative position for branch menu S32 left = getRect().mRight; S32 top = getRect().mTop - getRect().mBottom; - localPointToOtherView(left, top, &left, &top, getBranch()->getParent()); + localPointToOtherView(left, top, &left, &top, branch->getParent()); rect.setLeftTopAndSize( left, top, rect.getWidth(), rect.getHeight() ); - if (getBranch()->getCanTearOff()) + if (branch->getCanTearOff()) { rect.translate(0, TEAROFF_SEPARATOR_HEIGHT_PIXELS); } - getBranch()->setRect( rect ); + branch->setRect( rect ); S32 x = 0; S32 y = 0; - getBranch()->localPointToOtherView( 0, 0, &x, &y, getBranch()->getParent() ); + branch->localPointToOtherView( 0, 0, &x, &y, branch->getParent() ); S32 delta_x = 0; S32 delta_y = 0; if( y < menu_region_rect.mBottom ) @@ -1344,9 +1160,9 @@ void LLMenuItemBranchGL::openMenu() // move sub-menu over to left side delta_x = llmax(-x, (-1 * (rect.getWidth() + getRect().getWidth()))); } - getBranch()->translate( delta_x, delta_y ); - getBranch()->setVisible( TRUE ); - getBranch()->getParent()->sendChildToFront(getBranch()); + branch->translate( delta_x, delta_y ); + branch->setVisible( TRUE ); + branch->getParent()->sendChildToFront(branch); } } @@ -1363,10 +1179,7 @@ class LLMenuItemBranchDownGL : public LLMenuItemBranchGL protected: public: - LLMenuItemBranchDownGL( const std::string& name, const std::string& label, LLHandle<LLView> branch, - KEY key = KEY_NONE, MASK mask = MASK_NONE ); - - virtual std::string getType() const { return "menu"; } + LLMenuItemBranchDownGL( const Params& ); // returns the normal width of this control in pixels - this is // used for calculating the widest item, as well as for horizontal @@ -1394,11 +1207,8 @@ public: virtual BOOL handleAcceleratorKey(KEY key, MASK mask); }; -LLMenuItemBranchDownGL::LLMenuItemBranchDownGL( const std::string& name, - const std::string& label, - LLHandle<LLView> branch, - KEY key, MASK mask ) : - LLMenuItemBranchGL( name, label, branch, key, mask ) +LLMenuItemBranchDownGL::LLMenuItemBranchDownGL( const Params& p) : + LLMenuItemBranchGL(p) { } @@ -1503,7 +1313,7 @@ BOOL LLMenuItemBranchDownGL::handleMouseDown( S32 x, S32 y, MASK mask ) { // switch to mouse control mode LLMenuGL::setKeyboardMode(FALSE); - doIt(); + onCommit(); make_ui_sound("UISndClick"); return TRUE; } @@ -1542,7 +1352,7 @@ BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask) // open new menu only if previous menu was open if (itemp && itemp->getEnabled() && menu_open) { - itemp->doIt(); + itemp->onCommit(); } return TRUE; @@ -1556,7 +1366,7 @@ BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask) // open new menu only if previous menu was open if (itemp && itemp->getEnabled() && menu_open) { - itemp->doIt(); + itemp->onCommit(); } return TRUE; @@ -1568,7 +1378,7 @@ BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask) if (!isActive()) { - doIt(); + onCommit(); } getBranch()->highlightNextItem(NULL); return TRUE; @@ -1580,7 +1390,7 @@ BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask) if (!isActive()) { - doIt(); + onCommit(); } getBranch()->highlightPrevItem(NULL); return TRUE; @@ -1600,31 +1410,31 @@ void LLMenuItemBranchDownGL::draw( void ) if( getHighlight() ) { - gGL.color4fv( getHighlightBGColor().mV ); + gGL.color4fv( mHighlightBackground.get().mV ); gl_rect_2d( 0, getRect().getHeight(), getRect().getWidth(), 0 ); } - U8 font_style = getFontStyle(); + LLFontGL::ShadowType shadow_style = LLFontGL::NO_SHADOW; if (getEnabled() && !getDrawTextDisabled() ) { - font_style |= LLFontGL::DROP_SHADOW_SOFT; + shadow_style = LLFontGL::DROP_SHADOW_SOFT; } LLColor4 color; if (getHighlight()) { - color = getHighlightFGColor(); + color = mHighlightForeground.get(); } else if( getEnabled() ) { - color = getEnabledColor(); + color = mEnabledColor.get(); } else { - color = getDisabledColor(); + color = mDisabledColor.get(); } getFont()->render( mLabel.getWString(), 0, (F32)getRect().getWidth() / 2.f, (F32)LABEL_BOTTOM_PAD_PIXELS, color, - LLFontGL::HCENTER, LLFontGL::BOTTOM, font_style ); + LLFontGL::HCENTER, LLFontGL::BOTTOM, LLFontGL::NORMAL, shadow_style ); // underline navigation key only when keyboard navigation has been initiated @@ -1647,22 +1457,107 @@ void LLMenuItemBranchDownGL::draw( void ) setHover(FALSE); } +class LLMenuScrollItem : public LLMenuItemCallGL +{ +public: + enum EArrowType + { + ARROW_DOWN, + ARROW_UP + }; + + struct Params : public LLInitParam::Block<Params, LLMenuItemCallGL::Params> + { + Optional<EArrowType> arrow_type; + Optional<CommitCallbackParam> scroll_callback; + }; + +protected: + LLMenuScrollItem(const Params&); + friend class LLUICtrlFactory; + +public: + /*virtual*/ void draw(); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent); + /*virtual*/ void setEnabled(BOOL enabled); + virtual void onCommit( void ); + +private: + LLButton* mArrowBtn; +}; + +LLMenuScrollItem::LLMenuScrollItem(const Params& p) +: LLMenuItemCallGL(p) +{ + std::string icon; + if (p.arrow_type.isProvided() && p.arrow_type == ARROW_UP) + { + icon = "arrow_up.tga"; + } + else + { + icon = "arrow_down.tga"; + } + + LLButton::Params bparams; + bparams.label(""); + bparams.label_selected(""); + bparams.mouse_opaque(true); + bparams.scale_image(false); + bparams.click_callback(p.scroll_callback); + bparams.mouse_held_callback(p.scroll_callback); + bparams.follows.flags(FOLLOWS_ALL); + std::string background = "transparent.j2c"; + bparams.image_unselected.name(background); + bparams.image_disabled.name(background); + bparams.image_selected.name(background); + bparams.image_hover_selected.name(background); + bparams.image_disabled_selected.name(background); + bparams.image_hover_unselected.name(background); + bparams.image_overlay.name(icon); + + mArrowBtn = LLUICtrlFactory::create<LLButton>(bparams); + addChild(mArrowBtn); +} + +/*virtual*/ +void LLMenuScrollItem::draw() +{ + LLUICtrl::draw(); +} + +/*virtual*/ +void LLMenuScrollItem::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + mArrowBtn->reshape(width, height, called_from_parent); + LLView::reshape(width, height, called_from_parent); +} + +/*virtual*/ +void LLMenuScrollItem::setEnabled(BOOL enabled) +{ + mArrowBtn->setEnabled(enabled); + LLView::setEnabled(enabled); +} + +void LLMenuScrollItem::onCommit( void ) +{ + LLUICtrl::onCommit(); +} + ///============================================================================ /// Class LLMenuGL ///============================================================================ -static LLRegisterWidget<LLMenuGL> r1("menu"); - -// Default constructor -LLMenuGL::LLMenuGL( const std::string& name, const std::string& label, LLHandle<LLFloater> parent_floater_handle ) -: LLUICtrl( name, LLRect(), FALSE, NULL, NULL ), - mBackgroundColor( sDefaultBackgroundColor ), - mBgVisible( TRUE ), - mParentMenuItem( NULL ), - mLabel( label ), - mDropShadowed( TRUE ), - mHorizontalLayout( FALSE ), - mKeepFixedSize( FALSE ), +LLMenuGL::LLMenuGL(const LLMenuGL::Params& p) +: LLUICtrl(p), + mBackgroundColor( p.bg_color() ), + mBgVisible( p.bg_visible ), + mDropShadowed( p.drop_shadow ), + mHorizontalLayout( p.horizontal_layout ), + mScrollable(mHorizontalLayout ? FALSE : p.scrollable), // Scrolling is supported only for vertical layout + mKeepFixedSize( p.keep_fixed_size ), + mLabel (p.label), mLastMouseX(0), mLastMouseY(0), mMouseVelX(0), @@ -1670,38 +1565,40 @@ LLMenuGL::LLMenuGL( const std::string& name, const std::string& label, LLHandle< mTornOff(FALSE), mTearOffItem(NULL), mSpilloverBranch(NULL), + mFirstVisibleItem(NULL), + mArrowUpItem(NULL), + mArrowDownItem(NULL), mSpilloverMenu(NULL), - mParentFloaterHandle(parent_floater_handle), - mJumpKey(KEY_NONE) + mJumpKey(p.jump_key), + mCreateJumpKeys(p.create_jump_keys), + mParentFloaterHandle(p.parent_floater), + mNeedsArrange(FALSE) { + typedef boost::tokenizer<boost::char_separator<char> > tokenizer; + boost::char_separator<char> sep("_"); + tokenizer tokens(p.label(), sep); + tokenizer::iterator token_iter; + + S32 token_count = 0; + std::string new_menu_label; + for( token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) + { + new_menu_label += (*token_iter); + if (token_count > 0) + { + setJumpKey((*token_iter).c_str()[0]); + } + ++token_count; + } + setLabel(new_menu_label); + mFadeTimer.stop(); - setCanTearOff(TRUE, parent_floater_handle); - setTabStop(FALSE); -} - -LLMenuGL::LLMenuGL( const std::string& label, LLHandle<LLFloater> parent_floater_handle ) -: LLUICtrl( label, LLRect(), FALSE, NULL, NULL ), - mBackgroundColor( sDefaultBackgroundColor ), - mBgVisible( TRUE ), - mParentMenuItem( NULL ), - mLabel( label ), - mDropShadowed( TRUE ), - mHorizontalLayout( FALSE ), - mKeepFixedSize( FALSE ), - mLastMouseX(0), - mLastMouseY(0), - mMouseVelX(0), - mMouseVelY(0), - mTornOff(FALSE), - mTearOffItem(NULL), - mSpilloverBranch(NULL), - mSpilloverMenu(NULL), - mParentFloaterHandle(parent_floater_handle), - mJumpKey(KEY_NONE) +} + +void LLMenuGL::initFromParams(const LLMenuGL::Params& p) { - mFadeTimer.stop(); - setCanTearOff(TRUE, parent_floater_handle); - setTabStop(FALSE); + LLUICtrl::initFromParams(p); + setCanTearOff(p.can_tear_off, p.parent_floater); } // Destroys the object @@ -1717,10 +1614,10 @@ void LLMenuGL::setCanTearOff(BOOL tear_off, LLHandle<LLFloater> parent_floater_h { if (tear_off && mTearOffItem == NULL) { - mTearOffItem = new LLMenuItemTearOffGL(parent_floater_handle); - mItems.insert(mItems.begin(), mTearOffItem); - addChildAtEnd(mTearOffItem); - arrange(); + LLMenuItemTearOffGL::Params p; + p.parent_floater_handle = parent_floater_handle; + mTearOffItem = LLUICtrlFactory::create<LLMenuItemTearOffGL>(p); + addChildInBack(mTearOffItem); } else if (!tear_off && mTearOffItem != NULL) { @@ -1728,315 +1625,51 @@ void LLMenuGL::setCanTearOff(BOOL tear_off, LLHandle<LLFloater> parent_floater_h removeChild(mTearOffItem); delete mTearOffItem; mTearOffItem = NULL; - arrange(); + needsArrange(); } } -// virtual -LLXMLNodePtr LLMenuGL::getXML(bool save_children) const +bool LLMenuGL::addChild(LLView* view, S32 tab_group) { - LLXMLNodePtr node = LLView::getXML(); - - // Attributes - - node->createChild("opaque", TRUE)->setBoolValue(mBgVisible); - - node->createChild("drop_shadow", TRUE)->setBoolValue(mDropShadowed); - - node->createChild("tear_off", TRUE)->setBoolValue((mTearOffItem != NULL)); - - if (mBgVisible) + if (LLMenuGL* menup = dynamic_cast<LLMenuGL*>(view)) { - // TomY TODO: this should save out the color control name - node->createChild("color", TRUE)->setFloatValue(4, mBackgroundColor.mV); + appendMenu(menup); + return true; } - - // Contents - item_list_t::const_iterator item_iter; - for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) + else if (LLMenuItemGL* itemp = dynamic_cast<LLMenuItemGL*>(view)) { - LLView* child = (*item_iter); - LLMenuItemGL* item = (LLMenuItemGL*)child; - - LLXMLNodePtr child_node = item->getXML(); - - node->addChild(child_node); + append(itemp); + return true; } - - return node; + return false; } -void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory *factory) +void LLMenuGL::removeChild( LLView* ctrl) { - if (child->hasName(LL_MENU_GL_TAG)) + LLMenuItemGL* itemp = dynamic_cast<LLMenuItemGL*>(ctrl); + if (itemp) { - // SUBMENU - LLMenuGL *submenu = (LLMenuGL*)LLMenuGL::fromXML(child, parent, factory); - appendMenu(submenu); - if (LLMenuGL::sMenuContainer != NULL) - { - submenu->updateParent(LLMenuGL::sMenuContainer); - } - else + item_list_t::iterator found_it = std::find(mItems.begin(), mItems.end(), (itemp)); + if (found_it != mItems.end()) { - submenu->updateParent(parent); + mItems.erase(found_it); } } - else if (child->hasName(LL_MENU_ITEM_CALL_GL_TAG) || - child->hasName(LL_MENU_ITEM_CHECK_GL_TAG) || - child->hasName(LL_MENU_ITEM_SEPARATOR_GL_TAG)) - { - LLMenuItemGL *item = NULL; - - std::string type; - std::string item_name; - std::string source_label; - std::string item_label; - KEY jump_key = KEY_NONE; - - child->getAttributeString("type", type); - child->getAttributeString("name", item_name); - child->getAttributeString("label", source_label); - - // parse jump key out of label - typedef boost::tokenizer<boost::char_separator<char> > tokenizer; - boost::char_separator<char> sep("_"); - tokenizer tokens(source_label, sep); - tokenizer::iterator token_iter; - S32 token_count = 0; - for( token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) - { - item_label += (*token_iter); - if (token_count > 0) - { - jump_key = (*token_iter).c_str()[0]; - } - ++token_count; - } - - - if (child->hasName(LL_MENU_ITEM_SEPARATOR_GL_TAG)) - { - appendSeparator(item_name); - } - else - { - // ITEM - if (child->hasName(LL_MENU_ITEM_CALL_GL_TAG) || - child->hasName(LL_MENU_ITEM_CHECK_GL_TAG)) - { - MASK mask = 0; - -#ifdef LL_DARWIN - // See if this Mac accelerator should really use the ctrl key and not get mapped to cmd - BOOL useMacCtrl = FALSE; - child->getAttributeBOOL("useMacCtrl", useMacCtrl); -#endif // LL_DARWIN - - std::string shortcut; - child->getAttributeString("shortcut", shortcut); - if (shortcut.find("control") != shortcut.npos) - { -#ifdef LL_DARWIN - if ( useMacCtrl ) - { - mask |= MASK_MAC_CONTROL; - } -#endif // LL_DARWIN - mask |= MASK_CONTROL; - } - if (shortcut.find("alt") != shortcut.npos) - { - mask |= MASK_ALT; - } - if (shortcut.find("shift") != shortcut.npos) - { - mask |= MASK_SHIFT; - } - S32 pipe_pos = shortcut.rfind("|"); - std::string key_str = shortcut.substr(pipe_pos+1); - - KEY key = KEY_NONE; - LLKeyboard::keyFromString(key_str, &key); - - LLMenuItemCallGL *new_item; - LLXMLNodePtr call_child; - - if (child->hasName(LL_MENU_ITEM_CHECK_GL_TAG)) - { - std::string control_name; - child->getAttributeString("control_name", control_name); - - new_item = new LLMenuItemCheckGL(item_name, item_label, 0, 0, control_name, parent, 0, key, mask); - - for (call_child = child->getFirstChild(); call_child.notNull(); call_child = call_child->getNextSibling()) - { - if (call_child->hasName("on_check")) - { - std::string callback_name; - std::string control_name; - if (call_child->hasAttribute("function")) - { - call_child->getAttributeString("function", callback_name); - - control_name = callback_name; - - std::string callback_data = item_name; - if (call_child->hasAttribute("userdata")) - { - call_child->getAttributeString("userdata", callback_data); - if (!callback_data.empty()) - { - control_name = llformat("%s(%s)", callback_name.c_str(), callback_data.c_str()); - } - } - - LLSD userdata; - userdata["control"] = control_name; - userdata["data"] = callback_data; - - LLSimpleListener* callback = parent->getListenerByName(callback_name); - - if (!callback) continue; - - new_item->addListener(callback, "on_build", userdata); - } - else if (call_child->hasAttribute("control")) - { - call_child->getAttributeString("control", control_name); - } - else - { - continue; - } - LLControlVariable *control = parent->findControl(control_name); - if (!control) - { - parent->addBoolControl(control_name, FALSE); - } - ((LLMenuItemCheckGL*)new_item)->setCheckedControl(control_name, parent); - } - } - } - else - { - new_item = new LLMenuItemCallGL(item_name, item_label, 0, 0, 0, 0, key, mask); - } - - for (call_child = child->getFirstChild(); call_child.notNull(); call_child = call_child->getNextSibling()) - { - if (call_child->hasName("on_click")) - { - std::string callback_name; - call_child->getAttributeString("function", callback_name); - - std::string callback_data = item_name; - if (call_child->hasAttribute("userdata")) - { - call_child->getAttributeString("userdata", callback_data); - } - - LLSimpleListener* callback = parent->getListenerByName(callback_name); - - if (!callback) continue; - - new_item->addListener(callback, "on_click", callback_data); - } - if (call_child->hasName("on_enable")) - { - std::string callback_name; - std::string control_name; - if (call_child->hasAttribute("function")) - { - call_child->getAttributeString("function", callback_name); - - control_name = callback_name; - - std::string callback_data; - if (call_child->hasAttribute("userdata")) - { - call_child->getAttributeString("userdata", callback_data); - if (!callback_data.empty()) - { - control_name = llformat("%s(%s)", callback_name.c_str(), callback_data.c_str()); - } - } - - LLSD userdata; - userdata["control"] = control_name; - userdata["data"] = callback_data; - - LLSimpleListener* callback = parent->getListenerByName(callback_name); - - if (!callback) continue; - - new_item->addListener(callback, "on_build", userdata); - } - else if (call_child->hasAttribute("control")) - { - call_child->getAttributeString("control", control_name); - } - else - { - continue; - } - new_item->setEnabledControl(control_name, parent); - } - if (call_child->hasName("on_visible")) - { - std::string callback_name; - std::string control_name; - if (call_child->hasAttribute("function")) - { - call_child->getAttributeString("function", callback_name); - - control_name = callback_name; - - std::string callback_data; - if (call_child->hasAttribute("userdata")) - { - call_child->getAttributeString("userdata", callback_data); - if (!callback_data.empty()) - { - control_name = llformat("%s(%s)", callback_name.c_str(), callback_data.c_str()); - } - } - - LLSD userdata; - userdata["control"] = control_name; - userdata["data"] = callback_data; - - LLSimpleListener* callback = parent->getListenerByName(callback_name); - - if (!callback) continue; + return LLUICtrl::removeChild(ctrl); +} - new_item->addListener(callback, "on_build", userdata); - } - else if (call_child->hasAttribute("control")) - { - call_child->getAttributeString("control", control_name); - } - else - { - continue; - } - new_item->setVisibleControl(control_name, parent); - } - } - item = new_item; - item->setLabel(item_label); - if (jump_key != KEY_NONE) - item->setJumpKey(jump_key); - } +BOOL LLMenuGL::postBuild() +{ + createJumpKeys(); + return LLUICtrl::postBuild(); +} - if (item != NULL) - { - append(item); - } - } - } +const widget_registry_t& LLMenuGL::getChildRegistry() const +{ + return MenuRegistry::instance(); } + // are we the childmost active menu and hence our jump keys should be enabled? // or are we a free-standing torn-off menu (which uses jump keys too) BOOL LLMenuGL::jumpKeysActive() @@ -2081,77 +1714,88 @@ BOOL LLMenuGL::isOpen() return getVisible(); } } -// static -LLView* LLMenuGL::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("menu"); - node->getAttributeString("name", name); - - std::string label = name; - node->getAttributeString("label", label); - // parse jump key out of label - std::string new_menu_label; - - typedef boost::tokenizer<boost::char_separator<char> > tokenizer; - boost::char_separator<char> sep("_"); - tokenizer tokens(label, sep); - tokenizer::iterator token_iter; +void LLMenuGL::scrollItemsUp() +{ + // Slowing down the items scrolling when arrow button is held + if (mScrollItemsTimer.hasExpired() && NULL != mFirstVisibleItem) + { + mScrollItemsTimer.setTimerExpirySec(.033f); + } + else + { + return; + } - KEY jump_key = KEY_NONE; - S32 token_count = 0; - for( token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) + item_list_t::iterator cur_item_iter; + item_list_t::iterator prev_item_iter; + for (cur_item_iter = mItems.begin(), prev_item_iter = mItems.begin(); cur_item_iter != mItems.end(); cur_item_iter++) { - new_menu_label += (*token_iter); - if (token_count > 0) + if( (*cur_item_iter) == mFirstVisibleItem) { - jump_key = (*token_iter).c_str()[0]; + break; + } + if ((*cur_item_iter)->getVisible()) + { + prev_item_iter = cur_item_iter; } - ++token_count; } - BOOL opaque = FALSE; - node->getAttributeBOOL("opaque", opaque); - - LLMenuGL *menu = new LLMenuGL(name, new_menu_label); - - menu->setJumpKey(jump_key); - - BOOL tear_off = FALSE; - node->getAttributeBOOL("tear_off", tear_off); - menu->setCanTearOff(tear_off); + if ((*prev_item_iter)->getVisible()) + { + mFirstVisibleItem = *prev_item_iter; + } + + mNeedsArrange = TRUE; + arrangeAndClear(); +} - if (node->hasAttribute("drop_shadow")) +void LLMenuGL::scrollItemsDown() +{ + // Slowing down the items scrolling when arrow button is held + if (mScrollItemsTimer.hasExpired()) + { + mScrollItemsTimer.setTimerExpirySec(.033f); + } + else + { + return; + } + + if (NULL == mFirstVisibleItem) { - BOOL drop_shadow = FALSE; - node->getAttributeBOOL("drop_shadow", drop_shadow); - menu->setDropShadowed(drop_shadow); + mFirstVisibleItem = *mItems.begin(); } - menu->setBackgroundVisible(opaque); - LLColor4 color(0,0,0,1); - if (opaque && LLUICtrlFactory::getAttributeColor(node,"color", color)) + item_list_t::iterator cur_item_iter; + + for (cur_item_iter = mItems.begin(); cur_item_iter != mItems.end(); cur_item_iter++) { - menu->setBackgroundColor(color); + if( (*cur_item_iter) == mFirstVisibleItem) + { + break; + } } - BOOL create_jump_keys = FALSE; - node->getAttributeBOOL("create_jump_keys", create_jump_keys); + item_list_t::iterator next_item_iter; - LLXMLNodePtr child; - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) + for (next_item_iter = ++cur_item_iter; next_item_iter != mItems.end(); next_item_iter++) { - menu->parseChildXML(child, parent, factory); + if( (*next_item_iter)->getVisible()) + { + break; + } } - if (create_jump_keys) + if ((*next_item_iter)->getVisible()) { - menu->createJumpKeys(); + mFirstVisibleItem = *next_item_iter; } - return menu; + + mNeedsArrange = TRUE; + arrangeAndClear(); } - // rearrange the child rects so they fit the shape of the menu. void LLMenuGL::arrange( void ) { @@ -2169,11 +1813,26 @@ void LLMenuGL::arrange( void ) // torn off menus are not constrained to the size of the screen U32 max_width = getTornOff() ? U32_MAX : menu_region_rect.getWidth(); - U32 max_height = getTornOff() ? U32_MAX : menu_region_rect.getHeight(); + U32 max_height = U32_MAX; + if (!getTornOff()) + { + max_height = getRect().mTop - menu_region_rect.mBottom; + if (menu_region_rect.mTop - getRect().mTop > (S32)max_height) + { + max_height = menu_region_rect.mTop - getRect().mTop; + } + } + // *FIX: create the item first and then ask for its dimensions? - S32 spillover_item_width = PLAIN_PAD_PIXELS + LLFontGL::getFontSansSerif()->getWidth( std::string("More") ); + S32 spillover_item_width = PLAIN_PAD_PIXELS + LLFontGL::getFontSansSerif()->getWidth( std::string("More") ); // *TODO: Translate S32 spillover_item_height = llround(LLFontGL::getFontSansSerif()->getLineHeight()) + MENU_ITEM_PADDING; + // Scrolling support + item_list_t::iterator first_visible_item_iter; + item_list_t::iterator first_hidden_item_iter = mItems.end(); + S32 height_before_first_visible_item = -1; + S32 visible_items_height = 0; + if (mHorizontalLayout) { item_list_t::iterator item_iter; @@ -2182,26 +1841,27 @@ void LLMenuGL::arrange( void ) if ((*item_iter)->getVisible()) { if (!getTornOff() - && item_iter != mItems.begin() // Don't spillover the first item! + && *item_iter != mSpilloverBranch && width + (*item_iter)->getNominalWidth() > max_width - spillover_item_width) { // no room for any more items createSpilloverBranch(); - item_list_t::iterator spillover_iter; - for (spillover_iter = item_iter; spillover_iter != mItems.end(); ++spillover_iter) + std::vector<LLMenuItemGL*> items_to_remove; + std::copy(item_iter, mItems.end(), std::back_inserter(items_to_remove)); + std::vector<LLMenuItemGL*>::iterator spillover_iter; + for (spillover_iter= items_to_remove.begin(); spillover_iter != items_to_remove.end(); ++spillover_iter) { LLMenuItemGL* itemp = (*spillover_iter); removeChild(itemp); - mSpilloverMenu->appendNoArrange(itemp); // *NOTE:Mani Favor addChild() in merge with skinning + mSpilloverMenu->addChild(itemp); } - mSpilloverMenu->arrange(); // *NOTE: Mani Remove line in merge with skinning/viewer2.0 branch - mSpilloverMenu->updateParent(LLMenuGL::sMenuContainer); // *NOTE: Mani Remove line in merge with skinning/viewer2.0 branch - mItems.erase(item_iter, mItems.end()); - mItems.push_back(mSpilloverBranch); + addChild(mSpilloverBranch); + height = llmax(height, mSpilloverBranch->getNominalHeight()); width += mSpilloverBranch->getNominalWidth(); + break; } else @@ -2216,31 +1876,35 @@ void LLMenuGL::arrange( void ) else { item_list_t::iterator item_iter; + for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) { if ((*item_iter)->getVisible()) { if (!getTornOff() - && item_iter != mItems.begin() // Don't spillover the first item! + && !mScrollable + && *item_iter != mSpilloverBranch && height + (*item_iter)->getNominalHeight() > max_height - spillover_item_height) { // no room for any more items createSpilloverBranch(); - item_list_t::iterator spillover_iter; - for (spillover_iter= item_iter; spillover_iter != mItems.end(); ++spillover_iter) + std::vector<LLMenuItemGL*> items_to_remove; + std::copy(item_iter, mItems.end(), std::back_inserter(items_to_remove)); + std::vector<LLMenuItemGL*>::iterator spillover_iter; + for (spillover_iter= items_to_remove.begin(); spillover_iter != items_to_remove.end(); ++spillover_iter) { LLMenuItemGL* itemp = (*spillover_iter); removeChild(itemp); - mSpilloverMenu->appendNoArrange(itemp); // *NOTE:Mani Favor addChild() in merge with skinning + mSpilloverMenu->addChild(itemp); } - mSpilloverMenu->arrange(); // *NOTE: Mani Remove line in merge with skinning/viewer2.0 branch - mSpilloverMenu->updateParent(LLMenuGL::sMenuContainer); // *NOTE: Mani Remove line in merge with skinning/viewer2.0 branch - mItems.erase(item_iter, mItems.end()); - mItems.push_back(mSpilloverBranch); + + addChild(mSpilloverBranch); + height += mSpilloverBranch->getNominalHeight(); width = llmax( width, mSpilloverBranch->getNominalWidth() ); + break; } else @@ -2249,19 +1913,164 @@ void LLMenuGL::arrange( void ) height += (*item_iter)->getNominalHeight(); width = llmax( width, (*item_iter)->getNominalWidth() ); } + + if (mScrollable) + { + // Determining visible items boundaries + if (NULL == mFirstVisibleItem) + { + mFirstVisibleItem = *item_iter; + } + + if (*item_iter == mFirstVisibleItem) + { + height_before_first_visible_item = height - (*item_iter)->getNominalHeight(); + first_visible_item_iter = item_iter; + } + + if (-1 != height_before_first_visible_item && 0 == visible_items_height && height - height_before_first_visible_item > max_height - spillover_item_height * 2) + { + first_hidden_item_iter = item_iter; + visible_items_height = height - height_before_first_visible_item - (*item_iter)->getNominalHeight(); + } + } } } - } - setRect(LLRect(getRect().mLeft, getRect().mBottom + height, getRect().mLeft + width, getRect().mBottom)); + if (mScrollable) + { + S32 max_items_height = max_height - spillover_item_height * 2; + + // Fix mFirstVisibleItem value, if it doesn't allow to display all items, that can fit + if (visible_items_height < max_items_height) + { + if (visible_items_height == 0) + { + visible_items_height = height - height_before_first_visible_item; + } + + item_list_t::iterator tmp_iter(first_visible_item_iter); + while (visible_items_height < max_items_height && first_visible_item_iter != mItems.begin()) + { + if ((*first_visible_item_iter)->getVisible()) + { + // It keeps visible item, after first_visible_item_iter + tmp_iter = first_visible_item_iter; + } + + first_visible_item_iter--; + + if ((*first_visible_item_iter)->getVisible()) + { + visible_items_height += (*first_visible_item_iter)->getNominalHeight(); + height_before_first_visible_item -= (*first_visible_item_iter)->getNominalHeight(); + } + } + + // Roll back one item, that doesn't fit + if (visible_items_height > max_items_height) + { + visible_items_height -= (*first_visible_item_iter)->getNominalHeight(); + height_before_first_visible_item += (*first_visible_item_iter)->getNominalHeight(); + first_visible_item_iter = tmp_iter; + } + if (!(*first_visible_item_iter)->getVisible()) + { + first_visible_item_iter = tmp_iter; + } + + mFirstVisibleItem = *first_visible_item_iter; + } + } + } S32 cur_height = (S32)llmin(max_height, height); + + if (mScrollable && + (height_before_first_visible_item > MENU_ITEM_PADDING || + height_before_first_visible_item + visible_items_height < (S32)height)) + { + // Reserving 2 extra slots for arrow items + cur_height = visible_items_height + spillover_item_height * 2; + } + + setRect(LLRect(getRect().mLeft, getRect().mTop, getRect().mLeft + width, getRect().mTop - cur_height)); + S32 cur_width = 0; + S32 offset = 0; + if (mScrollable) + { + // No space for all items, creating arrow items + if (height_before_first_visible_item > MENU_ITEM_PADDING || + height_before_first_visible_item + visible_items_height < (S32)height) + { + if (NULL == mArrowUpItem) + { + LLMenuScrollItem::Params item_params; + item_params.name(ARROW_UP); + item_params.arrow_type(LLMenuScrollItem::ARROW_UP); + item_params.scroll_callback.function(boost::bind(&LLMenuGL::scrollItemsUp, this)); + + mArrowUpItem = LLUICtrlFactory::create<LLMenuScrollItem>(item_params); + LLUICtrl::addChild(mArrowUpItem); + + } + if (NULL == mArrowDownItem) + { + LLMenuScrollItem::Params item_params; + item_params.name(ARROW_DOWN); + item_params.arrow_type(LLMenuScrollItem::ARROW_DOWN); + item_params.scroll_callback.function(boost::bind(&LLMenuGL::scrollItemsDown, this)); + + mArrowDownItem = LLUICtrlFactory::create<LLMenuScrollItem>(item_params); + LLUICtrl::addChild(mArrowDownItem); + } + + LLRect rect; + mArrowUpItem->setRect(rect.setLeftTopAndSize( 0, cur_height, width, mArrowUpItem->getNominalHeight())); + mArrowUpItem->setVisible(TRUE); + mArrowUpItem->setEnabled(height_before_first_visible_item > MENU_ITEM_PADDING); + mArrowUpItem->reshape(width, mArrowUpItem->getNominalHeight()); + mArrowDownItem->setRect(rect.setLeftTopAndSize( 0, mArrowDownItem->getNominalHeight(), width, mArrowDownItem->getNominalHeight())); + mArrowDownItem->setVisible(TRUE); + mArrowDownItem->setEnabled(height_before_first_visible_item + visible_items_height < (S32)height); + mArrowDownItem->reshape(width, mArrowDownItem->getNominalHeight()); + + cur_height -= mArrowUpItem->getNominalHeight(); + + offset = menu_region_rect.mRight; // This moves items behind visible area + } + else + { + if (NULL != mArrowUpItem) + { + mArrowUpItem->setVisible(FALSE); + } + if (NULL != mArrowDownItem) + { + mArrowDownItem->setVisible(FALSE); + } + } + + } + item_list_t::iterator item_iter; for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) { if ((*item_iter)->getVisible()) { + if (mScrollable) + { + if (item_iter == first_visible_item_iter) + { + offset = 0; + } + else if (item_iter == first_hidden_item_iter) + { + offset = menu_region_rect.mRight; // This moves items behind visible area + } + } + // setup item rect to hold label LLRect rect; if (mHorizontalLayout) @@ -2271,8 +2080,11 @@ void LLMenuGL::arrange( void ) } else { - rect.setLeftTopAndSize( 0, cur_height, width, (*item_iter)->getNominalHeight()); - cur_height -= (*item_iter)->getNominalHeight(); + rect.setLeftTopAndSize( 0 + offset, cur_height, width, (*item_iter)->getNominalHeight()); + if (offset == 0) + { + cur_height -= (*item_iter)->getNominalHeight(); + } } (*item_iter)->setRect( rect ); (*item_iter)->buildDrawLabel(); @@ -2285,6 +2097,15 @@ void LLMenuGL::arrange( void ) } } +void LLMenuGL::arrangeAndClear( void ) +{ + if (mNeedsArrange) + { + arrange(); + mNeedsArrange = FALSE; + } +} + void LLMenuGL::createSpilloverBranch() { if (!mSpilloverBranch) @@ -2293,14 +2114,24 @@ void LLMenuGL::createSpilloverBranch() delete mSpilloverMenu; // technically, you can't tear off spillover menus, but we're passing the handle // along just to be safe - mSpilloverMenu = new LLMenuGL(std::string("More"), std::string("More"), mParentFloaterHandle); + LLMenuGL::Params p; + p.name("More"); + p.label("More"); // *TODO: Translate + p.parent_floater(mParentFloaterHandle); + p.bg_color(mBackgroundColor); + p.bg_visible(true); + p.can_tear_off(false); + mSpilloverMenu = new LLMenuGL(p); mSpilloverMenu->updateParent(LLMenuGL::sMenuContainer); - // Inherit colors - mSpilloverMenu->setBackgroundColor( mBackgroundColor ); - mSpilloverMenu->setCanTearOff(FALSE); - mSpilloverBranch = new LLMenuItemBranchGL(std::string("More"), std::string("More"), mSpilloverMenu->getHandle()); - mSpilloverBranch->setFontStyle(LLFontGL::ITALIC); + LLMenuItemBranchGL::Params branch_params; + branch_params.name = "More"; + branch_params.label = "More"; // *TODO: Translate + branch_params.branch = mSpilloverMenu; + branch_params.font.style = "italic"; + + + mSpilloverBranch = LLUICtrlFactory::create<LLMenuItemBranchGL>(branch_params); } } @@ -2311,25 +2142,15 @@ void LLMenuGL::cleanupSpilloverBranch() // head-recursion to propagate items back up to root menu mSpilloverMenu->cleanupSpilloverBranch(); - removeChild(mSpilloverBranch); - - item_list_t::iterator found_iter = std::find(mItems.begin(), mItems.end(), mSpilloverBranch); - if (found_iter != mItems.end()) - { - mItems.erase(found_iter); - } - // pop off spillover items while (mSpilloverMenu->getItemCount()) { LLMenuItemGL* itemp = mSpilloverMenu->getItem(0); mSpilloverMenu->removeChild(itemp); - mSpilloverMenu->mItems.erase(mSpilloverMenu->mItems.begin()); // put them at the end of our own list - mItems.push_back(itemp); addChild(itemp); } - + // Delete the branch, and since the branch will delete the menu, // set the menu* to null. delete mSpilloverBranch; @@ -2340,6 +2161,9 @@ void LLMenuGL::cleanupSpilloverBranch() void LLMenuGL::createJumpKeys() { + if (!mCreateJumpKeys) return; + mCreateJumpKeys = FALSE; + mJumpKeys.clear(); std::set<std::string> unique_words; @@ -2440,16 +2264,18 @@ void LLMenuGL::empty( void ) cleanupSpilloverBranch(); mItems.clear(); + mFirstVisibleItem = NULL; + mArrowUpItem = NULL; + mArrowDownItem = NULL; deleteAllChildren(); - } // Adjust rectangle of the menu void LLMenuGL::setLeftAndBottom(S32 left, S32 bottom) { setRect(LLRect(left, getRect().mTop, getRect().mRight, bottom)); - arrange(); + needsArrange(); } BOOL LLMenuGL::handleJumpKey(KEY key) @@ -2462,12 +2288,9 @@ BOOL LLMenuGL::handleJumpKey(KEY key) // switch to keyboard navigation mode LLMenuGL::setKeyboardMode(TRUE); - // force highlight to close old menus and any open sub-menus - - //clearHoverItem(); // force highlight to close old menus and open and sub-menus found_it->second->setHighlight(TRUE); - found_it->second->doIt(); + found_it->second->onCommit(); } // if we are navigating the menus, we need to eat the keystroke @@ -2479,30 +2302,18 @@ BOOL LLMenuGL::handleJumpKey(KEY key) // Add the menu item to this menu. BOOL LLMenuGL::append( LLMenuItemGL* item ) { + if (!item) return FALSE; mItems.push_back( item ); - addChild( item ); - arrange(); - return TRUE; -} - -// *NOTE:Mani - appendNoArrange() should be removed when merging to skinning/viewer2.0 -// Its added as a fix to a viewer 1.23 bug that has already been address by skinning work. -BOOL LLMenuGL::appendNoArrange( LLMenuItemGL* item ) -{ - mItems.push_back( item ); - addChild( item ); + LLUICtrl::addChild(item); + needsArrange(); return TRUE; } // add a separator to this menu -BOOL LLMenuGL::appendSeparator( const std::string &separator_name ) +BOOL LLMenuGL::addSeparator() { - LLMenuItemGL* separator; - if (separator_name.empty()) - separator = new LLMenuItemSeparatorGL(std::string("separator")); - else - separator = new LLMenuItemSeparatorGL(separator_name); - return append( separator ); + LLMenuItemGL* separator = new LLMenuItemSeparatorGL(); + return addChild(separator); } // add a menu - this will create a cascading menu @@ -2515,14 +2326,22 @@ BOOL LLMenuGL::appendMenu( LLMenuGL* menu ) } BOOL success = TRUE; - LLMenuItemBranchGL* branch = NULL; - branch = new LLMenuItemBranchGL( menu->getName(), menu->getLabel(), menu->getHandle() ); - branch->setJumpKey(menu->getJumpKey()); + LLMenuItemBranchGL::Params p; + p.name = menu->getName(); + p.label = menu->getLabel(); + p.branch = menu; + p.jump_key = menu->getJumpKey(); + p.enabled_color=LLUI::getCachedColorFunctor("MenuItemEnabledColor"); + p.disabled_color=LLUI::getCachedColorFunctor("MenuItemDisabledColor"); + p.highlight_bg_color=LLUI::getCachedColorFunctor("MenuItemHighlightBgColor"); + p.highlight_fg_color=LLUI::getCachedColorFunctor("MenuItemHighlightFgColor"); + + LLMenuItemBranchGL* branch = LLUICtrlFactory::create<LLMenuItemBranchGL>(p); success &= append( branch ); // Inherit colors menu->setBackgroundColor( mBackgroundColor ); - + menu->updateParent(LLMenuGL::sMenuContainer); return success; } @@ -2560,6 +2379,7 @@ void LLMenuGL::setItemVisible( const std::string& name, BOOL visible ) if( (*item_iter)->getName() == name ) { (*item_iter)->setVisible( visible ); + needsArrange(); break; } } @@ -2572,7 +2392,7 @@ void LLMenuGL::setItemLastSelected(LLMenuItemGL* item) LLMenuHolderGL::setActivatedItem(item); } - // fix the checkmarks + // update enabled and checkmark status item->buildDrawLabel(); } @@ -2670,7 +2490,7 @@ LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disa while(1) { // skip separators and disabled/invisible items - if ((*next_item_iter)->getEnabled() && (*next_item_iter)->getVisible() && (*next_item_iter)->getType() != SEPARATOR_NAME) + if ((*next_item_iter)->getEnabled() && (*next_item_iter)->getVisible() && !dynamic_cast<LLMenuItemSeparatorGL*>(*next_item_iter)) { if (cur_item) { @@ -2777,7 +2597,10 @@ void LLMenuGL::updateParent(LLView* parentp) { getParent()->removeChild(this); } - parentp->addChild(this); + if (parentp) + { + parentp->addChild(this); + } item_list_t::iterator item_iter; for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) { @@ -2880,29 +2703,59 @@ BOOL LLMenuGL::handleHover( S32 x, S32 y, MASK mask ) } } getWindow()->setCursor(UI_CURSOR_ARROW); + + // *HACK Release the mouse capture + // This is done to release the mouse after the Navigation Bar "Back" or "Forward" button + // drop-down menu is shown. Otherwise any other view won't be able to handle mouse events + // until the user chooses one of the drop-down menu items. + + return TRUE; +} + +BOOL LLMenuGL::handleScrollWheel( S32 x, S32 y, S32 clicks ) +{ + if (!mScrollable) + return blockMouseEvent(x, y); + + if( clicks > 0 ) + { + while( clicks-- ) + scrollItemsDown(); + } + else + { + while( clicks++ ) + scrollItemsUp(); + } + return TRUE; } void LLMenuGL::draw( void ) { + if (mNeedsArrange) + { + arrange(); + mNeedsArrange = FALSE; + } if (mDropShadowed && !mTornOff) { + static LLUICachedControl<S32> drop_shadow_floater ("DropShadowFloater", 0); + static LLUICachedControl<LLColor4> color_drop_shadow ("ColorDropShadow", *(new LLColor4)); gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, - LLUI::sColorsGroup->getColor("ColorDropShadow"), - LLUI::sConfigGroup->getS32("DropShadowFloater") ); + color_drop_shadow, drop_shadow_floater ); } - LLColor4 bg_color = mBackgroundColor; - if( mBgVisible ) { - gl_rect_2d( 0, getRect().getHeight(), getRect().getWidth(), 0, mBackgroundColor ); + gl_rect_2d( 0, getRect().getHeight(), getRect().getWidth(), 0, mBackgroundColor.get() ); } LLView::draw(); } -void LLMenuGL::drawBackground(LLMenuItemGL* itemp, LLColor4& color) +void LLMenuGL::drawBackground(LLMenuItemGL* itemp, F32 alpha) { + LLColor4 color = itemp->getHighlightBgColor() % alpha; gGL.color4fv( color.mV ); LLRect item_rect = itemp->getRect(); gl_rect_2d( 0, item_rect.getHeight(), item_rect.getWidth(), 0); @@ -2990,6 +2843,15 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) //rect.setLeftTopAndSize(x + HPAD, y, rect.getWidth(), rect.getHeight()); menu->setRect( rect ); + // Resetting scrolling position + if (menu->isScrollable()) + { + menu->mFirstVisibleItem = NULL; + menu->needsArrange(); + } + menu->arrangeAndClear(); // Fix menu rect if needed. + rect = menu->getRect(); + S32 bottom; left = rect.mLeft; bottom = rect.mBottom; @@ -3017,1461 +2879,955 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) menu->getParent()->sendChildToFront(menu); } -//----------------------------------------------------------------------------- -// class LLPieMenuBranch -// A branch to another pie menu -//----------------------------------------------------------------------------- -class LLPieMenuBranch : public LLMenuItemGL -{ -public: - LLPieMenuBranch(const std::string& name, const std::string& label, LLPieMenu* branch); - - // called to rebuild the draw label - virtual void buildDrawLabel( void ); - - // doIt() - do the primary funcationality of the menu item. - virtual void doIt( void ); +///============================================================================ +/// Class LLMenuBarGL +///============================================================================ - LLPieMenu* getBranch() { return mBranch; } +static LLDefaultWidgetRegistry::Register<LLMenuBarGL> r2("menu_bar"); -protected: - LLPieMenu* mBranch; -}; +LLMenuBarGL::LLMenuBarGL( const Params& p ) +: LLMenuGL(p), + mAltKeyTrigger(FALSE) +{} -LLPieMenuBranch::LLPieMenuBranch(const std::string& name, - const std::string& label, - LLPieMenu* branch) -: LLMenuItemGL( name, label, KEY_NONE, MASK_NONE ), - mBranch( branch ) +// Default destructor +LLMenuBarGL::~LLMenuBarGL() { - mBranch->hide(FALSE); - mBranch->setParentMenuItem(this); + std::for_each(mAccelerators.begin(), mAccelerators.end(), DeletePointer()); + mAccelerators.clear(); } -// called to rebuild the draw label -void LLPieMenuBranch::buildDrawLabel( void ) +BOOL LLMenuBarGL::handleAcceleratorKey(KEY key, MASK mask) { + if (getHighlightedItem() && mask == MASK_NONE) { - // default enablement is this -- if any of the subitems are - // enabled, this item is enabled. JC - U32 sub_count = mBranch->getItemCount(); - U32 i; - BOOL any_enabled = FALSE; - for (i = 0; i < sub_count; i++) + // unmodified key accelerators are ignored when navigating menu + // (but are used as jump keys so will still work when appropriate menu is up) + return FALSE; + } + BOOL result = LLMenuGL::handleAcceleratorKey(key, mask); + if (result && mask & MASK_ALT) + { + // ALT key used to trigger hotkey, don't use as shortcut to open menu + mAltKeyTrigger = FALSE; + } + + if(!result && (key == KEY_F10 && mask == MASK_CONTROL) && !gKeyboard->getKeyRepeated(key)) + { + if (getHighlightedItem()) { - LLMenuItemGL* item = mBranch->getItem(i); - item->buildDrawLabel(); - if (item->getEnabled() && !item->getDrawTextDisabled() ) - { - any_enabled = TRUE; - break; - } + clearHoverItem(); } - setDrawTextDisabled(!any_enabled); - setEnabled(TRUE); + else + { + // close menus originating from other menu bars when first opening menu via keyboard + LLMenuGL::sMenuContainer->hideMenus(); + highlightNextItem(NULL); + LLMenuGL::setKeyboardMode(TRUE); + } + return TRUE; } - mDrawAccelLabel.clear(); - std::string st = mDrawAccelLabel; - appendAcceleratorString( st ); - mDrawAccelLabel = st; - - // No special branch suffix - mDrawBranchLabel.clear(); + return result; } -// doIt() - do the primary funcationality of the menu item. -void LLPieMenuBranch::doIt( void ) +BOOL LLMenuBarGL::handleKeyHere(KEY key, MASK mask) { - LLPieMenu *parent = (LLPieMenu *)getParent(); + static LLUICachedControl<bool> use_altkey_for_menus ("UseAltKeyForMenus", 0); + if(key == KEY_ALT && !gKeyboard->getKeyRepeated(key) && use_altkey_for_menus) + { + mAltKeyTrigger = TRUE; + } + else // if any key other than ALT hit, clear out waiting for Alt key mode + { + mAltKeyTrigger = FALSE; + } + + if (key == KEY_ESCAPE && mask == MASK_NONE) + { + LLMenuGL::setKeyboardMode(FALSE); + // if any menus are visible, this will return TRUE, stopping further processing of ESCAPE key + return LLMenuGL::sMenuContainer->hideMenus(); + } - LLRect rect = parent->getRect(); - S32 center_x; - S32 center_y; - parent->localPointToScreen(rect.getWidth() / 2, rect.getHeight() / 2, ¢er_x, ¢er_y); + // before processing any other key, check to see if ALT key has triggered menu access + checkMenuTrigger(); - parent->hide(FALSE); - mBranch->show( center_x, center_y, FALSE ); + return LLMenuGL::handleKeyHere(key, mask); } -//----------------------------------------------------------------------------- -// class LLPieMenu -// A circular menu of items, icons, etc. -//----------------------------------------------------------------------------- -LLPieMenu::LLPieMenu(const std::string& name, const std::string& label) -: LLMenuGL(name, label), - mFirstMouseDown(FALSE), - mUseInfiniteRadius(FALSE), - mHoverItem(NULL), - mHoverThisFrame(FALSE), - mHoveredAnyItem(FALSE), - mOuterRingAlpha(1.f), - mCurRadius(0.f), - mRightMouseDown(FALSE) -{ - LLMenuGL::setVisible(FALSE); - setCanTearOff(FALSE); -} +BOOL LLMenuBarGL::handleJumpKey(KEY key) +{ + // perform case-insensitive comparison + key = toupper(key); + navigation_key_map_t::iterator found_it = mJumpKeys.find(key); + if(found_it != mJumpKeys.end() && found_it->second->getEnabled()) + { + // switch to keyboard navigation mode + LLMenuGL::setKeyboardMode(TRUE); -LLPieMenu::LLPieMenu(const std::string& name) -: LLMenuGL(name, name), - mFirstMouseDown(FALSE), - mUseInfiniteRadius(FALSE), - mHoverItem(NULL), - mHoverThisFrame(FALSE), - mHoveredAnyItem(FALSE), - mOuterRingAlpha(1.f), - mCurRadius(0.f), - mRightMouseDown(FALSE) -{ - LLMenuGL::setVisible(FALSE); - setCanTearOff(FALSE); + found_it->second->setHighlight(TRUE); + found_it->second->onCommit(); + } + return TRUE; } - -void LLPieMenu::initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *factory) +BOOL LLMenuBarGL::handleMouseDown(S32 x, S32 y, MASK mask) { - LLXMLNodePtr child; - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) + // clicks on menu bar closes existing menus from other contexts but leave + // own menu open so that we get toggle behavior + if (!getHighlightedItem() || !getHighlightedItem()->isActive()) { - if (child->hasName(LL_PIE_MENU_TAG)) - { - // SUBMENU - std::string name("menu"); - child->getAttributeString("name", name); - std::string label(name); - child->getAttributeString("label", label); - - LLPieMenu *submenu = new LLPieMenu(name, label); - appendPieMenu(submenu); - submenu->initXML(child, context, factory); - } - else - { - parseChildXML(child, context, factory); - } + LLMenuGL::sMenuContainer->hideMenus(); } + + return LLMenuGL::handleMouseDown(x, y, mask); } -// virtual -void LLPieMenu::setVisible(BOOL visible) +BOOL LLMenuBarGL::handleRightMouseDown(S32 x, S32 y, MASK mask) { - if (!visible) + // clicks on menu bar closes existing menus from other contexts but leave + // own menu open so that we get toggle behavior + if (!getHighlightedItem() || !getHighlightedItem()->isActive()) { - hide(FALSE); + LLMenuGL::sMenuContainer->hideMenus(); } -} -BOOL LLPieMenu::handleHover( S32 x, S32 y, MASK mask ) -{ - // This is mostly copied from the llview class, but it continues - // the hover handle code after a hover handler has been found. - BOOL handled = FALSE; + return LLMenuGL::handleMouseDown(x, y, mask); +} - // If we got a hover event, we've already moved the cursor - // for any menu shifts, so subsequent mouseup messages will be in the - // correct position. No need to correct them. - //mShiftHoriz = 0; - //mShiftVert = 0; - // release mouse capture after short period of visibility if we're using a finite boundary - // so that right click outside of boundary will trigger new pie menu - if (hasMouseCapture() && - !mRightMouseDown && - mShrinkBorderTimer.getStarted() && - mShrinkBorderTimer.getElapsedTimeF32() >= PIE_SHRINK_TIME) +void LLMenuBarGL::draw() +{ + LLMenuItemGL* itemp = getHighlightedItem(); + // If we are in mouse-control mode and the mouse cursor is not hovering over + // the current highlighted menu item and it isn't open, then remove the + // highlight. This is done via a polling mechanism here, as we don't receive + // notifications when the mouse cursor moves off of us + if (itemp && !itemp->isOpen() && !itemp->getHover() && !LLMenuGL::getKeyboardMode()) { - gFocusMgr.setMouseCapture(NULL); - mUseInfiniteRadius = FALSE; + clearHoverItem(); } - LLMenuItemGL *item = pieItemFromXY( x, y ); + checkMenuTrigger(); - if (item && item->getEnabled()) - { - getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; - handled = TRUE; + LLMenuGL::draw(); +} - if (item != mHoverItem) + +void LLMenuBarGL::checkMenuTrigger() +{ + // has the ALT key been pressed and subsequently released? + if (mAltKeyTrigger && !gKeyboard->getKeyDown(KEY_ALT)) + { + // if alt key was released quickly, treat it as a menu access key + // otherwise it was probably an Alt-zoom or similar action + static LLUICachedControl<F32> menu_access_key_time ("MenuAccessKeyTime", 0); + if (gKeyboard->getKeyElapsedTime(KEY_ALT) <= menu_access_key_time || + gKeyboard->getKeyElapsedFrameCount(KEY_ALT) < 2) { - if (mHoverItem) + if (getHighlightedItem()) { - mHoverItem->setHighlight( FALSE ); + clearHoverItem(); } - mHoverItem = item; - mHoverItem->setHighlight( TRUE ); - - switch(pieItemIndexFromXY(x, y)) + else { - case 0: - make_ui_sound("UISndPieMenuSliceHighlight0"); - break; - case 1: - make_ui_sound("UISndPieMenuSliceHighlight1"); - break; - case 2: - make_ui_sound("UISndPieMenuSliceHighlight2"); - break; - case 3: - make_ui_sound("UISndPieMenuSliceHighlight3"); - break; - case 4: - make_ui_sound("UISndPieMenuSliceHighlight4"); - break; - case 5: - make_ui_sound("UISndPieMenuSliceHighlight5"); - break; - case 6: - make_ui_sound("UISndPieMenuSliceHighlight6"); - break; - case 7: - make_ui_sound("UISndPieMenuSliceHighlight7"); - break; - default: - make_ui_sound("UISndPieMenuSliceHighlight0"); - break; + // close menus originating from other menu bars + LLMenuGL::sMenuContainer->hideMenus(); + + highlightNextItem(NULL); + LLMenuGL::setKeyboardMode(TRUE); } } - mHoveredAnyItem = TRUE; + mAltKeyTrigger = FALSE; } - else +} + +BOOL LLMenuBarGL::jumpKeysActive() +{ + // require user to be in keyboard navigation mode to activate key triggers + // as menu bars are always visible and it is easy to leave the mouse cursor over them + return LLMenuGL::getKeyboardMode() && getHighlightedItem() && LLMenuGL::jumpKeysActive(); +} + +// rearrange the child rects so they fit the shape of the menu bar. +void LLMenuBarGL::arrange( void ) +{ + U32 pos = 0; + LLRect rect( 0, getRect().getHeight(), 0, 0 ); + item_list_t::const_iterator item_iter; + for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) { - // clear out our selection - if (mHoverItem) + LLMenuItemGL* item = *item_iter; + if (item->getVisible()) { - mHoverItem->setHighlight(FALSE); - mHoverItem = NULL; + rect.mLeft = pos; + pos += item->getNominalWidth(); + rect.mRight = pos; + item->setRect( rect ); + item->buildDrawLabel(); } } + reshape(rect.mRight, rect.getHeight()); +} - if( !handled && pointInView( x, y ) ) + +S32 LLMenuBarGL::getRightmostMenuEdge() +{ + // Find the last visible menu + item_list_t::reverse_iterator item_iter; + for (item_iter = mItems.rbegin(); item_iter != mItems.rend(); ++item_iter) { - getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; - handled = TRUE; + if ((*item_iter)->getVisible()) + { + break; + } } - mHoverThisFrame = TRUE; - - return handled; + if (item_iter == mItems.rend()) + { + return 0; + } + return (*item_iter)->getRect().mRight; } -BOOL LLPieMenu::handleMouseDown( S32 x, S32 y, MASK mask ) +// add a vertical separator to this menu +BOOL LLMenuBarGL::addSeparator() { - BOOL handled = FALSE; - // The click was somewhere within our rectangle - LLMenuItemGL *item = pieItemFromXY( x, y ); + LLMenuItemGL* separator = new LLMenuItemVerticalSeparatorGL(); + return append( separator ); +} - if (item) - { - // lie to the item about where the click happened - // to make sure it's within the item's rectangle - handled = item->handleMouseDown( 0, 0, mask ); - } - else if (!mRightMouseDown) +// add a menu - this will create a drop down menu. +BOOL LLMenuBarGL::appendMenu( LLMenuGL* menu ) +{ + if( menu == this ) { - // call hidemenus to make sure transient selections get cleared - ((LLMenuHolderGL*)getParent())->hideMenus(); + llerrs << "** Attempt to attach menu to itself. This is certainly " + << "a logic error." << llendl; } - // always handle mouse down as mouse up will close open menus - return handled; + BOOL success = TRUE; + + // *TODO: Hack! Fix this + LLMenuItemBranchDownGL::Params p; + p.name = menu->getName(); + p.label = menu->getLabel(); + p.visible = menu->getVisible(); + p.branch = menu; + p.enabled_color=LLUI::getCachedColorFunctor("MenuItemEnabledColor"); + p.disabled_color=LLUI::getCachedColorFunctor("MenuItemDisabledColor"); + p.highlight_bg_color=LLUI::getCachedColorFunctor("MenuItemHighlightBgColor"); + p.highlight_fg_color=LLUI::getCachedColorFunctor("MenuItemHighlightFgColor"); + + LLMenuItemBranchDownGL* branch = LLUICtrlFactory::create<LLMenuItemBranchDownGL>(p); + success &= branch->addToAcceleratorList(&mAccelerators); + success &= append( branch ); + branch->setJumpKey(branch->getJumpKey()); + menu->updateParent(LLMenuGL::sMenuContainer); + + return success; } -BOOL LLPieMenu::handleRightMouseDown(S32 x, S32 y, MASK mask) +BOOL LLMenuBarGL::handleHover( S32 x, S32 y, MASK mask ) { BOOL handled = FALSE; + LLView* active_menu = NULL; - mRightMouseDown = TRUE; - - // The click was somewhere within our rectangle - LLMenuItemGL *item = pieItemFromXY( x, y ); - S32 delta_x = x /*+ mShiftHoriz*/ - getLocalRect().getCenterX(); - S32 delta_y = y /*+ mShiftVert*/ - getLocalRect().getCenterY(); - BOOL clicked_in_pie = ((delta_x * delta_x) + (delta_y * delta_y) < mCurRadius*mCurRadius) || mUseInfiniteRadius; + BOOL no_mouse_data = mLastMouseX == 0 && mLastMouseY == 0; + S32 mouse_delta_x = no_mouse_data ? 0 : x - mLastMouseX; + S32 mouse_delta_y = no_mouse_data ? 0 : y - mLastMouseY; + mMouseVelX = (mMouseVelX / 2) + (mouse_delta_x / 2); + mMouseVelY = (mMouseVelY / 2) + (mouse_delta_y / 2); + mLastMouseX = x; + mLastMouseY = y; - // grab mouse if right clicking anywhere within pie (even deadzone in middle), to detect drag outside of pie - if (clicked_in_pie) - { - // capture mouse cursor as if on initial menu show - gFocusMgr.setMouseCapture(this); - mShrinkBorderTimer.stop(); - mUseInfiniteRadius = TRUE; - handled = TRUE; - } - - if (item) + // if nothing currently selected or mouse has moved since last call, pick menu item via mouse + // otherwise let keyboard control it + if (!getHighlightedItem() || !LLMenuGL::getKeyboardMode() || llabs(mMouseVelX) > 0 || llabs(mMouseVelY) > 0) { - // lie to the item about where the click happened - // to make sure it's within the item's rectangle - if (item->handleMouseDown( 0, 0, mask )) + // find current active menu + for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { - handled = TRUE; + LLView* viewp = *child_it; + if (((LLMenuItemGL*)viewp)->isOpen()) + { + active_menu = viewp; + } } - } - - return handled; -} -BOOL LLPieMenu::handleRightMouseUp( S32 x, S32 y, MASK mask ) -{ - // release mouse capture when right mouse button released, and we're past the shrink time - if (mShrinkBorderTimer.getStarted() && - mShrinkBorderTimer.getElapsedTimeF32() > PIE_SHRINK_TIME) - { - mUseInfiniteRadius = FALSE; - gFocusMgr.setMouseCapture(NULL); - } + // check for new active menu + for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) + { + LLView* viewp = *child_it; + S32 local_x = x - viewp->getRect().mLeft; + S32 local_y = y - viewp->getRect().mBottom; + if( viewp->getVisible() && + viewp->getEnabled() && + viewp->pointInView(local_x, local_y) && + viewp->handleHover(local_x, local_y, mask)) + { + ((LLMenuItemGL*)viewp)->setHighlight(TRUE); + handled = TRUE; + if (active_menu && active_menu != viewp) + { + ((LLMenuItemGL*)viewp)->onCommit(); + LLMenuGL::setKeyboardMode(FALSE); + } + LLMenuGL::setKeyboardMode(FALSE); + } + } - S32 delta_x = x /*+ mShiftHoriz*/ - getLocalRect().getCenterX(); - S32 delta_y = y /*+ mShiftVert*/ - getLocalRect().getCenterY(); - if (!mHoveredAnyItem && !mFirstMouseDown && (delta_x * delta_x) + (delta_y * delta_y) < PIE_CENTER_SIZE * PIE_CENTER_SIZE) - { - // user released right mouse button in middle of pie, interpret this as closing the menu - sMenuContainer->hideMenus(); - return TRUE; + if (handled) + { + // set hover false on inactive menus + for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) + { + LLView* viewp = *child_it; + S32 local_x = x - viewp->getRect().mLeft; + S32 local_y = y - viewp->getRect().mBottom; + if (!viewp->pointInView(local_x, local_y) && ((LLMenuItemGL*)viewp)->getHighlight()) + { + ((LLMenuItemGL*)viewp)->setHighlight(FALSE); + } + } + } } + getWindow()->setCursor(UI_CURSOR_ARROW); + + return TRUE; +} - BOOL result = handleMouseUp( x, y, mask ); - mRightMouseDown = FALSE; - mHoveredAnyItem = FALSE; - - return result; +///============================================================================ +/// Class LLMenuHolderGL +///============================================================================ +LLMenuHolderGL::LLMenuHolderGL() + : LLPanel() +{ + setName("Menu Holder"); + setMouseOpaque(FALSE); + sItemActivationTimer.stop(); + mCanHide = TRUE; } -BOOL LLPieMenu::handleMouseUp( S32 x, S32 y, MASK mask ) +void LLMenuHolderGL::draw() { - BOOL handled = FALSE; + LLView::draw(); + // now draw last selected item as overlay + LLMenuItemGL* selecteditem = (LLMenuItemGL*)sItemLastSelectedHandle.get(); + if (selecteditem && sItemActivationTimer.getStarted() && sItemActivationTimer.getElapsedTimeF32() < ACTIVATE_HIGHLIGHT_TIME) + { + // make sure toggle items, for example, show the proper state when fading out + selecteditem->buildDrawLabel(); - // The click was somewhere within our rectangle - LLMenuItemGL *item = pieItemFromXY( x, y ); + LLRect item_rect; + selecteditem->localRectToOtherView(selecteditem->getLocalRect(), &item_rect, this); - if (item) - { - // lie to the item about where the click happened - // to make sure it's within the item's rectangle - if (item->getEnabled()) + F32 interpolant = sItemActivationTimer.getElapsedTimeF32() / ACTIVATE_HIGHLIGHT_TIME; + + LLUI::pushMatrix(); { - handled = item->handleMouseUp( 0, 0, mask ); - hide(TRUE); + LLUI::translate((F32)item_rect.mLeft, (F32)item_rect.mBottom, 0.f); + selecteditem->getMenu()->drawBackground(selecteditem, interpolant); + selecteditem->draw(); } + LLUI::popMatrix(); } - else if (!mRightMouseDown) - { - // call hidemenus to make sure transient selections get cleared - ((LLMenuHolderGL*)getParent())->hideMenus(); - } - - if (handled) - { - make_ui_sound("UISndClickRelease"); - } - - if (!handled && !mUseInfiniteRadius) - { - // call hidemenus to make sure transient selections get cleared - sMenuContainer->hideMenus(); - } +} - if (mFirstMouseDown) - { - make_ui_sound("UISndPieMenuAppear"); - mFirstMouseDown = FALSE; - } - - // *FIX: is this necessary? - if (!mShrinkBorderTimer.getStarted()) +BOOL LLMenuHolderGL::handleMouseDown( S32 x, S32 y, MASK mask ) +{ + BOOL handled = LLView::childrenHandleMouseDown(x, y, mask) != NULL; + if (!handled) { - mShrinkBorderTimer.start(); + // clicked off of menu, hide them all + hideMenus(); } - return handled; } - -// virtual -void LLPieMenu::draw() +BOOL LLMenuHolderGL::handleRightMouseDown( S32 x, S32 y, MASK mask ) { - // clear hover if mouse moved away - if (!mHoverThisFrame && mHoverItem) + BOOL handled = LLView::childrenHandleRightMouseDown(x, y, mask) != NULL; + if (!handled) { - mHoverItem->setHighlight(FALSE); - mHoverItem = NULL; + // clicked off of menu, hide them all + hideMenus(); } + return handled; +} - F32 width = (F32) getRect().getWidth(); - F32 height = (F32) getRect().getHeight(); - mCurRadius = PIE_SCALE_FACTOR * llmax( width/2, height/2 ); - - mOuterRingAlpha = mUseInfiniteRadius ? 0.f : 1.f; - if (mShrinkBorderTimer.getStarted()) +void LLMenuHolderGL::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + if (width != getRect().getWidth() || height != getRect().getHeight()) { - mOuterRingAlpha = clamp_rescale(mShrinkBorderTimer.getElapsedTimeF32(), 0.f, PIE_SHRINK_TIME, 0.f, 1.f); - mCurRadius *= clamp_rescale(mShrinkBorderTimer.getElapsedTimeF32(), 0.f, PIE_SHRINK_TIME, 1.f, 1.f / PIE_SCALE_FACTOR); + hideMenus(); } + LLView::reshape(width, height, called_from_parent); +} - // correct for non-square pixels - F32 center_x = width/2; - F32 center_y = height/2; - S32 steps = 100; - - gGL.pushMatrix(); +BOOL LLMenuHolderGL::hasVisibleMenu() const +{ + for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { - gGL.translatef(center_x, center_y, 0.f); - - F32 line_width = LLUI::sConfigGroup->getF32("PieMenuLineWidth"); - LLColor4 line_color = LLUI::sColorsGroup->getColor("PieMenuLineColor"); - LLColor4 bg_color = LLUI::sColorsGroup->getColor("PieMenuBgColor"); - LLColor4 selected_color = LLUI::sColorsGroup->getColor("PieMenuSelectedColor"); - - // main body - LLColor4 outer_color = bg_color; - outer_color.mV[VALPHA] *= mOuterRingAlpha; - gl_washer_2d( mCurRadius, (F32) PIE_CENTER_SIZE, steps, bg_color, outer_color ); - - // selected wedge - item_list_t::iterator item_iter; - S32 i = 0; - for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) + LLView* viewp = *child_it; + if (viewp->getVisible() && dynamic_cast<LLMenuBarGL*>(viewp) == NULL) { - if ((*item_iter)->getHighlight()) - { - F32 arc_size = F_PI * 0.25f; - - F32 start_radians = (i * arc_size) - (arc_size * 0.5f); - F32 end_radians = start_radians + arc_size; - - LLColor4 outer_color = selected_color; - outer_color.mV[VALPHA] *= mOuterRingAlpha; - gl_washer_segment_2d( mCurRadius, (F32)PIE_CENTER_SIZE, start_radians, end_radians, steps / 8, selected_color, outer_color ); - } - i++; + return TRUE; } - - LLUI::setLineWidth( line_width ); - - // inner lines - outer_color = line_color; - outer_color.mV[VALPHA] *= mOuterRingAlpha; - gl_washer_spokes_2d( mCurRadius, (F32)PIE_CENTER_SIZE, 8, line_color, outer_color ); - - // inner circle - gGL.color4fv( line_color.mV ); - gl_circle_2d( 0, 0, (F32)PIE_CENTER_SIZE, steps, FALSE ); - - // outer circle - gGL.color4fv( outer_color.mV ); - gl_circle_2d( 0, 0, mCurRadius, steps, FALSE ); - - LLUI::setLineWidth(1.0f); } - gGL.popMatrix(); - - mHoverThisFrame = FALSE; - - LLView::draw(); + return FALSE; } -void LLPieMenu::drawBackground(LLMenuItemGL* itemp, LLColor4& color) -{ - F32 width = (F32) getRect().getWidth(); - F32 height = (F32) getRect().getHeight(); - F32 center_x = width/2; - F32 center_y = height/2; - S32 steps = 100; - gGL.color4fv( color.mV ); - gGL.pushMatrix(); +BOOL LLMenuHolderGL::hideMenus() +{ + if (!mCanHide) { - gGL.translatef(center_x - itemp->getRect().mLeft, center_y - itemp->getRect().mBottom, 0.f); - - item_list_t::iterator item_iter; - S32 i = 0; - for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) + return FALSE; + } + BOOL menu_visible = hasVisibleMenu(); + if (menu_visible) + { + LLMenuGL::setKeyboardMode(FALSE); + // clicked off of menu, hide them all + for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { - if ((*item_iter) == itemp) + LLView* viewp = *child_it; + // clicks off of menu do not hide menu bar + if (dynamic_cast<LLMenuBarGL*>(viewp) == NULL && viewp->getVisible()) { - F32 arc_size = F_PI * 0.25f; - - F32 start_radians = (i * arc_size) - (arc_size * 0.5f); - F32 end_radians = start_radians + arc_size; - - LLColor4 outer_color = color; - outer_color.mV[VALPHA] *= mOuterRingAlpha; - gl_washer_segment_2d( mCurRadius, (F32)PIE_CENTER_SIZE, start_radians, end_radians, steps / 8, color, outer_color ); + viewp->setVisible(FALSE); } - i++; } } - gGL.popMatrix(); -} + //if (gFocusMgr.childHasKeyboardFocus(this)) + //{ + // gFocusMgr.setKeyboardFocus(NULL); + //} -// virtual -BOOL LLPieMenu::append(LLMenuItemGL *item) -{ - item->setBriefItem(TRUE); - item->setFont( LLFontGL::getFontSansSerifSmall() ); - return LLMenuGL::append(item); + return menu_visible; } -// virtual -BOOL LLPieMenu::appendSeparator(const std::string &separator_name) +void LLMenuHolderGL::setActivatedItem(LLMenuItemGL* item) { - LLMenuItemGL* separator = new LLMenuItemBlankGL(); - separator->setFont( LLFontGL::getFontSansSerifSmall() ); - return append( separator ); + sItemLastSelectedHandle = item->getHandle(); + sItemActivationTimer.start(); } - -BOOL LLPieMenu::appendPieMenu(LLPieMenu *menu) -{ - if (menu == this) - { - llerrs << "Can't attach a pie menu to itself" << llendl; - } - LLPieMenuBranch *item; - item = new LLPieMenuBranch(menu->getName(), menu->getLabel(), menu); - getParent()->addChild(item->getBranch()); - item->setFont( LLFontGL::getFontSansSerifSmall() ); - return append( item ); -} - -// virtual -void LLPieMenu::arrange() +///============================================================================ +/// Class LLTearOffMenu +///============================================================================ +LLTearOffMenu::LLTearOffMenu(LLMenuGL* menup) : + LLFloater() { - const S32 rect_height = 190; - const S32 rect_width = 190; - - // all divide by 6 - const S32 CARD_X = 60; - const S32 DIAG_X = 48; - const S32 CARD_Y = 76; - const S32 DIAG_Y = 42; + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); - const S32 ITEM_CENTER_X[] = { CARD_X, DIAG_X, 0, -DIAG_X, -CARD_X, -DIAG_X, 0, DIAG_X }; - const S32 ITEM_CENTER_Y[] = { 0, DIAG_Y, CARD_Y, DIAG_Y, 0, -DIAG_Y, -CARD_Y, -DIAG_Y }; + setName(menup->getName()); + setTitle(menup->getLabel()); + setCanMinimize(FALSE); + // flag menu as being torn off + menup->setTornOff(TRUE); + // update menu layout as torn off menu (no spillover menus) + menup->needsArrange(); LLRect rect; - - S32 font_height = 0; - if( mItems.size() ) - { - font_height = (*mItems.begin())->getNominalHeight(); - } - S32 item_width = 0; - -// F32 sin_delta = OO_SQRT2; // sin(45 deg) -// F32 cos_delta = OO_SQRT2; // cos(45 deg) - - // TODO: Compute actual bounding rect for menu - - // HACK: casting away const. Should use setRect or some helper function instead. - const_cast<LLRect&>(getRect()).setOriginAndSize(getRect().mLeft, getRect().mBottom, rect_width, rect_height ); + menup->localRectToOtherView(LLRect(-1, menup->getRect().getHeight(), menup->getRect().getWidth() + 3, 0), &rect, gFloaterView); + // make sure this floater is big enough for menu + mTargetHeight = (F32)(rect.getHeight() + floater_header_size + 5); + reshape(rect.getWidth(), rect.getHeight()); + setRect(rect); - // place items around a circle, with item 0 at positive X, - // rotating counter-clockwise - item_list_t::iterator item_iter; - S32 i = 0; - for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) - { - LLMenuItemGL *item = *item_iter; + // attach menu to floater + menup->setFollowsAll(); + mOldParent = menup->getParent(); + addChild(menup); + menup->setVisible(TRUE); + menup->translate(-menup->getRect().mLeft + 1, -menup->getRect().mBottom + 1); + menup->setDropShadowed(FALSE); - item_width = item->getNominalWidth(); + mMenu = menup; - // Put in the right place around a circle centered at 0,0 - rect.setCenterAndSize(ITEM_CENTER_X[i], - ITEM_CENTER_Y[i], - item_width, font_height ); + // highlight first item (tear off item will be disabled) + mMenu->highlightNextItem(NULL); +} - // Correct for the actual rectangle size - rect.translate( rect_width/2, rect_height/2 ); - item->setRect( rect ); +void LLTearOffMenu::draw() +{ + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + mMenu->setBackgroundVisible(isBackgroundOpaque()); + mMenu->needsArrange(); - // Make sure enablement is correct - item->buildDrawLabel(); - i++; + if (getRect().getHeight() != mTargetHeight) + { + // animate towards target height + reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLCriticalDamp::getInterpolant(0.05f)))); + } + else + { + // when in stasis, remain big enough to hold menu contents + mTargetHeight = (F32)(mMenu->getRect().getHeight() + floater_header_size + 4); + reshape(mMenu->getRect().getWidth() + 3, mMenu->getRect().getHeight() + floater_header_size + 5); } + LLFloater::draw(); } -LLMenuItemGL *LLPieMenu::pieItemFromXY(S32 x, S32 y) +void LLTearOffMenu::onFocusReceived() { - // We might have shifted this menu on draw. If so, we need - // to shift over mouseup events until we get a hover event. - //x += mShiftHoriz; - //y += mShiftVert; - - // An arc of the pie menu is 45 degrees - const F32 ARC_DEG = 45.f; - S32 delta_x = x - getRect().getWidth() / 2; - S32 delta_y = y - getRect().getHeight() / 2; - - // circle safe zone in the center - S32 dist_squared = delta_x*delta_x + delta_y*delta_y; - if (dist_squared < PIE_CENTER_SIZE*PIE_CENTER_SIZE) + // if nothing is highlighted, just highlight first item + if (!mMenu->getHighlightedItem()) { - return NULL; + mMenu->highlightNextItem(NULL); } - // infinite radius is only used with right clicks - S32 radius = llmax( getRect().getWidth()/2, getRect().getHeight()/2 ); - if (!(mUseInfiniteRadius && mRightMouseDown) && dist_squared > radius * radius) + // parent menu items get highlights so navigation logic keeps working + LLMenuItemGL* parent_menu_item = mMenu->getParentMenuItem(); + while(parent_menu_item) { - return NULL; + if (parent_menu_item->getMenu()->getVisible()) + { + parent_menu_item->setHighlight(TRUE); + parent_menu_item = parent_menu_item->getMenu()->getParentMenuItem(); + } + else + { + break; + } } + LLFloater::onFocusReceived(); +} - F32 angle = RAD_TO_DEG * (F32) atan2((F32)delta_y, (F32)delta_x); - - // rotate marks CCW so that east = [0, ARC_DEG) instead of - // [-ARC_DEG/2, ARC_DEG/2) - angle += ARC_DEG / 2.f; - - // make sure we're only using positive angles - if (angle < 0.f) angle += 360.f; +void LLTearOffMenu::onFocusLost() +{ + // remove highlight from parent item and our own menu + mMenu->clearHoverItem(); + LLFloater::onFocusLost(); +} - S32 which = S32( angle / ARC_DEG ); +BOOL LLTearOffMenu::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) +{ + // pass keystrokes down to menu + return mMenu->handleUnicodeChar(uni_char, TRUE); +} - if (0 <= which && which < (S32)mItems.size() ) +BOOL LLTearOffMenu::handleKeyHere(KEY key, MASK mask) +{ + if (!mMenu->getHighlightedItem()) { - item_list_t::iterator item_iter; - for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) + if (key == KEY_UP) { - if (which == 0) - { - return (*item_iter); - } - which--; + mMenu->highlightPrevItem(NULL); + return TRUE; + } + else if (key == KEY_DOWN) + { + mMenu->highlightNextItem(NULL); + return TRUE; } } - - return NULL; + // pass keystrokes down to menu + return mMenu->handleKey(key, mask, TRUE); } -S32 LLPieMenu::pieItemIndexFromXY(S32 x, S32 y) +void LLTearOffMenu::translate(S32 x, S32 y) { - // An arc of the pie menu is 45 degrees - const F32 ARC_DEG = 45.f; - // correct for non-square pixels - S32 delta_x = x - getRect().getWidth() / 2; - S32 delta_y = y - getRect().getHeight() / 2; - - // circle safe zone in the center - if (delta_x*delta_x + delta_y*delta_y < PIE_CENTER_SIZE*PIE_CENTER_SIZE) + if (x != 0 && y != 0) { - return -1; + // hide open sub-menus by clearing current hover item + mMenu->clearHoverItem(); } - - F32 angle = RAD_TO_DEG * (F32) atan2((F32)delta_y, (F32)delta_x); - - // rotate marks CCW so that east = [0, ARC_DEG) instead of - // [-ARC_DEG/2, ARC_DEG/2) - angle += ARC_DEG / 2.f; - - // make sure we're only using positive angles - if (angle < 0.f) angle += 360.f; - - S32 which = S32( angle / ARC_DEG ); - return which; + LLFloater::translate(x, y); } -void LLPieMenu::show(S32 x, S32 y, BOOL mouse_down) +//static +LLTearOffMenu* LLTearOffMenu::create(LLMenuGL* menup) { - S32 width = getRect().getWidth(); - S32 height = getRect().getHeight(); - - const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getMenuRect(); + LLTearOffMenu* tearoffp = new LLTearOffMenu(menup); + // keep onscreen + gFloaterView->adjustToFitScreen(tearoffp, FALSE); + tearoffp->openFloater(LLSD()); - LLView* parent_view = getParent(); - BOOL moved = FALSE; + return tearoffp; +} - S32 local_x, local_y; - parent_view->screenPointToLocal(x, y, &local_x, &local_y); +void LLTearOffMenu::onClose(bool app_quitting) +{ + removeChild(mMenu); + mOldParent->addChild(mMenu); + mMenu->clearHoverItem(); + mMenu->setFollowsNone(); + mMenu->setBackgroundVisible(TRUE); + mMenu->setVisible(FALSE); + mMenu->setTornOff(FALSE); + mMenu->setDropShadowed(TRUE); + destroy(); +} - // HACK: casting away const. Should use setRect or some helper function instead. - const_cast<LLRect&>(getRect()).setCenterAndSize(local_x, local_y, width, height); - arrange(); - // Adjust the pie rectangle to keep it on screen - if (getRect().mLeft < menu_region_rect.mLeft) +//----------------------------------------------------------------------------- +// class LLContextMenuBranch +// A branch to another context menu +//----------------------------------------------------------------------------- +class LLContextMenuBranch : public LLMenuItemGL +{ +public: + struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params> { - //mShiftHoriz = menu_region_rect.mLeft - getRect().mLeft; - //getRect().translate( mShiftHoriz, 0 ); - // HACK: casting away const. Should use setRect or some helper function instead. - const_cast<LLRect&>(getRect()).translate( menu_region_rect.mLeft - getRect().mLeft, 0 ); - moved = TRUE; - } + Mandatory<LLContextMenu*> branch; + }; - if (getRect().mRight > menu_region_rect.mRight) - { - //mShiftHoriz = menu_region_rect.mRight - getRect().mRight; - //getRect().translate( mShiftHoriz, 0); - // HACK: casting away const. Should use setRect or some helper function instead. - const_cast<LLRect&>(getRect()).translate( menu_region_rect.mRight - getRect().mRight, 0 ); - moved = TRUE; - } + LLContextMenuBranch(const Params&); - if (getRect().mBottom < menu_region_rect.mBottom) - { - //mShiftVert = menu_region_rect.mBottom - getRect().mBottom; - //getRect().translate( 0, mShiftVert ); - // HACK: casting away const. Should use setRect or some helper function instead. - const_cast<LLRect&>(getRect()).translate( 0, menu_region_rect.mBottom - getRect().mBottom ); - moved = TRUE; - } + // called to rebuild the draw label + virtual void buildDrawLabel( void ); + // onCommit() - do the primary funcationality of the menu item. + virtual void onCommit( void ); - if (getRect().mTop > menu_region_rect.mTop) - { - //mShiftVert = menu_region_rect.mTop - getRect().mTop; - //getRect().translate( 0, mShiftVert ); - // HACK: casting away const. Should use setRect or some helper function instead. - const_cast<LLRect&>(getRect()).translate( 0, menu_region_rect.mTop - getRect().mTop ); - moved = TRUE; - } + LLContextMenu* getBranch() { return mBranch; } + void setHighlight( BOOL highlight ); - // If we had to relocate the pie menu, put the cursor in the - // center of its rectangle - if (moved) - { - LLCoordGL center; - center.mX = (getRect().mLeft + getRect().mRight) / 2; - center.mY = (getRect().mTop + getRect().mBottom) / 2; +protected: + void showSubMenu(); - LLUI::setCursorPositionLocal(getParent(), center.mX, center.mY); - } + LLContextMenu* mBranch; +}; - // *FIX: what happens when mouse buttons reversed? - mRightMouseDown = mouse_down; - mFirstMouseDown = mouse_down; - mUseInfiniteRadius = TRUE; - mHoveredAnyItem = FALSE; +LLContextMenuBranch::LLContextMenuBranch(const LLContextMenuBranch::Params& p) +: LLMenuItemGL(p), + mBranch( p.branch ) +{ + mBranch->hide(); + mBranch->setParentMenuItem(this); +} - if (!mFirstMouseDown) +// called to rebuild the draw label +void LLContextMenuBranch::buildDrawLabel( void ) +{ { - make_ui_sound("UISndPieMenuAppear"); + // default enablement is this -- if any of the subitems are + // enabled, this item is enabled. JC + U32 sub_count = mBranch->getItemCount(); + U32 i; + BOOL any_enabled = FALSE; + for (i = 0; i < sub_count; i++) + { + LLMenuItemGL* item = mBranch->getItem(i); + item->buildDrawLabel(); + if (item->getEnabled() && !item->getDrawTextDisabled() ) + { + any_enabled = TRUE; + break; + } + } + setDrawTextDisabled(!any_enabled); + setEnabled(TRUE); } - LLView::setVisible(TRUE); - - // we want all mouse events in case user does quick right click again off of pie menu - // rectangle, to support gestural menu traversal - gFocusMgr.setMouseCapture(this); + mDrawAccelLabel.clear(); + std::string st = mDrawAccelLabel; + appendAcceleratorString( st ); + mDrawAccelLabel = st; + + // No special branch suffix + mDrawBranchLabel.clear(); +} - if (mouse_down) - { - mShrinkBorderTimer.stop(); - } - else - { - mShrinkBorderTimer.start(); - } +void LLContextMenuBranch::showSubMenu() +{ + S32 center_x; + S32 center_y; + localPointToScreen(getRect().getWidth(), getRect().getHeight() , ¢er_x, ¢er_y); + mBranch->show( center_x, center_y, FALSE); } -void LLPieMenu::hide(BOOL item_selected) +// onCommit() - do the primary funcationality of the menu item. +void LLContextMenuBranch::onCommit( void ) { - if (!getVisible()) return; + showSubMenu(); - if (mHoverItem) +} +void LLContextMenuBranch::setHighlight( BOOL highlight ) +{ + if (highlight == getHighlight()) return; + LLMenuItemGL::setHighlight(highlight); + if( highlight ) { - mHoverItem->setHighlight( FALSE ); - mHoverItem = NULL; + showSubMenu(); } + else + { + mBranch->hide(); + } +} - make_ui_sound("UISndPieMenuHide"); - - mFirstMouseDown = FALSE; - mRightMouseDown = FALSE; - mUseInfiniteRadius = FALSE; - mHoveredAnyItem = FALSE; - - LLView::setVisible(FALSE); - gFocusMgr.setMouseCapture(NULL); -} +/////////////////////////////////////////////////////////////////////////////////////////////////////////// +//----------------------------------------------------------------------------- +// class LLContextMenu +// A context menu +//----------------------------------------------------------------------------- +static LLDefaultWidgetRegistry::Register<LLContextMenu> context_menu_register("context_menu"); +static MenuRegistry::Register<LLContextMenu> context_menu_register2("context_menu"); -///============================================================================ -/// Class LLMenuBarGL -///============================================================================ -static LLRegisterWidget<LLMenuBarGL> r2("menu_bar"); +LLContextMenu::LLContextMenu(const Params& p) +: LLMenuGL(p), + mHoveredAnyItem(FALSE), + mHoverItem(NULL) -// Default constructor -LLMenuBarGL::LLMenuBarGL( const std::string& name ) : LLMenuGL ( name, name ) { - mHorizontalLayout = TRUE; - setCanTearOff(FALSE); - mKeepFixedSize = TRUE; - mAltKeyTrigger = FALSE; + //setBackgroundVisible(TRUE); } -// Default destructor -LLMenuBarGL::~LLMenuBarGL() +void LLContextMenu::setVisible(BOOL visible) { - std::for_each(mAccelerators.begin(), mAccelerators.end(), DeletePointer()); - mAccelerators.clear(); + if (!visible) + hide(); } -// virtual -LLXMLNodePtr LLMenuBarGL::getXML(bool save_children) const +void LLContextMenu::show(S32 x, S32 y,BOOL adjustCursor) { - // Sorty of hacky: reparent items to this and then back at the end of the export - LLView *orig_parent = NULL; - item_list_t::const_iterator item_iter; - for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) + arrangeAndClear(); + + S32 width = getRect().getWidth(); + S32 height = getRect().getHeight(); + const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getMenuRect(); + LLView* parent_view = getParent(); + + if(getParentMenuItem()) { - LLMenuItemGL* child = *item_iter; - LLMenuItemBranchGL* branch = (LLMenuItemBranchGL*)child; - LLMenuGL *menu = branch->getBranch(); - orig_parent = menu->getParent(); - menu->updateParent((LLView *)this); + S32 parent_width = getParentMenuItem()->getRect().getWidth(); + + if(x + width > menu_region_rect.getWidth()) + x -= parent_width + width; } - LLXMLNodePtr node = LLMenuGL::getXML(); + S32 local_x, local_y; + parent_view->screenPointToLocal(x, y, &local_x, &local_y); + + // HACK: casting away const. Should use setRect or some helper function instead. + const_cast<LLRect&>(getRect()).setCenterAndSize(local_x + width/2, local_y - height/2, width, height); + arrange(); + - for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) + if (translateIntoRect(menu_region_rect,FALSE) && adjustCursor) { - LLMenuItemGL* child = *item_iter; - LLMenuItemBranchGL* branch = (LLMenuItemBranchGL*)child; - LLMenuGL *menu = branch->getBranch(); - menu->updateParent(orig_parent); + LLUI::setCursorPositionLocal(getParent(), getRect().mLeft , getRect().mTop); } - return node; + LLView::setVisible(TRUE); + } -LLView* LLMenuBarGL::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) +void LLContextMenu::hide() { - std::string name("menu"); - node->getAttributeString("name", name); - - BOOL opaque = FALSE; - node->getAttributeBOOL("opaque", opaque); + if (!getVisible()) return; - LLMenuBarGL *menubar = new LLMenuBarGL(name); + LLView::setVisible(FALSE); - LLHandle<LLFloater> parent_handle; - LLFloater* parent_floater = dynamic_cast<LLFloater*>(parent); - if (parent_floater) + if (mHoverItem) { - parent_handle = parent_floater->getHandle(); + mHoverItem->setHighlight( FALSE ); } + mHoverItem = NULL; +} - // We need to have the rect early so that it's around when building - // the menu items - LLRect view_rect; - createRect(node, view_rect, parent, menubar->getRequiredRect()); - menubar->setRect(view_rect); - if (node->hasAttribute("drop_shadow")) - { - BOOL drop_shadow = FALSE; - node->getAttributeBOOL("drop_shadow", drop_shadow); - menubar->setDropShadowed(drop_shadow); - } +BOOL LLContextMenu::handleHover( S32 x, S32 y, MASK mask ) +{ + LLMenuGL::handleHover(x,y,mask); - menubar->setBackgroundVisible(opaque); - LLColor4 color(0,0,0,0); - if (opaque && LLUICtrlFactory::getAttributeColor(node,"color", color)) - { - menubar->setBackgroundColor(color); - } + BOOL handled = FALSE; - LLXMLNodePtr child; - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) + LLMenuItemGL *item = getHighlightedItem(); + + if (item && item->getEnabled()) { - if (child->hasName("menu")) + getWindow()->setCursor(UI_CURSOR_ARROW); + handled = TRUE; + + if (item != mHoverItem) { - LLMenuGL *menu = (LLMenuGL*)LLMenuGL::fromXML(child, parent, factory); - // because of lazy initialization, have to disable tear off functionality - // and then re-enable with proper parent handle - if (menu->getCanTearOff()) - { - menu->setCanTearOff(FALSE); - menu->setCanTearOff(TRUE, parent_handle); - } - menubar->appendMenu(menu); - if (LLMenuGL::sMenuContainer != NULL) - { - menu->updateParent(LLMenuGL::sMenuContainer); - } - else + if (mHoverItem) { - menu->updateParent(parent); + mHoverItem->setHighlight( FALSE ); } + mHoverItem = item; + mHoverItem->setHighlight( TRUE ); } + mHoveredAnyItem = TRUE; } - - menubar->initFromXML(node, parent); - - BOOL create_jump_keys = FALSE; - node->getAttributeBOOL("create_jump_keys", create_jump_keys); - if (create_jump_keys) - { - menubar->createJumpKeys(); - } - - return menubar; -} - -BOOL LLMenuBarGL::handleAcceleratorKey(KEY key, MASK mask) -{ - if (getHighlightedItem() && mask == MASK_NONE) - { - // unmodified key accelerators are ignored when navigating menu - // (but are used as jump keys so will still work when appropriate menu is up) - return FALSE; - } - BOOL result = LLMenuGL::handleAcceleratorKey(key, mask); - if (result && mask & MASK_ALT) + else { - // ALT key used to trigger hotkey, don't use as shortcut to open menu - mAltKeyTrigger = FALSE; + // clear out our selection + if (mHoverItem) + { + mHoverItem->setHighlight(FALSE); + mHoverItem = NULL; + } } - if(!result && (key == KEY_F10 && mask == MASK_CONTROL) && !gKeyboard->getKeyRepeated(key)) + if( !handled && pointInView( x, y ) ) { - if (getHighlightedItem()) - { - clearHoverItem(); - } - else - { - // close menus originating from other menu bars when first opening menu via keyboard - LLMenuGL::sMenuContainer->hideMenus(); - highlightNextItem(NULL); - LLMenuGL::setKeyboardMode(TRUE); - } - return TRUE; + getWindow()->setCursor(UI_CURSOR_ARROW); + handled = TRUE; } - return result; + return handled; } -BOOL LLMenuBarGL::handleKeyHere(KEY key, MASK mask) +BOOL LLContextMenu::handleMouseDown( S32 x, S32 y, MASK mask ) { - if(key == KEY_ALT && !gKeyboard->getKeyRepeated(key) && LLUI::sConfigGroup->getBOOL("UseAltKeyForMenus")) - { - mAltKeyTrigger = TRUE; - } - else // if any key other than ALT hit, clear out waiting for Alt key mode + BOOL handled = FALSE; + // The click was somewhere within our rectangle + LLMenuItemGL *item = getHighlightedItem(); + + if (item) { - mAltKeyTrigger = FALSE; + // lie to the item about where the click happened + // to make sure it's within the item's rectangle + handled = item->handleMouseDown( 0, 0, mask ); } - - if (key == KEY_ESCAPE && mask == MASK_NONE) + else { - LLMenuGL::setKeyboardMode(FALSE); - // if any menus are visible, this will return TRUE, stopping further processing of ESCAPE key - return LLMenuGL::sMenuContainer->hideMenus(); + // call hidemenus to make sure transient selections get cleared + ((LLMenuHolderGL*)getParent())->hideMenus(); } - // before processing any other key, check to see if ALT key has triggered menu access - checkMenuTrigger(); - - return LLMenuGL::handleKeyHere(key, mask); + // always handle mouse down as mouse up will close open menus + return handled; } - -BOOL LLMenuBarGL::handleJumpKey(KEY key) +BOOL LLContextMenu::handleMouseUp( S32 x, S32 y, MASK mask ) { - // perform case-insensitive comparison - key = toupper(key); - navigation_key_map_t::iterator found_it = mJumpKeys.find(key); - if(found_it != mJumpKeys.end() && found_it->second->getEnabled()) - { - // switch to keyboard navigation mode - LLMenuGL::setKeyboardMode(TRUE); + BOOL handled = FALSE; - found_it->second->setHighlight(TRUE); - found_it->second->doIt(); - } - return TRUE; -} + // The click was somewhere within our rectangle + LLMenuItemGL *item = getHighlightedItem(); -BOOL LLMenuBarGL::handleMouseDown(S32 x, S32 y, MASK mask) -{ - // clicks on menu bar closes existing menus from other contexts but leave - // own menu open so that we get toggle behavior - if (!getHighlightedItem() || !getHighlightedItem()->isActive()) + if (item) { - LLMenuGL::sMenuContainer->hideMenus(); + // lie to the item about where the click happened + // to make sure it's within the item's rectangle + if (item->getEnabled()) + { + handled = item->handleMouseUp( 0, 0, mask ); + hide(); + } + } + else + { + // call hidemenus to make sure transient selections get cleared + ((LLMenuHolderGL*)getParent())->hideMenus(); } - return LLMenuGL::handleMouseDown(x, y, mask); -} - -BOOL LLMenuBarGL::handleRightMouseDown(S32 x, S32 y, MASK mask) -{ - // clicks on menu bar closes existing menus from other contexts but leave - // own menu open so that we get toggle behavior - if (!getHighlightedItem() || !getHighlightedItem()->isActive()) + if (!handled) { - LLMenuGL::sMenuContainer->hideMenus(); + // call hidemenus to make sure transient selections get cleared + sMenuContainer->hideMenus(); } - return LLMenuGL::handleMouseDown(x, y, mask); + return handled; } - -void LLMenuBarGL::draw() +BOOL LLContextMenu::handleRightMouseDown(S32 x, S32 y, MASK mask) { - LLMenuItemGL* itemp = getHighlightedItem(); - // If we are in mouse-control mode and the mouse cursor is not hovering over - // the current highlighted menu item and it isn't open, then remove the - // highlight. This is done via a polling mechanism here, as we don't receive - // notifications when the mouse cursor moves off of us - if (itemp && !itemp->isOpen() && !itemp->getHover() && !LLMenuGL::getKeyboardMode()) - { - clearHoverItem(); - } + BOOL handled = FALSE; - checkMenuTrigger(); + // The click was somewhere within our rectangle + LLMenuItemGL *item = getHighlightedItem(); - LLMenuGL::draw(); -} + S32 local_x = x - getRect().mLeft; + S32 local_y = y - getRect().mBottom; -void LLMenuBarGL::checkMenuTrigger() -{ - // has the ALT key been pressed and subsequently released? - if (mAltKeyTrigger && !gKeyboard->getKeyDown(KEY_ALT)) + BOOL clicked_in_menu = pointInView(local_x, local_y) ; + + // grab mouse if right clicking anywhere within pie (even deadzone in middle), to detect drag outside of pie + if (clicked_in_menu) { - // if alt key was released quickly, treat it as a menu access key - // otherwise it was probably an Alt-zoom or similar action - if (gKeyboard->getKeyElapsedTime(KEY_ALT) <= LLUI::sConfigGroup->getF32("MenuAccessKeyTime") || - gKeyboard->getKeyElapsedFrameCount(KEY_ALT) < 2) + // capture mouse cursor as if on initial menu show + handled = TRUE; + } + + if (item) + { + // lie to the item about where the click happened + // to make sure it's within the item's rectangle + if (item->handleMouseDown( 0, 0, mask )) { - if (getHighlightedItem()) - { - clearHoverItem(); - } - else - { - // close menus originating from other menu bars - LLMenuGL::sMenuContainer->hideMenus(); - - highlightNextItem(NULL); - LLMenuGL::setKeyboardMode(TRUE); - } + handled = TRUE; } - mAltKeyTrigger = FALSE; } -} -BOOL LLMenuBarGL::jumpKeysActive() -{ - // require user to be in keyboard navigation mode to activate key triggers - // as menu bars are always visible and it is easy to leave the mouse cursor over them - return LLMenuGL::getKeyboardMode() && getHighlightedItem() && LLMenuGL::jumpKeysActive(); + return handled; } -// rearrange the child rects so they fit the shape of the menu bar. -void LLMenuBarGL::arrange( void ) +BOOL LLContextMenu::handleRightMouseUp( S32 x, S32 y, MASK mask ) { - U32 pos = 0; - LLRect rect( 0, getRect().getHeight(), 0, 0 ); - item_list_t::const_iterator item_iter; - for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) - { - LLMenuItemGL* item = *item_iter; - if (item->getVisible()) - { - rect.mLeft = pos; - pos += item->getNominalWidth(); - rect.mRight = pos; - item->setRect( rect ); - item->buildDrawLabel(); - } - } - reshape(rect.mRight, rect.getHeight()); -} + // release mouse capture when right mouse button released, and we're past the shrink time + S32 local_x = x - getRect().mLeft; + S32 local_y = y - getRect().mBottom; -S32 LLMenuBarGL::getRightmostMenuEdge() -{ - // Find the last visible menu - item_list_t::reverse_iterator item_iter; - for (item_iter = mItems.rbegin(); item_iter != mItems.rend(); ++item_iter) + if (!mHoveredAnyItem && !pointInView(local_x, local_y)) { - if ((*item_iter)->getVisible()) - { - break; - } + sMenuContainer->hideMenus(); + return TRUE; } - if (item_iter == mItems.rend()) - { - return 0; - } - return (*item_iter)->getRect().mRight; + + BOOL result = handleMouseUp( x, y, mask ); + mHoveredAnyItem = FALSE; + + return result; } -// add a vertical separator to this menu -BOOL LLMenuBarGL::appendSeparator( const std::string &separator_name ) +void LLContextMenu::draw() { - LLMenuItemGL* separator = new LLMenuItemVerticalSeparatorGL(); - return append( separator ); + LLMenuGL::draw(); } -// add a menu - this will create a drop down menu. -BOOL LLMenuBarGL::appendMenu( LLMenuGL* menu ) +BOOL LLContextMenu::appendContextSubMenu(LLContextMenu *menu) { - if( menu == this ) + + if (menu == this) { - llerrs << "** Attempt to attach menu to itself. This is certainly " - << "a logic error." << llendl; + llerrs << "Can't attach a context menu to itself" << llendl; } - BOOL success = TRUE; + LLContextMenuBranch *item; + LLContextMenuBranch::Params p; + p.name = menu->getName(); + p.label = menu->getLabel(); + p.branch = menu; + p.enabled_color=LLUI::getCachedColorFunctor("MenuItemEnabledColor"); + p.disabled_color=LLUI::getCachedColorFunctor("MenuItemDisabledColor"); + p.highlight_bg_color=LLUI::getCachedColorFunctor("MenuItemHighlightBgColor"); + p.highlight_fg_color=LLUI::getCachedColorFunctor("MenuItemHighlightFgColor"); + + item = LLUICtrlFactory::create<LLContextMenuBranch>(p); + LLMenuGL::sMenuContainer->addChild(item->getBranch()); + item->setFont( LLFontGL::getFontSansSerifSmall() ); - LLMenuItemBranchGL* branch = NULL; - branch = new LLMenuItemBranchDownGL( menu->getName(), menu->getLabel(), menu->getHandle()); - success &= branch->addToAcceleratorList(&mAccelerators); - success &= append( branch ); - branch->setJumpKey(branch->getJumpKey()); - return success; + return append( item ); } -BOOL LLMenuBarGL::handleHover( S32 x, S32 y, MASK mask ) +bool LLContextMenu::addChild(LLView* view, S32 tab_group) { - BOOL handled = FALSE; - LLView* active_menu = NULL; + LLContextMenu* context = dynamic_cast<LLContextMenu*>(view); + if (context) + return appendContextSubMenu(context); - BOOL no_mouse_data = mLastMouseX == 0 && mLastMouseY == 0; - S32 mouse_delta_x = no_mouse_data ? 0 : x - mLastMouseX; - S32 mouse_delta_y = no_mouse_data ? 0 : y - mLastMouseY; - mMouseVelX = (mMouseVelX / 2) + (mouse_delta_x / 2); - mMouseVelY = (mMouseVelY / 2) + (mouse_delta_y / 2); - mLastMouseX = x; - mLastMouseY = y; - - // if nothing currently selected or mouse has moved since last call, pick menu item via mouse - // otherwise let keyboard control it - if (!getHighlightedItem() || !LLMenuGL::getKeyboardMode() || llabs(mMouseVelX) > 0 || llabs(mMouseVelY) > 0) - { - // find current active menu - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) - { - LLView* viewp = *child_it; - if (((LLMenuItemGL*)viewp)->isOpen()) - { - active_menu = viewp; - } - } - - // check for new active menu - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) - { - LLView* viewp = *child_it; - S32 local_x = x - viewp->getRect().mLeft; - S32 local_y = y - viewp->getRect().mBottom; - if( viewp->getVisible() && - viewp->getEnabled() && - viewp->pointInView(local_x, local_y) && - viewp->handleHover(local_x, local_y, mask)) - { - ((LLMenuItemGL*)viewp)->setHighlight(TRUE); - handled = TRUE; - if (active_menu && active_menu != viewp) - { - ((LLMenuItemGL*)viewp)->doIt(); - LLMenuGL::setKeyboardMode(FALSE); - } - LLMenuGL::setKeyboardMode(FALSE); - } - } - - if (handled) - { - // set hover false on inactive menus - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) - { - LLView* viewp = *child_it; - S32 local_x = x - viewp->getRect().mLeft; - S32 local_y = y - viewp->getRect().mBottom; - if (!viewp->pointInView(local_x, local_y) && ((LLMenuItemGL*)viewp)->getHighlight()) - { - ((LLMenuItemGL*)viewp)->setHighlight(FALSE); - } - } - } - } - - getWindow()->setCursor(UI_CURSOR_ARROW); - - return TRUE; -} - -///============================================================================ -/// Class LLMenuHolderGL -///============================================================================ -LLMenuHolderGL::LLMenuHolderGL() - : LLPanel(std::string("Menu Holder")) -{ - setMouseOpaque(FALSE); - sItemActivationTimer.stop(); - mCanHide = TRUE; -} - -LLMenuHolderGL::LLMenuHolderGL(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows) -: LLPanel(name, rect, FALSE) -{ - setMouseOpaque(mouse_opaque); - sItemActivationTimer.stop(); - mCanHide = TRUE; -} + LLMenuItemSeparatorGL* separator = dynamic_cast<LLMenuItemSeparatorGL*>(view); + if (separator) + return append(separator); + LLMenuItemGL* item = dynamic_cast<LLMenuItemGL*>(view); + if (item) + return append(item); -void LLMenuHolderGL::draw() -{ - LLView::draw(); - // now draw last selected item as overlay - LLMenuItemGL* selecteditem = (LLMenuItemGL*)sItemLastSelectedHandle.get(); - if (selecteditem && sItemActivationTimer.getStarted() && sItemActivationTimer.getElapsedTimeF32() < ACTIVATE_HIGHLIGHT_TIME) - { - // make sure toggle items, for example, show the proper state when fading out - selecteditem->buildDrawLabel(); - - LLRect item_rect; - selecteditem->localRectToOtherView(selecteditem->getLocalRect(), &item_rect, this); - - F32 interpolant = sItemActivationTimer.getElapsedTimeF32() / ACTIVATE_HIGHLIGHT_TIME; - F32 alpha = lerp(LLMenuItemGL::getHighlightBGColor().mV[VALPHA], 0.f, interpolant); - LLColor4 bg_color(LLMenuItemGL::getHighlightBGColor().mV[VRED], - LLMenuItemGL::getHighlightBGColor().mV[VGREEN], - LLMenuItemGL::getHighlightBGColor().mV[VBLUE], - alpha); - - LLUI::pushMatrix(); - { - LLUI::translate((F32)item_rect.mLeft, (F32)item_rect.mBottom, 0.f); - selecteditem->getMenu()->drawBackground(selecteditem, bg_color); - selecteditem->draw(); - } - LLUI::popMatrix(); - } -} - -BOOL LLMenuHolderGL::handleMouseDown( S32 x, S32 y, MASK mask ) -{ - BOOL handled = LLView::childrenHandleMouseDown(x, y, mask) != NULL; - if (!handled) - { - // clicked off of menu, hide them all - hideMenus(); - } - return handled; -} - -BOOL LLMenuHolderGL::handleRightMouseDown( S32 x, S32 y, MASK mask ) -{ - BOOL handled = LLView::childrenHandleRightMouseDown(x, y, mask) != NULL; - if (!handled) - { - // clicked off of menu, hide them all - hideMenus(); - } - return handled; -} - -void LLMenuHolderGL::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - if (width != getRect().getWidth() || height != getRect().getHeight()) - { - hideMenus(); - } - LLView::reshape(width, height, called_from_parent); -} - -BOOL LLMenuHolderGL::hasVisibleMenu() const -{ - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) - { - LLView* viewp = *child_it; - if (viewp->getVisible() && dynamic_cast<LLMenuBarGL*>(viewp) == NULL) - { - return TRUE; - } - } - return FALSE; -} - - -BOOL LLMenuHolderGL::hideMenus() -{ - if (!mCanHide) - { - return FALSE; - } - BOOL menu_visible = hasVisibleMenu(); - if (menu_visible) - { - LLMenuGL::setKeyboardMode(FALSE); - // clicked off of menu, hide them all - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) - { - LLView* viewp = *child_it; - // clicks off of menu do not hide menu bar - if (dynamic_cast<LLMenuBarGL*>(viewp) == NULL && viewp->getVisible()) - { - viewp->setVisible(FALSE); - } - } - } - //if (gFocusMgr.childHasKeyboardFocus(this)) - //{ - // gFocusMgr.setKeyboardFocus(NULL); - //} - - return menu_visible; -} - -void LLMenuHolderGL::setActivatedItem(LLMenuItemGL* item) -{ - sItemLastSelectedHandle = item->getHandle(); - sItemActivationTimer.start(); -} - -///============================================================================ -/// Class LLTearOffMenu -///============================================================================ -LLTearOffMenu::LLTearOffMenu(LLMenuGL* menup) : - LLFloater(menup->getName(), LLRect(0, 100, 100, 0), menup->getLabel(), FALSE, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, FALSE, FALSE) -{ - // flag menu as being torn off - menup->setTornOff(TRUE); - // update menu layout as torn off menu (no spillover menus) - menup->arrange(); - - LLRect rect; - menup->localRectToOtherView(LLRect(-1, menup->getRect().getHeight(), menup->getRect().getWidth() + 3, 0), &rect, gFloaterView); - // make sure this floater is big enough for menu - mTargetHeight = (F32)(rect.getHeight() + LLFLOATER_HEADER_SIZE + 5); - reshape(rect.getWidth(), rect.getHeight()); - setRect(rect); - - // attach menu to floater - menup->setFollowsAll(); - mOldParent = menup->getParent(); - addChild(menup); - menup->setVisible(TRUE); - menup->translate(-menup->getRect().mLeft + 1, -menup->getRect().mBottom + 1); - menup->setDropShadowed(FALSE); - - mMenu = menup; - - // highlight first item (tear off item will be disabled) - mMenu->highlightNextItem(NULL); -} - - -void LLTearOffMenu::draw() -{ - mMenu->setBackgroundVisible(isBackgroundOpaque()); - mMenu->arrange(); - - if (getRect().getHeight() != mTargetHeight) - { - // animate towards target height - reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLCriticalDamp::getInterpolant(0.05f)))); - } - else - { - // when in stasis, remain big enough to hold menu contents - mTargetHeight = (F32)(mMenu->getRect().getHeight() + LLFLOATER_HEADER_SIZE + 4); - reshape(mMenu->getRect().getWidth() + 3, mMenu->getRect().getHeight() + LLFLOATER_HEADER_SIZE + 5); - } - LLFloater::draw(); -} - -void LLTearOffMenu::onFocusReceived() -{ - // if nothing is highlighted, just highlight first item - if (!mMenu->getHighlightedItem()) - { - mMenu->highlightNextItem(NULL); - } - - // parent menu items get highlights so navigation logic keeps working - LLMenuItemGL* parent_menu_item = mMenu->getParentMenuItem(); - while(parent_menu_item) - { - if (parent_menu_item->getMenu()->getVisible()) - { - parent_menu_item->setHighlight(TRUE); - parent_menu_item = parent_menu_item->getMenu()->getParentMenuItem(); - } - else - { - break; - } - } - LLFloater::onFocusReceived(); -} - -void LLTearOffMenu::onFocusLost() -{ - // remove highlight from parent item and our own menu - mMenu->clearHoverItem(); - LLFloater::onFocusLost(); -} - -BOOL LLTearOffMenu::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) -{ - // pass keystrokes down to menu - return mMenu->handleUnicodeChar(uni_char, TRUE); -} - -BOOL LLTearOffMenu::handleKeyHere(KEY key, MASK mask) -{ - if (!mMenu->getHighlightedItem()) - { - if (key == KEY_UP) - { - mMenu->highlightPrevItem(NULL); - return TRUE; - } - else if (key == KEY_DOWN) - { - mMenu->highlightNextItem(NULL); - return TRUE; - } - } - // pass keystrokes down to menu - return mMenu->handleKey(key, mask, TRUE); -} - -void LLTearOffMenu::translate(S32 x, S32 y) -{ - if (x != 0 && y != 0) - { - // hide open sub-menus by clearing current hover item - mMenu->clearHoverItem(); - } - LLFloater::translate(x, y); -} - -//static -LLTearOffMenu* LLTearOffMenu::create(LLMenuGL* menup) -{ - LLTearOffMenu* tearoffp = new LLTearOffMenu(menup); - // keep onscreen - gFloaterView->adjustToFitScreen(tearoffp, FALSE); - tearoffp->open(); /* Flawfinder: ignore */ - - return tearoffp; -} - -void LLTearOffMenu::onClose(bool app_quitting) -{ - removeChild(mMenu); - mOldParent->addChild(mMenu); - mMenu->clearHoverItem(); - mMenu->setFollowsNone(); - mMenu->setBackgroundVisible(TRUE); - mMenu->setVisible(FALSE); - mMenu->setTornOff(FALSE); - mMenu->setDropShadowed(TRUE); - destroy(); + return false; } diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index e62402d6179db579c29edeb881562504d944998d..7d889c291cf8908c97651889607365e25b6fff8b 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -38,78 +38,87 @@ #include "llstring.h" #include "v4color.h" #include "llframetimer.h" -#include "llevent.h" #include "llkeyboard.h" #include "llfloater.h" #include "lluistring.h" #include "llview.h" - +#include <boost/function.hpp> extern S32 MENU_BAR_HEIGHT; extern S32 MENU_BAR_WIDTH; -// These callbacks are used by the LLMenuItemCallGL and LLMenuItemCheckGL -// classes during their work. -typedef void (*menu_callback)(void*); - -// These callbacks are used by the LLMenuItemCallGL -// classes during their work. -typedef void (*on_disabled_callback)(void*); - -// This callback is used by the LLMenuItemCallGL and LLMenuItemCheckGL -// to determine if the current menu is enabled. -typedef BOOL (*enabled_callback)(void*); - -// This callback is used by LLMenuItemCheckGL to determine it's -// 'checked' state. -typedef BOOL (*check_callback)(void*); - -// This callback is potentially used by LLMenuItemCallGL. If provided, -// this function is called whenever it's time to determine the label's -// contents. Put the contents of the label in the provided parameter. -typedef void (*label_callback)(std::string&,void*); - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLMenuItemGL // // The LLMenuItemGL represents a single menu item in a menu. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLMenuItemGL : public LLView +class LLMenuItemGL : public LLUICtrl { public: - // static functions to control the global color scheme. - static void setEnabledColor( const LLColor4& color ) { sEnabledColor = color; } - static const LLColor4& getEnabledColor() { return sEnabledColor; } - static void setDisabledColor( const LLColor4& color ) { sDisabledColor = color; } - static const LLColor4& getDisabledColor() { return sDisabledColor; } - static void setHighlightBGColor( const LLColor4& color ) { sHighlightBackground = color; } - static const LLColor4& getHighlightBGColor() { return sHighlightBackground; } - static void setHighlightFGColor( const LLColor4& color ) { sHighlightForeground = color; } - static const LLColor4& getHighlightFGColor() { return sHighlightForeground; } - - LLMenuItemGL( const std::string& name, const std::string& label, KEY key = KEY_NONE, MASK = MASK_NONE ); - virtual ~LLMenuItemGL() {}; + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<std::string> shortcut; + Optional<KEY> jump_key; + Optional<bool> use_mac_ctrl; + + Deprecated rect, + left, + top, + right, + bottom, + width, + height, + bottom_delta, + left_delta; + + Optional<LLUIColor> enabled_color, + disabled_color, + highlight_bg_color, + highlight_fg_color; + + + Params() + : shortcut("shortcut"), + jump_key("", KEY_NONE), + use_mac_ctrl("use_mac_ctrl", false), + rect("rect"), + left("left"), + top("top"), + right("right"), + bottom("bottom"), + width("width"), + height("height"), + bottom_delta("bottom_delta"), + left_delta("left_delta"), + enabled_color("enabled_color"), + disabled_color("disabled_color"), + highlight_bg_color("highlight_bg_color"), + highlight_fg_color("highlight_fg_color") + { + mouse_opaque = true; + } + }; +protected: + LLMenuItemGL(const Params&); + friend class LLUICtrlFactory; +public: virtual void setValue(const LLSD& value) { setLabel(value.asString()); } - - virtual LLXMLNodePtr getXML(bool save_children = true) const; - - virtual std::string getType() const { return "item"; } + /*virtual*/ void onVisibilityChange(BOOL new_visibility); virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleAcceleratorKey(KEY key, MASK mask); + LLColor4 getHighlightBgColor() { return mHighlightBackground.get(); } + void setJumpKey(KEY key); KEY getJumpKey() const { return mJumpKey; } // set the font used by this item. void setFont(const LLFontGL* font) { mFont = font; } const LLFontGL* getFont() const { return mFont; } - void setFontStyle(U8 style) { mStyle = style; } - U8 getFontStyle() const { return mStyle; } // returns the height in pixels for the current font. virtual U32 getNominalHeight( void ) const; @@ -140,7 +149,7 @@ public: // lead to visual errors if the state of the object changes // without the knowledge of the menu item. For example, if a // boolean being watched is changed outside of the menu item's - // doIt() function, the draw buffer will not be updated and will + // onCommit() function, the draw buffer will not be updated and will // reflect the wrong value. If this ever becomes an issue, there // are ways to fix this. // Returns the enabled state of the item. @@ -149,8 +158,7 @@ public: // for branching menu items, bring sub menus up to root level of menu hierarchy virtual void updateBranchParent( LLView* parentp ){}; - // doIt() - do the primary funcationality of the menu item. - virtual void doIt( void ); + virtual void onCommit( void ); virtual void setHighlight( BOOL highlight ); virtual BOOL getHighlight() const { return mHighlight; } @@ -167,6 +175,7 @@ public: virtual BOOL handleKeyHere( KEY key, MASK mask ); virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); + virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); virtual void draw( void ); BOOL getHover() const { return mGotHover; } @@ -180,7 +189,10 @@ protected: // This function appends the character string representation of // the current accelerator key and mask to the provided string. void appendAcceleratorString( std::string& st ) const; - + + void initMenuEnableCallback(const EnableCallbackParam& cb, enable_signal_t& sig); + +protected: KEY mAcceleratorKey; MASK mAcceleratorMask; // mLabel contains the actual label specified by the user. @@ -193,13 +205,13 @@ protected: LLUIString mDrawAccelLabel; LLUIString mDrawBranchLabel; + LLUIColor mEnabledColor; + LLUIColor mDisabledColor; + LLUIColor mHighlightBackground; + LLUIColor mHighlightForeground; + BOOL mHighlight; private: - static LLColor4 sEnabledColor; - static LLColor4 sDisabledColor; - static LLColor4 sHighlightBackground; - static LLColor4 sHighlightForeground; - // Keyboard and mouse variables BOOL mAllowKeyRepeat; BOOL mGotHover; @@ -210,12 +222,32 @@ private: // Font for this item const LLFontGL* mFont; - U8 mStyle; BOOL mDrawTextDisabled; KEY mJumpKey; }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLMenuItemSeparatorGL +// +// This class represents a separator. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLMenuItemSeparatorGL : public LLMenuItemGL +{ +public: + struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params> + { + Params(); + }; + LLMenuItemSeparatorGL(const LLMenuItemSeparatorGL::Params& p = LLMenuItemSeparatorGL::Params()); + + /*virtual*/ void draw( void ); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + + /*virtual*/ U32 getNominalHeight( void ) const; +}; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLMenuItemCallGL @@ -224,78 +256,48 @@ private: // calls a user defined callback. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLMenuItemCallGL : public LLMenuItemGL, public LLOldEvents::LLObservable +class LLMenuItemCallGL : public LLMenuItemGL { public: - // normal constructor - LLMenuItemCallGL( const std::string& name, - menu_callback clicked_cb, - enabled_callback enabled_cb = NULL, - void* user_data = NULL, - KEY key = KEY_NONE, MASK mask = MASK_NONE, - BOOL enabled = TRUE, - on_disabled_callback on_disabled_cb = NULL); - LLMenuItemCallGL( const std::string& name, - const std::string& label, - menu_callback clicked_cb, - enabled_callback enabled_cb = NULL, - void* user_data = NULL, - KEY key = KEY_NONE, MASK mask = MASK_NONE, - BOOL enabled = TRUE, - on_disabled_callback on_disabled_cb = NULL); - - // constructor for when you want to trap the arrange method. - LLMenuItemCallGL( const std::string& name, - const std::string& label, - menu_callback clicked_cb, - enabled_callback enabled_cb, - label_callback label_cb, - void* user_data, - KEY key = KEY_NONE, MASK mask = MASK_NONE, - BOOL enabled = TRUE, - on_disabled_callback on_disabled_c = NULL); - LLMenuItemCallGL( const std::string& name, - menu_callback clicked_cb, - enabled_callback enabled_cb, - label_callback label_cb, - void* user_data, - KEY key = KEY_NONE, MASK mask = MASK_NONE, - BOOL enabled = TRUE, - on_disabled_callback on_disabled_c = NULL); - virtual LLXMLNodePtr getXML(bool save_children = true) const; - - virtual std::string getType() const { return "call"; } - - - void setEnabledControl(std::string enabled_control, LLView *context); - void setVisibleControl(std::string enabled_control, LLView *context); - - void setMenuCallback(menu_callback callback, void* data) { mCallback = callback; mUserData = data; }; - menu_callback getMenuCallback() const { return mCallback; } - - void setEnabledCallback(enabled_callback callback) { mEnabledCallback = callback; }; - - void setUserData(void *userdata) { mUserData = userdata; } - void* getUserData() const { return mUserData; } + struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params> + { + Optional<EnableCallbackParam > on_enable; + Optional<CommitCallbackParam > on_click; + Params() + : on_enable("on_enable"), + on_click("on_click") + {} + }; +protected: + LLMenuItemCallGL(const Params&); + friend class LLUICtrlFactory; + void updateEnabled( void ); +public: + void initFromParams(const Params& p); + // called to rebuild the draw label virtual void buildDrawLabel( void ); - // doIt() - do the primary funcationality of the menu item. - virtual void doIt( void ); + virtual void onCommit( void ); virtual BOOL handleAcceleratorKey(KEY key, MASK mask); - + virtual BOOL handleKeyHere(KEY key, MASK mask); + //virtual void draw(); - - + + boost::signals::connection setClickCallback( const commit_signal_t::slot_type& cb ) + { + return setCommitCallback(cb); + } + + boost::signals::connection setEnableCallback( const enable_signal_t::slot_type& cb ) + { + return mEnableSignal.connect(cb); + } + private: - menu_callback mCallback; - // mEnabledCallback should return TRUE if the item should be enabled - enabled_callback mEnabledCallback; - label_callback mLabelCallback; - void* mUserData; - on_disabled_callback mOnDisabledCallback; + enable_signal_t mEnableSignal; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -312,78 +314,37 @@ class LLMenuItemCheckGL : public LLMenuItemCallGL { public: - LLMenuItemCheckGL( const std::string& name, - const std::string& label, - menu_callback callback, - enabled_callback enabled_cb, - check_callback check, - void* user_data, - KEY key = KEY_NONE, MASK mask = MASK_NONE ); - LLMenuItemCheckGL( const std::string& name, - menu_callback callback, - enabled_callback enabled_cb, - check_callback check, - void* user_data, - KEY key = KEY_NONE, MASK mask = MASK_NONE ); - LLMenuItemCheckGL( const std::string& name, - const std::string& label, - menu_callback callback, - enabled_callback enabled_cb, - std::string control_name, - LLView *context, - void* user_data, - KEY key = KEY_NONE, MASK mask = MASK_NONE ); - virtual LLXMLNodePtr getXML(bool save_children = true) const; - - void setCheckedControl(std::string checked_control, LLView *context); - - virtual void setValue(const LLSD& value); - - virtual std::string getType() const { return "check"; } - - // called to rebuild the draw label - virtual void buildDrawLabel( void ); - -private: - check_callback mCheckCallback; - BOOL mChecked; -}; - + struct Params : public LLInitParam::Block<Params, LLMenuItemCallGL::Params> + { + Optional<EnableCallbackParam > on_check; + Params() + : on_check("on_check") + {} + }; -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLMenuItemToggleGL -// -// The LLMenuItemToggleGL is a menu item that wraps around a user -// specified and controlled boolean. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLMenuItemToggleGL : public LLMenuItemGL -{ +protected: + LLMenuItemCheckGL(const Params&); + friend class LLUICtrlFactory; public: - LLMenuItemToggleGL( const std::string& name, const std::string& label, - BOOL* toggle, - KEY key = KEY_NONE, MASK mask = MASK_NONE ); - - LLMenuItemToggleGL( const std::string& name, - BOOL* toggle, - KEY key = KEY_NONE, MASK mask = MASK_NONE ); + + void initFromParams(const Params& p); - virtual std::string getType() const { return "toggle"; } + virtual void onCommit( void ); + + virtual void setValue(const LLSD& value); // called to rebuild the draw label virtual void buildDrawLabel( void ); - - // doIt() - do the primary funcationality of the menu item. - virtual void doIt( void ); - - // LLView Functionality - //virtual void draw( void ); - + + boost::signals::connection setCheckCallback( const enable_signal_t::slot_type& cb ) + { + return mCheckSignal.connect(cb); + } + private: - BOOL* mToggle; + enable_signal_t mCheckSignal; }; - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLMenuGL // @@ -397,27 +358,59 @@ private: class LLMenuGL : public LLUICtrl -// TODO: The menu and menu item classes share a great deal of functionality and perhaps should be united. -// I think it may make the most sense to make LLMenuGL be a subclass of LLMenuItemGL. -MG { +public: + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<LLHandle<LLFloater> > parent_floater; + Optional<KEY> jump_key; + Optional<bool> horizontal_layout, + can_tear_off, + drop_shadow, + bg_visible, + create_jump_keys, + keep_fixed_size, + scrollable; + Optional<LLUIColor> bg_color; + + Params() + : jump_key("", KEY_NONE), + can_tear_off("tear_off", false), + drop_shadow("drop_shadow", true), + bg_visible("bg_visible", true), + create_jump_keys("create_jump_keys", false), + bg_color("bg_color", LLUI::getCachedColorFunctor( "MenuDefaultBgColor" )), + scrollable("scrollable", false) + { + addSynonym(bg_visible, "opaque"); + addSynonym(bg_color, "color"); + + name = "menu"; + } + }; + void initFromParams(const Params&); + +protected: + LLMenuGL(const LLMenuGL::Params& p); + friend class LLUICtrlFactory; // let branching menu items use my protected traversal methods friend class LLMenuItemBranchGL; public: - LLMenuGL( const std::string& name, const std::string& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>()); - LLMenuGL( const std::string& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>() ); virtual ~LLMenuGL( void ); - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - - void parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory *factory); + void parseChildXML(LLXMLNodePtr child, LLView* parent); // LLView Functionality - virtual BOOL handleUnicodeCharHere( llwchar uni_char ); - virtual BOOL handleHover( S32 x, S32 y, MASK mask ); - virtual void draw( void ); - virtual void drawBackground(LLMenuItemGL* itemp, LLColor4& color); - virtual void setVisible(BOOL visible); + /*virtual*/ BOOL handleUnicodeCharHere( llwchar uni_char ); + /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ); + /*virtual*/ BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); + /*virtual*/ void draw( void ); + /*virtual*/ void drawBackground(LLMenuItemGL* itemp, F32 alpha); + /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0); + /*virtual*/ void removeChild( LLView* ctrl); + /*virtual*/ BOOL postBuild(); + /*virtual*/ const widget_registry_t& getChildRegistry() const; virtual BOOL handleAcceleratorKey(KEY key, MASK mask); @@ -430,24 +423,13 @@ public: void setLabel(const LLStringExplicit& label) { mLabel = label; } // background colors - static void setDefaultBackgroundColor( const LLColor4& color ) { sDefaultBackgroundColor = color; } - void setBackgroundColor( const LLColor4& color ) { mBackgroundColor = color; } - const LLColor4& getBackgroundColor() const { return mBackgroundColor; } + void setBackgroundColor( const LLUIColor& color ) { mBackgroundColor = color; } + const LLUIColor& getBackgroundColor() const { return mBackgroundColor; } void setBackgroundVisible( BOOL b ) { mBgVisible = b; } void setCanTearOff(BOOL tear_off, LLHandle<LLFloater> parent_floater_handle = LLHandle<LLFloater>()); - // Add the menu item to this menu. - virtual BOOL append( LLMenuItemGL* item ); - - // *NOTE:Mani - appendNoArrange() should be removed when merging to skinning/viewer2.0 - // Its added as a fix to a viewer 1.23 bug that has already been address by skinning work. - virtual BOOL appendNoArrange( LLMenuItemGL* item ); - // add a separator to this menu - virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null ); - - // add a menu - this will create a cascading menu - virtual BOOL appendMenu( LLMenuGL* menu ); + virtual BOOL addSeparator(); // for branching menu items, bring sub menus up to root level of menu hierarchy virtual void updateParent( LLView* parentp ); @@ -471,19 +453,17 @@ public: virtual BOOL isOpen(); + void needsArrange() { mNeedsArrange = TRUE; } // Shape this menu to fit the current state of the children, and // adjust the child rects to fit. This is called automatically // when you add items. *FIX: We may need to deal with visibility // arrangement. virtual void arrange( void ); + void arrangeAndClear( void ); // remove all items on the menu void empty( void ); - // Rearrange the components, and do the right thing if the menu doesn't - // fit in the bounds. - // virtual void arrangeWithBounds(LLRect bounds); - void setItemLastSelected(LLMenuItemGL* item); // must be in menu U32 getItemCount(); // number of menu items LLMenuItemGL* getItem(S32 number); // 0 = first item @@ -504,8 +484,8 @@ public: // Whether to drop shadow menu bar void setDropShadowed( const BOOL shadowed ); - void setParentMenuItem( LLMenuItemGL* parent_menu_item ) { mParentMenuItem = parent_menu_item; } - LLMenuItemGL* getParentMenuItem() const { return mParentMenuItem; } + void setParentMenuItem( LLMenuItemGL* parent_menu_item ) { mParentMenuItem = parent_menu_item->getHandle(); } + LLMenuItemGL* getParentMenuItem() const { return dynamic_cast<LLMenuItemGL*>(mParentMenuItem.get()); } void setTornOff(BOOL torn_off); BOOL getTornOff() { return mTornOff; } @@ -518,15 +498,27 @@ public: static void setKeyboardMode(BOOL mode) { sKeyboardMode = mode; } static BOOL getKeyboardMode() { return sKeyboardMode; } + void scrollItemsUp(); + void scrollItemsDown(); + BOOL isScrollable() const { return mScrollable; } + static class LLMenuHolderGL* sMenuContainer; protected: void createSpilloverBranch(); void cleanupSpilloverBranch(); + // Add the menu item to this menu. + virtual BOOL append( LLMenuItemGL* item ); + + // add a menu - this will create a cascading menu + virtual BOOL appendMenu( LLMenuGL* menu ); // TODO: create accessor methods for these? typedef std::list< LLMenuItemGL* > item_list_t; item_list_t mItems; + LLMenuItemGL*mFirstVisibleItem; + LLMenuItemGL *mArrowUpItem, *mArrowDownItem; + typedef std::map<KEY, LLMenuItemGL*> navigation_key_map_t; navigation_key_map_t mJumpKeys; S32 mLastMouseX; @@ -534,25 +526,31 @@ protected: S32 mMouseVelX; S32 mMouseVelY; BOOL mHorizontalLayout; + BOOL mScrollable; BOOL mKeepFixedSize; + BOOL mNeedsArrange; private: + + static LLColor4 sDefaultBackgroundColor; static BOOL sKeyboardMode; - LLColor4 mBackgroundColor; + LLUIColor mBackgroundColor; BOOL mBgVisible; - LLMenuItemGL* mParentMenuItem; + LLHandle<LLView> mParentMenuItem; LLUIString mLabel; BOOL mDropShadowed; // Whether to drop shadow BOOL mHasSelection; LLFrameTimer mFadeTimer; + LLTimer mScrollItemsTimer; BOOL mTornOff; class LLMenuItemTearOffGL* mTearOffItem; class LLMenuItemBranchGL* mSpilloverBranch; LLMenuGL* mSpilloverMenu; LLHandle<LLFloater> mParentFloaterHandle; KEY mJumpKey; + BOOL mCreateJumpKeys; }; // end class LLMenuGL @@ -567,15 +565,17 @@ private: class LLMenuItemBranchGL : public LLMenuItemGL { public: - LLMenuItemBranchGL( const std::string& name, const std::string& label, LLHandle<LLView> branch, - KEY key = KEY_NONE, MASK mask = MASK_NONE ); + struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params> + { + Optional<LLMenuGL*> branch; + }; +protected: + LLMenuItemBranchGL(const Params&); + friend class LLUICtrlFactory; +public: virtual ~LLMenuItemBranchGL(); - - virtual LLXMLNodePtr getXML(bool save_children = true) const; - - virtual std::string getType() const { return "menu"; } - + virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleAcceleratorKey(KEY key, MASK mask); @@ -586,8 +586,7 @@ public: // called to rebuild the draw label virtual void buildDrawLabel( void ); - // doIt() - do the primary funcationality of the menu item. - virtual void doIt( void ); + virtual void onCommit( void ); virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); @@ -598,11 +597,11 @@ public: virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual BOOL isActive() const { return isOpen() && getBranch()->getHighlightedItem(); } + virtual BOOL isActive() const { return isOpen() && getBranch() && getBranch()->getHighlightedItem(); } virtual BOOL isOpen() const { return getBranch() && getBranch()->isOpen(); } - LLMenuGL *getBranch() const { return (LLMenuGL*)(mBranch.get()); } + LLMenuGL* getBranch() const { return (LLMenuGL*)mBranchHandle.get(); } virtual void updateBranchParent( LLView* parentp ); @@ -611,77 +610,69 @@ public: virtual void draw(); - virtual void setEnabledSubMenus(BOOL enabled) { if(getBranch()) getBranch()->setEnabledSubMenus(enabled); } + virtual void setEnabledSubMenus(BOOL enabled) { if (getBranch()) getBranch()->setEnabledSubMenus(enabled); } virtual void openMenu(); virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; private: - LLHandle<LLView> mBranch; + LLHandle<LLView> mBranchHandle; }; // end class LLMenuItemBranchGL - //----------------------------------------------------------------------------- -// class LLPieMenu -// A circular menu of items, icons, etc. +// class LLContextMenu +// A context menu //----------------------------------------------------------------------------- -class LLPieMenu +class LLContextMenu : public LLMenuGL { public: - LLPieMenu(const std::string& name, const std::string& label); - LLPieMenu(const std::string& name); - virtual ~LLPieMenu() {} + struct Params : public LLInitParam::Block<Params, LLMenuGL::Params> + { + Params() + { + visible = false; + } + }; - void initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *factory); +protected: + LLContextMenu(const Params& p); + friend class LLUICtrlFactory; + +public: + virtual ~LLContextMenu() {} // LLView Functionality // can't set visibility directly, must call show or hide - virtual void setVisible(BOOL visible); + virtual void setVisible (BOOL visible); - virtual BOOL handleHover( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseUp( S32 x, S32 y, MASK mask ); - virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); - virtual void draw(); - virtual void drawBackground(LLMenuItemGL* itemp, LLColor4& color); + virtual void draw (); + + virtual void show (S32 x, S32 y, BOOL adjustCursor = TRUE); + virtual void hide (); - virtual BOOL append(LLMenuItemGL* item); - virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null ); + - BOOL appendPieMenu(LLPieMenu *menu); + virtual BOOL handleHover ( S32 x, S32 y, MASK mask ); + virtual BOOL handleMouseDown ( S32 x, S32 y, MASK mask ); + virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); + virtual BOOL handleRightMouseUp ( S32 x, S32 y, MASK mask ); + virtual BOOL handleMouseUp ( S32 x, S32 y, MASK mask ); - virtual void arrange( void ); + virtual bool addChild (LLView* view, S32 tab_group = 0); - // Display the menu centered on this point on the screen. - void show(S32 x, S32 y, BOOL mouse_down); - void hide(BOOL item_selected); + BOOL appendContextSubMenu(LLContextMenu *menu); -private: - LLMenuItemGL *pieItemFromXY(S32 x, S32 y); - S32 pieItemIndexFromXY(S32 x, S32 y); - - // These cause menu items to be spuriously selected by right-clicks - // near the window edge at low frame rates. I don't think they are - // needed unless you shift the menu position in the draw() function. JC - //S32 mShiftHoriz; // non-zero if menu had to shift this frame - //S32 mShiftVert; // non-zero if menu had to shift this frame - BOOL mFirstMouseDown; // true from show until mouse up - BOOL mUseInfiniteRadius; // allow picking pie menu items anywhere outside of center circle - LLMenuItemGL* mHoverItem; - BOOL mHoverThisFrame; +protected: BOOL mHoveredAnyItem; - LLFrameTimer mShrinkBorderTimer; - F32 mOuterRingAlpha; // for rendering pie menus as both bounded and unbounded - F32 mCurRadius; - BOOL mRightMouseDown; + LLMenuItemGL* mHoverItem; }; + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLMenuBarGL // @@ -691,28 +682,31 @@ private: class LLMenuBarGL : public LLMenuGL { public: - LLMenuBarGL( const std::string& name ); + struct Params : public LLInitParam::Block<Params, LLMenuGL::Params> + { + Params() + { + can_tear_off = false; + keep_fixed_size = true; + horizontal_layout = true; + visible = true; + drop_shadow = false; + } + }; + LLMenuBarGL( const Params& p ); virtual ~LLMenuBarGL(); - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - virtual BOOL handleAcceleratorKey(KEY key, MASK mask); - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual BOOL handleJumpKey(KEY key); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleAcceleratorKey(KEY key, MASK mask); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ BOOL handleJumpKey(KEY key); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - // rearrange the child rects so they fit the shape of the menu - // bar. - virtual void arrange( void ); - virtual void draw(); - virtual BOOL jumpKeysActive(); + /*virtual*/ void draw(); + /*virtual*/ BOOL jumpKeysActive(); // add a vertical separator to this menu - virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null ); - - // add a menu - this will create a drop down menu. - virtual BOOL appendMenu( LLMenuGL* menu ); + virtual BOOL addSeparator(); // LLView Functionality virtual BOOL handleHover( S32 x, S32 y, MASK mask ); @@ -723,6 +717,12 @@ public: void resetMenuTrigger() { mAltKeyTrigger = FALSE; } private: + // add a menu - this will create a drop down menu. + virtual BOOL appendMenu( LLMenuGL* menu ); + // rearrange the child rects so they fit the shape of the menu + // bar. + virtual void arrange( void ); + void checkMenuTrigger(); std::list <LLKeyBinding*> mAccelerators; @@ -738,7 +738,6 @@ class LLMenuHolderGL : public LLPanel { public: LLMenuHolderGL(); - LLMenuHolderGL(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows = FOLLOWS_NONE); virtual ~LLMenuHolderGL() {} virtual BOOL hideMenus(); @@ -798,11 +797,19 @@ private: class LLMenuItemTearOffGL : public LLMenuItemGL { public: - LLMenuItemTearOffGL( LLHandle<LLFloater> parent_floater_handle = LLHandle<LLFloater>()); - - virtual std::string getType() const { return "tearoff_menu"; } - - virtual void doIt(void); + struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params> + { + Optional<LLHandle<LLFloater> > parent_floater_handle; + Params() + { + name = "tear off"; + label = "~~~~~~~~~~~"; + } + }; + + LLMenuItemTearOffGL( const Params& ); + + virtual void onCommit(void); virtual void draw(void); virtual U32 getNominalHeight() const; @@ -824,4 +831,31 @@ private: LLEditMenuHandlerMgr() {}; }; + +// *TODO: Eliminate +// For backwards compatability only; generally just use boost::bind +class view_listener_t : public boost::signals::trackable +{ +public: + virtual bool handleEvent(const LLSD& userdata) = 0; + virtual ~view_listener_t() {} + + static void addEnable(view_listener_t* listener, const std::string& name) + { + LLUICtrl::EnableCallbackRegistry::currentRegistrar().add(name, boost::bind(&view_listener_t::handleEvent, listener, _2)); + } + + static void addCommit(view_listener_t* listener, const std::string& name) + { + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add(name, boost::bind(&view_listener_t::handleEvent, listener, _2)); + } + + static void addMenu(view_listener_t* listener, const std::string& name) + { + // For now, add to both click and enable registries + addEnable(listener, name); + addCommit(listener, name); + } +}; + #endif // LL_LLMENUGL_H diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 1662ff7db62d41da31185feff098bc974a47c839..8779eee28d1d982a13112cba130e88ef16edcd97 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -45,17 +45,16 @@ std::list<LLModalDialog*> LLModalDialog::sModalStack; LLModalDialog::LLModalDialog( const std::string& title, S32 width, S32 height, BOOL modal ) - : LLFloater( std::string("modal container"), - LLRect( 0, height, width, 0 ), - title, - FALSE, // resizable - DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, - FALSE, // drag_on_left - modal ? FALSE : TRUE, // minimizable - modal ? FALSE : TRUE, // close button - TRUE), // bordered + : LLFloater(), mModal( modal ) { + setRect(LLRect( 0, height, width, 0 )); + setTitle(title); + if (modal) + { + setCanMinimize(FALSE); + setCanClose(FALSE); + } setVisible( FALSE ); setBackgroundVisible(TRUE); setBackgroundOpaque(TRUE); @@ -72,12 +71,12 @@ LLModalDialog::~LLModalDialog() } // virtual -void LLModalDialog::open() /* Flawfinder: ignore */ +void LLModalDialog::openFloater(const LLSD& key) { // SJB: Hack! Make sure we don't ever host a modal dialog LLMultiFloater* thost = LLFloater::getFloaterHost(); LLFloater::setFloaterHost(NULL); - LLFloater::open(); + LLFloater::openFloater(key); LLFloater::setFloaterHost(thost); } @@ -229,7 +228,7 @@ BOOL LLModalDialog::handleKeyHere(KEY key, MASK mask ) BOOL enough_time_elapsed = mVisibleTime.getElapsedTimeF32() > 1.0f; if (enough_time_elapsed && key == KEY_ESCAPE) { - close(); + closeFloater(); return TRUE; } return FALSE; @@ -245,32 +244,15 @@ void LLModalDialog::onClose(bool app_quitting) // virtual void LLModalDialog::draw() { - LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); - S32 shadow_lines = LLUI::sConfigGroup->getS32("DropShadowFloater"); + static LLUICachedControl<LLColor4> shadow_color ("ColorDropShadow", *(new LLColor4)); + static LLUICachedControl<S32> shadow_lines ("DropShadowFloater", 0); gl_drop_shadow( 0, getRect().getHeight(), getRect().getWidth(), 0, shadow_color, shadow_lines); LLFloater::draw(); - - if (mModal) - { - // If we've lost focus to a non-child, get it back ASAP. - if( gFocusMgr.getTopCtrl() != this ) - { - gFocusMgr.setTopCtrl( this ); - } - - if( !gFocusMgr.childHasKeyboardFocus( this ) ) - { - setFocus(TRUE); - } - - if( !gFocusMgr.childHasMouseCapture( this ) ) - { - gFocusMgr.setMouseCapture( this ); - } - } + + // Focus retrieval moved to LLFloaterView::refresh() } void LLModalDialog::centerOnScreen() diff --git a/indra/llui/llmodaldialog.h b/indra/llui/llmodaldialog.h index f6abd0a7ac1d34415024ba989094817f3871e171..dad92ab82a879d822fad2c5d7c4f2bb0b3a8a95b 100644 --- a/indra/llui/llmodaldialog.h +++ b/indra/llui/llmodaldialog.h @@ -48,7 +48,7 @@ public: LLModalDialog( const std::string& title, S32 width, S32 height, BOOL modal = true ); /*virtual*/ ~LLModalDialog(); - /*virtual*/ void open(); /* Flawfinder: ignore */ + /*virtual*/ void openFloater(const LLSD& key = LLSD()); /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c0fe7ff32dc0945b03b8f5825832c63c874029a1 --- /dev/null +++ b/indra/llui/llmultifloater.cpp @@ -0,0 +1,510 @@ +/** + * @file llmultifloater.cpp + * @brief LLFloater that hosts other floaters + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +// Floating "windows" within the GL display, like the inventory floater, +// mini-map floater, etc. + +#include "linden_common.h" + +#include "llmultifloater.h" +#include "llresizehandle.h" + +// +// LLMultiFloater +// + +LLMultiFloater::LLMultiFloater(const LLFloater::Params& params) + : LLFloater(), + mTabContainer(NULL), + mTabPos(LLTabContainer::TOP), + mAutoResize(TRUE), + mOrigMinWidth(0), + mOrigMinHeight(0) +{ +} + +void LLMultiFloater::buildTabContainer() +{ + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + + LLTabContainer::Params p; + p.name(std::string("Preview Tabs")); + p.rect(LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - floater_header_size, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0)); + p.tab_position(mTabPos); + p.follows.flags(FOLLOWS_ALL); + p.commit_callback.function(boost::bind(&LLMultiFloater::onTabSelected, this)); + + mTabContainer = LLUICtrlFactory::create<LLTabContainer>(p); + addChild(mTabContainer); + + if (isResizable()) + { + mTabContainer->setRightTabBtnOffset(RESIZE_HANDLE_WIDTH); + } +} + +void LLMultiFloater::onOpen(const LLSD& key) +{ + if (mTabContainer->getTabCount() <= 0) + { + // for now, don't allow multifloaters + // without any child floaters + closeFloater(); + } +} + +void LLMultiFloater::onClose(bool app_quitting) +{ + if(closeAllFloaters() == TRUE) + { + LLFloater::onClose(app_quitting); + }//else not all tabs could be closed... +} + +void LLMultiFloater::draw() +{ + if (mTabContainer->getTabCount() == 0) + { + //RN: could this potentially crash in draw hierarchy? + closeFloater(); + } + else + { + for (S32 i = 0; i < mTabContainer->getTabCount(); i++) + { + LLFloater* floaterp = (LLFloater*)mTabContainer->getPanelByIndex(i); + if (floaterp->getShortTitle() != mTabContainer->getPanelTitle(i)) + { + mTabContainer->setPanelTitle(i, floaterp->getShortTitle()); + } + } + LLFloater::draw(); + } +} + +BOOL LLMultiFloater::closeAllFloaters() +{ + S32 tabToClose = 0; + S32 lastTabCount = mTabContainer->getTabCount(); + while (tabToClose < mTabContainer->getTabCount()) + { + LLFloater* first_floater = (LLFloater*)mTabContainer->getPanelByIndex(tabToClose); + first_floater->closeFloater(); + if(lastTabCount == mTabContainer->getTabCount()) + { + //Tab did not actually close, possibly due to a pending Save Confirmation dialog.. + //so try and close the next one in the list... + tabToClose++; + }else + { + //Tab closed ok. + lastTabCount = mTabContainer->getTabCount(); + } + } + if( mTabContainer->getTabCount() != 0 ) + return FALSE; // Couldn't close all the tabs (pending save dialog?) so return FALSE. + return TRUE; //else all tabs were successfully closed... +} + +void LLMultiFloater::growToFit(S32 content_width, S32 content_height) +{ + static LLUICachedControl<S32> tabcntr_close_btn_size ("UITabCntrCloseBtnSize", 0); + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + S32 tabcntr_header_height = LLPANEL_BORDER_WIDTH + tabcntr_close_btn_size; + S32 new_width = llmax(getRect().getWidth(), content_width + LLPANEL_BORDER_WIDTH * 2); + S32 new_height = llmax(getRect().getHeight(), content_height + floater_header_size + tabcntr_header_height); + + if (isMinimized()) + { + LLRect newrect; + newrect.setLeftTopAndSize(getExpandedRect().mLeft, getExpandedRect().mTop, new_width, new_height); + setExpandedRect(newrect); + } + else + { + S32 old_height = getRect().getHeight(); + reshape(new_width, new_height); + // keep top left corner in same position + translate(0, old_height - new_height); + } +} + +/** + void addFloater(LLFloater* floaterp, BOOL select_added_floater) + + Adds the LLFloater pointed to by floaterp to this. + If floaterp is already hosted by this, then it is re-added to get + new titles, etc. + If select_added_floater is true, the LLFloater pointed to by floaterp will + become the selected tab in this + + Affects: mTabContainer, floaterp +**/ +void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point) +{ + if (!floaterp) + { + return; + } + + if (!mTabContainer) + { + llerrs << "Tab Container used without having been initialized." << llendl; + return; + } + + if (floaterp->getHost() == this) + { + // already hosted by me, remove + // do this so we get updated title, etc. + mFloaterDataMap.erase(floaterp->getHandle()); + mTabContainer->removeTabPanel(floaterp); + } + else if (floaterp->getHost()) + { + // floaterp is hosted by somebody else and + // this is adding it, so remove it from it's old host + floaterp->getHost()->removeFloater(floaterp); + } + else if (floaterp->getParent() == gFloaterView) + { + // rehost preview floater as child panel + gFloaterView->removeChild(floaterp); + } + + // store original configuration + LLFloaterData floater_data; + floater_data.mWidth = floaterp->getRect().getWidth(); + floater_data.mHeight = floaterp->getRect().getHeight(); + floater_data.mCanMinimize = floaterp->isMinimizeable(); + floater_data.mCanResize = floaterp->isResizable(); + + // remove minimize and close buttons + floaterp->setCanMinimize(FALSE); + floaterp->setCanResize(FALSE); + floaterp->setCanDrag(FALSE); + floaterp->storeRectControl(); + // avoid double rendering of floater background (makes it more opaque) + floaterp->setBackgroundVisible(FALSE); + + if (mAutoResize) + { + growToFit(floater_data.mWidth, floater_data.mHeight); + } + + //add the panel, add it to proper maps + mTabContainer->addTabPanel( + LLTabContainer::TabPanelParams() + .panel(floaterp) + .label(floaterp->getShortTitle()) + .insert_at(insertion_point)); + mFloaterDataMap[floaterp->getHandle()] = floater_data; + + updateResizeLimits(); + + if ( select_added_floater ) + { + mTabContainer->selectTabPanel(floaterp); + } + else + { + // reassert visible tab (hiding new floater if necessary) + mTabContainer->selectTab(mTabContainer->getCurrentPanelIndex()); + } + + floaterp->setHost(this); + if (isMinimized()) + { + floaterp->setVisible(FALSE); + } +} + +/** + BOOL selectFloater(LLFloater* floaterp) + + If the LLFloater pointed to by floaterp is hosted by this, + then its tab is selected and returns true. Otherwise returns false. + + Affects: mTabContainer +**/ +BOOL LLMultiFloater::selectFloater(LLFloater* floaterp) +{ + return mTabContainer->selectTabPanel(floaterp); +} + +// virtual +void LLMultiFloater::selectNextFloater() +{ + mTabContainer->selectNextTab(); +} + +// virtual +void LLMultiFloater::selectPrevFloater() +{ + mTabContainer->selectPrevTab(); +} + +void LLMultiFloater::showFloater(LLFloater* floaterp, LLTabContainer::eInsertionPoint insertion_point) +{ + // we won't select a panel that already is selected + // it is hard to do this internally to tab container + // as tab selection is handled via index and the tab at a given + // index might have changed + if (floaterp != mTabContainer->getCurrentPanel() && + !mTabContainer->selectTabPanel(floaterp)) + { + addFloater(floaterp, TRUE, insertion_point); + } +} + +void LLMultiFloater::removeFloater(LLFloater* floaterp) +{ + if ( floaterp->getHost() != this ) + return; + + floater_data_map_t::iterator found_data_it = mFloaterDataMap.find(floaterp->getHandle()); + if (found_data_it != mFloaterDataMap.end()) + { + LLFloaterData& floater_data = found_data_it->second; + floaterp->setCanMinimize(floater_data.mCanMinimize); + if (!floater_data.mCanResize) + { + // restore original size + floaterp->reshape(floater_data.mWidth, floater_data.mHeight); + } + floaterp->setCanResize(floater_data.mCanResize); + mFloaterDataMap.erase(found_data_it); + } + mTabContainer->removeTabPanel(floaterp); + floaterp->setBackgroundVisible(TRUE); + floaterp->setCanDrag(TRUE); + floaterp->setHost(NULL); + floaterp->applyRectControl(); + + updateResizeLimits(); + + tabOpen((LLFloater*)mTabContainer->getCurrentPanel(), false); +} + +void LLMultiFloater::tabOpen(LLFloater* opened_floater, bool from_click) +{ + // default implementation does nothing +} + +void LLMultiFloater::tabClose() +{ + if (mTabContainer->getTabCount() == 0) + { + // no more children, close myself + closeFloater(); + } +} + +void LLMultiFloater::setVisible(BOOL visible) +{ + // *FIX: shouldn't have to do this, fix adding to minimized multifloater + LLFloater::setVisible(visible); + + if (mTabContainer) + { + LLPanel* cur_floaterp = mTabContainer->getCurrentPanel(); + + if (cur_floaterp) + { + cur_floaterp->setVisible(visible); + } + + // if no tab selected, and we're being shown, + // select last tab to be added + if (visible && !cur_floaterp) + { + mTabContainer->selectLastTab(); + } + } +} + +BOOL LLMultiFloater::handleKeyHere(KEY key, MASK mask) +{ + if (key == 'W' && mask == MASK_CONTROL) + { + LLFloater* floater = getActiveFloater(); + // is user closeable and is system closeable + if (floater && floater->canClose() && floater->isCloseable()) + { + floater->closeFloater(); + } + return TRUE; + } + + return LLFloater::handleKeyHere(key, mask); +} + +bool LLMultiFloater::addChild(LLView* child, S32 tab_group) +{ + LLTabContainer* tab_container = dynamic_cast<LLTabContainer*>(child); + if (tab_container) + { + // store pointer to tab container + setTabContainer(tab_container); + } + + // then go ahead and add child as usual + return LLFloater::addChild(child, tab_group); +} + +LLFloater* LLMultiFloater::getActiveFloater() +{ + return (LLFloater*)mTabContainer->getCurrentPanel(); +} + +S32 LLMultiFloater::getFloaterCount() +{ + return mTabContainer->getTabCount(); +} + +/** + BOOL isFloaterFlashing(LLFloater* floaterp) + + Returns true if the LLFloater pointed to by floaterp + is currently in a flashing state and is hosted by this. + False otherwise. + + Requires: floaterp != NULL +**/ +BOOL LLMultiFloater::isFloaterFlashing(LLFloater* floaterp) +{ + if ( floaterp && floaterp->getHost() == this ) + return mTabContainer->getTabPanelFlashing(floaterp); + + return FALSE; +} + +/** + BOOL setFloaterFlashing(LLFloater* floaterp, BOOL flashing) + + Sets the current flashing state of the LLFloater pointed + to by floaterp to be the BOOL flashing if the LLFloater pointed + to by floaterp is hosted by this. + + Requires: floaterp != NULL +**/ +void LLMultiFloater::setFloaterFlashing(LLFloater* floaterp, BOOL flashing) +{ + if ( floaterp && floaterp->getHost() == this ) + mTabContainer->setTabPanelFlashing(floaterp, flashing); +} + +void LLMultiFloater::onTabSelected() +{ + LLFloater* floaterp = dynamic_cast<LLFloater*>(mTabContainer->getCurrentPanel()); + if (floaterp) + { + tabOpen(floaterp, true); + } +} + +void LLMultiFloater::setCanResize(BOOL can_resize) +{ + LLFloater::setCanResize(can_resize); + if (isResizable() && mTabContainer->getTabPosition() == LLTabContainer::BOTTOM) + { + mTabContainer->setRightTabBtnOffset(RESIZE_HANDLE_WIDTH); + } + else + { + mTabContainer->setRightTabBtnOffset(0); + } +} + +BOOL LLMultiFloater::postBuild() +{ + // remember any original xml minimum size + getResizeLimits(&mOrigMinWidth, &mOrigMinHeight); + + if (mTabContainer) + { + return TRUE; + } + + requires<LLTabContainer>("Preview Tabs"); + if (checkRequirements()) + { + mTabContainer = getChild<LLTabContainer>("Preview Tabs"); + return TRUE; + } + + return FALSE; +} + +void LLMultiFloater::updateResizeLimits() +{ + static LLUICachedControl<S32> tabcntr_close_btn_size ("UITabCntrCloseBtnSize", 0); + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + S32 tabcntr_header_height = LLPANEL_BORDER_WIDTH + tabcntr_close_btn_size; + // initialize minimum size constraint to the original xml values. + S32 new_min_width = mOrigMinWidth; + S32 new_min_height = mOrigMinHeight; + // possibly increase minimum size constraint due to children's minimums. + for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx) + { + LLFloater* floaterp = (LLFloater*)mTabContainer->getPanelByIndex(tab_idx); + if (floaterp) + { + new_min_width = llmax(new_min_width, floaterp->getMinWidth() + LLPANEL_BORDER_WIDTH * 2); + new_min_height = llmax(new_min_height, floaterp->getMinHeight() + floater_header_size + tabcntr_header_height); + } + } + setResizeLimits(new_min_width, new_min_height); + + S32 cur_height = getRect().getHeight(); + S32 new_width = llmax(getRect().getWidth(), new_min_width); + S32 new_height = llmax(getRect().getHeight(), new_min_height); + + if (isMinimized()) + { + const LLRect& expanded = getExpandedRect(); + LLRect newrect; + newrect.setLeftTopAndSize(expanded.mLeft, expanded.mTop, llmax(expanded.getWidth(), new_width), llmax(expanded.getHeight(), new_height)); + setExpandedRect(newrect); + } + else + { + reshape(new_width, new_height); + + // make sure upper left corner doesn't move + translate(0, cur_height - getRect().getHeight()); + + // make sure this window is visible on screen when it has been modified + // (tab added, etc) + gFloaterView->adjustToFitScreen(this, TRUE); + } +} diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h new file mode 100644 index 0000000000000000000000000000000000000000..ea8a9841e39a0e60a7b0ac102de6abf0b0882bda --- /dev/null +++ b/indra/llui/llmultifloater.h @@ -0,0 +1,107 @@ +/** + * @file llmultifloater.h + * @brief LLFloater that hosts other floaters + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +// Floating "windows" within the GL display, like the inventory floater, +// mini-map floater, etc. + + +#ifndef LL_MULTI_FLOATER_H +#define LL_MULTI_FLOATER_H + +#include "llfloater.h" +#include "lltabcontainer.h" // for LLTabContainer::eInsertionPoint + +// https://wiki.lindenlab.com/mediawiki/index.php?title=LLMultiFloater&oldid=81376 +class LLMultiFloater : public LLFloater +{ +public: + LLMultiFloater(const LLFloater::Params& params = LLFloater::Params()); + virtual ~LLMultiFloater() {}; + + void buildTabContainer(); + + virtual BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void draw(); + /*virtual*/ void setVisible(BOOL visible); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0); + + virtual void setCanResize(BOOL can_resize); + virtual void growToFit(S32 content_width, S32 content_height); + virtual void addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); + + virtual void showFloater(LLFloater* floaterp, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); + virtual void removeFloater(LLFloater* floaterp); + + virtual void tabOpen(LLFloater* opened_floater, bool from_click); + virtual void tabClose(); + + virtual BOOL selectFloater(LLFloater* floaterp); + virtual void selectNextFloater(); + virtual void selectPrevFloater(); + + virtual LLFloater* getActiveFloater(); + virtual BOOL isFloaterFlashing(LLFloater* floaterp); + virtual S32 getFloaterCount(); + + virtual void setFloaterFlashing(LLFloater* floaterp, BOOL flashing); + virtual BOOL closeAllFloaters(); //Returns FALSE if the floater could not be closed due to pending confirmation dialogs + void setTabContainer(LLTabContainer* tab_container) { if (!mTabContainer) mTabContainer = tab_container; } + void onTabSelected(); + + virtual void updateResizeLimits(); + +protected: + struct LLFloaterData + { + S32 mWidth; + S32 mHeight; + BOOL mCanMinimize; + BOOL mCanResize; + }; + + LLTabContainer* mTabContainer; + + typedef std::map<LLHandle<LLFloater>, LLFloaterData> floater_data_map_t; + floater_data_map_t mFloaterDataMap; + + LLTabContainer::TabPosition mTabPos; + BOOL mAutoResize; + S32 mOrigMinWidth, mOrigMinHeight; // logically const but initialized late +}; + +#endif // LL_MULTI_FLOATER_H + + + diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp index c1487be553921857878b1c0359c5cf3379b458a9..099a79278a658225d1b1e11f9b5e9add9a7692d3 100644 --- a/indra/llui/llmultislider.cpp +++ b/indra/llui/llmultislider.cpp @@ -41,64 +41,59 @@ #include "llkeyboard.h" // for the MASK constants #include "llcontrol.h" #include "llimagegl.h" +#include "lluictrlfactory.h" #include <sstream> -static LLRegisterWidget<LLMultiSlider> r("multi_slider_bar"); +static LLDefaultWidgetRegistry::Register<LLMultiSlider> r("multi_slider_bar"); -const S32 MULTI_THUMB_WIDTH = 8; -const S32 MULTI_TRACK_HEIGHT = 6; const F32 FLOAT_THRESHOLD = 0.00001f; -const S32 EXTRA_TRIANGLE_WIDTH = 2; -const S32 EXTRA_TRIANGLE_HEIGHT = -2; S32 LLMultiSlider::mNameCounter = 0; -LLMultiSlider::LLMultiSlider( - const std::string& name, - const LLRect& rect, - void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), - void* callback_userdata, - F32 initial_value, - F32 min_value, - F32 max_value, - F32 increment, - S32 max_sliders, - BOOL allow_overlap, - BOOL draw_track, - BOOL use_triangle, - const std::string& control_name) - : - LLUICtrl( name, rect, TRUE, on_commit_callback, callback_userdata, - FOLLOWS_LEFT | FOLLOWS_TOP), - - mInitialValue( initial_value ), - mMinValue( min_value ), - mMaxValue( max_value ), - mIncrement( increment ), - mMaxNumSliders(max_sliders), - mAllowOverlap(allow_overlap), - mDrawTrack(draw_track), - mUseTriangle(use_triangle), +LLMultiSlider::Params::Params() +: max_sliders("max_sliders", 1), + allow_overlap("allow_overlap", false), + draw_track("draw_track", true), + use_triangle("use_triangle", false), + track_color("track_color"), + thumb_disabled_color("thumb_disabled_color"), + thumb_outline_color("thumb_outline_color"), + thumb_center_color("thumb_center_color"), + thumb_center_selected_color("thumb_center_selected_color"), + triangle_color("triangle_color"), + mouse_down_callback("mouse_down_callback"), + mouse_up_callback("mouse_up_callback"), + thumb_width("thumb_width") +{ + name = "multi_slider_bar"; + mouse_opaque(true); + follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP); +} + +LLMultiSlider::LLMultiSlider(const LLMultiSlider::Params& p) +: LLF32UICtrl(p), mMouseOffset( 0 ), - mDragStartThumbRect( 0, getRect().getHeight(), MULTI_THUMB_WIDTH, 0 ), - mTrackColor( LLUI::sColorsGroup->getColor( "MultiSliderTrackColor" ) ), - mThumbOutlineColor( LLUI::sColorsGroup->getColor( "MultiSliderThumbOutlineColor" ) ), - mThumbCenterColor( LLUI::sColorsGroup->getColor( "MultiSliderThumbCenterColor" ) ), - mThumbCenterSelectedColor( LLUI::sColorsGroup->getColor( "MultiSliderThumbCenterSelectedColor" ) ), - mDisabledThumbColor(LLUI::sColorsGroup->getColor( "MultiSliderDisabledThumbColor" ) ), - mTriangleColor(LLUI::sColorsGroup->getColor( "MultiSliderTriangleColor" ) ), - mMouseDownCallback( NULL ), - mMouseUpCallback( NULL ) + mDragStartThumbRect( 0, getRect().getHeight(), p.thumb_width, 0 ), + mMaxNumSliders(p.max_sliders), + mAllowOverlap(p.allow_overlap), + mDrawTrack(p.draw_track), + mUseTriangle(p.use_triangle), + mTrackColor(p.track_color()), + mThumbOutlineColor(p.thumb_outline_color()), + mThumbCenterColor(p.thumb_center_color()), + mThumbCenterSelectedColor(p.thumb_center_selected_color()), + mDisabledThumbColor(p.thumb_disabled_color()), + mTriangleColor(p.triangle_color()), + mThumbWidth(p.thumb_width) { mValue.emptyMap(); mCurSlider = LLStringUtil::null; - - // properly handle setting the starting thumb rect - // do it this way to handle both the operating-on-settings - // and standalone ways of using this - setControlName(control_name, NULL); - setValue(getValue()); + + if (p.mouse_down_callback.isProvided()) + initCommitCallback(p.mouse_down_callback, mMouseDownSignal); + if (p.mouse_up_callback.isProvided()) + initCommitCallback(p.mouse_up_callback, mMouseUpSignal); } void LLMultiSlider::setSliderValue(const std::string& name, F32 value, BOOL from_event) @@ -152,12 +147,12 @@ void LLMultiSlider::setSliderValue(const std::string& name, F32 value, BOOL from F32 t = (newValue - mMinValue) / (mMaxValue - mMinValue); - S32 left_edge = MULTI_THUMB_WIDTH/2; - S32 right_edge = getRect().getWidth() - (MULTI_THUMB_WIDTH/2); + S32 left_edge = mThumbWidth/2; + S32 right_edge = getRect().getWidth() - (mThumbWidth/2); S32 x = left_edge + S32( t * (right_edge - left_edge) ); - mThumbRects[name].mLeft = x - (MULTI_THUMB_WIDTH/2); - mThumbRects[name].mRight = x + (MULTI_THUMB_WIDTH/2); + mThumbRects[name].mLeft = x - (mThumbWidth/2); + mThumbRects[name].mRight = x + (mThumbWidth/2); } void LLMultiSlider::setValue(const LLSD& value) @@ -211,7 +206,7 @@ const std::string& LLMultiSlider::addSlider(F32 val) } // add a new thumb rect - mThumbRects[newName.str()] = LLRect( 0, getRect().getHeight(), MULTI_THUMB_WIDTH, 0 ); + mThumbRects[newName.str()] = LLRect( 0, getRect().getHeight(), mThumbWidth, 0 ); // add the value and set the current slider to this one mValue.insert(newName.str(), initVal); @@ -295,15 +290,15 @@ void LLMultiSlider::clear() deleteCurSlider(); } - LLUICtrl::clear(); + LLF32UICtrl::clear(); } BOOL LLMultiSlider::handleHover(S32 x, S32 y, MASK mask) { if( gFocusMgr.getMouseCapture() == this ) { - S32 left_edge = MULTI_THUMB_WIDTH/2; - S32 right_edge = getRect().getWidth() - (MULTI_THUMB_WIDTH/2); + S32 left_edge = mThumbWidth/2; + S32 right_edge = getRect().getWidth() - (mThumbWidth/2); x += mMouseOffset; x = llclamp( x, left_edge, right_edge ); @@ -331,10 +326,8 @@ BOOL LLMultiSlider::handleMouseUp(S32 x, S32 y, MASK mask) { gFocusMgr.setMouseCapture( NULL ); - if( mMouseUpCallback ) - { - mMouseUpCallback( this, mCallbackUserData ); - } + mMouseUpSignal( this, LLSD() ); + handled = TRUE; make_ui_sound("UISndClickRelease"); } @@ -353,10 +346,7 @@ BOOL LLMultiSlider::handleMouseDown(S32 x, S32 y, MASK mask) { setFocus(TRUE); } - if( mMouseDownCallback ) - { - mMouseDownCallback( this, mCallbackUserData ); - } + mMouseDownSignal( this, LLSD() ); if (MASK_CONTROL & mask) // if CTRL is modifying { @@ -379,7 +369,7 @@ BOOL LLMultiSlider::handleMouseDown(S32 x, S32 y, MASK mask) // Find the offset of the actual mouse location from the center of the thumb. if (mThumbRects[mCurSlider].pointInRect(x,y)) { - mMouseOffset = (mThumbRects[mCurSlider].mLeft + MULTI_THUMB_WIDTH/2) - x; + mMouseOffset = (mThumbRects[mCurSlider].mLeft + mThumbWidth/2) - x; } else { @@ -424,6 +414,8 @@ BOOL LLMultiSlider::handleKeyHere(KEY key, MASK mask) void LLMultiSlider::draw() { + static LLUICachedControl<S32> extra_triangle_height ("UIExtraTriangleHeight", 0); + static LLUICachedControl<S32> extra_triangle_width ("UIExtraTriangleWidth", 0); LLColor4 curThumbColor; std::map<std::string, LLRect>::iterator mIt; @@ -439,16 +431,17 @@ void LLMultiSlider::draw() F32 opacity = getEnabled() ? 1.f : 0.3f; // Track - LLUIImagePtr thumb_imagep = LLUI::sImageProvider->getUIImage("rounded_square.tga"); + LLUIImagePtr thumb_imagep = LLUI::getUIImage("rounded_square.tga"); - S32 height_offset = (getRect().getHeight() - MULTI_TRACK_HEIGHT) / 2; + static LLUICachedControl<S32> multi_track_height ("UIMultiTrackHeight", 0); + S32 height_offset = (getRect().getHeight() - multi_track_height) / 2; LLRect track_rect(0, getRect().getHeight() - height_offset, getRect().getWidth(), height_offset ); if(mDrawTrack) { track_rect.stretch(-1); - thumb_imagep->draw(track_rect, mTrackColor % opacity); + thumb_imagep->draw(track_rect, mTrackColor.get() % opacity); } // if we're supposed to use a drawn triangle @@ -458,13 +451,13 @@ void LLMultiSlider::draw() for(mIt = mThumbRects.begin(); mIt != mThumbRects.end(); mIt++) { gl_triangle_2d( - mIt->second.mLeft - EXTRA_TRIANGLE_WIDTH, - mIt->second.mTop + EXTRA_TRIANGLE_HEIGHT, - mIt->second.mRight + EXTRA_TRIANGLE_WIDTH, - mIt->second.mTop + EXTRA_TRIANGLE_HEIGHT, + mIt->second.mLeft - extra_triangle_width, + mIt->second.mTop + extra_triangle_height, + mIt->second.mRight + extra_triangle_width, + mIt->second.mTop + extra_triangle_height, mIt->second.mLeft + mIt->second.getWidth() / 2, - mIt->second.mBottom - EXTRA_TRIANGLE_HEIGHT, - mTriangleColor, TRUE); + mIt->second.mBottom - extra_triangle_height, + mTriangleColor.get(), TRUE); } } else if (!thumb_imagep) @@ -474,7 +467,7 @@ void LLMultiSlider::draw() for(mIt = mThumbRects.begin(); mIt != mThumbRects.end(); mIt++) { // choose the color - curThumbColor = mThumbCenterColor; + curThumbColor = mThumbCenterColor.get(); if(mIt->first == mCurSlider) { curSldrIt = mIt; @@ -488,19 +481,19 @@ void LLMultiSlider::draw() // now draw the current slider if(curSldrIt != mThumbRects.end()) { - gl_rect_2d(curSldrIt->second, mThumbCenterSelectedColor, TRUE); + gl_rect_2d(curSldrIt->second, mThumbCenterSelectedColor.get(), TRUE); } // and draw the drag start if (gFocusMgr.getMouseCapture() == this) { - gl_rect_2d(mDragStartThumbRect, mThumbCenterColor % opacity, FALSE); + gl_rect_2d(mDragStartThumbRect, mThumbCenterColor.get() % opacity, FALSE); } } else if( gFocusMgr.getMouseCapture() == this ) { // draw drag start - thumb_imagep->drawSolid(mDragStartThumbRect, mThumbCenterColor % 0.3f); + thumb_imagep->drawSolid(mDragStartThumbRect, mThumbCenterColor.get() % 0.3f); // draw the highlight if (hasFocus()) @@ -513,7 +506,7 @@ void LLMultiSlider::draw() for(mIt = mThumbRects.begin(); mIt != mThumbRects.end(); mIt++) { // choose the color - curThumbColor = mThumbCenterColor; + curThumbColor = mThumbCenterColor.get(); if(mIt->first == mCurSlider) { // don't draw now, draw last @@ -528,7 +521,7 @@ void LLMultiSlider::draw() // draw cur slider last if(curSldrIt != mThumbRects.end()) { - thumb_imagep->drawSolid(curSldrIt->second, mThumbCenterSelectedColor); + thumb_imagep->drawSolid(curSldrIt->second, mThumbCenterSelectedColor.get()); } } @@ -546,7 +539,7 @@ void LLMultiSlider::draw() { // choose the color - curThumbColor = mThumbCenterColor; + curThumbColor = mThumbCenterColor.get(); if(mIt->first == mCurSlider) { curSldrIt = mIt; @@ -559,74 +552,9 @@ void LLMultiSlider::draw() if(curSldrIt != mThumbRects.end()) { - thumb_imagep->drawSolid(curSldrIt->second, mThumbCenterSelectedColor % opacity); + thumb_imagep->drawSolid(curSldrIt->second, mThumbCenterSelectedColor.get() % opacity); } } - LLUICtrl::draw(); -} - -// virtual -LLXMLNodePtr LLMultiSlider::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - node->createChild("initial_val", TRUE)->setFloatValue(getInitialValue()); - node->createChild("min_val", TRUE)->setFloatValue(getMinValue()); - node->createChild("max_val", TRUE)->setFloatValue(getMaxValue()); - node->createChild("increment", TRUE)->setFloatValue(getIncrement()); - - return node; -} - - -//static -LLView* LLMultiSlider::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("multi_slider_bar"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - F32 initial_value = 0.f; - node->getAttributeF32("initial_val", initial_value); - - F32 min_value = 0.f; - node->getAttributeF32("min_val", min_value); - - F32 max_value = 1.f; - node->getAttributeF32("max_val", max_value); - - F32 increment = 0.1f; - node->getAttributeF32("increment", increment); - - S32 max_sliders = 1; - node->getAttributeS32("max_sliders", max_sliders); - - BOOL allow_overlap = FALSE; - node->getAttributeBOOL("allow_overlap", allow_overlap); - - BOOL draw_track = TRUE; - node->getAttributeBOOL("draw_track", draw_track); - - BOOL use_triangle = FALSE; - node->getAttributeBOOL("use_triangle", use_triangle); - - LLMultiSlider* multiSlider = new LLMultiSlider(name, - rect, - NULL, - NULL, - initial_value, - min_value, - max_value, - increment, - max_sliders, - allow_overlap, - draw_track, - use_triangle); - - multiSlider->initFromXML(node, parent); - - return multiSlider; + LLF32UICtrl::draw(); } diff --git a/indra/llui/llmultislider.h b/indra/llui/llmultislider.h index cdbdb597f9b7b6f3ced68654b91a639557647f46..9c01b528a7778fb50426ff29caf07574683e0245 100644 --- a/indra/llui/llmultislider.h +++ b/indra/llui/llmultislider.h @@ -33,32 +33,40 @@ #ifndef LL_MULTI_SLIDER_H #define LL_MULTI_SLIDER_H -#include "lluictrl.h" +#include "llf32uictrl.h" #include "v4color.h" class LLUICtrlFactory; -class LLMultiSlider : public LLUICtrl +class LLMultiSlider : public LLF32UICtrl { public: - LLMultiSlider( - const std::string& name, - const LLRect& rect, - void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), - void* callback_userdata, - F32 initial_value, - F32 min_value, - F32 max_value, - F32 increment, - S32 max_sliders, - BOOL allow_overlap, - BOOL draw_track, - BOOL use_triangle, - const std::string& control_name = LLStringUtil::null ); - - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); + struct Params : public LLInitParam::Block<Params, LLF32UICtrl::Params> + { + Optional<S32> max_sliders; + Optional<bool> allow_overlap, + draw_track, + use_triangle; + + Optional<LLUIColor> track_color, + thumb_disabled_color, + thumb_outline_color, + thumb_center_color, + thumb_center_selected_color, + triangle_color; + + Optional<CommitCallbackParam> mouse_down_callback, + mouse_up_callback; + Optional<S32> thumb_width; + + Params(); + }; + +protected: + LLMultiSlider(const Params&); + friend class LLUICtrlFactory; +public: void setSliderValue(const std::string& name, F32 value, BOOL from_event = FALSE); F32 getSliderValue(const std::string& name) const; @@ -67,41 +75,27 @@ public: void setCurSlider(const std::string& name); void setCurSliderValue(F32 val, BOOL from_event = false) { setSliderValue(mCurSlider, val, from_event); } - virtual void setValue(const LLSD& value); - virtual LLSD getValue() const { return mValue; } - - virtual void setMinValue(LLSD min_value) { setMinValue((F32)min_value.asReal()); } - virtual void setMaxValue(LLSD max_value) { setMaxValue((F32)max_value.asReal()); } + /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ LLSD getValue() const { return mValue; } - F32 getInitialValue() const { return mInitialValue; } - F32 getMinValue() const { return mMinValue; } - F32 getMaxValue() const { return mMaxValue; } - F32 getIncrement() const { return mIncrement; } - void setMinValue(F32 min_value) { mMinValue = min_value; } - void setMaxValue(F32 max_value) { mMaxValue = max_value; } - void setIncrement(F32 increment) { mIncrement = increment; } - void setMouseDownCallback( void (*cb)(LLUICtrl* ctrl, void* userdata) ) { mMouseDownCallback = cb; } - void setMouseUpCallback( void (*cb)(LLUICtrl* ctrl, void* userdata) ) { mMouseUpCallback = cb; } + boost::signals::connection setMouseDownCallback( const commit_signal_t::slot_type& cb ) { return mMouseDownSignal.connect(cb); } + boost::signals::connection setMouseUpCallback( const commit_signal_t::slot_type& cb ) { return mMouseUpSignal.connect(cb); } - bool findUnusedValue(F32& initVal); + bool findUnusedValue(F32& initVal); const std::string& addSlider(); const std::string& addSlider(F32 val); void deleteSlider(const std::string& name); void deleteCurSlider() { deleteSlider(mCurSlider); } void clear(); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual void draw(); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ void draw(); protected: LLSD mValue; - F32 mInitialValue; - F32 mMinValue; - F32 mMaxValue; - F32 mIncrement; std::string mCurSlider; static S32 mNameCounter; @@ -112,17 +106,18 @@ protected: S32 mMouseOffset; LLRect mDragStartThumbRect; + S32 mThumbWidth; std::map<std::string, LLRect> mThumbRects; - LLColor4 mTrackColor; - LLColor4 mThumbOutlineColor; - LLColor4 mThumbCenterColor; - LLColor4 mThumbCenterSelectedColor; - LLColor4 mDisabledThumbColor; - LLColor4 mTriangleColor; + LLUIColor mTrackColor; + LLUIColor mThumbOutlineColor; + LLUIColor mThumbCenterColor; + LLUIColor mThumbCenterSelectedColor; + LLUIColor mDisabledThumbColor; + LLUIColor mTriangleColor; - void (*mMouseDownCallback)(LLUICtrl* ctrl, void* userdata); - void (*mMouseUpCallback)(LLUICtrl* ctrl, void* userdata); + commit_signal_t mMouseDownSignal; + commit_signal_t mMouseUpSignal; }; #endif // LL_LLSLIDER_H diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp index 8bcf9f9b764bd071eb8137b1bd2458c081884e7a..4bbfc639762acd61fb009e7c7f2289146aaa299b 100644 --- a/indra/llui/llmultisliderctrl.cpp +++ b/indra/llui/llmultisliderctrl.cpp @@ -50,90 +50,100 @@ #include "llcontrol.h" #include "llfocusmgr.h" #include "llresmgr.h" +#include "lluictrlfactory.h" -static LLRegisterWidget<LLMultiSliderCtrl> r("multi_slider"); +static LLDefaultWidgetRegistry::Register<LLMultiSliderCtrl> r("multi_slider"); const U32 MAX_STRING_LENGTH = 10; - +LLMultiSliderCtrl::Params::Params() +: text_width("text_width"), + label_width("label_width"), + show_text("show_text", true), + can_edit_text("can_edit_text", false), + max_sliders("max_sliders", 1), + allow_overlap("allow_overlap", false), + draw_track("draw_track", true), + use_triangle("use_triangle", false), + decimal_digits("decimal_digits", 3), + text_color("text_color"), + text_disabled_color("text_disabled_color"), + mouse_down_callback("mouse_down_callback"), + mouse_up_callback("mouse_up_callback") +{ + mouse_opaque = true; +} -LLMultiSliderCtrl::LLMultiSliderCtrl(const std::string& name, const LLRect& rect, - const std::string& label, - const LLFontGL* font, - S32 label_width, - S32 text_left, - BOOL show_text, - BOOL can_edit_text, - void (*commit_callback)(LLUICtrl*, void*), - void* callback_user_data, - F32 initial_value, F32 min_value, F32 max_value, F32 increment, - S32 max_sliders, BOOL allow_overlap, - BOOL draw_track, - BOOL use_triangle, - const std::string& control_which) - : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data ), - mFont(font), - mShowText( show_text ), - mCanEditText( can_edit_text ), - mPrecision( 3 ), - mLabelBox( NULL ), - mLabelWidth( label_width ), - - mEditor( NULL ), - mTextBox( NULL ), - mTextEnabledColor( LLUI::sColorsGroup->getColor( "LabelTextColor" ) ), - mTextDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ), - mSliderMouseUpCallback( NULL ), - mSliderMouseDownCallback( NULL ) +LLMultiSliderCtrl::LLMultiSliderCtrl(const LLMultiSliderCtrl::Params& p) +: LLF32UICtrl(p), + mLabelBox( NULL ), + mEditor( NULL ), + mTextBox( NULL ), + mTextEnabledColor(p.text_color()), + mTextDisabledColor(p.text_disabled_color()) { + static LLUICachedControl<S32> multi_sliderctrl_spacing ("UIMultiSliderctrlSpacing", 0); + S32 top = getRect().getHeight(); S32 bottom = 0; S32 left = 0; + S32 label_width = p.label_width; + S32 text_width = p.text_width; + // Label - if( !label.empty() ) + if( !p.label().empty() ) { - if (label_width == 0) + if (p.label_width == 0) { - label_width = font->getWidth(label); + label_width = p.font()->getWidth(p.label); } LLRect label_rect( left, top, label_width, bottom ); - mLabelBox = new LLTextBox( std::string("MultiSliderCtrl Label"), label_rect, label, font ); + LLTextBox::Params params; + params.name("MultiSliderCtrl Label"); + params.rect(label_rect); + params.text(p.label); + params.font(p.font); + mLabelBox = LLUICtrlFactory::create<LLTextBox> (params); addChild(mLabelBox); } S32 slider_right = getRect().getWidth(); - if( show_text ) - { - slider_right = text_left - MULTI_SLIDERCTRL_SPACING; - } - S32 slider_left = label_width ? label_width + MULTI_SLIDERCTRL_SPACING : 0; - LLRect slider_rect( slider_left, top, slider_right, bottom ); - mMultiSlider = new LLMultiSlider( - std::string("multi_slider"), - slider_rect, - LLMultiSliderCtrl::onSliderCommit, this, - initial_value, min_value, max_value, increment, - max_sliders, allow_overlap, draw_track, - use_triangle, - control_which ); - addChild( mMultiSlider ); - mCurValue = mMultiSlider->getCurSliderValue(); - - if( show_text ) + if (p.show_text) { + if (!p.text_width.isProvided()) + { + text_width = 0; + // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) + if ( p.max_value() ) + text_width = p.font()->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( p.max_value ) ) + p.decimal_digits + 1 ); + + if ( p.increment < 1.0f ) + text_width += p.font()->getWidth(std::string(".")); // (mostly) take account of decimal point in value + + if ( p.min_value < 0.0f || p.max_value < 0.0f ) + text_width += p.font()->getWidth(std::string("-")); // (mostly) take account of minus sign + + // padding to make things look nicer + text_width += 8; + } + S32 text_left = getRect().getWidth() - text_width; + + slider_right = text_left - multi_sliderctrl_spacing; + LLRect text_rect( text_left, top, getRect().getWidth(), bottom ); - if( can_edit_text ) + if( p.can_edit_text ) { - mEditor = new LLLineEditor( std::string("MultiSliderCtrl Editor"), text_rect, - LLStringUtil::null, font, - MAX_STRING_LENGTH, - &LLMultiSliderCtrl::onEditorCommit, NULL, NULL, this, - &LLLineEditor::prevalidateFloat ); - mEditor->setFollowsLeft(); - mEditor->setFollowsBottom(); + LLLineEditor::Params params; + params.name("MultiSliderCtrl Editor"); + params.rect(text_rect); + params.font(p.font); + params.max_length_bytes(MAX_STRING_LENGTH); + params.commit_callback.function(LLMultiSliderCtrl::onEditorCommit); + params.prevalidate_callback(&LLLineEditor::prevalidateFloat); + params.follows.flags(FOLLOWS_LEFT | FOLLOWS_BOTTOM); + mEditor = LLUICtrlFactory::create<LLLineEditor> (params); mEditor->setFocusReceivedCallback( &LLMultiSliderCtrl::onEditorGainFocus ); - mEditor->setIgnoreTab(TRUE); // don't do this, as selecting the entire text is single clicking in some cases // and double clicking in others //mEditor->setSelectAllonFocusReceived(TRUE); @@ -141,13 +151,37 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const std::string& name, const LLRect& rect } else { - mTextBox = new LLTextBox( std::string("MultiSliderCtrl Text"), text_rect, LLStringUtil::null, font); - mTextBox->setFollowsLeft(); - mTextBox->setFollowsBottom(); + LLTextBox::Params params; + params.name("MultiSliderCtrl Text"); + params.rect(text_rect); + params.font(p.font); + params.follows.flags(FOLLOWS_LEFT | FOLLOWS_BOTTOM); + mTextBox = LLUICtrlFactory::create<LLTextBox> (params); addChild(mTextBox); } } + S32 slider_left = label_width ? label_width + multi_sliderctrl_spacing : 0; + LLRect slider_rect( slider_left, top, slider_right, bottom ); + LLMultiSlider::Params params; + params.rect(slider_rect); + params.commit_callback.function( LLMultiSliderCtrl::onSliderCommit ); + params.mouse_down_callback( p.mouse_down_callback ); + params.mouse_up_callback( p.mouse_up_callback ); + params.initial_value(p.initial_value()); + params.min_value(p.min_value); + params.max_value(p.max_value); + params.increment(p.increment); + params.max_sliders(p.max_sliders); + params.allow_overlap(p.allow_overlap); + params.draw_track(p.draw_track); + params.use_triangle(p.use_triangle); + params.control_name(p.control_name); + mMultiSlider = LLUICtrlFactory::create<LLMultiSlider> (params); + addChild( mMultiSlider ); + mCurValue = mMultiSlider->getCurSliderValue(); + + updateText(); } @@ -203,7 +237,8 @@ BOOL LLMultiSliderCtrl::setLabelArg( const std::string& key, const LLStringExpli S32 delta = rect.mRight - prev_right; rect = mMultiSlider->getRect(); S32 left = rect.mLeft + delta; - left = llclamp(left, 0, rect.mRight-MULTI_SLIDERCTRL_SPACING); + static LLUICachedControl<S32> multi_slider_ctrl_spacing ("UIMultiSliderctrlSpacing", 0); + left = llclamp(left, 0, rect.mRight - multi_slider_ctrl_spacing); rect.mLeft = left; mMultiSlider->setRect(rect); } @@ -294,11 +329,12 @@ void LLMultiSliderCtrl::updateText() } // static -void LLMultiSliderCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) +void LLMultiSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata) { - LLMultiSliderCtrl* self = (LLMultiSliderCtrl*) userdata; - llassert( caller == self->mEditor ); - + LLMultiSliderCtrl* self = dynamic_cast<LLMultiSliderCtrl*>(ctrl); + if (!ctrl) + return; + BOOL success = FALSE; F32 val = self->mCurValue; F32 saved_val = self->mCurValue; @@ -310,17 +346,9 @@ void LLMultiSliderCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) val = (F32) atof( text.c_str() ); if( self->mMultiSlider->getMinValue() <= val && val <= self->mMultiSlider->getMaxValue() ) { - if( self->mValidateCallback ) - { - self->setCurSliderValue( val ); // set the value temporarily so that the callback can retrieve it. - if( self->mValidateCallback( self, self->mCallbackUserData ) ) - { - success = TRUE; - } - } - else + self->setCurSliderValue( val ); // set the value temporarily so that the callback can retrieve it. + if( self->mValidateSignal( self, val ) ) { - self->setCurSliderValue( val ); success = TRUE; } } @@ -342,26 +370,19 @@ void LLMultiSliderCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) } // static -void LLMultiSliderCtrl::onSliderCommit( LLUICtrl* caller, void *userdata ) +void LLMultiSliderCtrl::onSliderCommit(LLUICtrl* ctrl, const LLSD& userdata) { - LLMultiSliderCtrl* self = (LLMultiSliderCtrl*) userdata; - //llassert( caller == self->mSlider ); - + LLMultiSliderCtrl* self = dynamic_cast<LLMultiSliderCtrl*>(ctrl); + if (!self) + return; + BOOL success = FALSE; F32 saved_val = self->mCurValue; F32 new_val = self->mMultiSlider->getCurSliderValue(); - if( self->mValidateCallback ) + self->mCurValue = new_val; // set the value temporarily so that the callback can retrieve it. + if( self->mValidateSignal( self, new_val ) ) { - self->mCurValue = new_val; // set the value temporarily so that the callback can retrieve it. - if( self->mValidateCallback( self, self->mCallbackUserData ) ) - { - success = TRUE; - } - } - else - { - self->mCurValue = new_val; success = TRUE; } @@ -382,11 +403,11 @@ void LLMultiSliderCtrl::onSliderCommit( LLUICtrl* caller, void *userdata ) void LLMultiSliderCtrl::setEnabled(BOOL b) { - LLUICtrl::setEnabled( b ); + LLF32UICtrl::setEnabled( b ); if( mLabelBox ) { - mLabelBox->setColor( b ? mTextEnabledColor : mTextDisabledColor ); + mLabelBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() ); } mMultiSlider->setEnabled( b ); @@ -398,7 +419,7 @@ void LLMultiSliderCtrl::setEnabled(BOOL b) if( mTextBox ) { - mTextBox->setColor( b ? mTextEnabledColor : mTextDisabledColor ); + mTextBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() ); } } @@ -409,7 +430,7 @@ void LLMultiSliderCtrl::setTentative(BOOL b) { mEditor->setTentative(b); } - LLUICtrl::setTentative(b); + LLF32UICtrl::setTentative(b); } @@ -422,7 +443,8 @@ void LLMultiSliderCtrl::onCommit() mEditor->setTentative(FALSE); } - LLUICtrl::onCommit(); + setControlValue(getValueF32()); + LLF32UICtrl::onCommit(); } @@ -438,37 +460,14 @@ void LLMultiSliderCtrl::setPrecision(S32 precision) updateText(); } -void LLMultiSliderCtrl::setSliderMouseDownCallback( void (*slider_mousedown_callback)(LLUICtrl* caller, void* userdata) ) -{ - mSliderMouseDownCallback = slider_mousedown_callback; - mMultiSlider->setMouseDownCallback( LLMultiSliderCtrl::onSliderMouseDown ); -} - -// static -void LLMultiSliderCtrl::onSliderMouseDown(LLUICtrl* caller, void* userdata) +boost::signals::connection LLMultiSliderCtrl::setSliderMouseDownCallback( const commit_signal_t::slot_type& cb ) { - LLMultiSliderCtrl* self = (LLMultiSliderCtrl*) userdata; - if( self->mSliderMouseDownCallback ) - { - self->mSliderMouseDownCallback( self, self->mCallbackUserData ); - } + return mMultiSlider->setMouseDownCallback( cb ); } - -void LLMultiSliderCtrl::setSliderMouseUpCallback( void (*slider_mouseup_callback)(LLUICtrl* caller, void* userdata) ) +boost::signals::connection LLMultiSliderCtrl::setSliderMouseUpCallback( const commit_signal_t::slot_type& cb ) { - mSliderMouseUpCallback = slider_mouseup_callback; - mMultiSlider->setMouseUpCallback( LLMultiSliderCtrl::onSliderMouseUp ); -} - -// static -void LLMultiSliderCtrl::onSliderMouseUp(LLUICtrl* caller, void* userdata) -{ - LLMultiSliderCtrl* self = (LLMultiSliderCtrl*) userdata; - if( self->mSliderMouseUpCallback ) - { - self->mSliderMouseUpCallback( self, self->mCallbackUserData ); - } + return mMultiSlider->setMouseUpCallback( cb ); } void LLMultiSliderCtrl::onTabInto() @@ -484,154 +483,9 @@ void LLMultiSliderCtrl::reportInvalidData() make_ui_sound("UISndBadKeystroke"); } -//virtual -std::string LLMultiSliderCtrl::getControlName() const -{ - return mMultiSlider->getControlName(); -} - // virtual void LLMultiSliderCtrl::setControlName(const std::string& control_name, LLView* context) { mMultiSlider->setControlName(control_name, context); } -// virtual -LLXMLNodePtr LLMultiSliderCtrl::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - node->createChild("show_text", TRUE)->setBoolValue(mShowText); - - node->createChild("can_edit_text", TRUE)->setBoolValue(mCanEditText); - - node->createChild("decimal_digits", TRUE)->setIntValue(mPrecision); - - if (mLabelBox) - { - node->createChild("label", TRUE)->setStringValue(mLabelBox->getText()); - } - - // TomY TODO: Do we really want to export the transient state of the slider? - node->createChild("value", TRUE)->setFloatValue(mCurValue); - - if (mMultiSlider) - { - node->createChild("initial_val", TRUE)->setFloatValue(mMultiSlider->getInitialValue()); - node->createChild("min_val", TRUE)->setFloatValue(mMultiSlider->getMinValue()); - node->createChild("max_val", TRUE)->setFloatValue(mMultiSlider->getMaxValue()); - node->createChild("increment", TRUE)->setFloatValue(mMultiSlider->getIncrement()); - } - addColorXML(node, mTextEnabledColor, "text_enabled_color", "LabelTextColor"); - addColorXML(node, mTextDisabledColor, "text_disabled_color", "LabelDisabledColor"); - - return node; -} - -LLView* LLMultiSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("multi_slider"); - node->getAttributeString("name", name); - - std::string label; - node->getAttributeString("label", label); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - LLFontGL* font = LLView::selectFont(node); - - // HACK: Font might not be specified. - if (!font) - { - font = LLFontGL::getFontSansSerifSmall(); - } - - S32 label_width = 0; - node->getAttributeS32("label_width", label_width); - - BOOL show_text = TRUE; - node->getAttributeBOOL("show_text", show_text); - - BOOL can_edit_text = FALSE; - node->getAttributeBOOL("can_edit_text", can_edit_text); - - BOOL allow_overlap = FALSE; - node->getAttributeBOOL("allow_overlap", allow_overlap); - - BOOL draw_track = TRUE; - node->getAttributeBOOL("draw_track", draw_track); - - BOOL use_triangle = FALSE; - node->getAttributeBOOL("use_triangle", use_triangle); - - F32 initial_value = 0.f; - node->getAttributeF32("initial_val", initial_value); - - F32 min_value = 0.f; - node->getAttributeF32("min_val", min_value); - - F32 max_value = 1.f; - node->getAttributeF32("max_val", max_value); - - F32 increment = 0.1f; - node->getAttributeF32("increment", increment); - - U32 precision = 3; - node->getAttributeU32("decimal_digits", precision); - - S32 max_sliders = 1; - node->getAttributeS32("max_sliders", max_sliders); - - - S32 text_left = 0; - if (show_text) - { - // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) - if ( max_value ) - text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); - - if ( increment < 1.0f ) - text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value - - if ( min_value < 0.0f || max_value < 0.0f ) - text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign - - // padding to make things look nicer - text_left += 8; - } - - LLUICtrlCallback callback = NULL; - - if (label.empty()) - { - label.assign(node->getTextContents()); - } - - LLMultiSliderCtrl* slider = new LLMultiSliderCtrl(name, - rect, - label, - font, - label_width, - rect.getWidth() - text_left, - show_text, - can_edit_text, - callback, - NULL, - initial_value, - min_value, - max_value, - increment, - max_sliders, - allow_overlap, - draw_track, - use_triangle); - - slider->setPrecision(precision); - - slider->initFromXML(node, parent); - - slider->updateText(); - - return slider; -} diff --git a/indra/llui/llmultisliderctrl.h b/indra/llui/llmultisliderctrl.h index b62b5ec3233a7643225b9ee4fc5ba58f258dd38e..85ba77b7df327eb4e6aec945bdab8af5e6951275 100644 --- a/indra/llui/llmultisliderctrl.h +++ b/indra/llui/llmultisliderctrl.h @@ -33,17 +33,12 @@ #ifndef LL_MULTI_SLIDERCTRL_H #define LL_MULTI_SLIDERCTRL_H -#include "lluictrl.h" +#include "llf32uictrl.h" #include "v4color.h" #include "llmultislider.h" #include "lltextbox.h" #include "llrect.h" -// -// Constants -// -const S32 MULTI_SLIDERCTRL_SPACING = 4; // space between label, slider, and text -const S32 MULTI_SLIDERCTRL_HEIGHT = 16; // // Classes @@ -53,27 +48,35 @@ class LLLineEditor; class LLSlider; -class LLMultiSliderCtrl : public LLUICtrl +class LLMultiSliderCtrl : public LLF32UICtrl { public: - LLMultiSliderCtrl(const std::string& name, - const LLRect& rect, - const std::string& label, - const LLFontGL* font, - S32 slider_left, - S32 text_left, - BOOL show_text, - BOOL can_edit_text, - void (*commit_callback)(LLUICtrl*, void*), - void* callback_userdata, - F32 initial_value, F32 min_value, F32 max_value, F32 increment, - S32 max_sliders, BOOL allow_overlap, BOOL draw_track, - BOOL use_triangle, - const std::string& control_which = LLStringUtil::null ); - + struct Params : public LLInitParam::Block<Params, LLF32UICtrl::Params> + { + Optional<S32> label_width, + text_width; + Optional<bool> show_text, + can_edit_text; + Optional<S32> decimal_digits; + Optional<S32> max_sliders; + Optional<bool> allow_overlap, + draw_track, + use_triangle; + + Optional<LLUIColor> text_color, + text_disabled_color; + + Optional<CommitCallbackParam> mouse_down_callback, + mouse_up_callback; + + Params(); + }; + +protected: + LLMultiSliderCtrl(const Params&); + friend class LLUICtrlFactory; +public: virtual ~LLMultiSliderCtrl(); - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); F32 getSliderValue(const std::string& name) const; void setSliderValue(const std::string& name, F32 v, BOOL from_event = FALSE); @@ -112,8 +115,8 @@ public: void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; } - void setSliderMouseDownCallback( void (*slider_mousedown_callback)(LLUICtrl* caller, void* userdata) ); - void setSliderMouseUpCallback( void (*slider_mouseup_callback)(LLUICtrl* caller, void* userdata) ); + boost::signals::connection setSliderMouseDownCallback( const commit_signal_t::slot_type& cb ); + boost::signals::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb ); virtual void onTabInto(); @@ -121,13 +124,10 @@ public: virtual void onCommit(); // mark not tentative, then commit virtual void setControlName(const std::string& control_name, LLView* context); - virtual std::string getControlName() const; - static void onSliderCommit(LLUICtrl* caller, void* userdata); - static void onSliderMouseDown(LLUICtrl* caller,void* userdata); - static void onSliderMouseUp(LLUICtrl* caller,void* userdata); - - static void onEditorCommit(LLUICtrl* caller, void* userdata); + static void onSliderCommit(LLUICtrl* caller, const LLSD& userdata); + + static void onEditorCommit(LLUICtrl* ctrl, const LLSD& userdata); static void onEditorGainFocus(LLFocusableElement* caller, void *userdata); static void onEditorChangeFocus(LLUICtrl* caller, S32 direction, void *userdata); @@ -149,11 +149,8 @@ private: LLLineEditor* mEditor; LLTextBox* mTextBox; - LLColor4 mTextEnabledColor; - LLColor4 mTextDisabledColor; - - void (*mSliderMouseUpCallback)( LLUICtrl* ctrl, void* userdata ); - void (*mSliderMouseDownCallback)( LLUICtrl* ctrl, void* userdata ); + LLUIColor mTextEnabledColor; + LLUIColor mTextDisabledColor; }; #endif // LL_MULTI_SLIDERCTRL_H diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index fe1ea950703dbac1bb4b820539f1a0fbab83806c..452f18b40ba50645641a14f35b627529525d1f9b 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -31,11 +31,14 @@ */ #include "linden_common.h" + +#include "llnotifications.h" + +#include "lluictrl.h" #include "lluictrlfactory.h" #include "lldir.h" #include "llsdserialize.h" - -#include "llnotifications.h" +#include "lltrans.h" #include <algorithm> #include <boost/regex.hpp> @@ -161,7 +164,7 @@ bool filterIgnoredNotifications(LLNotificationPtr notification) // Check to see if the user wants to ignore this alert if (form->getIgnoreType() != LLNotificationForm::IGNORE_NO) { - return LLUI::sConfigGroup->getWarning(notification->getName()); + return LLUI::sSettingGroups["ignores"]->getBOOL(notification->getName()); } return true; @@ -182,7 +185,7 @@ bool handleIgnoredNotification(const LLSD& payload) response = pNotif->getResponseTemplate(LLNotification::WITH_DEFAULT_BUTTON); break; case LLNotificationForm::IGNORE_WITH_LAST_RESPONSE: - response = LLUI::sIgnoresGroup->getLLSD("Default" + pNotif->getName()); + response = LLUI::sSettingGroups["ignores"]->getLLSD("Default" + pNotif->getName()); break; case LLNotificationForm::IGNORE_SHOW_AGAIN: break; @@ -240,10 +243,11 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLXMLNodeP { // remember last option chosen by user and automatically respond with that in the future mIgnore = IGNORE_WITH_LAST_RESPONSE; - LLUI::sIgnoresGroup->declareLLSD(std::string("Default") + name, "", std::string("Default response for notification " + name)); + LLUI::sSettingGroups["ignores"]->declareLLSD(std::string("Default") + name, "", std::string("Default response for notification " + name)); } child->getAttributeString("text", mIgnoreMsg); - LLUI::sIgnoresGroup->addWarning(name); + BOOL show_notification = TRUE; + LLUI::sSettingGroups["ignores"]->declareBOOL(name, show_notification, "Ignore notification with this name", TRUE); } else { @@ -339,13 +343,13 @@ void LLNotificationForm::formatElements(const LLSD& substitutions) if ((*it).has("text")) { std::string text = (*it)["text"].asString(); - text = LLNotification::format(text, substitutions); + LLStringUtil::format(text, substitutions); (*it)["text"] = text; } if ((*it)["type"].asString() == "text" && (*it).has("value")) { std::string value = (*it)["value"].asString(); - value = LLNotification::format(value, substitutions); + LLStringUtil::format(value, substitutions); (*it)["value"] = value; } } @@ -366,6 +370,7 @@ LLNotificationTemplate::LLNotificationTemplate() : mExpireSeconds(0), mExpireOption(-1), mURLOption(-1), + mURLOpenExternally(-1), mUnique(false), mPriority(NOTIFICATION_PRIORITY_NORMAL) { @@ -377,13 +382,24 @@ LLNotification::LLNotification(const LLNotification::Params& p) : mSubstitutions(p.substitutions), mPayload(p.payload), mExpiresAt(0), - mResponseFunctorName(p.functor_name), - mTemporaryResponder(p.mTemporaryResponder), + mTemporaryResponder(false), mRespondedTo(false), mPriority(p.priority), mCancelled(false), mIgnored(false) { + if (p.functor.name.isChosen()) + { + mResponseFunctorName = p.functor.name; + } + else if (p.functor.function.isChosen()) + { + mResponseFunctorName = LLUUID::generateNewID().asString(); + LLNotificationFunctorRegistry::instance().registerFunctor(mResponseFunctorName, p.functor.function()); + + mTemporaryResponder = true; + } + mId.generate(); init(p.name, p.form_elements); } @@ -540,10 +556,11 @@ void LLNotification::respond(const LLSD& response) if (mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO) { - LLUI::sIgnoresGroup->setWarning(getName(), !mIgnored); + BOOL show_notification = mIgnored ? FALSE : TRUE; + LLUI::sSettingGroups["ignores"]->setBOOL(getName(), show_notification); if (mIgnored && mForm->getIgnoreType() == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE) { - LLUI::sIgnoresGroup->setLLSD("Default" + getName(), response); + LLUI::sSettingGroups["ignores"]->setLLSD("Default" + getName(), response); } } @@ -601,8 +618,12 @@ void LLNotification::init(const std::string& template_name, const LLSD& form_ele if (!mTemplatep) return; // add default substitutions - // TODO: change this to read from the translatable strings file! - mSubstitutions["SECOND_LIFE"] = "Second Life"; + const LLStringUtil::format_map_t& default_args = LLTrans::getDefaultArgs(); + for (LLStringUtil::format_map_t::const_iterator iter = default_args.begin(); + iter != default_args.end(); ++iter) + { + mSubstitutions[iter->first] = iter->second; + } mSubstitutions["_URL"] = getURL(); mSubstitutions["_NAME"] = template_name; // TODO: something like this so that a missing alert is sensible: @@ -636,64 +657,6 @@ std::string LLNotification::summarize() const return s; } -//static -std::string LLNotification::format(const std::string& s, const LLSD& substitutions) -{ - if (!substitutions.isMap()) - { - return s; - } - - std::ostringstream output; - // match strings like [NAME] - const boost::regex key("\\[([0-9_A-Z]+)]"); - - std::string::const_iterator start = s.begin(); - std::string::const_iterator end = s.end(); - boost::smatch match; - - while (boost::regex_search(start, end, match, key, boost::match_default)) - { - bool found_replacement = false; - std::string replacement; - - // see if we have a replacement for the bracketed string (without the brackets) - // test first using has() because if we just look up with operator[] we get back an - // empty string even if the value is missing. We want to distinguish between - // missing replacements and deliberately empty replacement strings. - if (substitutions.has(std::string(match[1].first, match[1].second))) - { - replacement = substitutions[std::string(match[1].first, match[1].second)].asString(); - found_replacement = true; - } - // if not, see if there's one WITH brackets - else if (substitutions.has(std::string(match[0].first, match[0].second))) - { - replacement = substitutions[std::string(match[0].first, match[0].second)].asString(); - found_replacement = true; - } - - if (found_replacement) - { - // found a replacement - // "hello world" is output - output << std::string(start, match[0].first) << replacement; - } - else - { - // we had no replacement, so leave the string we searched for so that it gets noticed by QA - // "hello [NAME_NOT_FOUND]" is output - output << std::string(start, match[0].second); - } - - // update search position - start = match[0].second; - } - // send the remainder of the string (with no further matches for bracketed names) - output << std::string(start, end); - return output.str(); -} - std::string LLNotification::getMessage() const { // all our callers cache this result, so it gives us more flexibility @@ -701,15 +664,27 @@ std::string LLNotification::getMessage() const // cache it in the notification if (!mTemplatep) return std::string(); - return format(mTemplatep->mMessage, mSubstitutions); + + std::string message = mTemplatep->mMessage; + LLStringUtil::format(message, mSubstitutions); + return message; } std::string LLNotification::getLabel() const { - return (mTemplatep ? format(mTemplatep->mLabel, mSubstitutions) : ""); + std::string label = mTemplatep->mLabel; + LLStringUtil::format(label, mSubstitutions); + return (mTemplatep ? label : ""); } - +std::string LLNotification::getURL() const +{ + if (!mTemplatep) + return std::string(); + std::string url = mTemplatep->mURL; + LLStringUtil::format(url, mSubstitutions); + return (mTemplatep ? url : ""); +} // ========================================================= // LLNotificationChannel implementation @@ -952,6 +927,7 @@ std::string LLNotificationChannel::summarize() LLNotifications::LLNotifications() : LLNotificationChannelBase(LLNotificationFilters::includeEverything, LLNotificationComparators::orderByUUID()) { + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2)); } @@ -1101,9 +1077,6 @@ void LLNotifications::createDefaultChannels() connectFailedFilter(&handleIgnoredNotification); } -static std::string sStringSkipNextTime("Skip this dialog next time"); -static std::string sStringAlwaysChoose("Always choose this option"); - bool LLNotifications::addTemplate(const std::string &name, LLNotificationTemplatePtr theTemplate) { @@ -1324,8 +1297,17 @@ bool LLNotifications::loadTemplates() item->getAttributeString("sound", sound); if (!sound.empty()) { - // TODO: test for bad sound effect name / missing effect - pTemplate->mSoundEffect = LLUUID(LLUI::sConfigGroup->getString(sound.c_str())); + // test for bad sound effect name / missing effect + if (LLUI::sSettingGroups["config"]->controlExists(sound)) + { + pTemplate->mSoundEffect = + LLUUID(LLUI::sSettingGroups["config"]->getString(sound)); + } + else + { + llwarns << "Unknown sound effect control name " << sound + << llendl; + } } for (LLXMLNodePtr child = item->getFirstChild(); @@ -1338,6 +1320,7 @@ bool LLNotifications::loadTemplates() { pTemplate->mURL = child->getTextContents(); child->getAttributeU32("option", pTemplate->mURLOption); + child->getAttributeU32("openexternally", pTemplate->mURLOpenExternally); } if (child->hasName("unique")) @@ -1377,12 +1360,20 @@ bool LLNotifications::loadTemplates() return true; } +// Add a simple notification (from XUI) +void LLNotifications::addFromCallback(const LLSD& name) +{ + add(LLNotification::Params().name(name.asString())); +} + // we provide a couple of simple add notification functions so that it's reasonable to create notifications in one line LLNotificationPtr LLNotifications::add(const std::string& name, const LLSD& substitutions, const LLSD& payload) { - return add(LLNotification::Params(name).substitutions(substitutions).payload(payload)); + LLNotification::Params::Functor functor_p; + functor_p.name = name; + return add(LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p)); } LLNotificationPtr LLNotifications::add(const std::string& name, @@ -1390,7 +1381,9 @@ LLNotificationPtr LLNotifications::add(const std::string& name, const LLSD& payload, const std::string& functor_name) { - return add(LLNotification::Params(name).substitutions(substitutions).payload(payload).functor_name(functor_name)); + LLNotification::Params::Functor functor_p; + functor_p.name = functor_name; + return add(LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p)); } LLNotificationPtr LLNotifications::add(const std::string& name, @@ -1398,7 +1391,9 @@ LLNotificationPtr LLNotifications::add(const std::string& name, const LLSD& payload, LLNotificationFunctorRegistry::ResponseFunctor functor) { - return add(LLNotification::Params(name).substitutions(substitutions).payload(payload).functor(functor)); + LLNotification::Params::Functor functor_p; + functor_p.function = functor; + return add(LLNotification::Params().name(name).substitutions(substitutions).payload(payload).functor(functor_p)); } // generalized add function that takes a parameter block object for more complex instantiations diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index d01296c89e8b2bc556f452ad4721bfdaddf66026..5c8d146e0cb20018e3e2dd9551684f57a45ead9f 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -101,6 +101,7 @@ #include "llevents.h" #include "llfunctorregistry.h" #include "llui.h" +#include "llmemory.h" class LLNotification; typedef boost::shared_ptr<LLNotification> LLNotificationPtr; @@ -235,6 +236,11 @@ struct LLNotificationTemplate // that URL. Obsolete this and eliminate the buttons for affected // messages when we allow clickable URLs in the UI U32 mURLOption; + + U32 mURLOpenExternally; + //This is a flag that tells if the url needs to open externally dispite + //what the user setting is. + // does this notification persist across sessions? if so, it will be // serialized to disk on first receipt and read on startup bool mPersist; @@ -277,42 +283,49 @@ friend class LLNotifications; public: // parameter object used to instantiate a new notification - class Params : public LLParamBlock<Params> + struct Params : public LLInitParam::Block<Params> { friend class LLNotification; - public: - Params(const std::string& _name) - : name(_name), - mTemporaryResponder(false), - functor_name(_name), - priority(NOTIFICATION_PRIORITY_UNSPECIFIED), - timestamp(LLDate::now()) + + Mandatory<std::string> name; + + // optional + Optional<LLSD> substitutions; + Optional<LLSD> payload; + Optional<ENotificationPriority> priority; + Optional<LLSD> form_elements; + Optional<LLDate> timestamp; + Optional<LLNotificationContext*> context; + + struct Functor : public LLInitParam::Choice<Functor> { + Option<std::string> name; + Option<LLNotificationFunctorRegistry::ResponseFunctor> function; + + Functor() + : name("functor_name"), + function("functor") + {} + }; + Optional<Functor> functor; + + Params() + : name("name"), + priority("priority", NOTIFICATION_PRIORITY_UNSPECIFIED), + timestamp("time_stamp") + { + timestamp = LLDate::now(); } - // pseudo-param - Params& functor(LLNotificationFunctorRegistry::ResponseFunctor f) - { - functor_name = LLUUID::generateNewID().asString(); - LLNotificationFunctorRegistry::instance().registerFunctor(functor_name, f); - - mTemporaryResponder = true; - return *this; + Params(const std::string& _name) + : name("name"), + priority("priority", NOTIFICATION_PRIORITY_UNSPECIFIED), + timestamp("time_stamp") + { + functor.name = _name; + name = _name; + timestamp = LLDate::now(); } - - LLMandatoryParam<std::string> name; - - // optional - LLOptionalParam<LLSD> substitutions; - LLOptionalParam<LLSD> payload; - LLOptionalParam<ENotificationPriority> priority; - LLOptionalParam<LLSD> form_elements; - LLOptionalParam<LLDate> timestamp; - LLOptionalParam<LLNotificationContext*> context; - LLOptionalParam<std::string> functor_name; - - private: - bool mTemporaryResponder; }; private: @@ -365,10 +378,6 @@ public: // constructor from a saved notification LLNotification(const LLSD& sd); - // This is a string formatter for substituting into the message directly - // from LLSD without going through the hopefully-to-be-obsoleted LLString - static std::string format(const std::string& text, const LLSD& substitutions); - void setResponseFunctor(std::string const &responseFunctorName); typedef enum e_response_template_type @@ -460,16 +469,21 @@ public: std::string getMessage() const; std::string getLabel() const; - std::string getURL() const - { - return (mTemplatep ? mTemplatep->mURL : ""); - } + std::string getURL() const; +// { +// return (mTemplatep ? mTemplatep->mURL : ""); +// } S32 getURLOption() const { return (mTemplatep ? mTemplatep->mURLOption : -1); } - + + S32 getURLOpenExternally() const + { + return(mTemplatep? mTemplatep->mURLOpenExternally : -1); + } + const LLNotificationFormPtr getForm(); const LLDate getExpiration() const @@ -798,7 +812,10 @@ public: // OK to call more than once because it will reload bool loadTemplates(); LLXMLNodePtr checkForXMLTemplate(LLXMLNodePtr item); - + + // Add a simple notification (from XUI) + void addFromCallback(const LLSD& name); + // we provide a collection of simple add notification functions so that it's reasonable to create notifications in one line LLNotificationPtr add(const std::string& name, const LLSD& substitutions = LLSD(), diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 28780c7adb234c704b592f44e7eb0c1588600c62..ad5cdca5cca03b5fcadc52bf709cc5d6779218e4 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -54,74 +54,49 @@ #include "lluictrlfactory.h" #include "llviewborder.h" #include "llbutton.h" +#include "lltabcontainer.h" -// LLLayoutStack -#include "llresizebar.h" -#include "llcriticaldamp.h" +static LLDefaultWidgetRegistry::Register<LLPanel> r1("panel", &LLPanel::fromXML); -const S32 RESIZE_BAR_OVERLAP = 1; -const S32 RESIZE_BAR_HEIGHT = 3; - -static LLRegisterWidget<LLPanel> r1("panel"); - -void LLPanel::init() +LLPanel::Params::Params() +: has_border("border", false), + bg_opaque_color("bg_opaque_color"), + bg_alpha_color("bg_alpha_color"), + background_visible("background_visible", false), + background_opaque("background_opaque", false), + min_width("min_width", 100), + min_height("min_height", 100), + strings("string"), + filename("filename"), + class_name("class") { - // mRectControl - mBgColorAlpha = LLUI::sColorsGroup->getColor( "DefaultBackgroundColor" ); - mBgColorOpaque = LLUI::sColorsGroup->getColor( "FocusBackgroundColor" ); - mDefaultBtnHighlight = LLUI::sColorsGroup->getColor( "DefaultHighlightLight" ); - mBgVisible = FALSE; - mBgOpaque = FALSE; - mBorder = NULL; - mDefaultBtn = NULL; - setIsChrome(FALSE); //is this a decorator to a live window or a form? - mLastTabGroup = 0; - - mPanelHandle.bind(this); - setTabStop(FALSE); + name = "panel"; + addSynonym(background_visible, "bg_visible"); + addSynonym(has_border, "border_visible"); + addSynonym(label, "title"); } -LLPanel::LLPanel() -: mRectControl() -{ - init(); - setName(std::string("panel")); -} -LLPanel::LLPanel(const std::string& name) -: LLUICtrl(name, LLRect(0, 0, 0, 0), TRUE, NULL, NULL), - mRectControl() +LLPanel::LLPanel(const LLPanel::Params& p) +: LLUICtrl(p), + mBgColorAlpha(p.bg_alpha_color().get()), + mBgColorOpaque(p.bg_opaque_color().get()), + mBgVisible(p.background_visible), + mBgOpaque(p.background_opaque), + mDefaultBtn(NULL), + mBorder(NULL), + mLabel(p.label), + mCommitCallbackRegistrar(false), + mEnableCallbackRegistrar(false) { - init(); -} + setIsChrome(FALSE); - -LLPanel::LLPanel(const std::string& name, const LLRect& rect, BOOL bordered) -: LLUICtrl(name, rect, TRUE, NULL, NULL), - mRectControl() -{ - init(); - if (bordered) + if (p.has_border) { - addBorder(); + addBorder(p.border); } -} - - -LLPanel::LLPanel(const std::string& name, const std::string& rect_control, BOOL bordered) -: LLUICtrl(name, LLUI::sConfigGroup->getRect(rect_control), TRUE, NULL, NULL), - mRectControl( rect_control ) -{ - init(); - if (bordered) - { - addBorder(); - } -} - -LLPanel::~LLPanel() -{ - storeRectControl(); + + mPanelHandle.bind(this); } // virtual @@ -130,27 +105,23 @@ BOOL LLPanel::isPanel() const return TRUE; } -// virtual -BOOL LLPanel::postBuild() -{ - return TRUE; -} - -void LLPanel::addBorder(LLViewBorder::EBevel border_bevel, - LLViewBorder::EStyle border_style, S32 border_thickness) +void LLPanel::addBorder(LLViewBorder::Params p) { removeBorder(); - mBorder = new LLViewBorder( std::string("panel border"), - LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), - border_bevel, border_style, border_thickness ); - mBorder->setSaveToXML(false); + p.rect = getLocalRect(); + + mBorder = LLUICtrlFactory::create<LLViewBorder>(p); addChild( mBorder ); } void LLPanel::removeBorder() { - delete mBorder; - mBorder = NULL; + if (mBorder) + { + removeChild(mBorder); + delete mBorder; + mBorder = NULL; + } } @@ -258,20 +229,6 @@ void LLPanel::setDefaultBtn(const std::string& id) } } -void LLPanel::addCtrl( LLUICtrl* ctrl, S32 tab_group) -{ - mLastTabGroup = tab_group; - - LLView::addCtrl(ctrl, tab_group); -} - -void LLPanel::addCtrlAtEnd( LLUICtrl* ctrl, S32 tab_group) -{ - mLastTabGroup = tab_group; - - LLView::addCtrlAtEnd(ctrl, tab_group); -} - BOOL LLPanel::handleKeyHere( KEY key, MASK mask ) { BOOL handled = FALSE; @@ -308,29 +265,26 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask ) } } } - - // If we have a default button, click it when - // return is pressed, unless current focus is a return-capturing button - // in which case *that* button will handle the return key - LLButton* focused_button = dynamic_cast<LLButton*>(cur_focus); - if (cur_focus && !(focused_button && focused_button->getCommitOnReturn())) + + // If RETURN was pressed and something has focus, call onCommit() + if (!handled && cur_focus && key == KEY_RETURN && mask == MASK_NONE) { - // RETURN key means hit default button in this case - if (key == KEY_RETURN && mask == MASK_NONE - && mDefaultBtn != NULL - && mDefaultBtn->getVisible() - && mDefaultBtn->getEnabled()) + LLButton* focused_button = dynamic_cast<LLButton*>(cur_focus); + if (focused_button && focused_button->getCommitOnReturn()) + { + // current focus is a return-capturing button, + // let *that* button handle the return key + handled = FALSE; + } + else if (mDefaultBtn && mDefaultBtn->getVisible() && mDefaultBtn->getEnabled()) { + // If we have a default button, click it when return is pressed mDefaultBtn->onCommit(); handled = TRUE; } - } - - if (key == KEY_RETURN && mask == MASK_NONE) - { - // set keyboard focus to self to trigger commitOnFocusLost behavior on current ctrl - if (cur_focus && cur_focus->acceptsTextInput()) + else if (cur_focus->acceptsTextInput()) { + // call onCommit for text input handling control cur_focus->onCommit(); handled = TRUE; } @@ -364,12 +318,10 @@ void LLPanel::setFocus(BOOL b) { if (!gFocusMgr.childHasKeyboardFocus(this)) { - //refresh(); - if (!focusFirstItem()) - { - LLUICtrl::setFocus(TRUE); - } - onFocusReceived(); + // give ourselves focus preemptively, to avoid infinite loop + LLUICtrl::setFocus(TRUE); + // then try to pass to first valid child + focusFirstItem(); } } else @@ -399,191 +351,194 @@ void LLPanel::setBorderVisible(BOOL b) } } -// virtual -LLXMLNodePtr LLPanel::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLView::getXML(); - - if (mBorder && mBorder->getVisible()) - { - node->createChild("border", TRUE)->setBoolValue(TRUE); - } +LLFastTimer::DeclareTimer FTM_PANEL_CONSTRUCTION("Panel Construction"); - if (!mRectControl.empty()) - { - node->createChild("rect_control", TRUE)->setStringValue(mRectControl); - } +LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_node) +{ + std::string name("panel"); + node->getAttributeString("name", name); - if (!mLabel.empty()) - { - node->createChild("label", TRUE)->setStringValue(mLabel); - } + std::string class_attr; + node->getAttributeString("class", class_attr); - if (save_children) + LLPanel* panelp = NULL; + { - LLView::child_list_const_reverse_iter_t rit; - for (rit = getChildList()->rbegin(); rit != getChildList()->rend(); ++rit) + LLFastTimer timer(FTM_PANEL_CONSTRUCTION); + + if(!class_attr.empty()) { - LLView* childp = *rit; - - if (childp->getSaveToXML()) + panelp = LLRegisterPanelClass::instance().createPanelClass(class_attr); + if (!panelp) { - LLXMLNodePtr xml_node = childp->getXML(); - - node->addChild(xml_node); + llwarns << "Panel class \"" << class_attr << "\" not registered." << llendl; } } - } - return node; -} - -LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory *factory) -{ - std::string name("panel"); - node->getAttributeString("name", name); + if (!panelp) + { + panelp = LLUICtrlFactory::getInstance()->createFactoryPanel(name); + } - LLPanel* panelp = factory->createFactoryPanel(name); - // Fall back on a default panel, if there was no special factory. - if (!panelp) - { - LLRect rect; - createRect(node, rect, parent, LLRect()); - // create a new panel without a border, by default - panelp = new LLPanel(name, rect, FALSE); - panelp->initPanelXML(node, parent, factory); - // preserve panel's width and height, but override the location - const LLRect& panelrect = panelp->getRect(); - S32 w = panelrect.getWidth(); - S32 h = panelrect.getHeight(); - rect.setLeftTopAndSize(rect.mLeft, rect.mTop, w, h); - panelp->setRect(rect); } - else + // factory panels may have registered their own factory maps + if (!panelp->getFactoryMap().empty()) { - panelp->initPanelXML(node, parent, factory); + LLUICtrlFactory::instance().pushFactoryFunctions(&panelp->getFactoryMap()); + } + // for local registry callbacks; define in constructor, referenced in XUI or postBuild + panelp->mCommitCallbackRegistrar.pushScope(); + panelp->mEnableCallbackRegistrar.pushScope(); + + panelp->initPanelXML(node, parent, output_node); + + panelp->mCommitCallbackRegistrar.popScope(); + panelp->mEnableCallbackRegistrar.popScope(); + + if (panelp && !panelp->getFactoryMap().empty()) + { + LLUICtrlFactory::instance().popFactoryFunctions(); } return panelp; } -BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) +void LLPanel::initFromParams(const LLPanel::Params& p) { - std::string name = getName(); - node->getAttributeString("name", name); - setName(name); + // control_name, tab_stop, focus_lost_callback, initial_value, rect, enabled, visible + LLUICtrl::initFromParams(p); - setPanelParameters(node, parent); - - initChildrenXML(node, factory); + for (LLInitParam::ParamIterator<LocalizedString>::const_iterator it = p.strings().begin(); + it != p.strings().end(); + ++it) + { + mUIStrings[it->name] = it->text; + } - std::string xml_filename; - node->getAttributeString("filename", xml_filename); + setName(p.name()); + setLabel(p.label()); - BOOL didPost; + setShape(p.rect); + parseFollowsFlags(p); - if (!xml_filename.empty()) + setEnabled(p.enabled); + setVisible(p.visible); + setToolTip(p.tool_tip()); + setSaveToXML(p.serializable); + + mHoverCursor = getCursorFromString(p.hover_cursor); + + if (p.has_border) { - didPost = factory->buildPanel(this, xml_filename, NULL); - - LLRect new_rect = getRect(); - // override rectangle with embedding parameters as provided - createRect(node, new_rect, parent); - setOrigin(new_rect.mLeft, new_rect.mBottom); - reshape(new_rect.getWidth(), new_rect.getHeight()); - // optionally override follows flags from including nodes - parseFollowsFlags(node); + addBorder(p.border); } - else + // let constructors set this value if not provided + if (p.use_bounding_rect.isProvided()) { - didPost = FALSE; + setUseBoundingRect(p.use_bounding_rect); } + setDefaultTabGroup(p.default_tab_group); + setMouseOpaque(p.mouse_opaque); + + setBackgroundVisible(p.background_visible); + setBackgroundOpaque(p.background_opaque); + setBackgroundColor(p.bg_opaque_color().get()); + setTransparentColor(p.bg_alpha_color().get()); - if (!didPost) - { - postBuild(); - didPost = TRUE; - } - - return didPost; } -void LLPanel::initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory) +static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); +static LLFastTimer::DeclareTimer FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference"); +static LLFastTimer::DeclareTimer FTM_PANEL_POSTBUILD("Panel PostBuild"); + +BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) { - LLXMLNodePtr child; - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) + const LLPanel::Params& default_params(LLUICtrlFactory::getDefaultParams<LLPanel::Params>()); + Params params(default_params); + { - // look for string declarations for programmatic text - if (child->hasName("string")) + LLFastTimer timer(FTM_PANEL_SETUP); + + LLXMLNodePtr referenced_xml; + std::string xml_filename; + node->getAttributeString("filename", xml_filename); + + if (!xml_filename.empty()) { - std::string string_name; - child->getAttributeString("name", string_name); - if (!string_name.empty()) + LLFastTimer timer(FTM_EXTERNAL_PANEL_LOAD); + if (output_node) { - mUIStrings[string_name] = child->getTextContents(); + //if we are exporting, we want to export the current xml + //not the referenced xml + LLXUIParser::instance().readXUI(node, params); + Params output_params(params); + setupParamsForExport(output_params, parent); + output_node->setName(node->getName()->mString); + LLXUIParser::instance().writeXUI( + output_node, output_params, &default_params); + return TRUE; } - } - else - { - factory->createWidget(this, child); - } - } -} + + if (!LLUICtrlFactory::getLayeredXMLNode(xml_filename, referenced_xml)) + { + llwarns << "Couldn't parse panel from: " << xml_filename << llendl; -void LLPanel::setPanelParameters(LLXMLNodePtr node, LLView* parent) -{ - /////// Rect, follows, tool_tip, enabled, visible attributes /////// - initFromXML(node, parent); + return FALSE; + } - /////// Border attributes /////// - BOOL border = mBorder != NULL; - node->getAttributeBOOL("border", border); - if (border) - { - LLViewBorder::EBevel bevel_style = LLViewBorder::BEVEL_OUT; - LLViewBorder::getBevelFromAttribute(node, bevel_style); + LLXUIParser::instance().readXUI(referenced_xml, params); - LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE; - std::string border_string; - node->getAttributeString("border_style", border_string); - LLStringUtil::toLower(border_string); + // add children using dimensions from referenced xml for consistent layout + setShape(params.rect); + LLUICtrlFactory::createChildren(this, referenced_xml); + } + + LLXUIParser::instance().readXUI(node, params); - if (border_string == "texture") + if (output_node) { - border_style = LLViewBorder::STYLE_TEXTURE; + Params output_params(params); + setupParamsForExport(output_params, parent); + output_node->setName(node->getName()->mString); + LLXUIParser::instance().writeXUI( + output_node, output_params, &default_params); + } + + setupParams(params, parent); + { + LLFastTimer timer(FTM_PANEL_CONSTRUCTION); + initFromParams(params); } - S32 border_thickness = LLPANEL_BORDER_WIDTH; - node->getAttributeS32("border_thickness", border_thickness); + // add children + LLUICtrlFactory::createChildren(this, node, output_node); - addBorder(bevel_style, border_style, border_thickness); - } - else - { - removeBorder(); + // Connect to parent after children are built, because tab containers + // do a reshape() on their child panels, which requires that the children + // be built/added. JC + if (parent) + { + S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : -1; + parent->addChild(this, tab_group); + } + + { + LLFastTimer timer(FTM_PANEL_POSTBUILD); + postBuild(); + } } + return TRUE; +} - /////// Background attributes /////// - BOOL background_visible = mBgVisible; - node->getAttributeBOOL("background_visible", background_visible); - setBackgroundVisible(background_visible); - - BOOL background_opaque = mBgOpaque; - node->getAttributeBOOL("background_opaque", background_opaque); - setBackgroundOpaque(background_opaque); - - LLColor4 color; - color = mBgColorOpaque; - LLUICtrlFactory::getAttributeColor(node,"bg_opaque_color", color); - setBackgroundColor(color); - - color = mBgColorAlpha; - LLUICtrlFactory::getAttributeColor(node,"bg_alpha_color", color); - setTransparentColor(color); - - std::string label = getLabel(); - node->getAttributeString("label", label); - setLabel(label); +const widget_registry_t& LLPanel::getChildRegistry() const +{ + // use default widget registry + return LLDefaultWidgetRegistry::instance(); +} + +bool LLPanel::hasString(const std::string& name) +{ + return mUIStrings.find(name) != mUIStrings.end(); } std::string LLPanel::getString(const std::string& name, const LLStringUtil::format_map_t& args) const @@ -597,9 +552,7 @@ std::string LLPanel::getString(const std::string& name, const LLStringUtil::form return formatted_string.getString(); } std::string err_str("Failed to find string " + name + " in panel " + getName()); //*TODO: Translate - // *TODO: once the QAR-369 ui-cleanup work on settings is in we need to change the following line to be - //if(LLUI::sConfigGroup->getBOOL("QAMode")) - if(LLUI::sQAMode) + if(LLUI::sSettingGroups["config"]->getBOOL("QAMode")) { llerrs << err_str << llendl; } @@ -618,7 +571,7 @@ std::string LLPanel::getString(const std::string& name) const return found_it->second; } std::string err_str("Failed to find string " + name + " in panel " + getName()); //*TODO: Translate - if(LLUI::sQAMode) + if(LLUI::sSettingGroups["config"]->getBOOL("QAMode")) { llerrs << err_str << llendl; } @@ -632,7 +585,7 @@ std::string LLPanel::getString(const std::string& name) const void LLPanel::childSetVisible(const std::string& id, bool visible) { - LLView* child = getChild<LLView>(id); + LLView* child = findChild<LLView>(id); if (child) { child->setVisible(visible); @@ -641,7 +594,7 @@ void LLPanel::childSetVisible(const std::string& id, bool visible) bool LLPanel::childIsVisible(const std::string& id) const { - LLView* child = getChild<LLView>(id); + LLView* child = findChild<LLView>(id); if (child) { return (bool)child->getVisible(); @@ -651,7 +604,7 @@ bool LLPanel::childIsVisible(const std::string& id) const void LLPanel::childSetEnabled(const std::string& id, bool enabled) { - LLView* child = getChild<LLView>(id); + LLView* child = findChild<LLView>(id); if (child) { child->setEnabled(enabled); @@ -660,7 +613,7 @@ void LLPanel::childSetEnabled(const std::string& id, bool enabled) void LLPanel::childSetTentative(const std::string& id, bool tentative) { - LLView* child = getChild<LLView>(id); + LLView* child = findChild<LLView>(id); if (child) { child->setTentative(tentative); @@ -669,7 +622,7 @@ void LLPanel::childSetTentative(const std::string& id, bool tentative) bool LLPanel::childIsEnabled(const std::string& id) const { - LLView* child = getChild<LLView>(id); + LLView* child = findChild<LLView>(id); if (child) { return (bool)child->getEnabled(); @@ -680,7 +633,7 @@ bool LLPanel::childIsEnabled(const std::string& id) const void LLPanel::childSetToolTip(const std::string& id, const std::string& msg) { - LLView* child = getChild<LLView>(id); + LLView* child = findChild<LLView>(id); if (child) { child->setToolTip(msg); @@ -689,7 +642,7 @@ void LLPanel::childSetToolTip(const std::string& id, const std::string& msg) void LLPanel::childSetRect(const std::string& id, const LLRect& rect) { - LLView* child = getChild<LLView>(id); + LLView* child = findChild<LLView>(id); if (child) { child->setRect(rect); @@ -698,7 +651,7 @@ void LLPanel::childSetRect(const std::string& id, const LLRect& rect) bool LLPanel::childGetRect(const std::string& id, LLRect& rect) const { - LLView* child = getChild<LLView>(id); + LLView* child = findChild<LLView>(id); if (child) { rect = child->getRect(); @@ -709,7 +662,7 @@ bool LLPanel::childGetRect(const std::string& id, LLRect& rect) const void LLPanel::childSetFocus(const std::string& id, BOOL focus) { - LLUICtrl* child = getChild<LLUICtrl>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { child->setFocus(focus); @@ -718,7 +671,7 @@ void LLPanel::childSetFocus(const std::string& id, BOOL focus) BOOL LLPanel::childHasFocus(const std::string& id) { - LLUICtrl* child = getChild<LLUICtrl>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { return child->hasFocus(); @@ -730,60 +683,28 @@ BOOL LLPanel::childHasFocus(const std::string& id) } } - -void LLPanel::childSetFocusChangedCallback(const std::string& id, void (*cb)(LLFocusableElement*, void*), void* user_data) +// *TODO: Deprecate; for backwards compatability only: +void LLPanel::childSetCommitCallback(const std::string& id, boost::function<void (LLUICtrl*,void*)> cb, void* data) { - LLUICtrl* child = getChild<LLUICtrl>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { - child->setFocusChangedCallback(cb, user_data); + child->setCommitCallback(boost::bind(cb, child, data)); } } -void LLPanel::childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void *userdata ) +void LLPanel::childSetValidate(const std::string& id, boost::function<bool (const LLSD& data)> cb) { - LLUICtrl* child = getChild<LLUICtrl>(id, true); - if (child) - { - child->setCommitCallback(cb); - child->setCallbackUserData(userdata); - } -} - -void LLPanel::childSetDoubleClickCallback(const std::string& id, void (*cb)(void*), void *userdata ) -{ - LLUICtrl* child = getChild<LLUICtrl>(id, true); - if (child) - { - child->setDoubleClickCallback(cb); - if (userdata) - { - child->setCallbackUserData(userdata); - } - } -} - -void LLPanel::childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*)) -{ - LLUICtrl* child = getChild<LLUICtrl>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { child->setValidateBeforeCommit(cb); } } -void LLPanel::childSetUserData(const std::string& id, void* userdata) -{ - LLUICtrl* child = getChild<LLUICtrl>(id, true); - if (child) - { - child->setCallbackUserData(userdata); - } -} - void LLPanel::childSetColor(const std::string& id, const LLColor4& color) { - LLUICtrl* child = getChild<LLUICtrl>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { child->setColor(color); @@ -792,7 +713,7 @@ void LLPanel::childSetColor(const std::string& id, const LLColor4& color) LLCtrlSelectionInterface* LLPanel::childGetSelectionInterface(const std::string& id) const { - LLUICtrl* child = getChild<LLUICtrl>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { return child->getSelectionInterface(); @@ -802,7 +723,7 @@ LLCtrlSelectionInterface* LLPanel::childGetSelectionInterface(const std::string& LLCtrlListInterface* LLPanel::childGetListInterface(const std::string& id) const { - LLUICtrl* child = getChild<LLUICtrl>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { return child->getListInterface(); @@ -812,7 +733,7 @@ LLCtrlListInterface* LLPanel::childGetListInterface(const std::string& id) const LLCtrlScrollInterface* LLPanel::childGetScrollInterface(const std::string& id) const { - LLUICtrl* child = getChild<LLUICtrl>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { return child->getScrollInterface(); @@ -822,7 +743,7 @@ LLCtrlScrollInterface* LLPanel::childGetScrollInterface(const std::string& id) c void LLPanel::childSetValue(const std::string& id, LLSD value) { - LLView* child = getChild<LLView>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { child->setValue(value); @@ -831,7 +752,7 @@ void LLPanel::childSetValue(const std::string& id, LLSD value) LLSD LLPanel::childGetValue(const std::string& id) const { - LLView* child = getChild<LLView>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { return child->getValue(); @@ -842,7 +763,7 @@ LLSD LLPanel::childGetValue(const std::string& id) const BOOL LLPanel::childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text) { - LLUICtrl* child = getChild<LLUICtrl>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { return child->setTextArg(key, text); @@ -852,7 +773,7 @@ BOOL LLPanel::childSetTextArg(const std::string& id, const std::string& key, con BOOL LLPanel::childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text) { - LLView* child = getChild<LLView>(id); + LLView* child = findChild<LLView>(id); if (child) { return child->setLabelArg(key, text); @@ -862,7 +783,7 @@ BOOL LLPanel::childSetLabelArg(const std::string& id, const std::string& key, co BOOL LLPanel::childSetToolTipArg(const std::string& id, const std::string& key, const LLStringExplicit& text) { - LLView* child = getChildView(id, true, FALSE); + LLView* child = findChild<LLView>(id); if (child) { return child->setToolTipArg(key, text); @@ -872,7 +793,7 @@ BOOL LLPanel::childSetToolTipArg(const std::string& id, const std::string& key, void LLPanel::childSetMinValue(const std::string& id, LLSD min_value) { - LLUICtrl* child = getChild<LLUICtrl>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { child->setMinValue(min_value); @@ -881,7 +802,7 @@ void LLPanel::childSetMinValue(const std::string& id, LLSD min_value) void LLPanel::childSetMaxValue(const std::string& id, LLSD max_value) { - LLUICtrl* child = getChild<LLUICtrl>(id, true); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { child->setMaxValue(max_value); @@ -890,7 +811,7 @@ void LLPanel::childSetMaxValue(const std::string& id, LLSD max_value) void LLPanel::childShowTab(const std::string& id, const std::string& tabname, bool visible) { - LLTabContainer* child = getChild<LLTabContainer>(id); + LLTabContainer* child = findChild<LLTabContainer>(id); if (child) { child->selectTabByName(tabname); @@ -899,7 +820,7 @@ void LLPanel::childShowTab(const std::string& id, const std::string& tabname, bo LLPanel *LLPanel::childGetVisibleTab(const std::string& id) const { - LLTabContainer* child = getChild<LLTabContainer>(id); + LLTabContainer* child = findChild<LLTabContainer>(id); if (child) { return child->getCurrentPanel(); @@ -907,40 +828,9 @@ LLPanel *LLPanel::childGetVisibleTab(const std::string& id) const return NULL; } -void LLPanel::childSetTabChangeCallback(const std::string& id, const std::string& tabname, void (*on_tab_clicked)(void*, bool), void *userdata, void (*on_precommit)(void*,bool)) -{ - LLTabContainer* child = getChild<LLTabContainer>(id); - if (child) - { - LLPanel *panel = child->getPanelByName(tabname); - if (panel) - { - child->setTabChangeCallback(panel, on_tab_clicked); - child->setTabUserData(panel, userdata); - if (on_precommit) - { - child->setTabPrecommitChangeCallback(panel, on_precommit); - } - } - } -} - -void LLPanel::childSetKeystrokeCallback(const std::string& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data) -{ - LLLineEditor* child = getChild<LLLineEditor>(id); - if (child) - { - child->setKeystrokeCallback(keystroke_callback); - if (user_data) - { - child->setCallbackUserData(user_data); - } - } -} - void LLPanel::childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) ) { - LLLineEditor* child = getChild<LLLineEditor>(id); + LLLineEditor* child = findChild<LLLineEditor>(id); if (child) { child->setPrevalidate(func); @@ -949,7 +839,7 @@ void LLPanel::childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWS void LLPanel::childSetWrappedText(const std::string& id, const std::string& text, bool visible) { - LLTextBox* child = getChild<LLTextBox>(id); + LLTextBox* child = findChild<LLTextBox>(id); if (child) { child->setVisible(visible); @@ -957,18 +847,18 @@ void LLPanel::childSetWrappedText(const std::string& id, const std::string& text } } -void LLPanel::childSetAction(const std::string& id, void(*function)(void*), void* value) +void LLPanel::childSetAction(const std::string& id, boost::function<void(void*)> function, void* value) { - LLButton* button = getChild<LLButton>(id); + LLButton* button = findChild<LLButton>(id); if (button) { - button->setClickedCallback(function, value); + button->setClickedCallback(boost::bind(function, value)); } } void LLPanel::childSetActionTextbox(const std::string& id, void(*function)(void*), void* value) { - LLTextBox* textbox = getChild<LLTextBox>(id); + LLTextBox* textbox = findChild<LLTextBox>(id); if (textbox) { textbox->setClickedCallback(function, value); @@ -977,7 +867,7 @@ void LLPanel::childSetActionTextbox(const std::string& id, void(*function)(void* void LLPanel::childSetControlName(const std::string& id, const std::string& control_name) { - LLView* view = getChild<LLView>(id); + LLUICtrl* view = findChild<LLUICtrl>(id); if (view) { view->setControlName(control_name, NULL); @@ -995,7 +885,11 @@ LLView* LLPanel::getChildView(const std::string& name, BOOL recurse, BOOL create } if (!view && create_if_missing) { - view = createDummyWidget<LLView>(name); + view = getDummyWidget<LLView>(name); + if (!view) + { + view = LLUICtrlFactory::createDummyWidget<LLView>(name); + } } return view; } @@ -1028,621 +922,8 @@ void LLPanel::childDisplayNotFound() LLNotifications::instance().add("FloaterNotFound", args); } -void LLPanel::storeRectControl() -{ - if( !mRectControl.empty() ) - { - LLUI::sConfigGroup->setRect( mRectControl, getRect() ); - } -} - - -// -// LLLayoutStack -// -struct LLLayoutStack::LLEmbeddedPanel -{ - LLEmbeddedPanel(LLPanel* panelp, eLayoutOrientation orientation, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize) : - mPanel(panelp), - mMinWidth(min_width), - mMinHeight(min_height), - mAutoResize(auto_resize), - mUserResize(user_resize), - mOrientation(orientation), - mCollapsed(FALSE), - mCollapseAmt(0.f), - mVisibleAmt(1.f) // default to fully visible - { - LLResizeBar::Side side = (orientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM; - LLRect resize_bar_rect = panelp->getRect(); - - S32 min_dim; - if (orientation == HORIZONTAL) - { - min_dim = mMinHeight; - } - else - { - min_dim = mMinWidth; - } - mResizeBar = new LLResizeBar(std::string("resizer"), mPanel, LLRect(), min_dim, S32_MAX, side); - mResizeBar->setEnableSnapping(FALSE); - // panels initialized as hidden should not start out partially visible - if (!mPanel->getVisible()) - { - mVisibleAmt = 0.f; - } - } - - ~LLEmbeddedPanel() - { - // probably not necessary, but... - delete mResizeBar; - mResizeBar = NULL; - } - - F32 getCollapseFactor() - { - if (mOrientation == HORIZONTAL) - { - F32 collapse_amt = - clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinWidth / (F32)llmax(1, mPanel->getRect().getWidth())); - return mVisibleAmt * collapse_amt; - } - else - { - F32 collapse_amt = - clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)mMinHeight / (F32)llmax(1, mPanel->getRect().getHeight()))); - return mVisibleAmt * collapse_amt; - } - } - - LLPanel* mPanel; - S32 mMinWidth; - S32 mMinHeight; - BOOL mAutoResize; - BOOL mUserResize; - BOOL mCollapsed; - LLResizeBar* mResizeBar; - eLayoutOrientation mOrientation; - F32 mVisibleAmt; - F32 mCollapseAmt; -}; - -static LLRegisterWidget<LLLayoutStack> r2("layout_stack"); - -LLLayoutStack::LLLayoutStack(eLayoutOrientation orientation) : - mOrientation(orientation), - mMinWidth(0), - mMinHeight(0), - mPanelSpacing(RESIZE_BAR_HEIGHT) -{ -} - -LLLayoutStack::~LLLayoutStack() -{ - std::for_each(mPanels.begin(), mPanels.end(), DeletePointer()); -} - -void LLLayoutStack::draw() -{ - updateLayout(); - - e_panel_list_t::iterator panel_it; - for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) - { - // clip to layout rectangle, not bounding rectangle - LLRect clip_rect = (*panel_it)->mPanel->getRect(); - // scale clipping rectangle by visible amount - if (mOrientation == HORIZONTAL) - { - clip_rect.mRight = clip_rect.mLeft + llround((F32)clip_rect.getWidth() * (*panel_it)->getCollapseFactor()); - } - else - { - clip_rect.mBottom = clip_rect.mTop - llround((F32)clip_rect.getHeight() * (*panel_it)->getCollapseFactor()); - } - - LLPanel* panelp = (*panel_it)->mPanel; - - LLLocalClipRect clip(clip_rect); - // only force drawing invisible children if visible amount is non-zero - drawChild(panelp, 0, 0, !clip_rect.isNull()); - } -} - -void LLLayoutStack::removeCtrl(LLUICtrl* ctrl) -{ - LLEmbeddedPanel* embedded_panelp = findEmbeddedPanel((LLPanel*)ctrl); - - if (embedded_panelp) - { - mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp)); - delete embedded_panelp; - } - - // need to update resizebars - - calcMinExtents(); - - LLView::removeCtrl(ctrl); -} - -LLXMLNodePtr LLLayoutStack::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLView::getXML(); - return node; -} - -//static -LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string orientation_string("vertical"); - node->getAttributeString("orientation", orientation_string); - - eLayoutOrientation orientation = VERTICAL; - - if (orientation_string == "horizontal") - { - orientation = HORIZONTAL; - } - else if (orientation_string == "vertical") - { - orientation = VERTICAL; - } - else - { - llwarns << "Unknown orientation " << orientation_string << ", using vertical" << llendl; - } - - LLLayoutStack* layout_stackp = new LLLayoutStack(orientation); - - node->getAttributeS32("border_size", layout_stackp->mPanelSpacing); - // don't allow negative spacing values - layout_stackp->mPanelSpacing = llmax(layout_stackp->mPanelSpacing, 0); - - std::string name("stack"); - node->getAttributeString("name", name); - - layout_stackp->setName(name); - layout_stackp->initFromXML(node, parent); - - LLXMLNodePtr child; - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) - { - S32 min_width = 0; - S32 min_height = 0; - BOOL auto_resize = TRUE; - - child->getAttributeS32("min_width", min_width); - child->getAttributeS32("min_height", min_height); - child->getAttributeBOOL("auto_resize", auto_resize); - - if (child->hasName("layout_panel")) - { - BOOL user_resize = TRUE; - child->getAttributeBOOL("user_resize", user_resize); - LLPanel* panelp = (LLPanel*)LLPanel::fromXML(child, layout_stackp, factory); - if (panelp) - { - panelp->setFollowsNone(); - layout_stackp->addPanel(panelp, min_width, min_height, auto_resize, user_resize); - } - } - else - { - BOOL user_resize = FALSE; - child->getAttributeBOOL("user_resize", user_resize); - - LLPanel* panelp = new LLPanel(std::string("auto_panel")); - LLView* new_child = factory->createWidget(panelp, child); - if (new_child) - { - // put child in new embedded panel - layout_stackp->addPanel(panelp, min_width, min_height, auto_resize, user_resize); - // resize panel to contain widget and move widget to be contained in panel - panelp->setRect(new_child->getRect()); - new_child->setOrigin(0, 0); - } - else - { - panelp->die(); - } - } - } - layout_stackp->updateLayout(); - - return layout_stackp; -} - -S32 LLLayoutStack::getDefaultHeight(S32 cur_height) -{ - // if we are spanning our children (crude upward propagation of size) - // then don't enforce our size on our children - if (mOrientation == HORIZONTAL) - { - cur_height = llmax(mMinHeight, getRect().getHeight()); - } - - return cur_height; -} - -S32 LLLayoutStack::getDefaultWidth(S32 cur_width) -{ - // if we are spanning our children (crude upward propagation of size) - // then don't enforce our size on our children - if (mOrientation == VERTICAL) - { - cur_width = llmax(mMinWidth, getRect().getWidth()); - } - - return cur_width; -} - -void LLLayoutStack::addPanel(LLPanel* panel, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize, EAnimate animate, S32 index) +void LLPanel::requires(const std::string& name) { - // panel starts off invisible (collapsed) - if (animate == ANIMATE) - { - panel->setVisible(FALSE); - } - LLEmbeddedPanel* embedded_panel = new LLEmbeddedPanel(panel, mOrientation, min_width, min_height, auto_resize, user_resize); - - mPanels.insert(mPanels.begin() + llclamp(index, 0, (S32)mPanels.size()), embedded_panel); - - addChild(panel); - addChild(embedded_panel->mResizeBar); - - // bring all resize bars to the front so that they are clickable even over the panels - // with a bit of overlap - for (e_panel_list_t::iterator panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) - { - LLResizeBar* resize_barp = (*panel_it)->mResizeBar; - sendChildToFront(resize_barp); - } - - // start expanding panel animation - if (animate == ANIMATE) - { - panel->setVisible(TRUE); - } -} - -void LLLayoutStack::removePanel(LLPanel* panel) -{ - removeChild(panel); + requires<LLView>(name); } -void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed) -{ - LLEmbeddedPanel* panel_container = findEmbeddedPanel(panel); - if (!panel_container) return; - - panel_container->mCollapsed = collapsed; -} - -void LLLayoutStack::updateLayout(BOOL force_resize) -{ - calcMinExtents(); - - // calculate current extents - S32 total_width = 0; - S32 total_height = 0; - - const F32 ANIM_OPEN_TIME = 0.02f; - const F32 ANIM_CLOSE_TIME = 0.03f; - - e_panel_list_t::iterator panel_it; - for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) - { - LLPanel* panelp = (*panel_it)->mPanel; - if (panelp->getVisible()) - { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(ANIM_OPEN_TIME)); - if ((*panel_it)->mVisibleAmt > 0.99f) - { - (*panel_it)->mVisibleAmt = 1.f; - } - } - else // not visible - { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); - if ((*panel_it)->mVisibleAmt < 0.001f) - { - (*panel_it)->mVisibleAmt = 0.f; - } - } - - if ((*panel_it)->mCollapsed) - { - (*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 1.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); - } - else - { - (*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 0.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); - } - - if (mOrientation == HORIZONTAL) - { - // enforce minimize size constraint by default - if (panelp->getRect().getWidth() < (*panel_it)->mMinWidth) - { - panelp->reshape((*panel_it)->mMinWidth, panelp->getRect().getHeight()); - } - total_width += llround(panelp->getRect().getWidth() * (*panel_it)->getCollapseFactor()); - // want n-1 panel gaps for n panels - if (panel_it != mPanels.begin()) - { - total_width += mPanelSpacing; - } - } - else //VERTICAL - { - // enforce minimize size constraint by default - if (panelp->getRect().getHeight() < (*panel_it)->mMinHeight) - { - panelp->reshape(panelp->getRect().getWidth(), (*panel_it)->mMinHeight); - } - total_height += llround(panelp->getRect().getHeight() * (*panel_it)->getCollapseFactor()); - if (panel_it != mPanels.begin()) - { - total_height += mPanelSpacing; - } - } - } - - S32 num_resizable_panels = 0; - S32 shrink_headroom_available = 0; - S32 shrink_headroom_total = 0; - for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) - { - // panels that are not fully visible do not count towards shrink headroom - if ((*panel_it)->getCollapseFactor() < 1.f) - { - continue; - } - - // if currently resizing a panel or the panel is flagged as not automatically resizing - // only track total available headroom, but don't use it for automatic resize logic - if ((*panel_it)->mResizeBar->hasMouseCapture() - || (!(*panel_it)->mAutoResize - && !force_resize)) - { - if (mOrientation == HORIZONTAL) - { - shrink_headroom_total += (*panel_it)->mPanel->getRect().getWidth() - (*panel_it)->mMinWidth; - } - else //VERTICAL - { - shrink_headroom_total += (*panel_it)->mPanel->getRect().getHeight() - (*panel_it)->mMinHeight; - } - } - else - { - num_resizable_panels++; - if (mOrientation == HORIZONTAL) - { - shrink_headroom_available += (*panel_it)->mPanel->getRect().getWidth() - (*panel_it)->mMinWidth; - shrink_headroom_total += (*panel_it)->mPanel->getRect().getWidth() - (*panel_it)->mMinWidth; - } - else //VERTICAL - { - shrink_headroom_available += (*panel_it)->mPanel->getRect().getHeight() - (*panel_it)->mMinHeight; - shrink_headroom_total += (*panel_it)->mPanel->getRect().getHeight() - (*panel_it)->mMinHeight; - } - } - } - - // calculate how many pixels need to be distributed among layout panels - // positive means panels need to grow, negative means shrink - S32 pixels_to_distribute; - if (mOrientation == HORIZONTAL) - { - pixels_to_distribute = getRect().getWidth() - total_width; - } - else //VERTICAL - { - pixels_to_distribute = getRect().getHeight() - total_height; - } - - // now we distribute the pixels... - S32 cur_x = 0; - S32 cur_y = getRect().getHeight(); - - for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) - { - LLPanel* panelp = (*panel_it)->mPanel; - - S32 cur_width = panelp->getRect().getWidth(); - S32 cur_height = panelp->getRect().getHeight(); - S32 new_width = llmax((*panel_it)->mMinWidth, cur_width); - S32 new_height = llmax((*panel_it)->mMinHeight, cur_height); - - S32 delta_size = 0; - - // if panel can automatically resize (not animating, and resize flag set)... - if ((*panel_it)->getCollapseFactor() == 1.f - && (force_resize || (*panel_it)->mAutoResize) - && !(*panel_it)->mResizeBar->hasMouseCapture()) - { - if (mOrientation == HORIZONTAL) - { - // if we're shrinking - if (pixels_to_distribute < 0) - { - // shrink proportionally to amount over minimum - // so we can do this in one pass - delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_width - (*panel_it)->mMinWidth) / (F32)shrink_headroom_available)) : 0; - shrink_headroom_available -= (cur_width - (*panel_it)->mMinWidth); - } - else - { - // grow all elements equally - delta_size = llround((F32)pixels_to_distribute / (F32)num_resizable_panels); - num_resizable_panels--; - } - pixels_to_distribute -= delta_size; - new_width = llmax((*panel_it)->mMinWidth, cur_width + delta_size); - } - else - { - new_width = getDefaultWidth(new_width); - } - - if (mOrientation == VERTICAL) - { - if (pixels_to_distribute < 0) - { - // shrink proportionally to amount over minimum - // so we can do this in one pass - delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_height - (*panel_it)->mMinHeight) / (F32)shrink_headroom_available)) : 0; - shrink_headroom_available -= (cur_height - (*panel_it)->mMinHeight); - } - else - { - delta_size = llround((F32)pixels_to_distribute / (F32)num_resizable_panels); - num_resizable_panels--; - } - pixels_to_distribute -= delta_size; - new_height = llmax((*panel_it)->mMinHeight, cur_height + delta_size); - } - else - { - new_height = getDefaultHeight(new_height); - } - } - else - { - if (mOrientation == HORIZONTAL) - { - new_height = getDefaultHeight(new_height); - } - else // VERTICAL - { - new_width = getDefaultWidth(new_width); - } - } - - // adjust running headroom count based on new sizes - shrink_headroom_total += delta_size; - - panelp->reshape(new_width, new_height); - panelp->setOrigin(cur_x, cur_y - new_height); - - LLRect panel_rect = panelp->getRect(); - LLRect resize_bar_rect = panel_rect; - if (mOrientation == HORIZONTAL) - { - resize_bar_rect.mLeft = panel_rect.mRight - RESIZE_BAR_OVERLAP; - resize_bar_rect.mRight = panel_rect.mRight + mPanelSpacing + RESIZE_BAR_OVERLAP; - } - else - { - resize_bar_rect.mTop = panel_rect.mBottom + RESIZE_BAR_OVERLAP; - resize_bar_rect.mBottom = panel_rect.mBottom - mPanelSpacing - RESIZE_BAR_OVERLAP; - } - (*panel_it)->mResizeBar->setRect(resize_bar_rect); - - if (mOrientation == HORIZONTAL) - { - cur_x += llround(new_width * (*panel_it)->getCollapseFactor()) + mPanelSpacing; - } - else //VERTICAL - { - cur_y -= llround(new_height * (*panel_it)->getCollapseFactor()) + mPanelSpacing; - } - } - - // update resize bars with new limits - LLResizeBar* last_resize_bar = NULL; - for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) - { - LLPanel* panelp = (*panel_it)->mPanel; - - if (mOrientation == HORIZONTAL) - { - (*panel_it)->mResizeBar->setResizeLimits( - (*panel_it)->mMinWidth, - (*panel_it)->mMinWidth + shrink_headroom_total); - } - else //VERTICAL - { - (*panel_it)->mResizeBar->setResizeLimits( - (*panel_it)->mMinHeight, - (*panel_it)->mMinHeight + shrink_headroom_total); - } - - // toggle resize bars based on panel visibility, resizability, etc - BOOL resize_bar_enabled = panelp->getVisible() && (*panel_it)->mUserResize; - (*panel_it)->mResizeBar->setVisible(resize_bar_enabled); - - if (resize_bar_enabled) - { - last_resize_bar = (*panel_it)->mResizeBar; - } - } - - // hide last resize bar as there is nothing past it - // resize bars need to be in between two resizable panels - if (last_resize_bar) - { - last_resize_bar->setVisible(FALSE); - } - - // not enough room to fit existing contents - if (force_resize == FALSE - // layout did not complete by reaching target position - && ((mOrientation == VERTICAL && cur_y != -mPanelSpacing) - || (mOrientation == HORIZONTAL && cur_x != getRect().getWidth() + mPanelSpacing))) - { - // do another layout pass with all stacked elements contributing - // even those that don't usually resize - llassert_always(force_resize == FALSE); - updateLayout(TRUE); - } -} // end LLLayoutStack::updateLayout - - -LLLayoutStack::LLEmbeddedPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const -{ - e_panel_list_t::const_iterator panel_it; - for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) - { - if ((*panel_it)->mPanel == panelp) - { - return *panel_it; - } - } - return NULL; -} - -void LLLayoutStack::calcMinExtents() -{ - mMinWidth = 0; - mMinHeight = 0; - - e_panel_list_t::iterator panel_it; - for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) - { - if (mOrientation == HORIZONTAL) - { - mMinHeight = llmax( mMinHeight, - (*panel_it)->mMinHeight); - mMinWidth += (*panel_it)->mMinWidth; - if (panel_it != mPanels.begin()) - { - mMinWidth += mPanelSpacing; - } - } - else //VERTICAL - { - mMinWidth = llmax( mMinWidth, - (*panel_it)->mMinWidth); - mMinHeight += (*panel_it)->mMinHeight; - if (panel_it != mPanels.begin()) - { - mMinHeight += mPanelSpacing; - } - } - } -} diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index a7c95790307fc1f624fd033d11f7e84b0758cb23..b3ccdd0f00fccad6b9b5a15a31456586fbfba040 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -42,7 +42,6 @@ #include "llviewborder.h" #include "lluistring.h" #include "v4color.h" -#include "llevents.h" #include <list> #include <queue> @@ -57,42 +56,73 @@ const BOOL BORDER_NO = FALSE; * With or without border, * Can contain LLUICtrls. */ -class LLPanel : public LLUICtrl, public LLEventTrackable +class LLPanel : public LLUICtrl { public: + struct LocalizedString : public LLInitParam::Block<LocalizedString> + { + Mandatory<std::string> name; + Mandatory<std::string> text; + + LocalizedString() + : name("name"), + text("value") + {} + }; + + struct Params + : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<bool> has_border; + Optional<LLViewBorder::Params> border; + + Optional<LLUIColor> bg_opaque_color, + bg_alpha_color; + + Optional<bool> background_visible, + background_opaque; + + Optional<S32> min_width, + min_height; + + Optional<std::string> filename; + Optional<std::string> class_name; - // minimal constructor for data-driven initialization - LLPanel(); - LLPanel(const std::string& name); + Multiple<LocalizedString> strings; - // Position and size not saved - LLPanel(const std::string& name, const LLRect& rect, BOOL bordered = TRUE); + Params(); + }; - // Position and size are saved to rect_control - LLPanel(const std::string& name, const std::string& rect_control, BOOL bordered = TRUE); +protected: + friend class LLUICtrlFactory; + // RN: for some reason you can't just use LLUICtrlFactory::getDefaultParams as a default argument in VC8 + static const Params& defaultParams() { return LLUICtrlFactory::getDefaultParams<LLPanel::Params>(); } + + // Panels can get constructed directly + LLPanel(const Params& params = defaultParams()); - /*virtual*/ ~LLPanel(); +public: +// LLPanel(const std::string& name, const LLRect& rect = LLRect(), BOOL bordered = TRUE); + /*virtual*/ ~LLPanel() {} // LLView interface /*virtual*/ BOOL isPanel() const; /*virtual*/ void draw(); /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ); - /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; + // Override to set not found list: - virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; + /*virtual*/ LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; // From LLFocusableElement /*virtual*/ void setFocus( BOOL b ); // New virtuals virtual void refresh(); // called in setFocus() - virtual BOOL postBuild(); virtual void clearCtrls(); // overridden in LLPanelObject and LLPanelVolume // Border controls - void addBorder( LLViewBorder::EBevel border_bevel = LLViewBorder::BEVEL_OUT, - LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE, - S32 border_thickness = LLPANEL_BORDER_WIDTH ); + void addBorder( LLViewBorder::Params p); + void addBorder() { LLViewBorder::Params p; p.border_thickness(LLPANEL_BORDER_WIDTH); addBorder(p); } void removeBorder(); BOOL hasBorder() const { return mBorder != NULL; } void setBorderVisible( BOOL b ); @@ -107,10 +137,7 @@ public: } // requires LLView by default - void requires(const std::string& name) - { - requires<LLView>(name); - } + void requires(const std::string& name); BOOL checkRequirements(); void setBackgroundColor( const LLColor4& color ) { mBgColorOpaque = color; } @@ -127,22 +154,20 @@ public: void setLabel(const LLStringExplicit& label) { mLabel = label; } std::string getLabel() const { return mLabel; } - void setRectControl(const std::string& rect_control) { mRectControl.assign(rect_control); } - const std::string& getRectControl() const { return mRectControl; } - void storeRectControl(); - void setCtrlsEnabled(BOOL b); LLHandle<LLPanel> getHandle() const { return mPanelHandle; } - S32 getLastTabGroup() const { return mLastTabGroup; } - const LLCallbackMap::map_t& getFactoryMap() const { return mFactoryMap; } - - BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - void initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory); - void setPanelParameters(LLXMLNodePtr node, LLView *parentp); - + + CommitCallbackRegistry::ScopedRegistrar& getCommitCallbackRegistrar() { return mCommitCallbackRegistrar; } + EnableCallbackRegistry::ScopedRegistrar& getEnableCallbackRegistrar() { return mEnableCallbackRegistrar; } + + void initFromParams(const Params& p); + BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL); + /*virtual*/ const widget_registry_t& getChildRegistry() const; + + bool hasString(const std::string& name); std::string getString(const std::string& name, const LLStringUtil::format_map_t& args) const; std::string getString(const std::string& name) const; @@ -167,12 +192,10 @@ public: // LLUICtrl void childSetFocus(const std::string& id, BOOL focus = TRUE); BOOL childHasFocus(const std::string& id); - void childSetFocusChangedCallback(const std::string& id, void (*cb)(LLFocusableElement*, void*), void* user_data = NULL); - void childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void* userdata = NULL ); - void childSetDoubleClickCallback(const std::string& id, void (*cb)(void*), void* userdata = NULL ); - void childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*) ); - void childSetUserData(const std::string& id, void* userdata); + // *TODO: Deprecate; for backwards compatability only: + void childSetCommitCallback(const std::string& id, boost::function<void (LLUICtrl*,void*)> cb, void* data); + void childSetValidate(const std::string& id, boost::function<bool (const LLSD& data)> cb ); void childSetColor(const std::string& id, const LLColor4& color); @@ -197,21 +220,21 @@ public: // LLTabContainer void childShowTab(const std::string& id, const std::string& tabname, bool visible = true); LLPanel *childGetVisibleTab(const std::string& id) const; - void childSetTabChangeCallback(const std::string& id, const std::string& tabname, void (*on_tab_clicked)(void*, bool), void *userdata, void (*on_precommit)(void*,bool) = NULL); // LLTextBox void childSetWrappedText(const std::string& id, const std::string& text, bool visible = true); // LLTextBox/LLTextEditor/LLLineEditor void childSetText(const std::string& id, const LLStringExplicit& text) { childSetValue(id, LLSD(text)); } + + // *NOTE: Does not return text from <string> tags, use getString() std::string childGetText(const std::string& id) const { return childGetValue(id).asString(); } // LLLineEditor - void childSetKeystrokeCallback(const std::string& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data); void childSetPrevalidate(const std::string& id, BOOL (*func)(const LLWString &) ); // LLButton - void childSetAction(const std::string& id, void(*function)(void*), void* value); + void childSetAction(const std::string& id, boost::function<void(void*)> function, void* value = NULL); void childSetActionTextbox(const std::string& id, void(*function)(void*), void* value = NULL); void childSetControlName(const std::string& id, const std::string& control_name); @@ -219,36 +242,31 @@ public: void childNotFound(const std::string& id) const; void childDisplayNotFound(); - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); + static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL); + + //call onOpen to let panel know when it's about to be shown or activated + virtual void onOpen(const LLSD& key) {} protected: // Override to set not found list LLButton* getDefaultButton() { return mDefaultBtn; } LLCallbackMap::map_t mFactoryMap; - + CommitCallbackRegistry::ScopedRegistrar mCommitCallbackRegistrar; + EnableCallbackRegistry::ScopedRegistrar mEnableCallbackRegistrar; + private: - // common construction logic - void init(); - - // From LLView - virtual void addCtrl( LLUICtrl* ctrl, S32 tab_group ); - virtual void addCtrlAtEnd( LLUICtrl* ctrl, S32 tab_group); - // Unified error reporting for the child* functions typedef std::set<std::string> expected_members_list_t; mutable expected_members_list_t mExpectedMembers; mutable expected_members_list_t mNewExpectedMembers; - std::string mRectControl; LLColor4 mBgColorAlpha; LLColor4 mBgColorOpaque; - LLColor4 mDefaultBtnHighlight; BOOL mBgVisible; BOOL mBgOpaque; LLViewBorder* mBorder; LLButton* mDefaultBtn; - std::string mLabel; - S32 mLastTabGroup; + LLUIString mLabel; LLRootHandle<LLPanel> mPanelHandle; typedef std::map<std::string, std::string> ui_string_map_t; @@ -258,56 +276,4 @@ private: }; // end class LLPanel - -class LLLayoutStack : public LLView -{ -public: - typedef enum e_layout_orientation - { - HORIZONTAL, - VERTICAL - } eLayoutOrientation; - - LLLayoutStack(eLayoutOrientation orientation); - virtual ~LLLayoutStack(); - - /*virtual*/ void draw(); - /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; - /*virtual*/ void removeCtrl(LLUICtrl* ctrl); - - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - - S32 getMinWidth() const { return mMinWidth; } - S32 getMinHeight() const { return mMinHeight; } - - typedef enum e_animate - { - NO_ANIMATE, - ANIMATE - } EAnimate; - - void addPanel(LLPanel* panel, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize, EAnimate animate = NO_ANIMATE, S32 index = S32_MAX); - void removePanel(LLPanel* panel); - void collapsePanel(LLPanel* panel, BOOL collapsed = TRUE); - S32 getNumPanels() { return mPanels.size(); } - -private: - struct LLEmbeddedPanel; - - void updateLayout(BOOL force_resize = FALSE); - void calcMinExtents(); - S32 getDefaultHeight(S32 cur_height); - S32 getDefaultWidth(S32 cur_width); - - const eLayoutOrientation mOrientation; - - typedef std::vector<LLEmbeddedPanel*> e_panel_list_t; - e_panel_list_t mPanels; - LLEmbeddedPanel* findEmbeddedPanel(LLPanel* panelp) const; - - S32 mMinWidth; - S32 mMinHeight; - S32 mPanelSpacing; -}; // end class LLLayoutStack - #endif diff --git a/indra/llui/llprogressbar.cpp b/indra/llui/llprogressbar.cpp index 8833494af8497ec1ddd164b4c0677522b37e9b7d..779967940af22721b97408db25e78aa1e9f98eb7 100644 --- a/indra/llui/llprogressbar.cpp +++ b/indra/llui/llprogressbar.cpp @@ -44,26 +44,32 @@ #include "llglheaders.h" #include "llfocusmgr.h" - -static LLRegisterWidget<LLProgressBar> r("progress_bar"); - -LLProgressBar::LLProgressBar(const std::string& name, const LLRect &rect) - : LLView(name, rect, FALSE), - mImageBar( NULL ), - mImageShadow( NULL ) -{ - mPercentDone = 0.f; - - // Defaults: - - setImageBar("rounded_square.tga"); - setImageShadow("rounded_square_soft.tga"); - - mColorBackground = LLColor4(0.3254f, 0.4000f, 0.5058f, 1.0f); - mColorBar = LLColor4(0.5764f, 0.6627f, 0.8352f, 1.0f); - mColorBar2 = LLColor4(0.5764f, 0.6627f, 0.8352f, 1.0f); - mColorShadow = LLColor4(0.2000f, 0.2000f, 0.4000f, 1.0f); -} +#include "lluictrlfactory.h" + +static LLDefaultWidgetRegistry::Register<LLProgressBar> r("progress_bar"); + +LLProgressBar::Params::Params() +: image_bar("image_bar"), + image_fill("image_fill"), + image_shadow("image_shadow"), + color_bar("color_bar"), + color_bar2("color_bar2"), + color_shadow("color_shadow"), + color_bg("color_bg") +{} + + +LLProgressBar::LLProgressBar(const LLProgressBar::Params& p) +: LLView(p), + mImageBar(p.image_bar), + mImageShadow(p.image_shadow), + mImageFill(p.image_fill), + mColorBackground(p.color_bg()), + mColorBar(p.color_bar()), + mColorBar2(p.color_bar2()), + mColorShadow(p.color_shadow()), + mPercentDone(0.f) +{} LLProgressBar::~LLProgressBar() { @@ -74,108 +80,19 @@ void LLProgressBar::draw() { static LLTimer timer; - LLUIImagePtr shadow_imagep = LLUI::getUIImage("rounded_square_soft.tga"); LLUIImagePtr bar_fg_imagep = LLUI::getUIImage("progressbar_fill.tga"); - LLUIImagePtr bar_bg_imagep = LLUI::getUIImage("progressbar_track.tga"); - LLUIImagePtr bar_imagep = LLUI::getUIImage("rounded_square.tga"); - LLColor4 background_color = LLUI::sColorsGroup->getColor("LoginProgressBarBgColor"); - bar_bg_imagep->draw(getLocalRect(), - background_color); + mImageBar->draw(getLocalRect(), mColorBackground.get()); F32 alpha = 0.5f + 0.5f*0.5f*(1.f + (F32)sin(3.f*timer.getElapsedTimeF32())); - LLColor4 bar_color = LLUI::sColorsGroup->getColor("LoginProgressBarFgColor"); + LLColor4 bar_color = mColorBar.get(); bar_color.mV[3] = alpha; LLRect progress_rect = getLocalRect(); progress_rect.mRight = llround(getRect().getWidth() * (mPercentDone / 100.f)); - bar_fg_imagep->draw(progress_rect); + mImageFill->draw(progress_rect); } void LLProgressBar::setPercent(const F32 percent) { mPercentDone = llclamp(percent, 0.f, 100.f); } - -void LLProgressBar::setImageBar( const std::string &bar_name ) -{ - mImageBar = LLUI::sImageProvider->getUIImage(bar_name)->getImage(); -} - -void LLProgressBar::setImageShadow(const std::string &shadow_name) -{ - mImageShadow = LLUI::sImageProvider->getUIImage(shadow_name)->getImage(); -} - -void LLProgressBar::setColorBar(const LLColor4 &c) -{ - mColorBar = c; -} -void LLProgressBar::setColorBar2(const LLColor4 &c) -{ - mColorBar2 = c; -} -void LLProgressBar::setColorShadow(const LLColor4 &c) -{ - mColorShadow = c; -} -void LLProgressBar::setColorBackground(const LLColor4 &c) -{ - mColorBackground = c; -} - - -// static -LLView* LLProgressBar::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("progress_bar"); - node->getAttributeString("name", name); - - LLProgressBar *progress = new LLProgressBar(name, LLRect()); - - - std::string image_bar; - if (node->hasAttribute("image_bar")) node->getAttributeString("image_bar",image_bar); - if (image_bar != LLStringUtil::null) progress->setImageBar(image_bar); - - - std::string image_shadow; - if (node->hasAttribute("image_shadow")) node->getAttributeString("image_shadow",image_shadow); - if (image_shadow != LLStringUtil::null) progress->setImageShadow(image_shadow); - - - LLColor4 color_bar; - if (node->hasAttribute("color_bar")) - { - node->getAttributeColor4("color_bar",color_bar); - progress->setColorBar(color_bar); - } - - - LLColor4 color_bar2; - if (node->hasAttribute("color_bar2")) - { - node->getAttributeColor4("color_bar2",color_bar2); - progress->setColorBar2(color_bar2); - } - - - LLColor4 color_shadow; - if (node->hasAttribute("color_shadow")) - { - node->getAttributeColor4("color_shadow",color_shadow); - progress->setColorShadow(color_shadow); - } - - - LLColor4 color_bg; - if (node->hasAttribute("color_bg")) - { - node->getAttributeColor4("color_bg",color_bg); - progress->setColorBackground(color_bg); - } - - - progress->initFromXML(node, parent); - - return progress; -} diff --git a/indra/llui/llprogressbar.h b/indra/llui/llprogressbar.h index 00ad61d540895026e75473b671a33fdb6309e811..5c2f73ef9e08319a88b23824391eae3e6c4cf2dd 100644 --- a/indra/llui/llprogressbar.h +++ b/indra/llui/llprogressbar.h @@ -40,37 +40,38 @@ class LLProgressBar : public LLView { public: - LLProgressBar(const std::string& name, const LLRect &rect); - virtual ~LLProgressBar(); - - void setPercent(const F32 percent); + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Optional<LLUIImage*> image_bar, + image_fill, + image_shadow; - void setImageBar(const std::string &bar_name); - void setImageShadow(const std::string &shadow_name); + Optional<LLUIColor> color_bar, + color_bar2, + color_shadow, + color_bg; - void setColorBar(const LLColor4 &c); - void setColorBar2(const LLColor4 &c); - void setColorShadow(const LLColor4 &c); - void setColorBackground(const LLColor4 &c); + Params(); + }; + LLProgressBar(const Params&); + virtual ~LLProgressBar(); - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); + void setPercent(const F32 percent); /*virtual*/ void draw(); -protected: +private: F32 mPercentDone; - LLPointer<LLImageGL> mImageBar; - //LLUUID mImageBarID; - //LLString mImageBarName; - LLColor4 mColorBar; - LLColor4 mColorBar2; + LLPointer<LLUIImage> mImageBar; + LLUIColor mColorBar; + LLUIColor mColorBar2; - LLPointer<LLImageGL> mImageShadow; - //LLUUID mImageShadowID; - //LLString mImageShadowName; - LLColor4 mColorShadow; - LLColor4 mColorBackground; + LLPointer<LLUIImage> mImageShadow; + LLUIColor mColorShadow; + LLUIColor mColorBackground; + + LLPointer<LLUIImage> mImageFill; }; #endif // LL_LLPROGRESSBAR_H diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index 33b93985d72f52bf9e7505d3d26f8798ca545b4d..70f98bd90850f62846ae8a799e8c427a6b762ad7 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -42,52 +42,60 @@ #include "llcontrol.h" #include "llui.h" #include "llfocusmgr.h" +#include "lluictrlfactory.h" -static LLRegisterWidget<LLRadioGroup> r("radio_group"); +static LLDefaultWidgetRegistry::Register<LLRadioGroup> r1("radio_group"); -LLRadioGroup::LLRadioGroup(const std::string& name, const LLRect& rect, - const std::string& control_name, - LLUICtrlCallback callback, - void* userdata, - BOOL border) -: LLUICtrl(name, rect, TRUE, callback, userdata, FOLLOWS_LEFT | FOLLOWS_TOP), - mSelectedIndex(0) -{ - setControlName(control_name, NULL); - init(border); -} +struct RadioGroupRegistry : public LLWidgetRegistry<RadioGroupRegistry> +{}; + +static RadioGroupRegistry::Register<LLRadioCtrl> register_radio_ctrl("radio_item"); -LLRadioGroup::LLRadioGroup(const std::string& name, const LLRect& rect, - S32 initial_index, - LLUICtrlCallback callback, - void* userdata, - BOOL border) : - LLUICtrl(name, rect, TRUE, callback, userdata, FOLLOWS_LEFT | FOLLOWS_TOP), - mSelectedIndex(initial_index) + + +LLRadioGroup::Params::Params() +: has_border("draw_border") { - init(border); + name = "radio_group"; + mouse_opaque = true; + follows.flags = FOLLOWS_LEFT | FOLLOWS_TOP; } -void LLRadioGroup::init(BOOL border) -{ - if (border) +LLRadioGroup::LLRadioGroup(const LLRadioGroup::Params& p) +: LLUICtrl(p), + mFont(p.font.isProvided() ? p.font() : LLFontGL::getFontSansSerifSmall()), + mSelectedIndex(-1), + mHasBorder(p.has_border) +{ + if (mHasBorder) { - addChild( new LLViewBorder( std::string("radio group border"), - LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), - LLViewBorder::BEVEL_NONE, - LLViewBorder::STYLE_LINE, - 1 ) ); + LLViewBorder::Params params; + params.name("radio group border"); + params.rect(LLRect(0, getRect().getHeight(), getRect().getWidth(), 0)); + params.bevel_type(LLViewBorder::BEVEL_NONE); + LLViewBorder * vb = LLUICtrlFactory::create<LLViewBorder> (params); + addChild (vb); } - mHasBorder = border; } - - - LLRadioGroup::~LLRadioGroup() { } +const widget_registry_t& LLRadioGroup::getChildRegistry() const +{ + return RadioGroupRegistry::instance(); +} + +// virtual +BOOL LLRadioGroup::postBuild() +{ + if (mControlVariable) + { + setSelectedIndex(mControlVariable->getValue().asInteger()); + } + return TRUE; +} // virtual void LLRadioGroup::setEnabled(BOOL enabled) @@ -250,48 +258,52 @@ void LLRadioGroup::draw() LLView::draw(); } - -// When adding a button, we need to ensure that the radio +// When adding a child button, we need to ensure that the radio // group gets a message when the button is clicked. -LLRadioCtrl* LLRadioGroup::addRadioButton(const std::string& name, const std::string& label, const LLRect& rect, const LLFontGL* font ) + +/*virtual*/ +bool LLRadioGroup::addChild(LLView* view, S32 tab_group) { - // Highlight will get fixed in draw method above - LLRadioCtrl* radio = new LLRadioCtrl(name, rect, label, font, - onClickButton, this); - addChild(radio); - mRadioButtons.push_back(radio); - return radio; + bool res = LLView::addChild(view, tab_group); + if (res) + { + LLRadioCtrl* radio_ctrl = dynamic_cast<LLRadioCtrl*>(view); + if (radio_ctrl) + { + radio_ctrl->setFont(mFont); + radio_ctrl->setCommitCallback(boost::bind(&LLRadioGroup::onClickButton, this, _1)); + mRadioButtons.push_back(radio_ctrl); + } + } + return res; } // Handle one button being clicked. All child buttons must have this // function as their callback function. -// static -void LLRadioGroup::onClickButton(LLUICtrl* ui_ctrl, void* userdata) +void LLRadioGroup::onClickButton(LLUICtrl* ctrl) { // llinfos << "LLRadioGroup::onClickButton" << llendl; - - LLRadioCtrl* clickedRadio = (LLRadioCtrl*) ui_ctrl; - LLRadioGroup* self = (LLRadioGroup*) userdata; - - S32 counter = 0; - for (button_list_t::iterator iter = self->mRadioButtons.begin(); - iter != self->mRadioButtons.end(); ++iter) + LLRadioCtrl* clicked_radio = dynamic_cast<LLRadioCtrl*>(ctrl); + if (!clicked_radio) + return; + S32 index = 0; + for (button_list_t::iterator iter = mRadioButtons.begin(); + iter != mRadioButtons.end(); ++iter) { LLRadioCtrl* radio = *iter; - if (radio == clickedRadio) + if (radio == clicked_radio) { - // llinfos << "clicked button " << counter << llendl; - self->setSelectedIndex(counter); - self->setControlValue(counter); + // llinfos << "clicked button " << index << llendl; + setSelectedIndex(index); // BUG: Calls click callback even if button didn't actually change - self->onCommit(); + onCommit(); return; } - counter++; + index++; } llwarns << "LLRadioGroup::onClickButton - clicked button that isn't a child" << llendl; @@ -340,107 +352,6 @@ LLSD LLRadioGroup::getValue() const return LLSD(); } -// virtual -LLXMLNodePtr LLRadioGroup::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - // Attributes - - node->createChild("draw_border", TRUE)->setBoolValue(mHasBorder); - - // Contents - - for (button_list_t::const_iterator iter = mRadioButtons.begin(); - iter != mRadioButtons.end(); ++iter) - { - LLRadioCtrl* radio = *iter; - - LLXMLNodePtr child_node = radio->LLView::getXML(); - child_node->setStringValue(radio->getLabel()); - child_node->setName(std::string("radio_item")); - - node->addChild(child_node); - } - - return node; -} - -// static -LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("radio_group"); - node->getAttributeString("name", name); - - U32 initial_value = 0; - node->getAttributeU32("initial_value", initial_value); - - BOOL draw_border = TRUE; - node->getAttributeBOOL("draw_border", draw_border); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - LLRadioGroup* radio_group = new LLRadioGroup(name, - rect, - initial_value, - NULL, - NULL, - draw_border); - - const std::string& contents = node->getValue(); - - LLRect group_rect = radio_group->getRect(); - - LLFontGL *font = LLView::selectFont(node); - - if (contents.find_first_not_of(" \n\t") != contents.npos) - { - // ...old school default vertical layout - typedef boost::tokenizer<boost::char_separator<char> > tokenizer; - boost::char_separator<char> sep("\t\n"); - tokenizer tokens(contents, sep); - tokenizer::iterator token_iter = tokens.begin(); - - const S32 HPAD = 4, VPAD = 4; - S32 cur_y = group_rect.getHeight() - VPAD; - - while(token_iter != tokens.end()) - { - const std::string& line = *token_iter; - LLRect rect(HPAD, cur_y, group_rect.getWidth() - (2 * HPAD), cur_y - 15); - cur_y -= VPAD + 15; - radio_group->addRadioButton(std::string("radio"), line, rect, font); - ++token_iter; - } - llwarns << "Legacy radio group format used! Please convert to use <radio_item> tags!" << llendl; - } - else - { - // ...per pixel layout - LLXMLNodePtr child; - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) - { - if (child->hasName("radio_item")) - { - LLRect item_rect; - createRect(child, item_rect, radio_group, rect); - - std::string radioname("radio"); - child->getAttributeString("name", radioname); - std::string item_label = child->getTextContents(); - LLRadioCtrl* radio = radio_group->addRadioButton(radioname, item_label, item_rect, font); - - radio->initFromXML(child, radio_group); - } - } - } - - radio_group->initFromXML(node, parent); - - return radio_group; -} - // LLCtrlSelectionInterface functions BOOL LLRadioGroup::setCurrentByID( const LLUUID& id ) { @@ -504,6 +415,22 @@ BOOL LLRadioGroup::operateOnAll(EOperation op) return FALSE; } +LLRadioCtrl::LLRadioCtrl(const LLRadioCtrl::Params& p) + : LLCheckBoxCtrl(p) +{ +} + +BOOL LLRadioCtrl::postBuild() +{ + // Old-style radio_item used the text contents to indicate the label, + // but new-style radio_item uses label attribute. + std::string value = getValue().asString(); + if (!value.empty()) + { + setLabel(value); + } + return TRUE; +} LLRadioCtrl::~LLRadioCtrl() { @@ -515,3 +442,19 @@ void LLRadioCtrl::setValue(const LLSD& value) mButton->setTabStop(value.asBoolean()); } +// *TODO: Remove this function after the initial XUI XML re-export pass. +// static +void LLRadioCtrl::setupParamsForExport(Params& p, LLView* parent) +{ + std::string label = p.label; + if (label.empty()) + { + // We don't have a label attribute, so move the text contents + // stored in "value" into the label + std::string initial_value = p.LLUICtrl::Params::initial_value(); + p.label = initial_value; + p.LLUICtrl::Params::initial_value = LLSD(); + } + + LLCheckBoxCtrl::setupParamsForExport(p, parent); +} diff --git a/indra/llui/llradiogroup.h b/indra/llui/llradiogroup.h index 3410b74104737ae1afbcf99c7d61f8aa73520369..d3cb8a628e9d15d8653574aa8a460a63535e6136 100644 --- a/indra/llui/llradiogroup.h +++ b/indra/llui/llradiogroup.h @@ -39,22 +39,36 @@ /* - * A checkbox control with use_radio_style == true. + * An invisible view containing multiple mutually exclusive toggling + * buttons (usually radio buttons). Automatically handles the mutex + * condition by highlighting only one button at a time. */ class LLRadioCtrl : public LLCheckBoxCtrl { public: - LLRadioCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLFontGL* font = NULL, - void (*commit_callback)(LLUICtrl*, void*) = NULL, void* callback_userdata = NULL) : - LLCheckBoxCtrl(name, rect, label, font, commit_callback, callback_userdata, FALSE, RADIO_STYLE) + struct Params : public LLInitParam::Block<Params, LLCheckBoxCtrl::Params> { - setTabStop(FALSE); - } - /*virtual*/ ~LLRadioCtrl(); + Deprecated length; + Deprecated type; + + Params() + : length("length"), + type("type") + {} + }; + /*virtual*/ ~LLRadioCtrl(); /*virtual*/ void setValue(const LLSD& value); -}; + /*virtual*/ BOOL postBuild(); + + // Ensure label is in an attribute, not the contents + static void setupParamsForExport(Params& p, LLView* parent); + +protected: + LLRadioCtrl(const Params& p); + friend class LLUICtrlFactory; +}; /* * An invisible view containing multiple mutually exclusive toggling @@ -65,30 +79,27 @@ class LLRadioGroup : public LLUICtrl, public LLCtrlSelectionInterface { public: - // Build a radio group. The number (0...n-1) of the currently selected - // element will be stored in the named control. After the control is - // changed the callback will be called. - LLRadioGroup(const std::string& name, const LLRect& rect, - const std::string& control_name, - LLUICtrlCallback callback = NULL, - void* userdata = NULL, - BOOL border = TRUE); - - // Another radio group constructor, but this one doesn't rely on - // needing a control - LLRadioGroup(const std::string& name, const LLRect& rect, - S32 initial_index, - LLUICtrlCallback callback = NULL, - void* userdata = NULL, - BOOL border = TRUE); - virtual ~LLRadioGroup(); + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<bool> has_border; + Params(); + }; + +protected: + LLRadioGroup(const Params&); + friend class LLUICtrlFactory; +public: + virtual ~LLRadioGroup(); + + virtual BOOL postBuild(); + + virtual bool addChild(LLView* view, S32 tab_group = 0); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual void setEnabled(BOOL enabled); - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); void setIndexEnabled(S32 index, BOOL enabled); // return the index value of the selected item @@ -104,14 +115,11 @@ public: // Draw the group, but also fix the highlighting based on the control. void draw(); - // You must use this method to add buttons to a radio group. - // Don't use addChild -- it won't set the callback function - // correctly. - LLRadioCtrl* addRadioButton(const std::string& name, const std::string& label, const LLRect& rect, const LLFontGL* font); - LLRadioCtrl* getRadioButton(const S32& index) { return mRadioButtons[index]; } // Update the control as needed. Userdata must be a pointer to the button. - static void onClickButton(LLUICtrl* radio, void* userdata); + void onClickButton(LLUICtrl* clicked_radio); + virtual const widget_registry_t& getChildRegistry() const; + //======================================================================== LLCtrlSelectionInterface* getSelectionInterface() { return (LLCtrlSelectionInterface*)this; }; @@ -131,9 +139,7 @@ public: /*virtual*/ BOOL operateOnAll(EOperation op); private: - // protected function shared by the two constructors. - void init(BOOL border); - + const LLFontGL* mFont; S32 mSelectedIndex; typedef std::vector<LLRadioCtrl*> button_list_t; button_list_t mRadioButtons; @@ -141,5 +147,4 @@ private: BOOL mHasBorder; }; - #endif diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index 5b9fe72e99f7c497335bc150b1b1c0ae67117561..304ac64f312347aee7103a4d047891efa5546015 100644 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -40,22 +40,22 @@ #include "llfocusmgr.h" #include "llwindow.h" -LLResizeBar::LLResizeBar( const std::string& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side ) - : - LLView( name, rect, TRUE ), +LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) +: LLView(p), mDragLastScreenX( 0 ), mDragLastScreenY( 0 ), mLastMouseScreenX( 0 ), mLastMouseScreenY( 0 ), - mMinSize( min_size ), - mMaxSize( max_size ), - mSide( side ), - mSnappingEnabled(TRUE), - mAllowDoubleClickSnapping(TRUE), - mResizingView(resizing_view) + mMinSize( p.min_size ), + mMaxSize( p.max_size ), + mSide( p.side ), + mSnappingEnabled(p.snapping_enabled), + mAllowDoubleClickSnapping(p.allow_double_click_snapping), + mResizingView(p.resizing_view) { + setFollowsNone(); // set up some generically good follow code. - switch( side ) + switch( mSide ) { case LEFT: setFollowsLeft(); @@ -80,8 +80,6 @@ LLResizeBar::LLResizeBar( const std::string& name, LLView* resizing_view, const default: break; } - // this is just a decorator - setSaveToXML(FALSE); } @@ -185,30 +183,31 @@ BOOL LLResizeBar::handleHover(S32 x, S32 y, MASK mask) if (mSnappingEnabled) { + static LLUICachedControl<S32> snap_margin ("SnapMargin", 0); switch( mSide ) { case LEFT: - snap_view = mResizingView->findSnapEdge(scaled_rect.mLeft, mouse_dir, SNAP_LEFT, SNAP_PARENT_AND_SIBLINGS, LLUI::sConfigGroup->getS32("SnapMargin")); + snap_view = mResizingView->findSnapEdge(scaled_rect.mLeft, mouse_dir, SNAP_LEFT, SNAP_PARENT_AND_SIBLINGS, snap_margin); break; case TOP: - snap_view = mResizingView->findSnapEdge(scaled_rect.mTop, mouse_dir, SNAP_TOP, SNAP_PARENT_AND_SIBLINGS, LLUI::sConfigGroup->getS32("SnapMargin")); + snap_view = mResizingView->findSnapEdge(scaled_rect.mTop, mouse_dir, SNAP_TOP, SNAP_PARENT_AND_SIBLINGS, snap_margin); break; case RIGHT: - snap_view = mResizingView->findSnapEdge(scaled_rect.mRight, mouse_dir, SNAP_RIGHT, SNAP_PARENT_AND_SIBLINGS, LLUI::sConfigGroup->getS32("SnapMargin")); + snap_view = mResizingView->findSnapEdge(scaled_rect.mRight, mouse_dir, SNAP_RIGHT, SNAP_PARENT_AND_SIBLINGS, snap_margin); break; case BOTTOM: - snap_view = mResizingView->findSnapEdge(scaled_rect.mBottom, mouse_dir, SNAP_BOTTOM, SNAP_PARENT_AND_SIBLINGS, LLUI::sConfigGroup->getS32("SnapMargin")); + snap_view = mResizingView->findSnapEdge(scaled_rect.mBottom, mouse_dir, SNAP_BOTTOM, SNAP_PARENT_AND_SIBLINGS, snap_margin); break; } } // register "snap" behavior with snapped view - mResizingView->snappedTo(snap_view); + mResizingView->setSnappedTo(snap_view); // restore original rectangle so the appropriate changes are detected mResizingView->setRect(orig_rect); // change view shape as user operation - mResizingView->userSetShape(scaled_rect); + mResizingView->setShape(scaled_rect, true); // update last valid mouse cursor position based on resized view's actual size LLRect new_rect = mResizingView->getRect(); @@ -284,7 +283,7 @@ BOOL LLResizeBar::handleDoubleClick(S32 x, S32 y, MASK mask) break; } - mResizingView->userSetShape(scaled_rect); + mResizingView->setShape(scaled_rect, true); } return TRUE; diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h index b9fc40593dd3221c9a203bf0dd1e0e9e15d14af8..4ad3d5035ac59327e7652c4566b1fe6b17f593a1 100644 --- a/indra/llui/llresizebar.h +++ b/indra/llui/llresizebar.h @@ -41,7 +41,31 @@ class LLResizeBar : public LLView public: enum Side { LEFT, TOP, RIGHT, BOTTOM }; - LLResizeBar(const std::string& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side ); + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Mandatory<LLView*> resizing_view; + Mandatory<Side> side; + + Optional<S32> min_size; + Optional<S32> max_size; + Optional<bool> snapping_enabled; + Optional<bool> allow_double_click_snapping; + + Params() + : max_size("", S32_MAX), + snapping_enabled("", true), + resizing_view("resizing_view"), + side("side"), + allow_double_click_snapping("", true) + { + name = "resize_bar"; + } + }; + +protected: + LLResizeBar(const LLResizeBar::Params& p); + friend class LLUICtrlFactory; +public: // virtual void draw(); No appearance virtual BOOL handleHover(S32 x, S32 y, MASK mask); diff --git a/indra/llui/llresizehandle.cpp b/indra/llui/llresizehandle.cpp index c5d57d8d6c4843d317f9799a43c94ee49e64e339..943e2f55f1d1f5c6c41300ead6b95b1f1bfa2763 100644 --- a/indra/llui/llresizehandle.cpp +++ b/indra/llui/llresizehandle.cpp @@ -44,37 +44,37 @@ const S32 RESIZE_BORDER_WIDTH = 3; -LLResizeHandle::LLResizeHandle( const std::string& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner ) - : - LLView( name, rect, TRUE ), +LLResizeHandle::Params::Params() +: corner("corner") +{ + name = "resize_handle"; +} + +LLResizeHandle::LLResizeHandle(const LLResizeHandle::Params& p) +: LLView(p), mDragLastScreenX( 0 ), mDragLastScreenY( 0 ), mLastMouseScreenX( 0 ), mLastMouseScreenY( 0 ), mImage( NULL ), - mMinWidth( min_width ), - mMinHeight( min_height ), - mCorner( corner ) + mMinWidth( p.min_width ), + mMinHeight( p.min_height ), + mCorner( p.corner ) { - setSaveToXML(false); - if( RIGHT_BOTTOM == mCorner) { - mImage = LLUI::sImageProvider->getUIImage("UIImgResizeBottomRightUUID"); + mImage = LLUI::getUIImage("resize_handle_bottom_right_blue.tga"); } - - switch( mCorner ) + switch( p.corner ) { - case LEFT_TOP: setFollows( FOLLOWS_LEFT | FOLLOWS_TOP ); break; - case LEFT_BOTTOM: setFollows( FOLLOWS_LEFT | FOLLOWS_BOTTOM ); break; - case RIGHT_TOP: setFollows( FOLLOWS_RIGHT | FOLLOWS_TOP ); break; - case RIGHT_BOTTOM: setFollows( FOLLOWS_RIGHT | FOLLOWS_BOTTOM ); break; + case LEFT_TOP: setFollows( FOLLOWS_LEFT | FOLLOWS_TOP ); break; + case LEFT_BOTTOM: setFollows( FOLLOWS_LEFT | FOLLOWS_BOTTOM ); break; + case RIGHT_TOP: setFollows( FOLLOWS_RIGHT | FOLLOWS_TOP ); break; + case RIGHT_BOTTOM: setFollows( FOLLOWS_RIGHT | FOLLOWS_BOTTOM ); break; } - - // decorator object, don't serialize - setSaveToXML(FALSE); } + BOOL LLResizeHandle::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; @@ -205,36 +205,37 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask) LLView* snap_view = NULL; LLView* test_view = NULL; + static LLUICachedControl<S32> snap_margin ("SnapMargin", 0); // now do snapping switch(mCorner) { case LEFT_TOP: - snap_view = resizing_view->findSnapEdge(scaled_rect.mLeft, mouse_dir, SNAP_LEFT, SNAP_PARENT_AND_SIBLINGS, LLUI::sConfigGroup->getS32("SnapMargin")); - test_view = resizing_view->findSnapEdge(scaled_rect.mTop, mouse_dir, SNAP_TOP, SNAP_PARENT_AND_SIBLINGS, LLUI::sConfigGroup->getS32("SnapMargin")); + snap_view = resizing_view->findSnapEdge(scaled_rect.mLeft, mouse_dir, SNAP_LEFT, SNAP_PARENT_AND_SIBLINGS, snap_margin); + test_view = resizing_view->findSnapEdge(scaled_rect.mTop, mouse_dir, SNAP_TOP, SNAP_PARENT_AND_SIBLINGS, snap_margin); if (!snap_view) { snap_view = test_view; } break; case LEFT_BOTTOM: - snap_view = resizing_view->findSnapEdge(scaled_rect.mLeft, mouse_dir, SNAP_LEFT, SNAP_PARENT_AND_SIBLINGS, LLUI::sConfigGroup->getS32("SnapMargin")); - test_view = resizing_view->findSnapEdge(scaled_rect.mBottom, mouse_dir, SNAP_BOTTOM, SNAP_PARENT_AND_SIBLINGS, LLUI::sConfigGroup->getS32("SnapMargin")); + snap_view = resizing_view->findSnapEdge(scaled_rect.mLeft, mouse_dir, SNAP_LEFT, SNAP_PARENT_AND_SIBLINGS, snap_margin); + test_view = resizing_view->findSnapEdge(scaled_rect.mBottom, mouse_dir, SNAP_BOTTOM, SNAP_PARENT_AND_SIBLINGS, snap_margin); if (!snap_view) { snap_view = test_view; } break; case RIGHT_TOP: - snap_view = resizing_view->findSnapEdge(scaled_rect.mRight, mouse_dir, SNAP_RIGHT, SNAP_PARENT_AND_SIBLINGS, LLUI::sConfigGroup->getS32("SnapMargin")); - test_view = resizing_view->findSnapEdge(scaled_rect.mTop, mouse_dir, SNAP_TOP, SNAP_PARENT_AND_SIBLINGS, LLUI::sConfigGroup->getS32("SnapMargin")); + snap_view = resizing_view->findSnapEdge(scaled_rect.mRight, mouse_dir, SNAP_RIGHT, SNAP_PARENT_AND_SIBLINGS, snap_margin); + test_view = resizing_view->findSnapEdge(scaled_rect.mTop, mouse_dir, SNAP_TOP, SNAP_PARENT_AND_SIBLINGS, snap_margin); if (!snap_view) { snap_view = test_view; } break; case RIGHT_BOTTOM: - snap_view = resizing_view->findSnapEdge(scaled_rect.mRight, mouse_dir, SNAP_RIGHT, SNAP_PARENT_AND_SIBLINGS, LLUI::sConfigGroup->getS32("SnapMargin")); - test_view = resizing_view->findSnapEdge(scaled_rect.mBottom, mouse_dir, SNAP_BOTTOM, SNAP_PARENT_AND_SIBLINGS, LLUI::sConfigGroup->getS32("SnapMargin")); + snap_view = resizing_view->findSnapEdge(scaled_rect.mRight, mouse_dir, SNAP_RIGHT, SNAP_PARENT_AND_SIBLINGS, snap_margin); + test_view = resizing_view->findSnapEdge(scaled_rect.mBottom, mouse_dir, SNAP_BOTTOM, SNAP_PARENT_AND_SIBLINGS, snap_margin); if (!snap_view) { snap_view = test_view; @@ -243,13 +244,13 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask) } // register "snap" behavior with snapped view - resizing_view->snappedTo(snap_view); + resizing_view->setSnappedTo(snap_view); // reset parent rect resizing_view->setRect(orig_rect); // translate and scale to new shape - resizing_view->userSetShape(scaled_rect); + resizing_view->setShape(scaled_rect, true); // update last valid mouse cursor position based on resized view's actual size LLRect new_rect = resizing_view->getRect(); diff --git a/indra/llui/llresizehandle.h b/indra/llui/llresizehandle.h index 0e23d526fafbc4ff33fa1fe3939de5f43cfe836a..e4e3c81cecc7cbad4c41158d39d4d0ad7914a3f5 100644 --- a/indra/llui/llresizehandle.h +++ b/indra/llui/llresizehandle.h @@ -44,9 +44,18 @@ class LLResizeHandle : public LLView public: enum ECorner { LEFT_TOP, LEFT_BOTTOM, RIGHT_TOP, RIGHT_BOTTOM }; - - LLResizeHandle(const std::string& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner = RIGHT_BOTTOM ); + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Mandatory<ECorner> corner; + Optional<S32> min_width; + Optional<S32> min_height; + Params(); + }; +protected: + LLResizeHandle(const LLResizeHandle::Params&); + friend class LLUICtrlFactory; +public: virtual void draw(); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index 141b08c39d1cbcbfe463739d01dd7c00e4fc943f..a4e23a605b248cb5b789f69d7d30fef840312138 100644 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -43,106 +43,8 @@ LLResMgr::LLResMgr() { - U32 i; - - // Init values for each locale. - // Note: This is only the most bare-bones version. In the future, load these dynamically, on demand. - - ////////////////////////////////////////////////////////////////////////////// - // USA - // USA Fonts - for( i=0; i<LLFONT_COUNT; i++ ) - { - mUSAFonts[i] = NULL; - } - mUSAFonts[ LLFONT_OCRA ] = LLFontGL::getFontMonospace(); - mUSAFonts[ LLFONT_SANSSERIF ] = LLFontGL::getFontSansSerif(); - mUSAFonts[ LLFONT_SANSSERIF_SMALL ] = LLFontGL::getFontSansSerifSmall(); - mUSAFonts[ LLFONT_SANSSERIF_BIG ] = LLFontGL::getFontSansSerifBig(); - mUSAFonts[ LLFONT_SMALL ] = LLFontGL::getFontMonospace(); -/* - // USA Strings - for( i=0; i<LLSTR_COUNT; i++ ) - { - mUSAStrings[i] = ""; - } - mUSAStrings[ LLSTR_HELLO ] = "hello"; - mUSAStrings[ LLSTR_GOODBYE ] = "goodbye"; - mUSAStrings[ LLSTR_CHAT_LABEL ] = "Chat"; - mUSAStrings[ LLSTR_STATUS_LABEL ] = "Properties"; - mUSAStrings[ LLSTR_X ] = "X"; - mUSAStrings[ LLSTR_Y ] = "Y"; - mUSAStrings[ LLSTR_Z ] = "Z"; - mUSAStrings[ LLSTR_POSITION ] = "Position (meters)"; - mUSAStrings[ LLSTR_SCALE ] = "Size (meters)"; - mUSAStrings[ LLSTR_ROTATION ] = "Rotation (degrees)"; - mUSAStrings[ LLSTR_HAS_PHYSICS ] = "Has Physics"; - mUSAStrings[ LLSTR_SCRIPT ] = "Script"; - mUSAStrings[ LLSTR_HELP ] = "Help"; - mUSAStrings[ LLSTR_REMOVE ] = "Remove"; - mUSAStrings[ LLSTR_CLEAR ] = "Clear"; - mUSAStrings[ LLSTR_APPLY ] = "Apply"; - mUSAStrings[ LLSTR_CANCEL ] = "Cancel"; - mUSAStrings[ LLSTR_MATERIAL ] = "Material"; - mUSAStrings[ LLSTR_FACE ] = "Face"; - mUSAStrings[ LLSTR_TEXTURE ] = "Texture"; - mUSAStrings[ LLSTR_TEXTURE_SIZE ] = "Repeats per Face"; - mUSAStrings[ LLSTR_TEXTURE_OFFSET ] = "Offset"; - mUSAStrings[ LLSTR_TEXTURE_ROTATION ] = "Rotation (degrees)"; - mUSAStrings[ LLSTR_U ] = "U"; - mUSAStrings[ LLSTR_V ] = "V"; - mUSAStrings[ LLSTR_OWNERSHIP ] = "Ownership"; - mUSAStrings[ LLSTR_PUBLIC ] = "Public"; - mUSAStrings[ LLSTR_PRIVATE ] = "Private"; - mUSAStrings[ LLSTR_REVERT ] = "Revert"; - mUSAStrings[ LLSTR_INSERT_SAMPLE ] = "Insert Sample"; - mUSAStrings[ LLSTR_SET_TEXTURE ] = "Set Texture"; - mUSAStrings[ LLSTR_EDIT_SCRIPT ] = "Edit Script..."; - mUSAStrings[ LLSTR_MOUSELOOK_INSTRUCTIONS ] = "Press ESC to leave Mouselook."; - mUSAStrings[ LLSTR_EDIT_FACE_INSTRUCTIONS ] = "Click on face to select part. Click and hold on a picture to look more like that. Press ESC to leave Face Edit Mode."; - mUSAStrings[ LLSTR_CLOSE ] = "Close"; - mUSAStrings[ LLSTR_MOVE ] = "Move"; - mUSAStrings[ LLSTR_ROTATE ] = "Rotate"; - mUSAStrings[ LLSTR_RESIZE ] = "Resize"; - mUSAStrings[ LLSTR_PLACE_BOX ] = "Place Box"; - mUSAStrings[ LLSTR_PLACE_PRISM ] = "Place Prism"; - mUSAStrings[ LLSTR_PLACE_PYRAMID ] = "Place Pyramid"; - mUSAStrings[ LLSTR_PLACE_TETRAHEDRON ] = "Place Tetrahedron"; - mUSAStrings[ LLSTR_PLACE_CYLINDER ] = "Place Cylinder"; - mUSAStrings[ LLSTR_PLACE_HALF_CYLINDER ] = "Place Half-Cylinder"; - mUSAStrings[ LLSTR_PLACE_CONE ] = "Place Cone"; - mUSAStrings[ LLSTR_PLACE_HALF_CONE ] = "Place Half-Cone"; - mUSAStrings[ LLSTR_PLACE_SPHERE ] = "Place Sphere"; - mUSAStrings[ LLSTR_PLACE_HALF_SPHERE ] = "Place Half-Sphere"; - mUSAStrings[ LLSTR_PLACE_BIRD ] = "Place Bird"; - mUSAStrings[ LLSTR_PLACE_SNAKE ] = "Place Silly Snake"; - mUSAStrings[ LLSTR_PLACE_ROCK ] = "Place Rock"; - mUSAStrings[ LLSTR_PLACE_TREE ] = "Place Tree"; - mUSAStrings[ LLSTR_PLACE_GRASS ] = "Place Grass"; - mUSAStrings[ LLSTR_MODIFY_LAND ] = "Modify Land"; -*/ - ////////////////////////////////////////////////////////////////////////////// - // UK - // The Brits are a lot like us Americans, so initially assume we're the same and only code the exceptions. - - // UK Fonts - for( i=0; i<LLFONT_COUNT; i++ ) - { - mUKFonts[i] = mUSAFonts[i]; - } -/* - // UK Strings - for( i=0; i<LLSTR_COUNT; i++ ) - { - mUKStrings[i] = mUSAStrings[i]; - } - mUKStrings[ LLSTR_HELLO ] = "hullo"; - mUKStrings[ LLSTR_GOODBYE ] = "cheerio"; -*/ - ////////////////////////////////////////////////////////////////////////////// // Set default setLocale( LLLOCALE_USA ); - } @@ -151,9 +53,9 @@ void LLResMgr::setLocale( LLLOCALE_ID locale_id ) mLocale = locale_id; //RN: for now, use normal 'C' locale for everything but specific UI input/output routines - switch( locale_id ) - { - case LLLOCALE_USA: +// switch( locale_id ) +// { +// case LLLOCALE_USA: //#if LL_WINDOWS // // Windows doesn't use ISO country codes. // llinfos << "Setting locale to " << setlocale( LC_ALL, "english-usa" ) << llendl; @@ -161,11 +63,8 @@ void LLResMgr::setLocale( LLLOCALE_ID locale_id ) // // posix version should work everywhere else. // llinfos << "Setting locale to " << setlocale( LC_ALL, "en_US" ) << llendl; //#endif - -// mStrings = mUSAStrings; - mFonts = mUSAFonts; - break; - case LLLOCALE_UK: +// break; +// case LLLOCALE_UK: //#if LL_WINDOWS // // Windows doesn't use ISO country codes. // llinfos << "Setting locale to " << setlocale( LC_ALL, "english-uk" ) << llendl; @@ -173,15 +72,12 @@ void LLResMgr::setLocale( LLLOCALE_ID locale_id ) // // posix version should work everywhere else. // llinfos << "Setting locale to " << setlocale( LC_ALL, "en_GB" ) << llendl; //#endif - -// mStrings = mUKStrings; - mFonts = mUKFonts; - break; - default: - llassert(0); - setLocale(LLLOCALE_USA); - break; - } +// break; +// default: +// llassert(0); +// setLocale(LLLOCALE_USA); +// break; +// } } char LLResMgr::getDecimalPoint() const @@ -418,27 +314,6 @@ void LLResMgr::getIntegerString( std::string& output, S32 input ) const } } -const std::string LLFONT_ID_NAMES[] = -{ - std::string("OCRA"), - std::string("SANSSERIF"), - std::string("SANSSERIF_SMALL"), - std::string("SANSSERIF_BIG"), - std::string("SMALL"), -}; - -const LLFontGL* LLResMgr::getRes( std::string font_id ) const -{ - for (S32 i=0; i<LLFONT_COUNT; ++i) - { - if (LLFONT_ID_NAMES[i] == font_id) - { - return getRes((LLFONT_ID)i); - } - } - return NULL; -} - #if LL_WINDOWS const std::string LLLocale::USER_LOCALE("English_United States.1252");// = LLStringUtil::null; const std::string LLLocale::SYSTEM_LOCALE("English_United States.1252"); diff --git a/indra/llui/llresmgr.h b/indra/llui/llresmgr.h index d54505c5038ba783ff8c6ed6da76763c660511a7..c8fa340990543453388b0f5d7fe6ef3c94713adb 100644 --- a/indra/llui/llresmgr.h +++ b/indra/llui/llresmgr.h @@ -37,7 +37,7 @@ #include "locale.h" #include "stdtypes.h" #include "llstring.h" -#include "llmemory.h" +#include "llsingleton.h" enum LLLOCALE_ID { @@ -46,18 +46,6 @@ enum LLLOCALE_ID LLLOCALE_COUNT // Number of values in this enum. Keep at end. }; -enum LLFONT_ID -{ - LLFONT_OCRA, - LLFONT_SANSSERIF, - LLFONT_SANSSERIF_SMALL, - LLFONT_SANSSERIF_BIG, - LLFONT_SMALL, - LLFONT_COUNT // Number of values in this enum. Keep at end. -}; - -class LLFontGL; - class LLResMgr : public LLSingleton<LLResMgr> { public: @@ -74,20 +62,9 @@ public: std::string getMonetaryString( S32 input ) const; void getIntegerString( std::string& output, S32 input ) const; -// const char* getRes( LLSTR_ID string_id ) const { return mStrings[ string_id ]; } - const LLFontGL* getRes( LLFONT_ID font_id ) const { return mFonts[ font_id ]; } - const LLFontGL* getRes( std::string font_id ) const; private: LLLOCALE_ID mLocale; -// const char** mStrings; - const LLFontGL** mFonts; - -// const char* mUSAStrings[LLSTR_COUNT]; - const LLFontGL* mUSAFonts[LLFONT_COUNT]; - -// const char* mUKStrings[LLSTR_COUNT]; - const LLFontGL* mUKFonts[LLFONT_COUNT]; }; class LLLocale diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index 65086d833d1cf3a8f35876a18e05a52b54c68c18..3f1ff34419555ec4547406f6409eb9976057b85f 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -46,101 +46,86 @@ #include "llwindow.h" #include "llcontrol.h" #include "llrender.h" +#include "lluictrlfactory.h" + +static LLDefaultWidgetRegistry::Register<LLScrollbar> register_scrollbar("scroll_bar"); + +LLScrollbar::Params::Params() +: orientation ("orientation", HORIZONTAL), + doc_size ("doc_size", 0), + doc_pos ("doc_pos", 0), + page_size ("page_size", 0), + step_size ("step_size", 1), + thumb_image("thumb_image"), + track_image("track_image"), + track_color("track_color"), + thumb_color("thumb_color"), + thickness("thickness"), + up_button("up_button"), + down_button("down_button"), + left_button("left_button"), + right_button("right_button") +{ + tab_stop = false; +} -LLScrollbar::LLScrollbar( - const std::string& name, LLRect rect, - LLScrollbar::ORIENTATION orientation, - S32 doc_size, S32 doc_pos, S32 page_size, - void (*change_callback)( S32 new_pos, LLScrollbar* self, void* userdata ), - void* callback_user_data, - S32 step_size) -: LLUICtrl( name, rect, TRUE, NULL, NULL ), - - mChangeCallback( change_callback ), - mCallbackUserData( callback_user_data ), - mOrientation( orientation ), - mDocSize( doc_size ), - mDocPos( doc_pos ), - mPageSize( page_size ), - mStepSize( step_size ), +LLScrollbar::LLScrollbar(const Params & p) +: LLUICtrl(p), + mChangeCallback( p.change_callback() ), + mOrientation( p.orientation ), + mDocSize( p.doc_size ), + mDocPos( p.doc_pos ), + mPageSize( p.page_size ), + mStepSize( p.step_size ), mDocChanged(FALSE), mDragStartX( 0 ), mDragStartY( 0 ), mHoverGlowStrength(0.15f), mCurGlowStrength(0.f), - mTrackColor( LLUI::sColorsGroup->getColor("ScrollbarTrackColor") ), - mThumbColor ( LLUI::sColorsGroup->getColor("ScrollbarThumbColor") ), - mHighlightColor ( LLUI::sColorsGroup->getColor("DefaultHighlightLight") ), - mShadowColor ( LLUI::sColorsGroup->getColor("DefaultShadowLight") ), + mTrackColor( p.track_color() ), + mThumbColor ( p.thumb_color() ), mOnScrollEndCallback( NULL ), - mOnScrollEndData( NULL ) + mOnScrollEndData( NULL ), + mThumbImage(p.thumb_image), + mTrackImage(p.track_image), + mThickness(p.thickness.isProvided() ? p.thickness : LLUI::sSettingGroups["config"]->getS32("UIScrollbarSize")) { - //llassert( 0 <= mDocSize ); - //llassert( 0 <= mDocPos && mDocPos <= mDocSize ); - - setTabStop(FALSE); updateThumbRect(); // Page up and page down buttons LLRect line_up_rect; - std::string line_up_img; - std::string line_up_selected_img; - std::string line_down_img; - std::string line_down_selected_img; - LLRect line_down_rect; - if( LLScrollbar::VERTICAL == mOrientation ) + if( VERTICAL == mOrientation ) { - line_up_rect.setLeftTopAndSize( 0, getRect().getHeight(), SCROLLBAR_SIZE, SCROLLBAR_SIZE ); - line_up_img="UIImgBtnScrollUpOutUUID"; - line_up_selected_img="UIImgBtnScrollUpInUUID"; - - line_down_rect.setOriginAndSize( 0, 0, SCROLLBAR_SIZE, SCROLLBAR_SIZE ); - line_down_img="UIImgBtnScrollDownOutUUID"; - line_down_selected_img="UIImgBtnScrollDownInUUID"; + line_up_rect.setLeftTopAndSize( 0, getRect().getHeight(), mThickness, mThickness ); + line_down_rect.setOriginAndSize( 0, 0, mThickness, mThickness ); } - else + else // HORIZONTAL { - // Horizontal - line_up_rect.setOriginAndSize( 0, 0, SCROLLBAR_SIZE, SCROLLBAR_SIZE ); - line_up_img="UIImgBtnScrollLeftOutUUID"; - line_up_selected_img="UIImgBtnScrollLeftInUUID"; - - line_down_rect.setOriginAndSize( getRect().getWidth() - SCROLLBAR_SIZE, 0, SCROLLBAR_SIZE, SCROLLBAR_SIZE ); - line_down_img="UIImgBtnScrollRightOutUUID"; - line_down_selected_img="UIImgBtnScrollRightInUUID"; + line_up_rect.setOriginAndSize( 0, 0, mThickness, mThickness ); + line_down_rect.setOriginAndSize( getRect().getWidth() - mThickness, 0, mThickness, mThickness ); } - LLButton* line_up_btn = new LLButton(std::string("Line Up"), line_up_rect, - line_up_img, line_up_selected_img, LLStringUtil::null, - &LLScrollbar::onLineUpBtnPressed, this, LLFontGL::getFontSansSerif() ); - if( LLScrollbar::VERTICAL == mOrientation ) - { - line_up_btn->setFollowsRight(); - line_up_btn->setFollowsTop(); - } - else - { - // horizontal - line_up_btn->setFollowsLeft(); - line_up_btn->setFollowsBottom(); - } - line_up_btn->setHeldDownCallback( &LLScrollbar::onLineUpBtnPressed ); - line_up_btn->setTabStop(FALSE); - line_up_btn->setScaleImage(TRUE); - - addChild(line_up_btn); - - LLButton* line_down_btn = new LLButton(std::string("Line Down"), line_down_rect, - line_down_img, line_down_selected_img, LLStringUtil::null, - &LLScrollbar::onLineDownBtnPressed, this, LLFontGL::getFontSansSerif() ); - line_down_btn->setFollowsRight(); - line_down_btn->setFollowsBottom(); - line_down_btn->setHeldDownCallback( &LLScrollbar::onLineDownBtnPressed ); - line_down_btn->setTabStop(FALSE); - line_down_btn->setScaleImage(TRUE); - addChild(line_down_btn); + LLButton::Params up_btn(mOrientation == VERTICAL ? p.up_button : p.left_button); + up_btn.name(std::string("Line Up")); + up_btn.rect(line_up_rect); + up_btn.click_callback.function(boost::bind(&LLScrollbar::onLineUpBtnPressed, this, _2)); + up_btn.mouse_held_callback.function(boost::bind(&LLScrollbar::onLineUpBtnPressed, this, _2)); + up_btn.tab_stop(false); + up_btn.follows.flags = (mOrientation == VERTICAL ? (FOLLOWS_RIGHT | FOLLOWS_TOP) : (FOLLOWS_LEFT | FOLLOWS_BOTTOM)); + + addChild(LLUICtrlFactory::create<LLButton>(up_btn)); + + LLButton::Params down_btn(mOrientation == VERTICAL ? p.down_button : p.right_button); + down_btn.name(std::string("Line Down")); + down_btn.rect(line_down_rect); + down_btn.follows.flags(FOLLOWS_RIGHT|FOLLOWS_BOTTOM); + down_btn.click_callback.function(boost::bind(&LLScrollbar::onLineDownBtnPressed, this, _2)); + down_btn.mouse_held_callback.function(boost::bind(&LLScrollbar::onLineDownBtnPressed, this, _2)); + down_btn.tab_stop(false); + + addChild(LLUICtrlFactory::create<LLButton>(down_btn)); } @@ -168,7 +153,7 @@ void LLScrollbar::setDocPos(S32 pos, BOOL update_thumb) if( mChangeCallback ) { - mChangeCallback( mDocPos, this, mCallbackUserData ); + mChangeCallback( mDocPos, this ); } if( update_thumb ) @@ -221,7 +206,7 @@ void LLScrollbar::updateThumbRect() const S32 THUMB_MIN_LENGTH = 16; S32 window_length = (mOrientation == LLScrollbar::HORIZONTAL) ? getRect().getWidth() : getRect().getHeight(); - S32 thumb_bg_length = llmax(0, window_length - 2 * SCROLLBAR_SIZE); + S32 thumb_bg_length = llmax(0, window_length - 2 * mThickness); S32 visible_lines = llmin( mDocSize, mPageSize ); S32 thumb_length = mDocSize ? llmin(llmax( visible_lines * thumb_bg_length / mDocSize, THUMB_MIN_LENGTH), thumb_bg_length) : thumb_bg_length; @@ -229,24 +214,24 @@ void LLScrollbar::updateThumbRect() if( mOrientation == LLScrollbar::VERTICAL ) { - S32 thumb_start_max = thumb_bg_length + SCROLLBAR_SIZE; - S32 thumb_start_min = SCROLLBAR_SIZE + THUMB_MIN_LENGTH; + S32 thumb_start_max = thumb_bg_length + mThickness; + S32 thumb_start_min = mThickness + THUMB_MIN_LENGTH; S32 thumb_start = variable_lines ? llmin( llmax(thumb_start_max - (mDocPos * (thumb_bg_length - thumb_length)) / variable_lines, thumb_start_min), thumb_start_max ) : thumb_start_max; mThumbRect.mLeft = 0; mThumbRect.mTop = thumb_start; - mThumbRect.mRight = SCROLLBAR_SIZE; + mThumbRect.mRight = mThickness; mThumbRect.mBottom = thumb_start - thumb_length; } else { // Horizontal - S32 thumb_start_max = thumb_bg_length + SCROLLBAR_SIZE - thumb_length; - S32 thumb_start_min = SCROLLBAR_SIZE; + S32 thumb_start_max = thumb_bg_length + mThickness - thumb_length; + S32 thumb_start_min = mThickness; S32 thumb_start = variable_lines ? llmin(llmax( thumb_start_min + (mDocPos * (thumb_bg_length - thumb_length)) / variable_lines, thumb_start_min), thumb_start_max ) : thumb_start_min; mThumbRect.mLeft = thumb_start; - mThumbRect.mTop = SCROLLBAR_SIZE; + mThumbRect.mTop = mThickness; mThumbRect.mRight = thumb_start + thumb_length; mThumbRect.mBottom = 0; } @@ -318,21 +303,21 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask) // S32 old_pos = mThumbRect.mTop; S32 delta_pixels = y - mDragStartY; - if( mOrigRect.mBottom + delta_pixels < SCROLLBAR_SIZE ) + if( mOrigRect.mBottom + delta_pixels < mThickness ) { - delta_pixels = SCROLLBAR_SIZE - mOrigRect.mBottom - 1; + delta_pixels = mThickness - mOrigRect.mBottom - 1; } else - if( mOrigRect.mTop + delta_pixels > height - SCROLLBAR_SIZE ) + if( mOrigRect.mTop + delta_pixels > height - mThickness ) { - delta_pixels = height - SCROLLBAR_SIZE - mOrigRect.mTop + 1; + delta_pixels = height - mThickness - mOrigRect.mTop + 1; } mThumbRect.mTop = mOrigRect.mTop + delta_pixels; mThumbRect.mBottom = mOrigRect.mBottom + delta_pixels; S32 thumb_length = mThumbRect.getHeight(); - S32 thumb_track_length = height - 2 * SCROLLBAR_SIZE; + S32 thumb_track_length = height - 2 * mThickness; if( delta_pixels != mLastDelta || mDocChanged) @@ -343,7 +328,7 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask) { S32 variable_lines = getDocPosMax(); S32 pos = mThumbRect.mTop; - F32 ratio = F32(pos - SCROLLBAR_SIZE - thumb_length) / usable_track_length; + F32 ratio = F32(pos - mThickness - thumb_length) / usable_track_length; S32 new_pos = llclamp( S32(variable_lines - ratio * variable_lines + 0.5f), 0, variable_lines ); // Note: we do not call updateThumbRect() here. Instead we let the thumb and the document go slightly @@ -362,21 +347,21 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask) S32 delta_pixels = x - mDragStartX; - if( mOrigRect.mLeft + delta_pixels < SCROLLBAR_SIZE ) + if( mOrigRect.mLeft + delta_pixels < mThickness ) { - delta_pixels = SCROLLBAR_SIZE - mOrigRect.mLeft - 1; + delta_pixels = mThickness - mOrigRect.mLeft - 1; } else - if( mOrigRect.mRight + delta_pixels > width - SCROLLBAR_SIZE ) + if( mOrigRect.mRight + delta_pixels > width - mThickness ) { - delta_pixels = width - SCROLLBAR_SIZE - mOrigRect.mRight + 1; + delta_pixels = width - mThickness - mOrigRect.mRight + 1; } mThumbRect.mLeft = mOrigRect.mLeft + delta_pixels; mThumbRect.mRight = mOrigRect.mRight + delta_pixels; S32 thumb_length = mThumbRect.getWidth(); - S32 thumb_track_length = width - 2 * SCROLLBAR_SIZE; + S32 thumb_track_length = width - 2 * mThickness; if( delta_pixels != mLastDelta || mDocChanged) { @@ -386,7 +371,7 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask) { S32 variable_lines = getDocPosMax(); S32 pos = mThumbRect.mLeft; - F32 ratio = F32(pos - SCROLLBAR_SIZE) / usable_track_length; + F32 ratio = F32(pos - mThickness) / usable_track_length; S32 new_pos = llclamp( S32(ratio * variable_lines + 0.5f), 0, variable_lines); @@ -475,14 +460,14 @@ void LLScrollbar::reshape(S32 width, S32 height, BOOL called_from_parent) if (mOrientation == VERTICAL) { - up_button->reshape(up_button->getRect().getWidth(), llmin(getRect().getHeight() / 2, SCROLLBAR_SIZE)); - down_button->reshape(down_button->getRect().getWidth(), llmin(getRect().getHeight() / 2, SCROLLBAR_SIZE)); + up_button->reshape(up_button->getRect().getWidth(), llmin(getRect().getHeight() / 2, mThickness)); + down_button->reshape(down_button->getRect().getWidth(), llmin(getRect().getHeight() / 2, mThickness)); up_button->setOrigin(up_button->getRect().mLeft, getRect().getHeight() - up_button->getRect().getHeight()); } else { - up_button->reshape(llmin(getRect().getWidth() / 2, SCROLLBAR_SIZE), up_button->getRect().getHeight()); - down_button->reshape(llmin(getRect().getWidth() / 2, SCROLLBAR_SIZE), down_button->getRect().getHeight()); + up_button->reshape(llmin(getRect().getWidth() / 2, mThickness), up_button->getRect().getHeight()); + down_button->reshape(llmin(getRect().getWidth() / 2, mThickness), down_button->getRect().getHeight()); down_button->setOrigin(getRect().getWidth() - down_button->getRect().getWidth(), down_button->getRect().mBottom); } updateThumbRect(); @@ -507,28 +492,25 @@ void LLScrollbar::draw() mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); } - // Draw background and thumb. - LLUIImage* rounded_rect_imagep = LLUI::sImageProvider->getUIImage("rounded_square.tga"); - - if (!rounded_rect_imagep) + if (mTrackImage.isNull() || mThumbImage.isNull()) { - gl_rect_2d(mOrientation == HORIZONTAL ? SCROLLBAR_SIZE : 0, - mOrientation == VERTICAL ? getRect().getHeight() - 2 * SCROLLBAR_SIZE : getRect().getHeight(), - mOrientation == HORIZONTAL ? getRect().getWidth() - 2 * SCROLLBAR_SIZE : getRect().getWidth(), - mOrientation == VERTICAL ? SCROLLBAR_SIZE : 0, mTrackColor, TRUE); + gl_rect_2d(mOrientation == HORIZONTAL ? mThickness : 0, + mOrientation == VERTICAL ? getRect().getHeight() - 2 * mThickness : getRect().getHeight(), + mOrientation == HORIZONTAL ? getRect().getWidth() - 2 * mThickness : getRect().getWidth(), + mOrientation == VERTICAL ? mThickness : 0, mTrackColor.get(), TRUE); - gl_rect_2d(mThumbRect, mThumbColor, TRUE); + gl_rect_2d(mThumbRect, mThumbColor.get(), TRUE); } else { // Background - rounded_rect_imagep->drawSolid(mOrientation == HORIZONTAL ? SCROLLBAR_SIZE : 0, - mOrientation == VERTICAL ? SCROLLBAR_SIZE : 0, - mOrientation == HORIZONTAL ? getRect().getWidth() - 2 * SCROLLBAR_SIZE : getRect().getWidth(), - mOrientation == VERTICAL ? getRect().getHeight() - 2 * SCROLLBAR_SIZE : getRect().getHeight(), - mTrackColor); + mTrackImage->drawSolid(mOrientation == HORIZONTAL ? mThickness : 0, + mOrientation == VERTICAL ? mThickness : 0, + mOrientation == HORIZONTAL ? getRect().getWidth() - 2 * mThickness : getRect().getWidth(), + mOrientation == VERTICAL ? getRect().getHeight() - 2 * mThickness : getRect().getHeight(), + mTrackColor.get()); // Thumb LLRect outline_rect = mThumbRect; @@ -536,14 +518,14 @@ void LLScrollbar::draw() if (gFocusMgr.getKeyboardFocus() == this) { - rounded_rect_imagep->draw(outline_rect, gFocusMgr.getFocusColor()); + mTrackImage->draw(outline_rect, gFocusMgr.getFocusColor()); } - rounded_rect_imagep->draw(mThumbRect, mThumbColor); + mThumbImage->draw(mThumbRect, mThumbColor.get()); if (mCurGlowStrength > 0.01f) { gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); - rounded_rect_imagep->drawSolid(mThumbRect, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); + mThumbImage->drawSolid(mThumbRect, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); gGL.setSceneBlendType(LLRender::BT_ALPHA); } @@ -625,19 +607,24 @@ void LLScrollbar::pageDown(S32 overlap) } } -// static -void LLScrollbar::onLineUpBtnPressed( void* userdata ) +void LLScrollbar::onLineUpBtnPressed( const LLSD& data ) { - LLScrollbar* self = (LLScrollbar*) userdata; - - self->changeLine( - self->mStepSize, TRUE ); + changeLine( -mStepSize, TRUE ); } -// static -void LLScrollbar::onLineDownBtnPressed( void* userdata ) +void LLScrollbar::onLineDownBtnPressed( const LLSD& data ) { - LLScrollbar* self = (LLScrollbar*) userdata; - self->changeLine( self->mStepSize, TRUE ); + changeLine( mStepSize, TRUE ); } +namespace LLInitParam +{ + template<> + bool ParamCompare<boost::function<void (S32, LLScrollbar*)> >::equals( + const boost::function<void (S32, LLScrollbar*)> &a, + const boost::function<void (S32, LLScrollbar*)> &b) + { + return false; + } +} diff --git a/indra/llui/llscrollbar.h b/indra/llui/llscrollbar.h index 0bbf8662aace89a581bd471662edfbe4f43f8fc3..43604d37b70d6e7e91dce096aed00d2a82ba28a8 100644 --- a/indra/llui/llscrollbar.h +++ b/indra/llui/llscrollbar.h @@ -36,12 +36,7 @@ #include "stdtypes.h" #include "lluictrl.h" #include "v4color.h" - -// -// Constants -// -const S32 SCROLLBAR_SIZE = 16; - +#include "llbutton.h" // // Classes @@ -50,15 +45,41 @@ class LLScrollbar : public LLUICtrl { public: + enum ORIENTATION { HORIZONTAL, VERTICAL }; + + typedef boost::function<void (S32, LLScrollbar*)> callback_t; + struct Params + : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Mandatory<ORIENTATION> orientation; + Mandatory<S32> doc_size; + Mandatory<S32> doc_pos; + Mandatory<S32> page_size; + + Optional<callback_t> change_callback; + Optional<S32> step_size; + Optional<S32> thickness; + + Optional<LLUIImage*> thumb_image, + track_image; - LLScrollbar(const std::string& name, LLRect rect, - ORIENTATION orientation, - S32 doc_size, S32 doc_pos, S32 page_size, - void(*change_callback)( S32 new_pos, LLScrollbar* self, void* userdata ), - void* callback_user_data = NULL, - S32 step_size = 1); + Optional<LLUIColor> track_color, + thumb_color; + Optional<LLButton::Params> up_button; + Optional<LLButton::Params> down_button; + Optional<LLButton::Params> left_button; + Optional<LLButton::Params> right_button; + + Params(); + }; + +protected: + LLScrollbar (const Params & p); + friend class LLUICtrlFactory; + +public: virtual ~LLScrollbar(); virtual void setValue(const LLSD& value); @@ -101,13 +122,11 @@ public: void pageUp(S32 overlap); void pageDown(S32 overlap); - static void onLineUpBtnPressed(void* userdata); - static void onLineDownBtnPressed(void* userdata); + void onLineUpBtnPressed(const LLSD& data); + void onLineDownBtnPressed(const LLSD& data); void setTrackColor( const LLColor4& color ) { mTrackColor = color; } void setThumbColor( const LLColor4& color ) { mThumbColor = color; } - void setHighlightColor( const LLColor4& color ) { mHighlightColor = color; } - void setShadowColor( const LLColor4& color ) { mShadowColor = color; } void setOnScrollEndCallback(void (*callback)(void*), void* userdata) { mOnScrollEndCallback = callback; mOnScrollEndData = userdata;} @@ -115,8 +134,7 @@ private: void updateThumbRect(); void changeLine(S32 delta, BOOL update_thumb ); - void (*mChangeCallback)( S32 new_pos, LLScrollbar* self, void* userdata ); - void* mCallbackUserData; + callback_t mChangeCallback; const ORIENTATION mOrientation; S32 mDocSize; // Size of the document that the scrollbar is modeling. Units depend on the user. 0 <= mDocSize. @@ -134,16 +152,24 @@ private: LLRect mOrigRect; S32 mLastDelta; - LLColor4 mTrackColor; - LLColor4 mThumbColor; - LLColor4 mFocusColor; - LLColor4 mHighlightColor; - LLColor4 mShadowColor; + LLUIColor mTrackColor; + LLUIColor mThumbColor; + + LLUIImagePtr mThumbImage; + LLUIImagePtr mTrackImage; + + S32 mThickness; void (*mOnScrollEndCallback)(void*); void *mOnScrollEndData; }; +namespace LLInitParam +{ + template<> + bool ParamCompare<boost::function<void (S32, LLScrollbar*)> >::equals( + const boost::function<void (S32, LLScrollbar*)> &a, const boost::function<void (S32, LLScrollbar*)> &b); +} #endif // LL_SCROLLBAR_H diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index cf03259879ec0f5e903951eb9ab2d4970dda66eb..2a2e56a92c7707ee9ca9be69e026dd4001ca5d91 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -1,6 +1,6 @@ /** * @file llscrollcontainer.cpp - * @brief LLScrollableContainerView base class + * @brief LLScrollContainer base class * * $LicenseInfo:firstyear=2001&license=viewergpl$ * @@ -33,8 +33,12 @@ #include "linden_common.h" -#include "llrender.h" #include "llscrollcontainer.h" + +#include "llrender.h" +#include "llcontainerview.h" +// #include "llfolderview.h" +#include "llscrollingpanellist.h" #include "llscrollbar.h" #include "llui.h" #include "llkeyboard.h" @@ -42,6 +46,7 @@ #include "llfocusmgr.h" #include "llframetimer.h" #include "lluictrlfactory.h" +#include "llpanel.h" #include "llfontgl.h" ///---------------------------------------------------------------------------- @@ -55,98 +60,79 @@ static const F32 MAX_AUTO_SCROLL_RATE = 500.f; static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f; ///---------------------------------------------------------------------------- -/// Class LLScrollableContainerView +/// Class LLScrollContainer ///---------------------------------------------------------------------------- -static LLRegisterWidget<LLScrollableContainerView> r("scroll_container"); +static LLDefaultWidgetRegistry::Register<LLScrollContainer> r("scroll_container"); -// Default constructor -LLScrollableContainerView::LLScrollableContainerView( const std::string& name, - const LLRect& rect, - LLView* scrolled_view, - BOOL is_opaque, - const LLColor4& bg_color ) : - LLUICtrl( name, rect, FALSE, NULL, NULL ), - mScrolledView( scrolled_view ), - mIsOpaque( is_opaque ), - mBackgroundColor( bg_color ), - mReserveScrollCorner( FALSE ), - mAutoScrolling( FALSE ), - mAutoScrollRate( 0.f ) +LLScrollContainer::Params::Params() +: is_opaque("opaque"), + bg_color("color"), + reserve_scroll_corner("reserve_scroll_corner", false) { - if( mScrolledView ) - { - addChild( mScrolledView ); - } - - init(); + name = "scroll_container"; + mouse_opaque(true); + tab_stop(false); } -// LLUICtrl constructor -LLScrollableContainerView::LLScrollableContainerView( const std::string& name, const LLRect& rect, - LLUICtrl* scrolled_ctrl, BOOL is_opaque, - const LLColor4& bg_color) : - LLUICtrl( name, rect, FALSE, NULL, NULL ), - mScrolledView( scrolled_ctrl ), - mIsOpaque( is_opaque ), - mBackgroundColor( bg_color ), - mReserveScrollCorner( FALSE ), - mAutoScrolling( FALSE ), - mAutoScrollRate( 0.f ) -{ - if( scrolled_ctrl ) - { - addChild( scrolled_ctrl ); - } - - init(); -} -void LLScrollableContainerView::init() +// Default constructor +LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) +: LLUICtrl(p), + mAutoScrolling( FALSE ), + mAutoScrollRate( 0.f ), + mBackgroundColor(p.bg_color()), + mIsOpaque(p.is_opaque), + mReserveScrollCorner(p.reserve_scroll_corner), + mScrolledView(NULL) { + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); LLRect border_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - mBorder = new LLViewBorder( std::string("scroll border"), border_rect, LLViewBorder::BEVEL_IN ); - addChild( mBorder ); + LLViewBorder::Params params; + params.name("scroll border"); + params.rect(border_rect); + params.bevel_type(LLViewBorder::BEVEL_IN); + mBorder = LLUICtrlFactory::create<LLViewBorder> (params); + LLView::addChild( mBorder ); mInnerRect.set( 0, getRect().getHeight(), getRect().getWidth(), 0 ); mInnerRect.stretch( -mBorder->getBorderWidth() ); LLRect vertical_scroll_rect = mInnerRect; - vertical_scroll_rect.mLeft = vertical_scroll_rect.mRight - SCROLLBAR_SIZE; - mScrollbar[VERTICAL] = new LLScrollbar( std::string("scrollable vertical"), - vertical_scroll_rect, - LLScrollbar::VERTICAL, - mInnerRect.getHeight(), - 0, - mInnerRect.getHeight(), - NULL, this, - VERTICAL_MULTIPLE); - addChild( mScrollbar[VERTICAL] ); + vertical_scroll_rect.mLeft = vertical_scroll_rect.mRight - scrollbar_size; + LLScrollbar::Params sbparams; + sbparams.name("scrollable vertical"); + sbparams.rect(vertical_scroll_rect); + sbparams.orientation(LLScrollbar::VERTICAL); + sbparams.doc_size(mInnerRect.getHeight()); + sbparams.doc_pos(0); + sbparams.page_size(mInnerRect.getHeight()); + sbparams.step_size(VERTICAL_MULTIPLE); + mScrollbar[VERTICAL] = LLUICtrlFactory::create<LLScrollbar> (sbparams); + LLView::addChild( mScrollbar[VERTICAL] ); mScrollbar[VERTICAL]->setVisible( FALSE ); mScrollbar[VERTICAL]->setFollowsRight(); mScrollbar[VERTICAL]->setFollowsTop(); mScrollbar[VERTICAL]->setFollowsBottom(); LLRect horizontal_scroll_rect = mInnerRect; - horizontal_scroll_rect.mTop = horizontal_scroll_rect.mBottom + SCROLLBAR_SIZE; - mScrollbar[HORIZONTAL] = new LLScrollbar( std::string("scrollable horizontal"), - horizontal_scroll_rect, - LLScrollbar::HORIZONTAL, - mInnerRect.getWidth(), - 0, - mInnerRect.getWidth(), - NULL, this, - HORIZONTAL_MULTIPLE); - addChild( mScrollbar[HORIZONTAL] ); + horizontal_scroll_rect.mTop = horizontal_scroll_rect.mBottom + scrollbar_size; + sbparams.name("scrollable horizontal"); + sbparams.rect(horizontal_scroll_rect); + sbparams.orientation(LLScrollbar::HORIZONTAL); + sbparams.doc_size(mInnerRect.getWidth()); + sbparams.doc_pos(0); + sbparams.page_size(mInnerRect.getWidth()); + sbparams.step_size(VERTICAL_MULTIPLE); + mScrollbar[HORIZONTAL] = LLUICtrlFactory::create<LLScrollbar> (sbparams); + LLView::addChild( mScrollbar[HORIZONTAL] ); mScrollbar[HORIZONTAL]->setVisible( FALSE ); mScrollbar[HORIZONTAL]->setFollowsLeft(); mScrollbar[HORIZONTAL]->setFollowsRight(); - - setTabStop(FALSE); } // Destroys the object -LLScrollableContainerView::~LLScrollableContainerView( void ) +LLScrollContainer::~LLScrollContainer( void ) { // mScrolledView and mScrollbar are child views, so the LLView // destructor takes care of memory deallocation. @@ -159,9 +145,9 @@ LLScrollableContainerView::~LLScrollableContainerView( void ) // internal scrollbar handlers // virtual -void LLScrollableContainerView::scrollHorizontal( S32 new_pos ) +void LLScrollContainer::scrollHorizontal( S32 new_pos ) { - //llinfos << "LLScrollableContainerView::scrollHorizontal()" << llendl; + //llinfos << "LLScrollContainer::scrollHorizontal()" << llendl; if( mScrolledView ) { LLRect doc_rect = mScrolledView->getRect(); @@ -171,9 +157,9 @@ void LLScrollableContainerView::scrollHorizontal( S32 new_pos ) } // virtual -void LLScrollableContainerView::scrollVertical( S32 new_pos ) +void LLScrollContainer::scrollVertical( S32 new_pos ) { - // llinfos << "LLScrollableContainerView::scrollVertical() " << new_pos << llendl; + // llinfos << "LLScrollContainer::scrollVertical() " << new_pos << llendl; if( mScrolledView ) { LLRect doc_rect = mScrolledView->getRect(); @@ -183,7 +169,7 @@ void LLScrollableContainerView::scrollVertical( S32 new_pos ) } // LLView functionality -void LLScrollableContainerView::reshape(S32 width, S32 height, +void LLScrollContainer::reshape(S32 width, S32 height, BOOL called_from_parent) { LLUICtrl::reshape( width, height, called_from_parent ); @@ -209,8 +195,17 @@ void LLScrollableContainerView::reshape(S32 width, S32 height, } } -BOOL LLScrollableContainerView::handleKeyHere(KEY key, MASK mask) +BOOL LLScrollContainer::handleKeyHere(KEY key, MASK mask) { + // allow scrolled view to handle keystrokes in case it delegated keyboard focus + // to the scroll container. + // NOTE: this should not recurse indefinitely as handleKeyHere + // should not propagate to parent controls, so mScrolledView should *not* + // call LLScrollContainer::handleKeyHere in turn + if (mScrolledView->handleKeyHere(key, mask)) + { + return TRUE; + } for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) { if( mScrollbar[i]->handleKeyHere(key, mask) ) @@ -222,7 +217,7 @@ BOOL LLScrollableContainerView::handleKeyHere(KEY key, MASK mask) return FALSE; } -BOOL LLScrollableContainerView::handleScrollWheel( S32 x, S32 y, S32 clicks ) +BOOL LLScrollContainer::handleScrollWheel( S32 x, S32 y, S32 clicks ) { for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) { @@ -239,7 +234,7 @@ BOOL LLScrollableContainerView::handleScrollWheel( S32 x, S32 y, S32 clicks ) return TRUE; } -BOOL LLScrollableContainerView::needsToScroll(S32 x, S32 y, LLScrollableContainerView::SCROLL_ORIENTATION axis) const +BOOL LLScrollContainer::needsToScroll(S32 x, S32 y, LLScrollContainer::SCROLL_ORIENTATION axis) const { if(mScrollbar[axis]->getVisible()) { @@ -247,7 +242,8 @@ BOOL LLScrollableContainerView::needsToScroll(S32 x, S32 y, LLScrollableContaine const S32 AUTOSCROLL_SIZE = 10; if(mScrollbar[axis]->getVisible()) { - inner_rect_local.mRight -= SCROLLBAR_SIZE; + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); + inner_rect_local.mRight -= scrollbar_size; inner_rect_local.mTop += AUTOSCROLL_SIZE; inner_rect_local.mBottom = inner_rect_local.mTop - AUTOSCROLL_SIZE; } @@ -260,13 +256,14 @@ BOOL LLScrollableContainerView::needsToScroll(S32 x, S32 y, LLScrollableContaine return FALSE; } -BOOL LLScrollableContainerView::handleDragAndDrop(S32 x, S32 y, MASK mask, +BOOL LLScrollContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) { + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); // Scroll folder view if needed. Never accepts a drag or drop. *accept = ACCEPT_NO; BOOL handled = FALSE; @@ -278,11 +275,11 @@ BOOL LLScrollableContainerView::handleDragAndDrop(S32 x, S32 y, MASK mask, LLRect inner_rect_local( 0, mInnerRect.getHeight(), mInnerRect.getWidth(), 0 ); if( mScrollbar[HORIZONTAL]->getVisible() ) { - inner_rect_local.mBottom += SCROLLBAR_SIZE; + inner_rect_local.mBottom += scrollbar_size; } if( mScrollbar[VERTICAL]->getVisible() ) { - inner_rect_local.mRight -= SCROLLBAR_SIZE; + inner_rect_local.mRight -= scrollbar_size; } if( mScrollbar[HORIZONTAL]->getVisible() ) @@ -337,7 +334,7 @@ BOOL LLScrollableContainerView::handleDragAndDrop(S32 x, S32 y, MASK mask, } -BOOL LLScrollableContainerView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect) +BOOL LLScrollContainer::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect) { S32 local_x, local_y; for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) @@ -364,14 +361,15 @@ BOOL LLScrollableContainerView::handleToolTip(S32 x, S32 y, std::string& msg, LL return TRUE; } -void LLScrollableContainerView::calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const +void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const { const LLRect& rect = mScrolledView->getRect(); calcVisibleSize(rect, visible_width, visible_height, show_h_scrollbar, show_v_scrollbar); } -void LLScrollableContainerView::calcVisibleSize( const LLRect& doc_rect, S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const +void LLScrollContainer::calcVisibleSize( const LLRect& doc_rect, S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const { + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); S32 doc_width = doc_rect.getWidth(); S32 doc_height = doc_rect.getHeight(); @@ -382,26 +380,28 @@ void LLScrollableContainerView::calcVisibleSize( const LLRect& doc_rect, S32 *vi if( *visible_height < doc_height ) { *show_v_scrollbar = TRUE; - *visible_width -= SCROLLBAR_SIZE; + *visible_width -= scrollbar_size; } *show_h_scrollbar = FALSE; if( *visible_width < doc_width ) { *show_h_scrollbar = TRUE; - *visible_height -= SCROLLBAR_SIZE; + *visible_height -= scrollbar_size; // Must retest now that visible_height has changed if( !*show_v_scrollbar && (*visible_height < doc_height) ) { *show_v_scrollbar = TRUE; - *visible_width -= SCROLLBAR_SIZE; + *visible_width -= scrollbar_size; } } } + -void LLScrollableContainerView::draw() +void LLScrollContainer::draw() { + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); if (mAutoScrolling) { // add acceleration to autoscroll @@ -427,7 +427,7 @@ void LLScrollableContainerView::draw() if( mIsOpaque ) { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4fv( mBackgroundColor.mV ); + gGL.color4fv( mBackgroundColor.get().mV ); gl_rect_2d( mInnerRect ); } @@ -448,9 +448,9 @@ void LLScrollableContainerView::draw() calcVisibleSize( mScrolledView->getRect(), &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar ); LLLocalClipRect clip(LLRect(mInnerRect.mLeft, - mInnerRect.mBottom + (show_h_scrollbar ? SCROLLBAR_SIZE : 0) + visible_height, + mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0) + visible_height, visible_width, - mInnerRect.mBottom + (show_h_scrollbar ? SCROLLBAR_SIZE : 0) + mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0) )); drawChild(mScrolledView); } @@ -487,10 +487,49 @@ void LLScrollableContainerView::draw() drawDebugRect(); } + //// *HACK: also draw debug rectangles around currently-being-edited LLView, and any elements that are being highlighted by GUI preview code (see LLFloaterUIPreview) + //std::set<LLView*>::iterator iter = std::find(sPreviewHighlightedElements.begin(), sPreviewHighlightedElements.end(), this); + //if ((sEditingUI && this == sEditingUIView) || (iter != sPreviewHighlightedElements.end() && sDrawPreviewHighlights)) + //{ + // drawDebugRect(); + //} + } // end draw -void LLScrollableContainerView::updateScroll() +bool LLScrollContainer::addChild(LLView* view, S32 tab_group) +{ + if (!mScrolledView) + { + //*TODO: Move LLFolderView to llui and enable this check +// if (dynamic_cast<LLPanel*>(view) || dynamic_cast<LLContainerView*>(view) || dynamic_cast<LLScrollingPanelList*>(view) || dynamic_cast<LLFolderView*>(view)) + { + // Use the first panel or container as the scrollable view (bit of a hack) + mScrolledView = view; + } + } + + bool ret_val = LLView::addChild(view, tab_group); + + //bring the scrollbars to the front + sendChildToFront( mScrollbar[HORIZONTAL] ); + sendChildToFront( mScrollbar[VERTICAL] ); + + return ret_val; +} + +const widget_registry_t& LLScrollContainer::getChildRegistry() const { + // a scroll container can contain any default widget + return LLDefaultWidgetRegistry::instance(); +} + +void LLScrollContainer::updateScroll() +{ + if (!mScrolledView) + { + return; + } + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); LLRect doc_rect = mScrolledView->getRect(); S32 doc_width = doc_rect.getWidth(); S32 doc_height = doc_rect.getHeight(); @@ -514,15 +553,15 @@ void LLScrollableContainerView::updateScroll() S32 v_scrollbar_height = visible_height; if( !show_h_scrollbar && mReserveScrollCorner ) { - v_scrollbar_height -= SCROLLBAR_SIZE; + v_scrollbar_height -= scrollbar_size; } - mScrollbar[VERTICAL]->reshape( SCROLLBAR_SIZE, v_scrollbar_height, TRUE ); + mScrollbar[VERTICAL]->reshape( scrollbar_size, v_scrollbar_height, TRUE ); // Make room for the horizontal scrollbar (or not) S32 v_scrollbar_offset = 0; if( show_h_scrollbar || mReserveScrollCorner ) { - v_scrollbar_offset = SCROLLBAR_SIZE; + v_scrollbar_offset = scrollbar_size; } LLRect r = mScrollbar[VERTICAL]->getRect(); r.translate( 0, mInnerRect.mBottom - r.mBottom + v_scrollbar_offset ); @@ -552,9 +591,9 @@ void LLScrollableContainerView::updateScroll() S32 h_scrollbar_width = visible_width; if( !show_v_scrollbar && mReserveScrollCorner ) { - h_scrollbar_width -= SCROLLBAR_SIZE; + h_scrollbar_width -= scrollbar_size; } - mScrollbar[HORIZONTAL]->reshape( h_scrollbar_width, SCROLLBAR_SIZE, TRUE ); + mScrollbar[HORIZONTAL]->reshape( h_scrollbar_width, scrollbar_size, TRUE ); } else { @@ -571,17 +610,17 @@ void LLScrollableContainerView::updateScroll() mScrollbar[VERTICAL]->setPageSize( visible_height ); } // end updateScroll -void LLScrollableContainerView::setBorderVisible(BOOL b) +void LLScrollContainer::setBorderVisible(BOOL b) { mBorder->setVisible( b ); } // Scroll so that as much of rect as possible is showing (where rect is defined in the space of scroller view, not scrolled) -void LLScrollableContainerView::scrollToShowRect(const LLRect& rect, const LLCoordGL& desired_offset) +void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLCoordGL& desired_offset) { if (!mScrolledView) { - llwarns << "LLScrollableContainerView::scrollToShowRect with no view!" << llendl; + llwarns << "LLScrollContainer::scrollToShowRect with no view!" << llendl; return; } @@ -646,27 +685,27 @@ void LLScrollableContainerView::scrollToShowRect(const LLRect& rect, const LLCoo updateScroll(); } -void LLScrollableContainerView::pageUp(S32 overlap) +void LLScrollContainer::pageUp(S32 overlap) { mScrollbar[VERTICAL]->pageUp(overlap); } -void LLScrollableContainerView::pageDown(S32 overlap) +void LLScrollContainer::pageDown(S32 overlap) { mScrollbar[VERTICAL]->pageDown(overlap); } -void LLScrollableContainerView::goToTop() +void LLScrollContainer::goToTop() { mScrollbar[VERTICAL]->setDocPos(0); } -void LLScrollableContainerView::goToBottom() +void LLScrollContainer::goToBottom() { mScrollbar[VERTICAL]->setDocPos(mScrollbar[VERTICAL]->getDocSize()); } -S32 LLScrollableContainerView::getBorderWidth() const +S32 LLScrollContainer::getBorderWidth() const { if (mBorder) { @@ -676,73 +715,3 @@ S32 LLScrollableContainerView::getBorderWidth() const return 0; } -// virtual -LLXMLNodePtr LLScrollableContainerView::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLView::getXML(); - - // Attributes - - node->createChild("opaque", TRUE)->setBoolValue(mIsOpaque); - - if (mIsOpaque) - { - node->createChild("color", TRUE)->setFloatValue(4, mBackgroundColor.mV); - } - - // Contents - - LLXMLNodePtr child_node = mScrolledView->getXML(); - - node->addChild(child_node); - - return node; -} - -LLView* LLScrollableContainerView::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("scroll_container"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - BOOL opaque = FALSE; - node->getAttributeBOOL("opaque", opaque); - - LLColor4 color(0,0,0,0); - LLUICtrlFactory::getAttributeColor(node,"color", color); - - // Create the scroll view - LLScrollableContainerView *ret = new LLScrollableContainerView(name, rect, (LLPanel*)NULL, opaque, color); - - LLPanel* panelp = NULL; - - // Find a child panel to add - LLXMLNodePtr child; - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) - { - LLView *control = factory->createCtrlWidget(panelp, child); - if (control && control->isPanel()) - { - if (panelp) - { - llinfos << "Warning! Attempting to put multiple panels into a scrollable container view!" << llendl; - delete control; - } - else - { - panelp = (LLPanel*)control; - } - } - } - - if (panelp == NULL) - { - panelp = new LLPanel(std::string("dummy"), LLRect::null, FALSE); - } - - ret->mScrolledView = panelp; - - return ret; -} diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index 70fc9087d7756a804f1b0efd218f011ca7820d32..26d8cc824eea2a9ed1a116673471a6a40bef3077 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -1,6 +1,6 @@ /** * @file llscrollcontainer.h - * @brief LLScrollableContainerView class header file. + * @brief LLScrollContainer class header file. * * $LicenseInfo:firstyear=2001&license=viewergpl$ * @@ -53,24 +53,28 @@ class LLUICtrlFactory; * the width and height of the view you're scrolling. * *****************************************************************************/ -class LLScrollableContainerView : public LLUICtrl +class LLScrollContainer : public LLUICtrl { public: // Note: vertical comes before horizontal because vertical // scrollbars have priority for mouse and keyboard events. enum SCROLL_ORIENTATION { VERTICAL, HORIZONTAL, SCROLLBAR_COUNT }; - LLScrollableContainerView( const std::string& name, const LLRect& rect, - LLView* scrolled_view, BOOL is_opaque = FALSE, - const LLColor4& bg_color = LLColor4(0,0,0,0) ); - LLScrollableContainerView( const std::string& name, const LLRect& rect, - LLUICtrl* scrolled_ctrl, BOOL is_opaque = FALSE, - const LLColor4& bg_color = LLColor4(0,0,0,0) ); - virtual ~LLScrollableContainerView( void ); - - void setScrolledView(LLView* view) { mScrolledView = view; } + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<bool> is_opaque; + Optional<LLUIColor> bg_color; + Optional<bool> reserve_scroll_corner; + + Params(); + }; +protected: + LLScrollContainer(const Params&); + friend class LLUICtrlFactory; +public: + virtual ~LLScrollContainer( void ); - virtual void setValue(const LLSD& value) { mInnerRect.setValue(value); } + virtual void setValue(const LLSD& value) { mInnerRect.setValue(value); } void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const; void calcVisibleSize( const LLRect& doc_rect, S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const; @@ -99,13 +103,10 @@ public: virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); virtual void draw(); - - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); + virtual bool addChild(LLView* view, S32 tab_group = 0); + virtual const widget_registry_t& getChildRegistry() const; private: - void init(); - // internal scrollbar handlers virtual void scrollHorizontal( S32 new_pos ); virtual void scrollVertical( S32 new_pos ); @@ -115,7 +116,7 @@ private: LLView* mScrolledView; S32 mSize; BOOL mIsOpaque; - LLColor4 mBackgroundColor; + LLUIColor mBackgroundColor; LLRect mInnerRect; LLViewBorder* mBorder; BOOL mReserveScrollCorner; diff --git a/indra/llui/llscrollingpanellist.cpp b/indra/llui/llscrollingpanellist.cpp index 05d0c6f753336f495b1039cbb0613160e0c25159..1f3a7f9fcf497b88c07db262ea6d387aa78d38d7 100644 --- a/indra/llui/llscrollingpanellist.cpp +++ b/indra/llui/llscrollingpanellist.cpp @@ -35,7 +35,7 @@ #include "llscrollingpanellist.h" -static LLRegisterWidget<LLScrollingPanelList> r("scrolling_panel_list"); +static LLDefaultWidgetRegistry::Register<LLScrollingPanelList> r("scrolling_panel_list"); ///////////////////////////////////////////////////////////////////// @@ -52,9 +52,9 @@ void LLScrollingPanelList::clearPanels() void LLScrollingPanelList::addPanel( LLScrollingPanel* panel ) { - addChildAtEnd( panel ); + addChildInBack( panel ); mPanelList.push_front( panel ); - + const S32 GAP_BETWEEN_PANELS = 6; // Resize this view @@ -82,7 +82,48 @@ void LLScrollingPanelList::addPanel( LLScrollingPanel* panel ) cur_y -= GAP_BETWEEN_PANELS; } } - + +void LLScrollingPanelList::removePanel( U32 panel_index ) +{ + if ( mPanelList.empty() || panel_index >= mPanelList.size() ) + { + llwarns << "Panel index " << panel_index << " is out of range!" << llendl; + return; + } + else + { + removeChild( mPanelList.at(panel_index) ); + mPanelList.erase( mPanelList.begin() + panel_index ); + } + + const S32 GAP_BETWEEN_PANELS = 6; + + // Resize this view + S32 total_height = 0; + S32 max_width = 0; + S32 cur_gap = 0; + for (std::deque<LLScrollingPanel*>::iterator iter = mPanelList.begin(); + iter != mPanelList.end(); ++iter) + { + LLScrollingPanel *childp = *iter; + total_height += childp->getRect().getHeight() + cur_gap; + max_width = llmax( max_width, childp->getRect().getWidth() ); + cur_gap = GAP_BETWEEN_PANELS; + } + reshape( max_width, total_height, FALSE ); + + // Reposition each of the child views + S32 cur_y = total_height; + for (std::deque<LLScrollingPanel*>::iterator iter = mPanelList.begin(); + iter != mPanelList.end(); ++iter) + { + LLScrollingPanel *childp = *iter; + cur_y -= childp->getRect().getHeight(); + childp->translate( -childp->getRect().mLeft, cur_y - childp->getRect().mBottom); + cur_y -= GAP_BETWEEN_PANELS; + } +} + void LLScrollingPanelList::updatePanels(BOOL allow_modify) { for (std::deque<LLScrollingPanel*>::iterator iter = mPanelList.begin(); @@ -138,18 +179,3 @@ void LLScrollingPanelList::draw() LLUICtrl::draw(); } - -// static -LLView* LLScrollingPanelList::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("scrolling_panel_list"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - LLScrollingPanelList* scrolling_panel_list = new LLScrollingPanelList(name, rect); - scrolling_panel_list->initFromXML(node, parent); - return scrolling_panel_list; -} - diff --git a/indra/llui/llscrollingpanellist.h b/indra/llui/llscrollingpanellist.h index b9d730978fff96246708c6d21e9985a1158c7fcf..5dc23facda9ea5d6bab387a18dde050db61212e3 100644 --- a/indra/llui/llscrollingpanellist.h +++ b/indra/llui/llscrollingpanellist.h @@ -29,6 +29,9 @@ * $/LicenseInfo$ */ +#ifndef LL_LLSCROLLINGPANELLIST_H +#define LL_LLSCROLLINGPANELLIST_H + #include <vector> #include "llui.h" @@ -42,7 +45,7 @@ class LLScrollingPanel : public LLPanel { public: - LLScrollingPanel(const std::string& name, const LLRect& rect) : LLPanel(name, rect) { } + LLScrollingPanel(const LLPanel::Params& params) : LLPanel(params) {} virtual void updatePanel(BOOL allow_modify) = 0; }; @@ -53,23 +56,34 @@ public: class LLScrollingPanelList : public LLUICtrl { public: - LLScrollingPanelList(const std::string& name, const LLRect& rect) - : LLUICtrl(name, rect, TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_BOTTOM ) {} + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Params() + { + name = "scrolling_panel_list"; + follows.flags = FOLLOWS_LEFT | FOLLOWS_BOTTOM; + } + }; + LLScrollingPanelList(const Params& p) + : LLUICtrl(p) + {} + + typedef std::deque<LLScrollingPanel*> panel_list_t; virtual void setValue(const LLSD& value) {}; - virtual LLXMLNodePtr getXML(bool save_children) const { return LLUICtrl::getXML(); } - virtual void draw(); void clearPanels(); void addPanel( LLScrollingPanel* panel ); + void removePanel( U32 panel_index ); void updatePanels(BOOL allow_modify); + const panel_list_t& getPanelList() { return mPanelList; } - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - private: void updatePanelVisiblilty(); - std::deque<LLScrollingPanel*> mPanelList; + panel_list_t mPanelList; }; + +#endif //LL_LLSCROLLINGPANELLIST_H diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4e6de24160dbea741d94d40a11b78785c921700e --- /dev/null +++ b/indra/llui/llscrolllistcell.cpp @@ -0,0 +1,413 @@ +/** + * @file llscrolllistcell.cpp + * @brief Scroll lists are composed of rows (items), each of which + * contains columns (cells). + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "llscrolllistcell.h" + +#include "llcheckboxctrl.h" +#include "llui.h" // LLUIImage +#include "lluictrlfactory.h" + +//static +LLScrollListCell* LLScrollListCell::create(const LLScrollListCell::Params& cell_p) +{ + LLScrollListCell* cell = NULL; + + if (cell_p.type() == "icon") + { + cell = new LLScrollListIcon(cell_p); + } + else if (cell_p.type() == "checkbox") + { + cell = new LLScrollListCheck(cell_p); + } + else if (cell_p.type() == "date") + { + cell = new LLScrollListDate(cell_p); + } + else // default is "text" + { + cell = new LLScrollListText(cell_p); + } + + if (cell_p.value.isProvided()) + { + cell->setValue(cell_p.value); + } + + return cell; +} + + +LLScrollListCell::LLScrollListCell(const LLScrollListCell::Params& p) +: mWidth(p.width) +{} + +// virtual +const LLSD LLScrollListCell::getValue() const +{ + return LLStringUtil::null; +} + +// +// LLScrollListIcon +// +LLScrollListIcon::LLScrollListIcon(const LLScrollListCell::Params& p) +: LLScrollListCell(p), + mIcon(LLUI::getUIImage(p.value().asString())), + mColor(p.color), + mAlignment(p.font_halign) +{} + +LLScrollListIcon::~LLScrollListIcon() +{ +} + +/*virtual*/ +S32 LLScrollListIcon::getHeight() const +{ return mIcon ? mIcon->getHeight() : 0; } + +/*virtual*/ +const LLSD LLScrollListIcon::getValue() const +{ return mIcon.isNull() ? LLStringUtil::null : mIcon->getName(); } + +void LLScrollListIcon::setValue(const LLSD& value) +{ + if (value.isUUID()) + { + // don't use default image specified by LLUUID::null, use no image in that case + LLUUID image_id = value.asUUID(); + mIcon = image_id.notNull() ? LLUI::getUIImageByID(image_id) : LLUIImagePtr(NULL); + } + else + { + std::string value_string = value.asString(); + if (LLUUID::validate(value_string)) + { + setValue(LLUUID(value_string)); + } + else if (!value_string.empty()) + { + mIcon = LLUI::getUIImage(value.asString()); + } + else + { + mIcon = NULL; + } + } +} + + +void LLScrollListIcon::setColor(const LLColor4& color) +{ + mColor = color; +} + +S32 LLScrollListIcon::getWidth() const +{ + // if no specified fix width, use width of icon + if (LLScrollListCell::getWidth() == 0 && mIcon.notNull()) + { + return mIcon->getWidth(); + } + return LLScrollListCell::getWidth(); +} + + +void LLScrollListIcon::draw(const LLColor4& color, const LLColor4& highlight_color) const +{ + if (mIcon) + { + switch(mAlignment) + { + case LLFontGL::LEFT: + mIcon->draw(0, 0, mColor); + break; + case LLFontGL::RIGHT: + mIcon->draw(getWidth() - mIcon->getWidth(), 0, mColor); + break; + case LLFontGL::HCENTER: + mIcon->draw((getWidth() - mIcon->getWidth()) / 2, 0, mColor); + break; + default: + break; + } + } +} + +// +// LLScrollListText +// +U32 LLScrollListText::sCount = 0; + +LLScrollListText::LLScrollListText(const LLScrollListCell::Params& p) +: LLScrollListCell(p), + mText(p.value().asString()), + mFont(p.font), + mColor(p.color), + mUseColor(p.color.isProvided()), + mFontStyle(LLFontGL::NORMAL), + mFontAlignment(p.font_halign), + mVisible(p.visible), + mHighlightCount( 0 ), + mHighlightOffset( 0 ) +{ + sCount++; + + // initialize rounded rect image + if (!mRoundedRectImage) + { + mRoundedRectImage = LLUI::getUIImage("rounded_square.tga"); + } +} + +//virtual +void LLScrollListText::highlightText(S32 offset, S32 num_chars) +{ + mHighlightOffset = offset; + mHighlightCount = num_chars; +} + +//virtual +BOOL LLScrollListText::isText() const +{ + return TRUE; +} + +//virtual +BOOL LLScrollListText::getVisible() const +{ + return mVisible; +} + +//virtual +S32 LLScrollListText::getHeight() const +{ + return llround(mFont->getLineHeight()); +} + + +LLScrollListText::~LLScrollListText() +{ + sCount--; +} + +S32 LLScrollListText::getContentWidth() const +{ + return mFont->getWidth(mText.getString()); +} + + +void LLScrollListText::setColor(const LLColor4& color) +{ + mColor = color; + mUseColor = TRUE; +} + +void LLScrollListText::setText(const LLStringExplicit& text) +{ + mText = text; +} + +//virtual +void LLScrollListText::setValue(const LLSD& text) +{ + setText(text.asString()); +} + +//virtual +const LLSD LLScrollListText::getValue() const +{ + return LLSD(mText.getString()); +} + + +void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_color) const +{ + LLColor4 display_color; + if (mUseColor) + { + display_color = mColor; + } + else + { + display_color = color; + } + + if (mHighlightCount > 0) + { + S32 left = 0; + switch(mFontAlignment) + { + case LLFontGL::LEFT: + left = mFont->getWidth(mText.getString(), 0, mHighlightOffset); + break; + case LLFontGL::RIGHT: + left = getWidth() - mFont->getWidth(mText.getString(), mHighlightOffset, S32_MAX); + break; + case LLFontGL::HCENTER: + left = (getWidth() - mFont->getWidth(mText.getString())) / 2; + break; + } + LLRect highlight_rect(left - 2, + llround(mFont->getLineHeight()) + 1, + left + mFont->getWidth(mText.getString(), mHighlightOffset, mHighlightCount) + 1, + 1); + mRoundedRectImage->draw(highlight_rect, highlight_color); + } + + // Try to draw the entire string + F32 right_x; + U32 string_chars = mText.length(); + F32 start_x = 0.f; + switch(mFontAlignment) + { + case LLFontGL::LEFT: + start_x = 0.f; + break; + case LLFontGL::RIGHT: + start_x = (F32)getWidth(); + break; + case LLFontGL::HCENTER: + start_x = (F32)getWidth() * 0.5f; + break; + } + mFont->render(mText.getWString(), 0, + start_x, 2.f, + display_color, + mFontAlignment, + LLFontGL::BOTTOM, + mFontStyle, + LLFontGL::NO_SHADOW, + string_chars, + getWidth(), + &right_x, + FALSE, + TRUE); +} + +// +// LLScrollListCheck +// +LLScrollListCheck::LLScrollListCheck(const LLScrollListCell::Params& p) +: LLScrollListCell(p) +{ + LLCheckBoxCtrl::Params checkbox_p; + checkbox_p.name("checkbox"); + checkbox_p.rect.left(0).bottom(0).width(p.width).height(p.width); + checkbox_p.enabled(p.enabled); + checkbox_p.initial_value(p.value()); + + mCheckBox = LLUICtrlFactory::create<LLCheckBoxCtrl>(checkbox_p); + + LLRect rect(mCheckBox->getRect()); + if (p.width) + { + rect.mRight = rect.mLeft + p.width; + mCheckBox->setRect(rect); + setWidth(p.width); + } + else + { + setWidth(rect.getWidth()); //check_box->getWidth(); + } + + mCheckBox->setColor(p.color); +} + + +LLScrollListCheck::~LLScrollListCheck() +{ + delete mCheckBox; + mCheckBox = NULL; +} + +void LLScrollListCheck::draw(const LLColor4& color, const LLColor4& highlight_color) const +{ + mCheckBox->draw(); +} + +BOOL LLScrollListCheck::handleClick() +{ + if (mCheckBox->getEnabled()) + { + mCheckBox->toggle(); + } + // don't change selection when clicking on embedded checkbox + return TRUE; +} + +/*virtual*/ +const LLSD LLScrollListCheck::getValue() const +{ + return mCheckBox->getValue(); +} + +/*virtual*/ +void LLScrollListCheck::setValue(const LLSD& value) +{ + mCheckBox->setValue(value); +} + +/*virtual*/ +void LLScrollListCheck::onCommit() +{ + mCheckBox->onCommit(); +} + +/*virtual*/ +void LLScrollListCheck::setEnabled(BOOL enable) +{ + mCheckBox->setEnabled(enable); +} + +// +// LLScrollListDate +// + +LLScrollListDate::LLScrollListDate( const LLScrollListCell::Params& p) +: LLScrollListText(p), + mDate(p.value().asDate()) +{} + +void LLScrollListDate::setValue(const LLSD& value) +{ + mDate = value.asDate(); + LLScrollListText::setValue(mDate.asRFC1123()); +} + +const LLSD LLScrollListDate::getValue() const +{ + return mDate; +} diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h new file mode 100644 index 0000000000000000000000000000000000000000..2ab13f76188f45afe051c77d0c5ee5e29d90ceb6 --- /dev/null +++ b/indra/llui/llscrolllistcell.h @@ -0,0 +1,223 @@ +/** + * @file llscrolllistcell.h + * @brief Scroll lists are composed of rows (items), each of which + * contains columns (cells). + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LLSCROLLLISTCELL_H +#define LLSCROLLLISTCELL_H + +#include "llfontgl.h" // HAlign +#include "llpointer.h" // LLPointer<> +#include "lluistring.h" +#include "v4color.h" +#include "llui.h" + +class LLCheckBoxCtrl; +class LLSD; +class LLUIImage; + +/* + * Represents a cell in a scrollable table. + * + * Sub-classes must return height and other properties + * though width accessors are implemented by the base class. + * It is therefore important for sub-class constructors to call + * setWidth() with realistic values. + */ +class LLScrollListCell +{ +public: + struct Params : public LLInitParam::Block<Params> + { + Optional<std::string> type, + column; + + Optional<S32> width; + Optional<bool> enabled, + visible; + + Optional<void*> userdata; + Optional<LLSD> value; + + Optional<const LLFontGL*> font; + Optional<LLColor4> font_color; + Optional<LLFontGL::HAlign> font_halign; + + Optional<LLColor4> color; + + Params() + : type("type", "text"), + column("column"), + width("width"), + enabled("enabled", true), + visible("visible", true), + value("value"), + font("font", LLFontGL::getFontSansSerifSmall()), + font_color("font_color", LLColor4::black), + color("color", LLColor4::white), + font_halign("halign", LLFontGL::LEFT) + { + addSynonym(column, "name"); + addSynonym(font_color, "font-color"); + } + }; + + static LLScrollListCell* create(const Params&); + + LLScrollListCell(const LLScrollListCell::Params&); + virtual ~LLScrollListCell() {}; + virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const = 0; // truncate to given width, if possible + virtual S32 getWidth() const {return mWidth;} + virtual S32 getContentWidth() const { return 0; } + virtual S32 getHeight() const = 0; + virtual const LLSD getValue() const; + virtual void setValue(const LLSD& value) { } + virtual BOOL getVisible() const { return TRUE; } + virtual void setWidth(S32 width) { mWidth = width; } + virtual void highlightText(S32 offset, S32 num_chars) {} + virtual BOOL isText() const = 0; + virtual void setColor(const LLColor4&) {} + virtual void onCommit() {}; + + virtual BOOL handleClick() { return FALSE; } + virtual void setEnabled(BOOL enable) { } + +private: + S32 mWidth; +}; + +class LLScrollListSpacer : public LLScrollListCell +{ +public: + LLScrollListSpacer(const LLScrollListCell::Params& p) : LLScrollListCell(p) {} + /*virtual*/ ~LLScrollListSpacer() {}; + /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const {} + /*virtual*/ S32 getHeight() const { return 0; } + /*virtual*/ BOOL isText() const { return FALSE; } +}; + +/* + * Cell displaying a text label. + */ +class LLScrollListText : public LLScrollListCell +{ +public: + LLScrollListText(const LLScrollListCell::Params&); + /*virtual*/ ~LLScrollListText(); + + /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const; + /*virtual*/ S32 getContentWidth() const; + /*virtual*/ S32 getHeight() const; + /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ const LLSD getValue() const; + /*virtual*/ BOOL getVisible() const; + /*virtual*/ void highlightText(S32 offset, S32 num_chars); + + /*virtual*/ void setColor(const LLColor4&); + /*virtual*/ BOOL isText() const; + + void setText(const LLStringExplicit& text); + void setFontStyle(const U8 font_style) { mFontStyle = font_style; } + +private: + LLUIString mText; + const LLFontGL* mFont; + LLColor4 mColor; + U8 mUseColor; + U8 mFontStyle; + LLFontGL::HAlign mFontAlignment; + BOOL mVisible; + S32 mHighlightCount; + S32 mHighlightOffset; + + LLPointer<LLUIImage> mRoundedRectImage; + + static U32 sCount; +}; + +/* + * Cell displaying an image. + */ +class LLScrollListIcon : public LLScrollListCell +{ +public: + LLScrollListIcon(const LLScrollListCell::Params& p); + /*virtual*/ ~LLScrollListIcon(); + /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const; + /*virtual*/ S32 getWidth() const; + /*virtual*/ S32 getHeight() const; + /*virtual*/ const LLSD getValue() const; + /*virtual*/ void setColor(const LLColor4&); + /*virtual*/ BOOL isText()const { return FALSE; } + /*virtual*/ void setValue(const LLSD& value); + +private: + LLPointer<LLUIImage> mIcon; + LLColor4 mColor; + LLFontGL::HAlign mAlignment; +}; + +/* + * An interactive cell containing a check box. + */ +class LLScrollListCheck : public LLScrollListCell +{ +public: + LLScrollListCheck( const LLScrollListCell::Params&); + /*virtual*/ ~LLScrollListCheck(); + /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const; + /*virtual*/ S32 getHeight() const { return 0; } + /*virtual*/ const LLSD getValue() const; + /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ void onCommit(); + + /*virtual*/ BOOL handleClick(); + /*virtual*/ void setEnabled(BOOL enable); + + LLCheckBoxCtrl* getCheckBox() { return mCheckBox; } + /*virtual*/ BOOL isText() const { return FALSE; } + +private: + LLCheckBoxCtrl* mCheckBox; +}; + +class LLScrollListDate : public LLScrollListText +{ +public: + LLScrollListDate( const LLScrollListCell::Params& p ); + virtual void setValue(const LLSD& value); + virtual const LLSD getValue() const; + +private: + LLDate mDate; +}; + +#endif diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp new file mode 100644 index 0000000000000000000000000000000000000000..48fddbfb717d465c0cee46915f4e68cdc31eb80d --- /dev/null +++ b/indra/llui/llscrolllistcolumn.cpp @@ -0,0 +1,320 @@ +/** + * @file llscrollcolumnheader.cpp + * @brief Scroll lists are composed of rows (items), each of which + * contains columns (cells). + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "llscrolllistcolumn.h" + +#include "llbutton.h" +#include "llresizebar.h" +#include "llscrolllistcell.h" +#include "llscrolllistctrl.h" +#include "llscrolllistitem.h" +#include "lluictrlfactory.h" + +const S32 MIN_COLUMN_WIDTH = 20; + +//--------------------------------------------------------------------------- +// LLScrollColumnHeader +//--------------------------------------------------------------------------- + +LLScrollColumnHeader::LLScrollColumnHeader(const LLScrollColumnHeader::Params& p) +: LLButton(p), // use combobox params to steal images + mColumn(p.column), + mHasResizableElement(FALSE) +{ + setClickedCallback(boost::bind(&LLScrollColumnHeader::onClick, this, _2)); + + // resize handles on left and right + const S32 RESIZE_BAR_THICKNESS = 3; + LLResizeBar::Params resize_bar_p; + resize_bar_p.resizing_view(this); + resize_bar_p.rect(LLRect(getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0)); + resize_bar_p.min_size(MIN_COLUMN_WIDTH); + resize_bar_p.side(LLResizeBar::RIGHT); + resize_bar_p.enabled(false); + mResizeBar = LLUICtrlFactory::create<LLResizeBar>(resize_bar_p); + addChild(mResizeBar); + + setToolTip(p.label()); +} + +LLScrollColumnHeader::~LLScrollColumnHeader() +{} + +void LLScrollColumnHeader::draw() +{ + std::string sort_column = mColumn->mParentCtrl->getSortColumnName(); + BOOL draw_arrow = !mColumn->mLabel.empty() + && mColumn->mParentCtrl->isSorted() + // check for indirect sorting column as well as column's sorting name + && (sort_column == mColumn->mSortingColumn || sort_column == mColumn->mName); + + BOOL is_ascending = mColumn->mParentCtrl->getSortAscending(); + setImageOverlay(is_ascending ? "up_arrow.tga" : "down_arrow.tga", LLFontGL::RIGHT, draw_arrow ? LLColor4::white : LLColor4::transparent); + + // Draw children + LLButton::draw(); +} + +BOOL LLScrollColumnHeader::handleDoubleClick(S32 x, S32 y, MASK mask) +{ + if (canResize() && mResizeBar->getRect().pointInRect(x, y)) + { + // reshape column to max content width + LLRect column_rect = getRect(); + column_rect.mRight = column_rect.mLeft + mColumn->mMaxContentWidth; + setShape(column_rect, true); + } + else + { + onClick(LLSD()); + } + return TRUE; +} + +void LLScrollColumnHeader::onClick(const LLSD& data) +{ + if (mColumn) + { + LLScrollListCtrl::onClickColumn(mColumn); + } +} + +LLView* LLScrollColumnHeader::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding) +{ + // this logic assumes dragging on right + llassert(snap_edge == SNAP_RIGHT); + + // use higher snap threshold for column headers + threshold = llmin(threshold, 10); + + LLRect snap_rect = getSnapRect(); + + S32 snap_delta = mColumn->mMaxContentWidth - snap_rect.getWidth(); + + // x coord growing means column growing, so same signs mean we're going in right direction + if (llabs(snap_delta) <= threshold && mouse_dir.mX * snap_delta > 0 ) + { + new_edge_val = snap_rect.mRight + snap_delta; + } + else + { + LLScrollListColumn* next_column = mColumn->mParentCtrl->getColumn(mColumn->mIndex + 1); + while (next_column) + { + if (next_column->mHeader) + { + snap_delta = (next_column->mHeader->getSnapRect().mRight - next_column->mMaxContentWidth) - snap_rect.mRight; + if (llabs(snap_delta) <= threshold && mouse_dir.mX * snap_delta > 0 ) + { + new_edge_val = snap_rect.mRight + snap_delta; + } + break; + } + next_column = mColumn->mParentCtrl->getColumn(next_column->mIndex + 1); + } + } + + return this; +} + +void LLScrollColumnHeader::handleReshape(const LLRect& new_rect, bool by_user) +{ + S32 new_width = new_rect.getWidth(); + S32 delta_width = new_width - (getRect().getWidth() /*+ mColumn->mParentCtrl->getColumnPadding()*/); + + if (delta_width != 0) + { + S32 remaining_width = -delta_width; + S32 col; + for (col = mColumn->mIndex + 1; col < mColumn->mParentCtrl->getNumColumns(); col++) + { + LLScrollListColumn* columnp = mColumn->mParentCtrl->getColumn(col); + if (!columnp) continue; + + if (columnp->mHeader && columnp->mHeader->canResize()) + { + // how many pixels in width can this column afford to give up? + S32 resize_buffer_amt = llmax(0, columnp->getWidth() - MIN_COLUMN_WIDTH); + + // user shrinking column, need to add width to other columns + if (delta_width < 0) + { + if (columnp->getWidth() > 0) + { + // statically sized column, give all remaining width to this column + columnp->setWidth(columnp->getWidth() + remaining_width); + if (columnp->mRelWidth > 0.f) + { + columnp->mRelWidth = (F32)columnp->getWidth() / (F32)mColumn->mParentCtrl->getItemListRect().getWidth(); + } + // all padding went to this widget, we're done + break; + } + } + else + { + // user growing column, need to take width from other columns + remaining_width += resize_buffer_amt; + + if (columnp->getWidth() > 0) + { + columnp->setWidth(columnp->getWidth() - llmin(columnp->getWidth() - MIN_COLUMN_WIDTH, delta_width)); + if (columnp->mRelWidth > 0.f) + { + columnp->mRelWidth = (F32)columnp->getWidth() / (F32)mColumn->mParentCtrl->getItemListRect().getWidth(); + } + } + + if (remaining_width >= 0) + { + // width sucked up from neighboring columns, done + break; + } + } + } + } + + // clamp resize amount to maximum that can be absorbed by other columns + if (delta_width > 0) + { + delta_width += llmin(remaining_width, 0); + } + + // propagate constrained delta_width to new width for this column + new_width = getRect().getWidth() + delta_width - mColumn->mParentCtrl->getColumnPadding(); + + // use requested width + mColumn->setWidth(new_width); + + // update proportional spacing + if (mColumn->mRelWidth > 0.f) + { + mColumn->mRelWidth = (F32)new_width / (F32)mColumn->mParentCtrl->getItemListRect().getWidth(); + } + + // tell scroll list to layout columns again + // do immediate update to get proper feedback to resize handle + // which needs to know how far the resize actually went + mColumn->mParentCtrl->updateColumns(); + } +} + +void LLScrollColumnHeader::setHasResizableElement(BOOL resizable) +{ + if (mHasResizableElement != resizable) + { + mColumn->mParentCtrl->dirtyColumns(); + mHasResizableElement = resizable; + } +} + +void LLScrollColumnHeader::updateResizeBars() +{ + S32 num_resizable_columns = 0; + S32 col; + for (col = 0; col < mColumn->mParentCtrl->getNumColumns(); col++) + { + LLScrollListColumn* columnp = mColumn->mParentCtrl->getColumn(col); + if (columnp->mHeader && columnp->mHeader->canResize()) + { + num_resizable_columns++; + } + } + + S32 num_resizers_enabled = 0; + + // now enable/disable resize handles on resizable columns if we have at least two + for (col = 0; col < mColumn->mParentCtrl->getNumColumns(); col++) + { + LLScrollListColumn* columnp = mColumn->mParentCtrl->getColumn(col); + if (!columnp->mHeader) continue; + BOOL enable = num_resizable_columns >= 2 && num_resizers_enabled < (num_resizable_columns - 1) && columnp->mHeader->canResize(); + columnp->mHeader->enableResizeBar(enable); + if (enable) + { + num_resizers_enabled++; + } + } +} + +void LLScrollColumnHeader::enableResizeBar(BOOL enable) +{ + mResizeBar->setEnabled(enable); +} + +BOOL LLScrollColumnHeader::canResize() +{ + return getVisible() && (mHasResizableElement || mColumn->mDynamicWidth); +} + +void LLScrollListColumn::SortNames::declareValues() +{ + declare("ascending", LLScrollListColumn::ASCENDING); + declare("descending", LLScrollListColumn::DESCENDING); +} + +LLScrollListColumn::LLScrollListColumn(const Params& p, LLScrollListCtrl* parent) +: mWidth(0), + mIndex (-1), + mParentCtrl(parent), + mName(p.name), + mLabel(p.header.label), + mHeader(NULL), + mMaxContentWidth(0), + mDynamicWidth(p.width.dynamic_width), + mRelWidth(p.width.relative_width), + mFontAlignment(p.halign), + mSortingColumn(p.sort_column) +{ + if (p.sort_ascending.isProvided()) + { + mSortDirection = p.sort_ascending() ? ASCENDING : DESCENDING; + } + else + { + mSortDirection = p.sort_direction; + } + + setWidth(p.width.pixel_width); +} + +void LLScrollListColumn::setWidth(S32 width) +{ + if (!mDynamicWidth && mRelWidth <= 0.f) + { + mParentCtrl->updateStaticColumnWidth(this, width); + } + mWidth = width; +} diff --git a/indra/llui/llscrolllistcolumn.h b/indra/llui/llscrolllistcolumn.h new file mode 100644 index 0000000000000000000000000000000000000000..c1bb86577f667ea6e85c92ce06b7248205eec12b --- /dev/null +++ b/indra/llui/llscrolllistcolumn.h @@ -0,0 +1,189 @@ +/** + * @file llscrollcolumnheader.h + * @brief Scroll lists are composed of rows (items), each of which + * contains columns (cells). + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LLSCROLLLISTCOLUMN_H +#define LLSCROLLLISTCOLUMN_H + +#include "llrect.h" +#include "lluistring.h" +#include "llbutton.h" +#include "llinitparam.h" + +class LLScrollListColumn; +class LLResizeBar; +class LLScrollListCtrl; + +class LLScrollColumnHeader : public LLButton +{ +public: + struct Params : public LLInitParam::Block<Params, LLButton::Params> + { + Mandatory<LLScrollListColumn*> column; + + Params() + : column("column") + { + name = "column_header"; + image_unselected.name("square_btn_32x128.tga"); + image_selected.name("square_btn_selected_32x128.tga"); + image_disabled.name("square_btn_32x128.tga"); + image_disabled_selected.name("square_btn_selected_32x128.tga"); + image_overlay.name("combobox_arrow.tga"); + image_overlay_alignment("right"); + font_halign = LLFontGL::LEFT; + tab_stop(false); + scale_image(true); + } + }; + LLScrollColumnHeader(const Params&); + ~LLScrollColumnHeader(); + + /*virtual*/ void draw(); + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); + + /*virtual*/ LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding); + /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); + + LLScrollListColumn* getColumn() { return mColumn; } + void setHasResizableElement(BOOL resizable); + void updateResizeBars(); + BOOL canResize(); + void enableResizeBar(BOOL enable); + + void onClick(const LLSD& data); + +private: + LLScrollListColumn* mColumn; + LLResizeBar* mResizeBar; + BOOL mHasResizableElement; +}; + +/* + * A simple data class describing a column within a scroll list. + */ +class LLScrollListColumn +{ +public: + typedef enum e_sort_direction + { + DESCENDING, + ASCENDING + } ESortDirection; + + struct SortNames + : public LLInitParam::TypeValuesHelper<LLScrollListColumn::ESortDirection, SortNames> + { + static void declareValues(); + }; + + struct Params : public LLInitParam::Block<Params> + { + Optional<std::string> name, + tool_tip; + Optional<std::string> sort_column; + Optional<ESortDirection, SortNames> sort_direction; + Optional<bool> sort_ascending; + + struct Width : public LLInitParam::Choice<Width> + { + Option<bool> dynamic_width; + Option<S32> pixel_width; + Option<F32> relative_width; + + Width() + : dynamic_width("dynamicwidth", false), + pixel_width("width"), + relative_width("relative_width", -1.f) + { + addSynonym(relative_width, "relwidth"); + } + }; + Optional<Width> width; + + // either an image or label is used in column header + struct Header : public LLInitParam::Choice<Header> + { + Option<std::string> label; + Option<LLUIImage*> image; + + Header() + : label("label"), + image("image") + {} + }; + Optional<Header> header; + + Optional<LLFontGL::HAlign> halign; + + Params() + : name("name"), + tool_tip("tool_tip"), + sort_column("sort_column"), + sort_direction("sort_direction"), + sort_ascending("sort_ascending", true), + halign("halign", LLFontGL::LEFT) + { + // default choice to "dynamic_width" + width.dynamic_width = true; + + addSynonym(sort_column, "sort"); + } + }; + + //NOTE: this is default constructible so we can store it in a map. + LLScrollListColumn(const Params& p = Params(), LLScrollListCtrl* = NULL); + + void setWidth(S32 width); + S32 getWidth() const { return mWidth; } + +public: + // Public data is fine so long as this remains a simple struct-like data class. + // If it ever gets any smarter than that, these should all become private + // with protected or public accessor methods added as needed. -MG + std::string mName; + std::string mSortingColumn; + ESortDirection mSortDirection; + LLUIString mLabel; + F32 mRelWidth; + BOOL mDynamicWidth; + S32 mMaxContentWidth; + S32 mIndex; + LLScrollListCtrl* mParentCtrl; + LLScrollColumnHeader* mHeader; + LLFontGL::HAlign mFontAlignment; + +private: + S32 mWidth; +}; + +#endif diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 5dd4e2d0ee79e00de8917814cc9b24621bb9f2fe..42c7c892c86a30e6683ad8991418f5088ecac107 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1,6 +1,7 @@ /** * @file llscrolllistctrl.cpp - * @brief LLScrollListCtrl base class + * @brief Scroll lists are composed of rows (items), each of which + * contains columns (cells). * * $LicenseInfo:firstyear=2001&license=viewergpl$ * @@ -30,34 +31,38 @@ * $/LicenseInfo$ */ -#include <algorithm> +#define INSTANTIATE_GETCHILD_SCROLLLIST #include "linden_common.h" -#include "llstl.h" -#include "llboost.h" #include "llscrolllistctrl.h" -#include "indra_constants.h" +#include <algorithm> + +#include "llstl.h" +#include "llboost.h" +//#include "indra_constants.h" #include "llcheckboxctrl.h" #include "llclipboard.h" #include "llfocusmgr.h" -#include "llrender.h" +//#include "llrender.h" #include "llresmgr.h" #include "llscrollbar.h" +#include "llscrolllistcell.h" #include "llstring.h" #include "llui.h" #include "lluictrlfactory.h" #include "llwindow.h" #include "llcontrol.h" #include "llkeyboard.h" -#include "llresizebar.h" +#include "llviewborder.h" +#include "lltextbox.h" +#include "llsdparam.h" -const S32 MIN_COLUMN_WIDTH = 20; -const S32 LIST_SNAP_PADDING = 5; +template LLScrollListCtrl* LLView::getChild<LLScrollListCtrl>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const; -static LLRegisterWidget<LLScrollListCtrl> r("scroll_list"); +static LLDefaultWidgetRegistry::Register<LLScrollListCtrl> r("scroll_list"); // local structures & classes. struct SortScrollListItem @@ -96,510 +101,89 @@ struct SortScrollListItem const sort_order_t& mSortOrders; }; - -// -// LLScrollListIcon -// -LLScrollListIcon::LLScrollListIcon(LLUIImagePtr icon, S32 width) - : LLScrollListCell(width), - mIcon(icon), - mColor(LLColor4::white) -{ -} - -LLScrollListIcon::LLScrollListIcon(const LLSD& value, S32 width) - : LLScrollListCell(width), - mColor(LLColor4::white) -{ - setValue(value); -} - - -LLScrollListIcon::~LLScrollListIcon() -{ -} - -void LLScrollListIcon::setValue(const LLSD& value) -{ - if (value.isUUID()) - { - // don't use default image specified by LLUUID::null, use no image in that case - LLUUID image_id = value.asUUID(); - mIcon = image_id.notNull() ? LLUI::sImageProvider->getUIImageByID(image_id) : LLUIImagePtr(NULL); - } - else - { - std::string value_string = value.asString(); - if (LLUUID::validate(value_string)) - { - setValue(LLUUID(value_string)); - } - else if (!value_string.empty()) - { - mIcon = LLUI::getUIImage(value.asString()); - } - else - { - mIcon = NULL; - } - } -} - - -void LLScrollListIcon::setColor(const LLColor4& color) -{ - mColor = color; -} - -S32 LLScrollListIcon::getWidth() const -{ - // if no specified fix width, use width of icon - if (LLScrollListCell::getWidth() == 0 && mIcon.notNull()) - { - return mIcon->getWidth(); - } - return LLScrollListCell::getWidth(); -} - - -void LLScrollListIcon::draw(const LLColor4& color, const LLColor4& highlight_color) const -{ - if (mIcon) - { - mIcon->draw(0, 0, mColor); - } -} - -// -// LLScrollListCheck -// -LLScrollListCheck::LLScrollListCheck(LLCheckBoxCtrl* check_box, S32 width) -{ - mCheckBox = check_box; - LLRect rect(mCheckBox->getRect()); - if (width) - { - - rect.mRight = rect.mLeft + width; - mCheckBox->setRect(rect); - setWidth(width); - } - else - { - setWidth(rect.getWidth()); //check_box->getWidth(); - } -} - -LLScrollListCheck::~LLScrollListCheck() -{ - delete mCheckBox; -} - -void LLScrollListCheck::draw(const LLColor4& color, const LLColor4& highlight_color) const -{ - mCheckBox->draw(); -} - -BOOL LLScrollListCheck::handleClick() -{ - if (mCheckBox->getEnabled()) - { - mCheckBox->toggle(); - } - // don't change selection when clicking on embedded checkbox - return TRUE; -} - -// -// LLScrollListSeparator -// -LLScrollListSeparator::LLScrollListSeparator(S32 width) : LLScrollListCell(width) -{ -} - -//virtual -S32 LLScrollListSeparator::getHeight() const -{ - return 5; -} - - -void LLScrollListSeparator::draw(const LLColor4& color, const LLColor4& highlight_color) const -{ - //*FIXME: use dynamic item heights and make separators narrow, and inactive - gl_line_2d(5, 8, llmax(5, getWidth() - 5), 8, color); -} - -// -// LLScrollListText -// -U32 LLScrollListText::sCount = 0; - -LLScrollListText::LLScrollListText( const std::string& text, const LLFontGL* font, S32 width, U8 font_style, LLFontGL::HAlign font_alignment, LLColor4& color, BOOL use_color, BOOL visible) -: LLScrollListCell(width), - mText( text ), - mFont( font ), - mColor(color), - mUseColor(use_color), - mFontStyle( font_style ), - mFontAlignment( font_alignment ), - mVisible( visible ), - mHighlightCount( 0 ), - mHighlightOffset( 0 ) -{ - sCount++; - - // initialize rounded rect image - if (!mRoundedRectImage) - { - mRoundedRectImage = LLUI::sImageProvider->getUIImage("rounded_square.tga"); - } -} -//virtual -void LLScrollListText::highlightText(S32 offset, S32 num_chars) -{ - mHighlightOffset = offset; - mHighlightCount = num_chars; -} - -//virtual -BOOL LLScrollListText::isText() const -{ - return TRUE; -} - -//virtual -BOOL LLScrollListText::getVisible() const -{ - return mVisible; -} - -//virtual -S32 LLScrollListText::getHeight() const -{ - return llround(mFont->getLineHeight()); -} - - -LLScrollListText::~LLScrollListText() -{ - sCount--; -} - -S32 LLScrollListText::getContentWidth() const -{ - return mFont->getWidth(mText.getString()); -} - - -void LLScrollListText::setColor(const LLColor4& color) -{ - mColor = color; - mUseColor = TRUE; -} - -void LLScrollListText::setText(const LLStringExplicit& text) -{ - mText = text; -} - -//virtual -void LLScrollListText::setValue(const LLSD& text) -{ - setText(text.asString()); -} - -//virtual -const LLSD LLScrollListText::getValue() const -{ - return LLSD(mText.getString()); -} - - -void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_color) const -{ - LLColor4 display_color; - if (mUseColor) - { - display_color = mColor; - } - else - { - display_color = color; - } - - if (mHighlightCount > 0) - { - S32 left = 0; - switch(mFontAlignment) - { - case LLFontGL::LEFT: - left = mFont->getWidth(mText.getString(), 0, mHighlightOffset); - break; - case LLFontGL::RIGHT: - left = getWidth() - mFont->getWidth(mText.getString(), mHighlightOffset, S32_MAX); - break; - case LLFontGL::HCENTER: - left = (getWidth() - mFont->getWidth(mText.getString())) / 2; - break; - } - LLRect highlight_rect(left - 2, - llround(mFont->getLineHeight()) + 1, - left + mFont->getWidth(mText.getString(), mHighlightOffset, mHighlightCount) + 1, - 1); - mRoundedRectImage->draw(highlight_rect, highlight_color); - } - - // Try to draw the entire string - F32 right_x; - U32 string_chars = mText.length(); - F32 start_x = 0.f; - switch(mFontAlignment) - { - case LLFontGL::LEFT: - start_x = 0.f; - break; - case LLFontGL::RIGHT: - start_x = (F32)getWidth(); - break; - case LLFontGL::HCENTER: - start_x = (F32)getWidth() * 0.5f; - break; - } - mFont->render(mText.getWString(), 0, - start_x, 2.f, - display_color, - mFontAlignment, - LLFontGL::BOTTOM, - mFontStyle, - string_chars, - getWidth(), - &right_x, - FALSE, - TRUE); -} - -LLScrollListDate::LLScrollListDate( const LLDate& date, const LLFontGL* font, S32 width, U8 font_style, LLFontGL::HAlign font_alignment, LLColor4& color, BOOL use_color, BOOL visible) -: LLScrollListText(date.asRFC1123(), font, width, font_style, font_alignment, color, use_color, visible), - mDate(date) -{ -} - -void LLScrollListDate::setValue(const LLSD& value) -{ - mDate = value.asDate(); - LLScrollListText::setValue(mDate.asRFC1123()); -} - -const LLSD LLScrollListDate::getValue() const -{ - return mDate; -} - -LLScrollListItem::~LLScrollListItem() -{ - std::for_each(mColumns.begin(), mColumns.end(), DeletePointer()); -} - -void LLScrollListItem::setNumColumns(S32 columns) -{ - S32 prev_columns = mColumns.size(); - if (columns < prev_columns) - { - std::for_each(mColumns.begin()+columns, mColumns.end(), DeletePointer()); - } - - mColumns.resize(columns); - - for (S32 col = prev_columns; col < columns; ++col) - { - mColumns[col] = NULL; - } -} - -void LLScrollListItem::setColumn( S32 column, LLScrollListCell *cell ) -{ - if (column < (S32)mColumns.size()) - { - delete mColumns[column]; - mColumns[column] = cell; - } - else - { - llerrs << "LLScrollListItem::setColumn: bad column: " << column << llendl; - } -} - -std::string LLScrollListItem::getContentsCSV() const -{ - std::string ret; - - S32 count = getNumColumns(); - for (S32 i=0; i<count; ++i) - { - ret += getColumn(i)->getValue().asString(); - if (i < count-1) - { - ret += ", "; - } - } - - return ret; -} - -void LLScrollListItem::draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding) -{ - // draw background rect - LLRect bg_rect = rect; - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4fv(bg_color.mV); - gl_rect_2d( bg_rect ); - } - - S32 cur_x = rect.mLeft; - S32 num_cols = getNumColumns(); - S32 cur_col = 0; - - for (LLScrollListCell* cell = getColumn(0); cur_col < num_cols; cell = getColumn(++cur_col)) - { - // Two ways a cell could be hidden - if (cell->getWidth() < 0 - || !cell->getVisible()) continue; - - LLUI::pushMatrix(); - { - LLUI::translate((F32) cur_x, (F32) rect.mBottom, 0.0f); - - cell->draw( fg_color, highlight_color ); - } - LLUI::popMatrix(); - - cur_x += cell->getWidth() + column_padding; - } -} - - -void LLScrollListItem::setEnabled(BOOL b) -{ - mEnabled = b; -} - -//--------------------------------------------------------------------------- -// LLScrollListItemComment -//--------------------------------------------------------------------------- -LLScrollListItemComment::LLScrollListItemComment(const std::string& comment_string, const LLColor4& color) -: LLScrollListItem(FALSE), - mColor(color) -{ - addColumn( comment_string, LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ) ); -} - -void LLScrollListItemComment::draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding) -{ - LLScrollListCell* cell = getColumn(0); - if (cell) - { - // Two ways a cell could be hidden - if (cell->getWidth() < 0 - || !cell->getVisible()) return; - - LLUI::pushMatrix(); - { - LLUI::translate((F32)rect.mLeft, (F32)rect.mBottom, 0.0f); - - // force first cell to be width of entire item - cell->setWidth(rect.getWidth()); - cell->draw( mColor, highlight_color ); - } - LLUI::popMatrix(); - } -} - -//--------------------------------------------------------------------------- -// LLScrollListItemSeparator -//--------------------------------------------------------------------------- -LLScrollListItemSeparator::LLScrollListItemSeparator() -: LLScrollListItem(FALSE) -{ - LLScrollListSeparator* cell = new LLScrollListSeparator(0); - setNumColumns(1); - setColumn(0, cell); -} - -void LLScrollListItemSeparator::draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding) -{ - //TODO* move LLScrollListSeparator::draw into here and get rid of it - LLScrollListCell* cell = getColumn(0); - if (cell) - { - // Two ways a cell could be hidden - if (cell->getWidth() < 0 - || !cell->getVisible()) return; - - LLUI::pushMatrix(); - { - LLUI::translate((F32)rect.mLeft, (F32)rect.mBottom, 0.0f); - - // force first cell to be width of entire item - cell->setWidth(rect.getWidth()); - cell->draw( fg_color, highlight_color ); - } - LLUI::popMatrix(); - } -} - //--------------------------------------------------------------------------- // LLScrollListCtrl //--------------------------------------------------------------------------- -LLScrollListCtrl::LLScrollListCtrl(const std::string& name, const LLRect& rect, - void (*commit_callback)(LLUICtrl* ctrl, void* userdata), - void* callback_user_data, - BOOL allow_multiple_selection, - BOOL show_border - ) - : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data), +LLScrollListCtrl::Contents::Contents() +: columns("columns"), + rows("rows") +{ + addSynonym(columns, "column"); + addSynonym(rows, "row"); +} + +LLScrollListCtrl::Params::Params() +: multi_select("multi_select", false), + has_border("draw_border"), + draw_heading("draw_heading"), + search_column("search_column", 0), + sort_column("sort_column", -1), + sort_ascending("sort_ascending", true), + commit_on_keyboard_movement("commit_on_keyboard_movement", true), + heading_height("heading_height"), + background_visible("background_visible"), + draw_stripes("draw_stripes"), + column_padding("column_padding"), + fg_unselected_color("fg_unselected_color"), + fg_selected_color("fg_selected_color"), + bg_selected_color("bg_selected_color"), + fg_disable_color("fg_disable_color"), + bg_writeable_color("bg_writeable_color"), + bg_read_only_color("bg_read_only_color"), + bg_stripe_color("bg_stripe_color"), + hovered_color("hovered_color"), + highlighted_color("highlighted_color") +{ + name = "scroll_list"; + mouse_opaque = true; +} + +LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p) +: LLUICtrl(p), mLineHeight(0), mScrollLines(0), mPageLines(0), - mHeadingHeight(20), mMaxSelectable(0), - mAllowMultipleSelection( allow_multiple_selection ), mAllowKeyboardMovement(TRUE), - mCommitOnKeyboardMovement(TRUE), + mCommitOnKeyboardMovement(p.commit_on_keyboard_movement), mCommitOnSelectionChange(FALSE), mSelectionChanged(FALSE), mNeedsScroll(FALSE), mCanSelect(TRUE), - mDisplayColumnHeaders(FALSE), mColumnsDirty(FALSE), mMaxItemCount(INT_MAX), mMaxContentWidth(0), - mBackgroundVisible( TRUE ), - mDrawStripes(TRUE), - mBgWriteableColor( LLUI::sColorsGroup->getColor( "ScrollBgWriteableColor" ) ), - mBgReadOnlyColor( LLUI::sColorsGroup->getColor( "ScrollBgReadOnlyColor" ) ), - mBgSelectedColor( LLUI::sColorsGroup->getColor("ScrollSelectedBGColor") ), - mBgStripeColor( LLUI::sColorsGroup->getColor("ScrollBGStripeColor") ), - mFgSelectedColor( LLUI::sColorsGroup->getColor("ScrollSelectedFGColor") ), - mFgUnselectedColor( LLUI::sColorsGroup->getColor("ScrollUnselectedColor") ), - mFgDisabledColor( LLUI::sColorsGroup->getColor("ScrollDisabledColor") ), - mHighlightedColor( LLUI::sColorsGroup->getColor("ScrollHighlightedColor") ), mBorderThickness( 2 ), mOnDoubleClickCallback( NULL ), mOnMaximumSelectCallback( NULL ), mOnSortChangedCallback( NULL ), mHighlightedItem(-1), mBorder(NULL), - mSearchColumn(0), mNumDynamicWidthColumns(0), mTotalStaticColumnWidth(0), mTotalColumnPadding(0), - mSorted(TRUE), + mSorted(FALSE), mDirty(FALSE), mOriginalSelection(-1), - mDrewSelected(FALSE) + mDrewSelected(FALSE), + mLastSelected(NULL), + mHeadingHeight(p.heading_height), + mAllowMultipleSelection(p.multi_select), + mDisplayColumnHeaders(p.draw_heading), + mBackgroundVisible(p.background_visible), + mDrawStripes(p.draw_stripes), + mBgWriteableColor(p.bg_writeable_color()), + mBgReadOnlyColor(p.bg_read_only_color()), + mBgSelectedColor(p.bg_selected_color()), + mBgStripeColor(p.bg_stripe_color()), + mFgSelectedColor(p.fg_selected_color()), + mFgUnselectedColor(p.fg_unselected_color()), + mFgDisabledColor(p.fg_disable_color()), + mHighlightedColor(p.highlighted_color()), + mHoveredColor(p.hovered_color()), + mSearchColumn(p.search_column), + mColumnPadding(p.column_padding) { mItemListRect.setOriginAndSize( mBorderThickness, @@ -612,37 +196,73 @@ LLScrollListCtrl::LLScrollListCtrl(const std::string& name, const LLRect& rect, mPageLines = mLineHeight? (mItemListRect.getHeight()) / mLineHeight : 0; // Init the scrollbar + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); + LLRect scroll_rect; scroll_rect.setOriginAndSize( - getRect().getWidth() - mBorderThickness - SCROLLBAR_SIZE, + getRect().getWidth() - mBorderThickness - scrollbar_size, mItemListRect.mBottom, - SCROLLBAR_SIZE, + scrollbar_size, mItemListRect.getHeight()); - mScrollbar = new LLScrollbar( std::string("Scrollbar"), scroll_rect, - LLScrollbar::VERTICAL, - getItemCount(), - mScrollLines, - mPageLines, - &LLScrollListCtrl::onScrollChange, this ); - mScrollbar->setFollowsRight(); - mScrollbar->setFollowsTop(); - mScrollbar->setFollowsBottom(); - mScrollbar->setEnabled( TRUE ); - // scrollbar is visible only when needed - mScrollbar->setVisible(FALSE); + + LLScrollbar::Params sbparams; + sbparams.name("Scrollbar"); + sbparams.rect(scroll_rect); + sbparams.orientation(LLScrollbar::VERTICAL); + sbparams.doc_size(getItemCount()); + sbparams.doc_pos(mScrollLines); + sbparams.page_size(mPageLines); + sbparams.change_callback(boost::bind(&LLScrollListCtrl::onScrollChange, this, _1, _2)); + sbparams.follows.flags(FOLLOWS_RIGHT | FOLLOWS_TOP | FOLLOWS_BOTTOM); + sbparams.visible(false); + mScrollbar = LLUICtrlFactory::create<LLScrollbar> (sbparams); addChild(mScrollbar); // Border - if (show_border) - { - LLRect border_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - mBorder = new LLViewBorder( std::string("dlg border"), border_rect, LLViewBorder::BEVEL_IN, LLViewBorder::STYLE_LINE, 1 ); + if (p.has_border) + { + LLRect border_rect = getLocalRect(); + LLViewBorder::Params params; + params.name("dig border"); + params.rect(border_rect); + params.bevel_type(LLViewBorder::BEVEL_IN); + mBorder = LLUICtrlFactory::create<LLViewBorder> (params); addChild(mBorder); } - mColumnPadding = 5; + // set border *after* rect is fully initialized + if (mBorder) + { + mBorder->setRect(getLocalRect()); + mBorder->reshape(getRect().getWidth(), getRect().getHeight()); + } + + if (p.sort_column >= 0) + { + sortByColumnIndex(p.sort_column, p.sort_ascending); + } - mLastSelected = NULL; + + for (LLInitParam::ParamIterator<LLScrollListColumn::Params>::const_iterator row_it = p.contents.columns().begin(); + row_it != p.contents.columns().end(); + ++row_it) + { + addColumn(*row_it); + } + + for (LLInitParam::ParamIterator<LLScrollListItem::Params>::const_iterator row_it = p.contents.rows().begin(); + row_it != p.contents.rows().end(); + ++row_it) + { + addRow(*row_it); + } + + LLTextBox::Params text_p; + text_p.name("comment_text"); + text_p.border_visible(false); + text_p.rect(mItemListRect); + text_p.follows.flags(FOLLOWS_ALL); + addChild(LLUICtrlFactory::create<LLTextBox>(text_p)); } S32 LLScrollListCtrl::getSearchColumn() @@ -666,6 +286,18 @@ S32 LLScrollListCtrl::getSearchColumn() } return llclamp(mSearchColumn, 0, getNumColumns()); } +/*virtual*/ +bool LLScrollListCtrl::preProcessChildNode(LLXMLNodePtr child) +{ + if (child->hasName("column") || child->hasName("row")) + { + return true; // skip + } + else + { + return false; + } +} LLScrollListCtrl::~LLScrollListCtrl() { @@ -818,6 +450,7 @@ void LLScrollListCtrl::reshape( S32 width, S32 height, BOOL called_from_parent ) void LLScrollListCtrl::updateLayout() { + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); // reserve room for column headers, if needed S32 heading_size = (mDisplayColumnHeaders ? mHeadingHeight : 0); mItemListRect.setOriginAndSize( @@ -826,22 +459,19 @@ void LLScrollListCtrl::updateLayout() getRect().getWidth() - 2 * mBorderThickness, getRect().getHeight() - (2 * mBorderThickness ) - heading_size ); + getChildView("comment_text")->setShape(mItemListRect); + // how many lines of content in a single "page" mPageLines = mLineHeight? mItemListRect.getHeight() / mLineHeight : 0; BOOL scrollbar_visible = getItemCount() > mPageLines; if (scrollbar_visible) { // provide space on the right for scrollbar - mItemListRect.mRight = getRect().getWidth() - mBorderThickness - SCROLLBAR_SIZE; + mItemListRect.mRight = getRect().getWidth() - mBorderThickness - scrollbar_size; } - // don't allow scrolling off bottom - if (mScrollLines + mPageLines > getItemCount()) - { - setScrollPos(llmax(0, getItemCount() - mPageLines)); - } - - mScrollbar->reshape(SCROLLBAR_SIZE, mItemListRect.getHeight() + (mDisplayColumnHeaders ? mHeadingHeight : 0)); + mScrollbar->setOrigin(getRect().getWidth() - mBorderThickness - scrollbar_size, mItemListRect.mBottom); + mScrollbar->reshape(scrollbar_size, mItemListRect.getHeight() + (mDisplayColumnHeaders ? mHeadingHeight : 0)); mScrollbar->setPageSize( mPageLines ); mScrollbar->setDocSize( getItemCount() ); mScrollbar->setVisible(scrollbar_visible); @@ -916,11 +546,11 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, BOOL r // create new column on demand if (mColumns.empty() && requires_column) { - LLSD new_column; - new_column["name"] = "default_column"; - new_column["label"] = ""; - new_column["dynamicwidth"] = TRUE; - addColumn(new_column); + LLScrollListColumn::Params col_params; + col_params.name = "default_column"; + col_params.header.label = ""; + col_params.width.dynamic_width = true; + addColumn(col_params); } updateLineHeightInsert(item); @@ -1017,7 +647,7 @@ void LLScrollListCtrl::updateColumns() // update column headers std::vector<LLScrollListColumn*>::iterator column_ordered_it; S32 left = mItemListRect.mLeft; - LLColumnHeader* last_header = NULL; + LLScrollColumnHeader* last_header = NULL; for (column_ordered_it = mColumnsIndexed.begin(); column_ordered_it != mColumnsIndexed.end(); ++column_ordered_it) { if ((*column_ordered_it)->getWidth() < 0) @@ -1052,7 +682,7 @@ void LLScrollListCtrl::updateColumns() } // expand last column header we encountered to full list width - if (last_header && last_header->canResize()) + if (last_header) { S32 new_width = llmax(0, mItemListRect.mRight - last_header->getRect().mLeft); last_header->reshape(new_width, last_header->getRect().getHeight()); @@ -1077,13 +707,6 @@ void LLScrollListCtrl::updateColumns() } -void LLScrollListCtrl::setDisplayHeading(BOOL display) -{ - mDisplayColumnHeaders = display; - - updateLayout(); -} - void LLScrollListCtrl::setHeadingHeight(S32 heading_height) { mHeadingHeight = heading_height; @@ -1275,7 +898,15 @@ void LLScrollListCtrl::deleteSelectedItems() dirtyColumns(); } -void LLScrollListCtrl::highlightNthItem(S32 target_index) +void LLScrollListCtrl::clearHighlightedItems() +{ + for (item_list::iterator iter = mItemList.begin(); iter != mItemList.end(); ++iter) + { + (*iter)->setHighlighted(false); + } +} + +void LLScrollListCtrl::mouseOverHighlightNthItem(S32 target_index) { if (mHighlightedItem != target_index) { @@ -1283,14 +914,14 @@ void LLScrollListCtrl::highlightNthItem(S32 target_index) } } -S32 LLScrollListCtrl::selectMultiple( LLDynamicArray<LLUUID> ids ) +S32 LLScrollListCtrl::selectMultiple( std::vector<LLUUID> ids ) { item_list::iterator iter; S32 count = 0; for (iter = mItemList.begin(); iter != mItemList.end(); iter++) { LLScrollListItem* item = *iter; - LLDynamicArray<LLUUID>::iterator iditr; + std::vector<LLUUID>::iterator iditr; for(iditr = ids.begin(); iditr != ids.end(); ++iditr) { if (item->getEnabled() && (item->getUUID() == (*iditr))) @@ -1446,35 +1077,51 @@ void LLScrollListCtrl::deselectAllItems(BOOL no_commit_on_change) /////////////////////////////////////////////////////////////////////////////////////////////////// // Use this to add comment text such as "Searching", which ignores column settings of list -LLScrollListItem* LLScrollListCtrl::addCommentText(const std::string& comment_text, EAddPosition pos) +void LLScrollListCtrl::setCommentText(const std::string& comment_text) { - LLScrollListItem* item = NULL; - if (getItemCount() < mMaxItemCount) - { - // always draw comment text with "enabled" color - item = new LLScrollListItemComment( comment_text, mFgUnselectedColor ); - addItem( item, pos, FALSE ); - } - return item; + getChild<LLTextBox>("comment_text")->setValue(comment_text); } LLScrollListItem* LLScrollListCtrl::addSeparator(EAddPosition pos) { - LLScrollListItem* item = new LLScrollListItemSeparator(); - addItem(item, pos, FALSE); - return item; + LLScrollListItem::Params separator_params; + separator_params.enabled(false); + LLScrollListCell::Params cell_params; + cell_params.type = "icon"; + cell_params.value = "menu_separator"; + cell_params.color = LLColor4(0.f, 0.f, 0.f, 0.7f); + cell_params.font_halign = LLFontGL::HCENTER; + separator_params.cells.add(cell_params); + return addRow( separator_params, pos ); } // Selects first enabled item of the given name. // Returns false if item not found. +// Calls getItemByLabel in order to combine functionality BOOL LLScrollListCtrl::selectItemByLabel(const std::string& label, BOOL case_sensitive) { - // ensure that no stale items are selected, even if we don't find a match - deselectAllItems(TRUE); - //RN: assume no empty items - if (label.empty()) + deselectAllItems(TRUE); // ensure that no stale items are selected, even if we don't find a match + LLScrollListItem* item = getItemByLabel(label, case_sensitive); + + bool found = NULL != item; + if(found) { - return FALSE; + selectItem(item); + } + + if (mCommitOnSelectionChange) + { + commitIfChanged(); + } + + return found; +} + +LLScrollListItem* LLScrollListCtrl::getItemByLabel(const std::string& label, BOOL case_sensitive, S32 column) +{ + if (label.empty()) //RN: assume no empty items + { + return NULL; } std::string target_text = label; @@ -1483,34 +1130,21 @@ BOOL LLScrollListCtrl::selectItemByLabel(const std::string& label, BOOL case_sen LLStringUtil::toLower(target_text); } - BOOL found = FALSE; - item_list::iterator iter; - S32 index = 0; for (iter = mItemList.begin(); iter != mItemList.end(); iter++) { LLScrollListItem* item = *iter; - // Only select enabled items with matching names - std::string item_text = item->getColumn(0)->getValue().asString(); + std::string item_text = item->getColumn(column)->getValue().asString(); // Only select enabled items with matching names if (!case_sensitive) { LLStringUtil::toLower(item_text); } - BOOL select = !found && item->getEnabled() && item_text == target_text; - if (select) + if(item_text == target_text) { - selectItem(item); + return item; } - found = found || select; - index++; } - - if (mCommitOnSelectionChange) - { - commitIfChanged(); - } - - return found; + return NULL; } @@ -1614,14 +1248,16 @@ const std::string LLScrollListCtrl::getSelectedItemLabel(S32 column) const LLScrollListItem* LLScrollListCtrl::addStringUUIDItem(const std::string& item_text, const LLUUID& id, EAddPosition pos, BOOL enabled, S32 column_width) { - LLScrollListItem* item = NULL; if (getItemCount() < mMaxItemCount) { - item = new LLScrollListItem( enabled, NULL, id ); - item->addColumn(item_text, LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF_SMALL), column_width); - addItem( item, pos ); + LLScrollListItem::Params item_p; + item_p.enabled(enabled); + item_p.value(id); + item_p.cells.add().value(item_text).width(column_width).type("text"); + + return addRow( item_p, pos ); } - return item; + return NULL; } // Select the line or lines that match this UUID @@ -1726,7 +1362,7 @@ void LLScrollListCtrl::drawItems() S32 max_columns = 0; LLColor4 highlight_color = LLColor4::white; - F32 type_ahead_timeout = LLUI::sConfigGroup->getF32("TypeAheadTimeout"); + static LLUICachedControl<F32> type_ahead_timeout ("TypeAheadTimeout", 0); highlight_color.mV[VALPHA] = clamp_rescale(mSearchTimer.getElapsedTimeF32(), type_ahead_timeout * 0.7f, type_ahead_timeout, 0.4f, 0.f); item_list::iterator iter; @@ -1754,27 +1390,46 @@ void LLScrollListCtrl::drawItems() if( mScrollLines <= line && line < mScrollLines + num_page_lines ) { - fg_color = (item->getEnabled() ? mFgUnselectedColor : mFgDisabledColor); + fg_color = (item->getEnabled() ? mFgUnselectedColor.get() : mFgDisabledColor.get()); if( item->getSelected() && mCanSelect) { - bg_color = mBgSelectedColor; - fg_color = (item->getEnabled() ? mFgSelectedColor : mFgDisabledColor); + if(item->getHighlighted()) // if it's highlighted, average the colors + { + bg_color = lerp(mBgSelectedColor.get(), mHighlightedColor.get(), 0.5f); + } + else // otherwise just select-highlight it + { + bg_color = mBgSelectedColor.get(); + } + + fg_color = (item->getEnabled() ? mFgSelectedColor.get() : mFgDisabledColor.get()); } else if (mHighlightedItem == line && mCanSelect) { - bg_color = mHighlightedColor; + if(item->getHighlighted()) // if it's highlighted, average the colors + { + bg_color = lerp(mHoveredColor.get(), mHighlightedColor.get(), 0.5f); + } + else // otherwise just hover-highlight it + { + bg_color = mHoveredColor.get(); + } + } + else if (item->getHighlighted()) + { + bg_color = mHighlightedColor.get(); } else { if (mDrawStripes && (line % 2 == 0) && (max_columns > 1)) { - bg_color = mBgStripeColor; + bg_color = mBgStripeColor.get(); } } if (!item->getEnabled()) { - bg_color = mBgReadOnlyColor; + bg_color = mBgReadOnlyColor.get(); } item->draw(item_rect, fg_color, bg_color, highlight_color, mColumnPadding); @@ -1807,8 +1462,7 @@ void LLScrollListCtrl::draw() if (mBackgroundVisible) { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4fv( getEnabled() ? mBgWriteableColor.mV : mBgReadOnlyColor.mV ); - gl_rect_2d(background); + gl_rect_2d(background, getEnabled() ? mBgWriteableColor.get() : mBgReadOnlyColor.get() ); } if (mColumnsDirty) @@ -1817,6 +1471,8 @@ void LLScrollListCtrl::draw() mColumnsDirty = FALSE; } + getChildView("comment_text")->setVisible(mItemList.empty()); + drawItems(); if (mBorder) @@ -1879,7 +1535,7 @@ BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sti } // otherwise, look for a tooltip associated with this column - LLColumnHeader* headerp = columnp->mHeader; + LLScrollColumnHeader* headerp = columnp->mHeader; if (headerp && !handled) { headerp->handleToolTip(x, y, msg, sticky_rect_screen); @@ -1922,7 +1578,7 @@ BOOL LLScrollListCtrl::selectItemAt(S32 x, S32 y, MASK mask) { if(mOnMaximumSelectCallback) { - mOnMaximumSelectCallback(mCallbackUserData); + mOnMaximumSelectCallback(); } break; } @@ -1960,7 +1616,7 @@ BOOL LLScrollListCtrl::selectItemAt(S32 x, S32 y, MASK mask) { if(mOnMaximumSelectCallback) { - mOnMaximumSelectCallback(mCallbackUserData); + mOnMaximumSelectCallback(); } } } @@ -2051,7 +1707,7 @@ BOOL LLScrollListCtrl::handleDoubleClick(S32 x, S32 y, MASK mask) { if( mCanSelect && mOnDoubleClickCallback ) { - mOnDoubleClickCallback( mCallbackUserData ); + mOnDoubleClickCallback(); } } } @@ -2221,11 +1877,11 @@ BOOL LLScrollListCtrl::handleHover(S32 x,S32 y,MASK mask) LLScrollListItem* item = hitItem(x, y); if (item) { - highlightNthItem(getItemIndex(item)); + mouseOverHighlightNthItem(getItemIndex(item)); } else { - highlightNthItem(-1); + mouseOverHighlightNthItem(-1); } } @@ -2234,6 +1890,11 @@ BOOL LLScrollListCtrl::handleHover(S32 x,S32 y,MASK mask) return handled; } +void LLScrollListCtrl::onMouseLeave(S32 x, S32 y, MASK mask) +{ + // clear mouse highlight + mouseOverHighlightNthItem(-1); +} BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) { @@ -2378,7 +2039,8 @@ BOOL LLScrollListCtrl::handleUnicodeCharHere(llwchar uni_char) } // perform incremental search based on keyboard input - if (mSearchTimer.getElapsedTimeF32() > LLUI::sConfigGroup->getF32("TypeAheadTimeout")) + static LLUICachedControl<F32> type_ahead_timeout ("TypeAheadTimeout", 0); + if (mSearchTimer.getElapsedTimeF32() > type_ahead_timeout) { mSearchString.clear(); } @@ -2554,7 +2216,7 @@ BOOL LLScrollListCtrl::setSort(S32 column_idx, BOOL ascending) LLScrollListColumn* sort_column = getColumn(column_idx); if (!sort_column) return FALSE; - sort_column->mSortAscending = ascending; + sort_column->mSortDirection = ascending ? LLScrollListColumn::ASCENDING : LLScrollListColumn::DESCENDING; sort_column_t new_sort_column(column_idx, ascending); @@ -2579,11 +2241,9 @@ BOOL LLScrollListCtrl::setSort(S32 column_idx, BOOL ascending) } // Called by scrollbar -//static -void LLScrollListCtrl::onScrollChange( S32 new_pos, LLScrollbar* scrollbar, void* userdata ) +void LLScrollListCtrl::onScrollChange( S32 new_pos, LLScrollbar* scrollbar ) { - LLScrollListCtrl* self = (LLScrollListCtrl*) userdata; - self->mScrollLines = new_pos; + mScrollLines = new_pos; } @@ -2656,7 +2316,7 @@ void LLScrollListCtrl::setScrollPos( S32 pos ) { mScrollbar->setDocPos( pos ); - onScrollChange(mScrollbar->getDocPos(), mScrollbar, this); + onScrollChange(mScrollbar->getDocPos(), mScrollbar); } @@ -2706,293 +2366,6 @@ void LLScrollListCtrl::updateStaticColumnWidth(LLScrollListColumn* col, S32 new_ mTotalStaticColumnWidth += llmax(0, new_width) - llmax(0, col->getWidth()); } - -// virtual -LLXMLNodePtr LLScrollListCtrl::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - // Attributes - - node->createChild("multi_select", TRUE)->setBoolValue(mAllowMultipleSelection); - - node->createChild("draw_border", TRUE)->setBoolValue((mBorder != NULL)); - - node->createChild("draw_heading", TRUE)->setBoolValue(mDisplayColumnHeaders); - - node->createChild("background_visible", TRUE)->setBoolValue(mBackgroundVisible); - - node->createChild("draw_stripes", TRUE)->setBoolValue(mDrawStripes); - - node->createChild("column_padding", TRUE)->setIntValue(mColumnPadding); - - addColorXML(node, mBgWriteableColor, "bg_writeable_color", "ScrollBgWriteableColor"); - addColorXML(node, mBgReadOnlyColor, "bg_read_only_color", "ScrollBgReadOnlyColor"); - addColorXML(node, mBgSelectedColor, "bg_selected_color", "ScrollSelectedBGColor"); - addColorXML(node, mBgStripeColor, "bg_stripe_color", "ScrollBGStripeColor"); - addColorXML(node, mFgSelectedColor, "fg_selected_color", "ScrollSelectedFGColor"); - addColorXML(node, mFgUnselectedColor, "fg_unselected_color", "ScrollUnselectedColor"); - addColorXML(node, mFgDisabledColor, "fg_disable_color", "ScrollDisabledColor"); - addColorXML(node, mHighlightedColor, "highlighted_color", "ScrollHighlightedColor"); - - // Contents - - std::map<std::string, LLScrollListColumn>::const_iterator itor; - std::vector<const LLScrollListColumn*> sorted_list; - sorted_list.resize(mColumns.size()); - for (itor = mColumns.begin(); itor != mColumns.end(); ++itor) - { - sorted_list[itor->second.mIndex] = &itor->second; - } - - std::vector<const LLScrollListColumn*>::iterator itor2; - for (itor2 = sorted_list.begin(); itor2 != sorted_list.end(); ++itor2) - { - LLXMLNodePtr child_node = node->createChild("column", FALSE); - const LLScrollListColumn *column = *itor2; - - child_node->createChild("name", TRUE)->setStringValue(column->mName); - child_node->createChild("label", TRUE)->setStringValue(column->mLabel); - child_node->createChild("width", TRUE)->setIntValue(column->getWidth()); - } - - return node; -} - -void LLScrollListCtrl::setScrollListParameters(LLXMLNodePtr node) -{ - // James: This is not a good way to do colors. We need a central "UI style" - // manager that sets the colors for ALL scroll lists, buttons, etc. - - LLColor4 color; - if(node->hasAttribute("fg_unselected_color")) - { - LLUICtrlFactory::getAttributeColor(node,"fg_unselected_color", color); - setFgUnselectedColor(color); - } - if(node->hasAttribute("fg_selected_color")) - { - LLUICtrlFactory::getAttributeColor(node,"fg_selected_color", color); - setFgSelectedColor(color); - } - if(node->hasAttribute("bg_selected_color")) - { - LLUICtrlFactory::getAttributeColor(node,"bg_selected_color", color); - setBgSelectedColor(color); - } - if(node->hasAttribute("fg_disable_color")) - { - LLUICtrlFactory::getAttributeColor(node,"fg_disable_color", color); - setFgDisableColor(color); - } - if(node->hasAttribute("bg_writeable_color")) - { - LLUICtrlFactory::getAttributeColor(node,"bg_writeable_color", color); - setBgWriteableColor(color); - } - if(node->hasAttribute("bg_read_only_color")) - { - LLUICtrlFactory::getAttributeColor(node,"bg_read_only_color", color); - setReadOnlyBgColor(color); - } - if (LLUICtrlFactory::getAttributeColor(node,"bg_stripe_color", color)) - { - setBgStripeColor(color); - } - if (LLUICtrlFactory::getAttributeColor(node,"highlighted_color", color)) - { - setHighlightedColor(color); - } - - if(node->hasAttribute("background_visible")) - { - BOOL background_visible; - node->getAttributeBOOL("background_visible", background_visible); - setBackgroundVisible(background_visible); - } - - if(node->hasAttribute("draw_stripes")) - { - BOOL draw_stripes; - node->getAttributeBOOL("draw_stripes", draw_stripes); - setDrawStripes(draw_stripes); - } - - if(node->hasAttribute("column_padding")) - { - S32 column_padding; - node->getAttributeS32("column_padding", column_padding); - setColumnPadding(column_padding); - } -} - -// static -LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("scroll_list"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - BOOL multi_select = FALSE; - node->getAttributeBOOL("multi_select", multi_select); - - BOOL draw_border = TRUE; - node->getAttributeBOOL("draw_border", draw_border); - - BOOL draw_heading = FALSE; - node->getAttributeBOOL("draw_heading", draw_heading); - - S32 search_column = 0; - node->getAttributeS32("search_column", search_column); - - S32 sort_column = -1; - node->getAttributeS32("sort_column", sort_column); - - BOOL sort_ascending = TRUE; - node->getAttributeBOOL("sort_ascending", sort_ascending); - - LLUICtrlCallback callback = NULL; - - LLScrollListCtrl* scroll_list = new LLScrollListCtrl( - name, - rect, - callback, - NULL, - multi_select, - draw_border); - - scroll_list->setDisplayHeading(draw_heading); - if (node->hasAttribute("heading_height")) - { - S32 heading_height; - node->getAttributeS32("heading_height", heading_height); - scroll_list->setHeadingHeight(heading_height); - } - - scroll_list->setScrollListParameters(node); - - scroll_list->initFromXML(node, parent); - - scroll_list->setSearchColumn(search_column); - - LLSD columns; - S32 index = 0; - LLXMLNodePtr child; - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) - { - if (child->hasName("column")) - { - std::string labelname(""); - child->getAttributeString("label", labelname); - - std::string columnname(labelname); - child->getAttributeString("name", columnname); - - std::string sortname(columnname); - child->getAttributeString("sort", sortname); - - BOOL sort_ascending = TRUE; - child->getAttributeBOOL("sort_ascending", sort_ascending); - - std::string imagename; - child->getAttributeString("image", imagename); - - BOOL columndynamicwidth = FALSE; - child->getAttributeBOOL("dynamicwidth", columndynamicwidth); - - S32 columnwidth = -1; - child->getAttributeS32("width", columnwidth); - - std::string tooltip; - child->getAttributeString("tool_tip", tooltip); - - F32 columnrelwidth = 0.f; - child->getAttributeF32("relwidth", columnrelwidth); - - LLFontGL::HAlign h_align = LLFontGL::LEFT; - h_align = LLView::selectFontHAlign(child); - - columns[index]["name"] = columnname; - columns[index]["sort"] = sortname; - columns[index]["sort_ascending"] = sort_ascending; - columns[index]["image"] = imagename; - columns[index]["label"] = labelname; - columns[index]["width"] = columnwidth; - columns[index]["relwidth"] = columnrelwidth; - columns[index]["dynamicwidth"] = columndynamicwidth; - columns[index]["halign"] = (S32)h_align; - columns[index]["tool_tip"] = tooltip; - - index++; - } - } - scroll_list->setColumnHeadings(columns); - - if (sort_column >= 0) - { - scroll_list->sortByColumnIndex(sort_column, sort_ascending); - } - - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) - { - if (child->hasName("row")) - { - LLUUID id; - child->getAttributeUUID("id", id); - - LLSD row; - - row["id"] = id; - - S32 column_idx = 0; - LLXMLNodePtr row_child; - for (row_child = child->getFirstChild(); row_child.notNull(); row_child = row_child->getNextSibling()) - { - if (row_child->hasName("column")) - { - std::string value = row_child->getTextContents(); - - std::string columnname(""); - row_child->getAttributeString("name", columnname); - - std::string font(""); - row_child->getAttributeString("font", font); - - std::string font_style(""); - row_child->getAttributeString("font-style", font_style); - - row["columns"][column_idx]["column"] = columnname; - row["columns"][column_idx]["value"] = value; - row["columns"][column_idx]["font"] = font; - row["columns"][column_idx]["font-style"] = font_style; - column_idx++; - } - } - scroll_list->addElement(row); - } - } - - std::string contents = node->getTextContents(); - if (!contents.empty()) - { - typedef boost::tokenizer<boost::char_separator<char> > tokenizer; - boost::char_separator<char> sep("\t\n"); - tokenizer tokens(contents, sep); - tokenizer::iterator token_iter = tokens.begin(); - - while(token_iter != tokens.end()) - { - const std::string& line = *token_iter; - scroll_list->addSimpleElement(line); - ++token_iter; - } - } - - return scroll_list; -} - // LLEditMenuHandler functions // virtual @@ -3068,20 +2441,27 @@ BOOL LLScrollListCtrl::canDeselect() const void LLScrollListCtrl::addColumn(const LLSD& column, EAddPosition pos) { - std::string name = column["name"].asString(); + LLScrollListColumn::Params p; + LLParamSDParser::instance().readSD(column, p); + addColumn(p, pos); +} + +void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params, EAddPosition pos) +{ + if (!column_params.validateBlock()) return; + + std::string name = column_params.name; // if no column name provided, just use ordinal as name if (name.empty()) { - std::ostringstream new_name; - new_name << mColumnsIndexed.size(); - name = new_name.str(); + name = llformat("%d", mColumnsIndexed.size()); } + if (mColumns.find(name) == mColumns.end()) { // Add column - mColumns[name] = LLScrollListColumn(column, this); + mColumns[name] = LLScrollListColumn(column_params, this); LLScrollListColumn* new_column = &mColumns[name]; - new_column->mParentCtrl = this; new_column->mIndex = mColumns.size()-1; // Add button @@ -3101,44 +2481,47 @@ void LLScrollListCtrl::addColumn(const LLSD& column, EAddPosition pos) new_column->setWidth((mItemListRect.getWidth() - mTotalStaticColumnWidth - mTotalColumnPadding) / mNumDynamicWidthColumns); } S32 top = mItemListRect.mTop; + S32 left = mItemListRect.mLeft; + for (std::map<std::string, LLScrollListColumn>::iterator itor = mColumns.begin(); + itor != mColumns.end(); + ++itor) { - std::map<std::string, LLScrollListColumn>::iterator itor; - for (itor = mColumns.begin(); itor != mColumns.end(); ++itor) + if (itor->second.mIndex < new_column->mIndex && + itor->second.getWidth() > 0) { - if (itor->second.mIndex < new_column->mIndex && - itor->second.getWidth() > 0) - { - left += itor->second.getWidth() + mColumnPadding; - } + left += itor->second.getWidth() + mColumnPadding; } } - std::string button_name = "btn_" + name; + S32 right = left+new_column->getWidth(); if (new_column->mIndex != (S32)mColumns.size()-1) { right += mColumnPadding; } + LLRect temp_rect = LLRect(left,top+mHeadingHeight,right,top); - new_column->mHeader = new LLColumnHeader(button_name, temp_rect, new_column); - if(column["image"].asString() != "") + + LLScrollColumnHeader::Params params; + params.name = "btn_" + name; + params.rect = temp_rect; + params.column = new_column; + params.tool_tip = column_params.tool_tip; + params.tab_stop = false; + params.visible = mDisplayColumnHeaders; + + if(column_params.header.image.isProvided()) { - //new_column->mHeader->setScaleImage(false); - new_column->mHeader->setImage(column["image"].asString()); + params.image_selected = column_params.header.image; + params.image_unselected = column_params.header.image; } else { - new_column->mHeader->setLabel(new_column->mLabel); - //new_column->mHeader->setLabel(new_column->mLabel); + params.label = column_params.header.label; } - new_column->mHeader->setToolTip(column["tool_tip"].asString()); - - //RN: although it might be useful to change sort order with the keyboard, - // mixing tab stops on child items along with the parent item is not supported yet - new_column->mHeader->setTabStop(FALSE); + new_column->mHeader = LLUICtrlFactory::create<LLScrollColumnHeader>(params); addChild(new_column->mHeader); - new_column->mHeader->setVisible(mDisplayColumnHeaders); sendChildToFront(mScrollbar); } @@ -3159,7 +2542,7 @@ void LLScrollListCtrl::onClickColumn(void *userdata) S32 column_index = info->mIndex; LLScrollListColumn* column = parent->mColumnsIndexed[info->mIndex]; - bool ascending = column->mSortAscending; + bool ascending = column->mSortDirection == LLScrollListColumn::ASCENDING; if (column->mSortingColumn != column->mName && parent->mColumns.find(column->mSortingColumn) != parent->mColumns.end()) { @@ -3178,7 +2561,7 @@ void LLScrollListCtrl::onClickColumn(void *userdata) if (parent->mOnSortChangedCallback) { - parent->mOnSortChangedCallback(parent->getCallbackUserData()); + parent->mOnSortChangedCallback(); } } @@ -3200,7 +2583,7 @@ void LLScrollListCtrl::clearColumns() std::map<std::string, LLScrollListColumn>::iterator itor; for (itor = mColumns.begin(); itor != mColumns.end(); ++itor) { - LLColumnHeader *header = itor->second.mHeader; + LLScrollColumnHeader *header = itor->second.mHeader; if (header) { removeChild(header); @@ -3215,13 +2598,13 @@ void LLScrollListCtrl::clearColumns() void LLScrollListCtrl::setColumnLabel(const std::string& column, const std::string& label) { - std::map<std::string, LLScrollListColumn>::iterator itor = mColumns.find(column); - if (itor != mColumns.end()) + LLScrollListColumn* columnp = getColumn(column); + if (columnp) { - itor->second.mLabel = label; - if (itor->second.mHeader) + columnp->mLabel = label; + if (columnp->mHeader) { - itor->second.mHeader->setLabel(label); + columnp->mHeader->setLabel(label); } } } @@ -3235,74 +2618,62 @@ LLScrollListColumn* LLScrollListCtrl::getColumn(S32 index) return mColumnsIndexed[index]; } -void LLScrollListCtrl::setColumnHeadings(LLSD headings) +LLScrollListColumn* LLScrollListCtrl::getColumn(const std::string& name) { - mColumns.clear(); - LLSD::array_const_iterator itor; - for (itor = headings.beginArray(); itor != headings.endArray(); ++itor) + column_map_t::iterator column_itor = mColumns.find(name); + if (column_itor != mColumns.end()) { - addColumn(*itor); + return &column_itor->second; } + return NULL; } -LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition pos, void* userdata) + +LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition pos, void* userdata) { - // ID - LLSD id = value["id"]; + LLScrollListItem::Params item_params; + LLParamSDParser::instance().readSD(element, item_params); + item_params.userdata = userdata; + return addRow(item_params, pos); +} - LLScrollListItem *new_item = new LLScrollListItem(id, userdata); - if (value.has("enabled")) - { - new_item->setEnabled( value["enabled"].asBoolean() ); - } +LLScrollListItem* LLScrollListCtrl::addRow(const LLScrollListItem::Params& item_p, EAddPosition pos) +{ + if (!item_p.validateBlock()) return NULL; + LLScrollListItem *new_item = new LLScrollListItem(item_p); new_item->setNumColumns(mColumns.size()); // Add any columns we don't already have - LLSD columns = value["columns"]; - LLSD::array_const_iterator itor; - S32 col_index = 0 ; - for (itor = columns.beginArray(); itor != columns.endArray(); ++itor) - { - if (itor->isUndefined()) - { - // skip unused columns in item passed in - continue; - } - std::string column = (*itor)["column"].asString(); + S32 col_index = 0; - LLScrollListColumn* columnp = NULL; + for(LLInitParam::ParamIterator<LLScrollListCell::Params>::const_iterator itor = item_p.cells().begin(); + itor != item_p.cells().end(); + ++itor) + { + LLScrollListCell::Params cell_p = *itor; + std::string column = cell_p.column; // empty columns strings index by ordinal if (column.empty()) { - std::ostringstream new_name; - new_name << col_index; - column = new_name.str(); + column = llformat("%d", col_index); } - std::map<std::string, LLScrollListColumn>::iterator column_itor; - column_itor = mColumns.find(column); - if (column_itor != mColumns.end()) - { - columnp = &column_itor->second; - } + LLScrollListColumn* columnp = getColumn(column); // create new column on demand if (!columnp) { - LLSD new_column; - new_column["name"] = column; - new_column["label"] = column; + LLScrollListColumn::Params new_column; + new_column.name = column; + new_column.header.label = column; + // if width supplied for column, use it, otherwise // use adaptive width - if (itor->has("width")) - { - new_column["width"] = (*itor)["width"]; - } - else + if (cell_p.width.isProvided()) { - new_column["dynamicwidth"] = true; + new_column.width.pixel_width = cell_p.width; } addColumn(new_column); columnp = &mColumns[column]; @@ -3310,91 +2681,48 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p } S32 index = columnp->mIndex; - S32 width = columnp->getWidth(); - LLFontGL::HAlign font_alignment = columnp->mFontAlignment; - LLColor4 fcolor = LLColor4::black; - - LLSD value = (*itor)["value"]; - std::string fontname = (*itor)["font"].asString(); - std::string fontstyle = (*itor)["font-style"].asString(); - std::string type = (*itor)["type"].asString(); - - if ((*itor).has("font-color")) - { - LLSD sd_color = (*itor)["font-color"]; - fcolor.setValue(sd_color); - } - - BOOL has_color = (*itor).has("color"); - LLColor4 color = ((*itor)["color"]); - BOOL enabled = !(*itor).has("enabled") || (*itor)["enabled"].asBoolean() == true; + cell_p.width.setIfNotProvided(columnp->getWidth()); - const LLFontGL *font = LLResMgr::getInstance()->getRes(fontname); - if (!font) - { - font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); - } - U8 font_style = LLFontGL::getStyleFromString(fontstyle); + LLScrollListCell* cell = LLScrollListCell::create(cell_p); - if (type == "icon") + if (cell) { - LLScrollListIcon* cell = new LLScrollListIcon(value, width); - if (has_color) - { - cell->setColor(color); - } new_item->setColumn(index, cell); - } - else if (type == "checkbox") - { - LLCheckBoxCtrl* ctrl = new LLCheckBoxCtrl(std::string("check"), - LLRect(0, width, width, 0), std::string(" ")); - ctrl->setEnabled(enabled); - ctrl->setValue(value); - LLScrollListCheck* cell = new LLScrollListCheck(ctrl,width); - if (has_color) + if (columnp->mHeader + && cell->isText() + && !cell->getValue().asString().empty()) { - cell->setColor(color); - } - new_item->setColumn(index, cell); - } - else if (type == "separator") - { - LLScrollListSeparator* cell = new LLScrollListSeparator(width); - if (has_color) - { - cell->setColor(color); + columnp->mHeader->setHasResizableElement(TRUE); } - new_item->setColumn(index, cell); } - else if (type == "date") + + col_index++; + } + + if (item_p.cells().empty()) + { + if (mColumns.empty()) { - LLScrollListDate* cell = new LLScrollListDate(value.asDate(), font, width, font_style, font_alignment); - if (has_color) - { - cell->setColor(color); - } - new_item->setColumn(index, cell); - if (columnp->mHeader && !value.asString().empty()) - { - columnp->mHeader->setHasResizableElement(TRUE); - } + LLScrollListColumn::Params new_column; + new_column.name = "0"; + + addColumn(new_column); + new_item->setNumColumns(mColumns.size()); } - else + + LLScrollListCell* cell = LLScrollListCell::create(LLScrollListCell::Params().value(item_p.value)); + if (cell) { - LLScrollListText* cell = new LLScrollListText(value.asString(), font, width, font_style, font_alignment, fcolor, TRUE); - if (has_color) - { - cell->setColor(color); - } - new_item->setColumn(index, cell); - if (columnp->mHeader && !value.asString().empty()) + LLScrollListColumn* columnp = &(mColumns.begin()->second); + + new_item->setColumn(0, cell); + if (columnp->mHeader + && cell->isText() + && !cell->getValue().asString().empty()) { columnp->mHeader->setHasResizableElement(TRUE); } } - - col_index++; } // add dummy cells for missing columns @@ -3404,12 +2732,14 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p if (new_item->getColumn(column_idx) == NULL) { LLScrollListColumn* column_ptr = &column_it->second; - new_item->setColumn(column_idx, new LLScrollListText(LLStringUtil::null, LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ), column_ptr->getWidth(), LLFontGL::NORMAL)); + LLScrollListCell::Params cell_p; + cell_p.width = column_ptr->getWidth(); + + new_item->setColumn(column_idx, new LLScrollListSpacer(cell_p)); } } addItem(new_item, pos); - return new_item; } @@ -3422,14 +2752,13 @@ LLScrollListItem* LLScrollListCtrl::addSimpleElement(const std::string& value, E entry_id = value; } - LLScrollListItem *new_item = new LLScrollListItem(entry_id); - - const LLFontGL *font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); - - new_item->addColumn(value, font, getRect().getWidth()); - - addItem(new_item, pos); - return new_item; + LLScrollListItem::Params item_params; + item_params.value(entry_id); + item_params.cells.add() + .value(value) + .font(LLFontGL::getFontSansSerifSmall()); + + return addRow(item_params, pos); } void LLScrollListCtrl::setValue(const LLSD& value ) @@ -3530,484 +2859,3 @@ void LLScrollListCtrl::onFocusLost() LLUICtrl::onFocusLost(); } -LLColumnHeader::LLColumnHeader(const std::string& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL* fontp) : - LLComboBox(label, rect, label, NULL, NULL), - mColumn(column), - mOrigLabel(label), - mShowSortOptions(FALSE), - mHasResizableElement(FALSE) -{ - mListPosition = LLComboBox::ABOVE; - setCommitCallback(onSelectSort); - setCallbackUserData(this); - mButton->setTabStop(FALSE); - // require at least two frames between mouse down and mouse up event to capture intentional "hold" not just bad framerate - mButton->setHeldDownDelay(LLUI::sConfigGroup->getF32("ColumnHeaderDropDownDelay"), 2); - mButton->setHeldDownCallback(onHeldDown); - mButton->setClickedCallback(onClick); - mButton->setMouseDownCallback(onMouseDown); - - mButton->setCallbackUserData(this); - mButton->setToolTip(label); - - mAscendingText = std::string("[LOW]...[HIGH](Ascending)"); // *TODO: Translate - mDescendingText = std::string("[HIGH]...[LOW](Descending)"); // *TODO: Translate - - mList->reshape(llmax(mList->getRect().getWidth(), 110, getRect().getWidth()), mList->getRect().getHeight()); - - // resize handles on left and right - const S32 RESIZE_BAR_THICKNESS = 3; - mResizeBar = new LLResizeBar( - std::string("resizebar"), - this, - LLRect( getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0), - MIN_COLUMN_WIDTH, S32_MAX, LLResizeBar::RIGHT ); - addChild(mResizeBar); - - mResizeBar->setEnabled(FALSE); -} - -LLColumnHeader::~LLColumnHeader() -{ -} - -void LLColumnHeader::draw() -{ - BOOL draw_arrow = !mColumn->mLabel.empty() && mColumn->mParentCtrl->isSorted() && mColumn->mParentCtrl->getSortColumnName() == mColumn->mSortingColumn; - - BOOL is_ascending = mColumn->mParentCtrl->getSortAscending(); - mButton->setImageOverlay(is_ascending ? "up_arrow.tga" : "down_arrow.tga", LLFontGL::RIGHT, draw_arrow ? LLColor4::white : LLColor4::transparent); - mArrowImage = mButton->getImageOverlay(); - - //BOOL clip = getRect().mRight > mColumn->mParentCtrl->getItemListRect().getWidth(); - //LLGLEnable scissor_test(clip ? GL_SCISSOR_TEST : GL_FALSE); - - //LLRect column_header_local_rect(-getRect().mLeft, getRect().getHeight(), mColumn->mParentCtrl->getItemListRect().getWidth() - getRect().mLeft, 0); - //LLUI::setScissorRegionLocal(column_header_local_rect); - - // Draw children - LLComboBox::draw(); - - if (mList->getVisible()) - { - // sync sort order with list selection every frame - mColumn->mParentCtrl->sortByColumn(mColumn->mSortingColumn, getCurrentIndex() == 0); - } -} - -BOOL LLColumnHeader::handleDoubleClick(S32 x, S32 y, MASK mask) -{ - if (canResize() && mResizeBar->getRect().pointInRect(x, y)) - { - // reshape column to max content width - LLRect column_rect = getRect(); - column_rect.mRight = column_rect.mLeft + mColumn->mMaxContentWidth; - userSetShape(column_rect); - } - else - { - onClick(this); - } - return TRUE; -} - -void LLColumnHeader::setImage(const std::string &image_name) -{ - if (mButton) - { - mButton->setImageSelected(image_name); - mButton->setImageUnselected(image_name); - } -} - -//static -void LLColumnHeader::onClick(void* user_data) -{ - LLColumnHeader* headerp = (LLColumnHeader*)user_data; - if (!headerp) return; - - LLScrollListColumn* column = headerp->mColumn; - if (!column) return; - - if (headerp->mList->getVisible()) - { - headerp->hideList(); - } - - LLScrollListCtrl::onClickColumn(column); - - // propagate new sort order to sort order list - headerp->mList->selectNthItem(column->mParentCtrl->getSortAscending() ? 0 : 1); -} - -//static -void LLColumnHeader::onMouseDown(void* user_data) -{ - // for now, do nothing but block the normal showList() behavior - return; -} - -//static -void LLColumnHeader::onHeldDown(void* user_data) -{ - LLColumnHeader* headerp = (LLColumnHeader*)user_data; - headerp->showList(); -} - -void LLColumnHeader::showList() -{ - if (mShowSortOptions) - { - //LLSD item_val = mColumn->mParentCtrl->getFirstData()->getValue(); - mOrigLabel = mButton->getLabelSelected(); - - // move sort column over to this column and do initial sort - mColumn->mParentCtrl->sortByColumn(mColumn->mSortingColumn, mColumn->mParentCtrl->getSortAscending()); - - std::string low_item_text; - std::string high_item_text; - - LLScrollListItem* itemp = mColumn->mParentCtrl->getFirstData(); - if (itemp) - { - LLScrollListCell* cell = itemp->getColumn(mColumn->mIndex); - if (cell && cell->isText()) - { - if (mColumn->mParentCtrl->getSortAscending()) - { - low_item_text = cell->getValue().asString(); - } - else - { - high_item_text = cell->getValue().asString(); - } - } - } - - itemp = mColumn->mParentCtrl->getLastData(); - if (itemp) - { - LLScrollListCell* cell = itemp->getColumn(mColumn->mIndex); - if (cell && cell->isText()) - { - if (mColumn->mParentCtrl->getSortAscending()) - { - high_item_text = cell->getValue().asString(); - } - else - { - low_item_text = cell->getValue().asString(); - } - } - } - - LLStringUtil::truncate(low_item_text, 3); - LLStringUtil::truncate(high_item_text, 3); - - std::string ascending_string; - std::string descending_string; - - if (low_item_text.empty() || high_item_text.empty()) - { - ascending_string = "Ascending"; - descending_string = "Descending"; - } - else - { - mAscendingText.setArg("[LOW]", low_item_text); - mAscendingText.setArg("[HIGH]", high_item_text); - mDescendingText.setArg("[LOW]", low_item_text); - mDescendingText.setArg("[HIGH]", high_item_text); - ascending_string = mAscendingText.getString(); - descending_string = mDescendingText.getString(); - } - - S32 text_width = LLFontGL::getFontSansSerifSmall()->getWidth(ascending_string); - text_width = llmax(text_width, LLFontGL::getFontSansSerifSmall()->getWidth(descending_string)) + 10; - text_width = llmax(text_width, getRect().getWidth() - 30); - - mList->getColumn(0)->setWidth(text_width); - ((LLScrollListText*)mList->getFirstData()->getColumn(0))->setText(ascending_string); - ((LLScrollListText*)mList->getLastData()->getColumn(0))->setText(descending_string); - - mList->reshape(llmax(text_width + 30, 110, getRect().getWidth()), mList->getRect().getHeight()); - - LLComboBox::showList(); - } -} - -//static -void LLColumnHeader::onSelectSort(LLUICtrl* ctrl, void* user_data) -{ - LLColumnHeader* headerp = (LLColumnHeader*)user_data; - if (!headerp) return; - - LLScrollListColumn* column = headerp->mColumn; - if (!column) return; - LLScrollListCtrl *parent = column->mParentCtrl; - if (!parent) return; - - if (headerp->getCurrentIndex() == 0) - { - // ascending - parent->sortByColumn(column->mSortingColumn, TRUE); - } - else - { - // descending - parent->sortByColumn(column->mSortingColumn, FALSE); - } - - // restore original column header - headerp->setLabel(headerp->mOrigLabel); -} - -LLView* LLColumnHeader::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding) -{ - // this logic assumes dragging on right - llassert(snap_edge == SNAP_RIGHT); - - // use higher snap threshold for column headers - threshold = llmin(threshold, 10); - - LLRect snap_rect = getSnapRect(); - - S32 snap_delta = mColumn->mMaxContentWidth - snap_rect.getWidth(); - - // x coord growing means column growing, so same signs mean we're going in right direction - if (llabs(snap_delta) <= threshold && mouse_dir.mX * snap_delta > 0 ) - { - new_edge_val = snap_rect.mRight + snap_delta; - } - else - { - LLScrollListColumn* next_column = mColumn->mParentCtrl->getColumn(mColumn->mIndex + 1); - while (next_column) - { - if (next_column->mHeader) - { - snap_delta = (next_column->mHeader->getSnapRect().mRight - next_column->mMaxContentWidth) - snap_rect.mRight; - if (llabs(snap_delta) <= threshold && mouse_dir.mX * snap_delta > 0 ) - { - new_edge_val = snap_rect.mRight + snap_delta; - } - break; - } - next_column = mColumn->mParentCtrl->getColumn(next_column->mIndex + 1); - } - } - - return this; -} - -void LLColumnHeader::userSetShape(const LLRect& new_rect) -{ - S32 new_width = new_rect.getWidth(); - S32 delta_width = new_width - (getRect().getWidth() /*+ mColumn->mParentCtrl->getColumnPadding()*/); - - if (delta_width != 0) - { - S32 remaining_width = -delta_width; - S32 col; - for (col = mColumn->mIndex + 1; col < mColumn->mParentCtrl->getNumColumns(); col++) - { - LLScrollListColumn* columnp = mColumn->mParentCtrl->getColumn(col); - if (!columnp) continue; - - if (columnp->mHeader && columnp->mHeader->canResize()) - { - // how many pixels in width can this column afford to give up? - S32 resize_buffer_amt = llmax(0, columnp->getWidth() - MIN_COLUMN_WIDTH); - - // user shrinking column, need to add width to other columns - if (delta_width < 0) - { - if (/*!columnp->mDynamicWidth && */columnp->getWidth() > 0) - { - // statically sized column, give all remaining width to this column - columnp->setWidth(columnp->getWidth() + remaining_width); - if (columnp->mRelWidth > 0.f) - { - columnp->mRelWidth = (F32)columnp->getWidth() / (F32)mColumn->mParentCtrl->getItemListRect().getWidth(); - } - // all padding went to this widget, we're done - break; - } - } - else - { - // user growing column, need to take width from other columns - remaining_width += resize_buffer_amt; - - if (/*!columnp->mDynamicWidth && */columnp->getWidth() > 0) - { - columnp->setWidth(columnp->getWidth() - llmin(columnp->getWidth() - MIN_COLUMN_WIDTH, delta_width)); - if (columnp->mRelWidth > 0.f) - { - columnp->mRelWidth = (F32)columnp->getWidth() / (F32)mColumn->mParentCtrl->getItemListRect().getWidth(); - } - } - - if (remaining_width >= 0) - { - // width sucked up from neighboring columns, done - break; - } - } - } - } - - // clamp resize amount to maximum that can be absorbed by other columns - if (delta_width > 0) - { - delta_width += llmin(remaining_width, 0); - } - - // propagate constrained delta_width to new width for this column - new_width = getRect().getWidth() + delta_width - mColumn->mParentCtrl->getColumnPadding(); - - // use requested width - mColumn->setWidth(new_width); - - // update proportional spacing - if (mColumn->mRelWidth > 0.f) - { - mColumn->mRelWidth = (F32)new_width / (F32)mColumn->mParentCtrl->getItemListRect().getWidth(); - } - - // tell scroll list to layout columns again - // do immediate update to get proper feedback to resize handle - // which needs to know how far the resize actually went - mColumn->mParentCtrl->updateColumns(); - } -} - -void LLColumnHeader::setHasResizableElement(BOOL resizable) -{ - // for now, dynamically spaced columns can't be resized -// if (mColumn->mDynamicWidth) return; - - if (mHasResizableElement != resizable) - { - mColumn->mParentCtrl->dirtyColumns(); - mHasResizableElement = resizable; - } -} - -void LLColumnHeader::updateResizeBars() -{ - S32 num_resizable_columns = 0; - S32 col; - for (col = 0; col < mColumn->mParentCtrl->getNumColumns(); col++) - { - LLScrollListColumn* columnp = mColumn->mParentCtrl->getColumn(col); - if (columnp->mHeader && columnp->mHeader->canResize()) - { - num_resizable_columns++; - } - } - - S32 num_resizers_enabled = 0; - - // now enable/disable resize handles on resizable columns if we have at least two - for (col = 0; col < mColumn->mParentCtrl->getNumColumns(); col++) - { - LLScrollListColumn* columnp = mColumn->mParentCtrl->getColumn(col); - if (!columnp->mHeader) continue; - BOOL enable = num_resizable_columns >= 2 && num_resizers_enabled < (num_resizable_columns - 1) && columnp->mHeader->canResize(); - columnp->mHeader->enableResizeBar(enable); - if (enable) - { - num_resizers_enabled++; - } - } -} - -void LLColumnHeader::enableResizeBar(BOOL enable) -{ - // for now, dynamically spaced columns can't be resized - //if (!mColumn->mDynamicWidth) - { - mResizeBar->setEnabled(enable); - } -} - -BOOL LLColumnHeader::canResize() -{ - return getVisible() && (mHasResizableElement || mColumn->mDynamicWidth); -} - -void LLScrollListColumn::setWidth(S32 width) -{ - if (!mDynamicWidth && mRelWidth <= 0.f) - { - mParentCtrl->updateStaticColumnWidth(this, width); - } - mWidth = width; -} - -// Default constructor -LLScrollListColumn::LLScrollListColumn() : - mName(), - mSortingColumn(), - mSortAscending(TRUE), - mLabel(), - mWidth(-1), - mRelWidth(-1.0), - mDynamicWidth(FALSE), - mMaxContentWidth(0), - mIndex(-1), - mParentCtrl(NULL), - mHeader(NULL), - mFontAlignment(LLFontGL::LEFT) -{ } - -LLScrollListColumn::LLScrollListColumn(const LLSD &sd, LLScrollListCtrl* parent) : - mWidth(0), - mIndex (-1), - mParentCtrl(parent), - mHeader(NULL), - mMaxContentWidth(0), - mDynamicWidth(FALSE), - mRelWidth(-1.f) -{ - mName = sd.get("name").asString(); - mSortingColumn = mName; - if (sd.has("sort")) - { - mSortingColumn = sd.get("sort").asString(); - } - mSortAscending = TRUE; - if (sd.has("sort_ascending")) - { - mSortAscending = sd.get("sort_ascending").asBoolean(); - } - mLabel = sd.get("label").asString(); - if (sd.has("relwidth") && (F32)sd.get("relwidth").asReal() > 0) - { - mRelWidth = (F32)sd.get("relwidth").asReal(); - if (mRelWidth < 0) mRelWidth = 0; - if (mRelWidth > 1) mRelWidth = 1; - mDynamicWidth = FALSE; - } - else if(sd.has("dynamicwidth") && (BOOL)sd.get("dynamicwidth").asBoolean() == TRUE) - { - mDynamicWidth = TRUE; - mRelWidth = -1; - } - else - { - - setWidth(sd.get("width").asInteger()); - } - - if (sd.has("halign")) - { - mFontAlignment = (LLFontGL::HAlign)llclamp(sd.get("halign").asInteger(), (S32)LLFontGL::LEFT, (S32)LLFontGL::HCENTER); - } - else - { - mFontAlignment = LLFontGL::LEFT; - } - -} diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 72d8894afab7728e94712c04a7db10483a429ad6..461df6760fa49ad42ef63039e85b4b8a0be72220 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -1,5 +1,8 @@ /** * @file llscrolllistctrl.h + * @brief A scrolling list of items. This is the one you want to use + * in UI code. LLScrollListCell, LLScrollListItem, etc. are utility + * classes. * * $LicenseInfo:firstyear=2001&license=viewergpl$ * @@ -37,346 +40,109 @@ #include "lluictrl.h" #include "llctrlselectioninterface.h" -#include "lldarray.h" +//#include "lldarray.h" #include "llfontgl.h" #include "llui.h" -#include "llstring.h" -#include "llimagegl.h" +#include "llstring.h" // LLWString +//#include "llimagegl.h" #include "lleditmenuhandler.h" #include "llframetimer.h" -#include "llcheckboxctrl.h" -#include "llcombobox.h" + #include "llscrollbar.h" -#include "llresizebar.h" #include "lldate.h" +#include "llscrolllistitem.h" +#include "llscrolllistcolumn.h" -/* - * Represents a cell in a scrollable table. - * - * Sub-classes must return height and other properties - * though width accessors are implemented by the base class. - * It is therefore important for sub-class constructors to call - * setWidth() with realistic values. - */ -class LLScrollListCell -{ -public: - LLScrollListCell(S32 width = 0) : mWidth(width) {}; - virtual ~LLScrollListCell() {}; - virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const = 0; // truncate to given width, if possible - virtual S32 getWidth() const {return mWidth;} - virtual S32 getContentWidth() const { return 0; } - virtual S32 getHeight() const = 0; - virtual const LLSD getValue() const { return LLStringUtil::null; } - virtual void setValue(const LLSD& value) { } - virtual BOOL getVisible() const { return TRUE; } - virtual void setWidth(S32 width) { mWidth = width; } - virtual void highlightText(S32 offset, S32 num_chars) {} - virtual BOOL isText() const = 0; - virtual void setColor(const LLColor4&) {} - virtual void onCommit() {}; - - virtual BOOL handleClick() { return FALSE; } - virtual void setEnabled(BOOL enable) { } - -private: - S32 mWidth; -}; - -/* - * Draws a horizontal line. - */ -class LLScrollListSeparator : public LLScrollListCell -{ -public: - LLScrollListSeparator(S32 width); - virtual ~LLScrollListSeparator() {}; - virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; // truncate to given width, if possible - virtual S32 getHeight() const; - virtual BOOL isText() const { return FALSE; } -}; - -/* - * Cell displaying a text label. - */ -class LLScrollListText : public LLScrollListCell -{ -public: - LLScrollListText( const std::string& text, const LLFontGL* font, S32 width = 0, U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE); - /*virtual*/ ~LLScrollListText(); - - virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; - virtual S32 getContentWidth() const; - virtual S32 getHeight() const; - virtual void setValue(const LLSD& value); - virtual const LLSD getValue() const; - virtual BOOL getVisible() const; - virtual void highlightText(S32 offset, S32 num_chars); - - virtual void setColor(const LLColor4&); - virtual BOOL isText() const; - - void setText(const LLStringExplicit& text); - void setFontStyle(const U8 font_style) { mFontStyle = font_style; } - -private: - LLUIString mText; - const LLFontGL* mFont; - LLColor4 mColor; - U8 mUseColor; - U8 mFontStyle; - LLFontGL::HAlign mFontAlignment; - BOOL mVisible; - S32 mHighlightCount; - S32 mHighlightOffset; - - LLPointer<LLUIImage> mRoundedRectImage; - - static U32 sCount; -}; - +class LLScrollListCell; +class LLTextBox; -class LLScrollListDate : public LLScrollListText -{ -public: - LLScrollListDate( const LLDate& date, const LLFontGL* font, S32 width=0, U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE); - virtual void setValue(const LLSD& value); - virtual const LLSD getValue() const; - -private: - LLDate mDate; -}; - -/* - * Cell displaying an image. - */ -class LLScrollListIcon : public LLScrollListCell -{ -public: - LLScrollListIcon( LLUIImagePtr icon, S32 width = 0); - LLScrollListIcon(const LLSD& value, S32 width = 0); - /*virtual*/ ~LLScrollListIcon(); - virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; - virtual S32 getWidth() const; - virtual S32 getHeight() const { return mIcon ? mIcon->getHeight() : 0; } - virtual const LLSD getValue() const { return mIcon.isNull() ? LLStringUtil::null : mIcon->getName(); } - virtual void setColor(const LLColor4&); - virtual BOOL isText()const { return FALSE; } - virtual void setValue(const LLSD& value); - -private: - LLUIImagePtr mIcon; - LLColor4 mColor; -}; - -/* - * An interactive cell containing a check box. - */ -class LLScrollListCheck : public LLScrollListCell -{ -public: - LLScrollListCheck( LLCheckBoxCtrl* check_box, S32 width = 0); - /*virtual*/ ~LLScrollListCheck(); - virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; - virtual S32 getHeight() const { return 0; } - virtual const LLSD getValue() const { return mCheckBox->getValue(); } - virtual void setValue(const LLSD& value) { mCheckBox->setValue(value); } - virtual void onCommit() { mCheckBox->onCommit(); } - - virtual BOOL handleClick(); - virtual void setEnabled(BOOL enable) { mCheckBox->setEnabled(enable); } - - LLCheckBoxCtrl* getCheckBox() { return mCheckBox; } - virtual BOOL isText() const { return FALSE; } - -private: - LLCheckBoxCtrl* mCheckBox; -}; - -/* - * A simple data class describing a column within a scroll list. - */ -class LLScrollListColumn -{ -public: - LLScrollListColumn(); - LLScrollListColumn(const LLSD &sd, LLScrollListCtrl* parent); - - void setWidth(S32 width); - S32 getWidth() const { return mWidth; } - - // Public data is fine so long as this remains a simple struct-like data class. - // If it ever gets any smarter than that, these should all become private - // with protected or public accessor methods added as needed. -MG - std::string mName; - std::string mSortingColumn; - BOOL mSortAscending; - std::string mLabel; - F32 mRelWidth; - BOOL mDynamicWidth; - S32 mMaxContentWidth; - S32 mIndex; - LLScrollListCtrl* mParentCtrl; - class LLColumnHeader* mHeader; - LLFontGL::HAlign mFontAlignment; - -private: - S32 mWidth; - -}; - -class LLColumnHeader : public LLComboBox -{ -public: - LLColumnHeader(const std::string& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL *font = NULL); - ~LLColumnHeader(); - - /*virtual*/ void draw(); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - - /*virtual*/ void showList(); - /*virtual*/ LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding); - /*virtual*/ void userSetShape(const LLRect& new_rect); - - void setImage(const std::string &image_name); - LLScrollListColumn* getColumn() { return mColumn; } - void setHasResizableElement(BOOL resizable); - void updateResizeBars(); - BOOL canResize(); - void enableResizeBar(BOOL enable); - std::string getLabel() { return mOrigLabel; } - - static void onSelectSort(LLUICtrl* ctrl, void* user_data); - static void onClick(void* user_data); - static void onMouseDown(void* user_data); - static void onHeldDown(void* user_data); - -private: - LLScrollListColumn* mColumn; - LLResizeBar* mResizeBar; - std::string mOrigLabel; - LLUIString mAscendingText; - LLUIString mDescendingText; - BOOL mShowSortOptions; - BOOL mHasResizableElement; -}; - -class LLScrollListItem +class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler, + public LLCtrlListInterface, public LLCtrlScrollInterface { public: - LLScrollListItem( BOOL enabled = TRUE, void* userdata = NULL, const LLUUID& uuid = LLUUID::null ) - : mSelected(FALSE), mEnabled( enabled ), mUserdata( userdata ), mItemValue( uuid ), mColumns() {} - LLScrollListItem( LLSD item_value, void* userdata = NULL ) - : mSelected(FALSE), mEnabled( TRUE ), mUserdata( userdata ), mItemValue( item_value ), mColumns() {} - - virtual ~LLScrollListItem(); - - void setSelected( BOOL b ) { mSelected = b; } - BOOL getSelected() const { return mSelected; } - - void setEnabled( BOOL b ); - BOOL getEnabled() const { return mEnabled; } - - void setUserdata( void* userdata ) { mUserdata = userdata; } - void* getUserdata() const { return mUserdata; } + struct Contents : public LLInitParam::Block<Contents> + { + Multiple<LLScrollListColumn::Params> columns; + Multiple<LLScrollListItem::Params> rows; - LLUUID getUUID() const { return mItemValue.asUUID(); } - LLSD getValue() const { return mItemValue; } + //Multiple<Contents> groups; - // If width = 0, just use the width of the text. Otherwise override with - // specified width in pixels. - void addColumn( const std::string& text, const LLFontGL* font, S32 width = 0 , U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, BOOL visible = TRUE) - { mColumns.push_back( new LLScrollListText(text, font, width, font_style, font_alignment, LLColor4::black, FALSE, visible) ); } + Contents(); + }; - void addColumn( LLUIImagePtr icon, S32 width = 0 ) - { mColumns.push_back( new LLScrollListIcon(icon, width) ); } - - void addColumn( LLCheckBoxCtrl* check, S32 width = 0 ) - { mColumns.push_back( new LLScrollListCheck(check,width) ); } - - void setNumColumns(S32 columns); - - void setColumn( S32 column, LLScrollListCell *cell ); + // *TODO: Add callbacks to Params + typedef boost::function<void (void)> callback_t; - S32 getNumColumns() const { return mColumns.size(); } - - LLScrollListCell *getColumn(const S32 i) const { if (0 <= i && i < (S32)mColumns.size()) { return mColumns[i]; } return NULL; } - - std::string getContentsCSV() const; + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + // behavioral flags + Optional<bool> multi_select, + commit_on_keyboard_movement; + + // display flags + Optional<bool> has_border, + draw_heading, + draw_stripes, + background_visible; + + // layout + Optional<S32> column_padding, + heading_height; + + // sort and search behavior + Optional<S32> search_column, + sort_column; + Optional<bool> sort_ascending; + + // colors + Optional<LLUIColor> fg_unselected_color, + fg_selected_color, + bg_selected_color, + fg_disable_color, + bg_writeable_color, + bg_read_only_color, + bg_stripe_color, + hovered_color, + highlighted_color; + + Optional<Contents> contents; + + Params(); + }; - virtual void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); +protected: + friend class LLUICtrlFactory; -private: - BOOL mSelected; - BOOL mEnabled; - void* mUserdata; - LLSD mItemValue; - std::vector<LLScrollListCell *> mColumns; -}; - -/* - * A graphical control representing a scrollable table. - * Cells in the table can be simple text or more complicated things - * such as icons or even interactive elements like check boxes. - */ -class LLScrollListItemComment : public LLScrollListItem -{ -public: - LLScrollListItemComment(const std::string& comment_string, const LLColor4& color); + LLScrollListCtrl(const Params&); - /*virtual*/ void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); -private: - LLColor4 mColor; -}; - -class LLScrollListItemSeparator : public LLScrollListItem -{ public: - LLScrollListItemSeparator(); - - /*virtual*/ void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); -}; - -class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler, - public LLCtrlListInterface, public LLCtrlScrollInterface -{ -public: - LLScrollListCtrl( - const std::string& name, - const LLRect& rect, - void (*commit_callback)(LLUICtrl*, void*), - void* callback_userdata, - BOOL allow_multiple_selection, - BOOL draw_border = TRUE); - virtual ~LLScrollListCtrl(); - virtual LLXMLNodePtr getXML(bool save_children = true) const; - void setScrollListParameters(LLXMLNodePtr node); - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - S32 isEmpty() const; void deleteAllItems() { clearRows(); } // Sets an array of column descriptors - void setColumnHeadings(LLSD headings); + void setColumnHeadings(const LLSD& headings); void sortByColumnIndex(U32 column, BOOL ascending); // LLCtrlListInterface functions virtual S32 getItemCount() const; // Adds a single column descriptor: ["name" : string, "label" : string, "width" : integer, "relwidth" : integer ] - virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); + virtual void addColumn(const LLScrollListColumn::Params& column, EAddPosition pos = ADD_BOTTOM); + virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); virtual void clearColumns(); virtual void setColumnLabel(const std::string& column, const std::string& label); - + virtual bool preProcessChildNode(LLXMLNodePtr child); virtual LLScrollListColumn* getColumn(S32 index); + virtual LLScrollListColumn* getColumn(const std::string& name); virtual S32 getNumColumns() const { return mColumnsIndexed.size(); } // Adds a single element, from an array of: // "columns" => [ "column" => column name, "value" => value, "type" => type, "font" => font, "font-style" => style ], "id" => uuid // Creates missing columns automatically. - virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); + virtual LLScrollListItem* addElement(const LLSD& element, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); + virtual LLScrollListItem* addRow(const LLScrollListItem::Params& value, EAddPosition pos = ADD_BOTTOM); // Simple add element. Takes a single array of: // [ "value" => value, "font" => font, "font-style" => style ] virtual void clearRows(); // clears all elements @@ -421,10 +187,14 @@ public: void deleteSelectedItems(); void deselectAllItems(BOOL no_commit_on_change = FALSE); // by default, go ahead and commit on selection change - void highlightNthItem( S32 index ); - void setDoubleClickCallback( void (*cb)(void*) ) { mOnDoubleClickCallback = cb; } - void setMaximumSelectCallback( void (*cb)(void*) ) { mOnMaximumSelectCallback = cb; } - void setSortChangedCallback( void (*cb)(void*) ) { mOnSortChangedCallback = cb; } + void clearHighlightedItems(); + void mouseOverHighlightNthItem( S32 index ); + + void setDoubleClickCallback( callback_t cb ) { mOnDoubleClickCallback = cb; } + void setMaximumSelectCallback( callback_t cb) { mOnMaximumSelectCallback = cb; } + void setSortChangedCallback( callback_t cb) { mOnSortChangedCallback = cb; } + // Convenience function; *TODO: replace with setter above + boost::bind() in calling code + void setDoubleClickCallback( boost::function<void (void* userdata)> cb, void* userdata) { mOnDoubleClickCallback = boost::bind(cb, userdata); } void swapWithNext(S32 index); void swapWithPrevious(S32 index); @@ -435,21 +205,21 @@ public: S32 getItemIndex( LLScrollListItem* item ) const; S32 getItemIndex( const LLUUID& item_id ) const; - LLScrollListItem* addCommentText( const std::string& comment_text, EAddPosition pos = ADD_BOTTOM); + void setCommentText( const std::string& comment_text); LLScrollListItem* addSeparator(EAddPosition pos); // "Simple" interface: use this when you're creating a list that contains only unique strings, only // one of which can be selected at a time. virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); - BOOL selectItemByLabel( const std::string& item, BOOL case_sensitive = TRUE ); // FALSE if item not found BOOL selectItemByPrefix(const std::string& target, BOOL case_sensitive = TRUE); BOOL selectItemByPrefix(const LLWString& target, BOOL case_sensitive = TRUE); + LLScrollListItem* getItemByLabel( const std::string& item, BOOL case_sensitive = TRUE, S32 column = 0 ); const std::string getSelectedItemLabel(S32 column = 0) const; LLSD getSelectedValue(); - // DEPRECATED: Use LLSD versions of addCommentText() and getSelectedValue(). + // DEPRECATED: Use LLSD versions of setCommentText() and getSelectedValue(). // "StringUUID" interface: use this when you're creating a list that contains non-unique strings each of which // has an associated, unique UUID, and only one of which can be selected at a time. LLScrollListItem* addStringUUIDItem(const std::string& item_text, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE, S32 column_width = 0); @@ -475,7 +245,8 @@ public: void setBgStripeColor(const LLColor4& c) { mBgStripeColor = c; } void setFgSelectedColor(const LLColor4 &c) { mFgSelectedColor = c; } void setFgUnselectedColor(const LLColor4 &c){ mFgUnselectedColor = c; } - void setHighlightedColor(const LLColor4 &c) { mHighlightedColor = c; } + void setHoveredColor(const LLColor4 &c) { mHoveredColor = c; } + void setHighlightedColor(const LLColor4 &c) { mHighlightedColor = c; } void setFgDisableColor(const LLColor4 &c) { mFgDisabledColor = c; } void setBackgroundVisible(BOOL b) { mBackgroundVisible = b; } @@ -514,6 +285,7 @@ public: /*virtual*/ void setFocus( BOOL b ); /*virtual*/ void onFocusReceived(); /*virtual*/ void onFocusLost(); + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); virtual BOOL isDirty() const; @@ -528,15 +300,14 @@ public: LLRect getItemListRect() { return mItemListRect; } // Used "internally" by the scroll bar. - static void onScrollChange( S32 new_pos, LLScrollbar* src, void* userdata ); + void onScrollChange( S32 new_pos, LLScrollbar* src ); static void onClickColumn(void *userdata); - void updateColumns(); + virtual void updateColumns(); void calcColumnWidths(); S32 getMaxContentWidth() { return mMaxContentWidth; } - void setDisplayHeading(BOOL display); void setHeadingHeight(S32 heading_height); void setCollapseEmptyColumns(BOOL collapse); @@ -561,7 +332,7 @@ public: BOOL getSortAscending() { return mSortColumns.empty() ? TRUE : mSortColumns.back().second; } BOOL needsSorting(); - S32 selectMultiple( LLDynamicArray<LLUUID> ids ); + S32 selectMultiple( std::vector<LLUUID> ids ); void sortItems(); // sorts a list without affecting the permanent sort order (so further list insertions can be unsorted, for example) void sortOnce(S32 column, BOOL ascending); @@ -604,7 +375,6 @@ private: void commitIfChanged(); BOOL setSort(S32 column, BOOL ascending); - S32 mCurIndex; // For get[First/Next]Data S32 mCurSelectedIndex; // For get[First/Next]Selected @@ -621,7 +391,7 @@ private: BOOL mSelectionChanged; BOOL mNeedsScroll; BOOL mCanSelect; - BOOL mDisplayColumnHeaders; + const BOOL mDisplayColumnHeaders; BOOL mColumnsDirty; item_list mItemList; @@ -637,19 +407,20 @@ private: BOOL mBackgroundVisible; BOOL mDrawStripes; - LLColor4 mBgWriteableColor; - LLColor4 mBgReadOnlyColor; - LLColor4 mBgSelectedColor; - LLColor4 mBgStripeColor; - LLColor4 mFgSelectedColor; - LLColor4 mFgUnselectedColor; - LLColor4 mFgDisabledColor; - LLColor4 mHighlightedColor; + LLUIColor mBgWriteableColor; + LLUIColor mBgReadOnlyColor; + LLUIColor mBgSelectedColor; + LLUIColor mBgStripeColor; + LLUIColor mFgSelectedColor; + LLUIColor mFgUnselectedColor; + LLUIColor mFgDisabledColor; + LLUIColor mHoveredColor; + LLUIColor mHighlightedColor; S32 mBorderThickness; - void (*mOnDoubleClickCallback)(void* userdata); - void (*mOnMaximumSelectCallback)(void* userdata ); - void (*mOnSortChangedCallback)(void* userdata); + callback_t mOnDoubleClickCallback; + callback_t mOnMaximumSelectCallback; + callback_t mOnSortChangedCallback; S32 mHighlightedItem; class LLViewBorder* mBorder; @@ -678,7 +449,15 @@ private: // HACK: Did we draw one selected item this frame? BOOL mDrewSelected; + + LLTextBox* mCommentTextBox; }; // end class LLScrollListCtrl +#ifdef LL_WINDOWS +#ifndef INSTANTIATE_GETCHILD_SCROLLLIST +#pragma warning (disable : 4231) +extern template LLScrollListCtrl* LLView::getChild<LLScrollListCtrl>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const; +#endif +#endif #endif // LL_SCROLLLISTCTRL_H diff --git a/indra/llui/llscrolllistitem.cpp b/indra/llui/llscrolllistitem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2ac6925c78f3c53c1488571173f187318d58f899 --- /dev/null +++ b/indra/llui/llscrolllistitem.cpp @@ -0,0 +1,157 @@ +/** + * @file llscrolllistitem.cpp + * @brief Scroll lists are composed of rows (items), each of which + * contains columns (cells). + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "llscrolllistitem.h" + +#include "llrect.h" +#include "llresmgr.h" // LLFONT_SANSSERIF_SMALL +#include "llui.h" + + +//--------------------------------------------------------------------------- +// LLScrollListItem +//--------------------------------------------------------------------------- + +LLScrollListItem::LLScrollListItem( const Params& p ) +: mSelected(FALSE), + mHighlighted(FALSE), + mEnabled(p.enabled), + mUserdata(p.userdata), + mItemValue(p.value) +{ +} + + +LLScrollListItem::~LLScrollListItem() +{ + std::for_each(mColumns.begin(), mColumns.end(), DeletePointer()); +} + +void LLScrollListItem::addColumn(const LLScrollListCell::Params& p) +{ + mColumns.push_back(LLScrollListCell::create(p)); +} + +void LLScrollListItem::setNumColumns(S32 columns) +{ + S32 prev_columns = mColumns.size(); + if (columns < prev_columns) + { + std::for_each(mColumns.begin()+columns, mColumns.end(), DeletePointer()); + } + + mColumns.resize(columns); + + for (S32 col = prev_columns; col < columns; ++col) + { + mColumns[col] = NULL; + } +} + +void LLScrollListItem::setColumn( S32 column, LLScrollListCell *cell ) +{ + if (column < (S32)mColumns.size()) + { + delete mColumns[column]; + mColumns[column] = cell; + } + else + { + llerrs << "LLScrollListItem::setColumn: bad column: " << column << llendl; + } +} + + +S32 LLScrollListItem::getNumColumns() const +{ + return mColumns.size(); +} + +LLScrollListCell* LLScrollListItem::getColumn(const S32 i) const +{ + if (0 <= i && i < (S32)mColumns.size()) + { + return mColumns[i]; + } + return NULL; +} + +std::string LLScrollListItem::getContentsCSV() const +{ + std::string ret; + + S32 count = getNumColumns(); + for (S32 i=0; i<count; ++i) + { + ret += getColumn(i)->getValue().asString(); + if (i < count-1) + { + ret += ", "; + } + } + + return ret; +} + + +void LLScrollListItem::draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding) +{ + // draw background rect + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + LLRect bg_rect = rect; + gl_rect_2d( bg_rect, bg_color ); + + S32 cur_x = rect.mLeft; + S32 num_cols = getNumColumns(); + S32 cur_col = 0; + + for (LLScrollListCell* cell = getColumn(0); cur_col < num_cols; cell = getColumn(++cur_col)) + { + // Two ways a cell could be hidden + if (cell->getWidth() < 0 + || !cell->getVisible()) continue; + + LLUI::pushMatrix(); + { + LLUI::translate((F32) cur_x, (F32) rect.mBottom, 0.0f); + + cell->draw( fg_color, highlight_color ); + } + LLUI::popMatrix(); + + cur_x += cell->getWidth() + column_padding; + } +} + diff --git a/indra/llui/llscrolllistitem.h b/indra/llui/llscrolllistitem.h new file mode 100644 index 0000000000000000000000000000000000000000..8d87137c3a2c043b1785300a50f730fd03589bad --- /dev/null +++ b/indra/llui/llscrolllistitem.h @@ -0,0 +1,129 @@ +/** + * @file llscrolllistitem.h + * @brief Scroll lists are composed of rows (items), each of which + * contains columns (cells). + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LLSCROLLLISTITEM_H +#define LLSCROLLLISTITEM_H + +#include "llfontgl.h" // LLFontGL::HAlign +#include "llpointer.h" // LLPointer<> +#include "llsd.h" +#include "lluistring.h" +#include "v4color.h" +#include "llinitparam.h" +#include "llscrolllistcell.h" + +#include <vector> + +class LLCoordGL; +class LLCheckBoxCtrl; +class LLResizeBar; +class LLScrollListCtrl; +class LLScrollColumnHeader; +class LLUIImage; + +//--------------------------------------------------------------------------- +// LLScrollListItem +//--------------------------------------------------------------------------- +class LLScrollListItem +{ + friend class LLScrollListCtrl; +public: + struct Params : public LLInitParam::Block<Params> + { + Optional<bool> enabled; + Optional<void*> userdata; + Optional<LLSD> value; + + Deprecated name; // use for localization tools + Deprecated type; + Deprecated length; + + Multiple<LLScrollListCell::Params> cells; + + Params() + : enabled("enabled", true), + value("value"), + name("name"), + type("type"), + length("length"), + cells("columns") + { + addSynonym(cells, "column"); + addSynonym(value, "id"); + } + }; + + virtual ~LLScrollListItem(); + + void setSelected( BOOL b ) { mSelected = b; } + BOOL getSelected() const { return mSelected; } + + void setEnabled( BOOL b ) { mEnabled = b; } + BOOL getEnabled() const { return mEnabled; } + + void setHighlighted( BOOL b ) { mHighlighted = b; } + BOOL getHighlighted() const { return mHighlighted; } + + void setUserdata( void* userdata ) { mUserdata = userdata; } + void* getUserdata() const { return mUserdata; } + + LLUUID getUUID() const { return mItemValue.asUUID(); } + LLSD getValue() const { return mItemValue; } + + void addColumn( const LLScrollListCell::Params& p ); + + void setNumColumns(S32 columns); + + void setColumn( S32 column, LLScrollListCell *cell ); + + S32 getNumColumns() const; + + LLScrollListCell *getColumn(const S32 i) const; + + std::string getContentsCSV() const; + + virtual void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); + +protected: + LLScrollListItem( const Params& ); + +private: + BOOL mSelected; + BOOL mHighlighted; + BOOL mEnabled; + void* mUserdata; + LLSD mItemValue; + std::vector<LLScrollListCell *> mColumns; +}; + +#endif diff --git a/indra/llui/llsdparam.cpp b/indra/llui/llsdparam.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1b0f3c9885bff1532a3cbf7d86572b7bfdf2fd04 --- /dev/null +++ b/indra/llui/llsdparam.cpp @@ -0,0 +1,158 @@ +/** + * @file llsdparam.cpp + * @brief parameter block abstraction for creating complex objects and + * parsing construction parameters from xml and LLSD + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +// Project includes +#include "llsdparam.h" + +// +// LLParamSDParser +// +LLParamSDParser::LLParamSDParser() +{ + using boost::bind; + + registerParserFuncs<S32>(bind(&LLParamSDParser::readTypedValue<S32>, this, _1, &LLSD::asInteger), + bind(&LLParamSDParser::writeTypedValue<S32>, this, _1, _2)); + registerParserFuncs<U32>(bind(&LLParamSDParser::readTypedValue<U32>, this, _1, &LLSD::asInteger), + bind(&LLParamSDParser::writeU32Param, this, _1, _2)); + registerParserFuncs<F32>(bind(&LLParamSDParser::readTypedValue<F32>, this, _1, &LLSD::asReal), + bind(&LLParamSDParser::writeTypedValue<F32>, this, _1, _2)); + registerParserFuncs<F64>(bind(&LLParamSDParser::readTypedValue<F64>, this, _1, &LLSD::asReal), + bind(&LLParamSDParser::writeTypedValue<F64>, this, _1, _2)); + registerParserFuncs<bool>(bind(&LLParamSDParser::readTypedValue<F32>, this, _1, &LLSD::asBoolean), + bind(&LLParamSDParser::writeTypedValue<F32>, this, _1, _2)); + registerParserFuncs<std::string>(bind(&LLParamSDParser::readTypedValue<std::string>, this, _1, &LLSD::asString), + bind(&LLParamSDParser::writeTypedValue<std::string>, this, _1, _2)); + registerParserFuncs<LLUUID>(bind(&LLParamSDParser::readTypedValue<LLUUID>, this, _1, &LLSD::asUUID), + bind(&LLParamSDParser::writeTypedValue<LLUUID>, this, _1, _2)); + registerParserFuncs<LLDate>(bind(&LLParamSDParser::readTypedValue<LLDate>, this, _1, &LLSD::asDate), + bind(&LLParamSDParser::writeTypedValue<LLDate>, this, _1, _2)); + registerParserFuncs<LLURI>(bind(&LLParamSDParser::readTypedValue<LLURI>, this, _1, &LLSD::asURI), + bind(&LLParamSDParser::writeTypedValue<LLURI>, this, _1, _2)); + registerParserFuncs<LLSD>(bind(&LLParamSDParser::readSDParam, this, _1), + bind(&LLParamSDParser::writeTypedValue<LLSD>, this, _1, _2)); +} + +bool LLParamSDParser::readSDParam(void* value_ptr) +{ + if (!mCurReadSD) return false; + *((LLSD*)value_ptr) = *mCurReadSD; + return true; +} + +// special case handling of U32 due to ambiguous LLSD::assign overload +bool LLParamSDParser::writeU32Param(const void* val_ptr, const parser_t::name_stack_t& name_stack) +{ + if (!mWriteSD) return false; + + LLSD* sd_to_write = getSDWriteNode(name_stack); + if (!sd_to_write) return false; + + sd_to_write->assign((S32)*((const U32*)val_ptr)); + return true; +} + +void LLParamSDParser::readSD(const LLSD& sd, LLInitParam::BaseBlock& block, bool silent) +{ + mCurReadSD = NULL; + mNameStack.clear(); + setParseSilently(silent); + + // must have named elements at top level to submit for parsing + if (sd.isMap()) + { + readSDValues(sd, block); + } + else + { + parserWarning("Top level map required for LLSD->Block conversion"); + } +} + +void LLParamSDParser::writeSD(LLSD& sd, const LLInitParam::BaseBlock& block) +{ + mWriteSD = &sd; + block.serializeBlock(*this); +} + +void LLParamSDParser::readSDValues(const LLSD& sd, LLInitParam::BaseBlock& block) +{ + if (sd.isMap()) + { + for (LLSD::map_const_iterator it = sd.beginMap(); + it != sd.endMap(); + ++it) + { + mNameStack.push_back(make_pair(it->first, newParseGeneration())); + readSDValues(it->second, block); + mNameStack.pop_back(); + } + } + else if (sd.isArray()) + { + for (LLSD::array_const_iterator it = sd.beginArray(); + it != sd.endArray(); + ++it) + { + mNameStack.back().second = newParseGeneration(); + readSDValues(*it, block); + } + } + else + { + mCurReadSD = &sd; + block.submitValue(mNameStack, *this); + } +} + +/*virtual*/ std::string LLParamSDParser::getCurrentElementName() +{ + std::string full_name = "sd"; + for (name_stack_t::iterator it = mNameStack.begin(); + it != mNameStack.end(); + ++it) + { + full_name += llformat("[%s]", it->first.c_str()); + } + + return full_name; +} + +LLSD* LLParamSDParser::getSDWriteNode(const parser_t::name_stack_t& name_stack) +{ + //TODO: implement nested LLSD writing + return mWriteSD; +} + diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h new file mode 100644 index 0000000000000000000000000000000000000000..12f28f876faa980bd12e9f475e72714130f6be1c --- /dev/null +++ b/indra/llui/llsdparam.h @@ -0,0 +1,107 @@ +/** + * @file llsdparam.h + * @brief parameter block abstraction for creating complex objects and + * parsing construction parameters from xml and LLSD + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLSDPARAM_H +#define LL_LLSDPARAM_H + +#include "llinitparam.h" + +class LLParamSDParser +: public LLInitParam::Parser, + public LLSingleton<LLParamSDParser> +{ +LOG_CLASS(LLParamSDParser); + +typedef LLInitParam::Parser parser_t; + +protected: + LLParamSDParser(); + friend class LLSingleton<LLParamSDParser>; +public: + void readSD(const LLSD& sd, LLInitParam::BaseBlock& block, bool silent = false); + void writeSD(LLSD& sd, const LLInitParam::BaseBlock& block); + + /*virtual*/ std::string getCurrentElementName(); + +private: + void readSDValues(const LLSD& sd, LLInitParam::BaseBlock& block); + + template<typename T> + bool readTypedValue(void* val_ptr, boost::function<T(const LLSD&)> parser_func) + { + if (!mCurReadSD) return false; + + *((T*)val_ptr) = parser_func(*mCurReadSD); + return true; + } + + template<typename T> + bool writeTypedValue(const void* val_ptr, const parser_t::name_stack_t& name_stack) + { + if (!mWriteSD) return false; + + LLSD* sd_to_write = getSDWriteNode(name_stack); + if (!sd_to_write) return false; + + sd_to_write->assign(*((const T*)val_ptr)); + return true; + } + + LLSD* getSDWriteNode(const parser_t::name_stack_t& name_stack); + + bool readSDParam(void* value_ptr); + bool writeU32Param(const void* value_ptr, const parser_t::name_stack_t& name_stack); + + Parser::name_stack_t mNameStack; + const LLSD* mCurReadSD; + LLSD* mWriteSD; +}; + +template<typename T> +class LLSDParamAdapter : public T + { + public: + LLSDParamAdapter() {} + LLSDParamAdapter(const LLSD& sd) + { + LLParamSDParser::instance().readSD(sd, *this); + } + + LLSDParamAdapter(const T& val) + { + T::operator=(val); + } + }; + +#endif // LL_LLSDPARAM_H + diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3171f96fcf0350b93180d46e8f1d7238d7f7e09c --- /dev/null +++ b/indra/llui/llsearcheditor.cpp @@ -0,0 +1,124 @@ +/** + * @file lllineeditor.cpp + * @brief LLLineEditor base class + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +// Text editor widget to let users enter a single line. + +#include "linden_common.h" + +#include "llsearcheditor.h" + +static LLDefaultWidgetRegistry::Register<LLSearchEditor> r2("search_editor"); + +LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p) +: LLUICtrl(p) +{ + LLLineEditor::Params line_editor_p(p); + line_editor_p.name("search edit box"); + line_editor_p.rect(getLocalRect()); + line_editor_p.follows.flags(FOLLOWS_ALL); + line_editor_p.text_pad_right(getRect().getHeight()); + line_editor_p.keystroke_callback(boost::bind(&LLSearchEditor::onSearchEdit, this, _1)); + + mSearchEdit = LLUICtrlFactory::create<LLLineEditor>(line_editor_p); + addChild(mSearchEdit); + + S32 btn_width = getRect().getHeight(); // button is square, and as tall as search editor + LLRect clear_btn_rect(getRect().getWidth() - btn_width, getRect().getHeight(), getRect().getWidth(), 0); + LLButton::Params button_params(p.clear_search_button); + button_params.name(std::string("clear search")); + button_params.rect(clear_btn_rect) ; + button_params.follows.flags(FOLLOWS_RIGHT|FOLLOWS_TOP); + button_params.tab_stop(false); + button_params.click_callback.function(boost::bind(&LLSearchEditor::onClearSearch, this, _2)); + + mClearSearchButton = LLUICtrlFactory::create<LLButton>(button_params); + mSearchEdit->addChild(mClearSearchButton); +} + +//virtual +void LLSearchEditor::setValue(const LLSD& value ) +{ + mSearchEdit->setValue(value); +} + +//virtual +LLSD LLSearchEditor::getValue() const +{ + return mSearchEdit->getValue(); +} + +//virtual +BOOL LLSearchEditor::setTextArg( const std::string& key, const LLStringExplicit& text ) +{ + return mSearchEdit->setTextArg(key, text); +} + +//virtual +BOOL LLSearchEditor::setLabelArg( const std::string& key, const LLStringExplicit& text ) +{ + return mSearchEdit->setLabelArg(key, text); +} + +//virtual +void LLSearchEditor::clear() +{ + if (mSearchEdit) + { + mSearchEdit->clear(); + } +} + +void LLSearchEditor::draw() +{ + mClearSearchButton->setVisible(!mSearchEdit->getWText().empty()); + + LLUICtrl::draw(); +} + + +void LLSearchEditor::onSearchEdit(LLLineEditor* caller ) +{ + if (mSearchCallback) + { + mSearchCallback(caller->getText()); + } +} + +void LLSearchEditor::onClearSearch(const LLSD& data) +{ + setText(LLStringUtil::null); + if (mSearchCallback) + { + mSearchCallback(LLStringUtil::null); + } +} + diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h new file mode 100644 index 0000000000000000000000000000000000000000..d8c5093fbf67592ef11d12ca49bd97c50c9c4452 --- /dev/null +++ b/indra/llui/llsearcheditor.h @@ -0,0 +1,98 @@ +/** + * @file llsearcheditor.h + * @brief Text editor widget that represents a search operation + * + * Features: + * Text entry of a single line (text, delete, left and right arrow, insert, return). + * Callbacks either on every keystroke or just on the return key. + * Focus (allow multiple text entry widgets) + * Clipboard (cut, copy, and paste) + * Horizontal scrolling to allow strings longer than widget size allows + * Pre-validation (limit which keys can be used) + * Optional line history so previous entries can be recalled by CTRL UP/DOWN + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLSEARCHEDITOR_H +#define LL_LLSEARCHEDITOR_H + +#include "lllineeditor.h" +#include "llbutton.h" + +#include <boost/function.hpp> + +/* + * @brief A line editor with a button to clear it and a callback to call on every edit event. + */ +class LLSearchEditor : public LLUICtrl +{ +public: + struct Params : public LLInitParam::Block<Params, LLLineEditor::Params> + { + Optional<boost::function<void(const std::string&, void*)> > search_callback; + + Optional<LLButton::Params> clear_search_button; + + Params() + : clear_search_button("clear_search_button") + { + name = "search_editor"; + } + }; + +protected: + LLSearchEditor(const Params&); + friend class LLUICtrlFactory; +public: + virtual ~LLSearchEditor() {} + + /*virtual*/ void draw(); + + void setText(const LLStringExplicit &new_text) { mSearchEdit->setText(new_text); } + + typedef boost::function<void (const std::string& search_string)> search_callback_t; + void setSearchCallback(search_callback_t cb) { mSearchCallback = cb; } + + // LLUICtrl interface + virtual void setValue(const LLSD& value ); + virtual LLSD getValue() const; + virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); + virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); + virtual void clear(); + +private: + void onSearchEdit(LLLineEditor* caller ); + void onClearSearch(const LLSD& data); + + LLLineEditor* mSearchEdit; + LLButton* mClearSearchButton; + search_callback_t mSearchCallback; +}; + +#endif // LL_LLSEARCHEDITOR_H diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp index 4dfc904581a7e5b03afa71923eb126c9c4c0b536..66ed0d4e884ff4bc91fe09b8f17ea7c11103b8a7 100644 --- a/indra/llui/llslider.cpp +++ b/indra/llui/llslider.cpp @@ -41,53 +41,45 @@ #include "llkeyboard.h" // for the MASK constants #include "llcontrol.h" #include "llimagegl.h" +#include "lluictrlfactory.h" + +static LLDefaultWidgetRegistry::Register<LLSlider> r1("slider_bar"); + +LLSlider::Params::Params() +: track_color("track_color"), + thumb_outline_color("thumb_outline_color"), + thumb_center_color("thumb_center_color"), + thumb_image("thumb_image"), + track_image("track_image"), + track_highlight_image("track_highlight_image"), + mouse_down_callback("mouse_down_callback"), + mouse_up_callback("mouse_up_callback") +{ + follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP); +} -static LLRegisterWidget<LLSlider> r1("slider_bar"); -static LLRegisterWidget<LLSlider> r2("volume_slider"); - - -LLSlider::LLSlider( - const std::string& name, - const LLRect& rect, - void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), - void* callback_userdata, - F32 initial_value, - F32 min_value, - F32 max_value, - F32 increment, - BOOL volume, - const std::string& control_name) - : - LLUICtrl( name, rect, TRUE, on_commit_callback, callback_userdata, - FOLLOWS_LEFT | FOLLOWS_TOP), - mValue( initial_value ), - mInitialValue( initial_value ), - mMinValue( min_value ), - mMaxValue( max_value ), - mIncrement( increment ), - mVolumeSlider( volume ), +LLSlider::LLSlider(const LLSlider::Params& p) +: LLF32UICtrl(p), mMouseOffset( 0 ), - mTrackColor( LLUI::sColorsGroup->getColor( "SliderTrackColor" ) ), - mThumbOutlineColor( LLUI::sColorsGroup->getColor( "SliderThumbOutlineColor" ) ), - mThumbCenterColor( LLUI::sColorsGroup->getColor( "SliderThumbCenterColor" ) ), - mMouseDownCallback( NULL ), - mMouseUpCallback( NULL ) + mTrackColor(p.track_color()), + mThumbOutlineColor(p.thumb_outline_color()), + mThumbCenterColor(p.thumb_center_color()), + mThumbImage(p.thumb_image), + mTrackImage(p.track_image), + mTrackHighlightImage(p.track_highlight_image) { - mThumbImage = LLUI::sImageProvider->getUIImage("icn_slide-thumb_dark.tga"); - mTrackImage = LLUI::sImageProvider->getUIImage("icn_slide-groove_dark.tga"); - mTrackHighlightImage = LLUI::sImageProvider->getUIImage("icn_slide-highlight.tga"); - - // properly handle setting the starting thumb rect - // do it this way to handle both the operating-on-settings - // and standalone ways of using this - setControlName(control_name, NULL); - setValue(getValueF32()); - + mViewModel->setValue(p.initial_value); updateThumbRect(); mDragStartThumbRect = mThumbRect; + setControlName(p.control_name, NULL); + setValue(getValueF32()); + + if (p.mouse_down_callback.isProvided()) + initCommitCallback(p.mouse_down_callback, mMouseDownSignal); + if (p.mouse_up_callback.isProvided()) + initCommitCallback(p.mouse_up_callback, mMouseUpSignal); } - void LLSlider::setValue(F32 value, BOOL from_event) { value = llclamp( value, mMinValue, mMaxValue ); @@ -98,21 +90,22 @@ void LLSlider::setValue(F32 value, BOOL from_event) value -= fmod(value, mIncrement); value += mMinValue; - if (!from_event && mValue != value) + if (!from_event && getValueF32() != value) { setControlValue(value); } - mValue = value; + LLF32UICtrl::setValue(value); updateThumbRect(); } void LLSlider::updateThumbRect() { - F32 t = (mValue - mMinValue) / (mMaxValue - mMinValue); + const S32 DEFAULT_THUMB_SIZE = 16; + F32 t = (getValueF32() - mMinValue) / (mMaxValue - mMinValue); - S32 thumb_width = mThumbImage->getWidth(); - S32 thumb_height = mThumbImage->getHeight(); + S32 thumb_width = mThumbImage ? mThumbImage->getWidth() : DEFAULT_THUMB_SIZE; + S32 thumb_height = mThumbImage ? mThumbImage->getHeight() : DEFAULT_THUMB_SIZE; S32 left_edge = (thumb_width / 2); S32 right_edge = getRect().getWidth() - (thumb_width / 2); @@ -126,10 +119,10 @@ void LLSlider::updateThumbRect() void LLSlider::setValueAndCommit(F32 value) { - F32 old_value = mValue; + F32 old_value = getValueF32(); setValue(value); - if (mValue != old_value) + if (getValueF32() != old_value) { onCommit(); } @@ -169,10 +162,8 @@ BOOL LLSlider::handleMouseUp(S32 x, S32 y, MASK mask) { gFocusMgr.setMouseCapture( NULL ); - if( mMouseUpCallback ) - { - mMouseUpCallback( this, mCallbackUserData ); - } + mMouseUpSignal( this, getValueF32() ); + handled = TRUE; make_ui_sound("UISndClickRelease"); } @@ -191,10 +182,7 @@ BOOL LLSlider::handleMouseDown(S32 x, S32 y, MASK mask) { setFocus(TRUE); } - if( mMouseDownCallback ) - { - mMouseDownCallback( this, mCallbackUserData ); - } + mMouseDownSignal( this, getValueF32() ); if (MASK_CONTROL & mask) // if CTRL is modifying { @@ -257,8 +245,8 @@ void LLSlider::draw() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); F32 opacity = getEnabled() ? 1.f : 0.3f; - LLColor4 center_color = (mThumbCenterColor % opacity); - LLColor4 track_color = (mTrackColor % opacity); + LLColor4 center_color = (mThumbCenterColor.get() % opacity); + LLColor4 track_color = (mTrackColor.get() % opacity); // Track LLRect track_rect(mThumbImage->getWidth() / 2, @@ -273,7 +261,7 @@ void LLSlider::draw() if( hasMouseCapture() ) { // Show ghost where thumb was before dragging began. - mThumbImage->draw(mDragStartThumbRect, mThumbCenterColor % 0.3f); + mThumbImage->draw(mDragStartThumbRect, mThumbCenterColor.get() % 0.3f); } if (hasFocus()) { @@ -281,61 +269,7 @@ void LLSlider::draw() mThumbImage->drawBorder(mThumbRect, gFocusMgr.getFocusColor(), gFocusMgr.getFocusFlashWidth()); } // Fill in the thumb. - mThumbImage->draw(mThumbRect, hasMouseCapture() ? mThumbOutlineColor : center_color); + mThumbImage->draw(mThumbRect, hasMouseCapture() ? mThumbOutlineColor.get() : center_color); LLUICtrl::draw(); } - -// virtual -LLXMLNodePtr LLSlider::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - node->createChild("initial_val", TRUE)->setFloatValue(getInitialValue()); - node->createChild("min_val", TRUE)->setFloatValue(getMinValue()); - node->createChild("max_val", TRUE)->setFloatValue(getMaxValue()); - node->createChild("increment", TRUE)->setFloatValue(getIncrement()); - node->createChild("volume", TRUE)->setBoolValue(mVolumeSlider); - - return node; -} - - -//static -LLView* LLSlider::fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory) -{ - std::string name("slider_bar"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - F32 initial_value = 0.f; - node->getAttributeF32("initial_val", initial_value); - - F32 min_value = 0.f; - node->getAttributeF32("min_val", min_value); - - F32 max_value = 1.f; - node->getAttributeF32("max_val", max_value); - - F32 increment = 0.1f; - node->getAttributeF32("increment", increment); - - BOOL volume = node->hasName("volume_slider") ? TRUE : FALSE; - node->getAttributeBOOL("volume", volume); - - LLSlider* slider = new LLSlider(name, - rect, - NULL, - NULL, - initial_value, - min_value, - max_value, - increment, - volume); - - slider->initFromXML(node, parent); - - return slider; -} diff --git a/indra/llui/llslider.h b/indra/llui/llslider.h index 154685fac19d7f479ffabb091febaf34f121191d..39c55afd8cd57a8eb207c83e61d43f910093afb9 100644 --- a/indra/llui/llslider.h +++ b/indra/llui/llslider.h @@ -33,47 +33,42 @@ #ifndef LL_LLSLIDER_H #define LL_LLSLIDER_H -#include "lluictrl.h" +#include "llf32uictrl.h" #include "v4color.h" class LLImageGL; -class LLSlider : public LLUICtrl +class LLSlider : public LLF32UICtrl { public: - LLSlider( - const std::string& name, - const LLRect& rect, - void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), - void* callback_userdata, - F32 initial_value, - F32 min_value, - F32 max_value, - F32 increment, - BOOL volume, //TODO: create a "volume" slider sub-class or just use image art, no? -MG - const std::string& control_name = LLStringUtil::null ); + struct Params : public LLInitParam::Block<Params, LLF32UICtrl::Params> + { + Optional<LLUIColor> track_color, + thumb_outline_color, + thumb_center_color; - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); + Optional<LLUIImage*> thumb_image, + track_image, + track_highlight_image; - void setValue( F32 value, BOOL from_event = FALSE ); - F32 getValueF32() const { return mValue; } + Optional<CommitCallbackParam> mouse_down_callback, + mouse_up_callback; - virtual void setValue(const LLSD& value ) { setValue((F32)value.asReal(), TRUE); } - virtual LLSD getValue() const { return LLSD(getValueF32()); } - virtual void setMinValue(LLSD min_value) { setMinValue((F32)min_value.asReal()); } - virtual void setMaxValue(LLSD max_value) { setMaxValue((F32)max_value.asReal()); } + Params(); + }; +protected: + LLSlider(const Params&); + friend class LLUICtrlFactory; +public: + void setValue( F32 value, BOOL from_event = FALSE ); + // overrides for LLF32UICtrl methods + virtual void setValue(const LLSD& value ) { setValue((F32)value.asReal(), TRUE); } + virtual void setMinValue(F32 min_value) { LLF32UICtrl::setMinValue(min_value); updateThumbRect(); } + virtual void setMaxValue(F32 max_value) { LLF32UICtrl::setMaxValue(max_value); updateThumbRect(); } - F32 getInitialValue() const { return mInitialValue; } - F32 getMinValue() const { return mMinValue; } - F32 getMaxValue() const { return mMaxValue; } - F32 getIncrement() const { return mIncrement; } - void setMinValue(F32 min_value) {mMinValue = min_value; updateThumbRect(); } - void setMaxValue(F32 max_value) {mMaxValue = max_value; updateThumbRect(); } - void setIncrement(F32 increment) {mIncrement = increment;} - void setMouseDownCallback( void (*cb)(LLUICtrl* ctrl, void* userdata) ) { mMouseDownCallback = cb; } - void setMouseUpCallback( void (*cb)(LLUICtrl* ctrl, void* userdata) ) { mMouseUpCallback = cb; } + boost::signals::connection setMouseDownCallback( const commit_signal_t::slot_type& cb ) { return mMouseDownSignal.connect(cb); } + boost::signals::connection setMouseUpCallback( const commit_signal_t::slot_type& cb ) { return mMouseUpSignal.connect(cb); } virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -85,12 +80,6 @@ private: void setValueAndCommit(F32 value); void updateThumbRect(); - F32 mValue; - F32 mInitialValue; - F32 mMinValue; - F32 mMaxValue; - F32 mIncrement; - BOOL mVolumeSlider; S32 mMouseOffset; LLRect mDragStartThumbRect; @@ -100,12 +89,12 @@ private: LLUIImage* mTrackHighlightImage; LLRect mThumbRect; - LLColor4 mTrackColor; - LLColor4 mThumbOutlineColor; - LLColor4 mThumbCenterColor; + LLUIColor mTrackColor; + LLUIColor mThumbOutlineColor; + LLUIColor mThumbCenterColor; - void (*mMouseDownCallback)(LLUICtrl* ctrl, void* userdata); - void (*mMouseUpCallback)(LLUICtrl* ctrl, void* userdata); + commit_signal_t mMouseDownSignal; + commit_signal_t mMouseUpSignal; }; #endif // LL_LLSLIDER_H diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index 31baddd7ccd3002eb5e380f426ee69b3c45bb557..de2c9759b758a6d2319cb8da23b6f82f563a60d2 100644 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -49,84 +49,103 @@ #include "llcontrol.h" #include "llfocusmgr.h" #include "llresmgr.h" +#include "lluictrlfactory.h" const U32 MAX_STRING_LENGTH = 10; -static LLRegisterWidget<LLSliderCtrl> r("slider"); - -LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect, - const std::string& label, - const LLFontGL* font, - S32 label_width, - S32 text_left, - BOOL show_text, - BOOL can_edit_text, - BOOL volume, - void (*commit_callback)(LLUICtrl*, void*), - void* callback_user_data, - F32 initial_value, F32 min_value, F32 max_value, F32 increment, - const std::string& control_which) - : LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data ), - mFont(font), - mShowText( show_text ), - mCanEditText( can_edit_text ), - mVolumeSlider( volume ), - mPrecision( 3 ), - mLabelBox( NULL ), - mLabelWidth( label_width ), - mValue( initial_value ), - mEditor( NULL ), - mTextBox( NULL ), - mTextEnabledColor( LLUI::sColorsGroup->getColor( "LabelTextColor" ) ), - mTextDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ), - mSliderMouseUpCallback( NULL ), - mSliderMouseDownCallback( NULL ) +static LLDefaultWidgetRegistry::Register<LLSliderCtrl> r("slider"); + +LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p) +: LLF32UICtrl(p), + mLabelBox( NULL ), + mEditor( NULL ), + mTextBox( NULL ), + mFont(p.font), + mShowText(p.show_text), + mCanEditText(p.can_edit_text), + mPrecision(p.decimal_digits), + mTextEnabledColor(p.text_color()), + mTextDisabledColor(p.text_disabled_color()) { S32 top = getRect().getHeight(); S32 bottom = 0; S32 left = 0; + S32 label_width = p.label_width; + S32 text_width = p.text_width; + // Label - if( !label.empty() ) + if( !p.label().empty() ) { - if (label_width == 0) + if (!p.label_width.isProvided()) { - label_width = font->getWidth(label); + label_width = p.font()->getWidth(p.label); } LLRect label_rect( left, top, label_width, bottom ); - mLabelBox = new LLTextBox( std::string("SliderCtrl Label"), label_rect, label, font ); + LLTextBox::Params params(p.slider_label); + params.rect.setIfNotProvided(label_rect); + params.font.setIfNotProvided(p.font); + params.text(p.label); + mLabelBox = LLUICtrlFactory::create<LLTextBox> (params); addChild(mLabelBox); } + if (p.show_text && !p.text_width.isProvided()) + { + // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) + if ( p.max_value ) + text_width = p.font()->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( p.max_value ) ) + p.decimal_digits + 1 ); + + if ( p.increment < 1.0f ) + text_width += p.font()->getWidth(std::string(".")); // (mostly) take account of decimal point in value + + if ( p.min_value < 0.0f || p.max_value < 0.0f ) + text_width += p.font()->getWidth(std::string("-")); // (mostly) take account of minus sign + + // padding to make things look nicer + text_width += 8; + } + + + S32 text_left = getRect().getWidth() - text_width; + static LLUICachedControl<S32> sliderctrl_spacing ("UISliderctrlSpacing", 0); + S32 slider_right = getRect().getWidth(); - if( show_text ) + if( p.show_text ) { - slider_right = text_left - SLIDERCTRL_SPACING; + slider_right = text_left - sliderctrl_spacing; } - S32 slider_left = label_width ? label_width + SLIDERCTRL_SPACING : 0; - LLRect slider_rect( slider_left, top, slider_right, bottom ); - mSlider = new LLSlider(std::string("slider"), - slider_rect, - LLSliderCtrl::onSliderCommit, this, - initial_value, min_value, max_value, increment, volume, - control_which ); + S32 slider_left = label_width ? label_width + sliderctrl_spacing : 0; + LLSlider::Params slider_p(p.slider_bar); + slider_p.name("slider_bar"); + slider_p.rect.setIfNotProvided(LLRect(slider_left,top,slider_right,bottom)); + slider_p.initial_value.setIfNotProvided(p.initial_value().asReal()); + slider_p.min_value.setIfNotProvided(p.min_value); + slider_p.max_value.setIfNotProvided(p.max_value); + slider_p.increment.setIfNotProvided(p.increment); + + slider_p.commit_callback.function(&LLSliderCtrl::onSliderCommit); + slider_p.control_name(p.control_name); + slider_p.mouse_down_callback( p.mouse_down_callback ); + slider_p.mouse_up_callback( p.mouse_up_callback ); + mSlider = LLUICtrlFactory::create<LLSlider> (slider_p); + addChild( mSlider ); - if( show_text ) + if( p.show_text() ) { LLRect text_rect( text_left, top, getRect().getWidth(), bottom ); - if( can_edit_text ) + if( p.can_edit_text() ) { - mEditor = new LLLineEditor( std::string("SliderCtrl Editor"), text_rect, - LLStringUtil::null, font, - MAX_STRING_LENGTH, - &LLSliderCtrl::onEditorCommit, NULL, NULL, this, - &LLLineEditor::prevalidateFloat ); - mEditor->setFollowsLeft(); - mEditor->setFollowsBottom(); + LLLineEditor::Params line_p(p.value_editor); + line_p.rect.setIfNotProvided(text_rect); + line_p.font.setIfNotProvided(p.font); + line_p.commit_callback.function(&LLSliderCtrl::onEditorCommit); + line_p.prevalidate_callback(&LLLineEditor::prevalidateFloat); + mEditor = LLUICtrlFactory::create<LLLineEditor>(line_p); + mEditor->setFocusReceivedCallback( &LLSliderCtrl::onEditorGainFocus, this ); - mEditor->setIgnoreTab(TRUE); // don't do this, as selecting the entire text is single clicking in some cases // and double clicking in others //mEditor->setSelectAllonFocusReceived(TRUE); @@ -134,9 +153,10 @@ LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect, } else { - mTextBox = new LLTextBox( std::string("SliderCtrl Text"), text_rect, LLStringUtil::null, font); - mTextBox->setFollowsLeft(); - mTextBox->setFollowsBottom(); + LLTextBox::Params text_p(p.value_text); + text_p.rect.setIfNotProvided(text_rect); + text_p.font.setIfNotProvided(p.font); + mTextBox = LLUICtrlFactory::create<LLTextBox>(text_p); addChild(mTextBox); } } @@ -144,7 +164,6 @@ LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect, updateText(); } - // static void LLSliderCtrl::onEditorGainFocus( LLFocusableElement* caller, void *userdata ) { @@ -179,7 +198,8 @@ BOOL LLSliderCtrl::setLabelArg( const std::string& key, const LLStringExplicit& S32 delta = rect.mRight - prev_right; rect = mSlider->getRect(); S32 left = rect.mLeft + delta; - left = llclamp(left, 0, rect.mRight-SLIDERCTRL_SPACING); + static LLUICachedControl<S32> sliderctrl_spacing ("UISliderctrlSpacing", 0); + left = llclamp(left, 0, rect.mRight - sliderctrl_spacing); rect.mLeft = left; mSlider->setRect(rect); } @@ -224,10 +244,11 @@ void LLSliderCtrl::updateText() } // static -void LLSliderCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) +void LLSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata ) { - LLSliderCtrl* self = (LLSliderCtrl*) userdata; - llassert( caller == self->mEditor ); + LLSliderCtrl* self = dynamic_cast<LLSliderCtrl*>(ctrl->getParent()); + if (!self) + return; BOOL success = FALSE; F32 val = self->mValue; @@ -240,17 +261,9 @@ void LLSliderCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) val = (F32) atof( text.c_str() ); if( self->mSlider->getMinValue() <= val && val <= self->mSlider->getMaxValue() ) { - if( self->mValidateCallback ) + self->setValue( val ); // set the value temporarily so that the callback can retrieve it. + if( self->mValidateSignal( self, val ) ) { - self->setValue( val ); // set the value temporarily so that the callback can retrieve it. - if( self->mValidateCallback( self, self->mCallbackUserData ) ) - { - success = TRUE; - } - } - else - { - self->setValue( val ); success = TRUE; } } @@ -272,26 +285,19 @@ void LLSliderCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) } // static -void LLSliderCtrl::onSliderCommit( LLUICtrl* caller, void *userdata ) +void LLSliderCtrl::onSliderCommit( LLUICtrl* ctrl, const LLSD& userdata ) { - LLSliderCtrl* self = (LLSliderCtrl*) userdata; - llassert( caller == self->mSlider ); + LLSliderCtrl* self = dynamic_cast<LLSliderCtrl*>(ctrl->getParent()); + if (!self) + return; BOOL success = FALSE; F32 saved_val = self->mValue; F32 new_val = self->mSlider->getValueF32(); - if( self->mValidateCallback ) + self->mValue = new_val; // set the value temporarily so that the callback can retrieve it. + if( self->mValidateSignal( self, new_val ) ) { - self->mValue = new_val; // set the value temporarily so that the callback can retrieve it. - if( self->mValidateCallback( self, self->mCallbackUserData ) ) - { - success = TRUE; - } - } - else - { - self->mValue = new_val; success = TRUE; } @@ -316,7 +322,7 @@ void LLSliderCtrl::setEnabled(BOOL b) if( mLabelBox ) { - mLabelBox->setColor( b ? mTextEnabledColor : mTextDisabledColor ); + mLabelBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() ); } mSlider->setEnabled( b ); @@ -328,7 +334,7 @@ void LLSliderCtrl::setEnabled(BOOL b) if( mTextBox ) { - mTextBox->setColor( b ? mTextEnabledColor : mTextDisabledColor ); + mTextBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() ); } } @@ -339,7 +345,7 @@ void LLSliderCtrl::setTentative(BOOL b) { mEditor->setTentative(b); } - LLUICtrl::setTentative(b); + LLF32UICtrl::setTentative(b); } @@ -351,8 +357,9 @@ void LLSliderCtrl::onCommit() { mEditor->setTentative(FALSE); } - - LLUICtrl::onCommit(); + + setControlValue(getValueF32()); + LLF32UICtrl::onCommit(); } @@ -368,37 +375,14 @@ void LLSliderCtrl::setPrecision(S32 precision) updateText(); } -void LLSliderCtrl::setSliderMouseDownCallback( void (*slider_mousedown_callback)(LLUICtrl* caller, void* userdata) ) -{ - mSliderMouseDownCallback = slider_mousedown_callback; - mSlider->setMouseDownCallback( LLSliderCtrl::onSliderMouseDown ); -} - -// static -void LLSliderCtrl::onSliderMouseDown(LLUICtrl* caller, void* userdata) -{ - LLSliderCtrl* self = (LLSliderCtrl*) userdata; - if( self->mSliderMouseDownCallback ) - { - self->mSliderMouseDownCallback( self, self->mCallbackUserData ); - } -} - - -void LLSliderCtrl::setSliderMouseUpCallback( void (*slider_mouseup_callback)(LLUICtrl* caller, void* userdata) ) +boost::signals::connection LLSliderCtrl::setSliderMouseDownCallback( const commit_signal_t::slot_type& cb ) { - mSliderMouseUpCallback = slider_mouseup_callback; - mSlider->setMouseUpCallback( LLSliderCtrl::onSliderMouseUp ); + return mSlider->setMouseDownCallback( cb ); } -// static -void LLSliderCtrl::onSliderMouseUp(LLUICtrl* caller, void* userdata) +boost::signals::connection LLSliderCtrl::setSliderMouseUpCallback( const commit_signal_t::slot_type& cb ) { - LLSliderCtrl* self = (LLSliderCtrl*) userdata; - if( self->mSliderMouseUpCallback ) - { - self->mSliderMouseUpCallback( self, self->mCallbackUserData ); - } + return mSlider->setMouseUpCallback( cb ); } void LLSliderCtrl::onTabInto() @@ -414,131 +398,4 @@ void LLSliderCtrl::reportInvalidData() make_ui_sound("UISndBadKeystroke"); } -// virtual -LLXMLNodePtr LLSliderCtrl::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - node->createChild("show_text", TRUE)->setBoolValue(mShowText); - node->createChild("can_edit_text", TRUE)->setBoolValue(mCanEditText); - - node->createChild("volume", TRUE)->setBoolValue(mVolumeSlider); - - node->createChild("decimal_digits", TRUE)->setIntValue(mPrecision); - - if (mLabelBox) - { - node->createChild("label", TRUE)->setStringValue(mLabelBox->getText()); - } - - // TomY TODO: Do we really want to export the transient state of the slider? - node->createChild("value", TRUE)->setFloatValue(mValue); - - if (mSlider) - { - node->createChild("initial_val", TRUE)->setFloatValue(mSlider->getInitialValue()); - node->createChild("min_val", TRUE)->setFloatValue(mSlider->getMinValue()); - node->createChild("max_val", TRUE)->setFloatValue(mSlider->getMaxValue()); - node->createChild("increment", TRUE)->setFloatValue(mSlider->getIncrement()); - } - addColorXML(node, mTextEnabledColor, "text_enabled_color", "LabelTextColor"); - addColorXML(node, mTextDisabledColor, "text_disabled_color", "LabelDisabledColor"); - - return node; -} - -LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("slider"); - node->getAttributeString("name", name); - - std::string label; - node->getAttributeString("label", label); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - LLFontGL* font = LLView::selectFont(node); - - // HACK: Font might not be specified. - if (!font) - { - font = LLFontGL::getFontSansSerifSmall(); - } - - S32 label_width = 0; - node->getAttributeS32("label_width", label_width); - - BOOL show_text = TRUE; - node->getAttributeBOOL("show_text", show_text); - - BOOL can_edit_text = FALSE; - node->getAttributeBOOL("can_edit_text", can_edit_text); - - BOOL volume = FALSE; - node->getAttributeBOOL("volume", volume); - - F32 initial_value = 0.f; - node->getAttributeF32("initial_val", initial_value); - - F32 min_value = 0.f; - node->getAttributeF32("min_val", min_value); - - F32 max_value = 1.f; - node->getAttributeF32("max_val", max_value); - - F32 increment = 0.1f; - node->getAttributeF32("increment", increment); - - U32 precision = 3; - node->getAttributeU32("decimal_digits", precision); - - S32 text_left = 0; - if (show_text) - { - // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) - if ( max_value ) - text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); - - if ( increment < 1.0f ) - text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value - - if ( min_value < 0.0f || max_value < 0.0f ) - text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign - - // padding to make things look nicer - text_left += 8; - } - - LLUICtrlCallback callback = NULL; - - if (label.empty()) - { - label.assign(node->getTextContents()); - } - - LLSliderCtrl* slider = new LLSliderCtrl(name, - rect, - label, - font, - label_width, - rect.getWidth() - text_left, - show_text, - can_edit_text, - volume, - callback, - NULL, - initial_value, - min_value, - max_value, - increment); - - slider->setPrecision(precision); - - slider->initFromXML(node, parent); - - slider->updateText(); - - return slider; -} diff --git a/indra/llui/llsliderctrl.h b/indra/llui/llsliderctrl.h index 272dd7ffd32522fb19a954e4edd57c8dc6891056..0bcb1ccc9b627ca309a479a2ef21da3a5d1625f8 100644 --- a/indra/llui/llsliderctrl.h +++ b/indra/llui/llsliderctrl.h @@ -38,54 +38,71 @@ #include "llslider.h" #include "lltextbox.h" #include "llrect.h" +#include "lllineeditor.h" -// -// Constants -// -const S32 SLIDERCTRL_SPACING = 4; // space between label, slider, and text -const S32 SLIDERCTRL_HEIGHT = 16; - -class LLSliderCtrl : public LLUICtrl +class LLSliderCtrl : public LLF32UICtrl { public: - LLSliderCtrl(const std::string& name, - const LLRect& rect, - const std::string& label, - const LLFontGL* font, - S32 slider_left, - S32 text_left, - BOOL show_text, - BOOL can_edit_text, - BOOL volume, //TODO: create a "volume" slider sub-class or just use image art, no? -MG - void (*commit_callback)(LLUICtrl*, void*), - void* callback_userdata, - F32 initial_value, F32 min_value, F32 max_value, F32 increment, - const std::string& control_which = LLStringUtil::null ); - + struct Params : public LLInitParam::Block<Params, LLF32UICtrl::Params> + { + Optional<S32> label_width; + Optional<S32> text_width; + Optional<bool> show_text; + Optional<bool> can_edit_text; + Optional<bool> is_volume_slider; + Optional<S32> decimal_digits; + + Optional<LLUIColor> text_color, + text_disabled_color; + + Optional<CommitCallbackParam> mouse_down_callback, + mouse_up_callback; + + Optional<LLSlider::Params> slider_bar; + Optional<LLLineEditor::Params> value_editor; + Optional<LLTextBox::Params> value_text; + Optional<LLTextBox::Params> slider_label; + + Params() + : text_width("text_width"), + label_width("label_width"), + show_text("show_text"), + can_edit_text("can_edit_text"), + is_volume_slider("volume"), + decimal_digits("decimal_digits", 3), + text_color("text_color"), + text_disabled_color("text_disabled_color"), + slider_bar("slider_bar"), + value_editor("value_editor"), + value_text("value_text"), + slider_label("slider_label"), + mouse_down_callback("mouse_down_callback"), + mouse_up_callback("mouse_up_callback") + {} + }; +protected: + LLSliderCtrl(const Params&); + friend class LLUICtrlFactory; +public: virtual ~LLSliderCtrl() {} // Children all cleaned up by default view destructor. - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - - F32 getValueF32() const { return mSlider->getValueF32(); } + /*virtual*/ F32 getValueF32() const { return mSlider->getValueF32(); } void setValue(F32 v, BOOL from_event = FALSE); - virtual void setValue(const LLSD& value) { setValue((F32)value.asReal(), TRUE); } - virtual LLSD getValue() const { return LLSD(getValueF32()); } - virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); - - virtual void setMinValue(LLSD min_value) { setMinValue((F32)min_value.asReal()); } - virtual void setMaxValue(LLSD max_value) { setMaxValue((F32)max_value.asReal()); } + /*virtual*/ void setValue(const LLSD& value) { setValue((F32)value.asReal(), TRUE); } + /*virtual*/ LLSD getValue() const { return LLSD(getValueF32()); } + /*virtual*/ BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); BOOL isMouseHeldDown() const { return mSlider->hasMouseCapture(); } - virtual void setEnabled( BOOL b ); - virtual void clear(); virtual void setPrecision(S32 precision); - void setMinValue(F32 min_value) { mSlider->setMinValue(min_value); updateText(); } - void setMaxValue(F32 max_value) { mSlider->setMaxValue(max_value); updateText(); } - void setIncrement(F32 increment) { mSlider->setIncrement(increment);} + + /*virtual*/ void setEnabled( BOOL b ); + /*virtual*/ void clear(); + /*virtual*/ void setMinValue(F32 min_value) { mSlider->setMinValue(min_value); updateText(); } + /*virtual*/ void setMaxValue(F32 max_value) { mSlider->setMaxValue(max_value); updateText(); } + /*virtual*/ void setIncrement(F32 increment) { mSlider->setIncrement(increment);} F32 getMinValue() { return mSlider->getMinValue(); } F32 getMaxValue() { return mSlider->getMaxValue(); } @@ -94,27 +111,23 @@ public: void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; } - void setSliderMouseDownCallback( void (*slider_mousedown_callback)(LLUICtrl* caller, void* userdata) ); - void setSliderMouseUpCallback( void (*slider_mouseup_callback)(LLUICtrl* caller, void* userdata) ); + boost::signals::connection setSliderMouseDownCallback( const commit_signal_t::slot_type& cb ); + boost::signals::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb ); - virtual void onTabInto(); + /*virtual*/ void onTabInto(); - virtual void setTentative(BOOL b); // marks value as tentative - virtual void onCommit(); // mark not tentative, then commit + /*virtual*/ void setTentative(BOOL b); // marks value as tentative + /*virtual*/ void onCommit(); // mark not tentative, then commit - virtual void setControlName(const std::string& control_name, LLView* context) + /*virtual*/ void setControlName(const std::string& control_name, LLView* context) { - LLView::setControlName(control_name, context); + LLUICtrl::setControlName(control_name, context); mSlider->setControlName(control_name, context); } - virtual std::string getControlName() const { return mSlider->getControlName(); } + static void onSliderCommit(LLUICtrl* caller, const LLSD& userdata); - static void onSliderCommit(LLUICtrl* caller, void* userdata); - static void onSliderMouseDown(LLUICtrl* caller,void* userdata); - static void onSliderMouseUp(LLUICtrl* caller,void* userdata); - - static void onEditorCommit(LLUICtrl* caller, void* userdata); + static void onEditorCommit(LLUICtrl* ctrl, const LLSD& userdata); static void onEditorGainFocus(LLFocusableElement* caller, void *userdata); static void onEditorChangeFocus(LLUICtrl* caller, S32 direction, void *userdata); @@ -125,7 +138,6 @@ private: const LLFontGL* mFont; BOOL mShowText; BOOL mCanEditText; - BOOL mVolumeSlider; S32 mPrecision; LLTextBox* mLabelBox; @@ -136,11 +148,8 @@ private: class LLLineEditor* mEditor; LLTextBox* mTextBox; - LLColor4 mTextEnabledColor; - LLColor4 mTextDisabledColor; - - void (*mSliderMouseUpCallback)( LLUICtrl* ctrl, void* userdata ); - void (*mSliderMouseDownCallback)( LLUICtrl* ctrl, void* userdata ); + LLUIColor mTextEnabledColor; + LLUIColor mTextDisabledColor; }; #endif // LL_LLSLIDERCTRL_H diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp index c54a2cd1401f0b46b24d93d07496e3dfa309b2be..72329a4b323d05526222b1fe16fb34aed766ad95 100644 --- a/indra/llui/llspinctrl.cpp +++ b/indra/llui/llspinctrl.cpp @@ -49,97 +49,119 @@ #include "llcontrol.h" #include "llfocusmgr.h" #include "llresmgr.h" +#include "lluictrlfactory.h" const U32 MAX_STRING_LENGTH = 32; -static LLRegisterWidget<LLSpinCtrl> r2("spinner"); - -LLSpinCtrl::LLSpinCtrl( const std::string& name, const LLRect& rect, const std::string& label, const LLFontGL* font, - void (*commit_callback)(LLUICtrl*, void*), - void* callback_user_data, - F32 initial_value, F32 min_value, F32 max_value, F32 increment, - const std::string& control_name, - S32 label_width) - : - LLUICtrl(name, rect, TRUE, commit_callback, callback_user_data, FOLLOWS_LEFT | FOLLOWS_TOP ), - mValue( initial_value ), - mInitialValue( initial_value ), - mMaxValue( max_value ), - mMinValue( min_value ), - mIncrement( increment ), - mPrecision( 3 ), - mLabelBox( NULL ), - mTextEnabledColor( LLUI::sColorsGroup->getColor( "LabelTextColor" ) ), - mTextDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ), - mbHasBeenSet( FALSE ) +static LLDefaultWidgetRegistry::Register<LLSpinCtrl> r2("spinner"); + +LLSpinCtrl::Params::Params() +: label_width("label_width"), + decimal_digits("decimal_digits"), + allow_text_entry("allow_text_entry", true), + text_enabled_color("text_enabled_color"), + text_disabled_color("text_disabled_color") +{} + +LLSpinCtrl::LLSpinCtrl(const LLSpinCtrl::Params& p) +: LLF32UICtrl(p), + mLabelBox(NULL), + mbHasBeenSet( FALSE ), + mPrecision(p.decimal_digits), + mTextEnabledColor(p.text_enabled_color()), + mTextDisabledColor(p.text_disabled_color()) { + static LLUICachedControl<S32> spinctrl_spacing ("UISpinctrlSpacing", 0); + static LLUICachedControl<S32> spinctrl_btn_width ("UISpinctrlBtnWidth", 0); + static LLUICachedControl<S32> spinctrl_btn_height ("UISpinctrlBtnHeight", 0); S32 top = getRect().getHeight(); - S32 bottom = top - 2 * SPINCTRL_BTN_HEIGHT; + S32 bottom = top - 2 * spinctrl_btn_height; S32 centered_top = top; S32 centered_bottom = bottom; S32 btn_left = 0; + // reserve space for spinner + S32 label_width = llclamp(p.label_width(), 0, llmax(0, getRect().getWidth() - 40)); // Label - if( !label.empty() ) + if( !p.label().empty() ) { LLRect label_rect( 0, centered_top, label_width, centered_bottom ); - mLabelBox = new LLTextBox( std::string("SpinCtrl Label"), label_rect, label, font ); + LLTextBox::Params params; + params.name("SpinCtrl Label"); + params.rect(label_rect); + params.text(p.label); + if (p.font.isProvided()) + { + params.font(p.font); + } + mLabelBox = LLUICtrlFactory::create<LLTextBox> (params); addChild(mLabelBox); - btn_left += label_rect.mRight + SPINCTRL_SPACING; + btn_left += label_rect.mRight + spinctrl_spacing; } - S32 btn_right = btn_left + SPINCTRL_BTN_WIDTH; + S32 btn_right = btn_left + spinctrl_btn_width; // Spin buttons - LLRect up_rect( btn_left, top, btn_right, top - SPINCTRL_BTN_HEIGHT ); - std::string out_id = "UIImgBtnSpinUpOutUUID"; - std::string in_id = "UIImgBtnSpinUpInUUID"; - mUpBtn = new LLButton(std::string("SpinCtrl Up"), up_rect, - out_id, - in_id, - LLStringUtil::null, - &LLSpinCtrl::onUpBtn, this, LLFontGL::getFontSansSerif() ); - mUpBtn->setFollowsLeft(); - mUpBtn->setFollowsBottom(); - mUpBtn->setHeldDownCallback( &LLSpinCtrl::onUpBtn ); - mUpBtn->setTabStop(FALSE); + LLButton::Params up_button_params; + up_button_params.name(std::string("SpinCtrl Up")); + up_button_params.rect + .left(btn_left) + .top(top) + .right(btn_right) + .height(spinctrl_btn_height); + up_button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM); + up_button_params.image_unselected.name("spin_up_out_blue.tga"); + up_button_params.image_selected.name("spin_up_in_blue.tga"); + up_button_params.click_callback.function(boost::bind(&LLSpinCtrl::onUpBtn, this, _2)); + up_button_params.mouse_held_callback.function(boost::bind(&LLSpinCtrl::onUpBtn, this, _2)); + up_button_params.tab_stop(false); + + mUpBtn = LLUICtrlFactory::create<LLButton>(up_button_params); addChild(mUpBtn); - LLRect down_rect( btn_left, top - SPINCTRL_BTN_HEIGHT, btn_right, bottom ); - out_id = "UIImgBtnSpinDownOutUUID"; - in_id = "UIImgBtnSpinDownInUUID"; - mDownBtn = new LLButton(std::string("SpinCtrl Down"), down_rect, - out_id, - in_id, - LLStringUtil::null, - &LLSpinCtrl::onDownBtn, this, LLFontGL::getFontSansSerif() ); - mDownBtn->setFollowsLeft(); - mDownBtn->setFollowsBottom(); - mDownBtn->setHeldDownCallback( &LLSpinCtrl::onDownBtn ); - mDownBtn->setTabStop(FALSE); + LLRect down_rect( btn_left, top - spinctrl_btn_height, btn_right, bottom ); + + LLButton::Params down_button_params; + down_button_params.name(std::string("SpinCtrl Down")); + down_button_params.rect + .left(btn_left) + .right(btn_right) + .bottom(bottom) + .height(spinctrl_btn_height); + down_button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM); + down_button_params.image_unselected.name("spin_down_out_blue.tga"); + down_button_params.image_selected.name("spin_down_in_blue.tga"); + down_button_params.click_callback.function(boost::bind(&LLSpinCtrl::onDownBtn, this, _2)); + down_button_params.mouse_held_callback.function(boost::bind(&LLSpinCtrl::onDownBtn, this, _2)); + down_button_params.tab_stop(false); + mDownBtn = LLUICtrlFactory::create<LLButton>(down_button_params); addChild(mDownBtn); LLRect editor_rect( btn_right + 1, centered_top, getRect().getWidth(), centered_bottom ); - mEditor = new LLLineEditor( std::string("SpinCtrl Editor"), editor_rect, LLStringUtil::null, font, - MAX_STRING_LENGTH, - &LLSpinCtrl::onEditorCommit, NULL, NULL, this, - &LLLineEditor::prevalidateFloat ); - mEditor->setFollowsLeft(); - mEditor->setFollowsBottom(); + LLLineEditor::Params params; + params.name("SpinCtrl Editor"); + params.rect(editor_rect); + if (p.font.isProvided()) + { + params.font(p.font); + } + params.max_length_bytes(MAX_STRING_LENGTH); + params.commit_callback.function((boost::bind(&LLSpinCtrl::onEditorCommit, this, _2))); + params.prevalidate_callback(&LLLineEditor::prevalidateFloat); + params.follows.flags(FOLLOWS_LEFT | FOLLOWS_BOTTOM); + mEditor = LLUICtrlFactory::create<LLLineEditor> (params); mEditor->setFocusReceivedCallback( &LLSpinCtrl::onEditorGainFocus, this ); //RN: this seems to be a BAD IDEA, as it makes the editor behavior different when it has focus // than when it doesn't. Instead, if you always have to double click to select all the text, // it's easier to understand //mEditor->setSelectAllonFocusReceived(TRUE); - mEditor->setIgnoreTab(TRUE); addChild(mEditor); updateEditor(); setUseBoundingRect( TRUE ); } - F32 clamp_precision(F32 value, S32 decimal_precision) { // pow() isn't perfect @@ -157,69 +179,50 @@ F32 clamp_precision(F32 value, S32 decimal_precision) } -// static -void LLSpinCtrl::onUpBtn( void *userdata ) +void LLSpinCtrl::onUpBtn( const LLSD& data ) { - LLSpinCtrl* self = (LLSpinCtrl*) userdata; - if( self->getEnabled() ) + if( getEnabled() ) { // use getValue()/setValue() to force reload from/to control - F32 val = (F32)self->getValue().asReal() + self->mIncrement; - val = clamp_precision(val, self->mPrecision); - val = llmin( val, self->mMaxValue ); + F32 val = (F32)getValue().asReal() + mIncrement; + val = clamp_precision(val, mPrecision); + val = llmin( val, mMaxValue ); - if( self->mValidateCallback ) - { - F32 saved_val = (F32)self->getValue().asReal(); - self->setValue(val); - if( !self->mValidateCallback( self, self->mCallbackUserData ) ) - { - self->setValue( saved_val ); - self->reportInvalidData(); - self->updateEditor(); - return; - } - } - else + F32 saved_val = (F32)getValue().asReal(); + setValue(val); + if( !mValidateSignal( this, val ) ) { - self->setValue(val); + setValue( saved_val ); + reportInvalidData(); + updateEditor(); + return; } - self->updateEditor(); - self->onCommit(); + updateEditor(); + onCommit(); } } -// static -void LLSpinCtrl::onDownBtn( void *userdata ) +void LLSpinCtrl::onDownBtn( const LLSD& data ) { - LLSpinCtrl* self = (LLSpinCtrl*) userdata; - - if( self->getEnabled() ) + if( getEnabled() ) { - F32 val = (F32)self->getValue().asReal() - self->mIncrement; - val = clamp_precision(val, self->mPrecision); - val = llmax( val, self->mMinValue ); + F32 val = (F32)getValue().asReal() - mIncrement; + val = clamp_precision(val, mPrecision); + val = llmax( val, mMinValue ); - if( self->mValidateCallback ) + F32 saved_val = (F32)getValue().asReal(); + setValue(val); + if( !mValidateSignal( this, val ) ) { - F32 saved_val = (F32)self->getValue().asReal(); - self->setValue(val); - if( !self->mValidateCallback( self, self->mCallbackUserData ) ) - { - self->setValue( saved_val ); - self->reportInvalidData(); - self->updateEditor(); - return; - } - } - else - { - self->setValue(val); + setValue( saved_val ); + reportInvalidData(); + updateEditor(); + return; } - self->updateEditor(); - self->onCommit(); + updateEditor(); + onCommit(); } } @@ -235,10 +238,10 @@ void LLSpinCtrl::onEditorGainFocus( LLFocusableElement* caller, void *userdata ) void LLSpinCtrl::setValue(const LLSD& value ) { F32 v = (F32)value.asReal(); - if (mValue != v || !mbHasBeenSet) + if (getValueF32() != v || !mbHasBeenSet) { mbHasBeenSet = TRUE; - mValue = v; + LLF32UICtrl::setValue(value); if (!mEditor->hasFocus()) { @@ -251,10 +254,10 @@ void LLSpinCtrl::setValue(const LLSD& value ) void LLSpinCtrl::forceSetValue(const LLSD& value ) { F32 v = (F32)value.asReal(); - if (mValue != v || !mbHasBeenSet) + if (getValueF32() != v || !mbHasBeenSet) { mbHasBeenSet = TRUE; - mValue = v; + LLF32UICtrl::setValue(value); updateEditor(); } @@ -286,55 +289,43 @@ void LLSpinCtrl::updateEditor() mEditor->setText( text ); } -void LLSpinCtrl::onEditorCommit( LLUICtrl* caller, void *userdata ) +void LLSpinCtrl::onEditorCommit( const LLSD& data ) { BOOL success = FALSE; - LLSpinCtrl* self = (LLSpinCtrl*) userdata; - llassert( caller == self->mEditor ); - - std::string text = self->mEditor->getText(); + std::string text = mEditor->getText(); if( LLLineEditor::postvalidateFloat( text ) ) { LLLocale locale(LLLocale::USER_LOCALE); F32 val = (F32) atof(text.c_str()); - if (val < self->mMinValue) val = self->mMinValue; - if (val > self->mMaxValue) val = self->mMaxValue; + if (val < mMinValue) val = mMinValue; + if (val > mMaxValue) val = mMaxValue; - if( self->mValidateCallback ) + F32 saved_val = getValueF32(); + setValue(val); + if( mValidateSignal( this, val ) ) { - F32 saved_val = self->mValue; - self->mValue = val; - if( self->mValidateCallback( self, self->mCallbackUserData ) ) - { - success = TRUE; - self->onCommit(); - } - else - { - self->mValue = saved_val; - } + success = TRUE; + onCommit(); } else { - self->mValue = val; - self->onCommit(); - success = TRUE; + setValue(saved_val); } } - self->updateEditor(); + updateEditor(); if( !success ) { - self->reportInvalidData(); + reportInvalidData(); } } void LLSpinCtrl::forceEditorCommit() { - onEditorCommit(mEditor, this); + onEditorCommit( LLSD() ); } @@ -348,6 +339,10 @@ void LLSpinCtrl::setEnabled(BOOL b) { LLView::setEnabled( b ); mEditor->setEnabled( b ); + if( mLabelBox ) + { + mLabelBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() ); + } } @@ -368,8 +363,8 @@ BOOL LLSpinCtrl::isMouseHeldDown() const void LLSpinCtrl::onCommit() { setTentative(FALSE); - setControlValue(mValue); - LLUICtrl::onCommit(); + setControlValue(getValueF32()); + LLF32UICtrl::onCommit(); } @@ -414,29 +409,19 @@ void LLSpinCtrl::reportInvalidData() make_ui_sound("UISndBadKeystroke"); } -void LLSpinCtrl::draw() -{ - if( mLabelBox ) - { - mLabelBox->setColor( getEnabled() ? mTextEnabledColor : mTextDisabledColor ); - } - LLUICtrl::draw(); -} - - BOOL LLSpinCtrl::handleScrollWheel(S32 x, S32 y, S32 clicks) { if( clicks > 0 ) { while( clicks-- ) { - LLSpinCtrl::onDownBtn(this); + onDownBtn(getValue()); } } else while( clicks++ ) { - LLSpinCtrl::onUpBtn(this); + onUpBtn(getValue()); } return TRUE; @@ -456,105 +441,15 @@ BOOL LLSpinCtrl::handleKeyHere(KEY key, MASK mask) } if(key == KEY_UP) { - LLSpinCtrl::onUpBtn(this); + onUpBtn(getValue()); return TRUE; } if(key == KEY_DOWN) { - LLSpinCtrl::onDownBtn(this); + onDownBtn(getValue()); return TRUE; } } return FALSE; } -// virtual -LLXMLNodePtr LLSpinCtrl::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - node->createChild("decimal_digits", TRUE)->setIntValue(mPrecision); - - if (mLabelBox) - { - node->createChild("label", TRUE)->setStringValue(mLabelBox->getText()); - - node->createChild("label_width", TRUE)->setIntValue(mLabelBox->getRect().getWidth()); - } - - node->createChild("initial_val", TRUE)->setFloatValue(mInitialValue); - - node->createChild("min_val", TRUE)->setFloatValue(mMinValue); - - node->createChild("max_val", TRUE)->setFloatValue(mMaxValue); - - node->createChild("increment", TRUE)->setFloatValue(mIncrement); - - addColorXML(node, mTextEnabledColor, "text_enabled_color", "LabelTextColor"); - addColorXML(node, mTextDisabledColor, "text_disabled_color", "LabelDisabledColor"); - - return node; -} - -LLView* LLSpinCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("spinner"); - node->getAttributeString("name", name); - - std::string label; - node->getAttributeString("label", label); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - LLFontGL* font = LLView::selectFont(node); - - F32 initial_value = 0.f; - node->getAttributeF32("initial_val", initial_value); - - F32 min_value = 0.f; - node->getAttributeF32("min_val", min_value); - - F32 max_value = 1.f; - node->getAttributeF32("max_val", max_value); - - F32 increment = 0.1f; - node->getAttributeF32("increment", increment); - - U32 precision = 3; - node->getAttributeU32("decimal_digits", precision); - - S32 label_width = llmin(40, rect.getWidth() - 40); - node->getAttributeS32("label_width", label_width); - - BOOL allow_text_entry = TRUE; - node->getAttributeBOOL("allow_text_entry", allow_text_entry); - - LLUICtrlCallback callback = NULL; - - if(label.empty()) - { - label.assign( node->getValue() ); - } - - LLSpinCtrl* spinner = new LLSpinCtrl(name, - rect, - label, - font, - callback, - NULL, - initial_value, - min_value, - max_value, - increment, - LLStringUtil::null, - label_width); - - spinner->setPrecision(precision); - - spinner->initFromXML(node, parent); - spinner->setAllowEdit(allow_text_entry); - - return spinner; -} - diff --git a/indra/llui/llspinctrl.h b/indra/llui/llspinctrl.h index dfd0eb3ac1a7368ee6901d8008c5f3f608682962..eb1a2eb8a7971b914d838fe4e046bcffdea0547a 100644 --- a/indra/llui/llspinctrl.h +++ b/indra/llui/llspinctrl.h @@ -35,62 +35,46 @@ #include "stdtypes.h" -#include "lluictrl.h" +#include "llf32uictrl.h" #include "v4color.h" #include "llrect.h" -// -// Constants -// -const S32 SPINCTRL_BTN_HEIGHT = 8; -const S32 SPINCTRL_BTN_WIDTH = 16; -const S32 SPINCTRL_SPACING = 2; // space between label right and button left -const S32 SPINCTRL_HEIGHT = 2 * SPINCTRL_BTN_HEIGHT; -const S32 SPINCTRL_DEFAULT_LABEL_WIDTH = 10; - class LLSpinCtrl -: public LLUICtrl +: public LLF32UICtrl { public: - LLSpinCtrl(const std::string& name, const LLRect& rect, - const std::string& label, - const LLFontGL* font, - void (*commit_callback)(LLUICtrl*, void*), - void* callback_userdata, - F32 initial_value, F32 min_value, F32 max_value, F32 increment, - const std::string& control_name = std::string(), - S32 label_width = SPINCTRL_DEFAULT_LABEL_WIDTH ); - + struct Params : public LLInitParam::Block<Params, LLF32UICtrl::Params> + { + Optional<S32> label_width; + Optional<U32> decimal_digits; + Optional<bool> allow_text_entry; + + Optional<LLUIColor> text_enabled_color; + Optional<LLUIColor> text_disabled_color; + + Params(); + }; +protected: + LLSpinCtrl(const Params&); + friend class LLUICtrlFactory; +public: virtual ~LLSpinCtrl() {} // Children all cleaned up by default view destructor. - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); - virtual void forceSetValue(const LLSD& value ) ; virtual void setValue(const LLSD& value ); - virtual LLSD getValue() const { return mValue; } - F32 get() const { return (F32)getValue().asReal(); } + F32 get() const { return getValueF32(); } void set(F32 value) { setValue(value); mInitialValue = value; } - virtual void setMinValue(LLSD min_value) { setMinValue((F32)min_value.asReal()); } - virtual void setMaxValue(LLSD max_value) { setMaxValue((F32)max_value.asReal()); } - BOOL isMouseHeldDown() const; virtual void setEnabled( BOOL b ); virtual void setFocus( BOOL b ); virtual void clear(); - virtual BOOL isDirty() const { return( mValue != mInitialValue ); } - virtual void resetDirty() { mInitialValue = mValue; } + virtual BOOL isDirty() const { return( getValueF32() != mInitialValue ); } + virtual void resetDirty() { mInitialValue = getValueF32(); } virtual void setPrecision(S32 precision); - virtual void setMinValue(F32 min) { mMinValue = min; } - virtual void setMaxValue(F32 max) { mMaxValue = max; } - virtual void setIncrement(F32 inc) { mIncrement = inc; } - virtual F32 getMinValue() { return mMinValue ; } - virtual F32 getMaxValue() { return mMaxValue ; } - virtual F32 getIncrement() { return mIncrement ; } void setLabel(const LLStringExplicit& label); void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } @@ -107,31 +91,23 @@ public: virtual BOOL handleScrollWheel(S32 x,S32 y,S32 clicks); virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual void draw(); - - static void onEditorCommit(LLUICtrl* caller, void* userdata); + void onEditorCommit(const LLSD& data); static void onEditorGainFocus(LLFocusableElement* caller, void *userdata); static void onEditorChangeFocus(LLUICtrl* caller, S32 direction, void *userdata); - static void onUpBtn(void *userdata); - static void onDownBtn(void *userdata); + void onUpBtn(const LLSD& data); + void onDownBtn(const LLSD& data); private: void updateEditor(); void reportInvalidData(); - F32 mValue; - F32 mInitialValue; - F32 mMaxValue; - F32 mMinValue; - F32 mIncrement; - S32 mPrecision; class LLTextBox* mLabelBox; class LLLineEditor* mEditor; - LLColor4 mTextEnabledColor; - LLColor4 mTextDisabledColor; + LLUIColor mTextEnabledColor; + LLUIColor mTextDisabledColor; class LLButton* mUpBtn; class LLButton* mDownBtn; diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bd74b285a7ac83916a689d223e78ff179be256e6 --- /dev/null +++ b/indra/llui/llstatbar.cpp @@ -0,0 +1,293 @@ +/** + * @file llstatbar.cpp + * @brief A little map of the world with network information + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +//#include "llviewerprecompiledheaders.h" +#include "linden_common.h" + +#include "llstatbar.h" + +#include "llmath.h" +#include "llui.h" +#include "llgl.h" +#include "llfontgl.h" + +#include "llstat.h" +#include "lluictrlfactory.h" + +/////////////////////////////////////////////////////////////////////////////////// + +LLStatBar::LLStatBar(const Params& p) + : LLView(p), + mLabel(p.label), + mUnitLabel(p.unit_label), + mMinBar(p.bar_min), + mMaxBar(p.bar_max), + mStatp(LLStat::getStat(p.stat)), + mTickSpacing(p.tick_spacing), + mLabelSpacing(p.label_spacing), + mPrecision(p.precision), + mUpdatesPerSec(p.update_rate), + mPerSec(p.show_per_sec), + mDisplayBar(p.show_bar), + mDisplayHistory(p.show_history), + mDisplayMean(p.show_mean) +{ +} + +BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) +{ + if (mDisplayBar) + { + if (mDisplayHistory) + { + mDisplayBar = FALSE; + mDisplayHistory = FALSE; + } + else + { + mDisplayHistory = TRUE; + } + } + else + { + mDisplayBar = TRUE; + } + + LLView* parent = getParent(); + parent->reshape(parent->getRect().getWidth(), parent->getRect().getHeight(), FALSE); + + return FALSE; +} + +void LLStatBar::draw() +{ + if (!mStatp) + { +// llinfos << "No stats for statistics bar!" << llendl; + return; + } + + // Get the values. + F32 current, min, max, mean; + if (mPerSec) + { + current = mStatp->getCurrentPerSec(); + min = mStatp->getMinPerSec(); + max = mStatp->getMaxPerSec(); + mean = mStatp->getMeanPerSec(); + } + else + { + current = mStatp->getCurrent(); + min = mStatp->getMin(); + max = mStatp->getMax(); + mean = mStatp->getMean(); + } + + + if ((mUpdatesPerSec == 0.f) || (mUpdateTimer.getElapsedTimeF32() > 1.f/mUpdatesPerSec) || (mValue == 0.f)) + { + if (mDisplayMean) + { + mValue = mean; + } + else + { + mValue = current; + } + mUpdateTimer.reset(); + } + + S32 width = getRect().getWidth() - 40; + S32 max_width = width; + S32 bar_top = getRect().getHeight() - 15; // 16 pixels from top. + S32 bar_height = bar_top - 20; + S32 tick_height = 4; + S32 tick_width = 1; + S32 left, top, right, bottom; + + F32 value_scale = max_width/(mMaxBar - mMinBar); + + LLFontGL::getFontMonospace()->renderUTF8(mLabel, 0, 0, getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f), + LLFontGL::LEFT, LLFontGL::TOP); + + std::string value_format; + std::string value_str; + if (!mUnitLabel.empty()) + { + value_format = llformat( "%%.%df%%s", mPrecision); + value_str = llformat( value_format.c_str(), mValue, mUnitLabel.c_str()); + } + else + { + value_format = llformat( "%%.%df", mPrecision); + value_str = llformat( value_format.c_str(), mValue); + } + + // Draw the value. + LLFontGL::getFontMonospace()->renderUTF8(value_str, 0, width, getRect().getHeight(), + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::RIGHT, LLFontGL::TOP); + + value_format = llformat( "%%.%df", mPrecision); + if (mDisplayBar) + { + std::string tick_label; + + // Draw the tick marks. + F32 tick_value; + top = bar_top; + bottom = bar_top - bar_height - tick_height/2; + + LLGLSUIDefault gls_ui; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + + for (tick_value = mMinBar; tick_value <= mMaxBar; tick_value += mTickSpacing) + { + left = llfloor((tick_value - mMinBar)*value_scale); + right = left + tick_width; + gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.1f)); + } + + // Draw the tick labels (and big ticks). + bottom = bar_top - bar_height - tick_height; + for (tick_value = mMinBar; tick_value <= mMaxBar; tick_value += mLabelSpacing) + { + left = llfloor((tick_value - mMinBar)*value_scale); + right = left + tick_width; + gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f)); + + tick_label = llformat( value_format.c_str(), tick_value); + // draw labels for the tick marks + LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, left - 1, bar_top - bar_height - tick_height, + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::LEFT, LLFontGL::TOP); + } + + // Now, draw the bars + top = bar_top; + bottom = bar_top - bar_height; + + // draw background bar. + left = 0; + right = width; + gl_rect_2d(left, top, right, bottom, LLColor4(0.f, 0.f, 0.f, 0.25f)); + + if (mStatp->getNumValues() == 0) + { + // No data, don't draw anything... + return; + } + // draw min and max + left = (S32) ((min - mMinBar) * value_scale); + + if (left < 0) + { + left = 0; + llwarns << "Min:" << min << llendl; + } + + right = (S32) ((max - mMinBar) * value_scale); + gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 0.f, 0.f, 0.25f)); + + S32 num_values = mStatp->getNumValues() - 1; + if (mDisplayHistory) + { + S32 i; + for (i = 0; i < num_values; i++) + { + if (i == mStatp->getNextBin()) + { + continue; + } + if (mPerSec) + { + left = (S32)((mStatp->getPrevPerSec(i) - mMinBar) * value_scale); + right = (S32)((mStatp->getPrevPerSec(i) - mMinBar) * value_scale) + 1; + gl_rect_2d(left, bottom+i+1, right, bottom+i, LLColor4(1.f, 0.f, 0.f, 1.f)); + } + else + { + left = (S32)((mStatp->getPrev(i) - mMinBar) * value_scale); + right = (S32)((mStatp->getPrev(i) - mMinBar) * value_scale) + 1; + gl_rect_2d(left, bottom+i+1, right, bottom+i, LLColor4(1.f, 0.f, 0.f, 1.f)); + } + } + } + else + { + // draw current + left = (S32) ((current - mMinBar) * value_scale) - 1; + right = (S32) ((current - mMinBar) * value_scale) + 1; + gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 0.f, 0.f, 1.f)); + } + + // draw mean bar + top = bar_top + 2; + bottom = bar_top - bar_height - 2; + left = (S32) ((mean - mMinBar) * value_scale) - 1; + right = (S32) ((mean - mMinBar) * value_scale) + 1; + gl_rect_2d(left, top, right, bottom, LLColor4(0.f, 1.f, 0.f, 1.f)); + } + + LLView::draw(); +} + +void LLStatBar::setRange(F32 bar_min, F32 bar_max, F32 tick_spacing, F32 label_spacing) +{ + mMinBar = bar_min; + mMaxBar = bar_max; + mTickSpacing = tick_spacing; + mLabelSpacing = label_spacing; +} + +LLRect LLStatBar::getRequiredRect() +{ + LLRect rect; + + if (mDisplayBar) + { + if (mDisplayHistory) + { + rect.mTop = 67; + } + else + { + rect.mTop = 40; + } + } + else + { + rect.mTop = 14; + } + return rect; +} diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h new file mode 100644 index 0000000000000000000000000000000000000000..7de782a24f32fc672ce9a4d0b8929cac1e6a1545 --- /dev/null +++ b/indra/llui/llstatbar.h @@ -0,0 +1,108 @@ +/** + * @file llstatbar.h + * @brief A little map of the world with network information + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLSTATBAR_H +#define LL_LLSTATBAR_H + +#include "llview.h" +#include "llframetimer.h" + +class LLStat; + +class LLStatBar : public LLView +{ +public: + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Optional<std::string> label; + Optional<std::string> unit_label; + Optional<F32> bar_min; + Optional<F32> bar_max; + Optional<F32> tick_spacing; + Optional<F32> label_spacing; + Optional<U32> precision; + Optional<F32> update_rate; + Optional<bool> show_per_sec; + Optional<bool> show_bar; + Optional<bool> show_history; + Optional<bool> show_mean; + Optional<std::string> stat; + Params() + : label("label"), + unit_label("unit_label"), + bar_min("bar_min", 0.0f), + bar_max("bar_max", 50.0f), + tick_spacing("tick_spacing", 10.0f), + label_spacing("label_spacing", 10.0f), + precision("precision", 0), + update_rate("update_rate", 5.0f), + show_per_sec("show_per_sec", TRUE), + show_bar("show_bar", TRUE), + show_history("show_history", FALSE), + show_mean("show_mean", TRUE), + stat("stat") + { + follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT); + } + }; + LLStatBar(const Params&); + + virtual void draw(); + virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + + void setStat(LLStat* stat) { mStatp = stat; } + void setRange(F32 bar_min, F32 bar_max, F32 tick_spacing, F32 label_spacing); + void getRange(F32& bar_min, F32& bar_max) { bar_min = mMinBar; bar_max = mMaxBar; } + + /*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options. + +private: + F32 mMinBar; + F32 mMaxBar; + F32 mTickSpacing; + F32 mLabelSpacing; + U32 mPrecision; + F32 mUpdatesPerSec; + BOOL mPerSec; // Use the per sec stats. + BOOL mDisplayBar; // Display the bar graph. + BOOL mDisplayHistory; + BOOL mDisplayMean; // If true, display mean, if false, display current value + + LLStat* mStatp; + + LLFrameTimer mUpdateTimer; + LLUIString mLabel; + std::string mUnitLabel; + F32 mValue; +}; + +#endif diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3bd2c9f9e7f3889977051002e605f116abd5aa2b --- /dev/null +++ b/indra/llui/llstatgraph.cpp @@ -0,0 +1,163 @@ +/** + * @file llstatgraph.cpp + * @brief Simpler compact stat graph with tooltip + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +//#include "llviewerprecompiledheaders.h" +#include "linden_common.h" + +#include "llstatgraph.h" +#include "llrender.h" + +#include "llmath.h" +#include "llui.h" +#include "llstat.h" +#include "llgl.h" +#include "llglheaders.h" +//#include "llviewercontrol.h" + +/////////////////////////////////////////////////////////////////////////////////// + +LLStatGraph::LLStatGraph(const LLView::Params& p) +: LLView(p) +{ + mStatp = NULL; + setToolTip(p.name()); + mNumThresholds = 3; + mThresholdColors[0] = LLColor4(0.f, 1.f, 0.f, 1.f); + mThresholdColors[1] = LLColor4(1.f, 1.f, 0.f, 1.f); + mThresholdColors[2] = LLColor4(1.f, 0.f, 0.f, 1.f); + mThresholdColors[3] = LLColor4(1.f, 0.f, 0.f, 1.f); + mThresholds[0] = 50.f; + mThresholds[1] = 75.f; + mThresholds[2] = 100.f; + mMin = 0.f; + mMax = 125.f; + mPerSec = TRUE; + mValue = 0.f; + mPrecision = 0; +} + +void LLStatGraph::draw() +{ + F32 range, frac; + range = mMax - mMin; + if (mStatp) + { + if (mPerSec) + { + mValue = mStatp->getMeanPerSec(); + } + else + { + mValue = mStatp->getMean(); + } + } + frac = (mValue - mMin) / range; + frac = llmax(0.f, frac); + frac = llmin(1.f, frac); + + if (mUpdateTimer.getElapsedTimeF32() > 0.5f) + { + std::string format_str; + std::string tmp_str; + format_str = llformat("%%s%%.%df%%s", mPrecision); + tmp_str = llformat(format_str.c_str(), mLabel.c_str(), mValue, mUnits.c_str()); + setToolTip(tmp_str); + + mUpdateTimer.reset(); + } + + LLColor4 color; + + S32 i; + for (i = 0; i < mNumThresholds - 1; i++) + { + if (mThresholds[i] > mValue) + { + break; + } + } + + //gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, + // gSavedSkinSettings.getColor("ColorDropShadow"), + // (S32) gSavedSettings.getF32("DropShadowFloater") ); + + color = LLUI::sSettingGroups["color"]->getColor( "MenuDefaultBgColor" ); + gGL.color4fv(color.mV); + gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, TRUE); + + gGL.color4fv(LLColor4::black.mV); + gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, FALSE); + + color = mThresholdColors[i]; + gGL.color4fv(color.mV); + gl_rect_2d(1, llround(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE); +} + +void LLStatGraph::setValue(const LLSD& value) +{ + mValue = (F32)value.asReal(); +} + +void LLStatGraph::setMin(const F32 min) +{ + mMin = min; +} + +void LLStatGraph::setMax(const F32 max) +{ + mMax = max; +} + +void LLStatGraph::setStat(LLStat *statp) +{ + mStatp = statp; +} + +void LLStatGraph::setLabel(const std::string& label) +{ + mLabel = label; +} + +void LLStatGraph::setUnits(const std::string& units) +{ + mUnits = units; +} + +void LLStatGraph::setPrecision(const S32 precision) +{ + mPrecision = precision; +} + +void LLStatGraph::setThreshold(const S32 i, F32 value) +{ + mThresholds[i] = value; +} diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h new file mode 100644 index 0000000000000000000000000000000000000000..dd38050b1b799d11cd2e68b90f728cfc87e5e245 --- /dev/null +++ b/indra/llui/llstatgraph.h @@ -0,0 +1,76 @@ +/** + * @file llstatgraph.h + * @brief Simpler compact stat graph with tooltip + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLSTATGRAPH_H +#define LL_LLSTATGRAPH_H + +#include "llview.h" +#include "llframetimer.h" +#include "v4color.h" + +class LLStat; + +class LLStatGraph : public LLView +{ +public: + LLStatGraph(const LLView::Params&); + + virtual void draw(); + + void setLabel(const std::string& label); + void setUnits(const std::string& units); + void setPrecision(const S32 precision); + void setStat(LLStat *statp); + void setThreshold(const S32 i, F32 value); + void setMin(const F32 min); + void setMax(const F32 max); + + /*virtual*/ void setValue(const LLSD& value); + + LLStat *mStatp; + BOOL mPerSec; +private: + F32 mValue; + + F32 mMin; + F32 mMax; + LLFrameTimer mUpdateTimer; + std::string mLabel; + std::string mUnits; + S32 mPrecision; // Num of digits of precision after dot + + S32 mNumThresholds; + F32 mThresholds[4]; + LLColor4 mThresholdColors[4]; +}; + +#endif // LL_LLSTATGRAPH_H diff --git a/indra/llui/llstatview.cpp b/indra/llui/llstatview.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6691f16c1e1611a30b09f00b37cad3029a8945d4 --- /dev/null +++ b/indra/llui/llstatview.cpp @@ -0,0 +1,80 @@ +/** + * @file llstatview.cpp + * @brief Container for all statistics info. + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "llstatview.h" + +#include "llerror.h" +#include "llstatbar.h" +#include "llfontgl.h" +#include "llgl.h" +#include "llui.h" + +#include "llstatbar.h" + +LLStatView::LLStatView(const LLStatView::Params& p) +: LLContainerView(p), + mSetting(p.setting) +{ + BOOL isopen = getDisplayChildren(); + if (mSetting.length() > 0) + { + isopen = LLUI::sSettingGroups["config"]->getBOOL(mSetting); + } + setDisplayChildren(isopen); +} + +LLStatView::~LLStatView() +{ + // Children all cleaned up by default view destructor. + if (mSetting.length() > 0) + { + BOOL isopen = getDisplayChildren(); + LLUI::sSettingGroups["config"]->setBOOL(mSetting, isopen); + } +} + + +// widget registrars +struct StatViewRegistry : public LLWidgetRegistry<StatViewRegistry> +{}; + +static StatViewRegistry::Register<LLStatBar> r1("stat_bar"); + + +const widget_registry_t& LLStatView::getChildRegistry() const +{ + return StatViewRegistry::instance(); +} + + diff --git a/indra/llui/llstatview.h b/indra/llui/llstatview.h new file mode 100644 index 0000000000000000000000000000000000000000..20aba7782bd6724532507783fe682afb71139d81 --- /dev/null +++ b/indra/llui/llstatview.h @@ -0,0 +1,66 @@ +/** + * @file llstatview.h + * @brief Container for all statistics info. + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLSTATVIEW_H +#define LL_LLSTATVIEW_H + +#include "llstatbar.h" +#include "llcontainerview.h" +#include <vector> + +class LLStatBar; + +class LLStatView : public LLContainerView +{ +public: + struct Params : public LLInitParam::Block<Params, LLContainerView::Params> + { + Optional<std::string> setting; + Params() + : setting("setting") + { + follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT); + } + }; + ~LLStatView(); + + virtual const widget_registry_t& getChildRegistry() const; + +protected: + LLStatView(const Params&); + friend class LLUICtrlFactory; + +protected: + std::string mSetting; + +}; +#endif // LL_STATVIEW_ diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp index a716cbbaec11dc835e2dca531530ff3fe41d0966..432d54dfee7f4f34c4b9e5fc51485610f43e2219 100644 --- a/indra/llui/llstyle.cpp +++ b/indra/llui/llstyle.cpp @@ -33,10 +33,11 @@ #include "linden_common.h" #include "llstyle.h" + +#include "llfontgl.h" #include "llstring.h" #include "llui.h" -//#include "llviewerimagelist.h" LLStyle::LLStyle() { @@ -110,7 +111,13 @@ LLStyle &LLStyle::operator=(const LLStyle &rhs) return *this; } +//virtual +const std::string& LLStyle::getFontString() const +{ + return mFontName; +} +//virtual void LLStyle::setFontName(const std::string& fontname) { mFontName = fontname; @@ -118,26 +125,35 @@ void LLStyle::setFontName(const std::string& fontname) std::string fontname_lc = fontname; LLStringUtil::toLower(fontname_lc); - mFontID = LLFONT_OCRA; // default - + // cache the font pointer for speed when rendering text if ((fontname_lc == "sansserif") || (fontname_lc == "sans-serif")) { - mFontID = LLFONT_SANSSERIF; + mFont = LLFontGL::getFontSansSerif(); } else if ((fontname_lc == "serif")) { - mFontID = LLFONT_SMALL; + // *TODO: Do we have a real serif font? + mFont = LLFontGL::getFontMonospace(); } else if ((fontname_lc == "sansserifbig")) { - mFontID = LLFONT_SANSSERIF_BIG; + mFont = LLFontGL::getFontSansSerifBig(); } else if (fontname_lc == "small") { - mFontID = LLFONT_SANSSERIF_SMALL; + mFont = LLFontGL::getFontSansSerifSmall(); + } + else + { + mFont = LLFontGL::getFontMonospace(); } } +//virtual +LLFontGL* LLStyle::getFont() const +{ + return mFont; +} void LLStyle::setLinkHREF(const std::string& href) { @@ -166,7 +182,7 @@ LLUIImagePtr LLStyle::getImage() const void LLStyle::setImage(const LLUUID& src) { - mImagep = LLUI::sImageProvider->getUIImageByID(src); + mImagep = LLUI::getUIImageByID(src); } diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h index 3ad379cdd9f9091f328053fce4bd5b0615e2cc78..890abc7d677458de5bf85b6a57d5135380210632 100644 --- a/indra/llui/llstyle.h +++ b/indra/llui/llstyle.h @@ -34,10 +34,11 @@ #define LL_LLSTYLE_H #include "v4color.h" -#include "llresmgr.h" #include "llfont.h" #include "llui.h" +class LLFontGL; + class LLStyle : public LLRefCount { public: @@ -55,9 +56,9 @@ public: virtual BOOL isVisible() const; virtual void setVisible(BOOL is_visible); - virtual const std::string& getFontString() const { return mFontName; } + virtual const std::string& getFontString() const; virtual void setFontName(const std::string& fontname); - virtual LLFONT_ID getFontID() const { return mFontID; } + virtual LLFontGL* getFont() const; virtual const std::string& getLinkHREF() const { return mLink; } virtual void setLinkHREF(const std::string& href); @@ -107,7 +108,7 @@ private: BOOL mVisible; LLColor4 mColor; std::string mFontName; - LLFONT_ID mFontID; + LLFontGL* mFont; // cached for performance std::string mLink; LLUIImagePtr mImagep; BOOL mIsEmbeddedItem; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index f4169488d4c0bad78da6d189dbd7db9317c754b7..3391b1275c64f1f48a34edb0484e3eb74b72bf08 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -35,73 +35,139 @@ #include "llfocusmgr.h" #include "llbutton.h" #include "llrect.h" -#include "llresmgr.h" #include "llresizehandle.h" #include "lltextbox.h" #include "llcriticaldamp.h" #include "lluictrlfactory.h" -#include "lltabcontainervertical.h" #include "llrender.h" +#include "llfloater.h" + +//---------------------------------------------------------------------------- + +// Implementation Notes: +// - Each tab points to a LLPanel (see LLTabTuple below) +// - When a tab is selected, the validation callback +// (LLUICtrl::mValidateSignal) is called +// - If the validation callback returns true (or none is provided), +// the tab is changed and the commit callback +// (LLUICtrl::mCommitSignal) is called +// - Callbacks pass the LLTabContainer as the control, +// and the NAME of the selected PANEL as the LLSD data + +//---------------------------------------------------------------------------- const F32 SCROLL_STEP_TIME = 0.4f; const F32 SCROLL_DELAY_TIME = 0.5f; -const S32 TAB_PADDING = 15; -const S32 TABCNTR_TAB_MIN_WIDTH = 60; -const S32 TABCNTR_VERT_TAB_MIN_WIDTH = 100; -const S32 TABCNTR_TAB_MAX_WIDTH = 150; -const S32 TABCNTR_TAB_PARTIAL_WIDTH = 12; // When tabs are parially obscured, how much can you still see. -const S32 TABCNTR_TAB_HEIGHT = 16; -const S32 TABCNTR_ARROW_BTN_SIZE = 16; -const S32 TABCNTR_BUTTON_PANEL_OVERLAP = 1; // how many pixels the tab buttons and tab panels overlap. -const S32 TABCNTR_TAB_H_PAD = 4; - -const S32 TABCNTR_CLOSE_BTN_SIZE = 16; -const S32 TABCNTR_HEADER_HEIGHT = LLPANEL_BORDER_WIDTH + TABCNTR_CLOSE_BTN_SIZE; - -const S32 TABCNTRV_CLOSE_BTN_SIZE = 16; -const S32 TABCNTRV_HEADER_HEIGHT = LLPANEL_BORDER_WIDTH + TABCNTRV_CLOSE_BTN_SIZE; -//const S32 TABCNTRV_TAB_WIDTH = 100; -const S32 TABCNTRV_ARROW_BTN_SIZE = 16; -const S32 TABCNTRV_PAD = 0; - -static LLRegisterWidget<LLTabContainer> r("tab_container"); - -LLTabContainer::LLTabContainer(const std::string& name, const LLRect& rect, TabPosition pos, - BOOL bordered, BOOL is_vertical ) - : - LLPanel(name, rect, bordered), + +void LLTabContainer::TabPositions::declareValues() +{ + declare("top", LLTabContainer::TOP); + declare("bottom", LLTabContainer::BOTTOM); + declare("left", LLTabContainer::LEFT); +} + +//---------------------------------------------------------------------------- + +// Structure used to map tab buttons to and from tab panels +class LLTabTuple +{ +public: + LLTabTuple( LLTabContainer* c, LLPanel* p, LLButton* b, LLTextBox* placeholder = NULL) + : + mTabContainer(c), + mTabPanel(p), + mButton(b), + mOldState(FALSE), + mPlaceholderText(placeholder), + mPadding(0) + {} + + LLTabContainer* mTabContainer; + LLPanel* mTabPanel; + LLButton* mButton; + BOOL mOldState; + LLTextBox* mPlaceholderText; + S32 mPadding; +}; + +//---------------------------------------------------------------------------- + +struct LLPlaceHolderPanel : public LLPanel +{ + // create dummy param block to register with "placeholder" nane + struct Params : public LLPanel::Params{}; + LLPlaceHolderPanel(const Params& p) : LLPanel(p) + {} +}; +static LLDefaultWidgetRegistry::Register<LLPlaceHolderPanel> r1("placeholder"); +static LLDefaultWidgetRegistry::Register<LLTabContainer> r2("tab_container"); + +LLTabContainer::Params::Params() +: tab_width("tab_width"), + tab_position("tab_position"), + tab_min_width("tab_min_width"), + tab_max_width("tab_max_width"), + hide_tabs("hide_tabs", false), + tab_top_image_unselected("tab_top_image_unselected"), + tab_top_image_selected("tab_top_image_selected"), + tab_bottom_image_unselected("tab_bottom_image_unselected"), + tab_bottom_image_selected("tab_bottom_image_selected"), + tab_left_image_unselected("tab_left_image_unselected"), + tab_left_image_selected("tab_left_image_selected") +{ + name(std::string("tab_container")); + mouse_opaque = false; +} + +LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) +: LLPanel(p), mCurrentTabIdx(-1), - mNextTabIdx(-1), - mTabsHidden(FALSE), + mTabsHidden(p.hide_tabs), mScrolled(FALSE), mScrollPos(0), mScrollPosPixels(0), mMaxScrollPos(0), - mCloseCallback( NULL ), - mCallbackUserdata( NULL ), mTitleBox(NULL), mTopBorderHeight(LLPANEL_BORDER_WIDTH), - mTabPosition(pos), mLockedTabCount(0), - mMinTabWidth(TABCNTR_TAB_MIN_WIDTH), - mMaxTabWidth(TABCNTR_TAB_MAX_WIDTH), + mMinTabWidth(0), + mMaxTabWidth(p.tab_max_width), mPrevArrowBtn(NULL), mNextArrowBtn(NULL), - mIsVertical(is_vertical), + mIsVertical( p.tab_position == LEFT ), // Horizontal Specific mJumpPrevArrowBtn(NULL), mJumpNextArrowBtn(NULL), - mRightTabBtnOffset(0), - mTotalTabWidth(0) -{ - //RN: HACK to support default min width for legacy vertical tab containers - if (mIsVertical) + mRightTabBtnOffset(p.tab_padding_right), + mTotalTabWidth(0), + mTabPosition(p.tab_position), + mImageTopUnselected(p.tab_top_image_unselected), + mImageTopSelected(p.tab_top_image_selected), + mImageBottomUnselected(p.tab_bottom_image_unselected), + mImageBottomSelected(p.tab_bottom_image_selected), + mImageLeftUnselected(p.tab_left_image_unselected), + mImageLeftSelected(p.tab_left_image_selected) +{ + static LLUICachedControl<S32> tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0); + + mDragAndDropDelayTimer.stop(); + + if (p.tab_width.isProvided()) + { + mMinTabWidth = p.tab_width; + } + else if (!mIsVertical) { - mMinTabWidth = TABCNTR_VERT_TAB_MIN_WIDTH; + mMinTabWidth = p.tab_min_width; } - setMouseOpaque(FALSE); + else + { + // *HACK: support default min width for legacy vertical + // tab containers + mMinTabWidth = tabcntr_vert_tab_min_width; + } + initButtons( ); - mDragAndDropDelayTimer.stop(); } LLTabContainer::~LLTabContainer() @@ -150,16 +216,45 @@ LLView* LLTabContainer::getChildView(const std::string& name, BOOL recurse, BOOL return LLView::getChildView(name, recurse, create_if_missing); } +bool LLTabContainer::addChild(LLView* view, S32 tab_group) +{ + LLPanel* panelp = dynamic_cast<LLPanel*>(view); + + if (panelp) + { + panelp->setSaveToXML(TRUE); + + addTabPanel(TabPanelParams().panel(panelp).label(panelp->getLabel()).is_placeholder(dynamic_cast<LLPlaceHolderPanel*>(view) != NULL)); + return true; + } + else + { + return LLUICtrl::addChild(view, tab_group); + } +} + +BOOL LLTabContainer::postBuild() +{ + selectFirstTab(); + + return TRUE; +} + // virtual void LLTabContainer::draw() { + static LLUICachedControl<S32> tabcntrv_pad ("UITabCntrvPad", 0); + static LLUICachedControl<S32> tabcntrv_arrow_btn_size ("UITabCntrvArrowBtnSize", 0); + static LLUICachedControl<S32> tabcntr_tab_h_pad ("UITabCntrTabHPad", 0); + static LLUICachedControl<S32> tabcntr_arrow_btn_size ("UITabCntrArrowBtnSize", 0); + static LLUICachedControl<S32> tabcntr_tab_partial_width ("UITabCntrTabPartialWidth", 0); S32 target_pixel_scroll = 0; S32 cur_scroll_pos = getScrollPos(); if (cur_scroll_pos > 0) { + S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + tabcntr_arrow_btn_size + tabcntr_arrow_btn_size + 1); if (!mIsVertical) { - S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + TABCNTR_ARROW_BTN_SIZE + TABCNTR_ARROW_BTN_SIZE + 1); for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) { if (cur_scroll_pos == 0) @@ -171,26 +266,10 @@ void LLTabContainer::draw() } // Show part of the tab to the left of what is fully visible - target_pixel_scroll -= TABCNTR_TAB_PARTIAL_WIDTH; + target_pixel_scroll -= tabcntr_tab_partial_width; // clamp so that rightmost tab never leaves right side of screen target_pixel_scroll = llmin(mTotalTabWidth - available_width_with_arrows, target_pixel_scroll); } - else - { - S32 available_height_with_arrows = getRect().getHeight() - getTopBorderHeight() - (LLPANEL_BORDER_WIDTH + TABCNTR_ARROW_BTN_SIZE + TABCNTR_ARROW_BTN_SIZE + 1); - for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) - { - if (cur_scroll_pos==0) - { - break; - } - target_pixel_scroll += (*iter)->mButton->getRect().getHeight(); - cur_scroll_pos--; - } - S32 total_tab_height = (BTN_HEIGHT + TABCNTRV_PAD) * getTabCount() + TABCNTRV_PAD; - // clamp so that the bottom tab never leaves bottom of panel - target_pixel_scroll = llmin(total_tab_height - available_height_with_arrows, target_pixel_scroll); - } } setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLCriticalDamp::getInterpolant(0.08f))); @@ -207,13 +286,13 @@ void LLTabContainer::draw() S32 left = 0, top = 0; if (mIsVertical) { - top = getRect().getHeight() - getTopBorderHeight() - LLPANEL_BORDER_WIDTH - 1 - (has_scroll_arrows ? TABCNTRV_ARROW_BTN_SIZE : 0); + top = getRect().getHeight() - getTopBorderHeight() - LLPANEL_BORDER_WIDTH - 1 - (has_scroll_arrows ? tabcntrv_arrow_btn_size : 0); top += getScrollPosPixels(); } else { // Set the leftmost position of the tab buttons. - left = LLPANEL_BORDER_WIDTH + (has_scroll_arrows ? (TABCNTR_ARROW_BTN_SIZE * 2) : TABCNTR_TAB_H_PAD); + left = LLPANEL_BORDER_WIDTH + (has_scroll_arrows ? (tabcntr_arrow_btn_size * 2) : tabcntr_tab_h_pad); left -= getScrollPosPixels(); } @@ -243,8 +322,8 @@ void LLTabContainer::draw() // ...but clip them. if (mIsVertical) { - clip_rect.mBottom = mNextArrowBtn->getRect().mTop + 3*TABCNTRV_PAD; - clip_rect.mTop = mPrevArrowBtn->getRect().mBottom - 3*TABCNTRV_PAD; + clip_rect.mBottom = mNextArrowBtn->getRect().mTop + 3*tabcntrv_pad; + clip_rect.mTop = mPrevArrowBtn->getRect().mBottom - 3*tabcntrv_pad; } else { @@ -262,7 +341,7 @@ void LLTabContainer::draw() tuple->mButton->translate( left ? left - tuple->mButton->getRect().mLeft : 0, top ? top - tuple->mButton->getRect().mTop : 0 ); - if (top) top -= BTN_HEIGHT + TABCNTRV_PAD; + if (top) top -= BTN_HEIGHT + tabcntrv_pad; if (left) left += tuple->mButton->getRect().getWidth(); if (!mIsVertical) @@ -316,6 +395,7 @@ void LLTabContainer::draw() // virtual BOOL LLTabContainer::handleMouseDown( S32 x, S32 y, MASK mask ) { + static LLUICachedControl<S32> tabcntrv_pad ("UITabCntrvPad", 0); BOOL handled = FALSE; BOOL has_scroll_arrows = (getMaxScrollPos() > 0); @@ -359,9 +439,9 @@ BOOL LLTabContainer::handleMouseDown( S32 x, S32 y, MASK mask ) if (mIsVertical) { tab_rect = LLRect(firsttuple->mButton->getRect().mLeft, - has_scroll_arrows ? mPrevArrowBtn->getRect().mBottom - TABCNTRV_PAD : mPrevArrowBtn->getRect().mTop, + has_scroll_arrows ? mPrevArrowBtn->getRect().mBottom - tabcntrv_pad : mPrevArrowBtn->getRect().mTop, firsttuple->mButton->getRect().mRight, - has_scroll_arrows ? mNextArrowBtn->getRect().mTop + TABCNTRV_PAD : mNextArrowBtn->getRect().mBottom ); + has_scroll_arrows ? mNextArrowBtn->getRect().mTop + tabcntrv_pad : mNextArrowBtn->getRect().mBottom ); } else { @@ -483,6 +563,7 @@ BOOL LLTabContainer::handleMouseUp( S32 x, S32 y, MASK mask ) // virtual BOOL LLTabContainer::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect ) { + static LLUICachedControl<S32> tabcntrv_pad ("UITabCntrvPad", 0); BOOL handled = LLPanel::handleToolTip( x, y, msg, sticky_rect ); if (!handled && getTabCount() > 0) { @@ -493,9 +574,9 @@ BOOL LLTabContainer::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* stic if (mIsVertical) { clip = LLRect(firsttuple->mButton->getRect().mLeft, - has_scroll_arrows ? mPrevArrowBtn->getRect().mBottom - TABCNTRV_PAD : mPrevArrowBtn->getRect().mTop, + has_scroll_arrows ? mPrevArrowBtn->getRect().mBottom - tabcntrv_pad : mPrevArrowBtn->getRect().mTop, firsttuple->mButton->getRect().mRight, - has_scroll_arrows ? mNextArrowBtn->getRect().mTop + TABCNTRV_PAD : mNextArrowBtn->getRect().mBottom ); + has_scroll_arrows ? mNextArrowBtn->getRect().mTop + tabcntrv_pad : mNextArrowBtn->getRect().mBottom ); } else { @@ -616,14 +697,6 @@ BOOL LLTabContainer::handleKeyHere(KEY key, MASK mask) return handled; } -// virtual -LLXMLNodePtr LLTabContainer::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLPanel::getXML(); - node->createChild("tab_position", TRUE)->setStringValue((getTabPosition() == TOP ? "top" : "bottom")); - return node; -} - // virtual BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, EAcceptance *accept, std::string &tooltip) { @@ -676,21 +749,33 @@ BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDrag return LLView::handleDragAndDrop(x, y, mask, drop, type, cargo_data, accept, tooltip); } -void LLTabContainer::addTabPanel(LLPanel* child, - const std::string& label, - BOOL select, - void (*on_tab_clicked)(void*, bool), - void* userdata, - S32 indent, - BOOL placeholder, - eInsertionPoint insertion_point) +void LLTabContainer::addTabPanel(LLPanel* panelp) +{ + addTabPanel(TabPanelParams().panel(panelp)); +} + +void LLTabContainer::addTabPanel(const TabPanelParams& panel) { + LLPanel* child = panel.panel(); + const std::string& label = panel.label.isProvided() + ? panel.label() + : panel.panel()->getLabel(); + BOOL select = panel.select_tab(); + S32 indent = panel.indent(); + BOOL placeholder = panel.is_placeholder; + eInsertionPoint insertion_point = panel.insert_at(); + + static LLUICachedControl<S32> tabcntrv_pad ("UITabCntrvPad", 0); + static LLUICachedControl<S32> tabcntr_button_panel_overlap ("UITabCntrButtonPanelOverlap", 0); + static LLUICachedControl<S32> tabcntr_tab_height ("UITabCntrTabHeight", 0); + static LLUICachedControl<S32> tab_padding ("UITabPadding", 0); if (child->getParent() == this) { // already a child of mine return; } - const LLFontGL* font = LLResMgr::getInstance()->getRes( mIsVertical ? LLFONT_SANSSERIF : LLFONT_SANSSERIF_SMALL ); + const LLFontGL* font = + (mIsVertical ? LLFontGL::getFontSansSerif() : LLFontGL::getFontSansSerifSmall()); // Store the original label for possible xml export. child->setLabel(label); @@ -700,7 +785,7 @@ void LLTabContainer::addTabPanel(LLPanel* child, S32 button_width = mMinTabWidth; if (!mIsVertical) { - button_width = llclamp(font->getWidth(trimmed_label) + TAB_PADDING, mMinTabWidth, mMaxTabWidth); + button_width = llclamp(font->getWidth(trimmed_label) + tab_padding, mMinTabWidth, mMaxTabWidth); } // Tab panel @@ -708,20 +793,20 @@ void LLTabContainer::addTabPanel(LLPanel* child, S32 tab_panel_bottom; if( getTabPosition() == LLTabContainer::TOP ) { - S32 tab_height = mIsVertical ? BTN_HEIGHT : TABCNTR_TAB_HEIGHT; - tab_panel_top = getRect().getHeight() - getTopBorderHeight() - (tab_height - TABCNTR_BUTTON_PANEL_OVERLAP); + S32 tab_height = mIsVertical ? BTN_HEIGHT : tabcntr_tab_height; + tab_panel_top = getRect().getHeight() - getTopBorderHeight() - (tab_height - tabcntr_button_panel_overlap); tab_panel_bottom = LLPANEL_BORDER_WIDTH; } else { tab_panel_top = getRect().getHeight() - getTopBorderHeight(); - tab_panel_bottom = (TABCNTR_TAB_HEIGHT - TABCNTR_BUTTON_PANEL_OVERLAP); // Run to the edge, covering up the border + tab_panel_bottom = (tabcntr_tab_height - tabcntr_button_panel_overlap); // Run to the edge, covering up the border } LLRect tab_panel_rect; if (mIsVertical) { - tab_panel_rect = LLRect(mMinTabWidth + (LLPANEL_BORDER_WIDTH * 2) + TABCNTRV_PAD, + tab_panel_rect = LLRect(mMinTabWidth + (LLPANEL_BORDER_WIDTH * 2) + tabcntrv_pad, getRect().getHeight() - LLPANEL_BORDER_WIDTH, getRect().getWidth() - LLPANEL_BORDER_WIDTH, LLPANEL_BORDER_WIDTH); @@ -744,28 +829,28 @@ void LLTabContainer::addTabPanel(LLPanel* child, // Tab button LLRect btn_rect; // Note: btn_rect.mLeft is just a dummy. Will be updated in draw(). - std::string tab_img; - std::string tab_selected_img; + LLUIImage* tab_img = NULL; + LLUIImage* tab_selected_img = NULL; S32 tab_fudge = 1; // To make new tab art look better, nudge buttons up 1 pel if (mIsVertical) { - btn_rect.setLeftTopAndSize(TABCNTRV_PAD + LLPANEL_BORDER_WIDTH + 2, // JC - Fudge factor - (getRect().getHeight() - getTopBorderHeight() - LLPANEL_BORDER_WIDTH - 1) - ((BTN_HEIGHT + TABCNTRV_PAD) * getTabCount()), + btn_rect.setLeftTopAndSize(tabcntrv_pad + LLPANEL_BORDER_WIDTH + 2, // JC - Fudge factor + (getRect().getHeight() - getTopBorderHeight() - LLPANEL_BORDER_WIDTH - 1) - ((BTN_HEIGHT + tabcntrv_pad) * getTabCount()), mMinTabWidth, BTN_HEIGHT); } else if( getTabPosition() == LLTabContainer::TOP ) { - btn_rect.setLeftTopAndSize( 0, getRect().getHeight() - getTopBorderHeight() + tab_fudge, button_width, TABCNTR_TAB_HEIGHT ); - tab_img = "tab_top_blue.tga"; - tab_selected_img = "tab_top_selected_blue.tga"; + btn_rect.setLeftTopAndSize( 0, getRect().getHeight() - getTopBorderHeight() + tab_fudge, button_width, tabcntr_tab_height ); + tab_img = mImageTopUnselected.get(); + tab_selected_img = mImageTopSelected.get(); } else { - btn_rect.setOriginAndSize( 0, 0 + tab_fudge, button_width, TABCNTR_TAB_HEIGHT ); - tab_img = "tab_bottom_blue.tga"; - tab_selected_img = "tab_bottom_selected_blue.tga"; + btn_rect.setOriginAndSize( 0, 0 + tab_fudge, button_width, tabcntr_tab_height ); + tab_img = mImageBottomUnselected.get(); + tab_selected_img = mImageBottomSelected.get(); } LLTextBox* textbox = NULL; @@ -774,31 +859,38 @@ void LLTabContainer::addTabPanel(LLPanel* child, if (placeholder) { btn_rect.translate(0, -LLBUTTON_V_PAD-2); - textbox = new LLTextBox(trimmed_label, btn_rect, trimmed_label, font); + LLTextBox::Params params; + params.name(trimmed_label); + params.rect(btn_rect); + params.text(trimmed_label); + params.font(font); + textbox = LLUICtrlFactory::create<LLTextBox> (params); - btn = new LLButton(LLStringUtil::null, LLRect(0,0,0,0)); + LLButton::Params p; + p.name(""); + btn = LLUICtrlFactory::create<LLButton>(p); } else { if (mIsVertical) { - btn = new LLButton(std::string("vert tab button"), - btn_rect, - LLStringUtil::null, - LLStringUtil::null, - LLStringUtil::null, - &LLTabContainer::onTabBtn, NULL, - font, - trimmed_label, trimmed_label); - btn->setImages(std::string("tab_left.tga"), std::string("tab_left_selected.tga")); - btn->setScaleImage(TRUE); - btn->setHAlign(LLFontGL::LEFT); - btn->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); - btn->setTabStop(FALSE); + LLButton::Params p; + p.name(std::string("vert tab button")); + p.rect(btn_rect); + p.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT); + p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child)); + p.font(font); + p.label(trimmed_label); + p.image_unselected(mImageLeftUnselected); + p.image_selected(mImageLeftSelected); + p.scale_image(true); + p.font_halign = LLFontGL::LEFT; + p.tab_stop(false); if (indent) { - btn->setLeftHPad(indent); + p.pad_left(indent); } + btn = LLUICtrlFactory::create<LLButton>(p); } else { @@ -806,39 +898,44 @@ void LLTabContainer::addTabPanel(LLPanel* child, tooltip += "\nAlt-Left arrow for previous tab"; tooltip += "\nAlt-Right arrow for next tab"; - btn = new LLButton(std::string(child->getName()) + " tab", - btn_rect, - LLStringUtil::null, LLStringUtil::null, LLStringUtil::null, - &LLTabContainer::onTabBtn, NULL, // set userdata below - font, - trimmed_label, trimmed_label ); - btn->setVisible( FALSE ); - btn->setToolTip( tooltip ); - btn->setScaleImage(TRUE); - btn->setImages(tab_img, tab_selected_img); - + LLButton::Params p; + p.name(std::string(child->getName()) + " tab"); + p.rect(btn_rect); + p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child)); + p.font(font); + p.label(trimmed_label); + p.visible(false); + p.tool_tip(tooltip); + p.scale_image(true); + p.image_unselected(tab_img); + p.image_selected(tab_selected_img); + p.tab_stop(false); // Try to squeeze in a bit more text - btn->setLeftHPad( 4 ); - btn->setRightHPad( 2 ); - btn->setHAlign(LLFontGL::LEFT); - btn->setTabStop(FALSE); + p.pad_left(4); + p.pad_right(2); + p.font_halign = LLFontGL::LEFT; + p.follows.flags = FOLLOWS_LEFT; + p.follows.flags = FOLLOWS_LEFT; + if (indent) { - btn->setLeftHPad(indent); + p.pad_left(indent); } if( getTabPosition() == TOP ) { - btn->setFollowsTop(); + p.follows.flags = p.follows.flags() | FOLLOWS_TOP; } else { - btn->setFollowsBottom(); + p.follows.flags = p.follows.flags() | FOLLOWS_BOTTOM; } + + btn = LLUICtrlFactory::create<LLButton>(p); } } - LLTabTuple* tuple = new LLTabTuple( this, child, btn, on_tab_clicked, userdata, textbox ); + LLTabTuple* tuple = new LLTabTuple( this, child, btn, textbox ); insertTuple( tuple, insertion_point ); if (textbox) @@ -849,12 +946,11 @@ void LLTabContainer::addTabPanel(LLPanel* child, if (btn) { btn->setSaveToXML(false); - btn->setCallbackUserData( tuple ); addChild( btn, 0 ); } if (child) { - addChild(child, 1); + LLUICtrl::addChild(child, 1); } if( select ) @@ -867,11 +963,12 @@ void LLTabContainer::addTabPanel(LLPanel* child, void LLTabContainer::addPlaceholder(LLPanel* child, const std::string& label) { - addTabPanel(child, label, FALSE, NULL, NULL, 0, TRUE); + addTabPanel(TabPanelParams().panel(child).label(label).is_placeholder(true)); } void LLTabContainer::removeTabPanel(LLPanel* child) { + static LLUICachedControl<S32> tabcntrv_pad ("UITabCntrvPad", 0); if (mIsVertical) { // Fix-up button sizes @@ -880,8 +977,8 @@ void LLTabContainer::removeTabPanel(LLPanel* child) { LLTabTuple* tuple = *iter; LLRect rect; - rect.setLeftTopAndSize(TABCNTRV_PAD + LLPANEL_BORDER_WIDTH + 2, // JC - Fudge factor - (getRect().getHeight() - LLPANEL_BORDER_WIDTH - 1) - ((BTN_HEIGHT + TABCNTRV_PAD) * (tab_count)), + rect.setLeftTopAndSize(tabcntrv_pad + LLPANEL_BORDER_WIDTH + 2, // JC - Fudge factor + (getRect().getHeight() - LLPANEL_BORDER_WIDTH - 1) - ((BTN_HEIGHT + tabcntrv_pad) * (tab_count)), mMinTabWidth, BTN_HEIGHT); if (tuple->mPlaceholderText) @@ -1044,7 +1141,7 @@ S32 LLTabContainer::getPanelIndexByTitle(const std::string& title) return -1; } -LLPanel *LLTabContainer::getPanelByName(const std::string& name) +LLPanel* LLTabContainer::getPanelByName(const std::string& name) { for (S32 index = 0 ; index < (S32)mTabList.size(); index++) { @@ -1138,42 +1235,36 @@ BOOL LLTabContainer::selectTabPanel(LLPanel* child) BOOL LLTabContainer::selectTab(S32 which) { - if (which >= getTabCount()) return FALSE; - if (which < 0) return FALSE; - - //if( gFocusMgr.childHasKeyboardFocus( this ) ) - //{ - // gFocusMgr.setKeyboardFocus( NULL ); - //} + if (which >= getTabCount() || which < 0) + return FALSE; LLTabTuple* selected_tuple = getTab(which); if (!selected_tuple) { return FALSE; } + + LLSD cbdata; + if (selected_tuple->mTabPanel) + cbdata = selected_tuple->mTabPanel->getName(); - if (!selected_tuple->mPrecommitChangeCallback) + BOOL res = FALSE; + if( mValidateSignal( this, cbdata ) ) { - return setTab(which); + res = setTab(which); + if (res) + { + mCommitSignal(this, cbdata); + } } - - mNextTabIdx = which; - selected_tuple->mPrecommitChangeCallback(selected_tuple->mUserData, false); - return TRUE; + + return res; } +// private BOOL LLTabContainer::setTab(S32 which) { - if (which == -1) - { - if (mNextTabIdx == -1) - { - return FALSE; - } - which = mNextTabIdx; - mNextTabIdx = -1; - } - + static LLUICachedControl<S32> tabcntr_arrow_btn_size ("UITabCntrArrowBtnSize", 0); LLTabTuple* selected_tuple = getTab(which); if (!selected_tuple) { @@ -1196,7 +1287,7 @@ BOOL LLTabContainer::setTab(S32 which) // RN: this limits tab-stops to active button only, which would require arrow keys to switch tabs tuple->mButton->setTabStop( is_selected ); - if( is_selected && (mIsVertical || (getMaxScrollPos() > 0))) + if (is_selected) { // Make sure selected tab is within scroll region if (mIsVertical) @@ -1212,7 +1303,7 @@ BOOL LLTabContainer::setTab(S32 which) is_visible = FALSE; } } - else + else if (getMaxScrollPos() > 0) { if( i < getScrollPos() ) { @@ -1220,7 +1311,7 @@ BOOL LLTabContainer::setTab(S32 which) } else { - S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + TABCNTR_ARROW_BTN_SIZE + TABCNTR_ARROW_BTN_SIZE + 1); + S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + tabcntr_arrow_btn_size + tabcntr_arrow_btn_size + 1); S32 running_tab_width = tuple->mButton->getRect().getWidth(); S32 j = i - 1; S32 min_scroll_pos = i; @@ -1243,13 +1334,13 @@ BOOL LLTabContainer::setTab(S32 which) } is_visible = TRUE; } + else + { + is_visible = TRUE; + } } i++; } - if( selected_tuple->mOnChangeCallback ) - { - selected_tuple->mOnChangeCallback( selected_tuple->mUserData, false ); - } } if (mIsVertical && getCurrentPanelIndex() >= 0) { @@ -1295,6 +1386,7 @@ void LLTabContainer::setTabPanelFlashing(LLPanel* child, BOOL state ) void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const LLColor4& color) { + static LLUICachedControl<S32> tab_padding ("UITabPadding", 0); LLTabTuple* tuple = getTabByPanel(child); if( tuple ) { @@ -1302,7 +1394,7 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L if (!mIsVertical) { - const LLFontGL* fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); + const LLFontGL* fontp = LLFontGL::getFontSansSerifSmall(); // remove current width from total tab strip width mTotalTabWidth -= tuple->mButton->getRect().getWidth(); @@ -1313,7 +1405,7 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L tuple->mPadding = image_overlay_width; tuple->mButton->setRightHPad(6); - tuple->mButton->reshape(llclamp(fontp->getWidth(tuple->mButton->getLabelSelected()) + TAB_PADDING + tuple->mPadding, mMinTabWidth, mMaxTabWidth), + tuple->mButton->reshape(llclamp(fontp->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth), tuple->mButton->getRect().getHeight()); // add back in button width to total tab strip width mTotalTabWidth += tuple->mButton->getRect().getWidth(); @@ -1352,33 +1444,6 @@ S32 LLTabContainer::getTopBorderHeight() const return mTopBorderHeight; } -void LLTabContainer::setTabChangeCallback(LLPanel* tab, void (*on_tab_clicked)(void*, bool)) -{ - LLTabTuple* tuplep = getTabByPanel(tab); - if (tuplep) - { - tuplep->mOnChangeCallback = on_tab_clicked; - } -} - -void LLTabContainer::setTabPrecommitChangeCallback(LLPanel* tab, void (*on_precommit)(void*, bool)) -{ - LLTabTuple* tuplep = getTabByPanel(tab); - if (tuplep) - { - tuplep->mPrecommitChangeCallback = on_precommit; - } -} - -void LLTabContainer::setTabUserData(LLPanel* tab, void* userdata) -{ - LLTabTuple* tuplep = getTabByPanel(tab); - if (tuplep) - { - tuplep->mUserData = userdata; - } -} - void LLTabContainer::setRightTabBtnOffset(S32 offset) { mNextArrowBtn->translate( -offset - mRightTabBtnOffset, 0 ); @@ -1388,13 +1453,15 @@ void LLTabContainer::setRightTabBtnOffset(S32 offset) void LLTabContainer::setPanelTitle(S32 index, const std::string& title) { + static LLUICachedControl<S32> tab_padding ("UITabPadding", 0); + if (index >= 0 && index < getTabCount()) { LLTabTuple* tuple = getTab(index); LLButton* tab_button = tuple->mButton; - const LLFontGL* fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); + const LLFontGL* fontp = LLFontGL::getFontSansSerifSmall(); mTotalTabWidth -= tab_button->getRect().getWidth(); - tab_button->reshape(llclamp(fontp->getWidth(title) + TAB_PADDING + tuple->mPadding, mMinTabWidth, mMaxTabWidth), tab_button->getRect().getHeight()); + tab_button->reshape(llclamp(fontp->getWidth(title) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth), tab_button->getRect().getHeight()); mTotalTabWidth += tab_button->getRect().getWidth(); tab_button->setLabelSelected(title); tab_button->setLabelUnselected(title); @@ -1403,184 +1470,62 @@ void LLTabContainer::setPanelTitle(S32 index, const std::string& title) } -// static -void LLTabContainer::onTabBtn( void* userdata ) +void LLTabContainer::onTabBtn( const LLSD& data, LLPanel* panel ) { - LLTabTuple* tuple = (LLTabTuple*) userdata; - LLTabContainer* self = tuple->mTabContainer; - self->selectTabPanel( tuple->mTabPanel ); + LLTabTuple* tuple = getTabByPanel(panel); + selectTabPanel( panel ); tuple->mTabPanel->setFocus(TRUE); } -// static -void LLTabContainer::onCloseBtn( void* userdata ) -{ - LLTabContainer* self = (LLTabContainer*) userdata; - if( self->mCloseCallback ) - { - self->mCloseCallback( self->mCallbackUserdata ); - } -} - -// static -void LLTabContainer::onNextBtn( void* userdata ) +void LLTabContainer::onNextBtn( const LLSD& data ) { - // Scroll tabs to the left - LLTabContainer* self = (LLTabContainer*) userdata; - if (!self->mScrolled) + if (!mScrolled) { - self->scrollNext(); + scrollNext(); } - self->mScrolled = FALSE; + mScrolled = FALSE; } -// static -void LLTabContainer::onNextBtnHeld( void* userdata ) +void LLTabContainer::onNextBtnHeld( const LLSD& data ) { - LLTabContainer* self = (LLTabContainer*) userdata; - if (self->mScrollTimer.getElapsedTimeF32() > SCROLL_STEP_TIME) + if (mScrollTimer.getElapsedTimeF32() > SCROLL_STEP_TIME) { - self->mScrollTimer.reset(); - self->scrollNext(); - self->mScrolled = TRUE; + mScrollTimer.reset(); + scrollNext(); + mScrolled = TRUE; } } -// static -void LLTabContainer::onPrevBtn( void* userdata ) +void LLTabContainer::onPrevBtn( const LLSD& data ) { - LLTabContainer* self = (LLTabContainer*) userdata; - if (!self->mScrolled) + if (!mScrolled) { - self->scrollPrev(); + scrollPrev(); } - self->mScrolled = FALSE; + mScrolled = FALSE; } -// static -void LLTabContainer::onJumpFirstBtn( void* userdata ) +void LLTabContainer::onJumpFirstBtn( const LLSD& data ) { - LLTabContainer* self = (LLTabContainer*) userdata; - self->mScrollPos = 0; + mScrollPos = 0; } -// static -void LLTabContainer::onJumpLastBtn( void* userdata ) +void LLTabContainer::onJumpLastBtn( const LLSD& data ) { - LLTabContainer* self = (LLTabContainer*) userdata; - self->mScrollPos = self->mMaxScrollPos; + mScrollPos = mMaxScrollPos; } -// static -void LLTabContainer::onPrevBtnHeld( void* userdata ) +void LLTabContainer::onPrevBtnHeld( const LLSD& data ) { - LLTabContainer* self = (LLTabContainer*) userdata; - if (self->mScrollTimer.getElapsedTimeF32() > SCROLL_STEP_TIME) + if (mScrollTimer.getElapsedTimeF32() > SCROLL_STEP_TIME) { - self->mScrollTimer.reset(); - self->scrollPrev(); - self->mScrolled = TRUE; + mScrollTimer.reset(); + scrollPrev(); + mScrolled = TRUE; } } -// static -LLView* LLTabContainer::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("tab_container"); - node->getAttributeString("name", name); - - // Figure out if we are creating a vertical or horizontal tab container. - bool is_vertical = false; - LLTabContainer::TabPosition tab_position = LLTabContainer::TOP; - if (node->hasAttribute("tab_position")) - { - std::string tab_position_string; - node->getAttributeString("tab_position", tab_position_string); - LLStringUtil::toLower(tab_position_string); - - if ("top" == tab_position_string) - { - tab_position = LLTabContainer::TOP; - is_vertical = false; - } - else if ("bottom" == tab_position_string) - { - tab_position = LLTabContainer::BOTTOM; - is_vertical = false; - } - else if ("left" == tab_position_string) - { - is_vertical = true; - } - } - BOOL border = FALSE; - node->getAttributeBOOL("border", border); - - LLTabContainer* tab_container = new LLTabContainer(name, LLRect::null, tab_position, border, is_vertical); - - S32 tab_min_width = tab_container->mMinTabWidth; - if (node->hasAttribute("tab_width")) - { - node->getAttributeS32("tab_width", tab_min_width); - } - else if( node->hasAttribute("tab_min_width")) - { - node->getAttributeS32("tab_min_width", tab_min_width); - } - - S32 tab_max_width = tab_container->mMaxTabWidth; - if (node->hasAttribute("tab_max_width")) - { - node->getAttributeS32("tab_max_width", tab_max_width); - } - - tab_container->setMinTabWidth(tab_min_width); - tab_container->setMaxTabWidth(tab_max_width); - - BOOL hidden(tab_container->getTabsHidden()); - node->getAttributeBOOL("hide_tabs", hidden); - tab_container->setTabsHidden(hidden); - - tab_container->setPanelParameters(node, parent); - - if (LLFloater::getFloaterHost()) - { - LLFloater::getFloaterHost()->setTabContainer(tab_container); - } - - //parent->addChild(tab_container); - - // Add all tab panels. - LLXMLNodePtr child; - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) - { - LLView *control = factory->createCtrlWidget(tab_container, child); - if (control && control->isPanel()) - { - LLPanel* panelp = (LLPanel*)control; - std::string label; - child->getAttributeString("label", label); - if (label.empty()) - { - label = panelp->getLabel(); - } - BOOL placeholder = FALSE; - child->getAttributeBOOL("placeholder", placeholder); - tab_container->addTabPanel(panelp, label, false, - NULL, NULL, 0, placeholder); - } - } - - tab_container->selectFirstTab(); - - tab_container->postBuild(); - - tab_container->initButtons(); // now that we have the correct rect - - return tab_container; -} - // private void LLTabContainer::initButtons() @@ -1591,99 +1536,105 @@ void LLTabContainer::initButtons() return; // Don't have a rect yet or already got called } - std::string out_id; - std::string in_id; - if (mIsVertical) { + static LLUICachedControl<S32> tabcntrv_arrow_btn_size ("UITabCntrvArrowBtnSize", 0); // Left and right scroll arrows (for when there are too many tabs to show all at once). S32 btn_top = getRect().getHeight(); - S32 btn_top_lower = getRect().mBottom+TABCNTRV_ARROW_BTN_SIZE; + S32 btn_top_lower = getRect().mBottom+tabcntrv_arrow_btn_size; LLRect up_arrow_btn_rect; - up_arrow_btn_rect.setLeftTopAndSize( mMinTabWidth/2 , btn_top, TABCNTRV_ARROW_BTN_SIZE, TABCNTRV_ARROW_BTN_SIZE ); + up_arrow_btn_rect.setLeftTopAndSize( mMinTabWidth/2 , btn_top, tabcntrv_arrow_btn_size, tabcntrv_arrow_btn_size ); LLRect down_arrow_btn_rect; - down_arrow_btn_rect.setLeftTopAndSize( mMinTabWidth/2 , btn_top_lower, TABCNTRV_ARROW_BTN_SIZE, TABCNTRV_ARROW_BTN_SIZE ); - - out_id = "UIImgBtnScrollUpOutUUID"; - in_id = "UIImgBtnScrollUpInUUID"; - mPrevArrowBtn = new LLButton(std::string("Up Arrow"), up_arrow_btn_rect, - out_id, in_id, LLStringUtil::null, - &onPrevBtn, this, NULL ); - mPrevArrowBtn->setFollowsTop(); - mPrevArrowBtn->setFollowsLeft(); - - out_id = "UIImgBtnScrollDownOutUUID"; - in_id = "UIImgBtnScrollDownInUUID"; - mNextArrowBtn = new LLButton(std::string("Down Arrow"), down_arrow_btn_rect, - out_id, in_id, LLStringUtil::null, - &onNextBtn, this, NULL ); - mNextArrowBtn->setFollowsBottom(); - mNextArrowBtn->setFollowsLeft(); + down_arrow_btn_rect.setLeftTopAndSize( mMinTabWidth/2 , btn_top_lower, tabcntrv_arrow_btn_size, tabcntrv_arrow_btn_size ); + + LLButton::Params prev_btn_params; + prev_btn_params.name(std::string("Up Arrow")); + prev_btn_params.rect(up_arrow_btn_rect); + prev_btn_params.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT); + prev_btn_params.image_unselected.name("scrollbutton_up_out_blue.tga"); + prev_btn_params.image_selected.name("scrollbutton_up_in_blue.tga"); + prev_btn_params.click_callback.function(boost::bind(&LLTabContainer::onPrevBtn, this, _2)); + mPrevArrowBtn = LLUICtrlFactory::create<LLButton>(prev_btn_params); + + LLButton::Params next_btn_params; + next_btn_params.name(std::string("Down Arrow")); + next_btn_params.rect(down_arrow_btn_rect); + next_btn_params.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_LEFT); + next_btn_params.image_unselected.name("scrollbutton_down_out_blue.tga"); + next_btn_params.image_selected.name("scrollbutton_down_in_blue.tga"); + next_btn_params.click_callback.function(boost::bind(&LLTabContainer::onNextBtn, this, _2)); + mNextArrowBtn = LLUICtrlFactory::create<LLButton>(next_btn_params); } else // Horizontal { + static LLUICachedControl<S32> tabcntr_arrow_btn_size ("UITabCntrArrowBtnSize", 0); S32 arrow_fudge = 1; // match new art better - // tabs on bottom reserve room for resize handle (just in case) - if (getTabPosition() == BOTTOM) - { - mRightTabBtnOffset = RESIZE_HANDLE_WIDTH; - } - // Left and right scroll arrows (for when there are too many tabs to show all at once). - S32 btn_top = (getTabPosition() == TOP ) ? getRect().getHeight() - getTopBorderHeight() : TABCNTR_ARROW_BTN_SIZE + 1; + S32 btn_top = (getTabPosition() == TOP ) ? getRect().getHeight() - getTopBorderHeight() : tabcntr_arrow_btn_size + 1; LLRect left_arrow_btn_rect; - left_arrow_btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH+1+TABCNTR_ARROW_BTN_SIZE, btn_top + arrow_fudge, TABCNTR_ARROW_BTN_SIZE, TABCNTR_ARROW_BTN_SIZE ); + left_arrow_btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH+1+tabcntr_arrow_btn_size, btn_top + arrow_fudge, tabcntr_arrow_btn_size, tabcntr_arrow_btn_size ); LLRect jump_left_arrow_btn_rect; - jump_left_arrow_btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH+1, btn_top + arrow_fudge, TABCNTR_ARROW_BTN_SIZE, TABCNTR_ARROW_BTN_SIZE ); + jump_left_arrow_btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH+1, btn_top + arrow_fudge, tabcntr_arrow_btn_size, tabcntr_arrow_btn_size ); - S32 right_pad = TABCNTR_ARROW_BTN_SIZE + LLPANEL_BORDER_WIDTH + 1; + S32 right_pad = tabcntr_arrow_btn_size + LLPANEL_BORDER_WIDTH + 1; LLRect right_arrow_btn_rect; - right_arrow_btn_rect.setLeftTopAndSize( getRect().getWidth() - mRightTabBtnOffset - right_pad - TABCNTR_ARROW_BTN_SIZE, + right_arrow_btn_rect.setLeftTopAndSize( getRect().getWidth() - mRightTabBtnOffset - right_pad - tabcntr_arrow_btn_size, btn_top + arrow_fudge, - TABCNTR_ARROW_BTN_SIZE, TABCNTR_ARROW_BTN_SIZE ); + tabcntr_arrow_btn_size, tabcntr_arrow_btn_size ); LLRect jump_right_arrow_btn_rect; jump_right_arrow_btn_rect.setLeftTopAndSize( getRect().getWidth() - mRightTabBtnOffset - right_pad, btn_top + arrow_fudge, - TABCNTR_ARROW_BTN_SIZE, TABCNTR_ARROW_BTN_SIZE ); - - out_id = "UIImgBtnJumpLeftOutUUID"; - in_id = "UIImgBtnJumpLeftInUUID"; - mJumpPrevArrowBtn = new LLButton(std::string("Jump Left Arrow"), jump_left_arrow_btn_rect, - out_id, in_id, LLStringUtil::null, - &LLTabContainer::onJumpFirstBtn, this, LLFontGL::getFontSansSerif() ); - mJumpPrevArrowBtn->setFollowsLeft(); - - out_id = "UIImgBtnScrollLeftOutUUID"; - in_id = "UIImgBtnScrollLeftInUUID"; - mPrevArrowBtn = new LLButton(std::string("Left Arrow"), left_arrow_btn_rect, - out_id, in_id, LLStringUtil::null, - &LLTabContainer::onPrevBtn, this, LLFontGL::getFontSansSerif() ); - mPrevArrowBtn->setHeldDownCallback(onPrevBtnHeld); - mPrevArrowBtn->setFollowsLeft(); - - out_id = "UIImgBtnJumpRightOutUUID"; - in_id = "UIImgBtnJumpRightInUUID"; - mJumpNextArrowBtn = new LLButton(std::string("Jump Right Arrow"), jump_right_arrow_btn_rect, - out_id, in_id, LLStringUtil::null, - &LLTabContainer::onJumpLastBtn, this, - LLFontGL::getFontSansSerif()); - mJumpNextArrowBtn->setFollowsRight(); - - out_id = "UIImgBtnScrollRightOutUUID"; - in_id = "UIImgBtnScrollRightInUUID"; - mNextArrowBtn = new LLButton(std::string("Right Arrow"), right_arrow_btn_rect, - out_id, in_id, LLStringUtil::null, - &LLTabContainer::onNextBtn, this, - LLFontGL::getFontSansSerif()); - mNextArrowBtn->setFollowsRight(); + tabcntr_arrow_btn_size, tabcntr_arrow_btn_size ); + + LLButton::Params p; + p.name(std::string("Jump Left Arrow")); + p.image_unselected.name("jump_left_out.tga"); + p.image_selected.name("jump_left_in.tga"); + p.click_callback.function(boost::bind(&LLTabContainer::onJumpFirstBtn, this, _2)); + p.rect(jump_left_arrow_btn_rect); + p.follows.flags(FOLLOWS_LEFT); + + mJumpPrevArrowBtn = LLUICtrlFactory::create<LLButton>(p); + + p = LLButton::Params(); + p.name(std::string("Left Arrow")); + p.rect(left_arrow_btn_rect); + p.follows.flags(FOLLOWS_LEFT); + p.image_unselected.name("scrollbutton_left_out_blue.tga"); + p.image_selected.name("scrollbutton_left_in_blue.tga"); + p.click_callback.function(boost::bind(&LLTabContainer::onPrevBtn, this, _2)); + p.mouse_held_callback.function(boost::bind(&LLTabContainer::onPrevBtnHeld, this, _2)); + + mPrevArrowBtn = LLUICtrlFactory::create<LLButton>(p); + + p = LLButton::Params(); + p.name(std::string("Jump Right Arrow")); + p.rect(jump_right_arrow_btn_rect); + p.follows.flags(FOLLOWS_RIGHT); + p.image_unselected.name("jump_right_out.tga"); + p.image_selected.name("jump_right_in.tga"); + p.click_callback.function(boost::bind(&LLTabContainer::onJumpLastBtn, this, _2)); + + mJumpNextArrowBtn = LLUICtrlFactory::create<LLButton>(p); + + p = LLButton::Params(); + p.name(std::string("Right Arrow")); + p.rect(right_arrow_btn_rect); + p.follows.flags(FOLLOWS_RIGHT); + p.image_unselected.name("scrollbutton_right_out_blue.tga"); + p.image_selected.name("scrollbutton_right_in_blue.tga"); + p.click_callback.function(boost::bind(&LLTabContainer::onNextBtn, this, _2)); + p.mouse_held_callback.function(boost::bind(&LLTabContainer::onNextBtnHeld, this, _2)); + + mNextArrowBtn = LLUICtrlFactory::create<LLButton>(p); if( getTabPosition() == TOP ) { @@ -1701,12 +1652,10 @@ void LLTabContainer::initButtons() } } - mPrevArrowBtn->setHeldDownCallback(onPrevBtnHeld); mPrevArrowBtn->setSaveToXML(false); mPrevArrowBtn->setTabStop(FALSE); addChild(mPrevArrowBtn); - mNextArrowBtn->setHeldDownCallback(onNextBtnHeld); mNextArrowBtn->setSaveToXML(false); mNextArrowBtn->setTabStop(FALSE); addChild(mNextArrowBtn); @@ -1729,7 +1678,17 @@ void LLTabContainer::initButtons() setDefaultTabGroup(1); } -LLTabContainer::LLTabTuple* LLTabContainer::getTabByPanel(LLPanel* child) +//this is a work around for the current LLPanel::initFromParams hack +//so that it doesn't overwrite the default tab group. +//will be removed when LLPanel is fixed soon. +void LLTabContainer::initFromParams(const LLPanel::Params& p) +{ + LLPanel::initFromParams(p); + + setDefaultTabGroup(1); +} + +LLTabTuple* LLTabContainer::getTabByPanel(LLPanel* child) { for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) { @@ -1775,14 +1734,16 @@ void LLTabContainer::insertTuple(LLTabTuple * tuple, eInsertionPoint insertion_p void LLTabContainer::updateMaxScrollPos() { + static LLUICachedControl<S32> tabcntrv_pad ("UITabCntrvPad", 0); BOOL no_scroll = TRUE; if (mIsVertical) { - S32 tab_total_height = (BTN_HEIGHT + TABCNTRV_PAD) * getTabCount(); + S32 tab_total_height = (BTN_HEIGHT + tabcntrv_pad) * getTabCount(); S32 available_height = getRect().getHeight() - getTopBorderHeight(); if( tab_total_height > available_height ) { - S32 available_height_with_arrows = getRect().getHeight() - 2*(TABCNTRV_ARROW_BTN_SIZE + 3*TABCNTRV_PAD); + static LLUICachedControl<S32> tabcntrv_arrow_btn_size ("UITabCntrvArrowBtnSize", 0); + S32 available_height_with_arrows = getRect().getHeight() - 2*(tabcntrv_arrow_btn_size + 3*tabcntrv_pad); S32 additional_needed = tab_total_height - available_height_with_arrows; setMaxScrollPos((S32) ceil(additional_needed / float(BTN_HEIGHT) ) ); no_scroll = FALSE; @@ -1790,16 +1751,19 @@ void LLTabContainer::updateMaxScrollPos() } else { + static LLUICachedControl<S32> tabcntr_tab_h_pad ("UITabCntrTabHPad", 0); + static LLUICachedControl<S32> tabcntr_arrow_btn_size ("UITabCntrArrowBtnSize", 0); + static LLUICachedControl<S32> tabcntr_tab_partial_width ("UITabCntrTabPartialWidth", 0); S32 tab_space = 0; S32 available_space = 0; tab_space = mTotalTabWidth; - available_space = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + TABCNTR_TAB_H_PAD); + available_space = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + tabcntr_tab_h_pad); if( tab_space > available_space ) { - S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + TABCNTR_ARROW_BTN_SIZE + TABCNTR_ARROW_BTN_SIZE + 1); + S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + tabcntr_arrow_btn_size + tabcntr_arrow_btn_size + 1); // subtract off reserved portion on left - available_width_with_arrows -= TABCNTR_TAB_PARTIAL_WIDTH; + available_width_with_arrows -= tabcntr_tab_partial_width; S32 running_tab_width = 0; setMaxScrollPos(getTabCount()); diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 8117cdee9baaa63576625da51a7b8dc4b2536e42..ac8232bbb1b587e5533b3b0d4c0fc5c4f73a23b4 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -37,7 +37,7 @@ #include "lltextbox.h" #include "llframetimer.h" -extern const S32 TABCNTR_HEADER_HEIGHT; +class LLTabTuple; class LLTabContainer : public LLPanel { @@ -56,8 +56,38 @@ public: RIGHT_OF_CURRENT } eInsertionPoint; - LLTabContainer( const std::string& name, const LLRect& rect, TabPosition pos, - BOOL bordered, BOOL is_vertical); + struct TabPositions : public LLInitParam::TypeValuesHelper<LLTabContainer::TabPosition, TabPositions> + { + static void declareValues(); + }; + + struct Params + : public LLInitParam::Block<Params, LLPanel::Params> + { + Optional<TabPosition, TabPositions> tab_position; + Optional<S32> tab_width, + tab_min_width, + tab_max_width; + Optional<bool> hide_tabs; + Optional<S32> tab_padding_right; + + Optional<LLUIImage*> tab_top_image_unselected, + tab_top_image_selected, + tab_bottom_image_unselected, + tab_bottom_image_selected, + tab_left_image_unselected, + tab_left_image_selected; + + Params(); + }; + +protected: + LLTabContainer(const Params&); + friend class LLUICtrlFactory; + +public: + //LLTabContainer( const std::string& name, const LLRect& rect, TabPosition pos, + // BOOL bordered, BOOL is_vertical); /*virtual*/ ~LLTabContainer(); @@ -74,17 +104,30 @@ public: /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, EAcceptance* accept, std::string& tooltip); - /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; /*virtual*/ LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; + /*virtual*/ void initFromParams(const LLPanel::Params& p); + /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0); + /*virtual*/ BOOL postBuild(); + + struct TabPanelParams : public LLInitParam::Block<TabPanelParams> + { + Mandatory<LLPanel*> panel; + + Optional<std::string> label; + Optional<bool> select_tab, + is_placeholder; + Optional<S32> indent; + Optional<eInsertionPoint> insert_at; + Optional<void*> user_data; + + TabPanelParams() + : panel("panel", NULL), + insert_at("insert_at", END) + {} + }; - void addTabPanel(LLPanel* child, - const std::string& label, - BOOL select = FALSE, - void (*on_tab_clicked)(void*, bool) = NULL, - void* userdata = NULL, - S32 indent = 0, - BOOL placeholder = FALSE, - eInsertionPoint insertion_point = END); + void addTabPanel(LLPanel* panel); + void addTabPanel(const TabPanelParams& panel); void addPlaceholder(LLPanel* child, const std::string& label); void removeTabPanel( LLPanel* child ); void lockTabs(S32 num_tabs = 0); @@ -108,7 +151,6 @@ public: BOOL selectTabPanel( LLPanel* child ); BOOL selectTab(S32 which); BOOL selectTabByName(const std::string& title); - BOOL setTab(S32 which); BOOL getTabPanelFlashing(LLPanel* child); void setTabPanelFlashing(LLPanel* child, BOOL state); @@ -119,10 +161,6 @@ public: void setTopBorderHeight(S32 height); S32 getTopBorderHeight() const; - void setTabChangeCallback(LLPanel* tab, void (*on_tab_clicked)(void*,bool)); - void setTabPrecommitChangeCallback(LLPanel* tab, void (*on_precommit)(void*, bool)); - void setTabUserData(LLPanel* tab, void* userdata); - void setRightTabBtnOffset( S32 offset ); void setPanelTitle(S32 index, const std::string& title); @@ -134,51 +172,20 @@ public: void startDragAndDropDelayTimer() { mDragAndDropDelayTimer.start(); } - static void onCloseBtn(void* userdata); - static void onTabBtn(void* userdata); - static void onNextBtn(void* userdata); - static void onNextBtnHeld(void* userdata); - static void onPrevBtn(void* userdata); - static void onPrevBtnHeld(void* userdata); - static void onJumpFirstBtn( void* userdata ); - static void onJumpLastBtn( void* userdata ); - - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); + void onTabBtn( const LLSD& data, LLPanel* panel ); + void onNextBtn(const LLSD& data); + void onNextBtnHeld(const LLSD& data); + void onPrevBtn(const LLSD& data); + void onPrevBtnHeld(const LLSD& data); + void onJumpFirstBtn( const LLSD& data ); + void onJumpLastBtn( const LLSD& data ); private: - // Structure used to map tab buttons to and from tab panels - struct LLTabTuple - { - LLTabTuple( LLTabContainer* c, LLPanel* p, LLButton* b, - void (*cb)(void*,bool), void* userdata, LLTextBox* placeholder = NULL, - void (*pcb)(void*,bool) = NULL) - : - mTabContainer(c), - mTabPanel(p), - mButton(b), - mOnChangeCallback( cb ), - mPrecommitChangeCallback( pcb ), - mUserData( userdata ), - mOldState(FALSE), - mPlaceholderText(placeholder), - mPadding(0) - {} - - LLTabContainer* mTabContainer; - LLPanel* mTabPanel; - LLButton* mButton; - void (*mOnChangeCallback)(void*, bool); - void (*mPrecommitChangeCallback)(void*,bool); // Precommit callback gets called before tab is changed and - // can prevent it from being changed. onChangeCallback is called - // immediately after tab is actually changed - Nyx - void* mUserData; - BOOL mOldState; - LLTextBox* mPlaceholderText; - S32 mPadding; - }; void initButtons(); + BOOL setTab(S32 which); + LLTabTuple* getTab(S32 index) { return mTabList[index]; } LLTabTuple* getTabByPanel(LLPanel* child); void insertTuple(LLTabTuple * tuple, eInsertionPoint insertion_point); @@ -207,7 +214,6 @@ private: tuple_list_t mTabList; S32 mCurrentTabIdx; - S32 mNextTabIdx; BOOL mTabsHidden; BOOL mScrolled; @@ -216,9 +222,6 @@ private: S32 mScrollPosPixels; S32 mMaxScrollPos; - void (*mCloseCallback)(void*); - void* mCallbackUserdata; - LLTextBox* mTitleBox; S32 mTopBorderHeight; @@ -240,7 +243,13 @@ private: S32 mTotalTabWidth; LLFrameTimer mDragAndDropDelayTimer; -}; + LLPointer<LLUIImage> mImageTopUnselected; + LLPointer<LLUIImage> mImageTopSelected; + LLPointer<LLUIImage> mImageBottomUnselected; + LLPointer<LLUIImage> mImageBottomSelected; + LLPointer<LLUIImage> mImageLeftUnselected; + LLPointer<LLUIImage> mImageLeftSelected; +}; #endif // LL_TABCONTAINER_H diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 89893bcf8d7828c8d1c9152b2c35a8e294b2fc7d..464e4be80972557733008464c581a88205a5a9d8 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -30,65 +30,66 @@ * $/LicenseInfo$ */ +#define INSTANTIATE_GETCHILD_TEXTBOX + #include "linden_common.h" #include "lltextbox.h" #include "lluictrlfactory.h" #include "llfocusmgr.h" #include "llwindow.h" -static LLRegisterWidget<LLTextBox> r("text"); - -LLTextBox::LLTextBox(const std::string& name, const LLRect& rect, const std::string& text, - const LLFontGL* font, BOOL mouse_opaque) -: LLUICtrl(name, rect, mouse_opaque, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP ), - mFontGL(font ? font : LLFontGL::getFontSansSerifSmall()) -{ - initDefaults(); - setText( text ); - setTabStop(FALSE); -} - -LLTextBox::LLTextBox(const std::string& name, const std::string& text, F32 max_width, - const LLFontGL* font, BOOL mouse_opaque) : - LLUICtrl(name, LLRect(0, 0, 1, 1), mouse_opaque, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), - mFontGL(font ? font : LLFontGL::getFontSansSerifSmall()) -{ - initDefaults(); - setWrappedText(text, max_width); - reshapeToFitText(); - setTabStop(FALSE); -} - -LLTextBox::LLTextBox(const std::string& name_and_label, const LLRect& rect) : - LLUICtrl(name_and_label, rect, TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), - mFontGL(LLFontGL::getFontSansSerifSmall()) -{ - initDefaults(); - setText( name_and_label ); - setTabStop(FALSE); -} - -void LLTextBox::initDefaults() +template LLTextBox* LLView::getChild<LLTextBox>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const; + +static LLDefaultWidgetRegistry::Register<LLTextBox> r("text"); + +LLTextBox::Params::Params() +: text_color("text_color"), + length("length"), + type("type"), + highlight_on_hover("hover", false), + border_visible("border_visible", false), + border_drop_shadow_visible("border_drop_shadow_visible", false), + bg_visible("bg_visible", false), + use_ellipses("use_ellipses"), + word_wrap("word_wrap", false), + drop_shadow_visible("drop_shadow_visible"), + hover_color("hover_color"), + disabled_color("disabled_color"), + background_color("background_color"), + border_color("border_color"), + v_pad("v_pad", 0), + h_pad("h_pad", 0), + line_spacing("line_spacing", 0), + text("text"), + font_shadow("font_shadow", LLFontGL::NO_SHADOW) +{} + +LLTextBox::LLTextBox(const LLTextBox::Params& p) +: LLUICtrl(p), + mFontGL(p.font), + mHoverActive( p.highlight_on_hover ), + mHasHover( FALSE ), + mBackgroundVisible( p.bg_visible ), + mBorderVisible( p.border_visible ), + mShadowType( p.font_shadow ), + mBorderDropShadowVisible( p.border_drop_shadow_visible ), + mUseEllipses( p.use_ellipses ), + mHPad(p.h_pad), + mVPad(p.v_pad), + mVAlign( LLFontGL::TOP ), + mClickedCallback(NULL), + mTextColor(p.text_color()), + mDisabledColor(p.disabled_color()), + mBackgroundColor(p.background_color()), + mBorderColor(p.border_color()), + mHoverColor(p.hover_color()), + mHAlign(p.font_halign), + mLineSpacing(p.line_spacing), + mWordWrap( p.word_wrap ), + mDidWordWrap(FALSE), + mFontStyle(LLFontGL::getStyleFromString(p.font.style)) { - mTextColor = LLUI::sColorsGroup->getColor("LabelTextColor"); - mDisabledColor = LLUI::sColorsGroup->getColor("LabelDisabledColor"); - mBackgroundColor = LLUI::sColorsGroup->getColor("DefaultBackgroundColor"); - mBorderColor = LLUI::sColorsGroup->getColor("DefaultHighlightLight"); - mHoverColor = LLUI::sColorsGroup->getColor( "LabelSelectedColor" ); - mHoverActive = FALSE; - mHasHover = FALSE; - mBackgroundVisible = FALSE; - mBorderVisible = FALSE; - mFontStyle = LLFontGL::DROP_SHADOW_SOFT; - mBorderDropShadowVisible = FALSE; - mUseEllipses = FALSE; - mLineSpacing = 0; - mHPad = 0; - mVPad = 0; - mHAlign = LLFontGL::LEFT; - mVAlign = LLFontGL::TOP; - mClickedCallback = NULL; - mCallbackUserData = NULL; + setText( p.text() ); } BOOL LLTextBox::handleMouseDown(S32 x, S32 y, MASK mask) @@ -113,7 +114,6 @@ BOOL LLTextBox::handleMouseDown(S32 x, S32 y, MASK mask) return handled; } - BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; @@ -139,7 +139,7 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask) // If mouseup in the widget, it's been clicked if (mClickedCallback) { - (*mClickedCallback)( mCallbackUserData ); + mClickedCallback(); } } @@ -160,8 +160,15 @@ BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) void LLTextBox::setText(const LLStringExplicit& text) { - mText.assign(text); - setLineLengths(); + if(mWordWrap && !mDidWordWrap) + { + setWrappedText(text); + } + else + { + mText.assign(text); + setLineLengths(); + } } void LLTextBox::setLineLengths() @@ -193,7 +200,7 @@ void LLTextBox::setLineLengths() void LLTextBox::setWrappedText(const LLStringExplicit& in_text, F32 max_width) { - if (max_width < 0.0) + if (max_width < 0.0f) { max_width = (F32)getRect().getWidth(); } @@ -203,7 +210,8 @@ void LLTextBox::setWrappedText(const LLStringExplicit& in_text, F32 max_width) LLWString::size_type cur = 0;; LLWString::size_type len = wtext.size(); - + F32 line_height = mFontGL->getLineHeight(); + S32 line_num = 1; while (cur < len) { LLWString::size_type end = wtext.find('\n', cur); @@ -221,6 +229,8 @@ void LLTextBox::setWrappedText(const LLStringExplicit& in_text, F32 max_width) final_wtext.append(wtext, cur, useLen); cur += useLen; + // not enough room to add any more characters + if (useLen == 0) break; } if (cur < len) @@ -229,12 +239,22 @@ void LLTextBox::setWrappedText(const LLStringExplicit& in_text, F32 max_width) { cur += 1; } - final_wtext += '\n'; + line_num +=1; + // Don't wrap the last line if the text is going to spill off + // the bottom of the rectangle. Assume we prefer to run off + // the right edge. + // *TODO: Is this the right behavior? + if((line_num-1)*line_height <= (F32)getRect().getHeight()) + { + final_wtext += '\n'; + } } } - + + mDidWordWrap = TRUE; std::string final_text = wstring_to_utf8str(final_wtext); setText(final_text); + } S32 LLTextBox::getTextPixelWidth() @@ -272,6 +292,11 @@ S32 LLTextBox::getTextPixelHeight() return (S32)(num_lines * mFontGL->getLineHeight()); } +void LLTextBox::setValue(const LLSD& value ) +{ + mDidWordWrap = FALSE; + setText(value.asString()); +} BOOL LLTextBox::setTextArg( const std::string& key, const LLStringExplicit& text ) { @@ -289,8 +314,8 @@ void LLTextBox::draw() if( mBorderDropShadowVisible ) { - static LLColor4 color_drop_shadow = LLUI::sColorsGroup->getColor("ColorDropShadow"); - static S32 drop_shadow_tooltip = LLUI::sConfigGroup->getS32("DropShadowTooltip"); + static LLUICachedControl<LLColor4> color_drop_shadow ("ColorDropShadow", *(new LLColor4)); + static LLUICachedControl<S32> drop_shadow_tooltip ("DropShadowTooltip", 0); gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, color_drop_shadow, drop_shadow_tooltip); } @@ -298,7 +323,7 @@ void LLTextBox::draw() if (mBackgroundVisible) { LLRect r( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - gl_rect_2d( r, mBackgroundColor ); + gl_rect_2d( r, mBackgroundColor.get() ); } S32 text_x = 0; @@ -321,16 +346,16 @@ void LLTextBox::draw() { if(mHasHover) { - drawText( text_x, text_y, mHoverColor ); + drawText( text_x, text_y, mHoverColor.get() ); } else { - drawText( text_x, text_y, mTextColor ); + drawText( text_x, text_y, mTextColor.get() ); } } else { - drawText( text_x, text_y, mDisabledColor ); + drawText( text_x, text_y, mDisabledColor.get() ); } if (sDebugRects) @@ -338,6 +363,13 @@ void LLTextBox::draw() drawDebugRect(); } + //// *HACK: also draw debug rectangles around currently-being-edited LLView, and any elements that are being highlighted by GUI preview code (see LLFloaterUIPreview) + //std::set<LLView*>::iterator iter = std::find(sPreviewHighlightedElements.begin(), sPreviewHighlightedElements.end(), this); + //if ((sEditingUI && this == sEditingUIView) || (iter != sPreviewHighlightedElements.end() && sDrawPreviewHighlights)) + //{ + // drawDebugRect(); + //} + mHasHover = FALSE; // This is reset every frame. } @@ -355,6 +387,7 @@ void LLTextBox::drawText( S32 x, S32 y, const LLColor4& color ) mFontGL->render(mText.getWString(), 0, (F32)x, (F32)y, color, mHAlign, mVAlign, mFontStyle, + mShadowType, S32_MAX, getRect().getWidth(), NULL, TRUE, mUseEllipses); } else @@ -367,6 +400,7 @@ void LLTextBox::drawText( S32 x, S32 y, const LLColor4& color ) mFontGL->render(mText.getWString(), cur_pos, (F32)x, (F32)y, color, mHAlign, mVAlign, mFontStyle, + mShadowType, line_length, getRect().getWidth(), NULL, TRUE, mUseEllipses ); cur_pos += line_length + 1; y -= llfloor(mFontGL->getLineHeight()) + mLineSpacing; @@ -380,86 +414,3 @@ void LLTextBox::reshapeToFitText() S32 height = getTextPixelHeight(); reshape( width + 2 * mHPad, height + 2 * mVPad ); } - -// virtual -LLXMLNodePtr LLTextBox::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - // Attributes - node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mFontGL)); - node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(mHAlign)); - addColorXML(node, mTextColor, "text_color", "LabelTextColor"); - addColorXML(node, mDisabledColor, "disabled_color", "LabelDisabledColor"); - addColorXML(node, mBackgroundColor, "bg_color", "DefaultBackgroundColor"); - addColorXML(node, mBorderColor, "border_color", "DefaultHighlightLight"); - node->createChild("bg_visible", TRUE)->setBoolValue(mBackgroundVisible); - node->createChild("border_visible", TRUE)->setBoolValue(mBorderVisible); - node->createChild("border_drop_shadow_visible", TRUE)->setBoolValue(mBorderDropShadowVisible); - node->createChild("h_pad", TRUE)->setIntValue(mHPad); - node->createChild("v_pad", TRUE)->setIntValue(mVPad); - - // Contents - node->setStringValue(mText); - - return node; -} - -// static -LLView* LLTextBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("text_box"); - node->getAttributeString("name", name); - LLFontGL* font = LLView::selectFont(node); - - std::string text = node->getTextContents(); - - LLTextBox* text_box = new LLTextBox(name, - LLRect(), - text, - font, - FALSE); - - - LLFontGL::HAlign halign = LLView::selectFontHAlign(node); - text_box->setHAlign(halign); - - text_box->initFromXML(node, parent); - - node->getAttributeS32("line_spacing", text_box->mLineSpacing); - - std::string font_style; - if (node->getAttributeString("font-style", font_style)) - { - text_box->mFontStyle = LLFontGL::getStyleFromString(font_style); - } - - BOOL mouse_opaque = text_box->getMouseOpaque(); - if (node->getAttributeBOOL("mouse_opaque", mouse_opaque)) - { - text_box->setMouseOpaque(mouse_opaque); - } - - if(node->hasAttribute("text_color")) - { - LLColor4 color; - LLUICtrlFactory::getAttributeColor(node, "text_color", color); - text_box->setColor(color); - } - - if(node->hasAttribute("hover_color")) - { - LLColor4 color; - LLUICtrlFactory::getAttributeColor(node, "hover_color", color); - text_box->setHoverColor(color); - text_box->setHoverActive(true); - } - - BOOL hover_active = FALSE; - if(node->getAttributeBOOL("hover", hover_active)) - { - text_box->setHoverActive(hover_active); - } - - return text_box; -} diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index 07a6aa36220e26378298f33dfbae611a2c062e51..aae538a2212f926a5c136e1571d07b6da136f4db 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -43,27 +43,46 @@ class LLTextBox : public LLUICtrl { public: - // By default, follows top and left and is mouse-opaque. - // If no text, text = name. - // If no font, uses default system font. - LLTextBox(const std::string& name, const LLRect& rect, const std::string& text, - const LLFontGL* font = NULL, BOOL mouse_opaque = TRUE ); + + // *TODO: Add callback to Params + typedef boost::function<void (void)> callback_t; + + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<std::string> text; - // Construct a textbox which handles word wrapping for us. - LLTextBox(const std::string& name, const std::string& text, F32 max_width = 200, - const LLFontGL* font = NULL, BOOL mouse_opaque = TRUE ); + Optional<bool> highlight_on_hover, + border_visible, + border_drop_shadow_visible, + bg_visible, + use_ellipses, + word_wrap; - // "Simple" constructors for text boxes that have the same name and label *TO BE DEPRECATED* - LLTextBox(const std::string& name_and_label, const LLRect& rect); + Optional<LLFontGL::ShadowType> font_shadow; - // Consolidate common member initialization - // 20+ initializers times 3+ constructors is unmaintainable. - void initDefaults(); + Deprecated drop_shadow_visible, + type, + length; - virtual ~LLTextBox() {} + Optional<LLUIColor> text_color, + hover_color, + disabled_color, + background_color, + border_color; - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); + Optional<S32> v_pad, + h_pad, + line_spacing; + + Params(); + }; + +protected: + LLTextBox(const Params&); + friend class LLUICtrlFactory; + +public: + virtual ~LLTextBox() {} virtual void draw(); virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); @@ -81,18 +100,17 @@ public: void setHoverActive( BOOL active ) { mHoverActive = active; } void setText( const LLStringExplicit& text ); - void setWrappedText(const LLStringExplicit& text, F32 max_width = -1.0); // -1 means use existing control width + void setWrappedText(const LLStringExplicit& text, F32 max_width = -1.f); // -1 means use existing control width void setUseEllipses( BOOL use_ellipses ) { mUseEllipses = use_ellipses; } void setBackgroundVisible(BOOL visible) { mBackgroundVisible = visible; } void setBorderVisible(BOOL visible) { mBorderVisible = visible; } - void setFontStyle(U8 style) { mFontStyle = style; } void setBorderDropshadowVisible(BOOL visible){ mBorderDropShadowVisible = visible; } void setHPad(S32 pixels) { mHPad = pixels; } void setVPad(S32 pixels) { mVPad = pixels; } void setRightAlign() { mHAlign = LLFontGL::RIGHT; } void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } - void setClickedCallback( void (*cb)(void *data), void* data = NULL ){ mClickedCallback = cb; mCallbackUserData = data; } // mouse down and up within button + void setClickedCallback( boost::function<void (void*)> cb, void* userdata = NULL ){ mClickedCallback = boost::bind(cb, userdata); } // mouse down and up within button const LLFontGL* getFont() const { return mFontGL; } @@ -102,7 +120,7 @@ public: S32 getTextPixelWidth(); S32 getTextPixelHeight(); - virtual void setValue(const LLSD& value ) { setText(value.asString()); } + virtual void setValue(const LLSD& value ); virtual LLSD getValue() const { return LLSD(getText()); } virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); @@ -112,18 +130,21 @@ private: LLUIString mText; const LLFontGL* mFontGL; - LLColor4 mTextColor; - LLColor4 mDisabledColor; - LLColor4 mBackgroundColor; - LLColor4 mBorderColor; - LLColor4 mHoverColor; + LLUIColor mTextColor; + LLUIColor mDisabledColor; + LLUIColor mBackgroundColor; + LLUIColor mBorderColor; + LLUIColor mHoverColor; BOOL mHoverActive; BOOL mHasHover; BOOL mBackgroundVisible; BOOL mBorderVisible; + BOOL mWordWrap; + BOOL mDidWordWrap; U8 mFontStyle; // style bit flags for font + LLFontGL::ShadowType mShadowType; BOOL mBorderDropShadowVisible; BOOL mUseEllipses; @@ -135,8 +156,14 @@ private: LLFontGL::VAlign mVAlign; std::vector<S32> mLineLengthList; - void (*mClickedCallback)(void* data ); - void* mCallbackUserData; + callback_t mClickedCallback; }; +#ifdef LL_WINDOWS +#ifndef INSTANTIATE_GETCHILD_TEXTBOX +#pragma warning (disable : 4231) +extern template LLTextBox* LLView::getChild<LLTextBox>( const std::string& name, BOOL recurse, BOOL create_if_missing ) const; +#endif +#endif + #endif diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 5e54c7a307cb21223e6473a790c29ec51fdff852..34bced064e874a3cb776f8c74d20fcd40420b66a 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -63,32 +63,17 @@ // // Globals // -static LLRegisterWidget<LLTextEditor> r("simple_text_editor"); - -BOOL gDebugTextEditorTips = FALSE; +static LLDefaultWidgetRegistry::Register<LLTextEditor> r("simple_text_editor"); // // Constants // -const S32 UI_TEXTEDITOR_BUFFER_BLOCK_SIZE = 512; -const S32 UI_TEXTEDITOR_BORDER = 1; -const S32 UI_TEXTEDITOR_H_PAD = 4; -const S32 UI_TEXTEDITOR_V_PAD_TOP = 4; const S32 UI_TEXTEDITOR_LINE_NUMBER_MARGIN = 32; const S32 UI_TEXTEDITOR_LINE_NUMBER_DIGITS = 4; const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; const S32 SPACES_PER_TAB = 4; -const F32 PREEDIT_MARKER_BRIGHTNESS = 0.4f; -const S32 PREEDIT_MARKER_GAP = 1; -const S32 PREEDIT_MARKER_POSITION = 2; -const S32 PREEDIT_MARKER_THICKNESS = 1; -const F32 PREEDIT_STANDOUT_BRIGHTNESS = 0.6f; -const S32 PREEDIT_STANDOUT_GAP = 1; -const S32 PREEDIT_STANDOUT_POSITION = 2; -const S32 PREEDIT_STANDOUT_THICKNESS = 2; - LLColor4 LLTextEditor::mLinkColor = LLColor4::blue; void (* LLTextEditor::mURLcallback)(const std::string&) = NULL; @@ -243,18 +228,9 @@ private: /////////////////////////////////////////////////////////////////// - -LLTextEditor::LLTextEditor( - const std::string& name, - const LLRect& rect, - S32 max_length, // In bytes - const std::string &default_text, - const LLFontGL* font, - BOOL allow_embedded_items) - : - LLUICtrl( name, rect, TRUE, NULL, NULL, FOLLOWS_TOP | FOLLOWS_LEFT ), - mTextIsUpToDate(TRUE), - mMaxTextByteLength( max_length ), +LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) + : LLUICtrl(p, LLTextViewModelPtr(new LLTextViewModel)), + mMaxTextByteLength( p.max_text_length ), mBaseDocIsPristine(TRUE), mPristineCmd( NULL ), mLastCmd( NULL ), @@ -265,45 +241,40 @@ LLTextEditor::LLTextEditor( mScrolledToBottom( TRUE ), mOnScrollEndCallback( NULL ), mOnScrollEndData( NULL ), - mCursorColor( LLUI::sColorsGroup->getColor( "TextCursorColor" ) ), - mFgColor( LLUI::sColorsGroup->getColor( "TextFgColor" ) ), - mDefaultColor( LLUI::sColorsGroup->getColor( "TextDefaultColor" ) ), - mReadOnlyFgColor( LLUI::sColorsGroup->getColor( "TextFgReadOnlyColor" ) ), - mWriteableBgColor( LLUI::sColorsGroup->getColor( "TextBgWriteableColor" ) ), - mReadOnlyBgColor( LLUI::sColorsGroup->getColor( "TextBgReadOnlyColor" ) ), - mFocusBgColor( LLUI::sColorsGroup->getColor( "TextBgFocusColor" ) ), - mReadOnly(FALSE), - mWordWrap( FALSE ), + mCursorColor( p.cursor_color() ), + mFgColor( p.text_color() ), + mDefaultColor( p.default_color() ), + mReadOnlyFgColor( p.text_readonly_color() ), + mWriteableBgColor( p.bg_writeable_color() ), + mReadOnlyBgColor( p.bg_readonly_color() ), + mFocusBgColor( p.bg_focus_color() ), + mReadOnly(p.read_only), + mWordWrap( p.word_wrap ), mShowLineNumbers ( FALSE ), - mTabsToNextField( TRUE ), mCommitOnFocusLost( FALSE ), mHideScrollbarForShortDocs( FALSE ), - mTakesNonScrollClicks( TRUE ), - mTrackBottom( FALSE ), - mAllowEmbeddedItems( allow_embedded_items ), + mTakesNonScrollClicks( p.takes_non_scroll_clicks ), + mTrackBottom( p.track_bottom ), + mAllowEmbeddedItems( p.allow_embedded_items ), mAcceptCallingCardNames(FALSE), mHandleEditKeysDirectly( FALSE ), mMouseDownX(0), mMouseDownY(0), mLastSelectionX(-1), - mLastSelectionY(-1), mReflowNeeded(FALSE), - mScrollNeeded(FALSE) + mScrollNeeded(FALSE), + mLastSelectionY(-1), + mTabsToNextField(p.ignore_tab), + mGLFont(p.font), + mGLFontStyle(LLFontGL::getStyleFromString(p.font.style)) { + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); + mSourceID.generate(); // reset desired x cursor position mDesiredXPixel = -1; - if (font) - { - mGLFont = font; - } - else - { - mGLFont = LLFontGL::getFontSansSerif(); - } - updateTextRect(); S32 line_height = llround( mGLFont->getLineHeight() ); @@ -312,36 +283,57 @@ LLTextEditor::LLTextEditor( // Init the scrollbar LLRect scroll_rect; scroll_rect.setOriginAndSize( - getRect().getWidth() - SCROLLBAR_SIZE, + getRect().getWidth() - scrollbar_size, 1, - SCROLLBAR_SIZE, + scrollbar_size, getRect().getHeight() - 1); S32 lines_in_doc = getLineCount(); - mScrollbar = new LLScrollbar( std::string("Scrollbar"), scroll_rect, - LLScrollbar::VERTICAL, - lines_in_doc, - 0, - page_size, - NULL, this ); - mScrollbar->setFollowsRight(); - mScrollbar->setFollowsTop(); - mScrollbar->setFollowsBottom(); - mScrollbar->setEnabled( TRUE ); - mScrollbar->setVisible( TRUE ); + LLScrollbar::Params sbparams; + sbparams.name("Scrollbar"); + sbparams.rect(scroll_rect); + sbparams.orientation(LLScrollbar::VERTICAL); + sbparams.doc_size(lines_in_doc); + sbparams.doc_pos(0); + sbparams.page_size(page_size); + sbparams.follows.flags(FOLLOWS_RIGHT | FOLLOWS_TOP | FOLLOWS_BOTTOM); + mScrollbar = LLUICtrlFactory::create<LLScrollbar> (sbparams); mScrollbar->setOnScrollEndCallback(mOnScrollEndCallback, mOnScrollEndData); addChild(mScrollbar); - mBorder = new LLViewBorder( std::string("text ed border"), LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), LLViewBorder::BEVEL_IN, LLViewBorder::STYLE_LINE, UI_TEXTEDITOR_BORDER ); + static LLUICachedControl<S32> text_editor_border ("UITextEditorBorder", 0); + LLViewBorder::Params params; + params.name("text ed border"); + params.rect(getLocalRect()); + params.bevel_type(LLViewBorder::BEVEL_IN); + params.border_thickness(text_editor_border); + mBorder = LLUICtrlFactory::create<LLViewBorder> (params); addChild( mBorder ); + mBorder->setVisible(!p.hide_border); - appendText(default_text, FALSE, FALSE); - - resetDirty(); // Update saved text state + appendText(p.default_text, FALSE, FALSE); + + setHideScrollbarForShortDocs(p.hide_scrollbar); mParseHTML=FALSE; mHTML.clear(); } +void LLTextEditor::initFromParams( const LLTextEditor::Params& p) +{ + resetDirty(); // Update saved text state + LLUICtrl::initFromParams(p); + // HACK: work around enabled == readonly design bug -- RN + // setEnabled will modify our read only status, so do this after + // LLUICtrl::initFromParams + if (p.read_only.isProvided()) + { + mReadOnly = p.read_only; + updateSegments(); + updateAllowingLanguageInput(); + } + // HACK: text editors always need to be enabled so that we can scroll + LLView::setEnabled(true); +} LLTextEditor::~LLTextEditor() { @@ -360,6 +352,11 @@ LLTextEditor::~LLTextEditor() std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer()); } +LLTextViewModel* LLTextEditor::getViewModel() const +{ + return (LLTextViewModel*)mViewModel.get(); +} + void LLTextEditor::setTrackColor( const LLColor4& color ) { mScrollbar->setTrackColor(color); @@ -370,16 +367,6 @@ void LLTextEditor::setThumbColor( const LLColor4& color ) mScrollbar->setThumbColor(color); } -void LLTextEditor::setHighlightColor( const LLColor4& color ) -{ - mScrollbar->setHighlightColor(color); -} - -void LLTextEditor::setShadowColor( const LLColor4& color ) -{ - mScrollbar->setShadowColor(color); -} - void LLTextEditor::updateLineStartList(S32 startpos) { updateSegments(); @@ -400,7 +387,8 @@ void LLTextEditor::updateLineStartList(S32 startpos) seg_offset = iter->mOffset; mLineStartList.erase(iter, mLineStartList.end()); } - + + LLWString text(getWText()); while( seg_idx < seg_num ) { mLineStartList.push_back(line_info(seg_idx,seg_offset)); @@ -412,7 +400,7 @@ void LLTextEditor::updateLineStartList(S32 startpos) LLTextSegment* segment = mSegments[seg_idx]; S32 start_idx = segment->getStart() + seg_offset; S32 end_idx = start_idx; - while (end_idx < segment->getEnd() && mWText[end_idx] != '\n') + while (end_idx < segment->getEnd() && text[end_idx] != '\n') { end_idx++; } @@ -433,7 +421,7 @@ void LLTextEditor::updateLineStartList(S32 startpos) } else { - const llwchar* str = mWText.c_str() + start_idx; + const llwchar* str = text.c_str() + start_idx; S32 drawn = mGLFont->maxDrawableChars(str, (F32)abs(mTextRect.getWidth()) - line_width, end_idx - start_idx, mWordWrap, mAllowEmbeddedItems ); if( 0 == drawn && line_width == start_x) @@ -447,7 +435,7 @@ void LLTextEditor::updateLineStartList(S32 startpos) if (end_idx < segment->getEnd()) { line_ended = TRUE; - if (mWText[end_idx] == '\n') + if (text[end_idx] == '\n') { seg_offset++; // skip newline } @@ -490,17 +478,17 @@ BOOL LLTextEditor::truncate() BOOL did_truncate = FALSE; // First rough check - if we're less than 1/4th the size, we're OK - if (mWText.size() >= (size_t) (mMaxTextByteLength / 4)) + if (getLength() >= S32(mMaxTextByteLength / 4)) { // Have to check actual byte size - S32 utf8_byte_size = wstring_utf8_length( mWText ); + LLWString text(getWText()); + S32 utf8_byte_size = wstring_utf8_length(text); if ( utf8_byte_size > mMaxTextByteLength ) { // Truncate safely in UTF-8 - std::string temp_utf8_text = wstring_to_utf8str( mWText ); + std::string temp_utf8_text = wstring_to_utf8str(text); temp_utf8_text = utf8str_truncate( temp_utf8_text, mMaxTextByteLength ); - mWText = utf8str_to_wstring( temp_utf8_text ); - mTextIsUpToDate = FALSE; + getViewModel()->setDisplay(utf8str_to_wstring( temp_utf8_text )); did_truncate = TRUE; } } @@ -511,10 +499,7 @@ BOOL LLTextEditor::truncate() void LLTextEditor::setText(const LLStringExplicit &utf8str) { // LLStringUtil::removeCRLF(utf8str); - mUTF8Text = utf8str_removeCRLF(utf8str); - // mUTF8Text = utf8str; - mWText = utf8str_to_wstring(mUTF8Text); - mTextIsUpToDate = TRUE; + mViewModel->setValue(utf8str_removeCRLF(utf8str)); truncate(); blockUndo(); @@ -529,9 +514,7 @@ void LLTextEditor::setText(const LLStringExplicit &utf8str) void LLTextEditor::setWText(const LLWString &wtext) { - mWText = wtext; - mUTF8Text.clear(); - mTextIsUpToDate = FALSE; + getViewModel()->setDisplay(wtext); truncate(); blockUndo(); @@ -550,24 +533,13 @@ void LLTextEditor::setValue(const LLSD& value) setText(value.asString()); } -const std::string& LLTextEditor::getText() const +std::string LLTextEditor::getText() const { - if (!mTextIsUpToDate) + if (mAllowEmbeddedItems) { - if (mAllowEmbeddedItems) - { - llwarns << "getText() called on text with embedded items (not supported)" << llendl; - } - mUTF8Text = wstring_to_utf8str(mWText); - mTextIsUpToDate = TRUE; + llwarns << "getText() called on text with embedded items (not supported)" << llendl; } - return mUTF8Text; -} - -// virtual -LLSD LLTextEditor::getValue() const -{ - return LLSD(getText()); + return mViewModel->getValue().asString(); } void LLTextEditor::setWordWrap(BOOL b) @@ -709,7 +681,7 @@ void LLTextEditor::setCursorAtLocalPos( S32 local_x, S32 local_y, BOOL round ) S32 LLTextEditor::prevWordPos(S32 cursorPos) const { - const LLWString& wtext = mWText; + LLWString wtext(getWText()); while( (cursorPos > 0) && (wtext[cursorPos-1] == ' ') ) { cursorPos--; @@ -723,7 +695,7 @@ S32 LLTextEditor::prevWordPos(S32 cursorPos) const S32 LLTextEditor::nextWordPos(S32 cursorPos) const { - const LLWString& wtext = mWText; + LLWString wtext(getWText()); while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos] ) ) { cursorPos++; @@ -849,12 +821,13 @@ S32 LLTextEditor::getCursorPosFromLocalCoord( S32 local_x, S32 local_y, BOOL rou { S32 line_len = line_end - line_start; S32 pos; + LLWString text(getWText()); if (mAllowEmbeddedItems) { // Figure out which character we're nearest to. bindEmbeddedChars(mGLFont); - pos = mGLFont->charFromPixelOffset(mWText.c_str(), line_start, + pos = mGLFont->charFromPixelOffset(text.c_str(), line_start, (F32)(local_x - mTextRect.mLeft), (F32)(mTextRect.getWidth()), line_len, @@ -863,7 +836,7 @@ S32 LLTextEditor::getCursorPosFromLocalCoord( S32 local_x, S32 local_y, BOOL rou } else { - pos = mGLFont->charFromPixelOffset(mWText.c_str(), line_start, + pos = mGLFont->charFromPixelOffset(text.c_str(), line_start, (F32)(local_x - mTextRect.mLeft), (F32)mTextRect.getWidth(), line_len, @@ -876,14 +849,15 @@ S32 LLTextEditor::getCursorPosFromLocalCoord( S32 local_x, S32 local_y, BOOL rou void LLTextEditor::setCursor(S32 row, S32 column) { - const llwchar* doc = mWText.c_str(); + LLWString text(getWText()); + const llwchar* doc = text.c_str(); const char CR = 10; while(row--) { while (CR != *doc++); } doc += column; - setCursorPos(doc - mWText.c_str()); + setCursorPos(doc - text.c_str()); } void LLTextEditor::setCursorPos(S32 offset) @@ -935,7 +909,7 @@ BOOL LLTextEditor::selectionContainsLineBreaks() S32 left = llmin(mSelectionStart, mSelectionEnd); S32 right = left + llabs(mSelectionStart - mSelectionEnd); - const LLWString &wtext = mWText; + LLWString wtext = getWText(); for( S32 i = left; i < right; i++ ) { if (wtext[i] == '\n') @@ -972,7 +946,7 @@ S32 LLTextEditor::indentLine( S32 pos, S32 spaces ) // Unindent for(S32 i=0; i < -spaces; i++) { - const LLWString &wtext = mWText; + LLWString wtext = getWText(); if (wtext[pos] == ' ') { delta_spaces += remove( pos, 1, FALSE ); @@ -987,7 +961,7 @@ void LLTextEditor::indentSelectedLines( S32 spaces ) { if( hasSelection() ) { - const LLWString &text = mWText; + LLWString text = getWText(); S32 left = llmin( mSelectionStart, mSelectionEnd ); S32 right = left + llabs( mSelectionStart - mSelectionEnd ); BOOL cursor_on_right = (mSelectionEnd > mSelectionStart); @@ -1217,6 +1191,7 @@ BOOL LLTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask) BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) { + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); BOOL handled = FALSE; mHoverSegment = NULL; @@ -1291,7 +1266,7 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) if( !handled ) { lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; - if (!mScrollbar->getVisible() || x < getRect().getWidth() - SCROLLBAR_SIZE) + if (!mScrollbar->getVisible() || x < getRect().getWidth() - scrollbar_size) { getWindow()->setCursor(UI_CURSOR_IBEAM); } @@ -1374,7 +1349,7 @@ BOOL LLTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) setCursorAtLocalPos( x, y, FALSE ); deselect(); - const LLWString &text = mWText; + LLWString text = getWText(); if( isPartOfWord( text[mCursorPos] ) ) { @@ -1471,12 +1446,12 @@ S32 LLTextEditor::remove(const S32 pos, const S32 length, const BOOL group_with_ S32 LLTextEditor::append(const LLWString &wstr, const BOOL group_with_next_op) { - return insert(mWText.length(), wstr, group_with_next_op); + return insert(getLength(), wstr, group_with_next_op); } S32 LLTextEditor::overwriteChar(S32 pos, llwchar wc) { - if ((S32)mWText.length() == pos) + if ((S32)getLength() == pos) { return addChar(pos, wc); } @@ -1498,7 +1473,7 @@ void LLTextEditor::removeCharOrTab() { S32 chars_to_remove = 1; - const LLWString &text = mWText; + LLWString text = getWText(); if (text[mCursorPos - 1] == ' ') { // Try to remove a "tab" @@ -1563,7 +1538,7 @@ void LLTextEditor::removeChar() // Add a single character to the text S32 LLTextEditor::addChar(S32 pos, llwchar wc) { - if ( (wstring_utf8_length( mWText ) + wchar_utf8_length( wc )) >= mMaxTextByteLength) + if ( (wstring_utf8_length( getWText() ) + wchar_utf8_length( wc )) >= mMaxTextByteLength) { make_ui_sound("UISndBadKeystroke"); return 0; @@ -1865,7 +1840,7 @@ void LLTextEditor::cut() } S32 left_pos = llmin( mSelectionStart, mSelectionEnd ); S32 length = llabs( mSelectionStart - mSelectionEnd ); - gClipboard.copyFromSubstring( mWText, left_pos, length, mSourceID ); + gClipboard.copyFromSubstring( getWText(), left_pos, length, mSourceID ); deleteSelection( FALSE ); needsReflow(); @@ -1885,7 +1860,7 @@ void LLTextEditor::copy() } S32 left_pos = llmin( mSelectionStart, mSelectionEnd ); S32 length = llabs( mSelectionStart - mSelectionEnd ); - gClipboard.copyFromSubstring(mWText, left_pos, length, mSourceID); + gClipboard.copyFromSubstring(getWText(), left_pos, length, mSourceID); } BOOL LLTextEditor::canPaste() const @@ -1986,7 +1961,7 @@ void LLTextEditor::copyPrimary() } S32 left_pos = llmin( mSelectionStart, mSelectionEnd ); S32 length = llabs( mSelectionStart - mSelectionEnd ); - gClipboard.copyFromPrimarySubstring(mWText, left_pos, length, mSourceID); + gClipboard.copyFromPrimarySubstring(getWText(), left_pos, length, mSourceID); } BOOL LLTextEditor::canPastePrimary() const @@ -2237,7 +2212,7 @@ void LLTextEditor::unindentLineBeforeCloseBrace() { if( mCursorPos >= 1 ) { - const LLWString &text = mWText; + LLWString text = getWText(); if( ' ' == text[ mCursorPos - 1 ] ) { removeCharOrTab(); @@ -2401,7 +2376,7 @@ void LLTextEditor::doDelete() { S32 i; S32 chars_to_remove = 1; - const LLWString &text = mWText; + LLWString text = getWText(); if( (text[ mCursorPos ] == ' ') && (mCursorPos + SPACES_PER_TAB < getLength()) ) { // Try to remove a full tab's worth of spaces @@ -2565,10 +2540,10 @@ void LLTextEditor::drawBackground() S32 right = getRect().getWidth(); S32 bottom = 0; - LLColor4 bg_color = mReadOnly ? mReadOnlyBgColor - : gFocusMgr.getKeyboardFocus() == this ? mFocusBgColor : mWriteableBgColor; + LLColor4 bg_color = mReadOnly ? mReadOnlyBgColor.get() + : gFocusMgr.getKeyboardFocus() == this ? mFocusBgColor.get() : mWriteableBgColor.get(); if( mShowLineNumbers ) { - gl_rect_2d(left, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN, bottom, mReadOnlyBgColor ); // line number area always read-only + gl_rect_2d(left, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN, bottom, mReadOnlyBgColor.get() ); // line number area always read-only gl_rect_2d(UI_TEXTEDITOR_LINE_NUMBER_MARGIN, top, right, bottom, bg_color); // body text area to the right of line numbers gl_rect_2d(UI_TEXTEDITOR_LINE_NUMBER_MARGIN, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN-1, bottom, LLColor4::grey3); // separator } else { @@ -2584,7 +2559,7 @@ void LLTextEditor::drawSelectionBackground() // Draw selection even if we don't have keyboard focus for search/replace if( hasSelection() ) { - const LLWString &text = mWText; + LLWString text = getWText(); const S32 text_len = getLength(); std::queue<S32> line_endings; @@ -2683,7 +2658,7 @@ void LLTextEditor::drawSelectionBackground() if( selection_visible ) { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - const LLColor4& color = mReadOnly ? mReadOnlyBgColor : mWriteableBgColor; + const LLColor4& color = mReadOnly ? mReadOnlyBgColor.get() : mWriteableBgColor.get(); F32 alpha = hasFocus() ? 1.f : 0.5f; gGL.color4f( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], alpha ); S32 margin_offset = mShowLineNumbers ? UI_TEXTEDITOR_LINE_NUMBER_MARGIN : 0; @@ -2735,7 +2710,7 @@ void LLTextEditor::drawCursor() if( gFocusMgr.getKeyboardFocus() == this && gShowTextEditCursor && !mReadOnly) { - const LLWString &text = mWText; + LLWString text = getWText(); const S32 text_len = getLength(); // Skip through the lines we aren't drawing. @@ -2819,7 +2794,7 @@ void LLTextEditor::drawCursor() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4fv( mCursorColor.mV ); + gGL.color4fv( mCursorColor.get().mV ); gl_rect_2d(llfloor(cursor_left), llfloor(cursor_top), llfloor(cursor_right), llfloor(cursor_bottom)); @@ -2834,21 +2809,22 @@ void LLTextEditor::drawCursor() } else if (mReadOnly) { - text_color = mReadOnlyFgColor; + text_color = mReadOnlyFgColor.get(); } else { - text_color = mFgColor; + text_color = mFgColor.get(); } mGLFont->render(text, mCursorPos, next_char_left, cursor_bottom + line_height, LLColor4(1.f - text_color.mV[VRED], 1.f - text_color.mV[VGREEN], 1.f - text_color.mV[VBLUE], 1.f), LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, + LLFontGL::NO_SHADOW, 1); } // Make sure the IME is in the right place - LLRect screen_pos = getScreenRect(); + LLRect screen_pos = calcScreenRect(); LLCoordGL ime_pos( screen_pos.mLeft + llfloor(cursor_left), screen_pos.mBottom + llfloor(cursor_top) ); ime_pos.mX = (S32) (ime_pos.mX * LLUI::sGLScaleFactor.mV[VX]); @@ -2861,12 +2837,22 @@ void LLTextEditor::drawCursor() void LLTextEditor::drawPreeditMarker() { + static LLUICachedControl<F32> preedit_marker_brightness ("UIPreeditMarkerBrightness", 0); + static LLUICachedControl<S32> preedit_marker_gap ("UIPreeditMarkerGap", 0); + static LLUICachedControl<S32> preedit_marker_position ("UIPreeditMarkerPosition", 0); + static LLUICachedControl<S32> preedit_marker_thickness ("UIPreeditMarkerThickness", 0); + static LLUICachedControl<F32> preedit_standout_brightness ("UIPreeditStandoutBrightness", 0); + static LLUICachedControl<S32> preedit_standout_gap ("UIPreeditStandoutGap", 0); + static LLUICachedControl<S32> preedit_standout_position ("UIPreeditStandoutPosition", 0); + static LLUICachedControl<S32> preedit_standout_thickness ("UIPreeditStandoutThickness", 0); + if (!hasPreeditString()) { return; } - const llwchar *text = mWText.c_str(); + const LLWString textString(getWText()); + const llwchar *text = textString.c_str(); const S32 text_len = getLength(); const S32 num_lines = getLineCount(); @@ -2929,19 +2915,19 @@ void LLTextEditor::drawPreeditMarker() if (mPreeditStandouts[i]) { - gl_rect_2d(preedit_left + PREEDIT_STANDOUT_GAP, - line_y + PREEDIT_STANDOUT_POSITION, - preedit_right - PREEDIT_STANDOUT_GAP - 1, - line_y + PREEDIT_STANDOUT_POSITION - PREEDIT_STANDOUT_THICKNESS, - (mCursorColor * PREEDIT_STANDOUT_BRIGHTNESS + mWriteableBgColor * (1 - PREEDIT_STANDOUT_BRIGHTNESS)).setAlpha(1.0f)); + gl_rect_2d(preedit_left + preedit_standout_gap, + line_y + preedit_standout_position, + preedit_right - preedit_standout_gap - 1, + line_y + preedit_standout_position - preedit_standout_thickness, + (mCursorColor.get() * preedit_standout_brightness + mWriteableBgColor.get() * (1 - preedit_standout_brightness)).setAlpha(1.0f)); } else { - gl_rect_2d(preedit_left + PREEDIT_MARKER_GAP, - line_y + PREEDIT_MARKER_POSITION, - preedit_right - PREEDIT_MARKER_GAP - 1, - line_y + PREEDIT_MARKER_POSITION - PREEDIT_MARKER_THICKNESS, - (mCursorColor * PREEDIT_MARKER_BRIGHTNESS + mWriteableBgColor * (1 - PREEDIT_MARKER_BRIGHTNESS)).setAlpha(1.0f)); + gl_rect_2d(preedit_left + preedit_marker_gap, + line_y + preedit_marker_position, + preedit_right - preedit_marker_gap - 1, + line_y + preedit_marker_position - preedit_marker_thickness, + (mCursorColor.get() * preedit_marker_brightness + mWriteableBgColor.get() * (1 - preedit_marker_brightness)).setAlpha(1.0f)); } } } @@ -2956,9 +2942,12 @@ void LLTextEditor::drawPreeditMarker() void LLTextEditor::drawText() { - const LLWString &text = mWText; + LLWString text = getWText(); const S32 text_len = getLength(); - if( text_len <= 0 ) return; + if( text_len <= 0 ) + { + return; + } S32 selection_left = -1; S32 selection_right = -1; // Draw selection even if we don't have keyboard focus for search/replace @@ -2970,26 +2959,14 @@ void LLTextEditor::drawText() LLGLSUIDefault gls_ui; - // There are several concepts that are important for understanding the following drawing code. - // The document is logically a sequence of characters (stored in a LLWString). - // Variables below with "start" or "end" in their names refer to positions or offsets into it. - // Next there are two kinds of "line" variables to understand. Newline characters in the - // character sequence represent logical lines. These are what get numbered and so variables - // representing this kind of line have "num" in their names. - // The others represent line fragments or displayed lines which the scrollbar deals with. - // When the "show line numbers" property is turned on, we draw line numbers to the left of the - // beginning of each logical line and not in front of wrapped "continuation" display lines. -MG - - S32 cur_line = mScrollbar->getDocPos(); // scrollbar counts each wrap as a new line. + S32 cur_line = mScrollbar->getDocPos(); S32 num_lines = getLineCount(); - if (cur_line >= num_lines) return; - S32 line_start = getLineStart(cur_line); - S32 prev_start = getLineStart(cur_line-1); - S32 cur_line_num = getLineForPosition(line_start); // doesn't count wraps. i.e. only counts newlines. - S32 prev_line_num = getLineForPosition(prev_start); - BOOL cur_line_is_continuation = cur_line_num > 0 && cur_line_num == prev_line_num; - BOOL line_wraps = FALSE; + if (cur_line >= num_lines) + { + return; + } + S32 line_start = getLineStart(cur_line); LLTextSegment t(line_start); segment_list_t::iterator seg_iter; seg_iter = std::upper_bound(mSegments.begin(), mSegments.end(), &t, LLTextSegment::compare()); @@ -3008,36 +2985,12 @@ void LLTextEditor::drawText() next_start = getLineStart(cur_line + 1); line_end = next_start; } - line_wraps = text[line_end-1] != '\n'; - if ( ! line_wraps ) + if ( text[line_end-1] == '\n' ) { - --line_end; // don't attempt to draw the newline char. + --line_end; } - F32 text_start = (F32)mTextRect.mLeft; - F32 text_x = text_start + (mShowLineNumbers ? UI_TEXTEDITOR_LINE_NUMBER_MARGIN : 0); - - // draw the line numbers - if( mShowLineNumbers && !cur_line_is_continuation) - { - const LLFontGL *num_font = LLFontGL::getFontMonospace(); - F32 y_top = text_y + ((F32)llround(num_font->getLineHeight()) / 2); - const LLWString ltext = utf8str_to_wstring(llformat("%*d", UI_TEXTEDITOR_LINE_NUMBER_DIGITS, cur_line_num )); - BOOL is_cur_line = getCurrentLine() == cur_line_num; - const U8 style = is_cur_line ? LLFontGL::BOLD : LLFontGL::NORMAL; - const LLColor4 fg_color = is_cur_line ? mCursorColor : mReadOnlyFgColor; - num_font->render( - ltext, // string to draw - 0, // begin offset - 3., // x - y_top, // y - fg_color, - LLFontGL::LEFT, // horizontal alignment - LLFontGL::VCENTER, // vertical alignment - style, - S32_MAX, // max chars - UI_TEXTEDITOR_LINE_NUMBER_MARGIN); // max pixels - } + F32 text_x = (F32)mTextRect.mLeft; S32 seg_start = line_start; while( seg_start < line_end ) @@ -3082,31 +3035,20 @@ void LLTextEditor::drawText() drawClippedSegment( text, seg_start, clipped_end, text_x, text_y, selection_left, selection_right, style, &text_x ); - if( text_x == text_start && mShowLineNumbers ) - { - text_x += UI_TEXTEDITOR_LINE_NUMBER_MARGIN; - } - // Note: text_x is incremented by drawClippedSegment() seg_start += clipped_len; } } - // move down one line - text_y -= (F32)line_height; - - if( line_wraps ) - { - cur_line_num--; - } - cur_line_is_continuation = line_wraps; // so as to not not number the continuation lines + // move down one line + text_y -= (F32)line_height; line_start = next_start; cur_line++; - cur_line_num++; } } + // Draws a single text segment, reversing the color for selection if needed. void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32 seg_end, F32 x, F32 y, S32 selection_left, S32 selection_right, const LLStyleSP& style, F32* right_x ) { @@ -3121,7 +3063,7 @@ void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32 if ( style->getFontString()[0] ) { - font = LLResMgr::getInstance()->getRes(style->getFontID()); + font = style->getFont(); } U8 font_flags = LLFontGL::NORMAL; @@ -3141,13 +3083,15 @@ void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32 if (style->getIsEmbeddedItem()) { + static LLUICachedControl<LLColor4> text_embedded_item_readonly_color ("TextEmbeddedItemReadOnlyColor", *(new LLColor4)); + static LLUICachedControl<LLColor4> text_embedded_item_color ("TextEmbeddedItemColor", *(new LLColor4)); if (mReadOnly) { - color = LLUI::sColorsGroup->getColor("TextEmbeddedItemReadOnlyColor"); + color = text_embedded_item_readonly_color; } else { - color = LLUI::sColorsGroup->getColor("TextEmbeddedItemColor"); + color = text_embedded_item_color; } } @@ -3159,7 +3103,7 @@ void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32 S32 start = seg_start; S32 end = llmin( selection_left, seg_end ); S32 length = end - start; - font->render(text, start, x, y_top, color, LLFontGL::LEFT, LLFontGL::TOP, font_flags, length, S32_MAX, right_x, mAllowEmbeddedItems); + font->render(text, start, x, y_top, color, LLFontGL::LEFT, LLFontGL::TOP, mGLFontStyle, LLFontGL::NO_SHADOW, length, S32_MAX, right_x, mAllowEmbeddedItems); } x = *right_x; @@ -3172,7 +3116,7 @@ void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32 font->render(text, start, x, y_top, LLColor4( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], 1.f ), - LLFontGL::LEFT, LLFontGL::TOP, font_flags, length, S32_MAX, right_x, mAllowEmbeddedItems); + LLFontGL::LEFT, LLFontGL::TOP, mGLFontStyle, LLFontGL::NO_SHADOW, length, S32_MAX, right_x, mAllowEmbeddedItems); } x = *right_x; if( selection_right < seg_end ) @@ -3181,7 +3125,7 @@ void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32 S32 start = llmax( selection_right, seg_start ); S32 end = seg_end; S32 length = end - start; - font->render(text, start, x, y_top, color, LLFontGL::LEFT, LLFontGL::TOP, font_flags, length, S32_MAX, right_x, mAllowEmbeddedItems); + font->render(text, start, x, y_top, color, LLFontGL::LEFT, LLFontGL::TOP, mGLFontStyle, LLFontGL::NO_SHADOW, length, S32_MAX, right_x, mAllowEmbeddedItems); } } @@ -3203,17 +3147,18 @@ void LLTextEditor::draw() } { - LLLocalClipRect clip(LLRect(0, getRect().getHeight(), getRect().getWidth() - (mScrollbar->getVisible() ? SCROLLBAR_SIZE : 0), 0)); + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); + LLLocalClipRect clip(LLRect(0, getRect().getHeight(), getRect().getWidth() - (mScrollbar->getVisible() ? scrollbar_size : 0), 0)); - bindEmbeddedChars(mGLFont); + bindEmbeddedChars( mGLFont ); - drawBackground(); - drawSelectionBackground(); - drawPreeditMarker(); - drawText(); - drawCursor(); + drawBackground(); + drawSelectionBackground(); + drawPreeditMarker(); + drawText(); + drawCursor(); - unbindEmbeddedChars(mGLFont); + unbindEmbeddedChars( mGLFont ); //RN: the decision was made to always show the orange border for keyboard focus but do not put an insertion caret // when in readonly mode @@ -3346,7 +3291,8 @@ void LLTextEditor::changeLine( S32 delta ) // if remembered position was reset (thus -1), calculate new one here if( desired_x_pixel == -1 ) { - desired_x_pixel = mGLFont->getWidth(mWText.c_str(), line_start, offset, mAllowEmbeddedItems ); + LLWString text(getWText()); + desired_x_pixel = mGLFont->getWidth(text.c_str(), line_start, offset, mAllowEmbeddedItems ); } S32 new_line = 0; @@ -3376,7 +3322,8 @@ void LLTextEditor::changeLine( S32 delta ) S32 new_line_len = new_line_end - new_line_start; S32 new_offset; - new_offset = mGLFont->charFromPixelOffset(mWText.c_str(), new_line_start, + LLWString text(getWText()); + new_offset = mGLFont->charFromPixelOffset(text.c_str(), new_line_start, (F32)desired_x_pixel, (F32)mTextRect.getWidth(), new_line_len, @@ -3424,7 +3371,7 @@ void LLTextEditor::getLineAndColumnForPosition( S32 position, S32* line, S32* co } else { - const LLWString &text = mWText; + LLWString text = getWText(); S32 line_count = 0; S32 line_start = 0; S32 i; @@ -3561,7 +3508,7 @@ void LLTextEditor::autoIndent() S32 space_count = 0; S32 i; - const LLWString &text = mWText; + LLWString text = getWText(); while( ' ' == text[line_start] ) { space_count++; @@ -3813,17 +3760,18 @@ void LLTextEditor::removeTextFromEnd(S32 num_chars) S32 LLTextEditor::insertStringNoUndo(const S32 pos, const LLWString &wstr) { - S32 old_len = mWText.length(); // length() returns character length + LLWString text(getWText()); + S32 old_len = text.length(); // length() returns character length S32 insert_len = wstr.length(); - mWText.insert(pos, wstr); - mTextIsUpToDate = FALSE; + text.insert(pos, wstr); + getViewModel()->setDisplay(text); if ( truncate() ) { // The user's not getting everything he's hoping for make_ui_sound("UISndBadKeystroke"); - insert_len = mWText.length() - old_len; + insert_len = getLength() - old_len; } return insert_len; @@ -3831,19 +3779,21 @@ S32 LLTextEditor::insertStringNoUndo(const S32 pos, const LLWString &wstr) S32 LLTextEditor::removeStringNoUndo(S32 pos, S32 length) { - mWText.erase(pos, length); - mTextIsUpToDate = FALSE; + LLWString text(getWText()); + text.erase(pos, length); + getViewModel()->setDisplay(text); return -length; // This will be wrong if someone calls removeStringNoUndo with an excessive length } S32 LLTextEditor::overwriteCharNoUndo(S32 pos, llwchar wc) { - if (pos > (S32)mWText.length()) + if (pos > (S32)getLength()) { return 0; } - mWText[pos] = wc; - mTextIsUpToDate = FALSE; + LLWString text(getWText()); + text[pos] = wc; + getViewModel()->setDisplay(text); return 1; } @@ -3912,11 +3862,16 @@ BOOL LLTextEditor::tryToRevertToPristineState() void LLTextEditor::updateTextRect() { + static LLUICachedControl<S32> texteditor_border ("UITextEditorBorder", 0); + static LLUICachedControl<S32> texteditor_h_pad ("UITextEditorHPad", 0); + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); + static LLUICachedControl<S32> texteditor_vpad_top ("UITextEditorVPadTop", 0); + mTextRect.setOriginAndSize( - UI_TEXTEDITOR_BORDER + UI_TEXTEDITOR_H_PAD, - UI_TEXTEDITOR_BORDER, - getRect().getWidth() - SCROLLBAR_SIZE - 2 * (UI_TEXTEDITOR_BORDER + UI_TEXTEDITOR_H_PAD), - getRect().getHeight() - 2 * UI_TEXTEDITOR_BORDER - UI_TEXTEDITOR_V_PAD_TOP ); + texteditor_border + texteditor_h_pad, + texteditor_border, + getRect().getWidth() - scrollbar_size - 2 * (texteditor_border + texteditor_h_pad), + getRect().getHeight() - 2 * texteditor_border - texteditor_vpad_top ); } void LLTextEditor::loadKeywords(const std::string& filename, @@ -3933,7 +3888,7 @@ void LLTextEditor::loadKeywords(const std::string& filename, mKeywords.addToken(LLKeywordToken::WORD, name, color, tooltips[i] ); } - mKeywords.findSegments( &mSegments, mWText, mDefaultColor ); + mKeywords.findSegments( &mSegments, getWText(), mDefaultColor.get() ); llassert( mSegments.front()->getStart() == 0 ); llassert( mSegments.back()->getEnd() == getLength() ); @@ -3945,7 +3900,7 @@ void LLTextEditor::updateSegments() if (mKeywords.isLoaded()) { // HACK: No non-ascii keywords for now - mKeywords.findSegments(&mSegments, mWText, mDefaultColor); + mKeywords.findSegments(&mSegments, getWText(), mDefaultColor.get()); } else if (mAllowEmbeddedItems) { @@ -3960,8 +3915,8 @@ void LLTextEditor::updateSegments() } if (mSegments.empty()) { - LLColor4& text_color = ( mReadOnly ? mReadOnlyFgColor : mFgColor ); - LLTextSegment* default_segment = new LLTextSegment( text_color, 0, mWText.length() ); + LLColor4 text_color = ( mReadOnly ? mReadOnlyFgColor.get() : mFgColor.get() ); + LLTextSegment* default_segment = new LLTextSegment( text_color, 0, getLength() ); default_segment->setIsDefault(TRUE); mSegments.push_back(default_segment); } @@ -3971,7 +3926,7 @@ void LLTextEditor::updateSegments() // *NOTE: Using this will invalidate references to mSegments from mLineStartList. void LLTextEditor::pruneSegments() { - S32 len = mWText.length(); + S32 len = getLength(); // Find and update the first valid segment segment_list_t::iterator iter = mSegments.end(); while(iter != mSegments.begin()) @@ -4008,7 +3963,7 @@ void LLTextEditor::findEmbeddedItemSegments() mSegments.clear(); BOOL found_embedded_items = FALSE; - const LLWString &text = mWText; + LLWString text = getWText(); S32 idx = 0; while( text[idx] ) { @@ -4029,7 +3984,7 @@ void LLTextEditor::findEmbeddedItemSegments() BOOL in_text = FALSE; - LLColor4& text_color = ( mReadOnly ? mReadOnlyFgColor : mFgColor ); + LLColor4 text_color = ( mReadOnly ? mReadOnlyFgColor.get() : mFgColor.get() ); if( idx > 0 ) { @@ -4222,7 +4177,7 @@ BOOL LLTextEditor::exportBuffer(std::string &buffer ) outstream << "Linden text version 1\n"; outstream << "{\n"; - outstream << llformat("Text length %d\n", mWText.length() ); + outstream << llformat("Text length %d\n", getLength() ); outstream << getText(); outstream << "}\n"; @@ -4297,103 +4252,6 @@ void LLTextSegment::dump() const } -// virtual -LLXMLNodePtr LLTextEditor::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - // Attributes - - node->createChild("max_length", TRUE)->setIntValue(getMaxLength()); - node->createChild("embedded_items", TRUE)->setBoolValue(mAllowEmbeddedItems); - node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mGLFont)); - node->createChild("word_wrap", TRUE)->setBoolValue(mWordWrap); - node->createChild("hide_scrollbar", TRUE)->setBoolValue(mHideScrollbarForShortDocs); - - addColorXML(node, mCursorColor, "cursor_color", "TextCursorColor"); - addColorXML(node, mFgColor, "text_color", "TextFgColor"); - addColorXML(node, mDefaultColor, "text_default_color", "TextDefaultColor"); - addColorXML(node, mReadOnlyFgColor, "text_readonly_color", "TextFgReadOnlyColor"); - addColorXML(node, mReadOnlyBgColor, "bg_readonly_color", "TextBgReadOnlyColor"); - addColorXML(node, mWriteableBgColor, "bg_writeable_color", "TextBgWriteableColor"); - addColorXML(node, mFocusBgColor, "bg_focus_color", "TextBgFocusColor"); - - // Contents - node->setStringValue(getText()); - - return node; -} - -// static -LLView* LLTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("text_editor"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - U32 max_text_length = 255; - node->getAttributeU32("max_length", max_text_length); - - BOOL allow_embedded_items; - node->getAttributeBOOL("embedded_items", allow_embedded_items); - - LLFontGL* font = LLView::selectFont(node); - - std::string text = node->getTextContents().substr(0, max_text_length - 1); - - LLTextEditor* text_editor = new LLTextEditor(name, - rect, - max_text_length, - text, - font, - allow_embedded_items); - - text_editor->setTextEditorParameters(node); - - BOOL hide_scrollbar = FALSE; - node->getAttributeBOOL("hide_scrollbar",hide_scrollbar); - text_editor->setHideScrollbarForShortDocs(hide_scrollbar); - - text_editor->initFromXML(node, parent); - - return text_editor; -} - -void LLTextEditor::setTextEditorParameters(LLXMLNodePtr node) -{ - BOOL word_wrap = FALSE; - node->getAttributeBOOL("word_wrap", word_wrap); - setWordWrap(word_wrap); - - node->getAttributeBOOL("show_line_numbers", mShowLineNumbers); - - node->getAttributeBOOL("track_bottom", mTrackBottom); - - LLColor4 color; - if (LLUICtrlFactory::getAttributeColor(node,"cursor_color", color)) - { - setCursorColor(color); - } - if(LLUICtrlFactory::getAttributeColor(node,"text_color", color)) - { - setFgColor(color); - } - if(LLUICtrlFactory::getAttributeColor(node,"text_readonly_color", color)) - { - setReadOnlyFgColor(color); - } - if(LLUICtrlFactory::getAttributeColor(node,"bg_readonly_color", color)) - { - setReadOnlyBgColor(color); - } - if(LLUICtrlFactory::getAttributeColor(node,"bg_writeable_color", color)) - { - setWriteableBgColor(color); - } -} - /////////////////////////////////////////////////////////////////// // Refactoring note: We may eventually want to replace this with boost::regex or // boost::tokenizer capabilities since we've already fixed at least two JIRAs @@ -4559,13 +4417,19 @@ BOOL LLTextEditor::findHTML(const std::string &line, S32 *begin, S32 *end) const void LLTextEditor::updateAllowingLanguageInput() { + LLWindow* window = getWindow(); + if (!window) + { + // test app, no window available + return; + } if (hasFocus() && !mReadOnly) { - getWindow()->allowLanguageTextInput(this, TRUE); + window->allowLanguageTextInput(this, TRUE); } else { - getWindow()->allowLanguageTextInput(this, FALSE); + window->allowLanguageTextInput(this, FALSE); } } @@ -4694,7 +4558,8 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect current_line++; } - const llwchar * const text = mWText.c_str(); + const LLWString textString(getWText()); + const llwchar * const text = textString.c_str(); const S32 line_height = llround(mGLFont->getLineHeight()); if (coord) @@ -4772,7 +4637,7 @@ void LLTextEditor::markAsPreedit(S32 position, S32 length) { llwarns << "markAsPreedit invoked when hasPreeditString is true." << llendl; } - mPreeditWString = LLWString( mWText, position, length ); + mPreeditWString = LLWString( getWText(), position, length ); if (length > 0) { mPreeditPositions.resize(2); @@ -4800,3 +4665,8 @@ S32 LLTextEditor::getPreeditFontSize() const { return llround(mGLFont->getLineHeight() * LLUI::sGLScaleFactor.mV[VY]); } + +LLWString LLTextEditor::getWText() const +{ + return getViewModel()->getDisplay(); +} diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 9291e1c436aaee93d67b96c2bf8cd3a08df58099..efedb30f4718d30b2e0231b3a98a40da3569efe7 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -43,18 +43,79 @@ #include "llstyle.h" #include "lleditmenuhandler.h" #include "lldarray.h" +#include "llviewborder.h" // for params #include "llpreeditor.h" +#include "llcontrol.h" class LLFontGL; class LLScrollbar; -class LLViewBorder; class LLKeywordToken; class LLTextCmd; class LLUICtrlFactory; class LLTextEditor : public LLUICtrl, LLEditMenuHandler, protected LLPreeditor { +public: + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<std::string> default_text; + Optional<S32> max_text_length; + + Optional<bool> read_only, + allow_embedded_items, + hide_scrollbar, + word_wrap, + ignore_tab, + hide_border, + track_bottom, + takes_non_scroll_clicks; + + //colors + Optional<LLUIColor> cursor_color, + default_color, + text_color, + text_readonly_color, + bg_readonly_color, + bg_writeable_color, + bg_focus_color; + + Optional<LLViewBorder::Params> border; + + Deprecated type, + length, + is_unicode; + + + Params() + : max_text_length("max_length", 255), + read_only("read_only", false), + allow_embedded_items("embedded_items", false), + hide_scrollbar("hide_scrollbar", false), + hide_border("hide_border", false), + word_wrap("word_wrap", false), + ignore_tab("ignore_tab", true), + track_bottom("track_bottom", false), + takes_non_scroll_clicks("takes_non_scroll_clicks", true), + cursor_color("cursor_color"), + default_color("default_color"), + text_color("text_color"), + text_readonly_color("text_readonly_color"), + bg_readonly_color("bg_readonly_color"), + bg_writeable_color("bg_writeable_color"), + bg_focus_color("bg_focus_color"), + length("length"), + type("type"), + is_unicode("is_unicode") + {} + + + }; + + void initFromParams(const Params&); +protected: + LLTextEditor(const Params&); + friend class LLUICtrlFactory; public: // // Constants @@ -63,18 +124,8 @@ public: static const llwchar LAST_EMBEDDED_CHAR = 0x10ffff; static const S32 MAX_EMBEDDED_ITEMS = LAST_EMBEDDED_CHAR - FIRST_EMBEDDED_CHAR + 1; - LLTextEditor(const std::string& name, - const LLRect& rect, - S32 max_length, - const std::string &default_text, - const LLFontGL* glfont = NULL, - BOOL allow_embedded_items = FALSE); - virtual ~LLTextEditor(); - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); - void setTextEditorParameters(LLXMLNodePtr node); void setParseHTML(BOOL parsing) {mParseHTML=parsing;} void setParseHighlights(BOOL parsing) {mParseHighlights=parsing;} @@ -195,8 +246,6 @@ public: void setReadOnlyBgColor( const LLColor4& c ) { mReadOnlyBgColor = c; } void setTrackColor( const LLColor4& color ); void setThumbColor( const LLColor4& color ); - void setHighlightColor( const LLColor4& color ); - void setShadowColor( const LLColor4& color ); // Hacky methods to make it into a word-wrapping, potentially scrolling, // read-only text box. @@ -235,9 +284,8 @@ public: // new methods void setValue(const LLSD& value); - LLSD getValue() const; - const std::string& getText() const; + std::string getText() const; // Non-undoable void setText(const LLStringExplicit &utf8str); @@ -255,9 +303,9 @@ public: BOOL isScrolledToBottom(); // Getters - const LLWString& getWText() const { return mWText; } - llwchar getWChar(S32 pos) const { return mWText[pos]; } - LLWString getWSubString(S32 pos, S32 len) const { return mWText.substr(pos, len); } + LLWString getWText() const; + llwchar getWChar(S32 pos) const { return getWText()[pos]; } + LLWString getWSubString(S32 pos, S32 len) const { return getWText().substr(pos, len); } const LLTextSegment* getCurrentSegment() const { return getSegmentAtOffset(mCursorPos); } const LLTextSegment* getPreviousSegment() const; @@ -270,7 +318,7 @@ protected: // Methods // - S32 getLength() const { return mWText.length(); } + S32 getLength() const { return getWText().length(); } void getSegmentAndOffset( S32 startpos, S32* segidxp, S32* offsetp ) const; void drawPreeditMarker(); @@ -439,8 +487,10 @@ private: // // Methods // - void pasteHelper(bool is_primary); + void pasteHelper(bool is_primary); + virtual LLTextViewModel* getViewModel() const; + void updateSegments(); void pruneSegments(); @@ -473,13 +523,10 @@ private: class LLTextCmdOverwriteChar; class LLTextCmdRemove; - LLWString mWText; - mutable std::string mUTF8Text; - mutable BOOL mTextIsUpToDate; - S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes const LLFontGL* mGLFont; + U8 mGLFontStyle; // the font style from xml class LLViewBorder* mBorder; @@ -519,14 +566,13 @@ private: LLFrameTimer mKeystrokeTimer; - LLColor4 mCursorColor; - - LLColor4 mFgColor; - LLColor4 mDefaultColor; - LLColor4 mReadOnlyFgColor; - LLColor4 mWriteableBgColor; - LLColor4 mReadOnlyBgColor; - LLColor4 mFocusBgColor; + LLUIColor mCursorColor; + LLUIColor mFgColor; + LLUIColor mDefaultColor; + LLUIColor mReadOnlyFgColor; + LLUIColor mWriteableBgColor; + LLUIColor mReadOnlyBgColor; + LLUIColor mFocusBgColor; BOOL mReadOnly; BOOL mWordWrap; diff --git a/indra/llui/lltextparser.cpp b/indra/llui/lltextparser.cpp index 227d24a8655c88507b23e4e6a9a071e97cdaf694..707dd0afdd985f339e31b35f39ae578614385984 100644 --- a/indra/llui/lltextparser.cpp +++ b/indra/llui/lltextparser.cpp @@ -1,10 +1,9 @@ /** - * @file lltexteditor.cpp - * @brief LLTextEditor base class + * @file lltextparser.cpp * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2007, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +11,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -31,6 +31,8 @@ #include "linden_common.h" +#include "lltextparser.h" + #include "llsd.h" #include "llsdserialize.h" #include "llerror.h" @@ -39,22 +41,12 @@ #include "message.h" #include "llmath.h" #include "v4color.h" -#include "audioengine.h" -#include "llwindow.h" #include "lldir.h" -#include "lltextparser.h" -//#include "lltexttospeech.h" - // Routines used for parsing text for TextParsers and html LLTextParser* LLTextParser::sInstance = NULL; -// -// Constants -// -const F32 SOUND_GAIN = 1.0f; - // // Member Functions // @@ -75,38 +67,7 @@ LLTextParser* LLTextParser::getInstance() return sInstance; } -void LLTextParser::triggerAlerts(LLUUID agent_id, LLVector3d position, std::string text, LLWindow* viewer_window) -{ -// bool spoken=FALSE; - for (S32 i=0;i<mHighlights.size();i++) - { - if (findPattern(text,mHighlights[i]) >= 0 ) - { - if(gAudiop) - { - if ((std::string)mHighlights[i]["sound_lluuid"] != LLUUID::null.asString()) - { - gAudiop->triggerSound(mHighlights[i]["sound_lluuid"].asUUID(), agent_id, SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_UI, position); - } -/* - if (!spoken) - { - LLTextToSpeech* text_to_speech = NULL; - text_to_speech = LLTextToSpeech::getInstance(); - spoken = text_to_speech->speak((LLString)mHighlights[i]["voice"],text); - } - */ - } - if (mHighlights[i]["flash"]) - { - if (viewer_window && viewer_window->getMinimized()) - { - viewer_window->flashIcon(5.f); - } - } - } - } -} +// Moved triggerAlerts() to llfloaterchat.cpp to break llui/llaudio library dependency. S32 LLTextParser::findPattern(const std::string &text, LLSD highlight) { diff --git a/indra/llui/lltextparser.h b/indra/llui/lltextparser.h index 5c5c3f3301bef1e3e3f9188ce12bdf8a40adc121..fb1a7758b7be677a40e60adc53b490a75f820ad2 100644 --- a/indra/llui/lltextparser.h +++ b/indra/llui/lltextparser.h @@ -3,6 +3,30 @@ * @brief GUI for user-defined highlights * * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ * */ @@ -10,12 +34,10 @@ #ifndef LL_LLTEXTPARSER_H #define LL_LLTEXTPARSER_H -#include <vector> -#include "linden_common.h" - #include "lltextparser.h" -class LLSD; +#include "llsd.h" + class LLUUID; class LLVector3d; class LLColor4; @@ -35,13 +57,13 @@ public: S32 findPattern(const std::string &text, LLSD highlight); LLSD parsePartialLineHighlights(const std::string &text,const LLColor4 &color,S32 part=WHOLE, S32 index=0); bool parseFullLineHighlights(const std::string &text, LLColor4 *color); - void triggerAlerts(LLUUID agent_id, LLVector3d position, std::string text, LLWindow* viewer_window); std::string getFileName(); LLSD loadFromDisk(); bool saveToDisk(LLSD highlights); + public: - LLSD mHighlights; + LLSD mHighlights; private: static LLTextParser* sInstance; }; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 57ce13c9c64eb7c871c11125d15cf49314344137..3c9759695d9013e0b4ebb8f31522e6315f0d7c64 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -50,10 +50,18 @@ // Project includes #include "llcontrol.h" #include "llui.h" +#include "lluicolortable.h" #include "llview.h" #include "lllineeditor.h" +#include "llfloater.h" +#include "llfloaterreg.h" +#include "llmenugl.h" #include "llwindow.h" +// for XUIParse +#include "llquaternion.h" +#include <boost/tokenizer.hpp> + // // Globals // @@ -65,18 +73,18 @@ BOOL gShowTextEditCursor = TRUE; // Language for UI construction std::map<std::string, std::string> gTranslation; std::list<std::string> gUntranslated; +/*static*/ LLUI::settings_map_t LLUI::sSettingGroups; +/*static*/ LLImageProviderInterface* LLUI::sImageProvider = NULL; +/*static*/ LLUIAudioCallback LLUI::sAudioCallback = NULL; +/*static*/ LLVector2 LLUI::sGLScaleFactor(1.f, 1.f); +/*static*/ LLWindow* LLUI::sWindow = NULL; +/*static*/ LLHtmlHelp* LLUI::sHtmlHelp = NULL; +/*static*/ LLView* LLUI::sRootView = NULL; +/*static*/ BOOL LLUI::sShowXUINames = FALSE; +/*static*/ std::stack<LLRect> LLScreenClipRect::sClipRectStack; + +/*static*/ std::vector<std::string> LLUI::sXUIPaths; -LLControlGroup* LLUI::sConfigGroup = NULL; -LLControlGroup* LLUI::sIgnoresGroup = NULL; -LLControlGroup* LLUI::sColorsGroup = NULL; -LLImageProviderInterface* LLUI::sImageProvider = NULL; -LLUIAudioCallback LLUI::sAudioCallback = NULL; -LLVector2 LLUI::sGLScaleFactor(1.f, 1.f); -LLWindow* LLUI::sWindow = NULL; -LLHtmlHelp* LLUI::sHtmlHelp = NULL; -BOOL LLUI::sShowXUINames = FALSE; -std::stack<LLRect> LLScreenClipRect::sClipRectStack; -BOOL LLUI::sQAMode = FALSE; // // Functions @@ -84,18 +92,18 @@ BOOL LLUI::sQAMode = FALSE; void make_ui_sound(const char* namep) { std::string name = ll_safe_string(namep); - if (!LLUI::sConfigGroup->controlExists(name)) + if (!LLUI::sSettingGroups["config"]->controlExists(name)) { llwarns << "tried to make ui sound for unknown sound name: " << name << llendl; } else { - LLUUID uuid(LLUI::sConfigGroup->getString(name)); + LLUUID uuid(LLUI::sSettingGroups["config"]->getString(name)); if (uuid.isNull()) { - if (LLUI::sConfigGroup->getString(name) == LLUUID::null.asString()) + if (LLUI::sSettingGroups["config"]->getString(name) == LLUUID::null.asString()) { - if (LLUI::sConfigGroup->getBOOL("UISndDebugSpamToggle")) + if (LLUI::sSettingGroups["config"]->getBOOL("UISndDebugSpamToggle")) { llinfos << "ui sound name: " << name << " triggered but silent (null uuid)" << llendl; } @@ -108,7 +116,7 @@ void make_ui_sound(const char* namep) } else if (LLUI::sAudioCallback != NULL) { - if (LLUI::sConfigGroup->getBOOL("UISndDebugSpamToggle")) + if (LLUI::sSettingGroups["config"]->getBOOL("UISndDebugSpamToggle")) { llinfos << "ui sound name: " << name << llendl; } @@ -1554,21 +1562,18 @@ bool handleShowXUINamesChanged(const LLSD& newvalue) return true; } -void LLUI::initClass(LLControlGroup* config, - LLControlGroup* ignores, - LLControlGroup* colors, +void LLUI::initClass(const settings_map_t& settings, LLImageProviderInterface* image_provider, LLUIAudioCallback audio_callback, const LLVector2* scale_factor, const std::string& language) { - sConfigGroup = config; - sIgnoresGroup = ignores; - sColorsGroup = colors; + sSettingGroups = settings; - if (sConfigGroup == NULL - || sIgnoresGroup == NULL - || sColorsGroup == NULL) + if ((get_ptr_in_map(sSettingGroups, std::string("config")) == NULL) || + (get_ptr_in_map(sSettingGroups, std::string("color")) == NULL) || + (get_ptr_in_map(sSettingGroups, std::string("floater")) == NULL) || + (get_ptr_in_map(sSettingGroups, std::string("ignores")) == NULL)) { llerrs << "Failure to initialize configuration groups" << llendl; } @@ -1577,16 +1582,31 @@ void LLUI::initClass(LLControlGroup* config, sAudioCallback = audio_callback; sGLScaleFactor = (scale_factor == NULL) ? LLVector2(1.f, 1.f) : *scale_factor; sWindow = NULL; // set later in startup - LLFontGL::sShadowColor = colors->getColor("ColorDropShadow"); + LLFontGL::sShadowColor = LLUI::sSettingGroups["color"]->getColor("ColorDropShadow"); - LLUI::sShowXUINames = LLUI::sConfigGroup->getBOOL("ShowXUINames"); - LLUI::sConfigGroup->getControl("ShowXUINames")->getSignal()->connect(&handleShowXUINamesChanged); + static LLUICachedControl<bool> show_xui_names ("ShowXUINames", false); + LLUI::sShowXUINames = show_xui_names; + LLUI::sSettingGroups["config"]->getControl("ShowXUINames")->getSignal()->connect(boost::bind(&handleShowXUINamesChanged, _2)); + + // Callbacks for associating controls with floater visibilty: + LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("Floater.Toggle", boost::bind(&LLFloaterReg::toggleFloaterInstance, _2)); + LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("Floater.Show", boost::bind(&LLFloaterReg::showFloaterInstance, _2)); + LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("Floater.Hide", boost::bind(&LLFloaterReg::hideFloaterInstance, _2)); + LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("Floater.InitToVisibilityControl", boost::bind(&LLFloaterReg::initUICtrlToFloaterVisibilityControl, _1, _2)); + + // Button initialization callback for toggle buttons + LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("Button.SetFloaterToggle", boost::bind(&LLButton::setFloaterToggle, _1, _2)); + + // Currently unused, but kept for reference: + LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("Button.ToggleFloater", boost::bind(&LLButton::toggleFloaterAndSetToggleState, _1, _2)); + + // Used by menus along with Floater.Toggle to display visibility as a checkmark + LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", boost::bind(&LLFloaterReg::floaterInstanceVisible, _2)); } void LLUI::cleanupClass() { sImageProvider->cleanUp(); - LLLineEditor::cleanupLineEditor(); } @@ -1678,26 +1698,60 @@ void LLUI::getCursorPositionLocal(const LLView* viewp, S32 *x, S32 *y) // static std::string LLUI::getLanguage() { - std::string language = "en-us"; - if (sConfigGroup) + std::string language = "en"; + if (sSettingGroups["config"]) { - language = sConfigGroup->getString("Language"); + language = sSettingGroups["config"]->getString("Language"); if (language.empty() || language == "default") { - language = sConfigGroup->getString("InstallLanguage"); + language = sSettingGroups["config"]->getString("InstallLanguage"); } if (language.empty() || language == "default") { - language = sConfigGroup->getString("SystemLanguage"); + language = sSettingGroups["config"]->getString("SystemLanguage"); } if (language.empty() || language == "default") { - language = "en-us"; + language = "en"; } } return language; } +//static +void LLUI::setupPaths() +{ + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml"); + + LLXMLNodePtr root; + BOOL success = LLXMLNode::parseFile(filename, root, NULL); + sXUIPaths.clear(); + + if (success) + { + LLStringUtil::format_map_t path_args; + path_args["[LANGUAGE]"] = LLUI::getLanguage(); + + for (LLXMLNodePtr path = root->getFirstChild(); path.notNull(); path = path->getNextSibling()) + { + std::string path_val_ui(path->getValue()); + LLStringUtil::format(path_val_ui, path_args); + if (std::find(sXUIPaths.begin(), sXUIPaths.end(), path_val_ui) == sXUIPaths.end()) + { + sXUIPaths.push_back(path_val_ui); + } + } + } + else // parsing failed + { + std::string slash = gDirUtilp->getDirDelimiter(); + std::string dir = "xui" + slash + "en"; + llwarns << "XUI::config file unable to open: " << filename << llendl; + sXUIPaths.push_back(dir); + } +} + + //static std::string LLUI::locateSkin(const std::string& filename) { @@ -1707,7 +1761,7 @@ std::string LLUI::locateSkin(const std::string& filename) { found_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); // Should be CUSTOM_SKINS? } - if (sConfigGroup && sConfigGroup->controlExists("Language")) + if (sSettingGroups["config"] && sSettingGroups["config"]->controlExists("Language")) { if (!gDirUtilp->fileExists(found_file)) { @@ -1718,7 +1772,7 @@ std::string LLUI::locateSkin(const std::string& filename) } if (!gDirUtilp->fileExists(found_file)) { - std::string local_skin = "xui" + slash + "en-us" + slash + filename; + std::string local_skin = "xui" + slash + "en" + slash + filename; found_file = gDirUtilp->findSkinnedFilename(local_skin); } if (!gDirUtilp->fileExists(found_file)) @@ -1765,10 +1819,23 @@ void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen) glPointToScreen(gl.mRight, gl.mBottom, &screen->mRight, &screen->mBottom); } +//static +LLPointer<LLUIImage> LLUI::getUIImageByID(const LLUUID& image_id) +{ + if (sImageProvider) + { + return sImageProvider->getUIImageByID(image_id); + } + else + { + return NULL; + } +} + //static -LLUIImage* LLUI::getUIImage(const std::string& name) +LLPointer<LLUIImage> LLUI::getUIImage(const std::string& name) { - if (!name.empty()) + if (!name.empty() && sImageProvider) return sImageProvider->getUIImage(name); else return NULL; @@ -1780,10 +1847,26 @@ void LLUI::setHtmlHelp(LLHtmlHelp* html_help) LLUI::sHtmlHelp = html_help; } -//static -void LLUI::setQAMode(BOOL b) +// static +boost::function<const LLColor4&()> LLUI::getCachedColorFunctor(const std::string& color_name) +{ + return LLCachedControl<LLColor4>(*sSettingGroups["color"], color_name, LLColor4::magenta); +} + +// static +LLControlGroup& LLUI::getControlControlGroup (const std::string& controlname) { - LLUI::sQAMode = b; + for (settings_map_t::iterator itor = sSettingGroups.begin(); + itor != sSettingGroups.end(); ++itor) + { + if(itor->second!= NULL) + { + if (sSettingGroups[(itor->first)]->controlExists(controlname)) + return *sSettingGroups[(itor->first)]; + } + } + + return *sSettingGroups["config"]; // default group } LLScreenClipRect::LLScreenClipRect(const LLRect& rect, BOOL enabled) : mScissorState(GL_SCISSOR_TEST), mEnabled(enabled) @@ -1849,102 +1932,163 @@ LLLocalClipRect::LLLocalClipRect(const LLRect &rect, BOOL enabled) { } - -// -// LLUIImage -// - -LLUIImage::LLUIImage(const std::string& name, LLPointer<LLImageGL> image) : - mName(name), - mImage(image), - mScaleRegion(0.f, 1.f, 1.f, 0.f), - mClipRegion(0.f, 1.f, 1.f, 0.f), - mUniformScaling(TRUE), - mNoClip(TRUE) +namespace LLInitParam { -} + TypedParam<LLUIColor >::TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func) + : super_t(descriptor, name, value, func), + red("red"), + green("green"), + blue("blue"), + alpha("alpha"), + control("") + {} -void LLUIImage::setClipRegion(const LLRectf& region) -{ - mClipRegion = region; - mNoClip = mClipRegion.mLeft == 0.f - && mClipRegion.mRight == 1.f - && mClipRegion.mBottom == 0.f - && mClipRegion.mTop == 1.f; -} + LLUIColor TypedParam<LLUIColor>::getValueFromBlock() const + { + if (control.isProvided()) + { + return LLUIColorTable::instance().getColor(control); + } + else + { + return LLColor4(red, green, blue, alpha); + } + } -void LLUIImage::setScaleRegion(const LLRectf& region) -{ - mScaleRegion = region; - mUniformScaling = mScaleRegion.mLeft == 0.f - && mScaleRegion.mRight == 1.f - && mScaleRegion.mBottom == 0.f - && mScaleRegion.mTop == 1.f; -} + void TypeValues<LLUIColor>::declareValues() + { + declare("white", LLColor4::white); + declare("black", LLColor4::black); + declare("red", LLColor4::red); + declare("green", LLColor4::green); + declare("blue", LLColor4::blue); + } -//TODO: move drawing implementation inside class -void LLUIImage::draw(S32 x, S32 y, const LLColor4& color) const -{ - gl_draw_image(x, y, mImage, color, mClipRegion); -} + TypedParam<const LLFontGL*>::TypedParam(BlockDescriptor& descriptor, const char* name, const LLFontGL*const value, ParamDescriptor::validation_func_t func) + : super_t(descriptor, name, value, func), + name("", std::string("")), + size("size", std::string("")), + style("style", std::string("")) + {} -void LLUIImage::draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const -{ - if (mUniformScaling) + const LLFontGL* TypedParam<const LLFontGL*>::getValueFromBlock() const { - gl_draw_scaled_image(x, y, width, height, mImage, color, mClipRegion); + if (name.isProvided()) + { + const LLFontGL* res_fontp = LLFontGL::getFontByName(name); + if (res_fontp) + { + return res_fontp; + } + + U8 fontstyle = 0; + fontstyle = LLFontGL::getStyleFromString(style()); + LLFontDescriptor desc(name(), size(), fontstyle); + const LLFontGL* fontp = LLFontGL::getFont(desc); + if (fontp) + { + return fontp; + } + } + + // default to current value + return mData.mValue; } - else + + TypedParam<LLRect>::TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func) + : super_t(descriptor, name, value, func), + left("left"), + top("top"), + right("right"), + bottom("bottom"), + width("width"), + height("height") + {} + + LLRect TypedParam<LLRect>::getValueFromBlock() const { - gl_draw_scaled_image_with_border( - x, y, - width, height, - mImage, - color, - FALSE, - mClipRegion, - mScaleRegion); - } -} + LLRect rect; -void LLUIImage::drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const -{ - gl_draw_scaled_image_with_border( - x, y, - width, height, - mImage, - color, - TRUE, - mClipRegion, - mScaleRegion); -} + //calculate from params + // prefer explicit left and right + if (left.isProvided() && right.isProvided()) + { + rect.mLeft = left; + rect.mRight = right; + } + // otherwise use width along with specified side, if any + else if (width.isProvided()) + { + // only right + width provided + if (right.isProvided()) + { + rect.mRight = right; + rect.mLeft = right - width; + } + else // left + width, or just width + { + rect.mLeft = left; + rect.mRight = left + width; + } + } + // just left, just right, or none + else + { + rect.mLeft = left; + rect.mRight = right; + } -void LLUIImage::drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, S32 border_width) const -{ - LLRect border_rect; - border_rect.setOriginAndSize(x, y, width, height); - border_rect.stretch(border_width, border_width); - drawSolid(border_rect, color); -} + // prefer explicit bottom and top + if (bottom.isProvided() && top.isProvided()) + { + rect.mBottom = bottom; + rect.mTop = top; + } + // otherwise height along with specified side, if any + else if (height.isProvided()) + { + // top + height provided + if (top.isProvided()) + { + rect.mTop = top; + rect.mBottom = top - height; + } + // bottom + height or just height + else + { + rect.mBottom = bottom; + rect.mTop = bottom + height; + } + } + // just bottom, just top, or none + else + { + rect.mBottom = bottom; + rect.mTop = top; + } + return rect; + } -S32 LLUIImage::getWidth() const -{ - // return clipped dimensions of actual image area - return llround((F32)mImage->getWidth(0) * mClipRegion.getWidth()); -} + void TypeValues<LLFontGL::HAlign>::declareValues() + { + declare("left", LLFontGL::LEFT); + declare("right", LLFontGL::RIGHT); + declare("center", LLFontGL::HCENTER); + } -S32 LLUIImage::getHeight() const -{ - // return clipped dimensions of actual image area - return llround((F32)mImage->getHeight(0) * mClipRegion.getHeight()); -} + void TypeValues<LLFontGL::VAlign>::declareValues() + { + declare("top", LLFontGL::TOP); + declare("center", LLFontGL::VCENTER); + declare("baseline", LLFontGL::BASELINE); + declare("bottom", LLFontGL::BOTTOM); + } -S32 LLUIImage::getTextureWidth() const -{ - return mImage->getWidth(0); + void TypeValues<LLFontGL::ShadowType>::declareValues() + { + declare("none", LLFontGL::NO_SHADOW); + declare("hard", LLFontGL::DROP_SHADOW); + declare("soft", LLFontGL::DROP_SHADOW_SOFT); + } } -S32 LLUIImage::getTextureHeight() const -{ - return mImage->getHeight(0); -} diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 6d6ce7a97c56fcbab337e2b7724edfae049d1c22..35c0bb478ebf8bfbf2fbaf2bca732fd7d7edefdc 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -35,28 +35,34 @@ #ifndef LL_LLUI_H #define LL_LLUI_H +#include "llpointer.h" // LLPointer<> #include "llrect.h" #include "llcontrol.h" -#include "llrect.h" #include "llcoord.h" //#include "llhtmlhelp.h" #include "llgl.h" // *TODO: break this dependency #include <stack> -//#include "llimagegl.h" +#include "lluiimage.h" // *TODO: break this dependency, need to add #include "lluiimage.h" to all widgets that hold an Optional<LLUIImage*> in their paramblocks +#include "llinitparam.h" +#include "llregistry.h" #include <boost/signals2.hpp> +#include "lllazyvalue.h" // LLUIFactory #include "llsd.h" +// for initparam specialization +#include "llfontgl.h" + class LLColor4; class LLHtmlHelp; class LLImageGL; class LLVector3; class LLVector2; +class LLUIImage; class LLUUID; class LLWindow; class LLView; -class LLUIImage; // UI colors extern const LLColor4 UI_VERTEX_COLOR; @@ -157,9 +163,8 @@ public: // // Methods // - static void initClass(LLControlGroup* config, - LLControlGroup* ignores, - LLControlGroup* colors, + typedef std::map<std::string, LLControlGroup*> settings_map_t; + static void initClass(const settings_map_t& settings, LLImageProviderInterface* image_provider, LLUIAudioCallback audio_callback = NULL, const LLVector2 *scale_factor = NULL, @@ -174,41 +179,46 @@ public: // Return the ISO639 language name ("en", "ko", etc.) for the viewer UI. // http://www.loc.gov/standards/iso639-2/php/code_list.php static std::string getLanguage(); + + static void setupPaths(); + static const std::vector<std::string>& getXUIPaths() { return sXUIPaths; } + static std::string getSkinPath() { return sXUIPaths.front(); } + static std::string getLocalizedSkinPath() { return sXUIPaths.back(); } //all files may not exist at the localized path //helper functions (should probably move free standing rendering helper functions here) + static LLView* getRootView() { return sRootView; } + static void setRootView(LLView* view) { sRootView = view; } static std::string locateSkin(const std::string& filename); static void setCursorPositionScreen(S32 x, S32 y); static void setCursorPositionLocal(const LLView* viewp, S32 x, S32 y); static void getCursorPositionLocal(const LLView* viewp, S32 *x, S32 *y); static void setScaleFactor(const LLVector2& scale_factor); static void setLineWidth(F32 width); - static LLUIImage* getUIImage(const std::string& name); + static LLPointer<LLUIImage> getUIImageByID(const LLUUID& image_id); + static LLPointer<LLUIImage> getUIImage(const std::string& name); static LLVector2 getWindowSize(); static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y); static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y); static void screenRectToGL(const LLRect& screen, LLRect *gl); static void glRectToScreen(const LLRect& gl, LLRect *screen); static void setHtmlHelp(LLHtmlHelp* html_help); - + static boost::function<const LLColor4&()> getCachedColorFunctor(const std::string& color_name); + // Returns the control group containing the control name, or the default group + static LLControlGroup& getControlControlGroup (const std::string& controlname); + // // Data // - static LLControlGroup* sConfigGroup; - static LLControlGroup* sIgnoresGroup; - static LLControlGroup* sColorsGroup; - static LLImageProviderInterface* sImageProvider; + static settings_map_t sSettingGroups; static LLUIAudioCallback sAudioCallback; static LLVector2 sGLScaleFactor; static LLWindow* sWindow; static BOOL sShowXUINames; static LLHtmlHelp* sHtmlHelp; - - // *TODO: remove the following when QAR-369 settings clean-up work is in. - // Also remove the call to this method which will then be obsolete. - // Search for QAR-369 below to enable the proper accessing of this feature. -MG - static void setQAMode(BOOL b); - static BOOL sQAMode; - + static LLView* sRootView; +private: + static LLImageProviderInterface* sImageProvider; + static std::vector<std::string> sXUIPaths; }; // FactoryPolicy is a static class that controls the creation and lookup of UI elements, @@ -365,7 +375,6 @@ protected: // T must derive from LLUISingleton<T> LLUISingleton() { sInstance = static_cast<T*>(this); } - ~LLUISingleton() { sInstance = NULL; } public: @@ -383,6 +392,12 @@ public: return sInstance; } + static void destroyInstance() + { + delete sInstance; + sInstance = NULL; + } + private: static T* sInstance; }; @@ -413,49 +428,6 @@ public: LLLocalClipRect(const LLRect& rect, BOOL enabled = TRUE); }; -class LLUIImage : public LLRefCount -{ -public: - LLUIImage(const std::string& name, LLPointer<LLImageGL> image); - - void setClipRegion(const LLRectf& region); - void setScaleRegion(const LLRectf& region); - - LLPointer<LLImageGL> getImage() { return mImage; } - const LLPointer<LLImageGL>& getImage() const { return mImage; } - - void draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color = UI_VERTEX_COLOR) const; - void draw(S32 x, S32 y, const LLColor4& color = UI_VERTEX_COLOR) const; - void draw(const LLRect& rect, const LLColor4& color = UI_VERTEX_COLOR) const { draw(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color); } - - void drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const; - void drawSolid(const LLRect& rect, const LLColor4& color) const { drawSolid(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color); } - void drawSolid(S32 x, S32 y, const LLColor4& color) const { drawSolid(x, y, mImage->getWidth(0), mImage->getHeight(0), color); } - - void drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, S32 border_width) const; - void drawBorder(const LLRect& rect, const LLColor4& color, S32 border_width) const { drawBorder(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color, border_width); } - void drawBorder(S32 x, S32 y, const LLColor4& color, S32 border_width) const { drawBorder(x, y, mImage->getWidth(0), mImage->getHeight(0), color, border_width); } - - const std::string& getName() const { return mName; } - - S32 getWidth() const; - S32 getHeight() const; - - // returns dimensions of underlying textures, which might not be equal to ui image portion - S32 getTextureWidth() const; - S32 getTextureHeight() const; - -protected: - std::string mName; - LLRectf mScaleRegion; - LLRectf mClipRegion; - LLPointer<LLImageGL> mImage; - BOOL mUniformScaling; - BOOL mNoClip; -}; - -typedef LLPointer<LLUIImage> LLUIImagePtr; - template <typename T> class LLTombStone : public LLRefCount { @@ -593,71 +565,15 @@ private: //RN: maybe this needs to moved elsewhere? class LLImageProviderInterface { -public: +protected: LLImageProviderInterface() {}; virtual ~LLImageProviderInterface() {}; - - virtual LLUIImagePtr getUIImage(const std::string& name) = 0; - virtual LLUIImagePtr getUIImageByID(const LLUUID& id) = 0; - virtual void cleanUp() = 0; -}; - -// This mix-in class adds support for tracking all instances of the specificed class parameter T -// The (optional) key associates a value of type KEY with a given instance of T, for quick lookup -// If KEY is not provided, then instances are stored in a simple list -template<typename T, typename KEY = T*> -class LLInstanceTracker : boost::noncopyable -{ public: - typedef typename std::map<KEY, T*>::iterator instance_iter; - typedef typename std::map<KEY, T*>::const_iterator instance_const_iter; - - static T* getInstance(KEY k) { instance_iter found = sInstances.find(k); return (found == sInstances.end()) ? NULL : found->second; } - - static instance_iter beginInstances() { return sInstances.begin(); } - static instance_iter endInstances() { return sInstances.end(); } - static S32 instanceCount() { return sInstances.size(); } -protected: - LLInstanceTracker(KEY key) { add(key); } - virtual ~LLInstanceTracker() { remove(); } - virtual void setKey(KEY key) { remove(); add(key); } - virtual const KEY& getKey() const { return mKey; } - -private: - void add(KEY key) - { - mKey = key; - sInstances[key] = static_cast<T*>(this); - } - void remove() { sInstances.erase(mKey); } - -private: - - KEY mKey; - static std::map<KEY, T*> sInstances; -}; - -template<typename T> -class LLInstanceTracker<T, T*> : boost::noncopyable -{ -public: - typedef typename std::set<T*>::iterator instance_iter; - typedef typename std::set<T*>::const_iterator instance_const_iter; - - static instance_iter instancesBegin() { return sInstances.begin(); } - static instance_iter instancesEnd() { return sInstances.end(); } - static S32 instanceCount() { return sInstances.size(); } - -protected: - LLInstanceTracker() { sInstances.insert(static_cast<T*>(this)); } - virtual ~LLInstanceTracker() { sInstances.erase(static_cast<T*>(this)); } - - static std::set<T*> sInstances; + virtual LLPointer<LLUIImage> getUIImage(const std::string& name) = 0; + virtual LLPointer<LLUIImage> getUIImageByID(const LLUUID& id) = 0; + virtual void cleanUp() = 0; }; -template <typename T, typename KEY> std::map<KEY, T*> LLInstanceTracker<T, KEY>::sInstances; -template <typename T> std::set<T*> LLInstanceTracker<T, T*>::sInstances; - class LLCallbackRegistry { public: @@ -746,93 +662,116 @@ private: template <typename T> LLRegisterWith<LLInitClassList> LLInitClass<T>::sRegister(&T::initClass); template <typename T> LLRegisterWith<LLDestroyClassList> LLDestroyClass<T>::sRegister(&T::destroyClass); +// useful parameter blocks +struct TimeIntervalParam : public LLInitParam::Choice<TimeIntervalParam> +{ + Option<F32> seconds; + Option<S32> frames; + TimeIntervalParam() + : seconds("seconds"), + frames("frames") + {} +}; -template <typename DERIVED> -class LLParamBlock +template <class T> +class LLUICachedControl : public LLCachedControl<T> { -protected: - LLParamBlock() { sBlock = (DERIVED*)this; } +public: + // This constructor will declare a control if it doesn't exist in the contol group + LLUICachedControl(const std::string& name, + const T& default_value, + const std::string& comment = "Declared In Code") + : LLCachedControl<T>(LLUI::getControlControlGroup(name), name, default_value, comment) + {} + + // This constructor will signal an error if the control doesn't exist in the control group + LLUICachedControl(const std::string& name) + : LLCachedControl<T>(LLUI::getControlControlGroup(name), name) + {} +}; - typedef typename boost::add_const<DERIVED>::type Tconst; +typedef LLLazyValue<LLColor4> LLUIColor; - template <typename T> - class LLMandatoryParam +namespace LLInitParam +{ + template<> + class TypedParam<LLRect> + : public BlockValue<LLRect> { + typedef BlockValue<LLRect> super_t; public: - typedef typename boost::add_const<T>::type T_const; + Optional<S32> left, + top, + right, + bottom, + width, + height; - LLMandatoryParam(T_const initial_val) : mVal(initial_val), mBlock(sBlock) {} - LLMandatoryParam(const LLMandatoryParam<T>& other) : mVal(other.mVal) {} + TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func); - DERIVED& operator ()(T_const set_value) { mVal = set_value; return *mBlock; } - operator T() const { return mVal; } - T operator=(T_const set_value) { mVal = set_value; return mVal; } + LLRect getValueFromBlock() const; + }; - private: - T mVal; - DERIVED* mBlock; + template<> + struct TypeValues<LLUIColor> : public TypeValuesHelper<LLUIColor> + { + static void declareValues(); }; - template <typename T> - class LLOptionalParam + template<> + class TypedParam<LLUIColor> + : public BlockValue<LLUIColor> { + typedef BlockValue<LLUIColor> super_t; public: - typedef typename boost::add_const<T>::type T_const; - - LLOptionalParam(T_const initial_val) : mVal(initial_val), mBlock(sBlock) {} - LLOptionalParam() : mBlock(sBlock) {} - LLOptionalParam(const LLOptionalParam<T>& other) : mVal(other.mVal) {} - - DERIVED& operator ()(T_const set_value) { mVal = set_value; return *mBlock; } - operator T() const { return mVal; } - T operator=(T_const set_value) { mVal = set_value; return mVal; } - - private: - T mVal; - DERIVED* mBlock; + Optional<F32> red; + Optional<F32> green; + Optional<F32> blue; + Optional<F32> alpha; + Optional<std::string> control; + + TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func); + LLUIColor getValueFromBlock() const; }; - // specialization that requires initialization for reference types - template <typename T> - class LLOptionalParam <T&> + template<> + class TypedParam<const LLFontGL*> + : public BlockValue<const LLFontGL*> { + typedef BlockValue<const LLFontGL*> super_t; public: - typedef typename boost::add_const<T&>::type T_const; + Optional<std::string> name; + Optional<std::string> size; + Optional<std::string> style; - LLOptionalParam(T_const initial_val) : mVal(initial_val), mBlock(sBlock) {} - LLOptionalParam(const LLOptionalParam<T&>& other) : mVal(other.mVal) {} - - DERIVED& operator ()(T_const set_value) { mVal = set_value; return *mBlock; } - operator T&() const { return mVal; } - T& operator=(T_const set_value) { mVal = set_value; return mVal; } + TypedParam(BlockDescriptor& descriptor, const char* name, const LLFontGL* const value, ParamDescriptor::validation_func_t func); + const LLFontGL* getValueFromBlock() const; + }; - private: - T& mVal; - DERIVED* mBlock; + template<> + struct TypeValues<LLFontGL::HAlign> : public TypeValuesHelper<LLFontGL::HAlign> + { + static void declareValues(); }; - // specialization that initializes pointer params to NULL - template<typename T> - class LLOptionalParam<T*> + template<> + struct TypeValues<LLFontGL::VAlign> : public TypeValuesHelper<LLFontGL::VAlign> { - public: - typedef typename boost::add_const<T*>::type T_const; - - LLOptionalParam(T_const initial_val) : mVal(initial_val), mBlock(sBlock) {} - LLOptionalParam() : mVal((T*)NULL), mBlock(sBlock) {} - LLOptionalParam(const LLOptionalParam<T*>& other) : mVal(other.mVal) {} - - DERIVED& operator ()(T_const set_value) { mVal = set_value; return *mBlock; } - operator T*() const { return mVal; } - T* operator=(T_const set_value) { mVal = set_value; return mVal; } - private: - T* mVal; - DERIVED* mBlock; + static void declareValues(); }; - static DERIVED* sBlock; -}; + template<> + struct TypeValues<LLFontGL::ShadowType> : public TypeValuesHelper<LLFontGL::ShadowType> + { + static void declareValues(); + }; +} -template <typename T> T* LLParamBlock<T>::sBlock = NULL; +namespace LLInitParam +{ + template<> + bool ParamCompare<LLLazyValue<LLColor4> >::equals( + const LLLazyValue<LLColor4> &a, const LLLazyValue<LLColor4> &b); +} #endif diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp new file mode 100644 index 0000000000000000000000000000000000000000..27ba6cc8b4d582d3505c1b127fa098ed446046ca --- /dev/null +++ b/indra/llui/lluicolortable.cpp @@ -0,0 +1,155 @@ +/** + * @file lluicolortable.cpp + * @brief brief LLUIColorTable class implementation file + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include <queue> + +#include "lluicolortable.h" + +LLUIColorTable::ColorParams::ColorParams() +: value("value"), + reference("reference") +{ +} + +LLUIColorTable::ColorEntryParams::ColorEntryParams() +: name("name"), + color("") +{ +} + +LLUIColorTable::Params::Params() +: color_entries("color_entries") +{ +} + +void LLUIColorTable::init(const Params& p) +{ + // this map will contain all color references after the following loop + typedef std::map<std::string, std::string> string_string_map_t; + string_string_map_t unresolved_refs; + + mColors.clear(); + for(LLInitParam::ParamIterator<ColorEntryParams>::const_iterator it = p.color_entries().begin(); + it != p.color_entries().end(); + ++it) + { + ColorEntryParams color_entry = *it; + if(color_entry.color.value.isChosen()) + { + mColors.insert(string_color_map_t::value_type(color_entry.name, color_entry.color.value)); + } + else + { + unresolved_refs.insert(string_string_map_t::value_type(color_entry.name, color_entry.color.reference)); + } + } + + // maintain an in order queue of visited references for better debugging of cycles + typedef std::queue<std::string> string_queue_t; + string_queue_t ref_chain; + + // maintain a map of the previously visited references in the reference chain for detecting cycles + typedef std::map<std::string, string_string_map_t::iterator> string_color_ref_iter_map_t; + string_color_ref_iter_map_t visited_refs; + + // loop through the unresolved color references until there are none left + while(!unresolved_refs.empty()) + { + // we haven't visited any references yet + visited_refs.clear(); + + string_string_map_t::iterator it = unresolved_refs.begin(); + while(true) + { + if(it != unresolved_refs.end()) + { + // locate the current reference in the previously visited references... + string_color_ref_iter_map_t::iterator visited = visited_refs.lower_bound(it->first); + if(visited != visited_refs.end() + && !(visited_refs.key_comp()(it->first, visited->first))) + { + // ...if we find the current reference in the previously visited references + // we know that there is a cycle + std::string ending_ref = it->first; + std::string warning("The following colors form a cycle: "); + + // warn about the references in the chain and remove them from + // the unresolved references map because they cannot be resolved + for(string_color_ref_iter_map_t::iterator iter = visited_refs.begin(); + iter != visited_refs.end(); + ++iter) + { + if(!ref_chain.empty()) + { + warning += ref_chain.front() + "->"; + ref_chain.pop(); + } + unresolved_refs.erase(iter->second); + } + + llwarns << warning + ending_ref << llendl; + + break; + } + else + { + // ...continue along the reference chain + ref_chain.push(it->first); + visited_refs.insert(visited, string_color_ref_iter_map_t::value_type(it->first, it)); + } + } + else + { + // since this reference does not refer to another reference it must refer to an + // actual color, lets find it... + string_color_map_t::iterator color_value = mColors.find(it->second); + + if(color_value != mColors.end()) + { + // ...we found the color, and we now add every reference in the reference chain + // to the color map + for(string_color_ref_iter_map_t::iterator iter = visited_refs.begin(); + iter != visited_refs.end(); + ++iter) + { + mColors.insert(string_color_map_t::value_type(iter->first, color_value->second)); + unresolved_refs.erase(iter->second); + } + + break; + } + else + { + // ... we did not find the color which imples that the current reference + // references a non-existant color + for(string_color_ref_iter_map_t::iterator iter = visited_refs.begin(); + iter != visited_refs.end(); + ++iter) + { + llwarns << iter->first << " references a non-existent color" << llendl; + unresolved_refs.erase(iter->second); + } + + break; + } + } + + // find the next color reference in the reference chain + it = unresolved_refs.find(it->second); + } + } +} + +const LLColor4& LLUIColorTable::getColor(const std::string& name) const +{ + string_color_map_t::const_iterator iter = mColors.find(name); + return (iter != mColors.end() ? iter->second : LLColor4::magenta); +} diff --git a/indra/llui/lluicolortable.h b/indra/llui/lluicolortable.h new file mode 100644 index 0000000000000000000000000000000000000000..89008758135a3a01b8d7e338e2e05b4328ef5404 --- /dev/null +++ b/indra/llui/lluicolortable.h @@ -0,0 +1,58 @@ +/** + * @file lluicolortable.h + * @brief brief LLUIColorTable class header file + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +#ifndef LL_LLUICOLORTABLE_H_ +#define LL_LLUICOLORTABLE_H_ + +#include <map> + +#include "llinitparam.h" +#include "llsingleton.h" + +#include "v4color.h" + +class LLUIColorTable : public LLSingleton<LLUIColorTable> +{ +public: + struct ColorParams : LLInitParam::Choice<ColorParams> + { + Option<LLColor4> value; + Option<std::string> reference; + + ColorParams(); + }; + + struct ColorEntryParams : LLInitParam::Block<ColorEntryParams> + { + Mandatory<std::string> name; + Mandatory<ColorParams> color; + + ColorEntryParams(); + }; + + struct Params : LLInitParam::Block<Params> + { + Multiple<ColorEntryParams> color_entries; + + Params(); + }; + + // define colors by passing in a param block that can be generated via XUI file or manually + void init(const Params& p); + + // color lookup + const LLColor4& getColor(const std::string& name) const; + +private: + // consider using sorted vector + typedef std::map<std::string, LLColor4> string_color_map_t; + string_color_map_t mColors; +}; + +#endif // LL_LLUICOLORTABLE_H diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 9d97312ab0c84cab48a723271bb51272d2885480..80ef7ebdf12d8da3264e710a3a1787ec21f3de3d 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -36,13 +36,30 @@ #include "lluictrl.h" #include "llfocusmgr.h" #include "llpanel.h" +#include "lluictrlfactory.h" -static LLRegisterWidget<LLUICtrl> r("ui_ctrl"); +static LLDefaultWidgetRegistry::Register<LLUICtrl> r("ui_ctrl"); + +LLUICtrl::Params::Params() +: tab_stop("tab_stop", true), + label("label"), + initial_value("initial_value"), + init_callback("init_callback"), + commit_callback("commit_callback"), + validate_callback("validate_callback"), + rightclick_callback("rightclick_callback"), + control_name("control_name") +{ + addSynonym(initial_value, "initial_val"); + // this is the canonical name for text contents of an xml node + addSynonym(initial_value, "value"); +} LLFocusableElement::LLFocusableElement() : mFocusLostCallback(NULL), mFocusReceivedCallback(NULL), mFocusChangedCallback(NULL), + mTopLostCallback(NULL), mFocusCallbackUserData(NULL) { } @@ -77,6 +94,14 @@ void LLFocusableElement::onFocusLost() } } +void LLFocusableElement::onTopLost() +{ + if (mTopLostCallback) + { + mTopLostCallback(this, mFocusCallbackUserData); + } +} + BOOL LLFocusableElement::hasFocus() const { return FALSE; @@ -86,36 +111,91 @@ void LLFocusableElement::setFocus(BOOL b) { } - - -LLUICtrl::LLUICtrl() : - mCommitCallback(NULL), - mLostTopCallback(NULL), - mValidateCallback(NULL), - mCallbackUserData(NULL), +LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel) +: LLView(p), mTentative(FALSE), - mTabStop(TRUE), - mIsChrome(FALSE) + mIsChrome(FALSE), + mViewModel(viewmodel), + mControlVariable(NULL), + mEnabledControlVariable(NULL), + mDisabledControlVariable(NULL) { + mUICtrlHandle.bind(this); } -LLUICtrl::LLUICtrl(const std::string& name, const LLRect& rect, BOOL mouse_opaque, - void (*on_commit_callback)(LLUICtrl*, void*), - void* callback_userdata, - U32 reshape) -: // can't make this automatically follow top and left, breaks lots - // of buttons in the UI. JC 7/20/2002 - LLView( name, rect, mouse_opaque, reshape ), - mCommitCallback( on_commit_callback) , - mLostTopCallback( NULL ), - mValidateCallback( NULL ), - mCallbackUserData( callback_userdata ), - mTentative( FALSE ), - mTabStop( TRUE ), - mIsChrome(FALSE) +void LLUICtrl::initFromParams(const Params& p) { + LLView::initFromParams(p); + + setControlName(p.control_name); + if(p.enabled_controls.isProvided()) + { + if (p.enabled_controls.enabled.isChosen()) + { + LLControlVariable* control = findControl(p.enabled_controls.enabled); + if (control) + setEnabledControlVariable(control); + } + else if(p.enabled_controls.disabled.isChosen()) + { + LLControlVariable* control = findControl(p.enabled_controls.disabled); + if (control) + setDisabledControlVariable(control); + } + } + if(p.controls_visibility.isProvided()) + { + if (p.controls_visibility.visible.isChosen()) + { + LLControlVariable* control = findControl(p.controls_visibility.visible); + if (control) + setMakeVisibleControlVariable(control); + } + else if (p.controls_visibility.invisible.isChosen()) + { + LLControlVariable* control = findControl(p.controls_visibility.invisible); + if (control) + setMakeInvisibleControlVariable(control); + } + } + + setTabStop(p.tab_stop); + setFocusLostCallback(p.focus_lost_callback()); + + if (p.initial_value.isProvided() + && !p.control_name.isProvided()) + { + setValue(p.initial_value); + } + + if (p.commit_callback.isProvided()) + initCommitCallback(p.commit_callback, mCommitSignal); + + if (p.validate_callback.isProvided()) + initEnableCallback(p.validate_callback, mValidateSignal); + + if (p.init_callback.isProvided()) + { + if (p.init_callback.function.isProvided()) + { + p.init_callback.function()(this, p.init_callback.parameter); + } + else + { + commit_callback_t* initfunc = (CallbackRegistry<commit_callback_t>::getValue(p.init_callback.function_name)); + if (initfunc) + { + (*initfunc)(this, p.init_callback.parameter); + } + } + } + + if(p.rightclick_callback.isProvided()) + initCommitCallback(p.rightclick_callback, mRightClickSignal); + } + LLUICtrl::~LLUICtrl() { gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() @@ -127,12 +207,60 @@ LLUICtrl::~LLUICtrl() } } -void LLUICtrl::onCommit() +void LLUICtrl::initCommitCallback(const CommitCallbackParam& cb, commit_signal_t& sig) { - if( mCommitCallback ) + if (cb.function.isProvided()) { - mCommitCallback( this, mCallbackUserData ); + if (cb.parameter.isProvided()) + sig.connect(boost::bind(cb.function(), _1, cb.parameter)); + else + sig.connect(cb.function()); } + else + { + std::string function_name = cb.function_name; + commit_callback_t* func = (CallbackRegistry<commit_callback_t>::getValue(function_name)); + if (func) + { + if (cb.parameter.isProvided()) + sig.connect(boost::bind((*func), _1, cb.parameter)); + else + sig.connect(*func); + } + else if (!function_name.empty()) + { + llwarns << "No callback found for: '" << function_name << "' in control: " << getName() << llendl; + } + } +} + +void LLUICtrl::initEnableCallback(const EnableCallbackParam& cb, enable_signal_t& sig) +{ + // Set the callback function + if (cb.function.isProvided()) + { + if (cb.parameter.isProvided()) + sig.connect(boost::bind(cb.function(), this, cb.parameter)); + else + sig.connect(cb.function()); + } + else + { + enable_callback_t* func = (EnableCallbackRegistry::getValue(cb.function_name)); + if (func) + { + if (cb.parameter.isProvided()) + sig.connect(boost::bind((*func), this, cb.parameter)); + else + sig.connect(*func); + } + } +} + + +void LLUICtrl::onCommit() +{ + mCommitSignal(this, getValue()); } //virtual @@ -141,10 +269,170 @@ BOOL LLUICtrl::isCtrl() const return TRUE; } +//virtual +void LLUICtrl::setValue(const LLSD& value) +{ + mViewModel->setValue(value); +} + //virtual LLSD LLUICtrl::getValue() const { - return LLSD(); + return mViewModel->getValue(); +} + +/// When two widgets are displaying the same data (e.g. during a skin +/// change), share their ViewModel. +void LLUICtrl::shareViewModelFrom(const LLUICtrl& other) +{ + // Because mViewModel is an LLViewModelPtr, this assignment will quietly + // dispose of the previous LLViewModel -- unless it's already shared by + // somebody else. + mViewModel = other.mViewModel; +} + +//virtual +LLViewModel* LLUICtrl::getViewModel() const +{ + return mViewModel; +} + +bool LLUICtrl::setControlValue(const LLSD& value) +{ + if (mControlVariable) + { + mControlVariable->set(value); + return true; + } + return false; +} + +void LLUICtrl::setControlVariable(LLControlVariable* control) +{ + if (mControlVariable) + { + //RN: this will happen in practice, should we try to avoid it? + //llwarns << "setControlName called twice on same control!" << llendl; + mControlConnection.disconnect(); // disconnect current signal + mControlVariable = NULL; + } + + if (control) + { + mControlVariable = control; + mControlConnection = mControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getUICtrlHandle(), std::string("value"))); + setValue(mControlVariable->getValue()); + } +} + +//virtual +void LLUICtrl::setControlName(const std::string& control_name, LLView *context) +{ + if (context == NULL) + { + context = this; + } + + // Register new listener + if (!control_name.empty()) + { + LLControlVariable* control = context->findControl(control_name); + setControlVariable(control); + } +} + +void LLUICtrl::setEnabledControlVariable(LLControlVariable* control) +{ + if (mEnabledControlVariable) + { + mEnabledControlConnection.disconnect(); // disconnect current signal + mEnabledControlVariable = NULL; + } + if (control) + { + mEnabledControlVariable = control; + mEnabledControlConnection = mEnabledControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getUICtrlHandle(), std::string("enabled"))); + setEnabled(mEnabledControlVariable->getValue().asBoolean()); + } +} + +void LLUICtrl::setDisabledControlVariable(LLControlVariable* control) +{ + if (mDisabledControlVariable) + { + mDisabledControlConnection.disconnect(); // disconnect current signal + mDisabledControlVariable = NULL; + } + if (control) + { + mDisabledControlVariable = control; + mDisabledControlConnection = mDisabledControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getUICtrlHandle(), std::string("disabled"))); + setEnabled(!(mDisabledControlVariable->getValue().asBoolean())); + } +} + +void LLUICtrl::setMakeVisibleControlVariable(LLControlVariable* control) +{ + if (mMakeVisibleControlVariable) + { + mMakeVisibleControlConnection.disconnect(); // disconnect current signal + mMakeVisibleControlVariable = NULL; + } + if (control) + { + mMakeVisibleControlVariable = control; + mMakeVisibleControlConnection = mMakeVisibleControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getUICtrlHandle(), std::string("visible"))); + setVisible(mMakeVisibleControlVariable->getValue().asBoolean()); + } +} + +void LLUICtrl::setMakeInvisibleControlVariable(LLControlVariable* control) +{ + if (mMakeInvisibleControlVariable) + { + mMakeInvisibleControlConnection.disconnect(); // disconnect current signal + mMakeInvisibleControlVariable = NULL; + } + if (control) + { + mMakeInvisibleControlVariable = control; + mMakeInvisibleControlConnection = mMakeInvisibleControlVariable->getSignal()->connect(boost::bind(&controlListener, _2, getUICtrlHandle(), std::string("invisible"))); + setVisible(!(mMakeInvisibleControlVariable->getValue().asBoolean())); + } +} +// static +bool LLUICtrl::controlListener(const LLSD& newvalue, LLHandle<LLUICtrl> handle, std::string type) +{ + LLUICtrl* ctrl = handle.get(); + if (ctrl) + { + if (type == "value") + { + ctrl->setValue(newvalue); + return true; + } + else if (type == "enabled") + { + ctrl->setEnabled(newvalue.asBoolean()); + return true; + } + else if(type =="disabled") + { + ctrl->setEnabled(!newvalue.asBoolean()); + return true; + } + else if (type == "visible") + { + ctrl->setVisible(newvalue.asBoolean()); + return true; + } + else if (type == "invisible") + { + ctrl->setVisible(!newvalue.asBoolean()); + return true; + } + } + return false; } // virtual @@ -248,12 +536,10 @@ void LLUICtrl::onFocusLost() } } -void LLUICtrl::onLostTop() +void LLUICtrl::onTopLost() { - if (mLostTopCallback) - { - mLostTopCallback(this, mCallbackUserData); - } + // trigger callbacks + LLFocusableElement::onTopLost(); } @@ -278,12 +564,13 @@ BOOL LLUICtrl::acceptsTextInput() const //virtual BOOL LLUICtrl::isDirty() const { - return FALSE; + return mViewModel->isDirty(); }; //virtual void LLUICtrl::resetDirty() { + mViewModel->resetDirty(); } // virtual @@ -456,7 +743,8 @@ BOOL LLUICtrl::focusNextItem(BOOL text_fields_only) { // this assumes that this method is called on the focus root. LLCtrlQuery query = getTabOrderQuery(); - if(text_fields_only || LLUI::sConfigGroup->getBOOL("TabToTextFieldsOnly")) + static LLUICachedControl<bool> tab_to_text_fields_only ("TabToTextFieldsOnly", false); + if(text_fields_only || tab_to_text_fields_only) { query.addPreFilter(LLUICtrl::LLTextInputFilter::getInstance()); } @@ -468,7 +756,8 @@ BOOL LLUICtrl::focusPrevItem(BOOL text_fields_only) { // this assumes that this method is called on the focus root. LLCtrlQuery query = getTabOrderQuery(); - if(text_fields_only || LLUI::sConfigGroup->getBOOL("TabToTextFieldsOnly")) + static LLUICachedControl<bool> tab_to_text_fields_only ("TabToTextFieldsOnly", false); + if(text_fields_only || tab_to_text_fields_only) { query.addPreFilter(LLUICtrl::LLTextInputFilter::getInstance()); } @@ -524,33 +813,6 @@ BOOL LLUICtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect return handled; }*/ -void LLUICtrl::initFromXML(LLXMLNodePtr node, LLView* parent) -{ - BOOL has_tab_stop = hasTabStop(); - node->getAttributeBOOL("tab_stop", has_tab_stop); - - setTabStop(has_tab_stop); - - LLView::initFromXML(node, parent); -} - -LLXMLNodePtr LLUICtrl::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLView::getXML(save_children); - node->createChild("tab_stop", TRUE)->setBoolValue(hasTabStop()); - - return node; -} - -//static -LLView* LLUICtrl::fromXML(LLXMLNodePtr node, LLView* parent, class LLUICtrlFactory* factory) -{ - LLUICtrl* ctrl = new LLUICtrl(); - ctrl->initFromXML(node, parent); - return ctrl; -} - - // Skip over any parents that are not LLUICtrl's // Used in focus logic since only LLUICtrl elements can have focus LLUICtrl* LLUICtrl::getParentUICtrl() const @@ -570,6 +832,16 @@ LLUICtrl* LLUICtrl::getParentUICtrl() const return NULL; } +// *TODO: Deprecate; for backwards compatability only: +boost::signals::connection LLUICtrl::setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data) +{ + return setCommitCallback( boost::bind(cb, _1, data)); +} +boost::signals::connection LLUICtrl::setValidateBeforeCommit( boost::function<bool (const LLSD& data)> cb ) +{ + return mValidateSignal.connect(boost::bind(cb, _2)); +} + // virtual void LLUICtrl::setTentative(BOOL b) { @@ -582,11 +854,6 @@ BOOL LLUICtrl::getTentative() const return mTentative; } -// virtual -void LLUICtrl::setDoubleClickCallback( void (*cb)(void*) ) -{ -} - // virtual void LLUICtrl::setColor(const LLColor4& color) { } @@ -598,3 +865,40 @@ void LLUICtrl::setMinValue(LLSD min_value) // virtual void LLUICtrl::setMaxValue(LLSD max_value) { } + + + +namespace LLInitParam +{ + template<> + bool ParamCompare<LLUICtrl::commit_callback_t>::equals( + const LLUICtrl::commit_callback_t &a, + const LLUICtrl::commit_callback_t &b) + { + return false; + } + + template<> + bool ParamCompare<LLUICtrl::focus_callback_t>::equals( + const LLUICtrl::focus_callback_t &a, + const LLUICtrl::focus_callback_t &b) + { + return false; + } + + template<> + bool ParamCompare<LLUICtrl::enable_callback_t>::equals( + const LLUICtrl::enable_callback_t &a, + const LLUICtrl::enable_callback_t &b) + { + return false; + } + + template<> + bool ParamCompare<LLLazyValue<LLColor4> >::equals( + const LLLazyValue<LLColor4> &a, + const LLLazyValue<LLColor4> &b) + { + return a.get() == b.get(); + } +} diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index db41af8470de9f2048c65649e809904f94b455d9..71f0a47f45b81577e015ebbd1e55673bd2eda3ea 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -34,10 +34,17 @@ #ifndef LL_LLUICTRL_H #define LL_LLUICTRL_H -#include "llview.h" +#include "llboost.h" #include "llrect.h" #include "llsd.h" +#include <boost/function.hpp> + +#include "llinitparam.h" +#include "llview.h" +#include "llviewmodel.h" +const BOOL TAKE_FOCUS_YES = TRUE; +const BOOL TAKE_FOCUS_NO = FALSE; class LLFocusableElement { @@ -49,39 +56,127 @@ public: virtual void setFocus( BOOL b ); virtual BOOL hasFocus() const; - void setFocusLostCallback(void (*cb)(LLFocusableElement* caller, void*), void* user_data = NULL) { mFocusLostCallback = cb; mFocusCallbackUserData = user_data; } - void setFocusReceivedCallback( void (*cb)(LLFocusableElement*, void*), void* user_data = NULL) { mFocusReceivedCallback = cb; mFocusCallbackUserData = user_data; } - void setFocusChangedCallback( void (*cb)(LLFocusableElement*, void*), void* user_data = NULL ) { mFocusChangedCallback = cb; mFocusCallbackUserData = user_data; } + typedef boost::function<void(LLFocusableElement*, void*)> focus_callback_t; + void setFocusLostCallback(focus_callback_t cb, void* user_data = NULL) { mFocusLostCallback = cb; mFocusCallbackUserData = user_data; } + void setFocusReceivedCallback(focus_callback_t cb, void* user_data = NULL) { mFocusReceivedCallback = cb; mFocusCallbackUserData = user_data; } + void setFocusChangedCallback(focus_callback_t cb, void* user_data = NULL ) { mFocusChangedCallback = cb; mFocusCallbackUserData = user_data; } + void setTopLostCallback(focus_callback_t cb, void* user_data = NULL ) { mTopLostCallback = cb; mFocusCallbackUserData = user_data; } protected: virtual void onFocusReceived(); virtual void onFocusLost(); - void (*mFocusLostCallback)( LLFocusableElement* caller, void* userdata ); - void (*mFocusReceivedCallback)( LLFocusableElement* ctrl, void* userdata ); - void (*mFocusChangedCallback)( LLFocusableElement* ctrl, void* userdata ); + virtual void onTopLost(); // called when registered as top ctrl and user clicks elsewhere + focus_callback_t mFocusLostCallback; + focus_callback_t mFocusReceivedCallback; + focus_callback_t mFocusChangedCallback; + focus_callback_t mTopLostCallback; void* mFocusCallbackUserData; }; class LLUICtrl -: public LLView, public LLFocusableElement + : public LLView, public LLFocusableElement, public boost::signals::trackable { public: - typedef void (*LLUICtrlCallback)(LLUICtrl* ctrl, void* userdata); - typedef BOOL (*LLUICtrlValidate)(LLUICtrl* ctrl, void* userdata); - - LLUICtrl(); - LLUICtrl( const std::string& name, const LLRect& rect, BOOL mouse_opaque, - LLUICtrlCallback callback, - void* callback_userdata, - U32 reshape=FOLLOWS_NONE); + + + typedef boost::function<void (LLUICtrl* ctrl, const LLSD& param)> commit_callback_t; + typedef boost::signal<void (LLUICtrl* ctrl, const LLSD& param)> commit_signal_t; + + typedef boost::function<bool (LLUICtrl* ctrl, const LLSD& param)> enable_callback_t; + typedef boost::signal<bool (LLUICtrl* ctrl, const LLSD& param), boost_boolean_combiner> enable_signal_t; + + struct CallbackParam : public LLInitParam::Block<CallbackParam> + { + Deprecated name; + + Optional<std::string> function_name; + Optional<LLSD> parameter; + + Optional<std::string> control_name; + + CallbackParam() + : name("name"), + function_name("function"), + parameter("parameter"), + control_name("control") // Shortcut to control -> "control_name" for backwards compatability + { + addSynonym(parameter, "userdata"); + } + }; + + struct CommitCallbackParam : public LLInitParam::Block<CommitCallbackParam, CallbackParam > + { + Optional<commit_callback_t> function; + }; + + struct EnableCallbackParam : public LLInitParam::Block<EnableCallbackParam, CallbackParam > + { + Optional<enable_callback_t> function; + }; + + struct EnableControls : public LLInitParam::Choice<EnableControls> + { + Option<std::string> enabled; + Option<std::string> disabled; + + EnableControls() + : enabled("enabled_control"), + disabled("disabled_control") + {} + }; + struct ControlVisibility : public LLInitParam::Choice<ControlVisibility> + { + Option<std::string> visible; + Option<std::string> invisible; + + ControlVisibility() + : visible("make_visible_control"), + invisible("make_invisible_control") + {} + }; + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Optional<std::string> label; + Optional<bool> tab_stop; + Optional<LLSD> initial_value; + + Optional<CommitCallbackParam> init_callback, + commit_callback; + Optional<EnableCallbackParam> validate_callback; + + Optional<CommitCallbackParam> rightclick_callback; + + Optional<focus_callback_t> focus_lost_callback; + + Optional<std::string> control_name; + Optional<EnableControls> enabled_controls; + Optional<ControlVisibility> controls_visibility; + + Params(); + }; + /*virtual*/ ~LLUICtrl(); + void initFromParams(const Params& p); +protected: + friend class LLUICtrlFactory; + LLUICtrl(const Params& p = LLUICtrl::Params(), + const LLViewModelPtr& viewmodel=LLViewModelPtr(new LLViewModel)); + + void initCommitCallback(const CommitCallbackParam& cb, commit_signal_t& sig); + void initEnableCallback(const EnableCallbackParam& cb, enable_signal_t& sig); + + // We need this virtual so we can override it with derived versions + virtual LLViewModel* getViewModel() const; + // We shouldn't ever need to set this directly + //virtual void setViewModel(const LLViewModelPtr&); + +public: // LLView interface - /*virtual*/ void initFromXML(LLXMLNodePtr node, LLView* parent); - /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; /*virtual*/ BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); /*virtual*/ void onFocusReceived(); /*virtual*/ void onFocusLost(); + /*virtual*/ void onTopLost(); /*virtual*/ BOOL isCtrl() const; /*virtual*/ void setTentative(BOOL b); /*virtual*/ BOOL getTentative() const; @@ -97,7 +192,23 @@ public: virtual class LLCtrlListInterface* getListInterface(); virtual class LLCtrlScrollInterface* getScrollInterface(); + bool setControlValue(const LLSD& value); + void setControlVariable(LLControlVariable* control); + virtual void setControlName(const std::string& control, LLView *context = NULL); + + LLControlVariable* getControlVariable() { return mControlVariable; } + + void setEnabledControlVariable(LLControlVariable* control); + void setDisabledControlVariable(LLControlVariable* control); + void setMakeVisibleControlVariable(LLControlVariable* control); + void setMakeInvisibleControlVariable(LLControlVariable* control); + + virtual void setValue(const LLSD& value); virtual LLSD getValue() const; + /// When two widgets are displaying the same data (e.g. during a skin + /// change), share their ViewModel. + virtual void shareViewModelFrom(const LLUICtrl& other); + virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); virtual void setIsChrome(BOOL is_chrome); @@ -108,14 +219,12 @@ public: virtual BOOL isDirty() const; // Defauls to false virtual void resetDirty(); //Defaults to no-op - // Call appropriate callbacks - virtual void onLostTop(); // called when registered as top ctrl and user clicks elsewhere + // Call appropriate callback virtual void onCommit(); // Default to no-op: virtual void onTabInto(); virtual void clear(); - virtual void setDoubleClickCallback( void (*cb)(void*) ); virtual void setColor(const LLColor4& color); virtual void setMinValue(LLSD min_value); virtual void setMaxValue(LLSD max_value); @@ -126,6 +235,7 @@ public: BOOL focusLastItem(BOOL prefer_text_fields = FALSE); // Non Virtuals + LLHandle<LLUICtrl> getUICtrlHandle() const { return mUICtrlHandle; } BOOL getIsChrome() const; void setTabStop( BOOL b ); @@ -133,16 +243,14 @@ public: LLUICtrl* getParentUICtrl() const; - void* getCallbackUserData() const { return mCallbackUserData; } - void setCallbackUserData( void* data ) { mCallbackUserData = data; } + boost::signals::connection setCommitCallback( const commit_signal_t::slot_type& cb ) { return mCommitSignal.connect(cb); } + boost::signals::connection setValidateCallback( const enable_signal_t::slot_type& cb ) { return mValidateSignal.connect(cb); } - void setCommitCallback( void (*cb)(LLUICtrl*, void*) ) { mCommitCallback = cb; } - void setValidateBeforeCommit( BOOL(*cb)(LLUICtrl*, void*) ) { mValidateCallback = cb; } - void setLostTopCallback( void (*cb)(LLUICtrl*, void*) ) { mLostTopCallback = cb; } + // *TODO: Deprecate; for backwards compatability only: + boost::signals::connection setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data); + boost::signals::connection setValidateBeforeCommit( boost::function<bool (const LLSD& data)> cb ); - static LLView* fromXML(LLXMLNodePtr node, LLView* parent, class LLUICtrlFactory* factory); - - LLUICtrl* findRootMostFocusRoot(); + LLUICtrl* findRootMostFocusRoot(); class LLTextInputFilter : public LLQueryFilter, public LLSingleton<LLTextInputFilter> { @@ -151,22 +259,59 @@ public: return filterResult_t(view->isCtrl() && static_cast<const LLUICtrl *>(view)->acceptsTextInput(), TRUE); } }; + + template <typename F> class CallbackRegistry : public LLRegistrySingleton<std::string, F, CallbackRegistry<F> > + {}; + typedef CallbackRegistry<commit_callback_t> CommitCallbackRegistry; + typedef CallbackRegistry<enable_callback_t> EnableCallbackRegistry; + protected: - void (*mCommitCallback)( LLUICtrl* ctrl, void* userdata ); - void (*mLostTopCallback)( LLUICtrl* ctrl, void* userdata ); - BOOL (*mValidateCallback)( LLUICtrl* ctrl, void* userdata ); + static bool controlListener(const LLSD& newvalue, LLHandle<LLUICtrl> handle, std::string type); - void* mCallbackUserData; + commit_signal_t mCommitSignal; + enable_signal_t mValidateSignal; + commit_signal_t mRightClickSignal; + LLViewModelPtr mViewModel; + + LLControlVariable* mControlVariable; + boost::signals::connection mControlConnection; + LLControlVariable* mEnabledControlVariable; + boost::signals::connection mEnabledControlConnection; + LLControlVariable* mDisabledControlVariable; + boost::signals::connection mDisabledControlConnection; + LLControlVariable* mMakeVisibleControlVariable; + boost::signals::connection mMakeVisibleControlConnection; + LLControlVariable* mMakeInvisibleControlVariable; + boost::signals::connection mMakeInvisibleControlConnection; private: BOOL mTabStop; BOOL mIsChrome; BOOL mTentative; + LLRootHandle<LLUICtrl> mUICtrlHandle; class DefaultTabGroupFirstSorter; }; +namespace LLInitParam +{ + template<> + bool ParamCompare<LLUICtrl::commit_callback_t>::equals( + const LLUICtrl::commit_callback_t &a, + const LLUICtrl::commit_callback_t &b); + + template<> + bool ParamCompare<LLUICtrl::enable_callback_t>::equals( + const LLUICtrl::enable_callback_t &a, + const LLUICtrl::enable_callback_t &b); + + template<> + bool ParamCompare<LLUICtrl::focus_callback_t>::equals( + const LLUICtrl::focus_callback_t &a, + const LLUICtrl::focus_callback_t &b); +} + #endif // LL_LLUICTRL_H diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 983cc53f69a437d65bd98f357d3df0c5d7cdd82d..24e4ad18e686a3f6526b46068d257b5c0cae6b9b 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -41,6 +41,8 @@ #include "llcontrol.h" #include "lldir.h" #include "v4color.h" +#include "v3dmath.h" +#include "llquaternion.h" // this library includes #include "llbutton.h" @@ -64,7 +66,6 @@ #include "llmultisliderctrl.h" #include "llspinctrl.h" #include "lltabcontainer.h" -#include "lltabcontainervertical.h" #include "lltextbox.h" #include "lltexteditor.h" #include "llui.h" @@ -77,37 +78,43 @@ const S32 VPAD = 4; const S32 FLOATER_H_MARGIN = 15; const S32 MIN_WIDGET_HEIGHT = 10; -std::vector<std::string> LLUICtrlFactory::sXUIPaths; +LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION("Widget Construction"); +LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS("Widget InitFromParams"); +LLFastTimer::DeclareTimer FTM_WIDGET_SETUP("Widget Setup"); + +//----------------------------------------------------------------------------- +// Register widgets that are purely data driven here so they get linked in +#include "llstatview.h" +static LLDefaultWidgetRegistry::Register<LLStatView> register_stat_view("stat_view"); + +//----------------------------------------------------------------------------- // UI Ctrl class for padding class LLUICtrlLocate : public LLUICtrl { public: - LLUICtrlLocate() : LLUICtrl(std::string("locate"), LLRect(0,0,0,0), FALSE, NULL, NULL) { setTabStop(FALSE); } - virtual void draw() { } - - static LLView *fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> { - std::string name("pad"); - node->getAttributeString("name", name); + Params() + { + name = "locate"; + tab_stop = false; + } + }; + + LLUICtrlLocate(const Params& p) : LLUICtrl(p) {} + virtual void draw() { } - LLUICtrlLocate *new_ctrl = new LLUICtrlLocate(); - new_ctrl->setName(name); - new_ctrl->initFromXML(node, parent); - return new_ctrl; - } }; -static LLRegisterWidget<LLUICtrlLocate> r1("locate"); -static LLRegisterWidget<LLUICtrlLocate> r2("pad"); +static LLDefaultWidgetRegistry::Register<LLUICtrlLocate> r1("locate"); //----------------------------------------------------------------------------- // LLUICtrlFactory() //----------------------------------------------------------------------------- LLUICtrlFactory::LLUICtrlFactory() - : mDummyPanel(NULL) + : mDummyPanel(NULL) // instantiated when first needed { - setupPaths(); } LLUICtrlFactory::~LLUICtrlFactory() @@ -116,141 +123,140 @@ LLUICtrlFactory::~LLUICtrlFactory() mDummyPanel = NULL; } -void LLUICtrlFactory::setupPaths() +void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitParam::BaseBlock& block) { - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml"); + std::string filename = std::string("widgets") + gDirUtilp->getDirDelimiter() + widget_tag + ".xml"; + LLXMLNodePtr root_node; - LLXMLNodePtr root; - BOOL success = LLXMLNode::parseFile(filename, root, NULL); - sXUIPaths.clear(); - - if (success) + if (LLUICtrlFactory::getLayeredXMLNode(filename, root_node)) { - LLXMLNodePtr path; - - for (path = root->getFirstChild(); path.notNull(); path = path->getNextSibling()) + LLXUIParser::instance().readXUI(root_node, block); + } +} + +//static +void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, LLXMLNodePtr output_node) +{ + if (node.isNull()) return; + + for (LLXMLNodePtr child_node = node->getFirstChild(); child_node.notNull(); child_node = child_node->getNextSibling()) + { + LLXMLNodePtr outputChild; + if (output_node) { - LLUIString path_val_ui(path->getValue()); - std::string language = LLUI::getLanguage(); - path_val_ui.setArg("[LANGUAGE]", language); + outputChild = output_node->createChild("", FALSE); + } - if (std::find(sXUIPaths.begin(), sXUIPaths.end(), path_val_ui.getString()) == sXUIPaths.end()) - { - sXUIPaths.push_back(path_val_ui.getString()); - } + if (!instance().createFromXML(child_node, viewp, LLStringUtil::null, outputChild, viewp->getChildRegistry())) + { + std::string child_name = std::string(child_node->getName()->mString); + llwarns << "Could not create widget named " << child_node->getName()->mString << llendl; + } + + if (outputChild && !outputChild->mChildren && outputChild->mAttributes.empty() && outputChild->getValue().empty()) + { + output_node->deleteChild(outputChild); } } - else // parsing failed - { - std::string slash = gDirUtilp->getDirDelimiter(); - std::string dir = "xui" + slash + "en-us"; - llwarns << "XUI::config file unable to open: " << filename << llendl; - sXUIPaths.push_back(dir); - } -} -// static -const std::vector<std::string>& LLUICtrlFactory::getXUIPaths() -{ - return sXUIPaths; } +LLFastTimer::DeclareTimer FTM_XML_PARSE("XML Reading/Parsing"); //----------------------------------------------------------------------------- // getLayeredXMLNode() //----------------------------------------------------------------------------- bool LLUICtrlFactory::getLayeredXMLNode(const std::string &xui_filename, LLXMLNodePtr& root) { - std::string full_filename = gDirUtilp->findSkinnedFilename(sXUIPaths.front(), xui_filename); - if (full_filename.empty()) - { - llwarns << "Couldn't find UI description file: " << sXUIPaths.front() + gDirUtilp->getDirDelimiter() + xui_filename << llendl; - return false; - } + LLFastTimer timer(FTM_XML_PARSE); + return LLXMLNode::getLayeredXMLNode(xui_filename, root, LLUI::getXUIPaths()); +} + +//----------------------------------------------------------------------------- +// getLocalizedXMLNode() +//----------------------------------------------------------------------------- +bool LLUICtrlFactory::getLocalizedXMLNode(const std::string &xui_filename, LLXMLNodePtr& root) +{ + LLFastTimer timer(FTM_XML_PARSE); + std::string full_filename = gDirUtilp->findSkinnedFilename(LLUI::getLocalizedSkinPath(), xui_filename); if (!LLXMLNode::parseFile(full_filename, root, NULL)) { - // try filename as passed in since sometimes we load an xml file from a user-supplied path - if (!LLXMLNode::parseFile(xui_filename, root, NULL)) - { - llwarns << "Problem reading UI description file: " << xui_filename << llendl; - return false; - } + return false; } - - LLXMLNodePtr updateRoot; - - std::vector<std::string>::const_iterator itor; - - for (itor = sXUIPaths.begin(), ++itor; itor != sXUIPaths.end(); ++itor) + else { - std::string nodeName; - std::string updateName; - - std::string layer_filename = gDirUtilp->findSkinnedFilename((*itor), xui_filename); - if(layer_filename.empty()) - { - // no localized version of this file, that's ok, keep looking - continue; - } - - if (!LLXMLNode::parseFile(layer_filename, updateRoot, NULL)) - { - llwarns << "Problem reading localized UI description file: " << (*itor) + gDirUtilp->getDirDelimiter() + xui_filename << llendl; - return false; - } - - updateRoot->getAttributeString("name", updateName); - root->getAttributeString("name", nodeName); - - if (updateName == nodeName) - { - LLXMLNode::updateNode(root, updateRoot); - } + return true; } - - return true; } +static LLFastTimer::DeclareTimer BUILD_FLOATERS("Build Floaters"); //----------------------------------------------------------------------------- // buildFloater() //----------------------------------------------------------------------------- -void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filename, - const LLCallbackMap::map_t* factory_map, BOOL open) /* Flawfinder: ignore */ +void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filename, BOOL open_floater, LLXMLNodePtr output_node) { + LLFastTimer timer(BUILD_FLOATERS); LLXMLNodePtr root; - if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) + //if exporting, only load the language being exported, + //instead of layering localized version on top of english + if (output_node) + { + if (!LLUICtrlFactory::getLocalizedXMLNode(filename, root)) + { + llwarns << "Couldn't parse floater from: " << LLUI::getLocalizedSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl; + return; + } + } + else if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) { + llwarns << "Couldn't parse floater from: " << LLUI::getSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl; return; } // root must be called floater - if( !(root->hasName("floater") || root->hasName("multi_floater") ) ) + if( !(root->hasName("floater") || root->hasName("multi_floater")) ) { llwarns << "Root node should be named floater in: " << filename << llendl; return; } - if (factory_map) + lldebugs << "Building floater " << filename << llendl; + mFileNames.push_back(gDirUtilp->findSkinnedFilename(LLUI::getSkinPath(), filename)); { - mFactoryStack.push_front(factory_map); - } + if (!floaterp->getFactoryMap().empty()) + { + mFactoryStack.push_front(&floaterp->getFactoryMap()); + } - floaterp->initFloaterXML(root, NULL, this, open); /* Flawfinder: ignore */ + // for local registry callbacks; define in constructor, referenced in XUI or postBuild + floaterp->getCommitCallbackRegistrar().pushScope(); + floaterp->getEnableCallbackRegistrar().pushScope(); + + floaterp->initFloaterXML(root, floaterp->getParent(), open_floater, output_node); - if (LLUI::sShowXUINames) - { - floaterp->setToolTip(filename); - } - - if (factory_map) - { - mFactoryStack.pop_front(); + if (LLUI::sShowXUINames) + { + floaterp->setToolTip(filename); + } + + floaterp->getCommitCallbackRegistrar().popScope(); + floaterp->getEnableCallbackRegistrar().popScope(); + + if (!floaterp->getFactoryMap().empty()) + { + mFactoryStack.pop_front(); + } } + mFileNames.pop_back(); +} - LLHandle<LLFloater> handle = floaterp->getHandle(); - mBuiltFloaters[handle] = filename; +LLFloater* LLUICtrlFactory::buildFloaterFromXML(const std::string& filename, BOOL open_floater) +{ + LLFloater* floater = new LLFloater(); + buildFloater(floater, filename, open_floater); + return floater; } //----------------------------------------------------------------------------- @@ -258,34 +264,33 @@ void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filen //----------------------------------------------------------------------------- S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename) { - llofstream out(filename); - if (!out.good()) - { - llwarns << "Unable to open " << filename << " for output." << llendl; - return 1; - } - - out << XML_HEADER; - - LLXMLNodePtr xml_node = viewp->getXML(); - - xml_node->writeToOstream(out); - - out.close(); return 0; } +static LLFastTimer::DeclareTimer BUILD_PANELS("Build Panels"); + //----------------------------------------------------------------------------- // buildPanel() //----------------------------------------------------------------------------- -BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename, - const LLCallbackMap::map_t* factory_map) +BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename, LLXMLNodePtr output_node) { + LLFastTimer timer(BUILD_PANELS); BOOL didPost = FALSE; LLXMLNodePtr root; - if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) + //if exporting, only load the language being exported, + //instead of layering localized version on top of english + if (output_node) + { + if (!LLUICtrlFactory::getLocalizedXMLNode(filename, root)) + { + llwarns << "Couldn't parse panel from: " << LLUI::getLocalizedSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl; + return didPost; + } + } + else if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) { + llwarns << "Couldn't parse panel from: " << LLUI::getSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl; return didPost; } @@ -296,246 +301,794 @@ BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename, return didPost; } - if (factory_map) + lldebugs << "Building panel " << filename << llendl; + + mFileNames.push_back(gDirUtilp->findSkinnedFilename(LLUI::getSkinPath(), filename)); { - mFactoryStack.push_front(factory_map); + if (!panelp->getFactoryMap().empty()) + { + mFactoryStack.push_front(&panelp->getFactoryMap()); + } + + // for local registry callbacks; define in constructor, referenced in XUI or postBuild + panelp->getCommitCallbackRegistrar().pushScope(); + panelp->getEnableCallbackRegistrar().pushScope(); + + didPost = panelp->initPanelXML(root, NULL, output_node); + + panelp->getCommitCallbackRegistrar().popScope(); + panelp->getEnableCallbackRegistrar().popScope(); + + if (LLUI::sShowXUINames) + { + panelp->setToolTip(filename); + } + + if (!panelp->getFactoryMap().empty()) + { + mFactoryStack.pop_front(); + } } + mFileNames.pop_back(); + return didPost; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +LLFastTimer::DeclareTimer FTM_CREATE_FROM_XML("Create child widget"); - didPost = panelp->initPanelXML(root, NULL, this); +LLView *LLUICtrlFactory::createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, LLXMLNodePtr output_node, const widget_registry_t& registry) +{ + LLFastTimer timer(FTM_CREATE_FROM_XML); + std::string ctrl_type = node->getName()->mString; + LLStringUtil::toLower(ctrl_type); - if (LLUI::sShowXUINames) + const LLWidgetCreatorFunc* funcp = registry.getValue(ctrl_type); + if (funcp == NULL) { - panelp->setToolTip(filename); + return NULL; } - LLHandle<LLPanel> handle = panelp->getHandle(); - mBuiltPanels[handle] = filename; - - if (factory_map) + if (parent == NULL) { - mFactoryStack.pop_front(); + if (mDummyPanel == NULL) + { + LLPanel::Params p; + mDummyPanel = create<LLPanel>(p); + } + parent = mDummyPanel; } - - return didPost; + LLView *view = (*funcp)(node, parent, output_node); + if (LLUI::sShowXUINames && view && !filename.empty()) + { + view->setToolTip(filename); + } + + return view; } //----------------------------------------------------------------------------- -// buildMenu() +// createFactoryPanel() //----------------------------------------------------------------------------- -LLMenuGL *LLUICtrlFactory::buildMenu(const std::string &filename, LLView* parentp) +LLPanel* LLUICtrlFactory::createFactoryPanel(const std::string& name) { - // TomY TODO: Break this function into buildMenu and buildMenuBar - LLXMLNodePtr root; - LLMenuGL* menu; - - if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) + std::deque<const LLCallbackMap::map_t*>::iterator itor; + for (itor = mFactoryStack.begin(); itor != mFactoryStack.end(); ++itor) { - return NULL; + const LLCallbackMap::map_t* factory_map = *itor; + + // Look up this panel's name in the map. + LLCallbackMap::map_const_iter_t iter = factory_map->find( name ); + if (iter != factory_map->end()) + { + // Use the factory to create the panel, instead of using a default LLPanel. + LLPanel *ret = (LLPanel*) iter->second.mCallback( iter->second.mData ); + return ret; + } } + LLPanel::Params panel_p; + return create<LLPanel>(panel_p); +} - // root must be called panel - if( !root->hasName( "menu_bar" ) && !root->hasName( "menu" )) +//----------------------------------------------------------------------------- + +//static +BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const std::string& name, LLColor4& color) +{ + std::string colorstring; + BOOL res = node->getAttributeString(name.c_str(), colorstring); + if (res && LLUI::sSettingGroups["color"]) { - llwarns << "Root node should be named menu bar or menu in : " << filename << llendl; - return NULL; + if (LLUI::sSettingGroups["color"]->controlExists(colorstring)) + { + color.setVec(LLUI::sSettingGroups["color"]->getColor(colorstring)); + } + else + { + res = FALSE; + } } + if (!res) + { + res = LLColor4::parseColor(colorstring, &color); + } + if (!res) + { + res = node->getAttributeColor(name.c_str(), color); + } + return res; +} - if (root->hasName("menu")) +//static +void LLUICtrlFactory::setCtrlParent(LLView* view, LLView* parent, S32 tab_group) +{ + if (tab_group < 0) tab_group = parent->getLastTabGroup(); + parent->addChild(view, tab_group); +} + + +// Avoid directly using LLUI and LLDir in the template code +//static +std::string LLUICtrlFactory::findSkinnedFilename(const std::string& filename) +{ + return gDirUtilp->findSkinnedFilename(LLUI::getSkinPath(), filename); +} + +void LLUICtrlFactory::pushFactoryFunctions(const LLCallbackMap::map_t* map) +{ + mFactoryStack.push_back(map); +} + +void LLUICtrlFactory::popFactoryFunctions() +{ + if (!mFactoryStack.empty()) { - menu = (LLMenuGL*)LLMenuGL::fromXML(root, parentp, this); + mFactoryStack.pop_back(); } - else +} + +const widget_registry_t& LLUICtrlFactory::getWidgetRegistry(LLView* viewp) +{ + return viewp->getChildRegistry(); +} + + +// +// LLXUIParser +// +LLXUIParser::LLXUIParser() +: mLastWriteGeneration(-1), + mCurReadDepth(0) +{ + registerParserFuncs<bool>(boost::bind(&LLXUIParser::readBoolValue, this, _1), + boost::bind(&LLXUIParser::writeBoolValue, this, _1, _2)); + registerParserFuncs<std::string>(boost::bind(&LLXUIParser::readStringValue, this, _1), + boost::bind(&LLXUIParser::writeStringValue, this, _1, _2)); + registerParserFuncs<U8>(boost::bind(&LLXUIParser::readU8Value, this, _1), + boost::bind(&LLXUIParser::writeU8Value, this, _1, _2)); + registerParserFuncs<S8>(boost::bind(&LLXUIParser::readS8Value, this, _1), + boost::bind(&LLXUIParser::writeS8Value, this, _1, _2)); + registerParserFuncs<U16>(boost::bind(&LLXUIParser::readU16Value, this, _1), + boost::bind(&LLXUIParser::writeU16Value, this, _1, _2)); + registerParserFuncs<S16>(boost::bind(&LLXUIParser::readS16Value, this, _1), + boost::bind(&LLXUIParser::writeS16Value, this, _1, _2)); + registerParserFuncs<U32>(boost::bind(&LLXUIParser::readU32Value, this, _1), + boost::bind(&LLXUIParser::writeU32Value, this, _1, _2)); + registerParserFuncs<S32>(boost::bind(&LLXUIParser::readS32Value, this, _1), + boost::bind(&LLXUIParser::writeS32Value, this, _1, _2)); + registerParserFuncs<F32>(boost::bind(&LLXUIParser::readF32Value, this, _1), + boost::bind(&LLXUIParser::writeF32Value, this, _1, _2)); + registerParserFuncs<F64>(boost::bind(&LLXUIParser::readF64Value, this, _1), + boost::bind(&LLXUIParser::writeF64Value, this, _1, _2)); + registerParserFuncs<LLColor4>(boost::bind(&LLXUIParser::readColor4Value, this, _1), + boost::bind(&LLXUIParser::writeColor4Value, this, _1, _2)); + registerParserFuncs<LLUIColor>(boost::bind(&LLXUIParser::readUIColorValue, this, _1), + boost::bind(&LLXUIParser::writeUIColorValue, this, _1, _2)); + registerParserFuncs<LLUUID>(boost::bind(&LLXUIParser::readUUIDValue, this, _1), + boost::bind(&LLXUIParser::writeUUIDValue, this, _1, _2)); + registerParserFuncs<LLSD>(boost::bind(&LLXUIParser::readSDValue, this, _1), + boost::bind(&LLXUIParser::writeSDValue, this, _1, _2)); +} + +static LLFastTimer::DeclareTimer PARSE_XUI("XUI Parsing"); + +void LLXUIParser::readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, bool silent) +{ + LLFastTimer timer(PARSE_XUI); + mNameStack.clear(); + mCurReadDepth = 0; + setParseSilently(silent); + + if (node.isNull()) { - menu = (LLMenuGL*)LLMenuBarGL::fromXML(root, parentp, this); + parserWarning("Invalid node"); } - - if (LLUI::sShowXUINames) + else { - menu->setToolTip(filename); + readXUIImpl(node, std::string(node->getName()->mString), block); } +} - return menu; +void LLXUIParser::writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock &block, const LLInitParam::BaseBlock* diff_block) +{ + mLastWriteGeneration = -1; + mWriteRootNode = node; + block.serializeBlock(*this, Parser::name_stack_t(), diff_block); } -//----------------------------------------------------------------------------- -// buildMenu() -//----------------------------------------------------------------------------- -LLPieMenu *LLUICtrlFactory::buildPieMenu(const std::string &filename, LLView* parentp) +// go from a stack of names to a specific XML node +LLXMLNodePtr LLXUIParser::getNode(const name_stack_t& stack) { - LLXMLNodePtr root; + name_stack_t name_stack; - if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) + for (name_stack_t::const_iterator it = stack.begin(); + it != stack.end(); + ++it) { - return NULL; + if (!it->first.empty()) + { + name_stack.push_back(*it); + } } - // root must be called panel - if( !root->hasName( LL_PIE_MENU_TAG )) + if (name_stack.empty() || mWriteRootNode.isNull()) return NULL; + + std::string attribute_name = name_stack.front().first; + + // heuristic to make font always attribute of parent node + bool is_font = (attribute_name == "font"); + // XML spec says that attributes have their whitespace normalized + // on parse: http://www.w3.org/TR/REC-xml/#AVNormalize + // Therefore text-oriented widgets that might have carriage returns + // have their values serialized as text contents, not the + // initial_value attribute. JC + if (attribute_name == "initial_value") { - llwarns << "Root node should be named " << LL_PIE_MENU_TAG << " in : " << filename << llendl; - return NULL; + const char* root_node_name = mWriteRootNode->getName()->mString; + if (!strcmp(root_node_name, "text") // LLTextBox + || !strcmp(root_node_name, "text_editor") + || !strcmp(root_node_name, "line_editor")) // for consistency + { + // writeStringValue will write to this node + return mWriteRootNode; + } } - std::string name("menu"); - root->getAttributeString("name", name); + for (name_stack_t::const_iterator it = ++name_stack.begin(); + it != name_stack.end(); + ++it) + { + attribute_name += "."; + attribute_name += it->first; + } - LLPieMenu *menu = new LLPieMenu(name); - parentp->addChild(menu); - menu->initXML(root, parentp, this); + // *NOTE: <string> elements for translation need to have whitespace + // preserved like "initial_value" above, however, the <string> node + // becomes an attribute of the containing floater or panel. + // Because all <string> elements must have a "name" attribute, and + // "name" is parsed first, just put the value into the last written + // child. + if (attribute_name == "string.value") + { + // The caller of will shortly call writeStringValue(), which sets + // this node's type to string, but we don't want to export type="string". + // Set the default for this node to suppress the export. + static LLXMLNodePtr default_node; + if (default_node.isNull()) + { + default_node = new LLXMLNode(); + // Force the node to have a string type + default_node->setStringValue( std::string() ); + } + mLastWrittenChild->setDefault(default_node); + // mLastWrittenChild is the "string" node part of "string.value", + // so the caller will call writeStringValue() into that node, + // setting the node text contents. + return mLastWrittenChild; + } + + LLXMLNodePtr attribute_node; - if (LLUI::sShowXUINames) + const char* attribute_cstr = attribute_name.c_str(); + if (name_stack.size() != 1 + && !is_font) { - menu->setToolTip(filename); + std::string child_node_name(mWriteRootNode->getName()->mString); + child_node_name += "."; + child_node_name += name_stack.front().first; + + LLXMLNodePtr child_node; + + if (mLastWriteGeneration == name_stack.front().second) + { + child_node = mLastWrittenChild; + } + else + { + mLastWriteGeneration = name_stack.front().second; + child_node = mWriteRootNode->createChild(child_node_name.c_str(), false); + } + + mLastWrittenChild = child_node; + + name_stack_t::const_iterator it = ++name_stack.begin(); + std::string short_attribute_name(it->first); + + for (++it; + it != name_stack.end(); + ++it) + { + short_attribute_name += "."; + short_attribute_name += it->first; + } + + if (child_node->hasAttribute(short_attribute_name.c_str())) + { + llerrs << "Attribute " << short_attribute_name << " already exists!" << llendl; + } + + attribute_node = child_node->createChild(short_attribute_name.c_str(), true); + } + else + { + if (mWriteRootNode->hasAttribute(attribute_cstr)) + { + mWriteRootNode->getAttribute(attribute_cstr, attribute_node); + } + else + { + attribute_node = mWriteRootNode->createChild(attribute_name.c_str(), true); + } } - return menu; + return attribute_node; } -//----------------------------------------------------------------------------- -// rebuild() -//----------------------------------------------------------------------------- -void LLUICtrlFactory::rebuild() + +bool LLXUIParser::readXUIImpl(LLXMLNodePtr nodep, const std::string& scope, LLInitParam::BaseBlock& block) { - built_panel_t::iterator built_panel_it; - for (built_panel_it = mBuiltPanels.begin(); - built_panel_it != mBuiltPanels.end(); - ++built_panel_it) + typedef boost::tokenizer<boost::char_separator<char> > tokenizer; + boost::char_separator<char> sep("."); + + bool values_parsed = false; + + // submit attributes for current node + values_parsed |= readAttributes(nodep, block); + + // treat text contents of xml node as "value" parameter + std::string text_contents = nodep->getSanitizedValue(); + if (!text_contents.empty()) { - std::string filename = built_panel_it->second; - LLPanel* panelp = built_panel_it->first.get(); - if (!panelp) + mCurReadNode = nodep; + mNameStack.push_back(std::make_pair(std::string("value"), newParseGeneration())); + // child nodes are not necessarily valid parameters (could be a child widget) + // so don't complain once we've recursed + bool silent = mCurReadDepth > 0; + block.submitValue(mNameStack, *this, silent); + mNameStack.pop_back(); + } + + // then traverse children + // child node must start with last name of parent node (our "scope") + // for example: "<button><button.param nested_param1="foo"><param.nested_param2 nested_param3="bar"/></button.param></button>" + // which equates to the following nesting: + // button + // param + // nested_param1 + // nested_param2 + // nested_param3 + mCurReadDepth++; + for(LLXMLNodePtr childp = nodep->getFirstChild(); childp.notNull();) + { + std::string child_name(childp->getName()->mString); + S32 num_tokens_pushed = 0; + + // for non "dotted" child nodes check to see if child node maps to another widget type + // and if not, treat as a child element of the current node + // e.g. <button><rect left="10"/></button> will interpret <rect> as "button.rect" + // since there is no widget named "rect" + if (child_name.find(".") == std::string::npos) + { + mNameStack.push_back(std::make_pair(child_name, newParseGeneration())); + num_tokens_pushed++; + } + else + { + // parse out "dotted" name into individual tokens + tokenizer name_tokens(child_name, sep); + + tokenizer::iterator name_token_it = name_tokens.begin(); + if(name_token_it == name_tokens.end()) + { + childp = childp->getNextSibling(); + continue; + } + + // check for proper nesting + if(!scope.empty() && *name_token_it != scope) + { + childp = childp->getNextSibling(); + continue; + } + + // now ignore first token + ++name_token_it; + + // copy remaining tokens on to our running token list + for(tokenizer::iterator token_to_push = name_token_it; token_to_push != name_tokens.end(); ++token_to_push) + { + mNameStack.push_back(std::make_pair(*token_to_push, newParseGeneration())); + num_tokens_pushed++; + } + } + + // recurse and visit children XML nodes + if(readXUIImpl(childp, mNameStack.empty() ? scope : mNameStack.back().first, block)) { - continue; + // child node successfully parsed, remove from DOM + + values_parsed = true; + LLXMLNodePtr node_to_remove = childp; + childp = childp->getNextSibling(); + + nodep->deleteChild(node_to_remove); + } + else + { + childp = childp->getNextSibling(); } - llinfos << "Rebuilding UI panel " << panelp->getName() - << " from " << filename - << llendl; - BOOL visible = panelp->getVisible(); - panelp->setVisible(FALSE); - panelp->setFocus(FALSE); - panelp->deleteAllChildren(); - buildPanel(panelp, filename.c_str(), &panelp->getFactoryMap()); - panelp->setVisible(visible); + while(num_tokens_pushed-- > 0) + { + mNameStack.pop_back(); + } } + mCurReadDepth--; + return values_parsed; +} + +bool LLXUIParser::readAttributes(LLXMLNodePtr nodep, LLInitParam::BaseBlock& block) +{ + typedef boost::tokenizer<boost::char_separator<char> > tokenizer; + boost::char_separator<char> sep("."); + + bool any_parsed = false; - built_floater_t::iterator built_floater_it; - for (built_floater_it = mBuiltFloaters.begin(); - built_floater_it != mBuiltFloaters.end(); - ++built_floater_it) + for(LLXMLAttribList::const_iterator attribute_it = nodep->mAttributes.begin(); + attribute_it != nodep->mAttributes.end(); + ++attribute_it) { - LLFloater* floaterp = built_floater_it->first.get(); - if (!floaterp) + S32 num_tokens_pushed = 0; + std::string attribute_name(attribute_it->first->mString); + mCurReadNode = attribute_it->second; + + tokenizer name_tokens(attribute_name, sep); + // copy remaining tokens on to our running token list + for(tokenizer::iterator token_to_push = name_tokens.begin(); token_to_push != name_tokens.end(); ++token_to_push) { - continue; + mNameStack.push_back(std::make_pair(*token_to_push, newParseGeneration())); + num_tokens_pushed++; } - std::string filename = built_floater_it->second; - llinfos << "Rebuilding UI floater " << floaterp->getName() - << " from " << filename - << llendl; - BOOL visible = floaterp->getVisible(); - floaterp->setVisible(FALSE); - floaterp->setFocus(FALSE); - floaterp->deleteAllChildren(); - gFloaterView->removeChild(floaterp); - buildFloater(floaterp, filename, &floaterp->getFactoryMap()); - floaterp->setVisible(visible); + // child nodes are not necessarily valid attributes, so don't complain once we've recursed + bool silent = mCurReadDepth > 0; + any_parsed |= block.submitValue(mNameStack, *this, silent); + + while(num_tokens_pushed-- > 0) + { + mNameStack.pop_back(); + } } + + return any_parsed; } -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- +bool LLXUIParser::readBoolValue(void* val_ptr) +{ + S32 value; + bool success = mCurReadNode->getBoolValue(1, &value); + *((bool*)val_ptr) = (value != FALSE); + return success; +} -LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node) +bool LLXUIParser::writeBoolValue(const void* val_ptr, const name_stack_t& stack) { - std::string ctrl_type = node->getName()->mString; - LLStringUtil::toLower(ctrl_type); - - LLWidgetClassRegistry::factory_func_t func = LLWidgetClassRegistry::getInstance()->getCreatorFunc(ctrl_type); + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) + { + node->setBoolValue(*((bool*)val_ptr)); + return true; + } + return false; +} - if (func == NULL) +bool LLXUIParser::readStringValue(void* val_ptr) +{ + *((std::string*)val_ptr) = mCurReadNode->getSanitizedValue(); + return true; +} + +bool LLXUIParser::writeStringValue(const void* val_ptr, const name_stack_t& stack) +{ + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) { - llwarns << "Unknown control type " << ctrl_type << llendl; - return NULL; + node->setStringValue(*((std::string*)val_ptr)); + return true; } + return false; +} - if (parent == NULL) +bool LLXUIParser::readU8Value(void* val_ptr) +{ + return mCurReadNode->getByteValue(1, (U8*)val_ptr); +} + +bool LLXUIParser::writeU8Value(const void* val_ptr, const name_stack_t& stack) +{ + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) { - if (mDummyPanel == NULL) - { - mDummyPanel = new LLPanel; - } - parent = mDummyPanel; + node->setUnsignedValue(*((U8*)val_ptr)); + return true; } - LLView *ctrl = func(node, parent, this); + return false; +} - return ctrl; +bool LLXUIParser::readS8Value(void* val_ptr) +{ + S32 value; + if(mCurReadNode->getIntValue(1, &value)) + { + *((S8*)val_ptr) = value; + return true; + } + return false; } -LLView* LLUICtrlFactory::createWidget(LLPanel *parent, LLXMLNodePtr node) +bool LLXUIParser::writeS8Value(const void* val_ptr, const name_stack_t& stack) { - LLView* view = createCtrlWidget(parent, node); + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) + { + node->setIntValue(*((S8*)val_ptr)); + return true; + } + return false; +} - S32 tab_group = parent->getLastTabGroup(); - node->getAttributeS32("tab_group", tab_group); +bool LLXUIParser::readU16Value(void* val_ptr) +{ + U32 value; + if(mCurReadNode->getUnsignedValue(1, &value)) + { + *((U16*)val_ptr) = value; + return true; + } + return false; +} - if (view) +bool LLXUIParser::writeU16Value(const void* val_ptr, const name_stack_t& stack) +{ + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) { - parent->addChild(view, tab_group); + node->setUnsignedValue(*((U16*)val_ptr)); + return true; } + return false; +} - return view; +bool LLXUIParser::readS16Value(void* val_ptr) +{ + S32 value; + if(mCurReadNode->getIntValue(1, &value)) + { + *((S16*)val_ptr) = value; + return true; + } + return false; } -//----------------------------------------------------------------------------- -// createFactoryPanel() -//----------------------------------------------------------------------------- -LLPanel* LLUICtrlFactory::createFactoryPanel(const std::string& name) +bool LLXUIParser::writeS16Value(const void* val_ptr, const name_stack_t& stack) { - std::deque<const LLCallbackMap::map_t*>::iterator itor; - for (itor = mFactoryStack.begin(); itor != mFactoryStack.end(); ++itor) + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) { - const LLCallbackMap::map_t* factory_map = *itor; + node->setIntValue(*((S16*)val_ptr)); + return true; + } + return false; +} - // Look up this panel's name in the map. - LLCallbackMap::map_const_iter_t iter = factory_map->find( name ); - if (iter != factory_map->end()) - { - // Use the factory to create the panel, instead of using a default LLPanel. - LLPanel *ret = (LLPanel*) iter->second.mCallback( iter->second.mData ); - return ret; - } +bool LLXUIParser::readU32Value(void* val_ptr) +{ + return mCurReadNode->getUnsignedValue(1, (U32*)val_ptr); +} + +bool LLXUIParser::writeU32Value(const void* val_ptr, const name_stack_t& stack) +{ + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) + { + node->setUnsignedValue(*((U32*)val_ptr)); + return true; } - return NULL; + return false; } -//----------------------------------------------------------------------------- +bool LLXUIParser::readS32Value(void* val_ptr) +{ + return mCurReadNode->getIntValue(1, (S32*)val_ptr); +} -//static -BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const std::string& name, LLColor4& color) +bool LLXUIParser::writeS32Value(const void* val_ptr, const name_stack_t& stack) { - std::string colorstring; - BOOL res = node->getAttributeString(name.c_str(), colorstring); - if (res && LLUI::sColorsGroup) + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) { - if (LLUI::sColorsGroup->controlExists(colorstring)) - { - color.setVec(LLUI::sColorsGroup->getColor(colorstring)); - } - else - { - res = FALSE; - } + node->setIntValue(*((S32*)val_ptr)); + return true; } - if (!res) + return false; +} + +bool LLXUIParser::readF32Value(void* val_ptr) +{ + return mCurReadNode->getFloatValue(1, (F32*)val_ptr); +} + +bool LLXUIParser::writeF32Value(const void* val_ptr, const name_stack_t& stack) +{ + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) { - res = LLColor4::parseColor(colorstring, &color); - } - if (!res) + node->setFloatValue(*((F32*)val_ptr)); + return true; + } + return false; +} + +bool LLXUIParser::readF64Value(void* val_ptr) +{ + return mCurReadNode->getDoubleValue(1, (F64*)val_ptr); +} + +bool LLXUIParser::writeF64Value(const void* val_ptr, const name_stack_t& stack) +{ + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) { - res = node->getAttributeColor(name.c_str(), color); + node->setDoubleValue(*((F64*)val_ptr)); + return true; } - return res; + return false; } +bool LLXUIParser::readColor4Value(void* val_ptr) +{ + LLColor4* colorp = (LLColor4*)val_ptr; + if(mCurReadNode->getFloatValue(4, colorp->mV) >= 3) + { + return true; + } + + return false; +} + +bool LLXUIParser::writeColor4Value(const void* val_ptr, const name_stack_t& stack) +{ + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) + { + LLColor4 color = *((LLColor4*)val_ptr); + node->setFloatValue(4, color.mV); + return true; + } + return false; +} + +bool LLXUIParser::readUIColorValue(void* val_ptr) +{ + LLUIColor* param = (LLUIColor*)val_ptr; + LLColor4 color; + bool success = mCurReadNode->getFloatValue(4, color.mV) >= 3; + if (success) + { + param->set(color); + return true; + } + return false; +} + +bool LLXUIParser::writeUIColorValue(const void* val_ptr, const name_stack_t& stack) +{ + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) + { + LLUIColor color = *((LLUIColor*)val_ptr); + //RN: don't write out the color that is represented by a function + // rely on param block exporting to get the reference to the color settings + if (color.isUsingFunction()) return false; + node->setFloatValue(4, color.get().mV); + return true; + } + return false; +} + +bool LLXUIParser::readUUIDValue(void* val_ptr) +{ + LLUUID temp_id; + // LLUUID::set is destructive, so use temporary value + if (temp_id.set(mCurReadNode->getSanitizedValue())) + { + *(LLUUID*)(val_ptr) = temp_id; + return true; + } + return false; +} + +bool LLXUIParser::writeUUIDValue(const void* val_ptr, const name_stack_t& stack) +{ + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) + { + node->setStringValue(((LLUUID*)val_ptr)->asString()); + return true; + } + return false; +} + +bool LLXUIParser::readSDValue(void* val_ptr) +{ + *((LLSD*)val_ptr) = LLSD(mCurReadNode->getSanitizedValue()); + return true; +} + +bool LLXUIParser::writeSDValue(const void* val_ptr, const name_stack_t& stack) +{ + LLXMLNodePtr node = getNode(stack); + if (node.notNull()) + { + node->setStringValue(((LLSD*)val_ptr)->asString()); + return true; + } + return false; +} + +/*virtual*/ std::string LLXUIParser::getCurrentElementName() +{ + std::string full_name; + for (name_stack_t::iterator it = mNameStack.begin(); + it != mNameStack.end(); + ++it) + { + full_name += it->first + "."; // build up dotted names: "button.param.nestedparam." + } + + return full_name; +} + +void LLXUIParser::parserWarning(const std::string& message) +{ +#ifdef LL_WINDOWS + // use Visual Studo friendly formatting of output message for easy access to originating xml + llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", LLUICtrlFactory::getInstance()->getCurFileName().c_str(), mCurReadNode->getLineNumber(), message.c_str()).c_str()); + utf16str += '\n'; + OutputDebugString(utf16str.c_str()); +#else + Parser::parserWarning(message); +#endif +} + +void LLXUIParser::parserError(const std::string& message) +{ +#ifdef LL_WINDOWS + llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", LLUICtrlFactory::getInstance()->getCurFileName().c_str(), mCurReadNode->getLineNumber(), message.c_str()).c_str()); + utf16str += '\n'; + OutputDebugString(utf16str.c_str()); +#else + Parser::parserError(message); +#endif +} diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 5e7c24efc07df1e2b57137c8c4b5a36f2c8e812e..4045022c8e568ad9ae335d5b3240e42157b43af8 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -33,68 +33,418 @@ #ifndef LLUICTRLFACTORY_H #define LLUICTRLFACTORY_H +#include "llcallbackmap.h" +#include "llinitparam.h" +#include "llxmlnode.h" +#include "llfasttimer.h" + +#include <boost/function.hpp> #include <iosfwd> #include <stack> -#include "llcallbackmap.h" -#include "llfloater.h" - -class LLView; class LLPanel; +class LLFloater; +class LLView; -class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory> +class LLXUIParser : public LLInitParam::Parser, public LLSingleton<LLXUIParser> { +LOG_CLASS(LLXUIParser); + +protected: + LLXUIParser(); + friend class LLSingleton<LLXUIParser>; public: + typedef LLInitParam::Parser::name_stack_t name_stack_t; + + /*virtual*/ std::string getCurrentElementName(); + /*virtual*/ void parserWarning(const std::string& message); + /*virtual*/ void parserError(const std::string& message); + + void readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, bool silent=false); + void writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const LLInitParam::BaseBlock* diff_block = NULL); + +private: + typedef std::list<std::pair<std::string, bool> > token_list_t; + + bool readXUIImpl(LLXMLNodePtr node, const std::string& scope, LLInitParam::BaseBlock& block); + bool readAttributes(LLXMLNodePtr nodep, LLInitParam::BaseBlock& block); + + //reader helper functions + bool readBoolValue(void* val_ptr); + bool readStringValue(void* val_ptr); + bool readU8Value(void* val_ptr); + bool readS8Value(void* val_ptr); + bool readU16Value(void* val_ptr); + bool readS16Value(void* val_ptr); + bool readU32Value(void* val_ptr); + bool readS32Value(void* val_ptr); + bool readF32Value(void* val_ptr); + bool readF64Value(void* val_ptr); + bool readColor4Value(void* val_ptr); + bool readUIColorValue(void* val_ptr); + bool readUUIDValue(void* val_ptr); + bool readSDValue(void* val_ptr); + + //writer helper functions + bool writeBoolValue(const void* val_ptr, const name_stack_t&); + bool writeStringValue(const void* val_ptr, const name_stack_t&); + bool writeU8Value(const void* val_ptr, const name_stack_t&); + bool writeS8Value(const void* val_ptr, const name_stack_t&); + bool writeU16Value(const void* val_ptr, const name_stack_t&); + bool writeS16Value(const void* val_ptr, const name_stack_t&); + bool writeU32Value(const void* val_ptr, const name_stack_t&); + bool writeS32Value(const void* val_ptr, const name_stack_t&); + bool writeF32Value(const void* val_ptr, const name_stack_t&); + bool writeF64Value(const void* val_ptr, const name_stack_t&); + bool writeColor4Value(const void* val_ptr, const name_stack_t&); + bool writeUIColorValue(const void* val_ptr, const name_stack_t&); + bool writeUUIDValue(const void* val_ptr, const name_stack_t&); + bool writeSDValue(const void* val_ptr, const name_stack_t&); + + LLXMLNodePtr getNode(const name_stack_t& stack); + +private: + Parser::name_stack_t mNameStack; + LLXMLNodePtr mCurReadNode; + // Root of the widget XML sub-tree, for example, "line_editor" + LLXMLNodePtr mWriteRootNode; + S32 mLastWriteGeneration; + LLXMLNodePtr mLastWrittenChild; + S32 mCurReadDepth; +}; + +// global static instance for registering all widget types +typedef boost::function<LLView* (LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node)> LLWidgetCreatorFunc; + +typedef LLRegistry<std::string, LLWidgetCreatorFunc> widget_registry_t; + +template <typename DERIVED_TYPE> +class LLWidgetRegistry : public LLRegistrySingleton<std::string, LLWidgetCreatorFunc, DERIVED_TYPE> +{ +public: + typedef LLRegistrySingleton<std::string, LLWidgetCreatorFunc, DERIVED_TYPE> super_t; + // local static instance for registering a particular widget + template<typename T, typename PARAM_BLOCK = typename T::Params> + class Register : public super_t::StaticRegistrar + { + public: + // register with either the provided builder, or the generic templated builder + Register(const char* tag, LLWidgetCreatorFunc func = NULL); + }; + +protected: + LLWidgetRegistry() {} +}; + +class LLDefaultWidgetRegistry : public LLWidgetRegistry<LLDefaultWidgetRegistry> +{ +protected: + LLDefaultWidgetRegistry() {} + friend class LLSingleton<LLDefaultWidgetRegistry>; +}; + +struct LLCompareTypeID +{ + bool operator()(const std::type_info* lhs, const std::type_info* rhs) const + { + return lhs->before(*rhs); + } +}; + + +class LLWidgetTemplateRegistry +: public LLRegistrySingleton<const std::type_info*, std::string, LLWidgetTemplateRegistry, LLCompareTypeID> +{ + +}; + +extern LLFastTimer::DeclareTimer FTM_WIDGET_SETUP; +extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION; +extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS; + +class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory> +{ +private: + friend class LLSingleton<LLUICtrlFactory>; LLUICtrlFactory(); - // do not call! needs to be public so run-time can clean up the singleton - virtual ~LLUICtrlFactory(); + ~LLUICtrlFactory(); + + // only partial specialization allowed in inner classes, so use extra dummy parameter + template <typename T, int DUMMY> + class ParamDefaults : public LLSingleton<ParamDefaults<T, DUMMY> > + { + public: + ParamDefaults() + { + // recursively initialize from base class param block + ((typename T::base_block_t&)mPrototype).fillFrom(ParamDefaults<typename T::base_block_t, DUMMY>::instance().get()); + // after initializing base classes, look up template file for this param block + std::string* param_block_tag = LLWidgetTemplateRegistry::instance().getValue(&typeid(T)); + if (param_block_tag) + { + LLUICtrlFactory::loadWidgetTemplate(*param_block_tag, mPrototype); + } + } + + const T& get() { return mPrototype; } - void setupPaths(); + private: + T mPrototype; + }; - void buildFloater(LLFloater* floaterp, const std::string &filename, - const LLCallbackMap::map_t* factory_map = NULL, BOOL open = TRUE); - BOOL buildPanel(LLPanel* panelp, const std::string &filename, - const LLCallbackMap::map_t* factory_map = NULL); + // base case for recursion, there are NO base classes of LLInitParam::BaseBlock + template<int DUMMY> + class ParamDefaults<LLInitParam::BaseBlock, DUMMY> : public LLSingleton<ParamDefaults<LLInitParam::BaseBlock, DUMMY> > + { + public: + const LLInitParam::BaseBlock& get() { return mBaseBlock; } + private: + LLInitParam::BaseBlock mBaseBlock; + }; - void removePanel(LLPanel* panelp) { mBuiltPanels.erase(panelp->getHandle()); } - void removeFloater(LLFloater* floaterp) { mBuiltFloaters.erase(floaterp->getHandle()); } +public: + + template<typename T> + static const T& getDefaultParams() + { + //#pragma message("Generating ParamDefaults") + return ParamDefaults<T, 0>::instance().get(); + } - class LLMenuGL *buildMenu(const std::string &filename, LLView* parentp); - class LLPieMenu *buildPieMenu(const std::string &filename, LLView* parentp); + void buildFloater(LLFloater* floaterp, const std::string &filename, BOOL open_floater = TRUE, LLXMLNodePtr output_node = NULL); + LLFloater* buildFloaterFromXML(const std::string& filename, BOOL open_floater = TRUE); + BOOL buildPanel(LLPanel* panelp, const std::string &filename, LLXMLNodePtr output_node = NULL); // Does what you want for LLFloaters and LLPanels // Returns 0 on success S32 saveToXML(LLView* viewp, const std::string& filename); - // Rebuilds all currently built panels. - void rebuild(); + std::string getCurFileName() { return mFileNames.empty() ? "" : mFileNames.back(); } static BOOL getAttributeColor(LLXMLNodePtr node, const std::string& name, LLColor4& color); LLPanel* createFactoryPanel(const std::string& name); - virtual LLView* createCtrlWidget(LLPanel *parent, LLXMLNodePtr node); - virtual LLView* createWidget(LLPanel *parent, LLXMLNodePtr node); + void pushFactoryFunctions(const LLCallbackMap::map_t* map); + void popFactoryFunctions(); + + template<typename T> + static T* create(typename T::Params& params, LLView* parent = NULL) + { + //#pragma message("Generating LLUICtrlFactory::create") + params.fillFrom(ParamDefaults<typename T::Params, 0>::instance().get()); + //S32 foo = "test"; + + if (!params.validateBlock()) + { + llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl; + } + T* widget = new T(params); + widget->initFromParams(params); + if (parent) + widget->setParent(parent); + return widget; + } + + LLView* createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, LLXMLNodePtr output_node, const widget_registry_t& ); + + static const widget_registry_t& getWidgetRegistry(LLView*); + + template<typename T> + static T* createFromFile(const std::string &filename, LLView *parent, LLXMLNodePtr output_node = NULL) + { + //#pragma message("Generating LLUICtrlFactory::createFromFile") + T* widget = NULL; + + std::string skinned_filename = findSkinnedFilename(filename); + getInstance()->mFileNames.push_back(skinned_filename); + { + LLXMLNodePtr root_node; + + //if exporting, only load the language being exported, + //instead of layering localized version on top of english + if (output_node) + { + if (!LLUICtrlFactory::getLocalizedXMLNode(filename, root_node)) + { + llwarns << "Couldn't parse XUI file: " << filename << llendl; + goto fail; + } + } + else if (!LLUICtrlFactory::getLayeredXMLNode(filename, root_node)) + { + llwarns << "Couldn't parse XUI file: " << skinned_filename << llendl; + goto fail; + } + + LLView* view = getInstance()->createFromXML(root_node, parent, filename, output_node, getWidgetRegistry(parent)); + if (view) + { + widget = dynamic_cast<T*>(view); + // not of right type, so delete it + if (!widget) + { + delete view; + view = NULL; + } + + } + } +fail: + getInstance()->mFileNames.pop_back(); + return widget; + } + + template <class T> + static T* createDummyWidget(const std::string& name) + { + //#pragma message("Generating LLUICtrlFactory::createDummyWidget") + typename T::Params params; + params.name(name); + + return create<T>(params); + } + + template<typename T, typename PARAM_BLOCK> + static T* defaultBuilder(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) + { + LLFastTimer timer(FTM_WIDGET_SETUP); + + //#pragma message("Generating LLUICtrlFactory::defaultBuilder") + PARAM_BLOCK params(getDefaultParams<PARAM_BLOCK>()); + + LLXUIParser::instance().readXUI(node, params); + + if (output_node) + { + // We always want to output top-left coordinates + PARAM_BLOCK output_params(params); + T::setupParamsForExport(output_params, parent); + // Export only the differences between this any default params + PARAM_BLOCK default_params(getDefaultParams<PARAM_BLOCK>()); + output_node->setName(node->getName()->mString); + LLXUIParser::instance().writeXUI( + output_node, output_params, &default_params); + } + + // Apply layout transformations, usually munging rect + T::setupParams(params, parent); + + if (!params.validateBlock()) + { + llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl; + } + T* widget; + { + LLFastTimer timer(FTM_WIDGET_CONSTRUCTION); + widget = new T(params); + } + { + LLFastTimer timer(FTM_INIT_FROM_PARAMS); + widget->initFromParams(params); + } + + if (parent) + { + S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : -1; + setCtrlParent(widget, parent, tab_group); + } + + createChildren(widget, node, output_node); + + if (!widget->postBuild()) + { + delete widget; + return NULL; + } + + return widget; + } + + static void createChildren(LLView* viewp, LLXMLNodePtr node, LLXMLNodePtr output_node = NULL); static bool getLayeredXMLNode(const std::string &filename, LLXMLNodePtr& root); + + static bool getLocalizedXMLNode(const std::string &xui_filename, LLXMLNodePtr& root); - static const std::vector<std::string>& getXUIPaths(); + static void loadWidgetTemplate(const std::string& widget_tag, LLInitParam::BaseBlock& block); private: - bool getLayeredXMLNodeImpl(const std::string &filename, LLXMLNodePtr& root); + //static void setCtrlValue(LLView* view, LLXMLNodePtr node); + static void setCtrlParent(LLView* view, LLView* parent, S32 tab_group); + + // Avoid directly using LLUI and LLDir in the template code + static std::string findSkinnedFilename(const std::string& filename); + + typedef std::deque<const LLCallbackMap::map_t*> factory_stack_t; + factory_stack_t mFactoryStack; + + LLPanel* mDummyPanel; + std::vector<std::string> mFileNames; +}; + +// this is here to make gcc happy with reference to LLUICtrlFactory +template<typename DERIVED> +template<typename T, typename PARAM_BLOCK> +LLWidgetRegistry<DERIVED>::Register<T, PARAM_BLOCK>::Register(const char* tag, LLWidgetCreatorFunc func) +: LLWidgetRegistry<DERIVED>::StaticRegistrar(tag, func.empty() ? (LLWidgetCreatorFunc)&LLUICtrlFactory::defaultBuilder<T, PARAM_BLOCK> : func) +{ + //FIXME: inventory_panel will register itself with LLPanel::Params but it does have its own params...:( + LLWidgetTemplateRegistry::instance().defaultRegistrar().add(&typeid(PARAM_BLOCK), tag); +} + + +typedef boost::function<LLPanel* (void)> LLPannelClassCreatorFunc; - typedef std::map<LLHandle<LLPanel>, std::string> built_panel_t; - built_panel_t mBuiltPanels; +// local static instance for registering a particular panel class - typedef std::map<LLHandle<LLFloater>, std::string> built_floater_t; - built_floater_t mBuiltFloaters; +class LLRegisterPanelClass +: public LLSingleton< LLRegisterPanelClass > +{ +public: + // reigister with either the provided builder, or the generic templated builder + void addPanelClass(const std::string& tag,LLPannelClassCreatorFunc func) + { + mPannelClassesNames[tag] = func; + } + + LLPanel* createPanelClass(const std::string& tag) + { + param_name_map_t::iterator iT = mPannelClassesNames.find(tag); + if(iT == mPannelClassesNames.end()) + return 0; + return iT->second(); + } + template<typename T> + static T* defaultPanelClassBuilder() + { + T* pT = new T(); + return pT; + } - std::deque<const LLCallbackMap::map_t*> mFactoryStack; +private: + typedef std::map< std::string, LLPannelClassCreatorFunc> param_name_map_t; + + param_name_map_t mPannelClassesNames; +}; - static std::vector<std::string> sXUIPaths; - LLPanel* mDummyPanel; +// local static instance for registering a particular panel class +template<typename T> +class LLRegisterPanelClassWrapper +: public LLRegisterPanelClass +{ +public: + // reigister with either the provided builder, or the generic templated builder + LLRegisterPanelClassWrapper(const std::string& tag); }; +template<typename T> +LLRegisterPanelClassWrapper<T>::LLRegisterPanelClassWrapper(const std::string& tag) +{ + LLRegisterPanelClass::instance().addPanelClass(tag,&LLRegisterPanelClass::defaultPanelClassBuilder<T>); +} + + #endif //LLUICTRLFACTORY_H diff --git a/indra/llui/lluifwd.h b/indra/llui/lluifwd.h index 32d5c9b44fe2935c3729027e19f99a061d6d2c36..f99bb39fddecf4193a56520a01ef8f113317ad36 100644 --- a/indra/llui/lluifwd.h +++ b/indra/llui/lluifwd.h @@ -53,7 +53,6 @@ class LLSlider; class LLSliderCtrl; class LLSpinCtrl; class LLTabContainer; -class LLTabContainerVertical; class LLTextBox; class LLTextEditor; class LLTextureCtrl; diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8e0de0cb0c09522a7c3fc98cdc116e017d0cebc0 --- /dev/null +++ b/indra/llui/lluiimage.cpp @@ -0,0 +1,166 @@ +/** + * @file lluiimage.cpp + * @brief UI implementation + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +// Utilities functions the user interface needs + +//#include "llviewerprecompiledheaders.h" +#include "linden_common.h" + +// Project includes +#include "lluiimage.h" +#include "llui.h" + +LLUIImage::LLUIImage(const std::string& name, LLPointer<LLImageGL> image) : + mName(name), + mImage(image), + mScaleRegion(0.f, 1.f, 1.f, 0.f), + mClipRegion(0.f, 1.f, 1.f, 0.f), + mUniformScaling(TRUE), + mNoClip(TRUE) +{ +} + +LLUIImage::~LLUIImage() +{ +} + +void LLUIImage::setClipRegion(const LLRectf& region) +{ + mClipRegion = region; + mNoClip = mClipRegion.mLeft == 0.f + && mClipRegion.mRight == 1.f + && mClipRegion.mBottom == 0.f + && mClipRegion.mTop == 1.f; +} + +void LLUIImage::setScaleRegion(const LLRectf& region) +{ + mScaleRegion = region; + mUniformScaling = mScaleRegion.mLeft == 0.f + && mScaleRegion.mRight == 1.f + && mScaleRegion.mBottom == 0.f + && mScaleRegion.mTop == 1.f; +} + +//TODO: move drawing implementation inside class +void LLUIImage::draw(S32 x, S32 y, const LLColor4& color) const +{ + gl_draw_image(x, y, mImage, color, mClipRegion); +} + +void LLUIImage::draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const +{ + if (mUniformScaling) + { + gl_draw_scaled_image(x, y, width, height, mImage, color, mClipRegion); + } + else + { + gl_draw_scaled_image_with_border( + x, y, + width, height, + mImage, + color, + FALSE, + mClipRegion, + mScaleRegion); + } +} + +void LLUIImage::drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const +{ + gl_draw_scaled_image_with_border( + x, y, + width, height, + mImage, + color, + TRUE, + mClipRegion, + mScaleRegion); +} + +void LLUIImage::drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, S32 border_width) const +{ + LLRect border_rect; + border_rect.setOriginAndSize(x, y, width, height); + border_rect.stretch(border_width, border_width); + drawSolid(border_rect, color); +} + +S32 LLUIImage::getWidth() const +{ + // return clipped dimensions of actual image area + return llround((F32)mImage->getWidth(0) * mClipRegion.getWidth()); +} + +S32 LLUIImage::getHeight() const +{ + // return clipped dimensions of actual image area + return llround((F32)mImage->getHeight(0) * mClipRegion.getHeight()); +} + +S32 LLUIImage::getTextureWidth() const +{ + return mImage->getWidth(0); +} + +S32 LLUIImage::getTextureHeight() const +{ + return mImage->getHeight(0); +} + +namespace LLInitParam +{ + LLUIImage* TypedParam<LLUIImage*>::getValueFromBlock() const + { + LLUIImage* imagep = LLUI::getUIImage(name()); + if (!imagep) + { + // default to current value + imagep = mData.mValue; + } + return imagep; + } + + + template<> + bool ParamCompare<LLUIImage*>::equals( + LLUIImage* const &a, + LLUIImage* const &b) + { + // force all LLUIImages for XML UI export to be "non-default" + if (!a && !b) + return false; + else + return (a == b); + } +} diff --git a/indra/llui/lluiimage.h b/indra/llui/lluiimage.h new file mode 100644 index 0000000000000000000000000000000000000000..e35026cd3d77b544b5c017b3a8419b4f43da6699 --- /dev/null +++ b/indra/llui/lluiimage.h @@ -0,0 +1,114 @@ +/** + * @file lluiimage.h + * @brief wrapper for images used in the UI that handles smart scaling, etc. + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLUIIMAGE_H +#define LL_LLUIIMAGE_H + +//#include "llgl.h" +#include "llimagegl.h" +#include "llrefcount.h" +#include "llrect.h" +#include <boost/function.hpp> +#include "llinitparam.h" + +extern const LLColor4 UI_VERTEX_COLOR; + +class LLUIImage : public LLRefCount +{ +public: + LLUIImage(const std::string& name, LLPointer<LLImageGL> image); + virtual ~LLUIImage(); + + void setClipRegion(const LLRectf& region); + void setScaleRegion(const LLRectf& region); + + LLPointer<LLImageGL> getImage() { return mImage; } + const LLPointer<LLImageGL>& getImage() const { return mImage; } + + void draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color = UI_VERTEX_COLOR) const; + void draw(S32 x, S32 y, const LLColor4& color = UI_VERTEX_COLOR) const; + void draw(const LLRect& rect, const LLColor4& color = UI_VERTEX_COLOR) const { draw(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color); } + + void drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const; + void drawSolid(const LLRect& rect, const LLColor4& color) const { drawSolid(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color); } + void drawSolid(S32 x, S32 y, const LLColor4& color) const { drawSolid(x, y, mImage->getWidth(0), mImage->getHeight(0), color); } + + void drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, S32 border_width) const; + void drawBorder(const LLRect& rect, const LLColor4& color, S32 border_width) const { drawBorder(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color, border_width); } + void drawBorder(S32 x, S32 y, const LLColor4& color, S32 border_width) const { drawBorder(x, y, mImage->getWidth(0), mImage->getHeight(0), color, border_width); } + + const std::string& getName() const { return mName; } + + virtual S32 getWidth() const; + virtual S32 getHeight() const; + + // returns dimensions of underlying textures, which might not be equal to ui image portion + S32 getTextureWidth() const; + S32 getTextureHeight() const; + +protected: + std::string mName; + LLRectf mScaleRegion; + LLRectf mClipRegion; + LLPointer<LLImageGL> mImage; + BOOL mUniformScaling; + BOOL mNoClip; +}; + +namespace LLInitParam +{ + template<> + class TypedParam<LLUIImage*, TypeValues<LLUIImage*>, false> + : public BlockValue<LLUIImage*> + { + typedef boost::add_reference<boost::add_const<LLUIImage*>::type>::type T_const_ref; + typedef BlockValue<LLUIImage*> super_t; + public: + Optional<std::string> name; + + TypedParam(BlockDescriptor& descriptor, const char* name, super_t::value_assignment_t value, ParamDescriptor::validation_func_t func) + : super_t(descriptor, name, value, func) + { + } + + LLUIImage* getValueFromBlock() const; + }; + + // Need custom comparison function for our test app, which only loads + // LLUIImage* as NULL. + template<> + bool ParamCompare<LLUIImage*>::equals( + LLUIImage* const &a, LLUIImage* const &b); +} + +typedef LLPointer<LLUIImage> LLUIImagePtr; +#endif diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index 0b76b8e814c60df62db60d67687852f476a34b8f..7ce0fd7a88d1a75344ce0b29ba47ffd2884109d3 100644 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -33,6 +33,7 @@ #include "linden_common.h" #include "lluistring.h" #include "llsd.h" +#include "lltrans.h" const LLStringUtil::format_map_t LLUIString::sNullArgs; @@ -111,7 +112,18 @@ void LLUIString::clear() void LLUIString::format() { + // optimize for empty strings (don't attempt string replacement) + if (mOrig.empty()) + { + mResult.clear(); + mWResult.clear(); + return; + } mResult = mOrig; - LLStringUtil::format(mResult, mArgs); + + // get the defailt args + local args + LLStringUtil::format_map_t combined_args = LLTrans::getDefaultArgs(); + combined_args.insert(mArgs.begin(), mArgs.end()); + LLStringUtil::format(mResult, combined_args); mWResult = utf8str_to_wstring(mResult); } diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 8ec681fcaf699797f14f090357745535255e3815..2e2ef4d79f52519f4360b03e7b8609594ba5dd8e 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -56,19 +56,18 @@ #include "lltexteditor.h" #include "lltextbox.h" -using namespace LLOldEvents; - -//HACK: this allows you to instantiate LLView from xml with "<view/>" which we don't want -static LLRegisterWidget<LLView> r("view"); - BOOL LLView::sDebugRects = FALSE; BOOL LLView::sDebugKeys = FALSE; S32 LLView::sDepth = 0; BOOL LLView::sDebugMouseHandling = FALSE; std::string LLView::sMouseHandlerMessage; -BOOL LLView::sEditingUI = FALSE; +//BOOL LLView::sEditingUI = FALSE; BOOL LLView::sForceReshape = FALSE; -LLView* LLView::sEditingUIView = NULL; +//LLView* LLView::sEditingUIView = NULL; +std::set<LLView*> LLView::sPreviewHighlightedElements; +BOOL LLView::sHighlightingDiffs = FALSE; +LLView* LLView::sPreviewClickedElement = NULL; +BOOL LLView::sDrawPreviewHighlights = FALSE; S32 LLView::sLastLeftXML = S32_MIN; S32 LLView::sLastBottomXML = S32_MIN; @@ -76,77 +75,78 @@ S32 LLView::sLastBottomXML = S32_MIN; BOOL LLView::sIsDrawing = FALSE; #endif -LLView::LLView() : - mParentView(NULL), - mReshapeFlags(FOLLOWS_NONE), - mDefaultTabGroup(0), - mEnabled(TRUE), - mMouseOpaque(TRUE), - mSoundFlags(MOUSE_UP), // default to only make sound on mouse up - mSaveToXML(TRUE), - mIsFocusRoot(FALSE), - mLastVisible(TRUE), - mUseBoundingRect(FALSE), - mVisible(TRUE), - mNextInsertionOrdinal(0), - mHoverCursor(UI_CURSOR_ARROW) -{ -} - -LLView::LLView(const std::string& name, BOOL mouse_opaque) : +LLView::Params::Params() +: name("name", std::string("unnamed")), + enabled("enabled", true), + visible("visible", true), + mouse_opaque("mouse_opaque", true), + follows("follows"), + hover_cursor("hover_cursor", "UI_CURSOR_ARROW"), + use_bounding_rect("use_bounding_rect", false), + tab_group("tab_group", 0), + default_tab_group("default_tab_group"), + tool_tip("tool_tip"), + sound_flags("sound_flags", MOUSE_UP), + font("font", LLFontGL::getFontSansSerif()), + font_halign("halign"), + font_valign("valign"), + layout("layout"), + rect("rect"), + bottom_delta("bottom_delta", S32_MAX), + top_pad("top_pad"), + top_delta("top_delta", S32_MAX), + left_pad("left_pad"), + left_delta("left_delta", S32_MAX), + center_horiz("center_horiz", false), + center_vert("center_vert", false), + serializable("", false), + user_resize("user_resize"), + auto_resize("auto_resize"), + needs_translate("translate") +{ + addSynonym(rect, ""); +} + +LLView::LLView(const LLView::Params& p) +: mName(p.name), mParentView(NULL), - mName(name), mReshapeFlags(FOLLOWS_NONE), - mDefaultTabGroup(0), - mEnabled(TRUE), - mMouseOpaque(mouse_opaque), - mSoundFlags(MOUSE_UP), // default to only make sound on mouse up - mSaveToXML(TRUE), - mIsFocusRoot(FALSE), - mLastVisible(TRUE), - mUseBoundingRect(FALSE), - mVisible(TRUE), - mNextInsertionOrdinal(0), - mHoverCursor(UI_CURSOR_ARROW) -{ -} - - -LLView::LLView( - const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 reshape) : - mParentView(NULL), - mName(name), - mRect(rect), - mBoundingRect(rect), - mReshapeFlags(reshape), - mDefaultTabGroup(0), - mEnabled(TRUE), - mMouseOpaque(mouse_opaque), - mSoundFlags(MOUSE_UP), // default to only make sound on mouse up - mSaveToXML(TRUE), + mSaveToXML(p.serializable), mIsFocusRoot(FALSE), - mLastVisible(TRUE), - mUseBoundingRect(FALSE), - mVisible(TRUE), + mLastVisible(FALSE), mNextInsertionOrdinal(0), - mHoverCursor(UI_CURSOR_ARROW) + mHoverCursor(getCursorFromString(p.hover_cursor)), + mEnabled(p.enabled), + mVisible(p.visible), + mMouseOpaque(p.mouse_opaque), + mSoundFlags(p.sound_flags), + mUseBoundingRect(p.use_bounding_rect), + mDefaultTabGroup(p.default_tab_group), + mLastTabGroup(0), + mToolTipMsg((LLStringExplicit)p.tool_tip()), + mDummyWidgets(NULL) { + // create rect first, as this will supply initial follows flags + setShape(p.rect); + parseFollowsFlags(p); } - LLView::~LLView() { //llinfos << "Deleting view " << mName << ":" << (void*) this << llendl; // llassert(LLView::sIsDrawing == FALSE); + +// llassert_always(sDepth == 0); // avoid deleting views while drawing! It can subtly break list iterators + if( gFocusMgr.getKeyboardFocus() == this ) { - llwarns << "View holding keyboard focus deleted: " << getName() << ". Keyboard focus removed." << llendl; + //llwarns << "View holding keyboard focus deleted: " << getName() << ". Keyboard focus removed." << llendl; gFocusMgr.removeKeyboardFocusWithoutCallback( this ); } if( hasMouseCapture() ) { - llwarns << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << llendl; + //llwarns << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << llendl; gFocusMgr.removeMouseCaptureWithoutCallback( this ); } @@ -157,16 +157,13 @@ LLView::~LLView() mParentView->removeChild(this); } - dispatch_list_t::iterator itor; - for (itor = mDispatchList.begin(); itor != mDispatchList.end(); ++itor) + if (mDummyWidgets) { - (*itor).second->clearDispatchers(); + std::for_each(mDummyWidgets->begin(), mDummyWidgets->end(), + DeletePairedPointer()); + delete mDummyWidgets; + mDummyWidgets = NULL; } - - std::for_each(mFloaterControls.begin(), mFloaterControls.end(), - DeletePairedPointer()); - std::for_each(mDummyWidgets.begin(), mDummyWidgets.end(), - DeletePairedPointer()); } // virtual @@ -187,7 +184,6 @@ BOOL LLView::isPanel() const return FALSE; } -// virtual void LLView::setToolTip(const LLStringExplicit& msg) { mToolTipMsg = msg; @@ -234,19 +230,31 @@ const std::string& LLView::getName() const void LLView::sendChildToFront(LLView* child) { +// llassert_always(sDepth == 0); // Avoid re-ordering while drawing; it can cause subtle iterator bugs if (child && child->getParent() == this) { - mChildList.remove( child ); - mChildList.push_front(child); + // minor optimization, but more importantly, + // won't temporarily create an empty list + if (child != mChildList.front()) + { + mChildList.remove( child ); + mChildList.push_front(child); + } } } void LLView::sendChildToBack(LLView* child) { +// llassert_always(sDepth == 0); // Avoid re-ordering while drawing; it can cause subtle iterator bugs if (child && child->getParent() == this) { - mChildList.remove( child ); - mChildList.push_back(child); + // minor optimization, but more importantly, + // won't temporarily create an empty list + if (child != mChildList.back()) + { + mChildList.remove( child ); + mChildList.push_back(child); + } } } @@ -266,12 +274,18 @@ void LLView::moveChildToBackOfTabGroup(LLUICtrl* child) } } -void LLView::addChild(LLView* child, S32 tab_group) +// virtual +bool LLView::addChild(LLView* child, S32 tab_group) { + if (!child) + { + return false; + } if (mParentView == child) { llerrs << "Adding view " << child->getName() << " as child of itself" << llendl; } + // remove from current parent if (child->mParentView) { @@ -284,55 +298,46 @@ void LLView::addChild(LLView* child, S32 tab_group) // add to ctrl list if is LLUICtrl if (child->isCtrl()) { - // controls are stored in reverse order from render order - addCtrlAtEnd((LLUICtrl*) child, tab_group); + LLUICtrl* ctrl = static_cast<LLUICtrl*>(child); + mCtrlOrder.insert(tab_order_pair_t(ctrl, + tab_order_t(tab_group, mNextInsertionOrdinal))); + + mNextInsertionOrdinal++; } child->mParentView = this; updateBoundingRect(); + mLastTabGroup = tab_group; + return true; } -void LLView::addChildAtEnd(LLView* child, S32 tab_group) +bool LLView::addChildInBack(LLView* child, S32 tab_group) { - if (mParentView == child) - { - llerrs << "Adding view " << child->getName() << " as child of itself" << llendl; - } - // remove from current parent - if (child->mParentView) + if(addChild(child, tab_group)) { - child->mParentView->removeChild(child); + sendChildToBack(child); + return true; } - // add to back of child list - mChildList.push_back(child); - - // add to ctrl list if is LLUICtrl - if (child->isCtrl()) - { - // controls are stored in reverse order from render order - addCtrl((LLUICtrl*) child, tab_group); - } - - child->mParentView = this; - updateBoundingRect(); + return false; } // remove the specified child from the view, and set it's parent to NULL. -void LLView::removeChild(LLView* child, BOOL deleteIt) +void LLView::removeChild(LLView* child) { + //llassert_always(sDepth == 0); // Avoid re-ordering while drawing; it can cause subtle iterator bugs if (child->mParentView == this) { mChildList.remove( child ); child->mParentView = NULL; if (child->isCtrl()) { - removeCtrl((LLUICtrl*)child); - } - if (deleteIt) - { - delete child; + child_tab_order_t::iterator found = mCtrlOrder.find(static_cast<LLUICtrl*>(child)); + if(found != mCtrlOrder.end()) + { + mCtrlOrder.erase(found); + } } } else @@ -342,28 +347,6 @@ void LLView::removeChild(LLView* child, BOOL deleteIt) updateBoundingRect(); } -void LLView::addCtrlAtEnd(LLUICtrl* ctrl, S32 tab_group) -{ - mCtrlOrder.insert(tab_order_pair_t(ctrl, - tab_order_t(tab_group, mNextInsertionOrdinal++))); -} - -void LLView::addCtrl( LLUICtrl* ctrl, S32 tab_group) -{ - // add to front of list by using negative ordinal, which monotonically increases - mCtrlOrder.insert(tab_order_pair_t(ctrl, - tab_order_t(tab_group, -1 * mNextInsertionOrdinal++))); -} - -void LLView::removeCtrl(LLUICtrl* ctrl) -{ - child_tab_order_t::iterator found = mCtrlOrder.find(ctrl); - if(found != mCtrlOrder.end()) - { - mCtrlOrder.erase(found); - } -} - LLView::ctrl_list_t LLView::getCtrlList() const { ctrl_list_t controls; @@ -653,7 +636,7 @@ BOOL LLView::canSnapTo(const LLView* other_view) } // virtual -void LLView::snappedTo(const LLView* snap_view) +void LLView::setSnappedTo(const LLView* snap_view) { } @@ -671,6 +654,17 @@ BOOL LLView::handleHover(S32 x, S32 y, MASK mask) return handled; } +void LLView::onMouseEnter(S32 x, S32 y, MASK mask) +{ + //llinfos << "Mouse entered " << getName() << llendl; +} + +void LLView::onMouseLeave(S32 x, S32 y, MASK mask) +{ + //llinfos << "Mouse left " << getName() << llendl; +} + + std::string LLView::getShowNamesToolTip() { LLView* view = getParent(); @@ -731,23 +725,14 @@ BOOL LLView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_s // get our own tooltip tool_tip = mToolTipMsg.getString(); - if ( - LLUI::sShowXUINames + + if (LLUI::sShowXUINames && (tool_tip.find(".xml", 0) == std::string::npos) && (mName.find("Drag", 0) == std::string::npos)) { tool_tip = getShowNamesToolTip(); } - BOOL show_names_text_box = LLUI::sShowXUINames && dynamic_cast<LLTextBox*>(this) != NULL; - - // don't allow any siblings to handle this event - // even if we don't have a tooltip - if (getMouseOpaque() || show_names_text_box) - { - handled = TRUE; - } - if(!tool_tip.empty()) { msg = tool_tip; @@ -759,7 +744,13 @@ BOOL LLView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_s localPointToScreen( mRect.getWidth(), mRect.getHeight(), &(sticky_rect_screen->mRight), &(sticky_rect_screen->mTop) ); - + } + // don't allow any siblings to handle this event + // even if we don't have a tooltip + if (getMouseOpaque() || + (!tool_tip.empty() && + (!LLUI::sShowXUINames || dynamic_cast<LLTextBox*>(this)))) + { handled = TRUE; } @@ -925,22 +916,22 @@ BOOL LLView::handleMouseDown(S32 x, S32 y, MASK mask) handled_view = this; } - // HACK If we're editing UI, select the leaf view that ate the click. - if (sEditingUI && handled_view) - { - // need to find leaf views, big hack - LLButton* buttonp = dynamic_cast<LLButton*>(handled_view); - LLLineEditor* line_editorp = dynamic_cast<LLLineEditor*>(handled_view); - LLTextEditor* text_editorp = dynamic_cast<LLTextEditor*>(handled_view); - LLTextBox* text_boxp = dynamic_cast<LLTextBox*>(handled_view); - if (buttonp - || line_editorp - || text_editorp - || text_boxp) - { - sEditingUIView = handled_view; - } - } + //// HACK If we're editing UI, select the leaf view that ate the click. + //if (sEditingUI && handled_view) + //{ + // // need to find leaf views, big hack + // LLButton* buttonp = dynamic_cast<LLButton*>(handled_view); + // LLLineEditor* line_editorp = dynamic_cast<LLLineEditor*>(handled_view); + // LLTextEditor* text_editorp = dynamic_cast<LLTextEditor*>(handled_view); + // LLTextBox* text_boxp = dynamic_cast<LLTextBox*>(handled_view); + // if (buttonp + // || line_editorp + // || text_editorp + // || text_boxp) + // { + // sEditingUIView = handled_view; + // } + //} return handled; } @@ -1166,6 +1157,7 @@ LLView* LLView::childrenHandleRightMouseDown(S32 x, S32 y, MASK mask) { sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; } + handled_view = viewp; break; } @@ -1328,55 +1320,58 @@ void LLView::draw() } } - LLRect rootRect = getRootView()->getRect(); - LLRect screenRect; - - // draw focused control on top of everything else - LLView* focus_view = gFocusMgr.getKeyboardFocus(); - if (focus_view && focus_view->getParent() != this) + if (!mChildList.empty()) { - focus_view = NULL; - } + LLRect rootRect = getRootView()->getRect(); + LLRect screenRect; - ++sDepth; - for (child_list_reverse_iter_t child_iter = mChildList.rbegin(); child_iter != mChildList.rend(); ++child_iter) - { - LLView *viewp = *child_iter; + // draw focused control on top of everything else + LLView* focus_view = gFocusMgr.getKeyboardFocus(); + if (focus_view && focus_view->getParent() != this) + { + focus_view = NULL; + } - if (viewp->getVisible() && viewp != focus_view && viewp->getRect().isValid()) + ++sDepth; + + for (child_list_reverse_iter_t child_iter = mChildList.rbegin(); child_iter != mChildList.rend();) // ++child_iter) { - // Only draw views that are within the root view - localRectToScreen(viewp->getRect(),&screenRect); - if ( rootRect.rectInRect(&screenRect) ) + child_list_reverse_iter_t child = child_iter++; + LLView *viewp = *child; + + if (viewp->getVisible() && viewp != focus_view && viewp->getRect().isValid()) { - glMatrixMode(GL_MODELVIEW); - LLUI::pushMatrix(); + // Only draw views that are within the root view + localRectToScreen(viewp->getRect(),&screenRect); + if ( rootRect.rectInRect(&screenRect) ) { - LLUI::translate((F32)viewp->getRect().mLeft, (F32)viewp->getRect().mBottom, 0.f); - viewp->draw(); + glMatrixMode(GL_MODELVIEW); + LLUI::pushMatrix(); + { + LLUI::translate((F32)viewp->getRect().mLeft, (F32)viewp->getRect().mBottom, 0.f); + viewp->draw(); + } + LLUI::popMatrix(); } - LLUI::popMatrix(); } - } - } - --sDepth; + } + --sDepth; - if (focus_view && focus_view->getVisible()) - { - drawChild(focus_view); + if (focus_view && focus_view->getVisible()) + { + drawChild(focus_view); + } } - // HACK - if (sEditingUI && this == sEditingUIView) - { - drawDebugRect(); - } + gGL.getTexUnit(0)->disable(); } //Draw a box for debugging. void LLView::drawDebugRect() { + std::set<LLView*>::iterator preview_iter = std::find(sPreviewHighlightedElements.begin(), sPreviewHighlightedElements.end(), this); // figure out if it's a previewed element + LLUI::pushMatrix(); { // drawing solids requires texturing be disabled @@ -1391,9 +1386,21 @@ void LLView::drawDebugRect() // draw red rectangle for the border LLColor4 border_color(0.f, 0.f, 0.f, 1.f); - if (sEditingUI) + //if (sEditingUI) + //{ + // border_color.mV[0] = 1.f; + //} + if(preview_iter != sPreviewHighlightedElements.end()) { - border_color.mV[0] = 1.f; + if(LLView::sPreviewClickedElement && this == sPreviewClickedElement) + { + border_color = LLColor4::red; + } + else + { + static LLUICachedControl<LLColor4> scroll_highlighted_color ("ScrollHighlightedColor", *(new LLColor4)); + border_color = scroll_highlighted_color; + } } else { @@ -1416,8 +1423,8 @@ void LLView::drawDebugRect() gGL.vertex2i(0, debug_rect.getHeight() - 1); gGL.end(); - // Draw the name if it's not a leaf node - if (mChildList.size() && !sEditingUI) + // Draw the name if it's not a leaf node or not in editing or preview mode + if (mChildList.size() && preview_iter == sPreviewHighlightedElements.end()) { //char temp[256]; S32 x, y; @@ -1427,7 +1434,7 @@ void LLView::drawDebugRect() std::string debug_text = llformat("%s (%d x %d)", getName().c_str(), debug_rect.getWidth(), debug_rect.getHeight()); LLFontGL::getFontSansSerifSmall()->renderUTF8(debug_text, 0, (F32)x, (F32)y, border_color, - LLFontGL::HCENTER, LLFontGL::BASELINE, LLFontGL::NORMAL, + LLFontGL::HCENTER, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); } } @@ -1583,15 +1590,28 @@ void LLView::updateBoundingRect() } } -LLRect LLView::getScreenRect() const +LLRect LLView::calcScreenRect() const { - // *FIX: check for one-off error LLRect screen_rect; localPointToScreen(0, 0, &screen_rect.mLeft, &screen_rect.mBottom); localPointToScreen(getRect().getWidth(), getRect().getHeight(), &screen_rect.mRight, &screen_rect.mTop); return screen_rect; } +LLRect LLView::calcScreenBoundingRect() const +{ + LLRect screen_rect; + // get bounding rect, if used + LLRect bounding_rect = mUseBoundingRect ? mBoundingRect : mRect; + + // convert to local coordinates, as defined by mRect + bounding_rect.translate(-mRect.mLeft, -mRect.mBottom); + + localPointToScreen(bounding_rect.mLeft, bounding_rect.mBottom, &screen_rect.mLeft, &screen_rect.mBottom); + localPointToScreen(bounding_rect.mRight, bounding_rect.mTop, &screen_rect.mRight, &screen_rect.mTop); + return screen_rect; +} + LLRect LLView::getLocalBoundingRect() const { LLRect local_bounding_rect = getBoundingRect(); @@ -1690,7 +1710,12 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse, BOOL create_ if (create_if_missing) { - return createDummyWidget<LLView>(name); + LLView* view = getDummyWidget<LLView>(name); + if (!view) + { + view = LLUICtrlFactory::createDummyWidget<LLView>(name); + } + return view; } return NULL; } @@ -1779,12 +1804,32 @@ LLView* LLView::getRootView() return view; } -BOOL LLView::deleteViewByHandle(LLHandle<LLView> handle) +LLView* LLView::findPrevSibling(LLView* child) +{ + child_list_t::iterator prev_it = std::find(mChildList.begin(), mChildList.end(), child); + if (prev_it != mChildList.end() && prev_it != mChildList.begin()) + { + return *(--prev_it); + } + return NULL; +} + +LLView* LLView::findNextSibling(LLView* child) +{ + child_list_t::iterator next_it = std::find(mChildList.begin(), mChildList.end(), child); + if (next_it != mChildList.end()) + { + next_it++; + } + + return (next_it != mChildList.end()) ? *next_it : NULL; +} + +void LLView::deleteViewByHandle(LLHandle<LLView> handle) { LLView* viewp = handle.get(); delete viewp; - return viewp != NULL; } @@ -1945,132 +1990,6 @@ BOOL LLView::localRectToOtherView( const LLRect& local, LLRect* other, LLView* o return FALSE; } -// virtual -LLXMLNodePtr LLView::getXML(bool save_children) const -{ - //FIXME: need to provide actual derived type tag, probably outside this method - LLXMLNodePtr node = new LLXMLNode("view", FALSE); - - node->createChild("name", TRUE)->setStringValue(getName()); - node->createChild("width", TRUE)->setIntValue(getRect().getWidth()); - node->createChild("height", TRUE)->setIntValue(getRect().getHeight()); - - LLView* parent = getParent(); - S32 left = getRect().mLeft; - S32 bottom = getRect().mBottom; - if (parent) bottom -= parent->getRect().getHeight(); - - node->createChild("left", TRUE)->setIntValue(left); - node->createChild("bottom", TRUE)->setIntValue(bottom); - - U32 follows_flags = getFollows(); - if (follows_flags) - { - std::stringstream buffer; - bool pipe = false; - if (followsLeft()) - { - buffer << "left"; - pipe = true; - } - if (followsTop()) - { - if (pipe) buffer << "|"; - buffer << "top"; - pipe = true; - } - if (followsRight()) - { - if (pipe) buffer << "|"; - buffer << "right"; - pipe = true; - } - if (followsBottom()) - { - if (pipe) buffer << "|"; - buffer << "bottom"; - } - node->createChild("follows", TRUE)->setStringValue(buffer.str()); - } - // Export all widgets as enabled and visible - code must disable. - node->createChild("mouse_opaque", TRUE)->setBoolValue(mMouseOpaque ); - if (!mToolTipMsg.getString().empty()) - { - node->createChild("tool_tip", TRUE)->setStringValue(mToolTipMsg.getString()); - } - if (mSoundFlags != MOUSE_UP) - { - node->createChild("sound_flags", TRUE)->setIntValue((S32)mSoundFlags); - } - - node->createChild("enabled", TRUE)->setBoolValue(getEnabled()); - - if (!mControlName.empty()) - { - node->createChild("control_name", TRUE)->setStringValue(mControlName); - } - return node; -} - -//static -LLView* LLView::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - LLView* viewp = new LLView(); - viewp->initFromXML(node, parent); - return viewp; -} - -// static -void LLView::addColorXML(LLXMLNodePtr node, const LLColor4& color, - const char* xml_name, const char* control_name) -{ - if (color != LLUI::sColorsGroup->getColor(ll_safe_string(control_name))) - { - node->createChild(xml_name, TRUE)->setFloatValue(4, color.mV); - } -} - -//static -std::string LLView::escapeXML(const std::string& xml, std::string& indent) -{ - std::string ret = indent + "\"" + LLXMLNode::escapeXML(xml); - - //replace every newline with a close quote, new line, indent, open quote - size_t index = ret.size()-1; - size_t fnd; - - while ((fnd = ret.rfind("\n", index)) != std::string::npos) - { - ret.replace(fnd, 1, "\"\n" + indent + "\""); - index = fnd-1; - } - - //append close quote - ret.append("\""); - - return ret; -} - -// static -LLWString LLView::escapeXML(const LLWString& xml) -{ - LLWString out; - for (LLWString::size_type i = 0; i < xml.size(); ++i) - { - llwchar c = xml[i]; - switch(c) - { - case '"': out.append(utf8string_to_wstring(""")); break; - case '\'': out.append(utf8string_to_wstring("'")); break; - case '&': out.append(utf8string_to_wstring("&")); break; - case '<': out.append(utf8string_to_wstring("<")); break; - case '>': out.append(utf8string_to_wstring(">")); break; - default: out.push_back(c); break; - } - } - return out; -} - // static const LLCtrlQuery & LLView::getTabOrderQuery() { @@ -2107,7 +2026,12 @@ const LLCtrlQuery & LLView::getFocusRootsQuery() } -void LLView::userSetShape(const LLRect& new_rect) +void LLView::setShape(const LLRect& new_rect, bool by_user) +{ + handleReshape(new_rect, by_user); +} + +void LLView::handleReshape(const LLRect& new_rect, bool by_user) { reshape(new_rect.getWidth(), new_rect.getHeight()); translate(new_rect.mLeft - getRect().mLeft, new_rect.mBottom - getRect().mBottom); @@ -2355,560 +2279,482 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna // Listener dispatch functions //----------------------------------------------------------------------------- -void LLView::registerEventListener(std::string name, LLSimpleListener* function) -{ - mDispatchList.insert(std::pair<std::string, LLSimpleListener*>(name, function)); -} -void LLView::deregisterEventListener(std::string name) +LLControlVariable *LLView::findControl(const std::string& name) { - dispatch_list_t::iterator itor = mDispatchList.find(name); - if (itor != mDispatchList.end()) + // parse the name to locate which group it belongs to + std::size_t key_pos= name.find("."); + if(key_pos!= std::string::npos ) { - mDispatchList.erase(itor); + std::string control_group_key = name.substr(0, key_pos); + LLControlVariable* control; + // check if it's in the control group that name indicated + if(LLUI::sSettingGroups[control_group_key]) + { + control = LLUI::sSettingGroups[control_group_key]->getControl(name); + if (control) + { + return control; + } + } } + + LLControlGroup& control_group = LLUI::getControlControlGroup(name); + return control_group.getControl(name); } -std::string LLView::findEventListener(LLSimpleListener *listener) const +const widget_registry_t& LLView::getChildRegistry() const { - dispatch_list_t::const_iterator itor; - for (itor = mDispatchList.begin(); itor != mDispatchList.end(); ++itor) - { - if (itor->second == listener) - { - return itor->first; - } - } - if (mParentView) - { - return mParentView->findEventListener(listener); - } - return LLStringUtil::null; + static widget_registry_t empty_registry; + return empty_registry; } -LLSimpleListener* LLView::getListenerByName(const std::string& callback_name) + +const S32 FLOATER_H_MARGIN = 15; +const S32 MIN_WIDGET_HEIGHT = 10; +const S32 VPAD = 4; + +void LLView::initFromParams(const LLView::Params& params) { - LLSimpleListener* callback = NULL; - dispatch_list_t::iterator itor = mDispatchList.find(callback_name); - if (itor != mDispatchList.end()) - { - callback = itor->second; - } - else if (mParentView) + LLRect required_rect = getRequiredRect(); + + S32 width = llmax(getRect().getWidth(), required_rect.getWidth()); + S32 height = llmax(getRect().getHeight(), required_rect.getHeight()); + + reshape(width, height); + + // call virtual methods with most recent data + // use getters because these values might not come through parameter block + setEnabled(getEnabled()); + setVisible(getVisible()); + + if (!params.name().empty()) { - callback = mParentView->getListenerByName(callback_name); + setName(params.name()); } - return callback; + + mLayout = params.layout(); } -LLControlVariable *LLView::findControl(const std::string& name) +void LLView::parseFollowsFlags(const LLView::Params& params) { - control_map_t::iterator itor = mFloaterControls.find(name); - if (itor != mFloaterControls.end()) + // preserve follows flags set by code if user did not override + if (!params.follows.isProvided()) { - return itor->second; + return; } - if (mParentView) + + // interpret either string or bitfield version of follows + if (params.follows.string.isChosen()) { - return mParentView->findControl(name); - } - return LLUI::sConfigGroup->getControl(name); -} + setFollows(FOLLOWS_NONE); -const S32 FLOATER_H_MARGIN = 15; -const S32 MIN_WIDGET_HEIGHT = 10; -const S32 VPAD = 4; + std::string follows = params.follows.string; -// static -U32 LLView::createRect(LLXMLNodePtr node, LLRect &rect, LLView* parent_view, const LLRect &required_rect) -{ - U32 follows = 0; - S32 x = rect.mLeft; - S32 y = rect.mBottom; - S32 w = rect.getWidth(); - S32 h = rect.getHeight(); + typedef boost::tokenizer<boost::char_separator<char> > tokenizer; + boost::char_separator<char> sep("|"); + tokenizer tokens(follows, sep); + tokenizer::iterator token_iter = tokens.begin(); - U32 last_x = 0; - U32 last_y = 0; - if (parent_view) - { - last_y = parent_view->getRect().getHeight(); - child_list_t::const_iterator itor = parent_view->getChildList()->begin(); - if (itor != parent_view->getChildList()->end()) + while(token_iter != tokens.end()) { - LLView *last_view = (*itor); - if (last_view->getSaveToXML()) + const std::string& token_str = *token_iter; + if (token_str == "left") + { + setFollowsLeft(); + } + else if (token_str == "right") + { + setFollowsRight(); + } + else if (token_str == "top") { - last_x = last_view->getRect().mLeft; - last_y = last_view->getRect().mBottom; + setFollowsTop(); } + else if (token_str == "bottom") + { + setFollowsBottom(); + } + else if (token_str == "all") + { + setFollowsAll(); + } + ++token_iter; } } - - std::string rect_control; - node->getAttributeString("rect_control", rect_control); - if (! rect_control.empty()) - { - LLRect rect = LLUI::sConfigGroup->getRect(rect_control); - x = rect.mLeft; - y = rect.mBottom; - w = rect.getWidth(); - h = rect.getHeight(); - } - - if (node->hasAttribute("left")) - { - node->getAttributeS32("left", x); - } - if (node->hasAttribute("bottom")) + else if (params.follows.flags.isChosen()) { - node->getAttributeS32("bottom", y); + setFollows(params.follows.flags); } +} - // Make your width the width of the containing - // view if you don't specify a width. - if (parent_view) - { - if(w == 0) - { - w = llmax(required_rect.getWidth(), parent_view->getRect().getWidth() - (FLOATER_H_MARGIN) - x); - } - if(h == 0) - { - h = llmax(MIN_WIDGET_HEIGHT, required_rect.getHeight()); +// static +//LLFontGL::HAlign LLView::selectFontHAlign(LLXMLNodePtr node) +//{ +// LLFontGL::HAlign gl_hfont_align = LLFontGL::LEFT; +// +// if (node->hasAttribute("halign")) +// { +// std::string horizontal_align_name; +// node->getAttributeString("halign", horizontal_align_name); +// gl_hfont_align = LLFontGL::hAlignFromName(horizontal_align_name); +// } +// return gl_hfont_align; +//} + +// Return the rectangle of the last-constructed child, +// if present and a first-class widget (eg, not a close box or drag handle) +// Returns true if found +static bool get_last_child_rect(LLView* parent, LLRect *rect) +{ + if (!parent) return false; + + LLView::child_list_t::const_iterator itor = + parent->getChildList()->begin(); + for (;itor != parent->getChildList()->end(); ++itor) + { + LLView *last_view = (*itor); + if (last_view->getSaveToXML()) + { + *rect = last_view->getRect(); + return true; } } + return false; +} - if (node->hasAttribute("width")) - { - node->getAttributeS32("width", w); - } - if (node->hasAttribute("height")) +//static +void LLView::setupParams(LLView::Params& p, LLView* parent) +{ + const S32 VPAD = 4; + const S32 MIN_WIDGET_HEIGHT = 10; + + p.serializable(true); + + // *NOTE: This will confuse export of floater/panel coordinates unless + // the default is also "topleft". JC + if (p.layout().empty() && parent) { - node->getAttributeS32("height", h); + p.layout = parent->getLayout(); } - if (parent_view) + if (parent) { - if (node->hasAttribute("left_delta")) - { - S32 left_delta = 0; - node->getAttributeS32("left_delta", left_delta); - x = last_x + left_delta; - } - else if (node->hasAttribute("left") && node->hasAttribute("right")) + LLRect parent_rect = parent->getLocalRect(); + // overwrite uninitialized rect params, using context + LLRect last_rect = parent->getLocalRect(); + + bool layout_topleft = (p.layout() == "topleft"); + if (layout_topleft) { - // compute width based on left and right - S32 right = 0; - node->getAttributeS32("right", right); - if (right < 0) - { - right = parent_view->getRect().getWidth() + right; - } - w = right - x; + //invert top to bottom + if (p.rect.top.isProvided()) p.rect.top = parent_rect.getHeight() - p.rect.top; + if (p.rect.bottom.isProvided()) p.rect.bottom = parent_rect.getHeight() - p.rect.bottom; } - else if (node->hasAttribute("left")) + + // convert negative or centered coordinates to parent relative values + // Note: some of this logic matches the logic in TypedParam<LLRect>::getValueFromBlock() + + if (p.center_horiz) { - if (x < 0) + if (p.rect.left.isProvided() && p.rect.right.isProvided()) { - x = parent_view->getRect().getWidth() + x; - follows |= FOLLOWS_RIGHT; + S32 width = p.rect.right - p.rect.left; + width = llmax(width, 0); + S32 offset = parent_rect.getWidth()/2 - width/2; + p.rect.left = p.rect.left + offset; + p.rect.right = p.rect.right + offset; } else { - follows |= FOLLOWS_LEFT; + p.rect.left = p.rect.left + parent_rect.getWidth()/2 - p.rect.width/2; } } - else if (node->hasAttribute("width") && node->hasAttribute("right")) + else + { + if (p.rect.left < 0) p.rect.left = p.rect.left + parent_rect.getWidth(); + if (p.rect.right < 0) p.rect.right = p.rect.right + parent_rect.getWidth(); + } + if (p.center_vert) { - S32 right = 0; - node->getAttributeS32("right", right); - if (right < 0) + if (p.rect.bottom.isProvided() && p.rect.top.isProvided()) { - right = parent_view->getRect().getWidth() + right; + S32 height = p.rect.top - p.rect.bottom; + height = llmax(height, 0); + S32 offset = parent_rect.getHeight()/2 - height/2; + p.rect.bottom = p.rect.bottom + offset; + p.rect.top = p.rect.top + offset; + } + else + { + p.rect.bottom = p.rect.bottom + parent_rect.getHeight()/2 - p.rect.height/2; } - x = right - w; } else { - // left not specified, same as last - x = last_x; + if (p.rect.bottom < 0) p.rect.bottom = p.rect.bottom + parent_rect.getHeight(); + if (p.rect.top < 0) p.rect.top = p.rect.top + parent_rect.getHeight(); } - if (node->hasAttribute("bottom_delta")) + + // DEPRECATE: automatically fall back to height of MIN_WIDGET_HEIGHT pixels + if (!p.rect.height.isProvided() && !p.rect.top.isProvided()) { - S32 bottom_delta = 0; - node->getAttributeS32("bottom_delta", bottom_delta); - y = last_y + bottom_delta; + p.rect.height = MIN_WIDGET_HEIGHT; } - else if (node->hasAttribute("top")) + + last_rect.translate(0, last_rect.getHeight()); + + // If there was a recently constructed child, use its rectangle + get_last_child_rect(parent, &last_rect); + + if (layout_topleft) { - // compute height based on top - S32 top = 0; - node->getAttributeS32("top", top); - if (top < 0) + p.bottom_delta.setIfNotProvided(0, false); + + // Invert the sense of bottom_delta for topleft layout + if (p.bottom_delta.isProvided()) { - top = parent_view->getRect().getHeight() + top; + p.bottom_delta = -p.bottom_delta; } - h = top - y; - } - else if (node->hasAttribute("bottom")) - { - if (y < 0) + else if (p.top_pad.isProvided()) { - y = parent_view->getRect().getHeight() + y; - follows |= FOLLOWS_TOP; + p.bottom_delta = -(p.rect.height + p.top_pad); } - else + else if (p.top_delta.isProvided()) { - follows |= FOLLOWS_BOTTOM; + p.bottom_delta = + -(p.top_delta + p.rect.height - last_rect.getHeight()); } - } - else - { - // if bottom not specified, generate automatically - if (last_y == 0) + else if (!p.bottom_delta.isProvided() + && !p.left_delta.isProvided() + && !p.top_pad.isProvided() + && !p.left_pad.isProvided()) { - // treat first child as "bottom" - y = parent_view->getRect().getHeight() - (h + VPAD); - follows |= FOLLOWS_TOP; + // set default position is just below last rect + p.bottom_delta.set(-(p.rect.height + VPAD), false); } - else + + // default to same left edge + p.left_delta.setIfNotProvided(0, false); + if (p.left_pad.isProvided()) { - // treat subsequent children as "bottom_delta" - y = last_y - (h + VPAD); + // left_pad is based on prior widget's right edge + p.left_delta.set(p.left_pad + last_rect.getWidth(), false); } + + last_rect.translate(p.left_delta, p.bottom_delta); + } + else + { + // set default position is just below last rect + p.bottom_delta.setIfNotProvided(-(p.rect.height + VPAD), false); + p.left_delta.setIfNotProvided(0, false); + last_rect.translate(p.left_delta, p.bottom_delta); } - } - else - { - x = llmax(x, 0); - y = llmax(y, 0); - follows = FOLLOWS_LEFT | FOLLOWS_TOP; - } - rect.setOriginAndSize(x, y, w, h); - - return follows; -} - -void LLView::initFromXML(LLXMLNodePtr node, LLView* parent) -{ - // create rect first, as this will supply initial follows flags - LLRect view_rect; - U32 follows_flags = createRect(node, view_rect, parent, getRequiredRect()); - // call reshape in case there are any child elements that need to be layed out - reshape(view_rect.getWidth(), view_rect.getHeight()); - setRect(view_rect); - setFollows(follows_flags); - - parseFollowsFlags(node); - if (node->hasAttribute("control_name")) - { - std::string control_name; - node->getAttributeString("control_name", control_name); - setControlName(control_name, NULL); - } + // this handles case where *both* x and x_delta are provided + // ignore x in favor of default x + x_delta + if (p.bottom_delta.isProvided()) p.rect.bottom.set(0, false); + if (p.left_delta.isProvided()) p.rect.left.set(0, false); - if (node->hasAttribute("tool_tip")) - { - std::string tool_tip_msg; - node->getAttributeString("tool_tip", tool_tip_msg); - setToolTip(tool_tip_msg); + // selectively apply rectangle defaults, making sure that + // params are not flagged as having been "provided" + // as rect params are overconstrained and rely on provided flags + p.rect.left.setIfNotProvided(last_rect.mLeft, false); + p.rect.bottom.setIfNotProvided(last_rect.mBottom, false); + p.rect.top.setIfNotProvided(last_rect.mTop, false); + p.rect.right.setIfNotProvided(last_rect.mRight, false); + p.rect.width.setIfNotProvided(last_rect.getWidth(), false); + p.rect.height.setIfNotProvided(last_rect.getHeight(), false); } +} - if (node->hasAttribute("enabled")) - { - BOOL enabled; - node->getAttributeBOOL("enabled", enabled); - setEnabled(enabled); - } - - if (node->hasAttribute("visible")) +static S32 invert_vertical(S32 y, LLView* parent) +{ + if (y < 0) { - BOOL visible; - node->getAttributeBOOL("visible", visible); - setVisible(visible); + // already based on top-left, just invert + return -y; } - - if (node->hasAttribute("hover_cursor")) + else if (parent) { - std::string cursor_string; - node->getAttributeString("hover_cursor", cursor_string); - mHoverCursor = getCursorFromString(cursor_string); + // use parent to flip coordinate + S32 parent_height = parent->getRect().getHeight(); + return parent_height - y; } - - node->getAttributeBOOL("use_bounding_rect", mUseBoundingRect); - node->getAttributeBOOL("mouse_opaque", mMouseOpaque); - - node->getAttributeS32("default_tab_group", mDefaultTabGroup); - - reshape(view_rect.getWidth(), view_rect.getHeight()); -} - -void LLView::parseFollowsFlags(LLXMLNodePtr node) -{ - if (node->hasAttribute("follows")) + else { - setFollowsNone(); - - std::string follows; - node->getAttributeString("follows", follows); - - typedef boost::tokenizer<boost::char_separator<char> > tokenizer; - boost::char_separator<char> sep("|"); - tokenizer tokens(follows, sep); - tokenizer::iterator token_iter = tokens.begin(); - - while(token_iter != tokens.end()) - { - const std::string& token_str = *token_iter; - if (token_str == "left") + llwarns << "Attempting to convert layout to top-left with no parent" << llendl; + return y; + } +} + +// Assumes that input is in bottom-left coordinates, hence must call +// _before_ convert_coords_to_top_left(). +static void convert_to_relative_layout(LLView::Params& p, LLView* parent) +{ + // Use setupParams to get the final widget rectangle + // according to our wacky layout rules. + LLView::Params final = p; + LLView::setupParams(final, parent); + // Must actually extract the rectangle to get consistent + // right = left+width, top = bottom+height + LLRect final_rect = final.rect; + + // We prefer to write out top edge instead of bottom, regardless + // of whether we use relative positioning + bool converted_top = false; + + // Look for a last rectangle + LLRect last_rect; + if (get_last_child_rect(parent, &last_rect)) + { + // ...we have a previous widget to compare to + const S32 EDGE_THRESHOLD_PIXELS = 4; + S32 left_pad = final_rect.mLeft - last_rect.mRight; + S32 left_delta = final_rect.mLeft - last_rect.mLeft; + S32 top_pad = final_rect.mTop - last_rect.mBottom; + S32 top_delta = final_rect.mTop - last_rect.mTop; + // If my left edge is almost the same, or my top edge is + // almost the same... + if (llabs(left_delta) <= EDGE_THRESHOLD_PIXELS + || llabs(top_delta) <= EDGE_THRESHOLD_PIXELS) + { + // ...use relative positioning + // prefer top_pad if widgets are stacking vertically + // (coordinate system is still bottom-left here) + if (top_pad < 0) { - setFollowsLeft(); + p.top_pad = top_pad; + p.top_delta.setProvided(false); } - else if (token_str == "right") - { - setFollowsRight(); - } - else if (token_str == "top") + else { - setFollowsTop(); + p.top_pad.setProvided(false); + p.top_delta = top_delta; } - else if (token_str == "bottom") + // null out other vertical specifiers + p.rect.top.setProvided(false); + p.rect.bottom.setProvided(false); + p.bottom_delta.setProvided(false); + converted_top = true; + + // prefer left_pad if widgets are stacking horizontally + if (left_pad > 0) { - setFollowsBottom(); + p.left_pad = left_pad; + p.left_delta.setProvided(false); } - else if (token_str == "all") + else { - setFollowsAll(); + p.left_pad.setProvided(false); + p.left_delta = left_delta; } - ++token_iter; + p.rect.left.setProvided(false); + p.rect.right.setProvided(false); } } -} -// static -LLFontGL* LLView::selectFont(LLXMLNodePtr node) -{ - std::string font_name, font_size, font_style; - U8 style = 0; - - if (node->hasAttribute("font")) - { - node->getAttributeString("font", font_name); - } - - if (node->hasAttribute("font_size")) + if (!converted_top) { - node->getAttributeString("font_size", font_size); + // ...this is the first widget, or one that wasn't aligned + // prefer top/left specification + p.rect.top = final_rect.mTop; + p.rect.bottom.setProvided(false); + p.bottom_delta.setProvided(false); + p.top_pad.setProvided(false); + p.top_delta.setProvided(false); } - - if (node->hasAttribute("font_style")) - { - node->getAttributeString("font_style", font_style); - style = LLFontGL::getStyleFromString(font_style); - } - - if (node->hasAttribute("font-style")) - { - node->getAttributeString("font-style", font_style); - style = LLFontGL::getStyleFromString(font_style); - } - - if (font_name.empty()) - return NULL; - - LLFontDescriptor desc(font_name, font_size, style); - LLFontGL* gl_font = LLFontGL::getFont(desc); - - return gl_font; } -// static -LLFontGL::HAlign LLView::selectFontHAlign(LLXMLNodePtr node) +static void convert_coords_to_top_left(LLView::Params& p, LLView* parent) { - LLFontGL::HAlign gl_hfont_align = LLFontGL::LEFT; - - if (node->hasAttribute("halign")) + // Convert the coordinate system to be top-left based. + if (p.rect.top.isProvided()) { - std::string horizontal_align_name; - node->getAttributeString("halign", horizontal_align_name); - gl_hfont_align = LLFontGL::hAlignFromName(horizontal_align_name); + p.rect.top = invert_vertical(p.rect.top, parent); } - return gl_hfont_align; -} - -// static -LLFontGL::VAlign LLView::selectFontVAlign(LLXMLNodePtr node) -{ - LLFontGL::VAlign gl_vfont_align = LLFontGL::BASELINE; - - if (node->hasAttribute("valign")) + if (p.rect.bottom.isProvided()) { - std::string vert_align_name; - node->getAttributeString("valign", vert_align_name); - gl_vfont_align = LLFontGL::vAlignFromName(vert_align_name); + p.rect.bottom = invert_vertical(p.rect.bottom, parent); } - return gl_vfont_align; -} - -// static -LLFontGL::StyleFlags LLView::selectFontStyle(LLXMLNodePtr node) -{ - LLFontGL::StyleFlags gl_font_style = LLFontGL::NORMAL; - - if (node->hasAttribute("style")) + if (p.top_pad.isProvided()) { - std::string style_flags_name; - node->getAttributeString("style", style_flags_name); - - if (style_flags_name == "normal") - { - gl_font_style = LLFontGL::NORMAL; - } - else if (style_flags_name == "bold") - { - gl_font_style = LLFontGL::BOLD; - } - else if (style_flags_name == "italic") - { - gl_font_style = LLFontGL::ITALIC; - } - else if (style_flags_name == "underline") - { - gl_font_style = LLFontGL::UNDERLINE; - } - //else leave left + p.top_pad = -p.top_pad; } - return gl_font_style; -} - -bool LLView::setControlValue(const LLSD& value) -{ - std::string ctrlname = getControlName(); - if (!ctrlname.empty()) + if (p.top_delta.isProvided()) { - LLUI::sConfigGroup->setValue(ctrlname, value); - return true; + p.top_delta = -p.top_delta; } - return false; -} - -//virtual -void LLView::setControlName(const std::string& control_name, LLView *context) -{ - if (context == NULL) + if (p.bottom_delta.isProvided()) { - context = this; + p.bottom_delta = -p.bottom_delta; } + p.layout = "topleft"; +} - if (!mControlName.empty()) +//static +void LLView::setupParamsForExport(Params& p, LLView* parent) +{ + // Don't convert if already top-left based + if (p.layout() == "topleft") { - llwarns << "setControlName called twice on same control!" << llendl; - mControlConnection.disconnect(); // disconnect current signal - mControlName.clear(); + return; } - - // Register new listener - if (!control_name.empty()) - { - LLControlVariable *control = context->findControl(control_name); - if (control) - { - mControlName = control_name; - mControlConnection = control->getSignal()->connect(boost::bind(&controlListener, _1, getHandle(), std::string("value"))); - setValue(control->getValue()); - } - } -} -// static -bool LLView::controlListener(const LLSD& newvalue, LLHandle<LLView> handle, std::string type) -{ - LLView* view = handle.get(); - if (view) + // heuristic: Many of our floaters and panels were bulk-exported. + // These specify exactly bottom/left and height/width. + // Others were done by hand using bottom_delta and/or left_delta. + // Some rely on not specifying left to mean align with left edge. + // Try to convert both to use relative layout, but using top-left + // coordinates. + // Avoid rectangles where top/bottom/left/right was specified. + if (p.rect.height.isProvided() && p.rect.width.isProvided()) { - if (type == "value") + if (p.rect.bottom.isProvided() && p.rect.left.isProvided()) { - view->setValue(newvalue); - return true; + // standard bulk export, convert it + convert_to_relative_layout(p, parent); } - else if (type == "enabled") + else if (p.rect.bottom.isProvided() && p.left_delta.isProvided()) { - view->setEnabled(newvalue.asBoolean()); - return true; + // hand layout with left_delta + convert_to_relative_layout(p, parent); } - else if (type == "visible") + else if (p.bottom_delta.isProvided()) { - view->setVisible(newvalue.asBoolean()); - return true; + // hand layout with bottom_delta + // don't check for p.rect.left or p.left_delta because sometimes + // this layout doesn't set it for widgets that are left-aligned + convert_to_relative_layout(p, parent); } } - return false; -} -void LLView::addBoolControl(const std::string& name, bool initial_value) -{ - mFloaterControls[name] = new LLControlVariable(name, TYPE_BOOLEAN, initial_value, std::string("Internal floater control")); -} - -LLControlVariable *LLView::getControl(const std::string& name) -{ - control_map_t::iterator itor = mFloaterControls.find(name); - if (itor != mFloaterControls.end()) - { - return itor->second; - } - return NULL; + convert_coords_to_top_left(p, parent); } -//virtual -void LLView::setValue(const LLSD& value) -{ -} - -//virtual -LLSD LLView::getValue() const -{ - return LLSD(); -} - -LLView* LLView::createWidget(LLXMLNodePtr xml_node) const -{ - // forward requests to ui ctrl factory - return LLUICtrlFactory::getInstance()->createCtrlWidget(NULL, xml_node); -} - -// -// LLWidgetClassRegistry -// - -LLWidgetClassRegistry::LLWidgetClassRegistry() +LLView::tree_iterator_t LLView::beginTree() { + return tree_iterator_t(this, + boost::bind(boost::mem_fn(&LLView::beginChild), _1), + boost::bind(boost::mem_fn(&LLView::endChild), _1)); } -void LLWidgetClassRegistry::registerCtrl(const std::string& tag, LLWidgetClassRegistry::factory_func_t function) +LLView::tree_iterator_t LLView::endTree() { - std::string lower_case_tag = tag; - LLStringUtil::toLower(lower_case_tag); - - mCreatorFunctions[lower_case_tag] = function; + // an empty iterator is an "end" iterator + return tree_iterator_t(); } -BOOL LLWidgetClassRegistry::isTagRegistered(const std::string &tag) -{ - return mCreatorFunctions.find(tag) != mCreatorFunctions.end(); -} - -LLWidgetClassRegistry::factory_func_t LLWidgetClassRegistry::getCreatorFunc(const std::string& ctrl_type) -{ - factory_map_t::const_iterator found_it = mCreatorFunctions.find(ctrl_type); - if (found_it == mCreatorFunctions.end()) +// only create maps on demand, as they incur heap allocation/deallocation cost +// when a view is constructed/deconstructed +LLView::dummy_widget_map_t& LLView::getDummyWidgetMap() const +{ + if (!mDummyWidgets) { - return NULL; + mDummyWidgets = new dummy_widget_map_t(); } - return found_it->second; + return *mDummyWidgets; } - diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 721fe99f4a63b44608a067047e6a1aaf8787ffea..458d02d001b7e4782063428de773e04d97b760d4 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -37,6 +37,7 @@ // the HUD or a dialog box or a button. It can also contain sub-views // and child widgets +#include "stdtypes.h" #include "llcoord.h" #include "llfontgl.h" #include "llmortician.h" @@ -47,12 +48,14 @@ #include "llrect.h" #include "llui.h" #include "lluistring.h" -#include "lluixmltags.h" #include "llviewquery.h" -#include "llxmlnode.h" #include "stdenums.h" #include "lluistring.h" #include "llcursortypes.h" +#include "lluictrlfactory.h" +#include "lltreeiterators.h" + +#include <list> const U32 FOLLOWS_NONE = 0x00; const U32 FOLLOWS_LEFT = 0x01; @@ -75,9 +78,6 @@ virtual BOOL isPanel(); LLPanel virtual void setRect(const LLRect &rect); LLLineEditor -virtual void addCtrl( LLUICtrl* ctrl, S32 tab_group); -virtual void addCtrlAtEnd( LLUICtrl* ctrl, S32 tab_group); -virtual void removeCtrl( LLUICtrl* ctrl); LLPanel virtual BOOL canFocusChildren() const { return TRUE; } LLFolderView @@ -103,7 +103,7 @@ virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); LLUICtrl, et. al. virtual void translate( S32 x, S32 y ); LLMenuGL -virtual void userSetShape(const LLRect& new_rect); +virtual void setShape(const LLRect& new_rect, bool by_user); LLFloater, LLScrollLIstVtrl virtual LLView* findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir, LLView::ESnapType snap_type, S32 threshold, S32 padding = 0); virtual LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding = 0); @@ -121,10 +121,6 @@ virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,EDragAndDropTy virtual void draw(); * - * -virtual LLXMLNodePtr getXML(bool save_children = true) const; - * -virtual void initFromXML(LLXMLNodePtr node, LLView* parent); * virtual void onFocusLost() {} LLUICtrl, LLScrollListCtrl, LLMenuGL, LLLineEditor, LLComboBox @@ -132,14 +128,8 @@ virtual void onFocusReceived() {} LLUICtrl, LLTextEditor, LLScrollListVtrl, LLMenuGL, LLLineEditor virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; LLTabContainer, LLPanel, LLMenuGL -virtual void setControlName(const std::string& control, LLView *context); - LLSliderCtrl, LLCheckBoxCtrl -virtual std::string getControlName() const { return mControlName; } - LLSliderCtrl, LLCheckBoxCtrl virtual bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); LLMenuItem -virtual void setValue(const LLSD& value); - * protected: virtual BOOL handleKeyHere(KEY key, MASK mask); @@ -148,67 +138,69 @@ virtual BOOL handleUnicodeCharHere(llwchar uni_char); * */ -class LLUICtrlFactory; - -// maps xml strings to widget classes -class LLWidgetClassRegistry : public LLSingleton<LLWidgetClassRegistry> +class LLView : public LLMouseHandler, public LLMortician { - friend class LLSingleton<LLWidgetClassRegistry>; public: - typedef LLView* (*factory_func_t)(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - typedef std::map<std::string, factory_func_t> factory_map_t; - - void registerCtrl(const std::string& xml_tag, factory_func_t function); - BOOL isTagRegistered(const std::string& xml_tag); - factory_func_t getCreatorFunc(const std::string& xml_tag); - - // get (first) xml tag for a given class - template <class T> std::string getTag() + struct Follows : public LLInitParam::Choice<Follows> { - factory_map_t::iterator it; - for(it = mCreatorFunctions.begin(); it != mCreatorFunctions.end(); ++it) - { - if (it->second == T::fromXML) - { - return it->first; - } - } - - return ""; - } - -private: - LLWidgetClassRegistry(); - virtual ~LLWidgetClassRegistry() {}; - - typedef std::set<std::string> ctrl_name_set_t; - ctrl_name_set_t mUICtrlNames; + Option<std::string> string; + Option<U32> flags; - // map of xml tags to widget creator functions - factory_map_t mCreatorFunctions; -}; + Follows() + : string(""), + flags("flags", FOLLOWS_LEFT | FOLLOWS_TOP) + {} + }; -template<class T> -class LLRegisterWidget -{ -public: - LLRegisterWidget(const std::string& tag) + struct Params : public LLInitParam::Block<Params> { - LLWidgetClassRegistry* registry = LLWidgetClassRegistry::getInstance(); - if (registry->isTagRegistered(tag)) - { - //error! - llerrs << "Widget named " << tag << " already registered!" << llendl; - } - else - { - registry->registerCtrl(tag, T::fromXML); - } - } -}; + Mandatory<std::string> name; + + Optional<bool> enabled, + visible; + Optional<bool> mouse_opaque; + Optional<bool> use_bounding_rect; + Optional<S32> tab_group, + default_tab_group; + Optional<std::string> tool_tip; + + Optional<S32> sound_flags; + Optional<bool> serializable; + Optional<Follows> follows; + Optional<std::string> hover_cursor; + + // font params + Optional<const LLFontGL*> font; + Optional<LLFontGL::HAlign> font_halign; + Optional<LLFontGL::VAlign> font_valign; + + Optional<std::string> layout; + Optional<LLRect> rect; + // Historical bottom-left layout used bottom_delta and left_delta + // for relative positioning. New layout "topleft" prefers specifying + // based on top edge. + Optional<S32> bottom_delta, // deprecated + top_pad, // from last bottom to my top + top_delta, // from last top to my top + left_pad, // from last right to my left + left_delta; // from last left to my left + + Optional<bool> center_horiz, + center_vert; + + // these are nested attributes for LLLayoutPanel + //FIXME: get parent context involved in parsing traversal + Deprecated user_resize, + auto_resize, + needs_translate; + + Params(); + }; + void initFromParams(const LLView::Params&); -class LLView : public LLMouseHandler, public LLMortician -{ +protected: + LLView(const LLView::Params&); + friend class LLUICtrlFactory; public: #if LL_DEBUG @@ -253,10 +245,6 @@ public: typedef child_tab_order_t::reverse_iterator child_tab_order_reverse_iter_t; typedef child_tab_order_t::const_reverse_iterator child_tab_order_const_reverse_iter_t; - LLView(); - LLView(const std::string& name, BOOL mouse_opaque); - LLView(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows=FOLLOWS_NONE); - virtual ~LLView(); // Hack to support LLFocusMgr (from LLMouseHandler) @@ -300,15 +288,19 @@ public: void sendChildToBack(LLView* child); void moveChildToFrontOfTabGroup(LLUICtrl* child); void moveChildToBackOfTabGroup(LLUICtrl* child); + + virtual bool addChild(LLView* view, S32 tab_group = 0); + + // implemented in terms of addChild() + bool addChildInBack(LLView* view, S32 tab_group = 0); - void addChild(LLView* view, S32 tab_group = 0); - void addChildAtEnd(LLView* view, S32 tab_group = 0); // remove the specified child from the view, and set it's parent to NULL. - void removeChild(LLView* view, BOOL deleteIt = FALSE); + virtual void removeChild(LLView* view); + + // helper function for lluictrlfactory.h create<> template + void setParent(LLView* parent) { if (parent) parent->addChild(this); } - virtual void addCtrl( LLUICtrl* ctrl, S32 tab_group); - virtual void addCtrlAtEnd( LLUICtrl* ctrl, S32 tab_group); - virtual void removeCtrl( LLUICtrl* ctrl); + virtual BOOL postBuild() { return TRUE; } child_tab_order_t getCtrlOrder() const { return mCtrlOrder; } ctrl_list_t getCtrlList() const; @@ -316,6 +308,7 @@ public: void setDefaultTabGroup(S32 d) { mDefaultTabGroup = d; } S32 getDefaultTabGroup() const { return mDefaultTabGroup; } + S32 getLastTabGroup() { return mLastTabGroup; } BOOL isInVisibleChain() const; BOOL isInEnabledChain() const; @@ -347,7 +340,7 @@ public: virtual void onVisibilityChange ( BOOL curVisibilityIn ); void pushVisible(BOOL visible) { mLastVisible = mVisible; setVisible(visible); } - void popVisible() { setVisible(mLastVisible); mLastVisible = TRUE; } + void popVisible() { setVisible(mLastVisible); } LLHandle<LLView> getHandle() { mHandle.bind(this); return mHandle; } @@ -361,11 +354,14 @@ public: const LLRect& getRect() const { return mRect; } const LLRect& getBoundingRect() const { return mBoundingRect; } LLRect getLocalBoundingRect() const; - LLRect getScreenRect() const; + LLRect calcScreenRect() const; + LLRect calcScreenBoundingRect() const; LLRect getLocalRect() const; virtual LLRect getSnapRect() const; LLRect getLocalSnapRect() const; + std::string getLayout() { return mLayout; } + // Override and return required size for this object. 0 for width/height means don't care. virtual LLRect getRequiredRect(); void updateBoundingRect(); @@ -373,12 +369,17 @@ public: LLView* getRootView(); LLView* getParent() const { return mParentView; } LLView* getFirstChild() const { return (mChildList.empty()) ? NULL : *(mChildList.begin()); } + LLView* findPrevSibling(LLView* child); + LLView* findNextSibling(LLView* child); S32 getChildCount() const { return (S32)mChildList.size(); } template<class _Pr3> void sortChildren(_Pr3 _Pred) { mChildList.sort(_Pred); } BOOL hasAncestor(const LLView* parentp) const; BOOL hasChild(const std::string& childname, BOOL recurse = FALSE) const; BOOL childHasKeyboardFocus( const std::string& childname ) const; - + + typedef LLTreeDFSIter<LLView, child_list_const_iter_t> tree_iterator_t; + tree_iterator_t beginTree(); + tree_iterator_t endTree(); // // UTILITIES @@ -391,13 +392,11 @@ public: BOOL translateIntoRect( const LLRect& constraint, BOOL allow_partial_outside ); void centerWithin(const LLRect& bounds); - virtual void userSetShape(const LLRect& new_rect); + void setShape(const LLRect& new_rect, bool by_user = false); virtual LLView* findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir, LLView::ESnapType snap_type, S32 threshold, S32 padding = 0); virtual LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding = 0); - virtual BOOL canSnapTo(const LLView* other_view); - - virtual void snappedTo(const LLView* snap_view); + virtual void setSnappedTo(const LLView* snap_view); virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); @@ -407,15 +406,11 @@ public: EAcceptance* accept, std::string& tooltip_msg); - std::string getShowNamesToolTip(); + virtual std::string getShowNamesToolTip(); virtual void draw(); - virtual LLXMLNodePtr getXML(bool save_children = true) const; - //FIXME: make LLView non-instantiable from XML - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); - virtual void initFromXML(LLXMLNodePtr node, LLView* parent); - void parseFollowsFlags(LLXMLNodePtr node); + void parseFollowsFlags(const LLView::Params& params); // Some widgets, like close box buttons, don't need to be saved BOOL getSaveToXML() const { return mSaveToXML; } @@ -440,25 +435,16 @@ public: void screenRectToLocal( const LLRect& screen, LLRect* local ) const; void localRectToScreen( const LLRect& local, LLRect* screen ) const; - // Listener dispatching functions (Dispatcher deletes pointers to listeners on deregistration or destruction) - LLOldEvents::LLSimpleListener* getListenerByName(const std::string& callback_name); - void registerEventListener(std::string name, LLOldEvents::LLSimpleListener* function); - void deregisterEventListener(std::string name); - std::string findEventListener(LLOldEvents::LLSimpleListener *listener) const; - void addListenerToControl(LLOldEvents::LLEventDispatcher *observer, const std::string& name, LLSD filter, LLSD userdata); - - void addBoolControl(const std::string& name, bool initial_value); - LLControlVariable *getControl(const std::string& name); LLControlVariable *findControl(const std::string& name); - bool setControlValue(const LLSD& value); - virtual void setControlName(const std::string& control, LLView *context); - virtual std::string getControlName() const { return mControlName; } + // Moved setValue(), getValue(), setControlValue(), setControlName(), + // controlListener() to LLUICtrl because an LLView is NOT assumed to + // contain a value. If that's what you want, use LLUICtrl instead. // virtual bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata); - virtual void setValue(const LLSD& value); - virtual LLSD getValue() const; const child_list_t* getChildList() const { return &mChildList; } + const child_list_const_iter_t beginChild() { return mChildList.begin(); } + const child_list_const_iter_t endChild() { return mChildList.end(); } // LLMouseHandler functions // Default behavior is to pass events to children @@ -479,26 +465,20 @@ public: /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const; /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const; - template <class T> T* getChild(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const + // view-specific handlers + virtual void onMouseEnter(S32 x, S32 y, MASK mask); + virtual void onMouseLeave(S32 x, S32 y, MASK mask); + + + template <class T> T* findChild(const std::string& name, BOOL recurse = TRUE) const { LLView* child = getChildView(name, recurse, FALSE); T* result = dynamic_cast<T*>(child); - if (!result) - { - // did we find *something* with that name? - if (child) - { - llwarns << "Found child named " << name << " but of wrong type " << typeid(child).name() << ", expecting " << typeid(T).name() << llendl; - } - if (create_if_missing) - { - // create dummy widget instance here - result = createDummyWidget<T>(name); - } - } return result; } + template <class T> T* getChild(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; + template <class T> T& getChildRef(const std::string& name, BOOL recurse = TRUE) const { return *getChild<T>(name, recurse, TRUE); @@ -506,72 +486,24 @@ public: virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; - template <class T> T* createDummyWidget(const std::string& name) const - { - T* widget = getDummyWidget<T>(name); - if (!widget) - { - // get xml tag name corresponding to requested widget type (e.g. "button") - std::string xml_tag = LLWidgetClassRegistry::getInstance()->getTag<T>(); - if (xml_tag.empty()) - { - llwarns << "No xml tag registered for this class " << llendl; - return NULL; - } - // create dummy xml node (<button name="foo"/>) - LLXMLNodePtr new_node_ptr = new LLXMLNode(xml_tag.c_str(), FALSE); - new_node_ptr->createChild("name", TRUE)->setStringValue(name); - - widget = dynamic_cast<T*>(createWidget(new_node_ptr)); - if (widget) - { - // need non-const to update private dummy widget cache - llwarns << "Making dummy " << xml_tag << " named " << name << " in " << getName() << llendl; - mDummyWidgets.insert(std::make_pair(name, widget)); - } - else - { - // dynamic cast will fail if T::fromXML only registered for base class - llwarns << "Failed to create dummy widget of requested type " << llendl; - return NULL; - } - } - return widget; - } - template <class T> T* getDummyWidget(const std::string& name) const { - dummy_widget_map_t::const_iterator found_it = mDummyWidgets.find(name); - if (found_it == mDummyWidgets.end()) + dummy_widget_map_t::const_iterator found_it = getDummyWidgetMap().find(name); + if (found_it == getDummyWidgetMap().end()) { return NULL; } return dynamic_cast<T*>(found_it->second); } - LLView* createWidget(LLXMLNodePtr xml_node) const; - + // determines allowable children when parsing XUI + virtual const widget_registry_t& getChildRegistry() const; + ////////////////////////////////////////////// // statics - static U32 createRect(LLXMLNodePtr node, LLRect &rect, LLView* parent_view, const LLRect &required_rect = LLRect()); - - static LLFontGL* selectFont(LLXMLNodePtr node); - static LLFontGL::HAlign selectFontHAlign(LLXMLNodePtr node); - static LLFontGL::VAlign selectFontVAlign(LLXMLNodePtr node); - static LLFontGL::StyleFlags selectFontStyle(LLXMLNodePtr node); - + ////////////////////////////////////////////// + //static LLFontGL::HAlign selectFontHAlign(LLXMLNodePtr node); - // Only saves color if different from default setting. - static void addColorXML(LLXMLNodePtr node, const LLColor4& color, - const char* xml_name, const char* control_name); - // Escapes " (quot) ' (apos) & (amp) < (lt) > (gt) - //static std::string escapeXML(const std::string& xml); - static LLWString escapeXML(const LLWString& xml); - - //same as above, but wraps multiple lines in quotes and prepends - //indent as leading white space on each line - static std::string escapeXML(const std::string& xml, std::string& indent); - // focuses the item in the list after the currently-focused item, wrapping if necessary static BOOL focusNext(LLView::child_list_t & result); // focuses the item in the list before the currently-focused item, wrapping if necessary @@ -582,14 +514,24 @@ public: // return query for iterating over focus roots in tab order static const LLCtrlQuery & getFocusRootsQuery(); - static BOOL deleteViewByHandle(LLHandle<LLView> handle); + static void deleteViewByHandle(LLHandle<LLView> handle); static LLWindow* getWindow(void) { return LLUI::sWindow; } + // Set up params after XML load before calling new(), + // usually to adjust layout. + static void setupParams(Params& p, LLView* parent); + + // For re-export of floaters and panels, convert the coordinate system + // to be top-left based. + static void setupParamsForExport(Params& p, LLView* parent); -protected: + //virtual BOOL addChildFromParam(const LLInitParam::BaseBlock& params) { return TRUE; } virtual BOOL handleKeyHere(KEY key, MASK mask); virtual BOOL handleUnicodeCharHere(llwchar uni_char); + virtual void handleReshape(const LLRect& rect, bool by_user); + +protected: void drawDebugRect(); void drawChild(LLView* childp, S32 x_offset = 0, S32 y_offset = 0, BOOL force_draw = FALSE); @@ -612,11 +554,8 @@ protected: LLView* childrenHandleRightMouseDown(S32 x, S32 y, MASK mask); LLView* childrenHandleRightMouseUp(S32 x, S32 y, MASK mask); - static bool controlListener(const LLSD& newvalue, LLHandle<LLView> handle, std::string type); - - typedef std::map<std::string, LLControlVariable*> control_map_t; - control_map_t mFloaterControls; - + ECursorType mHoverCursor; + private: LLView* mParentView; child_list_t mChildList; @@ -625,11 +564,13 @@ private: // location in pixels, relative to surrounding structure, bottom,left=0,0 LLRect mRect; LLRect mBoundingRect; + std::string mLayout; U32 mReshapeFlags; child_tab_order_t mCtrlOrder; S32 mDefaultTabGroup; + S32 mLastTabGroup; BOOL mEnabled; // Enabled means "accepts input that has an effect on the state of the application." // A disabled view, for example, may still have a scrollbar that responds to mouse events. @@ -651,18 +592,12 @@ private: static LLWindow* sWindow; // All root views must know about their window. - typedef std::map<std::string, LLPointer<LLOldEvents::LLSimpleListener> > dispatch_list_t; - dispatch_list_t mDispatchList; - - std::string mControlName; - typedef std::map<std::string, LLView*> dummy_widget_map_t; - mutable dummy_widget_map_t mDummyWidgets; + // allocate this map no demand, as it is rarely needed + mutable dummy_widget_map_t* mDummyWidgets; - boost::signals2::connection mControlConnection; + dummy_widget_map_t& getDummyWidgetMap() const; - ECursorType mHoverCursor; - public: static BOOL sDebugRects; // Draw debug rects behind everything. static BOOL sDebugKeys; @@ -670,8 +605,12 @@ public: static BOOL sDebugMouseHandling; static std::string sMouseHandlerMessage; static S32 sSelectID; - static BOOL sEditingUI; - static LLView* sEditingUIView; +// static BOOL sEditingUI; +// static LLView* sEditingUIView; + static std::set<LLView*> sPreviewHighlightedElements; // DEV-16869 + static BOOL sHighlightingDiffs; // DEV-16869 + static LLView* sPreviewClickedElement; // DEV-16869 + static BOOL sDrawPreviewHighlights; static S32 sLastLeftXML; static S32 sLastBottomXML; static BOOL sForceReshape; @@ -688,5 +627,39 @@ private: LLView::child_tab_order_t mTabOrder; }; +template <class T> T* LLView::getChild(const std::string& name, BOOL recurse, BOOL create_if_missing) const +{ + LLView* child = getChildView(name, recurse, FALSE); + T* result = dynamic_cast<T*>(child); + if (!result) + { + // did we find *something* with that name? + if (child) + { + llwarns << "Found child named " << name << " but of wrong type " << typeid(child).name() << ", expecting " << typeid(T*).name() << llendl; + } + if (create_if_missing) + { + result = getDummyWidget<T>(name); + if (!result) + { + result = LLUICtrlFactory::createDummyWidget<T>(name); + + if (result) + { + llwarns << "Making dummy " << typeid(T).name() << " named \"" << name << "\" in " << getName() << llendl; + } + else + { + llwarns << "Failed to create dummy " << typeid(T).name() << llendl; + return NULL; + } + + getDummyWidgetMap()[name] = result; + } + } + } + return result; +} #endif //LL_LLVIEW_H diff --git a/indra/llui/llviewborder.cpp b/indra/llui/llviewborder.cpp index d4a9e9d1bf165ea2fc5c712587da599532927f3d..a5b09671bbd952a5aae6d7bda83aa54551c208b2 100644 --- a/indra/llui/llviewborder.cpp +++ b/indra/llui/llviewborder.cpp @@ -33,25 +33,52 @@ #include "llviewborder.h" #include "llrender.h" #include "llfocusmgr.h" +#include "lluictrlfactory.h" -static LLRegisterWidget<LLViewBorder> r("view_border"); - -LLViewBorder::LLViewBorder( const std::string& name, const LLRect& rect, EBevel bevel, EStyle style, S32 width ) - : - LLView( name, rect, FALSE ), - mBevel( bevel ), - mStyle( style ), - mHighlightLight( LLUI::sColorsGroup->getColor( "DefaultHighlightLight" ) ), - mHighlightDark( LLUI::sColorsGroup->getColor( "DefaultHighlightDark" ) ), - mShadowLight( LLUI::sColorsGroup->getColor( "DefaultShadowLight" ) ), - mShadowDark( LLUI::sColorsGroup->getColor( "DefaultShadowDark" ) ), - mBorderWidth( width ), - mTexture( NULL ), - mHasKeyboardFocus( FALSE ) +static LLDefaultWidgetRegistry::Register<LLViewBorder> r("view_border"); + +void LLViewBorder::BevelValues::declareValues() +{ + declare("in", LLViewBorder::BEVEL_IN); + declare("out", LLViewBorder::BEVEL_OUT); + declare("bright", LLViewBorder::BEVEL_BRIGHT); + declare("none", LLViewBorder::BEVEL_NONE); +} + +void LLViewBorder::StyleValues::declareValues() { - setFollowsAll(); + declare("line", LLViewBorder::STYLE_LINE); + declare("texture", LLViewBorder::STYLE_TEXTURE); } +LLViewBorder::Params::Params() +: bevel_type("bevel_style", BEVEL_OUT), + render_style("border_style", STYLE_LINE), + border_thickness("border_thickness"), + highlight_light_color("highlight_light_color"), + highlight_dark_color("highlight_dark_color"), + shadow_light_color("shadow_light_color"), + shadow_dark_color("shadow_dark_color") +{ + name = "view_border"; + mouse_opaque = false; + follows.flags = FOLLOWS_ALL; +} + + +LLViewBorder::LLViewBorder(const LLViewBorder::Params& p) +: LLView(p), + mTexture( NULL ), + mHasKeyboardFocus( FALSE ), + mBorderWidth(p.border_thickness), + mHighlightLight(p.highlight_light_color()), + mHighlightDark(p.highlight_dark_color()), + mShadowLight(p.shadow_light_color()), + mShadowDark(p.shadow_dark_color()), + mBevel(p.bevel_type), + mStyle(p.render_style) +{} + void LLViewBorder::setColors( const LLColor4& shadow_dark, const LLColor4& highlight_light ) { mShadowDark = shadow_dark; @@ -69,7 +96,7 @@ void LLViewBorder::setColorsExtended( const LLColor4& shadow_light, const LLColo void LLViewBorder::setTexture( const LLUUID &image_id ) { - mTexture = LLUI::sImageProvider->getUIImageByID(image_id); + mTexture = LLUI::getUIImageByID(image_id); } @@ -114,17 +141,17 @@ void LLViewBorder::drawOnePixelLines() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLColor4 top_color = mHighlightLight; - LLColor4 bottom_color = mHighlightLight; + LLColor4 top_color = mHighlightLight.get(); + LLColor4 bottom_color = mHighlightLight.get(); switch( mBevel ) { case BEVEL_OUT: - top_color = mHighlightLight; - bottom_color = mShadowDark; + top_color = mHighlightLight.get(); + bottom_color = mShadowDark.get(); break; case BEVEL_IN: - top_color = mShadowDark; - bottom_color = mHighlightLight; + top_color = mShadowDark.get(); + bottom_color = mHighlightLight.get(); break; case BEVEL_NONE: // use defaults @@ -163,31 +190,36 @@ void LLViewBorder::drawTwoPixelLines() LLColor4 focus_color = gFocusMgr.getFocusColor(); - F32* top_in_color = mShadowDark.mV; - F32* top_out_color = mShadowDark.mV; - F32* bottom_in_color = mShadowDark.mV; - F32* bottom_out_color = mShadowDark.mV; + LLColor4 top_in_color; + LLColor4 top_out_color; + LLColor4 bottom_in_color; + LLColor4 bottom_out_color; + switch( mBevel ) { case BEVEL_OUT: - top_in_color = mHighlightLight.mV; - top_out_color = mHighlightDark.mV; - bottom_in_color = mShadowLight.mV; - bottom_out_color = mShadowDark.mV; + top_in_color = mHighlightLight.get(); + top_out_color = mHighlightDark.get(); + bottom_in_color = mShadowLight.get(); + bottom_out_color = mShadowDark.get(); break; case BEVEL_IN: - top_in_color = mShadowDark.mV; - top_out_color = mShadowLight.mV; - bottom_in_color = mHighlightDark.mV; - bottom_out_color = mHighlightLight.mV; + top_in_color = mShadowDark.get(); + top_out_color = mShadowLight.get(); + bottom_in_color = mHighlightDark.get(); + bottom_out_color = mHighlightLight.get(); break; case BEVEL_BRIGHT: - top_in_color = mHighlightLight.mV; - top_out_color = mHighlightLight.mV; - bottom_in_color = mHighlightLight.mV; - bottom_out_color = mHighlightLight.mV; + top_in_color = mHighlightLight.get(); + top_out_color = mHighlightLight.get(); + bottom_in_color = mHighlightLight.get(); + bottom_out_color = mHighlightLight.get(); break; case BEVEL_NONE: + top_in_color = mShadowDark.get(); + top_out_color = mShadowDark.get(); + bottom_in_color = mShadowDark.get(); + bottom_out_color = mShadowDark.get(); // use defaults break; default: @@ -196,8 +228,8 @@ void LLViewBorder::drawTwoPixelLines() if( mHasKeyboardFocus ) { - top_out_color = focus_color.mV; - bottom_out_color = focus_color.mV; + top_out_color = focus_color; + bottom_out_color = focus_color; } S32 left = 0; @@ -206,19 +238,19 @@ void LLViewBorder::drawTwoPixelLines() S32 bottom = 0; // draw borders - gGL.color3fv( top_out_color ); + gGL.color3fv( top_out_color.mV ); gl_line_2d(left, bottom, left, top-1); gl_line_2d(left, top-1, right, top-1); - gGL.color3fv( top_in_color ); + gGL.color3fv( top_in_color.mV ); gl_line_2d(left+1, bottom+1, left+1, top-2); gl_line_2d(left+1, top-2, right-1, top-2); - gGL.color3fv( bottom_out_color ); + gGL.color3fv( bottom_out_color.mV ); gl_line_2d(right-1, top-1, right-1, bottom); gl_line_2d(left, bottom, right, bottom); - gGL.color3fv( bottom_in_color ); + gGL.color3fv( bottom_in_color.mV ); gl_line_2d(right-2, top-2, right-2, bottom+1); gl_line_2d(left+1, bottom+1, right-1, bottom+1); } @@ -302,26 +334,3 @@ BOOL LLViewBorder::getBevelFromAttribute(LLXMLNodePtr node, LLViewBorder::EBevel return FALSE; } - -// static -LLView* LLViewBorder::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("view_border"); - node->getAttributeString("name", name); - - LLViewBorder::EBevel bevel_style = LLViewBorder::BEVEL_IN; - getBevelFromAttribute(node, bevel_style); - - S32 border_thickness = 1; - node->getAttributeS32("border_thickness", border_thickness); - - LLViewBorder* border = new LLViewBorder(name, - LLRect(), - bevel_style, - LLViewBorder::STYLE_LINE, - border_thickness); - - border->initFromXML(node, parent); - - return border; -} diff --git a/indra/llui/llviewborder.h b/indra/llui/llviewborder.h index a40e6534a89d4fe86439aa3aef1de7d5067c298d..37e13fb18196f1b1204e38bbb805f137d820b1fa 100644 --- a/indra/llui/llviewborder.h +++ b/indra/llui/llviewborder.h @@ -35,15 +35,41 @@ #include "llview.h" - class LLViewBorder : public LLView { public: - enum EBevel { BEVEL_IN, BEVEL_OUT, BEVEL_BRIGHT, BEVEL_NONE }; - enum EStyle { STYLE_LINE, STYLE_TEXTURE }; - - LLViewBorder( const std::string& name, const LLRect& rect, EBevel bevel = BEVEL_OUT, EStyle style = STYLE_LINE, S32 width = 1 ); - + typedef enum e_bevel { BEVEL_IN, BEVEL_OUT, BEVEL_BRIGHT, BEVEL_NONE } EBevel ; + typedef enum e_style { STYLE_LINE, STYLE_TEXTURE } EStyle; + + struct BevelValues + : public LLInitParam::TypeValuesHelper<LLViewBorder::EBevel, BevelValues> + { + static void declareValues(); + }; + + struct StyleValues + : public LLInitParam::TypeValuesHelper<LLViewBorder::EStyle, StyleValues> + { + static void declareValues(); + }; + + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Optional<EBevel, BevelValues> bevel_type; + Optional<EStyle, StyleValues> render_style; + Optional<S32> border_thickness; + + Optional<LLUIColor> highlight_light_color, + highlight_dark_color, + shadow_light_color, + shadow_dark_color; + + Params(); + }; +protected: + LLViewBorder(const Params&); + friend class LLUICtrlFactory; +public: virtual void setValue(const LLSD& val) { setRect(LLRect(val)); } virtual BOOL isCtrl() const { return FALSE; } @@ -51,7 +77,6 @@ public: // llview functionality virtual void draw(); - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); static BOOL getBevelFromAttribute(LLXMLNodePtr node, LLViewBorder::EBevel& bevel_style); void setBorderWidth(S32 width) { mBorderWidth = width; } @@ -63,8 +88,8 @@ public: const LLColor4& highlight_light, const LLColor4& highlight_dark ); void setTexture( const class LLUUID &image_id ); - LLColor4 getHighlightLight() {return mHighlightLight;} - LLColor4 getShadowDark() {return mHighlightDark;} + LLColor4 getHighlightLight() {return mHighlightLight.get();} + LLColor4 getShadowDark() {return mHighlightDark.get();} EStyle getStyle() const { return mStyle; } @@ -77,14 +102,14 @@ private: void drawTextureTrapezoid( F32 degrees, S32 width, S32 length, F32 start_x, F32 start_y ); EBevel mBevel; - const EStyle mStyle; - LLColor4 mHighlightLight; - LLColor4 mHighlightDark; - LLColor4 mShadowLight; - LLColor4 mShadowDark; - LLColor4 mBackgroundColor; + EStyle mStyle; + LLUIColor mHighlightLight; + LLUIColor mHighlightDark; + LLUIColor mShadowLight; + LLUIColor mShadowDark; + LLUIColor mBackgroundColor; S32 mBorderWidth; - LLUIImagePtr mTexture; + LLPointer<LLUIImage> mTexture; BOOL mHasKeyboardFocus; }; diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4107289e855624ea628b40f81d3864a551f4df67 --- /dev/null +++ b/indra/llui/llviewmodel.cpp @@ -0,0 +1,163 @@ +/** + * @file llviewmodel.cpp + * @author Nat Goodspeed + * @date 2008-08-08 + * @brief Implementation for llviewmodel. + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +// Precompiled header +#include "linden_common.h" +// associated header +#include "llviewmodel.h" +// STL headers +// std headers +// external library headers +// other Linden headers + +/// +LLViewModel::LLViewModel() + : mDirty(false) +{ +} + +/// Instantiate an LLViewModel with an existing data value +LLViewModel::LLViewModel(const LLSD& value) + : mDirty(false) +{ + setValue(value); +} + +/// Update the stored value +void LLViewModel::setValue(const LLSD& value) +{ + mValue = value; + mDirty = true; +} + +LLSD LLViewModel::getValue() const +{ + return mValue; +} + +//////////////////////////////////////////////////////////////////////////// + +/// +LLTextViewModel::LLTextViewModel() + : LLViewModel(false), + mUpdateFromDisplay(false) +{ +} + +/// Instantiate an LLViewModel with an existing data value +LLTextViewModel::LLTextViewModel(const LLSD& value) + : LLViewModel(value), + mUpdateFromDisplay(false) +{ +} + +/// Update the stored value +void LLTextViewModel::setValue(const LLSD& value) +{ + LLViewModel::setValue(value); + mDisplay = utf8str_to_wstring(value.asString()); + // mDisplay and mValue agree + mUpdateFromDisplay = false; +} + +void LLTextViewModel::setDisplay(const LLWString& value) +{ + // This is the strange way to alter the value. Normally we'd setValue() + // and do the utf8str_to_wstring() to get the corresponding mDisplay + // value. But a text editor might want to edit the display string + // directly, then convert back to UTF8 on commit. + mDisplay = value; + mDirty = true; + // Don't immediately convert to UTF8 -- do it lazily -- we expect many + // more setDisplay() calls than getValue() calls. Just flag that it needs + // doing. + mUpdateFromDisplay = true; +} + +LLSD LLTextViewModel::getValue() const +{ + // Has anyone called setDisplay() since the last setValue()? If so, have + // to convert mDisplay back to UTF8. + if (mUpdateFromDisplay) + { + // The fact that we're lazily updating fields in this object should be + // transparent to clients, which is why this method is left + // conventionally const. Nor do we particularly want to make these + // members mutable. Just cast away constness in this one place. + LLTextViewModel* nthis = const_cast<LLTextViewModel*>(this); + nthis->mUpdateFromDisplay = false; + nthis->mValue = wstring_to_utf8str(mDisplay); + } + return LLViewModel::getValue(); +} + + +//////////////////////////////////////////////////////////////////////////// + +LLListViewModel::LLListViewModel(const LLSD& values) + : LLViewModel() +{ +} + +void LLListViewModel::addColumn(const LLSD& column, EAddPosition pos) +{ +} + +void LLListViewModel::clearColumns() +{ +} + +void LLListViewModel::setColumnLabel(const std::string& column, const std::string& label) +{ +} + +LLScrollListItem* LLListViewModel::addElement(const LLSD& value, EAddPosition pos, + void* userdata) +{ + return NULL; +} + +LLScrollListItem* LLListViewModel::addSimpleElement(const std::string& value, EAddPosition pos, + const LLSD& id) +{ + return NULL; +} + +void LLListViewModel::clearRows() +{ +} + +void LLListViewModel::sortByColumn(const std::string& name, bool ascending) +{ +} diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h new file mode 100644 index 0000000000000000000000000000000000000000..c8a9b52ccaae8f2cb9da6ef502ec449943125b0c --- /dev/null +++ b/indra/llui/llviewmodel.h @@ -0,0 +1,219 @@ +/** + * @file llviewmodel.h + * @author Nat Goodspeed + * @date 2008-08-08 + * @brief Define "View Model" classes intended to store data values for use + * by LLUICtrl subclasses. The phrase is borrowed from Microsoft + * terminology, in which "View Model" means the storage object + * underlying a specific widget object -- as in our case -- rather + * than the business "model" object underlying the overall "view" + * presented by the collection of widgets. + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#if ! defined(LL_LLVIEWMODEL_H) +#define LL_LLVIEWMODEL_H + +#include "llpointer.h" +#include "llsd.h" +#include "llrefcount.h" +#include "stdenums.h" +#include "llstring.h" +#include <string> + +class LLScrollListItem; + +class LLViewModel; +class LLTextViewModel; +class LLListViewModel; +// Because LLViewModel is derived from LLRefCount, always pass, store +// and return LLViewModelPtr rather than plain LLViewModel*. +typedef LLPointer<LLViewModel> LLViewModelPtr; +typedef LLPointer<LLTextViewModel> LLTextViewModelPtr; +typedef LLPointer<LLListViewModel> LLListViewModelPtr; + +/** + * LLViewModel stores a scalar LLSD data item, the current display value of a + * scalar LLUICtrl widget. LLViewModel subclasses are used to store data + * collections used for aggregate widgets. LLViewModel is ref-counted because + * -- for multiple skins -- we may have distinct widgets sharing the same + * LLViewModel data. This way, the LLViewModel is quietly deleted when the + * last referencing widget is destroyed. + */ +class LLViewModel: public LLRefCount +{ +public: + LLViewModel(); + /// Instantiate an LLViewModel with an existing data value + LLViewModel(const LLSD& value); + + /// Update the stored value + virtual void setValue(const LLSD& value); + /// Get the stored value, in appropriate type. + virtual LLSD getValue() const; + + /// Has the value been changed since last time we checked? + bool isDirty() const { return mDirty; } + /// Once the value has been saved to a file, or otherwise consumed by the + /// app, we no longer need to enable the Save button + void resetDirty() { mDirty = false; } + // + void setDirty() { mDirty = true; } + +protected: + LLSD mValue; + bool mDirty; +}; + +/** + * LLTextViewModel stores a value displayed as text. + */ +class LLTextViewModel: public LLViewModel +{ +public: + LLTextViewModel(); + /// Instantiate an LLViewModel with an existing data value + LLTextViewModel(const LLSD& value); + + // LLViewModel functions + virtual void setValue(const LLSD& value); + virtual LLSD getValue() const; + + // New functions + /// Get the stored value in string form + LLWString getDisplay() const { return mDisplay; } + /** + * Set the display string directly (see LLTextEditor). What the user is + * editing is actually the LLWString value rather than the underlying + * UTF-8 value. + */ + void setDisplay(const LLWString& value); + +private: + /// To avoid converting every widget's stored value from LLSD to LLWString + /// every frame, cache the converted value + LLWString mDisplay; + /// As the user edits individual characters (setDisplay()), defer + /// LLWString-to-UTF8 conversions until s/he's done. + bool mUpdateFromDisplay; +}; + +/** + * LLListViewModel stores a list of data items. The semantics are borrowed + * from LLScrollListCtrl. + */ +class LLListViewModel: public LLViewModel +{ +public: + LLListViewModel() {} + LLListViewModel(const LLSD& values); + + virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); + virtual void clearColumns(); + virtual void setColumnLabel(const std::string& column, const std::string& label); + virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, + void* userdata = NULL); + virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos, + const LLSD& id); + virtual void clearRows(); + virtual void sortByColumn(const std::string& name, bool ascending); +}; + +//namespace LLViewModel +//{ +// class Value +// { +// public: +// Value(const LLSD& value = LLSD()); +// +// LLSD getValue() const { return mValue; } +// void setValue(const LLSD& value) { mValue = value; } +// +// bool isAvailable() const { return false; } +// bool isReadOnly() const { return false; } +// +// bool undo() { return false; } +// bool redo() { return false; } +// +// /// Has the value been changed since last time we checked? +// bool isDirty() const { return mDirty; } +// /// Once the value has been saved to a file, or otherwise consumed by the +// /// app, we no longer need to enable the Save button +// void resetDirty() { mDirty = false; } +// // +// void setDirty() { mDirty = true; } +// +// protected: +// LLSD mValue; +// bool mDirty; +// }; +// +// class Numeric : public Value +// { +// public: +// Numeric(S32 value = 0); +// Numeric(F32 value); +// +// F32 getPrecision(); +// F32 getMin(); +// F32 getMax(); +// +// void increment(); +// void decrement(); +// }; +// +// class MultipleValues : public Value +// { +// class Selector +// {}; +// +// MultipleValues(); +// virtual S32 numElements(); +// }; +// +// class Tuple : public MultipleValues +// { +// Tuple(S32 size); +// LLSD getValue(S32 which) const; +// void setValue(S32 which, const LLSD& value); +// }; +// +// class List : public MultipleValues +// { +// List(); +// +// void add(const ValueModel& value); +// bool remove(const Selector& item); +// +// void setSortElement(const Selector& element); +// void sort(); +// }; +// +//}; +#endif /* ! defined(LL_LLVIEWMODEL_H) */ diff --git a/indra/llui/llviewquery.h b/indra/llui/llviewquery.h index e87795f9a38f07359aaf775ac0e9b6526c6d16c0..98d9bf8796ff7572eb38346ecd410e61c5b63a85 100644 --- a/indra/llui/llviewquery.h +++ b/indra/llui/llviewquery.h @@ -35,7 +35,7 @@ #include <list> -#include "llmemory.h" +#include "llsingleton.h" #include "llui.h" class LLView; diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index d6a6eca34150dfdbddbad07de729a33a6d5d2a00..54af8b43add9488ec20722d75bfade005933d81f 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -41,7 +41,9 @@ #endif #include "lldir.h" + #include "llerror.h" +#include "lltimer.h" // ms_sleep() #include "lluuid.h" #if LL_WINDOWS @@ -125,16 +127,20 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask) } const std::string LLDir::findFile(const std::string &filename, - const std::string searchPath1, - const std::string searchPath2, - const std::string searchPath3) const + const std::string& searchPath1, + const std::string& searchPath2, + const std::string& searchPath3) const { std::vector<std::string> search_paths; search_paths.push_back(searchPath1); search_paths.push_back(searchPath2); search_paths.push_back(searchPath3); + return findFile(filename, search_paths); +} - std::vector<std::string>::iterator search_path_iter; +const std::string LLDir::findFile(const std::string& filename, const std::vector<std::string> search_paths) const +{ + std::vector<std::string>::const_iterator search_path_iter; for (search_path_iter = search_paths.begin(); search_path_iter != search_paths.end(); ++search_path_iter) @@ -319,19 +325,13 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd prefix += mDirDelimiter; prefix += "app_settings"; break; - + case LL_PATH_CHARACTER: prefix = getAppRODataDir(); prefix += mDirDelimiter; prefix += "character"; break; - case LL_PATH_MOTIONS: - prefix = getAppRODataDir(); - prefix += mDirDelimiter; - prefix += "motions"; - break; - case LL_PATH_HELP: prefix = "help"; break; @@ -372,17 +372,29 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd prefix = getSkinDir(); break; + case LL_PATH_DEFAULT_SKIN: + prefix = getDefaultSkinDir(); + break; + + case LL_PATH_USER_SKIN: + prefix = getOSUserAppDir(); + prefix += mDirDelimiter; + prefix += "user_settings"; + prefix += mDirDelimiter; + prefix += "skins"; + break; + case LL_PATH_SKINS: prefix = getAppRODataDir(); prefix += mDirDelimiter; prefix += "skins"; break; - //case LL_PATH_HTML: - // prefix = getSkinDir(); - // prefix += mDirDelimiter; - // prefix += "html"; - // break; + case LL_PATH_LOCAL_ASSETS: + prefix = getAppRODataDir(); + prefix += mDirDelimiter; + prefix += "local_assets"; + break; case LL_PATH_MOZILLA_PROFILE: prefix = getOSUserAppDir(); @@ -488,11 +500,14 @@ std::string LLDir::findSkinnedFilename(const std::string &subdir1, const std::st std::string subdirs = ((subdir1.empty() ? "" : mDirDelimiter) + subdir1) + ((subdir2.empty() ? "" : mDirDelimiter) + subdir2); - std::string found_file = findFile(filename, - getUserSkinDir() + subdirs, // first look in user skin override - getSkinDir() + subdirs, // then in current skin - getDefaultSkinDir() + subdirs); // and last in default skin + std::vector<std::string> search_paths; + + search_paths.push_back(getUserSkinDir() + subdirs); // first look in user skin override + search_paths.push_back(getSkinDir() + subdirs); // then in current skin + search_paths.push_back(getDefaultSkinDir() + subdirs); // then default skin + search_paths.push_back(getCacheDir() + subdirs); // and last in preload directory + std::string found_file = findFile(filename, search_paths); return found_file; } diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h index 760b6512a5469089b0a77ac6099c012388d6da5b..a33f7a29149c3d53f078ea5f452e9ff46df7b44e 100644 --- a/indra/llvfs/lldir.h +++ b/indra/llvfs/lldir.h @@ -47,17 +47,19 @@ typedef enum ELLPath LL_PATH_PER_SL_ACCOUNT = 3, LL_PATH_CACHE = 4, LL_PATH_CHARACTER = 5, - LL_PATH_MOTIONS = 6, - LL_PATH_HELP = 7, - LL_PATH_LOGS = 8, - LL_PATH_TEMP = 9, - LL_PATH_SKINS = 10, - LL_PATH_TOP_SKIN = 11, - LL_PATH_CHAT_LOGS = 12, - LL_PATH_PER_ACCOUNT_CHAT_LOGS = 13, - LL_PATH_MOZILLA_PROFILE = 14, -// LL_PATH_HTML = 15, + LL_PATH_HELP = 6, + LL_PATH_LOGS = 7, + LL_PATH_TEMP = 8, + LL_PATH_SKINS = 9, + LL_PATH_TOP_SKIN = 10, + LL_PATH_CHAT_LOGS = 11, + LL_PATH_PER_ACCOUNT_CHAT_LOGS = 12, + LL_PATH_MOZILLA_PROFILE = 13, + LL_PATH_USER_SKIN = 14, + LL_PATH_LOCAL_ASSETS = 15, +// LL_PATH_HTML = 16, LL_PATH_EXECUTABLE = 16, + LL_PATH_DEFAULT_SKIN = 17, LL_PATH_LAST } ELLPath; @@ -68,8 +70,13 @@ class LLDir LLDir(); virtual ~LLDir(); - virtual void initAppDirs(const std::string &app_name) = 0; - public: + // app_name - Usually SecondLife, used for creating settings directories + // in OS-specific location, such as C:\Documents and Settings + // app_read_only_data_dir - Usually the source code directory, used + // for test applications to read newview data files. + virtual void initAppDirs(const std::string &app_name, + const std::string& app_read_only_data_dir = "") = 0; + virtual S32 deleteFilesInDir(const std::string &dirname, const std::string &mask); // pure virtual functions @@ -79,7 +86,8 @@ class LLDir virtual std::string getCurPath() = 0; virtual BOOL fileExists(const std::string &filename) const = 0; - const std::string findFile(const std::string &filename, const std::string searchPath1 = "", const std::string searchPath2 = "", const std::string searchPath3 = "") const; + const std::string findFile(const std::string& filename, const std::vector<std::string> filenames) const; + const std::string findFile(const std::string& filename, const std::string& searchPath1 = "", const std::string& searchPath2 = "", const std::string& searchPath3 = "") const; const std::string &getExecutablePathAndName() const; // Full pathname of the executable const std::string &getAppName() const; // install directory under progams/ ie "SecondLife" const std::string &getExecutableDir() const; // Directory where the executable is located diff --git a/indra/llvfs/lldir_linux.cpp b/indra/llvfs/lldir_linux.cpp index 8ff8c5d1c64fdd91d3325a66a943e09b5db467bf..2d724f0f9fc9c16735ddaa87941678199bb1240f 100644 --- a/indra/llvfs/lldir_linux.cpp +++ b/indra/llvfs/lldir_linux.cpp @@ -139,8 +139,14 @@ LLDir_Linux::~LLDir_Linux() // Implementation -void LLDir_Linux::initAppDirs(const std::string &app_name) +void LLDir_Linux::initAppDirs(const std::string &app_name, + const std::string& app_read_only_data_dir) { + // Allow override so test apps can read newview directory + if (!app_read_only_data_dir.empty()) + { + mAppRODataDir = app_read_only_data_dir; + } mAppName = app_name; std::string upper_app_name(app_name); diff --git a/indra/llvfs/lldir_linux.h b/indra/llvfs/lldir_linux.h index 20b408f8dccc318702096c543fb6d4df6d98fed2..a78a9854ffafc76dcd04782c09a8319eb2660586 100644 --- a/indra/llvfs/lldir_linux.h +++ b/indra/llvfs/lldir_linux.h @@ -44,7 +44,8 @@ public: LLDir_Linux(); virtual ~LLDir_Linux(); - virtual void initAppDirs(const std::string &app_name); + /*virtual*/ void initAppDirs(const std::string &app_name, + const std::string& app_read_only_data_dir); public: virtual std::string getCurPath(); virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask); diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp index d4dee5a02ea774f61da981c7a7c1689e3dbeed40..04577bfc3b6e02c8a35339a8069408ed9b3320d4 100644 --- a/indra/llvfs/lldir_mac.cpp +++ b/indra/llvfs/lldir_mac.cpp @@ -203,8 +203,14 @@ LLDir_Mac::~LLDir_Mac() // Implementation -void LLDir_Mac::initAppDirs(const std::string &app_name) +void LLDir_Mac::initAppDirs(const std::string &app_name, + const std::string& app_read_only_data_dir) { + // Allow override so test apps can read newview directory + if (!app_read_only_data_dir.empty()) + { + mAppRODataDir = app_read_only_data_dir; + } mCAFile = getExpandedFilename(LL_PATH_APP_SETTINGS, "CA.pem"); //dumpCurrentDirectories(); diff --git a/indra/llvfs/lldir_mac.h b/indra/llvfs/lldir_mac.h index 28d48a0b6a3d93237ca416ab20ee49b7b509b0a9..82ac94ed4c595b278c8b8a155ac4836eb4735dd5 100644 --- a/indra/llvfs/lldir_mac.h +++ b/indra/llvfs/lldir_mac.h @@ -43,7 +43,8 @@ public: LLDir_Mac(); virtual ~LLDir_Mac(); - virtual void initAppDirs(const std::string &app_name); + /*virtual*/ void initAppDirs(const std::string &app_name, + const std::string& app_read_only_data_dir); public: virtual S32 deleteFilesInDir(const std::string &dirname, const std::string &mask); virtual std::string getCurPath(); diff --git a/indra/llvfs/lldir_solaris.cpp b/indra/llvfs/lldir_solaris.cpp index 9553d923aaa91546fb425e3a6b2e1070b534c40f..ba71bc0eb4049aef31726a6735ef0819759fa9e4 100644 --- a/indra/llvfs/lldir_solaris.cpp +++ b/indra/llvfs/lldir_solaris.cpp @@ -172,8 +172,14 @@ LLDir_Solaris::~LLDir_Solaris() // Implementation -void LLDir_Solaris::initAppDirs(const std::string &app_name) +void LLDir_Solaris::initAppDirs(const std::string &app_name, + const std::string& app_read_only_data_dir) { + // Allow override so test apps can read newview directory + if (!app_read_only_data_dir.empty()) + { + mAppRODataDir = app_read_only_data_dir; + } mAppName = app_name; std::string upper_app_name(app_name); diff --git a/indra/llvfs/lldir_solaris.h b/indra/llvfs/lldir_solaris.h index 139754ba28abe20a7c0684478c7183ded87cc5aa..1fa83483557cff3a2c038b9d0bf3afa24f357b65 100644 --- a/indra/llvfs/lldir_solaris.h +++ b/indra/llvfs/lldir_solaris.h @@ -44,7 +44,8 @@ public: LLDir_Solaris(); virtual ~LLDir_Solaris(); - virtual void initAppDirs(const std::string &app_name); + /*virtual*/ void initAppDirs(const std::string &app_name, + const std::string& app_read_only_data_dir); public: virtual std::string getCurPath(); virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask); diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp index 19b9bcc6eac42badce6418f202046651fbae4f22..1fdd31c6350e98c9a81b4a7267bb5aab3a209a8b 100644 --- a/indra/llvfs/lldir_win32.cpp +++ b/indra/llvfs/lldir_win32.cpp @@ -151,8 +151,14 @@ LLDir_Win32::~LLDir_Win32() // Implementation -void LLDir_Win32::initAppDirs(const std::string &app_name) +void LLDir_Win32::initAppDirs(const std::string &app_name, + const std::string& app_read_only_data_dir) { + // Allow override so test apps can read newview directory + if (!app_read_only_data_dir.empty()) + { + mAppRODataDir = app_read_only_data_dir; + } mAppName = app_name; mOSUserAppDir = mOSUserDir; mOSUserAppDir += "\\"; @@ -205,7 +211,14 @@ void LLDir_Win32::initAppDirs(const std::string &app_name) llwarns << "Couldn't create LL_PATH_MOZILLA_PROFILE dir " << getExpandedFilename(LL_PATH_MOZILLA_PROFILE,"") << llendl; } } - + res = LLFile::mkdir(getExpandedFilename(LL_PATH_USER_SKIN,"")); + if (res == -1) + { + if (errno != EEXIST) + { + llwarns << "Couldn't create LL_PATH_SKINS dir " << getExpandedFilename(LL_PATH_USER_SKIN,"") << llendl; + } + } mCAFile = getExpandedFilename(LL_PATH_APP_SETTINGS, "CA.pem"); } diff --git a/indra/llvfs/lldir_win32.h b/indra/llvfs/lldir_win32.h index 8710ca50e1419c18b3bfb5c4ba0e1761bd322399..d2497901e4f4f7d42dc8f5d8c2a6ca5e7fa8635d 100644 --- a/indra/llvfs/lldir_win32.h +++ b/indra/llvfs/lldir_win32.h @@ -41,7 +41,8 @@ public: LLDir_Win32(); virtual ~LLDir_Win32(); - /*virtual*/ void initAppDirs(const std::string &app_name); + /*virtual*/ void initAppDirs(const std::string &app_name, + const std::string& app_read_only_data_dir); /*virtual*/ std::string getCurPath(); /*virtual*/ U32 countFilesInDir(const std::string &dirname, const std::string &mask); diff --git a/indra/llvfs/lllfsthread.h b/indra/llvfs/lllfsthread.h index 5a11cb33d74e08222892a3e8c6b73600c7793dbe..31396933024a1c66d47a8699b5aa100ce94a91c8 100644 --- a/indra/llvfs/lllfsthread.h +++ b/indra/llvfs/lllfsthread.h @@ -39,7 +39,7 @@ #include <set> #include "llapr.h" - +#include "llpointer.h" #include "llqueuedthread.h" //============================================================================ diff --git a/indra/llvfs/llpidlock.cpp b/indra/llvfs/llpidlock.cpp index e231002a527c46f3ecedd1db901884efd1db4f23..93ac1203023c45ca049a259f1143718f8e183b51 100755 --- a/indra/llvfs/llpidlock.cpp +++ b/indra/llvfs/llpidlock.cpp @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2007&license=viewergpl$ * - * Copyright (c) 2007, Linden Research, Inc. + * Copyright (c) 2007-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -13,12 +13,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/llvfs/llpidlock.h b/indra/llvfs/llpidlock.h index 44ed8caf463e92fd17a5330787e8a0349e269e8d..42aee4dc4fc4edcc092895f405ab0007b12f75a9 100755 --- a/indra/llvfs/llpidlock.h +++ b/indra/llvfs/llpidlock.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2007, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/llvfs/llvfs.cpp b/indra/llvfs/llvfs.cpp index ef8c4d6c7f36bfee32b03a3ad71d4b1b027c210a..9ce1e75d06f501ade52c7f9a5645afa63c7d0873 100644 --- a/indra/llvfs/llvfs.cpp +++ b/indra/llvfs/llvfs.cpp @@ -46,7 +46,9 @@ #endif #include "llvfs.h" + #include "llstl.h" +#include "lltimer.h" const S32 FILE_BLOCK_MASK = 0x000003FF; // 1024-byte blocks const S32 VFS_CLEANUP_SIZE = 5242880; // how much space we free up in a single stroke diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index e1f7406287f982029e93cbd0838e5094cbcf9790..f5d06b725871c4983df821d3f1319ddb6801107c 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -37,7 +37,7 @@ set(llwindow_SOURCE_FILES llwindowheadless.cpp ) -set(llwindows_HEADER_FILES +set(llwindow_HEADER_FILES CMakeLists.txt llkeyboard.h @@ -47,10 +47,12 @@ set(llwindows_HEADER_FILES set(viewer_SOURCE_FILES llwindow.cpp llmousehandler.cpp + llwindowcallbacks.cpp ) set(viewer_HEADER_FILES llwindow.h + llwindowcallbacks.h llpreeditor.h llmousehandler.h ) @@ -143,7 +145,7 @@ if (SERVER AND NOT WINDOWS AND NOT DARWIN) ${llwindow_SOURCE_FILES} ${server_SOURCE_FILES} ) - # *TODO: This should probably have target_link_libraries + target_link_libraries (llwindowheadless ${llwindow_LINK_LIBRARIES}) endif (SERVER AND NOT WINDOWS AND NOT DARWIN) if (llwindow_HEADER_FILES) diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp index e0cb82d2be56f7f18a3c7502604a4c0b04782c1d..d8058baf53f49b5e07c4444775dc533730f64734 100644 --- a/indra/llwindow/lldxhardware.cpp +++ b/indra/llwindow/lldxhardware.cpp @@ -47,6 +47,7 @@ #include "llstring.h" #include "llstl.h" +#include "lltimer.h" void (*gWriteDebug)(const char* msg) = NULL; LLDXHardware gDXHardware; diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp index 02b4ed17c22754ede6f53d062fe8ca60dfa74554..f0f618aef15a19b5abe1b680644d26d2e1597f5c 100644 --- a/indra/llwindow/llkeyboard.cpp +++ b/indra/llwindow/llkeyboard.cpp @@ -34,7 +34,7 @@ #include "indra_constants.h" #include "llkeyboard.h" -#include "llwindow.h" +#include "llwindowcallbacks.h" // diff --git a/indra/llwindow/llkeyboardmacosx.cpp b/indra/llwindow/llkeyboardmacosx.cpp index ec82032161f2ee755bcc8b0d5920de2b5151f010..f53773c39319675616fa3679b22ac3f8de5d2de2 100644 --- a/indra/llwindow/llkeyboardmacosx.cpp +++ b/indra/llwindow/llkeyboardmacosx.cpp @@ -34,7 +34,7 @@ #include "linden_common.h" #include "llkeyboardmacosx.h" -#include "llwindow.h" +#include "llwindowcallbacks.h" #include <Carbon/Carbon.h> diff --git a/indra/llwindow/llkeyboardsdl.cpp b/indra/llwindow/llkeyboardsdl.cpp index 8a6b6d62983c83b27a27c25ca528aa9e8b1e8992..8a0b1de98c517df265b01247012dce6a0633b779 100644 --- a/indra/llwindow/llkeyboardsdl.cpp +++ b/indra/llwindow/llkeyboardsdl.cpp @@ -34,7 +34,7 @@ #include "linden_common.h" #include "llkeyboardsdl.h" -#include "llwindow.h" +#include "llwindowcallbacks.h" #include "SDL/SDL.h" LLKeyboardSDL::LLKeyboardSDL() diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp index a06f19149cd04a68a1af6d84c3dba67e00b56565..ea11e0537eb5c1a61f3861b5b29ff067120a6826 100644 --- a/indra/llwindow/llkeyboardwin32.cpp +++ b/indra/llwindow/llkeyboardwin32.cpp @@ -34,14 +34,16 @@ #include "linden_common.h" -#include "llkeyboardwin32.h" - -#include "llwindow.h" - #define WIN32_LEAN_AND_MEAN #include <winsock2.h> #include <windows.h> +#include "llkeyboardwin32.h" + +#include "llwindowcallbacks.h" + + + LLKeyboardWin32::LLKeyboardWin32() { // Set up key mapping for windows - eventually can read this from a file? diff --git a/indra/llwindow/llpreeditor.h b/indra/llwindow/llpreeditor.h index 370f76cb8563e6da825117347200ea291fbce1a8..dd63a98606ec3fb28051e5c5abb14cf9ac13f70e 100644 --- a/indra/llwindow/llpreeditor.h +++ b/indra/llwindow/llpreeditor.h @@ -94,7 +94,7 @@ public: // Get the contents of this preeditor as a LLWString. If there is an active preedit, // the returned LLWString contains it. - virtual const LLWString & getWText() const = 0; + virtual LLWString getWText() const = 0; // Handle a UTF-32 char on this preeditor, i.e., add the character // to the contents. diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index 7e412a14deab904580ff1fb03d913e9b2e505ee4..1c6c9e6e9d210ba202c7ab1794cbf207aedd38ce 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -46,14 +46,12 @@ #include "llerror.h" #include "llkeyboard.h" #include "linked_lists.h" +#include "llwindowcallbacks.h" -//static instance for default callbacks -LLWindowCallbacks LLWindow::sDefaultCallbacks; // -// LLWindowCallbacks +// Globals // - LLSplashScreen *gSplashScreenp = NULL; BOOL gDebugClicks = FALSE; BOOL gDebugWindowProc = FALSE; @@ -67,158 +65,6 @@ const std::string gURLProtocolWhitelist[] = { "file:", "http:", "https:" }; // Important - these lists should match - protocol to handler const std::string gURLProtocolWhitelistHandler[] = { "http", "http", "https" }; -BOOL LLWindowCallbacks::handleTranslatedKeyDown(const KEY key, const MASK mask, BOOL repeated) -{ - return FALSE; -} - - -BOOL LLWindowCallbacks::handleTranslatedKeyUp(const KEY key, const MASK mask) -{ - return FALSE; -} - -void LLWindowCallbacks::handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level) -{ -} - -BOOL LLWindowCallbacks::handleUnicodeChar(llwchar uni_char, MASK mask) -{ - return FALSE; -} - - -BOOL LLWindowCallbacks::handleMouseDown(LLWindow *window, const LLCoordGL pos, MASK mask) -{ - return FALSE; -} - -BOOL LLWindowCallbacks::handleMouseUp(LLWindow *window, const LLCoordGL pos, MASK mask) -{ - return FALSE; -} - -void LLWindowCallbacks::handleMouseLeave(LLWindow *window) -{ - return; -} - -BOOL LLWindowCallbacks::handleCloseRequest(LLWindow *window) -{ - //allow the window to close - return TRUE; -} - -void LLWindowCallbacks::handleQuit(LLWindow *window) -{ - if(LLWindowManager::destroyWindow(window) == FALSE) - { - llerrs << "LLWindowCallbacks::handleQuit() : Couldn't destroy window" << llendl; - } -} - -BOOL LLWindowCallbacks::handleRightMouseDown(LLWindow *window, const LLCoordGL pos, MASK mask) -{ - return FALSE; -} - -BOOL LLWindowCallbacks::handleRightMouseUp(LLWindow *window, const LLCoordGL pos, MASK mask) -{ - return FALSE; -} - -BOOL LLWindowCallbacks::handleMiddleMouseDown(LLWindow *window, const LLCoordGL pos, MASK mask) -{ - return FALSE; -} - -BOOL LLWindowCallbacks::handleMiddleMouseUp(LLWindow *window, const LLCoordGL pos, MASK mask) -{ - return FALSE; -} - -BOOL LLWindowCallbacks::handleActivate(LLWindow *window, BOOL activated) -{ - return FALSE; -} - -BOOL LLWindowCallbacks::handleActivateApp(LLWindow *window, BOOL activating) -{ - return FALSE; -} - -void LLWindowCallbacks::handleMouseMove(LLWindow *window, const LLCoordGL pos, MASK mask) -{ -} - -void LLWindowCallbacks::handleScrollWheel(LLWindow *window, S32 clicks) -{ -} - -void LLWindowCallbacks::handleResize(LLWindow *window, const S32 width, const S32 height) -{ -} - -void LLWindowCallbacks::handleFocus(LLWindow *window) -{ -} - -void LLWindowCallbacks::handleFocusLost(LLWindow *window) -{ -} - -void LLWindowCallbacks::handleMenuSelect(LLWindow *window, const S32 menu_item) -{ -} - -BOOL LLWindowCallbacks::handlePaint(LLWindow *window, const S32 x, const S32 y, - const S32 width, const S32 height) -{ - return FALSE; -} - -BOOL LLWindowCallbacks::handleDoubleClick(LLWindow *window, const LLCoordGL pos, MASK mask) -{ - return FALSE; -} - -void LLWindowCallbacks::handleWindowBlock(LLWindow *window) -{ -} - -void LLWindowCallbacks::handleWindowUnblock(LLWindow *window) -{ -} - -void LLWindowCallbacks::handleDataCopy(LLWindow *window, S32 data_type, void *data) -{ -} - -BOOL LLWindowCallbacks::handleTimerEvent(LLWindow *window) -{ - return FALSE; -} - -BOOL LLWindowCallbacks::handleDeviceChange(LLWindow *window) -{ - return FALSE; -} - -void LLWindowCallbacks::handlePingWatchdog(LLWindow *window, const char * msg) -{ - -} - -void LLWindowCallbacks::handlePauseWatchdog(LLWindow *window) -{ - -} - -void LLWindowCallbacks::handleResumeWatchdog(LLWindow *window) -{ - -} - S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type) { @@ -257,8 +103,8 @@ S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type) // LLWindow // -LLWindow::LLWindow(BOOL fullscreen, U32 flags) - : mCallbacks(&sDefaultCallbacks), +LLWindow::LLWindow(LLWindowCallbacks* callbacks, BOOL fullscreen, U32 flags) + : mCallbacks(callbacks), mPostQuit(TRUE), mFullscreen(fullscreen), mFullscreenWidth(0), @@ -275,9 +121,23 @@ LLWindow::LLWindow(BOOL fullscreen, U32 flags) mHideCursorPermanent(FALSE), mFlags(flags), mHighSurrogate(0) +{ } + +LLWindow::~LLWindow() +{ } + +//virtual +BOOL LLWindow::isValid() { + return TRUE; } - + +//virtual +BOOL LLWindow::canDelete() +{ + return TRUE; +} + // virtual void LLWindow::incBusyCount() { @@ -293,13 +153,28 @@ void LLWindow::decBusyCount() } } -void LLWindow::setCallbacks(LLWindowCallbacks *callbacks) +//virtual +void LLWindow::resetBusyCount() { - mCallbacks = callbacks; - if (gKeyboard) - { - gKeyboard->setCallbacks(callbacks); - } + mBusyCount = 0; +} + +//virtual +S32 LLWindow::getBusyCount() const +{ + return mBusyCount; +} + +//virtual +ECursorType LLWindow::getCursor() const +{ + return mCurrentCursor; +} + +//virtual +BOOL LLWindow::dialogColorPicker(F32 *r, F32 *g, F32 *b) +{ + return FALSE; } void *LLWindow::getMediaWindow() @@ -462,23 +337,7 @@ void LLSplashScreen::hide() static std::set<LLWindow*> sWindowList; LLWindow* LLWindowManager::createWindow( - const std::string& title, - const std::string& name, - LLCoordScreen upper_left, - LLCoordScreen size, - U32 flags, - BOOL fullscreen, - BOOL clearBg, - BOOL disable_vsync, - BOOL use_gl, - BOOL ignore_pixel_depth) -{ - return createWindow( - title, name, upper_left.mX, upper_left.mY, size.mX, size.mY, flags, - fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth); -} - -LLWindow* LLWindowManager::createWindow( + LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, @@ -492,26 +351,26 @@ LLWindow* LLWindowManager::createWindow( if (use_gl) { #if LL_MESA_HEADLESS - new_window = new LLWindowMesaHeadless( + new_window = new LLWindowMesaHeadless(callbacks, title, name, x, y, width, height, flags, fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth); #elif LL_SDL - new_window = new LLWindowSDL( + new_window = new LLWindowSDL(callbacks, title, x, y, width, height, flags, fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples); #elif LL_WINDOWS - new_window = new LLWindowWin32( + new_window = new LLWindowWin32(callbacks, title, name, x, y, width, height, flags, fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples); #elif LL_DARWIN - new_window = new LLWindowMacOSX( + new_window = new LLWindowMacOSX(callbacks, title, name, x, y, width, height, flags, fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples); #endif } else { - new_window = new LLWindowHeadless( + new_window = new LLWindowHeadless(callbacks, title, name, x, y, width, height, flags, fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth); } diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 8361771b665ab42d7c326e27140e6caa2031b784..8602225108414776a775b16bea4e3c8a64bb43d5 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -39,52 +39,8 @@ #include "llcursortypes.h" class LLSplashScreen; - -class LLWindow; - class LLPreeditor; - -class LLWindowCallbacks -{ -public: - virtual ~LLWindowCallbacks() {} - virtual BOOL handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated); - virtual BOOL handleTranslatedKeyUp(KEY key, MASK mask); - virtual void handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level); - virtual BOOL handleUnicodeChar(llwchar uni_char, MASK mask); - - virtual BOOL handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); - virtual BOOL handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); - virtual void handleMouseLeave(LLWindow *window); - // return TRUE to allow window to close, which will then cause handleQuit to be called - virtual BOOL handleCloseRequest(LLWindow *window); - // window is about to be destroyed, clean up your business - virtual void handleQuit(LLWindow *window); - virtual BOOL handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); - virtual BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); - virtual BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); - virtual BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); - virtual BOOL handleActivate(LLWindow *window, BOOL activated); - virtual BOOL handleActivateApp(LLWindow *window, BOOL activating); - virtual void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); - virtual void handleScrollWheel(LLWindow *window, S32 clicks); - virtual void handleResize(LLWindow *window, S32 width, S32 height); - virtual void handleFocus(LLWindow *window); - virtual void handleFocusLost(LLWindow *window); - virtual void handleMenuSelect(LLWindow *window, S32 menu_item); - virtual BOOL handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S32 height); - virtual BOOL handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask); // double-click of left mouse button - virtual void handleWindowBlock(LLWindow *window); // window is taking over CPU for a while - virtual void handleWindowUnblock(LLWindow *window); // window coming back after taking over CPU for a while - virtual void handleDataCopy(LLWindow *window, S32 data_type, void *data); - virtual BOOL handleTimerEvent(LLWindow *window); - virtual BOOL handleDeviceChange(LLWindow *window); - - virtual void handlePingWatchdog(LLWindow *window, const char * msg); - virtual void handlePauseWatchdog(LLWindow *window); - virtual void handleResumeWatchdog(LLWindow *window); - -}; +class LLWindowCallbacks; // Refer to llwindow_test in test/common/llwindow for usage example @@ -134,12 +90,12 @@ public: // arrow/hour if busycount > 0. virtual void incBusyCount(); virtual void decBusyCount(); - virtual void resetBusyCount() { mBusyCount = 0; } - virtual S32 getBusyCount() const { return mBusyCount; } + virtual void resetBusyCount(); + virtual S32 getBusyCount() const; // Sets cursor, may set to arrow+hourglass virtual void setCursor(ECursorType cursor) = 0; - virtual ECursorType getCursor() const { return mCurrentCursor; } + virtual ECursorType getCursor() const; virtual void captureMouse() = 0; virtual void releaseMouse() = 0; @@ -183,13 +139,12 @@ public: virtual F32 getPixelAspectRatio() = 0; virtual void setNativeAspectRatio(F32 aspect) = 0; - void setCallbacks(LLWindowCallbacks *callbacks); - virtual void beforeDialog() {}; // prepare to put up an OS dialog (if special measures are required, such as in fullscreen mode) virtual void afterDialog() {}; // undo whatever was done in beforeDialog() -// opens system default color picker - virtual BOOL dialog_color_picker (F32 *r, F32 *g, F32 *b) { return FALSE; }; + // opens system default color picker, modally + // Returns TRUE if valid color selected + virtual BOOL dialogColorPicker(F32 *r, F32 *g, F32 *b); // return a platform-specific window reference (HWND on Windows, WindowRef on the Mac, Gtk window on Linux) virtual void *getPlatformWindow() = 0; @@ -207,12 +162,12 @@ public: static std::vector<std::string> getDynamicFallbackFontList(); protected: - LLWindow(BOOL fullscreen, U32 flags); - virtual ~LLWindow() {} - virtual BOOL isValid() {return TRUE;} - virtual BOOL canDelete() {return TRUE;} -protected: - static LLWindowCallbacks sDefaultCallbacks; + LLWindow(LLWindowCallbacks* callbacks, BOOL fullscreen, U32 flags); + virtual ~LLWindow(); + // Defaults to true + virtual BOOL isValid(); + // Defaults to true + virtual BOOL canDelete(); protected: LLWindowCallbacks* mCallbacks; @@ -294,18 +249,8 @@ const S32 OSBTN_CANCEL = 3; class LLWindowManager { public: - static LLWindow* createWindow( - const std::string& title, - const std::string& name, - LLCoordScreen upper_left = LLCoordScreen(10, 10), - LLCoordScreen size = LLCoordScreen(320, 240), - U32 flags = 0, - BOOL fullscreen = FALSE, - BOOL clearBg = FALSE, - BOOL disable_vsync = TRUE, - BOOL use_gl = TRUE, - BOOL ignore_pixel_depth = FALSE); static LLWindow *createWindow( + LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags = 0, BOOL fullscreen = FALSE, diff --git a/indra/llwindow/llwindowcallbacks.cpp b/indra/llwindow/llwindowcallbacks.cpp new file mode 100644 index 0000000000000000000000000000000000000000..72f99971499de517a6910ad1aec1b4681073828e --- /dev/null +++ b/indra/llwindow/llwindowcallbacks.cpp @@ -0,0 +1,201 @@ +/** + * @file llwindowcallbacks.cpp + * @brief OS event callback class + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "llwindowcallbacks.h" + +#include "llcoord.h" + +// +// LLWindowCallbacks +// + +BOOL LLWindowCallbacks::handleTranslatedKeyDown(const KEY key, const MASK mask, BOOL repeated) +{ + return FALSE; +} + + +BOOL LLWindowCallbacks::handleTranslatedKeyUp(const KEY key, const MASK mask) +{ + return FALSE; +} + +void LLWindowCallbacks::handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level) +{ +} + +BOOL LLWindowCallbacks::handleUnicodeChar(llwchar uni_char, MASK mask) +{ + return FALSE; +} + + +BOOL LLWindowCallbacks::handleMouseDown(LLWindow *window, const LLCoordGL pos, MASK mask) +{ + return FALSE; +} + +BOOL LLWindowCallbacks::handleMouseUp(LLWindow *window, const LLCoordGL pos, MASK mask) +{ + return FALSE; +} + +void LLWindowCallbacks::handleMouseLeave(LLWindow *window) +{ + return; +} + +BOOL LLWindowCallbacks::handleCloseRequest(LLWindow *window) +{ + //allow the window to close + return TRUE; +} + +void LLWindowCallbacks::handleQuit(LLWindow *window) +{ +} + +BOOL LLWindowCallbacks::handleRightMouseDown(LLWindow *window, const LLCoordGL pos, MASK mask) +{ + return FALSE; +} + +BOOL LLWindowCallbacks::handleRightMouseUp(LLWindow *window, const LLCoordGL pos, MASK mask) +{ + return FALSE; +} + +BOOL LLWindowCallbacks::handleMiddleMouseDown(LLWindow *window, const LLCoordGL pos, MASK mask) +{ + return FALSE; +} + +BOOL LLWindowCallbacks::handleMiddleMouseUp(LLWindow *window, const LLCoordGL pos, MASK mask) +{ + return FALSE; +} + +BOOL LLWindowCallbacks::handleActivate(LLWindow *window, BOOL activated) +{ + return FALSE; +} + +BOOL LLWindowCallbacks::handleActivateApp(LLWindow *window, BOOL activating) +{ + return FALSE; +} + +void LLWindowCallbacks::handleMouseMove(LLWindow *window, const LLCoordGL pos, MASK mask) +{ +} + +void LLWindowCallbacks::handleScrollWheel(LLWindow *window, S32 clicks) +{ +} + +void LLWindowCallbacks::handleResize(LLWindow *window, const S32 width, const S32 height) +{ +} + +void LLWindowCallbacks::handleFocus(LLWindow *window) +{ +} + +void LLWindowCallbacks::handleFocusLost(LLWindow *window) +{ +} + +void LLWindowCallbacks::handleMenuSelect(LLWindow *window, const S32 menu_item) +{ +} + +BOOL LLWindowCallbacks::handlePaint(LLWindow *window, const S32 x, const S32 y, + const S32 width, const S32 height) +{ + return FALSE; +} + +BOOL LLWindowCallbacks::handleDoubleClick(LLWindow *window, const LLCoordGL pos, MASK mask) +{ + return FALSE; +} + +void LLWindowCallbacks::handleWindowBlock(LLWindow *window) +{ +} + +void LLWindowCallbacks::handleWindowUnblock(LLWindow *window) +{ +} + +void LLWindowCallbacks::handleDataCopy(LLWindow *window, S32 data_type, void *data) +{ +} + +BOOL LLWindowCallbacks::handleTimerEvent(LLWindow *window) +{ + return FALSE; +} + +BOOL LLWindowCallbacks::handleDeviceChange(LLWindow *window) +{ + return FALSE; +} + +void LLWindowCallbacks::handlePingWatchdog(LLWindow *window, const char * msg) +{ + +} + +void LLWindowCallbacks::handlePauseWatchdog(LLWindow *window) +{ + +} + +void LLWindowCallbacks::handleResumeWatchdog(LLWindow *window) +{ + +} + +std::string LLWindowCallbacks::translateString(const char* tag) +{ + return std::string(); +} + +//virtual +std::string LLWindowCallbacks::translateString(const char* tag, + const std::map<std::string, std::string>& args) +{ + return std::string(); +} diff --git a/indra/llwindow/llwindowcallbacks.h b/indra/llwindow/llwindowcallbacks.h new file mode 100644 index 0000000000000000000000000000000000000000..abc66c42a2882a1844173350fec37f2ba34f2471 --- /dev/null +++ b/indra/llwindow/llwindowcallbacks.h @@ -0,0 +1,85 @@ +/** + * @file llwindowcallbacks.h + * @brief OS event callback class + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLWINDOWCALLBACKS_H +#define LLWINDOWCALLBACKS_H + +class LLCoordGL; +class LLWindow; + +class LLWindowCallbacks +{ +public: + virtual ~LLWindowCallbacks() {} + virtual BOOL handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated); + virtual BOOL handleTranslatedKeyUp(KEY key, MASK mask); + virtual void handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level); + virtual BOOL handleUnicodeChar(llwchar uni_char, MASK mask); + + virtual BOOL handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); + virtual BOOL handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); + virtual void handleMouseLeave(LLWindow *window); + // return TRUE to allow window to close, which will then cause handleQuit to be called + virtual BOOL handleCloseRequest(LLWindow *window); + // window is about to be destroyed, clean up your business + virtual void handleQuit(LLWindow *window); + virtual BOOL handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); + virtual BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); + virtual BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); + virtual BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); + virtual BOOL handleActivate(LLWindow *window, BOOL activated); + virtual BOOL handleActivateApp(LLWindow *window, BOOL activating); + virtual void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); + virtual void handleScrollWheel(LLWindow *window, S32 clicks); + virtual void handleResize(LLWindow *window, S32 width, S32 height); + virtual void handleFocus(LLWindow *window); + virtual void handleFocusLost(LLWindow *window); + virtual void handleMenuSelect(LLWindow *window, S32 menu_item); + virtual BOOL handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S32 height); + virtual BOOL handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask); // double-click of left mouse button + virtual void handleWindowBlock(LLWindow *window); // window is taking over CPU for a while + virtual void handleWindowUnblock(LLWindow *window); // window coming back after taking over CPU for a while + virtual void handleDataCopy(LLWindow *window, S32 data_type, void *data); + virtual BOOL handleTimerEvent(LLWindow *window); + virtual BOOL handleDeviceChange(LLWindow *window); + + virtual void handlePingWatchdog(LLWindow *window, const char * msg); + virtual void handlePauseWatchdog(LLWindow *window); + virtual void handleResumeWatchdog(LLWindow *window); + + // Look up a localized string, usually for an error message + virtual std::string translateString(const char* tag); + virtual std::string translateString(const char* tag, + const std::map<std::string, std::string>& args); +}; + + +#endif diff --git a/indra/llwindow/llwindowheadless.cpp b/indra/llwindow/llwindowheadless.cpp index 37428464400726f1df0bdbf30cc3fc15c9947571..b4e9009321e3815c8010e185954580c1d041f53d 100644 --- a/indra/llwindow/llwindowheadless.cpp +++ b/indra/llwindow/llwindowheadless.cpp @@ -38,10 +38,10 @@ // // LLWindowHeadless // -LLWindowHeadless::LLWindowHeadless(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, - U32 flags, BOOL fullscreen, BOOL clearBg, +LLWindowHeadless::LLWindowHeadless(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, + U32 flags, BOOL fullscreen, BOOL clear_background, BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth) - : LLWindow(fullscreen, flags) + : LLWindow(callbacks, fullscreen, flags) { } diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index 4353d157b57b90fe9afc1f5523736689ed0e1ee2..3cffd2bbf6b1f4a74738f036ce38689402b4697c 100644 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -94,9 +94,12 @@ public: /*virtual*/ void *getPlatformWindow() { return 0; }; /*virtual*/ void bringToFront() {}; - LLWindowHeadless(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, - U32 flags, BOOL fullscreen, BOOL clearBg, - BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth); + LLWindowHeadless(LLWindowCallbacks* callbacks, + const std::string& title, const std::string& name, + S32 x, S32 y, + S32 width, S32 height, + U32 flags, BOOL fullscreen, BOOL clear_background, + BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth); virtual ~LLWindowHeadless(); private: diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 65a40dcef4bf5e72f38aa4fd973f3249c2358b68..82dc5e4a13c25d54189c70f8839110fc50317b34 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -32,19 +32,21 @@ #include "linden_common.h" -#include <Carbon/Carbon.h> -#include <OpenGL/OpenGL.h> - #include "llwindowmacosx.h" + #include "llkeyboardmacosx.h" +#include "llwindowcallbacks.h" +#include "llwindowmacosx-objc.h" +#include "llpreeditor.h" + #include "llerror.h" #include "llgl.h" #include "llstring.h" #include "lldir.h" #include "indra_constants.h" -#include "llwindowmacosx-objc.h" -#include "llpreeditor.h" +#include <Carbon/Carbon.h> +#include <OpenGL/OpenGL.h> extern BOOL gDebugWindowProc; @@ -214,19 +216,27 @@ static LLWindowMacOSX *gWindowImplementation = NULL; -LLWindowMacOSX::LLWindowMacOSX(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, +LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks, + const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth, U32 fsaa_samples) - : LLWindow(fullscreen, flags) + : LLWindow(NULL, fullscreen, flags) { + // *HACK: During window construction we get lots of OS events for window + // reshape, activate, etc. that the viewer isn't ready to handle. + // Route them to a dummy callback structure until the end of constructor. + LLWindowCallbacks null_callbacks; + mCallbacks = &null_callbacks; + // Voodoo for calling cocoa from carbon (see llwindowmacosx-objc.mm). setupCocoa(); // Initialize the keyboard gKeyboard = new LLKeyboardMacOSX(); + gKeyboard->setCallbacks(callbacks); // Ignore use_gl for now, only used for drones on PC mWindow = NULL; @@ -315,6 +325,7 @@ LLWindowMacOSX::LLWindowMacOSX(const std::string& title, const std::string& name setCursor( UI_CURSOR_ARROW ); } + mCallbacks = callbacks; stop_glerror(); } @@ -3202,7 +3213,7 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url) } -BOOL LLWindowMacOSX::dialog_color_picker ( F32 *r, F32 *g, F32 *b) +BOOL LLWindowMacOSX::dialogColorPicker( F32 *r, F32 *g, F32 *b) { BOOL retval = FALSE; OSErr error = noErr; diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 388678273269a29676fae95f262a98628ed6e81e..17074080eb070bd9da994d8d748779fe8c7c77dc 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -35,6 +35,8 @@ #include "llwindow.h" +#include "lltimer.h" + #include <Carbon/Carbon.h> #include <AGL/agl.h> @@ -103,7 +105,7 @@ public: /*virtual*/ void beforeDialog(); /*virtual*/ void afterDialog(); - /*virtual*/ BOOL dialog_color_picker(F32 *r, F32 *g, F32 *b); + /*virtual*/ BOOL dialogColorPicker(F32 *r, F32 *g, F32 *b); /*virtual*/ void *getPlatformWindow(); /*virtual*/ void *getMediaWindow(); @@ -116,7 +118,7 @@ public: static std::vector<std::string> getDynamicFallbackFontList(); protected: - LLWindowMacOSX( + LLWindowMacOSX(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags, BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth, diff --git a/indra/llwindow/llwindowmesaheadless.cpp b/indra/llwindow/llwindowmesaheadless.cpp index c1f9d2095e5e0e9a403ccc758cfb70b367f88b82..7ee09f4a24fcf37a9864bb43fe45bd2ac4b98d11 100644 --- a/indra/llwindow/llwindowmesaheadless.cpp +++ b/indra/llwindow/llwindowmesaheadless.cpp @@ -44,10 +44,11 @@ U16 *gMesaBuffer = NULL; // // LLWindowMesaHeadless // -LLWindowMesaHeadless::LLWindowMesaHeadless(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, +LLWindowMesaHeadless::LLWindowMesaHeadless(LLWindowCallbacks* callbacks, + const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth) - : LLWindow(fullscreen, flags) + : LLWindow(callbacks, fullscreen, flags) { if (use_gl) { diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h index ab562d9ffef7b044cb8e77b968b1598b492c6167..22e0ec126d507957b52dd863e047d4d3c16c0d82 100644 --- a/indra/llwindow/llwindowmesaheadless.h +++ b/indra/llwindow/llwindowmesaheadless.h @@ -98,7 +98,8 @@ public: /*virtual*/ void *getPlatformWindow() { return 0; }; /*virtual*/ void bringToFront() {}; - LLWindowMesaHeadless(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, + LLWindowMesaHeadless(LLWindowCallbacks* callbacks, + const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth); ~LLWindowMesaHeadless(); diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 24bd70d57f91f012351de892cd9f8febc19fd278..3c203d9f5ccef50bbca8e11b200934ad1ddba399 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -36,15 +36,16 @@ #include "linden_common.h" #include "llwindowsdl.h" + +#include "llwindowcallbacks.h" #include "llkeyboardsdl.h" + #include "llerror.h" #include "llgl.h" #include "llstring.h" #include "lldir.h" #include "llfindlocale.h" -#include "indra_constants.h" - #if LL_GTK extern "C" { # include "gtk/gtk.h" @@ -187,16 +188,19 @@ Display* LLWindowSDL::get_SDL_Display(void) #endif // LL_X11 -LLWindowSDL::LLWindowSDL(const std::string& title, S32 x, S32 y, S32 width, +LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, + const std::string& title, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth, U32 fsaa_samples) - : LLWindow(fullscreen, flags), Lock_Display(NULL), + : LLWindow(callbacks, fullscreen, flags), + Lock_Display(NULL), Unlock_Display(NULL), mGamma(1.0f) { // Initialize the keyboard gKeyboard = new LLKeyboardSDL(); + gKeyboard->setCallbacks(callbacks); // Note that we can't set up key-repeat until after SDL has init'd video // Ignore use_gl for now, only used for drones on PC @@ -2229,7 +2233,7 @@ static void color_changed_callback(GtkWidget *widget, gtk_color_selection_get_current_color(colorsel, colorp); } -BOOL LLWindowSDL::dialog_color_picker ( F32 *r, F32 *g, F32 *b) +BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) { BOOL rtn = FALSE; @@ -2306,7 +2310,7 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ return 0; } -BOOL LLWindowSDL::dialog_color_picker ( F32 *r, F32 *g, F32 *b) +BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) { return (FALSE); } diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 632d8fc1fad41adff91cd3eea860a6afe6b2251b..1e4dffd7a61d5462aca9480e03c2d38f724fdb00 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -36,6 +36,7 @@ // Simple Directmedia Layer (http://libsdl.org/) implementation of LLWindow class #include "llwindow.h" +#include "lltimer.h" #include "SDL/SDL.h" #include "SDL/SDL_endian.h" @@ -118,7 +119,7 @@ public: /*virtual*/ void beforeDialog(); /*virtual*/ void afterDialog(); - /*virtual*/ BOOL dialog_color_picker(F32 *r, F32 *g, F32 *b); + /*virtual*/ BOOL dialogColorPicker(F32 *r, F32 *g, F32 *b); /*virtual*/ void *getPlatformWindow(); /*virtual*/ void bringToFront(); @@ -147,7 +148,7 @@ public: #endif // LL_X11 protected: - LLWindowSDL( + LLWindowSDL(LLWindowCallbacks* callbacks, const std::string& title, int x, int y, int width, int height, U32 flags, BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth, U32 fsaa_samples); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 6280868dfb4316be6ba8b6e1e4b3269995c69efa..ce1bc821685fc63a36722adf161d67bfbbab1bc3 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -36,6 +36,17 @@ #include "llwindowwin32.h" +// LLWindow library includes +#include "llkeyboardwin32.h" +#include "llpreeditor.h" +#include "llwindowcallbacks.h" + +// Linden library includes +#include "llerror.h" +#include "llgl.h" +#include "llstring.h" + +// System includes #include <commdlg.h> #include <WinUser.h> #include <mapi.h> @@ -49,16 +60,7 @@ #include <dinput.h> #include <Dbt.h.> -#include "llkeyboardwin32.h" -#include "llerror.h" -#include "llgl.h" -#include "llstring.h" -#include "lldir.h" - -#include "indra_constants.h" - -#include "llpreeditor.h" - +#include "llmemtype.h" // culled from winuser.h #ifndef WM_MOUSEWHEEL /* Added to be compatible with later SDK's */ const S32 WM_MOUSEWHEEL = 0x020A; @@ -358,13 +360,14 @@ LLWinImm::~LLWinImm() } -LLWindowWin32::LLWindowWin32(const std::string& title, const std::string& name, S32 x, S32 y, S32 width, +LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, + const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth, U32 fsaa_samples) - : LLWindow(fullscreen, flags) + : LLWindow(callbacks, fullscreen, flags) { mFSAASamples = fsaa_samples; mIconResource = gIconResource; @@ -378,6 +381,7 @@ LLWindowWin32::LLWindowWin32(const std::string& title, const std::string& name, // Initialize the keyboard gKeyboard = new LLKeyboardWin32(); + gKeyboard->setCallbacks(callbacks); // Initialize (boot strap) the Language text input management, // based on the system's (user's) default settings. @@ -481,7 +485,8 @@ LLWindowWin32::LLWindowWin32(const std::string& title, const std::string& name, if (!RegisterClass(&wc)) { - OSMessageBox("RegisterClass failed", "Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBRegClassFailed"), + mCallbacks->translateString("MBError"), OSMB_OK); return; } sIsClassRegistered = TRUE; @@ -572,8 +577,11 @@ LLWindowWin32::LLWindowWin32(const std::string& title, const std::string& name, mFullscreenBits = -1; mFullscreenRefresh = -1; - std::string error = llformat("Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); - OSMessageBox(error, "Error", OSMB_OK); + std::map<std::string,std::string> args; + args["[WIDTH]"] = llformat("%d", width); + args["[HEIGHT]"] = llformat ("%d", height); + OSMessageBox(mCallbacks->translateString("MBFullScreenErr", args), + mCallbacks->translateString("MBError"), OSMB_OK); } } @@ -712,7 +720,9 @@ void LLWindowWin32::close() // This causes WM_DESTROY to be sent *immediately* if (!DestroyWindow(mWindowHandle)) { - OSMessageBox("DestroyWindow(mWindowHandle) failed", "Shutdown Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBDestroyWinFailed"), + mCallbacks->translateString("MBShutdownErr"), + OSMB_OK); } mWindowHandle = NULL; @@ -1015,14 +1025,16 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO if (!(mhDC = GetDC(mWindowHandle))) { close(); - OSMessageBox("Can't make GL device context", "Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBDevContextErr"), + mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } if (!(pixel_format = ChoosePixelFormat(mhDC, &pfd))) { close(); - OSMessageBox("Can't find suitable pixel format", "Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBPixelFmtErr"), + mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } @@ -1031,57 +1043,48 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO &pfd)) { close(); - OSMessageBox("Can't get pixel format description", "Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBPixelFmtDescErr"), + mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } if (pfd.cColorBits < 32) { close(); - OSMessageBox( - "Second Life requires True Color (32-bit) to run in a window.\n" - "Please go to Control Panels -> Display -> Settings and\n" - "set the screen to 32-bit color.\n" - "Alternately, if you choose to run fullscreen, Second Life\n" - "will automatically adjust the screen each time it runs.", - "Error", - OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBTrueColorWindow"), + mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } if (pfd.cAlphaBits < 8) { close(); - OSMessageBox( - "Second Life is unable to run because it can't get an 8 bit alpha\n" - "channel. Usually this is due to video card driver issues.\n" - "Please make sure you have the latest video card drivers installed.\n" - "Also be sure your monitor is set to True Color (32-bit) in\n" - "Control Panels -> Display -> Settings.\n" - "If you continue to receive this message, contact customer service.", - "Error", - OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBAlpha"), + mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } if (!SetPixelFormat(mhDC, pixel_format, &pfd)) { close(); - OSMessageBox("Can't set pixel format", "Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBPixelFmtSetErr"), + mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } if (!(mhRC = wglCreateContext(mhDC))) { close(); - OSMessageBox("Can't create GL rendering context", "Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBGLContextErr"), + mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } if (!wglMakeCurrent(mhDC, mhRC)) { close(); - OSMessageBox("Can't activate GL rendering context", "Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBGLContextActErr"), + mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } @@ -1243,14 +1246,15 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO if (!(mhDC = GetDC(mWindowHandle))) { close(); - OSMessageBox("Can't make GL device context", "Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBDevContextErr"), mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } if (!SetPixelFormat(mhDC, pixel_format, &pfd)) { close(); - OSMessageBox("Can't set pixel format", "Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBPixelFmtSetErr"), + mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } @@ -1287,7 +1291,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO &pfd)) { close(); - OSMessageBox("Can't get pixel format description", "Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBPixelFmtDescErr"), mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } @@ -1300,57 +1304,35 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO if (pfd.cColorBits < 32 || GetDeviceCaps(mhDC, BITSPIXEL) < 32) { close(); - OSMessageBox( - "Second Life requires True Color (32-bit) to run in a window.\n" - "Please go to Control Panels -> Display -> Settings and\n" - "set the screen to 32-bit color.\n" - "Alternately, if you choose to run fullscreen, Second Life\n" - "will automatically adjust the screen each time it runs.", - "Error", - OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBTrueColorWindow"), mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } if (pfd.cAlphaBits < 8) { close(); - OSMessageBox( - "Second Life is unable to run because it can't get an 8 bit alpha\n" - "channel. Usually this is due to video card driver issues.\n" - "Please make sure you have the latest video card drivers installed.\n" - "Also be sure your monitor is set to True Color (32-bit) in\n" - "Control Panels -> Display -> Settings.\n" - "If you continue to receive this message, contact customer service.", - "Error", - OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBAlpha"), mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } if (!(mhRC = wglCreateContext(mhDC))) { close(); - OSMessageBox("Can't create GL rendering context", "Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBGLContextErr"), mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } if (!wglMakeCurrent(mhDC, mhRC)) { close(); - OSMessageBox("Can't activate GL rendering context", "Error", OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBGLContextActErr"), mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } if (!gGLManager.initGL()) { close(); - OSMessageBox( - "Second Life is unable to run because your video card drivers\n" - "did not install properly, are out of date, or are for unsupported\n" - "hardware. Please make sure you have the latest video card drivers\n" - "and even if you do have the latest, try reinstalling them.\n\n" - "If you continue to receive this message, contact customer service.", - "Error", - OSMB_OK); + OSMessageBox(mCallbacks->translateString("MBVideoDrvErr"), mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } @@ -1612,6 +1594,8 @@ void LLWindowWin32::gatherInput() MSG msg; int msg_count = 0; + LLMemType m1(LLMemType::MTYPE_GATHER_INPUT); + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) && msg_count < MAX_MESSAGE_PER_UPDATE) { mCallbacks->handlePingWatchdog(this, "Main:TranslateGatherInput"); @@ -3030,7 +3014,7 @@ void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url ) } -BOOL LLWindowWin32::dialog_color_picker ( F32 *r, F32 *g, F32 *b ) +BOOL LLWindowWin32::dialogColorPicker( F32 *r, F32 *g, F32 *b ) { BOOL retval = FALSE; diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 237f834318ade1dba72ebf56e407932ee8662557..e14324c9f170309213cf85ff1b341378c2ee6abc 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -100,7 +100,7 @@ public: /*virtual*/ F32 getPixelAspectRatio(); /*virtual*/ void setNativeAspectRatio(F32 ratio) { mOverrideAspectRatio = ratio; } - /*virtual*/ BOOL dialog_color_picker (F32 *r, F32 *g, F32 *b ); + /*virtual*/ BOOL dialogColorPicker(F32 *r, F32 *g, F32 *b ); /*virtual*/ void *getPlatformWindow(); /*virtual*/ void bringToFront(); @@ -115,7 +115,7 @@ public: static std::vector<std::string> getDynamicFallbackFontList(); protected: - LLWindowWin32( + LLWindowWin32(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags, BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth, U32 fsaa_samples); diff --git a/indra/llxml/CMakeLists.txt b/indra/llxml/CMakeLists.txt index c5fb44e7215b68625982ec8b859ab5aa4be69ea7..3f7714f5058e35f3453853584fc663fd3ea2eabb 100644 --- a/indra/llxml/CMakeLists.txt +++ b/indra/llxml/CMakeLists.txt @@ -5,11 +5,13 @@ project(llxml) include(00-Common) include(LLCommon) include(LLMath) +include(LLVFS) include(LLXML) include_directories( ${LLCOMMON_INCLUDE_DIRS} ${LLMATH_INCLUDE_DIRS} + ${LLVFS_INCLUDE_DIRS} ) set(llxml_SOURCE_FILES @@ -38,6 +40,7 @@ add_library (llxml ${llxml_SOURCE_FILES}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level target_link_libraries( llxml + llvfs llmath ${EXPAT_LIBRARIES} ) diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 8bd04d727cf5ded9193ba03be44120065bd3fba6..2271c02cd040e6b2405832ff3d27ec15fb47dafc 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -56,6 +56,45 @@ #define CONTROL_ERRS LL_WARNS("ControlErrors") #endif + +template <> eControlType get_control_type<U32>(); +template <> eControlType get_control_type<S32>(); +template <> eControlType get_control_type<F32>(); +template <> eControlType get_control_type<bool>(); +// Yay BOOL, its really an S32. +//template <> eControlType get_control_type<BOOL> () ; +template <> eControlType get_control_type<std::string>(); + +template <> eControlType get_control_type<LLVector3>(); +template <> eControlType get_control_type<LLVector3d>(); +template <> eControlType get_control_type<LLRect>(); +template <> eControlType get_control_type<LLColor4>(); +template <> eControlType get_control_type<LLColor3>(); +template <> eControlType get_control_type<LLColor4U>(); +template <> eControlType get_control_type<LLSD>(); + +template <> LLSD convert_to_llsd<U32>(const U32& in); +template <> LLSD convert_to_llsd<LLVector3>(const LLVector3& in); +template <> LLSD convert_to_llsd<LLVector3d>(const LLVector3d& in); +template <> LLSD convert_to_llsd<LLRect>(const LLRect& in); +template <> LLSD convert_to_llsd<LLColor4>(const LLColor4& in); +template <> LLSD convert_to_llsd<LLColor3>(const LLColor3& in); +template <> LLSD convert_to_llsd<LLColor4U>(const LLColor4U& in); + +template <> bool convert_from_llsd<bool>(const LLSD& sd, eControlType type, const std::string& control_name); +template <> S32 convert_from_llsd<S32>(const LLSD& sd, eControlType type, const std::string& control_name); +template <> U32 convert_from_llsd<U32>(const LLSD& sd, eControlType type, const std::string& control_name); +template <> F32 convert_from_llsd<F32>(const LLSD& sd, eControlType type, const std::string& control_name); +template <> std::string convert_from_llsd<std::string>(const LLSD& sd, eControlType type, const std::string& control_name); +template <> LLWString convert_from_llsd<LLWString>(const LLSD& sd, eControlType type, const std::string& control_name); +template <> LLVector3 convert_from_llsd<LLVector3>(const LLSD& sd, eControlType type, const std::string& control_name); +template <> LLVector3d convert_from_llsd<LLVector3d>(const LLSD& sd, eControlType type, const std::string& control_name); +template <> LLRect convert_from_llsd<LLRect>(const LLSD& sd, eControlType type, const std::string& control_name); +template <> LLColor4 convert_from_llsd<LLColor4>(const LLSD& sd, eControlType type, const std::string& control_name); +template <> LLColor4U convert_from_llsd<LLColor4U>(const LLSD& sd, eControlType type, const std::string& control_name); +template <> LLColor3 convert_from_llsd<LLColor3>(const LLSD& sd, eControlType type, const std::string& control_name); +template <> LLSD convert_from_llsd<LLSD>(const LLSD& sd, eControlType type, const std::string& control_name); + //this defines the current version of the settings file const S32 CURRENT_VERSION = 101; @@ -87,9 +126,6 @@ bool LLControlVariable::llsd_compare(const LLSD& a, const LLSD & b) case TYPE_COL3: result = LLColor3(a) == LLColor3(b); break; - case TYPE_COL4U: - result = LLColor4U(a) == LLColor4U(b); - break; case TYPE_STRING: result = a.asString() == b.asString(); break; @@ -148,9 +184,15 @@ LLSD LLControlVariable::getComparableValue(const LLSD& value) return storable_value; } -void LLControlVariable::setValue(const LLSD& value, bool saved_value) +void LLControlVariable::setValue(const LLSD& new_value, bool saved_value) { - LLSD storable_value = getComparableValue(value); + if (mValidateSignal(this, new_value) == false) + { + // can not set new value, exit + return; + } + + LLSD storable_value = getComparableValue(new_value); bool value_changed = llsd_compare(getValue(), storable_value) == FALSE; if(saved_value) { @@ -163,7 +205,7 @@ void LLControlVariable::setValue(const LLSD& value, bool saved_value) } else { - // This is a unsaved value. Its needs to reside at + // This is an unsaved value. Its needs to reside at // mValues[2] (or greater). It must not affect // the result of getSaveValue() if (llsd_compare(mValues.back(), storable_value) == FALSE) @@ -185,10 +227,9 @@ void LLControlVariable::setValue(const LLSD& value, bool saved_value) } } - if(value_changed) { - mSignal(storable_value); + mCommitSignal(this, storable_value); } } @@ -262,7 +303,8 @@ LLPointer<LLControlVariable> LLControlGroup::getControl(const std::string& name) //////////////////////////////////////////////////////////////////////////// -LLControlGroup::LLControlGroup() +LLControlGroup::LLControlGroup(const std::string& name) +: LLInstanceTracker<LLControlGroup, std::string>(name) { mTypeString[TYPE_U32] = "U32"; mTypeString[TYPE_S32] = "S32"; @@ -274,7 +316,6 @@ LLControlGroup::LLControlGroup() mTypeString[TYPE_RECT] = "Rect"; mTypeString[TYPE_COL4] = "Color4"; mTypeString[TYPE_COL3] = "Color3"; - mTypeString[TYPE_COL4U] = "Color4u"; mTypeString[TYPE_LLSD] = "LLSD"; } @@ -370,11 +411,6 @@ BOOL LLControlGroup::declareRect(const std::string& name, const LLRect &initial_ return declareControl(name, TYPE_RECT, initial_val.getValue(), comment, persist); } -BOOL LLControlGroup::declareColor4U(const std::string& name, const LLColor4U &initial_val, const std::string& comment, BOOL persist ) -{ - return declareControl(name, TYPE_COL4U, initial_val.getValue(), comment, persist); -} - BOOL LLControlGroup::declareColor4(const std::string& name, const LLColor4 &initial_val, const std::string& comment, BOOL persist ) { return declareControl(name, TYPE_COL4, initial_val.getValue(), comment, persist); @@ -392,81 +428,32 @@ BOOL LLControlGroup::declareLLSD(const std::string& name, const LLSD &initial_va BOOL LLControlGroup::getBOOL(const std::string& name) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_BOOLEAN)) - return control->get().asBoolean(); - else - { - CONTROL_ERRS << "Invalid BOOL control " << name << llendl; - return FALSE; - } + return (BOOL)get<bool>(name); } S32 LLControlGroup::getS32(const std::string& name) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_S32)) - return control->get().asInteger(); - else - { - CONTROL_ERRS << "Invalid S32 control " << name << llendl; - return 0; - } + return get<S32>(name); } U32 LLControlGroup::getU32(const std::string& name) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_U32)) - return control->get().asInteger(); - else - { - CONTROL_ERRS << "Invalid U32 control " << name << llendl; - return 0; - } + return get<U32>(name); } F32 LLControlGroup::getF32(const std::string& name) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_F32)) - return (F32) control->get().asReal(); - else - { - CONTROL_ERRS << "Invalid F32 control " << name << llendl; - return 0.0f; - } -} - -std::string LLControlGroup::findString(const std::string& name) -{ - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_STRING)) - return control->get().asString(); - return LLStringUtil::null; + return get<F32>(name); } std::string LLControlGroup::getString(const std::string& name) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_STRING)) - return control->get().asString(); - else - { - CONTROL_ERRS << "Invalid string control " << name << llendl; - return LLStringUtil::null; - } + return get<std::string>(name); } LLWString LLControlGroup::getWString(const std::string& name) { - return utf8str_to_wstring(getString(name)); + return get<LLWString>(name); } std::string LLControlGroup::getText(const std::string& name) @@ -479,123 +466,38 @@ std::string LLControlGroup::getText(const std::string& name) LLVector3 LLControlGroup::getVector3(const std::string& name) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_VEC3)) - return control->get(); - else - { - CONTROL_ERRS << "Invalid LLVector3 control " << name << llendl; - return LLVector3::zero; - } + return get<LLVector3>(name); } LLVector3d LLControlGroup::getVector3d(const std::string& name) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_VEC3D)) - return control->get(); - else - { - CONTROL_ERRS << "Invalid LLVector3d control " << name << llendl; - return LLVector3d::zero; - } + return get<LLVector3d>(name); } LLRect LLControlGroup::getRect(const std::string& name) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_RECT)) - return control->get(); - else - { - CONTROL_ERRS << "Invalid rect control " << name << llendl; - return LLRect::null; - } + return get<LLRect>(name); } LLColor4 LLControlGroup::getColor(const std::string& name) { - ctrl_name_table_t::const_iterator i = mNameTable.find(name); - - if (i != mNameTable.end()) - { - LLControlVariable* control = i->second; - - switch(control->mType) - { - case TYPE_COL4: - { - return LLColor4(control->get()); - } - case TYPE_COL4U: - { - return LLColor4(LLColor4U(control->get())); - } - default: - { - CONTROL_ERRS << "Control " << name << " not a color" << llendl; - return LLColor4::white; - } - } - } - else - { - CONTROL_ERRS << "Invalid getColor control " << name << llendl; - return LLColor4::white; - } -} - -LLColor4U LLControlGroup::getColor4U(const std::string& name) -{ - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_COL4U)) - return control->get(); - else - { - CONTROL_ERRS << "Invalid LLColor4 control " << name << llendl; - return LLColor4U::white; - } + return get<LLColor4>(name); } LLColor4 LLControlGroup::getColor4(const std::string& name) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_COL4)) - return control->get(); - else - { - CONTROL_ERRS << "Invalid LLColor4 control " << name << llendl; - return LLColor4::white; - } + return get<LLColor4>(name); } LLColor3 LLControlGroup::getColor3(const std::string& name) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_COL3)) - return control->get(); - else - { - CONTROL_ERRS << "Invalid LLColor3 control " << name << llendl; - return LLColor3::white; - } + return get<LLColor3>(name); } LLSD LLControlGroup::getLLSD(const std::string& name) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_LLSD)) - return control->getValue(); - CONTROL_ERRS << "Invalid LLSD control " << name << llendl; - return LLSD(); + return get<LLSD>(name); } BOOL LLControlGroup::controlExists(const std::string& name) @@ -604,170 +506,67 @@ BOOL LLControlGroup::controlExists(const std::string& name) return iter != mNameTable.end(); } + //------------------------------------------------------------------- // Set functions //------------------------------------------------------------------- void LLControlGroup::setBOOL(const std::string& name, BOOL val) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_BOOLEAN)) - { - control->set(val); - } - else - { - CONTROL_ERRS << "Invalid control " << name << llendl; - } + set<bool>(name, val); } void LLControlGroup::setS32(const std::string& name, S32 val) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_S32)) - { - control->set(val); - } - else - { - CONTROL_ERRS << "Invalid control " << name << llendl; - } + set(name, val); } void LLControlGroup::setF32(const std::string& name, F32 val) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_F32)) - { - control->set(val); - } - else - { - CONTROL_ERRS << "Invalid control " << name << llendl; - } + set(name, val); } void LLControlGroup::setU32(const std::string& name, U32 val) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_U32)) - { - control->set((LLSD::Integer) val); - } - else - { - CONTROL_ERRS << "Invalid control " << name << llendl; - } + set(name, val); } void LLControlGroup::setString(const std::string& name, const std::string &val) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_STRING)) - { - control->set(val); - } - else - { - CONTROL_ERRS << "Invalid control " << name << llendl; - } + set(name, val); } void LLControlGroup::setVector3(const std::string& name, const LLVector3 &val) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_VEC3)) - { - control->set(val.getValue()); - } - else - { - CONTROL_ERRS << "Invalid control " << name << llendl; - } + set(name, val); } void LLControlGroup::setVector3d(const std::string& name, const LLVector3d &val) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_VEC3D)) - { - control->set(val.getValue()); - } - else - { - CONTROL_ERRS << "Invalid control " << name << llendl; - } + set(name, val); } void LLControlGroup::setRect(const std::string& name, const LLRect &val) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_RECT)) - { - control->set(val.getValue()); - } - else - { - CONTROL_ERRS << "Invalid rect control " << name << llendl; - } -} - -void LLControlGroup::setColor4U(const std::string& name, const LLColor4U &val) -{ - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_COL4U)) - { - control->set(val.getValue()); - } - else - { - CONTROL_ERRS << "Invalid LLColor4 control " << name << llendl; - } + set(name, val); } void LLControlGroup::setColor4(const std::string& name, const LLColor4 &val) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_COL4)) - { - control->set(val.getValue()); - } - else - { - CONTROL_ERRS << "Invalid LLColor4 control " << name << llendl; - } + set(name, val); } void LLControlGroup::setLLSD(const std::string& name, const LLSD& val) { - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_LLSD)) - { - setValue(name, val); - } - else - { - CONTROL_ERRS << "Invalid LLSD control " << name << llendl; - } + set(name, val); } -void LLControlGroup::setValue(const std::string& name, const LLSD& val) +void LLControlGroup::setUntypedValue(const std::string& name, const LLSD& val) { if (name.empty()) { @@ -778,7 +577,7 @@ void LLControlGroup::setValue(const std::string& name, const LLSD& val) if (control) { - control->set(val); + control->setValue(val); } else { @@ -786,6 +585,7 @@ void LLControlGroup::setValue(const std::string& name, const LLSD& val) } } + //--------------------------------------------------------------- // Load and save //--------------------------------------------------------------- @@ -854,9 +654,6 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require case TYPE_COL4: declareColor4(name, LLColor4::white, LLStringUtil::null, NO_PERSIST); break; - case TYPE_COL4U: - declareColor4U(name, LLColor4U::white, LLStringUtil::null, NO_PERSIST); - break; case TYPE_STRING: default: declareString(name, LLStringUtil::null, LLStringUtil::null, NO_PERSIST); @@ -954,15 +751,6 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require validitems++; } break; - case TYPE_COL4U: - { - LLColor4U color; - - child_nodep->getAttributeColor4U("value", color); - control->set(color.getValue()); - validitems++; - } - break; case TYPE_COL4: { LLColor4 color; @@ -1063,6 +851,7 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v U32 validitems = 0; bool hidefromsettingseditor = false; + for(LLSD::map_const_iterator itr = settings.beginMap(); itr != settings.endMap(); ++itr) { bool persist = true; @@ -1155,55 +944,6 @@ void LLControlGroup::applyToAll(ApplyFunctor* func) } } -//============================================================================ -// First-use - -static std::string get_warn_name(const std::string& name) -{ - std::string warnname = "Warn" + name; - for (std::string::iterator iter = warnname.begin(); iter != warnname.end(); ++iter) - { - char c = *iter; - if (!isalnum(c)) - { - *iter = '_'; - } - } - return warnname; -} - -void LLControlGroup::addWarning(const std::string& name) -{ - // Note: may get called more than once per warning - // (e.g. if allready loaded from a settings file), - // but that is OK, declareBOOL will handle it - std::string warnname = get_warn_name(name); - std::string comment = std::string("Enables ") + name + std::string(" warning dialog"); - declareBOOL(warnname, TRUE, comment); - mWarnings.insert(warnname); -} - -BOOL LLControlGroup::getWarning(const std::string& name) -{ - std::string warnname = get_warn_name(name); - return getBOOL(warnname); -} - -void LLControlGroup::setWarning(const std::string& name, BOOL val) -{ - std::string warnname = get_warn_name(name); - setBOOL(warnname, val); -} - -void LLControlGroup::resetWarnings() -{ - for (std::set<std::string>::iterator iter = mWarnings.begin(); - iter != mWarnings.end(); ++iter) - { - setBOOL(*iter, TRUE); - } -} - //============================================================================ #ifdef TEST_HARNESS @@ -1268,4 +1008,297 @@ void main() #endif +template <> eControlType get_control_type<U32>() +{ + return TYPE_U32; +} + +template <> eControlType get_control_type<S32>() +{ + return TYPE_S32; +} + +template <> eControlType get_control_type<F32>() +{ + return TYPE_F32; +} + +template <> eControlType get_control_type<bool> () +{ + return TYPE_BOOLEAN; +} +/* +// Yay BOOL, its really an S32. +template <> eControlType get_control_type<BOOL> () +{ + return TYPE_BOOLEAN; +} +*/ +template <> eControlType get_control_type<std::string>() +{ + return TYPE_STRING; +} + +template <> eControlType get_control_type<LLVector3>() +{ + return TYPE_VEC3; +} + +template <> eControlType get_control_type<LLVector3d>() +{ + return TYPE_VEC3D; +} + +template <> eControlType get_control_type<LLRect>() +{ + return TYPE_RECT; +} + +template <> eControlType get_control_type<LLColor4>() +{ + return TYPE_COL4; +} + +template <> eControlType get_control_type<LLColor3>() +{ + return TYPE_COL3; +} + +template <> eControlType get_control_type<LLSD>() +{ + return TYPE_LLSD; +} + + +template <> LLSD convert_to_llsd<U32>(const U32& in) +{ + return (LLSD::Integer)in; +} + +template <> LLSD convert_to_llsd<LLVector3>(const LLVector3& in) +{ + return in.getValue(); +} + +template <> LLSD convert_to_llsd<LLVector3d>(const LLVector3d& in) +{ + return in.getValue(); +} + +template <> LLSD convert_to_llsd<LLRect>(const LLRect& in) +{ + return in.getValue(); +} + +template <> LLSD convert_to_llsd<LLColor4>(const LLColor4& in) +{ + return in.getValue(); +} + +template <> LLSD convert_to_llsd<LLColor3>(const LLColor3& in) +{ + return in.getValue(); +} + +template <> LLSD convert_to_llsd<LLColor4U>(const LLColor4U& in) +{ + return in.getValue(); +} + + +template<> +bool convert_from_llsd<bool>(const LLSD& sd, eControlType type, const std::string& control_name) +{ + if (type == TYPE_BOOLEAN) + return sd.asBoolean(); + else + { + CONTROL_ERRS << "Invalid BOOL value" << llendl; + return FALSE; + } +} + +template<> +S32 convert_from_llsd<S32>(const LLSD& sd, eControlType type, const std::string& control_name) +{ + if (type == TYPE_S32) + return sd.asInteger(); + else + { + CONTROL_ERRS << "Invalid S32 value" << llendl; + return 0; + } +} + +template<> +U32 convert_from_llsd<U32>(const LLSD& sd, eControlType type, const std::string& control_name) +{ + if (type == TYPE_U32) + return sd.asInteger(); + else + { + CONTROL_ERRS << "Invalid U32 value" << llendl; + return 0; + } +} + +template<> +F32 convert_from_llsd<F32>(const LLSD& sd, eControlType type, const std::string& control_name) +{ + if (type == TYPE_F32) + return (F32) sd.asReal(); + else + { + CONTROL_ERRS << "Invalid F32 value" << llendl; + return 0.0f; + } +} + +template<> +std::string convert_from_llsd<std::string>(const LLSD& sd, eControlType type, const std::string& control_name) +{ + if (type == TYPE_STRING) + return sd.asString(); + else + { + CONTROL_ERRS << "Invalid string value" << llendl; + return LLStringUtil::null; + } +} + +template<> +LLWString convert_from_llsd<LLWString>(const LLSD& sd, eControlType type, const std::string& control_name) +{ + return utf8str_to_wstring(convert_from_llsd<std::string>(sd, type, control_name)); +} + +template<> +LLVector3 convert_from_llsd<LLVector3>(const LLSD& sd, eControlType type, const std::string& control_name) +{ + if (type == TYPE_VEC3) + return sd; + else + { + CONTROL_ERRS << "Invalid LLVector3 value" << llendl; + return LLVector3::zero; + } +} + +template<> +LLVector3d convert_from_llsd<LLVector3d>(const LLSD& sd, eControlType type, const std::string& control_name) +{ + if (type == TYPE_VEC3D) + return sd; + else + { + CONTROL_ERRS << "Invalid LLVector3d value" << llendl; + return LLVector3d::zero; + } +} + +template<> +LLRect convert_from_llsd<LLRect>(const LLSD& sd, eControlType type, const std::string& control_name) +{ + if (type == TYPE_RECT) + return sd; + else + { + CONTROL_ERRS << "Invalid rect value" << llendl; + return LLRect::null; + } +} + + +template<> +LLColor4 convert_from_llsd<LLColor4>(const LLSD& sd, eControlType type, const std::string& control_name) +{ + if (type == TYPE_COL4) + { + LLColor4 color(sd); + if (color.mV[VRED] < 0.f || color.mV[VRED] > 1.f) + { + llwarns << "Color " << control_name << " value out of range " << llendl; + } + else if (color.mV[VGREEN] < 0.f || color.mV[VGREEN] > 1.f) + { + llwarns << "Color " << control_name << " value out of range " << llendl; + } + else if (color.mV[VBLUE] < 0.f || color.mV[VBLUE] > 1.f) + { + llwarns << "Color " << control_name << " value out of range " << llendl; + } + else if (color.mV[VALPHA] < 0.f || color.mV[VALPHA] > 1.f) + { + llwarns << "Color " << control_name << " value out of range " << llendl; + } + + return LLColor4(sd); + } + else + { + CONTROL_ERRS << "Control " << control_name << " not a color" << llendl; + return LLColor4::white; + } +} + +template<> +LLColor3 convert_from_llsd<LLColor3>(const LLSD& sd, eControlType type, const std::string& control_name) +{ + if (type == TYPE_COL3) + return sd; + else + { + CONTROL_ERRS << "Invalid LLColor3 value" << llendl; + return LLColor3::white; + } +} + +template<> +LLSD convert_from_llsd<LLSD>(const LLSD& sd, eControlType type, const std::string& control_name) +{ + return sd; +} + + +#if TEST_CACHED_CONTROL + +#define DECL_LLCC(T, V) static LLCachedControl<T> mySetting_##T("TestCachedControl"#T, V) +DECL_LLCC(U32, (U32)666); +DECL_LLCC(S32, (S32)-666); +DECL_LLCC(F32, (F32)-666.666); +DECL_LLCC(bool, true); +DECL_LLCC(BOOL, FALSE); +static LLCachedControl<std::string> mySetting_string("TestCachedControlstring", "Default String Value"); +DECL_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f)); +DECL_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f)); +DECL_LLCC(LLRect, LLRect(0, 0, 100, 500)); +DECL_LLCC(LLColor4, LLColor4(0.0f, 0.5f, 1.0f)); +DECL_LLCC(LLColor3, LLColor3(1.0f, 0.f, 0.5f)); +DECL_LLCC(LLColor4U, LLColor4U(255, 200, 100, 255)); + +LLSD test_llsd = LLSD()["testing1"] = LLSD()["testing2"]; +DECL_LLCC(LLSD, test_llsd); + +static LLCachedControl<std::string> test_BrowserHomePage("BrowserHomePage", "hahahahahha", "Not the real comment"); + +void test_cached_control() +{ +#define TEST_LLCC(T, V) if((T)mySetting_##T != V) llerrs << "Fail "#T << llendl + TEST_LLCC(U32, 666); + TEST_LLCC(S32, (S32)-666); + TEST_LLCC(F32, (F32)-666.666); + TEST_LLCC(bool, true); + TEST_LLCC(BOOL, FALSE); + if((std::string)mySetting_string != "Default String Value") llerrs << "Fail string" << llendl; + TEST_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f)); + TEST_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f)); + TEST_LLCC(LLRect, LLRect(0, 0, 100, 500)); + TEST_LLCC(LLColor4, LLColor4(0.0f, 0.5f, 1.0f)); + TEST_LLCC(LLColor3, LLColor3(1.0f, 0.f, 0.5f)); + TEST_LLCC(LLColor4U, LLColor4U(255, 200, 100, 255)); +//There's no LLSD comparsion for LLCC yet. TEST_LLCC(LLSD, test_llsd); + + if((std::string)test_BrowserHomePage != "http://www.secondlife.com") llerrs << "Fail BrowserHomePage" << llendl; +} +#endif // TEST_CACHED_CONTROL diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index a39a56aacd786fa5a8c4f1568eb156b65a76acbc..1782c20a7e3b0955dd7b162285f7247f8683cc30 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -33,11 +33,14 @@ #ifndef LL_LLCONTROL_H #define LL_LLCONTROL_H +#include "llboost.h" #include "llevent.h" #include "llnametable.h" #include "llmap.h" #include "llstring.h" #include "llrect.h" +#include "llrefcount.h" +#include "llinstancetracker.h" #include "llcontrolgroupreader.h" @@ -53,7 +56,7 @@ #endif #include <boost/bind.hpp> -#include <boost/signals2.hpp> +#include <boost/signal.hpp> #if LL_WINDOWS # if (_MSC_VER >= 1300 && _MSC_VER < 1400) @@ -65,7 +68,6 @@ class LLVector3; class LLVector3d; class LLColor4; class LLColor3; -class LLColor4U; const BOOL NO_PERSIST = FALSE; @@ -81,15 +83,17 @@ typedef enum e_control_type TYPE_RECT, TYPE_COL4, TYPE_COL3, - TYPE_COL4U, TYPE_LLSD, TYPE_COUNT } eControlType; -class LLControlVariable : public LLRefCount +class LLControlVariable : public LLRefCount, boost::noncopyable { friend class LLControlGroup; - typedef boost::signals2::signal<void(const LLSD&)> signal_t; + +public: + typedef boost::signal<bool(LLControlVariable* control, const LLSD&), boost_boolean_combiner> validate_signal_t; + typedef boost::signal<void(LLControlVariable* control, const LLSD&)> commit_signal_t; private: std::string mName; @@ -99,7 +103,8 @@ private: bool mHideFromSettingsEditor; std::vector<LLSD> mValues; - signal_t mSignal; + commit_signal_t mCommitSignal; + validate_signal_t mValidateSignal; public: LLControlVariable(const std::string& name, eControlType type, @@ -116,7 +121,9 @@ public: void resetToDefault(bool fire_signal = false); - signal_t* getSignal() { return &mSignal; } + commit_signal_t* getSignal() { return &mCommitSignal; } // shorthand for commit signal + commit_signal_t* getCommitSignal() { return &mCommitSignal; } + validate_signal_t* getValidateSignal() { return &mValidateSignal; } bool isDefault() { return (mValues.size() == 1); } bool isSaveValueDefault(); @@ -136,31 +143,55 @@ public: void firePropertyChanged() { - mSignal(mValues.back()); + mCommitSignal(this, mValues.back()); } private: LLSD getComparableValue(const LLSD& value); bool llsd_compare(const LLSD& a, const LLSD & b); - }; +typedef LLPointer<LLControlVariable> LLControlVariablePtr; + +//! Helper functions for converting between static types and LLControl values +template <class T> +eControlType get_control_type() +{ + llwarns << "Usupported control type: " << typeid(T).name() << "." << llendl; + return TYPE_COUNT; +} + +template <class T> +LLSD convert_to_llsd(const T& in) +{ + // default implementation + return LLSD(in); +} + +template <class T> +T convert_from_llsd(const LLSD& sd, eControlType type, const std::string& control_name) +{ + // needs specialization + return T(sd); +} + //const U32 STRING_CACHE_SIZE = 10000; -class LLControlGroup : public LLControlGroupReader +class LLControlGroup : public LLInstanceTracker<LLControlGroup, std::string> { protected: - typedef std::map<std::string, LLPointer<LLControlVariable> > ctrl_name_table_t; + typedef std::map<std::string, LLControlVariablePtr > ctrl_name_table_t; ctrl_name_table_t mNameTable; - std::set<std::string> mWarnings; std::string mTypeString[TYPE_COUNT]; eControlType typeStringToEnum(const std::string& typestr); std::string typeEnumToString(eControlType typeenum); public: - LLControlGroup(); + LLControlGroup(const std::string& name); ~LLControlGroup(); void cleanup(); - LLPointer<LLControlVariable> getControl(const std::string& name); + typedef LLInstanceTracker<LLControlGroup, std::string>::instance_iter instance_iter; + + LLControlVariablePtr getControl(const std::string& name); struct ApplyFunctor { @@ -178,33 +209,47 @@ public: BOOL declareVec3(const std::string& name, const LLVector3 &initial_val,const std::string& comment, BOOL persist = TRUE); BOOL declareVec3d(const std::string& name, const LLVector3d &initial_val, const std::string& comment, BOOL persist = TRUE); BOOL declareRect(const std::string& name, const LLRect &initial_val, const std::string& comment, BOOL persist = TRUE); - BOOL declareColor4U(const std::string& name, const LLColor4U &initial_val, const std::string& comment, BOOL persist = TRUE); BOOL declareColor4(const std::string& name, const LLColor4 &initial_val, const std::string& comment, BOOL persist = TRUE); BOOL declareColor3(const std::string& name, const LLColor3 &initial_val, const std::string& comment, BOOL persist = TRUE); BOOL declareLLSD(const std::string& name, const LLSD &initial_val, const std::string& comment, BOOL persist = TRUE); - - std::string findString(const std::string& name); - std::string getString(const std::string& name); - LLWString getWString(const std::string& name); - std::string getText(const std::string& name); - LLVector3 getVector3(const std::string& name); - LLVector3d getVector3d(const std::string& name); - LLRect getRect(const std::string& name); + std::string getString(const std::string& name); + std::string getText(const std::string& name); BOOL getBOOL(const std::string& name); S32 getS32(const std::string& name); F32 getF32(const std::string& name); U32 getU32(const std::string& name); + + LLWString getWString(const std::string& name); + LLVector3 getVector3(const std::string& name); + LLVector3d getVector3d(const std::string& name); + LLRect getRect(const std::string& name); LLSD getLLSD(const std::string& name); - // Note: If an LLColor4U control exists, it will cast it to the correct - // LLColor4 for you. LLColor4 getColor(const std::string& name); - LLColor4U getColor4U(const std::string& name); LLColor4 getColor4(const std::string& name); LLColor3 getColor3(const std::string& name); + // generic getter + template<typename T> T get(const std::string& name) + { + LLControlVariable* control = getControl(name); + LLSD value; + eControlType type = TYPE_COUNT; + + if (control) + { + value = control->get(); + type = control->type(); + } + else + { + llwarns << "Control " << name << " not found." << llendl; + } + return convert_from_llsd<T>(value, type, name); + } + void setBOOL(const std::string& name, BOOL val); void setS32(const std::string& name, S32 val); void setF32(const std::string& name, F32 val); @@ -213,12 +258,26 @@ public: void setVector3(const std::string& name, const LLVector3 &val); void setVector3d(const std::string& name, const LLVector3d &val); void setRect(const std::string& name, const LLRect &val); - void setColor4U(const std::string& name, const LLColor4U &val); void setColor4(const std::string& name, const LLColor4 &val); - void setColor3(const std::string& name, const LLColor3 &val); void setLLSD(const std::string& name, const LLSD& val); - void setValue(const std::string& name, const LLSD& val); + + // type agnostic setter that takes LLSD + void setUntypedValue(const std::string& name, const LLSD& val); + + // generic setter + template<typename T> void set(const std::string& name, const T& val) + { + LLControlVariable* control = getControl(name); + if (control && control->isType(get_control_type<T>())) + { + control->set(convert_to_llsd(val)); + } + else + { + llwarns << "Invalid control " << name << llendl; + } + } BOOL controlExists(const std::string& name); @@ -229,17 +288,170 @@ public: U32 saveToFile(const std::string& filename, BOOL nondefault_only); U32 loadFromFile(const std::string& filename, bool default_values = false); void resetToDefaults(); +}; + +//! Publish/Subscribe object to interact with LLControlGroups. + +//! Use an LLCachedControl instance to connect to a LLControlVariable +//! without have to manually create and bind a listener to a local +//! object. +template <class T> +class LLControlCache : public LLRefCount, public LLInstanceTracker<LLControlCache<T>, std::string> +{ +public: + // This constructor will declare a control if it doesn't exist in the contol group + LLControlCache(LLControlGroup& group, + const std::string& name, + const T& default_value, + const std::string& comment) + : LLInstanceTracker<LLControlCache<T>, std::string >(name) + { + if(!group.controlExists(name)) + { + if(!declareTypedControl(group, name, default_value, comment)) + { + llerrs << "The control could not be created!!!" << llendl; + } + } + + bindToControl(group, name); + } + + LLControlCache(LLControlGroup& group, + const std::string& name) + : LLInstanceTracker<LLControlCache<T>, std::string >(name) + { + if(!group.controlExists(name)) + { + llerrs << "Control named " << name << "not found." << llendl; + } + + bindToControl(group, name); + } + + ~LLControlCache() + { + if(mConnection.connected()) + { + mConnection.disconnect(); + } + } + + const T& getValue() const { return mCachedValue; } - // Ignorable Warnings - - // Add a config variable to be reset on resetWarnings() - void addWarning(const std::string& name); - BOOL getWarning(const std::string& name); - void setWarning(const std::string& name, BOOL val); - - // Resets all ignorables - void resetWarnings(); +private: + void bindToControl(LLControlGroup& group, const std::string& name) + { + LLControlVariablePtr controlp = group.getControl(name); + mType = controlp->type(); + mCachedValue = convert_from_llsd<T>(controlp->get(), mType, name); + + // Add a listener to the controls signal... + mConnection = controlp->getSignal()->connect( + boost::bind(&LLControlCache<T>::handleValueChange, this, _2) + ); + mType = controlp->type(); + } + bool declareTypedControl(LLControlGroup& group, + const std::string& name, + const T& default_value, + const std::string& comment) + { + LLSD init_value; + eControlType type = get_control_type<T>(); + init_value = convert_to_llsd(default_value); + if(type < TYPE_COUNT) + { + group.declareControl(name, type, init_value, comment, FALSE); + return true; + } + return false; + } + + bool handleValueChange(const LLSD& newvalue) + { + mCachedValue = convert_from_llsd<T>(newvalue, mType, ""); + return true; + } + +private: + T mCachedValue; + eControlType mType; + boost::signals::connection mConnection; +}; + +template <typename T> +class LLCachedControl +{ +public: + LLCachedControl(LLControlGroup& group, + const std::string& name, + const T& default_value, + const std::string& comment = "Declared In Code") + { + mCachedControlPtr = LLControlCache<T>::getInstance(name); + if (mCachedControlPtr.isNull()) + { + mCachedControlPtr = new LLControlCache<T>(group, name, default_value, comment); + } + } + + LLCachedControl(LLControlGroup& group, + const std::string& name) + { + mCachedControlPtr = LLControlCache<T>::getInstance(name); + if (mCachedControlPtr.isNull()) + { + mCachedControlPtr = new LLControlCache<T>(group, name); + } + } + + operator const T&() const { return mCachedControlPtr->getValue(); } + operator boost::function<const T&()> () const { return boost::function<const T&()>(*this); } + const T& operator()() { return mCachedControlPtr->getValue(); } + +private: + LLPointer<LLControlCache<T> > mCachedControlPtr; }; +template <> eControlType get_control_type<U32>(); +template <> eControlType get_control_type<S32>(); +template <> eControlType get_control_type<F32>(); +template <> eControlType get_control_type<bool>(); +// Yay BOOL, its really an S32. +//template <> eControlType get_control_type<BOOL> () +template <> eControlType get_control_type<std::string>(); +template <> eControlType get_control_type<LLVector3>(); +template <> eControlType get_control_type<LLVector3d>(); +template <> eControlType get_control_type<LLRect>(); +template <> eControlType get_control_type<LLColor4>(); +template <> eControlType get_control_type<LLColor3>(); +template <> eControlType get_control_type<LLSD>(); + +template <> LLSD convert_to_llsd<U32>(const U32& in); +template <> LLSD convert_to_llsd<LLVector3>(const LLVector3& in); +template <> LLSD convert_to_llsd<LLVector3d>(const LLVector3d& in); +template <> LLSD convert_to_llsd<LLRect>(const LLRect& in); +template <> LLSD convert_to_llsd<LLColor4>(const LLColor4& in); +template <> LLSD convert_to_llsd<LLColor3>(const LLColor3& in); + +template<> std::string convert_from_llsd<std::string>(const LLSD& sd, eControlType type, const std::string& control_name); +template<> LLWString convert_from_llsd<LLWString>(const LLSD& sd, eControlType type, const std::string& control_name); +template<> LLVector3 convert_from_llsd<LLVector3>(const LLSD& sd, eControlType type, const std::string& control_name); +template<> LLVector3d convert_from_llsd<LLVector3d>(const LLSD& sd, eControlType type, const std::string& control_name); +template<> LLRect convert_from_llsd<LLRect>(const LLSD& sd, eControlType type, const std::string& control_name); +template<> bool convert_from_llsd<bool>(const LLSD& sd, eControlType type, const std::string& control_name); +template<> S32 convert_from_llsd<S32>(const LLSD& sd, eControlType type, const std::string& control_name); +template<> F32 convert_from_llsd<F32>(const LLSD& sd, eControlType type, const std::string& control_name); +template<> U32 convert_from_llsd<U32>(const LLSD& sd, eControlType type, const std::string& control_name); +template<> LLColor3 convert_from_llsd<LLColor3>(const LLSD& sd, eControlType type, const std::string& control_name); +template<> LLColor4 convert_from_llsd<LLColor4>(const LLSD& sd, eControlType type, const std::string& control_name); +template<> LLSD convert_from_llsd<LLSD>(const LLSD& sd, eControlType type, const std::string& control_name); + +//#define TEST_CACHED_CONTROL 1 +#ifdef TEST_CACHED_CONTROL +void test_cached_control(); +#endif // TEST_CACHED_CONTROL + #endif diff --git a/indra/llxml/llcontrolgroupreader.h b/indra/llxml/llcontrolgroupreader.h index 960b19036ea0c076f923e164a2ac9c3effcd01be..116ea2eae087e348761d323f6b3bc9dfc4dbc3e2 100644 --- a/indra/llxml/llcontrolgroupreader.h +++ b/indra/llxml/llcontrolgroupreader.h @@ -3,7 +3,30 @@ * @brief Interface providing readonly access to LLControlGroup (intended for unit testing) * * $LicenseInfo:firstyear=2001&license=viewergpl$ + * * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ @@ -13,9 +36,11 @@ #include "stdtypes.h" #include <string> -// Many of the types below are commented out because for the purposes of the early testing we're doing, -// we don't need them and we don't want to pull in all the machinery to support them. -// But the model is here for future unit test extensions. +#include "v3math.h" +#include "v3dmath.h" +#include "v3color.h" +#include "v4color.h" +#include "llrect.h" class LLControlGroupReader { @@ -23,22 +48,32 @@ public: LLControlGroupReader() {} virtual ~LLControlGroupReader() {} - virtual std::string getString(const std::string& name) = 0; - //virtual LLWString getWString(const std::string& name) = 0; - virtual std::string getText(const std::string& name) = 0; - //virtual LLVector3 getVector3(const std::string& name) = 0; - //virtual LLVector3d getVector3d(const std::string& name) = 0; - //virtual LLRect getRect(const std::string& name) = 0; - virtual BOOL getBOOL(const std::string& name) = 0; - virtual S32 getS32(const std::string& name) = 0; - virtual F32 getF32(const std::string& name) = 0; - virtual U32 getU32(const std::string& name) = 0; - //virtual LLSD getLLSD(const std::string& name) = 0; - - //virtual LLColor4 getColor(const std::string& name) = 0; - //virtual LLColor4U getColor4U(const std::string& name) = 0; - //virtual LLColor4 getColor4(const std::string& name) = 0; - //virtual LLColor3 getColor3(const std::string& name) = 0; + virtual std::string getString(const std::string& name) { return ""; } + virtual LLWString getWString(const std::string& name) { return LLWString(); } + virtual std::string getText(const std::string& name) { return ""; } + virtual LLVector3 getVector3(const std::string& name) { return LLVector3(); } + virtual LLVector3d getVector3d(const std::string& name) { return LLVector3d(); } + virtual LLRect getRect(const std::string& name) { return LLRect(); } + virtual BOOL getBOOL(const std::string& name) { return FALSE; } + virtual S32 getS32(const std::string& name) { return 0; } + virtual F32 getF32(const std::string& name) {return 0.0f; } + virtual U32 getU32(const std::string& name) {return 0; } + virtual LLSD getLLSD(const std::string& name) { return LLSD(); } + + virtual LLColor4 getColor(const std::string& name) { return LLColor4(); } + virtual LLColor4 getColor4(const std::string& name) { return LLColor4(); } + virtual LLColor3 getColor3(const std::string& name) { return LLColor3(); } + + virtual void setBOOL(const std::string& name, BOOL val) {} + virtual void setS32(const std::string& name, S32 val) {} + virtual void setF32(const std::string& name, F32 val) {} + virtual void setU32(const std::string& name, U32 val) {} + virtual void setString(const std::string& name, const std::string& val) {} + virtual void setVector3(const std::string& name, const LLVector3 &val) {} + virtual void setVector3d(const std::string& name, const LLVector3d &val) {} + virtual void setRect(const std::string& name, const LLRect &val) {} + virtual void setColor4(const std::string& name, const LLColor4 &val) {} + virtual void setLLSD(const std::string& name, const LLSD& val) {} }; #endif /* LL_LLCONTROLGROUPREADER_H */ diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index 800b13573f2d8f5cf224883c41c0c68e223850fb..e97aa55190d334e58605cbe6ed8376a8d68d6623 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -47,6 +47,7 @@ #include "llquaternion.h" #include "llstring.h" #include "lluuid.h" +#include "lldir.h" const S32 MAX_COLUMN_WIDTH = 80; @@ -64,6 +65,7 @@ LLXMLNode::LLXMLNode() : mPrecision(64), mType(TYPE_CONTAINER), mEncoding(ENCODING_DEFAULT), + mLineNumber(-1), mParent(NULL), mChildren(NULL), mAttributes(), @@ -85,6 +87,7 @@ LLXMLNode::LLXMLNode(const char* name, BOOL is_attribute) : mPrecision(64), mType(TYPE_CONTAINER), mEncoding(ENCODING_DEFAULT), + mLineNumber(-1), mParent(NULL), mChildren(NULL), mAttributes(), @@ -106,6 +109,7 @@ LLXMLNode::LLXMLNode(LLStringTableEntry* name, BOOL is_attribute) : mPrecision(64), mType(TYPE_CONTAINER), mEncoding(ENCODING_DEFAULT), + mLineNumber(-1), mParent(NULL), mChildren(NULL), mAttributes(), @@ -226,6 +230,10 @@ BOOL LLXMLNode::removeChild(LLXMLNode *target_child) { mChildren->head = target_child->mNext; } + if (target_child == mChildren->tail) + { + mChildren->tail = target_child->mPrev; + } LLXMLNodePtr prev = target_child->mPrev; LLXMLNodePtr next = target_child->mNext; @@ -387,6 +395,7 @@ void XMLCALL StartXMLNode(void *userData, { // Create a new node LLXMLNode *new_node_ptr = new LLXMLNode(name, FALSE); + LLXMLNodePtr new_node = new_node_ptr; new_node->mID.clear(); LLXMLNodePtr ptr_new_node = new_node; @@ -401,7 +410,8 @@ void XMLCALL StartXMLNode(void *userData, } new_node_ptr->mParser = parent->mParser; - + new_node_ptr->setLineNumber(XML_GetCurrentLineNumber(*new_node_ptr->mParser)); + // Set the current active node to the new node XML_Parser *parser = parent->mParser; XML_SetUserData(*parser, (void *)new_node_ptr); @@ -492,6 +502,7 @@ void XMLCALL StartXMLNode(void *userData, if (!new_node->getAttribute(attr_name.c_str(), attr_node, FALSE)) { attr_node = new LLXMLNode(attr_name.c_str(), TRUE); + attr_node->setLineNumber(XML_GetCurrentLineNumber(*new_node_ptr->mParser)); } attr_node->setValue(attr_value); new_node->addChild(attr_node); @@ -836,12 +847,66 @@ BOOL LLXMLNode::isFullyDefault() } // static -void LLXMLNode::writeHeaderToFile(LLFILE *fOut) +bool LLXMLNode::getLayeredXMLNode(const std::string &xui_filename, LLXMLNodePtr& root, + const std::vector<std::string>& paths) +{ + std::string full_filename = gDirUtilp->findSkinnedFilename(paths.front(), xui_filename); + if (full_filename.empty()) + { + return false; + } + + if (!LLXMLNode::parseFile(full_filename, root, NULL)) + { + // try filename as passed in since sometimes we load an xml file from a user-supplied path + if (!LLXMLNode::parseFile(xui_filename, root, NULL)) + { + llwarns << "Problem reading UI description file: " << xui_filename << llendl; + return false; + } + } + + LLXMLNodePtr updateRoot; + + std::vector<std::string>::const_iterator itor; + + for (itor = paths.begin(), ++itor; itor != paths.end(); ++itor) + { + std::string nodeName; + std::string updateName; + + std::string layer_filename = gDirUtilp->findSkinnedFilename((*itor), xui_filename); + if(layer_filename.empty()) + { + // no localized version of this file, that's ok, keep looking + continue; + } + + if (!LLXMLNode::parseFile(layer_filename, updateRoot, NULL)) + { + llwarns << "Problem reading localized UI description file: " << (*itor) + gDirUtilp->getDirDelimiter() + xui_filename << llendl; + return false; + } + + updateRoot->getAttributeString("name", updateName); + root->getAttributeString("name", nodeName); + + if (updateName == nodeName) + { + LLXMLNode::updateNode(root, updateRoot); + } + } + + return true; +} + +// static +void LLXMLNode::writeHeaderToFile(LLFILE *out_file) { - fprintf(fOut, "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n"); + fprintf(out_file, "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n"); } -void LLXMLNode::writeToFile(LLFILE *fOut, const std::string& indent) +void LLXMLNode::writeToFile(LLFILE *out_file, const std::string& indent) { if (isFullyDefault()) { @@ -852,7 +917,8 @@ void LLXMLNode::writeToFile(LLFILE *fOut, const std::string& indent) std::ostringstream ostream; writeToOstream(ostream, indent); std::string outstring = ostream.str(); - if (fwrite(outstring.c_str(), 1, outstring.length(), fOut) != outstring.length()) + size_t written = fwrite(outstring.c_str(), 1, outstring.length(), out_file); + if (written != outstring.length()) { llwarns << "Short write" << llendl; } @@ -872,12 +938,12 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const std::string& i BOOL has_default_length = mDefault.isNull()?FALSE:(mLength == mDefault->mLength); // stream the name - output_stream << indent << "<" << mName->mString; + output_stream << indent << "<" << mName->mString << "\n"; // ID if (mID != "") { - output_stream << " id=\"" << mID << "\""; + output_stream << indent << " id=\"" << mID << "\"\n"; } // Type @@ -886,22 +952,22 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const std::string& i switch (mType) { case TYPE_BOOLEAN: - output_stream << " type=\"boolean\""; + output_stream << indent << " type=\"boolean\"\n"; break; case TYPE_INTEGER: - output_stream << " type=\"integer\""; + output_stream << indent << " type=\"integer\"\n"; break; case TYPE_FLOAT: - output_stream << " type=\"float\""; + output_stream << indent << " type=\"float\"\n"; break; case TYPE_STRING: - output_stream << " type=\"string\""; + output_stream << indent << " type=\"string\"\n"; break; case TYPE_UUID: - output_stream << " type=\"uuid\""; + output_stream << indent << " type=\"uuid\"\n"; break; case TYPE_NODEREF: - output_stream << " type=\"noderef\""; + output_stream << indent << " type=\"noderef\"\n"; break; default: // default on switch(enum) eliminates a warning on linux @@ -915,13 +981,13 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const std::string& i switch (mEncoding) { case ENCODING_DECIMAL: - output_stream << " encoding=\"decimal\""; + output_stream << indent << " encoding=\"decimal\"\n"; break; case ENCODING_HEX: - output_stream << " encoding=\"hex\""; + output_stream << indent << " encoding=\"hex\"\n"; break; /*case ENCODING_BASE32: - output_stream << " encoding=\"base32\""; + output_stream << indent << " encoding=\"base32\"\n"; break;*/ default: // default on switch(enum) eliminates a warning on linux @@ -932,24 +998,23 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const std::string& i // Precision if (!has_default_precision && (mType == TYPE_INTEGER || mType == TYPE_FLOAT)) { - output_stream << " precision=\"" << mPrecision << "\""; + output_stream << indent << " precision=\"" << mPrecision << "\"\n"; } // Version if (mVersionMajor > 0 || mVersionMinor > 0) { - output_stream << " version=\"" << mVersionMajor << "." << mVersionMinor << "\""; + output_stream << indent << " version=\"" << mVersionMajor << "." << mVersionMinor << "\"\n"; } // Array length if (!has_default_length && mLength > 0) { - output_stream << " length=\"" << mLength << "\""; + output_stream << indent << " length=\"" << mLength << "\"\n"; } { // Write out attributes - S32 col_pos = 0; LLXMLAttribList::const_iterator attr_itr; LLXMLAttribList::const_iterator attr_end = mAttributes.end(); for (attr_itr = mAttributes.begin(); attr_itr != attr_end; ++attr_itr) @@ -971,17 +1036,14 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const std::string& i std::string attr_str = llformat(" %s=\"%s\"", attr.c_str(), escapeXML(child->mValue).c_str()); - if (col_pos + (S32)attr_str.length() > MAX_COLUMN_WIDTH) - { - output_stream << "\n" << indent << " "; - col_pos = 4; - } - col_pos += attr_str.length(); - output_stream << attr_str; + output_stream << indent << attr_str << "\n"; } } } + // erase last \n before attaching final > or /> + output_stream.seekp(-1, std::ios::cur); + if (mChildren.isNull() && mValue == "") { output_stream << " />\n"; @@ -993,7 +1055,7 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const std::string& i if (mChildren.notNull()) { // stream non-attributes - std::string next_indent = indent + "\t"; + std::string next_indent = indent + " "; for (LLXMLNode* child = getFirstChild(); child; child = child->getNextSibling()) { child->writeToOstream(output_stream, next_indent); @@ -1002,7 +1064,7 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const std::string& i if (!mValue.empty()) { std::string contents = getTextContents(); - output_stream << indent << "\t" << escapeXML(contents) << "\n"; + output_stream << indent << " " << escapeXML(contents) << "\n"; } output_stream << indent << "</" << mName->mString << ">\n"; } @@ -2475,14 +2537,15 @@ std::string LLXMLNode::escapeXML(const std::string& xml) return out; } -void LLXMLNode::setStringValue(U32 length, const std::string *array) +void LLXMLNode::setStringValue(U32 length, const std::string *strings) { if (length == 0) return; std::string new_value; for (U32 pos=0; pos<length; ++pos) { - new_value.append(escapeXML(array[pos])); + // *NOTE: Do not escape strings here - do it on output + new_value.append( strings[pos] ); if (pos < length-1) new_value.append(" "); } @@ -3150,6 +3213,19 @@ LLXMLNodePtr LLXMLNode::getNextSibling() const return ret; } +std::string LLXMLNode::getSanitizedValue() const +{ + if (mIsAttribute) + { + return getValue() ; + } + else + { + return getTextContents(); + } +} + + std::string LLXMLNode::getTextContents() const { std::string msg; @@ -3215,3 +3291,13 @@ std::string LLXMLNode::getTextContents() const } return msg; } + +void LLXMLNode::setLineNumber(S32 line_number) +{ + mLineNumber = line_number; +} + +S32 LLXMLNode::getLineNumber() +{ + return mLineNumber; +} diff --git a/indra/llxml/llxmlnode.h b/indra/llxml/llxmlnode.h index d4e127b05caeb2b85266ffb60dd11ace945976fa..c983a1441068d1449eb458a4c4b278f44da8bab5 100644 --- a/indra/llxml/llxmlnode.h +++ b/indra/llxml/llxmlnode.h @@ -44,8 +44,8 @@ #include <map> #include "indra_constants.h" -#include "llmemory.h" -#include "llthread.h" +#include "llpointer.h" +#include "llthread.h" // LLThreadSafeRefCount #include "llstring.h" #include "llstringtable.h" @@ -153,8 +153,18 @@ public: LLXMLNodePtr& node, LLXMLNodePtr& update_node); static LLXMLNodePtr replaceNode(LLXMLNodePtr node, LLXMLNodePtr replacement_node); - static void writeHeaderToFile(LLFILE *fOut); - void writeToFile(LLFILE *fOut, const std::string& indent = std::string()); + + static bool getLayeredXMLNode(const std::string &xui_filename, LLXMLNodePtr& root, + const std::vector<std::string>& paths); + + + // Write standard XML file header: + // <?xml version="1.0" encoding="utf-8" standalone="yes" ?> + static void writeHeaderToFile(LLFILE *out_file); + + // Write XML to file with one attribute per line. + // XML escapes values as they are written. + void writeToFile(LLFILE *out_file, const std::string& indent = std::string()); void writeToOstream(std::ostream& output_stream, const std::string& indent = std::string()); // Utility @@ -207,6 +217,7 @@ public: U32 getLength() const { return mLength; } U32 getPrecision() const { return mPrecision; } const std::string& getValue() const { return mValue; } + std::string getSanitizedValue() const; std::string getTextContents() const; const LLStringTableEntry* getName() const { return mName; } BOOL hasName(const char* name) const { return mName == gStringTable.checkStringEntry(name); } @@ -227,6 +238,8 @@ public: bool getAttribute(const char* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE); bool getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE); + S32 getLineNumber(); + // The following skip over attributes LLXMLNodePtr getFirstChild() const; LLXMLNodePtr getNextSibling() const; @@ -262,6 +275,8 @@ public: void setName(const std::string& name); void setName(LLStringTableEntry* name); + void setLineNumber(S32 line_number); + // Escapes " (quot) ' (apos) & (amp) < (lt) > (gt) static std::string escapeXML(const std::string& xml); @@ -300,6 +315,7 @@ public: U32 mPrecision; // The number of BITS per array item ValueType mType; // The value type Encoding mEncoding; // The value encoding + S32 mLineNumber; // line number in source file, if applicable LLXMLNode* mParent; // The parent node LLXMLChildrenPtr mChildren; // The child nodes @@ -312,7 +328,11 @@ public: protected: LLStringTableEntry *mName; // The name of this node - std::string mValue; // The value of this node (use getters/setters only) + + // The value of this node (use getters/setters only) + // Values are not XML-escaped in memory + // They may contain " (quot) ' (apos) & (amp) < (lt) > (gt) + std::string mValue; LLXMLNodePtr mDefault; // Mirror node in the default tree diff --git a/indra/lscript/lscript_execute.h b/indra/lscript/lscript_execute.h index 9a631c4c8f0f999b826f1806eaf0535f9931d9e4..245fc320d1154ee84b0847bebba58adf2fb69332 100644 --- a/indra/lscript/lscript_execute.h +++ b/indra/lscript/lscript_execute.h @@ -37,6 +37,8 @@ #include "linked_lists.h" #include "lscript_library.h" +class LLTimer; + // Return values for run() methods const U32 NO_DELETE_FLAG = 0x0000; const U32 DELETE_FLAG = 0x0001; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 0c8486bd4f1ff4ea9017d5cac31dac8ef4c2360e..0cbacd5b2ecda095bb9d1559b8329fa80355dcee 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -63,41 +63,48 @@ include_directories( ) set(viewer_SOURCE_FILES + llaccordionpanel.cpp llagent.cpp llagentaccess.cpp llagentdata.cpp llagentlanguage.cpp llagentpilot.cpp + llagentwearables.cpp llanimstatelabels.cpp llappviewer.cpp llassetuploadresponders.cpp llassetuploadqueue.cpp llaudiosourcevo.cpp + llavatariconctrl.cpp + llavatarlist.cpp + llavatarlistitem.cpp + llavatarpropertiesprocessor.cpp llbbox.cpp + llbottomtray.cpp llbox.cpp llcallbacklist.cpp llcallingcard.cpp llcapabilitylistener.cpp llcaphttpsender.cpp llchatbar.cpp + llchathistoryscroll.cpp + llchiclet.cpp llclassifiedinfo.cpp llclassifiedstatsresponder.cpp llcloud.cpp - llcolorscheme.cpp + llcollapsiblectrl.cpp llcolorswatch.cpp llcommandhandler.cpp llcommandlineparser.cpp - llcompass.cpp llcompilequeue.cpp llconfirmationmanager.cpp - llconsole.cpp - llcontainerview.cpp llcurrencyuimanager.cpp llcylinder.cpp lldebugmessagebox.cpp lldebugview.cpp lldelayedgestureerror.cpp lldirpicker.cpp + lldraggerbar.cpp lldrawable.cpp lldrawpoolalpha.cpp lldrawpoolavatar.cpp @@ -118,12 +125,14 @@ set(viewer_SOURCE_FILES lleventpoll.cpp llface.cpp llfasttimerview.cpp + llfavoritesbar.cpp llfeaturemanager.cpp llfilepicker.cpp llfirstuse.cpp llflexibleobject.cpp llfloaterabout.cpp llfloateractivespeakers.cpp + llfloateraddlandmark.cpp llfloateranimpreview.cpp llfloaterauction.cpp llfloateravatarinfo.cpp @@ -137,6 +146,7 @@ set(viewer_SOURCE_FILES llfloaterbuy.cpp llfloaterbuycurrency.cpp llfloaterbuyland.cpp + llfloatercall.cpp llfloatercamera.cpp llfloaterchat.cpp llfloaterchatterbox.cpp @@ -145,7 +155,6 @@ set(viewer_SOURCE_FILES llfloatercustomize.cpp llfloaterdaycycle.cpp llfloaterdirectory.cpp - llfloatereditui.cpp llfloaterenvsettings.cpp llfloaterevent.cpp llfloaterfriends.cpp @@ -168,17 +177,15 @@ set(viewer_SOURCE_FILES llfloaterlagmeter.cpp llfloaterland.cpp llfloaterlandholdings.cpp - llfloaterlandmark.cpp llfloatermap.cpp llfloatermemleak.cpp + llfloaterminiinspector.cpp llfloatermute.cpp llfloaternamedesc.cpp - llfloaternewim.cpp llfloaternotificationsconsole.cpp llfloaterobjectiminfo.cpp llfloateropenobject.cpp llfloaterparcel.cpp - llfloaterpermissionsmgr.cpp llfloaterperms.cpp llfloaterpostcard.cpp llfloaterpostprocess.cpp @@ -190,12 +197,11 @@ set(viewer_SOURCE_FILES llfloatersellland.cpp llfloatersettingsdebug.cpp llfloatersnapshot.cpp - llfloaterstats.cpp llfloatertelehub.cpp - llfloatertest.cpp llfloatertools.cpp llfloatertopobjects.cpp llfloatertos.cpp + llfloateruipreview.cpp llfloaterurldisplay.cpp llfloaterurlentry.cpp llfloatervoicedevicesettings.cpp @@ -204,11 +210,12 @@ set(viewer_SOURCE_FILES llfloaterworldmap.cpp llfolderview.cpp llfollowcam.cpp - llframestats.cpp - llframestatview.cpp + llfriendactions.cpp llgesturemgr.cpp llgivemoney.cpp llglsandbox.cpp + llgroupactions.cpp + llgrouplist.cpp llgroupmgr.cpp llgroupnotify.cpp llhomelocationresponder.cpp @@ -226,13 +233,15 @@ set(viewer_SOURCE_FILES llhudview.cpp llimpanel.cpp llimview.cpp - llinventoryactions.cpp + llimcontrolpanel.cpp llinventorybridge.cpp llinventoryclipboard.cpp llinventorymodel.cpp llinventoryview.cpp lljoystickbutton.cpp lllandmarklist.cpp + lllocationhistory.cpp + lllocationinputctrl.cpp lllogchat.cpp llloginhandler.cpp llmanip.cpp @@ -243,6 +252,7 @@ set(viewer_SOURCE_FILES llmediaremotectrl.cpp llmemoryview.cpp llmenucommands.cpp + llmetricperformancetester.cpp llmimetypes.cpp llmorphview.cpp llmoveview.cpp @@ -250,15 +260,16 @@ set(viewer_SOURCE_FILES llnamebox.cpp llnameeditor.cpp llnamelistctrl.cpp + llnavigationbar.cpp + llnearbychathistory.cpp llnetmap.cpp llnotify.cpp + lloutputmonitorctrl.cpp lloverlaybar.cpp - llpanelaudioprefs.cpp - llpanelaudiovolume.cpp llpanelavatar.cpp + llpanelavatarrow.cpp llpanelclassified.cpp llpanelcontents.cpp - llpaneldebug.cpp llpaneldirbrowser.cpp llpaneldirclassified.cpp llpaneldirevents.cpp @@ -267,41 +278,37 @@ set(viewer_SOURCE_FILES llpaneldirland.cpp llpaneldirpeople.cpp llpaneldirplaces.cpp - llpaneldirpopular.cpp llpaneldisplay.cpp llpanelevent.cpp llpanelface.cpp - llpanelgeneral.cpp llpanelgroup.cpp llpanelgroupgeneral.cpp llpanelgroupinvite.cpp llpanelgrouplandmoney.cpp llpanelgroupnotices.cpp llpanelgrouproles.cpp - llpanelinput.cpp llpanelinventory.cpp llpanelland.cpp + llpanellandmarks.cpp llpanellandmedia.cpp - llpanellandobjects.cpp - llpanellandoptions.cpp llpanellogin.cpp - llpanelmorph.cpp - llpanelmsgs.cpp - llpanelnetwork.cpp + llpanelmeprofile.cpp llpanelobject.cpp + llpanelpeople.cpp llpanelpermissions.cpp llpanelpick.cpp + llpanelpicks.cpp llpanelplace.cpp - llpanelskins.cpp + llpanelplaceinfo.cpp + llpanelplaces.cpp + llpanelplacestab.cpp + llpanelprofileview.cpp + llpanelteleporthistory.cpp llpanelvolume.cpp - llpanelweb.cpp llparcelselection.cpp llpatchvertexarray.cpp llpolymesh.cpp llpolymorph.cpp - llprefschat.cpp - llprefsim.cpp - llprefsvoice.cpp llpreviewanim.cpp llpreview.cpp llpreviewgesture.cpp @@ -312,23 +319,26 @@ set(viewer_SOURCE_FILES llpreviewtexture.cpp llproductinforequest.cpp llprogressview.cpp + llrecentpeople.cpp llregionposition.cpp llremoteparcelrequest.cpp llsavedsettingsglue.cpp llselectmgr.cpp + llsidetray.cpp llsky.cpp + llslurl.cpp llspatialpartition.cpp llsprite.cpp llsrv.cpp llstartup.cpp - llstatbar.cpp - llstatgraph.cpp llstatusbar.cpp - llstatview.cpp llstylemap.cpp llsurface.cpp llsurfacepatch.cpp + llteleporthistory.cpp + lltexglobalcolor.cpp lltexlayer.cpp + lltexlayerparams.cpp lltexturecache.cpp lltexturectrl.cpp lltexturefetch.cpp @@ -352,9 +362,7 @@ set(viewer_SOURCE_FILES lltoolselect.cpp lltoolselectland.cpp lltoolselectrect.cpp - lltoolview.cpp lltracker.cpp - lltrans.cpp lluploaddialog.cpp llurl.cpp llurldispatcher.cpp @@ -363,13 +371,13 @@ set(viewer_SOURCE_FILES llurlwhitelist.cpp lluserauth.cpp llvectorperfoptions.cpp - llvelocitybar.cpp llviewchildren.cpp llviewerassetstorage.cpp llvieweraudio.cpp llviewercamera.cpp llviewercontrol.cpp llviewerdisplay.cpp + llviewerfloaterreg.cpp llviewergenericmessage.cpp llviewergesture.cpp llviewerimage.cpp @@ -409,6 +417,7 @@ set(viewer_SOURCE_FILES llvlmanager.cpp llvoavatar.cpp llvoavatardefines.cpp + llvoavatarself.cpp llvocache.cpp llvoclouds.cpp llvograss.cpp @@ -416,6 +425,7 @@ set(viewer_SOURCE_FILES llvoiceclient.cpp llvoiceremotectrl.cpp llvoicevisualizer.cpp + llvoicecontrolpanel.cpp llvoinventorylistener.cpp llvopartgroup.cpp llvosky.cpp @@ -429,6 +439,7 @@ set(viewer_SOURCE_FILES llwaterparammanager.cpp llwaterparamset.cpp llwearable.cpp + llwearabledictionary.cpp llwearablelist.cpp llweb.cpp llwebbrowserctrl.cpp @@ -465,19 +476,25 @@ endif (LINUX) set(viewer_HEADER_FILES CMakeLists.txt ViewerInstall.cmake - + llaccordionpanel.h llagent.h llagentaccess.h llagentdata.h llagentlanguage.h llagentpilot.h + llagentwearables.h llanimstatelabels.h llappearance.h llappviewer.h llassetuploadresponders.h llassetuploadqueue.h llaudiosourcevo.h + llavatariconctrl.h + llavatarlist.h + llavatarlistitem.h + llavatarpropertiesprocessor.h llbbox.h + llbottomtray.h llbox.h llcallbacklist.h llcallingcard.h @@ -485,24 +502,24 @@ set(viewer_HEADER_FILES llcapabilityprovider.h llcaphttpsender.h llchatbar.h + llchathistoryscroll.h + llchiclet.h llclassifiedinfo.h llclassifiedstatsresponder.h llcloud.h - llcolorscheme.h + llcollapsiblectrl.h llcolorswatch.h llcommandhandler.h llcommandlineparser.h - llcompass.h llcompilequeue.h llconfirmationmanager.h - llconsole.h - llcontainerview.h llcurrencyuimanager.h llcylinder.h lldebugmessagebox.h lldebugview.h lldelayedgestureerror.h lldirpicker.h + lldraggerbar.h lldrawable.h lldrawpool.h lldrawpoolalpha.h @@ -524,12 +541,14 @@ set(viewer_HEADER_FILES lleventpoll.h llface.h llfasttimerview.h + llfavoritesbar.h llfeaturemanager.h llfilepicker.h llfirstuse.h llflexibleobject.h llfloaterabout.h llfloateractivespeakers.h + llfloateraddlandmark.h llfloateranimpreview.h llfloaterauction.h llfloateravatarinfo.h @@ -543,6 +562,7 @@ set(viewer_HEADER_FILES llfloaterbuycontents.h llfloaterbuycurrency.h llfloaterbuyland.h + llfloatercall.h llfloatercamera.h llfloaterchat.h llfloaterchatterbox.h @@ -551,7 +571,6 @@ set(viewer_HEADER_FILES llfloatercustomize.h llfloaterdaycycle.h llfloaterdirectory.h - llfloatereditui.h llfloaterenvsettings.h llfloaterevent.h llfloaterfonttest.h @@ -574,17 +593,15 @@ set(viewer_HEADER_FILES llfloaterlagmeter.h llfloaterland.h llfloaterlandholdings.h - llfloaterlandmark.h llfloatermap.h llfloatermemleak.h + llfloaterminiinspector.h llfloatermute.h llfloaternamedesc.h - llfloaternewim.h llfloaternotificationsconsole.h llfloaterobjectiminfo.h llfloateropenobject.h llfloaterparcel.h - llfloaterpermissionsmgr.h llfloaterpostcard.h llfloaterpostprocess.h llfloaterpreference.h @@ -596,12 +613,11 @@ set(viewer_HEADER_FILES llfloatersellland.h llfloatersettingsdebug.h llfloatersnapshot.h - llfloaterstats.h llfloatertelehub.h - llfloatertest.h llfloatertools.h llfloatertopobjects.h llfloatertos.h + llfloateruipreview.h llfloaterurldisplay.h llfloaterurlentry.h llfloatervoicedevicesettings.h @@ -610,10 +626,11 @@ set(viewer_HEADER_FILES llfloaterworldmap.h llfolderview.h llfollowcam.h - llframestats.h - llframestatview.h + llfriendactions.h llgesturemgr.h llgivemoney.h + llgroupactions.h + llgrouplist.h llgroupmgr.h llgroupnotify.h llhomelocationresponder.h @@ -631,6 +648,7 @@ set(viewer_HEADER_FILES llhudview.h llimpanel.h llimview.h + llimcontrolpanel.h llinventorybridge.h llinventoryclipboard.h llinventorymodel.h @@ -638,6 +656,8 @@ set(viewer_HEADER_FILES lljoystickbutton.h lllandmarklist.h lllightconstants.h + lllocationhistory.h + lllocationinputctrl.h lllogchat.h llloginhandler.h llmanip.h @@ -648,6 +668,7 @@ set(viewer_HEADER_FILES llmediaremotectrl.h llmemoryview.h llmenucommands.h + llmetricperformancetester.h llmimetypes.h llmorphview.h llmoveview.h @@ -655,15 +676,16 @@ set(viewer_HEADER_FILES llnamebox.h llnameeditor.h llnamelistctrl.h + llnavigationbar.h + llnearbychathistory.h llnetmap.h llnotify.h + lloutputmonitorctrl.h lloverlaybar.h - llpanelaudioprefs.h - llpanelaudiovolume.h llpanelavatar.h + llpanelavatarrow.h llpanelclassified.h llpanelcontents.h - llpaneldebug.h llpaneldirbrowser.h llpaneldirclassified.h llpaneldirevents.h @@ -672,42 +694,37 @@ set(viewer_HEADER_FILES llpaneldirland.h llpaneldirpeople.h llpaneldirplaces.h - llpaneldirpopular.h llpaneldisplay.h llpanelevent.h llpanelface.h - llpanelgeneral.h llpanelgroup.h llpanelgroupgeneral.h llpanelgroupinvite.h llpanelgrouplandmoney.h llpanelgroupnotices.h llpanelgrouproles.h - llpanelinput.h llpanelinventory.h llpanelland.h + llpanellandmarks.h llpanellandmedia.h - llpanellandobjects.h - llpanellandoptions.h - llpanelLCD.h llpanellogin.h - llpanelmorph.h - llpanelmsgs.h - llpanelnetwork.h + llpanelmeprofile.h llpanelobject.h + llpanelpeople.h llpanelpermissions.h llpanelpick.h + llpanelpicks.h llpanelplace.h - llpanelskins.h + llpanelplaceinfo.h + llpanelplaces.h + llpanelplacestab.h + llpanelprofileview.h + llpanelteleporthistory.h llpanelvolume.h - llpanelweb.h llparcelselection.h llpatchvertexarray.h llpolymesh.h llpolymorph.h - llprefschat.h - llprefsim.h - llprefsvoice.h llpreview.h llpreviewanim.h llpreviewgesture.h @@ -718,25 +735,29 @@ set(viewer_HEADER_FILES llpreviewtexture.h llproductinforequest.h llprogressview.h + llrecentpeople.h llregionposition.h llremoteparcelrequest.h llresourcedata.h + llrootview.h llsavedsettingsglue.h llselectmgr.h + llsidetray.h llsky.h + llslurl.h llspatialpartition.h llsprite.h llsrv.h llstartup.h - llstatbar.h - llstatgraph.h llstatusbar.h - llstatview.h llstylemap.h llsurface.h llsurfacepatch.h lltable.h + llteleporthistory.h + lltexglobalcolor.h lltexlayer.h + lltexlayerparams.h lltexturecache.h lltexturectrl.h lltexturefetch.h @@ -760,9 +781,7 @@ set(viewer_HEADER_FILES lltoolselect.h lltoolselectland.h lltoolselectrect.h - lltoolview.h lltracker.h - lltrans.h lluiconstants.h lluploaddialog.h llurl.h @@ -772,7 +791,6 @@ set(viewer_HEADER_FILES llurlwhitelist.h lluserauth.h llvectorperfoptions.h - llvelocitybar.h llviewchildren.h llviewerassetstorage.h llvieweraudio.h @@ -780,6 +798,7 @@ set(viewer_HEADER_FILES llviewercamera.h llviewercontrol.h llviewerdisplay.h + llviewerfloaterreg.h llviewergenericmessage.h llviewergesture.h llviewerimage.h @@ -817,6 +836,7 @@ set(viewer_HEADER_FILES llvlmanager.h llvoavatar.h llvoavatardefines.h + llvoavatarself.h llvocache.h llvoclouds.h llvograss.h @@ -824,6 +844,7 @@ set(viewer_HEADER_FILES llvoiceclient.h llvoiceremotectrl.h llvoicevisualizer.h + llvoicecontrolpanel.h llvoinventorylistener.h llvopartgroup.h llvosky.h @@ -838,6 +859,7 @@ set(viewer_HEADER_FILES llwaterparammanager.h llwaterparamset.h llwearable.h + llwearabledictionary.h llwearablelist.h llweb.h llwebbrowserctrl.h @@ -937,6 +959,10 @@ if (WINDOWS) ) endforeach( src_file ${viewer_SOURCE_FILES} ) list(APPEND viewer_SOURCE_FILES llviewerprecompiledheaders.cpp) + # llstartup.cpp needs special symbols for audio libraries, so it resets + # COMPILE_FLAGS below. Make sure it maintains precompiled header settings. + set(LLSTARTUP_COMPILE_FLAGS + "${LLSTARTUP_COMPILE_FLAGS} /Yullviewerprecompiledheaders.h") # Add resource files to the project. # viewerRes.rc is the only buildable file, but @@ -1000,12 +1026,11 @@ if (WINDOWS) ) set(viewer_LIBRARIES - advapi32 + ${WINDOWS_LIBRARIES} comdlg32 ${DINPUT_LIBRARY} ${DXGUID_LIBRARY} fmodvc - gdi32 kernel32 odbc32 odbccp32 @@ -1013,7 +1038,6 @@ if (WINDOWS) oleaut32 opengl32 shell32 - user32 Vfw32 winspool ) @@ -1035,16 +1059,18 @@ endif (WINDOWS) # Add the xui files. This is handy for searching for xui elements # from within the IDE. - -file(GLOB viewer_XUI_FILE_GLOB_LIST - ${CMAKE_CURRENT_SOURCE_DIR}/skins/default/xui/en-us/*.xml) - set(viewer_XUI_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/skins/default/colors.xml - ${CMAKE_CURRENT_SOURCE_DIR}/skins/default/colors_base.xml + skins/default/colors.xml + skins/default/textures/textures.xml ) +file(GLOB DEFAULT_XUI_FILE_GLOB_LIST + ${CMAKE_CURRENT_SOURCE_DIR}/skins/default/xui/en/*.xml) +list(APPEND viewer_XUI_FILES ${DEFAULT_XUI_FILE_GLOB_LIST}) + +file(GLOB DEFAULT_WIDGET_FILE_GLOB_LIST + ${CMAKE_CURRENT_SOURCE_DIR}/skins/default/xui/en/widgets/*.xml) +list(APPEND viewer_XUI_FILES ${DEFAULT_WIDGET_FILE_GLOB_LIST}) -list(APPEND viewer_XUI_FILES ${viewer_XUI_FILE_GLOB_LIST}) list(SORT viewer_XUI_FILES) source_group("XUI Files" FILES ${viewer_XUI_FILES}) @@ -1167,8 +1193,10 @@ if (WINDOWS) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES + # *TODO -reenable this once we get server usage sorted out + #LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:\"__tcmalloc\"" LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS" - LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\"" + LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO" LINK_FLAGS_RELEASE ${release_flags} ) @@ -1271,6 +1299,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${WINDOWS_LIBRARIES} ${XMLRPCEPI_LIBRARIES} ${ELFIO_LIBRARIES} + ${GOOGLE_PERFTOOLS_LIBRARIES} ) build_version(viewer) @@ -1408,3 +1437,4 @@ set_source_files_properties( ) LL_ADD_PROJECT_UNIT_TESTS(${VIEWER_BINARY_NAME} "${viewer_TEST_SOURCE_FILES}") +#ADD_VIEWER_BUILD_TEST(llmemoryview viewer) diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 5f11ed8e229a622d4bef955c03f768594a5789eb..783a886fdd325e0c654afbaac2a82ee3bf10fddc 100644 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -106,6 +106,46 @@ <string>QuitAfterSeconds</string> </map> + <key>logperformance</key> + <map> + <key>desc</key> + <string>Log performance metrics for benchmarking</string> + <key>map-to</key> + <string>LogPerformance</string> + </map> + + <key>logmetrics</key> + <map> + <key>desc</key> + <string>Log metrics for benchmarking</string> + <key>map-to</key> + <string>LogMetrics</string> + </map> + + <key>analyzeperformance</key> + <map> + <key>desc</key> + <string>When used in conjunction with logperformance, analyzes result of log against baseline.</string> + <key>map-to</key> + <string>AnalyzePerformance</string> + </map> + + <key>debugsession</key> + <map> + <key>desc</key> + <string>Run as if RenderDebugGL is TRUE, but log errors until end of session.</string> + <key>map-to</key> + <string>DebugSession</string> + </map> + + <key>replaysession</key> + <map> + <key>desc</key> + <string>After login, replay last recorded session and quit.</string> + <key>map-to</key> + <string>ReplaySession</string> + </map> + <key>rotate</key> <map> <key>map-to</key> @@ -166,6 +206,16 @@ <string>UserLogFile</string> </map> + <key>graphicslevel</key> + <map> + <key>desc</key> + <string>Set the detail level. + 0 - low, 1 - medium, 2 - high, 3 - ultra + </string> + <key>count</key> + <integer>1</integer> + </map> + <key>setdefault</key> <map> <key>desc</key> diff --git a/indra/newview/app_settings/ignorable_dialogs.xml b/indra/newview/app_settings/ignorable_dialogs.xml new file mode 100644 index 0000000000000000000000000000000000000000..669235af1bc0cb7620a6e2b88b3b172923a36798 --- /dev/null +++ b/indra/newview/app_settings/ignorable_dialogs.xml @@ -0,0 +1,291 @@ +<?xml version="1.0" ?> +<llsd> +<map> + <key>FirstAppearance</key> + <map> + <key>Comment</key> + <string>Enables FirstAppearance warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstAttach</key> + <map> + <key>Comment</key> + <string>Enables FirstAttach warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstBalanceDecrease</key> + <map> + <key>Comment</key> + <string>Enables FirstBalanceDecrease warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstBalanceIncrease</key> + <map> + <key>Comment</key> + <string>Enables FirstBalanceIncrease warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstBuild</key> + <map> + <key>Comment</key> + <string>Enables FirstBuild warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstDebugMenus</key> + <map> + <key>Comment</key> + <string>Enables FirstDebugMenus warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstFlexible</key> + <map> + <key>Comment</key> + <string>Enables FirstFlexible warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstGoTo</key> + <map> + <key>Comment</key> + <string>Enables FirstGoTo warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstInventory</key> + <map> + <key>Comment</key> + <string>Enables FirstInventory warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstLeftClickNoHit</key> + <map> + <key>Comment</key> + <string>Enables FirstLeftClickNoHit warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstMap</key> + <map> + <key>Comment</key> + <string>Enables FirstMap warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstMedia</key> + <map> + <key>Comment</key> + <string>Enables FirstMedia warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstOverrideKeys</key> + <map> + <key>Comment</key> + <string>Enables FirstOverrideKeys warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstSandbox</key> + <map> + <key>Comment</key> + <string>Enables FirstSandbox warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstSculptedPrim</key> + <map> + <key>Comment</key> + <string>Enables FirstSculptedPrim warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstSit</key> + <map> + <key>Comment</key> + <string>Enables FirstSit warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstStreamingMusic</key> + <map> + <key>Comment</key> + <string>Enables FirstStreamingMusic warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstStreamingVideo</key> + <map> + <key>Comment</key> + <string>Enables FirstStreamingVideo warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstTeleport</key> + <map> + <key>Comment</key> + <string>Enables FirstTeleport warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>FirstVoice</key> + <map> + <key>Comment</key> + <string>Enables FirstVoice warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>AboutDirectX9</key> + <map> + <key>Comment</key> + <string>Enables AboutDirectX9 warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>BrowserLaunch</key> + <map> + <key>Comment</key> + <string>Enables BrowserLaunch warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>DeedObject</key> + <map> + <key>Comment</key> + <string>Enables DeedObject warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>NewClassified</key> + <map> + <key>Comment</key> + <string>Enables NewClassified warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>QuickTimeInstalled</key> + <map> + <key>Comment</key> + <string>Enables QuickTimeInstalled warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>ReturnToOwner</key> + <map> + <key>Comment</key> + <string>Enables ReturnToOwner warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + </map> +</llsd> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7ae92129dc314a127b9cf0b562a80386c2e88547..5ad49774a9ef6b206ea87b775dce852e52435eb6 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -23,38 +23,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>UserChatColor</key> - <map> - <key>Comment</key> - <string>Color of your chat messages</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Color4</string> - <key>Value</key> - <array> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - </array> - </map> - <key>AgentChatColor</key> - <map> - <key>Comment</key> - <string>Color of chat messages from other residents</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Color4</string> - <key>Value</key> - <array> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - </array> - </map> <key>AlertedUnsupportedHardware</key> <map> <key>Comment</key> @@ -594,22 +562,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>BackgroundChatColor</key> - <map> - <key>Comment</key> - <string>Color of chat bubble background</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Color4</string> - <key>Value</key> - <array> - <real>0.0</real> - <real>0.0</real> - <real>0.0</real> - <real>1.0</real> - </array> - </map> <key>BackgroundYieldTime</key> <map> <key>Comment</key> @@ -621,42 +573,21 @@ <key>Value</key> <integer>40</integer> </map> - <key>BackwardBtnRect</key> - <map> - <key>Comment</key> - <string /> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>45</integer> - <integer>29</integer> - <integer>66</integer> - <integer>4</integer> - </array> - </map> - <key>BasicHelpRect</key> + <key>BeaconAlwaysOn</key> <map> <key>Comment</key> - <string>Rectangle for help window</string> + <string>Beacons / highlighting always on</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>404</integer> - <integer>467</integer> - <integer>0</integer> - </array> + <integer>0</integer> </map> - <key>BeaconAlwaysOn</key> + <key>BottomPanelNew</key> <map> <key>Comment</key> - <string>Beacons / highlighting always on</string> + <string>Enable the new bottom panel</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -884,6 +815,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>BuildBtnEnabled</key> + <map> + <key>Comment</key> + <string /> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>BuildFeathering</key> <map> <key>Comment</key> @@ -1391,22 +1333,6 @@ <key>Value</key> <integer>1</integer> </map> - <key>ChatterboxRect</key> - <map> - <key>Comment</key> - <string>Rectangle for chatterbox window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>400</integer> - <integer>350</integer> - <integer>0</integer> - </array> - </map> <key>CheesyBeacon</key> <map> <key>Comment</key> @@ -1421,7 +1347,7 @@ <key>ClientSettingsFile</key> <map> <key>Comment</key> - <string>Persisted client settings file name (per install).</string> + <string>Client settings file name (per install).</string> <key>Persist</key> <integer>0</integer> <key>Type</key> @@ -1497,777 +1423,612 @@ <string /> </array> </map> - <key>ColorPaletteEntry01</key> + <key>CompressSnapshotsToDisk</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Compress snapshots saved to disk (Using JPEG 2000)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.0</real> - <real>0.0</real> - <real>0.0</real> - <real>1.0</real> - </array> - </map> - <key>ColorPaletteEntry02</key> + <integer>0</integer> + </map> + <key>ConnectAsGod</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Log in a god if you have god access.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.5</real> - <real>0.5</real> - <real>0.5</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>ColorPaletteEntry03</key> + <key>ConnectionPort</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Custom connection port number</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>U32</string> <key>Value</key> - <array> - <real>0.5</real> - <real>0.0</real> - <real>0.0</real> - <real>1.0</real> - </array> + <integer>13000</integer> </map> - <key>ColorPaletteEntry04</key> + <key>ConnectionPortEnabled</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Use the custom connection port?</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.5</real> - <real>0.5</real> - <real>0.0</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>ColorPaletteEntry05</key> + <key>ConsoleBackgroundOpacity</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Opacity of chat console (0.0 = completely transparent, 1.0 = completely opaque)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>F32</string> <key>Value</key> - <array> - <real>0.0</real> - <real>0.5</real> - <real>0.0</real> - <real>1.0</real> - </array> + <real>0.700</real> </map> - <key>ColorPaletteEntry06</key> + <key>ConsoleBufferSize</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Size of chat console history (lines of chat)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>0.0</real> - <real>0.5</real> - <real>0.5</real> - <real>1.0</real> - </array> + <integer>40</integer> </map> - <key>ColorPaletteEntry07</key> + <key>ConsoleMaxLines</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Max number of lines of chat text visible in console.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>0.0</real> - <real>0.0</real> - <real>0.5</real> - <real>1.0</real> - </array> + <integer>40</integer> </map> - <key>ColorPaletteEntry08</key> + <key>ContactsTornOff</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Show contacts window separately from Communicate window.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.5</real> - <real>0.0</real> - <real>0.5</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>ColorPaletteEntry09</key> + <key>CookiesEnabled</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Accept cookies from Web sites?</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.5</real> - <real>0.5</real> - <real>0.0</real> - <real>1.0</real> - </array> + <integer>1</integer> </map> - <key>ColorPaletteEntry10</key> + <key>CreateToolCopyCenters</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.0</real> - <real>0.25</real> - <real>0.25</real> - <real>1.0</real> - </array> + <integer>1</integer> </map> - <key>ColorPaletteEntry11</key> + <key>CreateToolCopyRotates</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.0</real> - <real>0.5</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>ColorPaletteEntry12</key> + <key>CreateToolCopySelection</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.0</real> - <real>0.25</real> - <real>0.5</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>ColorPaletteEntry13</key> + <key>CreateToolKeepSelected</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>After using create tool, keep the create tool active</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.5</real> - <real>0.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>ColorPaletteEntry14</key> + <key>Cursor3D</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Tread Joystick values as absolute positions (not deltas).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.5</real> - <real>0.25</real> - <real>0.0</real> - <real>1.0</real> - </array> + <integer>1</integer> </map> - <key>ColorPaletteEntry15</key> + <key>CustomServer</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Specifies IP address or hostname of grid to which you connect</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>String</string> <key>Value</key> - <array> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <string /> </map> - <key>ColorPaletteEntry16</key> + <key>DebugBeaconLineWidth</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Size of lines for Debug Beacons</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>1</integer> </map> - <key>ColorPaletteEntry17</key> + <key>DebugInventoryFilters</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Turn on debugging display for inventory filtering</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>ColorPaletteEntry18</key> + <key>DebugPermissions</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Log permissions for selected inventory items</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.75</real> - <real>0.75</real> - <real>0.75</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>ColorPaletteEntry19</key> + <key>DebugShowColor</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Show color under cursor</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>1.0</real> - <real>0.0</real> - <real>0.0</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>ColorPaletteEntry20</key> + <key>DebugShowRenderInfo</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Show depth buffer contents</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>1.0</real> - <real>1.0</real> - <real>0.0</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>ColorPaletteEntry21</key> + <key>DebugShowRenderMatrices</key> + <map> + <key>Comment</key> + <string>Display values of current view and projection matrices.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>DebugShowTime</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Show depth buffer contents</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.0</real> - <real>1.0</real> - <real>0.0</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>ColorPaletteEntry22</key> + <key>DebugStatModeFPS</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>0.0</real> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>-1</integer> </map> - <key>ColorPaletteEntry23</key> + <key>DebugStatModeBandwidth</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>0.0</real> - <real>0.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>-1</integer> </map> - <key>ColorPaletteEntry24</key> + <key>DebugStatModePacketLoss</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>1.0</real> - <real>0.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>-1</integer> </map> - <key>ColorPaletteEntry25</key> + <key>DebugStatMode</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>1.0</real> - <real>1.0</real> - <real>0.5</real> - <real>1.0</real> - </array> + <integer>-1</integer> </map> - <key>ColorPaletteEntry26</key> + <key>DebugStatModeKTrisDrawnFr</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>0.0</real> - <real>1.0</real> - <real>0.5</real> - <real>1.0</real> - </array> + <integer>-1</integer> </map> - <key>ColorPaletteEntry27</key> + <key>DebugStatModeKTrisDrawnSec</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>0.5</real> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>-1</integer> </map> - <key>ColorPaletteEntry28</key> + <key>DebugStatModeTotalObjs</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>0.5</real> - <real>0.5</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>-1</integer> </map> - <key>ColorPaletteEntry29</key> + <key>DebugStatModeNewObjs</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>1.0</real> - <real>0.0</real> - <real>0.5</real> - <real>1.0</real> - </array> + <integer>-1</integer> </map> - <key>ColorPaletteEntry30</key> + <key>DebugStatModeTextureCount</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>1.0</real> - <real>0.5</real> - <real>0.0</real> - <real>1.0</real> - </array> + <integer>-1</integer> </map> - <key>ColorPaletteEntry31</key> + <key>DebugStatModeRawCount</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>-1</integer> </map> - <key>ColorPaletteEntry32</key> + <key>DebugStatModeGLMem</key> <map> <key>Comment</key> - <string>Color picker palette entry</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>S32</string> <key>Value</key> - <array> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>-1</integer> </map> - <key>ColumnHeaderDropDownDelay</key> + <key>DebugStatModeFormattedMem</key> <map> <key>Comment</key> - <string>Time in seconds of mouse click before column header shows sort options list</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>0.300000011921</real> + <integer>-1</integer> </map> - <key>CompileOutputRect</key> + <key>DebugStatModeRawMem</key> <map> <key>Comment</key> - <string>Rectangle for script Recompile Everything output window</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>S32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>400</integer> - <integer>300</integer> - <integer>0</integer> - </array> + <integer>-1</integer> </map> - <key>ConnectAsGod</key> + <key>DebugStatModeBoundMem</key> <map> <key>Comment</key> - <string>Log in a god if you have god access.</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>-1</integer> </map> - <key>ConnectionPort</key> + <key>DebugStatModePacketsIn</key> <map> <key>Comment</key> - <string>Custom connection port number</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>U32</string> + <string>S32</string> <key>Value</key> - <integer>13000</integer> + <integer>-1</integer> </map> - <key>ConnectionPortEnabled</key> + <key>DebugStatModePacketsOut</key> <map> <key>Comment</key> - <string>Use the custom connection port?</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>-1</integer> </map> - <key>ConsoleBackgroundOpacity</key> + <key>DebugStatModeObjects</key> <map> <key>Comment</key> - <string>Opacity of chat console (0.0 = completely transparent, 1.0 = completely opaque)</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>0.700</real> + <integer>-1</integer> </map> - <key>ConsoleBufferSize</key> + <key>DebugStatModeTexture</key> <map> <key>Comment</key> - <string>Size of chat console history (lines of chat)</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>40</integer> + <integer>-1</integer> </map> - <key>ConsoleMaxLines</key> + <key>DebugStatModeAsset</key> <map> <key>Comment</key> - <string>Max number of lines of chat text visible in console.</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>40</integer> + <integer>-1</integer> </map> - <key>ContactsTornOff</key> + <key>DebugStatModeLayers</key> <map> <key>Comment</key> - <string>Show contacts window separately from Communicate window.</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>-1</integer> </map> - <key>CookiesEnabled</key> + <key>DebugStatModeActualIn</key> <map> <key>Comment</key> - <string>Accept cookies from Web sites?</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>-1</integer> </map> - <key>CreateToolCopyCenters</key> + <key>DebugStatModeActualOut</key> <map> <key>Comment</key> - <string /> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>-1</integer> </map> - <key>CreateToolCopyRotates</key> + <key>DebugStatModeVFSPendingOps</key> <map> <key>Comment</key> - <string /> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>-1</integer> </map> - <key>CreateToolCopySelection</key> + <key>DebugStatModeTimeDialation</key> <map> <key>Comment</key> - <string /> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>-1</integer> </map> - <key>CreateToolKeepSelected</key> + <key>DebugStatModeSimFPS</key> <map> <key>Comment</key> - <string>After using create tool, keep the create tool active</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>-1</integer> </map> - <key>Cursor3D</key> + <key>DebugStatModePhysicsFPS</key> <map> <key>Comment</key> - <string>Tread Joystick values as absolute positions (not deltas).</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>-1</integer> </map> - <key>CustomServer</key> + <key>DebugStatModePinnedObjects</key> <map> <key>Comment</key> - <string>Specifies IP address or hostname of grid to which you connect</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string /> + <integer>-1</integer> </map> - <key>DebugBeaconLineWidth</key> + <key>DebugStatModeLowLODObjects</key> <map> <key>Comment</key> - <string>Size of lines for Debug Beacons</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>-1</integer> </map> - <key>DebugInventoryFilters</key> + <key>DebugStatModeMemoryAllocated</key> <map> <key>Comment</key> - <string>Turn on debugging display for inventory filtering</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>-1</integer> </map> - <key>DebugPermissions</key> + <key>DebugStatModeAgentUpdatesSec</key> <map> <key>Comment</key> - <string>Log permissions for selected inventory items</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>-1</integer> </map> - <key>DebugShowColor</key> + <key>DebugStatModeMainAgents</key> <map> <key>Comment</key> - <string>Show color under cursor</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>-1</integer> </map> - <key>DebugShowRenderInfo</key> + <key>DebugStatModeChildAgents</key> <map> <key>Comment</key> - <string>Show depth buffer contents</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>-1</integer> </map> - <key>DebugShowRenderMatrices</key> - <map> - <key>Comment</key> - <string>Display values of current view and projection matrices.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>DebugShowTime</key> + <key>DebugStatModeSimObjects</key> <map> <key>Comment</key> - <string>Show depth buffer contents</string> + <string>Mode of stat in Statistics floater</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>-1</integer> </map> - <key>DebugStatModeFPS</key> + <key>DebugStatModeSimActiveObjects</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2278,7 +2039,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeBandwidth</key> + <key>DebugStatModeSimActiveScripts</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2289,7 +2050,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModePacketLoss</key> + <key>DebugStatModeSimScriptEvents</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2300,7 +2061,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatMode</key> + <key>DebugStatModeSimInPPS</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2311,7 +2072,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeKTrisDrawnFr</key> + <key>DebugStatModeSimOutPPS</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2322,7 +2083,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeKTrisDrawnSec</key> + <key>DebugStatModeSimPendingDownloads</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2333,7 +2094,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeTotalObjs</key> + <key>SimPendingUploads</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2344,7 +2105,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeNewObjs</key> + <key>DebugStatModeSimTotalUnackedBytes</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2355,7 +2116,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeTextureCount</key> + <key>DebugStatModeSimFrameMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2366,7 +2127,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeRawCount</key> + <key>DebugStatModeSimNetMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2377,7 +2138,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeGLMem</key> + <key>DebugStatModeSimSimPhysicsMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2388,7 +2149,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeFormattedMem</key> + <key>DebugStatModeSimSimOtherMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2399,7 +2160,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeRawMem</key> + <key>DebugStatModeSimAgentMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2410,7 +2171,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeBoundMem</key> + <key>DebugStatModeSimImagesMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2421,7 +2182,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModePacketsIn</key> + <key>DebugStatModeSimScriptMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2432,7 +2193,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModePacketsOut</key> + <key>DebugStatModeSimSpareMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2443,7 +2204,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeObjects</key> + <key>DebugStatModeSimSimPhysicsStepMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2454,7 +2215,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeTexture</key> + <key>DebugStatModeSimSimPhysicsShapeUpdateMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2465,7 +2226,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeAsset</key> + <key>DebugStatModeSimSimPhysicsOtherMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2476,7 +2237,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeLayers</key> + <key>DebugStatModeSimSleepMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2487,7 +2248,7 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeActualIn</key> + <key>DebugStatModeSimPumpIOMsec</key> <map> <key>Comment</key> <string>Mode of stat in Statistics floater</string> @@ -2498,373 +2259,384 @@ <key>Value</key> <integer>-1</integer> </map> - <key>DebugStatModeActualOut</key> + <key>DebugViews</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Display debugging info for views.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>0</integer> </map> - <key>DebugStatModeVFSPendingOps</key> + <key>DebugWindowProc</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Log windows messages</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>0</integer> </map> - <key>DebugStatModeTimeDialation</key> + <key>DefaultObjectTexture</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Texture used as 'Default' in texture picker. (UUID texture reference)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>String</string> <key>Value</key> - <integer>-1</integer> + <string>89556747-24cb-43ed-920b-47caed15465f</string> </map> - <key>DebugStatModeSimFPS</key> + <key>DisableCameraConstraints</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Disable the normal bounds put on the camera by avatar position</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>0</integer> </map> - <key>DebugStatModePhysicsFPS</key> + <key>DisableRendering</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Disable GL rendering and GUI (load testing)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>0</integer> </map> - <key>DebugStatModePinnedObjects</key> + <key>DisableVerticalSync</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Update frames as fast as possible (FALSE = update frames between display scans)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>1</integer> </map> - <key>DebugStatModeLowLODObjects</key> + <key>DisplayAvatarAgentTarget</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Show avatar positioning locators (animation debug)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>0</integer> </map> - <key>DebugStatModeMemoryAllocated</key> + <key>DisplayChat</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Display Latest Chat message on LCD</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>1</integer> </map> - <key>DebugStatModeAgentUpdatesSec</key> + <key>DisplayDebug</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Display Network Information on LCD</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>1</integer> </map> - <key>DebugStatModeMainAgents</key> + <key>DisplayDebugConsole</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Display Console Debug Information on LCD</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>1</integer> </map> - <key>DebugStatModeChildAgents</key> + <key>DisplayIM</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Display Latest IM message on LCD</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>1</integer> </map> - <key>DebugStatModeSimObjects</key> + <key>DisplayLinden</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Display Account Information on LCD</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>1</integer> </map> - <key>DebugStatModeSimActiveObjects</key> + <key>DisplayRegion</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Display Location information on LCD</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>1</integer> </map> - <key>DebugStatModeSimActiveScripts</key> + <key>DisplayTimecode</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Display timecode on screen</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>0</integer> </map> - <key>DebugStatModeSimScriptEvents</key> + <key>Disregard128DefaultDrawDistance</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Whether to use the auto default to 128 draw distance</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>1</integer> </map> - <key>DebugStatModeSimInPPS</key> + <key>Disregard96DefaultDrawDistance</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Whether to use the auto default to 96 draw distance</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>1</integer> </map> - <key>DebugStatModeSimOutPPS</key> + <key>DoubleClickAutoPilot</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Enable double-click auto pilot</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>0</integer> </map> - <key>DebugStatModeSimPendingDownloads</key> + <key>DragAndDropToolTipDelay</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Seconds before displaying tooltip when performing drag and drop operation</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>-1</integer> + <real>0.10000000149</real> </map> - <key>SimPendingUploads</key> + <key>DropShadowButton</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Drop shadow width for buttons (pixels)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>-1</integer> + <integer>2</integer> </map> - <key>DebugStatModeSimTotalUnackedBytes</key> + <key>DropShadowFloater</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Drop shadow width for floaters (pixels)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>-1</integer> + <integer>5</integer> </map> - <key>DebugStatModeSimFrameMsec</key> + <key>DropShadowSlider</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Drop shadow width for sliders (pixels)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>-1</integer> + <integer>3</integer> </map> - <key>DebugStatModeSimNetMsec</key> + <key>DropShadowTooltip</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Drop shadow width for tooltips (pixels)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>-1</integer> + <integer>4</integer> </map> - <key>DebugStatModeSimSimPhysicsMsec</key> + <key>DynamicCameraStrength</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Amount camera lags behind avatar motion (0 = none, 30 = avatar velocity)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>-1</integer> + <real>2.0</real> </map> - <key>DebugStatModeSimSimOtherMsec</key> + <key>EditCameraMovement</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>When entering build mode, camera moves up above avatar</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>0</integer> </map> - <key>DebugStatModeSimAgentMsec</key> + <key>EditLinkedParts</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Select individual parts of linked objects</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>0</integer> </map> - <key>DebugStatModeSimImagesMsec</key> + <key>EnableRippleWater</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Whether to use ripple water shader or not</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> - </map> - <key>DebugStatModeSimScriptMsec</key> - <map> - <key>Comment</key> - <string>Mode of stat in Statistics floater</string> - <key>Persist</key> <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>-1</integer> </map> - <key>DebugStatModeSimSpareMsec</key> + <key>EnableVoiceChat</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Enable talking to other residents with a microphone</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>1</integer> </map> - <key>DebugStatModeSimSimPhysicsStepMsec</key> + <key>EnergyFromTop</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>-1</integer> + <integer>20</integer> </map> - <key>DebugStatModeSimSimPhysicsShapeUpdateMsec</key> + <key>EnergyHeight</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>-1</integer> + <integer>40</integer> </map> - <key>DebugStatModeSimSimPhysicsOtherMsec</key> + <key>EnergyWidth</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>-1</integer> + <integer>175</integer> </map> - <key>DebugStatModeSimSleepMsec</key> + <key>EveryoneCopy</key> + <map> + <key>Comment</key> + <string>Everyone can copy the newly created objects</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>FPSLogFrequency</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Seconds between display of FPS in log (0 for never)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>-1</integer> + <real>60.0</real> </map> - <key>DebugStatModeSimPumpIOMsec</key> + <key>FPSLogFrequency</key> + <map> + <key>Comment</key> + <string>Seconds between display of FPS in log (0 for never)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>10.0</real> + </map> + <key>FilterItemsPerFrame</key> <map> <key>Comment</key> - <string>Mode of stat in Statistics floater</string> + <string>Maximum number of inventory items to match against search filter every frame (lower to increase framerate while searching, higher to improve search speed)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>-1</integer> + <integer>500</integer> </map> - <key>DebugViews</key> + <key>FindLandArea</key> <map> <key>Comment</key> - <string>Display debugging info for views.</string> + <string>Enables filtering of land search results by area</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -2872,54 +2644,54 @@ <key>Value</key> <integer>0</integer> </map> - <key>DebugWindowProc</key> + <key>FindLandPrice</key> <map> <key>Comment</key> - <string>Log windows messages</string> + <string>Enables filtering of land search results by price</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>DefaultObjectTexture</key> + <key>FindLandType</key> <map> <key>Comment</key> - <string>Texture used as 'Default' in texture picker. (UUID texture reference)</string> + <string>Controls which type of land you are searching for in Find Land interface ("All", "Auction", "For Sale")</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>89556747-24cb-43ed-920b-47caed15465f</string> + <string>All</string> </map> - <key>DisableCameraConstraints</key> + <key>FindPeopleOnline</key> <map> <key>Comment</key> - <string>Disable the normal bounds put on the camera by avatar position</string> + <string>Limits people search to only users who are logged on</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>DisableRendering</key> + <key>FindPlacesPictures</key> <map> <key>Comment</key> - <string>Disable GL rendering and GUI (load testing)</string> + <string>Display only results of find places that have pictures</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>DisableVerticalSync</key> + <key>FirstLoginThisInstall</key> <map> <key>Comment</key> - <string>Update frames as fast as possible (FALSE = update frames between display scans)</string> + <string>Specifies that you have not successfully logged in since you installed the latest update</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -2927,43 +2699,43 @@ <key>Value</key> <integer>1</integer> </map> - <key>DisplayAvatarAgentTarget</key> + <key>FirstName</key> <map> <key>Comment</key> - <string>Show avatar positioning locators (animation debug)</string> + <string>Login first name</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>0</integer> + <string /> </map> - <key>DisplayChat</key> + <key>FirstPersonAvatarVisible</key> <map> <key>Comment</key> - <string>Display Latest Chat message on LCD</string> + <string>Display avatar and attachments below neck while in mouselook</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>DisplayDebug</key> + <key>FirstPersonBtnState</key> <map> <key>Comment</key> - <string>Display Network Information on LCD</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>DisplayDebugConsole</key> + <key>FirstRunThisInstall</key> <map> <key>Comment</key> - <string>Display Console Debug Information on LCD</string> + <string>Specifies that you have not run the viewer since you installed the latest update</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -2971,32 +2743,32 @@ <key>Value</key> <integer>1</integer> </map> - <key>DisplayIM</key> + <key>FirstSelectedDisabledPopups</key> <map> <key>Comment</key> - <string>Display Latest IM message on LCD</string> + <string>Return false if there is not disabled popup selected in the list of floater preferences popups</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> - </map> - <key>DisplayLinden</key> + <integer>0</integer> + </map> + <key>FixedWeather</key> <map> <key>Comment</key> - <string>Display Account Information on LCD</string> + <string>Weather effects do not change over time</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>DisplayRegion</key> + <key>FloaterActiveSpeakersSortAscending</key> <map> <key>Comment</key> - <string>Display Location information on LCD</string> + <string>Whether to sort up or down</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -3004,131 +2776,137 @@ <key>Value</key> <integer>1</integer> </map> - <key>DisplayTimecode</key> + <key>FloaterActiveSpeakersSortColumn</key> <map> <key>Comment</key> - <string>Display timecode on screen</string> + <string>Column name to sort on</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>0</integer> + <string>speaking_status</string> </map> - <key>Disregard128DefaultDrawDistance</key> + <key>FloaterMapNorth</key> <map> <key>Comment</key> - <string>Whether to use the auto default to 128 draw distance</string> + <string>Floater Map North Label</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>N</string> </map> - <key>Disregard96DefaultDrawDistance</key> + <key>FloaterMapNorthEast</key> <map> <key>Comment</key> - <string>Whether to use the auto default to 96 draw distance</string> + <string>Floater Map North-East Label</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>NE</string> </map> - <key>DoubleClickAutoPilot</key> + <key>FloaterMapNorthWest</key> <map> <key>Comment</key> - <string>Enable double-click auto pilot</string> + <string>Floater Map North-West Label</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>0</integer> + <string>NW</string> </map> - <key>DragAndDropToolTipDelay</key> + <key>FloaterMapEast</key> <map> <key>Comment</key> - <string>Seconds before displaying tooltip when performing drag and drop operation</string> + <string>Floater Map East Label</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>String</string> <key>Value</key> - <real>0.10000000149</real> + <string>E</string> </map> - <key>DropShadowButton</key> + <key>FloaterMapWest</key> <map> <key>Comment</key> - <string>Drop shadow width for buttons (pixels)</string> + <string>Floater Map West Label</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>String</string> <key>Value</key> - <integer>2</integer> + <string>W</string> </map> - <key>DropShadowFloater</key> + <key>FloaterMapSouth</key> <map> <key>Comment</key> - <string>Drop shadow width for floaters (pixels)</string> + <string>Floater Map South Label</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>String</string> <key>Value</key> - <integer>5</integer> + <string>S</string> </map> - <key>DropShadowSlider</key> + <key>FloaterMapSouthEast</key> <map> <key>Comment</key> - <string>Drop shadow width for sliders (pixels)</string> + <string>Floater Map South-East Label</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>String</string> <key>Value</key> - <integer>3</integer> + <string>SE</string> </map> - <key>DropShadowTooltip</key> + <key>FloaterMapSouthWest</key> <map> <key>Comment</key> - <string>Drop shadow width for tooltips (pixels)</string> + <string>Floater Map South-West Label</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>String</string> <key>Value</key> - <integer>4</integer> + <string>SW</string> </map> - <key>DynamicCameraStrength</key> + + <key>FloaterStatisticsRect</key> <map> <key>Comment</key> - <string>Amount camera lags behind avatar motion (0 = none, 30 = avatar velocity)</string> + <string>Rectangle for chat history</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Rect</string> <key>Value</key> - <real>2.0</real> + <array> + <integer>0</integer> + <integer>400</integer> + <integer>250</integer> + <integer>0</integer> + </array> </map> - <key>EditCameraMovement</key> + <key>FlyBtnEnabled</key> <map> <key>Comment</key> - <string>When entering build mode, camera moves up above avatar</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>EditLinkedParts</key> + <key>FlyBtnState</key> <map> <key>Comment</key> - <string>Select individual parts of linked objects</string> + <string /> <key>Persist</key> <integer>0</integer> <key>Type</key> @@ -3136,1397 +2914,1152 @@ <key>Value</key> <integer>0</integer> </map> - <key>EffectColor</key> + <key>FlycamAbsolute</key> <map> <key>Comment</key> - <string>Particle effects color</string> + <string>Treat Flycam values as absolute positions (not deltas).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>EnableRippleWater</key> + <key>FlycamAxisDeadZone0</key> <map> <key>Comment</key> - <string>Whether to use ripple water shader or not</string> + <string>Flycam axis 0 dead zone.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>0.1</real> </map> - <key>EnableVoiceChat</key> + <key>FlycamAxisDeadZone1</key> <map> <key>Comment</key> - <string>Enable talking to other residents with a microphone</string> + <string>Flycam axis 1 dead zone.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>0.1</real> </map> - <key>EnergyFromTop</key> + <key>FlycamAxisDeadZone2</key> <map> <key>Comment</key> - <string /> + <string>Flycam axis 2 dead zone.</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>20</integer> + <real>0.1</real> </map> - <key>EnergyHeight</key> + <key>FlycamAxisDeadZone3</key> <map> <key>Comment</key> - <string /> + <string>Flycam axis 3 dead zone.</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>40</integer> + <real>0.1</real> </map> - <key>EnergyWidth</key> + <key>FlycamAxisDeadZone4</key> <map> <key>Comment</key> - <string /> + <string>Flycam axis 4 dead zone.</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>175</integer> - </map> - <key>EveryoneCopy</key> - <map> - <key>Comment</key> - <string>Everyone can copy the newly created objects</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> + <real>0.1</real> </map> - <key>FPSLogFrequency</key> + <key>FlycamAxisDeadZone5</key> <map> <key>Comment</key> - <string>Seconds between display of FPS in log (0 for never)</string> + <string>Flycam axis 5 dead zone.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>F32</string> <key>Value</key> - <real>60.0</real> + <real>0.1</real> </map> - <key>FPSLogFrequency</key> - <map> - <key>Comment</key> - <string>Seconds between display of FPS in log (0 for never)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>10.0</real> - </map> - <key>FilterItemsPerFrame</key> + <key>FlycamAxisDeadZone6</key> <map> <key>Comment</key> - <string>Maximum number of inventory items to match against search filter every frame (lower to increase framerate while searching, higher to improve search speed)</string> + <string>Flycam axis 6 dead zone.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>500</integer> + <real>0.1</real> </map> - <key>FindLandArea</key> + <key>FlycamAxisScale0</key> <map> <key>Comment</key> - <string>Enables filtering of land search results by area</string> + <string>Flycam axis 0 scaler.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>1.0</real> </map> - <key>FindLandPrice</key> + <key>FlycamAxisScale1</key> <map> <key>Comment</key> - <string>Enables filtering of land search results by price</string> + <string>Flycam axis 1 scaler.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>1.0</real> </map> - <key>FindLandType</key> + <key>FlycamAxisScale2</key> <map> <key>Comment</key> - <string>Controls which type of land you are searching for in Find Land interface ("All", "Auction", "For Sale")</string> + <string>Flycam axis 2 scaler.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>All</string> + <real>1.0</real> </map> - <key>FindPeopleOnline</key> + <key>FlycamAxisScale3</key> <map> <key>Comment</key> - <string>Limits people search to only users who are logged on</string> + <string>Flycam axis 3 scaler.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>1.0</real> </map> - <key>FindPlacesPictures</key> + <key>FlycamAxisScale4</key> <map> <key>Comment</key> - <string>Display only results of find places that have pictures</string> + <string>Flycam axis 4 scaler.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>1.0</real> </map> - <key>FirstLoginThisInstall</key> + <key>FlycamAxisScale5</key> <map> <key>Comment</key> - <string>Specifies that you have not successfully logged in since you installed the latest update</string> + <string>Flycam axis 5 scaler.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>1.0</real> </map> - <key>FirstName</key> + <key>FlycamAxisScale6</key> <map> <key>Comment</key> - <string>Login first name</string> + <string>Flycam axis 6 scaler.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string /> + <real>1.0</real> </map> - <key>FirstPersonAvatarVisible</key> + <key>FlycamFeathering</key> <map> <key>Comment</key> - <string>Display avatar and attachments below neck while in mouselook</string> + <string>Flycam feathering (less is softer)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>16.0</real> </map> - <key>FirstPersonBtnState</key> + <key>FlycamZoomDirect</key> <map> <key>Comment</key> - <string /> + <string>Map flycam zoom axis directly to camera zoom.</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>FirstRunThisInstall</key> + <key>FlyingAtExit</key> <map> <key>Comment</key> - <string>Specifies that you have not run the viewer since you installed the latest update</string> + <string>Was flying when last logged out, so fly when logging in</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>FixedWeather</key> + <key>FocusOffsetDefault</key> <map> <key>Comment</key> - <string>Weather effects do not change over time</string> + <string>Default focus point offset relative to avatar (x-axis is forward)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>Vector3</string> <key>Value</key> - <integer>0</integer> + <array> + <real>1.0</real> + <real>0.0</real> + <real>1.0</real> + </array> </map> - <key>FloaterAboutRect</key> + <key>FocusPosOnLogout</key> <map> <key>Comment</key> - <string>Rectangle for About window</string> + <string>Camera focus point when last logged out (global coordinates)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Vector3D</string> <key>Value</key> <array> - <integer>0</integer> - <integer>440</integer> - <integer>470</integer> - <integer>0</integer> + <real>0.0</real> + <real>0.0</real> + <real>0.0</real> </array> </map> - <key>FloaterActiveSpeakersRect</key> + <key>FolderAutoOpenDelay</key> <map> <key>Comment</key> - <string>Rectangle for active speakers window</string> + <string>Seconds before automatically expanding the folder under the mouse when performing inventory drag and drop</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>300</integer> - <integer>250</integer> - <integer>0</integer> - </array> + <real>0.75</real> </map> - <key>FloaterActiveSpeakersSortAscending</key> + <key>FolderLoadingMessageWaitTime</key> <map> <key>Comment</key> - <string>Whether to sort up or down</string> + <string>Seconds to wait before showing the LOADING... text in folder views</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>0.5</real> </map> - <key>FloaterActiveSpeakersSortColumn</key> + <key>FontMonospace</key> <map> <key>Comment</key> - <string>Column name to sort on</string> + <string>Name of monospace font that definitely exists (Truetype file name)</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>speaking_status</string> + <string>DejaVuSansMono.ttf</string> </map> - <key>FloaterAdvancedSkyRect</key> + <key>FontSansSerif</key> <map> <key>Comment</key> - <string>Rectangle for Advanced Sky Editor</string> + <string>Name of primary sans-serif font that definitely exists (Truetype file name)</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>Rect</string> + <string>String</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>220</integer> - <integer>700</integer> - <integer>0</integer> - </array> + <string>MtBkLfRg.ttf</string> </map> - <key>FloaterAdvancedWaterRect</key> + <key>FontSansSerifBundledFallback</key> <map> <key>Comment</key> - <string>Rectangle for Advanced Water Editor</string> + <string>Name of secondary sans-serif font that definitely exists (Truetype file name)</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>Rect</string> + <string>String</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>240</integer> - <integer>700</integer> - <integer>0</integer> - </array> + <string>DejaVuSansCondensed.ttf</string> </map> - <key>FloaterAudioVolumeRect</key> + <key>FontSansSerifBold</key> <map> <key>Comment</key> - <string>Rectangle for Audio Volume window</string> + <string>Name of bold font (Truetype file name)</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>Rect</string> + <string>String</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>440</integer> - <integer>470</integer> - <integer>0</integer> - </array> + <string>MtBdLfRg.ttf</string> </map> - <key>FloaterBeaconsRect</key> - <map> - <key>Comment</key> - <string>Rectangle for beacon and highlight controls</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>200</integer> - <integer>250</integer> - <integer>250</integer> - <integer>200</integer> - </array> - </map> - <key>FloaterBuildOptionsRect</key> + <key>FontSansSerifFallback</key> <map> <key>Comment</key> - <string>Rectangle for build options window.</string> + <string>Name of sans-serif font (Truetype file name)</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>Rect</string> + <string>String</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>0</integer> - <integer>0</integer> - <integer>0</integer> - </array> + <string /> </map> - <key>FloaterBumpRect</key> + <key>FontSansSerifFallbackScale</key> <map> <key>Comment</key> - <string>Rectangle for Bumps/Hits window</string> + <string>Scale of fallback font relative to huge font (fraction of huge font size)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>180</integer> - <integer>400</integer> - <integer>0</integer> - </array> + <real>1.0</real> </map> - <key>FloaterBuyContentsRect</key> + <key>FontScreenDPI</key> <map> <key>Comment</key> - <string>Rectangle for Buy Contents window</string> + <string>Font resolution, higher is bigger (pixels per inch)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>250</integer> - <integer>300</integer> - <integer>0</integer> - </array> + <real>96.0</real> </map> - <key>FloaterBuyRect</key> + <key>FontSizeHuge</key> <map> <key>Comment</key> - <string>Rectangle for buy window</string> + <string>Size of huge font (points, or 1/72 of an inch)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>250</integer> - <integer>300</integer> - <integer>0</integer> - </array> + <real>16.0</real> </map> - <key>FloaterCameraRect3</key> + <key>FontSizeLarge</key> <map> <key>Comment</key> - <string>Rectangle for camera control window</string> + <string>Size of large font (points, or 1/72 of an inch)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>64</integer> - <integer>176</integer> - <integer>0</integer> - </array> + <real>12.0</real> </map> - <key>FloaterChatRect</key> + <key>FontSizeMedium</key> <map> <key>Comment</key> - <string>Rectangle for chat history</string> + <string>Size of medium font (points, or 1/72 of an inch)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>172</integer> - <integer>500</integer> - <integer>0</integer> - </array> + <real>10.0</real> </map> - <key>FloaterClothingRect</key> + <key>FontSizeMonospace</key> <map> <key>Comment</key> - <string>Rectangle for clothing window</string> + <string>Size of monospaced font (points, or 1/72 of an inch)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>480</integer> - <integer>320</integer> - <integer>0</integer> - </array> + <real>8.1</real> </map> - <key>FloaterContactsRect</key> + <key>FontSizeSmall</key> <map> <key>Comment</key> - <string>Rectangle for chat history</string> + <string>Size of small font (points, or 1/72 of an inch)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>390</integer> - <integer>395</integer> - <integer>0</integer> - </array> + <real>9.0</real> </map> - <key>FloaterCustomizeAppearanceRect</key> + <key>ForceShowGrid</key> <map> <key>Comment</key> - <string>Rectangle for avatar customization window</string> + <string>Always show grid dropdown on login screen</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>540</integer> - <integer>494</integer> - <integer>0</integer> - </array> + <integer>0</integer> </map> - <key>FloaterDayCycleRect</key> + <key>ForceMandatoryUpdate</key> <map> <key>Comment</key> - <string>Rectangle for Day Cycle Editor</string> + <string>For QA: On next startup, forces the auto-updater to run</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>646</integer> - <integer>275</integer> - <integer>0</integer> - </array> + <integer>0</integer> </map> - <key>FloaterEnvRect</key> + <key>FreezeTime</key> <map> <key>Comment</key> - <string>Rectangle for Environment Editor</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>150</integer> - <integer>600</integer> - <integer>0</integer> - </array> + <integer>0</integer> </map> - <key>FloaterFindRect2</key> + <key>NotFullScreen</key> <map> <key>Comment</key> - <string>Rectangle for Find window</string> + <string>Run SL in non fullscreen mode</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>570</integer> - <integer>780</integer> - <integer>0</integer> - </array> + <integer>1</integer> </map> - <key>FloaterFriendsRect</key> + <key>FullScreenAspectRatio</key> <map> <key>Comment</key> - <string>Rectangle for friends window</string> + <string>Aspect ratio of fullscreen display (width / height)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>400</integer> - <integer>250</integer> - <integer>0</integer> - </array> + <real>1.33329999447</real> </map> - <key>FloaterGestureRect2</key> + <key>FullScreenAutoDetectAspectRatio</key> <map> <key>Comment</key> - <string>Rectangle for gestures window</string> + <string>Automatically detect proper aspect ratio for fullscreen display</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>465</integer> - <integer>350</integer> - <integer>0</integer> - </array> + <integer>1</integer> </map> - <key>FloaterHUDRect2</key> + <key>FullScreenHeight</key> <map> <key>Comment</key> - <string>Rectangle for HUD Floater window</string> + <string>Fullscreen resolution in height</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>S32</string> <key>Value</key> -<!-- NOTE: Height and width must match values in settings.xml for - FloaterHUDRect because this floater is resized to those values - in LLViewerWindow initialization. JC --> - <array> - <integer>0</integer> - <integer>292</integer> - <integer>362</integer> - <integer>0</integer> - </array> + <integer>768</integer> </map> - <key>FloaterHtmlRect</key> + <key>FullScreenWidth</key> <map> <key>Comment</key> - <string>Rectangle for HTML window</string> + <string>Fullscreen resolution in width</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>S32</string> <key>Value</key> - <array> - <integer>100</integer> - <integer>460</integer> - <integer>370</integer> - <integer>100</integer> - </array> + <integer>1024</integer> </map> - <key>FloaterIMRect</key> + <key>GridCrossSections</key> <map> <key>Comment</key> - <string>Rectangle for IM window</string> + <string>Highlight cross sections of prims with grid manipulation plane.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>160</integer> - <integer>500</integer> - <integer>0</integer> - </array> + <integer>0</integer> </map> - <key>FloaterInspectRect</key> + <key>GridDrawSize</key> <map> <key>Comment</key> - <string>Rectangle for Object Inspect window</string> + <string>Visible extent of 2D snap grid (meters)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>400</integer> - <integer>400</integer> - <integer>0</integer> - </array> + <real>12.0</real> </map> - <key>FloaterInventoryRect</key> + <key>GridMode</key> <map> <key>Comment</key> - <string>Rectangle for inventory window</string> + <string>Snap grid reference frame (0 = world, 1 = local, 2 = reference object)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>S32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>400</integer> - <integer>300</integer> - <integer>0</integer> - </array> + <integer>0</integer> </map> - <key>FloaterJoystickRect</key> + <key>GridOpacity</key> <map> <key>Comment</key> - <string>Rectangle for joystick controls window.</string> + <string>Grid line opacity (0.0 = completely transparent, 1.0 = completely opaque)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>0</integer> - <integer>0</integer> - <integer>0</integer> - </array> + <real>0.699999988079</real> </map> - <key>FloaterLagMeter</key> + <key>GridResolution</key> <map> <key>Comment</key> - <string>Rectangle for lag meter</string> + <string>Size of single grid step (meters)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>142</integer> - <integer>350</integer> - <integer>0</integer> - </array> + <real>0.5</real> </map> - <key>FloaterLandRect5</key> + <key>GridSubUnit</key> <map> <key>Comment</key> - <string>Rectangle for About Land window</string> + <string>Display fractional grid steps, relative to grid size</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>370</integer> - <integer>460</integer> - <integer>0</integer> - </array> + <integer>0</integer> </map> - <key>FloaterLandmarkRect</key> + <key>GridSubdivision</key> <map> <key>Comment</key> - <string>Rectangle for landmark picker</string> + <string>Maximum number of times to divide single snap grid unit when GridSubUnit is true</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>S32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>290</integer> - <integer>310</integer> - <integer>0</integer> - </array> + <integer>32</integer> </map> - <key>FloaterMediaRect</key> + <key>GroupNotifyBoxHeight</key> <map> <key>Comment</key> - <string>Rectangle for media browser window</string> + <string>Height of group notice messages</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>S32</string> <key>Value</key> - <array> - <integer>16</integer> - <integer>650</integer> - <integer>600</integer> - <integer>128</integer> - </array> + <integer>260</integer> </map> - <key>FloaterMiniMapRect</key> + <key>GroupNotifyBoxWidth</key> <map> <key>Comment</key> - <string>Rectangle for world map</string> + <string>Width of group notice messages</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>S32</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>225</integer> - <integer>200</integer> - <integer>0</integer> - </array> - </map> - <key>FloaterMoveRect2</key> + <integer>400</integer> + </map> + <key>HelpHomeURL</key> <map> <key>Comment</key> - <string>Rectangle for avatar control window</string> + <string>URL of initial help page</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>String</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>58</integer> - <integer>135</integer> - <integer>0</integer> - </array> + <string>help/index.html</string> </map> - <key>FloaterMuteRect3</key> + <key>HelpLastVisitedURL</key> <map> <key>Comment</key> - <string>Rectangle for mute window</string> + <string>URL of last help page, will be shown next time help is accessed</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>String</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>300</integer> - <integer>300</integer> - <integer>0</integer> - </array> + <string>help/index.html</string> </map> - - <key>FloaterObjectIMInfo</key> - <map> - <key>Comment</key> - <string>Rectangle for floater object im info windows</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>300</integer> - <integer>300</integer> - <integer>0</integer> - </array> - </map> - <key>FloaterOpenObjectRect</key> + <key>HighResSnapshot</key> <map> <key>Comment</key> - <string>Rectangle for Open Object window</string> + <string>Double resolution of snapshot from current window resolution</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>350</integer> - <integer>300</integer> - <integer>0</integer> - </array> + <integer>0</integer> </map> - <key>FloaterPayRectB</key> + <key>HtmlHelpLastPage</key> <map> <key>Comment</key> - <string>Rectangle for pay window</string> + <string>Last URL visited via help system</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>String</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>150</integer> - <integer>400</integer> - <integer>0</integer> - </array> + <string /> </map> - <key>FloaterPermPrefsRect</key> + <key>IMInChatConsole</key> <map> <key>Comment</key> - <string>Rectangle for initial permissions preferences</string> + <string>Copy IM into chat console</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>200</integer> - <integer>250</integer> - <integer>250</integer> - <integer>200</integer> - </array> + <integer>1</integer> </map> - <key>FloaterRegionInfo</key> + <key>IMInChatHistory</key> <map> <key>Comment</key> - <string>Rectangle for region info window</string> + <string>Copy IM into chat history</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>512</integer> - <integer>480</integer> - <integer>0</integer> - </array> + <integer>0</integer> </map> - <key>FloaterScriptDebugRect</key> + <key>IMShowTimestamps</key> <map> <key>Comment</key> - <string>Rectangle for Script Error/Debug window</string> + <string>Show timestamps in IM</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>130</integer> - <integer>450</integer> - <integer>0</integer> - </array> + <integer>1</integer> </map> - <key>FloaterSnapshotRect</key> + <key>IgnorePixelDepth</key> <map> <key>Comment</key> - <string>Rectangle for snapshot window</string> + <string>Ignore pixel depth settings.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>200</integer> - <integer>200</integer> - <integer>400</integer> - </array> + <integer>0</integer> </map> - <key>FloaterStatisticsRect</key> + <key>ImagePipelineUseHTTP</key> <map> <key>Comment</key> - <string>Rectangle for chat history</string> + <string>If TRUE use HTTP GET to fetch textures from the server</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>400</integer> - <integer>250</integer> - <integer>0</integer> - </array> + <integer>0</integer> </map> - <key>FloaterViewBottom</key> + <key>InBandwidth</key> <map> <key>Comment</key> - <string>[DO NOT MODIFY] Controls layout of floating windows within SL window</string> + <string>Incoming bandwidth throttle (bps)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>-1</integer> + <real>0.0</real> </map> - <key>FloaterWorldMapRect2</key> + <key>InstallLanguage</key> <map> <key>Comment</key> - <string>Rectangle for world map window</string> + <string>Language passed from installer (for UI)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>String</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>0</integer> - <integer>0</integer> - <integer>0</integer> - </array> + <string>default</string> </map> - <key>FlyBtnState</key> + <key>InventoryAutoOpenDelay</key> <map> <key>Comment</key> - <string /> + <string>Seconds before automatically opening inventory when mouse is over inventory button when performing inventory drag and drop</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>1.0</real> </map> - <key>FlycamAbsolute</key> + <key>InventorySortOrder</key> <map> <key>Comment</key> - <string>Treat Flycam values as absolute positions (not deltas).</string> + <string>Specifies sort key for inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>U32</string> <key>Value</key> - <integer>0</integer> + <integer>7</integer> </map> - <key>FlycamAxisDeadZone0</key> + <key>InvertMouse</key> <map> <key>Comment</key> - <string>Flycam axis 0 dead zone.</string> + <string>When in mouselook, moving mouse up looks down and vice verse (FALSE = moving up looks up)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>0.1</real> + <integer>0</integer> </map> - <key>FlycamAxisDeadZone1</key> + <key>JoystickAvatarEnabled</key> <map> <key>Comment</key> - <string>Flycam axis 1 dead zone.</string> + <string>Enables the Joystick to control Avatar movement.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>0.1</real> + <integer>1</integer> </map> - <key>FlycamAxisDeadZone2</key> + <key>JoystickAxis0</key> <map> <key>Comment</key> - <string>Flycam axis 2 dead zone.</string> + <string>Flycam hardware axis mapping for internal axis 0 ([0, 5]).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>0.1</real> + <integer>1</integer> </map> - <key>FlycamAxisDeadZone3</key> + <key>JoystickAxis1</key> <map> <key>Comment</key> - <string>Flycam axis 3 dead zone.</string> + <string>Flycam hardware axis mapping for internal axis 1 ([0, 5]).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>0.1</real> + <integer>0</integer> </map> - <key>FlycamAxisDeadZone4</key> + <key>JoystickAxis2</key> <map> <key>Comment</key> - <string>Flycam axis 4 dead zone.</string> + <string>Flycam hardware axis mapping for internal axis 2 ([0, 5]).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>0.1</real> + <integer>2</integer> </map> - <key>FlycamAxisDeadZone5</key> + <key>JoystickAxis3</key> <map> <key>Comment</key> - <string>Flycam axis 5 dead zone.</string> + <string>Flycam hardware axis mapping for internal axis 3 ([0, 5]).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>0.1</real> + <integer>4</integer> </map> - <key>FlycamAxisDeadZone6</key> + <key>JoystickAxis4</key> <map> <key>Comment</key> - <string>Flycam axis 6 dead zone.</string> + <string>Flycam hardware axis mapping for internal axis 4 ([0, 5]).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>0.1</real> + <integer>3</integer> </map> - <key>FlycamAxisScale0</key> + <key>JoystickAxis5</key> <map> <key>Comment</key> - <string>Flycam axis 0 scaler.</string> + <string>Flycam hardware axis mapping for internal axis 5 ([0, 5]).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>1.0</real> + <integer>5</integer> </map> - <key>FlycamAxisScale1</key> + <key>JoystickAxis6</key> <map> <key>Comment</key> - <string>Flycam axis 1 scaler.</string> + <string>Flycam hardware axis mapping for internal axis 6 ([0, 5]).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>1.0</real> + <integer>-1</integer> </map> - <key>FlycamAxisScale2</key> + <key>JoystickBuildEnabled</key> <map> <key>Comment</key> - <string>Flycam axis 2 scaler.</string> + <string>Enables the Joystick to move edited objects.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>1.0</real> + <integer>0</integer> </map> - <key>FlycamAxisScale3</key> + <key>JoystickEnabled</key> <map> <key>Comment</key> - <string>Flycam axis 3 scaler.</string> + <string>Enables Joystick Input.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>1.0</real> + <integer>0</integer> </map> - <key>FlycamAxisScale4</key> + <key>JoystickFlycamEnabled</key> <map> <key>Comment</key> - <string>Flycam axis 4 scaler.</string> + <string>Enables the Joystick to control the flycam.</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>1.0</real> + <integer>1</integer> </map> - <key>FlycamAxisScale5</key> + <key>JoystickInitialized</key> <map> <key>Comment</key> - <string>Flycam axis 5 scaler.</string> + <string>Whether or not a joystick has been detected and initiailized.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>String</string> <key>Value</key> - <real>1.0</real> + <string /> </map> - <key>FlycamAxisScale6</key> + <key>JoystickRunThreshold</key> <map> <key>Comment</key> - <string>Flycam axis 6 scaler.</string> + <string>Input threshold to initiate running</string> <key>Persist</key> - <integer>1</integer> + <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>F32</string> <key>Value</key> - <real>1.0</real> - </map> - <key>FlycamFeathering</key> + <real>0.25</real> + </map> + <key>KeepAspectForSnapshot</key> <map> <key>Comment</key> - <string>Flycam feathering (less is softer)</string> + <string>Use full window when taking snapshot, regardless of requested image size</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>16.0</real> + <integer>1</integer> </map> - <key>FlycamZoomDirect</key> + <key>LandBrushSize</key> <map> <key>Comment</key> - <string>Map flycam zoom axis directly to camera zoom.</string> + <string>Size of affected region when using teraform tool</string> <key>Persist</key> - <integer>1</integer> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>2.0</real> </map> - <key>FlyingAtExit</key> + <key>LCDDestination</key> <map> <key>Comment</key> - <string>Was flying when last logged out, so fly when logging in</string> + <string>Which LCD to use</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> <integer>0</integer> </map> - <key>FocusOffsetDefault</key> + <key>LSLFindCaseInsensitivity</key> + <map> + <key>Comment</key> + <string>Use case insensitivity when searching in LSL editor</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>LSLHelpURL</key> <map> <key>Comment</key> - <string>Default focus point offset relative to avatar (x-axis is forward)</string> + <string>URL that points to LSL help files, with [LSL_STRING] corresponding to the referenced LSL function or keyword</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Vector3</string> + <string>String</string> <key>Value</key> - <array> - <real>1.0</real> - <real>0.0</real> - <real>1.0</real> - </array> + <string>http://wiki.secondlife.com/wiki/[LSL_STRING]</string> </map> - <key>FocusPosOnLogout</key> + <key>LagMeterShrunk</key> <map> <key>Comment</key> - <string>Camera focus point when last logged out (global coordinates)</string> + <string>Last large/small state for lag meter</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Vector3D</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.0</real> - <real>0.0</real> - <real>0.0</real> - </array> + <integer>0</integer> </map> - <key>FolderAutoOpenDelay</key> + <key>Language</key> <map> <key>Comment</key> - <string>Seconds before automatically expanding the folder under the mouse when performing inventory drag and drop</string> + <string>Language specifier (for UI)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>String</string> <key>Value</key> - <real>0.75</real> + <string>default</string> </map> - <key>FolderLoadingMessageWaitTime</key> + <key>LanguageIsPublic</key> + <map> + <key>Comment</key> + <string>Let other residents see our language information</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>LastFeatureVersion</key> <map> <key>Comment</key> - <string>Seconds to wait before showing the LOADING... text in folder views</string> + <string>[DO NOT MODIFY] Version number for tracking hardware changes</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>0.5</real> + <integer>0</integer> </map> - <key>FontMonospace</key> + <key>LastFindPanel</key> <map> <key>Comment</key> - <string>Name of monospace font that definitely exists (Truetype file name)</string> + <string>Controls which find operation appears by default when clicking "Find" button </string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>DejaVuSansMono.ttf</string> + <string>find_all_panel</string> </map> - <key>FontSansSerif</key> + <key>LastName</key> <map> <key>Comment</key> - <string>Name of primary sans-serif font that definitely exists (Truetype file name)</string> + <string>Login last name</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>MtBkLfRg.ttf</string> + <string /> </map> - <key>FontSansSerifBundledFallback</key> + <key>LastPrefTab</key> <map> <key>Comment</key> - <string>Name of secondary sans-serif font that definitely exists (Truetype file name)</string> + <string>Last selected tab in preferences window</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>DejaVuSansCondensed.ttf</string> + <integer>0</integer> </map> - <key>FontSansSerifBold</key> + <key>LastRunVersion</key> <map> <key>Comment</key> - <string>Name of bold font (Truetype file name)</string> + <string>Version number of last instance of the viewer that you ran</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>MtBdLfRg.ttf</string> + <string>0.0.0</string> </map> - <key>FontSansSerifFallback</key> + + <key>LastSnapshotToEmailHeight</key> <map> <key>Comment</key> - <string>Name of sans-serif font (Truetype file name)</string> + <string>The height of the last email snapshot, in px</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string /> + <integer>768</integer> </map> - <key>FontSansSerifFallbackScale</key> + <key>LastSnapshotToEmailWidth</key> <map> <key>Comment</key> - <string>Scale of fallback font relative to huge font (fraction of huge font size)</string> + <string>The width of the last email snapshot, in px</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>1.0</real> + <integer>1024</integer> </map> - <key>FontScreenDPI</key> + <key>LastSnapshotToDiskHeight</key> <map> <key>Comment</key> - <string>Font resolution, higher is bigger (pixels per inch)</string> + <string>The height of the last disk snapshot, in px</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>96.0</real> + <integer>768</integer> </map> - <key>FontSizeHuge</key> + <key>LastSnapshotToDiskWidth</key> <map> <key>Comment</key> - <string>Size of huge font (points, or 1/72 of an inch)</string> + <string>The width of the last disk snapshot, in px</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>16.0</real> + <integer>1024</integer> </map> - <key>FontSizeLarge</key> + <key>LastSnapshotToInventoryHeight</key> <map> <key>Comment</key> - <string>Size of large font (points, or 1/72 of an inch)</string> + <string>The height of the last texture snapshot, in px</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>12.0</real> + <integer>512</integer> </map> - <key>FontSizeMedium</key> + <key>LastSnapshotToInventoryWidth</key> <map> <key>Comment</key> - <string>Size of medium font (points, or 1/72 of an inch)</string> + <string>The width of the last texture snapshot, in px</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>10.0</real> + <integer>512</integer> </map> - <key>FontSizeMonospace</key> + <key>LastSnapshotType</key> <map> <key>Comment</key> - <string>Size of monospaced font (points, or 1/72 of an inch)</string> + <string>Select this as next type of snapshot to take (0 = postcard, 1 = texture, 2 = local image)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>8.1</real> + <integer>0</integer> </map> - <key>FontSizeSmall</key> + <key>LeftClickShowMenu</key> <map> <key>Comment</key> - <string>Size of small font (points, or 1/72 of an inch)</string> + <string>Left click opens pie menu (FALSE = left click touches or grabs object)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>9.0</real> + <integer>0</integer> </map> - <key>ForceShowGrid</key> + <key>LimitDragDistance</key> <map> <key>Comment</key> - <string>Always show grid dropdown on login screen</string> + <string>Limit translation of object via translate tool</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ForceMandatoryUpdate</key> + <key>LimitSelectDistance</key> <map> <key>Comment</key> - <string>For QA: On next startup, forces the auto-updater to run</string> + <string>Disallow selection of objects beyond max select distance</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ForwardBtnRect</key> + <key>LipSyncAah</key> <map> <key>Comment</key> - <string /> + <string>Aah (jaw opening) babble loop</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>String</string> <key>Value</key> - <array> - <integer>45</integer> - <integer>54</integer> - <integer>66</integer> - <integer>29</integer> - </array> + <string>257998776531013446642343</string> </map> - <key>FreezeTime</key> + <key>LipSyncAahPowerTransfer</key> <map> <key>Comment</key> - <string /> + <string>Transfer curve for Voice Interface power to aah lip sync amplitude</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>0</integer> + <string>0000123456789</string> </map> - <key>FullScreen</key> + <key>LipSyncEnabled</key> <map> <key>Comment</key> - <string>Run SL in fullscreen mode</string> + <string>0 disable lip-sync, 1 enable babble loop</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -4534,54 +4067,54 @@ <key>Value</key> <integer>0</integer> </map> - <key>FullScreenAspectRatio</key> + <key>LipSyncOoh</key> <map> <key>Comment</key> - <string>Aspect ratio of fullscreen display (width / height)</string> + <string>Ooh (mouth width) babble loop</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>String</string> <key>Value</key> - <real>1.33329999447</real> + <string>1247898743223344444443200000</string> </map> - <key>FullScreenAutoDetectAspectRatio</key> + <key>LipSyncOohAahRate</key> <map> <key>Comment</key> - <string>Automatically detect proper aspect ratio for fullscreen display</string> + <string>Rate to babble Ooh and Aah (/sec)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>24.0</real> </map> - <key>FullScreenHeight</key> + <key>LipSyncOohPowerTransfer</key> <map> <key>Comment</key> - <string>Fullscreen resolution in height</string> + <string>Transfer curve for Voice Interface power to ooh lip sync amplitude</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>String</string> <key>Value</key> - <integer>768</integer> + <string>0012345566778899</string> </map> - <key>FullScreenWidth</key> + <key>LocalCacheVersion</key> <map> <key>Comment</key> - <string>Fullscreen resolution in width</string> + <string>Version number of cache</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>1024</integer> + <integer>0</integer> </map> - <key>GridCrossSections</key> + <key>LogMessages</key> <map> <key>Comment</key> - <string>Highlight cross sections of prims with grid manipulation plane.</string> + <string>Log network traffic</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -4589,54 +4122,43 @@ <key>Value</key> <integer>0</integer> </map> - <key>GridDrawSize</key> + <key>LoginAsGod</key> <map> <key>Comment</key> - <string>Visible extent of 2D snap grid (meters)</string> + <string>Attempt to login with god powers (Linden accounts only)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>12.0</real> - </map> - <key>GridMode</key> - <map> - <key>Comment</key> - <string>Snap grid reference frame (0 = world, 1 = local, 2 = reference object)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>GridOpacity</key> + <key>LoginLocation</key> <map> <key>Comment</key> - <string>Grid line opacity (0.0 = completely transparent, 1.0 = completely opaque)</string> + <string>Login at same location you last logged out</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>String</string> <key>Value</key> - <real>0.699999988079</real> + <string>last</string> </map> - <key>GridResolution</key> + <key>LoginPage</key> <map> <key>Comment</key> - <string>Size of single grid step (meters)</string> + <string>Login authentication page.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>String</string> <key>Value</key> - <real>0.5</real> + <string /> </map> - <key>GridSubUnit</key> + <key>LosslessJ2CUpload</key> <map> <key>Comment</key> - <string>Display fractional grid steps, relative to grid size</string> + <string>Use lossless compression for small image uploads</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -4644,108 +4166,98 @@ <key>Value</key> <integer>0</integer> </map> - <key>GridSubdivision</key> + <key>MainloopTimeoutDefault</key> <map> <key>Comment</key> - <string>Maximum number of times to divide single snap grid unit when GridSubUnit is true</string> + <string>Timeout duration for mainloop lock detection, in seconds.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>32</integer> + <real>20.0</real> </map> - <key>GroupNotifyBoxHeight</key> + <key>MapOverlayIndex</key> <map> <key>Comment</key> - <string>Height of group notice messages</string> + <string>Currently selected world map type</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>260</integer> + <integer>0</integer> </map> - <key>GroupNotifyBoxWidth</key> + <key>MapScale</key> <map> <key>Comment</key> - <string>Width of group notice messages</string> + <string>World map zoom level (pixels per region)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>400</integer> + <real>128.0</real> </map> - <key>HTMLLinkColor</key> + <key>MapShowEvents</key> <map> <key>Comment</key> - <string>Color of hyperlinks</string> + <string>Show events on world map</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.600000023842</real> - <real>0.600000023842</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>1</integer> </map> - <key>HelpHomeURL</key> + <key>MapShowInfohubs</key> <map> <key>Comment</key> - <string>URL of initial help page</string> + <string>Show infohubs on the world map</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>help/index.html</string> + <integer>1</integer> </map> - <key>HelpLastVisitedURL</key> + <key>MapShowLandForSale</key> <map> <key>Comment</key> - <string>URL of last help page, will be shown next time help is accessed</string> + <string>Show land for sale on world map</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>help/index.html</string> + <integer>0</integer> </map> - <key>HighResSnapshot</key> + <key>MapShowPeople</key> <map> <key>Comment</key> - <string>Double resolution of snapshot from current window resolution</string> + <string>Show other users on world map</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>HtmlFindRect</key> + <key>MapShowTelehubs</key> <map> <key>Comment</key> - <string>Rectangle for HTML find window</string> + <string>Show telehubs on world map</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>16</integer> - <integer>650</integer> - <integer>600</integer> - <integer>128</integer> - </array> + <integer>1</integer> </map> - <key>HtmlHelpLastPage</key> + <key>Marker</key> <map> <key>Comment</key> - <string>Last URL visited via help system</string> + <string>[NOT USED]</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -4753,80 +4265,65 @@ <key>Value</key> <string /> </map> - <key>HtmlHelpRect</key> + <key>MaxDragDistance</key> <map> <key>Comment</key> - <string>Rectangle for HTML help window</string> + <string>Maximum allowed translation distance in a single operation of translate tool (meters from start point)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>16</integer> - <integer>650</integer> - <integer>600</integer> - <integer>128</integer> - </array> + <real>48.0</real> </map> - <key>HtmlReleaseMessage</key> + <key>MaxSelectDistance</key> <map> <key>Comment</key> - <string>Rectangle for HTML Release Message Floater window</string> + <string>Maximum allowed selection distance (meters from avatar)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>F32</string> <key>Value</key> - <array> - <integer>46</integer> - <integer>520</integer> - <integer>400</integer> - <integer>128</integer> - </array> + <real>64.0</real> </map> - <key>IMChatColor</key> + <key>MeanCollisionBump</key> <map> <key>Comment</key> - <string>Color of instant messages from other residents</string> + <string>You have experienced an abuse of being bumped by an object or avatar</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>IMInChatConsole</key> + <key>MeanCollisionPhysical</key> <map> <key>Comment</key> - <string>Copy IM into background chat console</string> + <string>You have experienced an abuse from a physical object</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>IMShowTimestamps</key> + <key>MeanCollisionPushObject</key> <map> <key>Comment</key> - <string>Show timestamps in IM</string> + <string>You have experienced an abuse of being pushed by a scripted object</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>IgnorePixelDepth</key> + <key>MeanCollisionScripted</key> <map> <key>Comment</key> - <string>Ignore pixel depth settings.</string> + <string>You have experienced an abuse from a scripted object</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -4834,10 +4331,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>ImagePipelineUseHTTP</key> + <key>MeanCollisionSelected</key> <map> <key>Comment</key> - <string>If TRUE use HTTP GET to fetch textures from the server</string> + <string>You have experienced an abuse of being pushed via a selected object</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -4845,65 +4342,76 @@ <key>Value</key> <integer>0</integer> </map> - <key>InBandwidth</key> + <key>MemoryLogFrequency</key> + <map> + <key>Comment</key> + <string>Seconds between display of Memory in log (0 for never)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>600.0</real> + </map> + <key>MemProfiling</key> <map> <key>Comment</key> - <string>Incoming bandwidth throttle (bps)</string> + <string>You want to use tcmalloc's memory profiling options.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>0.0</real> - </map> - <key>InstallLanguage</key> + <integer>0</integer> + </map> + <key>MenuAccessKeyTime</key> <map> <key>Comment</key> - <string>Language passed from installer (for UI)</string> + <string>Time (seconds) in which the menu key must be tapped to move focus to the menu bar</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>default</string> + <real>0.25</real> </map> - <key>InventoryAutoOpenDelay</key> + <key>MenuBarHeight</key> <map> <key>Comment</key> - <string>Seconds before automatically opening inventory when mouse is over inventory button when performing inventory drag and drop</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>1.0</real> + <integer>18</integer> </map> - <key>InventorySortOrder</key> + <key>MenuBarWidth</key> <map> <key>Comment</key> - <string>Specifies sort key for inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>U32</string> + <string>S32</string> <key>Value</key> - <integer>7</integer> + <integer>410</integer> </map> - <key>InvertMouse</key> + <key>MigrateCacheDirectory</key> <map> <key>Comment</key> - <string>When in mouselook, moving mouse up looks down and vice verse (FALSE = moving up looks up)</string> + <string>Check for old version of disk cache to migrate to current location</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>JoystickAvatarEnabled</key> + <key>MiniMapRotate</key> <map> <key>Comment</key> - <string>Enables the Joystick to control Avatar movement.</string> + <string>Rotate miniature world map to avatar direction</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -4911,87 +4419,87 @@ <key>Value</key> <integer>1</integer> </map> - <key>JoystickAxis0</key> + <key>MiniMapScale</key> <map> <key>Comment</key> - <string>Flycam hardware axis mapping for internal axis 0 ([0, 5]).</string> + <string>Miniature world map zoom levle (pixels per region)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>128.0</real> </map> - <key>JoystickAxis1</key> + <key>MouseSensitivity</key> <map> <key>Comment</key> - <string>Flycam hardware axis mapping for internal axis 1 ([0, 5]).</string> + <string>Controls responsiveness of mouse when in mouselook mode (fraction or multiple of default mouse sensitivity)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>3.0</real> </map> - <key>JoystickAxis2</key> + <key>MouseSmooth</key> <map> <key>Comment</key> - <string>Flycam hardware axis mapping for internal axis 2 ([0, 5]).</string> + <string>Smooths out motion of mouse when in mouselook mode.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>2</integer> + <integer>0</integer> </map> - <key>JoystickAxis3</key> + <key>MouseSun</key> <map> <key>Comment</key> - <string>Flycam hardware axis mapping for internal axis 3 ([0, 5]).</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>4</integer> + <integer>0</integer> </map> - <key>JoystickAxis4</key> + <key>MouselookBtnState</key> <map> <key>Comment</key> - <string>Flycam hardware axis mapping for internal axis 4 ([0, 5]).</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>3</integer> + <integer>0</integer> </map> - <key>JoystickAxis5</key> + <key>MuteAmbient</key> <map> <key>Comment</key> - <string>Flycam hardware axis mapping for internal axis 5 ([0, 5]).</string> + <string>Ambient sound effects, such as wind noise, play at 0 volume</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>5</integer> + <integer>0</integer> </map> - <key>JoystickAxis6</key> + <key>MuteAudio</key> <map> <key>Comment</key> - <string>Flycam hardware axis mapping for internal axis 6 ([0, 5]).</string> + <string>All audio plays at 0 volume (streaming audio still takes up bandwidth, for example)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>0</integer> </map> - <key>JoystickBuildEnabled</key> + <key>MuteMedia</key> <map> <key>Comment</key> - <string>Enables the Joystick to move edited objects.</string> + <string>Media plays at 0 volume (streaming audio still takes up bandwidth)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -4999,10 +4507,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>JoystickEnabled</key> + <key>MuteMusic</key> <map> <key>Comment</key> - <string>Enables Joystick Input.</string> + <string>Music plays at 0 volume (streaming audio still takes up bandwidth)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5010,43 +4518,43 @@ <key>Value</key> <integer>0</integer> </map> - <key>JoystickFlycamEnabled</key> + <key>MuteSounds</key> <map> <key>Comment</key> - <string>Enables the Joystick to control the flycam.</string> + <string>Sound effects play at 0 volume</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>JoystickInitialized</key> + <key>MuteUI</key> <map> <key>Comment</key> - <string>Whether or not a joystick has been detected and initiailized.</string> + <string>UI sound effects play at 0 volume</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string /> + <integer>0</integer> </map> - <key>JoystickRunThreshold</key> + <key>MuteVoice</key> <map> <key>Comment</key> - <string>Input threshold to initiate running</string> + <string>Voice plays at 0 volume (streaming audio still takes up bandwidth)</string> <key>Persist</key> - <integer>1</integer> + <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>0.25</real> - </map> - <key>KeepAspectForSnapshot</key> + <integer>0</integer> + </map> + <key>MuteWhenMinimized</key> <map> <key>Comment</key> - <string>Use full window when taking snapshot, regardless of requested image size</string> + <string>Mute audio when SL window is minimized</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5054,247 +4562,219 @@ <key>Value</key> <integer>1</integer> </map> - <key>LandBrushSize</key> + <key>NearMeRange</key> <map> <key>Comment</key> - <string>Size of affected region when using teraform tool</string> + <string>Search radius for nearby avatars</string> <key>Persist</key> - <integer>1</integer> + <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>F32</string> <key>Value</key> - <real>2.0</real> + <integer>20</integer> </map> - <key>LCDDestination</key> + <key>NextOwnerCopy</key> <map> <key>Comment</key> - <string>Which LCD to use</string> + <string>Newly created objects can be copied by next owner</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>LSLFindCaseInsensitivity</key> - <map> - <key>Comment</key> - <string>Use case insensitivity when searching in LSL editor</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>LSLHelpRect</key> + <key>NextOwnerModify</key> <map> <key>Comment</key> - <string>Rectangle for LSL help window</string> + <string>Newly created objects can be modified by next owner</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>400</integer> - <integer>400</integer> - <integer>0</integer> - </array> + <integer>0</integer> </map> - <key>LSLHelpURL</key> + <key>NextOwnerTransfer</key> <map> <key>Comment</key> - <string>URL that points to LSL help files, with [LSL_STRING] corresponding to the referenced LSL function or keyword</string> + <string>Newly created objects can be resold or given away by next owner</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>http://wiki.secondlife.com/wiki/[LSL_STRING]</string> + <integer>1</integer> </map> - <key>LagMeterShrunk</key> + <key>NewCacheLocation</key> <map> <key>Comment</key> - <string>Last large/small state for lag meter</string> + <string>Change the location of the local disk cache to this</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>0</integer> + <string /> </map> - <key>Language</key> + <key>NextLoginLocation</key> <map> <key>Comment</key> - <string>Language specifier (for UI)</string> + <string>Location to log into by default.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>default</string> + <string /> </map> - <key>LanguageIsPublic</key> - <map> - <key>Comment</key> - <string>Let other residents see our language information</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>LastFeatureVersion</key> + <key>NoAudio</key> <map> <key>Comment</key> - <string>[DO NOT MODIFY] Version number for tracking hardware changes</string> + <string>Disable audio playback.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>LastFindPanel</key> + <key>NoHardwareProbe</key> <map> <key>Comment</key> - <string>Controls which find operation appears by default when clicking "Find" button </string> + <string>Disable hardware probe.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>find_all_panel</string> + <integer>0</integer> </map> - <key>LastName</key> + <key>NoInventoryLibrary</key> <map> <key>Comment</key> - <string>Login last name</string> + <string>Do not request inventory library.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string /> + <integer>0</integer> </map> - <key>LastPrefTab</key> + <key>NoPreload</key> <map> <key>Comment</key> - <string>Last selected tab in preferences window</string> + <string>Disable sound and image preload.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>LastRunVersion</key> + <key>NoVerifySSLCert</key> <map> <key>Comment</key> - <string>Version number of last instance of the viewer that you ran</string> + <string>Do not verify SSL peers.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>0.0.0</string> + <integer>0</integer> </map> - - <key>LastSnapshotToEmailHeight</key> + <key>NotifyBoxHeight</key> <map> <key>Comment</key> - <string>The height of the last email snapshot, in px</string> + <string>Height of notification messages</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>768</integer> + <integer>200</integer> </map> - <key>LastSnapshotToEmailWidth</key> + <key>NotifyBoxWidth</key> <map> <key>Comment</key> - <string>The width of the last email snapshot, in px</string> + <string>Width of notification messages</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>1024</integer> + <integer>350</integer> </map> - <key>LastSnapshotToDiskHeight</key> + <key>NotifyMoneyChange</key> <map> <key>Comment</key> - <string>The height of the last disk snapshot, in px</string> + <string>Pop up notifications for all L$ transactions</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>768</integer> + <integer>1</integer> </map> - <key>LastSnapshotToDiskWidth</key> + <key>NotifyTipDuration</key> <map> <key>Comment</key> - <string>The width of the last disk snapshot, in px</string> + <string>Length of time that notification tips stay on screen (seconds)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>1024</integer> + <real>4.0</real> </map> - <key>LastSnapshotToInventoryHeight</key> + <key>NumSessions</key> <map> <key>Comment</key> - <string>The height of the last texture snapshot, in px</string> + <string>Number of successful logins to Second Life</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>512</integer> + <integer>0</integer> </map> - <key>LastSnapshotToInventoryWidth</key> + <key>NumpadControl</key> <map> <key>Comment</key> - <string>The width of the last texture snapshot, in px</string> + <string>How numpad keys control your avatar. 0 = Like the normal arrow keys, 1 = Numpad moves avatar when numlock is off, 2 = Numpad moves avatar regardless of numlock (use this if you have no numlock)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>512</integer> + <integer>0</integer> </map> - <key>LastSnapshotType</key> + <key>OpenDebugStatAdvanced</key> <map> <key>Comment</key> - <string>Select this as next type of snapshot to take (0 = postcard, 1 = texture, 2 = local image)</string> + <string>Expand advanced performance stats display</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>LeftClickShowMenu</key> + <key>OpenDebugStatBasic</key> <map> <key>Comment</key> - <string>Left click opens pie menu (FALSE = left click touches or grabs object)</string> + <string>Expand basic performance stats display</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>LimitDragDistance</key> + <key>OpenDebugStatNet</key> <map> <key>Comment</key> - <string>Limit translation of object via translate tool</string> + <string>Expand network stats display</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5302,10 +4782,10 @@ <key>Value</key> <integer>1</integer> </map> - <key>LimitSelectDistance</key> + <key>OpenDebugStatRender</key> <map> <key>Comment</key> - <string>Disallow selection of objects beyond max select distance</string> + <string>Expand render stats display</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5313,32 +4793,32 @@ <key>Value</key> <integer>1</integer> </map> - <key>LipSyncAah</key> + <key>OpenDebugStatSim</key> <map> <key>Comment</key> - <string>Aah (jaw opening) babble loop</string> + <string>Expand simulator performance stats display</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>257998776531013446642343</string> + <integer>1</integer> </map> - <key>LipSyncAahPowerTransfer</key> + <key>OpenDebugStatTexture</key> <map> <key>Comment</key> - <string>Transfer curve for Voice Interface power to aah lip sync amplitude</string> + <string>Expand Texture performance stats display</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>0000123456789</string> + <integer>0</integer> </map> - <key>LipSyncEnabled</key> + <key>OpenDebugStatPhysicsDetails</key> <map> <key>Comment</key> - <string>0 disable lip-sync, 1 enable babble loop</string> + <string>Expand Physics Details performance stats display</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5346,164 +4826,175 @@ <key>Value</key> <integer>0</integer> </map> - <key>LipSyncOoh</key> + <key>OpenDebugStatSimTime</key> <map> <key>Comment</key> - <string>Ooh (mouth width) babble loop</string> + <string>Expand Simulator Time performance stats display</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>1247898743223344444443200000</string> + <integer>0</integer> </map> - <key>LipSyncOohAahRate</key> + <key>OpenDebugStatSimTimeDetails</key> <map> <key>Comment</key> - <string>Rate to babble Ooh and Aah (/sec)</string> + <string>Expand Simulator Time Details performance stats display</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>24.0</real> + <integer>0</integer> </map> - <key>LipSyncOohPowerTransfer</key> + <key>OutBandwidth</key> <map> <key>Comment</key> - <string>Transfer curve for Voice Interface power to ooh lip sync amplitude</string> + <string>Expand render stats display</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>0012345566778899</string> + <integer>1</integer> </map> - <key>LocalCacheVersion</key> + <key>OutBandwidth</key> <map> <key>Comment</key> - <string>Version number of cache</string> + <string>Outgoing bandwidth throttle (bps)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>0.0</real> </map> - <key>LogMessages</key> + <key>OverlayTitle</key> <map> <key>Comment</key> - <string>Log network traffic</string> + <string>Controls watermark text message displayed on screen when "ShowOverlayTitle" is enabled (one word, underscores become spaces)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> + <string>Set_via_OverlayTitle_in_settings.xml</string> + </map> + <key>PTTCurrentlyEnabled</key> + <map> + <key>Comment</key> + <string>Use Push to Talk mode</string> + <key>Persist</key> <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> </map> - <key>LoginAsGod</key> + <key>PacketDropPercentage</key> <map> <key>Comment</key> - <string>Attempt to login with god powers (Linden accounts only)</string> + <string>Percentage of packets dropped by the client.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>0.0</real> </map> - <key>LoginLastLocation</key> + <key>ParcelMediaAutoPlayEnable</key> <map> <key>Comment</key> - <string>Login at same location you last logged out</string> + <string>Auto play parcel media when available</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>LoginPage</key> + <key>PerAccountSettingsFile</key> <map> <key>Comment</key> - <string>Login authentication page.</string> + <string>Persisted client settings file name (per user).</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>String</string> <key>Value</key> <string /> </map> - <key>LosslessJ2CUpload</key> + <key>PermissionsCautionEnabled</key> <map> <key>Comment</key> - <string>Use lossless compression for small image uploads</string> + <string>When enabled, changes the handling of script permission requests to help avoid accidental granting of certain permissions, such as the debit permission</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>MainloopTimeoutDefault</key> + <key>PermissionsCautionNotifyBoxHeight</key> <map> <key>Comment</key> - <string>Timeout duration for mainloop lock detection, in seconds.</string> + <string>Height of caution-style notification messages</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>20.0</real> + <integer>344</integer> </map> - <key>MapOverlayIndex</key> + <key>PickerContextOpacity</key> <map> <key>Comment</key> - <string>Currently selected world map type</string> + <string>Controls overall opacity of context frustrum connecting color and texture pickers with their swatches</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>0.34999999404</real> </map> - <key>MapScale</key> + <key>PicksPerSecondMouseMoving</key> <map> <key>Comment</key> - <string>World map zoom level (pixels per region)</string> + <string>How often to perform hover picks while the mouse is moving (picks per second)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>F32</string> <key>Value</key> - <real>128.0</real> + <real>5.0</real> </map> - <key>MapShowEvents</key> + <key>PicksPerSecondMouseStationary</key> <map> <key>Comment</key> - <string>Show events on world map</string> + <string>How often to perform hover picks while the mouse is stationary (picks per second)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>0.0</real> </map> - <key>MapShowInfohubs</key> + <key>PieMenuLineWidth</key> <map> <key>Comment</key> - <string>Show infohubs on the world map</string> + <string>Width of lines in pie menu display (pixels)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>2.5</real> </map> - <key>MapShowLandForSale</key> + <key>PingInterpolate</key> <map> <key>Comment</key> - <string>Show land for sale on world map</string> + <string>Extrapolate object position along velocity vector based on ping delay</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5511,21 +5002,21 @@ <key>Value</key> <integer>0</integer> </map> - <key>MapShowPeople</key> + <key>PitchFromMousePosition</key> <map> <key>Comment</key> - <string>Show other users on world map</string> + <string>Vertical range over which avatar head tracks mouse position (degrees of head rotation from top of window to bottom)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>90.0</real> </map> - <key>MapShowTelehubs</key> + <key>PlayTypingAnim</key> <map> <key>Comment</key> - <string>Show telehubs on world map</string> + <string>Your avatar plays the typing animation whenever you type in the chat bar</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5533,43 +5024,43 @@ <key>Value</key> <integer>1</integer> </map> - <key>Marker</key> + <key>PrecachingDelay</key> <map> <key>Comment</key> - <string>[NOT USED]</string> + <string>Delay when logging in to load world before showing it (seconds)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string /> + <real>6.0</real> </map> - <key>MaxDragDistance</key> + <key>PreferredMaturity</key> <map> <key>Comment</key> - <string>Maximum allowed translation distance in a single operation of translate tool (meters from start point)</string> + <string>Setting for the user's preferred maturity level.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>U32</string> <key>Value</key> - <real>48.0</real> + <integer>13</integer> </map> - <key>MaxSelectDistance</key> + <key>ProbeHardwareOnStartup</key> <map> <key>Comment</key> - <string>Maximum allowed selection distance (meters from avatar)</string> + <string>Query current hardware configuration on application startup</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>64.0</real> + <integer>1</integer> </map> - <key>MeanCollisionBump</key> + <key>PurgeCacheOnNextStartup</key> <map> <key>Comment</key> - <string>You have experienced an abuse of being bumped by an object or avatar</string> + <string>Clear local file cache next time viewer is run</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5577,10 +5068,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>MeanCollisionPhysical</key> + <key>PurgeCacheOnStartup</key> <map> <key>Comment</key> - <string>You have experienced an abuse from a physical object</string> + <string>Clear local file cache every time viewer is run</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5588,21 +5079,21 @@ <key>Value</key> <integer>0</integer> </map> - <key>MeanCollisionPushObject</key> + <key>PushToTalkButton</key> <map> <key>Comment</key> - <string>You have experienced an abuse of being pushed by a scripted object</string> + <string>Which button or keyboard key is used for push-to-talk</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>0</integer> + <string>MiddleMouse</string> </map> - <key>MeanCollisionScripted</key> + <key>PushToTalkToggle</key> <map> <key>Comment</key> - <string>You have experienced an abuse from a scripted object</string> + <string>Should the push-to-talk button behave as a toggle</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5610,10 +5101,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>MeanCollisionSelected</key> + <key>QAMode</key> <map> <key>Comment</key> - <string>You have experienced an abuse of being pushed via a selected object</string> + <string>Enable Testing Features.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5621,240 +5112,208 @@ <key>Value</key> <integer>0</integer> </map> - <key>MemoryLogFrequency</key> - <map> - <key>Comment</key> - <string>Seconds between display of Memory in log (0 for never)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>600.0</real> - </map> - <key>MenuAccessKeyTime</key> + <key>QuietSnapshotsToDisk</key> <map> <key>Comment</key> - <string>Time (seconds) in which the menu key must be tapped to move focus to the menu bar</string> + <string>Take snapshots to disk without playing animation or sound</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>0.25</real> + <integer>0</integer> </map> - <key>MenuBarHeight</key> + <key>QuitAfterSeconds</key> <map> <key>Comment</key> - <string /> + <string>The duration allowed before quitting.</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>F32</string> <key>Value</key> - <integer>18</integer> + <real>0.0</real> </map> - <key>MenuBarWidth</key> + <key>RadioLandBrushAction</key> <map> <key>Comment</key> - <string /> + <string>Last selected land modification operation (0 = flatten, 1 = raise, 2 = lower, 3 = smooth, 4 = roughen, 5 = revert)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <integer>410</integer> + <integer>0</integer> </map> - <key>MigrateCacheDirectory</key> + <key>RadioLandBrushSize</key> <map> <key>Comment</key> - <string>Check for old version of disk cache to migrate to current location</string> + <string>Size of land modification brush (0 = small, 1 = medium, 2 = large)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>MiniMapRotate</key> + <key>LandBrushForce</key> + <map> + <key>Comment</key> + <string>Multiplier for land modification brush force.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>1.0</real> + </map> + <key>RecentItemsSortOrder</key> <map> <key>Comment</key> - <string>Rotate miniature world map to avatar direction</string> + <string>Specifies sort key for recent inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>U32</string> <key>Value</key> <integer>1</integer> </map> - <key>MiniMapScale</key> + <key>RectangleSelectInclusive</key> <map> <key>Comment</key> - <string>Miniature world map zoom levle (pixels per region)</string> + <string>Select objects that have at least one vertex inside selection rectangle</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>128.0</real> + <integer>1</integer> </map> - <key>MouseSensitivity</key> + <key>RegionTextureSize</key> <map> <key>Comment</key> - <string>Controls responsiveness of mouse when in mouselook mode (fraction or multiple of default mouse sensitivity)</string> + <string>Terrain texture dimensions (power of 2)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>U32</string> <key>Value</key> - <real>3.0</real> + <integer>256</integer> </map> - <key>MouseSmooth</key> + <key>RememberPassword</key> <map> <key>Comment</key> - <string>Smooths out motion of mouse when in mouselook mode.</string> + <string>Keep password (in encrypted form) for next login</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>MouseSun</key> + <key>RenderAnisotropic</key> <map> <key>Comment</key> - <string /> + <string>Render textures using anisotropic filtering</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>MouselookBtnState</key> + <key>RenderAppleUseMultGL</key> <map> <key>Comment</key> - <string /> + <string>Whether we want to use multi-threaded OpenGL on Apple hardware (requires restart of SL).</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>MoveDownBtnRect</key> - <map> - <key>Comment</key> - <string /> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>91</integer> - <integer>29</integer> - <integer>116</integer> - <integer>4</integer> - </array> - </map> - <key>MoveUpBtnRect</key> + <key>RenderAttachedLights</key> + <map> + <key>Comment</key> + <string>Render lighted prims that are attached to avatars</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>RenderAttachedParticles</key> + <map> + <key>Comment</key> + <string>Render particle systems that are attached to avatars</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>RenderAvatar</key> <map> <key>Comment</key> - <string /> + <string>Render Avatars</string> <key>Persist</key> <integer>0</integer> <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>91</integer> - <integer>54</integer> - <integer>116</integer> - <integer>29</integer> - </array> - </map> - <key>MuteAmbient</key> - <map> - <key>Comment</key> - <string>Ambient sound effects, such as wind noise, play at 0 volume</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> - </map> - <key>MuteAudio</key> - <map> - <key>Comment</key> - <string>All audio plays at 0 volume (streaming audio still takes up bandwidth, for example)</string> - <key>Persist</key> <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> </map> - <key>MuteMedia</key> + <key>RenderAvatarCloth</key> <map> <key>Comment</key> - <string>Media plays at 0 volume (streaming audio still takes up bandwidth)</string> + <string>Controls if avatars use wavy cloth</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> - </map> - <key>MuteMusic</key> - <map> - <key>Comment</key> - <string>Music plays at 0 volume (streaming audio still takes up bandwidth)</string> - <key>Persist</key> <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> </map> - <key>MuteSounds</key> + <key>RenderAvatarLODFactor</key> <map> <key>Comment</key> - <string>Sound effects play at 0 volume</string> + <string>Controls level of detail of avatars (multiplier for current screen area when calculated level of detail)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>0.5</real> </map> - <key>MuteUI</key> + <key>RenderAvatarMaxVisible</key> <map> <key>Comment</key> - <string>UI sound effects play at 0 volume</string> + <string>Maximum number of avatars to display at any one time</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>35</integer> </map> - <key>MuteVoice</key> + <key>RenderAvatarInvisible</key> <map> <key>Comment</key> - <string>Voice plays at 0 volume (streaming audio still takes up bandwidth)</string> + <string>Set your avatar as Invisible</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>MuteWhenMinimized</key> + <key>RenderAvatarVP</key> <map> <key>Comment</key> - <string>Mute audio when SL window is minimized</string> + <string>Use vertex programs to perform hardware skinning of avatar</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5862,76 +5321,160 @@ <key>Value</key> <integer>1</integer> </map> - <key>NearMeRange</key> + + <key>RenderShadowGaussian</key> + <map> + <key>Comment</key> + <string>Gaussian coefficients for the two shadow/SSAO blurring passes (z component unused).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>2.0</real> + <real>2.0</real> + <real>0.0</real> + </array> + </map> + + <key>RenderShadowNearDist</key> + <map> + <key>Comment</key> + <string>Near clip plane of shadow camera (affects precision of depth shadows).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>256</real> + <real>256</real> + <real>256</real> + </array> + </map> + <key>RenderShadowClipPlanes</key> + <map> + <key>Comment</key> + <string>Near clip plane split distances for shadow map frusta.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>4.0</real> + <real>8.0</real> + <real>24.0</real> + </array> + </map> + <key>RenderSSAOScale</key> + <map> + <key>Comment</key> + <string>Scaling factor for the area to sample for occluders (pixels at 1 meter away, inversely varying with distance)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>500.0</real> + </map> + <key>RenderSSAOMaxScale</key> + <map> + <key>Comment</key> + <string>Maximum screen radius for sampling (pixels)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>60</integer> + </map> + <key>RenderSSAOFactor</key> + <map> + <key>Comment</key> + <string>Occlusion sensitivity factor for ambient occlusion (larger is more)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.30</real> + </map> + <key>RenderSSAOEffect</key> + <map> + <key>Comment</key> + <string>Multiplier for (1) value and (2) saturation (HSV definition), for areas which are totally occluded. Blends with original color for partly-occluded areas. (Third component is unused.)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>0.40</real> + <real>1.00</real> + <real>0.00</real> + </array> + </map> + <key>RenderBumpmapMinDistanceSquared</key> <map> <key>Comment</key> - <string>Search radius for nearby avatars</string> + <string>Maximum distance at which to render bumpmapped primitives (distance in meters, squared)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>F32</string> <key>Value</key> - <integer>20</integer> + <real>100.0</real> </map> - <key>NextOwnerCopy</key> + <key>RenderNormalMapScale</key> + <map> + <key>Comment</key> + <string>Scaler applied to height map when generating normal maps</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>128</real> + </map> + <key>RenderCubeMap</key> <map> <key>Comment</key> - <string>Newly created objects can be copied by next owner</string> + <string>Whether we can render the cube map or not</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> - </map> - <key>NextOwnerModify</key> - <map> - <key>Comment</key> - <string>Newly created objects can be modified by next owner</string> - <key>Persist</key> <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> </map> - <key>NextOwnerTransfer</key> + <key>RenderCustomSettings</key> <map> <key>Comment</key> - <string>Newly created objects can be resold or given away by next owner</string> + <string>Do you want to set the graphics settings yourself</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> - </map> - <key>NewCacheLocation</key> - <map> - <key>Comment</key> - <string>Change the location of the local disk cache to this</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string /> + <integer>0</integer> </map> - <key>NextLoginLocation</key> + <key>RenderDebugAlphaMask</key> <map> <key>Comment</key> - <string>Location to log into by default.</string> + <string>Test Alpha Masking Cutoffs.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string /> + <real>0.5</real> </map> - <key>NoAudio</key> + <key>RenderDebugGL</key> <map> <key>Comment</key> - <string>Disable audio playback.</string> + <string>Enable strict GL debugging.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5939,21 +5482,21 @@ <key>Value</key> <integer>0</integer> </map> - <key>NoHardwareProbe</key> + <key>RenderDebugPipeline</key> <map> <key>Comment</key> - <string>Disable hardware probe.</string> + <string>Enable strict pipeline debugging.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>NoInventoryLibrary</key> + <key>RenderDebugTextureBind</key> <map> <key>Comment</key> - <string>Do not request inventory library.</string> + <string>Enable texture bind performance test.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -5961,1960 +5504,132 @@ <key>Value</key> <integer>0</integer> </map> - <key>NoPreload</key> - <map> - <key>Comment</key> - <string>Disable sound and image preload.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>NoVerifySSLCert</key> - <map> - <key>Comment</key> - <string>Do not verify SSL peers.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>NotecardEditorRect</key> - <map> - <key>Comment</key> - <string>Rectangle for notecard editor</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>400</integer> - <integer>400</integer> - <integer>0</integer> - </array> - </map> - <key>NotifyBoxHeight</key> - <map> - <key>Comment</key> - <string>Height of notification messages</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>200</integer> - </map> - <key>NotifyBoxWidth</key> - <map> - <key>Comment</key> - <string>Width of notification messages</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>350</integer> - </map> - <key>NotifyMoneyChange</key> - <map> - <key>Comment</key> - <string>Pop up notifications for all L$ transactions</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>NotifyTipDuration</key> - <map> - <key>Comment</key> - <string>Length of time that notification tips stay on screen (seconds)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>4.0</real> - </map> - <key>NumSessions</key> - <map> - <key>Comment</key> - <string>Number of successful logins to Second Life</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>NumpadControl</key> - <map> - <key>Comment</key> - <string>How numpad keys control your avatar. 0 = Like the normal arrow keys, 1 = Numpad moves avatar when numlock is off, 2 = Numpad moves avatar regardless of numlock (use this if you have no numlock)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>ObjectChatColor</key> - <map> - <key>Comment</key> - <string>Color of chat messages from objects</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Color4</string> - <key>Value</key> - <array> - <real>0.699999988079</real> - <real>0.899999976158</real> - <real>0.699999988079</real> - <real>1</real> - </array> - </map> - <key>OpenDebugStatAdvanced</key> - <map> - <key>Comment</key> - <string>Expand advanced performance stats display</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>OpenDebugStatBasic</key> - <map> - <key>Comment</key> - <string>Expand basic performance stats display</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>OpenDebugStatNet</key> - <map> - <key>Comment</key> - <string>Expand network stats display</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>OpenDebugStatRender</key> - <map> - <key>Comment</key> - <string>Expand render stats display</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>OpenDebugStatSim</key> - <map> - <key>Comment</key> - <string>Expand simulator performance stats display</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>OpenDebugStatTexture</key> - <map> - <key>Comment</key> - <string>Expand Texture performance stats display</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>OpenDebugStatPhysicsDetails</key> - <map> - <key>Comment</key> - <string>Expand Physics Details performance stats display</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>OpenDebugStatSimTime</key> - <map> - <key>Comment</key> - <string>Expand Simulator Time performance stats display</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>OpenDebugStatSimTimeDetails</key> - <map> - <key>Comment</key> - <string>Expand Simulator Time Details performance stats display</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>OutBandwidth</key> - <map> - <key>Comment</key> - <string>Outgoing bandwidth throttle (bps)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.0</real> - </map> - <key>OverdrivenColor</key> - <map> - <key>Comment</key> - <string>Color of various indicators when resident is speaking too loud.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Color4</string> - <key>Value</key> - <array> - <real>1.0</real> - <real>0.0</real> - <real>0.0</real> - <real>1.0</real> - </array> - </map> - <key>OverlayTitle</key> - <map> - <key>Comment</key> - <string>Controls watermark text message displayed on screen when "ShowOverlayTitle" is enabled (one word, underscores become spaces)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string>Set_via_OverlayTitle_in_settings.xml</string> - </map> - <key>PTTCurrentlyEnabled</key> - <map> - <key>Comment</key> - <string>Use Push to Talk mode</string> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>PacketDropPercentage</key> - <map> - <key>Comment</key> - <string>Percentage of packets dropped by the client.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.0</real> - </map> - <key>ParcelMediaAutoPlayEnable</key> - <map> - <key>Comment</key> - <string>Auto play parcel media when available</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>PerAccountSettingsFile</key> - <map> - <key>Comment</key> - <string>Persisted client settings file name (per user).</string> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string /> - </map> - <key>PermissionsCautionEnabled</key> - <map> - <key>Comment</key> - <string>When enabled, changes the handling of script permission requests to help avoid accidental granting of certain permissions, such as the debit permission</string> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>PermissionsCautionNotifyBoxHeight</key> - <map> - <key>Comment</key> - <string>Height of caution-style notification messages</string> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>344</integer> - </map> - <key>PermissionsManagerRect</key> - <map> - <key>Comment</key> - <string>Rectangle for permissions manager window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>85</integer> - <integer>300</integer> - <integer>0</integer> - </array> - </map> - <key>PickerContextOpacity</key> - <map> - <key>Comment</key> - <string>Controls overall opacity of context frustrum connecting color and texture pickers with their swatches</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.34999999404</real> - </map> - <key>PicksPerSecondMouseMoving</key> - <map> - <key>Comment</key> - <string>How often to perform hover picks while the mouse is moving (picks per second)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>5.0</real> - </map> - <key>PicksPerSecondMouseStationary</key> - <map> - <key>Comment</key> - <string>How often to perform hover picks while the mouse is stationary (picks per second)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.0</real> - </map> - <key>PieMenuLineWidth</key> - <map> - <key>Comment</key> - <string>Width of lines in pie menu display (pixels)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>2.5</real> - </map> - <key>PinTalkViewOpen</key> - <map> - <key>Comment</key> - <string>Stay in IM after hitting return</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>PingInterpolate</key> - <map> - <key>Comment</key> - <string>Extrapolate object position along velocity vector based on ping delay</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>PitchFromMousePosition</key> - <map> - <key>Comment</key> - <string>Vertical range over which avatar head tracks mouse position (degrees of head rotation from top of window to bottom)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>90.0</real> - </map> - <key>PlayTypingAnim</key> - <map> - <key>Comment</key> - <string>Your avatar plays the typing animation whenever you type in the chat bar</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>PrecachingDelay</key> - <map> - <key>Comment</key> - <string>Delay when logging in to load world before showing it (seconds)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>6.0</real> - </map> - <key>PreferredMaturity</key> - <map> - <key>Comment</key> - <string>Setting for the user's preferred maturity level.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>U32</string> - <key>Value</key> - <integer>13</integer> - </map> - <key>PreviewAnimRect</key> - <map> - <key>Comment</key> - <string>Rectangle for animation preview window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>85</integer> - <integer>300</integer> - <integer>0</integer> - </array> - </map> - <key>PreviewClassifiedRect</key> - <map> - <key>Comment</key> - <string>Rectangle for URL preview window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>530</integer> - <integer>420</integer> - <integer>0</integer> - </array> - </map> - <key>PreviewEventRect</key> - <map> - <key>Comment</key> - <string>Rectangle for Event preview window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>530</integer> - <integer>420</integer> - <integer>0</integer> - </array> - </map> - <key>PreviewLandmarkRect</key> - <map> - <key>Comment</key> - <string>Rectangle for landmark preview window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>90</integer> - <integer>300</integer> - <integer>0</integer> - </array> - </map> - <key>PreviewObjectRect</key> - <map> - <key>Comment</key> - <string>Rectangle for object preview window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>85</integer> - <integer>300</integer> - <integer>0</integer> - </array> - </map> - <key>PreviewScriptRect</key> - <map> - <key>Comment</key> - <string>Rectangle for script preview window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>586</integer> - <integer>576</integer> - <integer>0</integer> - </array> - </map> - <key>PreviewSoundRect</key> - <map> - <key>Comment</key> - <string>Rectangle for sound preview window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>85</integer> - <integer>300</integer> - <integer>0</integer> - </array> - </map> - <key>PreviewTextureRect</key> - <map> - <key>Comment</key> - <string>Rectangle for texture preview window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>400</integer> - <integer>400</integer> - <integer>0</integer> - </array> - </map> - <key>PreviewURLRect</key> - <map> - <key>Comment</key> - <string>Rectangle for URL preview window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>90</integer> - <integer>300</integer> - <integer>0</integer> - </array> - </map> - <key>PreviewWearableRect</key> - <map> - <key>Comment</key> - <string>Rectangle for wearable preview window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>85</integer> - <integer>300</integer> - <integer>0</integer> - </array> - </map> - <key>ProbeHardwareOnStartup</key> - <map> - <key>Comment</key> - <string>Query current hardware configuration on application startup</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>PropertiesRect</key> - <map> - <key>Comment</key> - <string>Rectangle for inventory item properties window</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Rect</string> - <key>Value</key> - <array> - <integer>0</integer> - <integer>320</integer> - <integer>350</integer> - <integer>0</integer> - </array> - </map> - <key>PurgeCacheOnNextStartup</key> - <map> - <key>Comment</key> - <string>Clear local file cache next time viewer is run</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>PurgeCacheOnStartup</key> - <map> - <key>Comment</key> - <string>Clear local file cache every time viewer is run</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>PushToTalkButton</key> - <map> - <key>Comment</key> - <string>Which button or keyboard key is used for push-to-talk</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string>MiddleMouse</string> - </map> - <key>PushToTalkToggle</key> - <map> - <key>Comment</key> - <string>Should the push-to-talk button behave as a toggle</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>QAMode</key> - <map> - <key>Comment</key> - <string>Enable Testing Features.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>QuietSnapshotsToDisk</key> - <map> - <key>Comment</key> - <string>Take snapshots to disk without playing animation or sound</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>QuitAfterSeconds</key> - <map> - <key>Comment</key> - <string>The duration allowed before quitting.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.0</real> - </map> - <key>RadioLandBrushAction</key> - <map> - <key>Comment</key> - <string>Last selected land modification operation (0 = flatten, 1 = raise, 2 = lower, 3 = smooth, 4 = roughen, 5 = revert)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RadioLandBrushSize</key> - <map> - <key>Comment</key> - <string>Size of land modification brush (0 = small, 1 = medium, 2 = large)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>LandBrushForce</key> - <map> - <key>Comment</key> - <string>Multiplier for land modification brush force.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.0</real> - </map> - <key>RecentItemsSortOrder</key> - <map> - <key>Comment</key> - <string>Specifies sort key for recent inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>U32</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RectangleSelectInclusive</key> - <map> - <key>Comment</key> - <string>Select objects that have at least one vertex inside selection rectangle</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RegionTextureSize</key> - <map> - <key>Comment</key> - <string>Terrain texture dimensions (power of 2)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>U32</string> - <key>Value</key> - <integer>256</integer> - </map> - <key>RememberPassword</key> - <map> - <key>Comment</key> - <string>Keep password (in encrypted form) for next login</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderAnisotropic</key> - <map> - <key>Comment</key> - <string>Render textures using anisotropic filtering</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderAppleUseMultGL</key> - <map> - <key>Comment</key> - <string>Whether we want to use multi-threaded OpenGL on Apple hardware (requires restart of SL).</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderAttachedLights</key> - <map> - <key>Comment</key> - <string>Render lighted prims that are attached to avatars</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderAttachedParticles</key> - <map> - <key>Comment</key> - <string>Render particle systems that are attached to avatars</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderAvatarCloth</key> - <map> - <key>Comment</key> - <string>Controls if avatars use wavy cloth</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderAvatarLODFactor</key> - <map> - <key>Comment</key> - <string>Controls level of detail of avatars (multiplier for current screen area when calculated level of detail)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.5</real> - </map> - <key>RenderAvatarMaxVisible</key> - <map> - <key>Comment</key> - <string>Maximum number of avatars to display at any one time</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>35</integer> - </map> - <key>RenderAvatarInvisible</key> - <map> - <key>Comment</key> - <string>Set your avatar as Invisible</string> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderAvatarVP</key> - <map> - <key>Comment</key> - <string>Use vertex programs to perform hardware skinning of avatar</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - - <key>RenderShadowGaussian</key> - <map> - <key>Comment</key> - <string>Gaussian coefficients for the two shadow/SSAO blurring passes (z component unused).</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Vector3</string> - <key>Value</key> - <array> - <real>2.0</real> - <real>2.0</real> - <real>0.0</real> - </array> - </map> - - <key>RenderShadowNearDist</key> - <map> - <key>Comment</key> - <string>Near clip plane of shadow camera (affects precision of depth shadows).</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Vector3</string> - <key>Value</key> - <array> - <real>256</real> - <real>256</real> - <real>256</real> - </array> - </map> - <key>RenderShadowClipPlanes</key> - <map> - <key>Comment</key> - <string>Near clip plane split distances for shadow map frusta.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Vector3</string> - <key>Value</key> - <array> - <real>4.0</real> - <real>8.0</real> - <real>24.0</real> - </array> - </map> - <key>RenderSSAOScale</key> - <map> - <key>Comment</key> - <string>Scaling factor for the area to sample for occluders (pixels at 1 meter away, inversely varying with distance)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>500.0</real> - </map> - <key>RenderSSAOMaxScale</key> - <map> - <key>Comment</key> - <string>Maximum screen radius for sampling (pixels)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>U32</string> - <key>Value</key> - <integer>60</integer> - </map> - <key>RenderSSAOFactor</key> - <map> - <key>Comment</key> - <string>Occlusion sensitivity factor for ambient occlusion (larger is more)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.30</real> - </map> - <key>RenderSSAOEffect</key> - <map> - <key>Comment</key> - <string>Multiplier for (1) value and (2) saturation (HSV definition), for areas which are totally occluded. Blends with original color for partly-occluded areas. (Third component is unused.)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Vector3</string> - <key>Value</key> - <array> - <real>0.40</real> - <real>1.00</real> - <real>0.00</real> - </array> - </map> - <key>RenderBumpmapMinDistanceSquared</key> - <map> - <key>Comment</key> - <string>Maximum distance at which to render bumpmapped primitives (distance in meters, squared)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>100.0</real> - </map> - <key>RenderNormalMapScale</key> - <map> - <key>Comment</key> - <string>Scaler applied to height map when generating normal maps</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>128</real> - </map> - <key>RenderCubeMap</key> - <map> - <key>Comment</key> - <string>Whether we can render the cube map or not</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderCustomSettings</key> - <map> - <key>Comment</key> - <string>Do you want to set the graphics settings yourself</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderDebugGL</key> - <map> - <key>Comment</key> - <string>Enable strict GL debugging.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderDebugPipeline</key> - <map> - <key>Comment</key> - <string>Enable strict pipeline debugging.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderDebugTextureBind</key> - <map> - <key>Comment</key> - <string>Enable texture bind performance test.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderDelayCreation</key> - <map> - <key>Comment</key> - <string>Throttle creation of drawables.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderAnimateRes</key> - <map> - <key>Comment</key> - <string>Animate rezing prims.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - - <key>RenderAnimateTrees</key> - <map> - <key>Comment</key> - <string>Use GL matrix ops to animate tree branches.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderDeferredAlphaSoften</key> - <map> - <key>Comment</key> - <string>Scalar for softening alpha surfaces (for soft particles).</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.75</real> - </map> - <key>RenderDeferredNoise</key> - <map> - <key>Comment</key> - <string>Noise scalar to hide banding in deferred render.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>4</real> - </map> - <key>RenderDeferred</key> - <map> - <key>Comment</key> - <string>Use deferred rendering pipeline.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderDeferredSunShadow</key> - <map> - <key>Comment</key> - <string>Generate shadows from the sun.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderDeferredSunWash</key> - <map> - <key>Comment</key> - <string>Amount local lights are washed out by sun.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.5</real> - </map> - <key>RenderShadowNoise</key> - <map> - <key>Comment</key> - <string>Magnitude of noise on shadow samples.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>-0.0001</real> - </map> - <key>RenderShadowBlurSize</key> - <map> - <key>Comment</key> - <string>Scale of shadow softening kernel.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.7</real> - </map> - <key>RenderShadowBlurSamples</key> - <map> - <key>Comment</key> - <string>Number of samples to take for each pass of shadow blur (value range 1-16). Actual number of samples is value * 2 - 1.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>U32</string> - <key>Value</key> - <real>5</real> - </map> - <key>RenderDynamicLOD</key> - <map> - <key>Comment</key> - <string>Dynamically adjust level of detail.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderFSAASamples</key> - <map> - <key>Comment</key> - <string>Number of samples to use for FSAA (0 = no AA).</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>U32</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderFarClip</key> - <map> - <key>Comment</key> - <string>Distance of far clip plane from camera (meters)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>256.0</real> - </map> - <key>RenderFastAlpha</key> - <map> - <key>Comment</key> - <string>Use lossy alpha rendering optimization (opaque/nonexistent small alpha faces).</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderFastUI</key> - <map> - <key>Comment</key> - <string>[NOT USED]</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderFlexTimeFactor</key> - <map> - <key>Comment</key> - <string>Controls level of detail of flexible objects (multiplier for amount of time spent processing flex objects)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.0</real> - </map> - <key>RenderFogRatio</key> - <map> - <key>Comment</key> - <string>Distance from camera where fog reaches maximum density (fraction or multiple of far clip distance)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>4.0</real> - </map> - <key>RenderGamma</key> - <map> - <key>Comment</key> - <string>Sets gamma exponent for renderer</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.0</real> - </map> - <key>RenderGammaFull</key> - <map> - <key>Comment</key> - <string>Use fully controllable gamma correction, instead of faster, hard-coded gamma correction of 2.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <real>1.0</real> - </map> - <key>RenderGlow</key> - <map> - <key>Comment</key> - <string>Render bloom post effect.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderGlowIterations</key> - <map> - <key>Comment</key> - <string>Number of times to iterate the glow (higher = wider and smoother but slower)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>2</integer> - </map> - <key>RenderGlowLumWeights</key> - <map> - <key>Comment</key> - <string>Weights for each color channel to be used in calculating luminance (should add up to 1.0)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Vector3</string> - <key>Value</key> - <array> - <real>0.299</real> - <real>0.587</real> - <real>0.114</real> - </array> - </map> - <key>RenderGlowMaxExtractAlpha</key> - <map> - <key>Comment</key> - <string>Max glow alpha value for brightness extraction to auto-glow.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.065</real> - </map> - <key>RenderGlowMinLuminance</key> - <map> - <key>Comment</key> - <string>Min luminance intensity necessary to consider an object bright enough to automatically glow.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>2.5</real> - </map> - <key>RenderGlowResolutionPow</key> - <map> - <key>Comment</key> - <string>Glow map resolution power of two.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>9</integer> - </map> - <key>RenderGlowStrength</key> - <map> - <key>Comment</key> - <string>Additive strength of glow.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.35</real> - </map> - <key>RenderGlowWarmthAmount</key> - <map> - <key>Comment</key> - <string>Amount of warmth extraction to use (versus luminance extraction). 0 = lum, 1.0 = warmth</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.0</real> - </map> - <key>RenderGlowWarmthWeights</key> - <map> - <key>Comment</key> - <string>Weight of each color channel used before finding the max warmth</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Vector3</string> - <key>Value</key> - <array> - <real>1.0</real> - <real>0.5</real> - <real>0.7</real> - </array> - </map> - <key>RenderGlowWidth</key> - <map> - <key>Comment</key> - <string>Glow sample size (higher = wider and softer but eventually more pixelated)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.3</real> - </map> - <key>RenderGround</key> - <map> - <key>Comment</key> - <string>Determines whether we can render the ground pool or not</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderHUDInSnapshot</key> - <map> - <key>Comment</key> - <string>Display HUD attachments in snapshot</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderHUDParticles</key> - <map> - <key>Comment</key> - <string>Display particle systems in HUD attachments (experimental)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderHiddenSelections</key> - <map> - <key>Comment</key> - <string>Show selection lines on objects that are behind other objects</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderHideGroupTitle</key> - <map> - <key>Comment</key> - <string>Don't show my group title in my name label</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderHideGroupTitleAll</key> - <map> - <key>Comment</key> - <string>Show group titles in name labels</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderInitError</key> - <map> - <key>Comment</key> - <string>Error occured while initializing GL</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderLightRadius</key> - <map> - <key>Comment</key> - <string>Render the radius of selected lights</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderLightingDetail</key> - <map> - <key>Comment</key> - <string>Amount of detail for lighting objects/avatars/terrain (0=sun/moon only, 1=enable local lights)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderMaxPartCount</key> - <map> - <key>Comment</key> - <string>Maximum number of particles to display on screen</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>4096</integer> - </map> - <key>RenderMaxNodeSize</key> - <map> - <key>Comment</key> - <string>Maximum size of a single node's vertex data (in KB).</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>4096</integer> - </map> - <key>RenderMaxVBOSize</key> - <map> - <key>Comment</key> - <string>Maximum size of a vertex buffer (in KB).</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>512</integer> - </map> - <key>RenderName</key> - <map> - <key>Comment</key> - <string>Controls display of names above avatars (0 = never, 1 = fade, 2 = always)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>2</integer> - </map> - <key>RenderNameFadeDuration</key> - <map> - <key>Comment</key> - <string>Time interval over which to fade avatar names (seconds)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.0</real> - </map> - <key>RenderNameHideSelf</key> - <map> - <key>Comment</key> - <string>Don't display own name above avatar</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderNameShowTime</key> - <map> - <key>Comment</key> - <string>Fade avatar names after specified time (seconds)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>10.0</real> - </map> - <key>RenderObjectBump</key> - <map> - <key>Comment</key> - <string>Show bumpmapping on primitives</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderQualityPerformance</key> - <map> - <key>Comment</key> - <string>Which graphics settings you've chosen</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>U32</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderReflectionDetail</key> - <map> - <key>Comment</key> - <string>Detail of reflection render pass.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>2</integer> - </map> - <key>RenderReflectionRes</key> - <map> - <key>Comment</key> - <string>Reflection map resolution.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>64</integer> - </map> - <key>RenderResolutionDivisor</key> - <map> - <key>Comment</key> - <string>Divisor for rendering 3D scene at reduced resolution.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>U32</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderShaderLightingMaxLevel</key> - <map> - <key>Comment</key> - <string>Max lighting level to use in the shader (class 3 is default, 2 is less lights, 1 is sun/moon only. Works around shader compiler bugs on certain platforms.)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>3</integer> - </map> - <key>RenderShaderLODThreshold</key> - <map> - <key>Comment</key> - <string>Fraction of draw distance defining the switch to a different shader LOD</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.0</real> - </map> - <key>RenderShaderParticleThreshold</key> - <map> - <key>Comment</key> - <string>Fraction of draw distance to not use shader on particles</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.25</real> - </map> - <key>RenderSunDynamicRange</key> - <map> - <key>Comment</key> - <string>Defines what percent brighter the sun is than local point lights (1.0 = 100% brighter. Value should not be less than 0. ).</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.0</real> - </map> - <key>RenderTerrainDetail</key> - <map> - <key>Comment</key> - <string>Detail applied to terrain texturing (0 = none, 1 or 2 = full)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>2</integer> - </map> - <key>RenderTerrainLODFactor</key> - <map> - <key>Comment</key> - <string>Controls level of detail of terrain (multiplier for current screen area when calculated level of detail)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.0</real> - </map> - <key>RenderTerrainScale</key> - <map> - <key>Comment</key> - <string>Terrain detail texture scale</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>12.0</real> - </map> - <key>RenderTextureMemoryMultiple</key> - <map> - <key>Comment</key> - <string>Multiple of texture memory value to use (should fit: 0 < value <= 1.0)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.0</real> - </map> - <key>RenderTreeLODFactor</key> - <map> - <key>Comment</key> - <string>Controls level of detail of vegetation (multiplier for current screen area when calculated level of detail)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>0.5</real> - </map> - <key>RenderUIInSnapshot</key> - <map> - <key>Comment</key> - <string>Display user interface in snapshot</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderUnloadedAvatar</key> - <map> - <key>Comment</key> - <string>Show avatars which haven't finished loading</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderUseFBO</key> - <map> - <key>Comment</key> - <string>Whether we want to use GL_EXT_framebuffer_objects.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderUseFarClip</key> - <map> - <key>Comment</key> - <string>If false, frustum culling will ignore far clip plane.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderUseImpostors</key> - <map> - <key>Comment</key> - <string>Whether we want to use impostors for far away avatars.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderUseShaderLOD</key> - <map> - <key>Comment</key> - <string>Whether we want to have different shaders for LOD</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderUseShaderNearParticles</key> - <map> - <key>Comment</key> - <string>Whether we want to use shaders on near particles</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RenderVBOEnable</key> - <map> - <key>Comment</key> - <string>Use GL Vertex Buffer Objects</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderVolumeLODFactor</key> - <map> - <key>Comment</key> - <string>Controls level of detail of primitives (multiplier for current screen area when calculated level of detail)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.0</real> - </map> - <key>RenderWater</key> - <map> - <key>Comment</key> - <string>Display water</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderWaterMipNormal</key> - <map> - <key>Comment</key> - <string>Use mip maps for water normal map.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderWaterRefResolution</key> - <map> - <key>Comment</key> - <string>Water planar reflection resolution.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>512</integer> - </map> - <key>RenderWaterReflections</key> - <map> - <key>Comment</key> - <string>Reflect the environment in the water.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RotateRight</key> - <map> - <key>Comment</key> - <string>Make the agent rotate to its right.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RotationStep</key> - <map> - <key>Comment</key> - <string>All rotations via rotation tool are constrained to multiples of this unit (degrees)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>1.0</real> - </map> - <key>RunBtnState</key> - <map> - <key>Comment</key> - <string /> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>RunMultipleThreads</key> - <map> - <key>Comment</key> - <string>If TRUE keep background threads active during render</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>SafeMode</key> - <map> - <key>Comment</key> - <string>Reset preferences, run in safe mode.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>SaveMinidump</key> - <map> - <key>Comment</key> - <string>Save minidump for developer debugging on crash</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>ScaleShowAxes</key> - <map> - <key>Comment</key> - <string>Show indicator of selected scale axis when scaling</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>ScaleStretchTextures</key> + <key>RenderDelayCreation</key> + <map> + <key>Comment</key> + <string>Throttle creation of drawables.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>RenderAnimateRes</key> + <map> + <key>Comment</key> + <string>Animate rezing prims.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + + <key>RenderAnimateTrees</key> + <map> + <key>Comment</key> + <string>Use GL matrix ops to animate tree branches.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>RenderDeferredAlphaSoften</key> + <map> + <key>Comment</key> + <string>Scalar for softening alpha surfaces (for soft particles).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.75</real> + </map> + <key>RenderDeferredNoise</key> + <map> + <key>Comment</key> + <string>Noise scalar to hide banding in deferred render.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>4</real> + </map> + <key>RenderDeferred</key> + <map> + <key>Comment</key> + <string>Use deferred rendering pipeline.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>RenderDeferredSunShadow</key> + <map> + <key>Comment</key> + <string>Generate shadows from the sun.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>RenderDeferredSunWash</key> + <map> + <key>Comment</key> + <string>Amount local lights are washed out by sun.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.5</real> + </map> + <key>RenderShadowNoise</key> + <map> + <key>Comment</key> + <string>Magnitude of noise on shadow samples.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>-0.0001</real> + </map> + <key>RenderShadowBlurSize</key> + <map> + <key>Comment</key> + <string>Scale of shadow softening kernel.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.7</real> + </map> + <key>RenderShadowBlurSamples</key> + <map> + <key>Comment</key> + <string>Number of samples to take for each pass of shadow blur (value range 1-16). Actual number of samples is value * 2 - 1.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <real>5</real> + </map> + <key>RenderDynamicLOD</key> <map> <key>Comment</key> - <string>Stretch textures along with object when scaling</string> + <string>Dynamically adjust level of detail.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -7922,37 +5637,32 @@ <key>Value</key> <integer>1</integer> </map> - <key>ScaleUniform</key> + <key>RenderFSAASamples</key> <map> <key>Comment</key> - <string>Scale selected objects evenly about center of selection</string> + <string>Number of samples to use for FSAA (0 = no AA).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>U32</string> <key>Value</key> <integer>0</integer> </map> - <key>ScriptErrorColor</key> + <key>RenderFarClip</key> <map> <key>Comment</key> - <string>Color of script error messages</string> + <string>Distance of far clip plane from camera (meters)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>F32</string> <key>Value</key> - <array> - <real>0.8235294117</real> - <real>0.2745098039</real> - <real>0.2745098039</real> - <real>1.0</real> - </array> + <real>256.0</real> </map> - <key>ScriptErrorsAsChat</key> + <key>RenderFastAlpha</key> <map> <key>Comment</key> - <string>Display script errors and warning in chat history</string> + <string>Use lossy alpha rendering optimization (opaque/nonexistent small alpha faces).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -7960,10 +5670,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>ScriptHelpFollowsCursor</key> + <key>RenderFastUI</key> <map> <key>Comment</key> - <string>Scripting help window updates contents based on script editor contents under text cursor</string> + <string>[NOT USED]</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -7971,159 +5681,153 @@ <key>Value</key> <integer>0</integer> </map> - <key>SearchURLDefault</key> + <key>RenderFlexTimeFactor</key> <map> <key>Comment</key> - <string>URL to load for empty searches</string> + <string>Controls level of detail of flexible objects (multiplier for amount of time spent processing flex objects)</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>http://search.secondlife.com/client_search.php?</string> + <real>1.0</real> </map> - <key>SearchURLQuery</key> + <key>RenderFogRatio</key> <map> <key>Comment</key> - <string>URL to use for searches</string> + <string>Distance from camera where fog reaches maximum density (fraction or multiple of far clip distance)</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>http://search.secondlife.com/client_search.php?q=[QUERY]&s=[COLLECTION]&</string> + <real>4.0</real> </map> - <key>SearchURLSuffix2</key> + <key>RenderGamma</key> <map> <key>Comment</key> - <string>Parameters added to end of search queries</string> + <string>Sets gamma exponent for renderer</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>lang=[LANG]&mat=[MATURITY]&t=[TEEN]&region=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]</string> + <real>0.0</real> </map> - <key>SelectMovableOnly</key> + <key>RenderGammaFull</key> <map> <key>Comment</key> - <string>Select only objects you can move</string> + <string>Use fully controllable gamma correction, instead of faster, hard-coded gamma correction of 2.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <real>1.0</real> </map> - <key>SelectOwnedOnly</key> + <key>RenderGlow</key> <map> <key>Comment</key> - <string>Select only objects you own</string> + <string>Render bloom post effect.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>SelectionHighlightAlpha</key> + <key>RenderGlowIterations</key> <map> <key>Comment</key> - <string>Opacity of selection highlight (0.0 = completely transparent, 1.0 = completely opaque)</string> + <string>Number of times to iterate the glow (higher = wider and smoother but slower)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>0.40000000596</real> + <integer>2</integer> </map> - <key>SelectionHighlightAlphaTest</key> + <key>RenderGlowMaxExtractAlpha</key> <map> <key>Comment</key> - <string>Alpha value below which pixels are displayed on selection highlight line (0.0 = show all pixels, 1.0 = show now pixels)</string> + <string>Max glow alpha value for brightness extraction to auto-glow.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>F32</string> <key>Value</key> - <real>0.1</real> + <real>0.065</real> </map> - <key>SelectionHighlightThickness</key> + <key>RenderGlowMinLuminance</key> <map> <key>Comment</key> - <string>Thickness of selection highlight line (fraction of view distance)</string> + <string>Min luminance intensity necessary to consider an object bright enough to automatically glow.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>F32</string> <key>Value</key> - <real>0.00999999977648</real> + <real>2.5</real> </map> - <key>SelectionHighlightUAnim</key> + <key>RenderGlowResolutionPow</key> <map> <key>Comment</key> - <string>Rate at which texture animates along U direction in selection highlight line (fraction of texture per second)</string> + <string>Glow map resolution power of two.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>0.0</real> + <integer>9</integer> </map> - <key>SelectionHighlightUScale</key> + <key>RenderGlowStrength</key> <map> <key>Comment</key> - <string>Scale of texture display on selection highlight line (fraction of texture size)</string> + <string>Additive strength of glow.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>F32</string> <key>Value</key> - <real>0.1</real> + <real>0.35</real> </map> - <key>SelectionHighlightVAnim</key> + <key>RenderGlowWarmthAmount</key> <map> <key>Comment</key> - <string>Rate at which texture animates along V direction in selection highlight line (fraction of texture per second)</string> + <string>Amount of warmth extraction to use (versus luminance extraction). 0 = lum, 1.0 = warmth</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>F32</string> <key>Value</key> - <real>0.5</real> + <real>0.0</real> </map> - <key>SelectionHighlightVScale</key> + <key>RenderGlowWidth</key> <map> <key>Comment</key> - <string>Scale of texture display on selection highlight line (fraction of texture size)</string> + <string>Glow sample size (higher = wider and softer but eventually more pixelated)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>F32</string> <key>Value</key> - <real>1.0</real> + <real>1.3</real> </map> - <key>ServerChoice</key> + <key>RenderGround</key> <map> <key>Comment</key> - <string>[DO NOT MODIFY] Controls which grid you connect to</string> + <string>Determines whether we can render the ground pool or not</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ShareWithGroup</key> + <key>RenderHUDInSnapshot</key> <map> <key>Comment</key> - <string>Newly created objects are shared with the currently active group</string> + <string>Display HUD attachments in snapshot</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8131,10 +5835,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowActiveSpeakers</key> + <key>RenderHUDParticles</key> <map> <key>Comment</key> - <string>Display active speakers list on login</string> + <string>Display particle systems in HUD attachments (experimental)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8142,21 +5846,21 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowAllObjectHoverTip</key> + <key>RenderHiddenSelections</key> <map> <key>Comment</key> - <string>Show descriptive tooltip when mouse hovers over non-interactive and interactive objects.</string> + <string>Show selection lines on objects that are behind other objects</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ShowAxes</key> + <key>RenderHideGroupTitle</key> <map> <key>Comment</key> - <string>Render coordinate frame at your position</string> + <string>Don't show my group title in my name label</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8164,76 +5868,109 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowBanLines</key> + <key>RenderHideGroupTitleAll</key> <map> <key>Comment</key> - <string>Show in-world ban/access borders</string> + <string>Show group titles in name labels</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>ShowCameraControls</key> + <key>RenderInitError</key> <map> <key>Comment</key> - <string>Display camera controls on login</string> + <string>Error occured while initializing GL</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>ShowChatHistory</key> + <key>RenderLightRadius</key> <map> <key>Comment</key> - <string /> + <string>Render the radius of selected lights</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>ShowCommunicate</key> + <key>RenderLightingDetail</key> <map> <key>Comment</key> - <string /> + <string>Amount of detail for lighting objects/avatars/terrain (0=sun/moon only, 1=enable local lights)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ShowConsoleWindow</key> + <key>RenderMaxPartCount</key> <map> <key>Comment</key> - <string>Show log in separate OS window</string> + <string>Maximum number of particles to display on screen</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>4096</integer> </map> - <key>ShowCrosshairs</key> + <key>RenderMaxNodeSize</key> + <map> + <key>Comment</key> + <string>Maximum size of a single node's vertex data (in KB).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>4096</integer> + </map> + <key>RenderMaxVBOSize</key> <map> <key>Comment</key> - <string>Display crosshairs when in mouselook mode</string> + <string>Maximum size of a vertex buffer (in KB).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> + <key>Value</key> + <integer>512</integer> + </map> + <key>RenderName</key> + <map> + <key>Comment</key> + <string>Controls display of names above avatars (0 = never, 1 = fade, 2 = always)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> <key>Value</key> + <integer>2</integer> + </map> + <key>RenderNameFadeDuration</key> + <map> + <key>Comment</key> + <string>Time interval over which to fade avatar names (seconds)</string> + <key>Persist</key> <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>1.0</real> </map> - <key>ShowDebugConsole</key> + <key>RenderNameHideSelf</key> <map> <key>Comment</key> - <string>Show log in SL window</string> + <string>Don't display own name above avatar</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8241,376 +5978,340 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowDebugStats</key> + <key>RenderNameShowTime</key> <map> <key>Comment</key> - <string>Show performance stats display</string> + <string>Fade avatar names after specified time (seconds)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>10.0</real> </map> - <key>ShowDirectory</key> + <key>RenderObjectBump</key> <map> <key>Comment</key> - <string /> + <string>Show bumpmapping on primitives</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ShowEmptyFoldersWhenSearching</key> + <key>RenderQualityPerformance</key> <map> <key>Comment</key> - <string>Shows folders that do not have any visible contents when applying a filter to inventory</string> + <string>Which graphics settings you've chosen</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>U32</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ShowHoverTips</key> + <key>RenderReflectionDetail</key> <map> <key>Comment</key> - <string>Show descriptive tooltip when mouse hovers over items in world</string> + <string>Detail of reflection render pass.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> + <integer>2</integer> + </map> + <key>RenderReflectionRes</key> + <map> + <key>Comment</key> + <string>Reflection map resolution.</string> + <key>Persist</key> <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>64</integer> </map> - <key>ShowInventory</key> + <key>RenderResolutionDivisor</key> <map> <key>Comment</key> - <string>Open inventory window on login</string> + <string>Divisor for rendering 3D scene at reduced resolution.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>U32</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ShowLandHoverTip</key> + <key>RenderShaderLightingMaxLevel</key> <map> <key>Comment</key> - <string>Show descriptive tooltip when mouse hovers over land</string> + <string>Max lighting level to use in the shader (class 3 is default, 2 is less lights, 1 is sun/moon only. Works around shader compiler bugs on certain platforms.)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>3</integer> </map> - <key>ShowLeaders</key> + <key>RenderShaderLODThreshold</key> <map> <key>Comment</key> - <string /> + <string>Fraction of draw distance defining the switch to a different shader LOD</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>1.0</real> </map> - <key>ShowPGSearchAll</key> + <key>RenderShaderParticleThreshold</key> <map> <key>Comment</key> - <string>Display results of search All that are flagged as PG</string> + <string>Fraction of draw distance to not use shader on particles</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>0.25</real> </map> - <key>ShowMatureSearchAll</key> + <key>RenderSunDynamicRange</key> <map> <key>Comment</key> - <string>Display results of search All that are flagged as mature</string> + <string>Defines what percent brighter the sun is than local point lights (1.0 = 100% brighter. Value should not be less than 0. ).</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>1.0</real> </map> - <key>ShowAdultSearchAll</key> + <key>RenderTerrainDetail</key> <map> <key>Comment</key> - <string>Display results of search All that are flagged as adult</string> + <string>Detail applied to terrain texturing (0 = none, 1 or 2 = full)</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>2</integer> </map> - <key>ShowPGGroups</key> + <key>RenderTerrainLODFactor</key> <map> <key>Comment</key> - <string>Display results of find groups that are flagged as PG</string> + <string>Controls level of detail of terrain (multiplier for current screen area when calculated level of detail)</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>1.0</real> </map> - <key>ShowMatureGroups</key> + <key>RenderTerrainScale</key> <map> <key>Comment</key> - <string>Display results of find groups that are flagged as mature</string> + <string>Terrain detail texture scale</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>12.0</real> </map> - <key>ShowAdultGroups</key> + <key>RenderTextureMemoryMultiple</key> <map> <key>Comment</key> - <string>Display results of find groups that are flagged as adult</string> + <string>Multiple of texture memory value to use (should fit: 0 < value <= 1.0)</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>1.0</real> </map> - <key>ShowPGClassifieds</key> + <key>RenderTreeLODFactor</key> <map> <key>Comment</key> - <string>Display results of find classifieds that are flagged as PG</string> + <string>Controls level of detail of vegetation (multiplier for current screen area when calculated level of detail)</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>0.5</real> </map> - <key>ShowMatureClassifieds</key> + <key>RenderUIInSnapshot</key> <map> <key>Comment</key> - <string>Display results of find classifieds that are flagged as mature</string> + <string>Display user interface in snapshot</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>ShowAdultClassifieds</key> + <key>RenderUnloadedAvatar</key> <map> <key>Comment</key> - <string>Display results of find classifieds that are flagged as adult</string> + <string>Show avatars which haven't finished loading</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>ShowPGEvents</key> + <key>RenderUseFBO</key> <map> <key>Comment</key> - <string>Display results of find events that are flagged as PG</string> + <string>Whether we want to use GL_EXT_framebuffer_objects.</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>ShowMatureEvents</key> + <key>RenderUseFarClip</key> <map> <key>Comment</key> - <string>Display results of find events that are flagged as mature</string> + <string>If false, frustum culling will ignore far clip plane.</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ShowAdultEvents</key> + <key>RenderUseImpostors</key> <map> <key>Comment</key> - <string>Display results of find events that are flagged as adult</string> + <string>Whether we want to use impostors for far away avatars.</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ShowPGLand</key> + <key>RenderUseShaderLOD</key> <map> <key>Comment</key> - <string>Display results of find land sales that are flagged as PG</string> + <string>Whether we want to have different shaders for LOD</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>1</integer> </map> - <key>ShowMatureLand</key> + <key>RenderUseShaderNearParticles</key> <map> <key>Comment</key> - <string>Display results of find land sales that are flagged as mature</string> + <string>Whether we want to use shaders on near particles</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>ShowAdultLand</key> + <key>RenderVBOEnable</key> <map> <key>Comment</key> - <string>Display results of find land sales that are flagged as adult</string> + <string>Use GL Vertex Buffer Objects</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ShowPGSims</key> + <key>RenderVolumeLODFactor</key> <map> <key>Comment</key> - <string>Display results of find places or find popular that are in PG sims</string> + <string>Controls level of detail of primitives (multiplier for current screen area when calculated level of detail)</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>1.0</real> </map> - <key>ShowMatureSims</key> + <key>RenderWater</key> <map> <key>Comment</key> - <string>Display results of find places or find popular that are in mature sims</string> + <string>Display water</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ShowAdultSims</key> + <key>RenderWaterMipNormal</key> <map> <key>Comment</key> - <string>Display results of find places or find popular that are in adult sims</string> + <string>Use mip maps for water normal map.</string> <key>Persist</key> <integer>1</integer> - <key>HideFromEditor</key> - <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ShowMiniMap</key> + <key>RenderWaterRefResolution</key> <map> <key>Comment</key> - <string>Display mini map on login</string> + <string>Water planar reflection resolution.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>512</integer> </map> - <key>ShowMovementControls</key> + <key>RenderWaterReflections</key> <map> <key>Comment</key> - <string>Display movement controls on login</string> + <string>Reflect the environment in the water.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>ShowNearClip</key> + <key>RotateRight</key> <map> <key>Comment</key> - <string /> + <string>Make the agent rotate to its right.</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>ShowNewInventory</key> + <key>RotationStep</key> <map> <key>Comment</key> - <string>Automatically views new notecards/textures/landmarks</string> + <string>All rotations via rotation tool are constrained to multiples of this unit (degrees)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>1</integer> + <real>1.0</real> </map> - <key>ShowInInventory</key> - <map> - <key>Comment</key> - <string>Automatically opens inventory to show accepted objects</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>ShowObjectUpdates</key> + <key>RunBtnState</key> <map> <key>Comment</key> - <string>Show when update messages are received for individual objects</string> + <string /> <key>Persist</key> <integer>0</integer> <key>Type</key> @@ -8618,10 +6319,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowOverlayTitle</key> + <key>RunMultipleThreads</key> <map> <key>Comment</key> - <string>Prints watermark text message on screen</string> + <string>If TRUE keep background threads active during render</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8629,32 +6330,32 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowParcelOwners</key> + <key>SafeMode</key> <map> <key>Comment</key> - <string /> + <string>Reset preferences, run in safe mode.</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>ShowPermissions</key> + <key>SaveMinidump</key> <map> <key>Comment</key> - <string /> + <string>Save minidump for developer debugging on crash</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>ShowPropertyLines</key> + <key>ScaleShowAxes</key> <map> <key>Comment</key> - <string>Show line overlay demarking property boundaries</string> + <string>Show indicator of selected scale axis when scaling</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8662,10 +6363,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowSearchBar</key> + <key>ScaleStretchTextures</key> <map> <key>Comment</key> - <string>Show the Search Bar in the Status Overlay</string> + <string>Stretch textures along with object when scaling</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8673,21 +6374,21 @@ <key>Value</key> <integer>1</integer> </map> - <key>ShowSelectionBeam</key> + <key>ScaleUniform</key> <map> <key>Comment</key> - <string>Show selection particle beam when selecting or interacting with objects.</string> + <string>Scale selected objects evenly about center of selection</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>ShowStartLocation</key> + <key>ScriptErrorsAsChat</key> <map> <key>Comment</key> - <string>Display starting location menu on login screen</string> + <string>Display script errors and warning in chat history</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8695,10 +6396,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowTangentBasis</key> + <key>ScriptHelpFollowsCursor</key> <map> <key>Comment</key> - <string>Render normal and binormal (debugging bump mapping)</string> + <string>Scripting help window updates contents based on script editor contents under text cursor</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8706,54 +6407,49 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowToolBar</key> + <key>SearchURLDefault</key> <map> <key>Comment</key> - <string>Show toolbar at bottom of screen</string> + <string>URL to load for empty searches</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>http://search.secondlife.com/client_search.php?</string> </map> - <key>ShowTools</key> + <key>SearchURLQuery</key> <map> <key>Comment</key> - <string /> + <string>URL to use for searches</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>0</integer> + <string>http://search.secondlife.com/client_search.php?q=[QUERY]&s=[COLLECTION]&</string> </map> - <key>ShowTutorial</key> - <map> - <key>Comment</key> - <string>Show tutorial window on login</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>ShowVoiceChannelPopup</key> + <key>SearchURLSuffix2</key> <map> <key>Comment</key> - <string>Controls visibility of the current voice channel popup above the voice tab</string> + <string>Parameters added to end of search queries</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>0</integer> + <string>lang=[LANG]&mat=[MATURITY]&t=[TEEN]&region=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]</string> </map> - <key>ShowVolumeSettingsPopup</key> + <key>SelectMovableOnly</key> <map> <key>Comment</key> - <string>Show individual volume slider for voice, sound effects, etc</string> + <string>Select only objects you can move</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8761,10 +6457,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowWorldMap</key> + <key>SelectOwnedOnly</key> <map> <key>Comment</key> - <string>Display world map on login</string> + <string>Select only objects you own</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8772,160 +6468,142 @@ <key>Value</key> <integer>0</integer> </map> - <key>ShowXUINames</key> + <key>SelectionHighlightAlpha</key> <map> <key>Comment</key> - <string>Display XUI Names as Tooltips</string> + <string>Opacity of selection highlight (0.0 = completely transparent, 1.0 = completely opaque)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>0.40000000596</real> </map> - <key>SitBtnState</key> + <key>SelectionHighlightAlphaTest</key> <map> <key>Comment</key> - <string /> + <string>Alpha value below which pixels are displayed on selection highlight line (0.0 = show all pixels, 1.0 = show now pixels)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>0.1</real> </map> - <key>SkinCurrent</key> + <key>SelectionHighlightThickness</key> <map> <key>Comment</key> - <string>The currently selected skin.</string> + <string>Thickness of selection highlight line (fraction of view distance)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>default</string> + <real>0.00999999977648</real> </map> - <key>SkyAmbientScale</key> + <key>SelectionHighlightUAnim</key> <map> <key>Comment</key> - <string>Controls strength of ambient, or non-directional light from the sun and moon (fraction or multiple of default ambient level)</string> + <string>Rate at which texture animates along U direction in selection highlight line (fraction of texture per second)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>F32</string> <key>Value</key> - <real>0.300000011921</real> + <real>0.0</real> </map> - <key>SkyEditPresets</key> + <key>SelectionHighlightUScale</key> <map> <key>Comment</key> - <string>Whether to be able to edit the sky defaults or not</string> + <string>Scale of texture display on selection highlight line (fraction of texture size)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>0.1</real> </map> - <key>SkyNightColorShift</key> + <key>SelectionHighlightVAnim</key> <map> <key>Comment</key> - <string>Controls moonlight color (base color applied to moon as light source)</string> + <string>Rate at which texture animates along V direction in selection highlight line (fraction of texture per second)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color3</string> + <string>F32</string> <key>Value</key> - <array> - <real>0.699999988079</real> - <real>0.699999988079</real> - <real>1.0</real> - </array> + <real>0.5</real> </map> - <key>SkyOverrideSimSunPosition</key> + <key>SelectionHighlightVScale</key> <map> <key>Comment</key> - <string /> + <string>Scale of texture display on selection highlight line (fraction of texture size)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>F32</string> <key>Value</key> - <integer>0</integer> + <real>1.0</real> </map> - <key>SkySunDefaultPosition</key> + <key>ServerChoice</key> <map> <key>Comment</key> - <string>Default position of sun in sky (direction in world coordinates)</string> + <string>[DO NOT MODIFY] Controls which grid you connect to</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Vector3</string> + <string>S32</string> <key>Value</key> - <array> - <real>1.0</real> - <real>0.0</real> - <real>0.1</real> - </array> + <integer>0</integer> </map> - <key>SkyUseClassicClouds</key> + <key>ShareWithGroup</key> <map> <key>Comment</key> - <string>Whether to use the old Second Life particle clouds or not</string> + <string>Newly created objects are shared with the currently active group</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>SlideLeftBtnRect</key> + <key>ShowActiveSpeakers</key> <map> <key>Comment</key> - <string /> + <string>Display active speakers list on login</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>20</integer> - <integer>54</integer> - <integer>45</integer> - <integer>29</integer> - </array> + <integer>0</integer> </map> - <key>SlideRightBtnRect</key> + <key>ShowAllObjectHoverTip</key> <map> <key>Comment</key> - <string /> + <string>Show descriptive tooltip when mouse hovers over non-interactive and interactive objects.</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>66</integer> - <integer>54</integer> - <integer>91</integer> - <integer>29</integer> - </array> + <integer>0</integer> </map> - <key>SmallAvatarNames</key> + <key>ShowAxes</key> <map> <key>Comment</key> - <string>Display avatar name text in smaller font</string> + <string>Render coordinate frame at your position</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>SnapEnabled</key> + <key>ShowBanLines</key> <map> <key>Comment</key> - <string>Enable snapping to grid</string> + <string>Show in-world ban/access borders</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8933,21 +6611,21 @@ <key>Value</key> <integer>1</integer> </map> - <key>SnapMargin</key> + <key>ShowCameraControls</key> <map> <key>Comment</key> - <string>Controls maximum distance between windows before they auto-snap together (pixels)</string> + <string>Display camera controls on login</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>10</integer> + <integer>1</integer> </map> - <key>SnapToMouseCursor</key> + <key>ShowConsoleWindow</key> <map> <key>Comment</key> - <string>When snapping to grid, center object on nearest grid point to mouse cursor</string> + <string>Show log in separate OS window</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -8955,81 +6633,65 @@ <key>Value</key> <integer>0</integer> </map> - <key>SnapshotFormat</key> + <key>ShowCrosshairs</key> <map> <key>Comment</key> - <string>Save snapshots in this format (0 = PNG, 1 = JPEG, 2 = BMP)</string> + <string>Display crosshairs when in mouselook mode</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>0</integer> - </map> - <key>SnapshotLocalLastResolution</key> - <map> - <key>Comment</key> - <string>Take next local snapshot at this resolution</string> - <key>Persist</key> <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>0</integer> </map> - <key>SnapshotPostcardLastResolution</key> + <key>ShowDebugConsole</key> <map> <key>Comment</key> - <string>Take next postcard snapshot at this resolution</string> + <string>Show log in SL window</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>SnapshotQuality</key> + <key>ShowDirectory</key> <map> <key>Comment</key> - <string>Quality setting of postcard JPEGs (0 = worst, 100 = best)</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>75</integer> + <integer>0</integer> </map> - <key>SnapshotTextureLastResolution</key> + <key>ShowEmptyFoldersWhenSearching</key> <map> <key>Comment</key> - <string>Take next texture snapshot at this resolution</string> + <string>Shows folders that do not have any visible contents when applying a filter to inventory</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>SpeakingColor</key> + <key>ShowHoverTips</key> <map> <key>Comment</key> - <string>Color of various indicators when resident is speaking on a voice channel.</string> + <string>Show descriptive tooltip when mouse hovers over items in world</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.0</real> - <real>1.0</real> - <real>0.0</real> - <real>1.0</real> - </array> + <integer>1</integer> </map> - <key>SpeedTest</key> + <key>ShowLandHoverTip</key> <map> <key>Comment</key> - <string>Performance testing mode, no network</string> + <string>Show descriptive tooltip when mouse hovers over land</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -9037,359 +6699,376 @@ <key>Value</key> <integer>0</integer> </map> - <key>StatsAutoRun</key> + <key>ShowLeaders</key> <map> <key>Comment</key> - <string>Play back autopilot</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>StatsFile</key> + <key>ShowPGSearchAll</key> <map> <key>Comment</key> - <string>Filename for stats logging output</string> + <string>Display results of search All that are flagged as PG</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>fs.txt</string> + <integer>1</integer> </map> - <key>StatsNumRuns</key> + <key>ShowMatureSearchAll</key> <map> <key>Comment</key> - <string>Loop autopilot playback this number of times</string> + <string>Display results of search All that are flagged as mature</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>-1</integer> + <integer>0</integer> </map> - <key>StatsPilotFile</key> + <key>ShowAdultSearchAll</key> <map> <key>Comment</key> - <string>Filename for stats logging autopilot path</string> + <string>Display results of search All that are flagged as adult</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>pilot.txt</string> + <integer>0</integer> </map> - <key>StatsQuitAfterRuns</key> + <key>ShowPGGroups</key> <map> <key>Comment</key> - <string>Quit application after this number of autopilot playback runs</string> + <string>Display results of find groups that are flagged as PG</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> - <key>StatsSessionTrackFrameStats</key> + <key>ShowMatureGroups</key> <map> <key>Comment</key> - <string>Track rendering and network statistics</string> + <string>Display results of find groups that are flagged as mature</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>StatsSummaryFile</key> + <key>ShowAdultGroups</key> <map> <key>Comment</key> - <string>Filename for stats logging summary</string> + <string>Display results of find groups that are flagged as adult</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>fss.txt</string> + <integer>0</integer> </map> - <key>StatusBarHeight</key> + <key>ShowPGClassifieds</key> <map> <key>Comment</key> - <string>Height of menu/status bar at top of screen (pixels)</string> + <string>Display results of find classifieds that are flagged as PG</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>26</integer> + <integer>1</integer> </map> - <key>StatusBarPad</key> + <key>ShowMatureClassifieds</key> <map> <key>Comment</key> - <string>Spacing between popup buttons at bottom of screen (Stand up, Release Controls)</string> + <string>Display results of find classifieds that are flagged as mature</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> - <integer>10</integer> + <integer>0</integer> </map> - <key>SystemChatColor</key> + <key>ShowAdultClassifieds</key> <map> <key>Comment</key> - <string>Color of chat messages from SL System</string> + <string>Display results of find classifieds that are flagged as adult</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>Color4</string> + <string>Boolean</string> <key>Value</key> - <array> - <real>0.800000011921</real> - <real>1.0</real> - <real>1.0</real> - <real>1.0</real> - </array> + <integer>0</integer> </map> - <key>SystemLanguage</key> + <key>ShowPGEvents</key> <map> <key>Comment</key> - <string>Language indicated by system settings (for UI)</string> + <string>Display results of find events that are flagged as PG</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>en-us</string> + <integer>1</integer> </map> - <key>TabToTextFieldsOnly</key> + <key>ShowMatureEvents</key> <map> <key>Comment</key> - <string>TAB key takes you to next text entry field, instead of next widget</string> + <string>Display results of find events that are flagged as mature</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>TerrainColorHeightRange</key> + <key>ShowAdultEvents</key> <map> <key>Comment</key> - <string>Altitude range over which a given terrain texture has effect (meters)</string> + <string>Display results of find events that are flagged as adult</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>60.0</real> + <integer>0</integer> </map> - <key>TerrainColorStartHeight</key> + <key>ShowPGLand</key> <map> <key>Comment</key> - <string>Starting altitude for terrain texturing (meters)</string> + <string>Display results of find land sales that are flagged as PG</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>20.0</real> + <integer>1</integer> </map> - <key>TextureMemory</key> + <key>ShowMatureLand</key> <map> <key>Comment</key> - <string>Amount of memory to use for textures in MB (0 = autodetect)</string> + <string>Display results of find land sales that are flagged as mature</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>TexturePickerRect</key> + <key>ShowAdultLand</key> <map> <key>Comment</key> - <string>Rectangle for texture picker</string> + <string>Display results of find land sales that are flagged as adult</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>290</integer> - <integer>350</integer> - <integer>0</integer> - </array> + <integer>0</integer> </map> - <key>TexturePickerShowFolders</key> + <key>ShowPGSims</key> <map> <key>Comment</key> - <string>Show folders with no texures in texture picker</string> + <string>Display results of find places or find popular that are in PG sims</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>1</integer> </map> - <key>TexturePickerSortOrder</key> + <key>ShowMatureSims</key> <map> <key>Comment</key> - <string>Specifies sort key for textures in texture picker (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)</string> + <string>Display results of find places or find popular that are in mature sims</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>U32</string> + <string>Boolean</string> <key>Value</key> - <integer>2</integer> + <integer>0</integer> </map> - <key>ThirdPersonBtnState</key> + <key>ShowAdultSims</key> <map> <key>Comment</key> - <string /> + <string>Display results of find places or find popular that are in adult sims</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>ThrottleBandwidthKBPS</key> + <key>ShowMovementControls</key> <map> <key>Comment</key> - <string>Maximum allowable downstream bandwidth (kilo bits per second)</string> + <string>Display movement controls on login</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>500.0</real> + <integer>1</integer> </map> - <key>ToolHelpRect</key> + <key>ShowNearClip</key> <map> <key>Comment</key> <string /> <key>Persist</key> <integer>0</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>8</integer> - <integer>178</integer> - <integer>75</integer> - <integer>162</integer> - </array> + <integer>0</integer> </map> - <key>ToolTipDelay</key> + <key>ShowNewInventory</key> <map> <key>Comment</key> - <string>Seconds before displaying tooltip when mouse stops over UI element</string> + <string>Automatically views new notecards/textures/landmarks</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>0.699999988079</real> + <integer>1</integer> </map> - <key>ToolboxAutoMove</key> + <key>ShowInInventory</key> + <map> + <key>Comment</key> + <string>Automatically opens inventory to show accepted objects</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>ShowObjectUpdates</key> <map> <key>Comment</key> - <string>[NOT USED]</string> + <string>Show when update messages are received for individual objects</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>ToolboxRect</key> + <key>ShowOverlayTitle</key> <map> <key>Comment</key> - <string>Rectangle for tools window</string> + <string>Prints watermark text message on screen</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>0</integer> - <integer>100</integer> - <integer>100</integer> - <integer>100</integer> - </array> + <integer>0</integer> </map> - <key>TrackFocusObject</key> + <key>ShowParcelOwners</key> <map> <key>Comment</key> - <string>Camera tracks last object zoomed on</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>TurnLeftBtnRect</key> + <key>ShowPermissions</key> <map> <key>Comment</key> <string /> <key>Persist</key> <integer>0</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>20</integer> - <integer>29</integer> - <integer>45</integer> - <integer>4</integer> - </array> + <integer>0</integer> </map> - <key>TurnRightBtnRect</key> + <key>ShowPropertyLines</key> <map> <key>Comment</key> - <string /> + <string>Show line overlay demarking property boundaries</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>Rect</string> + <string>Boolean</string> <key>Value</key> - <array> - <integer>66</integer> - <integer>29</integer> - <integer>91</integer> - <integer>4</integer> - </array> + <integer>0</integer> </map> - <key>TutorialURL</key> + <key>ShowSearchBar</key> <map> <key>Comment</key> - <string>URL for tutorial menu item, set automatically during login</string> + <string>Show the Search Bar in the Status Overlay</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string /> + <integer>0</integer> </map> - <key>TypeAheadTimeout</key> + <key>ShowNetStats</key> <map> <key>Comment</key> - <string>Time delay before clearing type-ahead buffer in lists (seconds)</string> + <string>Show the Search Bar in the Status Overlay</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>Boolean</string> <key>Value</key> - <real>1.5</real> + <integer>0</integer> </map> - <key>UIAutoScale</key> + <key>ShowSelectionBeam</key> <map> <key>Comment</key> - <string>Keep UI scale consistent across different resolutions</string> + <string>Show selection particle beam when selecting or interacting with objects.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -9397,10 +7076,10 @@ <key>Value</key> <integer>1</integer> </map> - <key>UIFloaterTestBool</key> + <key>ShowStartLocation</key> <map> <key>Comment</key> - <string>Example saved setting for the test floater</string> + <string>Display starting location menu on login screen</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -9408,720 +7087,724 @@ <key>Value</key> <integer>0</integer> </map> - <key>UIImgBtnCloseActiveUUID</key> + <key>ShowTangentBasis</key> <map> <key>Comment</key> - <string /> + <string>Render normal and binormal (debugging bump mapping)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>47a8c844-cd2a-4b1a-be01-df8b1612fe5d</string> - </map> - <key>UIImgBtnCloseInactiveUUID</key> - <map> - <key>Comment</key> - <string /> - <key>Persist</key> <integer>0</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string>779e4fa3-9b13-f74a-fba9-3886fe9c86ba</string> </map> - <key>UIImgBtnClosePressedUUID</key> + <key>ShowToolBar</key> <map> <key>Comment</key> - <string /> + <string>Show toolbar at bottom of screen</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>e5821134-23c0-4bd0-af06-7fa95b9fb01a</string> + <integer>1</integer> </map> - <key>UIImgBtnForwardInUUID</key> + <key>ShowTools</key> <map> <key>Comment</key> <string /> <key>Persist</key> <integer>0</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>54197a61-f5d1-4c29-95d2-c071d08849cb</string> + <integer>0</integer> </map> - <key>UIImgBtnForwardOutUUID</key> + <key>ShowTutorial</key> + <map> + <key>Comment</key> + <string>Show tutorial window on login</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>ShowVoiceChannelPopup</key> <map> <key>Comment</key> - <string /> + <string>Controls visibility of the current voice channel popup above the voice tab</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>a0eb4021-1b20-4a53-892d-8faa9265a6f5</string> + <integer>0</integer> </map> - <key>UIImgBtnJumpLeftInUUID</key> + <key>ShowVolumeSettingsPopup</key> <map> <key>Comment</key> - <string /> + <string>Show individual volume slider for voice, sound effects, etc</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>9cad3e6d-2d6d-107d-f8ab-5ba272b5bfe1</string> + <integer>0</integer> </map> - <key>UIImgBtnJumpLeftOutUUID</key> + <key>ShowXUINames</key> <map> <key>Comment</key> - <string /> + <string>Display XUI Names as Tooltips</string> <key>Persist</key> <integer>0</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>3c18c87e-5f50-14e2-e744-f44734aa365f</string> + <integer>0</integer> </map> - <key>UIImgBtnJumpRightInUUID</key> + <key>SitBtnState</key> <map> <key>Comment</key> <string /> <key>Persist</key> <integer>0</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>7dabc040-ec13-2309-ddf7-4f161f6de2f4</string> + <integer>0</integer> </map> - <key>UIImgBtnJumpRightOutUUID</key> + <key>SkinCurrent</key> <map> <key>Comment</key> - <string /> + <string>The currently selected skin.</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>ff9a71eb-7414-4cf8-866e-a701deb7c3cf</string> + <string>default</string> </map> - <key>UIImgBtnLeftInUUID</key> + <key>SkinningSettingsFile</key> <map> <key>Comment</key> - <string /> + <string>Client skin color setting file name (per install).</string> <key>Persist</key> <integer>0</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>95463c78-aaa6-464d-892d-3a805b6bb7bf</string> + <string /> </map> - <key>UIImgBtnLeftOutUUID</key> + <key>SkyAmbientScale</key> <map> <key>Comment</key> - <string /> + <string>Controls strength of ambient, or non-directional light from the sun and moon (fraction or multiple of default ambient level)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>13a93910-6b44-45eb-ad3a-4d1324c59bac</string> + <real>0.300000011921</real> </map> - <key>UIImgBtnMinimizeActiveUUID</key> + <key>SkyEditPresets</key> <map> <key>Comment</key> - <string /> + <string>Whether to be able to edit the sky defaults or not</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>34c9398d-bb78-4643-9633-46a2fa3e9637</string> + <integer>0</integer> </map> - <key>UIImgBtnMinimizeInactiveUUID</key> + <key>SkyOverrideSimSunPosition</key> <map> <key>Comment</key> <string /> <key>Persist</key> <integer>0</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>6e72abba-1378-437f-bf7a-f0c15f3e99a3</string> + <integer>0</integer> </map> - <key>UIImgBtnMinimizePressedUUID</key> + <key>SkySunDefaultPosition</key> <map> <key>Comment</key> - <string /> + <string>Default position of sun in sky (direction in world coordinates)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Vector3</string> <key>Value</key> - <string>39801651-26cb-4926-af57-7af9352c273c</string> + <array> + <real>1.0</real> + <real>0.0</real> + <real>0.1</real> + </array> </map> - <key>UIImgBtnMoveDownInUUID</key> + <key>SkyUseClassicClouds</key> <map> <key>Comment</key> - <string /> + <string>Whether to use the old Second Life particle clouds or not</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>b92a70b9-c841-4c94-b4b3-cee9eb460d48</string> + <integer>1</integer> </map> - <key>UIImgBtnMoveDownOutUUID</key> + <key>SmallAvatarNames</key> <map> <key>Comment</key> - <string /> + <string>Display avatar name text in smaller font</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>b5abc9fa-9e62-4e03-bc33-82c4c1b6b689</string> + <integer>1</integer> </map> - <key>UIImgBtnMoveUpInUUID</key> + <key>SnapEnabled</key> <map> <key>Comment</key> - <string /> + <string>Enable snapping to grid</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>49b4b357-e430-4b56-b9e0-05b8759c3c82</string> + <integer>1</integer> </map> - <key>UIImgBtnMoveUpOutUUID</key> + <key>SnapMargin</key> <map> <key>Comment</key> - <string /> + <string>Controls maximum distance between windows before they auto-snap together (pixels)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>f887146d-829f-4e39-9211-cf872b78f97c</string> + <integer>10</integer> </map> - <key>UIImgBtnPanDownInUUID</key> + <key>SnapToMouseCursor</key> <map> <key>Comment</key> - <string /> + <string>When snapping to grid, center object on nearest grid point to mouse cursor</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>e5821134-23c0-4bd0-af06-7fa95b9fb01a</string> + <integer>0</integer> </map> - <key>UIImgBtnPanDownOutUUID</key> + <key>SnapshotFormat</key> <map> <key>Comment</key> - <string /> + <string>Save snapshots in this format (0 = PNG, 1 = JPEG, 2 = BMP)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>47a8c844-cd2a-4b1a-be01-df8b1612fe5d</string> - </map> - <key>UIImgBtnPanLeftInUUID</key> + <integer>0</integer> + </map> + <key>SnapshotLocalLastResolution</key> <map> <key>Comment</key> - <string /> + <string>Take next local snapshot at this resolution</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>e5821134-23c0-4bd0-af06-7fa95b9fb01a</string> + <integer>0</integer> </map> - <key>UIImgBtnPanLeftOutUUID</key> + <key>SnapshotPostcardLastResolution</key> <map> <key>Comment</key> - <string /> + <string>Take next postcard snapshot at this resolution</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>47a8c844-cd2a-4b1a-be01-df8b1612fe5d</string> + <integer>0</integer> </map> - <key>UIImgBtnPanRightInUUID</key> + <key>SnapshotQuality</key> <map> <key>Comment</key> - <string /> + <string>Quality setting of postcard JPEGs (0 = worst, 100 = best)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>e5821134-23c0-4bd0-af06-7fa95b9fb01a</string> + <integer>75</integer> </map> - <key>UIImgBtnPanRightOutUUID</key> + <key>SnapshotTextureLastResolution</key> <map> <key>Comment</key> - <string /> + <string>Take next texture snapshot at this resolution</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>47a8c844-cd2a-4b1a-be01-df8b1612fe5d</string> + <integer>0</integer> </map> - <key>UIImgBtnPanUpInUUID</key> + <key>SpeedTest</key> <map> <key>Comment</key> - <string /> + <string>Performance testing mode, no network</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>e5821134-23c0-4bd0-af06-7fa95b9fb01a</string> + <integer>0</integer> </map> - <key>UIImgBtnPanUpOutUUID</key> + <key>StatsAutoRun</key> <map> <key>Comment</key> - <string /> + <string>Play back autopilot</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>47a8c844-cd2a-4b1a-be01-df8b1612fe5d</string> + <integer>0</integer> </map> - <key>UIImgBtnRestoreActiveUUID</key> + <key>StatsFile</key> <map> <key>Comment</key> - <string /> + <string>Filename for stats logging output</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>111b39de-8928-4690-b7b2-e17d5c960277</string> + <string>fs.txt</string> </map> - <key>UIImgBtnRestoreInactiveUUID</key> + <key>StatsNumRuns</key> <map> <key>Comment</key> - <string /> + <string>Loop autopilot playback this number of times</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>0eafa471-70af-4882-b8c1-40a310929744</string> + <integer>-1</integer> </map> - <key>UIImgBtnRestorePressedUUID</key> + <key>StatsPilotFile</key> <map> <key>Comment</key> - <string /> + <string>Filename for stats logging autopilot path</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>90a0ed5c-2e7b-4845-9958-a64a1b30f312</string> + <string>pilot.txt</string> </map> - <key>UIImgBtnRightInUUID</key> + <key>StatsQuitAfterRuns</key> <map> <key>Comment</key> - <string /> + <string>Quit application after this number of autopilot playback runs</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>5e616d0d-4335-476f-9977-560bccd009da</string> + <integer>0</integer> </map> - <key>UIImgBtnRightOutUUID</key> + <key>StatsSessionTrackFrameStats</key> <map> <key>Comment</key> - <string /> + <string>Track rendering and network statistics</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>5a44fd04-f52b-4c30-8b00-4a31e27614bd</string> + <integer>0</integer> </map> - <key>UIImgBtnScrollDownInUUID</key> + <key>StatsSummaryFile</key> <map> <key>Comment</key> - <string /> + <string>Filename for stats logging summary</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>d2421bab-2eaf-4863-b8f6-5e4c52519247</string> + <string>fss.txt</string> </map> - <key>UIImgBtnScrollDownOutUUID</key> + <key>SystemLanguage</key> <map> <key>Comment</key> - <string /> + <string>Language indicated by system settings (for UI)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>b4ecdecf-5c8d-44e7-b882-17a77e88ed55</string> + <string>en</string> </map> - <key>UIImgBtnScrollLeftInUUID</key> + <key>TabToTextFieldsOnly</key> <map> <key>Comment</key> - <string /> + <string>TAB key takes you to next text entry field, instead of next widget</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>ea137a32-6718-4d05-9c22-7d570d27b2cd</string> + <integer>0</integer> </map> - <key>UIImgBtnScrollLeftOutUUID</key> + <key>TerrainColorHeightRange</key> <map> <key>Comment</key> - <string /> + <string>Altitude range over which a given terrain texture has effect (meters)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>43773e8d-49aa-48e0-80f3-a04715f4677a</string> + <real>60.0</real> </map> - <key>UIImgBtnScrollRightInUUID</key> + <key>TerrainColorStartHeight</key> <map> <key>Comment</key> - <string /> + <string>Starting altitude for terrain texturing (meters)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>b749de64-e903-4c3c-ac0b-25fb6fa39cb5</string> + <real>20.0</real> </map> - <key>UIImgBtnScrollRightOutUUID</key> + <key>TextureMemory</key> <map> <key>Comment</key> - <string /> + <string>Amount of memory to use for textures in MB (0 = autodetect)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>3d700d19-e708-465d-87f2-46c8c0ee7938</string> + <integer>0</integer> </map> - <key>UIImgBtnScrollUpInUUID</key> + <key>TexturePickerShowFolders</key> <map> <key>Comment</key> - <string /> + <string>Show folders with no texures in texture picker</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>a93abdf3-27b5-4e22-a8fa-c48216cd2e3a</string> + <integer>1</integer> </map> - <key>UIImgBtnScrollUpOutUUID</key> + <key>TexturePickerSortOrder</key> <map> <key>Comment</key> - <string /> + <string>Specifies sort key for textures in texture picker (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>U32</string> <key>Value</key> - <string>dad084d7-9a46-452a-b0ff-4b9f1cefdde9</string> + <integer>2</integer> </map> - <key>UIImgBtnSlideLeftInUUID</key> + <key>ThirdPersonBtnState</key> <map> <key>Comment</key> <string /> <key>Persist</key> <integer>0</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>724996f5-b956-46f6-9844-4fcfce1d5e83</string> + <integer>1</integer> </map> - <key>UIImgBtnSlideLeftOutUUID</key> + <key>ThrottleBandwidthKBPS</key> <map> <key>Comment</key> - <string /> + <string>Maximum allowable downstream bandwidth (kilo bits per second)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>82476321-0374-4c26-9567-521535ab4cd7</string> + <real>500.0</real> </map> - <key>UIImgBtnSlideRightInUUID</key> + <key>ToolTipDelay</key> <map> <key>Comment</key> - <string /> + <string>Seconds before displaying tooltip when mouse stops over UI element</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>7eeb57d2-3f37-454d-a729-8b217b8be443</string> + <real>0.699999988079</real> </map> - <key>UIImgBtnSlideRightOutUUID</key> + <key>ToolboxAutoMove</key> <map> <key>Comment</key> - <string /> + <string>[NOT USED]</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>1fbe4e60-0607-44d1-a50a-032eff56ae75</string> + <integer>0</integer> </map> - <key>UIImgBtnSpinDownInUUID</key> + <key>TrackFocusObject</key> <map> <key>Comment</key> - <string /> + <string>Camera tracks last object zoomed on</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>a985ac71-052f-48e6-9c33-d931c813ac92</string> + <integer>1</integer> </map> - <key>UIImgBtnSpinDownOutUUID</key> + <key>TutorialURL</key> <map> <key>Comment</key> - <string /> + <string>URL for tutorial menu item, set automatically during login</string> <key>Persist</key> <integer>0</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>b6d240dd-5602-426f-b606-bbb49a30726d</string> + <string /> </map> - <key>UIImgBtnSpinUpInUUID</key> + <key>TypeAheadTimeout</key> <map> <key>Comment</key> - <string /> + <string>Time delay before clearing type-ahead buffer in lists (seconds)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>c8450082-96a0-4319-8090-d3ff900b4954</string> + <real>1.5</real> </map> - <key>UIImgBtnSpinUpOutUUID</key> + <key>UIAutoScale</key> <map> <key>Comment</key> - <string /> + <string>Keep UI scale consistent across different resolutions</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>56576e6e-6710-4e66-89f9-471b59122794</string> + <integer>1</integer> </map> - <key>UIImgBtnTabBottomInUUID</key> + <key>UIAvatariconctrlSymbolHPad</key> <map> <key>Comment</key> - <string /> + <string>UI Avatar Icon Control Symbol Horizontal Pad</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>c001d8fd-a869-4b6f-86a1-fdcb106df9c7</string> - </map> - <key>UIImgBtnTabBottomOutUUID</key> + <real>2</real> + </map> + <key>UIAvatariconctrlSymbolVPad</key> <map> <key>Comment</key> - <string /> + <string>UI Avatar Icon Control Symbol Vertical Pad</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>bf0a8779-689b-48c3-bb9a-6af546366ef4</string> - </map> - <key>UIImgBtnTabBottomPartialInUUID</key> + <real>2</real> + </map> + <key>UIAvatariconctrlSymbolSize</key> <map> <key>Comment</key> - <string /> + <string>UI Avatar Icon Control Symbol Size</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>eb0b0904-8c91-4f24-b500-1180b91140de</string> - </map> - <key>UIImgBtnTabBottomPartialOutUUID</key> + <real>5</real> + </map> + <key>UIAvatariconctrlSymbolPosition</key> <map> <key>Comment</key> - <string /> + <string>UI Avatar Icon Control Symbol Position (TopLeft|TopRight|BottomLeft|BottomRight)</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>8dca716c-b29c-403a-9886-91c028357d6e</string> + <string>BottomRight</string> </map> - <key>UIImgBtnTabTopInUUID</key> + <key>UIButtonOrigHPad</key> <map> <key>Comment</key> - <string /> + <string>UI Button Original Horizontal Pad</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>16d032e8-817b-4368-8a4e-b7b947ae3889</string> + <real>6</real> </map> - <key>UIImgBtnTabTopOutUUID</key> + <key>UICheckboxctrlBtnSize</key> <map> <key>Comment</key> - <string /> + <string>UI Checkbox Control Button Size</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>1ed83f57-41cf-4052-a3b4-2e8bb78d8191</string> + <real>13</real> </map> - <key>UIImgBtnTabTopPartialInUUID</key> + <key>UICheckboxctrlHeight</key> <map> <key>Comment</key> - <string /> + <string>UI Checkbox Control Height</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>7c6c6c26-0e25-4438-89bd-30d8b8e9d704</string> + <real>16</real> </map> - <key>UIImgBtnTabTopPartialOutUUID</key> + <key>UICheckboxctrlHPad</key> <map> <key>Comment</key> - <string /> + <string>UI Checkbox Control Horizontal Pad</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>932ad585-0e45-4a57-aa23-4cf81beeb7b0</string> + <real>2</real> </map> - <key>UIImgBtnTearOffActiveUUID</key> + <key>UICheckboxctrlSpacing</key> <map> <key>Comment</key> - <string /> + <string>UI Checkbox Control Spacing</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>74e1a96f-4833-a24d-a1bb-1bce1468b0e7</string> + <real>5</real> </map> - <key>UIImgBtnTearOffInactiveUUID</key> + <key>UICheckboxctrlVPad</key> <map> <key>Comment</key> - <string /> + <string>UI Checkbox Control Vertical Pad</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>74e1a96f-4833-a24d-a1bb-1bce1468b0e7</string> + <real>2</real> </map> - <key>UIImgBtnTearOffPressedUUID</key> + <key>UICloseBoxFromTop</key> <map> <key>Comment</key> - <string /> + <string>Size of UI floater close box from top</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>d2524c13-4ba6-af7c-e305-8ac6cc18d86a</string> + <real>1</real> </map> - <key>UIImgCheckboxActiveSelectedUUID</key> + <key>UIExtraTriangleHeight</key> <map> <key>Comment</key> - <string /> + <string>UI extra triangle height</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>cf4a2ed7-1533-4686-9dde-df9a37ddca55</string> + <real>-2</real> </map> - <key>UIImgCheckboxActiveUUID</key> + <key>UIExtraTriangleWidth</key> <map> <key>Comment</key> - <string /> + <string>UI extra triangle width</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>05bb64ee-96fd-4243-b74e-f40a41bc53ba</string> + <real>2</real> </map> - <key>UIImgCheckboxInactiveSelectedUUID</key> + <key>UIFloaterCloseBoxSize</key> <map> <key>Comment</key> - <string /> + <string>Size of UI floater close box size</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>c817c642-9abd-4236-9287-ae0513fe7d2b</string> + <real>16</real> </map> - <key>UIImgCheckboxInactiveUUID</key> + <key>UIFloaterHeaderSize</key> <map> <key>Comment</key> - <string /> + <string>Size of UI floater header size</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>7d94cb59-32a2-49bf-a516-9e5a2045f9d9</string> + <real>18</real> </map> - <key>UIImgCreateSelectedUUID</key> + <key>UIFloaterHPad</key> <map> <key>Comment</key> - <string /> + <string>Size of UI floater horizontal pad</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>0098b015-3daf-4cfe-a72f-915369ea97c2</string> + <real>6</real> </map> - <key>UIImgCreateUUID</key> + <key>UIFloaterTestBool</key> <map> <key>Comment</key> - <string /> + <string>Example saved setting for the test floater</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>7a0b1bdb-b5d9-4df5-bac2-ba230da93b5b</string> + <integer>0</integer> </map> - <key>UIImgCrosshairsUUID</key> + <key>UIFloaterVPad</key> <map> <key>Comment</key> - <string>Image to use for crosshair display (UUID texture reference)</string> + <string>Size of UI floater vertical pad</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>6e1a3980-bf2d-4274-8970-91e60d85fb52</string> + <real>6</real> </map> <key>UIImgDefaultEyesUUID</key> <map> @@ -10222,7 +7905,7 @@ <key>Value</key> <string>5748decc-f629-461c-9a36-a35a221fe21f</string> </map> - <key>UIImgDefaultUnderwearUUID</key> + <key>UIImgDefaultAlphaUUID</key> <map> <key>Comment</key> <string /> @@ -10233,7 +7916,7 @@ <key>Value</key> <string>5748decc-f629-461c-9a36-a35a221fe21f</string> </map> - <key>UIImgDirectionArrowUUID</key> + <key>UIImgDefaultTattooUUID</key> <map> <key>Comment</key> <string /> @@ -10242,9 +7925,9 @@ <key>Type</key> <string>String</string> <key>Value</key> - <string>586383e8-4d9b-4fba-9196-2b5938e79c2c</string> + <string>5748decc-f629-461c-9a36-a35a221fe21f</string> </map> - <key>UIImgFaceSelectedUUID</key> + <key>UIImgDefaultUnderwearUUID</key> <map> <key>Comment</key> <string /> @@ -10253,9 +7936,9 @@ <key>Type</key> <string>String</string> <key>Value</key> - <string>b4870163-6208-42a9-9801-93133bf9a6cd</string> + <string>5748decc-f629-461c-9a36-a35a221fe21f</string> </map> - <key>UIImgFaceUUID</key> + <key>UIImgWhiteUUID</key> <map> <key>Comment</key> <string /> @@ -10264,194 +7947,238 @@ <key>Type</key> <string>String</string> <key>Value</key> - <string>ce15fd63-b0b6-463c-a37d-ea6393208b3e</string> + <string>5748decc-f629-461c-9a36-a35a221fe21f</string> </map> - <key>UIImgFocusSelectedUUID</key> + <key>UILineEditorCursorThickness</key> <map> <key>Comment</key> - <string /> + <string>UI Line Editor Cursor Thickness</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>ab6a730e-ddfd-4982-9a32-c6de3de6d31d</string> + <integer>2</integer> </map> - <key>UIImgFocusUUID</key> + <key>UILineEditorHPad</key> <map> <key>Comment</key> - <string /> + <string>UI Line Editor Horizontal Pad</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>57bc39d1-288c-4519-aea6-6d1786a5c274</string> + <integer>2</integer> </map> - <key>UIImgGrabSelectedUUID</key> + <key>UILineEditorVPad</key> <map> <key>Comment</key> - <string /> + <string>UI Line Editor Vertical Pad</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>c1e21504-f136-451d-b8e9-929037812f1d</string> + <integer>1</integer> </map> - <key>UIImgGrabUUID</key> + <key>UIMaxComboWidth</key> <map> <key>Comment</key> - <string /> + <string>Maximum width of combo box</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>c63f124c-6340-4fbf-b59e-0869a44adb64</string> + <real>500</real> </map> - <key>UIImgMoveSelectedUUID</key> + <key>UIMinimizedWidth</key> <map> <key>Comment</key> - <string /> + <string>Size of UI floater minimized width</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>46f17c7b-8381-48c3-b628-6a406e060dd6</string> + <real>160</real> </map> - <key>UIImgMoveUUID</key> + <key>UIMultiSliderctrlSpacing</key> <map> <key>Comment</key> - <string /> + <string>UI multi slider ctrl spacing</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>2fa5dc06-bcdd-4e09-a426-f9f262d4fa65</string> + <real>4</real> </map> - <key>UIImgRadioActiveSelectedUUID</key> + <key>UIMultiTrackHeight</key> <map> <key>Comment</key> - <string /> + <string>UI multi track height</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>52f09e07-5816-4052-953c-94c6c10479b7</string> + <real>6</real> </map> - <key>UIImgRadioActiveUUID</key> + <key>UIPreeditMarkerBrightness</key> <map> <key>Comment</key> - <string /> + <string>UI Preedit Marker Brightness</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>7a1ba9b8-1047-4d1e-9cfc-bc478c80b63f</string> + <real>0.4</real> </map> - <key>UIImgRadioInactiveSelectedUUID</key> + <key>UIPreeditMarkerGap</key> <map> <key>Comment</key> - <string /> + <string>UI Preedit Marker Gap</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>1975db39-aa29-4251-aea0-409ac09d414d</string> + <real>1</real> </map> - <key>UIImgRadioInactiveUUID</key> + <key>UIPreeditMarkerPosition</key> <map> <key>Comment</key> - <string /> + <string>UI Preedit Marker Position</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>90688481-67ff-4af0-be69-4aa084bcad1e</string> + <real>1</real> </map> - <key>UIImgResizeBottomRightUUID</key> + <key>UIPreeditMarkerThickness</key> <map> <key>Comment</key> - <string /> + <string>UI Preedit Marker Thickness</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>e3690e25-9690-4f6c-a745-e7dcd885285a</string> + <real>1</real> </map> - <key>UIImgRotateSelectedUUID</key> + <key>UIPreeditStandoutBrightness</key> <map> <key>Comment</key> - <string /> + <string>UI Preedit Standout Brightness</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>cdfb7fde-0d13-418a-9d89-2bd91019fc95</string> + <real>0.6</real> </map> - <key>UIImgRotateUUID</key> + <key>UIPreeditStandoutGap</key> <map> <key>Comment</key> - <string /> + <string>UI Preedit Standout Gap</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> + <key>Value</key> + <real>1</real> + </map> + <key>UIPreeditStandoutPosition</key> + <map> + <key>Comment</key> + <string>UI Preedit Standout Position</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <real>2</real> + </map> + <key>UIPreeditStandoutThickness</key> + <map> + <key>Comment</key> + <string>UI Preedit Standout Thickness</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <real>2</real> + </map> + <key>UIResizeBarHeight</key> + <map> + <key>Comment</key> + <string>Size of UI resize bar height</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <real>3</real> + </map> + <key>UIResizeBarOverlap</key> + <map> + <key>Comment</key> + <string>Size of UI resize bar overlap</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> <key>Value</key> - <string>c34b1eaa-aae3-4351-b082-e26c0b636779</string> + <real>1</real> </map> - <key>UIImgScaleSelectedUUID</key> + <key>UIScaleFactor</key> <map> <key>Comment</key> - <string /> + <string>Size of UI relative to default layout on 1024x768 screen</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>F32</string> <key>Value</key> - <string>55aa57ef-508a-47f7-8867-85d21c5a810d</string> + <real>1.0</real> </map> - <key>UIImgScaleUUID</key> + <key>UIScrollbarSize</key> <map> <key>Comment</key> - <string /> + <string>UI scrollbar size</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>88a90fef-b448-4883-9344-ecf378a60433</string> + <real>16</real> </map> - <key>UIImgWhiteUUID</key> + <key>UISliderctrlHeight</key> <map> <key>Comment</key> - <string /> + <string>UI slider ctrl height</string> <key>Persist</key> - <integer>0</integer> + <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>5748decc-f629-461c-9a36-a35a221fe21f</string> + <real>16</real> </map> - <key>UIScaleFactor</key> + <key>UISliderctrlSpacing</key> <map> <key>Comment</key> - <string>Size of UI relative to default layout on 1024x768 screen</string> + <string>UI slider ctrl spacing</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>F32</string> + <string>S32</string> <key>Value</key> - <real>1.0</real> + <real>4</real> </map> <key>UISndAlert</key> <map> @@ -10816,286 +8543,197 @@ <key>Value</key> <string>c80260ba-41fd-8a46-768a-6bf236360e3a</string> </map> - <key>UploadBakedTexOld</key> - <map> - <key>Comment</key> - <string>Forces the baked texture pipeline to upload using the old method.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>UseAltKeyForMenus</key> - <map> - <key>Comment</key> - <string>Access menus via keyboard by tapping Alt</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>UseChatBubbles</key> - <map> - <key>Comment</key> - <string>Show chat above avatars head in chat bubbles</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>UseDebugLogin</key> - <map> - <key>Comment</key> - <string>Provides extra control over which grid to connect to</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>UseDebugMenus</key> - <map> - <key>Comment</key> - <string>Turns on "Debug" menu</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>UseDefaultColorPicker</key> + <key>UISpinctrlBtnHeight</key> <map> <key>Comment</key> - <string>Use color picker supplied by operating system</string> + <string>UI spin control button height</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>UseEnergy</key> - <map> - <key>Comment</key> - <string /> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>8</integer> </map> - <key>UseExternalBrowser</key> + <key>UISpinctrlBtnWidth</key> <map> <key>Comment</key> - <string>Use default browser when opening web pages instead of in-world browser.</string> + <string>UI spin control button width</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>16</integer> </map> - <key>UseFreezeFrame</key> + <key>UISpinctrlDefaultLabelWidth</key> <map> <key>Comment</key> - <string>Freeze time when taking snapshots.</string> + <string>UI spin control default label width</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>10</integer> </map> - <key>UseOcclusion</key> + <key>UISpinctrlSpacing</key> <map> <key>Comment</key> - <string>Enable object culling based on occlusion (coverage) by other objects</string> + <string>UI spin control spacing</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>2</integer> </map> - <key>RenderDelayVBUpdate</key> + <key>UITabCntrArrowBtnSize</key> <map> <key>Comment</key> - <string>Delay vertex buffer updates until just before rendering</string> + <string>UI Tab Container Arrow Button Size</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>16</integer> </map> - <key>UseStartScreen</key> + <key>UITabCntrvArrowBtnSize</key> <map> <key>Comment</key> - <string>Whether to load a start screen image or not.</string> + <string>UI Tab Container V Arrow Button Size</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>16</integer> </map> - <key>UseWebPagesOnPrims</key> + <key>UITabCntrvPad</key> <map> <key>Comment</key> - <string>[NOT USED]</string> + <string>UI Tab Container V Pad</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> <integer>0</integer> </map> - <key>UserConnectionPort</key> + <key>UITabCntrButtonPanelOverlap</key> <map> <key>Comment</key> - <string>Port that this client transmits on.</string> + <string>UI Tab Container Button Panel Overlap</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>U32</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> - </map> - <key>UserLogFile</key> - <map> - <key>Comment</key> - <string>User specified log file name.</string> - <key>Persist</key> <integer>1</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string /> </map> - <key>UserLoginInfo</key> + <key>UITabCntrCloseBtnSize</key> <map> <key>Comment</key> - <string>Users loging data.</string> + <string>UI Tab Container Close Button Size</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>LLSD</string> + <string>S32</string> <key>Value</key> - <map> - </map> + <integer>16</integer> </map> - <key>VFSOldSize</key> + <key>UITabCntrTabHeight</key> <map> <key>Comment</key> - <string>[DO NOT MODIFY] Controls resizing of local file cache</string> + <string>UI Tab Container Tab Height</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>U32</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>16</integer> </map> - <key>VFSSalt</key> + <key>UITabCntrTabHPad</key> <map> <key>Comment</key> - <string>[DO NOT MODIFY] Controls local file caching behavior</string> + <string>UI Tab Container Tab Horizontal Pad</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>U32</string> + <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>4</integer> </map> - <key>VectorizeEnable</key> + <key>UITabCntrTabPartialWidth</key> <map> <key>Comment</key> - <string>Enable general vector operations and data alignment.</string> + <string>UI Tab Container Tab Partial Width</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>12</integer> </map> - <key>VectorizePerfTest</key> + <key>UITabCntrVertTabMinWidth</key> <map> <key>Comment</key> - <string>Test SSE/vectorization performance and choose fastest version.</string> + <string>UI Tab Container Vertical Tab Minimum Width</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>VectorizeProcessor</key> - <map> - <key>Comment</key> - <string>0=Compiler Default, 1=SSE, 2=SSE2, autodetected</string> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>U32</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>100</integer> </map> - <key>VectorizeSkin</key> + <key>UITabPadding</key> <map> <key>Comment</key> - <string>Enable vector operations for avatar skinning.</string> + <string>UI Tab Padding</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>15</integer> </map> - <key>VelocityInterpolate</key> + <key>UITextEditorBorder</key> <map> <key>Comment</key> - <string>Extrapolate object motion from last packet based on received velocity</string> + <string>UI Text Editor Border</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> <integer>1</integer> </map> - <key>VerboseLogs</key> + <key>UITextEditorHPad</key> <map> <key>Comment</key> - <string>Display source file and line number for each log item for debugging purposes</string> + <string>UI Text Horizontal Pad</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>4</integer> </map> - <key>VersionChannelName</key> + <key>UITextEditorVPadTop</key> <map> <key>Comment</key> - <string>Versioning Channel Name.</string> + <string>UI Text Vertical Pad Top</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>S32</string> <key>Value</key> - <string>Second Life Release</string> + <integer>4</integer> </map> - <key>VertexShaderEnable</key> + <key>UploadBakedTexOld</key> <map> <key>Comment</key> - <string>Enable/disable all GLSL shaders (debug)</string> + <string>Forces the baked texture pipeline to upload using the old method.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -11103,10 +8741,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>VivoxAutoPostCrashDumps</key> + <key>UseAltKeyForMenus</key> <map> <key>Comment</key> - <string>If true, SLVoice will automatically send crash dumps directly to Vivox.</string> + <string>Access menus via keyboard by tapping Alt</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -11114,43 +8752,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>VivoxDebugLevel</key> - <map> - <key>Comment</key> - <string>Logging level to use when launching the vivox daemon</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string>-1</string> - </map> - <key>VivoxDebugSIPURIHostName</key> - <map> - <key>Comment</key> - <string>Hostname portion of vivox SIP URIs (empty string for the default).</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string></string> - </map> - <key>VivoxDebugVoiceAccountServerURI</key> - <map> - <key>Comment</key> - <string>URI to the vivox account management server (empty string for the default).</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string></string> - </map> - <key>VoiceCallsFriendsOnly</key> + <key>UseChatBubbles</key> <map> <key>Comment</key> - <string>Only accept voice calls from residents on your friends list</string> + <string>Show chat above avatars head in chat bubbles</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -11158,186 +8763,187 @@ <key>Value</key> <integer>0</integer> </map> - <key>AutoDisengageMic</key> + <key>UseDebugLogin</key> <map> <key>Comment</key> - <string>Automatically turn off the microphone when ending IM calls.</string> + <string>Provides extra control over which grid to connect to</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>VoiceEarLocation</key> + <key>UseDebugMenus</key> <map> <key>Comment</key> - <string>Location of the virtual ear for voice</string> + <string>Turns on "Debug" menu</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> <integer>0</integer> </map> - <key>VoiceHost</key> + <key>UseDefaultColorPicker</key> <map> <key>Comment</key> - <string>Client SLVoice host to connect to</string> + <string>Use color picker supplied by operating system</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>127.0.0.1</string> + <integer>0</integer> </map> - <key>VoiceImageLevel0</key> + <key>UseEnergy</key> <map> <key>Comment</key> - <string>Texture UUID for voice image level 0</string> + <string /> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>041ee5a0-cb6a-9ac5-6e49-41e9320507d5</string> + <integer>1</integer> </map> - <key>VoiceImageLevel1</key> + <key>UseExternalBrowser</key> <map> <key>Comment</key> - <string>Texture UUID for voice image level 1</string> + <string>Use default browser when opening web pages instead of in-world browser.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>29de489d-0491-fb00-7dab-f9e686d31e83</string> + <integer>0</integer> </map> - <key>VoiceImageLevel2</key> + <key>UseFreezeFrame</key> <map> <key>Comment</key> - <string>Texture UUID for voice image level 2</string> + <string>Freeze time when taking snapshots.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>29de489d-0491-fb00-7dab-f9e686d31e83</string> + <integer>0</integer> </map> - <key>VoiceImageLevel3</key> + <key>UseOcclusion</key> <map> <key>Comment</key> - <string>Texture UUID for voice image level 3</string> + <string>Enable object culling based on occlusion (coverage) by other objects</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>29de489d-0491-fb00-7dab-f9e686d31e83</string> + <integer>1</integer> </map> - <key>VoiceImageLevel4</key> + <key>RenderDelayVBUpdate</key> <map> <key>Comment</key> - <string>Texture UUID for voice image level 4</string> + <string>Delay vertex buffer updates until just before rendering</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>29de489d-0491-fb00-7dab-f9e686d31e83</string> + <integer>1</integer> </map> - <key>VoiceImageLevel5</key> + <key>UseStartScreen</key> <map> <key>Comment</key> - <string>Texture UUID for voice image level 5</string> + <string>Whether to load a start screen image or not.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>29de489d-0491-fb00-7dab-f9e686d31e83</string> + <integer>1</integer> </map> - <key>VoiceImageLevel6</key> + <key>UseWebPagesOnPrims</key> <map> <key>Comment</key> - <string>Texture UUID for voice image level 6</string> + <string>[NOT USED]</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>29de489d-0491-fb00-7dab-f9e686d31e83</string> + <integer>0</integer> </map> - <key>VoiceInputAudioDevice</key> + <key>UserConnectionPort</key> <map> <key>Comment</key> - <string>Audio input device to use for voice</string> + <string>Port that this client transmits on.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>String</string> + <string>U32</string> <key>Value</key> - <string>Default</string> + <integer>0</integer> </map> - <key>VoiceOutputAudioDevice</key> + <key>UserLogFile</key> <map> <key>Comment</key> - <string>Audio output device to use for voice</string> + <string>User specified log file name.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>Default</string> + <string /> </map> - <key>VoicePort</key> + <key>UserLoginInfo</key> <map> <key>Comment</key> - <string>Client SLVoice port to connect to</string> + <string>Users loging data.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>U32</string> + <string>LLSD</string> <key>Value</key> - <integer>44125</integer> + <map> + </map> </map> - <key>WLSkyDetail</key> + <key>VFSOldSize</key> <map> <key>Comment</key> - <string>Controls vertex detail on the WindLight sky. Lower numbers will give better performance and uglier skies.</string> + <string>[DO NOT MODIFY] Controls resizing of local file cache</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>U32</string> <key>Value</key> - <integer>64</integer> + <integer>0</integer> </map> - <key>WarnAboutBadPCI</key> + <key>VFSSalt</key> <map> <key>Comment</key> - <string>Enables AboutBadPCI warning dialog</string> + <string>[DO NOT MODIFY] Controls local file caching behavior</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>U32</string> <key>Value</key> <integer>1</integer> </map> - <key>WarnAboutDirectX9</key> + <key>VectorizeEnable</key> <map> <key>Comment</key> - <string>Enables AboutDirectX9 warning dialog</string> + <string>Enable general vector operations and data alignment.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>WarnAboutOldGraphicsDriver</key> + <key>VectorizePerfTest</key> <map> <key>Comment</key> - <string>Enables AboutOldGraphicsDriver warning dialog</string> + <string>Test SSE/vectorization performance and choose fastest version.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -11345,21 +8951,21 @@ <key>Value</key> <integer>1</integer> </map> - <key>WarnAboutPCIGraphics</key> + <key>VectorizeProcessor</key> <map> <key>Comment</key> - <string>Enables AboutPCIGraphics warning dialog</string> + <string>0=Compiler Default, 1=SSE, 2=SSE2, autodetected</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>Boolean</string> + <string>U32</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>WarnBrowserLaunch</key> + <key>VectorizeSkin</key> <map> <key>Comment</key> - <string>Enables BrowserLaunch warning dialog</string> + <string>Enable vector operations for avatar skinning.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -11367,10 +8973,10 @@ <key>Value</key> <integer>1</integer> </map> - <key>WarnDeedObject</key> + <key>VelocityInterpolate</key> <map> <key>Comment</key> - <string>Enables DeedObject warning dialog</string> + <string>Extrapolate object motion from last packet based on received velocity</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -11378,98 +8984,98 @@ <key>Value</key> <integer>1</integer> </map> - <key>WarnFirstAppearance</key> + <key>VerboseLogs</key> <map> <key>Comment</key> - <string>Enables FirstAppearance warning dialog</string> + <string>Display source file and line number for each log item for debugging purposes</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>WarnFirstAttach</key> + <key>VersionChannelName</key> <map> <key>Comment</key> - <string>Enables FirstAttach warning dialog</string> + <string>Versioning Channel Name.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>Second Life Release</string> </map> - <key>WarnFirstBalanceDecrease</key> + <key>VertexShaderEnable</key> <map> <key>Comment</key> - <string>Enables FirstBalanceDecrease warning dialog</string> + <string>Enable/disable all GLSL shaders (debug)</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>WarnFirstBalanceIncrease</key> + <key>VivoxAutoPostCrashDumps</key> <map> <key>Comment</key> - <string>Enables FirstBalanceIncrease warning dialog</string> + <string>If true, SLVoice will automatically send crash dumps directly to Vivox.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>WarnFirstBuild</key> + <key>VivoxDebugLevel</key> <map> <key>Comment</key> - <string>Enables FirstBuild warning dialog</string> + <string>Logging level to use when launching the vivox daemon</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>-1</string> </map> - <key>WarnFirstDebugMenus</key> + <key>VivoxDebugSIPURIHostName</key> <map> <key>Comment</key> - <string>Enables FirstDebugMenus warning dialog</string> + <string>Hostname portion of vivox SIP URIs (empty string for the default).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string></string> </map> - <key>WarnFirstFlexible</key> + <key>VivoxDebugVoiceAccountServerURI</key> <map> <key>Comment</key> - <string>Enables FirstFlexible warning dialog</string> + <string>URI to the vivox account management server (empty string for the default).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string></string> </map> - <key>WarnFirstGoTo</key> + <key>VoiceCallsFriendsOnly</key> <map> <key>Comment</key> - <string>Enables FirstGoTo warning dialog</string> + <string>Only accept voice calls from residents on your friends list</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>WarnFirstInventory</key> + <key>AutoDisengageMic</key> <map> <key>Comment</key> - <string>Enables FirstInventory warning dialog</string> + <string>Automatically turn off the microphone when ending IM calls.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -11477,159 +9083,159 @@ <key>Value</key> <integer>1</integer> </map> - <key>WarnFirstLeftClickNoHit</key> + <key>VoiceEarLocation</key> <map> <key>Comment</key> - <string>Enables FirstLeftClickNoHit warning dialog</string> + <string>Location of the virtual ear for voice</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>WarnFirstMap</key> + <key>VoiceHost</key> <map> <key>Comment</key> - <string>Enables FirstMap warning dialog</string> + <string>Client SLVoice host to connect to</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>127.0.0.1</string> </map> - <key>WarnFirstMedia</key> + <key>VoiceImageLevel0</key> <map> <key>Comment</key> - <string>Enables FirstMedia warning dialog</string> + <string>Texture UUID for voice image level 0</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>041ee5a0-cb6a-9ac5-6e49-41e9320507d5</string> </map> - <key>WarnFirstOverrideKeys</key> + <key>VoiceImageLevel1</key> <map> <key>Comment</key> - <string>Enables FirstOverrideKeys warning dialog</string> + <string>Texture UUID for voice image level 1</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>29de489d-0491-fb00-7dab-f9e686d31e83</string> </map> - <key>WarnFirstSandbox</key> + <key>VoiceImageLevel2</key> <map> <key>Comment</key> - <string>Enables FirstSandbox warning dialog</string> + <string>Texture UUID for voice image level 2</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>29de489d-0491-fb00-7dab-f9e686d31e83</string> </map> - <key>WarnFirstSculptedPrim</key> + <key>VoiceImageLevel3</key> <map> <key>Comment</key> - <string>Enables FirstSculptedPrim warning dialog</string> + <string>Texture UUID for voice image level 3</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>29de489d-0491-fb00-7dab-f9e686d31e83</string> </map> - <key>WarnFirstSit</key> + <key>VoiceImageLevel4</key> <map> <key>Comment</key> - <string>Enables FirstSit warning dialog</string> + <string>Texture UUID for voice image level 4</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>29de489d-0491-fb00-7dab-f9e686d31e83</string> </map> - <key>WarnFirstStreamingMusic</key> + <key>VoiceImageLevel5</key> <map> <key>Comment</key> - <string>Enables FirstStreamingMusic warning dialog</string> + <string>Texture UUID for voice image level 5</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>29de489d-0491-fb00-7dab-f9e686d31e83</string> </map> - <key>WarnFirstStreamingVideo</key> + <key>VoiceImageLevel6</key> <map> <key>Comment</key> - <string>Enables FirstStreamingVideo warning dialog</string> + <string>Texture UUID for voice image level 6</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>29de489d-0491-fb00-7dab-f9e686d31e83</string> </map> - <key>WarnFirstTeleport</key> + <key>VoiceInputAudioDevice</key> <map> <key>Comment</key> - <string>Enables FirstTeleport warning dialog</string> + <string>Audio input device to use for voice</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>Default</string> </map> - <key>WarnFirstVoice</key> + <key>VoiceOutputAudioDevice</key> <map> <key>Comment</key> - <string>Enables FirstVoice warning dialog</string> + <string>Audio output device to use for voice</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>String</string> <key>Value</key> - <integer>1</integer> + <string>Default</string> </map> - <key>WarnNewClassified</key> + <key>VoicePort</key> <map> <key>Comment</key> - <string>Enables NewClassified warning dialog</string> + <string>Client SLVoice port to connect to</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>U32</string> <key>Value</key> - <integer>1</integer> + <integer>44125</integer> </map> - <key>WarnQuickTimeInstalled</key> + <key>WarningsAsChat</key> <map> <key>Comment</key> - <string>Enables QuickTimeInstalled warning dialog</string> + <string>Display warning messages in chat history</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> - <key>WarnReturnToOwner</key> + <key>WLSkyDetail</key> <map> <key>Comment</key> - <string>Enables ReturnToOwner warning dialog</string> + <string>Controls vertex detail on the WindLight sky. Lower numbers will give better performance and uglier skies.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>U32</string> <key>Value</key> - <integer>1</integer> + <integer>64</integer> </map> <key>WatchdogEnabled</key> <map> @@ -11807,22 +9413,6 @@ <key>Value</key> <real>0.40000000596</real> </map> - <key>llOwnerSayChatColor</key> - <map> - <key>Comment</key> - <string>Color of chat messages from objects only visible to the owner</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Color4</string> - <key>Value</key> - <array> - <real>0.990000009537</real> - <real>0.990000009537</real> - <real>0.689999997616</real> - <real>1.0</real> - </array> - </map> <key>particlesbeacon</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/settings_files.xml b/indra/newview/app_settings/settings_files.xml index ec5574535864bbe19e7e374f7ddc9f530d8e2858..aa5b301959c917f14d4cdc407185f02720b2f920 100644 --- a/indra/newview/app_settings/settings_files.xml +++ b/indra/newview/app_settings/settings_files.xml @@ -4,10 +4,10 @@ <map> <!-- The Locations LLSD block specifies the usage pattern of - the settings file types listed above. + the settings file types Each location is represented by a LLSD containing the following values: PathIndex = hard coded path indicies. - Files = map of files to load, from above 'Files' section. + Files = map of files to load Each file can have: Requirement = level of necessity for loading. 0 ( or Req. no key) = do not load @@ -50,6 +50,13 @@ <key>Requirement</key> <integer>1</integer> </map> + <key>Warnings</key> + <map> + <key>Name</key> + <string>ignorable_dialogs.xml</string> + <key>Requirement</key> + <integer>1</integer> + </map> </map> </map> <key>User</key> @@ -70,6 +77,13 @@ <key>Name</key> <string>settings_crash_behavior.xml</string> </map> + <key>Warnings</key> + <map> + <key>Name</key> + <string>ignorable_dialogs.xml</string> + <key>NameFromSetting</key> + <string>WarningSettingsFile</string> + </map> </map> </map> <key>Account</key> @@ -82,6 +96,49 @@ <map> <key>Name</key> <string>settings_per_account.xml</string> + <key>NameFromSetting</key> + <string>PerAccountSettingsFile</string> + </map> + </map> + </map> + <key>DefaultSkin</key> + <map> + <key>PathIndex</key> + <integer>17</integer> + <key>Files</key> + <map> + <key>Skinning</key> + <map> + <key>Name</key> + <string>colors.xml</string> + </map> + </map> + </map> + <key>CurrentSkin</key> + <map> + <key>PathIndex</key> + <integer>10</integer> + <key>Files</key> + <map> + <key>Skinning</key> + <map> + <key>Name</key> + <string>colors.xml</string> + </map> + </map> + </map> + <key>UserSkin</key> + <map> + <key>PathIndex</key> + <integer>14</integer> + <key>Files</key> + <map> + <key>Skinning</key> + <map> + <key>Name</key> + <string>colors.xml</string> + <key>NameFromSetting</key> + <string>SkinningSettingsFile</string> </map> </map> </map> diff --git a/indra/newview/app_settings/std_bump.ini b/indra/newview/app_settings/std_bump.ini index f34e21ce3268216e47d080da10eb970fad51e6a8..561e04c33c59600661f59c9555c51c4ab3ab18bb 100644 --- a/indra/newview/app_settings/std_bump.ini +++ b/indra/newview/app_settings/std_bump.ini @@ -1,18 +1,18 @@ LLStandardBumpmap version 1 -woodgrain 058c75c0-a0d5-f2f8-43f3-e9699a89c2fc.j2c -bark 6c9fa78a-1c69-2168-325b-3e03ffa348ce.j2c -bricks b8eed5f0-64b7-6e12-b67f-43fa8e773440.j2c -checker 9deab416-9c63-78d6-d558-9a156f12044c.j2c -concrete db9d39ec-a896-c287-1ced-64566217021e.j2c -crustytile f2d7b6f6-4200-1e9a-fd5b-96459e950f94.j2c -cutstone d9258671-868f-7511-c321-7baef9e948a4.j2c -discs d21e44ca-ff1c-a96e-b2ef-c0753426b7d9.j2c -gravel 4726f13e-bd07-f2fb-feb0-bfa2ac58ab61.j2c -petridish e569711a-27c2-aad4-9246-0c910239a179.j2c -siding 073c9723-540c-5449-cdd4-0e87fdc159e3.j2c -stonetile ae874d1a-93ef-54fb-5fd3-eb0cb156afc0.j2c -stucco 92e66e00-f56f-598a-7997-048aa64cde18.j2c -suction 83b77fc6-10b4-63ec-4de7-f40629f238c5.j2c -weave 735198cf-6ea0-2550-e222-21d3c6a341ae.j2c +woodgrain 058c75c0-a0d5-f2f8-43f3-e9699a89c2fc +bark 6c9fa78a-1c69-2168-325b-3e03ffa348ce +bricks b8eed5f0-64b7-6e12-b67f-43fa8e773440 +checker 9deab416-9c63-78d6-d558-9a156f12044c +concrete db9d39ec-a896-c287-1ced-64566217021e +crustytile f2d7b6f6-4200-1e9a-fd5b-96459e950f94 +cutstone d9258671-868f-7511-c321-7baef9e948a4 +discs d21e44ca-ff1c-a96e-b2ef-c0753426b7d9 +gravel 4726f13e-bd07-f2fb-feb0-bfa2ac58ab61 +petridish e569711a-27c2-aad4-9246-0c910239a179 +siding 073c9723-540c-5449-cdd4-0e87fdc159e3 +stonetile ae874d1a-93ef-54fb-5fd3-eb0cb156afc0 +stucco 92e66e00-f56f-598a-7997-048aa64cde18 +suction 83b77fc6-10b4-63ec-4de7-f40629f238c5 +weave 735198cf-6ea0-2550-e222-21d3c6a341ae diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 0ed5663ec1c1a626c9cbf5b183844bc0b86ae364..c943c57fdbe79d523a17b7ea446ad182a1d46c3e 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -5542,6 +5542,14 @@ <texture local_texture="hair_grain" /> </layer> + + <layer + name="hair alpha" + visibility_mask="TRUE"> + <texture + local_texture="hair_alpha" /> + </layer> + </layer_set> <!-- =========================================================== --> @@ -6451,8 +6459,6 @@ <layer name="facialhair" global_color="hair_color"> - <morph_mask - morph_name="Displace_Hair_Facial" /> <texture tga_file="head_hair.tga" @@ -6544,6 +6550,18 @@ <texture local_texture="head_bodypaint" /> </layer> + <layer + name="head alpha" + visibility_mask="TRUE"> + <texture + local_texture="head_alpha" /> + </layer> + <layer + name="head_tattoo"> + <texture + local_texture="head_tattoo" /> + </layer> + </layer_set> <!-- =========================================================== --> @@ -6659,6 +6677,13 @@ </param> </layer> + <layer + name="upper_tattoo"> + <texture + local_texture="upper_tattoo" /> + </layer> + + <layer name="upper_undershirt bump" render_pass="bump" @@ -7287,12 +7312,6 @@ <texture local_texture="upper_shirt" /> - <morph_mask - morph_name="Displace_Loose_Upperbody" /> - - <morph_mask - morph_name="Shirtsleeve_flair" /> - <param id="803" group="0" @@ -7728,6 +7747,14 @@ domain="0.01" /> </param> </layer> + + <layer + name="upper alpha" + visibility_mask="TRUE"> + <texture + local_texture="upper_alpha" /> + </layer> + </layer_set> <!-- =========================================================== --> @@ -7843,6 +7870,12 @@ </param> </layer> + <layer + name="lower_tattoo"> + <texture + local_texture="lower_tattoo" /> + </layer> + <layer name="lower_underpants bump" render_pass="bump" @@ -8313,18 +8346,6 @@ <texture local_texture="lower_pants" /> - <morph_mask - morph_name="Displace_Loose_Lowerbody" /> - - <morph_mask - morph_name="Leg_Pantflair" /> - - <morph_mask - morph_name="Low_Crotch" /> - - <morph_mask - morph_name="Leg_Longcuffs" /> - <param id="806" group="0" @@ -8600,6 +8621,14 @@ domain="0.01" /> </param> </layer> + + <layer + name="lower alpha" + visibility_mask="TRUE"> + <texture + local_texture="lower_alpha" /> + </layer> + </layer_set> <!-- =========================================================== --> @@ -8619,6 +8648,14 @@ <texture local_texture="eyes_iris" /> </layer> + + <layer + name="eyes alpha" + visibility_mask="TRUE"> + <texture + local_texture="eyes_alpha" /> + </layer> + </layer_set> <!-- =========================================================== --> @@ -8798,6 +8835,7 @@ domain="0" /> </param> </layer> + </layer_set> <!-- =========================================================== --> @@ -11258,5 +11296,36 @@ </param> </driver_parameters> + + <morph_masks> + <mask + morph_name="Displace_Hair_Facial" + body_region="head" + layer="facialhair" /> + <mask + morph_name="Displace_Loose_Upperbody" + body_region="upper_body" + layer="upper_clothes" /> + <mask + morph_name="Shirtsleeve_flair" + body_region="upper_body" + layer="upper_clothes" /> + <mask + morph_name="Displace_Loose_Lowerbody" + body_region="lower_body" + layer="lower_pants" /> + <mask + morph_name="Leg_Pantflair" + body_region="lower_body" + layer="lower_pants" /> + <mask + morph_name="Low_Crotch" + body_region="lower_body" + layer="lower_pants" /> + <mask + morph_name="Leg_Longcuffs" + body_region="lower_body" + layer="lower_pants" /> + </morph_masks> </linden_avatar> diff --git a/indra/newview/character/checkerboard.tga b/indra/newview/character/checkerboard.tga new file mode 100644 index 0000000000000000000000000000000000000000..1950d7403dfdad67395b79e2ef4cecd57304794e Binary files /dev/null and b/indra/newview/character/checkerboard.tga differ diff --git a/indra/newview/character/invisible_head.tga b/indra/newview/character/invisible_head.tga new file mode 100755 index 0000000000000000000000000000000000000000..2673a237d51d5398417930c64a7cfb55a6e0de20 Binary files /dev/null and b/indra/newview/character/invisible_head.tga differ diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 87218008bd500658302589acde498fab2d69958c..73a548cdc6e1190ba7ef11f8fa978d21ff306cb7 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -498,7 +498,8 @@ RMDir "$INSTDIR" IfFileExists "$INSTDIR" FOLDERFOUND NOFOLDER FOLDERFOUND: - MessageBox MB_YESNO $(DeleteProgramFilesMB) IDNO NOFOLDER + ; Silent uninstall always removes all files (/SD IDYES) + MessageBox MB_YESNO $(DeleteProgramFilesMB) /SD IDYES IDNO NOFOLDER RMDir /r "$INSTDIR" NOFOLDER: diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 07503404dce4a23c2fb69d30705cd148bb04bdcc..a70d31431fe7fb32cb2d33b12740b9f0042cff03 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -32,115 +32,82 @@ #include "llviewerprecompiledheaders.h" -#include "stdtypes.h" -#include "stdenums.h" - #include "llagent.h" +#include "llagentwearables.h" -#include "llcamera.h" -#include "llcoordframe.h" -#include "indra_constants.h" -#include "llmath.h" -#include "llcriticaldamp.h" -#include "llfocusmgr.h" -#include "llglheaders.h" -#include "llparcel.h" -#include "llpermissions.h" -#include "llregionhandle.h" -#include "m3math.h" -#include "m4math.h" -#include "message.h" -#include "llquaternion.h" -#include "v3math.h" -#include "v4math.h" -#include "llsmoothstep.h" -#include "llsdutil.h" -//#include "vmath.h" - -#include "imageids.h" -#include "llbox.h" -#include "llbutton.h" +#include "llanimationstates.h" #include "llcallingcard.h" #include "llchatbar.h" #include "llconsole.h" #include "lldrawable.h" -#include "llface.h" #include "llfirstuse.h" -#include "llfloater.h" +#include "llfloaterreg.h" #include "llfloateractivespeakers.h" #include "llfloateravatarinfo.h" -#include "llfloaterbuildoptions.h" #include "llfloatercamera.h" -#include "llfloaterchat.h" #include "llfloatercustomize.h" #include "llfloaterdirectory.h" #include "llfloatergroupinfo.h" -#include "llfloatergroups.h" #include "llfloaterland.h" -#include "llfloatermap.h" #include "llfloatermute.h" #include "llfloatersnapshot.h" #include "llfloatertools.h" #include "llfloaterworldmap.h" + +#include "llfocusmgr.h" #include "llgroupmgr.h" #include "llhomelocationresponder.h" -#include "llhudeffectlookat.h" +#include "llimview.h" #include "llhudmanager.h" -#include "llinventorymodel.h" -#include "llinventoryview.h" #include "lljoystickbutton.h" #include "llmenugl.h" #include "llmorphview.h" #include "llmoveview.h" -#include "llnotify.h" -#include "llquantize.h" +#include "llparcel.h" #include "llsdutil.h" #include "llselectmgr.h" #include "llsky.h" -#include "llrendersphere.h" +#include "llslurl.h" +#include "llsmoothstep.h" +#include "llsidetray.h" #include "llstatusbar.h" -#include "llstartup.h" -#include "llimview.h" +#include "llteleporthistory.h" #include "lltool.h" #include "lltoolcomp.h" -#include "lltoolfocus.h" -#include "lltoolgrab.h" #include "lltoolmgr.h" -#include "lltoolpie.h" -#include "lltoolview.h" -#include "llui.h" // for make_ui_sound +#include "lluictrlfactory.h" #include "llurldispatcher.h" + #include "llviewercamera.h" -#include "llviewerinventory.h" -#include "llviewermenu.h" -#include "llviewernetwork.h" +#include "llviewerdisplay.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" -#include "llviewerparceloverlay.h" -#include "llviewerregion.h" #include "llviewerstats.h" #include "llviewerwindow.h" -#include "llviewerdisplay.h" -#include "llvoavatar.h" -#include "llvoground.h" -#include "llvosky.h" -#include "llwearable.h" -#include "llwearablelist.h" +#include "llviewercontrol.h" +#include "llviewerjoystick.h" + +#include "llvoavatarself.h" +#include "llwindow.h" #include "llworld.h" #include "llworldmap.h" + #include "pipeline.h" -#include "roles_constants.h" -#include "llviewercontrol.h" -#include "llappviewer.h" -#include "llviewerjoystick.h" -#include "llfollowcam.h" +#include "lltrans.h" +#include "llbottomtray.h" #include "stringize.h" #include "llcapabilitylistener.h" +#include "llnavigationbar.h" //to show/hide navigation bar when changing mouse look state + using namespace LLVOAvatarDefines; extern LLMenuBarGL* gMenuBarView; +const BOOL ANIMATE = TRUE; +const U8 AGENT_STATE_TYPING = 0x04; +const U8 AGENT_STATE_EDITING = 0x10; + //drone wandering constants const F32 MAX_WANDER_TIME = 20.f; // seconds const F32 MAX_HEADING_HALF_ERROR = 0.2f; // radians @@ -216,7 +183,7 @@ const F64 CHAT_AGE_FAST_RATE = 3.0; // The agent instance. LLAgent gAgent; -// +//-------------------------------------------------------------------- // Statics // @@ -242,6 +209,19 @@ void LLAgentFriendObserver::changed(U32 mask) } } +bool handleSlowMotionAnimation(const LLSD& newvalue) +{ + if (newvalue.asBoolean()) + { + gAgent.getAvatarObject()->setAnimTimeFactor(0.2f); + } + else + { + gAgent.getAvatarObject()->setAnimTimeFactor(1.0f); + } + return true; +} + // ************************************************************ // Enabled this definition to compile a 'hacked' viewer that // locally believes the end user has godlike powers. @@ -264,19 +244,12 @@ LLAgent::LLAgent() : mHideGroupTitle(FALSE), mGroupID(), - mMapOriginX(0.F), - mMapOriginY(0.F), - mMapWidth(0), - mMapHeight(0), - mLookAt(NULL), mPointAt(NULL), mHUDTargetZoom(1.f), mHUDCurZoom(1.f), mInitialized(FALSE), - mNumPendingQueries(0), - mActiveCacheQueries(NULL), mForceMouselook(FALSE), mDoubleTapRunTimer(), @@ -395,24 +368,14 @@ LLAgent::LLAgent() : mFirstLogin(FALSE), mGenderChosen(FALSE), - mAgentWearablesUpdateSerialNum(0), - mWearablesLoaded(FALSE), - mTextureCacheQueryID(0), mAppearanceSerialNum(0) { - U32 i; - for (i = 0; i < TOTAL_CONTROLS; i++) + for (U32 i = 0; i < TOTAL_CONTROLS; i++) { mControlsTakenCount[i] = 0; mControlsTakenPassedOnCount[i] = 0; } - mActiveCacheQueries = new S32[BAKED_NUM_INDICES]; - for (i = 0; i < (U32)BAKED_NUM_INDICES; i++) - { - mActiveCacheQueries[i] = 0; - } - mFollowCam.setMaxCameraDistantFromSubject( MAX_CAMERA_DISTANCE_FROM_AGENT ); } @@ -422,6 +385,9 @@ LLAgent::LLAgent() : //----------------------------------------------------------------------------- void LLAgent::init() { + gSavedSettings.declareBOOL("SlowMotionAnimation", FALSE, "Declared in code", FALSE); + gSavedSettings.getControl("SlowMotionAnimation")->getSignal()->connect(boost::bind(&handleSlowMotionAnimation, _2)); + mDrawDistance = gSavedSettings.getF32("RenderFarClip"); // *Note: this is where LLViewerCamera::getInstance() used to be constructed. @@ -430,7 +396,7 @@ void LLAgent::init() // Leave at 0.1 meters until we have real near clip management LLViewerCamera::getInstance()->setNear(0.1f); LLViewerCamera::getInstance()->setFar(mDrawDistance); // if you want to change camera settings, do so in camera.h - LLViewerCamera::getInstance()->setAspect( gViewerWindow->getDisplayAspectRatio() ); // default, overridden in LLViewerWindow::reshape + LLViewerCamera::getInstance()->setAspect( gViewerWindow->getWorldViewAspectRatio() ); // default, overridden in LLViewerWindow::reshape LLViewerCamera::getInstance()->setViewHeightInPixels(768); // default, overridden in LLViewerWindow::reshape setFlying( gSavedSettings.getBOOL("FlyingAtExit") ); @@ -443,9 +409,10 @@ void LLAgent::init() mCameraZoomFraction = 1.f; mTrackFocusObject = gSavedSettings.getBOOL("TrackFocusObject"); -// LLDebugVarMessageBox::show("Camera Lag", &CAMERA_FOCUS_HALF_LIFE, 0.5f, 0.01f); + mEffectColor = gSavedSkinSettings.getColor4("EffectColor"); - mEffectColor = gSavedSettings.getColor4("EffectColor"); + gSavedSettings.getControl("PreferredMaturity")->getValidateSignal()->connect(boost::bind(&LLAgent::validateMaturity, this, _2)); + gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLAgent::handleMaturity, this, _2)); mInitialized = TRUE; } @@ -456,7 +423,9 @@ void LLAgent::init() void LLAgent::cleanup() { setSitCamera(LLUUID::null); + mAvatarObject = NULL; + if(mLookAt) { mLookAt->markDead() ; @@ -478,9 +447,6 @@ LLAgent::~LLAgent() { cleanup(); - delete [] mActiveCacheQueries; - mActiveCacheQueries = NULL; - // *Note: this is where LLViewerCamera::getInstance() used to be deleted. } @@ -529,7 +495,7 @@ void LLAgent::resetView(BOOL reset_camera, BOOL change_camera) LLViewerJoystick::getInstance()->moveAvatar(true); } - gFloaterTools->close(); + LLFloaterReg::hideInstance("build"); gViewerWindow->showCursor(); @@ -822,12 +788,24 @@ void LLAgent::setFlying(BOOL fly) //----------------------------------------------------------------------------- // toggleFlying() //----------------------------------------------------------------------------- +// static void LLAgent::toggleFlying() { - BOOL fly = !(mControlFlags & AGENT_CONTROL_FLY); + BOOL fly = !(gAgent.mControlFlags & AGENT_CONTROL_FLY); - setFlying( fly ); - resetView(); + gAgent.setFlying( fly ); + gAgent.resetView(); +} + +// static +bool LLAgent::enableFlying() +{ + BOOL sitting = FALSE; + if (gAgent.getAvatarObject()) + { + sitting = gAgent.getAvatarObject()->mIsSitting; + } + return !sitting; } @@ -942,7 +920,7 @@ std::string LLAgent::getSLURL() const S32 x = llround( (F32)fmod( agentPos.mdV[VX], (F64)REGION_WIDTH_METERS ) ); S32 y = llround( (F32)fmod( agentPos.mdV[VY], (F64)REGION_WIDTH_METERS ) ); S32 z = llround( (F32)agentPos.mdV[VZ] ); - slurl = LLURLDispatcher::buildSLURL(regionp->getName(), x, y, z); + slurl = LLSLURL::buildSLURL(regionp->getName(), x, y, z); } return slurl; } @@ -1319,14 +1297,19 @@ LLQuaternion LLAgent::getQuat() const //----------------------------------------------------------------------------- LLVector3 LLAgent::calcFocusOffset(LLViewerObject *object, LLVector3 original_focus_point, S32 x, S32 y) { - // calculate offset based on view direction - BOOL is_avatar = object->isAvatar(); - // since the animation system allows the avatars facing and position to deviate from its nominal LLViewerObject/LLDrawable transform - // calculate the focus-specific orientation for avatars based off the pelvis joint - // NOTE: pelvis no longer good candidate, removed. DEV-30589 LLMatrix4 obj_matrix = object->getRenderMatrix(); LLQuaternion obj_rot = object->getRenderRotation(); LLVector3 obj_pos = object->getRenderPosition(); + + BOOL is_avatar = object->isAvatar(); + // if is avatar - don't do any funk heuristics to position the focal point + // see DEV-30589 + if (is_avatar) + { + return original_focus_point - obj_pos; + } + + LLQuaternion inv_obj_rot = ~obj_rot; // get inverse of rotation LLVector3 object_extents = object->getScale(); // make sure they object extents are non-zero @@ -2119,8 +2102,7 @@ void LLAgent::setAFK() gAwayTimer.start(); if (gAFKMenu) { - //*TODO:Translate - gAFKMenu->setLabel(std::string("Set Not Away")); + gAFKMenu->setLabel(LLTrans::getString("AvatarSetNotAway")); } } } @@ -2143,8 +2125,7 @@ void LLAgent::clearAFK() clearControlFlags(AGENT_CONTROL_AWAY); if (gAFKMenu) { - //*TODO:Translate - gAFKMenu->setLabel(std::string("Set Away")); + gAFKMenu->setLabel(LLTrans::getString("AvatarSetAway")); } } } @@ -2166,10 +2147,9 @@ void LLAgent::setBusy() mIsBusy = TRUE; if (gBusyMenu) { - //*TODO:Translate - gBusyMenu->setLabel(std::string("Set Not Busy")); + gBusyMenu->setLabel(LLTrans::getString("AvatarSetNotBusy")); } - LLFloaterMute::getInstance()->updateButtons(); + LLFloaterReg::getTypedInstance<LLFloaterMute>("mute")->updateButtons(); } //----------------------------------------------------------------------------- @@ -2181,10 +2161,9 @@ void LLAgent::clearBusy() sendAnimationRequest(ANIM_AGENT_BUSY, ANIM_REQUEST_STOP); if (gBusyMenu) { - //*TODO:Translate - gBusyMenu->setLabel(std::string("Set Busy")); + gBusyMenu->setLabel(LLTrans::getString("AvatarSetBusy")); } - LLFloaterMute::getInstance()->updateButtons(); + LLFloaterReg::getTypedInstance<LLFloaterMute>("mute")->updateButtons(); } //----------------------------------------------------------------------------- @@ -2664,7 +2643,7 @@ std::ostream& operator<<(std::ostream &s, const LLAgent &agent) //----------------------------------------------------------------------------- // setAvatarObject() //----------------------------------------------------------------------------- -void LLAgent::setAvatarObject(LLVOAvatar *avatar) +void LLAgent::setAvatarObject(LLVOAvatarSelf *avatar) { mAvatarObject = avatar; @@ -2691,8 +2670,6 @@ void LLAgent::setAvatarObject(LLVOAvatar *avatar) { mPointAt->setSourceObject(avatar); } - - sendAgentWearablesRequest(); } // TRUE if your own avatar needs to be rendered. Usually only @@ -2743,7 +2720,7 @@ void LLAgent::startTyping() { sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_START); } - gChatBar->sendChatFromViewer("", CHAT_TYPE_START, FALSE); + LLBottomTray::getInstance()->sendChatFromViewer("", CHAT_TYPE_START, FALSE); } //----------------------------------------------------------------------------- @@ -2755,7 +2732,7 @@ void LLAgent::stopTyping() { clearRenderState(AGENT_STATE_TYPING); sendAnimationRequest(ANIM_AGENT_TYPE, ANIM_REQUEST_STOP); - gChatBar->sendChatFromViewer("", CHAT_TYPE_STOP, FALSE); + LLBottomTray::getInstance()->sendChatFromViewer("", CHAT_TYPE_STOP, FALSE); } } @@ -2809,13 +2786,6 @@ U8 LLAgent::getRenderState() //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -static const LLFloaterView::skip_list_t& get_skip_list() -{ - static LLFloaterView::skip_list_t skip_list; - skip_list.insert(LLFloaterMap::getInstance()); - return skip_list; -} - //----------------------------------------------------------------------------- // endAnimationUpdateUI() //----------------------------------------------------------------------------- @@ -2834,17 +2804,29 @@ void LLAgent::endAnimationUpdateUI() gViewerWindow->showCursor(); // show menus gMenuBarView->setVisible(TRUE); + LLNavigationBar::getInstance()->setVisible(TRUE); gStatusBar->setVisibleForMouselook(true); + LLBottomTray::getInstance()->setVisible(TRUE); + + LLSideTray::getInstance()->setVisible(TRUE); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); // Only pop if we have pushed... if (TRUE == mViewsPushed) { +#if 0 // Use this once all floaters are registered + LLFloaterReg::restoreVisibleInstances(); +#else // Use this for now + LLFloaterView::skip_list_t skip_list; + skip_list.insert(LLFloaterReg::findInstance("mini_map")); + gFloaterView->popVisibleAll(skip_list); +#endif mViewsPushed = FALSE; - gFloaterView->popVisibleAll(get_skip_list()); } + gAgent.setLookAt(LOOKAT_TARGET_CLEAR); if( gMorphView ) { @@ -2886,13 +2868,6 @@ void LLAgent::endAnimationUpdateUI() LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); - // HACK: If we're quitting, and we were in customize avatar, don't - // let the mini-map go visible again. JC - if (!LLAppViewer::instance()->quitRequested()) - { - LLFloaterMap::getInstance()->popVisible(); - } - if( gMorphView ) { gMorphView->setVisible( FALSE ); @@ -2919,8 +2894,13 @@ void LLAgent::endAnimationUpdateUI() { // hide menus gMenuBarView->setVisible(FALSE); + LLNavigationBar::getInstance()->setVisible(FALSE); gStatusBar->setVisibleForMouselook(false); + LLBottomTray::getInstance()->setVisible(FALSE); + + LLSideTray::getInstance()->setVisible(FALSE); + // clear out camera lag effect mCameraLag.clearVec(); @@ -2931,14 +2911,23 @@ void LLAgent::endAnimationUpdateUI() mViewsPushed = TRUE; - gFloaterView->pushVisibleAll(FALSE, get_skip_list()); + // hide all floaters except the mini map + +#if 0 // Use this once all floaters are registered + std::set<std::string> exceptions; + exceptions.insert("mini_map"); + LLFloaterReg::hideVisibleInstances(exceptions); +#else // Use this for now + LLFloaterView::skip_list_t skip_list; + skip_list.insert(LLFloaterReg::findInstance("mini_map")); + gFloaterView->pushVisibleAll(FALSE, skip_list); +#endif if( gMorphView ) { gMorphView->setVisible(FALSE); } - gIMMgr->setFloaterOpen( FALSE ); gConsole->setVisible( TRUE ); if (mAvatarObject.notNull()) @@ -2987,15 +2976,6 @@ void LLAgent::endAnimationUpdateUI() { LLToolMgr::getInstance()->setCurrentToolset(gFaceEditToolset); - LLFloaterMap::getInstance()->pushVisible(FALSE); - /* - LLView *view; - for (view = gFloaterView->getFirstChild(); view; view = gFloaterView->getNextChild()) - { - view->pushVisible(FALSE); - } - */ - if( gMorphView ) { gMorphView->setVisible( TRUE ); @@ -4250,7 +4230,7 @@ void LLAgent::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL camera_ani gFocusMgr.setKeyboardFocus( NULL ); gFocusMgr.setMouseCapture( NULL ); - LLVOAvatar::onCustomizeStart(); + LLVOAvatarSelf::onCustomizeStart(); } if (mAvatarObject.notNull()) @@ -4935,6 +4915,9 @@ int LLAgent::convertTextToMaturity(char text) bool LLAgent::sendMaturityPreferenceToServer(int preferredMaturity) { + if (!getRegion()) + return false; + // Update agent access preference on the server std::string url = getRegion()->getCapability("UpdateAgentInformation"); if (!url.empty()) @@ -4994,6 +4977,17 @@ const LLAgentAccess& LLAgent::getAgentAccess() return mAgentAccess; } +bool LLAgent::validateMaturity(const LLSD& newvalue) +{ + return mAgentAccess.canSetMaturity(newvalue.asInteger()); +} + +void LLAgent::handleMaturity(const LLSD& newvalue) +{ + sendMaturityPreferenceToServer(newvalue.asInteger()); +} + +//---------------------------------------------------------------------------- void LLAgent::buildFullname(std::string& name) const { @@ -5157,8 +5151,14 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO } // utility to build a location string -void LLAgent::buildLocationString(std::string& str) +BOOL LLAgent::buildLocationString(std::string& str, ELocationFormat fmt) { + LLViewerRegion* region = getRegion(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + + if (!region || !parcel) + return FALSE; + const LLVector3& agent_pos_region = getPositionAgent(); S32 pos_x = S32(agent_pos_region.mV[VX]); S32 pos_y = S32(agent_pos_region.mV[VY]); @@ -5185,23 +5185,53 @@ void LLAgent::buildLocationString(std::string& str) } // create a defult name and description for the landmark + std::string parcel_name = LLViewerParcelMgr::getInstance()->getAgentParcelName(); + std::string region_name = region->getName(); std::string buffer; if( LLViewerParcelMgr::getInstance()->getAgentParcelName().empty() ) { // the parcel doesn't have a name - buffer = llformat("%.32s (%d, %d, %d)", - getRegion()->getName().c_str(), + switch (fmt) + { + case LOCATION_FORMAT_LANDMARK: + buffer = llformat("%.100s", region_name.c_str()); + break; + case LOCATION_FORMAT_NORMAL: + buffer = llformat("%s", region_name.c_str()); + break; + case LOCATION_FORMAT_FULL: + buffer = llformat("%s (%d, %d, %d)", + region_name.c_str(), pos_x, pos_y, pos_z); + break; + } } else { // the parcel has a name, so include it in the landmark name - buffer = llformat("%.32s, %.32s (%d, %d, %d)", - LLViewerParcelMgr::getInstance()->getAgentParcelName().c_str(), - getRegion()->getName().c_str(), - pos_x, pos_y, pos_z); + switch (fmt) + { + case LOCATION_FORMAT_LANDMARK: + buffer = llformat("%.100s", parcel_name.c_str()); + break; + case LOCATION_FORMAT_NORMAL: + buffer = llformat("%s, %s", + region_name.c_str(), + parcel_name.c_str()); + break; + case LOCATION_FORMAT_FULL: + std::string sim_access_string = region->getSimAccessString(); + buffer = llformat("%s, %s (%d, %d, %d)%s%s", + region_name.c_str(), + parcel_name.c_str(), + pos_x, pos_y, pos_z, + sim_access_string.empty() ? "" : " - ", + sim_access_string.c_str()); + break; + } } str = buffer; + return TRUE; } LLQuaternion LLAgent::getHeadRotation() @@ -5366,7 +5396,7 @@ BOOL LLAgent::allowOperation(PermissionBit op, } -void LLAgent::getName(std::string& name) +void LLAgent::getName(std::string& name) const { name.clear(); @@ -5404,16 +5434,51 @@ void LLAgent::initOriginGlobal(const LLVector3d &origin_global) mAgentOriginGlobal = origin_global; } +BOOL LLAgent::leftButtonGrabbed() const +{ + return (!cameraMouselook() && mControlsTakenCount[CONTROL_LBUTTON_DOWN_INDEX] > 0) + || (cameraMouselook() && mControlsTakenCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0) + || (!cameraMouselook() && mControlsTakenPassedOnCount[CONTROL_LBUTTON_DOWN_INDEX] > 0) + || (cameraMouselook() && mControlsTakenPassedOnCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0); +} + +BOOL LLAgent::rotateGrabbed() const +{ + return (mControlsTakenCount[CONTROL_YAW_POS_INDEX] > 0) + || (mControlsTakenCount[CONTROL_YAW_NEG_INDEX] > 0); +} + +BOOL LLAgent::forwardGrabbed() const +{ + return (mControlsTakenCount[CONTROL_AT_POS_INDEX] > 0); +} + +BOOL LLAgent::backwardGrabbed() const +{ + return (mControlsTakenCount[CONTROL_AT_NEG_INDEX] > 0); +} + +BOOL LLAgent::upGrabbed() const +{ + return (mControlsTakenCount[CONTROL_UP_POS_INDEX] > 0); +} + +BOOL LLAgent::downGrabbed() const +{ + return (mControlsTakenCount[CONTROL_UP_NEG_INDEX] > 0); +} + void update_group_floaters(const LLUUID& group_id) { LLFloaterGroupInfo::refreshGroup(group_id); + //*TODO Implement group update for Profile View // update avatar info - LLFloaterAvatarInfo* fa = LLFloaterAvatarInfo::getInstance(gAgent.getID()); - if(fa) - { - fa->resetGroupList(); - } +// LLFloaterAvatarInfo* fa = LLFloaterReg::findTypedInstance<LLFloaterAvatarInfo>("preview_avatar", LLSD(gAgent.getID())); +// if(fa) +// { +// fa->resetGroupList(); +// } if (gIMMgr) { @@ -5849,9 +5914,9 @@ void LLAgent::processControlRelease(LLMessageSystem *msg, void **) //static void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void **user_data) { - gAgent.mNumPendingQueries--; + gAgentQueryManager.mNumPendingQueries--; - LLVOAvatar* avatarp = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); if (!avatarp || avatarp->isDead()) { llwarns << "No avatar for user in cached texture update!" << llendl; @@ -5881,12 +5946,12 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void * if (texture_id.notNull() && (S32)texture_index < BAKED_NUM_INDICES - && gAgent.mActiveCacheQueries[ texture_index ] == query_id) + && gAgentQueryManager.mActiveCacheQueries[texture_index] == query_id) { //llinfos << "Received cached texture " << (U32)texture_index << ": " << texture_id << llendl; - avatarp->setCachedBakedTexture(getTextureIndex((EBakedTextureIndex)texture_index), texture_id); + avatarp->setCachedBakedTexture(LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)texture_index), texture_id); //avatarp->setTETexture( LLVOAvatar::sBakedTextureIndices[texture_index], texture_id ); - gAgent.mActiveCacheQueries[ texture_index ] = 0; + gAgentQueryManager.mActiveCacheQueries[texture_index] = 0; num_results++; } } @@ -5895,7 +5960,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void * avatarp->updateMeshTextures(); - if (gAgent.mNumPendingQueries == 0) + if (gAgentQueryManager.mNumPendingQueries == 0) { // RN: not sure why composites are disabled at this point avatarp->setCompositeUpdatesEnabled(TRUE); @@ -5905,8 +5970,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void * BOOL LLAgent::anyControlGrabbed() const { - U32 i; - for (i = 0; i < TOTAL_CONTROLS; i++) + for (U32 i = 0; i < TOTAL_CONTROLS; i++) { if (gAgent.mControlsTakenCount[i] > 0) return TRUE; @@ -5998,12 +6062,12 @@ bool LLAgent::teleportCore(bool is_local) // process_teleport_location_reply // close the map and find panels so we can see our destination - LLFloaterWorldMap::hide(NULL); - LLFloaterDirectory::hide(NULL); + LLFloaterReg::hideInstance("world_map"); + LLFloaterReg::hideInstance("search"); // hide land floater too - it'll be out of date LLFloaterLand::hideInstance(); - + LLViewerParcelMgr::getInstance()->deselectLand(); // Close all pie menus, deselect land, etc. @@ -6164,13 +6228,18 @@ void LLAgent::setTeleportState(ETeleportState state) mTeleportState = state; if (mTeleportState > TELEPORT_NONE && gSavedSettings.getBOOL("FreezeTime")) { - LLFloaterSnapshot::hide(0); + LLFloaterReg::hideInstance("snapshot"); } if (mTeleportState == TELEPORT_MOVING) { // We're outa here. Save "back" slurl. mTeleportSourceSLURL = getSLURL(); } + else if(mTeleportState == TELEPORT_ARRIVING) + { + // Let the interested parties know we've teleported. + LLViewerParcelMgr::getInstance()->onTeleportFinished(); + } } void LLAgent::stopCurrentAnimations() @@ -6298,974 +6367,103 @@ void LLAgent::requestLeaveGodMode() sendReliableMessage(); } -// wearables -LLAgent::createStandardWearablesAllDoneCallback::~createStandardWearablesAllDoneCallback() -{ - gAgent.createStandardWearablesAllDone(); -} - -LLAgent::sendAgentWearablesUpdateCallback::~sendAgentWearablesUpdateCallback() -{ - gAgent.sendAgentWearablesUpdate(); -} - -LLAgent::addWearableToAgentInventoryCallback::addWearableToAgentInventoryCallback( - LLPointer<LLRefCount> cb, S32 index, LLWearable* wearable, U32 todo) : - mIndex(index), - mWearable(wearable), - mTodo(todo), - mCB(cb) -{ -} - -void LLAgent::addWearableToAgentInventoryCallback::fire(const LLUUID& inv_item) +//----------------------------------------------------------------------------- +// sendAgentSetAppearance() +//----------------------------------------------------------------------------- +void LLAgent::sendAgentSetAppearance() { - if (inv_item.isNull()) - return; - - gAgent.addWearabletoAgentInventoryDone(mIndex, inv_item, mWearable); + if (mAvatarObject.isNull()) return; - if (mTodo & CALL_UPDATE) - { - gAgent.sendAgentWearablesUpdate(); - } - if (mTodo & CALL_RECOVERDONE) - { - gAgent.recoverMissingWearableDone(); - } - /* - * Do this for every one in the loop - */ - if (mTodo & CALL_CREATESTANDARDDONE) - { - gAgent.createStandardWearablesDone(mIndex); - } - if (mTodo & CALL_MAKENEWOUTFITDONE) + if (gAgentQueryManager.mNumPendingQueries > 0 && !gAgent.cameraCustomizeAvatar()) { - gAgent.makeNewOutfitDone(mIndex); + return; } -} -void LLAgent::addWearabletoAgentInventoryDone( - S32 index, - const LLUUID& item_id, - LLWearable* wearable) -{ - if (item_id.isNull()) - return; - LLUUID old_item_id = mWearableEntry[index].mItemID; - mWearableEntry[index].mItemID = item_id; - mWearableEntry[index].mWearable = wearable; - if (old_item_id.notNull()) - gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id); - gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); - LLViewerInventoryItem* item = gInventory.getItem(item_id); - if(item && wearable) - { - // We're changing the asset id, so we both need to set it - // locally via setAssetUUID() and via setTransactionID() which - // will be decoded on the server. JC - item->setAssetUUID(wearable->getID()); - item->setTransactionID(wearable->getTransactionID()); - gInventory.addChangedMask(LLInventoryObserver::INTERNAL, item_id); - item->updateServer(FALSE); - } - gInventory.notifyObservers(); -} + llinfos << "TAT: Sent AgentSetAppearance: " << mAvatarObject->getBakedStatusForPrintout() << llendl; + //dumpAvatarTEs( "sendAgentSetAppearance()" ); -void LLAgent::sendAgentWearablesUpdate() -{ - // First make sure that we have inventory items for each wearable - S32 i; - for(i=0; i < WT_COUNT; ++i) - { - LLWearable* wearable = mWearableEntry[ i ].mWearable; - if (wearable) - { - if( mWearableEntry[ i ].mItemID.isNull() ) - { - LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( - LLPointer<LLRefCount>(NULL), - i, - wearable, - addWearableToAgentInventoryCallback::CALL_NONE); - addWearableToAgentInventory(cb, wearable); - } - else - { - gInventory.addChangedMask( LLInventoryObserver::LABEL, - mWearableEntry[i].mItemID ); - } - } - } + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_AgentSetAppearance); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, getID()); + msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); - // Then make sure the inventory is in sync with the avatar. - gInventory.notifyObservers(); + // correct for the collision tolerance (to make it look like the + // agent is actually walking on the ground/object) + // NOTE -- when we start correcting all of the other Havok geometry + // to compensate for the COLLISION_TOLERANCE ugliness we will have + // to tweak this number again + const LLVector3 body_size = mAvatarObject->mBodySize; + msg->addVector3Fast(_PREHASH_Size, body_size); - // Send the AgentIsNowWearing - gMessageSystem->newMessageFast(_PREHASH_AgentIsNowWearing); + // To guard against out of order packets + // Note: always start by sending 1. This resets the server's count. 0 on the server means "uninitialized" + mAppearanceSerialNum++; + msg->addU32Fast(_PREHASH_SerialNum, mAppearanceSerialNum ); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID()); + // is texture data current relative to wearables? + // KLW - TAT this will probably need to check the local queue. + BOOL textures_current = mAvatarObject->areTexturesCurrent(); - lldebugs << "sendAgentWearablesUpdate()" << llendl; - for(i=0; i < WT_COUNT; ++i) + for(U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++ ) { - gMessageSystem->nextBlockFast(_PREHASH_WearableData); - - U8 type_u8 = (U8)i; - gMessageSystem->addU8Fast(_PREHASH_WearableType, type_u8 ); + const ETextureIndex texture_index = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index); - LLWearable* wearable = mWearableEntry[ i ].mWearable; - if( wearable ) + // if we're not wearing a skirt, we don't need the texture to be baked + if (texture_index == TEX_SKIRT_BAKED && !mAvatarObject->isWearingWearableType(WT_SKIRT)) { - //llinfos << "Sending wearable " << wearable->getName() << llendl; - gMessageSystem->addUUIDFast(_PREHASH_ItemID, mWearableEntry[ i ].mItemID ); + continue; } - else + + // IMG_DEFAULT_AVATAR means not baked + if (!mAvatarObject->isTextureDefined(texture_index)) { - //llinfos << "Not wearing wearable type " << LLWearable::typeToTypeName((EWearableType)i) << llendl; - gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID::null ); + textures_current = FALSE; + break; } - - lldebugs << " " << LLWearable::typeToTypeLabel((EWearableType)i) << ": " << (wearable ? wearable->getID() : LLUUID::null) << llendl; } - gAgent.sendReliableMessage(); -} -void LLAgent::saveWearable( EWearableType type, BOOL send_update ) -{ - LLWearable* old_wearable = mWearableEntry[(S32)type].mWearable; - if( old_wearable && (old_wearable->isDirty() || old_wearable->isOldVersion()) ) + // only update cache entries if we have all our baked textures + if (textures_current) { - LLWearable* new_wearable = gWearableList.createCopyFromAvatar( old_wearable ); - mWearableEntry[(S32)type].mWearable = new_wearable; - - LLInventoryItem* item = gInventory.getItem(mWearableEntry[(S32)type].mItemID); - if( item ) - { - // Update existing inventory item - LLPointer<LLViewerInventoryItem> template_item = - new LLViewerInventoryItem(item->getUUID(), - item->getParentUUID(), - item->getPermissions(), - new_wearable->getID(), - new_wearable->getAssetType(), - item->getInventoryType(), - item->getName(), - item->getDescription(), - item->getSaleInfo(), - item->getFlags(), - item->getCreationDate()); - template_item->setTransactionID(new_wearable->getTransactionID()); - template_item->updateServer(FALSE); - gInventory.updateItem(template_item); - } - else + llinfos << "TAT: Sending cached texture data" << llendl; + for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { - // Add a new inventory item (shouldn't ever happen here) - U32 todo = addWearableToAgentInventoryCallback::CALL_NONE; - if (send_update) + const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); + LLUUID hash; + for (U8 i=0; i < baked_dict->mWearables.size(); i++) { - todo |= addWearableToAgentInventoryCallback::CALL_UPDATE; + // EWearableType wearable_type = gBakedWearableMap[baked_index][wearable_num]; + const EWearableType wearable_type = baked_dict->mWearables[i]; + // MULTI-WEARABLE: fixed to 0th - extend to everything once messaging works. + const LLWearable* wearable = gAgentWearables.getWearable(wearable_type,0); + if (wearable) + { + hash ^= wearable->getID(); + } + } + if (hash.notNull()) + { + hash ^= baked_dict->mWearablesHashID; } - LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( - LLPointer<LLRefCount>(NULL), - (S32)type, - new_wearable, - todo); - addWearableToAgentInventory(cb, new_wearable); - return; - } - - getAvatarObject()->wearableUpdated( type ); - if( send_update ) - { - sendAgentWearablesUpdate(); - } - } -} + const ETextureIndex texture_index = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index); -void LLAgent::saveWearableAs( - EWearableType type, - const std::string& new_name, - BOOL save_in_lost_and_found) -{ - if(!isWearableCopyable(type)) - { - llwarns << "LLAgent::saveWearableAs() not copyable." << llendl; - return; - } - LLWearable* old_wearable = getWearable(type); - if(!old_wearable) - { - llwarns << "LLAgent::saveWearableAs() no old wearable." << llendl; - return; - } - LLInventoryItem* item = gInventory.getItem(mWearableEntry[type].mItemID); - if(!item) - { - llwarns << "LLAgent::saveWearableAs() no inventory item." << llendl; - return; - } - std::string trunc_name(new_name); - LLStringUtil::truncate(trunc_name, DB_INV_ITEM_NAME_STR_LEN); - LLWearable* new_wearable = gWearableList.createCopyFromAvatar( - old_wearable, - trunc_name); - LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( - LLPointer<LLRefCount>(NULL), - type, - new_wearable, - addWearableToAgentInventoryCallback::CALL_UPDATE); - LLUUID category_id; - if (save_in_lost_and_found) - { - category_id = gInventory.findCategoryUUIDForType( - LLAssetType::AT_LOST_AND_FOUND); + msg->nextBlockFast(_PREHASH_WearableData); + msg->addUUIDFast(_PREHASH_CacheID, hash); + msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index); + } + msg->nextBlockFast(_PREHASH_ObjectData); + mAvatarObject->packTEMessage( gMessageSystem ); } else { - // put in same folder as original - category_id = item->getParentUUID(); - } - - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - category_id, - new_name, - cb); - -/* - LLWearable* old_wearable = getWearable( type ); - if( old_wearable ) - { - std::string old_name = old_wearable->getName(); - old_wearable->setName( new_name ); - LLWearable* new_wearable = gWearableList.createCopyFromAvatar( old_wearable ); - old_wearable->setName( old_name ); - - LLUUID category_id; - LLInventoryItem* item = gInventory.getItem( mWearableEntry[ type ].mItemID ); - if( item ) - { - new_wearable->setPermissions(item->getPermissions()); - if (save_in_lost_and_found) - { - category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); - } - else - { - // put in same folder as original - category_id = item->getParentUUID(); - } - LLInventoryView* view = LLInventoryView::getActiveInventory(); - if(view) - { - view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO); - } - } - - mWearableEntry[ type ].mWearable = new_wearable; - LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( - LLPointer<LLRefCount>(NULL), - type, - addWearableToAgentInventoryCallback::CALL_UPDATE); - addWearableToAgentInventory(cb, new_wearable, category_id); - } -*/ -} - -void LLAgent::revertWearable( EWearableType type ) -{ - LLWearable* wearable = mWearableEntry[(S32)type].mWearable; - if( wearable ) - { - wearable->writeToAvatar( TRUE ); - } - sendAgentSetAppearance(); -} - -void LLAgent::revertAllWearables() -{ - for( S32 i=0; i < WT_COUNT; i++ ) - { - revertWearable( (EWearableType)i ); - } -} - -void LLAgent::saveAllWearables() -{ - //if(!gInventory.isLoaded()) - //{ - // return; - //} - - for( S32 i=0; i < WT_COUNT; i++ ) - { - saveWearable( (EWearableType)i, FALSE ); - } - sendAgentWearablesUpdate(); -} - -// Called when the user changes the name of a wearable inventory item that is currenlty being worn. -void LLAgent::setWearableName( const LLUUID& item_id, const std::string& new_name ) -{ - for( S32 i=0; i < WT_COUNT; i++ ) - { - if( mWearableEntry[i].mItemID == item_id ) - { - LLWearable* old_wearable = mWearableEntry[i].mWearable; - llassert( old_wearable ); - - std::string old_name = old_wearable->getName(); - old_wearable->setName( new_name ); - LLWearable* new_wearable = gWearableList.createCopy( old_wearable ); - LLInventoryItem* item = gInventory.getItem(item_id); - if(item) - { - new_wearable->setPermissions(item->getPermissions()); - } - old_wearable->setName( old_name ); - - mWearableEntry[i].mWearable = new_wearable; - sendAgentWearablesUpdate(); - break; - } - } -} - - -BOOL LLAgent::isWearableModifiable(EWearableType type) -{ - LLUUID item_id = getWearableItem(type); - if(!item_id.isNull()) - { - LLInventoryItem* item = gInventory.getItem(item_id); - if(item && item->getPermissions().allowModifyBy(gAgent.getID(), - gAgent.getGroupID())) - { - return TRUE; - } - } - return FALSE; -} - -BOOL LLAgent::isWearableCopyable(EWearableType type) -{ - LLUUID item_id = getWearableItem(type); - if(!item_id.isNull()) - { - LLInventoryItem* item = gInventory.getItem(item_id); - if(item && item->getPermissions().allowCopyBy(gAgent.getID(), - gAgent.getGroupID())) - { - return TRUE; - } - } - return FALSE; -} - -U32 LLAgent::getWearablePermMask(EWearableType type) -{ - LLUUID item_id = getWearableItem(type); - if(!item_id.isNull()) - { - LLInventoryItem* item = gInventory.getItem(item_id); - if(item) - { - return item->getPermissions().getMaskOwner(); - } - } - return PERM_NONE; -} - -LLInventoryItem* LLAgent::getWearableInventoryItem(EWearableType type) -{ - LLUUID item_id = getWearableItem(type); - LLInventoryItem* item = NULL; - if(item_id.notNull()) - { - item = gInventory.getItem(item_id); - } - return item; -} - -LLWearable* LLAgent::getWearableFromWearableItem( const LLUUID& item_id ) -{ - for( S32 i=0; i < WT_COUNT; i++ ) - { - if( mWearableEntry[i].mItemID == item_id ) - { - return mWearableEntry[i].mWearable; - } - } - return NULL; -} - - -void LLAgent::sendAgentWearablesRequest() -{ - gMessageSystem->newMessageFast(_PREHASH_AgentWearablesRequest); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); - sendReliableMessage(); -} - -// Used to enable/disable menu items. -// static -BOOL LLAgent::selfHasWearable( void* userdata ) -{ - EWearableType type = (EWearableType)(intptr_t)userdata; - return gAgent.getWearable( type ) != NULL; -} - -BOOL LLAgent::isWearingItem( const LLUUID& item_id ) -{ - return (getWearableFromWearableItem( item_id ) != NULL); -} - -// static -void LLAgent::processAgentInitialWearablesUpdate( LLMessageSystem* mesgsys, void** user_data ) -{ - // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates - // that may result from AgentWearablesRequest having been sent more than once. - static bool first = true; - if (!first) return; - first = false; - - LLUUID agent_id; - gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); - - LLVOAvatar* avatar = gAgent.getAvatarObject(); - if( avatar && (agent_id == avatar->getID()) ) - { - gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, gAgent.mAgentWearablesUpdateSerialNum ); - - S32 num_wearables = gMessageSystem->getNumberOfBlocksFast(_PREHASH_WearableData); - if( num_wearables < 4 ) - { - // Transitional state. Avatars should always have at least their body parts (hair, eyes, shape and skin). - // The fact that they don't have any here (only a dummy is sent) implies that this account existed - // before we had wearables, or that the database has gotten messed up. - return; - } - - //lldebugs << "processAgentInitialWearablesUpdate()" << llendl; - // Add wearables - LLUUID asset_id_array[ WT_COUNT ]; - S32 i; - for( i=0; i < num_wearables; i++ ) - { - U8 type_u8 = 0; - gMessageSystem->getU8Fast(_PREHASH_WearableData, _PREHASH_WearableType, type_u8, i ); - if( type_u8 >= WT_COUNT ) - { - continue; - } - EWearableType type = (EWearableType) type_u8; - - LLUUID item_id; - gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_ItemID, item_id, i ); - - LLUUID asset_id; - gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_AssetID, asset_id, i ); - if( asset_id.isNull() ) - { - LLWearable::removeFromAvatar( type, FALSE ); - } - else - { - LLAssetType::EType asset_type = LLWearable::typeToAssetType( type ); - if( asset_type == LLAssetType::AT_NONE ) - { - continue; - } - - gAgent.mWearableEntry[type].mItemID = item_id; - asset_id_array[type] = asset_id; - } - - lldebugs << " " << LLWearable::typeToTypeLabel(type) << llendl; - } - - // now that we have the asset ids...request the wearable assets - for( i = 0; i < WT_COUNT; i++ ) - { - if( !gAgent.mWearableEntry[i].mItemID.isNull() ) - { - gWearableList.getAsset( - asset_id_array[i], - LLStringUtil::null, - LLWearable::typeToAssetType( (EWearableType) i ), - LLAgent::onInitialWearableAssetArrived, (void*)(intptr_t)i ); - } - } - } -} - -// A single wearable that the avatar was wearing on start-up has arrived from the database. -// static -void LLAgent::onInitialWearableAssetArrived( LLWearable* wearable, void* userdata ) -{ - EWearableType type = (EWearableType)(intptr_t)userdata; - - LLVOAvatar* avatar = gAgent.getAvatarObject(); - if( !avatar ) - { - return; - } - - if( wearable ) - { - llassert( type == wearable->getType() ); - gAgent.mWearableEntry[ type ].mWearable = wearable; - - // disable composites if initial textures are baked - avatar->setupComposites(); - gAgent.queryWearableCache(); - - wearable->writeToAvatar( FALSE ); - avatar->setCompositeUpdatesEnabled(TRUE); - gInventory.addChangedMask( LLInventoryObserver::LABEL, gAgent.mWearableEntry[type].mItemID ); - } - else - { - // Somehow the asset doesn't exist in the database. - gAgent.recoverMissingWearable( type ); - } - - gInventory.notifyObservers(); - - // Have all the wearables that the avatar was wearing at log-in arrived? - if( !gAgent.mWearablesLoaded ) - { - gAgent.mWearablesLoaded = TRUE; - for( S32 i = 0; i < WT_COUNT; i++ ) - { - if( !gAgent.mWearableEntry[i].mItemID.isNull() && !gAgent.mWearableEntry[i].mWearable ) - { - gAgent.mWearablesLoaded = FALSE; - break; - } - } - } - - if( gAgent.mWearablesLoaded ) - { - // Make sure that the server's idea of the avatar's wearables actually match the wearables. - gAgent.sendAgentSetAppearance(); - - // Check to see if there are any baked textures that we hadn't uploaded before we logged off last time. - // If there are any, schedule them to be uploaded as soon as the layer textures they depend on arrive. - if( !gAgent.cameraCustomizeAvatar() ) - { - avatar->requestLayerSetUploads(); - } - } -} - -// Normally, all wearables referred to "AgentWearablesUpdate" will correspond to actual assets in the -// database. If for some reason, we can't load one of those assets, we can try to reconstruct it so that -// the user isn't left without a shape, for example. (We can do that only after the inventory has loaded.) -void LLAgent::recoverMissingWearable( EWearableType type ) -{ - // Try to recover by replacing missing wearable with a new one. - LLNotifications::instance().add("ReplacedMissingWearable"); - lldebugs << "Wearable " << LLWearable::typeToTypeLabel( type ) << " could not be downloaded. Replaced inventory item with default wearable." << llendl; - LLWearable* new_wearable = gWearableList.createNewWearable(type); - - S32 type_s32 = (S32) type; - mWearableEntry[type_s32].mWearable = new_wearable; - new_wearable->writeToAvatar( TRUE ); - - // Add a new one in the lost and found folder. - // (We used to overwrite the "not found" one, but that could potentially - // destory content.) JC - LLUUID lost_and_found_id = - gInventory.findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); - LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( - LLPointer<LLRefCount>(NULL), - type_s32, - new_wearable, - addWearableToAgentInventoryCallback::CALL_RECOVERDONE); - addWearableToAgentInventory( cb, new_wearable, lost_and_found_id, TRUE); -} - -void LLAgent::recoverMissingWearableDone() -{ - // Have all the wearables that the avatar was wearing at log-in arrived or been fabricated? - mWearablesLoaded = TRUE; - for( S32 i = 0; i < WT_COUNT; i++ ) - { - if( !mWearableEntry[i].mItemID.isNull() && !mWearableEntry[i].mWearable ) - { - mWearablesLoaded = FALSE; - break; - } - } - - if( mWearablesLoaded ) - { - // Make sure that the server's idea of the avatar's wearables actually match the wearables. - sendAgentSetAppearance(); - } - else - { - gInventory.addChangedMask( LLInventoryObserver::LABEL, LLUUID::null ); - gInventory.notifyObservers(); - } -} - -void LLAgent::createStandardWearables(BOOL female) -{ - llwarns << "Creating Standard " << (female ? "female" : "male" ) - << " Wearables" << llendl; - - if (mAvatarObject.isNull()) - { - return; - } - - if(female) mAvatarObject->setSex(SEX_FEMALE); - else mAvatarObject->setSex(SEX_MALE); - - BOOL create[WT_COUNT] = - { - TRUE, //WT_SHAPE - TRUE, //WT_SKIN - TRUE, //WT_HAIR - TRUE, //WT_EYES - TRUE, //WT_SHIRT - TRUE, //WT_PANTS - TRUE, //WT_SHOES - TRUE, //WT_SOCKS - FALSE, //WT_JACKET - FALSE, //WT_GLOVES - TRUE, //WT_UNDERSHIRT - TRUE, //WT_UNDERPANTS - FALSE //WT_SKIRT - }; - - for( S32 i=0; i < WT_COUNT; i++ ) - { - bool once = false; - LLPointer<LLRefCount> donecb = NULL; - if( create[i] ) - { - if (!once) - { - once = true; - donecb = new createStandardWearablesAllDoneCallback; - } - llassert( mWearableEntry[i].mWearable == NULL ); - LLWearable* wearable = gWearableList.createNewWearable((EWearableType)i); - mWearableEntry[i].mWearable = wearable; - // no need to update here... - LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( - donecb, - i, - wearable, - addWearableToAgentInventoryCallback::CALL_CREATESTANDARDDONE); - addWearableToAgentInventory(cb, wearable, LLUUID::null, FALSE); - } - } -} -void LLAgent::createStandardWearablesDone(S32 index) -{ - LLWearable* wearable = mWearableEntry[index].mWearable; - - if (wearable) - { - wearable->writeToAvatar(TRUE); - } -} - -void LLAgent::createStandardWearablesAllDone() -{ - // ... because sendAgentWearablesUpdate will notify inventory - // observers. - mWearablesLoaded = TRUE; - sendAgentWearablesUpdate(); - sendAgentSetAppearance(); - - // Treat this as the first texture entry message, if none received yet - mAvatarObject->onFirstTEMessageReceived(); -} - -void LLAgent::makeNewOutfit( - const std::string& new_folder_name, - const LLDynamicArray<S32>& wearables_to_include, - const LLDynamicArray<S32>& attachments_to_include, - BOOL rename_clothing) -{ - if (mAvatarObject.isNull()) - { - return; - } - - // First, make a folder in the Clothes directory. - LLUUID folder_id = gInventory.createNewCategory( - gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING), - LLAssetType::AT_NONE, - new_folder_name); - - bool found_first_item = false; - - /////////////////// - // Wearables - - if( wearables_to_include.count() ) - { - // Then, iterate though each of the wearables and save copies of them in the folder. - S32 i; - S32 count = wearables_to_include.count(); - LLDynamicArray<LLUUID> delete_items; - LLPointer<LLRefCount> cbdone = NULL; - for( i = 0; i < count; ++i ) - { - S32 index = wearables_to_include[i]; - LLWearable* old_wearable = mWearableEntry[ index ].mWearable; - if( old_wearable ) - { - std::string new_name; - LLWearable* new_wearable; - new_wearable = gWearableList.createCopy(old_wearable); - if (rename_clothing) - { - new_name = new_folder_name; - new_name.append(" "); - new_name.append(old_wearable->getTypeLabel()); - LLStringUtil::truncate(new_name, DB_INV_ITEM_NAME_STR_LEN); - new_wearable->setName(new_name); - } - - LLViewerInventoryItem* item = gInventory.getItem(mWearableEntry[index].mItemID); - S32 todo = addWearableToAgentInventoryCallback::CALL_NONE; - if (!found_first_item) - { - found_first_item = true; - /* set the focus to the first item */ - todo |= addWearableToAgentInventoryCallback::CALL_MAKENEWOUTFITDONE; - /* send the agent wearables update when done */ - cbdone = new sendAgentWearablesUpdateCallback; - } - LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( - cbdone, - index, - new_wearable, - todo); - if (isWearableCopyable((EWearableType)index)) - { - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - folder_id, - new_name, - cb); - } - else - { - move_inventory_item( - gAgent.getID(), - gAgent.getSessionID(), - item->getUUID(), - folder_id, - new_name, - cb); - } - } - } - gInventory.notifyObservers(); - } - - - /////////////////// - // Attachments - - if( attachments_to_include.count() ) - { - BOOL msg_started = FALSE; - LLMessageSystem* msg = gMessageSystem; - for( S32 i = 0; i < attachments_to_include.count(); i++ ) - { - S32 attachment_pt = attachments_to_include[i]; - LLViewerJointAttachment* attachment = get_if_there(mAvatarObject->mAttachmentPoints, attachment_pt, (LLViewerJointAttachment*)NULL ); - if(!attachment) continue; - LLViewerObject* attached_object = attachment->getObject(); - if(!attached_object) continue; - const LLUUID& item_id = attachment->getItemID(); - if(item_id.isNull()) continue; - LLInventoryItem* item = gInventory.getItem(item_id); - if(!item) continue; - if(!msg_started) - { - msg_started = TRUE; - msg->newMessage("CreateNewOutfitAttachments"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", getID()); - msg->addUUID("SessionID", getSessionID()); - msg->nextBlock("HeaderData"); - msg->addUUID("NewFolderID", folder_id); - } - msg->nextBlock("ObjectData"); - msg->addUUID("OldItemID", item_id); - msg->addUUID("OldFolderID", item->getParentUUID()); - } - - if( msg_started ) - { - sendReliableMessage(); - } - - } -} - -void LLAgent::makeNewOutfitDone(S32 index) -{ - LLUUID first_item_id = mWearableEntry[index].mItemID; - // Open the inventory and select the first item we added. - if( first_item_id.notNull() ) - { - LLInventoryView* view = LLInventoryView::getActiveInventory(); - if(view) - { - view->getPanel()->setSelection(first_item_id, TAKE_FOCUS_NO); - } - } -} - - -void LLAgent::addWearableToAgentInventory( - LLPointer<LLInventoryCallback> cb, - LLWearable* wearable, - const LLUUID& category_id, - BOOL notify) -{ - create_inventory_item( - gAgent.getID(), - gAgent.getSessionID(), - category_id, - wearable->getTransactionID(), - wearable->getName(), - wearable->getDescription(), - wearable->getAssetType(), - LLInventoryType::IT_WEARABLE, - wearable->getType(), - wearable->getPermissions().getMaskNextOwner(), - cb); -} - -//----------------------------------------------------------------------------- -// sendAgentSetAppearance() -//----------------------------------------------------------------------------- -void LLAgent::sendAgentSetAppearance() -{ - if (mAvatarObject.isNull()) return; - - if (mNumPendingQueries > 0 && !gAgent.cameraCustomizeAvatar()) - { - return; - } - - - llinfos << "TAT: Sent AgentSetAppearance: " << mAvatarObject->getBakedStatusForPrintout() << llendl; - //dumpAvatarTEs( "sendAgentSetAppearance()" ); - - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_AgentSetAppearance); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, getID()); - msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); - - // correct for the collision tolerance (to make it look like the - // agent is actually walking on the ground/object) - // NOTE -- when we start correcting all of the other Havok geometry - // to compensate for the COLLISION_TOLERANCE ugliness we will have - // to tweak this number again - const LLVector3 body_size = mAvatarObject->mBodySize; - msg->addVector3Fast(_PREHASH_Size, body_size); - - // To guard against out of order packets - // Note: always start by sending 1. This resets the server's count. 0 on the server means "uninitialized" - mAppearanceSerialNum++; - msg->addU32Fast(_PREHASH_SerialNum, mAppearanceSerialNum ); - - // is texture data current relative to wearables? - // KLW - TAT this will probably need to check the local queue. - BOOL textures_current = !mAvatarObject->hasPendingBakedUploads() && mWearablesLoaded; - - for(U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++ ) - { - const ETextureIndex texture_index = getTextureIndex((EBakedTextureIndex)baked_index); - - // if we're not wearing a skirt, we don't need the texture to be baked - if (texture_index == TEX_SKIRT_BAKED && !mAvatarObject->isWearingWearableType(WT_SKIRT)) - { - continue; - } - - // IMG_DEFAULT_AVATAR means not baked - if (!mAvatarObject->isTextureDefined(texture_index)) - { - textures_current = FALSE; - break; - } - } - - // only update cache entries if we have all our baked textures - if (textures_current) - { - llinfos << "TAT: Sending cached texture data" << llendl; - for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) - { - const LLVOAvatarDictionary::WearableDictionaryEntry *wearable_dict = LLVOAvatarDictionary::getInstance()->getWearable((EBakedTextureIndex)baked_index); - LLUUID hash; - for (U8 i=0; i < wearable_dict->mWearablesVec.size(); i++) - { - // EWearableType wearable_type = gBakedWearableMap[baked_index][wearable_num]; - const EWearableType wearable_type = wearable_dict->mWearablesVec[i]; - const LLWearable* wearable = getWearable(wearable_type); - if (wearable) - { - hash ^= wearable->getID(); - } - } - if (hash.notNull()) - { - hash ^= wearable_dict->mHashID; - } - - const ETextureIndex texture_index = getTextureIndex((EBakedTextureIndex)baked_index); - - msg->nextBlockFast(_PREHASH_WearableData); - msg->addUUIDFast(_PREHASH_CacheID, hash); - msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index); - } - msg->nextBlockFast(_PREHASH_ObjectData); - mAvatarObject->packTEMessage( gMessageSystem ); - } - else - { - // If the textures aren't baked, send NULL for texture IDs - // This means the baked texture IDs on the server will be untouched. - // Once all textures are baked, another AvatarAppearance message will be sent to update the TEs - msg->nextBlockFast(_PREHASH_ObjectData); - gMessageSystem->addBinaryDataFast(_PREHASH_TextureEntry, NULL, 0); + // If the textures aren't baked, send NULL for texture IDs + // This means the baked texture IDs on the server will be untouched. + // Once all textures are baked, another AvatarAppearance message will be sent to update the TEs + msg->nextBlockFast(_PREHASH_ObjectData); + gMessageSystem->addBinaryDataFast(_PREHASH_TextureEntry, NULL, 0); } @@ -7294,456 +6492,20 @@ void LLAgent::sendAgentDataUpdateRequest() { gMessageSystem->newMessageFast(_PREHASH_AgentDataUpdateRequest); gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); sendReliableMessage(); } -void LLAgent::removeWearable( EWearableType type ) -{ - LLWearable* old_wearable = mWearableEntry[ type ].mWearable; - - if ( (gAgent.isTeen()) - && (type == WT_UNDERSHIRT || type == WT_UNDERPANTS)) - { - // Can't take off underclothing in simple UI mode or on PG accounts - return; - } - - if( old_wearable ) - { - if( old_wearable->isDirty() ) - { - LLSD payload; - payload["wearable_type"] = (S32)type; - // Bring up view-modal dialog: Save changes? Yes, No, Cancel - LLNotifications::instance().add("WearableSave", LLSD(), payload, &LLAgent::onRemoveWearableDialog); - return; - } - else - { - removeWearableFinal( type ); - } - } -} - -// static -bool LLAgent::onRemoveWearableDialog(const LLSD& notification, const LLSD& response ) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - EWearableType type = (EWearableType)notification["payload"]["wearable_type"].asInteger(); - switch( option ) - { - case 0: // "Save" - gAgent.saveWearable( type ); - gAgent.removeWearableFinal( type ); - break; - - case 1: // "Don't Save" - gAgent.removeWearableFinal( type ); - break; - - case 2: // "Cancel" - break; - - default: - llassert(0); - break; - } - return false; -} - -// Called by removeWearable() and onRemoveWearableDialog() to actually do the removal. -void LLAgent::removeWearableFinal( EWearableType type ) -{ - LLWearable* old_wearable = mWearableEntry[ type ].mWearable; - - gInventory.addChangedMask( LLInventoryObserver::LABEL, mWearableEntry[type].mItemID ); - - mWearableEntry[ type ].mWearable = NULL; - mWearableEntry[ type ].mItemID.setNull(); - - queryWearableCache(); - - if( old_wearable ) - { - old_wearable->removeFromAvatar( TRUE ); - } - - // Update the server - sendAgentWearablesUpdate(); - sendAgentSetAppearance(); - gInventory.notifyObservers(); -} - -void LLAgent::copyWearableToInventory( EWearableType type ) -{ - LLWearable* wearable = mWearableEntry[ type ].mWearable; - if( wearable ) - { - // Save the old wearable if it has changed. - if( wearable->isDirty() ) - { - wearable = gWearableList.createCopyFromAvatar( wearable ); - mWearableEntry[ type ].mWearable = wearable; - } - - // Make a new entry in the inventory. (Put it in the same folder as the original item if possible.) - LLUUID category_id; - LLInventoryItem* item = gInventory.getItem( mWearableEntry[ type ].mItemID ); - if( item ) - { - category_id = item->getParentUUID(); - wearable->setPermissions(item->getPermissions()); - } - LLPointer<LLInventoryCallback> cb = - new addWearableToAgentInventoryCallback( - LLPointer<LLRefCount>(NULL), - type, - wearable); - addWearableToAgentInventory(cb, wearable, category_id); - } -} - - -// A little struct to let setWearable() communicate more than one value with onSetWearableDialog(). -struct LLSetWearableData -{ - LLSetWearableData( const LLUUID& new_item_id, LLWearable* new_wearable ) : - mNewItemID( new_item_id ), mNewWearable( new_wearable ) {} - LLUUID mNewItemID; - LLWearable* mNewWearable; -}; - -BOOL LLAgent::needsReplacement(EWearableType wearableType, S32 remove) -{ - return TRUE; - /*if (remove) return TRUE; - - return getWearable(wearableType) ? TRUE : FALSE;*/ -} - -// Assumes existing wearables are not dirty. -void LLAgent::setWearableOutfit( - const LLInventoryItem::item_array_t& items, - const LLDynamicArray< LLWearable* >& wearables, - BOOL remove ) -{ - lldebugs << "setWearableOutfit() start" << llendl; - - BOOL wearables_to_remove[WT_COUNT]; - wearables_to_remove[WT_SHAPE] = FALSE; - wearables_to_remove[WT_SKIN] = FALSE; - wearables_to_remove[WT_HAIR] = FALSE; - wearables_to_remove[WT_EYES] = FALSE; - wearables_to_remove[WT_SHIRT] = remove; - wearables_to_remove[WT_PANTS] = remove; - wearables_to_remove[WT_SHOES] = remove; - wearables_to_remove[WT_SOCKS] = remove; - wearables_to_remove[WT_JACKET] = remove; - wearables_to_remove[WT_GLOVES] = remove; - wearables_to_remove[WT_UNDERSHIRT] = (!gAgent.isTeen()) & remove; - wearables_to_remove[WT_UNDERPANTS] = (!gAgent.isTeen()) & remove; - wearables_to_remove[WT_SKIRT] = remove; - - S32 count = wearables.count(); - llassert( items.count() == count ); - - S32 i; - for( i = 0; i < count; i++ ) - { - LLWearable* new_wearable = wearables[i]; - LLPointer<LLInventoryItem> new_item = items[i]; - - EWearableType type = new_wearable->getType(); - wearables_to_remove[type] = FALSE; - - LLWearable* old_wearable = mWearableEntry[ type ].mWearable; - if( old_wearable ) - { - const LLUUID& old_item_id = mWearableEntry[ type ].mItemID; - if( (old_wearable->getID() == new_wearable->getID()) && - (old_item_id == new_item->getUUID()) ) - { - lldebugs << "No change to wearable asset and item: " << LLWearable::typeToTypeName( type ) << llendl; - continue; - } - - gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id); - - // Assumes existing wearables are not dirty. - if( old_wearable->isDirty() ) - { - llassert(0); - continue; - } - } - - mWearableEntry[ type ].mItemID = new_item->getUUID(); - mWearableEntry[ type ].mWearable = new_wearable; - } - - std::vector<LLWearable*> wearables_being_removed; - - for( i = 0; i < WT_COUNT; i++ ) - { - if( wearables_to_remove[i] ) - { - wearables_being_removed.push_back(mWearableEntry[ i ].mWearable); - mWearableEntry[ i ].mWearable = NULL; - - gInventory.addChangedMask(LLInventoryObserver::LABEL, mWearableEntry[ i ].mItemID); - mWearableEntry[ i ].mItemID.setNull(); - } - } - - gInventory.notifyObservers(); - - queryWearableCache(); - - std::vector<LLWearable*>::iterator wearable_iter; - - for( wearable_iter = wearables_being_removed.begin(); - wearable_iter != wearables_being_removed.end(); - ++wearable_iter) - { - LLWearable* wearablep = *wearable_iter; - if (wearablep) - { - wearablep->removeFromAvatar( TRUE ); - } - } - - for( i = 0; i < count; i++ ) - { - wearables[i]->writeToAvatar( TRUE ); - } - - // Start rendering & update the server - mWearablesLoaded = TRUE; - sendAgentWearablesUpdate(); - sendAgentSetAppearance(); - - lldebugs << "setWearableOutfit() end" << llendl; -} - - -// User has picked "wear on avatar" from a menu. -void LLAgent::setWearable( LLInventoryItem* new_item, LLWearable* new_wearable ) -{ - EWearableType type = new_wearable->getType(); - - LLWearable* old_wearable = mWearableEntry[ type ].mWearable; - if( old_wearable ) - { - const LLUUID& old_item_id = mWearableEntry[ type ].mItemID; - if( (old_wearable->getID() == new_wearable->getID()) && - (old_item_id == new_item->getUUID()) ) - { - lldebugs << "No change to wearable asset and item: " << LLWearable::typeToTypeName( type ) << llendl; - return; - } - - if( old_wearable->isDirty() ) - { - // Bring up modal dialog: Save changes? Yes, No, Cancel - LLSD payload; - payload["item_id"] = new_item->getUUID(); - LLNotifications::instance().add( "WearableSave", LLSD(), payload, boost::bind(LLAgent::onSetWearableDialog, _1, _2, new_wearable)); - return; - } - } - - setWearableFinal( new_item, new_wearable ); -} - -// static -bool LLAgent::onSetWearableDialog( const LLSD& notification, const LLSD& response, LLWearable* wearable ) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - LLInventoryItem* new_item = gInventory.getItem( notification["payload"]["item_id"].asUUID()); - if( !new_item ) - { - delete wearable; - return false; - } - - switch( option ) - { - case 0: // "Save" - gAgent.saveWearable( wearable->getType() ); - gAgent.setWearableFinal( new_item, wearable ); - break; - - case 1: // "Don't Save" - gAgent.setWearableFinal( new_item, wearable ); - break; - - case 2: // "Cancel" - break; - - default: - llassert(0); - break; - } - - delete wearable; - return false; -} - -// Called from setWearable() and onSetWearableDialog() to actually set the wearable. -void LLAgent::setWearableFinal( LLInventoryItem* new_item, LLWearable* new_wearable ) -{ - EWearableType type = new_wearable->getType(); - - // Replace the old wearable with a new one. - llassert( new_item->getAssetUUID() == new_wearable->getID() ); - LLUUID old_item_id = mWearableEntry[ type ].mItemID; - mWearableEntry[ type ].mItemID = new_item->getUUID(); - mWearableEntry[ type ].mWearable = new_wearable; - - if (old_item_id.notNull()) - { - gInventory.addChangedMask( LLInventoryObserver::LABEL, old_item_id ); - gInventory.notifyObservers(); - } - - //llinfos << "LLVOAvatar::setWearable()" << llendl; - queryWearableCache(); - new_wearable->writeToAvatar( TRUE ); - - // Update the server - sendAgentWearablesUpdate(); - sendAgentSetAppearance(); -} - -void LLAgent::queryWearableCache() +void LLAgent::sendAgentUserInfoRequest() { - if (!mWearablesLoaded) - { - return; - } - - // Look up affected baked textures. - // If they exist: - // disallow updates for affected layersets (until dataserver responds with cache request.) - // If cache miss, turn updates back on and invalidate composite. - // If cache hit, modify baked texture entries. - // - // Cache requests contain list of hashes for each baked texture entry. - // Response is list of valid baked texture assets. (same message) - - gMessageSystem->newMessageFast(_PREHASH_AgentCachedTexture); + if(getID().isNull()) + return; // not logged in + gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest); gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID()); gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID()); - gMessageSystem->addS32Fast(_PREHASH_SerialNum, mTextureCacheQueryID); - - S32 num_queries = 0; - for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++ ) - { - const LLVOAvatarDictionary::WearableDictionaryEntry *wearable_dict = LLVOAvatarDictionary::getInstance()->getWearable((EBakedTextureIndex)baked_index); - LLUUID hash; - for (U8 i=0; i < wearable_dict->mWearablesVec.size(); i++) - { - // EWearableType wearable_type = gBakedWearableMap[baked_index][wearable_num]; - const EWearableType wearable_type = wearable_dict->mWearablesVec[i]; - const LLWearable* wearable = getWearable(wearable_type); - if (wearable) - { - hash ^= wearable->getID(); - } - } - if (hash.notNull()) - { - hash ^= wearable_dict->mHashID; - num_queries++; - // *NOTE: make sure at least one request gets packed - - //llinfos << "Requesting texture for hash " << hash << " in baked texture slot " << baked_index << llendl; - gMessageSystem->nextBlockFast(_PREHASH_WearableData); - gMessageSystem->addUUIDFast(_PREHASH_ID, hash); - gMessageSystem->addU8Fast(_PREHASH_TextureIndex, (U8)baked_index); - } - - mActiveCacheQueries[ baked_index ] = mTextureCacheQueryID; - } - - llinfos << "Requesting texture cache entry for " << num_queries << " baked textures" << llendl; - gMessageSystem->sendReliable(getRegion()->getHost()); - mNumPendingQueries++; - mTextureCacheQueryID++; -} - -// User has picked "remove from avatar" from a menu. -// static -void LLAgent::userRemoveWearable( void* userdata ) -{ - EWearableType type = (EWearableType)(intptr_t)userdata; - - if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR ) ) //&& - //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) - { - gAgent.removeWearable( type ); - } -} - -void LLAgent::userRemoveAllClothes( void* userdata ) -{ - // We have to do this up front to avoid having to deal with the case of multiple wearables being dirty. - if( gFloaterCustomize ) - { - gFloaterCustomize->askToSaveIfDirty( LLAgent::userRemoveAllClothesStep2, NULL ); - } - else - { - LLAgent::userRemoveAllClothesStep2( TRUE, NULL ); - } -} - -void LLAgent::userRemoveAllClothesStep2( BOOL proceed, void* userdata ) -{ - if( proceed ) - { - gAgent.removeWearable( WT_SHIRT ); - gAgent.removeWearable( WT_PANTS ); - gAgent.removeWearable( WT_SHOES ); - gAgent.removeWearable( WT_SOCKS ); - gAgent.removeWearable( WT_JACKET ); - gAgent.removeWearable( WT_GLOVES ); - gAgent.removeWearable( WT_UNDERSHIRT ); - gAgent.removeWearable( WT_UNDERPANTS ); - gAgent.removeWearable( WT_SKIRT ); - } -} - -void LLAgent::userRemoveAllAttachments( void* userdata ) -{ - LLVOAvatar* avatarp = gAgent.getAvatarObject(); - if(!avatarp) - { - llwarns << "No avatar found." << llendl; - return; - } - - gMessageSystem->newMessage("ObjectDetach"); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - - for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); - iter != avatarp->mAttachmentPoints.end(); ) - { - LLVOAvatar::attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - LLViewerObject* objectp = attachment->getObject(); - if (objectp) - { - gMessageSystem->nextBlockFast(_PREHASH_ObjectData); - gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID()); - } - } - gMessageSystem->sendReliable( gAgent.getRegionHost() ); + sendReliableMessage(); } void LLAgent::observeFriends() @@ -7808,4 +6570,87 @@ void LLAgent::parseTeleportMessages(const std::string& xml_filename) }//end for (all message sets in xml file) } +// static +void LLAgent::createLandmarkHere() +{ + std::string landmark_name, landmark_desc; + + gAgent.buildLocationString(landmark_name, LLAgent::LOCATION_FORMAT_LANDMARK); + gAgent.buildLocationString(landmark_desc, LLAgent::LOCATION_FORMAT_FULL); + LLUUID folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); + + createLandmarkHere(landmark_name, landmark_desc, folder_id); +} + +// static +void LLAgent::createLandmarkHere(const std::string& name, const std::string& desc, const LLUUID& folder_id) +{ + LLViewerRegion* agent_region = gAgent.getRegion(); + if(!agent_region) + { + llwarns << "No agent region" << llendl; + return; + } + LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (!agent_parcel) + { + llwarns << "No agent parcel" << llendl; + return; + } + if (!agent_parcel->getAllowLandmark() + && !LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK)) + { + LLNotifications::instance().add("CannotCreateLandmarkNotOwner"); + return; + } + + create_inventory_item(gAgent.getID(), gAgent.getSessionID(), + folder_id, LLTransactionID::tnull, + name, desc, + LLAssetType::AT_LANDMARK, + LLInventoryType::IT_LANDMARK, + NOT_WEARABLE, PERM_ALL, + NULL); +} + +void LLAgent::sendAgentUpdateUserInfo(bool im_via_email, const std::string& directory_visibility ) +{ + gMessageSystem->newMessageFast(_PREHASH_UpdateUserInfo); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID()); + gMessageSystem->nextBlockFast(_PREHASH_UserData); + gMessageSystem->addBOOLFast(_PREHASH_IMViaEMail, im_via_email); + gMessageSystem->addString("DirectoryVisibility", directory_visibility); + gAgent.sendReliableMessage(); +} + +// static +void LLAgent::dumpGroupInfo() +{ + llinfos << "group " << gAgent.mGroupName << llendl; + llinfos << "ID " << gAgent.mGroupID << llendl; + llinfos << "powers " << gAgent.mGroupPowers << llendl; + llinfos << "title " << gAgent.mGroupTitle << llendl; + //llinfos << "insig " << gAgent.mGroupInsigniaID << llendl; +} + +/********************************************************************************/ +LLAgentQueryManager gAgentQueryManager; + +LLAgentQueryManager::LLAgentQueryManager() : + mWearablesCacheQueryID(0), + mNumPendingQueries(0), + mUpdateSerialNum(0) +{ + for (U32 i = 0; i < BAKED_NUM_INDICES; i++) + { + mActiveCacheQueries[i] = 0; + } +} + +LLAgentQueryManager::~LLAgentQueryManager() +{ +} + // EOF diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 27fcb07fd598c6e9d4f6e3a570d183c683dcefb3..94f6229838aa4624674749bd80add611ff19c3ab 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -33,63 +33,25 @@ #ifndef LL_LLAGENT_H #define LL_LLAGENT_H -#include <set> - #include "indra_constants.h" -#include "llmath.h" -#include "llcontrol.h" -#include "llcoordframe.h" -#include "llevent.h" +#include "llevent.h" // LLObservable base class +#include "llagentaccess.h" #include "llagentaccess.h" #include "llagentconstants.h" -#include "llanimationstates.h" -#include "lldbstrings.h" -#include "llhudeffectlookat.h" -#include "llhudeffectpointat.h" -#include "llmemory.h" -#include "llstring.h" -#include "lluuid.h" -#include "m3math.h" -#include "m4math.h" -#include "llquaternion.h" -#include "lltimer.h" -#include "v3dmath.h" -#include "v3math.h" -#include "v4color.h" -#include "v4math.h" -//#include "vmath.h" -#include "stdenums.h" -#include "llwearable.h" -#include "llcharacter.h" -#include "llinventory.h" -#include "llviewerinventory.h" -#include "llagentdata.h" - -// Ventrella -#include "llfollowcam.h" -// end Ventrella - -const U8 AGENT_STATE_TYPING = 0x04; // Typing indication -const U8 AGENT_STATE_EDITING = 0x10; // Set when agent has objects selected - -const BOOL ANIMATE = TRUE; - -typedef enum e_camera_modes -{ - CAMERA_MODE_THIRD_PERSON, - CAMERA_MODE_MOUSELOOK, - CAMERA_MODE_CUSTOMIZE_AVATAR, - CAMERA_MODE_FOLLOW -} ECameraMode; - -typedef enum e_anim_request -{ - ANIM_REQUEST_START, - ANIM_REQUEST_STOP -} EAnimRequest; +#include "llhudeffectpointat.h" // ELookAtType +#include "llhudeffectlookat.h" // EPointAtType +#include "llpointer.h" +#include "llcharacter.h" // LLAnimPauseRequest +#include "llfollowcam.h" // Ventrella +#include "llagentdata.h" // gAgentID, gAgentSessionID +#include "llvoavatardefines.h" + +extern const BOOL ANIMATE; +extern const U8 AGENT_STATE_TYPING; // Typing indication +extern const U8 AGENT_STATE_EDITING; // Set when agent has objects selected class LLChat; -class LLVOAvatar; +class LLVOAvatarSelf; class LLViewerRegion; class LLMotion; class LLToolset; @@ -98,6 +60,25 @@ class LLPermissions; class LLHost; class LLFriendObserver; class LLPickInfo; +class LLViewerObject; +class LLAgentDropGroupViewerNode; + +//-------------------------------------------------------------------- +// Types +//-------------------------------------------------------------------- +enum ECameraMode +{ + CAMERA_MODE_THIRD_PERSON, + CAMERA_MODE_MOUSELOOK, + CAMERA_MODE_CUSTOMIZE_AVATAR, + CAMERA_MODE_FOLLOW +}; + +enum EAnimRequest +{ + ANIM_REQUEST_START, + ANIM_REQUEST_STOP +}; struct LLGroupData { @@ -110,273 +91,437 @@ struct LLGroupData std::string mName; }; -inline bool operator==(const LLGroupData &a, const LLGroupData &b) -{ - return (a.mID == b.mID); -} - -// forward declarations - -// - +//------------------------------------------------------------------------ +// LLAgent +//------------------------------------------------------------------------ class LLAgent : public LLOldEvents::LLObservable { LOG_CLASS(LLAgent); - + public: - // When the agent hasn't typed anything for this duration, it leaves the - // typing state (for both chat and IM). - static const F32 TYPING_TIMEOUT_SECS; + friend class LLAgentDropGroupViewerNode; - LLAgent(); - ~LLAgent(); +/******************************************************************************** + ** ** + ** INITIALIZATION + **/ + //-------------------------------------------------------------------- + // Constructors / Destructors + //-------------------------------------------------------------------- +public: + LLAgent(); + virtual ~LLAgent(); void init(); void cleanup(); + void setAvatarObject(LLVOAvatarSelf *avatar); - // - // MANIPULATORS - // - // TODO: Put all non-const functions here. + //-------------------------------------------------------------------- + // Login + //-------------------------------------------------------------------- +public: + void onAppFocusGained(); + void setFirstLogin(BOOL b) { mFirstLogin = b; } + // Return TRUE if the database reported this login as the first for this particular user. + BOOL isFirstLogin() const { return mFirstLogin; } +public: + BOOL mInitialized; + BOOL mFirstLogin; + std::string mMOTD; // Message of the day - // Called whenever the agent moves. Puts camera back in default position, - // deselects items, etc. - void resetView(BOOL reset_camera = TRUE, BOOL change_camera = FALSE); + //-------------------------------------------------------------------- + // Session + //-------------------------------------------------------------------- +public: + const LLUUID& getID() const { return gAgentID; } + const LLUUID& getSessionID() const { return gAgentSessionID; } + // Note: NEVER send this value in the clear or over any weakly + // encrypted channel (such as simple XOR masking). If you are unsure + // ask Aaron or MarkL. + const LLUUID& getSecureSessionID() const { return mSecureSessionID; } +public: + LLUUID mSecureSessionID; // Secure token for this login session + +/** Initialization + ** ** + *******************************************************************************/ - // Called on camera movement, to allow the camera to be unlocked from the - // default position behind the avatar. - void unlockView(); +/******************************************************************************** + ** ** + ** IDENTITY + **/ - void onAppFocusGained(); + //-------------------------------------------------------------------- + // Name + //-------------------------------------------------------------------- +public: + void getName(std::string& name) const; + void buildFullname(std::string &name) const; + void buildFullnameAndTitle(std::string &name) const; - void sendMessage(); // Send message to this agent's region. - void sendReliableMessage(); + //-------------------------------------------------------------------- + // Gender + //-------------------------------------------------------------------- +public: + // On the very first login, gender isn't chosen until the user clicks + // in a dialog. We don't render the avatar until they choose. + BOOL isGenderChosen() const { return mGenderChosen; } + void setGenderChosen(BOOL b) { mGenderChosen = b; } +private: + BOOL mGenderChosen; - LLVector3d calcCameraPositionTargetGlobal(BOOL *hit_limit = NULL); // Calculate the camera position target - LLVector3d calcFocusPositionTargetGlobal(); - LLVector3d calcThirdPersonFocusOffset(); - // target for this mode - LLVector3d getCameraPositionGlobal() const; - const LLVector3 &getCameraPositionAgent() const; - F32 calcCameraFOVZoomFactor(); - F32 getCameraMinOffGround(); // minimum height off ground for this mode, meters - void endAnimationUpdateUI(); - void setKey(const S32 direction, S32 &key); // sets key to +1 for +direction, -1 for -direction - void handleScrollWheel(S32 clicks); // mousewheel driven zoom +/** Identity + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** GENERAL ACCESSORS + **/ + +public: + LLVOAvatarSelf* getAvatarObject() const { return mAvatarObject; } + const LLUUID& getInventoryRootID() const { return mInventoryRootID; } + LLUUID& getInventoryRootID() { return mInventoryRootID; } +private: + LLUUID mInventoryRootID; + LLPointer<LLVOAvatarSelf> mAvatarObject; // NULL until avatar object sent down from simulator + +/** General Accessors + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** POSITION + **/ + + //-------------------------------------------------------------------- + // Position + //-------------------------------------------------------------------- +public: + LLVector3 getPosAgentFromGlobal(const LLVector3d &pos_global) const; + LLVector3d getPosGlobalFromAgent(const LLVector3 &pos_agent) const; + const LLVector3d &getPositionGlobal() const; + const LLVector3 &getPositionAgent(); + // Call once per frame to update position, angles (radians). + void updateAgentPosition(const F32 dt, const F32 yaw, const S32 mouse_x, const S32 mouse_y); + void setPositionAgent(const LLVector3 ¢er); +protected: + void propagate(const F32 dt); // ! BUG ! Should roll into updateAgentPosition +private: + mutable LLVector3d mPositionGlobal; + + //-------------------------------------------------------------------- + // Velocity + //-------------------------------------------------------------------- +public: + LLVector3 getVelocity() const; + F32 getVelocityZ() const { return getVelocity().mV[VZ]; } // ! HACK ! - void setAvatarObject(LLVOAvatar *avatar); + //-------------------------------------------------------------------- + // Coordinate System + //-------------------------------------------------------------------- +public: + LLCoordFrame getFrameAgent() const { return mFrameAgent; } + void initOriginGlobal(const LLVector3d &origin_global); // Only to be used in ONE place + void resetAxes(); + void resetAxes(const LLVector3 &look_at); // Makes reasonable left and up + // The following three get*Axis functions return direction avatar is looking, not camera. + const LLVector3& getAtAxis() const { return mFrameAgent.getAtAxis(); } + const LLVector3& getUpAxis() const { return mFrameAgent.getUpAxis(); } + const LLVector3& getLeftAxis() const { return mFrameAgent.getLeftAxis(); } + LLQuaternion getQuat() const; // Returns the quat that represents the rotation of the agent in the absolute frame +private: + LLVector3d mAgentOriginGlobal; // Origin of agent coords from global coords + LLCoordFrame mFrameAgent; // Agent position and view, agent-region coordinates - // rendering state bitmask helpers - void startTyping(); - void stopTyping(); - void setRenderState(U8 newstate); - void clearRenderState(U8 clearstate); - U8 getRenderState(); - // Set the home data + //-------------------------------------------------------------------- + // Home + //-------------------------------------------------------------------- +public: + void setStartPosition(U32 location_id); // Marks current location as start, sends information to servers + void setHomePosRegion(const U64& region_handle, const LLVector3& pos_region); + BOOL getHomePosGlobal(LLVector3d* pos_global); +private: + BOOL mHaveHomePosition; + U64 mHomeRegionHandle; + LLVector3 mHomePosRegion; + + //-------------------------------------------------------------------- + // Region + //-------------------------------------------------------------------- +public: + enum ELocationFormat + { + LOCATION_FORMAT_NORMAL, + LOCATION_FORMAT_LANDMARK, + LOCATION_FORMAT_FULL, + }; void setRegion(LLViewerRegion *regionp); LLViewerRegion *getRegion() const; LLHost getRegionHost() const; std::string getSLURL() const; - - void updateAgentPosition(const F32 dt, const F32 yaw, const S32 mouse_x, const S32 mouse_y); // call once per frame to update position, angles radians - void updateLookAt(const S32 mouse_x, const S32 mouse_y); - + BOOL inPrelude(); + BOOL buildLocationString(std::string& str, ELocationFormat fmt = LOCATION_FORMAT_LANDMARK); // Utility to build a location string + static void createLandmarkHere(); + static void createLandmarkHere(const std::string& name, const std::string& desc, const LLUUID& folder_id); +private: + LLViewerRegion *mRegionp; - void updateCamera(); // call once per frame to update camera location/orientation - void resetCamera(); // slam camera into its default position - void setupSitCamera(); - void setCameraCollidePlane(const LLVector4 &plane) { mCameraCollidePlane = plane; } + //-------------------------------------------------------------------- + // History + //-------------------------------------------------------------------- +public: + S32 getRegionsVisited() const; + F64 getDistanceTraveled() const; +private: + std::set<U64> mRegionsVisited; // Stat - what distinct regions has the avatar been to? + F64 mDistanceTraveled; // Stat - how far has the avatar moved? + LLVector3d mLastPositionGlobal; // Used to calculate travel distance + +/** Position + ** ** + *******************************************************************************/ - void changeCameraToDefault(); - void changeCameraToMouselook(BOOL animate = TRUE); - void changeCameraToThirdPerson(BOOL animate = TRUE); - void changeCameraToCustomizeAvatar(BOOL avatar_animate = TRUE, BOOL camera_animate = TRUE); // trigger transition animation - // Ventrella - void changeCameraToFollow(BOOL animate = TRUE); - //end Ventrella +/******************************************************************************** + ** ** + ** ACTIONS + **/ - void setFocusGlobal(const LLPickInfo& pick); - void setFocusGlobal(const LLVector3d &focus, const LLUUID &object_id = LLUUID::null); - void setFocusOnAvatar(BOOL focus, BOOL animate); - void setCameraPosAndFocusGlobal(const LLVector3d& pos, const LLVector3d& focus, const LLUUID &object_id); - void setSitCamera(const LLUUID &object_id, const LLVector3 &camera_pos = LLVector3::zero, const LLVector3 &camera_focus = LLVector3::zero); - void clearFocusObject(); - void setFocusObject(LLViewerObject* object); - void setObjectTracking(BOOL track) { mTrackFocusObject = track; } -// void setLookingAtAvatar(BOOL looking); + //-------------------------------------------------------------------- + // Fidget + //-------------------------------------------------------------------- + // Trigger random fidget animations +public: + void fidget(); + static void stopFidget(); +private: + LLFrameTimer mFidgetTimer; + LLFrameTimer mFocusObjectFadeTimer; + F32 mNextFidgetTime; + S32 mCurrentFidget; + //-------------------------------------------------------------------- + // Fly + //-------------------------------------------------------------------- +public: + BOOL getFlying() const { return mControlFlags & AGENT_CONTROL_FLY; } + void setFlying(BOOL fly); + static void toggleFlying(); + static bool enableFlying(); + BOOL canFly(); // Does this parcel allow you to fly? + + //-------------------------------------------------------------------- + // Chat + //-------------------------------------------------------------------- +public: void heardChat(const LLUUID& id); void lookAtLastChat(); - F32 getTypingTime() { return mTypingTimer.getElapsedTimeF32(); } + F32 getTypingTime() { return mTypingTimer.getElapsedTimeF32(); } + LLUUID getLastChatter() const { return mLastChatterID; } + F32 getNearChatRadius() { return mNearChatRadius; } +protected: + void ageChat(); // Helper function to prematurely age chat when agent is moving +private: + LLFrameTimer mChatTimer; + LLUUID mLastChatterID; + F32 mNearChatRadius; + + //-------------------------------------------------------------------- + // Typing + //-------------------------------------------------------------------- +public: + void startTyping(); + void stopTyping(); +public: + // When the agent hasn't typed anything for this duration, it leaves the + // typing state (for both chat and IM). + static const F32 TYPING_TIMEOUT_SECS; +private: + LLFrameTimer mTypingTimer; + //-------------------------------------------------------------------- + // AFK + //-------------------------------------------------------------------- +public: void setAFK(); void clearAFK(); BOOL getAFK() const; - void setAlwaysRun() { mbAlwaysRun = true; } - void clearAlwaysRun() { mbAlwaysRun = false; } + //-------------------------------------------------------------------- + // Run + //-------------------------------------------------------------------- +public: + enum EDoubleTapRunMode + { + DOUBLETAP_NONE, + DOUBLETAP_FORWARD, + DOUBLETAP_BACKWARD, + DOUBLETAP_SLIDELEFT, + DOUBLETAP_SLIDERIGHT + }; - void setRunning() { mbRunning = true; } - void clearRunning() { mbRunning = false; } + void setAlwaysRun() { mbAlwaysRun = true; } + void clearAlwaysRun() { mbAlwaysRun = false; } + void setRunning() { mbRunning = true; } + void clearRunning() { mbRunning = false; } + void sendWalkRun(bool running); + bool getAlwaysRun() const { return mbAlwaysRun; } + bool getRunning() const { return mbRunning; } +public: + LLFrameTimer mDoubleTapRunTimer; + EDoubleTapRunMode mDoubleTapRunMode; +private: + bool mbAlwaysRun; // Should the avatar run by default rather than walk? + bool mbRunning; // Is the avatar trying to run right now? + //-------------------------------------------------------------------- + // Busy + //-------------------------------------------------------------------- +public: void setBusy(); void clearBusy(); BOOL getBusy() const; +private: + BOOL mIsBusy; - void setAdminOverride(BOOL b); - void setGodLevel(U8 god_level); - void setFirstLogin(BOOL b) { mFirstLogin = b; } - void setGenderChosen(BOOL b) { mGenderChosen = b; } - - // update internal datastructures and update the server with the - // new contribution level. Returns true if the group id was found - // and contribution could be set. - BOOL setGroupContribution(const LLUUID& group_id, S32 contribution); - BOOL setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile); - void setHideGroupTitle(BOOL hide) { mHideGroupTitle = hide; } + //-------------------------------------------------------------------- + // Jump + //-------------------------------------------------------------------- +public: + BOOL getJump() const { return mbJump; } +private: + BOOL mbJump; - // - // ACCESSORS - // - // TODO: Put all read functions here, make them const + //-------------------------------------------------------------------- + // Grab + //-------------------------------------------------------------------- +public: + BOOL leftButtonGrabbed() const; + BOOL rotateGrabbed() const; + BOOL forwardGrabbed() const; + BOOL backwardGrabbed() const; + BOOL upGrabbed() const; + BOOL downGrabbed() const; - const LLUUID& getID() const { return gAgentID; } - const LLUUID& getSessionID() const { return gAgentSessionID; } - - const LLUUID& getSecureSessionID() const { return mSecureSessionID; } - // Note: NEVER send this value in the clear or over any weakly - // encrypted channel (such as simple XOR masking). If you are unsure - // ask Aaron or MarkL. - - BOOL isGodlike() const; - U8 getGodLevel() const; - // note: this is a prime candidate for pulling out into a Maturity class - // rather than just expose the preference setting, we're going to actually - // expose what the client code cares about -- what the user should see - // based on a combination of the is* and prefers* flags, combined with God bit. - bool wantsPGOnly() const; - bool canAccessMature() const; - bool canAccessAdult() const; - bool canAccessMaturityInRegion( U64 region_handle ) const; - bool canAccessMaturityAtGlobal( LLVector3d pos_global ) const; - bool prefersPG() const; - bool prefersMature() const; - bool prefersAdult() const; - bool isTeen() const; - bool isMature() const; - bool isAdult() const; - void setTeen(bool teen); - void setMaturity(char text); - static int convertTextToMaturity(char text); - bool sendMaturityPreferenceToServer(int preferredMaturity); + //-------------------------------------------------------------------- + // Controls + //-------------------------------------------------------------------- +public: + U32 getControlFlags(); + void setControlFlags(U32 mask); // Performs bitwise mControlFlags |= mask + void clearControlFlags(U32 mask); // Performs bitwise mControlFlags &= ~mask + BOOL controlFlagsDirty() const; + void enableControlFlagReset(); + void resetControlFlags(); + BOOL anyControlGrabbed() const; // True iff a script has taken over a control + BOOL isControlGrabbed(S32 control_index) const; + // Send message to simulator to force grabbed controls to be + // released, in case of a poorly written script. + void forceReleaseControls(); +private: + S32 mControlsTakenCount[TOTAL_CONTROLS]; + S32 mControlsTakenPassedOnCount[TOTAL_CONTROLS]; + U32 mControlFlags; // Replacement for the mFooKey's + BOOL mbFlagsDirty; + BOOL mbFlagsNeedReset; // ! HACK ! For preventing incorrect flags sent when crossing region boundaries - const LLAgentAccess& getAgentAccess(); + //-------------------------------------------------------------------- + // Animations + //-------------------------------------------------------------------- +public: + void stopCurrentAnimations(); + void requestStopMotion(LLMotion* motion); + void onAnimStop(const LLUUID& id); + void sendAnimationRequests(LLDynamicArray<LLUUID> &anim_ids, EAnimRequest request); + void sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request); + void endAnimationUpdateUI(); +private: + LLFrameTimer mAnimationTimer; // Seconds that transition animation has been active + F32 mAnimationDuration; // In seconds + BOOL mCustomAnim; // Current animation is ANIM_AGENT_CUSTOMIZE ? + LLAnimPauseRequest mPauseRequest; + BOOL mViewsPushed; // Keep track of whether or not we have pushed views - // This function can go away after the AO transition (see llstartup.cpp) - void setAOTransition(); +/** Animation + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** MOVEMENT + **/ - BOOL isGroupTitleHidden() const { return mHideGroupTitle; } - BOOL isGroupMember() const { return !mGroupID.isNull(); } // This is only used for building titles! - const LLUUID &getGroupID() const { return mGroupID; } - ECameraMode getCameraMode() const { return mCameraMode; } - BOOL getFocusOnAvatar() const { return mFocusOnAvatar; } - LLPointer<LLViewerObject>& getFocusObject() { return mFocusObject; } - F32 getFocusObjectDist() const { return mFocusObjectDist; } - BOOL inPrelude(); - BOOL canManageEstate() const; - BOOL getAdminOverride() const; - - LLUUID getLastChatter() const { return mLastChatterID; } - bool getAlwaysRun() const { return mbAlwaysRun; } - bool getRunning() const { return mbRunning; } - - const LLUUID& getInventoryRootID() const { return mInventoryRootID; } + //-------------------------------------------------------------------- + // Keys + //-------------------------------------------------------------------- +public: + void setKey(const S32 direction, S32 &key); // Sets key to +1 for +direction, -1 for -direction +private: + S32 mAtKey; // Either 1, 0, or -1. Indicates that movement key is pressed + S32 mWalkKey; // Like AtKey, but causes less forward thrust + S32 mLeftKey; + S32 mUpKey; + F32 mYawKey; + S32 mPitchKey; - void buildFullname(std::string &name) const; - void buildFullnameAndTitle(std::string &name) const; - - // Check against all groups in the entire agent group list. - BOOL isInGroup(const LLUUID& group_id) const; - BOOL hasPowerInGroup(const LLUUID& group_id, U64 power) const; - // Check for power in just the active group. - BOOL hasPowerInActiveGroup(const U64 power) const; - U64 getPowerInGroup(const LLUUID& group_id) const; - - // Get group information by group_id. if not in group, data is - // left unchanged and method returns FALSE. otherwise, values are - // copied and returns TRUE. - BOOL getGroupData(const LLUUID& group_id, LLGroupData& data) const; - // Get just the agent's contribution to the given group. - S32 getGroupContribution(const LLUUID& group_id) const; - - // return TRUE if the database reported this login as the first - // for this particular user. - BOOL isFirstLogin() const { return mFirstLogin; } - - // On the very first login, gender isn't chosen until the user clicks - // in a dialog. We don't render the avatar until they choose. - BOOL isGenderChosen() const { return mGenderChosen; } - - // utility to build a location string - void buildLocationString(std::string& str); - - LLQuaternion getHeadRotation(); - LLVOAvatar *getAvatarObject() const { return mAvatarObject; } - - BOOL needsRenderAvatar(); // TRUE when camera mode is such that your own avatar should draw - // Not const because timers can't be accessed in const-fashion. - BOOL needsRenderHead(); - BOOL cameraThirdPerson() const { return (mCameraMode == CAMERA_MODE_THIRD_PERSON && mLastCameraMode == CAMERA_MODE_THIRD_PERSON); } - BOOL cameraMouselook() const { return (mCameraMode == CAMERA_MODE_MOUSELOOK && mLastCameraMode == CAMERA_MODE_MOUSELOOK); } - BOOL cameraCustomizeAvatar() const { return (mCameraMode == CAMERA_MODE_CUSTOMIZE_AVATAR /*&& !mCameraAnimating*/); } - BOOL cameraFollow() const { return (mCameraMode == CAMERA_MODE_FOLLOW && mLastCameraMode == CAMERA_MODE_FOLLOW); } - - LLVector3 getPosAgentFromGlobal(const LLVector3d &pos_global) const; - LLVector3d getPosGlobalFromAgent(const LLVector3 &pos_agent) const; - - // Get the data members - const LLVector3& getAtAxis() const { return mFrameAgent.getAtAxis(); } // direction avatar is looking, not camera - const LLVector3& getUpAxis() const { return mFrameAgent.getUpAxis(); } // direction avatar is looking, not camera - const LLVector3& getLeftAxis() const { return mFrameAgent.getLeftAxis(); } // direction avatar is looking, not camera - - LLCoordFrame getFrameAgent() const { return mFrameAgent; } - LLVector3 getVelocity() const; - F32 getVelocityZ() const { return getVelocity().mV[VZ]; } // a hack - - const LLVector3d &getPositionGlobal() const; - const LLVector3 &getPositionAgent(); - S32 getRegionsVisited() const; - F64 getDistanceTraveled() const; - - const LLVector3d &getFocusGlobal() const { return mFocusGlobal; } - const LLVector3d &getFocusTargetGlobal() const { return mFocusTargetGlobal; } - - BOOL getJump() const { return mbJump; } - BOOL getAutoPilot() const { return mAutoPilot; } - LLVector3d getAutoPilotTargetGlobal() const { return mAutoPilotTargetGlobal; } - - LLQuaternion getQuat() const; // returns the quat that represents the rotation - // of the agent in the absolute frame -// BOOL getLookingAtAvatar() const; - - void getName(std::string& name); - - const LLColor4 &getEffectColor(); - void setEffectColor(const LLColor4 &color); - // - // UTILITIES - // - - // Set the physics data - void slamLookAt(const LLVector3 &look_at); - - void setPositionAgent(const LLVector3 ¢er); + //-------------------------------------------------------------------- + // Movement from user input + //-------------------------------------------------------------------- + // All set the appropriate animation flags. + // All turn off autopilot and make sure the camera is behind the avatar. + // Direction is either positive, zero, or negative +public: + void moveAt(S32 direction, bool reset_view = true); + void moveAtNudge(S32 direction); + void moveLeft(S32 direction); + void moveLeftNudge(S32 direction); + void moveUp(S32 direction); + void moveYaw(F32 mag, bool reset_view = true); + void movePitch(S32 direction); - void resetAxes(); - void resetAxes(const LLVector3 &look_at); // makes reasonable left and up + //-------------------------------------------------------------------- + // Orbit + //-------------------------------------------------------------------- +public: + void setOrbitLeftKey(F32 mag) { mOrbitLeftKey = mag; } + void setOrbitRightKey(F32 mag) { mOrbitRightKey = mag; } + void setOrbitUpKey(F32 mag) { mOrbitUpKey = mag; } + void setOrbitDownKey(F32 mag) { mOrbitDownKey = mag; } + void setOrbitInKey(F32 mag) { mOrbitInKey = mag; } + void setOrbitOutKey(F32 mag) { mOrbitOutKey = mag; } +private: + F32 mOrbitLeftKey; + F32 mOrbitRightKey; + F32 mOrbitUpKey; + F32 mOrbitDownKey; + F32 mOrbitInKey; + F32 mOrbitOutKey; + + //-------------------------------------------------------------------- + // Pan + //-------------------------------------------------------------------- +public: + void setPanLeftKey(F32 mag) { mPanLeftKey = mag; } + void setPanRightKey(F32 mag) { mPanRightKey = mag; } + void setPanUpKey(F32 mag) { mPanUpKey = mag; } + void setPanDownKey(F32 mag) { mPanDownKey = mag; } + void setPanInKey(F32 mag) { mPanInKey = mag; } + void setPanOutKey(F32 mag) { mPanOutKey = mag; } +private: + F32 mPanUpKey; + F32 mPanDownKey; + F32 mPanLeftKey; + F32 mPanRightKey; + F32 mPanInKey; + F32 mPanOutKey; - // Move the avatar's frame + //-------------------------------------------------------------------- + // Move the avatar's frame + //-------------------------------------------------------------------- +public: void rotate(F32 angle, const LLVector3 &axis); void rotate(F32 angle, F32 x, F32 y, F32 z); void rotate(const LLMatrix3 &matrix); @@ -387,201 +532,47 @@ public: LLVector3 getReferenceUpVector(); F32 clampPitchToLimits(F32 angle); - void setThirdPersonHeadOffset(LLVector3 offset) { mThirdPersonHeadOffset = offset; } - // Flight management - BOOL getFlying() const { return mControlFlags & AGENT_CONTROL_FLY; } - void setFlying(BOOL fly); - void toggleFlying(); - - // Does this parcel allow you to fly? - BOOL canFly(); - - // Animation functions - void stopCurrentAnimations(); - void requestStopMotion( LLMotion* motion ); - void onAnimStop(const LLUUID& id); - - void sendAnimationRequests(LLDynamicArray<LLUUID> &anim_ids, EAnimRequest request); - void sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request); - - LLVector3 calcFocusOffset(LLViewerObject *object, LLVector3 pos_agent, S32 x, S32 y); - BOOL calcCameraMinDistance(F32 &obj_min_distance); - - void startCameraAnimation(); - void stopCameraAnimation(); - - void cameraZoomIn(const F32 factor); // zoom in by fraction of current distance - void cameraOrbitAround(const F32 radians); // rotate camera CCW radians about build focus point - void cameraOrbitOver(const F32 radians); // rotate camera forward radians over build focus point - void cameraOrbitIn(const F32 meters); // move camera in toward build focus point - - F32 getCameraZoomFraction(); // get camera zoom as fraction of minimum and maximum zoom - void setCameraZoomFraction(F32 fraction); // set camera zoom as fraction of minimum and maximum zoom - - void cameraPanIn(const F32 meters); - void cameraPanLeft(const F32 meters); - void cameraPanUp(const F32 meters); - - void updateFocusOffset(); - void validateFocusObject(); - - void setUsingFollowCam( bool using_follow_cam); - - F32 calcCustomizeAvatarUIOffset( const LLVector3d& camera_pos_global ); - - // marks current location as start, sends information to servers - void setStartPosition(U32 location_id); - - // Movement from user input. All set the appropriate animation flags. - // All turn off autopilot and make sure the camera is behind the avatar. - // direction is either positive, zero, or negative - void moveAt(S32 direction, bool reset_view = true); - void moveAtNudge(S32 direction); - void moveLeft(S32 direction); - void moveLeftNudge(S32 direction); - void moveUp(S32 direction); - void moveYaw(F32 mag, bool reset_view = true); - void movePitch(S32 direction); - - void setOrbitLeftKey(F32 mag) { mOrbitLeftKey = mag; } - void setOrbitRightKey(F32 mag) { mOrbitRightKey = mag; } - void setOrbitUpKey(F32 mag) { mOrbitUpKey = mag; } - void setOrbitDownKey(F32 mag) { mOrbitDownKey = mag; } - void setOrbitInKey(F32 mag) { mOrbitInKey = mag; } - void setOrbitOutKey(F32 mag) { mOrbitOutKey = mag; } - - void setPanLeftKey(F32 mag) { mPanLeftKey = mag; } - void setPanRightKey(F32 mag) { mPanRightKey = mag; } - void setPanUpKey(F32 mag) { mPanUpKey = mag; } - void setPanDownKey(F32 mag) { mPanDownKey = mag; } - void setPanInKey(F32 mag) { mPanInKey = mag; } - void setPanOutKey(F32 mag) { mPanOutKey = mag; } - - U32 getControlFlags(); - void setControlFlags(U32 mask); // performs bitwise mControlFlags |= mask - void clearControlFlags(U32 mask); // performs bitwise mControlFlags &= ~mask - BOOL controlFlagsDirty() const; - void enableControlFlagReset(); - void resetControlFlags(); - - void propagate(const F32 dt); // BUG: should roll into updateAgentPosition - - void startAutoPilotGlobal(const LLVector3d &pos_global, const std::string& behavior_name = std::string(), const LLQuaternion *target_rotation = NULL, - void (*finish_callback)(BOOL, void *) = NULL, void *callback_data = NULL, F32 stop_distance = 0.f, F32 rotation_threshold = 0.03f); - + //-------------------------------------------------------------------- + // Autopilot + //-------------------------------------------------------------------- +public: + BOOL getAutoPilot() const { return mAutoPilot; } + LLVector3d getAutoPilotTargetGlobal() const { return mAutoPilotTargetGlobal; } + void startAutoPilotGlobal(const LLVector3d &pos_global, + const std::string& behavior_name = std::string(), + const LLQuaternion *target_rotation = NULL, + void (*finish_callback)(BOOL, void *) = NULL, void *callback_data = NULL, + F32 stop_distance = 0.f, F32 rotation_threshold = 0.03f); void startFollowPilot(const LLUUID &leader_id); void stopAutoPilot(BOOL user_cancel = FALSE); void setAutoPilotGlobal(const LLVector3d &pos_global); - void autoPilot(F32 *delta_yaw); // autopilot walking action, angles in radians + void autoPilot(F32 *delta_yaw); // Autopilot walking action, angles in radians void renderAutoPilotTarget(); +private: + BOOL mAutoPilot; + BOOL mAutoPilotFlyOnStop; + LLVector3d mAutoPilotTargetGlobal; + F32 mAutoPilotStopDistance; + BOOL mAutoPilotUseRotation; + LLVector3 mAutoPilotTargetFacing; + F32 mAutoPilotTargetDist; + S32 mAutoPilotNoProgressFrameCount; + F32 mAutoPilotRotationThreshold; + std::string mAutoPilotBehaviorName; + void (*mAutoPilotFinishedCallback)(BOOL, void *); + void* mAutoPilotCallbackData; + LLUUID mLeaderID; + +/** Movement + ** ** + *******************************************************************************/ - // - // teportation methods - // - - // go to a named location home - void teleportRequest( - const U64& region_handle, - const LLVector3& pos_local); - - // teleport to a landmark - void teleportViaLandmark(const LLUUID& landmark_id); - - // go home - void teleportHome() { teleportViaLandmark(LLUUID::null); } - - // to an invited location - void teleportViaLure(const LLUUID& lure_id, BOOL godlike); - - // to a global location - this will probably need to be - // deprecated. - void teleportViaLocation(const LLVector3d& pos_global); - - // cancel the teleport, may or may not be allowed by server - void teleportCancel(); - - void setTargetVelocity(const LLVector3 &vel); - const LLVector3 &getTargetVelocity() const; - - const std::string getTeleportSourceSLURL() const { return mTeleportSourceSLURL; } - - - // Setting the ability for this avatar to proxy for another avatar. - //static void processAddModifyAbility(LLMessageSystem* msg, void**); - //static void processGrantedProxies(LLMessageSystem* msg, void**); - //static void processRemoveModifyAbility(LLMessageSystem* msg, void**); - //BOOL isProxyFor(const LLUUID& agent_id);// *FIX should be const - - static void processAgentDataUpdate(LLMessageSystem *msg, void **); - static void processAgentGroupDataUpdate(LLMessageSystem *msg, void **); - static void processAgentDropGroup(LLMessageSystem *msg, void **); - static void processScriptControlChange(LLMessageSystem *msg, void **); - static void processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void **user_data); - //static void processControlTake(LLMessageSystem *msg, void **); - //static void processControlRelease(LLMessageSystem *msg, void **); - - // This method checks to see if this agent can modify an object - // based on the permissions and the agent's proxy status. - BOOL isGrantedProxy(const LLPermissions& perm); - - BOOL allowOperation(PermissionBit op, - const LLPermissions& perm, - U64 group_proxy_power = 0, - U8 god_minimum = GOD_MAINTENANCE); - - friend std::ostream& operator<<(std::ostream &s, const LLAgent &sphere); - - void initOriginGlobal(const LLVector3d &origin_global); // Only to be used in ONE place! - djs 08/07/02 - - BOOL leftButtonGrabbed() const { return ( (!cameraMouselook() && mControlsTakenCount[CONTROL_LBUTTON_DOWN_INDEX] > 0) - ||(cameraMouselook() && mControlsTakenCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0) - ||(!cameraMouselook() && mControlsTakenPassedOnCount[CONTROL_LBUTTON_DOWN_INDEX] > 0) - ||(cameraMouselook() && mControlsTakenPassedOnCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0)); } - BOOL rotateGrabbed() const { return ( (mControlsTakenCount[CONTROL_YAW_POS_INDEX] > 0) - ||(mControlsTakenCount[CONTROL_YAW_NEG_INDEX] > 0)); } - BOOL forwardGrabbed() const { return ( (mControlsTakenCount[CONTROL_AT_POS_INDEX] > 0)); } - BOOL backwardGrabbed() const { return ( (mControlsTakenCount[CONTROL_AT_NEG_INDEX] > 0)); } - BOOL upGrabbed() const { return ( (mControlsTakenCount[CONTROL_UP_POS_INDEX] > 0)); } - BOOL downGrabbed() const { return ( (mControlsTakenCount[CONTROL_UP_NEG_INDEX] > 0)); } - - // True iff a script has taken over a control. - BOOL anyControlGrabbed() const; - - BOOL isControlGrabbed(S32 control_index) const; - - // Send message to simulator to force grabbed controls to be - // released, in case of a poorly written script. - void forceReleaseControls(); - - BOOL sitCameraEnabled() { return mSitCameraEnabled; } - - F32 getCurrentCameraBuildOffset() { return (F32)mCameraFocusOffset.length(); } - - // look at behavior - BOOL setLookAt(ELookAtType target_type, LLViewerObject *object = NULL, LLVector3 position = LLVector3::zero); - ELookAtType getLookAtType(); - - // point at behavior - BOOL setPointAt(EPointAtType target_type, LLViewerObject *object = NULL, LLVector3 position = LLVector3::zero); - EPointAtType getPointAtType(); - - void setHomePosRegion( const U64& region_handle, const LLVector3& pos_region ); - BOOL getHomePosGlobal( LLVector3d* pos_global ); - void setCameraAnimating( BOOL b ) { mCameraAnimating = b; } - BOOL getCameraAnimating( ) { return mCameraAnimating; } - void setAnimationDuration( F32 seconds ) { mAnimationDuration = seconds; } - - F32 getNearChatRadius() { return mNearChatRadius; } - - enum EDoubleTapRunMode - { - DOUBLETAP_NONE, - DOUBLETAP_FORWARD, - DOUBLETAP_BACKWARD, - DOUBLETAP_SLIDELEFT, - DOUBLETAP_SLIDERIGHT - }; +/******************************************************************************** + ** ** + ** TELEPORT + **/ +public: enum ETeleportState { TELEPORT_NONE = 0, // No teleport in progress @@ -592,376 +583,487 @@ public: TELEPORT_ARRIVING = 5 // Make the user wait while content "pre-caches" }; - ETeleportState getTeleportState() const { return mTeleportState; } - void setTeleportState( ETeleportState state ); - const std::string& getTeleportMessage() const { return mTeleportMessage; } - void setTeleportMessage(const std::string& message) - { - mTeleportMessage = message; - } - - // trigger random fidget animations - void fidget(); - - void requestEnterGodMode(); - void requestLeaveGodMode(); - - void sendAgentSetAppearance(); - - void sendAgentDataUpdateRequest(); - - // Ventrella - LLFollowCam mFollowCam; - // end Ventrella +public: + static void parseTeleportMessages(const std::string& xml_filename); + const std::string getTeleportSourceSLURL() const { return mTeleportSourceSLURL; } +public: + // ! TODO ! Define ERROR and PROGRESS enums here instead of exposing the mappings. + static std::map<std::string, std::string> sTeleportErrorMessages; + static std::map<std::string, std::string> sTeleportProgressMessages; +private: + std::string mTeleportSourceSLURL; // SLURL where last TP began //-------------------------------------------------------------------- - // Wearables + // Teleport Actions //-------------------------------------------------------------------- - void setWearable( LLInventoryItem* new_item, LLWearable* wearable ); - static bool onSetWearableDialog( const LLSD& notification, const LLSD& response, LLWearable* wearable ); - void setWearableFinal( LLInventoryItem* new_item, LLWearable* new_wearable ); - void setWearableOutfit( const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLWearable* >& wearables, BOOL remove ); - void queryWearableCache(); - - BOOL isWearableModifiable(EWearableType type); - BOOL isWearableCopyable(EWearableType type); - BOOL needsReplacement(EWearableType wearableType, S32 remove); - U32 getWearablePermMask(EWearableType type); - - LLInventoryItem* getWearableInventoryItem(EWearableType type); +public: + void teleportRequest(const U64& region_handle, + const LLVector3& pos_local); // Go to a named location home + void teleportViaLandmark(const LLUUID& landmark_id); // Teleport to a landmark + void teleportHome() { teleportViaLandmark(LLUUID::null); } // Go home + void teleportViaLure(const LLUUID& lure_id, BOOL godlike); // To an invited location + void teleportViaLocation(const LLVector3d& pos_global); // To a global location - this will probably need to be deprecated + void teleportCancel(); // May or may not be allowed by server +protected: + bool teleportCore(bool is_local = false); // Stuff for all teleports; returns true if the teleport can proceed - LLWearable* getWearable( EWearableType type ) { return (type < WT_COUNT) ? mWearableEntry[ type ].mWearable : NULL; } - BOOL isWearingItem( const LLUUID& item_id ); - LLWearable* getWearableFromWearableItem( const LLUUID& item_id ); - const LLUUID& getWearableItem( EWearableType type ) { return (type < WT_COUNT) ? mWearableEntry[ type ].mItemID : LLUUID::null; } + //-------------------------------------------------------------------- + // Teleport State + //-------------------------------------------------------------------- +public: + ETeleportState getTeleportState() const { return mTeleportState; } + void setTeleportState(ETeleportState state); +private: + ETeleportState mTeleportState; - static EWearableType getTEWearableType( S32 te ); - static LLUUID getDefaultTEImageID( S32 te ); - - void copyWearableToInventory( EWearableType type ); - - void makeNewOutfit( - const std::string& new_folder_name, - const LLDynamicArray<S32>& wearables_to_include, - const LLDynamicArray<S32>& attachments_to_include, - BOOL rename_clothing); - void makeNewOutfitDone(S32 index); - - void removeWearable( EWearableType type ); - static bool onRemoveWearableDialog(const LLSD& notification, const LLSD& response ); - void removeWearableFinal( EWearableType type ); - - void sendAgentWearablesUpdate(); - - /** - * @brief Only public because of addWearableToAgentInventoryCallback. - * - * NOTE: Do not call this method unless you are the inventory callback. - * NOTE: This can suffer from race conditions when working on the - * same values for index. - * @param index The index in mWearableEntry. - * @param item_id The inventory item id of the new wearable to wear. - * @param wearable The actual wearable data. - */ - void addWearabletoAgentInventoryDone( - S32 index, - const LLUUID& item_id, - LLWearable* wearable); - - void saveWearableAs( EWearableType type, const std::string& new_name, BOOL save_in_lost_and_found ); - void saveWearable( EWearableType type, BOOL send_update = TRUE ); - void saveAllWearables(); + //-------------------------------------------------------------------- + // Teleport Message + //-------------------------------------------------------------------- +public: + const std::string& getTeleportMessage() const { return mTeleportMessage; } + void setTeleportMessage(const std::string& message) { mTeleportMessage = message; } +private: + std::string mTeleportMessage; - void revertWearable( EWearableType type ); - void revertAllWearables(); - - void setWearableName( const LLUUID& item_id, const std::string& new_name ); - void createStandardWearables(BOOL female); - void createStandardWearablesDone(S32 index); - void createStandardWearablesAllDone(); - - BOOL areWearablesLoaded() { return mWearablesLoaded; } +/** Teleport + ** ** + *******************************************************************************/ - void sendWalkRun(bool running); +/******************************************************************************** + ** ** + ** CAMERA + **/ - void observeFriends(); - void friendsChanged(); - - // statics - static void stopFidget(); - static void processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data); - static void userRemoveWearable( void* userdata ); // userdata is EWearableType - static void userRemoveAllClothes( void* userdata ); // userdata is NULL - static void userRemoveAllClothesStep2(BOOL proceed, void* userdata ); // userdata is NULL - static void userRemoveAllAttachments( void* userdata); // userdata is NULL - static BOOL selfHasWearable( void* userdata ); // userdata is EWearableType - - //debug methods - static void clearVisualParams(void *); - -protected: - // stuff to do for any sort of teleport. Returns true if the - // teleport can proceed. - bool teleportCore(bool is_local = false); + //-------------------------------------------------------------------- + // Mode + //-------------------------------------------------------------------- +public: + void changeCameraToDefault(); + void changeCameraToMouselook(BOOL animate = TRUE); + void changeCameraToThirdPerson(BOOL animate = TRUE); + void changeCameraToCustomizeAvatar(BOOL avatar_animate = TRUE, BOOL camera_animate = TRUE); // Trigger transition animation + void changeCameraToFollow(BOOL animate = TRUE); // Ventrella + BOOL cameraThirdPerson() const { return (mCameraMode == CAMERA_MODE_THIRD_PERSON && mLastCameraMode == CAMERA_MODE_THIRD_PERSON); } + BOOL cameraMouselook() const { return (mCameraMode == CAMERA_MODE_MOUSELOOK && mLastCameraMode == CAMERA_MODE_MOUSELOOK); } + BOOL cameraCustomizeAvatar() const { return (mCameraMode == CAMERA_MODE_CUSTOMIZE_AVATAR /*&& !mCameraAnimating*/); } + BOOL cameraFollow() const { return (mCameraMode == CAMERA_MODE_FOLLOW && mLastCameraMode == CAMERA_MODE_FOLLOW); } + ECameraMode getCameraMode() const { return mCameraMode; } + void updateCamera(); // Call once per frame to update camera location/orientation + void resetCamera(); // Slam camera into its default position +private: + ECameraMode mCameraMode; // Target mode after transition animation is done + ECameraMode mLastCameraMode; - // helper function to prematurely age chat when agent is moving - void ageChat(); + //-------------------------------------------------------------------- + // Position + //-------------------------------------------------------------------- +public: + LLVector3d getCameraPositionGlobal() const; + const LLVector3 &getCameraPositionAgent() const; + LLVector3d calcCameraPositionTargetGlobal(BOOL *hit_limit = NULL); // Calculate the camera position target + F32 getCameraMinOffGround(); // Minimum height off ground for this mode, meters + void setCameraCollidePlane(const LLVector4 &plane) { mCameraCollidePlane = plane; } + BOOL calcCameraMinDistance(F32 &obj_min_distance); + F32 calcCustomizeAvatarUIOffset(const LLVector3d& camera_pos_global); + F32 getCurrentCameraBuildOffset() { return (F32)mCameraFocusOffset.length(); } +private: + F32 mCurrentCameraDistance; // Current camera offset from avatar + F32 mTargetCameraDistance; // Target camera offset from avatar + F32 mCameraFOVZoomFactor; // Amount of fov zoom applied to camera when zeroing in on an object + F32 mCameraCurrentFOVZoomFactor; // Interpolated fov zoom + F32 mCameraFOVDefault; // Default field of view that is basis for FOV zoom effect + LLVector3 mCameraOffsetDefault; // Default third-person camera offset + LLVector4 mCameraCollidePlane; // Colliding plane for camera + F32 mCameraZoomFraction; // Mousewheel driven fraction of zoom + LLVector3 mCameraPositionAgent; // Camera position in agent coordinates + LLVector3 mCameraVirtualPositionAgent; // Camera virtual position (target) before performing FOV zoom + LLVector3d mCameraSmoothingLastPositionGlobal; + LLVector3d mCameraSmoothingLastPositionAgent; + BOOL mCameraSmoothingStop; + LLVector3 mCameraLag; // Third person camera lag + LLVector3 mCameraUpVector; // Camera's up direction in world coordinates (determines the 'roll' of the view) - // internal wearable functions - void sendAgentWearablesRequest(); - static void onInitialWearableAssetArrived(LLWearable* wearable, void* userdata); - void recoverMissingWearable(EWearableType type); - void recoverMissingWearableDone(); - void addWearableToAgentInventory(LLPointer<LLInventoryCallback> cb, - LLWearable* wearable, const LLUUID& category_id = LLUUID::null, - BOOL notify = TRUE); + //-------------------------------------------------------------------- + // Follow + //-------------------------------------------------------------------- public: - // TODO: Make these private! - LLUUID mSecureSessionID; // secure token for this login session + void setUsingFollowCam(bool using_follow_cam); +private: + LLFollowCam mFollowCam; // Ventrella - F32 mDrawDistance; + //-------------------------------------------------------------------- + // Sit + //-------------------------------------------------------------------- +public: + void setupSitCamera(); + BOOL sitCameraEnabled() { return mSitCameraEnabled; } + void setSitCamera(const LLUUID &object_id, + const LLVector3 &camera_pos = LLVector3::zero, const LLVector3 &camera_focus = LLVector3::zero); +private: + LLPointer<LLViewerObject> mSitCameraReferenceObject; // Object to which camera is related when sitting + BOOL mSitCameraEnabled; // Use provided camera information when sitting? + LLVector3 mSitCameraPos; // Root relative camera pos when sitting + LLVector3 mSitCameraFocus; // Root relative camera target when sitting - U64 mGroupPowers; - BOOL mHideGroupTitle; - std::string mGroupTitle; // honorific, like "Sir" - std::string mGroupName; - LLUUID mGroupID; - //LLUUID mGroupInsigniaID; - LLUUID mInventoryRootID; - LLUUID mMapID; - F64 mMapOriginX; // Global x coord of mMapID's bottom left corner. - F64 mMapOriginY; // Global y coord of mMapID's bottom left corner. - S32 mMapWidth; // Width of map in meters - S32 mMapHeight; // Height of map in meters - std::string mMOTD; // message of the day + //-------------------------------------------------------------------- + // Animation + //-------------------------------------------------------------------- +public: + void setCameraAnimating(BOOL b) { mCameraAnimating = b; } + BOOL getCameraAnimating() { return mCameraAnimating; } + void setAnimationDuration(F32 seconds) { mAnimationDuration = seconds; } + void startCameraAnimation(); + void stopCameraAnimation(); +private: + BOOL mCameraAnimating; // Camera is transitioning from one mode to another + LLVector3d mAnimationCameraStartGlobal; // Camera start position, global coords + LLVector3d mAnimationFocusStartGlobal; // Camera focus point, global coords + //-------------------------------------------------------------------- + // Focus + //-------------------------------------------------------------------- +public: + LLVector3d calcFocusPositionTargetGlobal(); + LLVector3 calcFocusOffset(LLViewerObject *object, LLVector3 pos_agent, S32 x, S32 y); + BOOL getFocusOnAvatar() const { return mFocusOnAvatar; } + LLPointer<LLViewerObject>& getFocusObject() { return mFocusObject; } + F32 getFocusObjectDist() const { return mFocusObjectDist; } + void updateFocusOffset(); + void validateFocusObject(); + void setFocusGlobal(const LLPickInfo& pick); + void setFocusGlobal(const LLVector3d &focus, const LLUUID &object_id = LLUUID::null); + void setFocusOnAvatar(BOOL focus, BOOL animate); + void setCameraPosAndFocusGlobal(const LLVector3d& pos, const LLVector3d& focus, const LLUUID &object_id); + void clearFocusObject(); + void setFocusObject(LLViewerObject* object); + void setObjectTracking(BOOL track) { mTrackFocusObject = track; } + const LLVector3d &getFocusGlobal() const { return mFocusGlobal; } + const LLVector3d &getFocusTargetGlobal() const { return mFocusTargetGlobal; } +private: + LLVector3d mCameraFocusOffset; // Offset from focus point in build mode + LLVector3d mCameraFocusOffsetTarget; // Target towards which we are lerping the camera's focus offset + BOOL mFocusOnAvatar; + LLVector3d mFocusGlobal; + LLVector3d mFocusTargetGlobal; + LLPointer<LLViewerObject> mFocusObject; + F32 mFocusObjectDist; + LLVector3 mFocusObjectOffset; + F32 mFocusDotRadius; // Meters + BOOL mTrackFocusObject; + F32 mUIOffset; + + //-------------------------------------------------------------------- + // Lookat / Pointat + //-------------------------------------------------------------------- +public: + void updateLookAt(const S32 mouse_x, const S32 mouse_y); + BOOL setLookAt(ELookAtType target_type, LLViewerObject *object = NULL, LLVector3 position = LLVector3::zero); + ELookAtType getLookAtType(); + void slamLookAt(const LLVector3 &look_at); // Set the physics data + BOOL setPointAt(EPointAtType target_type, LLViewerObject *object = NULL, LLVector3 position = LLVector3::zero); + EPointAtType getPointAtType(); +public: LLPointer<LLHUDEffectLookAt> mLookAt; LLPointer<LLHUDEffectPointAt> mPointAt; - LLDynamicArray<LLGroupData> mGroups; + //-------------------------------------------------------------------- + // Third person + //-------------------------------------------------------------------- +public: + LLVector3d calcThirdPersonFocusOffset(); + void setThirdPersonHeadOffset(LLVector3 offset) { mThirdPersonHeadOffset = offset; } +private: + LLVector3 mThirdPersonHeadOffset; // Head offset for third person camera position - F32 mHUDTargetZoom; // target zoom level for HUD objects (used when editing) - F32 mHUDCurZoom; // current animated zoom level for HUD objects + //-------------------------------------------------------------------- + // Orbit + //-------------------------------------------------------------------- +public: + void cameraOrbitAround(const F32 radians); // Rotate camera CCW radians about build focus point + void cameraOrbitOver(const F32 radians); // Rotate camera forward radians over build focus point + void cameraOrbitIn(const F32 meters); // Move camera in toward build focus point - BOOL mInitialized; + //-------------------------------------------------------------------- + // Zoom + //-------------------------------------------------------------------- +public: + void handleScrollWheel(S32 clicks); // Mousewheel driven zoom + void cameraZoomIn(const F32 factor); // Zoom in by fraction of current distance + F32 getCameraZoomFraction(); // Get camera zoom as fraction of minimum and maximum zoom + void setCameraZoomFraction(F32 fraction); // Set camera zoom as fraction of minimum and maximum zoom + F32 calcCameraFOVZoomFactor(); - S32 mNumPendingQueries; - S32* mActiveCacheQueries; + //-------------------------------------------------------------------- + // Pan + //-------------------------------------------------------------------- +public: + void cameraPanIn(const F32 meters); + void cameraPanLeft(const F32 meters); + void cameraPanUp(const F32 meters); + + //-------------------------------------------------------------------- + // View + //-------------------------------------------------------------------- +public: + // Called whenever the agent moves. Puts camera back in default position, deselects items, etc. + void resetView(BOOL reset_camera = TRUE, BOOL change_camera = FALSE); + // Called on camera movement. Unlocks camera from the default position behind the avatar. + void unlockView(); + //-------------------------------------------------------------------- + // Mouselook + //-------------------------------------------------------------------- +public: + BOOL getForceMouselook() const { return mForceMouselook; } + void setForceMouselook(BOOL mouselook) { mForceMouselook = mouselook; } +private: BOOL mForceMouselook; + + //-------------------------------------------------------------------- + // HUD + //-------------------------------------------------------------------- +public: + const LLColor4 &getEffectColor(); + void setEffectColor(const LLColor4 &color); +public: + F32 mHUDTargetZoom; // Target zoom level for HUD objects (used when editing) + F32 mHUDCurZoom; // Current animated zoom level for HUD objects +private: + LLColor4 mEffectColor; - static void parseTeleportMessages(const std::string& xml_filename); - //we should really define ERROR and PROGRESS enums here - //but I don't really feel like doing that, so I am just going - //to expose the mappings....yup - static std::map<std::string, std::string> sTeleportErrorMessages; - static std::map<std::string, std::string> sTeleportProgressMessages; +/** Camera + ** ** + *******************************************************************************/ - LLFrameTimer mDoubleTapRunTimer; - EDoubleTapRunMode mDoubleTapRunMode; +/******************************************************************************** + ** ** + ** ACCESS + **/ +public: + // Checks if agent can modify an object based on the permissions and the agent's proxy status. + BOOL isGrantedProxy(const LLPermissions& perm); + BOOL allowOperation(PermissionBit op, + const LLPermissions& perm, + U64 group_proxy_power = 0, + U8 god_minimum = GOD_MAINTENANCE); + const LLAgentAccess& getAgentAccess(); + BOOL canManageEstate() const; + BOOL getAdminOverride() const; + // ! BACKWARDS COMPATIBILITY ! This function can go away after the AO transition (see llstartup.cpp). + void setAOTransition(); private: - bool mbAlwaysRun; // should the avatar run by default rather than walk - bool mbRunning; // is the avatar trying to run right now - - LLAgentAccess mAgentAccess; + LLAgentAccess mAgentAccess; - ETeleportState mTeleportState; - std::string mTeleportMessage; - - S32 mControlsTakenCount[TOTAL_CONTROLS]; - S32 mControlsTakenPassedOnCount[TOTAL_CONTROLS]; - - LLViewerRegion *mRegionp; - LLVector3d mAgentOriginGlobal; // Origin of agent coords from global coords - mutable LLVector3d mPositionGlobal; + //-------------------------------------------------------------------- + // God + //-------------------------------------------------------------------- +public: + BOOL isGodlike() const; + U8 getGodLevel() const; + void setAdminOverride(BOOL b); + void setGodLevel(U8 god_level); + void requestEnterGodMode(); + void requestLeaveGodMode(); - std::string mTeleportSourceSLURL; // SLURL where last TP began. + //-------------------------------------------------------------------- + // Maturity + //-------------------------------------------------------------------- +public: + // Note: this is a prime candidate for pulling out into a Maturity class. + // Rather than just expose the preference setting, we're going to actually + // expose what the client code cares about -- what the user should see + // based on a combination of the is* and prefers* flags, combined with god bit. + bool wantsPGOnly() const; + bool canAccessMature() const; + bool canAccessAdult() const; + bool canAccessMaturityInRegion( U64 region_handle ) const; + bool canAccessMaturityAtGlobal( LLVector3d pos_global ) const; + bool prefersPG() const; + bool prefersMature() const; + bool prefersAdult() const; + bool isTeen() const; + bool isMature() const; + bool isAdult() const; + void setTeen(bool teen); + void setMaturity(char text); + static int convertTextToMaturity(char text); + bool sendMaturityPreferenceToServer(int preferredMaturity); // ! "U8" instead of "int"? + + // Maturity callbacks for PreferredMaturity control variable + void handleMaturity(const LLSD& newvalue); + bool validateMaturity(const LLSD& newvalue); + + +/** Access + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** RENDERING + **/ - std::set<U64> mRegionsVisited; // stat - what distinct regions has the avatar been to? - F64 mDistanceTraveled; // stat - how far has the avatar moved? - LLVector3d mLastPositionGlobal; // Used to calculate travel distance +public: + LLQuaternion getHeadRotation(); + BOOL needsRenderAvatar(); // TRUE when camera mode is such that your own avatar should draw + BOOL needsRenderHead(); +public: + F32 mDrawDistance; +private: + BOOL mShowAvatar; // Should we render the avatar? + U32 mAppearanceSerialNum; + + //-------------------------------------------------------------------- + // Rendering state bitmap helpers + //-------------------------------------------------------------------- +public: + void setRenderState(U8 newstate); + void clearRenderState(U8 clearstate); + U8 getRenderState(); +private: + U8 mRenderState; // Current behavior state of agent - LLPointer<LLVOAvatar> mAvatarObject; // NULL until avatar object sent down from simulator +/** Rendering + ** ** + *******************************************************************************/ - U8 mRenderState; // Current behavior state of agent - LLFrameTimer mTypingTimer; +/******************************************************************************** + ** ** + ** GROUPS + **/ - ECameraMode mCameraMode; // target mode after transition animation is done - ECameraMode mLastCameraMode; - BOOL mViewsPushed; // keep track of whether or not we have pushed views. - - BOOL mCustomAnim ; //current animation is ANIM_AGENT_CUSTOMIZE ? - BOOL mShowAvatar; // should we render the avatar? - BOOL mCameraAnimating; // camera is transitioning from one mode to another - LLVector3d mAnimationCameraStartGlobal; // camera start position, global coords - LLVector3d mAnimationFocusStartGlobal; // camera focus point, global coords - LLFrameTimer mAnimationTimer; // seconds that transition animation has been active - F32 mAnimationDuration; // seconds - F32 mCameraFOVZoomFactor; // amount of fov zoom applied to camera when zeroing in on an object - F32 mCameraCurrentFOVZoomFactor; // interpolated fov zoom - F32 mCameraFOVDefault; // default field of view that is basis for FOV zoom effect - LLVector3d mCameraFocusOffset; // offset from focus point in build mode - LLVector3d mCameraFocusOffsetTarget; // target towards which we are lerping the camera's focus offset - LLVector3 mCameraOffsetDefault; // default third-person camera offset - LLVector4 mCameraCollidePlane; // colliding plane for camera - F32 mCurrentCameraDistance; // current camera offset from avatar - F32 mTargetCameraDistance; // target camera offset from avatar - F32 mCameraZoomFraction; // mousewheel driven fraction of zoom - LLVector3 mCameraLag; // third person camera lag - LLVector3 mThirdPersonHeadOffset; // head offset for third person camera position - LLVector3 mCameraPositionAgent; // camera position in agent coordinates - LLVector3 mCameraVirtualPositionAgent; // camera virtual position (target) before performing FOV zoom - BOOL mSitCameraEnabled; // use provided camera information when sitting? - LLVector3 mSitCameraPos; // root relative camera pos when sitting - LLVector3 mSitCameraFocus; // root relative camera target when sitting - LLVector3d mCameraSmoothingLastPositionGlobal; - LLVector3d mCameraSmoothingLastPositionAgent; - BOOL mCameraSmoothingStop; +public: + const LLUUID &getGroupID() const { return mGroupID; } + // Get group information by group_id, or FALSE if not in group. + BOOL getGroupData(const LLUUID& group_id, LLGroupData& data) const; + // Get just the agent's contribution to the given group. + S32 getGroupContribution(const LLUUID& group_id) const; + // Update internal datastructures and update the server. + BOOL setGroupContribution(const LLUUID& group_id, S32 contribution); + BOOL setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile); + const std::string &getGroupName() const { return mGroupName; } +private: + std::string mGroupName; + LLUUID mGroupID; - LLVector3 mCameraUpVector; // camera's up direction in world coordinates (determines the 'roll' of the view) + //-------------------------------------------------------------------- + // Group Membership + //-------------------------------------------------------------------- +public: + // Checks against all groups in the entire agent group list. + BOOL isInGroup(const LLUUID& group_id) const; +protected: + // Only used for building titles. + BOOL isGroupMember() const { return !mGroupID.isNull(); } +public: + LLDynamicArray<LLGroupData> mGroups; - LLPointer<LLViewerObject> mSitCameraReferenceObject; // object to which camera is related when sitting + //-------------------------------------------------------------------- + // Group Title + //-------------------------------------------------------------------- +public: + void setHideGroupTitle(BOOL hide) { mHideGroupTitle = hide; } + BOOL isGroupTitleHidden() const { return mHideGroupTitle; } +private: + std::string mGroupTitle; // Honorific, like "Sir" + BOOL mHideGroupTitle; - BOOL mFocusOnAvatar; - LLVector3d mFocusGlobal; - LLVector3d mFocusTargetGlobal; - LLPointer<LLViewerObject> mFocusObject; - F32 mFocusObjectDist; - LLVector3 mFocusObjectOffset; - F32 mFocusDotRadius; // meters - BOOL mTrackFocusObject; - F32 mUIOffset; + //-------------------------------------------------------------------- + // Group Powers + //-------------------------------------------------------------------- +public: + BOOL hasPowerInGroup(const LLUUID& group_id, U64 power) const; + BOOL hasPowerInActiveGroup(const U64 power) const; + U64 getPowerInGroup(const LLUUID& group_id) const; + U64 mGroupPowers; - LLCoordFrame mFrameAgent; // Agent position and view, agent-region coordinates + //-------------------------------------------------------------------- + // Friends + //-------------------------------------------------------------------- +public: + void observeFriends(); + void friendsChanged(); +private: + LLFriendObserver* mFriendObserver; + std::set<LLUUID> mProxyForAgents; - BOOL mIsBusy; +/** Groups + ** ** + *******************************************************************************/ - S32 mAtKey; // Either 1, 0, or -1... indicates that movement-key is pressed - S32 mWalkKey; // like AtKey, but causes less forward thrust - S32 mLeftKey; - S32 mUpKey; - F32 mYawKey; - S32 mPitchKey; +/******************************************************************************** + ** ** + ** MESSAGING + **/ - F32 mOrbitLeftKey; - F32 mOrbitRightKey; - F32 mOrbitUpKey; - F32 mOrbitDownKey; - F32 mOrbitInKey; - F32 mOrbitOutKey; + //-------------------------------------------------------------------- + // Send + //-------------------------------------------------------------------- +public: + void sendMessage(); // Send message to this agent's region + void sendReliableMessage(); + void sendAgentSetAppearance(); + void sendAgentDataUpdateRequest(); + void sendAgentUserInfoRequest(); + // IM to Email and Online visibility + void sendAgentUpdateUserInfo(bool im_to_email, const std::string& directory_visibility); - F32 mPanUpKey; - F32 mPanDownKey; - F32 mPanLeftKey; - F32 mPanRightKey; - F32 mPanInKey; - F32 mPanOutKey; + //-------------------------------------------------------------------- + // Receive + //-------------------------------------------------------------------- +public: + static void processAgentDataUpdate(LLMessageSystem *msg, void **); + static void processAgentGroupDataUpdate(LLMessageSystem *msg, void **); + static void processAgentDropGroup(LLMessageSystem *msg, void **); + static void processScriptControlChange(LLMessageSystem *msg, void **); + static void processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void **user_data); + +/** Messaging + ** ** + *******************************************************************************/ - U32 mControlFlags; // replacement for the mFooKey's - BOOL mbFlagsDirty; - BOOL mbFlagsNeedReset; // HACK for preventing incorrect flags sent when crossing region boundaries +/******************************************************************************** + ** ** + ** DEBUGGING + **/ - BOOL mbJump; +public: + static void dumpGroupInfo(); + static void clearVisualParams(void *); + friend std::ostream& operator<<(std::ostream &s, const LLAgent &sphere); - BOOL mAutoPilot; - BOOL mAutoPilotFlyOnStop; - LLVector3d mAutoPilotTargetGlobal; - F32 mAutoPilotStopDistance; - BOOL mAutoPilotUseRotation; - LLVector3 mAutoPilotTargetFacing; - F32 mAutoPilotTargetDist; - S32 mAutoPilotNoProgressFrameCount; - F32 mAutoPilotRotationThreshold; - std::string mAutoPilotBehaviorName; - void (*mAutoPilotFinishedCallback)(BOOL, void *); - void* mAutoPilotCallbackData; - LLUUID mLeaderID; +/** Debugging + ** ** + *******************************************************************************/ - std::set<LLUUID> mProxyForAgents; +}; - LLColor4 mEffectColor; +extern LLAgent gAgent; - BOOL mHaveHomePosition; - U64 mHomeRegionHandle; - LLVector3 mHomePosRegion; - LLFrameTimer mChatTimer; - LLUUID mLastChatterID; - F32 mNearChatRadius; +inline bool operator==(const LLGroupData &a, const LLGroupData &b) +{ + return (a.mID == b.mID); +} - LLFrameTimer mFidgetTimer; - LLFrameTimer mFocusObjectFadeTimer; - F32 mNextFidgetTime; - S32 mCurrentFidget; - BOOL mFirstLogin; - BOOL mGenderChosen; +class LLAgentQueryManager +{ + friend class LLAgent; + friend class LLAgentWearables; - //-------------------------------------------------------------------- - // Wearables - //-------------------------------------------------------------------- - struct LLWearableEntry - { - LLWearableEntry() : mItemID( LLUUID::null ), mWearable( NULL ) {} - - LLUUID mItemID; // ID of the inventory item in the agent's inventory. - LLWearable* mWearable; - }; - LLWearableEntry mWearableEntry[ WT_COUNT ]; - U32 mAgentWearablesUpdateSerialNum; - BOOL mWearablesLoaded; - S32 mTextureCacheQueryID; - U32 mAppearanceSerialNum; - LLAnimPauseRequest mPauseRequest; - - class createStandardWearablesAllDoneCallback : public LLRefCount - { - protected: - ~createStandardWearablesAllDoneCallback(); - }; - class sendAgentWearablesUpdateCallback : public LLRefCount - { - protected: - ~sendAgentWearablesUpdateCallback(); - }; - - class addWearableToAgentInventoryCallback : public LLInventoryCallback - { - public: - enum { - CALL_NONE = 0, - CALL_UPDATE = 1, - CALL_RECOVERDONE = 2, - CALL_CREATESTANDARDDONE = 4, - CALL_MAKENEWOUTFITDONE = 8 - } EType; - - /** - * @brief Construct a callback for dealing with the wearables. - * - * Would like to pass the agent in here, but we can't safely - * count on it being around later. Just use gAgent directly. - * @param cb callback to execute on completion (??? unused ???) - * @param index Index for the wearable in the agent - * @param wearable The wearable data. - * @param todo Bitmask of actions to take on completion. - */ - addWearableToAgentInventoryCallback( - LLPointer<LLRefCount> cb, - S32 index, - LLWearable* wearable, - U32 todo = CALL_NONE); - virtual void fire(const LLUUID& inv_item); - - private: - S32 mIndex; - LLWearable* mWearable; - U32 mTodo; - LLPointer<LLRefCount> mCB; - }; - - LLFriendObserver* mFriendObserver; +public: + LLAgentQueryManager(); + virtual ~LLAgentQueryManager(); + + BOOL hasNoPendingQueries() const { return getNumPendingQueries() == 0; } + S32 getNumPendingQueries() const { return mNumPendingQueries; } +private: + S32 mNumPendingQueries; + S32 mWearablesCacheQueryID; + U32 mUpdateSerialNum; + S32 mActiveCacheQueries[LLVOAvatarDefines::BAKED_NUM_INDICES]; }; -extern LLAgent gAgent; +extern LLAgentQueryManager gAgentQueryManager; #endif diff --git a/indra/newview/llagentaccess.cpp b/indra/newview/llagentaccess.cpp index a4fbc04855e904c15b1c02c3c710aa2c624ab771..eb978eb6c1a26cbc1867d295c0d52701e171620a 100644 --- a/indra/newview/llagentaccess.cpp +++ b/indra/newview/llagentaccess.cpp @@ -3,16 +3,39 @@ * @brief LLAgentAccess class implementation - manages maturity and godmode info * * $LicenseInfo:firstyear=2001&license=viewergpl$ + * * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ #include "llviewerprecompiledheaders.h" #include "llagentaccess.h" #include "indra_constants.h" -#include "llcontrolgroupreader.h" +#include "llcontrol.h" -LLAgentAccess::LLAgentAccess(LLControlGroupReader& savedSettings) : +LLAgentAccess::LLAgentAccess(LLControlGroup& savedSettings) : mSavedSettings(savedSettings), mAccess(SIM_ACCESS_PG), mAdminOverride(false), @@ -140,6 +163,20 @@ int LLAgentAccess::convertTextToMaturity(char text) void LLAgentAccess::setMaturity(char text) { mAccess = LLAgentAccess::convertTextToMaturity(text); + U32 preferred_access = mSavedSettings.getU32("PreferredMaturity"); + while (!canSetMaturity(preferred_access)) + { + if (preferred_access == SIM_ACCESS_ADULT) + { + preferred_access = SIM_ACCESS_MATURE; + } + else + { + // Mature or invalid access gets set to PG + preferred_access = SIM_ACCESS_PG; + } + } + mSavedSettings.setU32("PreferredMaturity", preferred_access); } void LLAgentAccess::setTransition() @@ -152,3 +189,14 @@ bool LLAgentAccess::isInTransition() const return mAOTransition; } +bool LLAgentAccess::canSetMaturity(S32 maturity) +{ + if (isGodlike()) // Gods can always set their Maturity level + return true; + if (isAdult()) // Adults can always set their Maturity level + return true; + if (maturity == SIM_ACCESS_PG || (maturity == SIM_ACCESS_MATURE && isMature())) + return true; + else + return false; +} diff --git a/indra/newview/llagentaccess.h b/indra/newview/llagentaccess.h index dec0d76cc9216e869792839977707352ec40a2d5..93d2f0a37154a22fe376aafd0e939181f2ef7e34 100644 --- a/indra/newview/llagentaccess.h +++ b/indra/newview/llagentaccess.h @@ -3,7 +3,30 @@ * @brief LLAgentAccess class implementation - manages maturity and godmode info * * $LicenseInfo:firstyear=2001&license=viewergpl$ + * * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ @@ -13,12 +36,12 @@ #include "stdtypes.h" // forward declaration so that we don't have to include the whole class -class LLControlGroupReader; +class LLControlGroup; class LLAgentAccess { public: - LLAgentAccess(LLControlGroupReader& savedSettings); + LLAgentAccess(LLControlGroup& savedSettings); bool getAdminOverride() const; void setAdminOverride(bool b); @@ -48,6 +71,7 @@ public: void setTransition(); // sets the transition bit, which defaults to false bool isInTransition() const; + bool canSetMaturity(S32 maturity); private: U8 mAccess; // SIM_ACCESS_MATURE etc @@ -61,9 +85,7 @@ private: // all of the code that depends on it. bool mAOTransition; - // we want this to be const but the getters for it aren't, so we're - // overriding it for now - /* const */ LLControlGroupReader& mSavedSettings; + LLControlGroup& mSavedSettings; }; #endif // LL_LLAGENTACCESS_H diff --git a/indra/newview/llagentlanguage.h b/indra/newview/llagentlanguage.h index 596c5842321ec2a1328abcd37ee37f04a8ac471e..45348a1e5078b4b8060cfdf04d1c22470e5b1f1d 100644 --- a/indra/newview/llagentlanguage.h +++ b/indra/newview/llagentlanguage.h @@ -33,7 +33,7 @@ #ifndef LL_LLAGENTLANGUAGE_H #define LL_LLAGENTLANGUAGE_H -#include "llmemory.h" // LLSingleton<> +#include "llsingleton.h" // LLSingleton<> #include "llevent.h" class LLAgentLanguage: public LLSingleton<LLAgentLanguage>, public LLOldEvents::LLSimpleListener diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index 035c9426a1d3361af97892f6af081cdbb29ad0ce..8ffb97d8fcd263354708750dbcfbf48feb775b9e 100644 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -38,13 +38,13 @@ #include "llagentpilot.h" #include "llagent.h" -#include "llframestats.h" #include "llappviewer.h" #include "llviewercontrol.h" LLAgentPilot gAgentPilot; BOOL LLAgentPilot::sLoop = TRUE; +BOOL LLAgentPilot::sReplaySession = FALSE; LLAgentPilot::LLAgentPilot() : mNumRuns(-1), @@ -177,6 +177,11 @@ void LLAgentPilot::stopPlayback() mTimer.reset(); gAgent.stopAutoPilot(); } + + if (sReplaySession) + { + LLAppViewer::instance()->forceQuit(); + } } void LLAgentPilot::updateTarget() @@ -198,7 +203,6 @@ void LLAgentPilot::updateTarget() { llinfos << "At start, beginning playback" << llendl; mTimer.reset(); - LLFrameStats::startLogging(NULL); mStarted = TRUE; } } @@ -215,7 +219,6 @@ void LLAgentPilot::updateTarget() else { stopPlayback(); - LLFrameStats::stopLogging(NULL); mNumRuns--; if (sLoop) { diff --git a/indra/newview/llagentpilot.h b/indra/newview/llagentpilot.h index 0ad4772f688879bb3d355d6c3713418639c4e56d..dc034398a70b5cc0ad851c73a4c66f2f3c2317f2 100644 --- a/indra/newview/llagentpilot.h +++ b/indra/newview/llagentpilot.h @@ -70,6 +70,7 @@ public: static void startPlayback(void *); static void stopPlayback(void *); static BOOL sLoop; + static BOOL sReplaySession; S32 mNumRuns; BOOL mQuitAfterRuns; diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1c756b1441fe2731e9d4754432a1ffe54696aef4 --- /dev/null +++ b/indra/newview/llagentwearables.cpp @@ -0,0 +1,1584 @@ +/** + * @file llagentwearables.cpp + * @brief LLAgentWearables class implementation + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llagent.h" +#include "llagentwearables.h" + +#include "llfloatercustomize.h" +#include "llinventoryview.h" +#include "llinventorymodel.h" +#include "llnotify.h" +#include "llviewerregion.h" +#include "llvoavatarself.h" +#include "llwearable.h" +#include "llwearablelist.h" + +LLAgentWearables gAgentWearables; + +BOOL LLAgentWearables::mInitialWearablesUpdateReceived = FALSE; + +using namespace LLVOAvatarDefines; + +void LLAgentWearables::dump() +{ + llinfos << "LLAgentWearablesDump" << llendl; + for (S32 i = 0; i < WT_COUNT; i++) + { + U32 count = getWearableCount((EWearableType)i); + llinfos << "Type: " << i << " count " << count << llendl; + for (U32 j=0; j<count; j++) + { + LLWearableInv* wearable_entry = getWearableInv((EWearableType)i,j); + if (wearable_entry == NULL) + { + llinfos << " " << j << " NULL entry" << llendl; + continue; + } + if (wearable_entry->mWearable == NULL) + { + llinfos << " " << j << " NULL wearable" << llendl; + continue; + } + llinfos << " " << j << " Name " << wearable_entry->mWearable->getName() + << " description " << wearable_entry->mWearable->getDescription() << llendl; + + } + } +} + +// MULTI-WEARABLE: debugging +struct LLAgentDumper +{ + LLAgentDumper(std::string name): + mName(name) + { + llinfos << llendl; + llinfos << "LLAgentDumper " << mName << llendl; + gAgentWearables.dump(); + } + + ~LLAgentDumper() + { + llinfos << llendl; + llinfos << "~LLAgentDumper " << mName << llendl; + gAgentWearables.dump(); + } + + std::string mName; +}; + +LLAgentWearables::LLAgentWearables() : + mWearablesLoaded(FALSE), + mAvatarObject(NULL) +{ + // MULTI-WEARABLE: TODO remove null entries. + for (U32 i = 0; i < WT_COUNT; i++) + { + mWearableDatas[(EWearableType)i].push_back(new LLWearableInv); + } +} + +LLAgentWearables::~LLAgentWearables() +{ + cleanup(); +} + +void LLAgentWearables::cleanup() +{ + for (wearableentry_map_t::iterator iter = mWearableDatas.begin(); + iter != mWearableDatas.end(); + iter++) + { + wearableentry_vec_t &wearables = iter->second; + for (U32 i = 0; i < wearables.size(); i++) + { + LLWearableInv *wearable = wearables[i]; + delete wearable; + wearables[i] = NULL; + } + } + mAvatarObject = NULL; +} + +void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar) +{ + mAvatarObject = avatar; + if (avatar) + { + sendAgentWearablesRequest(); + } +} + +// wearables +LLAgentWearables::createStandardWearablesAllDoneCallback::~createStandardWearablesAllDoneCallback() +{ + gAgentWearables.createStandardWearablesAllDone(); +} + +LLAgentWearables::sendAgentWearablesUpdateCallback::~sendAgentWearablesUpdateCallback() +{ + gAgentWearables.sendAgentWearablesUpdate(); +} + +/** + * @brief Construct a callback for dealing with the wearables. + * + * Would like to pass the agent in here, but we can't safely + * count on it being around later. Just use gAgent directly. + * @param cb callback to execute on completion (??? unused ???) + * @param type Type for the wearable in the agent + * @param wearable The wearable data. + * @param todo Bitmask of actions to take on completion. + */ +LLAgentWearables::addWearableToAgentInventoryCallback::addWearableToAgentInventoryCallback( + LLPointer<LLRefCount> cb, S32 type, U32 index, LLWearable* wearable, U32 todo) : + mType(type), + mIndex(index), + mWearable(wearable), + mTodo(todo), + mCB(cb) +{ +} + +void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& inv_item) +{ + if (inv_item.isNull()) + return; + + gAgentWearables.addWearabletoAgentInventoryDone(mType, mIndex, inv_item, mWearable); + + if (mTodo & CALL_UPDATE) + { + gAgentWearables.sendAgentWearablesUpdate(); + } + if (mTodo & CALL_RECOVERDONE) + { + gAgentWearables.recoverMissingWearableDone(); + } + /* + * Do this for every one in the loop + */ + if (mTodo & CALL_CREATESTANDARDDONE) + { + gAgentWearables.createStandardWearablesDone(mType, mIndex); + } + if (mTodo & CALL_MAKENEWOUTFITDONE) + { + gAgentWearables.makeNewOutfitDone(mType, mIndex); + } +} + +void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type, + const U32 index, + const LLUUID& item_id, + LLWearable* wearable) +{ + if (item_id.isNull()) + return; + + LLWearableInv* wearable_entry = getWearableInv((EWearableType)type, index); + + LLUUID old_item_id = wearable_entry->mItemID; + wearable_entry->mItemID = item_id; + wearable_entry->mWearable = wearable; + if (old_item_id.notNull()) + gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id); + gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); + LLViewerInventoryItem* item = gInventory.getItem(item_id); + if (item && wearable) + { + // We're changing the asset id, so we both need to set it + // locally via setAssetUUID() and via setTransactionID() which + // will be decoded on the server. JC + item->setAssetUUID(wearable->getID()); + item->setTransactionID(wearable->getTransactionID()); + gInventory.addChangedMask(LLInventoryObserver::INTERNAL, item_id); + item->updateServer(FALSE); + } + gInventory.notifyObservers(); +} + +void LLAgentWearables::sendAgentWearablesUpdate() +{ + // MULTI-WEARABLE: call i "type" or something. + // First make sure that we have inventory items for each wearable + for (S32 i=0; i < WT_COUNT; ++i) + { + for (U32 j=0; j < getWearableCount((EWearableType)i); j++) + { + LLWearableInv* wearable_entry = getWearableInv((EWearableType)i,j); + LLWearable* wearable = wearable_entry->mWearable; + if (wearable) + { + if (wearable_entry->mItemID.isNull()) + { + LLPointer<LLInventoryCallback> cb = + new addWearableToAgentInventoryCallback( + LLPointer<LLRefCount>(NULL), + i, + j, + wearable, + addWearableToAgentInventoryCallback::CALL_NONE); + addWearableToAgentInventory(cb, wearable); + } + else + { + gInventory.addChangedMask(LLInventoryObserver::LABEL, + wearable_entry->mItemID); + } + } + } + } + + // Then make sure the inventory is in sync with the avatar. + gInventory.notifyObservers(); + + // Send the AgentIsNowWearing + gMessageSystem->newMessageFast(_PREHASH_AgentIsNowWearing); + + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + + lldebugs << "sendAgentWearablesUpdate()" << llendl; + // MULTI-WEARABLE: update for multi-wearables after server-side support is in. + for (S32 i=0; i < WT_COUNT; ++i) + { + gMessageSystem->nextBlockFast(_PREHASH_WearableData); + + U8 type_u8 = (U8)i; + gMessageSystem->addU8Fast(_PREHASH_WearableType, type_u8); + + // MULTI-WEARABLE: TODO: hacked index to 0, needs to loop over all once messages support this. + LLWearableInv* wearable_entry = getWearableInv((EWearableType)i, 0); + LLWearable* wearable = wearable_entry->mWearable; + if (wearable) + { + //llinfos << "Sending wearable " << wearable->getName() << llendl; + gMessageSystem->addUUIDFast(_PREHASH_ItemID, wearable_entry->mItemID); + } + else + { + //llinfos << "Not wearing wearable type " << LLWearableDictionary::getInstance()->getWearable((EWearableType)i) << llendl; + gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID::null); + } + + lldebugs << " " << LLWearableDictionary::getTypeLabel((EWearableType)i) << ": " << (wearable ? wearable->getID() : LLUUID::null) << llendl; + } + gAgent.sendReliableMessage(); +} + +// MULTI-WEARABLE: add index. +void LLAgentWearables::saveWearable(const EWearableType type, const U32 index, BOOL send_update) +{ + LLWearableInv* wearable_entry = getWearableInv(type, index); + LLWearable* old_wearable = wearable_entry ? wearable_entry->mWearable : NULL; + if (old_wearable && (old_wearable->isDirty() || old_wearable->isOldVersion())) + { + LLWearable* new_wearable = LLWearableList::instance().createCopyFromAvatar(old_wearable); + wearable_entry->mWearable = new_wearable; + + LLInventoryItem* item = gInventory.getItem(wearable_entry->mItemID); + if (item) + { + // Update existing inventory item + LLPointer<LLViewerInventoryItem> template_item = + new LLViewerInventoryItem(item->getUUID(), + item->getParentUUID(), + item->getPermissions(), + new_wearable->getID(), + new_wearable->getAssetType(), + item->getInventoryType(), + item->getName(), + item->getDescription(), + item->getSaleInfo(), + item->getFlags(), + item->getCreationDate()); + template_item->setTransactionID(new_wearable->getTransactionID()); + template_item->updateServer(FALSE); + gInventory.updateItem(template_item); + } + else + { + // Add a new inventory item (shouldn't ever happen here) + U32 todo = addWearableToAgentInventoryCallback::CALL_NONE; + if (send_update) + { + todo |= addWearableToAgentInventoryCallback::CALL_UPDATE; + } + LLPointer<LLInventoryCallback> cb = + new addWearableToAgentInventoryCallback( + LLPointer<LLRefCount>(NULL), + (S32)type, + index, + new_wearable, + todo); + addWearableToAgentInventory(cb, new_wearable); + return; + } + + gAgent.getAvatarObject()->wearableUpdated( type ); + + if (send_update) + { + sendAgentWearablesUpdate(); + } + } +} + +// MULTI-WEARABLE: add index +void LLAgentWearables::saveWearableAs(const EWearableType type, + const U32 index, + const std::string& new_name, + BOOL save_in_lost_and_found) +{ + if (!isWearableCopyable(type, index)) + { + llwarns << "LLAgent::saveWearableAs() not copyable." << llendl; + return; + } + LLWearableInv* wearable_entry = getWearableInv(type, index); + LLWearable* old_wearable = wearable_entry->mWearable; + if (!old_wearable) + { + llwarns << "LLAgent::saveWearableAs() no old wearable." << llendl; + return; + } + + LLInventoryItem* item = gInventory.getItem(wearable_entry->mItemID); + if (!item) + { + llwarns << "LLAgent::saveWearableAs() no inventory item." << llendl; + return; + } + std::string trunc_name(new_name); + LLStringUtil::truncate(trunc_name, DB_INV_ITEM_NAME_STR_LEN); + LLWearable* new_wearable = LLWearableList::instance().createCopyFromAvatar( + old_wearable, + trunc_name); + LLPointer<LLInventoryCallback> cb = + new addWearableToAgentInventoryCallback( + LLPointer<LLRefCount>(NULL), + type, + index, + new_wearable, + addWearableToAgentInventoryCallback::CALL_UPDATE); + LLUUID category_id; + if (save_in_lost_and_found) + { + category_id = gInventory.findCategoryUUIDForType( + LLAssetType::AT_LOST_AND_FOUND); + } + else + { + // put in same folder as original + category_id = item->getParentUUID(); + } + + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + category_id, + new_name, + cb); +} + +void LLAgentWearables::revertWearable(const EWearableType type, const U32 index) +{ + LLWearableInv* wearable_entry = getWearableInv(type, index); + LLWearable* wearable = wearable_entry->mWearable; + if (wearable) + { + wearable->writeToAvatar(TRUE); + } + gAgent.sendAgentSetAppearance(); +} + +void LLAgentWearables::saveAllWearables() +{ + //if (!gInventory.isLoaded()) + //{ + // return; + //} + + for (S32 i=0; i < WT_COUNT; i++) + { + for (U32 j=0; j < getWearableCount((EWearableType)i); j++) + saveWearable((EWearableType)i, j, FALSE); + } + sendAgentWearablesUpdate(); +} + +// Called when the user changes the name of a wearable inventory item that is currently being worn. +void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& new_name) +{ + for (S32 i=0; i < WT_COUNT; i++) + { + for (U32 j=0; j < getWearableCount((EWearableType)i); j++) + { + LLWearableInv* wearable_entry = getWearableInv((EWearableType)i,j); + if (wearable_entry->mItemID == item_id) + { + LLWearable* old_wearable = wearable_entry->mWearable; + llassert(old_wearable); + + std::string old_name = old_wearable->getName(); + old_wearable->setName(new_name); + LLWearable* new_wearable = LLWearableList::instance().createCopy(old_wearable); + LLInventoryItem* item = gInventory.getItem(item_id); + if (item) + { + new_wearable->setPermissions(item->getPermissions()); + } + old_wearable->setName(old_name); + + wearable_entry->mWearable = new_wearable; + sendAgentWearablesUpdate(); + break; + } + } + } +} + + +BOOL LLAgentWearables::isWearableModifiable(EWearableType type, U32 index) const +{ + LLUUID item_id = getWearableItem(type, index); + if (!item_id.isNull()) + { + LLInventoryItem* item = gInventory.getItem(item_id); + if (item && item->getPermissions().allowModifyBy(gAgent.getID(), + gAgent.getGroupID())) + { + return TRUE; + } + } + return FALSE; +} + +BOOL LLAgentWearables::isWearableCopyable(EWearableType type, U32 index) const +{ + LLUUID item_id = getWearableItem(type, index); + if (!item_id.isNull()) + { + LLInventoryItem* item = gInventory.getItem(item_id); + if (item && item->getPermissions().allowCopyBy(gAgent.getID(), + gAgent.getGroupID())) + { + return TRUE; + } + } + return FALSE; +} + +/* + U32 LLAgentWearables::getWearablePermMask(EWearableType type) + { + LLUUID item_id = getWearableItem(type); + if (!item_id.isNull()) + { + LLInventoryItem* item = gInventory.getItem(item_id); + if (item) + { + return item->getPermissions().getMaskOwner(); + } + } + return PERM_NONE; + } +*/ + +LLInventoryItem* LLAgentWearables::getWearableInventoryItem(EWearableType type, U32 index) +{ + LLUUID item_id = getWearableItem(type,index); + LLInventoryItem* item = NULL; + if (item_id.notNull()) + { + item = gInventory.getItem(item_id); + } + return item; +} + +LLWearable* LLAgentWearables::getWearableFromWearableItem(const LLUUID& item_id) const +{ + for (S32 i=0; i < WT_COUNT; i++) + { + for (U32 j=0; j < getWearableCount((EWearableType)i); j++) + { + const LLWearableInv* wearable_entry = getWearableInv((EWearableType)i, j); + if (wearable_entry->mItemID == item_id) + { + return wearable_entry->mWearable; + } + } + } + return NULL; +} + +void LLAgentWearables::sendAgentWearablesRequest() +{ + gMessageSystem->newMessageFast(_PREHASH_AgentWearablesRequest); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gAgent.sendReliableMessage(); +} + +// MULTI-WEARABLE: update for multiple items per type. +// Used to enable/disable menu items. +// static +BOOL LLAgentWearables::selfHasWearable(void* userdata) +{ + EWearableType type = (EWearableType)(intptr_t)userdata; + // MULTI-WEARABLE: TODO could be getWearableCount > 0, once null entries have been eliminated. + return gAgentWearables.getWearableInv(type,0)->mWearable != NULL; +} + +const LLAgentWearables::LLWearableInv LLAgentWearables::s_null_wearable; + +LLWearable* LLAgentWearables::getWearable(const EWearableType type, U32 index) +{ + LLWearableInv* inv = getWearableInv(type,index); + return inv->mWearable; +} + +const LLWearable* LLAgentWearables::getWearable(const EWearableType type, U32 index) const +{ + const LLWearableInv* inv = getWearableInv(type,index); + return inv->mWearable; +} + +//MULTI-WEARABLE: this will give wrong values until we get rid of the "always one empty object" scheme. +U32 LLAgentWearables::getWearableCount(const EWearableType type) const +{ + wearableentry_map_t::const_iterator wearable_iter = mWearableDatas.find(type); + if (wearable_iter == mWearableDatas.end()) + { + return 0; + } + const wearableentry_vec_t& wearable_vec = wearable_iter->second; + return wearable_vec.size(); +} + +LLAgentWearables::LLWearableInv* LLAgentWearables::getWearableInv(const EWearableType type, U32 index) +{ + wearableentry_map_t::iterator wearable_iter = mWearableDatas.find(type); + if (wearable_iter == mWearableDatas.end()) + { + return NULL; + } + wearableentry_vec_t& wearable_vec = wearable_iter->second; + if (index>=wearable_vec.size()) + { + return NULL; + } + else + { + return wearable_vec[index]; + } +} + +const LLAgentWearables::LLWearableInv* LLAgentWearables::getWearableInv(const EWearableType type, U32 index) const +{ + wearableentry_map_t::const_iterator wearable_iter = mWearableDatas.find(type); + if (wearable_iter == mWearableDatas.end()) return &s_null_wearable; + const wearableentry_vec_t& wearable_vec = wearable_iter->second; + if (index>=wearable_vec.size()) + return &s_null_wearable; + else + return wearable_vec[index]; +} + +const LLUUID& LLAgentWearables::getWearableItem(EWearableType type, U32 index) const +{ + return getWearableInv(type,index)->mItemID; +} + + +BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const +{ + return (getWearableFromWearableItem(item_id) != NULL); +} + +// MULTI-WEARABLE: update for multiple +// static +void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data) +{ + // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates + // that may result from AgentWearablesRequest having been sent more than once. + if (mInitialWearablesUpdateReceived) + return; + mInitialWearablesUpdateReceived = true; + + LLUUID agent_id; + gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); + + LLVOAvatar* avatar = gAgent.getAvatarObject(); + if (avatar && (agent_id == avatar->getID())) + { + gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, gAgentQueryManager.mUpdateSerialNum); + + S32 num_wearables = gMessageSystem->getNumberOfBlocksFast(_PREHASH_WearableData); + if (num_wearables < 4) + { + // Transitional state. Avatars should always have at least their body parts (hair, eyes, shape and skin). + // The fact that they don't have any here (only a dummy is sent) implies that this account existed + // before we had wearables, or that the database has gotten messed up. + return; + } + + //lldebugs << "processAgentInitialWearablesUpdate()" << llendl; + // Add wearables + LLUUID asset_id_array[WT_COUNT]; + // MULTI-WEARABLE: TODO: update once messages change. Currently use results to populate the zeroth element. + for (S32 i=0; i < num_wearables; i++) + { + U8 type_u8 = 0; + gMessageSystem->getU8Fast(_PREHASH_WearableData, _PREHASH_WearableType, type_u8, i); + if (type_u8 >= WT_COUNT) + { + continue; + } + const EWearableType type = (EWearableType) type_u8; + + LLUUID item_id; + gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_ItemID, item_id, i); + + LLUUID asset_id; + gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_AssetID, asset_id, i); + if (asset_id.isNull()) + { + LLWearable::removeFromAvatar(type, FALSE); + } + else + { + LLAssetType::EType asset_type = LLWearableDictionary::getAssetType(type); + if (asset_type == LLAssetType::AT_NONE) + { + continue; + } + // MULTI-WEARABLE: TODO FIXME: assumes zeroth element always exists and can be safely written to. + LLWearableInv* wearable_entry = gAgentWearables.getWearableInv(type,0); + wearable_entry->mItemID = item_id; + asset_id_array[type] = asset_id; + } + + lldebugs << " " << LLWearableDictionary::getTypeLabel(type) << llendl; + } + + // now that we have the asset ids...request the wearable assets + for (S32 i = 0; i < WT_COUNT; i++) + { + // MULTI-WEARABLE: TODO: update once messages change. Currently use results to populate the zeroth element. + LLWearableInv* wearable_entry = gAgentWearables.getWearableInv((EWearableType)i, 0); + if (!wearable_entry->mItemID.isNull()) + { + LLWearableList::instance().getAsset(asset_id_array[i], + LLStringUtil::null, + LLWearableDictionary::getAssetType((EWearableType) i), + onInitialWearableAssetArrived, (void*)(intptr_t)i); + } + } + } +} + +// A single wearable that the avatar was wearing on start-up has arrived from the database. +// static +void LLAgentWearables::onInitialWearableAssetArrived(LLWearable* wearable, void* userdata) +{ + const EWearableType type = (EWearableType)(intptr_t)userdata; + + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); + if (!avatar) + { + return; + } + + if (wearable) + { + llassert(type == wearable->getType()); + // MULTI-WEARABLE: is this always zeroth element? Change sometime. + LLWearableInv* wearable_entry = gAgentWearables.getWearableInv(type,0); + wearable_entry->mWearable = wearable; + + // disable composites if initial textures are baked + avatar->setupComposites(); + gAgentWearables.queryWearableCache(); + + wearable->writeToAvatar(FALSE); + avatar->setCompositeUpdatesEnabled(TRUE); + gInventory.addChangedMask(LLInventoryObserver::LABEL, wearable_entry->mItemID); + } + else + { + // Somehow the asset doesn't exist in the database. + // MULTI-WEARABLE: assuming zeroth elt + gAgentWearables.recoverMissingWearable(type,0); + } + + gInventory.notifyObservers(); + + // Have all the wearables that the avatar was wearing at log-in arrived? + // MULTI-WEARABLE: update when multiple wearables can arrive per type. + if (!gAgentWearables.mWearablesLoaded) + { + gAgentWearables.mWearablesLoaded = TRUE; + for (S32 i = 0; i < WT_COUNT; i++) + { + LLWearableInv* wearable_entry = gAgentWearables.getWearableInv((EWearableType)i,0); + if (!wearable_entry->mItemID.isNull() && !wearable_entry->mWearable) + { + gAgentWearables.mWearablesLoaded = FALSE; + break; + } + } + } + + if (gAgentWearables.mWearablesLoaded) + { + + // Can't query cache until all wearables have arrived, so calling this earlier is a no-op. + gAgentWearables.queryWearableCache(); + + // Make sure that the server's idea of the avatar's wearables actually match the wearables. + gAgent.sendAgentSetAppearance(); + + // Check to see if there are any baked textures that we hadn't uploaded before we logged off last time. + // If there are any, schedule them to be uploaded as soon as the layer textures they depend on arrive. + if (gAgent.cameraCustomizeAvatar()) + { + avatar->requestLayerSetUploads(); + } + } +} + +// Normally, all wearables referred to "AgentWearablesUpdate" will correspond to actual assets in the +// database. If for some reason, we can't load one of those assets, we can try to reconstruct it so that +// the user isn't left without a shape, for example. (We can do that only after the inventory has loaded.) +void LLAgentWearables::recoverMissingWearable(const EWearableType type, U32 index) +{ + // Try to recover by replacing missing wearable with a new one. + LLNotifications::instance().add("ReplacedMissingWearable"); + lldebugs << "Wearable " << LLWearableDictionary::getTypeLabel(type) << " could not be downloaded. Replaced inventory item with default wearable." << llendl; + LLWearable* new_wearable = LLWearableList::instance().createNewWearable(type); + + S32 type_s32 = (S32) type; + LLWearableInv* wearable_entry = getWearableInv(type, index); + wearable_entry->mWearable = new_wearable; + new_wearable->writeToAvatar(TRUE); + + // Add a new one in the lost and found folder. + // (We used to overwrite the "not found" one, but that could potentially + // destory content.) JC + LLUUID lost_and_found_id = + gInventory.findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); + LLPointer<LLInventoryCallback> cb = + new addWearableToAgentInventoryCallback( + LLPointer<LLRefCount>(NULL), + type_s32, + index, + new_wearable, + addWearableToAgentInventoryCallback::CALL_RECOVERDONE); + addWearableToAgentInventory(cb, new_wearable, lost_and_found_id, TRUE); +} + +void LLAgentWearables::recoverMissingWearableDone() +{ + // Have all the wearables that the avatar was wearing at log-in arrived or been fabricated? + mWearablesLoaded = TRUE; + for (S32 i = 0; i < WT_COUNT; i++) + { + // MULTI-WEARABLE: assuming zeroth elt - fix when messages change. + LLWearableInv* wearable_entry = getWearableInv((EWearableType)i,0); + if (!wearable_entry->mItemID.isNull() && !wearable_entry->mWearable) + { + mWearablesLoaded = FALSE; + break; + } + } + + if (mWearablesLoaded) + { + // Make sure that the server's idea of the avatar's wearables actually match the wearables. + gAgent.sendAgentSetAppearance(); + } + else + { + gInventory.addChangedMask(LLInventoryObserver::LABEL, LLUUID::null); + gInventory.notifyObservers(); + } +} + +void LLAgentWearables::createStandardWearables(BOOL female) +{ + llwarns << "Creating Standard " << (female ? "female" : "male") + << " Wearables" << llendl; + + if (mAvatarObject.isNull()) + { + return; + } + + mAvatarObject->setSex(female ? SEX_FEMALE : SEX_MALE); + + const BOOL create[WT_COUNT] = + { + TRUE, //WT_SHAPE + TRUE, //WT_SKIN + TRUE, //WT_HAIR + TRUE, //WT_EYES + TRUE, //WT_SHIRT + TRUE, //WT_PANTS + TRUE, //WT_SHOES + TRUE, //WT_SOCKS + FALSE, //WT_JACKET + FALSE, //WT_GLOVES + TRUE, //WT_UNDERSHIRT + TRUE, //WT_UNDERPANTS + FALSE //WT_SKIRT + }; + + for (S32 i=0; i < WT_COUNT; i++) + { + bool once = false; + LLPointer<LLRefCount> donecb = NULL; + if (create[i]) + { + if (!once) + { + once = true; + donecb = new createStandardWearablesAllDoneCallback; + } + // MULTI_WEARABLE: only elt 0, may be the right thing? + LLWearableInv* wearable_entry = getWearableInv((EWearableType)i,0); + llassert(wearable_entry->mWearable == NULL); + LLWearable* wearable = LLWearableList::instance().createNewWearable((EWearableType)i); + wearable_entry->mWearable = wearable; + // no need to update here... + // MULTI_WEARABLE: hardwired index = 0 here. + LLPointer<LLInventoryCallback> cb = + new addWearableToAgentInventoryCallback( + donecb, + i, + 0, + wearable, + addWearableToAgentInventoryCallback::CALL_CREATESTANDARDDONE); + addWearableToAgentInventory(cb, wearable, LLUUID::null, FALSE); + } + } +} + +void LLAgentWearables::createStandardWearablesDone(S32 type, U32 index) +{ + LLWearable* wearable = getWearable((EWearableType)type, index); + + if (wearable) + { + wearable->writeToAvatar(TRUE); + } +} + +void LLAgentWearables::createStandardWearablesAllDone() +{ + // ... because sendAgentWearablesUpdate will notify inventory + // observers. + mWearablesLoaded = TRUE; + updateServer(); + + // Treat this as the first texture entry message, if none received yet + mAvatarObject->onFirstTEMessageReceived(); +} + +void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name, + const LLDynamicArray<S32>& wearables_to_include, + const LLDynamicArray<S32>& attachments_to_include, + BOOL rename_clothing) +{ + if (mAvatarObject.isNull()) + { + return; + } + + // First, make a folder in the Clothes directory. + LLUUID folder_id = gInventory.createNewCategory( + gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING), + LLAssetType::AT_NONE, + new_folder_name); + + bool found_first_item = false; + + /////////////////// + // Wearables + + if (wearables_to_include.count()) + { + // Then, iterate though each of the wearables and save copies of them in the folder. + S32 i; + S32 count = wearables_to_include.count(); + LLDynamicArray<LLUUID> delete_items; + LLPointer<LLRefCount> cbdone = NULL; + for (i = 0; i < count; ++i) + { + const S32 type = wearables_to_include[i]; + for (U32 j=0; j<getWearableCount((EWearableType)i); j++) + { + LLWearableInv* wearable_entry = getWearableInv((EWearableType)type, j); + LLWearable* old_wearable = wearable_entry->mWearable; + if (old_wearable) + { + std::string new_name; + LLWearable* new_wearable; + new_wearable = LLWearableList::instance().createCopy(old_wearable); + if (rename_clothing) + { + new_name = new_folder_name; + new_name.append(" "); + new_name.append(old_wearable->getTypeLabel()); + LLStringUtil::truncate(new_name, DB_INV_ITEM_NAME_STR_LEN); + new_wearable->setName(new_name); + } + + LLViewerInventoryItem* item = gInventory.getItem(wearable_entry->mItemID); + S32 todo = addWearableToAgentInventoryCallback::CALL_NONE; + if (!found_first_item) + { + found_first_item = true; + /* set the focus to the first item */ + todo |= addWearableToAgentInventoryCallback::CALL_MAKENEWOUTFITDONE; + /* send the agent wearables update when done */ + cbdone = new sendAgentWearablesUpdateCallback; + } + LLPointer<LLInventoryCallback> cb = + new addWearableToAgentInventoryCallback( + cbdone, + type, + j, + new_wearable, + todo); + if (isWearableCopyable((EWearableType)type, j)) + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + folder_id, + new_name, + cb); + } + else + { + move_inventory_item( + gAgent.getID(), + gAgent.getSessionID(), + item->getUUID(), + folder_id, + new_name, + cb); + } + } + } + } + gInventory.notifyObservers(); + } + + + /////////////////// + // Attachments + + if (attachments_to_include.count()) + { + BOOL msg_started = FALSE; + LLMessageSystem* msg = gMessageSystem; + for (S32 i = 0; i < attachments_to_include.count(); i++) + { + S32 attachment_pt = attachments_to_include[i]; + LLViewerJointAttachment* attachment = get_if_there(mAvatarObject->mAttachmentPoints, attachment_pt, (LLViewerJointAttachment*)NULL); + if (!attachment) continue; + LLViewerObject* attached_object = attachment->getObject(); + if (!attached_object) continue; + const LLUUID& item_id = attachment->getItemID(); + if (item_id.isNull()) continue; + LLInventoryItem* item = gInventory.getItem(item_id); + if (!item) continue; + if (!msg_started) + { + msg_started = TRUE; + msg->newMessage("CreateNewOutfitAttachments"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->nextBlock("HeaderData"); + msg->addUUID("NewFolderID", folder_id); + } + msg->nextBlock("ObjectData"); + msg->addUUID("OldItemID", item_id); + msg->addUUID("OldFolderID", item->getParentUUID()); + } + + if (msg_started) + { + gAgent.sendReliableMessage(); + } + + } +} + +void LLAgentWearables::makeNewOutfitDone(S32 type, U32 index) +{ + LLWearableInv* wearable_entry = getWearableInv((EWearableType)type, index); + LLUUID first_item_id = wearable_entry->mItemID; + // Open the inventory and select the first item we added. + if (first_item_id.notNull()) + { + LLInventoryView* view = LLInventoryView::getActiveInventory(); + if (view) + { + view->getPanel()->setSelection(first_item_id, TAKE_FOCUS_NO); + } + } +} + + +void LLAgentWearables::addWearableToAgentInventory(LLPointer<LLInventoryCallback> cb, + LLWearable* wearable, + const LLUUID& category_id, + BOOL notify) +{ + create_inventory_item(gAgent.getID(), + gAgent.getSessionID(), + category_id, + wearable->getTransactionID(), + wearable->getName(), + wearable->getDescription(), + wearable->getAssetType(), + LLInventoryType::IT_WEARABLE, + wearable->getType(), + wearable->getPermissions().getMaskNextOwner(), + cb); +} + +void LLAgentWearables::removeWearable(const EWearableType type, bool do_remove_all, U32 index) +{ + + if (do_remove_all) + { + removeWearableFinal(type, do_remove_all, index); + } + else + { +// MULTI_WEARABLE: handle vector changes from arbitrary removal. + LLWearable* old_wearable = getWearable(type,index); + + if ((gAgent.isTeen()) + && (type == WT_UNDERSHIRT || type == WT_UNDERPANTS)) + { + // Can't take off underclothing in simple UI mode or on PG accounts + return; + } + + if (old_wearable) + { + if (old_wearable->isDirty()) + { + LLSD payload; + payload["wearable_type"] = (S32)type; + // Bring up view-modal dialog: Save changes? Yes, No, Cancel + LLNotifications::instance().add("WearableSave", LLSD(), payload, &LLAgentWearables::onRemoveWearableDialog); + return; + } + else + { + removeWearableFinal(type, do_remove_all, index); + } + } + } +} + + +// MULTI_WEARABLE: assuming one wearable per type. +// MULTI_WEARABLE: hardwiring 0th elt for now - notification needs to change. +// static +bool LLAgentWearables::onRemoveWearableDialog(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + EWearableType type = (EWearableType)notification["payload"]["wearable_type"].asInteger(); + switch(option) + { + case 0: // "Save" + gAgentWearables.saveWearable(type, 0); + gAgentWearables.removeWearableFinal(type, false, 0); + break; + + case 1: // "Don't Save" + gAgentWearables.removeWearableFinal(type, false, 0); + break; + + case 2: // "Cancel" + break; + + default: + llassert(0); + break; + } + return false; +} + +// Called by removeWearable() and onRemoveWearableDialog() to actually do the removal. +void LLAgentWearables::removeWearableFinal(const EWearableType type, bool do_remove_all, U32 index) +{ + //LLAgentDumper dumper("removeWearable"); + if (do_remove_all) + { + S32 max_entry = mWearableDatas[type].size()-1; + for (S32 i=max_entry; i>=0; i--) + { + LLWearableInv *wearable_entry = getWearableInv(type,i); + LLWearable* old_wearable = wearable_entry->mWearable; + gInventory.addChangedMask(LLInventoryObserver::LABEL, wearable_entry->mItemID); + wearable_entry->mWearable = NULL; + wearable_entry->mItemID.setNull(); + //queryWearableCache(); // BAP moved below + // MULTI_WEARABLE: FIXME - currently we keep a null entry, so can't delete the last one. + if (i>0) + { + mWearableDatas[type].pop_back(); + delete wearable_entry; + } + if (old_wearable) + { + old_wearable->removeFromAvatar(TRUE); + } + } + } + else + { + LLWearableInv* wearable_entry = getWearableInv(type, index); + LLWearable* old_wearable = wearable_entry->mWearable; + + gInventory.addChangedMask(LLInventoryObserver::LABEL, wearable_entry->mItemID); + + wearable_entry->mWearable = NULL; + wearable_entry->mItemID.setNull(); + + //queryWearableCache(); // BAP moved below + + if (old_wearable) + { + old_wearable->removeFromAvatar(TRUE); + } + + // MULTI_WEARABLE: logic changes if null entries go away + if (getWearableCount(type)>1) + { + // Have to shrink the vector and clean up the item. + wearableentry_map_t::iterator wearable_iter = mWearableDatas.find(type); + llassert_always(wearable_iter != mWearableDatas.end()); + wearableentry_vec_t& wearable_vec = wearable_iter->second; + wearable_vec.erase( wearable_vec.begin() + index ); + delete(wearable_entry); + } + } + + queryWearableCache(); + + // Update the server + updateServer(); + gInventory.notifyObservers(); +} + +// Assumes existing wearables are not dirty. +// MULTI_WEARABLE: assumes one wearable per type. +void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& items, + const LLDynamicArray< LLWearable* >& wearables, + BOOL remove) +{ + lldebugs << "setWearableOutfit() start" << llendl; + + BOOL wearables_to_remove[WT_COUNT]; + wearables_to_remove[WT_SHAPE] = FALSE; + wearables_to_remove[WT_SKIN] = FALSE; + wearables_to_remove[WT_HAIR] = FALSE; + wearables_to_remove[WT_EYES] = FALSE; + wearables_to_remove[WT_SHIRT] = remove; + wearables_to_remove[WT_PANTS] = remove; + wearables_to_remove[WT_SHOES] = remove; + wearables_to_remove[WT_SOCKS] = remove; + wearables_to_remove[WT_JACKET] = remove; + wearables_to_remove[WT_GLOVES] = remove; + wearables_to_remove[WT_UNDERSHIRT] = (!gAgent.isTeen()) & remove; + wearables_to_remove[WT_UNDERPANTS] = (!gAgent.isTeen()) & remove; + wearables_to_remove[WT_SKIRT] = remove; + + S32 count = wearables.count(); + llassert(items.count() == count); + + S32 i; + for (i = 0; i < count; i++) + { + LLWearable* new_wearable = wearables[i]; + LLPointer<LLInventoryItem> new_item = items[i]; + + const EWearableType type = new_wearable->getType(); + wearables_to_remove[type] = FALSE; + + // MULTI_WEARABLE: using 0th + LLWearableInv* old_wearable_entry = getWearableInv(type, 0); + LLWearable* old_wearable = old_wearable_entry->mWearable; + if (old_wearable) + { + const LLUUID& old_item_id = old_wearable_entry->mItemID; + if ((old_wearable->getID() == new_wearable->getID()) && + (old_item_id == new_item->getUUID())) + { + lldebugs << "No change to wearable asset and item: " << LLWearableDictionary::getInstance()->getWearableEntry(type) << llendl; + continue; + } + + gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id); + + // Assumes existing wearables are not dirty. + if (old_wearable->isDirty()) + { + llassert(0); + continue; + } + } + + old_wearable_entry->mItemID = new_item->getUUID(); + old_wearable_entry->mWearable = new_wearable; + } + + std::vector<LLWearable*> wearables_being_removed; + + for (i = 0; i < WT_COUNT; i++) + { + if (wearables_to_remove[i]) + { + // MULTI_WEARABLE: assuming 0th + LLWearableInv* wearable_entry = getWearableInv((EWearableType)i, 0); + wearables_being_removed.push_back(wearable_entry->mWearable); + wearable_entry->mWearable = NULL; + + gInventory.addChangedMask(LLInventoryObserver::LABEL, wearable_entry->mItemID); + wearable_entry->mItemID.setNull(); + } + } + + gInventory.notifyObservers(); + + queryWearableCache(); + + std::vector<LLWearable*>::iterator wearable_iter; + + for (wearable_iter = wearables_being_removed.begin(); + wearable_iter != wearables_being_removed.end(); + ++wearable_iter) + { + LLWearable* wearablep = *wearable_iter; + if (wearablep) + { + wearablep->removeFromAvatar(TRUE); + } + } + + for (i = 0; i < count; i++) + { + wearables[i]->writeToAvatar(TRUE); + } + + // Start rendering & update the server + mWearablesLoaded = TRUE; + updateServer(); + + lldebugs << "setWearableOutfit() end" << llendl; +} + + +// User has picked "wear on avatar" from a menu. +void LLAgentWearables::setWearable(LLInventoryItem* new_item, LLWearable* new_wearable, bool do_append) +{ + //LLAgentDumper dumper("setWearable"); + if (isWearingItem(new_item->getUUID())) + { + llwarns << "wearable " << new_item->getUUID() << " is already worn" << llendl; + return; + } + + const EWearableType type = new_wearable->getType(); + + if (!do_append) + { + // Remove old wearable, if any + // MULTI_WEARABLE: hardwired to 0 + LLWearableInv* old_wearable_entry = getWearableInv(type,0); + LLWearable* old_wearable = old_wearable_entry->mWearable; + if (old_wearable) + { + const LLUUID& old_item_id = old_wearable_entry->mItemID; + if ((old_wearable->getID() == new_wearable->getID()) && + (old_item_id == new_item->getUUID())) + { + lldebugs << "No change to wearable asset and item: " << LLWearableDictionary::getInstance()->getWearableEntry(type) << llendl; + return; + } + + if (old_wearable->isDirty()) + { + // Bring up modal dialog: Save changes? Yes, No, Cancel + LLSD payload; + payload["item_id"] = new_item->getUUID(); + LLNotifications::instance().add("WearableSave", LLSD(), payload, boost::bind(onSetWearableDialog, _1, _2, new_wearable)); + return; + } + } + } + + setWearableFinal(new_item, new_wearable, do_append); +} + +// static +bool LLAgentWearables::onSetWearableDialog(const LLSD& notification, const LLSD& response, LLWearable* wearable) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + LLInventoryItem* new_item = gInventory.getItem(notification["payload"]["item_id"].asUUID()); + if (!new_item) + { + delete wearable; + return false; + } + + switch(option) + { + case 0: // "Save" +// MULTI_WEARABLE: assuming 0th + gAgentWearables.saveWearable(wearable->getType(),0); + gAgentWearables.setWearableFinal(new_item, wearable); + break; + + case 1: // "Don't Save" + gAgentWearables.setWearableFinal(new_item, wearable); + break; + + case 2: // "Cancel" + break; + + default: + llassert(0); + break; + } + + delete wearable; + return false; +} + +// Called from setWearable() and onSetWearableDialog() to actually set the wearable. +// MULTI_WEARABLE: unify code after null objects are gone. +void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLWearable* new_wearable, bool do_append) +{ + const EWearableType type = new_wearable->getType(); + + if (do_append && getWearableInv(type,0)->mItemID.notNull()) + { + LLWearableInv *new_wearable_entry = new LLWearableInv; + new_wearable_entry->mItemID = new_item->getUUID(); + new_wearable_entry->mWearable = new_wearable; + mWearableDatas[type].push_back(new_wearable_entry); + llinfos << "Added additional wearable for type " << type + << " size is now " << mWearableDatas[type].size() << llendl; + } + else + { + LLWearableInv* wearable_entry = getWearableInv(type,0); + // Replace the old wearable with a new one. + llassert(new_item->getAssetUUID() == new_wearable->getID()); + LLUUID old_item_id = wearable_entry->mItemID; + wearable_entry->mItemID = new_item->getUUID(); + wearable_entry->mWearable = new_wearable; + + if (old_item_id.notNull()) + { + gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id); + gInventory.notifyObservers(); + } + llinfos << "Replaced current element 0 for type " << type + << " size is now " << mWearableDatas[type].size() << llendl; + } + + //llinfos << "LLVOAvatar::setWearable()" << llendl; + queryWearableCache(); + new_wearable->writeToAvatar(TRUE); + + updateServer(); +} + +void LLAgentWearables::queryWearableCache() +{ + if (!mWearablesLoaded) + { + return; + } + + // Look up affected baked textures. + // If they exist: + // disallow updates for affected layersets (until dataserver responds with cache request.) + // If cache miss, turn updates back on and invalidate composite. + // If cache hit, modify baked texture entries. + // + // Cache requests contain list of hashes for each baked texture entry. + // Response is list of valid baked texture assets. (same message) + + gMessageSystem->newMessageFast(_PREHASH_AgentCachedTexture); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gMessageSystem->addS32Fast(_PREHASH_SerialNum, gAgentQueryManager.mWearablesCacheQueryID); + + S32 num_queries = 0; + for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) + { + const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); + LLUUID hash; + for (U8 i=0; i < baked_dict->mWearables.size(); i++) + { + // EWearableType baked_type = gBakedWearableMap[baked_index][baked_num]; + const EWearableType baked_type = baked_dict->mWearables[i]; + // MULTI_WEARABLE: assuming 0th + const LLWearable* wearable = getWearableInv(baked_type,0)->mWearable; + if (wearable) + { + hash ^= wearable->getID(); + } + } + if (hash.notNull()) + { + hash ^= baked_dict->mWearablesHashID; + num_queries++; + // *NOTE: make sure at least one request gets packed + + //llinfos << "Requesting texture for hash " << hash << " in baked texture slot " << baked_index << llendl; + gMessageSystem->nextBlockFast(_PREHASH_WearableData); + gMessageSystem->addUUIDFast(_PREHASH_ID, hash); + gMessageSystem->addU8Fast(_PREHASH_TextureIndex, (U8)baked_index); + } + + gAgentQueryManager.mActiveCacheQueries[baked_index] = gAgentQueryManager.mWearablesCacheQueryID; + } + + llinfos << "Requesting texture cache entry for " << num_queries << " baked textures" << llendl; + gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); + gAgentQueryManager.mNumPendingQueries++; + gAgentQueryManager.mWearablesCacheQueryID++; +} + +// MULTI_WEARABLE: need a way to specify by wearable rather than by type. +// User has picked "remove from avatar" from a menu. +// static +void LLAgentWearables::userRemoveWearable(void* userdata) +{ + EWearableType type = (EWearableType)(intptr_t)userdata; + + if (!(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR)) //&& + //!((!gAgent.isTeen()) && (type==WT_UNDERPANTS || type==WT_UNDERSHIRT))) + { + // MULTI_WEARABLE: fixed to 0th for now. + gAgentWearables.removeWearable(type,false,0); + } +} + +// static +void LLAgentWearables::userRemoveAllClothes(void* userdata) +{ + // We have to do this up front to avoid having to deal with the case of multiple wearables being dirty. + if (gFloaterCustomize) + { + gFloaterCustomize->askToSaveIfDirty(userRemoveAllClothesStep2); + } + else + { + userRemoveAllClothesStep2(TRUE); + } +} + +// static +// MULTI_WEARABLE: removing all here. +void LLAgentWearables::userRemoveAllClothesStep2(BOOL proceed) +{ + if (proceed) + { + gAgentWearables.removeWearable(WT_SHIRT,true,0); + gAgentWearables.removeWearable(WT_PANTS,true,0); + gAgentWearables.removeWearable(WT_SHOES,true,0); + gAgentWearables.removeWearable(WT_SOCKS,true,0); + gAgentWearables.removeWearable(WT_JACKET,true,0); + gAgentWearables.removeWearable(WT_GLOVES,true,0); + gAgentWearables.removeWearable(WT_UNDERSHIRT,true,0); + gAgentWearables.removeWearable(WT_UNDERPANTS,true,0); + gAgentWearables.removeWearable(WT_SKIRT,true,0); + } +} + +void LLAgentWearables::userRemoveAllAttachments(void* userdata) +{ + LLVOAvatar* avatarp = gAgent.getAvatarObject(); + if (!avatarp) + { + llwarns << "No avatar found." << llendl; + return; + } + + gMessageSystem->newMessage("ObjectDetach"); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + + for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); + iter != avatarp->mAttachmentPoints.end();) + { + LLVOAvatar::attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + LLViewerObject* objectp = attachment->getObject(); + if (objectp) + { + gMessageSystem->nextBlockFast(_PREHASH_ObjectData); + gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID()); + } + } + gMessageSystem->sendReliable(gAgent.getRegionHost()); +} + +void LLAgentWearables::updateServer() +{ + sendAgentWearablesUpdate(); + gAgent.sendAgentSetAppearance(); +} diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h new file mode 100644 index 0000000000000000000000000000000000000000..98f49203d3d30b559ca6d4aa0cc67aeaca3a82e8 --- /dev/null +++ b/indra/newview/llagentwearables.h @@ -0,0 +1,235 @@ +/** + * @file llagentwearables.h + * @brief LLAgentWearables class header file + * + * $LicenseInfo:firstyear=2000&license=viewergpl$ + * + * Copyright (c) 2000-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLAGENTWEARABLES_H +#define LL_LLAGENTWEARABLES_H + +#include "llmemory.h" +#include "lluuid.h" +#include "llinventory.h" +#include "llviewerinventory.h" + +class LLInventoryItem; +class LLVOAvatarSelf; +class LLWearable; + +class LLAgentWearables +{ + //-------------------------------------------------------------------- + // Constructors / destructors / Initializers + //-------------------------------------------------------------------- +public: + LLAgentWearables(); + virtual ~LLAgentWearables(); + void setAvatarObject(LLVOAvatarSelf *avatar); + void createStandardWearables(BOOL female); + void cleanup(); + void dump(); +protected: + // MULTI-WEARABLE: assuming one per type. Type is called index - rename. + void createStandardWearablesDone(S32 type, U32 index/* = 0*/); + void createStandardWearablesAllDone(); + + //-------------------------------------------------------------------- + // Queries + //-------------------------------------------------------------------- +public: + BOOL isWearingItem(const LLUUID& item_id) const; + BOOL isWearableModifiable(EWearableType type, U32 index /*= 0*/) const; + BOOL isWearableCopyable(EWearableType type, U32 index /*= 0*/) const; + BOOL areWearablesLoaded() const { return mWearablesLoaded; } + + //-------------------------------------------------------------------- + // Accessors + //-------------------------------------------------------------------- +public: + const LLUUID& getWearableItem(EWearableType type, U32 index /*= 0*/) const; + LLWearable* getWearableFromWearableItem(const LLUUID& item_id) const; + LLInventoryItem* getWearableInventoryItem(EWearableType type, U32 index /*= 0*/); + // MULTI-WEARABLE: assuming one per type. + static BOOL selfHasWearable(void* userdata); // userdata is EWearableType + LLWearable* getWearable(const EWearableType type, U32 index /*= 0*/); + const LLWearable* getWearable(const EWearableType type, U32 index /*= 0*/) const; + U32 getWearableCount(const EWearableType type) const; + +private: + struct LLWearableInv; + LLWearableInv* getWearableInv(const EWearableType type, U32 index /*= 0*/); + const LLWearableInv* getWearableInv(const EWearableType type, U32 /*index = 0*/) const; + //-------------------------------------------------------------------- + // Setters + //-------------------------------------------------------------------- +public: + void setWearable(LLInventoryItem* new_item, LLWearable* wearable, bool do_append = false); + void setWearableOutfit(const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLWearable* >& wearables, BOOL remove); + void setWearableName(const LLUUID& item_id, const std::string& new_name); +protected: + void setWearableFinal(LLInventoryItem* new_item, LLWearable* new_wearable, bool do_append = false); + static bool onSetWearableDialog(const LLSD& notification, const LLSD& response, LLWearable* wearable); + + void addWearableToAgentInventory(LLPointer<LLInventoryCallback> cb, + LLWearable* wearable, + const LLUUID& category_id = LLUUID::null, + BOOL notify = TRUE); + void addWearabletoAgentInventoryDone(const S32 type, + const U32 index, + const LLUUID& item_id, + LLWearable* wearable); + void recoverMissingWearable(const EWearableType type, U32 index /*= 0*/); + void recoverMissingWearableDone(); + + //-------------------------------------------------------------------- + // Removing wearables + //-------------------------------------------------------------------- +public: + void removeWearable(const EWearableType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); +private: + void removeWearableFinal(const EWearableType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); +protected: + static bool onRemoveWearableDialog(const LLSD& notification, const LLSD& response); + static void userRemoveAllClothesStep2(BOOL proceed); // userdata is NULL + + //-------------------------------------------------------------------- + // Server Communication + //-------------------------------------------------------------------- +public: + static void processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data); +protected: + void sendAgentWearablesUpdate(); + void sendAgentWearablesRequest(); + void queryWearableCache(); + void updateServer(); + static void onInitialWearableAssetArrived(LLWearable* wearable, void* userdata); + + //-------------------------------------------------------------------- + // Outfits + //-------------------------------------------------------------------- +public: + void makeNewOutfit(const std::string& new_folder_name, + const LLDynamicArray<S32>& wearables_to_include, + const LLDynamicArray<S32>& attachments_to_include, + BOOL rename_clothing);protected: +private: + void makeNewOutfitDone(S32 type, U32 index); + + //-------------------------------------------------------------------- + // Save Wearables + //-------------------------------------------------------------------- +public: + // MULTI-WEARABLE: assumes one per type. + void saveWearableAs(const EWearableType type, const U32 index, const std::string& new_name, BOOL save_in_lost_and_found); + void saveWearable(const EWearableType type, const U32 index, BOOL send_update = TRUE); + void saveAllWearables(); + void revertWearable(const EWearableType type, const U32 index); + + //-------------------------------------------------------------------- + // Static UI hooks + //-------------------------------------------------------------------- +public: + // MULTI-WEARABLE: assuming one wearable per type. Need upstream changes. + static void userRemoveWearable(void* userdata); // userdata is EWearableType + static void userRemoveAllClothes(void* userdata); // userdata is NULL + static void userRemoveAllAttachments(void* userdata); // userdata is NULL + + //-------------------------------------------------------------------- + // Member variables + //-------------------------------------------------------------------- +private: + typedef std::vector<LLWearableInv*> wearableentry_vec_t; // all wearables of a certain type (EG all shirts) + typedef std::map<EWearableType, wearableentry_vec_t> wearableentry_map_t; // wearable "categories" arranged by wearable type + wearableentry_map_t mWearableDatas; + + static BOOL mInitialWearablesUpdateReceived; + BOOL mWearablesLoaded; + LLPointer<LLVOAvatarSelf> mAvatarObject; // NULL until avatar object sent down from simulator + + //-------------------------------------------------------------------------------- + // Support classes + //-------------------------------------------------------------------------------- +private: + class createStandardWearablesAllDoneCallback : public LLRefCount + { + protected: + ~createStandardWearablesAllDoneCallback(); + }; + class sendAgentWearablesUpdateCallback : public LLRefCount + { + protected: + ~sendAgentWearablesUpdateCallback(); + }; + + class addWearableToAgentInventoryCallback : public LLInventoryCallback + { + public: + enum EType + { + CALL_NONE = 0, + CALL_UPDATE = 1, + CALL_RECOVERDONE = 2, + CALL_CREATESTANDARDDONE = 4, + CALL_MAKENEWOUTFITDONE = 8 + }; + + // MULTI-WEARABLE: index is an EWearableType - more confusing usage. + // MULTI-WEARABLE: need to have type and index args both? + addWearableToAgentInventoryCallback(LLPointer<LLRefCount> cb, + S32 type, + U32 index, + LLWearable* wearable, + U32 todo = CALL_NONE); + virtual void fire(const LLUUID& inv_item); + private: + S32 mType; + U32 mIndex; + LLWearable* mWearable; + U32 mTodo; + LLPointer<LLRefCount> mCB; + }; + + struct LLWearableInv // Make this subclass of llwearable? + { + LLWearableInv() : mItemID(LLUUID::null), mWearable(NULL) {} + // BOOL exists() const; + LLUUID mItemID; // ID of the inventory item in the agent's inventory. + LLWearable* mWearable; + }; + const static LLWearableInv s_null_wearable; + +}; // LLAgentWearables + +extern LLAgentWearables gAgentWearables; + +//-------------------------------------------------------------------- +// Types +//-------------------------------------------------------------------- + +#endif // LL_AGENTWEARABLES_H diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b66b514597b51b7b0703344385daf9e1f2ed8bdf..ce66bb61808f0d3447a27ccc04b4cfb435c61126 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -30,9 +30,10 @@ * $/LicenseInfo$ */ - #include "llviewerprecompiledheaders.h" + #include "llappviewer.h" + #include "llprimitive.h" #include "llversionviewer.h" @@ -44,19 +45,20 @@ #include "llviewerimagelist.h" #include "llgroupmgr.h" #include "llagent.h" +#include "llagentwearables.h" #include "llwindow.h" #include "llviewerstats.h" #include "llmd5.h" #include "llpumpio.h" #include "llimpanel.h" #include "llmimetypes.h" +#include "llslurl.h" #include "llstartup.h" #include "llfocusmgr.h" #include "llviewerjoystick.h" -#include "llfloaterjoystick.h" +#include "llallocator.h" #include "llares.h" #include "llcurl.h" -#include "llfloatersnapshot.h" #include "llviewerwindow.h" #include "llviewerdisplay.h" #include "llviewermedia.h" @@ -64,14 +66,20 @@ #include "llviewerobjectlist.h" #include "llworldmap.h" #include "llmutelist.h" +#include "lluicolortable.h" #include "llurldispatcher.h" #include "llurlhistory.h" #include "llfirstuse.h" #include "llrender.h" - +#include "lllocationhistory.h" +#include "llfasttimerview.h" #include "llweb.h" #include "llsecondlifeurls.h" +// Linden library includes +#include "llmemory.h" + +// Third party library includes #include <boost/bind.hpp> #if LL_WINDOWS @@ -105,7 +113,6 @@ #include "llviewermenu.h" #include "llselectmgr.h" #include "lltrans.h" -#include "lluitrans.h" #include "lltracker.h" #include "llviewerparcelmgr.h" #include "llworldmapview.h" @@ -116,9 +123,7 @@ #include "lldebugview.h" #include "llconsole.h" #include "llcontainerview.h" -#include "llfloaterstats.h" #include "llhoverview.h" -#include "llfloatermemleak.h" #include "llsdserialize.h" @@ -139,12 +144,16 @@ #include "llvoavatar.h" #include "llfolderview.h" #include "lltoolbar.h" -#include "llframestats.h" #include "llagentpilot.h" #include "llsrv.h" #include "llvovolume.h" #include "llflexibleobject.h" #include "llvosurfacepatch.h" +#include "llviewerfloaterreg.h" +#include "llcommandlineparser.h" +#include "llfloatermemleak.h" +#include "llfloatersnapshot.h" +#include "llinventoryview.h" // includes for idle() idleShutdown() #include "llviewercontrol.h" @@ -161,11 +170,6 @@ #include "llviewerthrottle.h" #include "llparcel.h" - -#include "llinventoryview.h" - -#include "llcommandlineparser.h" - // *FIX: These extern globals should be cleaned up. // The globals either represent state/config/resource-storage of either // this app, or another 'component' of the viewer. App globals should be @@ -181,10 +185,6 @@ ////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor // -#if LL_WINDOWS && LL_LCD_COMPILE - #include "lllcd.h" -#endif - //---------------------------------------------------------------------------- // viewer.cpp - these are only used in viewer, should be easily moved. @@ -284,12 +284,23 @@ static std::string gLaunchFileOnQuit; // Used on Win32 for other apps to identify our window (eg, win_setup) const char* const VIEWER_WINDOW_CLASSNAME = "Second Life"; +//---------------------------------------------------------------------------- + +// List of entries from strings.xml to always replace +static std::set<std::string> default_trans_args; +void init_default_trans_args() +{ + default_trans_args.insert("SECOND_LIFE"); // World + default_trans_args.insert("SECOND_LIFE_VIEWER"); + default_trans_args.insert("SECOND_LIFE_GRID"); + default_trans_args.insert("SECOND_LIFE_SUPPORT"); +} + //---------------------------------------------------------------------------- // File scope definitons const char *VFS_DATA_FILE_BASE = "data.db2.x."; const char *VFS_INDEX_FILE_BASE = "index.db2.x."; -static std::string gSecondLife; static std::string gWindowTitle; std::string gLoginPage; @@ -366,7 +377,6 @@ static void settings_to_globals() MENU_BAR_HEIGHT = gSavedSettings.getS32("MenuBarHeight"); MENU_BAR_WIDTH = gSavedSettings.getS32("MenuBarWidth"); - STATUS_BAR_HEIGHT = gSavedSettings.getS32("StatusBarHeight"); LLCOMBOBOX_HEIGHT = BTN_HEIGHT - 2; LLCOMBOBOX_WIDTH = 128; @@ -388,10 +398,9 @@ static void settings_to_globals() LLSelectMgr::sRenderHiddenSelections = gSavedSettings.getBOOL("RenderHiddenSelections"); LLSelectMgr::sRenderLightRadius = gSavedSettings.getBOOL("RenderLightRadius"); - gFrameStats.setTrackStats(gSavedSettings.getBOOL("StatsSessionTrackFrameStats")); gAgentPilot.mNumRuns = gSavedSettings.getS32("StatsNumRuns"); gAgentPilot.mQuitAfterRuns = gSavedSettings.getBOOL("StatsQuitAfterRuns"); - gAgent.mHideGroupTitle = gSavedSettings.getBOOL("RenderHideGroupTitle"); + gAgent.setHideGroupTitle(gSavedSettings.getBOOL("RenderHideGroupTitle")); gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc"); gAllowTapTapHoldRun = gSavedSettings.getBOOL("AllowTapTapHoldRun"); @@ -408,7 +417,7 @@ static void settings_modify() LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors"); LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] - gDebugGL = gSavedSettings.getBOOL("RenderDebugGL"); + gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession; gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); #if LL_VECTORIZE @@ -446,6 +455,38 @@ static void settings_modify() #endif } +class LLFastTimerLogThread : public LLThread +{ +public: + std::string mFile; + + LLFastTimerLogThread() : LLThread("fast timer log") + { + if(LLFastTimer::sLog) + { + mFile = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "performance.slp"); + } + if(LLFastTimer::sMetricLog) + { + mFile = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "metric.slp"); + } + } + + void run() + { + std::ofstream os(mFile.c_str()); + + while (!LLAppViewer::instance()->isQuitting()) + { + LLFastTimer::writeLog(os); + os.flush(); + ms_sleep(32); + } + + os.close(); + } +}; + void LLAppViewer::initGridChoice() { // Load up the initial grid choice from: @@ -497,8 +538,6 @@ bool LLAppViewer::sendURLToOtherInstance(const std::string& url) LLAppViewer* LLAppViewer::sInstance = NULL; const std::string LLAppViewer::sGlobalSettingsName = "Global"; -const std::string LLAppViewer::sPerAccountSettingsName = "PerAccount"; -const std::string LLAppViewer::sCrashSettingsName = "CrashSettings"; LLTextureCache* LLAppViewer::sTextureCache = NULL; LLWorkerThread* LLAppViewer::sImageDecodeThread = NULL; @@ -513,11 +552,15 @@ LLAppViewer::LLAppViewer() : mPurgeOnExit(false), mSecondInstance(false), mSavedFinalSnapshot(false), + mForceGraphicsDetail(false), mQuitRequested(false), mLogoutRequestSent(false), mYieldTime(-1), mMainloopTimeout(NULL), - mAgentRegionLastAlive(false) + mAgentRegionLastAlive(false), + mFastTimerLogThread(NULL), + mRandomizeFramerate(LLCachedControl<bool>(gSavedSettings,"Randomize Framerate", FALSE)), + mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", FALSE)) { if(NULL != sInstance) { @@ -558,8 +601,13 @@ bool LLAppViewer::init() // // OK to write stuff to logs now, we've now crash reported if necessary // - if (!initConfiguration()) + + init_default_trans_args(); + + if (!initConfiguration()) return false; + + mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling")); // *NOTE:Mani - LLCurl::initClass is not thread safe. // Called before threads are created. @@ -612,34 +660,36 @@ bool LLAppViewer::init() LLError::setPrintLocation(true); } - // Load art UUID information, don't require these strings to be declared in code. - std::string colors_base_filename = gDirUtilp->findSkinnedFilename("colors_base.xml"); - LL_DEBUGS("InitInfo") << "Loading base colors from " << colors_base_filename << LL_ENDL; - gColors.loadFromFileLegacy(colors_base_filename, FALSE, TYPE_COL4U); - - // Load overrides from user colors file - std::string user_colors_filename = gDirUtilp->findSkinnedFilename("colors.xml"); - LL_DEBUGS("InitInfo") << "Loading user colors from " << user_colors_filename << LL_ENDL; - if (gColors.loadFromFileLegacy(user_colors_filename, FALSE, TYPE_COL4U) == 0) - { - LL_DEBUGS("InitInfo") << "Cannot load user colors from " << user_colors_filename << LL_ENDL; - } - // Widget construction depends on LLUI being initialized - LLUI::initClass(&gSavedSettings, - &gSavedSettings, - &gColors, + LLUI::settings_map_t settings_map; + settings_map["config"] = &gSavedSettings; + settings_map["color"] = &gSavedSkinSettings; + settings_map["ignores"] = &gWarningSettings; + settings_map["floater"] = &gSavedSettings; // *TODO: New settings file + settings_map["account"] = &gSavedPerAccountSettings; + + LLUI::initClass(settings_map, LLUIImageList::getInstance(), ui_audio_callback, &LLUI::sGLScaleFactor); + + // Setup paths and LLTrans after LLUI::initClass has been called + LLUI::setupPaths(); + LLTrans::parseStrings("strings.xml", default_trans_args); + LLWeb::initClass(); // do this after LLUI LLTextEditor::setURLCallbacks(&LLWeb::loadURL, &LLURLDispatcher::dispatchFromTextEditor, &LLURLDispatcher::dispatchFromTextEditor); - LLUICtrlFactory::getInstance()->setupPaths(); // update paths with correct language set + ///////////////////////////////////////////////// + + LLToolMgr::getInstance(); // Initialize tool manager if not already instantiated + + LLViewerFloaterReg::registerFloaters(); + ///////////////////////////////////////////////// // // Load settings files @@ -692,18 +742,8 @@ bool LLAppViewer::init() if (!initCache()) { std::ostringstream msg; - msg << - gSecondLife << " is unable to access a file that it needs.\n" - "\n" - "This can be because you somehow have multiple copies running, " - "or your system incorrectly thinks a file is open. " - "If this message persists, restart your computer and try again. " - "If it continues to persist, you may need to completely uninstall " << - gSecondLife << " and reinstall it."; - OSMessageBox( - msg.str(), - LLStringUtil::null, - OSMB_OK); + msg << LLTrans::getString("MBUnableToAccessFile"); + OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK); return 1; } @@ -820,6 +860,7 @@ bool LLAppViewer::init() bool LLAppViewer::mainLoop() { + LLMemType mt1(LLMemType::MTYPE_MAIN); mMainloopTimeout = new LLWatchdogTimeout(); // *FIX:Mani - Make this a setting, once new settings exist in this branch. @@ -837,7 +878,6 @@ bool LLAppViewer::mainLoop() LLVoiceChannel::initClass(); LLVoiceClient::init(gServicePump); - LLMemType mt1(LLMemType::MTYPE_MAIN); LLTimer frameTimer,idleTimer; LLTimer debugTime; LLViewerJoystick* joystick(LLViewerJoystick::getInstance()); @@ -853,12 +893,12 @@ bool LLAppViewer::mainLoop() // Handle messages while (!LLApp::isExiting()) { - LLFastTimer::reset(); // Should be outside of any timer instances + LLFastTimer::nextFrame(); // Should be outside of any timer instances try { - LLFastTimer t(LLFastTimer::FTM_FRAME); pingMainloopTimeout("Main:MiscNativeWindowEvents"); - + + if (gViewerWindow) { LLFastTimer t2(LLFastTimer::FTM_MESSAGES); gViewerWindow->mWindow->processMiscNativeEvents(); @@ -866,6 +906,7 @@ bool LLAppViewer::mainLoop() pingMainloopTimeout("Main:GatherInput"); + if (gViewerWindow) { LLFastTimer t2(LLFastTimer::FTM_MESSAGES); if (!restoreErrorTrap()) @@ -907,6 +948,7 @@ bool LLAppViewer::mainLoop() && !gViewerWindow->getShowProgress() && !gFocusMgr.focusLocked()) { + LLMemType mjk(LLMemType::MTYPE_JOY_KEY); joystick->scanJoystick(); gKeyboard->scanKeyboard(); } @@ -920,6 +962,7 @@ bool LLAppViewer::mainLoop() if (gAres != NULL && gAres->isInitialized()) { + LLMemType mt_ip(LLMemType::MTYPE_IDLE_PUMP); pingMainloopTimeout("Main:ServicePump"); LLFastTimer t4(LLFastTimer::FTM_PUMP); gAres->process(); @@ -947,12 +990,6 @@ bool LLAppViewer::mainLoop() pingMainloopTimeout("Main:Snapshot"); LLFloaterSnapshot::update(); // take snapshots - -#if LL_LCD_COMPILE - // update LCD Screen - pingMainloopTimeout("Main:LCD"); - gLcdScreen->UpdateDisplay(); -#endif } } @@ -963,6 +1000,7 @@ bool LLAppViewer::mainLoop() // Sleep and run background threads { + LLMemType mt_sleep(LLMemType::MTYPE_SLEEP); LLFastTimer t2(LLFastTimer::FTM_SLEEP); bool run_multiple_threads = gSavedSettings.getBOOL("RunMultipleThreads"); @@ -974,7 +1012,7 @@ bool LLAppViewer::mainLoop() // yield cooperatively when not running as foreground window if ( gNoRender - || !gViewerWindow->mWindow->getVisible() + || (gViewerWindow && !gViewerWindow->mWindow->getVisible()) || !gFocusMgr.getAppHasFocus()) { // Sleep if we're not rendering, or the window is minimized. @@ -990,12 +1028,12 @@ bool LLAppViewer::mainLoop() } } - if (gRandomizeFramerate) + if (mRandomizeFramerate) { ms_sleep(rand() % 200); } - if (gPeriodicSlowFrame + if (mPeriodicSlowFrame && (gFrameCount % 10 == 0)) { llinfos << "Periodic slow frame - sleeping 500 ms" << llendl; @@ -1221,22 +1259,26 @@ bool LLAppViewer::cleanup() llinfos << "Shutting down." << llendflush; // Destroy the UI - gViewerWindow->shutdownViews(); + if( gViewerWindow) + gViewerWindow->shutdownViews(); // Clean up selection managers after UI is destroyed, as UI may be observing them. // Clean up before GL is shut down because we might be holding on to objects with texture references LLSelectMgr::cleanupGlobals(); // Shut down OpenGL - gViewerWindow->shutdownGL(); + if( gViewerWindow) + { + gViewerWindow->shutdownGL(); + + // Destroy window, and make sure we're not fullscreen + // This may generate window reshape and activation events. + // Therefore must do this before destroying the message system. + delete gViewerWindow; + gViewerWindow = NULL; + llinfos << "ViewerWindow deleted" << llendflush; + } - // Destroy window, and make sure we're not fullscreen - // This may generate window reshape and activation events. - // Therefore must do this before destroying the message system. - delete gViewerWindow; - gViewerWindow = NULL; - llinfos << "ViewerWindow deleted" << llendflush; - // viewer UI relies on keyboard so keep it aound until viewer UI isa gone delete gKeyboard; gKeyboard = NULL; @@ -1256,12 +1298,6 @@ bool LLAppViewer::cleanup() // gDXHardware.cleanup(); //#endif // LL_WINDOWS -#if LL_LCD_COMPILE - // shut down the LCD window on a logitech keyboard, if there is one - delete gLcdScreen; - gLcdScreen = NULL; -#endif - LLVolumeMgr* volume_manager = LLPrimitive::getVolumeManager(); if (!volume_manager->cleanup()) { @@ -1303,8 +1339,10 @@ bool LLAppViewer::cleanup() // Must do this after all panels have been deleted because panels that have persistent rects // save their rects on delete. - gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); - + gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); + + //*FIX: don't overwrite user color tweaks with *all* colors + gSavedSkinSettings.saveToFile(gSavedSettings.getString("SkinningSettingsFile"), TRUE); // PerAccountSettingsFile should be empty if no use has been logged on. // *FIX:Mani This should get really saved in a "logoff" mode. gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); @@ -1314,8 +1352,11 @@ bool LLAppViewer::cleanup() // save all settings, even if equals defaults gCrashSettings.saveToFile(crash_settings_filename, FALSE); + std::string warnings_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Warnings")); + gWarningSettings.saveToFile(warnings_settings_filename, TRUE); + gSavedSettings.cleanup(); - gColors.cleanup(); + gSavedSkinSettings.cleanup(); gCrashSettings.cleanup(); // Save URL history file @@ -1360,6 +1401,7 @@ bool LLAppViewer::cleanup() sTextureCache->shutdown(); sTextureFetch->shutdown(); sImageDecodeThread->shutdown(); + delete sTextureCache; sTextureCache = NULL; delete sTextureFetch; @@ -1367,6 +1409,31 @@ bool LLAppViewer::cleanup() delete sImageDecodeThread; sImageDecodeThread = NULL; + LLLocationHistory::getInstance()->save(); + delete mFastTimerLogThread; + mFastTimerLogThread = NULL; + + if (LLFastTimerView::sAnalyzePerformance) + { + llinfos << "Analyzing performance" << llendl; + + if(LLFastTimer::sLog) + { + LLFastTimerView::doAnalysis( + gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "performance_baseline.slp"), + gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "performance.slp"), + gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "performance_report.csv")); + } + if(LLFastTimer::sMetricLog) + { + LLFastTimerView::doAnalysis( + gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "metric_baseline.slp"), + gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "metric.slp"), + gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "metric_report.csv")); + } + } + LLMetricPerformanceTester::cleanClass() ; + //Note: //LLViewerMedia::cleanupClass() has to be put before gImageList.shutdown() //because some new image might be generated during cleaning up media. --bao @@ -1419,6 +1486,8 @@ bool LLAppViewer::cleanup() llinfos << "File launched." << llendflush; } + ll_close_fail_log(); + llinfos << "Goodbye" << llendflush; // return 0; @@ -1469,6 +1538,13 @@ bool LLAppViewer::initThreads() LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(), enable_threads && false); LLImage::initClass(LLAppViewer::getImageDecodeThread()); + if (LLFastTimer::sLog || LLFastTimer::sMetricLog) + { + LLFastTimer::sLogLock = new LLMutex(NULL); + mFastTimerLogThread = new LLFastTimerLogThread(); + mFastTimerLogThread->start(); + } + // *FIX: no error handling here! return true; } @@ -1476,7 +1552,7 @@ bool LLAppViewer::initThreads() void errorCallback(const std::string &error_string) { #ifndef LL_RELEASE_FOR_DOWNLOAD - OSMessageBox(error_string, "Fatal Error", OSMB_OK); + OSMessageBox(error_string, LLTrans::getString("MBFatalError"), OSMB_OK); #endif //Set the ErrorActivated global so we know to create a marker file @@ -1544,7 +1620,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, llinfos << "Attempting to load settings for the group " << settings_group << " - from location " << location_key << llendl; - if(gSettings.find(settings_group) == gSettings.end()) + if(!LLControlGroup::getInstance(settings_group)) { llwarns << "No matching settings group for name " << settings_group << llendl; continue; @@ -1558,10 +1634,10 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, std::string custom_name_setting = file.get("NameFromSetting"); // *NOTE: Regardless of the group currently being lodaed, // this setting is always read from the Global settings. - if(gSettings[sGlobalSettingsName]->controlExists(custom_name_setting)) + if(LLControlGroup::getInstance(sGlobalSettingsName)->controlExists(custom_name_setting)) { std::string file_name = - gSettings[sGlobalSettingsName]->getString(custom_name_setting); + LLControlGroup::getInstance(sGlobalSettingsName)->getString(custom_name_setting); full_settings_path = file_name; } } @@ -1578,7 +1654,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, requirement = file.get("Requirement").asInteger(); } - if(!gSettings[settings_group]->loadFromFile(full_settings_path, set_defaults)) + if(!LLControlGroup::getInstance(settings_group)->loadFromFile(full_settings_path, set_defaults)) { if(requirement == 1) { @@ -1618,17 +1694,53 @@ std::string LLAppViewer::getSettingsFilename(const std::string& location_key, return std::string(); } +void LLAppViewer::loadColorSettings() +{ + gSavedSkinSettings.cleanup(); + + loadSettingsFromDirectory("DefaultSkin"); + loadSettingsFromDirectory("CurrentSkin", true); + loadSettingsFromDirectory("UserSkin"); + + class ColorConverterFunctor : public LLControlGroup::ApplyFunctor + { + public: + explicit ColorConverterFunctor(LLUIColorTable::Params& result) + :mResult(result) + { + } + + void apply(const std::string& name, LLControlVariable* control) + { + if(control->isType(TYPE_COL4)) + { + LLUIColorTable::ColorParams color; + color.value = control->getValue(); + + LLUIColorTable::ColorEntryParams color_entry; + color_entry.name = name; + color_entry.color = color; + + mResult.color_entries.add(color_entry); + } + } + + private: + LLUIColorTable::Params& mResult; + }; + + LLUIColorTable::Params params; + ColorConverterFunctor ccf(params); + LLControlGroup::getInstance("Skinning")->applyToAll(&ccf); + LLUIColorTable::instance().init(params); +} + bool LLAppViewer::initConfiguration() { - //Set up internal pointers - gSettings[sGlobalSettingsName] = &gSavedSettings; - gSettings[sPerAccountSettingsName] = &gSavedPerAccountSettings; - gSettings[sCrashSettingsName] = &gCrashSettings; - //Load settings files list std::string settings_file_list = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings_files.xml"); - LLControlGroup settings_control; - llinfos << "Loading settings file list" << settings_file_list << llendl; + LLControlGroup settings_control("SettingsFiles"); + llinfos << "Loading settings file list " << settings_file_list << llendl; if (0 == settings_control.loadFromFile(settings_file_list)) { llerrs << "Cannot load default configuration file " << settings_file_list << llendl; @@ -1651,21 +1763,22 @@ bool LLAppViewer::initConfiguration() if(!loadSettingsFromDirectory("Default", set_defaults)) { std::ostringstream msg; - msg << "Second Life could not load its default settings file. \n" - << "The installation may be corrupted. \n"; - - OSMessageBox( - msg.str(), - LLStringUtil::null, - OSMB_OK); - + msg << "Unable to load default settings file. The installation may be corrupted."; + OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK); return false; } - - // - set procedural settings + + LLUI::setupPaths(); // setup paths for LLTrans based on settings files only + LLTrans::parseStrings("strings.xml", default_trans_args); + + // - set procedural settings + // Note: can't use LL_PATH_PER_SL_ACCOUNT for any of these since we haven't logged in yet gSavedSettings.setString("ClientSettingsFile", gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Global"))); + gSavedSettings.setString("SkinningSettingsFile", + gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("UserSkin", "Skinning"))); + gSavedSettings.setString("VersionChannelName", LL_CHANNEL); #ifndef LL_RELEASE_FOR_DOWNLOAD @@ -1685,7 +1798,7 @@ bool LLAppViewer::initConfiguration() gSavedSettings.setBOOL("WatchdogEnabled", FALSE); #endif - gCrashSettings.getControl(CRASH_BEHAVIOR_SETTING)->getSignal()->connect(boost::bind(&handleCrashSubmitBehaviorChanged, _1)); + gCrashSettings.getControl(CRASH_BEHAVIOR_SETTING)->getSignal()->connect(boost::bind(&handleCrashSubmitBehaviorChanged, _2)); // These are warnings that appear on the first experience of that condition. // They are already set in the settings_default.xml file, but still need to be added to LLFirstUse @@ -1719,22 +1832,13 @@ bool LLAppViewer::initConfiguration() if(!initParseCommandLine(clp)) { - llwarns - << "Error parsing command line options. Command Line options ignored." - << llendl; - + llwarns << "Error parsing command line options. Command Line options ignored." << llendl; + llinfos << "Command line usage:\n" << clp << llendl; std::ostringstream msg; - msg << "Second Life found an error parsing the command line. \n" - << "Please see: http://wiki.secondlife.com/wiki/Client_parameters \n" - << "Error: " << clp.getErrorMessage(); - - OSMessageBox( - msg.str(), - LLStringUtil::null, - OSMB_OK); - + msg << LLTrans::getString("MBCmdLineError") << clp.getErrorMessage(); + OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK); return false; } @@ -1754,7 +1858,6 @@ bool LLAppViewer::initConfiguration() // - load overrides from user_settings loadSettingsFromDirectory("User"); - // - apply command line settings clp.notify(); @@ -1768,7 +1871,7 @@ bool LLAppViewer::initConfiguration() if(clp.hasOption("help")) { std::ostringstream msg; - msg << "Command line usage:\n" << clp; + msg << LLTrans::getString("MBCmdLineUsg") << "\n" << clp; llinfos << msg.str() << llendl; OSMessageBox( @@ -1779,36 +1882,6 @@ bool LLAppViewer::initConfiguration() return false; } - ////////////////////////// - // Apply settings... - if(clp.hasOption("setdefault")) - { - //const LLCommandLineParser::token_vector_t& setdefault = clp.getOption("setdefault"); - //if(0x1 & setdefault.size()) - //{ - // llwarns << "Invalid '--setdefault' parameter count." << llendl; - //} - //else - //{ - // LLCommandLineParser::token_vector_t::const_iterator itr = setdefault.begin(); - // for(; itr != setdefault.end(); ++itr) - // { - // const std::string& name = *itr; - // const std::string& value = *(++itr); - // LLControlVariable* c = gSettings[sGlobalSettingsName]->getControl(name); - // if(c) - // { - // c->setDefault(value); - // } - // else - // { - // llwarns << "'--setdefault' specified with unknown setting: '" - // << name << "'." << llendl; - // } - // } - //} - } - if(clp.hasOption("set")) { const LLCommandLineParser::token_vector_t& set_values = clp.getOption("set"); @@ -1823,7 +1896,7 @@ bool LLAppViewer::initConfiguration() { const std::string& name = *itr; const std::string& value = *(++itr); - LLControlVariable* c = gSettings[sGlobalSettingsName]->getControl(name); + LLControlVariable* c = LLControlGroup::getInstance(sGlobalSettingsName)->getControl(name); if(c) { c->setValue(value, false); @@ -1845,6 +1918,68 @@ bool LLAppViewer::initConfiguration() gCrashOnStartup = TRUE; } + if (clp.hasOption("logperformance")) + { + LLFastTimer::sLog = TRUE; + } + + if(clp.hasOption("logmetrics")) + { + LLFastTimer::sMetricLog = TRUE ; + } + + if (clp.hasOption("graphicslevel")) + { + const LLCommandLineParser::token_vector_t& value = clp.getOption("graphicslevel"); + if(value.size() != 1) + { + llwarns << "Usage: -graphicslevel <0-3>" << llendl; + } + else + { + std::string detail = value.front(); + mForceGraphicsDetail = TRUE; + + switch (detail.c_str()[0]) + { + case '0': + gSavedSettings.setU32("RenderQualityPerformance", 0); + break; + case '1': + gSavedSettings.setU32("RenderQualityPerformance", 1); + break; + case '2': + gSavedSettings.setU32("RenderQualityPerformance", 2); + break; + case '3': + gSavedSettings.setU32("RenderQualityPerformance", 3); + break; + default: + mForceGraphicsDetail = FALSE; + llwarns << "Usage: -graphicslevel <0-3>" << llendl; + break; + } + } + } + + if (clp.hasOption("analyzeperformance")) + { + LLFastTimerView::sAnalyzePerformance = TRUE; + } + + if (clp.hasOption("replaysession")) + { + LLAgentPilot::sReplaySession = TRUE; + } + + if (clp.hasOption("debugsession")) + { + gDebugSession = TRUE; + gDebugGL = TRUE; + + ll_init_fail_log(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "test_failures.log")); + } + // Handle slurl use. NOTE: Don't let SL-55321 reappear. // *FIX: This init code should be made more robust to prevent @@ -1865,7 +2000,7 @@ bool LLAppViewer::initConfiguration() if(clp.hasOption("url")) { std::string slurl = clp.getOption("url")[0]; - if (LLURLDispatcher::isSLURLCommand(slurl)) + if (LLSLURL::isSLURLCommand(slurl)) { LLStartUp::sSLURLCommand = slurl; } @@ -1877,9 +2012,9 @@ bool LLAppViewer::initConfiguration() else if(clp.hasOption("slurl")) { std::string slurl = clp.getOption("slurl")[0]; - if(LLURLDispatcher::isSLURL(slurl)) + if(LLSLURL::isSLURL(slurl)) { - if (LLURLDispatcher::isSLURLCommand(slurl)) + if (LLSLURL::isSLURLCommand(slurl)) { LLStartUp::sSLURLCommand = slurl; } @@ -1894,12 +2029,12 @@ bool LLAppViewer::initConfiguration() if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) { gDirUtilp->setSkinFolder(skinfolder->getValue().asString()); + + gSavedSettings.setString("SkinningSettingsFile", + gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("UserSkin", "Skinning"))); } mYieldTime = gSavedSettings.getS32("YieldTime"); - - // XUI:translate - gSecondLife = "Second Life"; // Read skin/branding settings if specified. //if (! gDirUtilp->getSkinDir().empty() ) @@ -1916,7 +2051,7 @@ bool LLAppViewer::initConfiguration() #if LL_DARWIN // Initialize apple menubar and various callbacks - init_apple_menu(gSecondLife.c_str()); + init_apple_menu(LLTrans::getString("SECOND_LIFE_VIEWER").c_str()); #if __ppc__ // If the CPU doesn't have Altivec (i.e. it's not at least a G4), don't go any further. @@ -1924,7 +2059,7 @@ bool LLAppViewer::initConfiguration() if(!gSysCPU.hasAltivec()) { std::ostringstream msg; - msg << gSecondLife << " requires a processor with AltiVec (G4 or later)."; + msg << LLTrans::getString("MBRequiresAltiVec"); OSMessageBox( msg.str(), LLStringUtil::null, @@ -1939,7 +2074,7 @@ bool LLAppViewer::initConfiguration() // Display splash screen. Must be after above check for previous // crash as this dialog is always frontmost. std::ostringstream splash_msg; - splash_msg << "Loading " << gSecondLife << "..."; + splash_msg << "Loading " << LLTrans::getString("SECOND_LIFE") << "..."; LLSplashScreen::show(); LLSplashScreen::update(splash_msg.str()); @@ -1955,12 +2090,11 @@ bool LLAppViewer::initConfiguration() // // Set the name of the window // -#if LL_RELEASE_FOR_DOWNLOAD - gWindowTitle = gSecondLife; -#elif LL_DEBUG - gWindowTitle = gSecondLife + std::string(" [DEBUG] ") + gArgs; + gWindowTitle = LLTrans::getString("SECOND_LIFE_VIEWER"); +#if LL_DEBUG + gWindowTitle += std::string(" [DEBUG] ") + gArgs; #else - gWindowTitle = gSecondLife + std::string(" ") + gArgs; + gWindowTitle += std::string(" ") + gArgs; #endif LLStringUtil::truncate(gWindowTitle, 255); @@ -1997,11 +2131,7 @@ bool LLAppViewer::initConfiguration() if (mSecondInstance) { std::ostringstream msg; - msg << - gSecondLife << " is already running.\n" - "\n" - "Check your task bar for a minimized copy of the program.\n" - "If this message persists, restart your computer.", + msg << LLTrans::getString("MBAlreadyRunning"); OSMessageBox( msg.str(), LLStringUtil::null, @@ -2046,6 +2176,8 @@ bool LLAppViewer::initConfiguration() gLastRunVersion = gSavedSettings.getString("LastRunVersion"); + loadColorSettings(); + return true; // Config was successful. } @@ -2053,7 +2185,7 @@ bool LLAppViewer::initConfiguration() void LLAppViewer::checkForCrash(void) { -#if 1 //*REMOVE:Mani LL_SEND_CRASH_REPORTS +#if LL_SEND_CRASH_REPORTS //*NOTE:Mani The current state of the crash handler has the MacOSX // sending all crash reports as freezes, in order to let // the MacOSX CrashRepoter generate stacks before spawning the @@ -2063,23 +2195,32 @@ void LLAppViewer::checkForCrash(void) #if LL_DARWIN if(gLastExecEvent != LAST_EXEC_NORMAL) #else - if (gLastExecEvent == LAST_EXEC_FROZE || gLastExecEvent == LAST_EXEC_OTHER_CRASH) + if (gLastExecEvent == LAST_EXEC_FROZE) #endif { llinfos << "Last execution froze, requesting to send crash report." << llendl; // // Pop up a freeze or crash warning dialog // - std::ostringstream msg; - msg << gSecondLife - << " appears to have frozen or crashed on the previous run.\n" - << "Would you like to send a crash report?"; - std::string alert; - alert = gSecondLife; - alert += " Alert"; - S32 choice = OSMessageBox(msg.str(), + S32 choice; + if(gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING) == CRASH_BEHAVIOR_ASK) + { + std::ostringstream msg; + msg << LLTrans::getString("MBFrozenCrashed"); + std::string alert = LLTrans::getString("SECOND_LIFE_VIEWER") + " " + LLTrans::getString("MBAlert"); + choice = OSMessageBox(msg.str(), alert, OSMB_YESNO); + } + else if(gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING) == CRASH_BEHAVIOR_NEVER_SEND) + { + choice = OSBTN_NO; + } + else + { + choice = OSBTN_YES; + } + if (OSBTN_YES == choice) { llinfos << "Sending crash report." << llendl; @@ -2114,7 +2255,7 @@ bool LLAppViewer::initWindow() gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"), FALSE, ignorePixelDepth); - if (gSavedSettings.getBOOL("FullScreen")) + if (!gSavedSettings.getBOOL("NotFullScreen")) { gViewerWindow->toggleFullscreen(FALSE); // request to go full screen... which will be delayed until login @@ -2132,6 +2273,11 @@ bool LLAppViewer::initWindow() // Initialize GL stuff // + if (mForceGraphicsDetail) + { + LLFeatureManager::getInstance()->setGraphicsLevel(gSavedSettings.getU32("RenderQualityPerformance"), false); + } + // Set this flag in case we crash while initializing GL gSavedSettings.setBOOL("RenderInitError", TRUE); gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); @@ -2152,9 +2298,6 @@ bool LLAppViewer::initWindow() LLUI::sWindow = gViewerWindow->getWindow(); - LLTrans::parseStrings("strings.xml"); - LLUITrans::parseStrings("ui_strings.xml"); - // Show watch cursor gViewerWindow->setCursor(UI_CURSOR_WAIT); @@ -2274,7 +2417,7 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["CrashNotHandled"] = (LLSD::Boolean)true; // Dump some debugging info - LL_INFOS("SystemInfo") << gSecondLife + LL_INFOS("SystemInfo") << LLTrans::getString("SECOND_LIFE_VIEWER") << " version " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH << LL_ENDL; @@ -2352,7 +2495,9 @@ void LLAppViewer::handleViewerCrash() gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath(); gDebugInfo["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds()); gDebugInfo["StartupState"] = LLStartUp::getStartupStateString(); - gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) getCurrentRSS() >> 10; + gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) LLMemory::getCurrentRSS() >> 10; + gDebugInfo["FirstLogin"] = (LLSD::Boolean) gAgent.isFirstLogin(); + gDebugInfo["FirstRunThisInstall"] = gSavedSettings.getBOOL("FirstRunThisInstall"); if(gLogoutInProgress) { @@ -2946,12 +3091,12 @@ void LLAppViewer::purgeCache() gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""),mask); } -const std::string& LLAppViewer::getSecondLifeTitle() const +std::string LLAppViewer::getSecondLifeTitle() const { - return gSecondLife; + return LLTrans::getString("SECOND_LIFE_VIEWER"); } -const std::string& LLAppViewer::getWindowTitle() const +std::string LLAppViewer::getWindowTitle() const { return gWindowTitle; } @@ -2985,7 +3130,7 @@ void LLAppViewer::forceDisconnect(const std::string& mesg) return; } - // Translate the message if possible + // *TODO: Translate the message if possible std::string big_reason = LLAgent::sTeleportErrorMessages[mesg]; if ( big_reason.size() == 0 ) { @@ -3121,6 +3266,7 @@ public: /////////////////////////////////////////////////////// void LLAppViewer::idle() { + LLMemType mt_idle(LLMemType::MTYPE_IDLE); pingMainloopTimeout("Main:Idle"); // Update frame timers @@ -3164,7 +3310,6 @@ void LLAppViewer::idle() // // Special case idle if still starting up // - if (LLStartUp::getStartupState() < STATE_STARTED) { // Skip rest if idle startup returns false (essentially, no world yet) @@ -3204,7 +3349,7 @@ void LLAppViewer::idle() // When appropriate, update agent location to the simulator. F32 agent_update_time = agent_update_timer.getElapsedTimeF32(); BOOL flags_changed = gAgent.controlFlagsDirty() || (last_control_flags != gAgent.getControlFlags()); - + if (flags_changed || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) { // Send avatar and camera info @@ -3219,7 +3364,6 @@ void LLAppViewer::idle() // Manage statistics // // - { // Initialize the viewer_stats_timer with an already elapsed time // of SEND_STATS_PERIOD so that the initial stats report will @@ -3257,9 +3401,8 @@ void LLAppViewer::idle() gObjectList.mNumUnknownUpdates = 0; } } - gFrameStats.addFrameData(); } - + if (!gDisconnected) { LLFastTimer t(LLFastTimer::FTM_NETWORK); @@ -3272,12 +3415,10 @@ void LLAppViewer::idle() // floating throughout the various object lists. // - gFrameStats.start(LLFrameStats::IDLE_NETWORK); stop_glerror(); idleNetwork(); stop_glerror(); - gFrameStats.start(LLFrameStats::AGENT_MISC); // Check for away from keyboard, kick idle agents. idle_afk_check(); @@ -3306,7 +3447,7 @@ void LLAppViewer::idle() return; } - gViewerWindow->handlePerFrameHover(); + gViewerWindow->updateUI(); /////////////////////////////////////// // Agent and camera movement @@ -3329,7 +3470,6 @@ void LLAppViewer::idle() { LLFastTimer t(LLFastTimer::FTM_OBJECTLIST_UPDATE); // Actually "object update" - gFrameStats.start(LLFrameStats::OBJECT_UPDATE); if (!(logoutRequestSent() && hasSavedFinalSnapshot())) { @@ -3345,7 +3485,6 @@ void LLAppViewer::idle() { LLFastTimer t(LLFastTimer::FTM_CLEANUP); - gFrameStats.start(LLFrameStats::CLEAN_DEAD); gObjectList.cleanDeadObjects(); LLDrawable::cleanupDeadDrawables(); } @@ -3364,7 +3503,6 @@ void LLAppViewer::idle() // { - gFrameStats.start(LLFrameStats::UPDATE_EFFECTS); LLSelectMgr::getInstance()->updateEffects(); LLHUDManager::getInstance()->cleanupEffects(); LLHUDManager::getInstance()->sendEffects(); @@ -3438,10 +3576,8 @@ void LLAppViewer::idle() if (!gNoRender) { LLFastTimer t(LLFastTimer::FTM_WORLD_UPDATE); - gFrameStats.start(LLFrameStats::UPDATE_MOVE); gPipeline.updateMove(); - gFrameStats.start(LLFrameStats::UPDATE_PARTICLES); LLWorld::getInstance()->updateParticles(); } stop_glerror(); @@ -3467,7 +3603,6 @@ void LLAppViewer::idle() } { - gFrameStats.start(LLFrameStats::AUDIO); LLFastTimer t(LLFastTimer::FTM_AUDIO_UPDATE); if (gAudiop) @@ -3610,6 +3745,7 @@ static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME; void LLAppViewer::idleNetwork() { + LLMemType mt_in(LLMemType::MTYPE_IDLE_NETWORK); pingMainloopTimeout("idleNetwork"); LLError::LLCallStacks::clear() ; llpushcallstacks ; @@ -3629,7 +3765,8 @@ void LLAppViewer::idleNetwork() stop_glerror(); const S64 frame_count = gFrameCount; // U32->S64 F32 total_time = 0.0f; - while (gMessageSystem->checkAllMessages(frame_count, gServicePump)) + + while (gMessageSystem->checkAllMessages(frame_count, gServicePump)) { if (gDoDisconnect) { @@ -3658,6 +3795,7 @@ void LLAppViewer::idleNetwork() break; #endif } + // Handle per-frame message system processing. gMessageSystem->processAcks(); @@ -3696,7 +3834,7 @@ void LLAppViewer::idleNetwork() } } llpushcallstacks ; - gObjectList.mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); + LLViewerStats::getInstance()->mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); // Retransmit unacknowledged packets. gXferManager->retransmitUnackedPackets(); @@ -3737,7 +3875,6 @@ void LLAppViewer::disconnectViewer() llinfos << "Disconnecting viewer!" << llendl; // Dump our frame statistics - gFrameStats.dump(); // Remember if we were flying gSavedSettings.setBOOL("FlyingAtExit", gAgent.getFlying() ); @@ -3749,35 +3886,6 @@ void LLAppViewer::disconnectViewer() { gFloaterView->restoreAll(); } - - - std::list<LLFloater*> floaters_to_close; - for(LLView::child_list_const_iter_t it = gFloaterView->getChildList()->begin(); - it != gFloaterView->getChildList()->end(); - ++it) - { - // The following names are defined in the - // floater_image_preview.xml - // floater_sound_preview.xml - // floater_animation_preview.xml - // files. - LLFloater* fl = static_cast<LLFloater*>(*it); - if(fl - && (fl->getName() == "Image Preview" - || fl->getName() == "Sound Preview" - || fl->getName() == "Animation Preview" - )) - { - floaters_to_close.push_back(fl); - } - } - - while(!floaters_to_close.empty()) - { - LLFloater* fl = floaters_to_close.front(); - floaters_to_close.pop_front(); - fl->close(); - } } if (LLSelectMgr::getInstance()) @@ -3800,6 +3908,8 @@ void LLAppViewer::disconnectViewer() // close inventory interface, close all windows LLInventoryView::cleanup(); + gAgentWearables.cleanup(); + // Also writes cached agent settings to gSavedSettings gAgent.cleanup(); @@ -3915,6 +4025,8 @@ void LLAppViewer::pingMainloopTimeout(const std::string& state, F32 secs) void LLAppViewer::handleLoginComplete() { + gViewerWindow->handleLoginComplete(); + initMainloopTimeout("Mainloop Init"); // Store some data to DebugInfo in case of a freeze. diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index a3b84759f5814345eb3cd95d0c7064c59a23dc81..75033698b6cb7a687ad4a083ea13dad08b9ee9f8 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -33,11 +33,15 @@ #ifndef LL_LLAPPVIEWER_H #define LL_LLAPPVIEWER_H +#include "llcontrol.h" + class LLTextureCache; class LLWorkerThread; class LLTextureFetch; class LLWatchdogTimeout; class LLCommandLineParser; +class LLAllocator; + class LLAppViewer : public LLApp { @@ -96,8 +100,8 @@ public: bool getPurgeCache() const { return mPurgeCache; } - const std::string& getSecondLifeTitle() const; // The Second Life title. - const std::string& getWindowTitle() const; // The window display name. + std::string getSecondLifeTitle() const; // The Second Life title. + std::string getWindowTitle() const; // The window display name. void forceDisconnect(const std::string& msg); // Force disconnection, with a message to the user. void badNetworkHandler(); // Cause a crash state due to bad network packet. @@ -119,14 +123,13 @@ public: virtual void forceErrorSoftwareException(); virtual void forceErrorDriverCrash(); - // *NOTE: There are currently 3 settings files: - // "Global", "PerAccount" and "CrashSettings" // The list is found in app_settings/settings_files.xml // but since they are used explicitly in code, // the follow consts should also do the trick. static const std::string sGlobalSettingsName; - static const std::string sPerAccountSettingsName; - static const std::string sCrashSettingsName; + + LLCachedControl<bool> mRandomizeFramerate; + LLCachedControl<bool> mPeriodicSlowFrame; // Load settings from the location specified by loction_key. // Key availale and rules for loading, are specified in @@ -136,6 +139,7 @@ public: std::string getSettingsFilename(const std::string& location_key, const std::string& file); + void loadColorSettings(); // For thread debugging. // llstartup needs to control init. @@ -150,6 +154,8 @@ public: // *NOTE:Mani Fix this for login abstraction!! void handleLoginComplete(); + LLAllocator & getAllocator() { return mAlloc; } + protected: virtual bool initWindow(); // Initialize the viewer's window. virtual bool initLogging(); // Initialize log files, logging system, return false on failure. @@ -221,6 +227,8 @@ private: bool mSavedFinalSnapshot; + bool mForceGraphicsDetail; + bool mQuitRequested; // User wants to quit, may have modified documents open. bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. S32 mYieldTime; @@ -228,10 +236,13 @@ private: LLWatchdogTimeout* mMainloopTimeout; + LLThread* mFastTimerLogThread; // for tracking viewer<->region circuit death bool mAgentRegionLastAlive; LLUUID mAgentRegionLastID; + LLAllocator mAlloc; + public: //some information for updater typedef struct diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 7c2e341bedc151efc3d7d416e3c6f63b38b38053..ca005946c94315351731a24f7cbdfa687815afbd 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -135,31 +135,6 @@ bool LLAppViewerMacOSX::init() return LLAppViewer::init(); } -bool LLAppViewerMacOSX::initLogging() -{ - // Remove the crash stack log from previous executions. - // Since we've started logging a new instance of the app, we can assume - // The old crash stack is invalid for the next crash report. - char path[MAX_PATH]; - FSRef folder; - if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr) - { - // folder is an FSRef to ~/Library/Logs/ - if(FSRefMakePath(&folder, (UInt8*)&path, sizeof(path)) == noErr) - { - std::string pathname = std::string(path) + std::string("/CrashReporter/"); - std::string mask = "Second Life*"; - std::string file_name; - while(gDirUtilp->getNextFileInDir(pathname, mask, file_name, false)) - { - LLFile::remove(pathname + file_name); - } - } - } - - return LLAppViewer::initLogging(); -} - // MacOSX may add and addition command line arguement for the process serial number. // The option takes a form like '-psn_0_12345'. The following method should be able to recognize // and either ignore or return a pair of values for the option. @@ -213,7 +188,7 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp) // in the "General" tab, click the "Add Localization" button // create a new localization for the language you're adding // set the contents of the new localization of the file to the string corresponding to our localization - // (i.e. "en-us", "ja", etc. Use the existing ones as a guide.) + // (i.e. "en", "ja", etc. Use the existing ones as a guide.) CFURLRef url = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("language"), CFSTR("txt"), NULL); char path[MAX_PATH]; if(CFURLGetFileSystemRepresentation(url, false, (UInt8 *)path, sizeof(path))) @@ -416,6 +391,28 @@ void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze) { _exit(1); } + + // TODO:palmer REMOVE THIS VERY SOON. THIS WILL NOT BE IN VIEWER 2.0 + // Remove the crash stack log from previous executions. + // Since we've started logging a new instance of the app, we can assume + // The old crash stack is invalid for the next crash report. + char path[MAX_PATH]; + FSRef folder; + if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr) + { + // folder is an FSRef to ~/Library/Logs/ + if(FSRefMakePath(&folder, (UInt8*)&path, sizeof(path)) == noErr) + { + std::string pathname = std::string(path) + std::string("/CrashReporter/"); + std::string mask = "Second Life*"; + std::string file_name; + while(gDirUtilp->getNextFileInDir(pathname, mask, file_name, false)) + { + LLFile::remove(pathname + file_name); + } + } + } + } std::string LLAppViewerMacOSX::generateSerialNumber() diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 16928923bf19c7ee55e493d80c925d6f6e4dd071..98d7ab712b7997821257ec8e4fe493c6d473e7f4 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -64,6 +64,7 @@ #include "llfindlocale.h" #include "llcommandlineparser.h" +#include "lltrans.h" // *FIX:Mani - This hack is to fix a linker issue with libndofdev.lib // The lib was compiled under VS2005 - in VS2003 we need to remap assert @@ -84,7 +85,7 @@ LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *excepti { // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. //OSMessageBox("Attach Debugger Now", "Error", OSMB_OK); - // Translate the signals/exceptions into cross-platform stuff + // *TODO: Translate the signals/exceptions into cross-platform stuff // Windows implementation _tprintf( _T("Entering Windows Exception Handler...\n") ); llinfos << "Entering Windows Exception Handler..." << llendl; @@ -159,9 +160,31 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, int nCmdShow) { LLMemType mt1(LLMemType::MTYPE_STARTUP); + + const S32 MAX_HEAPS = 255; + DWORD heap_enable_lfh_error[MAX_HEAPS]; + S32 num_heaps = 0; #if WINDOWS_CRT_MEM_CHECKS && !INCLUDE_VLD _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); // dump memory leaks on exit +#elif 1 + // Experimental - enable the low fragmentation heap + // This results in a 2-3x improvement in opening a new Inventory window (which uses a large numebr of allocations) + // Note: This won't work when running from the debugger unless the _NO_DEBUG_HEAP environment variable is set to 1 + + _CrtSetDbgFlag(0); // default, just making explicit + + ULONG ulEnableLFH = 2; + HANDLE* hHeaps = new HANDLE[MAX_HEAPS]; + num_heaps = GetProcessHeaps(MAX_HEAPS, hHeaps); + for(S32 i = 0; i < num_heaps; i++) + { + bool success = HeapSetInformation(hHeaps[i], HeapCompatibilityInformation, &ulEnableLFH, sizeof(ulEnableLFH)); + if (success) + heap_enable_lfh_error[i] = 0; + else + heap_enable_lfh_error[i] = GetLastError(); + } #endif // *FIX: global @@ -183,8 +206,21 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, llwarns << "Application init failed." << llendl; return -1; } - - // Run the application main loop + + // Have to wait until after logging is initialized to display LFH info + if (num_heaps > 0) + { + llinfos << "Attempted to enable LFH for " << num_heaps << " heaps." << llendl; + for(S32 i = 0; i < num_heaps; i++) + { + if (heap_enable_lfh_error[i]) + { + llinfos << " Failed to enable LFH for heap: " << i << " Error: " << heap_enable_lfh_error[i] << llendl; + } + } + } + + // Run the application main loop if(!LLApp::isQuitting()) { viewer_app_ptr->mainLoop(); @@ -409,33 +445,24 @@ bool LLAppViewerWin32::initHardwareTest() // but vram. vram_only = TRUE; - LLSplashScreen::update("Detecting hardware..."); + LLSplashScreen::update(LLTrans::getString("StartupDetectingHardware")); LL_DEBUGS("AppInit") << "Attempting to poll DirectX for hardware info" << LL_ENDL; gDXHardware.setWriteDebugFunc(write_debug_dx); BOOL probe_ok = gDXHardware.getInfo(vram_only); if (!probe_ok - && gSavedSettings.getWarning("AboutDirectX9")) + && gWarningSettings.getBOOL("AboutDirectX9")) { LL_WARNS("AppInit") << "DirectX probe failed, alerting user." << LL_ENDL; // Warn them that runnin without DirectX 9 will // not allow us to tell them about driver issues std::ostringstream msg; - msg << - LLAppViewer::instance()->getSecondLifeTitle() << " is unable to detect DirectX 9.0b or greater.\n" - "\n" << - LLAppViewer::instance()->getSecondLifeTitle() << " uses DirectX to detect hardware and/or\n" - "outdated drivers that can cause stability problems,\n" - "poor performance and crashes. While you can run\n" << - LLAppViewer::instance()->getSecondLifeTitle() << " without it, we highly recommend running\n" - "with DirectX 9.0b\n" - "\n" - "Do you wish to continue?\n"; + msg << LLTrans::getString ("MBNoDirectX"); S32 button = OSMessageBox( msg.str(), - "Warning", + LLTrans::getString("MBWarning"), OSMB_YESNO); if (OSBTN_NO== button) { @@ -443,7 +470,7 @@ bool LLAppViewerWin32::initHardwareTest() LLWeb::loadURLExternal(DIRECTX_9_URL); return false; } - gSavedSettings.setWarning("AboutDirectX9", FALSE); + gWarningSettings.setBOOL("AboutDirectX9", FALSE); } LL_DEBUGS("AppInit") << "Done polling DirectX for hardware info" << LL_ENDL; @@ -452,7 +479,7 @@ bool LLAppViewerWin32::initHardwareTest() // Disable so debugger can work std::ostringstream splash_msg; - splash_msg << "Loading " << LLAppViewer::instance()->getSecondLifeTitle() << "..."; + splash_msg << LLTrans::getString("StartupLoading") << " " << LLAppViewer::instance()->getSecondLifeTitle() << "..."; LLSplashScreen::update(splash_msg.str()); } diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 4fca9b1f19d69b3330eb71e2d2a949672c689776..4cd9647603fcde5c7d321fb7d9e092c06fd37ee1 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -59,6 +59,7 @@ // library includes #include "lleconomy.h" +#include "llfloaterreg.h" #include "llfocusmgr.h" #include "llscrolllistctrl.h" #include "llsdserialize.h" @@ -337,11 +338,11 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) } LLSendTexLayerResponder::LLSendTexLayerResponder(const LLSD& post_data, - const LLUUID& vfile_id, - LLAssetType::EType asset_type, - LLBakedUploadData * baked_upload_data) - : LLAssetUploadResponder(post_data, vfile_id, asset_type), - mBakedUploadData(baked_upload_data) + const LLUUID& vfile_id, + LLAssetType::EType asset_type, + LLBakedUploadData * baked_upload_data) : + LLAssetUploadResponder(post_data, vfile_id, asset_type), + mBakedUploadData(baked_upload_data) { } @@ -419,72 +420,68 @@ void LLUpdateAgentInventoryResponder::uploadComplete(const LLSD& content) LLInventoryType::EType inventory_type = new_item->getInventoryType(); switch(inventory_type) { - case LLInventoryType::IT_NOTECARD: - { - - // Update the UI with the new asset. - LLPreviewNotecard* nc; - nc = (LLPreviewNotecard*)LLPreview::find(new_item->getUUID()); - if(nc) - { - // *HACK: we have to delete the asset in the VFS so - // that the viewer will redownload it. This is only - // really necessary if the asset had to be modified by - // the uploader, so this can be optimized away in some - // cases. A better design is to have a new uuid if the - // script actually changed the asset. - if(nc->hasEmbeddedInventory()) - { - gVFS->removeFile( - content["new_asset"].asUUID(), - LLAssetType::AT_NOTECARD); - } - nc->refreshFromInventory(); - } - } - break; - case LLInventoryType::IT_LSL: - { - // Find our window and close it if requested. - LLPreviewLSL* preview = (LLPreviewLSL*)LLPreview::find(item_id); - if (preview) - { - // Bytecode save completed - if (content["compiled"]) - { - preview->callbackLSLCompileSucceeded(); - } - else - { - preview->callbackLSLCompileFailed(content["errors"]); - } - } - } - break; - - case LLInventoryType::IT_GESTURE: - { - // If this gesture is active, then we need to update the in-memory - // active map with the new pointer. - if (gGestureManager.isGestureActive(item_id)) - { - LLUUID asset_id = new_item->getAssetUUID(); - gGestureManager.replaceGesture(item_id, asset_id); - gInventory.notifyObservers(); - } - - //gesture will have a new asset_id - LLPreviewGesture* previewp = (LLPreviewGesture*)LLPreview::find(item_id); - if(previewp) - { - previewp->onUpdateSucceeded(); - } + case LLInventoryType::IT_NOTECARD: + { + // Update the UI with the new asset. + LLPreviewNotecard* nc = LLFloaterReg::findTypedInstance<LLPreviewNotecard>("preview_notecard", LLSD(item_id)); + if(nc) + { + // *HACK: we have to delete the asset in the VFS so + // that the viewer will redownload it. This is only + // really necessary if the asset had to be modified by + // the uploader, so this can be optimized away in some + // cases. A better design is to have a new uuid if the + // script actually changed the asset. + if(nc->hasEmbeddedInventory()) + { + gVFS->removeFile(content["new_asset"].asUUID(), LLAssetType::AT_NOTECARD); + } + nc->refreshFromInventory(new_item->getUUID()); + } + break; + } + case LLInventoryType::IT_LSL: + { + // Find our window and close it if requested. + LLPreviewLSL* preview = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", LLSD(item_id)); + if (preview) + { + // Bytecode save completed + if (content["compiled"]) + { + preview->callbackLSLCompileSucceeded(); + } + else + { + preview->callbackLSLCompileFailed(content["errors"]); + } + } + break; + } + + case LLInventoryType::IT_GESTURE: + { + // If this gesture is active, then we need to update the in-memory + // active map with the new pointer. + if (gGestureManager.isGestureActive(item_id)) + { + LLUUID asset_id = new_item->getAssetUUID(); + gGestureManager.replaceGesture(item_id, asset_id); + gInventory.notifyObservers(); + } + + //gesture will have a new asset_id + LLPreviewGesture* previewp = LLFloaterReg::findTypedInstance<LLPreviewGesture>("preview_gesture", LLSD(item_id)); + if(previewp) + { + previewp->onUpdateSucceeded(); + } - } - break; - case LLInventoryType::IT_WEARABLE: - default: - break; + break; + } + case LLInventoryType::IT_WEARABLE: + default: + break; } } @@ -522,64 +519,57 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content) switch(mAssetType) { - case LLAssetType::AT_NOTECARD: - { - - // Update the UI with the new asset. - LLPreviewNotecard* nc; - nc = (LLPreviewNotecard*)LLPreview::find(item_id); - if(nc) - { - // *HACK: we have to delete the asset in the VFS so - // that the viewer will redownload it. This is only - // really necessary if the asset had to be modified by - // the uploader, so this can be optimized away in some - // cases. A better design is to have a new uuid if the - // script actually changed the asset. - if(nc->hasEmbeddedInventory()) - { - gVFS->removeFile( - content["new_asset"].asUUID(), - LLAssetType::AT_NOTECARD); - } - - nc->refreshFromInventory(); - } - } - break; - case LLAssetType::AT_LSL_TEXT: - { - if(mQueueId.notNull()) - { - LLFloaterCompileQueue* queue = - (LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId); - if(NULL != queue) - { - queue->removeItemByItemID(item_id); - } - } - else - { - LLLiveLSLEditor* preview = LLLiveLSLEditor::find(item_id, task_id); - if (preview) - { - // Bytecode save completed - if (content["compiled"]) - { - preview->callbackLSLCompileSucceeded( - task_id, - item_id, - mPostData["is_script_running"]); - } - else - { - preview->callbackLSLCompileFailed(content["errors"]); - } - } - } - } - break; - default: + case LLAssetType::AT_NOTECARD: + { + // Update the UI with the new asset. + LLPreviewNotecard* nc = LLFloaterReg::findTypedInstance<LLPreviewNotecard>("preview_notecard", LLSD(item_id)); + if(nc) + { + // *HACK: we have to delete the asset in the VFS so + // that the viewer will redownload it. This is only + // really necessary if the asset had to be modified by + // the uploader, so this can be optimized away in some + // cases. A better design is to have a new uuid if the + // script actually changed the asset. + if(nc->hasEmbeddedInventory()) + { + gVFS->removeFile(content["new_asset"].asUUID(), + LLAssetType::AT_NOTECARD); + } + + nc->refreshFromInventory(); + } + break; + } + case LLAssetType::AT_LSL_TEXT: + { + if(mQueueId.notNull()) + { + LLFloaterCompileQueue* queue = LLFloaterReg::findTypedInstance<LLFloaterCompileQueue>("compile_queue", mQueueId); + if(NULL != queue) + { + queue->removeItemByItemID(item_id); + } + } + else + { + LLLiveLSLEditor* preview = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", LLSD(item_id)); + if (preview) + { + // Bytecode save completed + if (content["compiled"]) + { + preview->callbackLSLCompileSucceeded(task_id, item_id, mPostData["is_script_running"]); + } + else + { + preview->callbackLSLCompileFailed(content["errors"]); + } + } + } + break; + } + default: break; } } diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp new file mode 100644 index 0000000000000000000000000000000000000000..807f2f035cf3a8784c85b127608b381ec9a278bf --- /dev/null +++ b/indra/newview/llavatariconctrl.cpp @@ -0,0 +1,255 @@ +/** + * @file llavatariconctrl.cpp + * @brief LLAvatarIconCtrl class implementation + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llagent.h" +#include "llavatarconstants.h" +#include "llavatariconctrl.h" +#include "llcallingcard.h" // for LLAvatarTracker +#include "llfriendactions.h" +#include "llimview.h" +#include "llmenugl.h" +#include "lluictrlfactory.h" + +#define MENU_ITEM_VIEW_PROFILE 0 +#define MENU_ITEM_SEND_IM 1 + +static LLDefaultWidgetRegistry::Register<LLAvatarIconCtrl> r("avatar_icon"); + +LLAvatarIconCtrl::LLAvatarIconCtrl(const LLAvatarIconCtrl::Params& p) +: LLIconCtrl(p), + mDrawTooltip(p.draw_tooltip) +{ + LLRect rect = p.rect; + + static LLUICachedControl<S32> llavatariconctrl_symbol_hpad("UIAvatariconctrlSymbolHPad", 2); + static LLUICachedControl<S32> llavatariconctrl_symbol_vpad("UIAvatariconctrlSymbolVPad", 2); + static LLUICachedControl<S32> llavatariconctrl_symbol_size("UIAvatariconctrlSymbolSize", 5); + static LLUICachedControl<std::string> llavatariconctrl_symbol_pos("UIAvatariconctrlSymbolPosition", "BottomRight"); + + // BottomRight is the default position + S32 left = rect.getWidth() - llavatariconctrl_symbol_size - llavatariconctrl_symbol_hpad; + S32 bottom = llavatariconctrl_symbol_vpad; + + if ("BottomLeft" == (std::string)llavatariconctrl_symbol_pos) + { + left = llavatariconctrl_symbol_hpad; + bottom = llavatariconctrl_symbol_vpad; + } + else if ("TopLeft" == (std::string)llavatariconctrl_symbol_pos) + { + left = llavatariconctrl_symbol_hpad; + bottom = rect.getHeight() - llavatariconctrl_symbol_size - llavatariconctrl_symbol_vpad; + } + else if ("TopRight" == (std::string)llavatariconctrl_symbol_pos) + { + left = rect.getWidth() - llavatariconctrl_symbol_size - llavatariconctrl_symbol_hpad; + bottom = rect.getHeight() - llavatariconctrl_symbol_size - llavatariconctrl_symbol_vpad; + } + + rect.setOriginAndSize(left, bottom, llavatariconctrl_symbol_size, llavatariconctrl_symbol_size); + + LLIconCtrl::Params icparams; + icparams.name ("Status Symbol"); + icparams.follows.flags (FOLLOWS_RIGHT | FOLLOWS_BOTTOM); + icparams.rect (rect); + mStatusSymbol = LLUICtrlFactory::create<LLIconCtrl> (icparams); + mStatusSymbol->setValue("circle.tga"); + mStatusSymbol->setColor(LLColor4::grey); + + addChild(mStatusSymbol); + + if (p.avatar_id.isProvided()) + { + LLSD value(p.avatar_id); + setValue(value); + } + else + { + LLIconCtrl::setValue("default_profile_picture.j2c"); + } + + + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + + registrar.add("AvatarIcon.Action", boost::bind(&LLAvatarIconCtrl::onAvatarIconContextMenuItemClicked, this, _2)); + + LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder); + + mPopupMenuHandle = menu->getHandle(); +} + +LLAvatarIconCtrl::~LLAvatarIconCtrl() +{ + if (mAvatarId.notNull()) + { + LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarId, this); + // Name callbacks will be automatically disconnected since LLUICtrl is trackable + } + + LLView::deleteViewByHandle(mPopupMenuHandle); +} + +//virtual +void LLAvatarIconCtrl::setValue(const LLSD& value) +{ + if (value.isUUID()) + { + if (mAvatarId.notNull()) + { + LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarId, this); + } + + if (mAvatarId != value.asUUID()) + { + LLAvatarPropertiesProcessor::getInstance()->addObserver(value.asUUID(), this); + LLAvatarPropertiesProcessor::getInstance()->sendDataRequest(value.asUUID(),APT_PROPERTIES); + mAvatarId = value.asUUID(); + } + } + else + { + LLIconCtrl::setValue(value); + } + + gCacheName->get(mAvatarId, FALSE, boost::bind(&LLAvatarIconCtrl::nameUpdatedCallback, this, _1, _2, _3, _4)); +} + +//virtual +void LLAvatarIconCtrl::processProperties(void* data, EAvatarProcessorType type) +{ + if (APT_PROPERTIES == type) + { + LLAvatarData* avatar_data = static_cast<LLAvatarData*>(data); + if (avatar_data) + { + if (avatar_data->avatar_id != mAvatarId) + { + return; + } + + // Update the avatar + if (avatar_data->image_id.notNull()) + { + LLIconCtrl::setValue(avatar_data->image_id); + } + else + { + LLIconCtrl::setValue("default_profile_picture.j2c"); + } + + // Update color of status symbol and tool tip + if (avatar_data->flags & AVATAR_ONLINE) + { + mStatusSymbol->setColor(LLColor4::green); + if (mDrawTooltip) + { + setToolTip((LLStringExplicit)"Online"); + } + } + else + { + mStatusSymbol->setColor(LLColor4::grey); + if (mDrawTooltip) + { + setToolTip((LLStringExplicit)"Offline"); + } + } + } + } +} + +BOOL LLAvatarIconCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get(); + + if(menu) + { + bool is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarId) != NULL; + + menu->setItemEnabled("Add Friend", !is_friend); + menu->setItemEnabled("Remove Friend", is_friend); + + menu->buildDrawLabels(); + menu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(this, menu, x, y); + } + + return TRUE; +} + +void LLAvatarIconCtrl::nameUpdatedCallback( + const LLUUID& id, + const std::string& first, + const std::string& last, + BOOL is_group) +{ + if (id == mAvatarId) + { + mFirstName = first; + mLastName = last; + } +} + +void LLAvatarIconCtrl::onAvatarIconContextMenuItemClicked(const LLSD& userdata) +{ + std::string level = userdata.asString(); + LLUUID id = getAvatarId(); + + if (level == "profile") + { + LLFriendActions::showProfile(id); + } + else if (level == "im") + { + std::string name; + name.assign(getFirstName()); + name.append(" "); + name.append(getLastName()); + + gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id); + } + else if (level == "add") + { + std::string name; + name.assign(getFirstName()); + name.append(" "); + name.append(getLastName()); + + LLFriendActions::requestFriendshipDialog(id, name); + } + else if (level == "remove") + { + LLFriendActions::removeFriendDialog(id); + } +} diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h new file mode 100644 index 0000000000000000000000000000000000000000..cb1e9584ba5884e30a89bc375af23bb80d838b5f --- /dev/null +++ b/indra/newview/llavatariconctrl.h @@ -0,0 +1,89 @@ +/** + * @file llavatariconctrl.h + * @brief LLAvatarIconCtrl base class + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLAVATARICONCTRL_H +#define LL_LLAVATARICONCTRL_H + +#include "lliconctrl.h" +#include "llavatarpropertiesprocessor.h" +#include "llviewermenu.h" + +class LLAvatarIconCtrl +: public LLIconCtrl, public LLAvatarPropertiesObserver +{ +public: + struct Params : public LLInitParam::Block<Params, LLIconCtrl::Params> + { + Optional <LLUUID> avatar_id; + Optional <bool> draw_tooltip; + Params() + { + name = "avatar_icon"; + draw_tooltip = TRUE; + } + }; +protected: + LLAvatarIconCtrl(const Params&); + friend class LLUICtrlFactory; + + void onAvatarIconContextMenuItemClicked(const LLSD& userdata); + +public: + virtual ~LLAvatarIconCtrl(); + + virtual void setValue(const LLSD& value); + + // LLAvatarPropertiesProcessor observer trigger + virtual void processProperties(void* data, EAvatarProcessorType type); + + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + + void nameUpdatedCallback( + const LLUUID& id, + const std::string& first, + const std::string& last, + BOOL is_group); + + const LLUUID& getAvatarId() const { return mAvatarId; } + const std::string& getFirstName() const { return mFirstName; } + const std::string& getLastName() const { return mLastName; } + +protected: + LLIconCtrl* mStatusSymbol; + LLUUID mAvatarId; + std::string mFirstName; + std::string mLastName; + LLHandle<LLView> mPopupMenuHandle; + bool mDrawTooltip; +}; + +#endif // LL_LLAVATARICONCTRL_H diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp new file mode 100644 index 0000000000000000000000000000000000000000..08f0cf884204a53a905ea0f7a155f79364385cc2 --- /dev/null +++ b/indra/newview/llavatarlist.cpp @@ -0,0 +1,163 @@ +/** + * @file llavatarlist.h + * @brief Generic avatar list + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llavatarlist.h" + +// newview +#include "llcallingcard.h" // for LLAvatarTracker +#include "llcachename.h" + +static LLDefaultWidgetRegistry::Register<LLAvatarList> r("avatar_list"); + +LLAvatarList::Params::Params() +{ + draw_heading = true; + draw_stripes = false; + multi_select = false; + column_padding = 0; + search_column = LIST_NAME; + sort_column = LIST_NAME; +} + +LLAvatarList::LLAvatarList(const Params& p) +: LLScrollListCtrl(p) +{ + setCommitOnSelectionChange(TRUE); // there's no such param in LLScrollListCtrl::Params + + // "name" column + { + LLScrollListColumn::Params col_params; + col_params.name = "name"; + col_params.header.label = "Name"; // *TODO: localize or remove the header + col_params.width.dynamic_width = true; + addColumn(col_params); + } + + // invisible "id" column + { + LLScrollListColumn::Params col_params; + col_params.name = "id"; + col_params.width.pixel_width = 0; + addColumn(col_params); + } + + // The corresponding parameters don't work because we create columns dynamically. + sortByColumnIndex(LIST_NAME, TRUE); + setSearchColumn(LIST_NAME); +} + +std::vector<LLUUID> LLAvatarList::getSelectedIDs() +{ + LLUUID selected_id; + std::vector<LLUUID> avatar_ids; + std::vector<LLScrollListItem*> selected = getAllSelected(); + for(std::vector<LLScrollListItem*>::iterator itr = selected.begin(); itr != selected.end(); ++itr) + { + avatar_ids.push_back((*itr)->getUUID()); + } + return avatar_ids; +} + +void LLAvatarList::addItem(const LLUUID& id, const std::string& name, BOOL is_bold, EAddPosition pos) +{ + std::string fullname; + + // Populate list item. + LLSD element; + element["id"] = id; + + LLSD& friend_column = element["columns"][LIST_NAME]; + friend_column["column"] = "name"; + friend_column["value"] = name; + + LLScrollListItem* new_itemp = addElement(element, pos); + + // Indicate buddy online status. + // (looks like parsing font parameters from LLSD is broken) + if (is_bold) + { + LLScrollListText* name_textp = dynamic_cast<LLScrollListText*>(new_itemp->getColumn(LIST_NAME)); + if (name_textp) + name_textp->setFontStyle(LLFontGL::BOLD); + else + { + llwarns << "Name column not found" << llendl; + } + } +} + +BOOL LLAvatarList::updateList(const std::vector<LLUUID>& all_buddies) +{ + BOOL have_names = TRUE; + + // Save selection. + std::vector<LLUUID> selected_ids = getSelectedIDs(); + LLUUID current_id = getCurrentID(); + S32 pos = getScrollPos(); + + std::vector<LLUUID>::const_iterator buddy_it = all_buddies.begin(); + deleteAllItems(); + for(; buddy_it != all_buddies.end(); ++buddy_it) + { + std::string name; + const LLUUID& buddy_id = *buddy_it; + have_names &= gCacheName->getFullName(buddy_id, name); + addItem(buddy_id, name, LLAvatarTracker::instance().isBuddyOnline(buddy_id)); + } + + // Changed item in place, need to request sort and update columns + // because we might have changed data in a column on which the user + // has already sorted. JC + sortItems(); + + // re-select items + selectMultiple(selected_ids); + setCurrentByID(current_id); +#if 0 + // Restore selection. + if(selected_ids.size() > 0) + { + // only non-null if friends was already found. This may fail, + // but we don't really care here, because refreshUI() will + // clean up the interface. + for(std::vector<LLUUID>::iterator itr = selected_ids.begin(); itr != selected_ids.end(); ++itr) + { + setSelectedByValue(*itr, true); + } + } +#endif + setScrollPos(pos); + + return have_names; +} diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h new file mode 100644 index 0000000000000000000000000000000000000000..9bd9ce8e0eb85e6db96f0b48983c62f3a98e2565 --- /dev/null +++ b/indra/newview/llavatarlist.h @@ -0,0 +1,63 @@ +/** + * @file llavatarlist.h + * @brief Generic avatar list + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLAVATARLIST_H +#define LL_LLAVATARLIST_H + +#include <llscrolllistctrl.h> + +// *TODO: derive from ListView when it's ready. +class LLAvatarList : public LLScrollListCtrl +{ + LOG_CLASS(LLAvatarList); +public: + struct Params : public LLInitParam::Block<Params, LLScrollListCtrl::Params> + { + Params(); + }; + + enum AVATAR_LIST_COLUMN_ORDER + { + LIST_NAME, + }; + + LLAvatarList(const Params&); + virtual ~LLAvatarList() {} + + BOOL updateList(const std::vector<LLUUID>& all_buddies); + +protected: + std::vector<LLUUID> getSelectedIDs(); + void addItem(const LLUUID& id, const std::string& name, BOOL is_bold, EAddPosition pos = ADD_BOTTOM); +}; + +#endif // LL_LLAVATARLIST_H diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..80b80dc2283504515671be0df55053be838bf817 --- /dev/null +++ b/indra/newview/llavatarlistitem.cpp @@ -0,0 +1,273 @@ +/** + * @file llavatarlistitem.cpp + * @avatar list item source file + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterreg.h" +#include "llavatarlistitem.h" +#include "llagent.h" + + + +//--------------------------------------------------------------------------------- +LLAvatarListItem::LLAvatarListItem(const Params& p) : LLPanel() +{ + mNeedsArrange = false; + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_list_item.xml"); + + mStatus = NULL; + mInfo = NULL; + mProfile = NULL; + mini_inspector = NULL; + + mAvatar = getChild<LLAvatarIconCtrl>("avatar_icon"); + //mAvatar->setValue(p.avatar_icon); + mName = getChild<LLTextBox>("name"); + //mName->setText(p.user_name); + + init(p); + + +} + +//--------------------------------------------------------------------------------- +void LLAvatarListItem::init(const Params& p) +{ + mLocator = getChild<LLIconCtrl>("locator"); + + mStatus = getChild<LLTextBox>("user_status"); + + mInfo = getChild<LLButton>("info_btn"); + mInfo->setVisible(false); + + mProfile = getChild<LLButton>("profile_btn"); + mProfile->setVisible(false); + + if(!p.buttons.locator) + { + mLocator->setVisible(false); + delete mLocator; + mLocator = NULL; + } + + if(!p.buttons.status) + { + mStatus->setVisible(false); + delete mStatus; + mStatus = NULL; + } + + if(!p.buttons.info) + { + delete mInfo; + mInfo = NULL; + } + else + { + mInfo->setClickedCallback(boost::bind(&LLAvatarListItem::onInfoBtnClick, this)); + } + + if(!p.buttons.profile) + { + delete mProfile; + mProfile = NULL; + + LLRect rect; + + rect.setLeftTopAndSize(mName->getRect().mLeft, mName->getRect().mTop, mName->getRect().getWidth() + 30, mName->getRect().getHeight()); + mName->setRect(rect); + + if(mStatus) + { + rect.setLeftTopAndSize(mStatus->getRect().mLeft + 30, mStatus->getRect().mTop, mStatus->getRect().getWidth(), mStatus->getRect().getHeight()); + mStatus->setRect(rect); + } + + if(mLocator) + { + rect.setLeftTopAndSize(mLocator->getRect().mLeft + 30, mLocator->getRect().mTop, mLocator->getRect().getWidth(), mLocator->getRect().getHeight()); + mLocator->setRect(rect); + } + + if(mInfo) + { + rect.setLeftTopAndSize(mInfo->getRect().mLeft + 30, mInfo->getRect().mTop, mInfo->getRect().getWidth(), mInfo->getRect().getHeight()); + mInfo->setRect(rect); + } + } + +} + +//--------------------------------------------------------------------------------- +void LLAvatarListItem::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + if(!mNeedsArrange) + { + LLView::reshape(width, height, called_from_parent); + return; + } + + LLRect rect; + S32 profile_delta = 0; + S32 width_delta = getRect().getWidth() - width; + + if(!mProfile) + { + profile_delta = 30; + } + else + { + rect.setLeftTopAndSize(mProfile->getRect().mLeft - width_delta, mProfile->getRect().mTop, mProfile->getRect().getWidth(), mProfile->getRect().getHeight()); + mProfile->setRect(rect); + } + + width_delta += profile_delta; + + if(mInfo) + { + rect.setLeftTopAndSize(mInfo->getRect().mLeft - width_delta, mInfo->getRect().mTop, mInfo->getRect().getWidth(), mInfo->getRect().getHeight()); + mInfo->setRect(rect); + } + + if(mLocator) + { + rect.setLeftTopAndSize(mLocator->getRect().mLeft - width_delta, mLocator->getRect().mTop, mLocator->getRect().getWidth(), mLocator->getRect().getHeight()); + mLocator->setRect(rect); + } + + if(mStatus) + { + rect.setLeftTopAndSize(mStatus->getRect().mLeft - width_delta, mStatus->getRect().mTop, mStatus->getRect().getWidth(), mStatus->getRect().getHeight()); + mStatus->setRect(rect); + } + + mNeedsArrange = false; + LLView::reshape(width, height, called_from_parent); +} + +//--------------------------------------------------------------------------------- +LLAvatarListItem::~LLAvatarListItem() +{ +} +//--------------------------------------------------------------------------------- + +//--------------------------------------------------------------------------------- +BOOL LLAvatarListItem::handleHover(S32 x, S32 y, MASK mask) +{ + mYPos = y; + mXPos = x; + + return true; +} + +//--------------------------------------------------------------------------------- +void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) +{ + setTransparentColor( *(new LLColor4((F32)0.4, (F32)0.4, (F32)0.4)) ); + + if(mInfo) + mInfo->setVisible(true); + + if(mProfile) + mProfile->setVisible(true); +} + +//--------------------------------------------------------------------------------- +void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask) +{ + if(mInfo) + { + if( mInfo->getRect().pointInRect(x, y) ) + return; + + mInfo->setVisible(false); + } + + if(mProfile) + { + if( mProfile->getRect().pointInRect(x, y) ) + return; + + mProfile->setVisible(false); + } + + setTransparentColor( *(new LLColor4((F32)0.3, (F32)0.3, (F32)0.3)) ); +} + +//--------------------------------------------------------------------------------- +void LLAvatarListItem::setStatus(int status) +{ +} + +//--------------------------------------------------------------------------------- +void LLAvatarListItem::setName(std::string name) +{ +} + +//--------------------------------------------------------------------------------- +void LLAvatarListItem::setAvatar(LLSD& data) +{ +} + +//--------------------------------------------------------------------------------- +void LLAvatarListItem::onInfoBtnClick() +{ + mini_inspector = LLFloaterReg::showInstance("mini_inspector", gAgent.getID()); + + if (!mini_inspector) + return; + + LLRect rect; + localPointToScreen(mXPos, mYPos, &mXPos, &mYPos); + + + // *TODO Vadim: rewrite this. "+= -" looks weird. + S32 delta = mYPos - mini_inspector->getRect().getHeight(); + if(delta < 0) + { + mYPos += -delta; + } + + rect.setLeftTopAndSize(mXPos, mYPos, mini_inspector->getRect().getWidth(), mini_inspector->getRect().getHeight()); + mini_inspector->setRect(rect); + mini_inspector->setFrontmost(true); + mini_inspector->setVisible(true); + +} + +//--------------------------------------------------------------------------------- +void LLAvatarListItem::onProfileBtnClick() +{ +} + +//--------------------------------------------------------------------------------- diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h new file mode 100644 index 0000000000000000000000000000000000000000..5835a4c6b4bb6aa5696f2b75d1f239acd29e68c9 --- /dev/null +++ b/indra/newview/llavatarlistitem.h @@ -0,0 +1,102 @@ +/** + * @file llavatarlistitem.h + * @avatar list item header file + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llavatariconctrl.h" +#include <llview.h> +#include <llpanel.h> +#include <llfloater.h> +#include <lltextbox.h> +#include <llbutton.h> +#include <lluuid.h> + +#include "llfloaterminiinspector.h" + +class LLAvatarListItem : public LLPanel +{ +public: + struct Params : public LLInitParam::Block<Params, LLPanel::Params> + { + Optional<LLUUID> avatar_icon; + Optional<std::string> user_name; + struct avatar_list_item_buttons + { + bool status; + bool info; + bool profile; + bool locator; + avatar_list_item_buttons() : status(true), info(true), profile(true), locator(true) + {}; + } buttons; + + Params() : avatar_icon("avatar_icon",LLUUID()), user_name("user_name","") + {}; + }; + + + LLAvatarListItem(const Params& p); + virtual ~LLAvatarListItem(); + + void reshape(S32 width, S32 height, BOOL called_from_parent); + + //interface + void setStatus(int status); + void setName(std::string name); + void setAvatar(LLSD& data); + void needsArrange( void ) {mNeedsArrange = true;} + + + //event handlers + //mouse + virtual BOOL handleHover(S32 x, S32 y, MASK mask); + virtual void onMouseLeave(S32 x, S32 y, MASK mask); + virtual void onMouseEnter(S32 x, S32 y, MASK mask); + //buttons + void onInfoBtnClick(); + void onProfileBtnClick(); + +private: + LLAvatarIconCtrl* mAvatar; + LLIconCtrl* mLocator; + LLTextBox* mName; + LLTextBox* mStatus; + LLButton* mInfo; + LLButton* mProfile; + + S32 mYPos; + S32 mXPos; + + LLFloater* mini_inspector; + bool mNeedsArrange; + + // + void init(const Params& p); +}; diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e27da5663b09f192c921439d44fe4ce63ff43c0c --- /dev/null +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -0,0 +1,441 @@ +/** + * @file llavatarpropertiesprocessor.cpp + * @brief LLAvatarPropertiesProcessor class implementation + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llavatarpropertiesprocessor.h" + +#include "message.h" +#include "llagent.h" +#include "llviewergenericmessage.h" + +LLAvatarPropertiesProcessor::LLAvatarPropertiesProcessor() +{ +} + +void LLAvatarPropertiesProcessor::addObserver(const LLUUID& avatar_id, LLAvatarPropertiesObserver* observer) +{ + // Check if that observer is already in mObservers for that avatar_id + observer_multimap_t::iterator it; + + // IAN BUG this should update the observer's UUID if this is a dupe - sent to PE + it = mObservers.find(avatar_id); + while (it != mObservers.end()) + { + if (it->second == observer) + { + return; + } + else + { + ++it; + } + } + + mObservers.insert(std::pair<LLUUID, LLAvatarPropertiesObserver*>(avatar_id, observer)); +} + +void LLAvatarPropertiesProcessor::removeObserver(const LLUUID& avatar_id, LLAvatarPropertiesObserver* observer) +{ + if (!observer) + { + return; + } + + observer_multimap_t::iterator it; + it = mObservers.find(avatar_id); + while (it != mObservers.end()) + { + if (it->second == observer) + { + mObservers.erase(it); + break; + } + else + { + ++it; + } + } +} + +void LLAvatarPropertiesProcessor::sendDataRequest(const LLUUID& avatar_id, EAvatarProcessorType type, + const void * data) +{ + switch(type) + { + case APT_PROPERTIES: + sendAvatarPropertiesRequest(avatar_id); + break; + case APT_PICKS: + sendGenericRequest(avatar_id, "avatarpicksrequest"); + break; + case APT_PICK_INFO: + if (data) { + sendPickInfoRequest(avatar_id, *static_cast<const LLUUID*>(data)); + } + case APT_NOTES: + sendGenericRequest(avatar_id, "avatarnotesrequest"); + break; + case APT_GROUPS: + sendGenericRequest(avatar_id, "avatargroupsrequest"); + break; + default: + break; + } +} + +void LLAvatarPropertiesProcessor::sendGenericRequest(const LLUUID& avatar_id, const std::string method) +{ + std::vector<std::string> strings; + strings.push_back( avatar_id.asString() ); + send_generic_message(method, strings); +} + +void LLAvatarPropertiesProcessor::sendAvatarPropertiesRequest(const LLUUID& avatar_id) +{ + LLMessageSystem *msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_AvatarPropertiesRequest); + msg->nextBlockFast( _PREHASH_AgentData); + msg->addUUIDFast( _PREHASH_AgentID, gAgent.getID() ); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast( _PREHASH_AvatarID, avatar_id); + gAgent.sendReliableMessage(); +} + +void LLAvatarPropertiesProcessor::sendDataUpdate(const void* data, EAvatarProcessorType type) +{ + switch(type) + { + case APT_PROPERTIES: + sendAvatarPropertiesUpdate(data); + break; + case APT_PICK_INFO: + sendPicInfoUpdate(data); + case APT_PICKS: +// sendGenericRequest(avatar_id, "avatarpicksrequest"); + break; + case APT_NOTES: +// sendGenericRequest(avatar_id, "avatarnotesrequest"); + break; + case APT_GROUPS: +// sendGenericRequest(avatar_id, "avatargroupsrequest"); + break; + default: + break; + } + +} +void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const void* data) +{ + llinfos << "Sending avatarinfo update" << llendl; + + const LLAvatarData* avatar_props = static_cast<const LLAvatarData*>(data); + // This value is required by sendAvatarPropertiesUpdate method. + //A profile should never be mature. (From the original code) + BOOL mature = FALSE; + + + + LLMessageSystem *msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_AvatarPropertiesUpdate); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast( _PREHASH_AgentID, gAgent.getID() ); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); + msg->nextBlockFast(_PREHASH_PropertiesData); + + msg->addUUIDFast( _PREHASH_ImageID, avatar_props->image_id); + msg->addUUIDFast( _PREHASH_FLImageID, avatar_props->fl_image_id); + msg->addStringFast( _PREHASH_AboutText, avatar_props->about_text); + msg->addStringFast( _PREHASH_FLAboutText, avatar_props->fl_about_text); + + msg->addBOOL(_PREHASH_AllowPublish, avatar_props->allow_publish); + msg->addBOOL(_PREHASH_MaturePublish, mature); + msg->addString(_PREHASH_ProfileURL, avatar_props->profile_url); + gAgent.sendReliableMessage(); +} + +void LLAvatarPropertiesProcessor::processAvatarPropertiesReply(LLMessageSystem* msg, void**) +{ + LLAvatarData avatar_data; + + msg->getUUIDFast( _PREHASH_AgentData, _PREHASH_AgentID, avatar_data.agent_id); + msg->getUUIDFast( _PREHASH_AgentData, _PREHASH_AvatarID, avatar_data.avatar_id); + msg->getUUIDFast( _PREHASH_PropertiesData, _PREHASH_ImageID, avatar_data.image_id); + msg->getUUIDFast( _PREHASH_PropertiesData, _PREHASH_FLImageID, avatar_data.fl_image_id); + msg->getUUIDFast( _PREHASH_PropertiesData, _PREHASH_PartnerID, avatar_data.partner_id); + msg->getStringFast( _PREHASH_PropertiesData, _PREHASH_AboutText, avatar_data.about_text); + msg->getStringFast( _PREHASH_PropertiesData, _PREHASH_FLAboutText, avatar_data.fl_about_text); + msg->getStringFast( _PREHASH_PropertiesData, _PREHASH_BornOn, avatar_data.born_on); + msg->getString( _PREHASH_PropertiesData, _PREHASH_ProfileURL, avatar_data.profile_url); + msg->getU32Fast( _PREHASH_PropertiesData, _PREHASH_Flags, avatar_data.flags); + + + avatar_data.caption_index = 0; + + S32 charter_member_size = 0; + charter_member_size = msg->getSize(_PREHASH_PropertiesData, _PREHASH_CharterMember); + if(1 == charter_member_size) + { + msg->getBinaryData(_PREHASH_PropertiesData, _PREHASH_CharterMember, &avatar_data.caption_index, 1); + } + else if(1 < charter_member_size) + { + msg->getString(_PREHASH_PropertiesData, _PREHASH_CharterMember, avatar_data.caption_text); + } + notifyObservers(avatar_data.avatar_id,&avatar_data,APT_PROPERTIES); +} + +void LLAvatarPropertiesProcessor::processAvatarInterestsReply(LLMessageSystem* msg, void**) +{ +/* + AvatarInterestsReply is automatically sent by the server in response to the + AvatarPropertiesRequest sent when the panel is opened (in addition to the AvatarPropertiesReply message). + If the interests panel is no longer part of the design (?) we should just register the message + to a handler function that does nothing. + That will suppress the warnings and be compatible with old server versions. + WARNING: LLTemplateMessageReader::decodeData: Message from 216.82.37.237:13000 with no handler function received: AvatarInterestsReply +*/ +} +void LLAvatarPropertiesProcessor::processAvatarClassifiedReply(LLMessageSystem* msg, void**) +{ + // avatarclassifiedsrequest is not sent according to new UI design but + // keep this method according to resolved issues. +} +void LLAvatarPropertiesProcessor::processAvatarNotesReply(LLMessageSystem* msg, void**) +{ + LLAvatarNotes avatar_notes; + + msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, avatar_notes.agent_id); + msg->getUUID(_PREHASH_Data, _PREHASH_TargetID, avatar_notes.target_id); + msg->getString(_PREHASH_Data, _PREHASH_Notes, avatar_notes.notes); + + notifyObservers(avatar_notes.target_id,&avatar_notes,APT_NOTES); +} + +void LLAvatarPropertiesProcessor::processAvatarPicksReply(LLMessageSystem* msg, void**) +{ + LLAvatarPicks avatar_picks; + msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, avatar_picks.target_id); + msg->getUUID(_PREHASH_AgentData, _PREHASH_TargetID, avatar_picks.target_id); + + S32 block_count = msg->getNumberOfBlocks(_PREHASH_Data); + for (int block = 0; block < block_count; ++block) + { + LLUUID pick_id; + std::string pick_name; + + msg->getUUID(_PREHASH_Data, _PREHASH_PickID, pick_id, block); + msg->getString(_PREHASH_Data, _PREHASH_PickName, pick_name, block); + + avatar_picks.picks_list.push_back(std::make_pair(pick_id,pick_name)); + } + notifyObservers(avatar_picks.target_id,&avatar_picks,APT_PICKS); +} + +void LLAvatarPropertiesProcessor::processPickInfoReply(LLMessageSystem* msg, void**) +{ + LLPickData pick_data; + + // Extract the agent id and verify the message is for this + // client. + msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, pick_data.agent_id ); + msg->getUUID(_PREHASH_Data, _PREHASH_PickID, pick_data.pick_id); + msg->getUUID(_PREHASH_Data, _PREHASH_CreatorID, pick_data.creator_id); + + // ** top_pick should be deleted, not being used anymore - angela + msg->getBOOL(_PREHASH_Data, _PREHASH_TopPick, pick_data.top_pick); + msg->getUUID(_PREHASH_Data, _PREHASH_ParcelID, pick_data.parcel_id); + msg->getString(_PREHASH_Data, _PREHASH_Name, pick_data.name); + msg->getString(_PREHASH_Data, _PREHASH_Desc, pick_data.desc); + msg->getUUID(_PREHASH_Data, _PREHASH_SnapshotID, pick_data.snapshot_id); + + // "Location text" is actually the owner name, the original + // name that owner gave the parcel, and the location. + msg->getString(_PREHASH_Data, _PREHASH_User, pick_data.location_text); + pick_data.location_text.append(", "); + + msg->getString(_PREHASH_Data, _PREHASH_OriginalName, pick_data.original_name); + if (!pick_data.original_name.empty()) + { + pick_data.location_text.append(pick_data.original_name); + pick_data.location_text.append(", "); + } + + msg->getString(_PREHASH_Data, _PREHASH_SimName, pick_data.sim_name); + pick_data.location_text.append(pick_data.sim_name); + pick_data.location_text.append(" "); + + msg->getVector3d(_PREHASH_Data, _PREHASH_PosGlobal, pick_data.pos_global); + S32 region_x = llround((F32)pick_data.pos_global.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = llround((F32)pick_data.pos_global.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = llround((F32)pick_data.pos_global.mdV[VZ]); + pick_data.location_text.append(llformat("(%d, %d, %d)", region_x, region_y, region_z)); + + msg->getS32(_PREHASH_Data, _PREHASH_SortOrder, pick_data.sort_order); + msg->getBOOL(_PREHASH_Data, _PREHASH_Enabled, pick_data.enabled); + + notifyObservers(pick_data.agent_id, &pick_data, APT_PICK_INFO); +} + +void LLAvatarPropertiesProcessor::processAvatarGroupsReply(LLMessageSystem* msg, void**) +{ + LLAvatarGroups avatar_groups; + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, avatar_groups.agent_id ); + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_groups.avatar_id ); + + S32 group_count = msg->getNumberOfBlocksFast(_PREHASH_GroupData); + for(S32 i = 0; i < group_count; ++i) + { + LLAvatarGroups::LLGroupData group_data; + + msg->getU64( _PREHASH_GroupData, _PREHASH_GroupPowers, group_data.group_powers, i ); + msg->getStringFast(_PREHASH_GroupData, _PREHASH_GroupTitle, group_data.group_title, i ); + msg->getUUIDFast( _PREHASH_GroupData, _PREHASH_GroupID, group_data.group_id, i); + msg->getStringFast(_PREHASH_GroupData, _PREHASH_GroupName, group_data.group_name, i ); + msg->getUUIDFast( _PREHASH_GroupData, _PREHASH_GroupInsigniaID, group_data.group_insignia_id, i ); + + avatar_groups.group_list.push_back(group_data); + } + + notifyObservers(avatar_groups.avatar_id,&avatar_groups,APT_GROUPS); +} + +void LLAvatarPropertiesProcessor::notifyObservers(const LLUUID& id,void* data, EAvatarProcessorType type) +{ + LLAvatarPropertiesProcessor::observer_multimap_t observers = LLAvatarPropertiesProcessor::getInstance()->mObservers; + + observer_multimap_t::iterator oi = observers.lower_bound(id); + observer_multimap_t::iterator end = observers.upper_bound(id); + for (; oi != end; ++oi) + { + oi->second->processProperties(data,type); + } +} + +void LLAvatarPropertiesProcessor::sendFriendRights(const LLUUID& avatar_id, S32 rights) +{ + if(!avatar_id.isNull()) + { + LLMessageSystem* msg = gMessageSystem; + + // setup message header + msg->newMessageFast(_PREHASH_GrantUserRights); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUID(_PREHASH_AgentID, gAgent.getID()); + msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlockFast(_PREHASH_Rights); + msg->addUUID(_PREHASH_AgentRelated, avatar_id); + msg->addS32(_PREHASH_RelatedRights, rights); + + gAgent.sendReliableMessage(); + } +} + +void LLAvatarPropertiesProcessor::sendNotes(const LLUUID& avatar_id, const std::string notes) +{ + if(!avatar_id.isNull()) + { + LLMessageSystem* msg = gMessageSystem; + + // setup message header + msg->newMessageFast(_PREHASH_AvatarNotesUpdate); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUID(_PREHASH_AgentID, gAgent.getID()); + msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlockFast(_PREHASH_Data); + msg->addUUID(_PREHASH_TargetID, avatar_id); + msg->addString(_PREHASH_Notes, notes); + + gAgent.sendReliableMessage(); + } +} + + +void LLAvatarPropertiesProcessor::sendPickDelete( const LLUUID& pick_id ) +{ + LLMessageSystem* msg = gMessageSystem; + msg->newMessage(_PREHASH_PickDelete); + msg->nextBlock(_PREHASH_AgentData); + msg->addUUID(_PREHASH_AgentID, gAgent.getID()); + msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlock(_PREHASH_Data); + msg->addUUID(_PREHASH_PickID, pick_id); + gAgent.sendReliableMessage(); +} + +void LLAvatarPropertiesProcessor::sendPicInfoUpdate(const void* pick_data) +{ + if (!pick_data) return; + const LLPickData *new_pick = static_cast<const LLPickData*>(pick_data); + if (!new_pick) return; + + LLMessageSystem* msg = gMessageSystem; + + msg->newMessage(_PREHASH_PickInfoUpdate); + msg->nextBlock(_PREHASH_AgentData); + msg->addUUID(_PREHASH_AgentID, gAgent.getID()); + msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlock(_PREHASH_Data); + msg->addUUID(_PREHASH_PickID, new_pick->pick_id); + msg->addUUID(_PREHASH_CreatorID, new_pick->creator_id); + + //legacy var need to be deleted + msg->addBOOL(_PREHASH_TopPick, FALSE); + + // fills in on simulator if null + msg->addUUID(_PREHASH_ParcelID, new_pick->parcel_id); + msg->addString(_PREHASH_Name, new_pick->name); + msg->addString(_PREHASH_Desc, new_pick->desc); + msg->addUUID(_PREHASH_SnapshotID, new_pick->snapshot_id); + msg->addVector3d(_PREHASH_PosGlobal, new_pick->pos_global); + + // Only top picks have a sort order + msg->addS32(_PREHASH_SortOrder, 0); + + msg->addBOOL(_PREHASH_Enabled, new_pick->enabled); + gAgent.sendReliableMessage(); +} + +void LLAvatarPropertiesProcessor::sendPickInfoRequest(const LLUUID& creator_id, const LLUUID& pick_id) +{ + // Must ask for a pick based on the creator id because + // the pick database is distributed to the inventory cluster. JC + std::vector<std::string> request_params; + request_params.push_back(creator_id.asString() ); + request_params.push_back(pick_id.asString() ); + send_generic_message("pickinforequest", request_params); +} diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h new file mode 100644 index 0000000000000000000000000000000000000000..4d50541d9a6da4ec74bcdb442f3b196f6a26af18 --- /dev/null +++ b/indra/newview/llavatarpropertiesprocessor.h @@ -0,0 +1,206 @@ +/** + * @file llavatarpropertiesprocessor.h + * @brief LLAvatatIconCtrl base class + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLAVATARPROPERTIESPROCESSOR_H +#define LL_LLAVATARPROPERTIESPROCESSOR_H + +#include "lluuid.h" +#include <map> + +/* +*TODO Vadim: This needs some refactoring: +- Remove EAvatarProcessorType in favor of separate observers, derived from a common parent (to get rid of void*). +*/ + +/* +*TODO: mantipov: get rid of sendDataRequest and sendDataUpdate methods. Use exact methods instead of. +*/ + +class LLMessageSystem; + +enum EAvatarProcessorType +{ + APT_PROPERTIES, + APT_NOTES, + APT_GROUPS, + APT_PICKS, + APT_PICK_INFO +}; + +struct LLAvatarData +{ + LLUUID agent_id; + LLUUID avatar_id; //target id + LLUUID image_id; + LLUUID fl_image_id; + LLUUID partner_id; + std::string about_text; + std::string fl_about_text; + std::string born_on; + std::string profile_url; + U8 caption_index; + std::string caption_text; + U32 flags; + BOOL allow_publish; +}; + +struct LLAvatarPicks +{ + LLUUID agent_id; + LLUUID target_id; //target id + + typedef std::pair<LLUUID,std::string> pick_data_t; + typedef std::list< pick_data_t> picks_list_t; + picks_list_t picks_list; +}; + +struct LLPickData +{ + LLUUID agent_id; + LLUUID pick_id; + LLUUID creator_id; + BOOL top_pick; + LLUUID parcel_id; + std::string name; + std::string desc; + LLUUID snapshot_id; + LLVector3d pos_global; + S32 sort_order; + BOOL enabled; + + //used only in read requests + std::string location_text; + std::string original_name; + std::string sim_name; + + //used only in write (update) requests + LLUUID session_id; + +}; + +struct LLAvatarNotes +{ + LLUUID agent_id; + LLUUID target_id; //target id + std::string notes; +}; + +struct LLAvatarGroups +{ + LLUUID agent_id; + LLUUID avatar_id; //target id + BOOL list_in_profile; + + struct LLGroupData; + typedef std::list<LLGroupData> group_list_t; + + group_list_t group_list; + + struct LLGroupData + { + U64 group_powers; + BOOL accept_notices; + std::string group_title; + LLUUID group_id; + std::string group_name; + LLUUID group_insignia_id; + }; +}; + +class LLAvatarPropertiesObserver +{ +public: + virtual ~LLAvatarPropertiesObserver() {} + virtual void processProperties(void* data, EAvatarProcessorType type) = 0; +}; + +class LLAvatarPropertiesProcessor + : public LLSingleton<LLAvatarPropertiesProcessor> +{ +public: + + LLAvatarPropertiesProcessor(); + virtual ~LLAvatarPropertiesProcessor() + {} + + void addObserver(const LLUUID& avatar_id, LLAvatarPropertiesObserver* observer); + + void removeObserver(const LLUUID& avatar_id, LLAvatarPropertiesObserver* observer); + + void sendDataRequest(const LLUUID& avatar_id, EAvatarProcessorType type, const void * data = NULL); + + void sendDataUpdate(const void* data, EAvatarProcessorType type); + + void sendFriendRights(const LLUUID& avatar_id, S32 rights); + + void sendNotes(const LLUUID& avatar_id, const std::string notes); + + void sendPickDelete(const LLUUID& pick_id); + + static void processAvatarPropertiesReply(LLMessageSystem* msg, void**); + + static void processAvatarInterestsReply(LLMessageSystem* msg, void**); + + static void processAvatarClassifiedReply(LLMessageSystem* msg, void**); + + static void processAvatarGroupsReply(LLMessageSystem* msg, void**); + + static void processAvatarNotesReply(LLMessageSystem* msg, void**); + + static void processAvatarPicksReply(LLMessageSystem* msg, void**); + + static void processPickInfoReply(LLMessageSystem* msg, void**); +protected: + + void sendAvatarPropertiesRequest(const LLUUID& avatar_id); + + void sendGenericRequest(const LLUUID& avatar_id, const std::string method); + + void sendAvatarPropertiesUpdate(const void* data); + + void sendPickInfoRequest(const LLUUID& creator_id, const LLUUID& pick_id); + + void sendPicInfoUpdate(const void * pick_data); + + static void notifyObservers(const LLUUID& id,void* data, EAvatarProcessorType type); + + typedef void* (*processor_method_t)(LLMessageSystem*); + static processor_method_t getProcessor(EAvatarProcessorType type); + +protected: + + typedef std::multimap<LLUUID, LLAvatarPropertiesObserver*> observer_multimap_t; + + observer_multimap_t mObservers; +}; + +#endif // LL_LLAVATARPROPERTIESPROCESSOR_H diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f33dd2a32a9898ea968261dcd15ee0725bb1d5f2 --- /dev/null +++ b/indra/newview/llbottomtray.cpp @@ -0,0 +1,343 @@ +/** +* @file llbottomtray.cpp +* @brief LLBottomTray class implementation +* +* $LicenseInfo:firstyear=2009&license=viewergpl$ +* +* Copyright (c) 2009, Linden Research, Inc. +* +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at +* http://secondlifegrid.net/programs/open_source/licensing/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" // must be first include +#include "llbottomtray.h" +#include "llagent.h" +#include "llchiclet.h" +#include "lllayoutstack.h" +#include "llkeyboard.h" +#include "llgesturemgr.h" +#include "llanimationstates.h" + +//FIXME: temporary, for send_chat_from_viewer() proto +#include "llchatbar.h" + +LLBottomTray::LLBottomTray() + :mLastSpecialChatChannel(0) +{ + LLUICtrlFactory::getInstance()->buildPanel(this,"panel_bottomtray.xml"); + + mChicletPanel = getChild<LLChicletPanel>("chiclet_list",TRUE,FALSE); + + LLLineEditor* chat_box = getChatBox(); + chat_box->setCommitCallback(boost::bind(&LLBottomTray::onChatBoxCommit, this)); + chat_box->setKeystrokeCallback(&onChatBoxKeystroke, this); + chat_box->setFocusLostCallback(&onChatBoxFocusLost, this); + + LLIMMgr::getInstance()->addSessionObserver(this); +} + +LLBottomTray::~LLBottomTray() +{ + LLIMMgr::getInstance()->removeSessionObserver(this); +} + +LLLineEditor* LLBottomTray::getChatBox() +{ + return getChild<LLLineEditor>("chat_box",TRUE,FALSE); +} + +void LLBottomTray::onChatBoxCommit() +{ + if (getChatBox()->getText().length() > 0) + { + sendChat(CHAT_TYPE_NORMAL); + + LLLineEditor* chat_box = getChatBox(); + + if (chat_box) + { + chat_box->setText(LLStringExplicit("")); + } + + gAgent.stopTyping(); + } +} + +void LLBottomTray::sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate) +{ + sendChatFromViewer(utf8str_to_wstring(utf8text), type, animate); +} + +void LLBottomTray::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate) +{ + // Look for "/20 foo" channel chats. + S32 channel = 0; + LLWString out_text = stripChannelNumber(wtext, &channel); + std::string utf8_out_text = wstring_to_utf8str(out_text); + std::string utf8_text = wstring_to_utf8str(wtext); + + utf8_text = utf8str_trim(utf8_text); + if (!utf8_text.empty()) + { + utf8_text = utf8str_truncate(utf8_text, MAX_STRING - 1); + } + + // Don't animate for chats people can't hear (chat to scripts) + if (animate && (channel == 0)) + { + if (type == CHAT_TYPE_WHISPER) + { + lldebugs << "You whisper " << utf8_text << llendl; + gAgent.sendAnimationRequest(ANIM_AGENT_WHISPER, ANIM_REQUEST_START); + } + else if (type == CHAT_TYPE_NORMAL) + { + lldebugs << "You say " << utf8_text << llendl; + gAgent.sendAnimationRequest(ANIM_AGENT_TALK, ANIM_REQUEST_START); + } + else if (type == CHAT_TYPE_SHOUT) + { + lldebugs << "You shout " << utf8_text << llendl; + gAgent.sendAnimationRequest(ANIM_AGENT_SHOUT, ANIM_REQUEST_START); + } + else + { + llinfos << "send_chat_from_viewer() - invalid volume" << llendl; + return; + } + } + else + { + if (type != CHAT_TYPE_START && type != CHAT_TYPE_STOP) + { + lldebugs << "Channel chat: " << utf8_text << llendl; + } + } + + send_chat_from_viewer(utf8_out_text, type, channel); +} + +// static +void LLBottomTray::onChatBoxKeystroke(LLLineEditor* caller, void* userdata) +{ + LLBottomTray* self = (LLBottomTray *)userdata; + + LLWString raw_text; + if (self->getChatBox()) raw_text = self->getChatBox()->getWText(); + + // Can't trim the end, because that will cause autocompletion + // to eat trailing spaces that might be part of a gesture. + LLWStringUtil::trimHead(raw_text); + + S32 length = raw_text.length(); + + if( (length > 0) && (raw_text[0] != '/') ) // forward slash is used for escape (eg. emote) sequences + { + gAgent.startTyping(); + } + else + { + gAgent.stopTyping(); + } + + /* Doesn't work -- can't tell the difference between a backspace + that killed the selection vs. backspace at the end of line. + if (length > 1 + && text[0] == '/' + && key == KEY_BACKSPACE) + { + // the selection will already be deleted, but we need to trim + // off the character before + std::string new_text = raw_text.substr(0, length-1); + self->mInputEditor->setText( new_text ); + self->mInputEditor->setCursorToEnd(); + length = length - 1; + } + */ + + KEY key = gKeyboard->currentKey(); + + // Ignore "special" keys, like backspace, arrows, etc. + if (length > 1 + && raw_text[0] == '/' + && key < KEY_SPECIAL) + { + // we're starting a gesture, attempt to autocomplete + + std::string utf8_trigger = wstring_to_utf8str(raw_text); + std::string utf8_out_str(utf8_trigger); + + if (gGestureManager.matchPrefix(utf8_trigger, &utf8_out_str)) + { + if (self->getChatBox()) + { + std::string rest_of_match = utf8_out_str.substr(utf8_trigger.size()); + self->getChatBox()->setText(utf8_trigger + rest_of_match); // keep original capitalization for user-entered part + S32 outlength = self->getChatBox()->getLength(); // in characters + + // Select to end of line, starting from the character + // after the last one the user typed. + self->getChatBox()->setSelection(length, outlength); + } + } + + //llinfos << "GESTUREDEBUG " << trigger + // << " len " << length + // << " outlen " << out_str.getLength() + // << llendl; + } +} + +// static +void LLBottomTray::onChatBoxFocusLost(LLFocusableElement* caller, void* userdata) +{ + // stop typing animation + gAgent.stopTyping(); +} + + +//virtual +void LLBottomTray::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) +{ + if(getChicletPanel()) + { + LLSD sid(session_id); + + if(getChicletPanel()->findIMChiclet(&sid)) + { + + } + else + { + LLIMChiclet* chicklet = (LLIMChiclet *)getChicletPanel()->createChiclet(&sid); + chicklet->setIMSessionName(name); + chicklet->setOtherParticipantId(other_participant_id); + + getChicletPanel()->arrange(); + } + } +} + +//virtual +void LLBottomTray::sessionRemoved(const LLUUID& session_id) +{ + if(getChicletPanel()) + { + LLSD sid(session_id); + getChicletPanel()->removeIMChiclet(&sid); + getChicletPanel()->arrange(); + } +} + +void LLBottomTray::sendChat( EChatType type ) +{ + LLLineEditor* chat_box = getChatBox(); + + if (chat_box) + { + LLWString text = chat_box->getConvertedText(); + if (!text.empty()) + { + // store sent line in history, duplicates will get filtered + chat_box->updateHistory(); + // Check if this is destined for another channel + S32 channel = 0; + stripChannelNumber(text, &channel); + + std::string utf8text = wstring_to_utf8str(text); + // Try to trigger a gesture, if not chat to a script. + std::string utf8_revised_text; + if (0 == channel) + { + // discard returned "found" boolean + gGestureManager.triggerAndReviseString(utf8text, &utf8_revised_text); + } + else + { + utf8_revised_text = utf8text; + } + + utf8_revised_text = utf8str_trim(utf8_revised_text); + + if (!utf8_revised_text.empty()) + { + // Chat with animation + sendChatFromViewer(utf8_revised_text, type, TRUE); + } + } + } + + gAgent.stopTyping(); +} + +// If input of the form "/20foo" or "/20 foo", returns "foo" and channel 20. +// Otherwise returns input and channel 0. +LLWString LLBottomTray::stripChannelNumber(const LLWString &mesg, S32* channel) +{ + if (mesg[0] == '/' + && mesg[1] == '/') + { + // This is a "repeat channel send" + *channel = mLastSpecialChatChannel; + return mesg.substr(2, mesg.length() - 2); + } + else if (mesg[0] == '/' + && mesg[1] + && LLStringOps::isDigit(mesg[1])) + { + // This a special "/20" speak on a channel + S32 pos = 0; + + // Copy the channel number into a string + LLWString channel_string; + llwchar c; + do + { + c = mesg[pos+1]; + channel_string.push_back(c); + pos++; + } + while(c && pos < 64 && LLStringOps::isDigit(c)); + + // Move the pointer forward to the first non-whitespace char + // Check isspace before looping, so we can handle "/33foo" + // as well as "/33 foo" + while(c && iswspace(c)) + { + c = mesg[pos+1]; + pos++; + } + + mLastSpecialChatChannel = strtol(wstring_to_utf8str(channel_string).c_str(), NULL, 10); + *channel = mLastSpecialChatChannel; + return mesg.substr(pos, mesg.length() - pos); + } + else + { + // This is normal chat. + *channel = 0; + return mesg; + } +} + diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h new file mode 100644 index 0000000000000000000000000000000000000000..780e1b270de4adb5d34c50b8dde51fda5d9db530 --- /dev/null +++ b/indra/newview/llbottomtray.h @@ -0,0 +1,91 @@ +/** +* @file llbottomtray.h +* @brief LLBottomTray class header file +* +* $LicenseInfo:firstyear=2009&license=viewergpl$ +* +* Copyright (c) 2009, Linden Research, Inc. +* +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at +* http://secondlifegrid.net/programs/open_source/licensing/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ + +#ifndef LL_LLBOTTOMPANEL_H +#define LL_LLBOTTOMPANEL_H + +#include "llpanel.h" +#include "llflyoutbutton.h" +#include "llimview.h" +#include "llchat.h" + +class LLChicletPanel; +class LLNotificationChiclet; +class LLNotificationChiclet; +class LLTalkButton; + +class LLBottomTray + : public LLSingleton<LLBottomTray> + , public LLPanel + , public LLIMSessionObserver +{ +public: + LLBottomTray(); + + ~LLBottomTray(); + + LLLineEditor* getChatBox(); + + LLChicletPanel* getChicletPanel() {return mChicletPanel;}; + + LLNotificationChiclet* getIMWell() {return mIMWell;}; + + LLNotificationChiclet* getNotificationWell(){return mNotificationWell;}; + + void onChatBoxCommit(); + void sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate); + void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate); + static void onChatBoxKeystroke(LLLineEditor* caller, void* userdata); + static void onChatBoxFocusLost(LLFocusableElement* caller, void* userdata); + + // LLIMSessionObserver observe triggers + virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); + virtual void sessionRemoved(const LLUUID& session_id); + +protected: + + void sendChat( EChatType type ); + LLWString stripChannelNumber(const LLWString &mesg, S32* channel); + + // Which non-zero channel did we last chat on? + S32 mLastSpecialChatChannel; + + LLChicletPanel* mChicletPanel; + LLNotificationChiclet* mIMWell; + LLNotificationChiclet* mNotificationWell; + LLTalkButton* mTalkBtn; +}; + +extern LLBottomTray* gBottomTray; +extern S32 BOTTOM_TRAY_HEIGHT; + +#endif // LL_LLBOTTOMPANEL_H diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index db28c7ad38bebdbf1c4cfb4bf27bc6b8ce9ab27e..1844934e6a7dc7a896abb22de64b4e54544a3563 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -684,7 +684,7 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) { std::string notifyMsg = notification->getMessage(); if (!notifyMsg.empty()) - floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor")); + floater->addHistoryLine(notifyMsg,gSavedSkinSettings.getColor4("SystemChatColor")); } } diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 2395f3c5ae4bd1605d737fc3143794e60ce07731..5e97157694043aedf9222a7a89b81765a3719ef7 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -67,7 +67,7 @@ #include "llui.h" #include "llviewermenu.h" #include "lluictrlfactory.h" - +#include "llbottomtray.h" // // Globals @@ -76,11 +76,6 @@ const F32 AGENT_TYPING_TIMEOUT = 5.f; // seconds LLChatBar *gChatBar = NULL; -// legacy calllback glue -void toggleChatHistory(void* user_data); -void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); - - class LLChatBarGestureObserver : public LLGestureManagerObserver { public: @@ -97,7 +92,7 @@ private: // LLChatBar::LLChatBar() -: LLPanel(LLStringUtil::null, LLRect(), BORDER_NO), +: LLPanel(), mInputEditor(NULL), mGestureLabelTimer(), mLastSpecialChatChannel(0), @@ -107,7 +102,7 @@ LLChatBar::LLChatBar() { setIsChrome(TRUE); - #if !LL_RELEASE_FOR_DOWNLOAD +#if !LL_RELEASE_FOR_DOWNLOAD childDisplayNotFound(); #endif } @@ -123,34 +118,23 @@ LLChatBar::~LLChatBar() BOOL LLChatBar::postBuild() { - childSetAction("History", toggleChatHistory, this); - childSetCommitCallback("Say", onClickSay, this); + getChild<LLUICtrl>("Say")->setCommitCallback(boost::bind(&LLChatBar::onClickSay, this, _1)); // attempt to bind to an existing combo box named gesture - setGestureCombo(getChild<LLComboBox>( "Gesture")); - - LLButton * sayp = getChild<LLButton>("Say"); - if(sayp) - { - setDefaultBtn(sayp); - } + setGestureCombo(getChild<LLComboBox>( "Gesture", TRUE, FALSE)); mInputEditor = getChild<LLLineEditor>("Chat Editor"); - if (mInputEditor) - { - mInputEditor->setCallbackUserData(this); - mInputEditor->setKeystrokeCallback(&onInputEditorKeystroke); - mInputEditor->setFocusLostCallback(&onInputEditorFocusLost, this); - mInputEditor->setFocusReceivedCallback( &onInputEditorGainFocus, this ); - mInputEditor->setCommitOnFocusLost( FALSE ); - mInputEditor->setRevertOnEsc( FALSE ); - mInputEditor->setIgnoreTab(TRUE); - mInputEditor->setPassDelete(TRUE); - mInputEditor->setReplaceNewlinesWithSpaces(FALSE); - - mInputEditor->setMaxTextLength(1023); - mInputEditor->setEnableLineHistory(TRUE); - } + mInputEditor->setKeystrokeCallback(&onInputEditorKeystroke, this); + mInputEditor->setFocusLostCallback(&onInputEditorFocusLost, this); + mInputEditor->setFocusReceivedCallback( &onInputEditorGainFocus, this ); + mInputEditor->setCommitOnFocusLost( FALSE ); + mInputEditor->setRevertOnEsc( FALSE ); + mInputEditor->setIgnoreTab(TRUE); + mInputEditor->setPassDelete(TRUE); + mInputEditor->setReplaceNewlinesWithSpaces(FALSE); + + mInputEditor->setMaxTextLength(1023); + mInputEditor->setEnableLineHistory(TRUE); mIsBuilt = TRUE; @@ -209,10 +193,7 @@ void LLChatBar::refresh() gAgent.stopTyping(); } - childSetValue("History", LLFloaterChat::instanceVisible(LLSD())); - childSetEnabled("Say", mInputEditor->getText().size() > 0); - childSetEnabled("Shout", mInputEditor->getText().size() > 0); } @@ -311,8 +292,7 @@ void LLChatBar::setGestureCombo(LLComboBox* combo) mGestureCombo = combo; if (mGestureCombo) { - mGestureCombo->setCommitCallback(onCommitGesture); - mGestureCombo->setCallbackUserData(this); + mGestureCombo->setCommitCallback(boost::bind(&LLChatBar::onCommitGesture, this, _1)); // now register observer since we have a place to put the results mObserver = new LLChatBarGestureObserver(this); @@ -434,17 +414,25 @@ void LLChatBar::sendChat( EChatType type ) // static void LLChatBar::startChat(const char* line) { - gChatBar->setVisible(TRUE); - gChatBar->setKeyboardFocus(TRUE); - gSavedSettings.setBOOL("ChatVisible", TRUE); - - if (line && gChatBar->mInputEditor) + //TODO* remove DUMMY chat + if(LLBottomTray::getInstance()->getChatBox()) { - std::string line_string(line); - gChatBar->mInputEditor->setText(line_string); + LLBottomTray::getInstance()->getChatBox()->setFocus(TRUE); } - // always move cursor to end so users don't obliterate chat when accidentally hitting WASD - gChatBar->mInputEditor->setCursorToEnd(); + + // *TODO Vadim: Why was this code commented out? + +// gChatBar->setVisible(TRUE); +// gChatBar->setKeyboardFocus(TRUE); +// gSavedSettings.setBOOL("ChatVisible", TRUE); +// +// if (line && gChatBar->mInputEditor) +// { +// std::string line_string(line); +// gChatBar->mInputEditor->setText(line_string); +// } +// // always move cursor to end so users don't obliterate chat when accidentally hitting WASD +// gChatBar->mInputEditor->setCursorToEnd(); } @@ -452,21 +440,29 @@ void LLChatBar::startChat(const char* line) // static void LLChatBar::stopChat() { - // In simple UI mode, we never release focus from the chat bar - gChatBar->setKeyboardFocus(FALSE); - - // If we typed a movement key and pressed return during the - // same frame, the keyboard handlers will see the key as having - // gone down this frame and try to move the avatar. - gKeyboard->resetKeys(); - gKeyboard->resetMaskKeys(); - - // stop typing animation - gAgent.stopTyping(); + //TODO* remove DUMMY chat + if(LLBottomTray::getInstance()->getChatBox()) + { + LLBottomTray::getInstance()->getChatBox()->setFocus(FALSE); + } - // hide chat bar so it doesn't grab focus back - gChatBar->setVisible(FALSE); - gSavedSettings.setBOOL("ChatVisible", FALSE); + // *TODO Vadim: Why was this code commented out? + +// // In simple UI mode, we never release focus from the chat bar +// gChatBar->setKeyboardFocus(FALSE); +// +// // If we typed a movement key and pressed return during the +// // same frame, the keyboard handlers will see the key as having +// // gone down this frame and try to move the avatar. +// gKeyboard->resetKeys(); +// gKeyboard->resetMaskKeys(); +// +// // stop typing animation +// gAgent.stopTyping(); +// +// // hide chat bar so it doesn't grab focus back +// gChatBar->setVisible(FALSE); +// gSavedSettings.setBOOL("ChatVisible", FALSE); } // static @@ -553,20 +549,19 @@ void LLChatBar::onInputEditorGainFocus( LLFocusableElement* caller, void* userda LLFloaterChat::setHistoryCursorAndScrollToEnd(); } -// static -void LLChatBar::onClickSay( LLUICtrl* ctrl, void* userdata ) +void LLChatBar::onClickSay( LLUICtrl* ctrl ) { + std::string cmd = ctrl->getValue().asString(); e_chat_type chat_type = CHAT_TYPE_NORMAL; - if (ctrl->getValue().asString() == "shout") + if (cmd == "shout") { chat_type = CHAT_TYPE_SHOUT; } - else if (ctrl->getValue().asString() == "whisper") + else if (cmd == "whisper") { chat_type = CHAT_TYPE_WHISPER; } - LLChatBar* self = (LLChatBar*) userdata; - self->sendChat(chat_type); + sendChat(chat_type); } void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate) @@ -641,11 +636,9 @@ void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 } -// static -void LLChatBar::onCommitGesture(LLUICtrl* ctrl, void* data) +void LLChatBar::onCommitGesture(LLUICtrl* ctrl) { - LLChatBar* self = (LLChatBar*)data; - LLCtrlListInterface* gestures = self->mGestureCombo ? self->mGestureCombo->getListInterface() : NULL; + LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL; if (gestures) { S32 index = gestures->getFirstSelectedIndex(); @@ -665,23 +658,17 @@ void LLChatBar::onCommitGesture(LLUICtrl* ctrl, void* data) if (!revised_text.empty()) { // Don't play nodding animation - self->sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, FALSE); + sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, FALSE); } } - self->mGestureLabelTimer.start(); - if (self->mGestureCombo != NULL) + mGestureLabelTimer.start(); + if (mGestureCombo != NULL) { // free focus back to chat bar - self->mGestureCombo->setFocus(FALSE); + mGestureCombo->setFocus(FALSE); } } -void toggleChatHistory(void* user_data) -{ - LLFloaterChat::toggleInstance(LLSD()); -} - - class LLChatHandler : public LLCommandHandler { public: diff --git a/indra/newview/llchatbar.h b/indra/newview/llchatbar.h index 56a98a78f95498d779c01ce014b46023442baebc..e0e324af6b95873e8aaa3ccfadfeefde5a6691d5 100644 --- a/indra/newview/llchatbar.h +++ b/indra/newview/llchatbar.h @@ -45,6 +45,9 @@ class LLFrameTimer; class LLChatBarGestureObserver; class LLComboBox; +// legacy calllback glue +void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); + class LLChatBar : public LLPanel { @@ -82,14 +85,14 @@ public: LLWString stripChannelNumber(const LLWString &mesg, S32* channel); // callbacks - static void onClickSay( LLUICtrl*, void* userdata ); + void onClickSay(LLUICtrl* ctrl); static void onTabClick( void* userdata ); static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata); static void onInputEditorFocusLost(LLFocusableElement* caller,void* userdata); static void onInputEditorGainFocus(LLFocusableElement* caller,void* userdata); - static void onCommitGesture(LLUICtrl* ctrl, void* data); + void onCommitGesture(LLUICtrl* ctrl); static void startChat(const char* line); static void stopChat(); diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1c72e9c5aca4a182283ed2b25d0b0eacd35ce6f9 --- /dev/null +++ b/indra/newview/llchiclet.cpp @@ -0,0 +1,725 @@ +/** +* @file llchiclet.cpp +* @brief LLChiclet class implementation +* +* $LicenseInfo:firstyear=2002&license=viewergpl$ +* +* Copyright (c) 2002-2009, Linden Research, Inc. +* +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at +* http://secondlifegrid.net/programs/open_source/licensing/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" // must be first include +#include "llchiclet.h" +#include "llfloaterreg.h" +#include "llvoiceclient.h" +#include "llagent.h" +#include "lltextbox.h" +#include "lliconctrl.h" +#include "llvoicecontrolpanel.h" +#include "lloutputmonitorctrl.h" +#include "llimview.h" +#include "llbottomtray.h" + +static const S32 CHICLET_HEIGHT = 25; +static const S32 CHICLET_SPACING = 0; +static const S32 CHICLET_PADDING = 3; +static const S32 AVATAR_WIDTH = 25; +static const S32 SPEAKER_WIDTH = 20; +static const S32 COUNTER_WIDTH = 20; +static const S32 SCROLL_BUTTON_WIDTH = 19; +static const S32 SCROLL_BUTTON_HEIGHT = 20; +static const S32 NOTIFICATION_TEXT_TOP_PAD = 5; + +static LLDefaultWidgetRegistry::Register<LLChicletPanel> t1("chiclet_panel"); +static LLDefaultWidgetRegistry::Register<LLTalkButton> t2("chiclet_talk"); +static LLDefaultWidgetRegistry::Register<LLNotificationChiclet> t3("chiclet_notification"); +static LLDefaultWidgetRegistry::Register<LLChicletPanel> t4("chiclet_panel"); + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +LLNotificationChiclet::Params::Params() +: image_unselected("image_unselected") +, image_selected("image_selected") +, image_overlay("image_overlay") +{ +} + +LLNotificationChiclet::LLNotificationChiclet(const Params& p) +: LLChiclet(p) +, mButton(NULL) +, mCounterText(NULL) +{ + LLRect rc(p.rect); + + LLButton::Params button_params; + button_params.name("btn"); + button_params.label(LLStringUtil::null); + button_params.rect(LLRect(0,rc.getHeight(),rc.getWidth(),0)); + button_params.image_overlay(p.image_overlay); + button_params.image_unselected(p.image_unselected); + button_params.image_selected(p.image_selected); + button_params.tab_stop(false); + mButton = LLUICtrlFactory::create<LLButton>(button_params); + addChild(mButton); + + LLTextBox::Params textbox_params; + textbox_params.name("txt"); + textbox_params.rect(LLRect(p.label_left,rc.getHeight(), + rc.getWidth()-p.label_left,0)); + textbox_params.mouse_opaque(false); + textbox_params.v_pad(NOTIFICATION_TEXT_TOP_PAD); + textbox_params.font.style("SansSerif"); + textbox_params.font_halign(LLFontGL::HCENTER); + mCounterText = LLUICtrlFactory::create<LLTextBox>(textbox_params); + addChild(mCounterText); + mCounterText->setColor(LLColor4::white); + mCounterText->setText(LLStringUtil::null); +} + +LLNotificationChiclet::~LLNotificationChiclet() +{ + +} + +LLChiclet* LLNotificationChiclet::create(const Params& p) +{ + LLChiclet* chiclet = new LLNotificationChiclet(p); + return chiclet; +} + +void LLNotificationChiclet::setCounter(S32 counter) +{ + std::stringstream stream; + mCounter = counter; + stream << mCounter; + mCounterText->setText(stream.str()); +} + +boost::signals::connection LLNotificationChiclet::setClickCallback( + const commit_callback_t& cb) +{ + return mButton->setClickedCallback(cb); +} + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +LLChiclet::LLChiclet(const Params& p) +: LLUICtrl(p) +, mCounter(0) +, mShowCounter(true) +{ + +} + +LLChiclet::~LLChiclet() +{ + +} + +boost::signals::connection LLChiclet::setLeftButtonClickCallback( + const commit_callback_t& cb) +{ + return mCommitSignal.connect(cb); +} + +BOOL LLChiclet::handleMouseDown(S32 x, S32 y, MASK mask) +{ + onCommit(); + childrenHandleMouseDown(x,y,mask); + return TRUE; +} + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +LLIMChiclet::LLIMChiclet(const LLChiclet::Params& p) +: LLChiclet(p) +, mAvatar(NULL) +, mCounterText(NULL) +, mSpeaker(NULL) +, mIMSessionId() +, mShowSpeaker(false) +, mSpeakerStatus(SPEAKER_IDLE) +{ + LLAvatarIconCtrl::Params avatar_params; + avatar_params.control_name("avatar"); + avatar_params.draw_tooltip = FALSE; + mAvatar = LLUICtrlFactory::create<LLAvatarIconCtrl>(avatar_params); + + addChild(mAvatar); + + LLTextBox::Params unread_params; + unread_params.font.style("SansSerif"); + unread_params.font_halign(LLFontGL::HCENTER); + unread_params.v_pad(5); + mCounterText = LLUICtrlFactory::create<LLTextBox>(unread_params); + addChild(mCounterText); + mCounterText->setColor(LLColor4::white); + setCounter(getCounter()); + + LLIconCtrl::Params speaker_params; + speaker_params.image( LLUI::getUIImage("icn_voice_ptt-on-lvl2.tga") ); + mSpeaker = LLUICtrlFactory::create<LLIconCtrl>(speaker_params); + addChild(mSpeaker); + mSpeaker->setVisible(getShowSpeaker()); + + S32 left = 0; + mAvatar->setRect(LLRect(left,CHICLET_HEIGHT,AVATAR_WIDTH,0)); + left += AVATAR_WIDTH + CHICLET_SPACING; + mCounterText->setRect(LLRect(left,CHICLET_HEIGHT,left + COUNTER_WIDTH,0)); + left += COUNTER_WIDTH + CHICLET_SPACING; + mSpeaker->setRect(LLRect(left,CHICLET_HEIGHT,left + SPEAKER_WIDTH,0)); +} + +LLIMChiclet::~LLIMChiclet() +{ + +} + +LLChiclet* LLIMChiclet::create(LLSD* imSessionId /* = NULL */) +{ + LLIMChiclet* chiclet = new LLIMChiclet(LLChiclet::Params()); + chiclet->setIMSessionId(imSessionId); + return chiclet; +} + +void LLIMChiclet::setCounter(S32 counter) +{ + mCounter = counter; + std::stringstream stream; + stream << mCounter; + mCounterText->setText(stream.str()); + + LLRect rc = mCounterText->getRect(); + rc.mRight = rc.mLeft + calcCounterWidth(); + mCounterText->setRect(rc); +} + +LLRect LLIMChiclet::getRequiredRect() +{ + LLRect rect(0,CHICLET_HEIGHT,AVATAR_WIDTH,0); + if(getShowCounter()) + { + rect.mRight += CHICLET_SPACING + calcCounterWidth(); + } + if(getShowSpeaker()) + { + rect.mRight += CHICLET_SPACING + SPEAKER_WIDTH; + } + return rect; +} + +void LLIMChiclet::setShowCounter(bool show) +{ + LLChiclet::setShowCounter(show); + mCounterText->setVisible(getShowCounter()); +} + +void LLIMChiclet::setIMSessionName(const std::string& name) +{ + setToolTip(name); +} + +void LLIMChiclet::setOtherParticipantId(const LLUUID& other_participant_id) +{ + if (mAvatar) + { + mAvatar->setValue(other_participant_id); + } +} + +void LLIMChiclet::setShowSpeaker(bool show) +{ + mShowSpeaker = show; + mSpeaker->setVisible(getShowSpeaker()); +} + +void LLIMChiclet::draw() +{ + LLUICtrl::draw(); + gl_rect_2d(1, getRect().getHeight(), getRect().getWidth(), 1, LLColor4(0.0f,0.0f,0.0f,1.f), FALSE); +} + +S32 LLIMChiclet::calcCounterWidth() +{ + S32 font_width = mCounterText->getFont()->getWidth("0"); + S32 text_size = mCounterText->getText().size(); + + return llmax(font_width * text_size, COUNTER_WIDTH); +} + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +LLChicletPanel::LLChicletPanel(const Params&p) +: LLPanel(p) +, mLeftScroll(NULL) +, mRightScroll(NULL) +, mFirstToShow(0) +{ + LLButton::Params params; + + params.name("scroll_left"); + params.label(LLStringUtil::null); + params.tab_stop(false); + params.image_selected(LLUI::getUIImage("scroll_left.tga")); + params.image_unselected(LLUI::getUIImage("scroll_left.tga")); + params.image_hover_selected(LLUI::getUIImage("scroll_left.tga")); + mLeftScroll = LLUICtrlFactory::create<LLButton>(params); + addChild(mLeftScroll); + mLeftScroll->setClickedCallback(boost::bind(&LLChicletPanel::onLeftScrollClick,this)); + mLeftScroll->setEnabled(false); + + params.name("scroll_right"); + params.image_selected(LLUI::getUIImage("scroll_right.tga")); + params.image_unselected(LLUI::getUIImage("scroll_right.tga")); + params.image_hover_selected(LLUI::getUIImage("scroll_right.tga")); + mRightScroll = LLUICtrlFactory::create<LLButton>(params); + addChild(mRightScroll); + mRightScroll->setClickedCallback(boost::bind(&LLChicletPanel::onRightScrollClick,this)); + mRightScroll->setEnabled(false); + + LLPanel::Params panel_params; + mScrollArea = LLUICtrlFactory::create<LLPanel>(panel_params,this); + addChild(mScrollArea); +} + +LLChicletPanel::~LLChicletPanel() +{ + +} + +LLChicletPanel* LLChicletPanel::create() +{ + LLChicletPanel* panel = new LLChicletPanel(LLChicletPanel::Params()); + return panel; +} + +BOOL LLChicletPanel::postBuild() +{ + LLPanel::postBuild(); + + return TRUE; +} + +LLChiclet* LLChicletPanel::createChiclet(LLSD* imSessionId, S32 pos) +{ + LLChiclet* chiclet = LLIMChiclet::create(imSessionId); + if(!chiclet) + { + assert(false); + return NULL; + } + + if(!addChiclet(chiclet, pos)) + { + assert(false); + return NULL; + } + + return chiclet; +} + +bool LLChicletPanel::addChiclet(LLChiclet* chiclet, S32 pos) +{ + if(mScrollArea->addChild(chiclet)) + { + mChicletList.insert(mChicletList.begin() + pos, chiclet); + + chiclet->setLeftButtonClickCallback(boost::bind(&LLChicletPanel::onChicletClick, this, _1, _2)); + + return true; + } + + return false; +} + +void LLChicletPanel::onChicletClick(LLUICtrl*ctrl,const LLSD¶m) +{ + LLIMChiclet* chiclet = dynamic_cast<LLIMChiclet*>(ctrl); + if (chiclet) + { + LLFloaterReg::showInstance("communicate", chiclet->getIMSessionId().asUUID()); + } + + mCommitSignal(ctrl,param); +} + +LLChiclet* LLChicletPanel::findIMChiclet(LLSD* imSessionId) +{ + chiclet_list_t::const_iterator it = mChicletList.begin(); + for( ; mChicletList.end() != it; ++it) + { + LLIMChiclet* chiclet = dynamic_cast<LLIMChiclet*>(*it); + if(!chiclet) + { + continue; + } + + if(chiclet->getIMSessionId().asUUID() == imSessionId->asUUID()) + { + return chiclet; + } + } + return NULL; +} + +LLChiclet* LLChicletPanel::getChiclet(S32 pos) +{ + return mChicletList.at(pos); +} + +void LLChicletPanel::removeChiclet(chiclet_list_t::iterator it) +{ + mScrollArea->removeChild(*it); + delete *it; + mChicletList.erase(it); + mLeftScroll->setEnabled(canScrollLeft()); + mRightScroll->setEnabled(canScrollRight()); +} + +void LLChicletPanel::removeChiclet(S32 pos) +{ + if(0 > pos || getChicletCount() >= pos) + { + return; + } + removeChiclet(mChicletList.begin() + pos); +} + +void LLChicletPanel::removeChiclet(LLChiclet*chiclet) +{ + chiclet_list_t::iterator it = mChicletList.begin(); + for( ; mChicletList.end() != it; ++it) + { + LLChiclet* temp = *it; + if(temp == chiclet) + { + removeChiclet(it); + return; + } + } +} + +void LLChicletPanel::removeIMChiclet(LLSD* imSessionId) +{ + chiclet_list_t::iterator it = mChicletList.begin(); + for( ; mChicletList.end() != it; ++it) + { + LLIMChiclet* chiclet = dynamic_cast<LLIMChiclet*>(*it); + if(!chiclet) + { + continue; + } + + if(chiclet->getIMSessionId().asUUID() == imSessionId->asUUID()) + { + removeChiclet(it); + return; + } + } +} + +void LLChicletPanel::removeAll() +{ + mScrollArea->deleteAllChildren(); + + mChicletList.erase(mChicletList.begin(), mChicletList.end()); + mLeftScroll->setEnabled(false); + mRightScroll->setEnabled(false); +} + +void LLChicletPanel::reshape(S32 width, S32 height, BOOL called_from_parent ) +{ + LLPanel::reshape(width,height,called_from_parent); + + mLeftScroll->setRect(LLRect(0,CHICLET_HEIGHT,SCROLL_BUTTON_WIDTH, + CHICLET_HEIGHT - SCROLL_BUTTON_HEIGHT)); + mRightScroll->setRect(LLRect(getRect().getWidth()-SCROLL_BUTTON_WIDTH,CHICLET_HEIGHT, + getRect().getWidth(),CHICLET_HEIGHT - SCROLL_BUTTON_HEIGHT)); + + mScrollArea->setRect(LLRect(SCROLL_BUTTON_WIDTH + 5,CHICLET_HEIGHT + 1, + getRect().getWidth() - SCROLL_BUTTON_WIDTH - 5, 0)); + + + arrange(); +} + +void LLChicletPanel::arrange() +{ + S32 left = 0; + S32 size = getChicletCount(); + + for( int n = mFirstToShow; n < size; ++n) + { + LLChiclet* chiclet = getChiclet(n); + S32 chiclet_width = chiclet->getRequiredRect().getWidth(); + LLRect rc(left, CHICLET_HEIGHT, left + chiclet_width, 0); + + chiclet->setRect(rc); + chiclet->reshape(rc.getWidth(),rc.getHeight()); + + left += chiclet_width + CHICLET_PADDING; + } + + mLeftScroll->setEnabled(canScrollLeft()); + mRightScroll->setEnabled(canScrollRight()); +} + +void LLChicletPanel::draw() +{ + //gl_rect_2d(0,getRect().getHeight(),getRect().getWidth(),0,LLColor4(0.f,1.f,1.f,1.f),TRUE); + + child_list_const_iter_t it = getChildList()->begin(); + for( ; getChildList()->end() != it; ++it) + { + LLView* child = *it; + if(child == dynamic_cast<LLView*>(mScrollArea)) + { + LLLocalClipRect clip(mScrollArea->getRect()); + drawChild(mScrollArea); + } + else + { + drawChild(child); + } + } +} + +bool LLChicletPanel::canScrollRight() +{ + S32 width = 0; + LLRect visible_rect = mScrollArea->getRect(); + + chiclet_list_t::const_iterator it = mChicletList.begin() + mFirstToShow; + for(;mChicletList.end() != it; ++it) + { + LLChiclet* chiclet = *it; + width += chiclet->getRect().getWidth() + CHICLET_PADDING; + if(width > visible_rect.getWidth()) + return true; + } + return false; +} + +bool LLChicletPanel::canScrollLeft() +{ + return mFirstToShow > 0; +} + +void LLChicletPanel::scroll(ScrollDirection direction) +{ + S32 elem = 0; + if(SCROLL_LEFT == direction) + elem = mFirstToShow; + else if(SCROLL_RIGHT) + elem = mFirstToShow - 1; + + S32 offset = mChicletList[elem]->getRect().getWidth() + + CHICLET_PADDING; + offset *= direction; + + chiclet_list_t::const_iterator it = mChicletList.begin(); + for(;mChicletList.end() != it; ++it) + { + LLChiclet* chiclet = *it; + chiclet->translate(offset,0); + } +} + +void LLChicletPanel::scrollLeft() +{ + if(canScrollLeft()) + { + --mFirstToShow; + scroll(SCROLL_LEFT); + mLeftScroll->setEnabled(canScrollLeft()); + mRightScroll->setEnabled(canScrollRight()); + } +} + +void LLChicletPanel::scrollRight() +{ + if(canScrollRight()) + { + ++mFirstToShow; + scroll(SCROLL_RIGHT); + mLeftScroll->setEnabled(canScrollLeft()); + mRightScroll->setEnabled(canScrollRight()); + } +} + +void LLChicletPanel::onLeftScrollClick() +{ + scrollLeft(); +} + +void LLChicletPanel::onRightScrollClick() +{ + scrollRight(); +} + +boost::signals::connection LLChicletPanel::setChicletClickCallback( + const commit_callback_t& cb) +{ + return mCommitSignal.connect(cb); +} + +BOOL LLChicletPanel::handleScrollWheel(S32 x, S32 y, S32 clicks) +{ + if(clicks > 0) + { + scrollRight(); + } + else + { + scrollLeft(); + } + return TRUE; +} + +LLTalkButton::LLTalkButton(const LLUICtrl::Params& p) +: LLUICtrl(p) +{ + static S32 DROPDOWN_BTN_WIDTH = 20; + + LLRect rc(p.rect); + + LLButton::Params speak_params; + speak_params.name("left"); + speak_params.rect(LLRect(0,rc.getHeight(),rc.getWidth()-DROPDOWN_BTN_WIDTH,0)); + speak_params.label("Speak"); + speak_params.label_selected("Speak"); + speak_params.font(LLFontGL::getFontSansSerifSmall()); + speak_params.label_color(LLColor4::black); + speak_params.label_color_selected(LLColor4::black); + speak_params.tab_stop(false); + speak_params.is_toggle(true); + speak_params.picture_style(true); + speak_params.image_selected(LLUI::getUIImage("flyout_btn_left_selected.tga")); + speak_params.image_unselected(LLUI::getUIImage("flyout_btn_left.tga")); + mSpeakBtn = LLUICtrlFactory::create<LLButton>(speak_params); + addChild(mSpeakBtn); + + mSpeakBtn->setClickedCallback(boost::bind(&LLTalkButton::onClick_SpeakBtn, this)); + mSpeakBtn->setToggleState(false); + + LLButton::Params show_params; + show_params.name("right"); + show_params.rect(LLRect(rc.getWidth()-DROPDOWN_BTN_WIDTH,rc.getHeight(),rc.getWidth(),0)); + show_params.label(""); + show_params.tab_stop(false); + show_params.is_toggle(true); + show_params.picture_style(true); + show_params.image_selected(LLUI::getUIImage("show_btn_selected.tga")); + show_params.image_unselected(LLUI::getUIImage("show_btn.tga")); + mShowBtn = LLUICtrlFactory::create<LLButton>(show_params); + addChild(mShowBtn); + + mShowBtn->setClickedCallback(boost::bind(&LLTalkButton::onClick_ShowBtn, this)); + mShowBtn->setToggleState(false); + + mSpeakBtn->setToggleState(FALSE); + mShowBtn->setToggleState(FALSE); + + rc = mSpeakBtn->getRect(); + + LLOutputMonitorCtrl::Params monitor_param; + monitor_param.name("monitor"); + monitor_param.draw_border(false); + monitor_param.rect(LLRect(rc.getWidth()-20,18,rc.getWidth()-3,2)); + monitor_param.visible(true); + mOutputMonitor = LLUICtrlFactory::create<LLOutputMonitorCtrl>(monitor_param); + + mSpeakBtn->addChild(mOutputMonitor); + + mPrivateCallPanel = NULL; +} + +LLTalkButton::~LLTalkButton() +{ +} + +void LLTalkButton::draw() +{ + if(mSpeakBtn->getToggleState()) + { + mOutputMonitor->setPower(gVoiceClient->getCurrentPower(gAgent.getID())); + } + + LLUICtrl::draw(); +} + +void LLTalkButton::onClick_SpeakBtn() +{ + bool speaking = mSpeakBtn->getToggleState(); + gVoiceClient->setUserPTTState(speaking); + mOutputMonitor->setIsMuted(!speaking); +} + +void LLTalkButton::onClick_ShowBtn() +{ + if(!mShowBtn->getToggleState()) + { + mPrivateCallPanel->onClickClose(mPrivateCallPanel); + delete mPrivateCallPanel; + mPrivateCallPanel = NULL; + mShowBtn->setToggleState(FALSE); + return; + } + + S32 x = mSpeakBtn->getRect().mLeft; + S32 y = 0; + + localPointToScreen(x, y, &x, &y); + + mPrivateCallPanel = new LLVoiceControlPanel; + getRootView()->addChild(mPrivateCallPanel); + + y = LLBottomTray::getInstance()->getRect().getHeight() + + mPrivateCallPanel->getRect().getHeight(); + + LLRect rect; + rect.setLeftTopAndSize(x, y, mPrivateCallPanel->getRect().getWidth(), mPrivateCallPanel->getRect().getHeight()); + mPrivateCallPanel->setRect(rect); + + LLAvatarListItem::Params p; + p.buttons.status = true; + p.buttons.info = true; + p.buttons.profile = false; + p.buttons.locator = true; + + mPrivateCallPanel->addItem(new LLAvatarListItem(p)); + mPrivateCallPanel->setVisible(TRUE); + mPrivateCallPanel->setFrontmost(TRUE); + + mShowBtn->setToggleState(TRUE); +} diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h new file mode 100644 index 0000000000000000000000000000000000000000..f2b859a090cb63cc0b71820c02ebf207729610de --- /dev/null +++ b/indra/newview/llchiclet.h @@ -0,0 +1,286 @@ +/** +* @file llchiclet.h +* @brief LLChiclet class header file +* +* $LicenseInfo:firstyear=2002&license=viewergpl$ +* +* Copyright (c) 2002-2009, Linden Research, Inc. +* +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at +* http://secondlifegrid.net/programs/open_source/licensing/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ + +#ifndef LL_LLCHICLET_H +#define LL_LLCHICLET_H + +#include "llpanel.h" + +class LLTextBox; +class LLIconCtrl; +class LLAvatarIconCtrl; +class LLVoiceControlPanel; +class LLOutputMonitorCtrl; + +class LLChiclet : public LLUICtrl +{ +public: + + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Params(){}; + }; + + virtual ~LLChiclet(); + + virtual void setCounter(S32 counter) = 0; + + virtual S32 getCounter() = 0; + + virtual void setShowCounter(bool show) {mShowCounter = show;}; + + virtual bool getShowCounter() {return mShowCounter;}; + + virtual boost::signals::connection setLeftButtonClickCallback( + const commit_callback_t& cb); + +protected: + + friend class LLUICtrlFactory; + LLChiclet(const Params& p); + + virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + +protected: + S32 mCounter; + bool mShowCounter; +}; + +class LLIMChiclet : public LLChiclet +{ +public: + static LLChiclet* create(LLSD* imSessionId = NULL); + + void setCounter(S32); + + S32 getCounter() {return mCounter;}; + + const LLSD& getIMSessionId() const {return mIMSessionId;}; + + void setIMSessionId(LLSD* imSessionId) {if (imSessionId) mIMSessionId = *imSessionId;}; + void setIMSessionName(const std::string& name); + void setOtherParticipantId(const LLUUID& other_participant_id); + + void setShowSpeaker(bool show); + + bool getShowSpeaker() {return mShowSpeaker;}; + + enum SpeakerStatus + { + SPREAKER_ACTIVE, + SPEAKER_IDLE + }; + + void setSpeakerStatus(SpeakerStatus status); + + SpeakerStatus getSpeakerStatus() {return mSpeakerStatus;}; + + ~LLIMChiclet(); + +protected: + LLIMChiclet(const LLChiclet::Params& p); + friend class LLUICtrlFactory; + + S32 calcCounterWidth(); + + //overrides +public: + + void setShowCounter(bool show); + + void draw(); + + LLRect getRequiredRect(); + +protected: + LLAvatarIconCtrl* mAvatar; + LLTextBox* mCounterText; + LLIconCtrl* mSpeaker; + + LLSD mIMSessionId; + bool mShowSpeaker; + SpeakerStatus mSpeakerStatus; +}; + +class LLNotificationChiclet : public LLChiclet +{ +public: + + struct Params : public LLInitParam::Block<Params, LLChiclet::Params> + { + Optional<LLUIImage*> + image_unselected, + image_selected, + image_hover_selected, + image_hover_unselected, + image_disabled_selected, + image_disabled, + image_overlay; + + Optional<S32> + label_left; + + Params(); + }; + + static LLChiclet* create(const Params& p); + + void setCounter(S32 counter); + + S32 getCounter() {return mCounter;}; + + boost::signals::connection setClickCallback(const commit_callback_t& cb); + + virtual ~ LLNotificationChiclet(); + +protected: + LLNotificationChiclet(const Params& p); + friend class LLUICtrlFactory; + +protected: + LLButton* mButton; + LLTextBox* mCounterText; +}; + +class LLChicletPanel : public LLPanel +{ +public: + + struct Params : public LLInitParam::Block<Params, LLPanel::Params> + { + Params(){}; + }; + + static LLChicletPanel* create(); + + LLChiclet* createChiclet(LLSD* imSessionId = NULL, S32 pos = 0); + + bool addChiclet(LLChiclet*, S32 pos); + + LLChiclet* getChiclet(S32 pos); + + LLChiclet* findIMChiclet(LLSD* imSessionId); + + S32 getChicletCount() {return mChicletList.size();}; + + void removeChiclet(S32 pos); + + void removeChiclet(LLChiclet*); + + void removeIMChiclet(LLSD* imSessionId); + + void removeAll(); + + void arrange(); + + ~LLChicletPanel(); + + void scrollLeft(); + + void scrollRight(); + + void onLeftScrollClick(); + + void onRightScrollClick(); + + boost::signals::connection setChicletClickCallback( + const commit_callback_t& cb); + + void onChicletClick(LLUICtrl*ctrl,const LLSD¶m); + + //overrides +public: + + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE ); + + void draw(); + + BOOL postBuild(); + +protected: + LLChicletPanel(const Params&p); + friend class LLUICtrlFactory; + + bool needsScrolling(); + + bool canScrollRight(); + + bool canScrollLeft(); + + enum ScrollDirection + { + SCROLL_LEFT = 1, + SCROLL_RIGHT = -1 + }; + + void scroll(ScrollDirection direction); + + typedef std::vector<LLChiclet*> chiclet_list_t; + + void removeChiclet(chiclet_list_t::iterator it); + + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + +protected: + + chiclet_list_t mChicletList; + LLButton* mLeftScroll; + LLButton* mRightScroll; + S32 mFirstToShow; + S32 mLastToShow; + LLPanel* mScrollArea; +}; + + +class LLTalkButton : public LLUICtrl +{ +public: + + virtual ~LLTalkButton(); + + void onClick_SpeakBtn(); + void onClick_ShowBtn(); + + void draw(); + +protected: + friend class LLUICtrlFactory; + LLTalkButton(const LLUICtrl::Params& p); + +private: + LLButton* mSpeakBtn; + LLButton* mShowBtn; + LLVoiceControlPanel* mPrivateCallPanel; + LLOutputMonitorCtrl* mOutputMonitor; +}; + +#endif // LL_LLCHICLET_H diff --git a/indra/newview/llcloud.h b/indra/newview/llcloud.h index f4ae03b689fc79b45059db354288247cc3a24b14..155bf4eae91cbf09221326871996a10c1d62b3f9 100644 --- a/indra/newview/llcloud.h +++ b/indra/newview/llcloud.h @@ -72,7 +72,7 @@ #include "v3dmath.h" #include "v4math.h" #include "v4color.h" -#include "llmemory.h" +#include "llpointer.h" #include "lldarray.h" #include "llframetimer.h" diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index 5f8d9ed27b90cba1a7ec0d6c7feaa8e60037d4f5..33aaac542bd58b9b6f1a278add85cf0b606965de 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -37,12 +37,12 @@ // Linden library includes #include "v4color.h" +#include "llwindow.h" // setCursor() // Project includes #include "llui.h" #include "llrender.h" #include "lluiconstants.h" -#include "llviewerwindow.h" #include "llviewercontrol.h" #include "llbutton.h" #include "lltextbox.h" @@ -51,60 +51,55 @@ #include "llviewerimagelist.h" #include "llfocusmgr.h" -static LLRegisterWidget<LLColorSwatchCtrl> r("color_swatch"); +static LLDefaultWidgetRegistry::Register<LLColorSwatchCtrl> r("color_swatch"); -LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const LLColor4& color, - void (*commit_callback)(LLUICtrl* ctrl, void* userdata), - void* userdata ) -: LLUICtrl(name, rect, TRUE, commit_callback, userdata, FOLLOWS_LEFT | FOLLOWS_TOP), - mValid( TRUE ), - mColor( color ), - mBorderColor( gColors.getColor("DefaultHighlightLight") ), - mCanApplyImmediately(FALSE), - mOnCancelCallback(NULL), - mOnSelectCallback(NULL) +LLColorSwatchCtrl::Params::Params() +: color("color", LLColor4::white), + can_apply_immediately("can_apply_immediately", false), + alpha_background_image("alpha_background_image"), + border_color("border_color"), + label_width("label_width", -1), + caption_text("caption_text"), + border("border") { - mCaption = new LLTextBox( name, - LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 ), - name, - LLFontGL::getFontSansSerifSmall() ); - mCaption->setFollows( FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM ); - addChild( mCaption ); - - // Scalable UI made this off-by-one, I don't know why. JC - LLRect border_rect(0, getRect().getHeight()-1, getRect().getWidth()-1, 0); - border_rect.mBottom += BTN_HEIGHT_SMALL; - mBorder = new LLViewBorder(std::string("border"), border_rect, LLViewBorder::BEVEL_IN); - addChild(mBorder); - - mAlphaGradientImage = LLUI::getUIImage("color_swatch_alpha.tga"); + name = "colorswatch"; } -LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLColor4& color, - void (*commit_callback)(LLUICtrl* ctrl, void* userdata), - void* userdata ) -: LLUICtrl(name, rect, TRUE, commit_callback, userdata, FOLLOWS_LEFT | FOLLOWS_TOP), +LLColorSwatchCtrl::LLColorSwatchCtrl(const Params& p) +: LLUICtrl(p), mValid( TRUE ), - mColor( color ), - mBorderColor( gColors.getColor("DefaultHighlightLight") ), - mCanApplyImmediately(FALSE), - mOnCancelCallback(NULL), - mOnSelectCallback(NULL) -{ - mCaption = new LLTextBox( label, - LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 ), - label, - LLFontGL::getFontSansSerifSmall() ); - mCaption->setFollows( FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM ); + mColor(p.color), + mCanApplyImmediately(p.can_apply_immediately), + mAlphaGradientImage(p.alpha_background_image), + mOnCancelCallback(p.cancel_callback()), + mOnSelectCallback(p.select_callback()), + mBorderColor(p.border_color()), + mLabelWidth(p.label_width) +{ + LLTextBox::Params tp = p.caption_text; + // label_width is specified, not -1 + if(mLabelWidth!= -1) + { + tp.rect(LLRect( 0, BTN_HEIGHT_SMALL, mLabelWidth, 0 )); + } + else + { + tp.rect(LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 )); + } + + tp.text(p.label); + mCaption = LLUICtrlFactory::create<LLTextBox>(tp); addChild( mCaption ); - // Scalable UI made this off-by-one, I don't know why. JC - LLRect border_rect(0, getRect().getHeight()-1, getRect().getWidth()-1, 0); + LLRect border_rect = getLocalRect(); + border_rect.mTop -= 1; + border_rect.mRight -=1; border_rect.mBottom += BTN_HEIGHT_SMALL; - mBorder = new LLViewBorder(std::string("border"), border_rect, LLViewBorder::BEVEL_IN); - addChild(mBorder); - mAlphaGradientImage = LLUI::getUIImage("color_swatch_alpha.tga"); + LLViewBorder::Params params = p.border; + params.rect(border_rect); + mBorder = LLUICtrlFactory::create<LLViewBorder> (params); + addChild(mBorder); } LLColorSwatchCtrl::~LLColorSwatchCtrl () @@ -114,9 +109,8 @@ LLColorSwatchCtrl::~LLColorSwatchCtrl () if (pickerp) { pickerp->cancelSelection(); - pickerp->close(); + pickerp->closeFloater(); } - mAlphaGradientImage = NULL; } BOOL LLColorSwatchCtrl::handleDoubleClick(S32 x, S32 y, MASK mask) @@ -206,7 +200,7 @@ void LLColorSwatchCtrl::draw() mBorder->setKeyboardFocusHighlight(hasFocus()); // Draw border LLRect border( 0, getRect().getHeight(), getRect().getWidth(), BTN_HEIGHT_SMALL ); - gl_rect_2d( border, mBorderColor, FALSE ); + gl_rect_2d( border, mBorderColor.get(), FALSE ); LLRect interior = border; interior.stretch( -1 ); @@ -264,7 +258,7 @@ void LLColorSwatchCtrl::setEnabled( BOOL enabled ) if (pickerp) { pickerp->cancelSelection(); - pickerp->close(); + pickerp->closeFloater(); } } } @@ -295,11 +289,11 @@ void LLColorSwatchCtrl::onColorChanged ( void* data, EColorPickOp pick_op ) if (pick_op == COLOR_CANCEL && subject->mOnCancelCallback) { - subject->mOnCancelCallback(subject, subject->mCallbackUserData); + subject->mOnCancelCallback( subject, LLSD()); } else if (pick_op == COLOR_SELECT && subject->mOnSelectCallback) { - subject->mOnSelectCallback(subject, subject->mCallbackUserData); + subject->mOnSelectCallback( subject, LLSD() ); } else { @@ -343,59 +337,3 @@ void LLColorSwatchCtrl::showPicker(BOOL take_focus) } } -// virtual -LLXMLNodePtr LLColorSwatchCtrl::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - node->createChild("color", TRUE)->setFloatValue(4, mColor.mV); - - node->createChild("border_color", TRUE)->setFloatValue(4, mBorderColor.mV); - - if (mCaption) - { - node->createChild("label", TRUE)->setStringValue(mCaption->getText()); - } - - node->createChild("can_apply_immediately", TRUE)->setBoolValue(mCanApplyImmediately); - - return node; -} - -LLView* LLColorSwatchCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("colorswatch"); - node->getAttributeString("name", name); - - std::string label; - node->getAttributeString("label", label); - - LLColor4 color(1.f, 1.f, 1.f, 1.f); - node->getAttributeColor("initial_color", color); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - BOOL can_apply_immediately = FALSE; - node->getAttributeBOOL("can_apply_immediately", can_apply_immediately); - - LLUICtrlCallback callback = NULL; - - if (label.empty()) - { - label.assign(node->getValue()); - } - - LLColorSwatchCtrl* color_swatch = new LLColorSwatchCtrl( - name, - rect, - label, - color, - callback, - NULL ); - - color_swatch->setCanApplyImmediately(can_apply_immediately); - color_swatch->initFromXML(node, parent); - - return color_swatch; -} diff --git a/indra/newview/llcolorswatch.h b/indra/newview/llcolorswatch.h index 0dd021f51fd7bbc1e332d1ed5451ead8f00cf49d..a05926c2f5c8cf1ed9fb086be48fbe362d83cc9b 100644 --- a/indra/newview/llcolorswatch.h +++ b/indra/newview/llcolorswatch.h @@ -37,6 +37,7 @@ #include "v4color.h" #include "llfloater.h" #include "llviewerimage.h" +#include "lltextbox.h" // // Classes @@ -57,53 +58,65 @@ public: COLOR_CANCEL } EColorPickOp; - LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const LLColor4& color, - void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), - void* callback_userdata); - LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLColor4& color, - void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), - void* callback_userdata); + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<LLColor4> color; + Optional<bool> can_apply_immediately; + Optional<LLUIImage*> alpha_background_image; + Optional<commit_callback_t> cancel_callback; + Optional<commit_callback_t> select_callback; + Optional<LLUIColor> border_color; + Optional<S32> label_width; + + Optional<LLTextBox::Params> caption_text; + Optional<LLViewBorder::Params> border; + Params(); + }; +protected: + LLColorSwatchCtrl(const Params& p); + friend class LLUICtrlFactory; +public: ~LLColorSwatchCtrl (); - virtual void setValue(const LLSD& value); + /*virtual*/ void setValue(const LLSD& value); - virtual LLSD getValue() const { return mColor.getValue(); } + /*virtual*/ LLSD getValue() const { return mColor.getValue(); } const LLColor4& get() { return mColor; } void set(const LLColor4& color, BOOL update_picker = FALSE, BOOL from_event = FALSE); void setOriginal(const LLColor4& color); void setValid(BOOL valid); void setLabel(const std::string& label); + void setLabelWidth(S32 label_width) {mLabelWidth =label_width;} void setCanApplyImmediately(BOOL apply) { mCanApplyImmediately = apply; } - void setOnCancelCallback(LLUICtrlCallback cb) { mOnCancelCallback = cb; } - void setOnSelectCallback(LLUICtrlCallback cb) { mOnSelectCallback = cb; } + void setOnCancelCallback(commit_callback_t cb) { mOnCancelCallback = cb; } + void setOnSelectCallback(commit_callback_t cb) { mOnSelectCallback = cb; } void setFallbackImageName(const std::string& name) { mFallbackImageName = name; } void showPicker(BOOL take_focus); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); - virtual BOOL handleDoubleClick(S32 x,S32 y,MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleUnicodeCharHere(llwchar uni_char); - virtual void draw(); - virtual void setEnabled( BOOL enabled ); - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleDoubleClick(S32 x,S32 y,MASK mask); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); + /*virtual*/ void draw(); + /*virtual*/ void setEnabled( BOOL enabled ); static void onColorChanged ( void* data, EColorPickOp pick_op = COLOR_CHANGE ); protected: BOOL mValid; LLColor4 mColor; - LLColor4 mBorderColor; + LLUIColor mBorderColor; LLTextBox* mCaption; LLHandle<LLFloater> mPickerHandle; LLViewBorder* mBorder; BOOL mCanApplyImmediately; - LLUICtrlCallback mOnCancelCallback; - LLUICtrlCallback mOnSelectCallback; + commit_callback_t mOnCancelCallback; + commit_callback_t mOnSelectCallback; + S32 mLabelWidth; LLPointer<LLUIImage> mAlphaGradientImage; std::string mFallbackImageName; diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 689033a07ba2af84fde92fd4be9d5274a74a0633..096777ddd47caa56943647acd4c08580f48a6b6e 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -46,6 +46,7 @@ #include "llassetuploadqueue.h" #include "llassetuploadresponders.h" #include "llchat.h" +#include "llfloaterreg.h" #include "llviewerwindow.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" @@ -60,23 +61,17 @@ #include "llfloaterchat.h" #include "llviewerstats.h" #include "lluictrlfactory.h" +#include "lltrans.h" #include "llselectmgr.h" +// *TODO: This should be separated into the script queue, and the floater views of that queue. +// There should only be one floater class that can view any queue type + ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -// *TODO:Translate -const std::string COMPILE_QUEUE_TITLE("Recompilation Progress"); -const std::string COMPILE_START_STRING("recompile"); -const std::string RESET_QUEUE_TITLE("Reset Progress"); -const std::string RESET_START_STRING("reset"); -const std::string RUN_QUEUE_TITLE("Set Running Progress"); -const std::string RUN_START_STRING("set running"); -const std::string NOT_RUN_QUEUE_TITLE("Set Not Running Progress"); -const std::string NOT_RUN_START_STRING("set not running"); - struct LLScriptQueueData { LLUUID mQueueID; @@ -92,54 +87,26 @@ struct LLScriptQueueData /// Class LLFloaterScriptQueue ///---------------------------------------------------------------------------- -// static -LLMap<LLUUID, LLFloaterScriptQueue*> LLFloaterScriptQueue::sInstances; - - // Default constructor -LLFloaterScriptQueue::LLFloaterScriptQueue(const std::string& name, - const LLRect& rect, - const std::string& title, - const std::string& start_string) : - LLFloater(name, rect, title, - RESIZE_YES, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, - DRAG_ON_TOP, MINIMIZE_YES, CLOSE_YES) +LLFloaterScriptQueue::LLFloaterScriptQueue(const LLSD& key) : + LLFloater(key), + mDone(FALSE) { - mID.generate(); - - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_queue.xml"); - - childSetAction("close",onCloseBtn,this); - childSetEnabled("close",FALSE); - - setTitle(title); - - LLRect curRect = getRect(); - translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop); - - mStartString = start_string; - mDone = FALSE; - sInstances.addData(mID, this); + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_queue.xml", FALSE); } // Destroys the object LLFloaterScriptQueue::~LLFloaterScriptQueue() { - sInstances.removeData(mID); } -// find an instance by ID. Return NULL if it does not exist. -// static -LLFloaterScriptQueue* LLFloaterScriptQueue::findInstance(const LLUUID& id) +BOOL LLFloaterScriptQueue::postBuild() { - if(sInstances.checkData(id)) - { - return sInstances.getData(id); - } - return NULL; + childSetAction("close",onCloseBtn,this); + childSetEnabled("close",FALSE); + return TRUE; } - // This is the callback method for the viewer object currently being // worked on. // NOT static, virtual! @@ -185,7 +152,7 @@ void LLFloaterScriptQueue::inventoryChanged(LLViewerObject* viewer_object, void LLFloaterScriptQueue::onCloseBtn(void* user_data) { LLFloaterScriptQueue* self = (LLFloaterScriptQueue*)user_data; - self->close(); + self->closeFloater(); } void LLFloaterScriptQueue::addObject(const LLUUID& id) @@ -210,10 +177,12 @@ BOOL LLFloaterScriptQueue::start() n_objects = selectHandle->getRootObjectCount(); } - buffer = llformat("Starting %s of %d items.", mStartString.c_str(), n_objects); // *TODO: Translate + LLStringUtil::format_map_t args; + args["[START]"] = mStartString; + args["[COUNT]"] = llformat ("%d", mObjectIDs.count()); + buffer = getString ("Starting", args); - LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); - list->addCommentText(buffer); + getChild<LLScrollListCtrl>("queue output")->setCommentText(buffer); return nextObject(); } @@ -245,12 +214,8 @@ BOOL LLFloaterScriptQueue::nextObject() } while((mObjectIDs.count() > 0) && !successful_start); if(isDone() && !mDone) { - - LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); - mDone = TRUE; - std::string buffer = "Done."; // *TODO: Translate - list->addCommentText(buffer); + getChild<LLScrollListCtrl>("queue output")->setCommentText(getString("Done")); childSetEnabled("close",TRUE); } return successful_start; @@ -275,7 +240,7 @@ BOOL LLFloaterScriptQueue::popNext() { llinfos << "LLFloaterScriptQueue::popNext() requesting inv for " << mCurrentObjectID << llendl; - LLUUID* id = new LLUUID(mID); + LLUUID* id = new LLUUID(getKey().asUUID()); registerVOInventoryListener(obj,id); requestVOInventory(); rv = TRUE; @@ -289,64 +254,48 @@ BOOL LLFloaterScriptQueue::popNext() /// Class LLFloaterCompileQueue ///---------------------------------------------------------------------------- -// static -LLFloaterCompileQueue* LLFloaterCompileQueue::create(BOOL mono) +class LLCompileFloaterUploadQueueSupplier : public LLAssetUploadQueueSupplier { - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("CompileOutputRect"); - rect.translate(left - rect.mLeft, top - rect.mTop); - LLFloaterCompileQueue* new_queue = new LLFloaterCompileQueue("queue", rect); +public: - class LLCompileFloaterUploadQueueSupplier : public LLAssetUploadQueueSupplier + LLCompileFloaterUploadQueueSupplier(const LLUUID& queue_id) : + mQueueId(queue_id) { - public: - - LLCompileFloaterUploadQueueSupplier(const LLUUID& queue_id) : - mQueueId(queue_id) - { - } + } - virtual LLAssetUploadQueue* get() const + virtual LLAssetUploadQueue* get() const + { + LLFloaterCompileQueue* queue = LLFloaterReg::findTypedInstance<LLFloaterCompileQueue>("compile_queue", LLSD(mQueueId)); + if(NULL == queue) { - LLFloaterCompileQueue* queue = - (LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId); - - if(NULL == queue) - { - return NULL; - } - - return queue->mUploadQueue; + return NULL; } + return queue->getUploadQueue(); + } - virtual void log(std::string message) const + virtual void log(std::string message) const + { + LLFloaterCompileQueue* queue = LLFloaterReg::findTypedInstance<LLFloaterCompileQueue>("compile_queue", LLSD(mQueueId)); + if(NULL == queue) { - LLFloaterCompileQueue* queue = - (LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId); - - if(NULL == queue) - { - return; - } - - LLScrollListCtrl* list = queue->getChild<LLScrollListCtrl>("queue output"); - list->addCommentText(message.c_str()); + return; } + + queue->getChild<LLScrollListCtrl>("queue output")->setCommentText(message); + } - private: - LLUUID mQueueId; - }; - - new_queue->mUploadQueue = new LLAssetUploadQueue(new LLCompileFloaterUploadQueueSupplier(new_queue->getID())); - new_queue->mMono = mono; - new_queue->open(); - return new_queue; -} +private: + LLUUID mQueueId; +}; -LLFloaterCompileQueue::LLFloaterCompileQueue(const std::string& name, const LLRect& rect) -: LLFloaterScriptQueue(name, rect, COMPILE_QUEUE_TITLE, COMPILE_START_STRING) -{ } +LLFloaterCompileQueue::LLFloaterCompileQueue(const LLSD& key) + : LLFloaterScriptQueue(key) +{ + setTitle(LLTrans::getString("CompileQueueTitle")); + setStartString(LLTrans::getString("CompileQueueStart")); + + mUploadQueue = new LLAssetUploadQueue(new LLCompileFloaterUploadQueueSupplier(key.asUUID())); +} LLFloaterCompileQueue::~LLFloaterCompileQueue() { @@ -391,7 +340,7 @@ void LLFloaterCompileQueue::handleInventory(LLViewerObject *viewer_object, for(iter = asset_item_map.begin(); iter != asset_item_map.end(); iter++) { LLInventoryItem *itemp = iter->second; - LLScriptQueueData* datap = new LLScriptQueueData(getID(), + LLScriptQueueData* datap = new LLScriptQueueData(getKey().asUUID(), itemp->getName(), viewer_object->getID(), itemp->getUUID()); @@ -419,9 +368,12 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, { llinfos << "LLFloaterCompileQueue::scriptArrived()" << llendl; LLScriptQueueData* data = (LLScriptQueueData*)user_data; - if(!data) return; - LLFloaterCompileQueue* queue = static_cast<LLFloaterCompileQueue*> - (LLFloaterScriptQueue::findInstance(data->mQueueID)); + if(!data) + { + return; + } + LLFloaterCompileQueue* queue = LLFloaterReg::findTypedInstance<LLFloaterCompileQueue>("compile_queue", data->mQueueID); + std::string buffer; if(queue && (0 == status)) { @@ -447,13 +399,13 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, file.read(script_data, script_size); queue->mUploadQueue->queue(filename, data->mTaskId, - data->mItemId, is_running, queue->mMono, queue->getID(), - script_data, script_size, data->mScriptName); + data->mItemId, is_running, queue->mMono, queue->getKey().asUUID(), + script_data, script_size, data->mScriptName); } else { // It's now in the file, now compile it. - buffer = std::string("Downloaded, now compiling: ") + data->mScriptName; // *TODO: Translate + buffer = LLTrans::getString("CompileQueueDownloadedCompiling") + (": ") + data->mScriptName; // Write script to local file for compilation. LLFILE *fp = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/ @@ -492,19 +444,19 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ) { - LLChat chat(std::string("Script not found on server.")); // *TODO: Translate + LLChat chat(LLTrans::getString("CompileQueueScriptNotFound")); LLFloaterChat::addChat(chat); - buffer = std::string("Problem downloading: ") + data->mScriptName; // *TODO: Translate + buffer = LLTrans::getString("CompileQueueProblemDownloading") + (": ") + data->mScriptName; } else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) { - LLChat chat(std::string("Insufficient permissions to download a script.")); // *TODO: Translate + LLChat chat(LLTrans::getString("CompileQueueInsufficientPermDownload")); LLFloaterChat::addChat(chat); - buffer = std::string("Insufficient permissions for: ") + data->mScriptName; // *TODO: Translate + buffer = LLTrans::getString("CompileQueueInsufficientPermFor") + (": ") + data->mScriptName; } else { - buffer = std::string("Unknown failure to download ") + data->mScriptName; // *TODO: Translate + buffer = LLTrans::getString("CompileQueueUnknownFailure") + (" ") + data->mScriptName; } llwarns << "Problem downloading script asset." << llendl; @@ -512,8 +464,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, } if(queue && (buffer.size() > 0)) { - LLScrollListCtrl* list = queue->getChild<LLScrollListCtrl>("queue output"); - list->addCommentText(buffer); + queue->getChild<LLScrollListCtrl>("queue output")->setCommentText(buffer); } delete data; } @@ -536,8 +487,7 @@ void LLFloaterCompileQueue::onSaveBytecodeComplete(const LLUUID& asset_id, void* { llinfos << "LLFloaterCompileQueue::onSaveBytecodeComplete()" << llendl; LLCompileQueueData* data = (LLCompileQueueData*)user_data; - LLFloaterCompileQueue* queue = static_cast<LLFloaterCompileQueue*> - (LLFloaterScriptQueue::findInstance(data->mQueueID)); + LLFloaterCompileQueue* queue = LLFloaterReg::findTypedInstance<LLFloaterCompileQueue>("compile_queue", data->mQueueID); if(queue && (0 == status) && data) { queue->saveItemByItemID(data->mItemId); @@ -587,7 +537,7 @@ void LLFloaterCompileQueue::compile(const std::string& filename, llinfos << "compile successful." << llendl; // Save LSL bytecode - LLCompileQueueData* data = new LLCompileQueueData(mID, item_id); + LLCompileQueueData* data = new LLCompileQueueData(getKey().asUUID(), item_id); gAssetStorage->storeAssetData(dst_filename, new_asset_id, LLAssetType::AT_LSL_BYTECODE, &LLFloaterCompileQueue::onSaveBytecodeComplete, @@ -656,23 +606,13 @@ void LLFloaterCompileQueue::saveItemByItemID(const LLUUID& asset_id) /// Class LLFloaterResetQueue ///---------------------------------------------------------------------------- -// static -LLFloaterResetQueue* LLFloaterResetQueue::create() +LLFloaterResetQueue::LLFloaterResetQueue(const LLSD& key) + : LLFloaterScriptQueue(key) { - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("CompileOutputRect"); - rect.translate(left - rect.mLeft, top - rect.mTop); - LLFloaterResetQueue* new_queue = new LLFloaterResetQueue("queue", rect); - gFloaterView->addChild(new_queue); - new_queue->open(); - return new_queue; + setTitle(LLTrans::getString("ResetQueueTitle")); + setStartString(LLTrans::getString("ResetQueueStart")); } -LLFloaterResetQueue::LLFloaterResetQueue(const std::string& name, const LLRect& rect) -: LLFloaterScriptQueue(name, rect, RESET_QUEUE_TITLE, RESET_START_STRING) -{ } - LLFloaterResetQueue::~LLFloaterResetQueue() { } @@ -695,10 +635,9 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj, if (object) { LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); - LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); std::string buffer; - buffer = std::string("Resetting: ") + item->getName(); // *TODO: Translate - list->addCommentText(buffer); + buffer = getString("Resetting") + (": ") + item->getName(); + getChild<LLScrollListCtrl>("queue output")->setCommentText(buffer); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ScriptReset); msg->nextBlockFast(_PREHASH_AgentData); @@ -719,22 +658,13 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj, /// Class LLFloaterRunQueue ///---------------------------------------------------------------------------- -// static -LLFloaterRunQueue* LLFloaterRunQueue::create() +LLFloaterRunQueue::LLFloaterRunQueue(const LLSD& key) + : LLFloaterScriptQueue(key) { - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("CompileOutputRect"); - rect.translate(left - rect.mLeft, top - rect.mTop); - LLFloaterRunQueue* new_queue = new LLFloaterRunQueue("queue", rect); - new_queue->open(); /*Flawfinder: ignore*/ - return new_queue; + setTitle(LLTrans::getString("RunQueueTitle")); + setStartString(LLTrans::getString("RunQueueStart")); } -LLFloaterRunQueue::LLFloaterRunQueue(const std::string& name, const LLRect& rect) -: LLFloaterScriptQueue(name, rect, RUN_QUEUE_TITLE, RUN_START_STRING) -{ } - LLFloaterRunQueue::~LLFloaterRunQueue() { } @@ -759,8 +689,8 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj, LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); std::string buffer; - buffer = std::string("Running: ") + item->getName(); // *TODO: Translate - list->addCommentText(buffer); + buffer = getString("Running") + (": ") + item->getName(); + list->setCommentText(buffer); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_SetScriptRunning); @@ -783,22 +713,13 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj, /// Class LLFloaterNotRunQueue ///---------------------------------------------------------------------------- -// static -LLFloaterNotRunQueue* LLFloaterNotRunQueue::create() +LLFloaterNotRunQueue::LLFloaterNotRunQueue(const LLSD& key) + : LLFloaterScriptQueue(key) { - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("CompileOutputRect"); - rect.translate(left - rect.mLeft, top - rect.mTop); - LLFloaterNotRunQueue* new_queue = new LLFloaterNotRunQueue("queue", rect); - new_queue->open(); /*Flawfinder: ignore*/ - return new_queue; + setTitle(LLTrans::getString("NotRunQueueTitle")); + setStartString(LLTrans::getString("NotRunQueueStart")); } -LLFloaterNotRunQueue::LLFloaterNotRunQueue(const std::string& name, const LLRect& rect) -: LLFloaterScriptQueue(name, rect, NOT_RUN_QUEUE_TITLE, NOT_RUN_START_STRING) -{ } - LLFloaterNotRunQueue::~LLFloaterNotRunQueue() { } @@ -823,8 +744,8 @@ void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj, LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); std::string buffer; - buffer = std::string("Not running: ") +item->getName(); // *TODO: Translate - list->addCommentText(buffer); + buffer = getString("NotRunning") + (": ") +item->getName(); + list->setCommentText(buffer); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_SetScriptRunning); diff --git a/indra/newview/llcompilequeue.h b/indra/newview/llcompilequeue.h index 51240423bac33d294c16749c27bf43761a9365cc..063d573239300be7b3c11fd94665ec7be8ba36aa 100644 --- a/indra/newview/llcompilequeue.h +++ b/indra/newview/llcompilequeue.h @@ -59,20 +59,20 @@ class LLFloaterScriptQueue : public LLFloater, public LLVOInventoryListener { public: + LLFloaterScriptQueue(const LLSD& key); + virtual ~LLFloaterScriptQueue(); + + /*virtual*/ BOOL postBuild(); + + void setMono(bool mono) { mMono = mono; } + // addObject() accepts an object id. void addObject(const LLUUID& id); // start() returns TRUE if the queue has started, otherwise FALSE. BOOL start(); - - // find an instance by ID. Return NULL if it does not exist. - static LLFloaterScriptQueue* findInstance(const LLUUID& id); - + protected: - LLFloaterScriptQueue(const std::string& name, const LLRect& rect, - const std::string& title, const std::string& start_string); - virtual ~LLFloaterScriptQueue(); - // This is the callback method for the viewer object currently // being worked on. /*virtual*/ void inventoryChanged(LLViewerObject* obj, @@ -94,8 +94,7 @@ protected: BOOL nextObject(); BOOL popNext(); - // Get this instances ID. - const LLUUID& getID() const { return mID; } + void setStartString(const std::string& s) { mStartString = s; } protected: // UI @@ -107,10 +106,8 @@ protected: LLUUID mCurrentObjectID; BOOL mDone; - LLUUID mID; - static LLMap<LLUUID, LLFloaterScriptQueue*> sInstances; - std::string mStartString; + BOOL mMono; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -131,20 +128,19 @@ class LLAssetUploadQueue; class LLFloaterCompileQueue : public LLFloaterScriptQueue { + friend class LLFloaterReg; public: - // Use this method to create a compile queue. Once created, it - // will be responsible for it's own destruction. - static LLFloaterCompileQueue* create(BOOL mono); - static void onSaveBytecodeComplete(const LLUUID& asset_id, void* user_data, S32 status); // remove any object in mScriptScripts with the matching uuid. void removeItemByItemID(const LLUUID& item_id); + + LLAssetUploadQueue* getUploadQueue() { return mUploadQueue; } protected: - LLFloaterCompileQueue(const std::string& name, const LLRect& rect); + LLFloaterCompileQueue(const LLSD& key); virtual ~LLFloaterCompileQueue(); // This is called by inventoryChanged @@ -173,12 +169,11 @@ protected: // find InventoryItem given item id. const LLInventoryItem* findItemByItemID(const LLUUID& item_id) const; - + protected: LLViewerInventoryItem::item_array_t mCurrentScripts; private: - BOOL mMono; // Compile to mono. LLAssetUploadQueue* mUploadQueue; }; @@ -190,20 +185,14 @@ private: class LLFloaterResetQueue : public LLFloaterScriptQueue { -public: - // Use this method to create a reset queue. Once created, it - // will be responsible for it's own destruction. - static LLFloaterResetQueue* create(); - + friend class LLFloaterReg; protected: - LLFloaterResetQueue(const std::string& name, const LLRect& rect); + LLFloaterResetQueue(const LLSD& key); virtual ~LLFloaterResetQueue(); // This is called by inventoryChanged virtual void handleInventory(LLViewerObject* viewer_obj, InventoryObjectList* inv); - -protected: }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -214,20 +203,14 @@ protected: class LLFloaterRunQueue : public LLFloaterScriptQueue { -public: - // Use this method to create a run queue. Once created, it - // will be responsible for it's own destruction. - static LLFloaterRunQueue* create(); - + friend class LLFloaterReg; protected: - LLFloaterRunQueue(const std::string& name, const LLRect& rect); + LLFloaterRunQueue(const LLSD& key); virtual ~LLFloaterRunQueue(); // This is called by inventoryChanged virtual void handleInventory(LLViewerObject* viewer_obj, InventoryObjectList* inv); - -protected: }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -238,20 +221,14 @@ protected: class LLFloaterNotRunQueue : public LLFloaterScriptQueue { -public: - // Use this method to create a not run queue. Once created, it - // will be responsible for it's own destruction. - static LLFloaterNotRunQueue* create(); - + friend class LLFloaterReg; protected: - LLFloaterNotRunQueue(const std::string& name, const LLRect& rect); + LLFloaterNotRunQueue(const LLSD& key); virtual ~LLFloaterNotRunQueue(); // This is called by inventoryChanged virtual void handleInventory(LLViewerObject* viewer_obj, InventoryObjectList* inv); - -protected: }; #endif // LL_LLCOMPILEQUEUE_H diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index 86821249a07da5781aa3030a80af8bc81c3f4084..99576947279bfcd87ca5be35edae4960c621e452 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -46,6 +46,7 @@ #include "llviewchildren.h" #include "llxmlrpctransaction.h" #include "llviewernetwork.h" +#include "llpanel.h" const F64 CURRENCY_ESTIMATE_FREQUENCY = 2.0; @@ -356,8 +357,7 @@ void LLCurrencyUIManager::Impl::prepare() if (lindenAmount) { lindenAmount->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32); - lindenAmount->setKeystrokeCallback(onCurrencyKey); - lindenAmount->setCallbackUserData(this); + lindenAmount->setKeystrokeCallback(onCurrencyKey, this); } } diff --git a/indra/newview/lldebugmessagebox.cpp b/indra/newview/lldebugmessagebox.cpp index 4188ecc0e2667f1a8ee0ffc668dd1f8970fa190f..9eee3b239ca72ca86399b65ff98511f58ae458b4 100644 --- a/indra/newview/lldebugmessagebox.cpp +++ b/indra/newview/lldebugmessagebox.cpp @@ -50,32 +50,69 @@ std::map<std::string, LLDebugVarMessageBox*> LLDebugVarMessageBox::sInstances; LLDebugVarMessageBox::LLDebugVarMessageBox(const std::string& title, EDebugVarType var_type, void *var) : - LLFloater(std::string("msg box"), LLRect(10,160,400,10), title), + LLFloater(), mVarType(var_type), mVarData(var), mAnimate(FALSE) { + setRect(LLRect(10,160,400,10)); + + LLSliderCtrl::Params slider_p; + slider_p.label(title); + slider_p.label_width(70); + slider_p.text_width(40); + slider_p.can_edit_text(true); + slider_p.show_text(true); + + mSlider1 = NULL; + mSlider2 = NULL; + mSlider3 = NULL; + switch(var_type) { case VAR_TYPE_F32: - mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,130,190,110), title, NULL, 70, 130, TRUE, TRUE, FALSE, NULL, NULL, *((F32*)var), -100.f, 100.f, 0.1f, LLStringUtil::null); - mSlider1->setPrecision(3); + slider_p.name("slider 1"); + slider_p.rect(LLRect(20,130,190,110)); + slider_p.initial_value(*((F32*)var)); + slider_p.min_value(-100.f); + slider_p.max_value(100.f); + slider_p.increment(0.1f); + slider_p.decimal_digits(3); + mSlider1 = LLUICtrlFactory::create<LLSliderCtrl>(slider_p); addChild(mSlider1); - mSlider2 = NULL; - mSlider3 = NULL; break; case VAR_TYPE_S32: - mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,100,190,80), title, NULL, 70, 130, TRUE, TRUE, FALSE, NULL, NULL, (F32)*((S32*)var), -255.f, 255.f, 1.f, LLStringUtil::null); - mSlider1->setPrecision(0); + slider_p.name("slider 1"); + slider_p.rect(LLRect(20,100,190,80)); + slider_p.initial_value((F32)*((S32*)var)); + slider_p.min_value(-255.f); + slider_p.max_value(255.f); + slider_p.increment(1.f); + slider_p.decimal_digits(0); + mSlider1 = LLUICtrlFactory::create<LLSliderCtrl>(slider_p); addChild(mSlider1); - mSlider2 = NULL; - mSlider3 = NULL; break; case VAR_TYPE_VEC3: - mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,130,190,110), std::string("x: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, NULL, ((LLVector3*)var)->mV[VX], -100.f, 100.f, 0.1f, LLStringUtil::null); - mSlider1->setPrecision(3); - mSlider2 = new LLSliderCtrl(std::string("slider 2"), LLRect(20,100,190,80), std::string("y: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, NULL, ((LLVector3*)var)->mV[VY], -100.f, 100.f, 0.1f, LLStringUtil::null); - mSlider2->setPrecision(3); - mSlider3 = new LLSliderCtrl(std::string("slider 3"), LLRect(20,70,190,50), std::string("z: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, NULL, ((LLVector3*)var)->mV[VZ], -100.f, 100.f, 0.1f, LLStringUtil::null); - mSlider3->setPrecision(3); + slider_p.name("slider 1"); + slider_p.label("x: "); + slider_p.rect(LLRect(20,130,190,110)); + slider_p.initial_value(((LLVector3*)var)->mV[VX]); + slider_p.min_value(-100.f); + slider_p.max_value(100.f); + slider_p.increment(0.1f); + slider_p.decimal_digits(3); + mSlider1 = LLUICtrlFactory::create<LLSliderCtrl>(slider_p); + + slider_p.name("slider 2"); + slider_p.label("y: "); + slider_p.rect(LLRect(20,100,190,80)); + slider_p.initial_value(((LLVector3*)var)->mV[VY]); + mSlider2 = LLUICtrlFactory::create<LLSliderCtrl>(slider_p); + + slider_p.name("slider 3"); + slider_p.label("z: "); + slider_p.rect(LLRect(20,70,190,50)); + slider_p.initial_value(((LLVector3*)var)->mV[VZ]); + mSlider2 = LLUICtrlFactory::create<LLSliderCtrl>(slider_p); + addChild(mSlider1); addChild(mSlider2); addChild(mSlider3); @@ -85,10 +122,18 @@ LLDebugVarMessageBox::LLDebugVarMessageBox(const std::string& title, EDebugVarTy break; } - mAnimateButton = new LLButton(std::string("Animate"), LLRect(20, 45, 180, 25), LLStringUtil::null, onAnimateClicked, this); + LLButton::Params p; + p.name(std::string("Animate")); + p.rect(LLRect(20, 45, 180, 25)); + p.click_callback.function(boost::bind(&LLDebugVarMessageBox::onAnimateClicked, this, _2)); + mAnimateButton = LLUICtrlFactory::create<LLButton>(p); addChild(mAnimateButton); - mText = new LLTextBox(std::string("value"), LLRect(20,20,190,0)); + LLTextBox::Params params; + params.name("value"); + params.text(params.name); + params.rect(LLRect(20,20,190,0)); + mText = LLUICtrlFactory::create<LLTextBox> (params); addChild(mText); //disable hitting enter closes dialog @@ -112,8 +157,7 @@ void LLDebugVarMessageBox::show(const std::string& title, F32 *var, F32 max_valu { box->mSlider1->setValue(*var); } - box->mSlider1->setCommitCallback(slider_changed); - box->mSlider1->setCallbackUserData(box); + box->mSlider1->setCommitCallback(boost::bind(&LLDebugVarMessageBox::sliderChanged, box, _2)); #endif } @@ -129,8 +173,7 @@ void LLDebugVarMessageBox::show(const std::string& title, S32 *var, S32 max_valu { box->mSlider1->setValue((F32)*var); } - box->mSlider1->setCommitCallback(slider_changed); - box->mSlider1->setCallbackUserData(box); + box->mSlider1->setCommitCallback(boost::bind(&LLDebugVarMessageBox::sliderChanged, box, _2)); #endif } @@ -142,20 +185,17 @@ void LLDebugVarMessageBox::show(const std::string& title, LLVector3 *var, LLVect box->mSlider1->setMaxValue(max_value.mV[VX]); box->mSlider1->setMinValue(-max_value.mV[VX]); box->mSlider1->setIncrement(increment.mV[VX]); - box->mSlider1->setCommitCallback(slider_changed); - box->mSlider1->setCallbackUserData(box); + box->mSlider1->setCommitCallback(boost::bind(&LLDebugVarMessageBox::sliderChanged, box, _2)); box->mSlider2->setMaxValue(max_value.mV[VX]); box->mSlider2->setMinValue(-max_value.mV[VX]); box->mSlider2->setIncrement(increment.mV[VX]); - box->mSlider2->setCommitCallback(slider_changed); - box->mSlider2->setCallbackUserData(box); + box->mSlider2->setCommitCallback(boost::bind(&LLDebugVarMessageBox::sliderChanged, box, _2)); box->mSlider3->setMaxValue(max_value.mV[VX]); box->mSlider3->setMinValue(-max_value.mV[VX]); box->mSlider3->setIncrement(increment.mV[VX]); - box->mSlider3->setCommitCallback(slider_changed); - box->mSlider3->setCallbackUserData(box); + box->mSlider3->setCommitCallback(boost::bind(&LLDebugVarMessageBox::sliderChanged, box, _2)); #endif } @@ -170,45 +210,44 @@ LLDebugVarMessageBox* LLDebugVarMessageBox::show(const std::string& title, EDebu sInstances[title_string] = box; gFloaterView->addChild(box); box->reshape(200,150); - box->open(); /*Flawfinder: ignore*/ + box->openFloater(); box->mTitle = title_string; } return box; } -void LLDebugVarMessageBox::slider_changed(LLUICtrl* ctrl, void* user_data) +void LLDebugVarMessageBox::sliderChanged(const LLSD& data) { - LLDebugVarMessageBox *msg_box = (LLDebugVarMessageBox*)user_data; - if (!msg_box || !msg_box->mVarData) return; + if (!mVarData) + return; - switch(msg_box->mVarType) + switch(mVarType) { case VAR_TYPE_F32: - *((F32*)msg_box->mVarData) = (F32)msg_box->mSlider1->getValue().asReal(); + *((F32*)mVarData) = (F32)mSlider1->getValue().asReal(); break; case VAR_TYPE_S32: - *((S32*)msg_box->mVarData) = (S32)msg_box->mSlider1->getValue().asInteger(); + *((S32*)mVarData) = (S32)mSlider1->getValue().asInteger(); break; case VAR_TYPE_VEC3: { - LLVector3* vec_p = (LLVector3*)msg_box->mVarData; - vec_p->setVec((F32)msg_box->mSlider1->getValue().asReal(), - (F32)msg_box->mSlider2->getValue().asReal(), - (F32)msg_box->mSlider3->getValue().asReal()); + LLVector3* vec_p = (LLVector3*)mVarData; + vec_p->setVec((F32)mSlider1->getValue().asReal(), + (F32)mSlider2->getValue().asReal(), + (F32)mSlider3->getValue().asReal()); break; } default: - llwarns << "Unhandled var type " << msg_box->mVarType << llendl; + llwarns << "Unhandled var type " << mVarType << llendl; break; } } -void LLDebugVarMessageBox::onAnimateClicked(void* user_data) +void LLDebugVarMessageBox::onAnimateClicked(const LLSD& data) { - LLDebugVarMessageBox* msg_boxp = (LLDebugVarMessageBox*)user_data; - msg_boxp->mAnimate = !msg_boxp->mAnimate; - msg_boxp->mAnimateButton->setToggleState(msg_boxp->mAnimate); + mAnimate = !mAnimate; + mAnimateButton->setToggleState(mAnimate); } void LLDebugVarMessageBox::onClose(bool app_quitting) @@ -245,16 +284,16 @@ void LLDebugVarMessageBox::draw() { F32 animated_val = clamp_rescale(fmodf((F32)LLFrameTimer::getElapsedSeconds() / 5.f, 1.f), 0.f, 1.f, 0.f, mSlider1->getMaxValue()); mSlider1->setValue(animated_val); - slider_changed(mSlider1, this); + sliderChanged(LLSD()); if (mSlider2) { mSlider2->setValue(animated_val); - slider_changed(mSlider2, this); + sliderChanged(LLSD()); } if (mSlider3) { mSlider3->setValue(animated_val); - slider_changed(mSlider3, this); + sliderChanged(LLSD()); } } } diff --git a/indra/newview/lldebugmessagebox.h b/indra/newview/lldebugmessagebox.h index 07062218acbd3d3d2644d8c204de3ef6e5c98754..76e128cfc1d7971a451f7dbc3dd651aeae264203 100644 --- a/indra/newview/lldebugmessagebox.h +++ b/indra/newview/lldebugmessagebox.h @@ -66,8 +66,8 @@ protected: ~LLDebugVarMessageBox(); static LLDebugVarMessageBox* show(const std::string& title, EDebugVarType var_type, void *var); - static void slider_changed(LLUICtrl* ctrl, void* user_data); - static void onAnimateClicked(void* user_data); + void sliderChanged(const LLSD& data); + void onAnimateClicked(const LLSD& data); public: static void show(const std::string& title, F32 *var, F32 max_value = 100.f, F32 increment = 0.1f); diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index 40f5202067893d6146d35903ae04aba783bcd7e4..bd5b9c30a21b7758f74c593d7a11bd70caf2b5a3 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -35,16 +35,16 @@ #include "lldebugview.h" // library includes -#include "llframestatview.h" #include "llfasttimerview.h" #include "llmemoryview.h" #include "llconsole.h" #include "lltextureview.h" #include "llresmgr.h" #include "imageids.h" -#include "llvelocitybar.h" +#include "llviewercontrol.h" #include "llviewerwindow.h" -#include "llfloaterstats.h" +#include "llappviewer.h" +#include "llmemoryview.h" // // Globals @@ -56,57 +56,52 @@ LLDebugView* gDebugView = NULL; // Methods // -LLDebugView::LLDebugView(const std::string& name, const LLRect &rect) -: LLView(name, rect, FALSE) +LLDebugView::LLDebugView(const LLDebugView::Params& p) +: LLView(p) { LLRect r; + LLRect rect(p.rect); r.set(10, rect.getHeight() - 100, rect.getWidth()/2, 100); - mDebugConsolep = new LLConsole("debug console", 20, r, -1, 0.f ); - mDebugConsolep->setFollowsBottom(); - mDebugConsolep->setFollowsLeft(); - mDebugConsolep->setVisible( FALSE ); + LLConsole::Params cp; + cp.name("debug console"); + cp.max_lines(20); + cp.rect(r); + cp.font(LLFontGL::getFontMonospace()); + cp.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_LEFT); + cp.visible(false); + mDebugConsolep = LLUICtrlFactory::create<LLConsole>(cp); addChild(mDebugConsolep); r.set(150 - 25, rect.getHeight() - 50, rect.getWidth()/2 - 25, rect.getHeight() - 450); - mFrameStatView = new LLFrameStatView("frame stat", r); - mFrameStatView->setFollowsTop(); - mFrameStatView->setFollowsLeft(); - mFrameStatView->setVisible(FALSE); // start invisible - addChild(mFrameStatView); r.set(25, rect.getHeight() - 50, (S32) (gViewerWindow->getVirtualWindowRect().getWidth() * 0.75f), (S32) (gViewerWindow->getVirtualWindowRect().getHeight() * 0.75f)); - mFastTimerView = new LLFastTimerView("fast timers", r); + mFastTimerView = new LLFastTimerView(r); mFastTimerView->setFollowsTop(); mFastTimerView->setFollowsLeft(); mFastTimerView->setVisible(FALSE); // start invisible addChild(mFastTimerView); - r.set(25, rect.getHeight() - 50, rect.getWidth()/2, rect.getHeight() - 450); - mMemoryView = new LLMemoryView("memory", r); - mMemoryView->setFollowsTop(); - mMemoryView->setFollowsLeft(); - mMemoryView->setVisible(FALSE); // start invisible + r.set(25, rect.getHeight() - 50, (S32) (gViewerWindow->getVirtualWindowRect().getWidth() * 0.75f), + (S32) (gViewerWindow->getVirtualWindowRect().getHeight() * 0.75f)); + LLMemoryView::Params mp; + mp.name("memory"); + mp.rect(r); + mp.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT); + mp.visible(false); + mMemoryView = LLUICtrlFactory::create<LLMemoryView>(mp); addChild(mMemoryView); r.set(150, rect.getHeight() - 50, 820, 100); - gTextureView = new LLTextureView("gTextureView", r); - gTextureView->setRect(r); - gTextureView->setFollowsBottom(); - gTextureView->setFollowsLeft(); + LLTextureView::Params tvp; + tvp.name("gTextureView"); + tvp.rect(r); + tvp.follows.flags(FOLLOWS_BOTTOM|FOLLOWS_LEFT); + tvp.visible(false); + gTextureView = LLUICtrlFactory::create<LLTextureView>(tvp); addChild(gTextureView); //gTextureView->reshape(r.getWidth(), r.getHeight(), TRUE); - - const S32 VELOCITY_LEFT = 10; // 370; - const S32 VELOCITY_WIDTH = 500; - const S32 VELOCITY_TOP = 140; - const S32 VELOCITY_HEIGHT = 45; - r.setLeftTopAndSize( VELOCITY_LEFT, VELOCITY_TOP, VELOCITY_WIDTH, VELOCITY_HEIGHT ); - gVelocityBar = new LLVelocityBar("Velocity Bar", r); - gVelocityBar->setFollowsBottom(); - gVelocityBar->setFollowsLeft(); - addChild(gVelocityBar); } diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h index 189efd3a3fde0e04e2f3cb4c95e51978c6e64f50..9cf2a59a0a7c9de1ad7d74e3fba62ab61c902cd5 100644 --- a/indra/newview/lldebugview.h +++ b/indra/newview/lldebugview.h @@ -40,9 +40,7 @@ // declarations class LLButton; -class LLToolView; class LLStatusPanel; -class LLFrameStatView; class LLFastTimerView; class LLMemoryView; class LLConsole; @@ -52,10 +50,18 @@ class LLFloaterStats; class LLDebugView : public LLView { public: - LLDebugView(const std::string& name, const LLRect &rect); + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Params() + { + mouse_opaque = false; + } + }; + LLDebugView(const Params&); ~LLDebugView(); - LLFrameStatView* mFrameStatView; + void setStatsVisible(BOOL visible); + LLFastTimerView* mFastTimerView; LLMemoryView* mMemoryView; LLConsole* mDebugConsolep; diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp index 8b0ed39eb03f4c723c413429f142d8c6ec52306e..a720dc46b545f8f2bbbf5508f6b93d1d676a9abc 100644 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -40,6 +40,7 @@ #include "lldir.h" #include "llframetimer.h" #include "lltrans.h" +#include "llwindow.h" // beforeDialog() #if LL_LINUX || LL_SOLARIS # include "llfilepicker.h" diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index f5a66a3a784d2eea649f9cf2548a1f7b9501c5be..f3ef0753e74eacd76c010637eb676e5f8b2fd12a 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -46,7 +46,6 @@ #include "llmemtype.h" #include "llprimitive.h" #include "lldarray.h" -#include "llstat.h" #include "llviewerobject.h" #include "llrect.h" #include "llappviewer.h" // for gFrameTimeSeconds @@ -151,7 +150,7 @@ public: void updateTexture(); void updateMaterial(); - virtual void updateDistance(LLCamera& camera); + virtual void updateDistance(LLCamera& camera, bool force_update); BOOL updateGeometry(BOOL priority); void updateFaceSize(S32 idx); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 80c7d73e6a79cc5122cf43b309b6e149ed8d57d1..51f4bbac5c6db6daca76739275bf5041fece5288 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -95,11 +95,9 @@ static BOOL sRenderingSkinned = FALSE; S32 normal_channel = -1; S32 specular_channel = -1; -LLDrawPoolAvatar::LLDrawPoolAvatar() : -LLFacePool(POOL_AVATAR) +LLDrawPoolAvatar::LLDrawPoolAvatar() : + LLFacePool(POOL_AVATAR) { - //LLDebugVarMessageBox::show("acceleration", &CLOTHING_ACCEL_FORCE_FACTOR, 10.f, 0.1f); - //LLDebugVarMessageBox::show("gravity", &CLOTHING_GRAVITY_EFFECT, 10.f, 0.1f); } //----------------------------------------------------------------------------- @@ -110,7 +108,6 @@ LLDrawPool *LLDrawPoolAvatar::instancePool() return new LLDrawPoolAvatar(); } -BOOL gRenderAvatar = TRUE; S32 LLDrawPoolAvatar::getVertexShaderLevel() const { @@ -288,10 +285,6 @@ void LLDrawPoolAvatar::endShadowPass(S32 pass) void LLDrawPoolAvatar::renderShadow(S32 pass) { LLFastTimer t(LLFastTimer::FTM_SHADOW_AVATAR); - if (!gRenderAvatar) - { - return; - } if (mDrawFace.empty()) { @@ -609,13 +602,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } - - - if (!gRenderAvatar) - { - return; - } - if (mDrawFace.empty() && !single_avatar) { return; @@ -761,10 +747,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) //----------------------------------------------------------------------------- void LLDrawPoolAvatar::renderForSelect() { - if (!gRenderAvatar) - { - return; - } + if (mDrawFace.empty()) { diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index b11dcc1608a3645ba8fee8aaa1fe36a009d26ea5..ed6e55b7bc9ac71f7052cf9a73fe5cc0d11e8f44 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -127,9 +127,9 @@ void LLStandardBumpmap::restoreGL() { // *NOTE: This buffer size is hard coded into scanf() below. char label[2048] = ""; /* Flawfinder: ignore */ - char bump_file[2048] = ""; /* Flawfinder: ignore */ + char bump_image_id[2048] = ""; /* Flawfinder: ignore */ fields_read = fscanf( /* Flawfinder: ignore */ - file, "\n%2047s %2047s", label, bump_file); + file, "\n%2047s %2047s", label, bump_image_id); if( EOF == fields_read ) { break; @@ -140,10 +140,10 @@ void LLStandardBumpmap::restoreGL() return; } -// llinfos << "Loading bumpmap: " << bump_file << " from viewerart" << llendl; +// llinfos << "Loading bumpmap: " << bump_image_id << " from viewerart" << llendl; gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mLabel = label; gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage = - gImageList.getImageFromFile(bump_file, + gImageList.getImage(LLUUID(bump_image_id), TRUE, FALSE, 0, diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 7f21adcc94d95236aa570e2a2d9c30c3dd52c466..a9e0948ecf896882163bad821d7053d742d58504 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -43,7 +43,6 @@ #include "llviewercamera.h" #include "llviewerimagelist.h" #include "llviewerregion.h" -#include "llviewerwindow.h" #include "llvosky.h" #include "llworld.h" // To get water height #include "pipeline.h" @@ -61,8 +60,8 @@ LLDrawPool *LLDrawPoolSky::instancePool() void LLDrawPoolSky::prerender() { - mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT); -// gSky.mVOSkyp->updateGeometry(gSky.mVOSkyp->mDrawable); + mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT); + gSky.mVOSkyp->updateGeometry(gSky.mVOSkyp->mDrawable); } void LLDrawPoolSky::render(S32 pass) @@ -97,7 +96,6 @@ void LLDrawPoolSky::render(S32 pass) } - LLVOSky *voskyp = gSky.mVOSkyp; LLGLSPipelineSkyBox gls_skybox; LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); @@ -120,43 +118,9 @@ void LLDrawPoolSky::render(S32 pass) { renderSkyCubeFace(i); } - - LLFace *hbfaces[3]; - hbfaces[0] = NULL; - hbfaces[1] = NULL; - hbfaces[2] = NULL; - for (S32 curr_face = 0; curr_face < face_count; curr_face++) - { - LLFace* facep = mDrawFace[curr_face]; - if (voskyp->isSameFace(LLVOSky::FACE_SUN, facep)) - { - hbfaces[0] = facep; - } - if (voskyp->isSameFace(LLVOSky::FACE_MOON, facep)) - { - hbfaces[1] = facep; - } - if (voskyp->isSameFace(LLVOSky::FACE_BLOOM, facep)) - { - hbfaces[2] = facep; - } - } LLGLEnable blend(GL_BLEND); - if (hbfaces[2]) - { - // renderSunHalo(hbfaces[2]); - } - if (hbfaces[0]) - { - // renderHeavenlyBody(0, hbfaces[0]); - } - if (hbfaces[1]) - { - // renderHeavenlyBody(1, hbfaces[1]); - } - glPopMatrix(); } @@ -181,35 +145,6 @@ void LLDrawPoolSky::renderSkyCubeFace(U8 side) } } -void LLDrawPoolSky::renderHeavenlyBody(U8 hb, LLFace* face) -{ - if ( !mHB[hb]->getDraw() ) return; - if (! face->getGeomCount()) return; - - LLImageGL* tex = face->getTexture(); - gGL.getTexUnit(0)->bind(tex); - LLColor4 color(mHB[hb]->getInterpColor()); - LLOverrideFaceColor override(this, color); - face->renderIndexed(); -} - - - -void LLDrawPoolSky::renderSunHalo(LLFace* face) -{ - if (! mHB[0]->getDraw()) return; - if (! face->getGeomCount()) return; - - LLImageGL* tex = face->getTexture(); - gGL.getTexUnit(0)->bind(tex); - LLColor4 color(mHB[0]->getInterpColor()); - color.mV[3] = llclamp(mHB[0]->getHaloBrighness(), 0.f, 1.f); - - LLOverrideFaceColor override(this, color); - face->renderIndexed(); -} - - void LLDrawPoolSky::renderForSelect() { } diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 2f2b07232a2d7b80ed0162830c2cb1425bcae646..22634d96b0212433a191c79c50dba34950e76ddb 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -37,7 +37,6 @@ #include "lldrawable.h" #include "llface.h" #include "llsky.h" -#include "llviewerwindow.h" #include "llvotree.h" #include "pipeline.h" #include "llviewercamera.h" diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index ce3425dd9e656d792974714ccc66b51335f3024c..4a593ac4f8e98e0f923f18e631983c1abecfe280 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -45,7 +45,6 @@ #include "lldrawable.h" #include "llface.h" #include "llsky.h" -#include "llviewercamera.h" // to get OGL_TO_CFR_ROTATION #include "llviewerimagelist.h" #include "llviewerregion.h" #include "llvosky.h" diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index 62fcf60e7ff06952cf421d92c10112f973b84c12..1953c2906822968de03e7352387938ba06d9cea0 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -33,7 +33,12 @@ #include "llviewerprecompiledheaders.h" #include "lldynamictexture.h" + +// Linden library includes #include "llglheaders.h" +#include "llwindow.h" // getPosition() + +// Viewer includes #include "llviewerwindow.h" #include "llviewercamera.h" #include "llviewercontrol.h" @@ -174,7 +179,7 @@ void LLDynamicTexture::postRender(BOOL success) } // restore viewport - gViewerWindow->setupViewport(); + gViewerWindow->setup2DViewport(); // restore camera LLViewerCamera::getInstance()->setOrigin(mCamera); diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp index e7403c2903d121e8b9e4fc5810f8cd33dd08d1ed..c0fe327815af91f3e676150f5fb316bf4179bf5c 100644 --- a/indra/newview/lleventnotifier.cpp +++ b/indra/newview/lleventnotifier.cpp @@ -38,6 +38,7 @@ #include "llnotify.h" #include "lleventinfo.h" +#include "llfloaterreg.h" #include "llfloaterdirectory.h" #include "llfloaterworldmap.h" #include "llagent.h" @@ -192,11 +193,11 @@ bool LLEventNotification::handleResponse(const LLSD& notification, const LLSD& r { case 0: gAgent.teleportViaLocation(getEventPosGlobal()); - gFloaterWorldMap->trackLocation(getEventPosGlobal()); + LLFloaterWorldMap::getInstance()->trackLocation(getEventPosGlobal()); break; case 1: gDisplayEventHack = TRUE; - LLFloaterDirectory::showEvents(getEventID()); + LLFloaterReg::showInstance("search", LLSD().insert("panel", "event").insert("id", S32(getEventID()))); break; case 2: break; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 4a551ff261cbe9eedfb9272fc998239e7f306619..8332eec19c9a874f1e8638e446dd4436829b4823 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -46,7 +46,6 @@ #include "lldarrayptr.h" #include "llvertexbuffer.h" #include "llviewerimage.h" -#include "llstat.h" #include "lldrawable.h" class LLFacePool; diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index c9037d0fbbe32ac8d0e4b46f4db06b8e0d0e4915..b373dd2241bd9fcb6317a75c51e6d4c24ca1720f 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -41,6 +41,7 @@ #include "llrender.h" #include "llmath.h" #include "llfontgl.h" +#include "llsdserialize.h" #include "llappviewer.h" #include "llviewerimagelist.h" @@ -49,287 +50,108 @@ #include "llstat.h" #include "llfasttimer.h" - +#include "lltreeiterators.h" +#include "llmetricperformancetester.h" ////////////////////////////////////////////////////////////////////////////// static const S32 MAX_VISIBLE_HISTORY = 10; static const S32 LINE_GRAPH_HEIGHT = 240; -struct ft_display_info { - int timer; - const char *desc; - const LLColor4 *color; - S32 disabled; // initialized to 0 - int level; // calculated based on desc - int parent; // calculated -}; - -static const LLColor4 red0(0.5f, 0.0f, 0.0f, 1.0f); -static const LLColor4 green0(0.0f, 0.5f, 0.0f, 1.0f); -static const LLColor4 blue0(0.0f, 0.0f, 0.5f, 1.0f); -static const LLColor4 blue7(0.0f, 0.0f, 0.5f, 1.0f); - -static const LLColor4 green7(0.6f, 1.0f, 0.4f, 1.0f); -static const LLColor4 green8(0.4f, 1.0f, 0.6f, 1.0f); -static const LLColor4 green9(0.6f, 1.0f, 0.6f, 1.0f); - -// green(6), blue, yellow, orange, pink(2), cyan -// red (5) magenta (4) -static struct ft_display_info ft_display_table[] = -{ - { LLFastTimer::FTM_FRAME, "Frame", &LLColor4::white, 0 }, - { LLFastTimer::FTM_MESSAGES, " System Messages", &LLColor4::grey1, 1 }, - { LLFastTimer::FTM_MOUSEHANDLER, " Mouse", &LLColor4::grey1, 0 }, - { LLFastTimer::FTM_KEYHANDLER, " Keyboard", &LLColor4::grey1, 0 }, - { LLFastTimer::FTM_SLEEP, " Sleep", &LLColor4::grey2, 0 }, - { LLFastTimer::FTM_IDLE, " Idle", &blue0, 0 }, - { LLFastTimer::FTM_PUMP, " Pump", &LLColor4::magenta2, 1 }, - { LLFastTimer::FTM_CURL, " Curl", &LLColor4::magenta3, 0 }, - { LLFastTimer::FTM_INVENTORY, " Inventory Update", &LLColor4::purple6, 1 }, - { LLFastTimer::FTM_AUTO_SELECT, " Open and Select", &LLColor4::red, 0 }, - { LLFastTimer::FTM_FILTER, " Filter", &LLColor4::red2, 0 }, - { LLFastTimer::FTM_ARRANGE, " Arrange", &LLColor4::red3, 0 }, - { LLFastTimer::FTM_REFRESH, " Refresh", &LLColor4::red4, 0 }, - { LLFastTimer::FTM_SORT, " Sort", &LLColor4::red5, 0 }, - { LLFastTimer::FTM_RESET_DRAWORDER, " ResetDrawOrder", &LLColor4::pink1, 0 }, - { LLFastTimer::FTM_WORLD_UPDATE, " World Update", &LLColor4::blue1, 1 }, - { LLFastTimer::FTM_UPDATE_MOVE, " Move Objects", &LLColor4::pink2, 0 }, - { LLFastTimer::FTM_OCTREE_BALANCE, " Octree Balance", &LLColor4::red3, 0 }, - { LLFastTimer::FTM_SIMULATE_PARTICLES, " Particle Sim", &LLColor4::blue4, 0 }, - { LLFastTimer::FTM_OBJECTLIST_UPDATE, " Object Update", &LLColor4::purple1, 1 }, - { LLFastTimer::FTM_AVATAR_UPDATE, " Avatars", &LLColor4::purple2, 0 }, - { LLFastTimer::FTM_JOINT_UPDATE, " Joints", &LLColor4::purple3, 0 }, - { LLFastTimer::FTM_ATTACHMENT_UPDATE, " Attachments", &LLColor4::purple4, 0 }, - { LLFastTimer::FTM_UPDATE_ANIMATION, " Animation", &LLColor4::purple5, 0 }, - { LLFastTimer::FTM_FLEXIBLE_UPDATE, " Flex Update", &LLColor4::pink2, 0 }, - { LLFastTimer::FTM_LOD_UPDATE, " LOD Update", &LLColor4::magenta1, 0 }, - { LLFastTimer::FTM_REGION_UPDATE, " Region Update", &LLColor4::cyan2, 0 }, - { LLFastTimer::FTM_NETWORK, " Network", &LLColor4::orange1, 1 }, - { LLFastTimer::FTM_IDLE_NETWORK, " Decode Msgs", &LLColor4::orange2, 0 }, - { LLFastTimer::FTM_PROCESS_MESSAGES, " Process Msgs", &LLColor4::orange3, 0 }, - { LLFastTimer::FTM_PROCESS_OBJECTS, " Object Updates",&LLColor4::orange4, 0 }, - { LLFastTimer::FTM_CREATE_OBJECT, " Create Obj", &LLColor4::orange5, 0 }, -// { LLFastTimer::FTM_LOAD_AVATAR, " Load Avatar", &LLColor4::pink2, 0 }, - { LLFastTimer::FTM_PROCESS_IMAGES, " Image Updates",&LLColor4::orange6, 0 }, - { LLFastTimer::FTM_PIPELINE, " Pipeline", &LLColor4::magenta4, 0 }, - { LLFastTimer::FTM_CLEANUP, " Cleanup", &LLColor4::cyan3, 0 }, - { LLFastTimer::FTM_AUDIO_UPDATE, " Audio Update", &LLColor4::yellow3, 0 }, - { LLFastTimer::FTM_VFILE_WAIT, " VFile Wait", &LLColor4::cyan6, 0 }, -// { LLFastTimer::FTM_IDLE_CB, " Callbacks", &LLColor4::pink1, 0 }, - { LLFastTimer::FTM_RENDER, " Render", &green0, 1 }, - { LLFastTimer::FTM_PICK, " Pick", &LLColor4::purple, 1 }, - { LLFastTimer::FTM_HUD_EFFECTS, " HUD Effects", &LLColor4::orange1, 0 }, - { LLFastTimer::FTM_HUD_UPDATE, " HUD Update", &LLColor4::orange2, 0 }, - { LLFastTimer::FTM_UPDATE_SKY, " Sky Update", &LLColor4::cyan1, 0 }, - { LLFastTimer::FTM_UPDATE_TEXTURES, " Textures", &LLColor4::pink2, 0 }, - { LLFastTimer::FTM_GEO_UPDATE, " Geo Update", &LLColor4::blue3, 1 }, - { LLFastTimer::FTM_UPDATE_PRIMITIVES, " Volumes", &LLColor4::blue4, 0 }, - { LLFastTimer::FTM_GEN_VOLUME, " Gen Volume", &LLColor4::yellow3, 0 }, - { LLFastTimer::FTM_GEN_FLEX, " Flexible", &LLColor4::yellow4, 0 }, - { LLFastTimer::FTM_GEN_TRIANGLES, " Triangles", &LLColor4::yellow5, 0 }, - { LLFastTimer::FTM_UPDATE_AVATAR, " Avatar", &LLColor4::yellow1, 0 }, - { LLFastTimer::FTM_UPDATE_TREE, " Tree", &LLColor4::yellow2, 0 }, - { LLFastTimer::FTM_UPDATE_TERRAIN, " Terrain", &LLColor4::yellow6, 0 }, - { LLFastTimer::FTM_UPDATE_CLOUDS, " Clouds", &LLColor4::yellow7, 0 }, - { LLFastTimer::FTM_UPDATE_GRASS, " Grass", &LLColor4::yellow8, 0 }, - { LLFastTimer::FTM_UPDATE_WATER, " Water", &LLColor4::yellow9, 0 }, - { LLFastTimer::FTM_GEO_LIGHT, " Lighting", &LLColor4::yellow1, 0 }, - { LLFastTimer::FTM_GEO_SHADOW, " Shadow", &LLColor4::black, 0 }, - { LLFastTimer::FTM_UPDATE_PARTICLES, " Particles", &LLColor4::blue5, 0 }, - { LLFastTimer::FTM_GEO_RESERVE, " Reserve", &LLColor4::blue6, 0 }, - { LLFastTimer::FTM_UPDATE_LIGHTS, " Lights", &LLColor4::yellow2, 0 }, - { LLFastTimer::FTM_GEO_SKY, " Sky", &LLColor4::yellow3, 0 }, - { LLFastTimer::FTM_UPDATE_WLPARAM, " Windlight Param",&LLColor4::magenta2, 0 }, - { LLFastTimer::FTM_CULL, " Object Cull", &LLColor4::blue2, 1 }, - { LLFastTimer::FTM_CULL_REBOUND, " Rebound", &LLColor4::blue3, 0 }, - { LLFastTimer::FTM_FRUSTUM_CULL, " Frustum Cull", &LLColor4::blue4, 0 }, - { LLFastTimer::FTM_OCCLUSION_READBACK, " Occlusion Read", &LLColor4::red2, 0 }, - { LLFastTimer::FTM_IMAGE_UPDATE, " Image Update", &LLColor4::yellow4, 1 }, - { LLFastTimer::FTM_IMAGE_CREATE, " Image CreateGL",&LLColor4::yellow5, 0 }, - { LLFastTimer::FTM_IMAGE_DECODE, " Image Decode", &LLColor4::yellow6, 0 }, - { LLFastTimer::FTM_IMAGE_MARK_DIRTY, " Dirty Textures",&LLColor4::red1, 0 }, - { LLFastTimer::FTM_STATESORT, " State Sort", &LLColor4::orange1, 1 }, - { LLFastTimer::FTM_STATESORT_DRAWABLE, " Drawable", &LLColor4::orange2, 0 }, - { LLFastTimer::FTM_STATESORT_POSTSORT, " Post Sort", &LLColor4::orange3, 0 }, - { LLFastTimer::FTM_REBUILD_OCCLUSION_VB," Occlusion", &LLColor4::cyan5, 0 }, - { LLFastTimer::FTM_REBUILD_VBO, " VBO Rebuild", &LLColor4::red4, 0 }, - { LLFastTimer::FTM_REBUILD_VOLUME_VB, " Volume", &LLColor4::blue1, 0 }, -// { LLFastTimer::FTM_REBUILD_NONE_VB, " Unknown", &LLColor4::cyan5, 0 }, -// { LLFastTimer::FTM_REBUILD_BRIDGE_VB, " Bridge", &LLColor4::blue2, 0 }, -// { LLFastTimer::FTM_REBUILD_HUD_VB, " HUD", &LLColor4::blue3, 0 }, - { LLFastTimer::FTM_REBUILD_TERRAIN_VB, " Terrain", &LLColor4::blue4, 0 }, -// { LLFastTimer::FTM_REBUILD_WATER_VB, " Water", &LLColor4::blue5, 0 }, -// { LLFastTimer::FTM_REBUILD_TREE_VB, " Tree", &LLColor4::cyan1, 0 }, - { LLFastTimer::FTM_REBUILD_PARTICLE_VB, " Particle", &LLColor4::cyan2, 0 }, -// { LLFastTimer::FTM_REBUILD_CLOUD_VB, " Cloud", &LLColor4::cyan3, 0 }, - { LLFastTimer::FTM_REBUILD_GRASS_VB, " Grass", &LLColor4::cyan4, 0 }, - { LLFastTimer::FTM_SHADOW_RENDER, " Shadow", &LLColor4::green5, 1 }, - { LLFastTimer::FTM_SHADOW_SIMPLE, " Simple", &LLColor4::yellow2, 1 }, - { LLFastTimer::FTM_SHADOW_ALPHA, " Alpha", &LLColor4::yellow6, 1 }, - { LLFastTimer::FTM_SHADOW_TERRAIN, " Terrain", &LLColor4::green6, 1 }, - { LLFastTimer::FTM_SHADOW_AVATAR, " Avatar", &LLColor4::yellow1, 1 }, - { LLFastTimer::FTM_SHADOW_TREE, " Tree", &LLColor4::yellow8, 1 }, - { LLFastTimer::FTM_RENDER_GEOMETRY, " Geometry", &LLColor4::green2, 1 }, - { LLFastTimer::FTM_POOLS, " Pools", &LLColor4::green3, 1 }, - { LLFastTimer::FTM_POOLRENDER, " RenderPool", &LLColor4::green4, 1 }, - { LLFastTimer::FTM_RENDER_TERRAIN, " Terrain", &LLColor4::green6, 0 }, - { LLFastTimer::FTM_RENDER_CHARACTERS, " Avatars", &LLColor4::yellow1, 0 }, - { LLFastTimer::FTM_RENDER_SIMPLE, " Simple", &LLColor4::yellow2, 0 }, - { LLFastTimer::FTM_RENDER_FULLBRIGHT, " Fullbright", &LLColor4::yellow5, 0 }, - { LLFastTimer::FTM_RENDER_GLOW, " Glow", &LLColor4::orange1, 0 }, - { LLFastTimer::FTM_RENDER_GRASS, " Grass", &LLColor4::yellow6, 0 }, - { LLFastTimer::FTM_RENDER_INVISIBLE, " Invisible", &LLColor4::red2, 0 }, - { LLFastTimer::FTM_RENDER_SHINY, " Shiny", &LLColor4::yellow3, 0 }, - { LLFastTimer::FTM_RENDER_BUMP, " Bump", &LLColor4::yellow4, 0 }, - { LLFastTimer::FTM_RENDER_TREES, " Trees", &LLColor4::yellow8, 0 }, - { LLFastTimer::FTM_RENDER_OCCLUSION, " Occlusion", &LLColor4::red1, 0 }, - { LLFastTimer::FTM_RENDER_CLOUDS, " Clouds", &LLColor4::yellow5, 0 }, - { LLFastTimer::FTM_RENDER_ALPHA, " Alpha", &LLColor4::yellow6, 0 }, - { LLFastTimer::FTM_RENDER_HUD, " HUD", &LLColor4::yellow7, 0 }, - { LLFastTimer::FTM_RENDER_WATER, " Water", &LLColor4::yellow9, 0 }, - { LLFastTimer::FTM_RENDER_WL_SKY, " WL Sky", &LLColor4::blue3, 0 }, - { LLFastTimer::FTM_RENDER_FAKE_VBO_UPDATE," Fake VBO update", &LLColor4::red2, 0 }, - { LLFastTimer::FTM_RENDER_BLOOM, " Bloom", &LLColor4::blue4, 0 }, - { LLFastTimer::FTM_RENDER_BLOOM_FBO, " First FBO", &LLColor4::blue, 0 }, - { LLFastTimer::FTM_RENDER_UI, " UI", &LLColor4::cyan4, 1 }, - { LLFastTimer::FTM_RENDER_TIMER, " Timers", &LLColor4::cyan5, 1, 0 }, - { LLFastTimer::FTM_RENDER_FONTS, " Fonts", &LLColor4::pink1, 0 }, - { LLFastTimer::FTM_SWAP, " Swap", &LLColor4::pink2, 0 }, - { LLFastTimer::FTM_CLIENT_COPY, " Client Copy", &LLColor4::red1, 1}, - -#if 0 || !LL_RELEASE_FOR_DOWNLOAD - { LLFastTimer::FTM_TEMP1, " Temp1", &LLColor4::red1, 0 }, - { LLFastTimer::FTM_TEMP2, " Temp2", &LLColor4::magenta1, 0 }, - { LLFastTimer::FTM_TEMP3, " Temp3", &LLColor4::red2, 0 }, - { LLFastTimer::FTM_TEMP4, " Temp4", &LLColor4::magenta2, 0 }, - { LLFastTimer::FTM_TEMP5, " Temp5", &LLColor4::red3, 0 }, - { LLFastTimer::FTM_TEMP6, " Temp6", &LLColor4::magenta3, 0 }, - { LLFastTimer::FTM_TEMP7, " Temp7", &LLColor4::red4, 0 }, - { LLFastTimer::FTM_TEMP8, " Temp8", &LLColor4::magenta4, 0 }, -#endif - - { LLFastTimer::FTM_OTHER, " Other", &red0 } -}; -static int ft_display_didcalc = 0; -static const int FTV_DISPLAY_NUM = LL_ARRAY_SIZE(ft_display_table); +//static const int FTV_DISPLAY_NUM = (sizeof(ft_display_table)/sizeof(ft_display_table[0])); +static S32 FTV_NUM_TIMERS; +const S32 FTV_MAX_DEPTH = 8; + +std::vector<LLFastTimer::NamedTimer*> ft_display_idx; // line of table entry for display purposes (for collapse) + +typedef LLTreeDFSIter<LLFastTimer::NamedTimer, LLFastTimer::NamedTimer::child_const_iter> timer_tree_iterator_t; -S32 ft_display_idx[FTV_DISPLAY_NUM]; // line of table entry for display purposes (for collapse) +BOOL LLFastTimerView::sAnalyzePerformance = FALSE; + +static timer_tree_iterator_t begin_timer_tree(LLFastTimer::NamedTimer& id) +{ + return timer_tree_iterator_t(&id, + boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::beginChildren), _1), + boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::endChildren), _1)); +} + +static timer_tree_iterator_t end_timer_tree() +{ + return timer_tree_iterator_t(); +} -LLFastTimerView::LLFastTimerView(const std::string& name, const LLRect& rect) - : LLFloater(name, rect, std::string("Fast Timers")) +LLFastTimerView::LLFastTimerView(const LLRect& rect) +: LLFloater(), + mHoverTimer(NULL) { + setRect(rect); setVisible(FALSE); mDisplayMode = 0; mAvgCountTotal = 0; mMaxCountTotal = 0; - mDisplayCenter = 1; + mDisplayCenter = ALIGN_CENTER; mDisplayCalls = 0; mDisplayHz = 0; mScrollIndex = 0; - mHoverIndex = -1; + mHoverID = NULL; mHoverBarIndex = -1; - mBarStart = new S32[(MAX_VISIBLE_HISTORY + 1) * FTV_DISPLAY_NUM]; - memset(mBarStart, 0, (MAX_VISIBLE_HISTORY + 1) * FTV_DISPLAY_NUM * sizeof(S32)); - mBarEnd = new S32[(MAX_VISIBLE_HISTORY + 1) * FTV_DISPLAY_NUM]; - memset(mBarEnd, 0, (MAX_VISIBLE_HISTORY + 1) * FTV_DISPLAY_NUM * sizeof(S32)); - mSubtractHidden = 0; + FTV_NUM_TIMERS = LLFastTimer::NamedTimer::instanceCount(); mPrintStats = -1; - - // One-time setup - if (!ft_display_didcalc) - { - int pidx[FTV_DISPLAY_NUM]; - int pdisabled[FTV_DISPLAY_NUM]; - for (S32 i=0; i < FTV_DISPLAY_NUM; i++) - { - int level = 0; - const char *text = ft_display_table[i].desc; - while(text[0] == ' ') - { - text++; - level++; - } - llassert(level < FTV_DISPLAY_NUM); - ft_display_table[i].desc = text; - ft_display_table[i].level = level; - if (level > 0) - { - ft_display_table[i].parent = pidx[level-1]; - if (pdisabled[level-1]) - { - ft_display_table[i].disabled = 3; - } - } - else - { - ft_display_table[i].parent = -1; - } - ft_display_idx[i] = i; - pidx[level] = i; - pdisabled[level] = ft_display_table[i].disabled; - } - ft_display_didcalc = 1; - } } -LLFastTimerView::~LLFastTimerView() -{ - delete[] mBarStart; - delete[] mBarEnd; -} BOOL LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask) { - if (mBarRect.pointInRect(x, y)) + if (mHoverTimer ) + { + // right click collapses timers + if (!mHoverTimer->getCollapsed()) + { + mHoverTimer->setCollapsed(true); + } + else if (mHoverTimer->getParent()) + { + mHoverTimer->getParent()->setCollapsed(true); + } + } + else if (mBarRect.pointInRect(x, y)) { S32 bar_idx = MAX_VISIBLE_HISTORY - ((y - mBarRect.mBottom) * (MAX_VISIBLE_HISTORY + 2) / mBarRect.getHeight()); bar_idx = llclamp(bar_idx, 0, MAX_VISIBLE_HISTORY); mPrintStats = bar_idx; -// return TRUE; // for now, pass all mouse events through } return FALSE; } -S32 LLFastTimerView::getLegendIndex(S32 y) +LLFastTimer::NamedTimer* LLFastTimerView::getLegendID(S32 y) { S32 idx = (getRect().getHeight() - y) / ((S32) LLFontGL::getFontMonospace()->getLineHeight()+2) - 5; - if (idx >= 0 && idx < FTV_DISPLAY_NUM) + + if (idx >= 0 && idx < (S32)ft_display_idx.size()) { return ft_display_idx[idx]; } - return -1; + return NULL; } BOOL LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask) { if (x < mBarRect.mLeft) { - S32 legend_index = getLegendIndex(y); - if (legend_index >= 0 && legend_index < FTV_DISPLAY_NUM) + LLFastTimer::NamedTimer* idp = getLegendID(y); + if (idp) { - S32 disabled = ft_display_table[legend_index].disabled; - if (++disabled > 2) - disabled = 0; - ft_display_table[legend_index].disabled = disabled; - S32 level = ft_display_table[legend_index].level; - - // propagate enable/disable to all children - legend_index++; - while (legend_index < FTV_DISPLAY_NUM && ft_display_table[legend_index].level > level) - { - ft_display_table[legend_index].disabled = disabled ? 3 : 0; - legend_index++; - } + idp->setCollapsed(!idp->getCollapsed()); } } + else if (mHoverTimer) + { + //left click drills down by expanding timers + mHoverTimer->setCollapsed(false); + } else if (mask & MASK_ALT) { - if (mask & MASK_SHIFT) - { - mSubtractHidden = !mSubtractHidden; - } - else if (mask & MASK_CONTROL) + if (mask & MASK_CONTROL) { mDisplayHz = !mDisplayHz; } @@ -345,8 +167,7 @@ BOOL LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask) } else if (mask & MASK_CONTROL) { - if (++mDisplayCenter > 2) - mDisplayCenter = 0; + mDisplayCenter = (ChildAlignment)((mDisplayCenter + 1) % ALIGN_COUNT); } else { @@ -367,13 +188,14 @@ BOOL LLFastTimerView::handleMouseUp(S32 x, S32 y, MASK mask) return FALSE; } - BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) { + mHoverTimer = NULL; + mHoverID = NULL; + if(LLFastTimer::sPauseHistory && mBarRect.pointInRect(x, y)) { - mHoverIndex = -1; - mHoverBarIndex = MAX_VISIBLE_HISTORY - ((y - mBarRect.mBottom) * (MAX_VISIBLE_HISTORY + 2) / mBarRect.getHeight()); + mHoverBarIndex = llmin(LLFastTimer::getCurFrameIndex() - 1, MAX_VISIBLE_HISTORY - ((y - mBarRect.mBottom) * (MAX_VISIBLE_HISTORY + 2) / mBarRect.getHeight())); if (mHoverBarIndex == 0) { return TRUE; @@ -382,39 +204,88 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) { mHoverBarIndex = 0; } - for (S32 i = 0; i < FTV_DISPLAY_NUM; i++) + + S32 i = 0; + for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + it != end_timer_tree(); + ++it, ++i) { - if (x > mBarStart[mHoverBarIndex * FTV_DISPLAY_NUM + i] && - x < mBarEnd[mHoverBarIndex * FTV_DISPLAY_NUM + i] && - ft_display_table[i].disabled <= 1) + // is mouse over bar for this timer? + if (x > mBarStart[mHoverBarIndex][i] && + x < mBarEnd[mHoverBarIndex][i]) + { + mHoverID = (*it); + mHoverTimer = (*it); + mToolTipRect.set(mBarStart[mHoverBarIndex][i], + mBarRect.mBottom + llround(((F32)mHoverBarIndex + 1.f) * ((F32)mBarRect.getHeight() / ((F32)MAX_VISIBLE_HISTORY + 2.f))), + mBarEnd[mHoverBarIndex][i], + mBarRect.mBottom + llround((F32)mHoverBarIndex * ((F32)mBarRect.getHeight() / ((F32)MAX_VISIBLE_HISTORY + 2.f)))); + } + + if ((*it)->getCollapsed()) { - mHoverIndex = i; + it.skipDescendants(); } } } else if (x < mBarRect.mLeft) { - S32 legend_index = getLegendIndex(y); - if (legend_index >= 0 && legend_index < FTV_DISPLAY_NUM) + LLFastTimer::NamedTimer* timer_id = getLegendID(y); + if (timer_id) { - mHoverIndex = legend_index; + mHoverID = timer_id; } } return FALSE; } + +BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) +{ + if(LLFastTimer::sPauseHistory && mBarRect.pointInRect(x, y)) + { + // tooltips for timer bars + if (mHoverTimer) + { + msg = mHoverTimer->getToolTip(LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex); + return TRUE; + } + } + else + { + // tooltips for timer legend + if (x < mBarRect.mLeft) + { + LLFastTimer::NamedTimer* idp = getLegendID(y); + if (idp) + { + msg = idp->getToolTip(); + return TRUE; + } + } + + } + + return FALSE; +} + BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks) { LLFastTimer::sPauseHistory = TRUE; mScrollIndex = llclamp(mScrollIndex - clicks, - 0, llmin(LLFastTimer::sLastFrameIndex, (S32)LLFastTimer::FTM_HISTORY_NUM-MAX_VISIBLE_HISTORY)); + 0, + llmin(LLFastTimer::getLastFrameIndex(), (S32)LLFastTimer::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY)); return TRUE; } +static LLFastTimer::DeclareTimer FTM_RENDER_TIMER("Timers", true); + +static std::map<LLFastTimer::NamedTimer*, LLColor4> sTimerColors; + void LLFastTimerView::draw() { - LLFastTimer t(LLFastTimer::FTM_RENDER_TIMER); + LLFastTimer t(FTM_RENDER_TIMER); std::string tdesc; @@ -433,47 +304,9 @@ void LLFastTimerView::draw() S32 texth, textw; LLPointer<LLUIImage> box_imagep = LLUI::getUIImage("rounded_square.tga"); - // Make sure all timers are accounted for - // Set 'FTM_OTHER' to unaccounted ticks last frame - { - S32 display_timer[LLFastTimer::FTM_NUM_TYPES]; - S32 hidx = LLFastTimer::sLastFrameIndex % LLFastTimer::FTM_HISTORY_NUM; - for (S32 i=0; i < LLFastTimer::FTM_NUM_TYPES; i++) - { - display_timer[i] = 0; - } - for (S32 i=0; i < FTV_DISPLAY_NUM; i++) - { - S32 tidx = ft_display_table[i].timer; - display_timer[tidx] = 1; - } - LLFastTimer::sCountHistory[hidx][LLFastTimer::FTM_OTHER] = 0; - LLFastTimer::sCallHistory[hidx][LLFastTimer::FTM_OTHER] = 0; - for (S32 tidx = 0; tidx < LLFastTimer::FTM_NUM_TYPES; tidx++) - { - U64 counts = LLFastTimer::sCountHistory[hidx][tidx]; - if (counts > 0 && display_timer[tidx] == 0) - { - LLFastTimer::sCountHistory[hidx][LLFastTimer::FTM_OTHER] += counts; - LLFastTimer::sCallHistory[hidx][LLFastTimer::FTM_OTHER] += 1; - } - } - LLFastTimer::sCountAverage[LLFastTimer::FTM_OTHER] = 0; - LLFastTimer::sCallAverage[LLFastTimer::FTM_OTHER] = 0; - for (S32 h = 0; h < LLFastTimer::FTM_HISTORY_NUM; h++) - { - LLFastTimer::sCountAverage[LLFastTimer::FTM_OTHER] += LLFastTimer::sCountHistory[h][LLFastTimer::FTM_OTHER]; - LLFastTimer::sCallAverage[LLFastTimer::FTM_OTHER] += LLFastTimer::sCallHistory[h][LLFastTimer::FTM_OTHER]; - } - LLFastTimer::sCountAverage[LLFastTimer::FTM_OTHER] /= LLFastTimer::FTM_HISTORY_NUM; - LLFastTimer::sCallAverage[LLFastTimer::FTM_OTHER] /= LLFastTimer::FTM_HISTORY_NUM; - } - // Draw the window background - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.f, 0.f, 0.f, 0.25f)); - } + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.f, 0.f, 0.f, 0.25f)); S32 xleft = margin; S32 ytop = margin; @@ -512,148 +345,135 @@ void LLFastTimerView::draw() y -= (texth + 2); } - // Calc the total ticks - S32 histmax = llmin(LLFastTimer::sLastFrameIndex+1, MAX_VISIBLE_HISTORY); - U64 ticks_sum[LLFastTimer::FTM_HISTORY_NUM+1][FTV_DISPLAY_NUM]; - for (S32 j=-1; j<LLFastTimer::FTM_HISTORY_NUM; j++) - { - S32 hidx; - if (j >= 0) - hidx = (LLFastTimer::sLastFrameIndex+j) % LLFastTimer::FTM_HISTORY_NUM; - else - hidx = -1; - - // calculate tick info by adding child ticks to parents - for (S32 i=0; i < FTV_DISPLAY_NUM; i++) - { - if (mSubtractHidden && ft_display_table[i].disabled > 1) - { - continue; - } - // Get ticks - S32 tidx = ft_display_table[i].timer; - if (hidx >= 0) - ticks_sum[j+1][i] = LLFastTimer::sCountHistory[hidx][tidx]; - else - ticks_sum[j+1][i] = LLFastTimer::sCountAverage[tidx]; - S32 pidx = ft_display_table[i].parent; - // Add ticks to parents - while (pidx >= 0) - { - ticks_sum[j+1][pidx] += ticks_sum[j+1][i]; - pidx = ft_display_table[pidx].parent; - } - } - } + S32 histmax = llmin(LLFastTimer::getLastFrameIndex()+1, MAX_VISIBLE_HISTORY); // Draw the legend - - S32 legendwidth = 0; xleft = margin; ytop = y; y -= (texth + 2); - S32 cur_line = 0; - S32 display_line[FTV_DISPLAY_NUM]; - for (S32 i=0; i<FTV_DISPLAY_NUM; i++) + sTimerColors[&LLFastTimer::NamedTimer::getRootNamedTimer()] = LLColor4::grey; + + F32 hue = 0.f; + + for (timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + it != timer_tree_iterator_t(); + ++it) { - S32 disabled = ft_display_table[i].disabled; - if (disabled == 3) - { - continue; // skip row - } - display_line[i] = cur_line; - ft_display_idx[cur_line] = i; - cur_line++; - S32 level = ft_display_table[i].level; - S32 parent = ft_display_table[i].parent; - - x = xleft; + LLFastTimer::NamedTimer* idp = (*it); - left = x; right = x + texth; - top = y; bottom = y - texth; - S32 scale_offset = 0; - if (i == mHoverIndex) - { - scale_offset = llfloor(sinf(mHighlightTimer.getElapsedTimeF32() * 6.f) * 2.f); - } - gl_rect_2d(left - scale_offset, top + scale_offset, right + scale_offset, bottom - scale_offset, *ft_display_table[i].color); + const F32 HUE_INCREMENT = 0.23f; + hue = fmodf(hue + HUE_INCREMENT, 1.f); + // saturation increases with depth + F32 saturation = clamp_rescale((F32)idp->getDepth(), 0.f, 3.f, 0.f, 1.f); + // lightness alternates with depth + F32 lightness = idp->getDepth() % 2 ? 0.5f : 0.6f; - int tidx = ft_display_table[i].timer; - F32 ms = 0; - S32 calls = 0; - if (mHoverBarIndex > 0 && mHoverIndex >= 0) - { - S32 hidx = (LLFastTimer::sLastFrameIndex + (mHoverBarIndex - 1) - mScrollIndex) % LLFastTimer::FTM_HISTORY_NUM; - S32 bidx = LLFastTimer::FTM_HISTORY_NUM - mScrollIndex - mHoverBarIndex; - U64 ticks = ticks_sum[bidx+1][i]; // : LLFastTimer::sCountHistory[hidx][tidx]; - ms = (F32)((F64)ticks * iclock_freq); - calls = (S32)LLFastTimer::sCallHistory[hidx][tidx]; - } - else - { - U64 ticks = ticks_sum[0][i]; - ms = (F32)((F64)ticks * iclock_freq); - calls = (S32)LLFastTimer::sCallAverage[tidx]; - } - if (mDisplayCalls) - { - tdesc = llformat("%s (%d)",ft_display_table[i].desc,calls); - } - else - { - tdesc = llformat("%s [%.1f]",ft_display_table[i].desc,ms); - } - dx = (texth+4) + level*8; + LLColor4 child_color; + child_color.setHSL(hue, saturation, lightness); + + sTimerColors[idp] = child_color; + } - LLColor4 color = disabled > 1 ? LLColor4::grey : LLColor4::white; - if (level > 0) + const S32 LEGEND_WIDTH = 220; + { + LLLocalClipRect clip(LLRect(margin, y, LEGEND_WIDTH, margin)); + S32 cur_line = 0; + ft_display_idx.clear(); + std::map<LLFastTimer::NamedTimer*, S32> display_line; + for (timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + it != timer_tree_iterator_t(); + ++it) { - S32 line_start_y = (top + bottom) / 2; - S32 line_end_y = line_start_y + ((texth + 2) * (display_line[i] - display_line[parent])) - (texth / 2); - gl_line_2d(x + dx - 8, line_start_y, x + dx, line_start_y, color); - S32 line_x = x + (texth + 4) + ((level - 1) * 8); - gl_line_2d(line_x, line_start_y, line_x, line_end_y, color); - if (disabled == 1) + LLFastTimer::NamedTimer* idp = (*it); + display_line[idp] = cur_line; + ft_display_idx.push_back(idp); + cur_line++; + + x = xleft; + + left = x; right = x + texth; + top = y; bottom = y - texth; + S32 scale_offset = 0; + if (idp == mHoverID) { - gl_line_2d(line_x+4, line_start_y-3, line_x+4, line_start_y+4, color); + scale_offset = llfloor(sinf(mHighlightTimer.getElapsedTimeF32() * 6.f) * 2.f); } - } + gl_rect_2d(left - scale_offset, top + scale_offset, right + scale_offset, bottom - scale_offset, sTimerColors[idp]); - x += dx; - BOOL is_child_of_hover_item = (i == mHoverIndex); - S32 next_parent = ft_display_table[i].parent; - while(!is_child_of_hover_item && next_parent >= 0) - { - is_child_of_hover_item = (mHoverIndex == next_parent); - next_parent = ft_display_table[next_parent].parent; - } + F32 ms = 0; + S32 calls = 0; + if (mHoverBarIndex > 0 && mHoverID) + { + S32 hidx = LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex; + U64 ticks = idp->getHistoricalCount(hidx); + ms = (F32)((F64)ticks * iclock_freq); + calls = (S32)idp->getHistoricalCalls(hidx); + } + else + { + U64 ticks = idp->getCountAverage(); + ms = (F32)((F64)ticks * iclock_freq); + calls = (S32)idp->getCallAverage(); + } - if (is_child_of_hover_item) - { - LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::BOLD); - } - else - { - LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, color, LLFontGL::LEFT, LLFontGL::TOP); - } - y -= (texth + 2); + if (mDisplayCalls) + { + tdesc = llformat("%s (%d)",idp->getName().c_str(),calls); + } + else + { + tdesc = llformat("%s [%.1f]",idp->getName().c_str(),ms); + } + dx = (texth+4) + idp->getDepth()*8; - textw = dx + LLFontGL::getFontMonospace()->getWidth(std::string(ft_display_table[i].desc)) + 40; - if (textw > legendwidth) - legendwidth = textw; - } - for (S32 i=cur_line; i<FTV_DISPLAY_NUM; i++) - { - ft_display_idx[i] = -1; + LLColor4 color = LLColor4::white; + if (idp->getDepth() > 0) + { + S32 line_start_y = (top + bottom) / 2; + S32 line_end_y = line_start_y + ((texth + 2) * (cur_line - display_line[idp->getParent()])) - texth; + gl_line_2d(x + dx - 8, line_start_y, x + dx, line_start_y, color); + S32 line_x = x + (texth + 4) + ((idp->getDepth() - 1) * 8); + gl_line_2d(line_x, line_start_y, line_x, line_end_y, color); + if (idp->getCollapsed() && !idp->getChildren().empty()) + { + gl_line_2d(line_x+4, line_start_y-3, line_x+4, line_start_y+4, color); + } + } + + x += dx; + BOOL is_child_of_hover_item = (idp == mHoverID); + LLFastTimer::NamedTimer* next_parent = idp->getParent(); + while(!is_child_of_hover_item && next_parent) + { + is_child_of_hover_item = (mHoverID == next_parent); + next_parent = next_parent->getParent(); + } + + LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, + x, y, + color, + LLFontGL::LEFT, LLFontGL::TOP, + is_child_of_hover_item ? LLFontGL::BOLD : LLFontGL::NORMAL); + + y -= (texth + 2); + + textw = dx + LLFontGL::getFontMonospace()->getWidth(idp->getName()) + 40; + + if (idp->getCollapsed()) + { + it.skipDescendants(); + } + } } - xleft += legendwidth + 8; + + xleft += LEGEND_WIDTH + 8; // ytop = ytop; // update rectangle that includes timer bars mBarRect.mLeft = xleft; - mBarRect.mRight = getRect().mRight - xleft; + mBarRect.mRight = getRect().getWidth(); mBarRect.mTop = ytop - ((S32)LLFontGL::getFontMonospace()->getLineHeight() + 4); mBarRect.mBottom = margin + LINE_GRAPH_HEIGHT; @@ -665,25 +485,18 @@ void LLFastTimerView::draw() barw = width - xleft - margin; // Draw the history bars - if (LLFastTimer::sLastFrameIndex >= 0) + if (LLFastTimer::getLastFrameIndex() >= 0) { + LLLocalClipRect clip(LLRect(xleft, ytop - margin, getRect().getWidth() - margin, margin)); + U64 totalticks; if (!LLFastTimer::sPauseHistory) { - U64 ticks = 0; - int hidx = (LLFastTimer::sLastFrameIndex - mScrollIndex) % LLFastTimer::FTM_HISTORY_NUM; - for (S32 i=0; i<FTV_DISPLAY_NUM; i++) - { - if (mSubtractHidden && ft_display_table[i].disabled > 1) - { - continue; - } - int tidx = ft_display_table[i].timer; - ticks += LLFastTimer::sCountHistory[hidx][tidx]; - } - if (LLFastTimer::sCurFrameIndex >= 10) + U64 ticks = LLFastTimer::NamedTimer::getRootNamedTimer().getHistoricalCount(mScrollIndex); + + if (LLFastTimer::getCurFrameIndex() >= 10) { - U64 framec = LLFastTimer::sCurFrameIndex; + U64 framec = LLFastTimer::getCurFrameIndex(); U64 avg = (U64)mAvgCountTotal; mAvgCountTotal = (avg*framec + ticks) / (framec + 1); if (ticks > mMaxCountTotal) @@ -691,11 +504,13 @@ void LLFastTimerView::draw() mMaxCountTotal = ticks; } } -#if 1 + if (ticks < mAvgCountTotal/100 || ticks > mAvgCountTotal*100) - LLFastTimer::sResetHistory = 1; -#endif - if (LLFastTimer::sCurFrameIndex < 10 || LLFastTimer::sResetHistory) + { + LLFastTimer::sResetHistory = true; + } + + if (LLFastTimer::getCurFrameIndex() < 10 || LLFastTimer::sResetHistory) { mAvgCountTotal = ticks; mMaxCountTotal = ticks; @@ -716,16 +531,8 @@ void LLFastTimerView::draw() totalticks = 0; for (S32 j=0; j<histmax; j++) { - U64 ticks = 0; - for (S32 i=0; i<FTV_DISPLAY_NUM; i++) - { - if (mSubtractHidden && ft_display_table[i].disabled > 1) - { - continue; - } - int tidx = ft_display_table[i].timer; - ticks += LLFastTimer::sCountHistory[j][tidx]; - } + U64 ticks = LLFastTimer::NamedTimer::getRootNamedTimer().getHistoricalCount(j); + if (ticks > totalticks) totalticks = ticks; } @@ -798,18 +605,23 @@ void LLFastTimerView::draw() gl_rect_2d(graph_rect, FALSE); } + mBarStart.clear(); + mBarEnd.clear(); + // Draw bars for each history entry // Special: -1 = show running average gGL.getTexUnit(0)->bind(box_imagep->getImage()); for (S32 j=-1; j<histmax && y > LINE_GRAPH_HEIGHT; j++) { - int sublevel_dx[FTV_DISPLAY_NUM+1]; - int sublevel_left[FTV_DISPLAY_NUM+1]; - int sublevel_right[FTV_DISPLAY_NUM+1]; + mBarStart.push_back(std::vector<S32>()); + mBarEnd.push_back(std::vector<S32>()); + int sublevel_dx[FTV_MAX_DEPTH]; + int sublevel_left[FTV_MAX_DEPTH]; + int sublevel_right[FTV_MAX_DEPTH]; S32 tidx; if (j >= 0) { - tidx = LLFastTimer::FTM_HISTORY_NUM - j - 1 - mScrollIndex; + tidx = LLFastTimer::NamedTimer::HISTORY_NUM - j - 1 - mScrollIndex; } else { @@ -819,88 +631,75 @@ void LLFastTimerView::draw() x = xleft; // draw the bars for each stat - int xpos[FTV_DISPLAY_NUM+1]; - int deltax[FTV_DISPLAY_NUM+1]; - xpos[0] = xleft; + std::vector<S32> xpos; + std::vector<S32> deltax; + xpos.push_back(xleft); + + LLFastTimer::NamedTimer* prev_id = NULL; - for (S32 i = 0; i < FTV_DISPLAY_NUM; i++) + S32 i = 0; + for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + it != end_timer_tree(); + ++it, ++i) { - if (ft_display_table[i].disabled > 1) - { - continue; - } - - F32 frac = (F32)ticks_sum[tidx+1][i] / (F32)totalticks; + LLFastTimer::NamedTimer* idp = (*it); + F32 frac = tidx == -1 + ? (F32)idp->getCountAverage() / (F32)totalticks + : (F32)idp->getHistoricalCount(tidx) / (F32)totalticks; dx = llround(frac * (F32)barw); - deltax[i] = dx; + S32 prev_delta_x = deltax.empty() ? 0 : deltax.back(); + deltax.push_back(dx); - int level = ft_display_table[i].level; - int parent = ft_display_table[i].parent; - llassert(level < FTV_DISPLAY_NUM); - llassert(parent < FTV_DISPLAY_NUM); + int level = idp->getDepth() - 1; - left = xpos[level]; - - S32 prev_idx = i - 1; - while (prev_idx > 0) - { - if (ft_display_table[prev_idx].disabled <= 1) - { - break; - } - prev_idx--; - } - S32 next_idx = i + 1; - while (next_idx < FTV_DISPLAY_NUM) + while ((S32)xpos.size() > level + 1) { - if (ft_display_table[next_idx].disabled <= 1) - { - break; - } - next_idx++; + xpos.pop_back(); } - + left = xpos.back(); + if (level == 0) - { + { sublevel_left[level] = xleft; sublevel_dx[level] = dx; sublevel_right[level] = sublevel_left[level] + sublevel_dx[level]; - } - else if (i==0 || ft_display_table[prev_idx].level < level) + } + else if (prev_id && prev_id->getDepth() < idp->getDepth()) { - // If we are the first entry at a new sublevel block, calc the - // total width of this sublevel and modify left to align block. - U64 sublevelticks = ticks_sum[tidx+1][i]; - for (S32 k=i+1; k<FTV_DISPLAY_NUM; k++) - { - if (ft_display_table[k].level < level) - break; - if (ft_display_table[k].disabled <= 1 && ft_display_table[k].level == level) - sublevelticks += ticks_sum[tidx+1][k]; - } - F32 subfrac = (F32)sublevelticks / (F32)totalticks; + U64 sublevelticks = 0; + + for (LLFastTimer::NamedTimer::child_const_iter it = prev_id->beginChildren(); + it != prev_id->endChildren(); + ++it) + { + sublevelticks += (tidx == -1) + ? (*it)->getCountAverage() + : (*it)->getHistoricalCount(tidx); + } + + F32 subfrac = (F32)sublevelticks / (F32)totalticks; sublevel_dx[level] = (int)(subfrac * (F32)barw + .5f); - if (mDisplayCenter == 1) // center aligned + if (mDisplayCenter == ALIGN_CENTER) { - left += (deltax[parent] - sublevel_dx[level])/2; + left += (prev_delta_x - sublevel_dx[level])/2; } - else if (mDisplayCenter == 2) // right aligned + else if (mDisplayCenter == ALIGN_RIGHT) { - left += (deltax[parent] - sublevel_dx[level]); - } + left += (prev_delta_x - sublevel_dx[level]); + } sublevel_left[level] = left; sublevel_right[level] = sublevel_left[level] + sublevel_dx[level]; } right = left + dx; - xpos[level] = right; - xpos[level+1] = left; + xpos.back() = right; + xpos.push_back(left); - mBarStart[(j + 1) * FTV_DISPLAY_NUM + i] = left; - mBarEnd[(j + 1) * FTV_DISPLAY_NUM + i] = right; + mBarStart.back().push_back(left); + mBarEnd.back().push_back(right); top = y; bottom = y - barh; @@ -908,23 +707,23 @@ void LLFastTimerView::draw() if (right > left) { //U32 rounded_edges = 0; - LLColor4 color = *ft_display_table[i].color; + LLColor4 color = sTimerColors[idp];//*ft_display_table[i].color; S32 scale_offset = 0; - BOOL is_child_of_hover_item = (i == mHoverIndex); - S32 next_parent = ft_display_table[i].parent; - while(!is_child_of_hover_item && next_parent >= 0) + BOOL is_child_of_hover_item = (idp == mHoverID); + LLFastTimer::NamedTimer* next_parent = idp->getParent(); + while(!is_child_of_hover_item && next_parent) { - is_child_of_hover_item = (mHoverIndex == next_parent); - next_parent = ft_display_table[next_parent].parent; + is_child_of_hover_item = (mHoverID == next_parent); + next_parent = next_parent->getParent(); } - if (i == mHoverIndex) + if (idp == mHoverID) { scale_offset = llfloor(sinf(mHighlightTimer.getElapsedTimeF32() * 6.f) * 3.f); //color = lerp(color, LLColor4::black, -0.4f); } - else if (mHoverIndex >= 0 && !is_child_of_hover_item) + else if (mHoverID != NULL && !is_child_of_hover_item) { color = lerp(color, LLColor4::grey, 0.8f); } @@ -935,7 +734,13 @@ void LLFastTimerView::draw() gl_segmented_rect_2d_fragment_tex(sublevel_left[level], top - level + scale_offset, sublevel_right[level], bottom + level - scale_offset, box_imagep->getTextureWidth(), box_imagep->getTextureHeight(), 16, start_fragment, end_fragment); } - + + if ((*it)->getCollapsed()) + { + it.skipDescendants(); + } + + prev_id = idp; } y -= (barh + dy); if (j < 0) @@ -970,10 +775,10 @@ void LLFastTimerView::draw() //highlight visible range { - S32 first_frame = LLFastTimer::FTM_HISTORY_NUM - mScrollIndex; + S32 first_frame = LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex; S32 last_frame = first_frame - MAX_VISIBLE_HISTORY; - F32 frame_delta = ((F32) (graph_rect.getWidth()))/(LLFastTimer::FTM_HISTORY_NUM-1); + F32 frame_delta = ((F32) (graph_rect.getWidth()))/(LLFastTimer::NamedTimer::HISTORY_NUM-1); F32 right = (F32) graph_rect.mLeft + frame_delta*first_frame; F32 left = (F32) graph_rect.mLeft + frame_delta*last_frame; @@ -996,28 +801,27 @@ void LLFastTimerView::draw() } U64 cur_max = 0; - for (S32 idx = 0; idx < FTV_DISPLAY_NUM; ++idx) + for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + it != end_timer_tree(); + ++it) { - if (ft_display_table[idx].disabled > 1) - { //skip disabled timers - continue; - } + LLFastTimer::NamedTimer* idp = (*it); //fatten highlighted timer - if (mHoverIndex == idx) + if (mHoverID == idp) { gGL.flush(); glLineWidth(3); } - const F32 * col = ft_display_table[idx].color->mV; + const F32 * col = sTimerColors[idp].mV;// ft_display_table[idx].color->mV; F32 alpha = 1.f; - if (mHoverIndex >= 0 && - idx != mHoverIndex) + if (mHoverID != NULL && + idp != mHoverID) { //fade out non-hihglighted timers - if (ft_display_table[idx].parent != mHoverIndex) + if (idp->getParent() != mHoverID) { alpha = alpha_interp; } @@ -1025,9 +829,9 @@ void LLFastTimerView::draw() gGL.color4f(col[0], col[1], col[2], alpha); gGL.begin(LLRender::LINE_STRIP); - for (U32 j = 0; j < LLFastTimer::FTM_HISTORY_NUM; j++) + for (U32 j = 0; j < LLFastTimer::NamedTimer::HISTORY_NUM; j++) { - U64 ticks = ticks_sum[j+1][idx]; + U64 ticks = idp->getHistoricalCount(j); if (mDisplayHz) { @@ -1037,26 +841,31 @@ void LLFastTimerView::draw() } else if (mDisplayCalls) { - S32 tidx = ft_display_table[idx].timer; - S32 hidx = (LLFastTimer::sLastFrameIndex + j) % LLFastTimer::FTM_HISTORY_NUM; - ticks = (S32)LLFastTimer::sCallHistory[hidx][tidx]; + ticks = (S32)idp->getHistoricalCalls(j); } if (alpha == 1.f) - { //normalize to highlighted timer + { + //normalize to highlighted timer cur_max = llmax(cur_max, ticks); } - F32 x = graph_rect.mLeft + ((F32) (graph_rect.getWidth()))/(LLFastTimer::FTM_HISTORY_NUM-1)*j; + F32 x = graph_rect.mLeft + ((F32) (graph_rect.getWidth()))/(LLFastTimer::NamedTimer::HISTORY_NUM-1)*j; F32 y = graph_rect.mBottom + (F32) graph_rect.getHeight()/max_ticks*ticks; gGL.vertex2f(x,y); } gGL.end(); - if (mHoverIndex == idx) + if (mHoverID == idp) { gGL.flush(); glLineWidth(1); } + + if (idp->getCollapsed()) + { + //skip hidden timers + it.skipDescendants(); + } } //interpolate towards new maximum @@ -1068,12 +877,16 @@ void LLFastTimerView::draw() alpha_interp = alpha_interp + (alpha_target-alpha_interp) * dt; - if (mHoverIndex >= 0) + if (mHoverID != NULL) { x = (graph_rect.mRight + graph_rect.mLeft)/2; y = graph_rect.mBottom + 8; - LLFontGL::getFontMonospace()->renderUTF8(std::string(ft_display_table[mHoverIndex].desc), 0, x, y, LLColor4::white, + LLFontGL::getFontMonospace()->renderUTF8( + mHoverID->getName(), + 0, + x, y, + LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM); } } @@ -1083,87 +896,269 @@ void LLFastTimerView::draw() if (mPrintStats >= 0) { std::string legend_stat; - S32 stat_num; - S32 first = 1; - for (stat_num = 0; stat_num < FTV_DISPLAY_NUM; stat_num++) + bool first = true; + for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + it != end_timer_tree(); + ++it) { - if (ft_display_table[stat_num].disabled > 1) - continue; + LLFastTimer::NamedTimer* idp = (*it); + if (!first) + { legend_stat += ", "; - first=0; - legend_stat += ft_display_table[stat_num].desc; + } + first = true; + legend_stat += idp->getName(); + + if (idp->getCollapsed()) + { + it.skipDescendants(); + } } llinfos << legend_stat << llendl; std::string timer_stat; - first = 1; - for (stat_num = 0; stat_num < FTV_DISPLAY_NUM; stat_num++) + first = true; + for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + it != end_timer_tree(); + ++it) { - S32 disabled = ft_display_table[stat_num].disabled; - if (disabled > 1) - continue; + LLFastTimer::NamedTimer* idp = (*it); + if (!first) + { timer_stat += ", "; - first=0; + } + first = false; + U64 ticks; - S32 tidx = ft_display_table[stat_num].timer; if (mPrintStats > 0) { - S32 hidx = (LLFastTimer::sLastFrameIndex+(mPrintStats-1)-mScrollIndex) % LLFastTimer::FTM_HISTORY_NUM; - ticks = disabled >= 1 ? ticks_sum[mPrintStats][stat_num] : LLFastTimer::sCountHistory[hidx][tidx]; + S32 hidx = (mPrintStats - 1) - mScrollIndex; + ticks = idp->getHistoricalCount(hidx); } else { - ticks = disabled >= 1 ? ticks_sum[0][stat_num] : LLFastTimer::sCountAverage[tidx]; + ticks = idp->getCountAverage(); } F32 ms = (F32)((F64)ticks * iclock_freq); timer_stat += llformat("%.1f",ms); + + if (idp->getCollapsed()) + { + it.skipDescendants(); + } } llinfos << timer_stat << llendl; mPrintStats = -1; } - mHoverIndex = -1; + mHoverID = NULL; mHoverBarIndex = -1; LLView::draw(); } -F64 LLFastTimerView::getTime(LLFastTimer::EFastTimerType tidx) +F64 LLFastTimerView::getTime(LLFastTimer::NamedTimer::FrameState& id) { - // Find table index - S32 i; - for (i=0; i<FTV_DISPLAY_NUM; i++) + return (F64)id.mTimer->getCountAverage() / (F64)LLFastTimer::countsPerSecond(); +} + +//static +LLSD LLFastTimerView::analyzePerformanceLogDefault(std::istream& is) +{ + LLSD ret; + + LLSD cur; + + LLSD::Real total_time = 0.0; + LLSD::Integer total_frames = 0; + + while (!is.eof() && LLSDSerialize::fromXML(cur, is)) { - if (tidx == ft_display_table[i].timer) + for (LLSD::map_iterator iter = cur.beginMap(); iter != cur.endMap(); ++iter) { - break; + std::string label = iter->first; + + F64 time = iter->second["Time"].asReal(); + + total_time += time; + + if (time > 0.0) + { + ret[label]["TotalTime"] = ret[label]["TotalTime"].asReal() + time; + ret[label]["MaxTime"] = llmax(time, ret[label]["MaxTime"].asReal()); + + if (ret[label]["MinTime"].asReal() == 0) + { + ret[label]["MinTime"] = time; + } + else + { + ret[label]["MinTime"] = llmin(ret[label]["MinTime"].asReal(), time); + } + + LLSD::Integer samples = iter->second["Calls"].asInteger(); + + ret[label]["Samples"] = ret[label]["Samples"].asInteger() + samples; + ret[label]["MaxSamples"] = llmax(ret[label]["MaxSamples"].asInteger(), samples); + + if (ret[label]["MinSamples"].asInteger() == 0) + { + ret[label]["MinSamples"] = samples; + } + else + { + ret[label]["MinSamples"] = llmin(ret[label]["MinSamples"].asInteger(), samples); + } + } } + total_frames++; } + + ret["SessionTime"] = total_time; + ret["FrameCount"] = total_frames; - if (i == FTV_DISPLAY_NUM) + return ret; + +} + +//static +void LLFastTimerView::doAnalysisDefault(std::string baseline, std::string target, std::string output) +{ + + //analyze baseline + std::ifstream base_is(baseline.c_str()); + LLSD base = analyzePerformanceLogDefault(base_is); + base_is.close(); + + //analyze current + std::ifstream target_is(target.c_str()); + LLSD current = analyzePerformanceLogDefault(target_is); + target_is.close(); + + //output comparision + std::ofstream os(output.c_str()); + + LLSD::Real session_time = current["SessionTime"].asReal(); + + os << "Label, % Change, % of Session, Cur Min, Cur Max, Cur Mean, Cur Total, Cur Samples, Base Min, Base Max, Base Mean, Base Total, Base Samples\n"; + for (LLSD::map_iterator iter = base.beginMap(); iter != base.endMap(); ++iter) { - // walked off the end of ft_display_table without finding - // the desired timer type - llwarns << "Timer type " << tidx << " not known." << llendl; - return F64(0.0); + LLSD::String label = iter->first; + + if (current[label]["Samples"].asInteger() == 0 || + base[label]["Samples"].asInteger() == 0) + { + //cannot compare + continue; + } + LLSD::Real a = base[label]["TotalTime"].asReal() / base[label]["Samples"].asReal(); + LLSD::Real b = current[label]["TotalTime"].asReal() / base[label]["Samples"].asReal(); + + LLSD::Real diff = b-a; + + LLSD::Real perc = diff/a * 100; + + os << llformat("%s, %.2f, %.4f, %.4f, %.4f, %.4f, %.4f, %d, %.4f, %.4f, %.4f, %.4f, %d\n", + label.c_str(), + (F32) perc, + (F32) (current[label]["TotalTime"].asReal()/session_time * 100.0), + (F32) current[label]["MinTime"].asReal(), + (F32) current[label]["MaxTime"].asReal(), + (F32) b, + (F32) current[label]["TotalTime"].asReal(), + current[label]["Samples"].asInteger(), + (F32) base[label]["MinTime"].asReal(), + (F32) base[label]["MaxTime"].asReal(), + (F32) a, + (F32) base[label]["TotalTime"].asReal(), + base[label]["Samples"].asInteger()); } - S32 table_idx = i; - // Add child ticks to parent - U64 ticks = LLFastTimer::sCountAverage[tidx]; - S32 level = ft_display_table[table_idx].level; - for (i=table_idx+1; i<FTV_DISPLAY_NUM; i++) + os.flush(); + os.close(); +} + +//------------------------- +//static +LLSD LLFastTimerView::analyzeMetricPerformanceLog(std::istream& is) +{ + LLSD ret; + LLSD cur; + + while (!is.eof() && LLSDSerialize::fromXML(cur, is)) { - if (ft_display_table[i].level <= level) + for (LLSD::map_iterator iter = cur.beginMap(); iter != cur.endMap(); ++iter) { - break; + std::string label = iter->first; + + LLMetricPerformanceTester* tester = LLMetricPerformanceTester::getTester(iter->second["Name"].asString()) ; + if(tester) + { + ret[label]["Name"] = iter->second["Name"] ; + + S32 num_of_strings = tester->getNumOfMetricStrings() ; + for(S32 index = 0 ; index < num_of_strings ; index++) + { + ret[label][ tester->getMetricString(index) ] = iter->second[ tester->getMetricString(index) ] ; + } + } } - ticks += LLFastTimer::sCountAverage[ft_display_table[i].timer]; } + + return ret; +} + +//static +void LLFastTimerView::doAnalysisMetrics(std::string baseline, std::string target, std::string output) +{ + if(!LLMetricPerformanceTester::hasMetricPerformanceTesters()) + { + return ; + } + + //analyze baseline + std::ifstream base_is(baseline.c_str()); + LLSD base = analyzeMetricPerformanceLog(base_is); + base_is.close(); + + //analyze current + std::ifstream target_is(target.c_str()); + LLSD current = analyzeMetricPerformanceLog(target_is); + target_is.close(); - return (F64)ticks / (F64)LLFastTimer::countsPerSecond(); + //output comparision + std::ofstream os(output.c_str()); + + os << "Label, Metric, Base(B), Target(T), Diff(T-B), Percentage(100*T/B)\n"; + for(LLMetricPerformanceTester::name_tester_map_t::iterator iter = LLMetricPerformanceTester::sTesterMap.begin() ; + iter != LLMetricPerformanceTester::sTesterMap.end() ; ++iter) + { + LLMetricPerformanceTester* tester = ((LLMetricPerformanceTester*)iter->second) ; + tester->analyzePerformance(&os, &base, ¤t) ; + } + + os.flush(); + os.close(); } + +//static +void LLFastTimerView::doAnalysis(std::string baseline, std::string target, std::string output) +{ + if(LLFastTimer::sLog) + { + doAnalysisDefault(baseline, target, output) ; + return ; + } + + if(LLFastTimer::sMetricLog) + { + doAnalysisMetrics(baseline, target, output) ; + return ; + } +} + + diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 86fc194610450bcafe1dae4c96bda4320a04189b..78ca7b50d6ef612c60355d9b7b5c2298dcf7af97 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -34,39 +34,62 @@ #define LL_LLFASTTIMERVIEW_H #include "llfloater.h" -#include "llframetimer.h" +#include "llfasttimer.h" class LLFastTimerView : public LLFloater { public: - LLFastTimerView(const std::string& name, const LLRect& rect); - virtual ~LLFastTimerView(); + LLFastTimerView(const LLRect& rect); + + static BOOL sAnalyzePerformance; + + static void doAnalysis(std::string baseline, std::string target, std::string output); + +private: + static void doAnalysisDefault(std::string baseline, std::string target, std::string output) ; + static void doAnalysisMetrics(std::string baseline, std::string target, std::string output) ; + static LLSD analyzeMetricPerformanceLog(std::istream& is) ; + static LLSD analyzePerformanceLogDefault(std::istream& is) ; + +public: virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); + virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen); virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual void draw(); - S32 getLegendIndex(S32 y); - F64 getTime(LLFastTimer::EFastTimerType tidx); + LLFastTimer::NamedTimer* getLegendID(S32 y); + F64 getTime(LLFastTimer::NamedTimer::FrameState& id); private: - S32* mBarStart; - S32* mBarEnd; + typedef std::vector<std::vector<S32> > bar_positions_t; + bar_positions_t mBarStart; + bar_positions_t mBarEnd; S32 mDisplayMode; - S32 mDisplayCenter; + + typedef enum child_alignment + { + ALIGN_LEFT, + ALIGN_CENTER, + ALIGN_RIGHT, + ALIGN_COUNT + } ChildAlignment; + + ChildAlignment mDisplayCenter; S32 mDisplayCalls; S32 mDisplayHz; U64 mAvgCountTotal; U64 mMaxCountTotal; LLRect mBarRect; S32 mScrollIndex; - S32 mHoverIndex; + LLFastTimer::NamedTimer* mHoverID; + LLFastTimer::NamedTimer* mHoverTimer; + LLRect mToolTipRect; S32 mHoverBarIndex; LLFrameTimer mHighlightTimer; - S32 mSubtractHidden; S32 mPrintStats; }; diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7719af2bd719e2ca957829a947652de35c6d3fbe --- /dev/null +++ b/indra/newview/llfavoritesbar.cpp @@ -0,0 +1,579 @@ +/** + * @file llfavoritesbar.cpp + * @brief LLFavoritesBarCtrl class implementation + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfavoritesbar.h" + +#include "llbutton.h" +#include "llfloaterreg.h" +#include "llinventory.h" +#include "lluictrlfactory.h" +#include "llmenugl.h" + +#include "llagent.h" +#include "llinventorybridge.h" +#include "llinventorymodel.h" +#include "llviewerinventory.h" +#include "llviewermenu.h" +#include "llviewermenu.h" + +static LLDefaultWidgetRegistry::Register<LLFavoritesBarCtrl> r("favorites_bar"); + +// updateButtons's helper +struct LLFavoritesSort +{ + // Sorting by creation date and name + // TODO - made it customizible using gSavedSettings + bool operator()(const LLViewerInventoryItem* const& a, const LLViewerInventoryItem* const& b) + { + time_t first_create = a->getCreationDate(); + time_t second_create = b->getCreationDate(); + if (first_create == second_create) + { + return (LLStringUtil::compareDict(a->getName(), b->getName()) < 0); + } + else + { + return (first_create > second_create); + } + } +}; + +class LLVisibilityTrackingMenuGL : public LLMenuGL +{ +protected: + LLVisibilityTrackingMenuGL(const LLMenuGL::Params&); + friend class LLUICtrlFactory; +public: + virtual void onVisibilityChange (BOOL curVisibilityIn); + void setChevronRect(const LLRect& rect) { mChevronRect = rect; } + + bool getClosedByChevronClick() { return mClosedByChevronClick; } + void resetClosedByChevronClick() { mClosedByChevronClick = false; } + +protected: + bool mClosedByChevronClick; + LLRect mChevronRect; +}; + +LLVisibilityTrackingMenuGL::LLVisibilityTrackingMenuGL(const LLMenuGL::Params& p) +: LLMenuGL(p), + mClosedByChevronClick(false) +{ +} + +//virtual +void LLVisibilityTrackingMenuGL::onVisibilityChange (BOOL curVisibilityIn) +{ + S32 x,y; + LLUI::getCursorPositionLocal(LLUI::getRootView(), &x, &y); + + if (!curVisibilityIn && mChevronRect.pointInRect(x, y)) + { + mClosedByChevronClick = true; + } +} + +LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) +: LLUICtrl(p), + mFont(p.font.isProvided() ? p.font() : LLFontGL::getFontSansSerifSmall()), + mPopupMenuHandle(), + mInventoryItemsPopupMenuHandle() +{ + // Register callback for menus with current registrar (will be parent panel's registrar) + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Favorites.DoToSelected", + boost::bind(&LLFavoritesBarCtrl::doToSelected, this, _2)); + + // Add this if we need to selectively enable items + //LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Favorites.EnableSelected", + // boost::bind(&LLFavoritesBarCtrl::enableSelected, this, _2)); + + gInventory.addObserver(this); +} + +LLFavoritesBarCtrl::~LLFavoritesBarCtrl() +{ + gInventory.removeObserver(this); + + LLView::deleteViewByHandle(mPopupMenuHandle); + LLView::deleteViewByHandle(mInventoryItemsPopupMenuHandle); +} + +BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) +{ + *accept = ACCEPT_NO; + + switch (cargo_type) + { + + case DAD_LANDMARK: + { + // Copy the item into the favorites folder (if it's not already there). + LLInventoryItem *item = (LLInventoryItem *)cargo_data; + LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_FAVORITE); + if (item->getParentUUID() == favorites_id) + { + llwarns << "Attemt to copy a favorite item into the same folder." << llendl; + break; + } + + *accept = ACCEPT_YES_COPY_SINGLE; + + if (drop) + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + favorites_id, + std::string(), + LLPointer<LLInventoryCallback>(NULL)); + + llinfos << "Copied inventory item #" << item->getUUID() << " to favorites." << llendl; + } + + } + break; + default: + break; + } + + return TRUE; +} + +//virtual +void LLFavoritesBarCtrl::changed(U32 mask) +{ + if (mFavoriteFolderId.isNull()) + { + mFavoriteFolderId = gInventory.findCategoryUUIDForType(LLAssetType::AT_FAVORITE); + + if (mFavoriteFolderId.notNull()) + { + gInventory.fetchDescendentsOf(mFavoriteFolderId); + } + } + else + { + updateButtons(getRect().getWidth()); + } +} + +//virtual +void LLFavoritesBarCtrl::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + updateButtons(width); + + LLUICtrl::reshape(width, height, called_from_parent); +} + +void LLFavoritesBarCtrl::updateButtons(U32 bar_width) +{ + LLInventoryModel::item_array_t items; + + if (!collectFavoriteItems(items)) + { + return; + } + + const S32 buttonHPad = LLUI::sSettingGroups["config"]->getS32("ButtonHPad"); + const S32 buttonHGap = 2; + const S32 buttonVGap = 2; + static LLButton::Params default_button_params(LLUICtrlFactory::getDefaultParams<LLButton::Params>()); + std::string flat_icon = "transparent.j2c"; + std::string hover_icon = default_button_params.image_unselected.name; + std::string hover_icon_selected = default_button_params.image_selected.name; + + S32 curr_x = buttonHGap; + + S32 count = items.count(); + + const S32 chevron_button_width = mFont->getWidth(">>") + buttonHPad * 2; + + S32 buttons_space = bar_width - curr_x; + + S32 first_drop_down_item = count; + + // Calculating, how much buttons can fit in the bar + S32 buttons_width = 0; + for (S32 i = 0; i < count; ++i) + { + buttons_width += mFont->getWidth(items.get(i)->getName()) + buttonHPad * 2 + buttonHGap; + if (buttons_width > buttons_space) + { + // There is no space for all buttons. + // Calculating the number of buttons, that are fit with chevron button + buttons_space -= chevron_button_width + buttonHGap; + while (i >= 0 && buttons_width > buttons_space) + { + buttons_width -= mFont->getWidth(items.get(i)->getName()) + buttonHPad * 2 + buttonHGap; + i--; + } + first_drop_down_item = i + 1; // First item behind visible items + + break; + } + } + + // If inventory items are not changed up to mFirstDropDownItem, no need to recreate them + if (mFirstDropDownItem == first_drop_down_item && (mItemNamesCache.size() == count || mItemNamesCache.size() == mFirstDropDownItem)) + { + S32 i; + for (i = 0; i < mFirstDropDownItem; ++i) + { + if (mItemNamesCache.get(i) != items.get(i)->getName()) + { + break; + } + } + if (i == mFirstDropDownItem) + { + // Chevron button should stay right aligned + LLView *chevron_button = getChildView(std::string(">>"), FALSE, FALSE); + if (chevron_button) + { + LLRect rect; + rect.setOriginAndSize(bar_width - chevron_button_width - buttonHGap, buttonVGap, chevron_button_width, getRect().getHeight()-buttonVGap); + chevron_button->setRect(rect); + + S32 chevron_root_x, chevron_root_y; + localPointToOtherView(rect.mLeft, rect.mBottom, &chevron_root_x, &chevron_root_y, LLUI::getRootView()); + mChevronRect.setOriginAndSize(chevron_root_x, chevron_root_y, rect.getWidth(), rect.getHeight()); + } + return; + } + } + + mFirstDropDownItem = first_drop_down_item; + + mItemNamesCache.clear(); + for (S32 i = 0; i < mFirstDropDownItem; i++) + { + mItemNamesCache.put(items.get(i)->getName()); + } + + // Rebuild the buttons only + // child_list_t is a linked list, so safe to erase from the middle if we pre-incrament the iterator + for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ) + { + child_list_const_iter_t cur_it = child_it++; + LLView* viewp = *cur_it; + LLButton* button = dynamic_cast<LLButton*>(viewp); + if (button) + { + removeChild(button); + delete button; + } + } + + // Adding buttons + for(S32 i = 0; i < mFirstDropDownItem; i++) + { + + LLInventoryItem* item = items.get(i); + + S32 buttonWidth = mFont->getWidth(item->getName()) + buttonHPad * 2; + + LLRect rect; + rect.setOriginAndSize(curr_x, buttonVGap, buttonWidth, getRect().getHeight()-buttonVGap); + + LLButton::Params bparams; + bparams.image_unselected.name(flat_icon); + bparams.image_disabled.name(flat_icon); + bparams.image_selected.name(hover_icon_selected); + bparams.image_hover_selected.name(hover_icon_selected); + bparams.image_disabled_selected.name(hover_icon_selected); + bparams.image_hover_unselected.name(hover_icon); + bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_BOTTOM); + bparams.rect (rect); + bparams.tab_stop(false); + bparams.font(mFont); + bparams.name(item->getName()); + bparams.tool_tip(item->getName()); + bparams.click_callback.function(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID())); + bparams.rightclick_callback.function(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID())); + + addChildInBack(LLUICtrlFactory::create<LLButton> (bparams)); + + curr_x += buttonWidth + buttonHGap; + } + + // Chevron button + if (mFirstDropDownItem != count) + { + LLButton::Params bparams; + + LLRect rect; + rect.setOriginAndSize(bar_width - chevron_button_width - buttonHGap, buttonVGap, chevron_button_width, getRect().getHeight()-buttonVGap); + + bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_BOTTOM); + bparams.image_unselected.name(flat_icon); + bparams.image_disabled.name(flat_icon); + bparams.image_selected.name(hover_icon_selected); + bparams.image_hover_selected.name(hover_icon_selected); + bparams.image_disabled_selected.name(hover_icon_selected); + bparams.image_hover_unselected.name(hover_icon); + bparams.rect (rect); + bparams.tab_stop(false); + bparams.font(mFont); + bparams.name(">>"); + bparams.click_callback.function(boost::bind(&LLFavoritesBarCtrl::showDropDownMenu, this)); + + addChildInBack(LLUICtrlFactory::create<LLButton> (bparams)); + + S32 chevron_root_x, chevron_root_y; + localPointToOtherView(rect.mLeft, rect.mBottom, &chevron_root_x, &chevron_root_y, LLUI::getRootView()); + mChevronRect.setOriginAndSize(chevron_root_x, chevron_root_y, rect.getWidth(), rect.getHeight()); + } +} + +BOOL LLFavoritesBarCtrl::postBuild() +{ + // make the popup menu available + LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_favorites.xml", gMenuHolder); + if (!menu) + { + menu = LLUICtrlFactory::createDummyWidget<LLMenuGL>("inventory_menu"); + } + menu->setBackgroundColor(gSavedSkinSettings.getColor("MenuPopupBgColor")); + mInventoryItemsPopupMenuHandle = menu->getHandle(); + + return TRUE; +} + +BOOL LLFavoritesBarCtrl::collectFavoriteItems(LLInventoryModel::item_array_t &items) +{ + if (mFavoriteFolderId.isNull()) + return FALSE; + + LLInventoryModel::cat_array_t cats; + + LLIsType is_type(LLAssetType::AT_LANDMARK); + gInventory.collectDescendentsIf(mFavoriteFolderId, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type); + + std::sort(items.begin(), items.end(), LLFavoritesSort()); + + return TRUE; +} + +void LLFavoritesBarCtrl::showDropDownMenu() +{ + if (mPopupMenuHandle.isDead()) + { + LLMenuGL::Params menu_p; + menu_p.name("favorites menu"); + menu_p.can_tear_off(false); + menu_p.visible(false); + menu_p.scrollable(true); + + LLVisibilityTrackingMenuGL* menu = LLUICtrlFactory::create<LLVisibilityTrackingMenuGL>(menu_p); + + mPopupMenuHandle = menu->getHandle(); + } + + LLVisibilityTrackingMenuGL* menu = (LLVisibilityTrackingMenuGL*)mPopupMenuHandle.get(); + + if(menu) + { + if (menu->getClosedByChevronClick()) + { + menu->resetClosedByChevronClick(); + return; + } + + if (menu->getVisible()) + { + menu->setVisible(FALSE); + menu->resetClosedByChevronClick(); + return; + } + + LLInventoryModel::item_array_t items; + + if (!collectFavoriteItems(items)) + { + return; + } + + S32 count = items.count(); + + // Check it there are changed items, since last call + if (mItemNamesCache.size() == count) + { + S32 i; + for (i = mFirstDropDownItem; i < count; i++) + { + if (mItemNamesCache.get(i) != items.get(i)->getName()) + { + break; + } + } + + // Check passed, just show the menu + if (i == count) + { + menu->buildDrawLabels(); + menu->updateParent(LLMenuGL::sMenuContainer); + + menu->setChevronRect(mChevronRect); + + LLMenuGL::showPopup(this, menu, getRect().getWidth() - menu->getRect().getWidth(), 0); + return; + } + } + + // Add menu items to cache, if there is only names of buttons + if (mItemNamesCache.size() == mFirstDropDownItem) + { + for (S32 i = mFirstDropDownItem; i < count; i++) + { + mItemNamesCache.put(items.get(i)->getName()); + } + } + + menu->empty(); + + U32 max_width = 0; + + // Menu will not be wider, than bar + S32 bar_width = getRect().getWidth(); + + for(S32 i = mFirstDropDownItem; i < count; i++) + { + LLInventoryItem* item = items.get(i); + const std::string& item_name = item->getName(); + + LLMenuItemCallGL::Params item_params; + item_params.name(item_name); + item_params.label(item_name); + + item_params.on_click.function(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID())); + + LLMenuItemCallGL *menu_item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); + + // Check whether item name wider than menu + if ((S32) menu_item->getNominalWidth() > bar_width) + { + S32 chars_total = item_name.length(); + S32 chars_fitted = 1; + menu_item->setLabel(LLStringExplicit("")); + S32 label_space = bar_width - menu_item->getFont()->getWidth("...") - + menu_item->getNominalWidth(); // This returns width of menu item with empty label (pad pixels) + + while (chars_fitted < chars_total && menu_item->getFont()->getWidth(item_name, 0, chars_fitted) < label_space) + { + chars_fitted++; + } + chars_fitted--; // Rolling back one char, that doesn't fit + + menu_item->setLabel(item_name.substr(0, chars_fitted) + "..."); + } + + max_width = llmax(max_width, menu_item->getNominalWidth()); + + menu->addChild(menu_item); + } + + // Menu will not be wider, than bar + max_width = llmin((S32)max_width, bar_width); + + menu->buildDrawLabels(); + menu->updateParent(LLMenuGL::sMenuContainer); + + menu->setChevronRect(mChevronRect); + + LLMenuGL::showPopup(this, menu, getRect().getWidth() - max_width, 0); + } +} + +void LLFavoritesBarCtrl::onButtonClick(LLUUID item_id) +{ + LLInventoryModel::item_array_t items; + + if (!collectFavoriteItems(items)) + { + return; + } + + // We only have one Inventory, gInventory. Some day this should be better abstracted. + LLInvFVBridgeAction::doAction(item_id,&gInventory); +} + +void LLFavoritesBarCtrl::onButtonRightClick(LLUUID item_id) +{ + mSelectedItemID = item_id; + + LLMenuGL* menu = (LLMenuGL*)mInventoryItemsPopupMenuHandle.get(); + if (!menu) + { + return; + } + + menu->updateParent(LLMenuGL::sMenuContainer); + + S32 x,y; + LLUI::getCursorPositionLocal(this, &x, &y); + LLMenuGL::showPopup(this, menu, x, y); +} + +void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) +{ + std::string action = userdata.asString(); + llinfos << "Action = " << action << " Item = " << mSelectedItemID.asString() << llendl; + + LLViewerInventoryItem* item = gInventory.getItem(mSelectedItemID); + if (!item) + return; + + if (action == "open") + { + teleport_via_landmark(item->getAssetUUID()); + } + else if (action == "about") + { + LLFloaterReg::showInstance("preview_landmark", LLSD(mSelectedItemID), TAKE_FOCUS_YES); + } + else if (action == "rename") + { + // Would need to re-implement this: + // folder->startRenamingSelectedItem(); + } + else if (action == "delete") + { + gInventory.removeItem(mSelectedItemID); + } +} diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h new file mode 100644 index 0000000000000000000000000000000000000000..646e98cabbaffa39d0f6170b76bf67780519e5bd --- /dev/null +++ b/indra/newview/llfavoritesbar.h @@ -0,0 +1,89 @@ +/** + * @file llfavoritesbar.h + * @brief LLFavoritesBarCtrl base class + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLFAVORITESBARCTRL_H +#define LL_LLFAVORITESBARCTRL_H + +#include "lluictrl.h" +#include "lliconctrl.h" +#include "llinventorymodel.h" + +class LLFavoritesBarCtrl : public LLUICtrl, public LLInventoryObserver +{ +public: + struct Params : public LLUICtrl::Params{}; +protected: + LLFavoritesBarCtrl(const Params&); + friend class LLUICtrlFactory; +public: + virtual ~LLFavoritesBarCtrl(); + + /*virtual*/ BOOL postBuild(); + + /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg); + + // LLInventoryObserver observer trigger + virtual void changed(U32 mask); + virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + +protected: + void updateButtons(U32 bar_width); + BOOL collectFavoriteItems(LLInventoryModel::item_array_t &items); + + void onButtonClick(LLUUID id); + void onButtonRightClick(LLUUID id); + + void doToSelected(const LLSD& userdata); + + void showDropDownMenu(); + + LLHandle<LLView> mPopupMenuHandle; + LLHandle<LLView> mInventoryItemsPopupMenuHandle; + + LLUUID mFavoriteFolderId; + const LLFontGL *mFont; + S32 mFirstDropDownItem; + + typedef LLDynamicArray<std::string> item_names_array_t; + item_names_array_t mItemNamesCache; + + LLUUID mSelectedItemID; + LLRect mChevronRect; +}; + + +#endif // LL_LLFAVORITESBARCTRL_H + diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 8f5882615f95c13c8470c0609cb42dabbb73f458..028e1cc098c50b0963c4873c8b4fae7683ec9b67 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -39,6 +39,7 @@ #include "lldir.h" #include "llframetimer.h" #include "lltrans.h" +#include "llwindow.h" // beforeDialog() #if LL_SDL #include "llwindowsdl.h" // for some X/GTK utils to help with filepickers @@ -818,6 +819,13 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter) reset(); mNavOptions.optionFlags &= ~kNavAllowMultipleFiles; + + if(filter == FFLOAD_ALL) // allow application bundles etc. to be traversed; important for DEV-16869, but generally useful + { + // mNavOptions.optionFlags |= kNavAllowOpenPackages; + mNavOptions.optionFlags |= kNavSupportPackages; + } + // Modal, so pause agent send_agent_pause(); { diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 9ee24d6d832aff4334f4d95a914ebb5bfbacba84..352ca3c8636ec71389555bdb1e0b78c1eea131ac 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -51,8 +51,6 @@ std::set<std::string> LLFirstUse::sConfigVariables; // static void LLFirstUse::addConfigVariable(const std::string& var) { - //Don't add the warning, now that we're storing the default in the settings_default.xml file - //gSavedSettings.addWarning(var); sConfigVariables.insert(var); } @@ -63,7 +61,7 @@ void LLFirstUse::disableFirstUse() for (std::set<std::string>::iterator iter = sConfigVariables.begin(); iter != sConfigVariables.end(); ++iter) { - gSavedSettings.setWarning(*iter, FALSE); + gWarningSettings.setBOOL(*iter, FALSE); } } @@ -74,7 +72,7 @@ void LLFirstUse::resetFirstUse() for (std::set<std::string>::iterator iter = sConfigVariables.begin(); iter != sConfigVariables.end(); ++iter) { - gSavedSettings.setWarning(*iter, TRUE); + gWarningSettings.setBOOL(*iter, TRUE); } } @@ -82,9 +80,9 @@ void LLFirstUse::resetFirstUse() // Called whenever the viewer detects that your balance went up void LLFirstUse::useBalanceIncrease(S32 delta) { - if (gSavedSettings.getWarning("FirstBalanceIncrease")) + if (gWarningSettings.getBOOL("FirstBalanceIncrease")) { - gSavedSettings.setWarning("FirstBalanceIncrease", FALSE); + gWarningSettings.setBOOL("FirstBalanceIncrease", FALSE); LLSD args; args["AMOUNT"] = llformat("%d",delta); @@ -96,9 +94,9 @@ void LLFirstUse::useBalanceIncrease(S32 delta) // Called whenever the viewer detects your balance went down void LLFirstUse::useBalanceDecrease(S32 delta) { - if (gSavedSettings.getWarning("FirstBalanceDecrease")) + if (gWarningSettings.getBOOL("FirstBalanceDecrease")) { - gSavedSettings.setWarning("FirstBalanceDecrease", FALSE); + gWarningSettings.setBOOL("FirstBalanceDecrease", FALSE); LLSD args; args["AMOUNT"] = llformat("%d",-delta); @@ -112,9 +110,9 @@ void LLFirstUse::useSit() { // Our orientation island uses sitting to teach vehicle driving // so just never show this message. JC - //if (gSavedSettings.getWarning("FirstSit")) + //if (gWarningSettings.getBOOL("FirstSit")) //{ - // gSavedSettings.setWarning("FirstSit", FALSE); + // gWarningSettings.setBOOL("FirstSit", FALSE); // // LLNotifications::instance().add("FirstSit"); //} @@ -123,9 +121,9 @@ void LLFirstUse::useSit() // static void LLFirstUse::useMap() { - if (gSavedSettings.getWarning("FirstMap")) + if (gWarningSettings.getBOOL("FirstMap")) { - gSavedSettings.setWarning("FirstMap", FALSE); + gWarningSettings.setBOOL("FirstMap", FALSE); LLNotifications::instance().add("FirstMap"); } @@ -140,9 +138,9 @@ void LLFirstUse::useGoTo() // static void LLFirstUse::useBuild() { - if (gSavedSettings.getWarning("FirstBuild")) + if (gWarningSettings.getBOOL("FirstBuild")) { - gSavedSettings.setWarning("FirstBuild", FALSE); + gWarningSettings.setBOOL("FirstBuild", FALSE); LLNotifications::instance().add("FirstBuild"); } @@ -151,9 +149,9 @@ void LLFirstUse::useBuild() // static void LLFirstUse::useLeftClickNoHit() { - if (gSavedSettings.getWarning("FirstLeftClickNoHit")) + if (gWarningSettings.getBOOL("FirstLeftClickNoHit")) { - gSavedSettings.setWarning("FirstLeftClickNoHit", FALSE); + gWarningSettings.setBOOL("FirstLeftClickNoHit", FALSE); LLNotifications::instance().add("FirstLeftClickNoHit"); } @@ -162,12 +160,12 @@ void LLFirstUse::useLeftClickNoHit() // static void LLFirstUse::useTeleport() { - if (gSavedSettings.getWarning("FirstTeleport")) + if (gWarningSettings.getBOOL("FirstTeleport")) { LLVector3d teleportDestination = LLTracker::getTrackedPositionGlobal(); if(teleportDestination != LLVector3d::zero) { - gSavedSettings.setWarning("FirstTeleport", FALSE); + gWarningSettings.setBOOL("FirstTeleport", FALSE); LLNotifications::instance().add("FirstTeleport"); } @@ -181,9 +179,9 @@ void LLFirstUse::useOverrideKeys() // so don't show this message until you get off OI. JC if (!gAgent.inPrelude()) { - if (gSavedSettings.getWarning("FirstOverrideKeys")) + if (gWarningSettings.getBOOL("FirstOverrideKeys")) { - gSavedSettings.setWarning("FirstOverrideKeys", FALSE); + gWarningSettings.setBOOL("FirstOverrideKeys", FALSE); LLNotifications::instance().add("FirstOverrideKeys"); } @@ -199,9 +197,9 @@ void LLFirstUse::useAttach() // static void LLFirstUse::useAppearance() { - if (gSavedSettings.getWarning("FirstAppearance")) + if (gWarningSettings.getBOOL("FirstAppearance")) { - gSavedSettings.setWarning("FirstAppearance", FALSE); + gWarningSettings.setBOOL("FirstAppearance", FALSE); LLNotifications::instance().add("FirstAppearance"); } @@ -210,9 +208,9 @@ void LLFirstUse::useAppearance() // static void LLFirstUse::useInventory() { - if (gSavedSettings.getWarning("FirstInventory")) + if (gWarningSettings.getBOOL("FirstInventory")) { - gSavedSettings.setWarning("FirstInventory", FALSE); + gWarningSettings.setBOOL("FirstInventory", FALSE); LLNotifications::instance().add("FirstInventory"); } @@ -222,9 +220,9 @@ void LLFirstUse::useInventory() // static void LLFirstUse::useSandbox() { - if (gSavedSettings.getWarning("FirstSandbox")) + if (gWarningSettings.getBOOL("FirstSandbox")) { - gSavedSettings.setWarning("FirstSandbox", FALSE); + gWarningSettings.setBOOL("FirstSandbox", FALSE); LLSD args; args["HOURS"] = llformat("%d",SANDBOX_CLEAN_FREQ); @@ -236,9 +234,9 @@ void LLFirstUse::useSandbox() // static void LLFirstUse::useFlexible() { - if (gSavedSettings.getWarning("FirstFlexible")) + if (gWarningSettings.getBOOL("FirstFlexible")) { - gSavedSettings.setWarning("FirstFlexible", FALSE); + gWarningSettings.setBOOL("FirstFlexible", FALSE); LLNotifications::instance().add("FirstFlexible"); } @@ -247,9 +245,9 @@ void LLFirstUse::useFlexible() // static void LLFirstUse::useDebugMenus() { - if (gSavedSettings.getWarning("FirstDebugMenus")) + if (gWarningSettings.getBOOL("FirstDebugMenus")) { - gSavedSettings.setWarning("FirstDebugMenus", FALSE); + gWarningSettings.setBOOL("FirstDebugMenus", FALSE); LLNotifications::instance().add("FirstDebugMenus"); } @@ -258,9 +256,9 @@ void LLFirstUse::useDebugMenus() // static void LLFirstUse::useSculptedPrim() { - if (gSavedSettings.getWarning("FirstSculptedPrim")) + if (gWarningSettings.getBOOL("FirstSculptedPrim")) { - gSavedSettings.setWarning("FirstSculptedPrim", FALSE); + gWarningSettings.setBOOL("FirstSculptedPrim", FALSE); LLNotifications::instance().add("FirstSculptedPrim"); @@ -270,9 +268,9 @@ void LLFirstUse::useSculptedPrim() // static void LLFirstUse::useMedia() { - if (gSavedSettings.getWarning("FirstMedia")) + if (gWarningSettings.getBOOL("FirstMedia")) { - gSavedSettings.setWarning("FirstMedia", FALSE); + gWarningSettings.setBOOL("FirstMedia", FALSE); LLNotifications::instance().add("FirstMedia"); } diff --git a/indra/newview/llflexibleobject.h b/indra/newview/llflexibleobject.h index 895701da3ad9fd6e95b746b2e0dc6ef2b1b9a20f..811ae24df2a921edb601d3515536cf3969789f25 100644 --- a/indra/newview/llflexibleobject.h +++ b/indra/newview/llflexibleobject.h @@ -43,7 +43,6 @@ #ifndef LL_LLFLEXIBLEOBJECT_H #define LL_LLFLEXIBLEOBJECT_H -#include "llmemory.h" #include "llprimitive.h" #include "llvovolume.h" #include "llwind.h" diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 810799d27c0780fbec26a3ea9c42d35cc0f4968a..9df0a968882ccacc059fed3bdc5c5ed526edcf1a 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -69,41 +69,35 @@ extern LLCPUInfo gSysCPU; extern LLMemoryInfo gSysMemory; extern U32 gPacketsIn; -///---------------------------------------------------------------------------- -/// Local function declarations, constants, enums, and typedefs -///---------------------------------------------------------------------------- - -LLFloaterAbout* LLFloaterAbout::sInstance = NULL; - static std::string get_viewer_release_notes_url(); + ///---------------------------------------------------------------------------- /// Class LLFloaterAbout ///---------------------------------------------------------------------------- // Default constructor -LLFloaterAbout::LLFloaterAbout() -: LLFloater(std::string("floater_about"), std::string("FloaterAboutRect"), LLStringUtil::null) +LLFloaterAbout::LLFloaterAbout(const LLSD& key) +: LLFloater() { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml"); + //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml"); + +} - // Support for changing product name. - std::string title("About "); - title += LLAppViewer::instance()->getSecondLifeTitle(); - setTitle(title); +// Destroys the object +LLFloaterAbout::~LLFloaterAbout() +{ +} +BOOL LLFloaterAbout::postBuild() +{ + center(); LLViewerTextEditor *support_widget = getChild<LLViewerTextEditor>("support_editor", true); LLViewerTextEditor *credits_widget = getChild<LLViewerTextEditor>("credits_editor", true); - - if (!support_widget || !credits_widget) - { - return; - } - // For some reason, adding style doesn't work unless this is true. support_widget->setParseHTML(TRUE); @@ -112,15 +106,15 @@ LLFloaterAbout::LLFloaterAbout() viewer_link_style->setVisible(true); viewer_link_style->setFontName(LLStringUtil::null); viewer_link_style->setLinkHREF(get_viewer_release_notes_url()); - viewer_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); + viewer_link_style->setColor(gSavedSkinSettings.getColor4("HTMLLinkColor")); // Version string - std::string version = LLAppViewer::instance()->getSecondLifeTitle() + std::string version = LLTrans::getString("SECOND_LIFE_VIEWER") + llformat(" %d.%d.%d (%d) %s %s (%s)\n", LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD, __DATE__, __TIME__, gSavedSettings.getString("VersionChannelName").c_str()); - support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); + support_widget->appendColoredText(version, FALSE, FALSE, LLUI::sSettingGroups["color"]->getColor("TextFgReadOnlyColor")); support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style); std::string support; @@ -142,7 +136,7 @@ LLFloaterAbout::LLFloaterAbout() server_link_style->setVisible(true); server_link_style->setFontName(LLStringUtil::null); server_link_style->setLinkHREF(region->getCapability("ServerReleaseNotes")); - server_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); + server_link_style->setColor(gSavedSkinSettings.getColor4("HTMLLinkColor")); const LLVector3d &pos = gAgent.getPositionGlobal(); LLUIString pos_text = getString("you_are_at"); @@ -150,8 +144,8 @@ LLFloaterAbout::LLFloaterAbout() llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ])); support.append(pos_text); - std::string region_text = llformat("in %s located at ", - gAgent.getRegion()->getName().c_str()); + LLUIString region_text = getString ("in_region") + " "; + region_text.setArg("[REGION]", llformat ("%s", gAgent.getRegion()->getName().c_str())); support.append(region_text); std::string buffer; @@ -164,7 +158,7 @@ LLFloaterAbout::LLFloaterAbout() support.append(gLastVersionChannel); support.append("\n"); - support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); + support_widget->appendColoredText(support, FALSE, FALSE, LLUI::sSettingGroups["color"]->getColor("TextFgReadOnlyColor")); support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style); support = "\n\n"; @@ -175,25 +169,26 @@ LLFloaterAbout::LLFloaterAbout() // and this info sometimes gets sent to support // CPU - support.append("CPU: "); + support.append(getString("CPU") + " "); support.append( gSysCPU.getCPUString() ); support.append("\n"); U32 memory = gSysMemory.getPhysicalMemoryKB() / 1024; // Moved hack adjustment to Windows memory size into llsys.cpp - std::string mem_text = llformat("Memory: %u MB\n", memory ); - support.append(mem_text); + LLStringUtil::format_map_t args; + args["[MEM]"] = llformat ("%u", memory); + support.append(getString("Memory", args) + "\n"); - support.append("OS Version: "); + support.append(getString("OSVersion") + " "); support.append( LLAppViewer::instance()->getOSInfo().getOSString() ); support.append("\n"); - support.append("Graphics Card Vendor: "); + support.append(getString("GraphicsCardVendor") + " "); support.append( (const char*) glGetString(GL_VENDOR) ); support.append("\n"); - support.append("Graphics Card: "); + support.append(getString("GraphicsCard") + " "); support.append( (const char*) glGetString(GL_RENDERER) ); support.append("\n"); @@ -211,23 +206,23 @@ LLFloaterAbout::LLFloaterAbout() getWindow()->setCursor(UI_CURSOR_ARROW); #endif - support.append("OpenGL Version: "); + support.append(getString("OpenGLVersion") + " "); support.append( (const char*) glGetString(GL_VERSION) ); support.append("\n"); support.append("\n"); - support.append("libcurl Version: "); + support.append(getString("LibCurlVersion") + " "); support.append( LLCurl::getVersionString() ); support.append("\n"); - support.append("J2C Decoder Version: "); + support.append(getString("J2CDecoderVersion") + " "); support.append( LLImageJ2C::getEngineInfo() ); support.append("\n"); - support.append("Audio Driver Version: "); + support.append(getString("AudioDriverVersion") + " "); bool want_fullname = true; - support.append( gAudiop ? gAudiop->getDriverName(want_fullname) : "(none)" ); + support.append( gAudiop ? gAudiop->getDriverName(want_fullname) : getString("none") ); support.append("\n"); LLMediaManager *mgr = LLMediaManager::getInstance(); @@ -236,7 +231,7 @@ LLFloaterAbout::LLFloaterAbout() LLMediaBase *media_source = mgr->createSourceFromMimeType("http", "text/html"); if (media_source) { - support.append("LLMozLib Version: "); + support.append(getString("LLMozLibVersion") + " "); support.append(media_source->getVersion()); support.append("\n"); mgr->destroySource(media_source); @@ -245,15 +240,13 @@ LLFloaterAbout::LLFloaterAbout() if (gPacketsIn > 0) { - std::string packet_loss = llformat("Packets Lost: %.0f/%.0f (%.1f%%)", - LLViewerStats::getInstance()->mPacketsLostStat.getCurrent(), - F32(gPacketsIn), - 100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) ); - support.append(packet_loss); - support.append("\n"); + args["[LOST]"] = llformat ("%.0f", LLViewerStats::getInstance()->mPacketsLostStat.getCurrent()); + args["[IN]"] = llformat ("%.0f", F32(gPacketsIn)); + args["[PCT]"] = llformat ("%.1f", 100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) ); + support.append(getString ("PacketsLost", args) + "\n"); } - support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); + support_widget->appendColoredText(support, FALSE, FALSE, LLUI::sSettingGroups["color"]->getColor("TextFgReadOnlyColor")); // Fix views support_widget->setCursorPos(0); @@ -266,43 +259,24 @@ LLFloaterAbout::LLFloaterAbout() credits_widget->setTakesFocus(TRUE); credits_widget->setHandleEditKeysDirectly(TRUE); - center(); - - sInstance = this; -} - -// Destroys the object -LLFloaterAbout::~LLFloaterAbout() -{ - sInstance = NULL; -} - -// static -void LLFloaterAbout::show(void*) -{ - if (!sInstance) - { - sInstance = new LLFloaterAbout(); - } - - sInstance->open(); /*Flawfinder: ignore*/ + return TRUE; } -static std::string get_viewer_release_notes_url() -{ - std::ostringstream version; - version << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; + static std::string get_viewer_release_notes_url() + { + std::ostringstream version; + version << LL_VERSION_MAJOR << "." + << LL_VERSION_MINOR << "." + << LL_VERSION_PATCH << "." + << LL_VERSION_BUILD; - LLSD query; - query["channel"] = gSavedSettings.getString("VersionChannelName"); - query["version"] = version.str(); + LLSD query; + query["channel"] = gSavedSettings.getString("VersionChannelName"); + query["version"] = version.str(); - std::ostringstream url; - url << RELEASE_NOTES_BASE_URL << LLURI::mapToQueryString(query); + std::ostringstream url; + url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query); - return url.str(); -} + return url.str(); + } diff --git a/indra/newview/llfloaterabout.h b/indra/newview/llfloaterabout.h index 7564b8e41cc4c9c91531ce52dc1ed1c5050120b5..1b0f3cddd3479b607e9c79f18e8ab9c26bf5bce0 100644 --- a/indra/newview/llfloaterabout.h +++ b/indra/newview/llfloaterabout.h @@ -36,16 +36,16 @@ #include "llfloater.h" class LLFloaterAbout -: public LLFloater + : public LLFloater, public LLFloaterSingleton<LLFloaterAbout> { -public: - LLFloaterAbout(); + friend class LLUISingleton<LLFloaterAbout, VisibilityPolicy<LLFloater> >; +public: + LLFloaterAbout(const LLSD& key); +protected: virtual ~LLFloaterAbout(); - static void show(void*); - -private: - static LLFloaterAbout* sInstance; +public: + /*virtual*/ BOOL postBuild(); }; diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index 162456b8ce9af02f9171eb58a74278d957fb543b..12c4932293f92731cf38be0a3077776ad7ffd9c6 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -42,6 +42,7 @@ #include "llstring.h" #include "llagent.h" +#include "llanimationstates.h" #include "llbbox.h" #include "llbutton.h" #include "llcheckboxctrl.h" @@ -66,6 +67,7 @@ #include "llvoavatar.h" #include "pipeline.h" #include "lluictrlfactory.h" +#include "lltrans.h" S32 LLFloaterAnimPreview::sUploadAmount = 10; @@ -82,6 +84,40 @@ const F32 MAX_CAMERA_ZOOM = 10.f; const F32 BASE_ANIM_TIME_OFFSET = 5.f; +std::string STATUS[] = +{ + "E_ST_OK", + "E_ST_EOF", + "E_ST_NO_CONSTRAINT", + "E_ST_NO_FILE", +"E_ST_NO_HIER", +"E_ST_NO_JOINT", +"E_ST_NO_NAME", +"E_ST_NO_OFFSET", +"E_ST_NO_CHANNELS", +"E_ST_NO_ROTATION", +"E_ST_NO_AXIS", +"E_ST_NO_MOTION", +"E_ST_NO_FRAMES", +"E_ST_NO_FRAME_TIME", +"E_ST_NO_POS", +"E_ST_NO_ROT", +"E_ST_NO_XLT_FILE", +"E_ST_NO_XLT_HEADER", +"E_ST_NO_XLT_NAME", +"E_ST_NO_XLT_IGNORE", +"E_ST_NO_XLT_RELATIVE", +"E_ST_NO_XLT_OUTNAME", +"E_ST_NO_XLT_MATRIX", +"E_ST_NO_XLT_MERGECHILD", +"E_ST_NO_XLT_MERGEPARENT", +"E_ST_NO_XLT_PRIORITY", +"E_ST_NO_XLT_LOOP", +"E_ST_NO_XLT_EASEIN", +"E_ST_NO_XLT_EASEOUT", +"E_ST_NO_XLT_HAND", +"E_ST_NO_XLT_EMOTE", +}; //----------------------------------------------------------------------------- // LLFloaterAnimPreview() //----------------------------------------------------------------------------- @@ -131,9 +167,9 @@ void LLFloaterAnimPreview::setAnimCallbacks() childSetCommitCallback("priority", onCommitPriority, this); childSetCommitCallback("loop_check", onCommitLoop, this); childSetCommitCallback("loop_in_point", onCommitLoopIn, this); - childSetValidate("loop_in_point", validateLoopIn); + childSetValidate("loop_in_point", boost::bind(&LLFloaterAnimPreview::validateLoopIn, this, _1)); childSetCommitCallback("loop_out_point", onCommitLoopOut, this); - childSetValidate("loop_out_point", validateLoopOut); + childSetValidate("loop_out_point", boost::bind(&LLFloaterAnimPreview::validateLoopOut, this, _1)); childSetCommitCallback("hand_pose_combo", onCommitHandPose, this); @@ -141,9 +177,9 @@ void LLFloaterAnimPreview::setAnimCallbacks() childSetValue("emote_combo", "[None]"); childSetCommitCallback("ease_in_time", onCommitEaseIn, this); - childSetValidate("ease_in_time", validateEaseIn); + childSetValidate("ease_in_time", boost::bind(&LLFloaterAnimPreview::validateEaseIn, this, _1)); childSetCommitCallback("ease_out_time", onCommitEaseOut, this); - childSetValidate("ease_out_time", validateEaseOut); + childSetValidate("ease_out_time", boost::bind(&LLFloaterAnimPreview::validateEaseOut, this, _1)); } //----------------------------------------------------------------------------- @@ -151,7 +187,6 @@ void LLFloaterAnimPreview::setAnimCallbacks() //----------------------------------------------------------------------------- BOOL LLFloaterAnimPreview::postBuild() { - LLRect r; LLKeyframeMotion* motionp = NULL; LLBVHLoader* loaderp = NULL; @@ -172,63 +207,14 @@ BOOL LLFloaterAnimPreview::postBuild() PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f); - S32 y = mPreviewRect.mTop + BTN_HEIGHT; - S32 btn_left = PREVIEW_HPAD; - - r.set( btn_left, y, btn_left + 32, y - BTN_HEIGHT ); mPlayButton = getChild<LLButton>( "play_btn"); - if (!mPlayButton) - { - mPlayButton = new LLButton(std::string("play_btn"), LLRect(0,0,0,0)); - } - mPlayButton->setClickedCallback(onBtnPlay); - mPlayButton->setCallbackUserData(this); - - mPlayButton->setImages(std::string("button_anim_play.tga"), - std::string("button_anim_play_selected.tga")); - mPlayButton->setDisabledImages(LLStringUtil::null,LLStringUtil::null); - - mPlayButton->setScaleImage(TRUE); + mPlayButton->setClickedCallback(onBtnPlay, this); mStopButton = getChild<LLButton>( "stop_btn"); - if (!mStopButton) - { - mStopButton = new LLButton(std::string("stop_btn"), LLRect(0,0,0,0)); - } - mStopButton->setClickedCallback(onBtnStop); - mStopButton->setCallbackUserData(this); - - mStopButton->setImages(std::string("button_anim_stop.tga"), - std::string("button_anim_stop_selected.tga")); - mStopButton->setDisabledImages(LLStringUtil::null,LLStringUtil::null); - - mStopButton->setScaleImage(TRUE); - - r.set(r.mRight + PREVIEW_HPAD, y, getRect().getWidth() - PREVIEW_HPAD, y - BTN_HEIGHT); - //childSetCommitCallback("playback_slider", onSliderMove, this); + mStopButton->setClickedCallback(onBtnStop, this); childHide("bad_animation_text"); - //childSetCommitCallback("preview_base_anim", onCommitBaseAnim, this); - //childSetValue("preview_base_anim", "Standing"); - - //childSetCommitCallback("priority", onCommitPriority, this); - //childSetCommitCallback("loop_check", onCommitLoop, this); - //childSetCommitCallback("loop_in_point", onCommitLoopIn, this); - //childSetValidate("loop_in_point", validateLoopIn); - //childSetCommitCallback("loop_out_point", onCommitLoopOut, this); - //childSetValidate("loop_out_point", validateLoopOut); - - //childSetCommitCallback("hand_pose_combo", onCommitHandPose, this); - - //childSetCommitCallback("emote_combo", onCommitEmote, this); - //childSetValue("emote_combo", "[None]"); - - //childSetCommitCallback("ease_in_time", onCommitEaseIn, this); - //childSetValidate("ease_in_time", validateEaseIn); - //childSetCommitCallback("ease_out_time", onCommitEaseOut, this); - //childSetValidate("ease_out_time", validateEaseOut); - std::string exten = gDirUtilp->getExtension(mFilename); if (exten == "bvh") { @@ -254,7 +240,19 @@ BOOL LLFloaterAnimPreview::postBuild() { file_buffer[file_size] = '\0'; llinfos << "Loading BVH file " << mFilename << llendl; - loaderp = new LLBVHLoader(file_buffer); + ELoadStatus load_status = E_ST_OK; + S32 line_number = 0; + loaderp = new LLBVHLoader(file_buffer, load_status, line_number); + std::string status = getString(STATUS[load_status]); + + if(load_status == E_ST_NO_XLT_FILE) + { + llwarns << "NOTE: No translation table found." << llendl; + } + else + { + llwarns << "ERROR: [line: " << line_number << "] " << status << llendl; + } } infile.close() ; @@ -347,7 +345,7 @@ BOOL LLFloaterAnimPreview::postBuild() else { LLUIString out_str = getString("failed_file_read"); - out_str.setArg("[STATUS]", loaderp->getStatus()); // *TODO:Translate + out_str.setArg("[STATUS]", getString(STATUS[loaderp->getStatus()])); childSetValue("bad_animation_text", out_str.getString()); } } @@ -813,57 +811,53 @@ void LLFloaterAnimPreview::onCommitEaseOut(LLUICtrl* ctrl, void* data) //----------------------------------------------------------------------------- // validateEaseIn() //----------------------------------------------------------------------------- -BOOL LLFloaterAnimPreview::validateEaseIn(LLUICtrl* spin, void* data) +bool LLFloaterAnimPreview::validateEaseIn(const LLSD& data) { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) - return FALSE; + if (!getEnabled()) + return false; - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (!motionp->getLoop()) { - F32 new_ease_in = llclamp((F32)previewp->childGetValue("ease_in_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseOutDuration()); - previewp->childSetValue("ease_in_time", LLSD(new_ease_in)); + F32 new_ease_in = llclamp((F32)childGetValue("ease_in_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseOutDuration()); + childSetValue("ease_in_time", LLSD(new_ease_in)); } - return TRUE; + return true; } //----------------------------------------------------------------------------- // validateEaseOut() //----------------------------------------------------------------------------- -BOOL LLFloaterAnimPreview::validateEaseOut(LLUICtrl* spin, void* data) +bool LLFloaterAnimPreview::validateEaseOut(const LLSD& data) { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; + if (!getEnabled()) + return false; - if (!previewp->getEnabled()) - return FALSE; - - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (!motionp->getLoop()) { - F32 new_ease_out = llclamp((F32)previewp->childGetValue("ease_out_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseInDuration()); - previewp->childSetValue("ease_out_time", LLSD(new_ease_out)); + F32 new_ease_out = llclamp((F32)childGetValue("ease_out_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseInDuration()); + childSetValue("ease_out_time", LLSD(new_ease_out)); } - return TRUE; + return true; } //----------------------------------------------------------------------------- // validateLoopIn() //----------------------------------------------------------------------------- -BOOL LLFloaterAnimPreview::validateLoopIn(LLUICtrl* ctrl, void* data) +bool LLFloaterAnimPreview::validateLoopIn(const LLSD& data) { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) - return FALSE; + if (!getEnabled()) + return false; - F32 loop_in_value = (F32)previewp->childGetValue("loop_in_point").asReal(); - F32 loop_out_value = (F32)previewp->childGetValue("loop_out_point").asReal(); + F32 loop_in_value = (F32)childGetValue("loop_in_point").asReal(); + F32 loop_out_value = (F32)childGetValue("loop_out_point").asReal(); if (loop_in_value < 0.f) { @@ -878,21 +872,20 @@ BOOL LLFloaterAnimPreview::validateLoopIn(LLUICtrl* ctrl, void* data) loop_in_value = loop_out_value; } - previewp->childSetValue("loop_in_point", LLSD(loop_in_value)); - return TRUE; + childSetValue("loop_in_point", LLSD(loop_in_value)); + return true; } //----------------------------------------------------------------------------- // validateLoopOut() //----------------------------------------------------------------------------- -BOOL LLFloaterAnimPreview::validateLoopOut(LLUICtrl* spin, void* data) +bool LLFloaterAnimPreview::validateLoopOut(const LLSD& data) { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) - return FALSE; + if (!getEnabled()) + return false; - F32 loop_out_value = (F32)previewp->childGetValue("loop_out_point").asReal(); - F32 loop_in_value = (F32)previewp->childGetValue("loop_in_point").asReal(); + F32 loop_out_value = (F32)childGetValue("loop_out_point").asReal(); + F32 loop_in_value = (F32)childGetValue("loop_in_point").asReal(); if (loop_out_value < 0.f) { @@ -907,8 +900,8 @@ BOOL LLFloaterAnimPreview::validateLoopOut(LLUICtrl* spin, void* data) loop_out_value = loop_in_value; } - previewp->childSetValue("loop_out_point", LLSD(loop_out_value)); - return TRUE; + childSetValue("loop_out_point", LLSD(loop_out_value)); + return true; } @@ -1018,7 +1011,7 @@ void LLFloaterAnimPreview::onBtnOK(void* userdata) LLKeyframeDataCache::removeKeyframeData(floaterp->mMotionID); } - floaterp->close(false); + floaterp->closeFloater(false); } //----------------------------------------------------------------------------- diff --git a/indra/newview/llfloateranimpreview.h b/indra/newview/llfloateranimpreview.h index 639c9277cd273a90b91d8f713c90ad8f34ad0735..2f228c3ecd608ca36074eb39108d22af9188b290 100644 --- a/indra/newview/llfloateranimpreview.h +++ b/indra/newview/llfloateranimpreview.h @@ -92,16 +92,16 @@ public: static void onCommitLoop(LLUICtrl*, void*); static void onCommitLoopIn(LLUICtrl*, void*); static void onCommitLoopOut(LLUICtrl*, void*); - static BOOL validateLoopIn(LLUICtrl*, void*); - static BOOL validateLoopOut(LLUICtrl*, void*); + bool validateLoopIn(const LLSD& data); + bool validateLoopOut(const LLSD& data); static void onCommitName(LLUICtrl*, void*); static void onCommitHandPose(LLUICtrl*, void*); static void onCommitEmote(LLUICtrl*, void*); static void onCommitPriority(LLUICtrl*, void*); static void onCommitEaseIn(LLUICtrl*, void*); static void onCommitEaseOut(LLUICtrl*, void*); - static BOOL validateEaseIn(LLUICtrl*, void*); - static BOOL validateEaseOut(LLUICtrl*, void*); + bool validateEaseIn(const LLSD& data); + bool validateEaseOut(const LLSD& data); static void onBtnOK(void*); static void onSaveComplete(const LLUUID& asset_uuid, LLAssetType::EType type, diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index 747431fb1912f6b982516d9971841d60975541e4..e1974bba84ce000800bccfe885fc5adb080193bf 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -41,6 +41,7 @@ #include "llparcel.h" #include "llvfile.h" #include "llvfs.h" +#include "llwindow.h" #include "llagent.h" #include "llcombobox.h" @@ -69,41 +70,32 @@ void auction_tga_upload_done(const LLUUID& asset_id, /// Class llfloaterauction ///---------------------------------------------------------------------------- -LLFloaterAuction* LLFloaterAuction::sInstance = NULL; - // Default constructor -LLFloaterAuction::LLFloaterAuction() : - LLFloater(std::string("floater_auction")), +LLFloaterAuction::LLFloaterAuction(const LLSD& key) + : LLFloater(), mParcelID(-1) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_auction.xml"); - - childSetValue("fence_check", - LLSD( gSavedSettings.getBOOL("AuctionShowFence") ) ); - childSetCommitCallback("fence_check", - LLSavedSettingsGlue::setBOOL, (void*)"AuctionShowFence"); - - childSetAction("snapshot_btn", onClickSnapshot, this); - childSetAction("ok_btn", onClickOK, this); } // Destroys the object LLFloaterAuction::~LLFloaterAuction() { - sInstance = NULL; } -// static -void LLFloaterAuction::show() +BOOL LLFloaterAuction::postBuild() { - if(!sInstance) - { - sInstance = new LLFloaterAuction(); - sInstance->center(); - sInstance->setFocus(TRUE); - } - sInstance->initialize(); - sInstance->open(); /*Flawfinder: ignore*/ + childSetValue("fence_check", LLSD( gSavedSettings.getBOOL("AuctionShowFence") ) ); + getChild<LLUICtrl>("fence_check")->setCommitCallback(boost::bind(LLSavedSettingsGlue::setBOOL, _1, "AuctionShowFence")); + + childSetAction("snapshot_btn", onClickSnapshot, this); + childSetAction("ok_btn", onClickOK, this); + return TRUE; +} + +void LLFloaterAuction::onOpen(const LLSD& key) +{ + initialize(); } void LLFloaterAuction::initialize() @@ -259,7 +251,7 @@ void LLFloaterAuction::onClickOK(void* data) self->mImage = NULL; self->mParcelID = -1; self->mParcelHost.invalidate(); - self->close(); + self->closeFloater(); } diff --git a/indra/newview/llfloaterauction.h b/indra/newview/llfloaterauction.h index e13bce01e10923d72d3ad97362a8179ea2405731..d71fd3c653e90500e5c74dbacc446b761ef173a7 100644 --- a/indra/newview/llfloaterauction.h +++ b/indra/newview/llfloaterauction.h @@ -36,7 +36,7 @@ #include "llfloater.h" #include "lluuid.h" -#include "llmemory.h" +#include "llpointer.h" #include "llviewerimage.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -46,26 +46,24 @@ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLParcelSelection; -class LLFloaterAuction : public LLFloater +class LLFloaterAuction : public LLFloater, public LLFloaterSingleton<LLFloaterAuction> { + friend class LLUISingleton<LLFloaterAuction, VisibilityPolicy<LLFloater> >; public: // LLFloater interface /*virtual*/ void onClose(bool app_quitting) { setVisible(FALSE); } + /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void draw(); - - // LLFloaterAuction interface - static void show(); private: - LLFloaterAuction(); + LLFloaterAuction(const LLSD& key); ~LLFloaterAuction(); void initialize(); static void onClickSnapshot(void* data); static void onClickOK(void* data); - static LLFloaterAuction* sInstance; - + /*virtual*/ BOOL postBuild(); private: LLTransactionID mTransactionID; LLAssetID mImageID; diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index e382fefece6a723f46af1b286ebcd88f7667836e..2c2dcda633648671d282337a92a8f53ba3e90dfe 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -42,15 +42,13 @@ #include "llinventorymodel.h" #include "lllineeditor.h" #include "llscrolllistctrl.h" +#include "llscrolllistitem.h" +#include "llscrolllistcell.h" #include "lltextbox.h" #include "lluictrlfactory.h" #include "llviewercontrol.h" #include "llworld.h" - -const S32 MIN_WIDTH = 200; -const S32 MIN_HEIGHT = 340; -const LLRect FLOATER_RECT(0, 380, 240, 0); -const std::string FLOATER_TITLE = "Choose Resident"; +#include "lltabcontainer.h" // static LLFloaterAvatarPicker* LLFloaterAvatarPicker::sInstance = NULL; @@ -70,13 +68,13 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback, sInstance->mCallbackUserdata = userdata; sInstance->mCloseOnSelect = FALSE; - sInstance->open(); /* Flawfinder: ignore */ + sInstance->openFloater(); sInstance->center(); sInstance->setAllowMultiple(allow_multiple); } else { - sInstance->open(); /*Flawfinder: ignore*/ + sInstance->openFloater(); sInstance->mCallback = callback; sInstance->mCallbackUserdata = userdata; sInstance->setAllowMultiple(allow_multiple); @@ -88,30 +86,33 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback, } // Default constructor -LLFloaterAvatarPicker::LLFloaterAvatarPicker() : - LLFloater(std::string("avatarpicker"), FLOATER_RECT, FLOATER_TITLE, TRUE, MIN_WIDTH, MIN_HEIGHT), +LLFloaterAvatarPicker::LLFloaterAvatarPicker() + : LLFloater(), mResultsReturned(FALSE), mCallback(NULL), mCallbackUserdata(NULL) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_picker.xml", NULL); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_picker.xml"); } BOOL LLFloaterAvatarPicker::postBuild() { - childSetKeystrokeCallback("Edit", editKeystroke, this); + getChild<LLLineEditor>("Edit")->setKeystrokeCallback(editKeystroke, this); childSetAction("Find", onBtnFind, this); childDisable("Find"); childSetAction("Refresh", onBtnRefresh, this); childSetCommitCallback("near_me_range", onRangeAdjust, this); - - childSetDoubleClickCallback("SearchResults", onBtnSelect); - childSetDoubleClickCallback("NearMe", onBtnSelect); + + LLScrollListCtrl* searchresults = getChild<LLScrollListCtrl>("SearchResults"); + searchresults->setDoubleClickCallback(onBtnSelect, this); childSetCommitCallback("SearchResults", onList, this); - childSetCommitCallback("NearMe", onList, this); childDisable("SearchResults"); - + + LLScrollListCtrl* nearme = getChild<LLScrollListCtrl>("NearMe"); + nearme->setDoubleClickCallback(onBtnSelect, this); + childSetCommitCallback("NearMe", onList, this); + childSetAction("Select", onBtnSelect, this); childDisable("Select"); @@ -126,33 +127,26 @@ BOOL LLFloaterAvatarPicker::postBuild() search_panel->setDefaultBtn("Find"); } - getChild<LLScrollListCtrl>("SearchResults")->addCommentText(getString("no_results")); + getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("no_results")); LLInventoryPanel* inventory_panel = getChild<LLInventoryPanel>("InventoryPanel"); inventory_panel->setFilterTypes(0x1 << LLInventoryType::IT_CALLINGCARD); inventory_panel->setFollowsAll(); inventory_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); inventory_panel->openDefaultFolderForType(LLAssetType::AT_CALLINGCARD); - inventory_panel->setSelectCallback(LLFloaterAvatarPicker::onCallingCardSelectionChange, this); - - childSetTabChangeCallback("ResidentChooserTabs", "SearchPanel", onTabChanged, this); - childSetTabChangeCallback("ResidentChooserTabs", "CallingCardsPanel", onTabChanged, this); - childSetTabChangeCallback("ResidentChooserTabs", "NearMePanel", onTabChanged, this); + inventory_panel->setSelectCallback(boost::bind(&LLFloaterAvatarPicker::doCallingCardSelectionChange, this, _1, _2)); + + getChild<LLTabContainer>("ResidentChooserTabs")->setCommitCallback( + boost::bind(&LLFloaterAvatarPicker::onTabChanged, this)); setAllowMultiple(FALSE); return TRUE; } -void LLFloaterAvatarPicker::onTabChanged(void* userdata, bool from_click) +void LLFloaterAvatarPicker::onTabChanged() { - LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; - if (!self) - { - return; - } - - self->childSetEnabled("Select", self->visibleItemsSelected()); + childSetEnabled("Select", visibleItemsSelected()); } // Destroys the object @@ -216,7 +210,7 @@ void LLFloaterAvatarPicker::onBtnSelect(void* userdata) if(self->mCloseOnSelect) { self->mCloseOnSelect = FALSE; - self->close(); + self->closeFloater(); } } @@ -229,14 +223,14 @@ void LLFloaterAvatarPicker::onBtnRefresh(void* userdata) } self->getChild<LLScrollListCtrl>("NearMe")->deleteAllItems(); - self->getChild<LLScrollListCtrl>("NearMe")->addCommentText(self->getString("searching")); + self->getChild<LLScrollListCtrl>("NearMe")->setCommentText(self->getString("searching")); self->mNearMeListComplete = FALSE; } void LLFloaterAvatarPicker::onBtnClose(void* userdata) { LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; - if(self) self->close(); + if(self) self->closeFloater(); } void LLFloaterAvatarPicker::onRangeAdjust(LLUICtrl* source, void* data) @@ -253,18 +247,8 @@ void LLFloaterAvatarPicker::onList(LLUICtrl* ctrl, void* userdata) } } -// static callback for inventory picker (select from calling cards) -void LLFloaterAvatarPicker::onCallingCardSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data) -{ - LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)data; - if (self) - { - self->doCallingCardSelectionChange( items, user_action, data ); - } -} - // Callback for inventory picker (select from calling cards) -void LLFloaterAvatarPicker::doCallingCardSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data) +void LLFloaterAvatarPicker::doCallingCardSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action) { bool panel_active = (childGetVisibleTab("ResidentChooserTabs") == getChild<LLPanel>("CallingCardsPanel")); @@ -330,7 +314,7 @@ void LLFloaterAvatarPicker::populateNearMe() { childDisable("NearMe"); childDisable("Select"); - near_me_scroller->addCommentText(getString("no_one_near")); + near_me_scroller->setCommentText(getString("no_one_near")); } else { @@ -394,7 +378,7 @@ void LLFloaterAvatarPicker::find() gAgent.sendReliableMessage(); getChild<LLScrollListCtrl>("SearchResults")->deleteAllItems(); - getChild<LLScrollListCtrl>("SearchResults")->addCommentText(getString("searching")); + getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("searching")); childSetEnabled("Select", FALSE); mResultsReturned = FALSE; @@ -501,7 +485,7 @@ BOOL LLFloaterAvatarPicker::handleKeyHere(KEY key, MASK mask) } else if (key == KEY_ESCAPE && mask == MASK_NONE) { - close(); + closeFloater(); return TRUE; } diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 56bc387bcefd69533547e47466a82e4df4688e37..0f47401f23886a3d2847ccfe9d52f47dc6b3cfac 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -62,10 +62,9 @@ private: static void onRangeAdjust(LLUICtrl* source, void* data); static void onBtnClose(void* userdata); static void onList(class LLUICtrl* ctrl, void* userdata); - static void onTabChanged(void* userdata, bool from_click); + void onTabChanged(); - void doCallingCardSelectionChange(const std::deque<class LLFolderViewItem*> &items, BOOL user_action, void* data); - static void onCallingCardSelectionChange(const std::deque<class LLFolderViewItem*> &items, BOOL user_action, void* data); + void doCallingCardSelectionChange(const std::deque<class LLFolderViewItem*> &items, BOOL user_action); void populateNearMe(); BOOL visibleItemsSelected() const; // Returns true if any items in the current tab are selected. diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp index e81b5d7fceac5659d91c07601dc5bd207a4ba10e..e2f13088ebc99c0559f2f555dc2a3e129366be69 100644 --- a/indra/newview/llfloateravatartextures.cpp +++ b/indra/newview/llfloateravatartextures.cpp @@ -42,30 +42,29 @@ using namespace LLVOAvatarDefines; -LLFloaterAvatarTextures::LLFloaterAvatarTextures(const LLUUID& id) : - LLFloater(std::string("avatar_texture_debug")), +LLFloaterAvatarTextures* LLFloaterAvatarTextures::sInstance = NULL; +LLFloaterAvatarTextures::LLFloaterAvatarTextures(const LLUUID& id) + : LLFloater(), mID(id) { + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_textures.xml"); } LLFloaterAvatarTextures::~LLFloaterAvatarTextures() { + sInstance = NULL; } LLFloaterAvatarTextures* LLFloaterAvatarTextures::show(const LLUUID &id) { - - LLFloaterAvatarTextures* floaterp = new LLFloaterAvatarTextures(id); - - // Builds and adds to gFloaterView - LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_avatar_textures.xml"); - - gFloaterView->addChild(floaterp); - floaterp->open(); /*Flawfinder: ignore*/ - - gFloaterView->adjustToFitScreen(floaterp, FALSE); - - return floaterp; + if (!sInstance) + { + sInstance = new LLFloaterAvatarTextures(id); + gFloaterView->addChild(sInstance); + gFloaterView->adjustToFitScreen(sInstance, FALSE); + } + sInstance->openFloater(); + return sInstance; } BOOL LLFloaterAvatarTextures::postBuild() @@ -142,7 +141,7 @@ void LLFloaterAvatarTextures::refresh() } else { - setTitle(mTitle + ": INVALID AVATAR (" + mID.asString() + ")"); + setTitle(mTitle + ": " + getString("InvalidAvatar") + " (" + mID.asString() + ")"); } } diff --git a/indra/newview/llfloateravatartextures.h b/indra/newview/llfloateravatartextures.h index 4138edeb4da5002ba339bb3793c8cccd0502882c..3ec0e7cb034e7311b9fd2ea8e1ddb5a5468887f4 100644 --- a/indra/newview/llfloateravatartextures.h +++ b/indra/newview/llfloateravatartextures.h @@ -60,6 +60,7 @@ private: LLUUID mID; std::string mTitle; LLTextureCtrl* mTextures[LLVOAvatarDefines::TEX_NUM_INDICES]; + static LLFloaterAvatarTextures* sInstance; }; #endif diff --git a/indra/newview/llfloaterbeacons.cpp b/indra/newview/llfloaterbeacons.cpp index 5476b35dc84e53428456f4a3fad0d005549dd1ea..052f334285734e473f5b2adb171a6727c381983b 100644 --- a/indra/newview/llfloaterbeacons.cpp +++ b/indra/newview/llfloaterbeacons.cpp @@ -40,6 +40,7 @@ LLFloaterBeacons::LLFloaterBeacons(const LLSD& seed) +: LLFloater() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_beacons.xml"); @@ -71,14 +72,13 @@ BOOL LLFloaterBeacons::postBuild() // Needed to make the floater visibility toggle the beacons. // Too bad we can't just add control_name="BeaconAlwaysOn" to the XML. -void LLFloaterBeacons::open() +void LLFloaterBeacons::onOpen(const LLSD& key) { - LLFloater::open(); gSavedSettings.setBOOL( "BeaconAlwaysOn", TRUE); } -void LLFloaterBeacons::close(bool app_quitting) +void LLFloaterBeacons::onClose(bool app_quitting) { - LLFloater::close(app_quitting); + destroy(); if(!app_quitting) { gSavedSettings.setBOOL( "BeaconAlwaysOn", FALSE); diff --git a/indra/newview/llfloaterbeacons.h b/indra/newview/llfloaterbeacons.h index c12bdd7261c37480361d3780de20888188aa2edc..8156e82ac38be2c8d0d79d3d5dbb43385be5b1f2 100644 --- a/indra/newview/llfloaterbeacons.h +++ b/indra/newview/llfloaterbeacons.h @@ -45,8 +45,8 @@ public: // Needed to make the floater visibility toggle the beacons. // Too bad we can't just add control_name="BeaconAlwaysOn" to the XML. - /*virtual*/ void open(); - /*virtual*/ void close(bool app_quitting); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); private: LLFloaterBeacons(const LLSD& seed); diff --git a/indra/newview/llfloaterbuildoptions.cpp b/indra/newview/llfloaterbuildoptions.cpp index 3cd35db19c4213587c294538e0978a89a1c3a6e5..2507a72caa8a546a04dc608b3586a1c9142c55ce 100644 --- a/indra/newview/llfloaterbuildoptions.cpp +++ b/indra/newview/llfloaterbuildoptions.cpp @@ -40,58 +40,16 @@ #include "llfloaterbuildoptions.h" #include "lluictrlfactory.h" -// library includes -#include "llfontgl.h" -#include "llcheckboxctrl.h" -#include "llspinctrl.h" -#include "llsliderctrl.h" - -// newview includes -#include "llresmgr.h" -#include "llviewercontrol.h" - -// -// Globals -// -LLFloaterBuildOptions *LLFloaterBuildOptions::sInstance = NULL; - // // Methods // -LLFloaterBuildOptions::LLFloaterBuildOptions( ) -: LLFloater(std::string("build options floater")) +LLFloaterBuildOptions::LLFloaterBuildOptions(const LLSD& key) + : LLFloater() { - sInstance = this; + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_build_options.xml"); } LLFloaterBuildOptions::~LLFloaterBuildOptions() { - sInstance = NULL; -} - -// static -void LLFloaterBuildOptions::show(void*) -{ - if (sInstance) - { - sInstance->open(); /*Flawfinder: ignore*/ - } - else - { - LLFloaterBuildOptions* floater = new LLFloaterBuildOptions(); - - LLUICtrlFactory::getInstance()->buildFloater(floater, "floater_build_options.xml"); - floater->open(); /*Flawfinder: ignore*/ - } } -LLFloaterBuildOptions* LLFloaterBuildOptions::getInstance() -{ - return sInstance; -} - -// static -BOOL LLFloaterBuildOptions::visible(void*) -{ - return (sInstance != NULL); -} diff --git a/indra/newview/llfloaterbuildoptions.h b/indra/newview/llfloaterbuildoptions.h index e030b063d9f773b2a31e8aa7914363bf067913e3..da72520486b5a59ed45b3de881715fbcfb332897 100644 --- a/indra/newview/llfloaterbuildoptions.h +++ b/indra/newview/llfloaterbuildoptions.h @@ -42,19 +42,12 @@ class LLFloaterBuildOptions -: public LLFloater + : public LLFloater, public LLFloaterSingleton<LLFloaterBuildOptions> { + friend class LLUISingleton<LLFloaterBuildOptions, VisibilityPolicy<LLFloater> >; protected: - LLFloaterBuildOptions(); + LLFloaterBuildOptions(const LLSD& key); ~LLFloaterBuildOptions(); - -public: - static void show(void*); - static LLFloaterBuildOptions* getInstance(); - static BOOL visible(void*); - -protected: - static LLFloaterBuildOptions* sInstance; }; #endif diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp index d4e1e981253b51405a5f7bc3e9c89da3034b4c52..65dc3cd9f0552362571931378585a056953f1080 100644 --- a/indra/newview/llfloaterbulkpermission.cpp +++ b/indra/newview/llfloaterbulkpermission.cpp @@ -52,14 +52,21 @@ #include "llviewerstats.h" #include "lluictrlfactory.h" #include "llselectmgr.h" +#include "llcheckboxctrl.h" #include "roles_constants.h" // for GP_OBJECT_MANIPULATE -LLFloaterBulkPermission::LLFloaterBulkPermission(const LLSD& seed) : mDone(FALSE) +LLFloaterBulkPermission::LLFloaterBulkPermission(const LLSD& seed) +: LLFloater(), + mDone(FALSE) { mID.generate(); LLUICtrlFactory::getInstance()->buildFloater(this,"floater_bulk_perms.xml"); +} + +BOOL LLFloaterBulkPermission::postBuild() +{ childSetEnabled("next_owner_transfer", gSavedSettings.getBOOL("BulkChangeNextOwnerCopy")); childSetAction("help", onHelpBtn, this); childSetAction("apply", onApplyBtn, this); @@ -67,6 +74,7 @@ LLFloaterBulkPermission::LLFloaterBulkPermission(const LLSD& seed) : mDone(FALSE childSetAction("check_all", onCheckAll, this); childSetAction("check_none", onUncheckAll, this); childSetCommitCallback("next_owner_copy", &onCommitCopy, this); + return TRUE; } void LLFloaterBulkPermission::doApply() @@ -93,7 +101,7 @@ void LLFloaterBulkPermission::doApply() LLSelectMgr::getInstance()->getSelection()->applyToNodes(&gatherer); if(mObjectIDs.empty()) { - list->addCommentText(getString("nothing_to_modify_text")); + list->setCommentText(getString("nothing_to_modify_text")); } else { @@ -178,7 +186,7 @@ void LLFloaterBulkPermission::onCommitCopy(LLUICtrl* ctrl, void* data) BOOL LLFloaterBulkPermission::start() { // note: number of top-level objects to modify is mObjectIDs.count(). - getChild<LLScrollListCtrl>("queue output")->addCommentText(getString("start_text")); + getChild<LLScrollListCtrl>("queue output")->setCommentText(getString("start_text")); return nextObject(); } @@ -201,7 +209,7 @@ BOOL LLFloaterBulkPermission::nextObject() if(isDone() && !mDone) { - getChild<LLScrollListCtrl>("queue output")->addCommentText(getString("done_text")); + getChild<LLScrollListCtrl>("queue output")->setCommentText(getString("done_text")); mDone = TRUE; } return successful_start; @@ -268,6 +276,7 @@ void LLFloaterBulkPermission::handleInventory(LLViewerObject* viewer_obj, Invent ( asstype == LLAssetType::AT_CLOTHING && gSavedSettings.getBOOL("BulkChangeIncludeClothing" )) || ( asstype == LLAssetType::AT_GESTURE && gSavedSettings.getBOOL("BulkChangeIncludeGestures" )) || ( asstype == LLAssetType::AT_LANDMARK && gSavedSettings.getBOOL("BulkChangeIncludeLandmarks" )) || + ( asstype == LLAssetType::AT_FAVORITE && gSavedSettings.getBOOL("BulkChangeIncludeFavourite" )) || ( asstype == LLAssetType::AT_NOTECARD && gSavedSettings.getBOOL("BulkChangeIncludeNotecards" )) || ( asstype == LLAssetType::AT_OBJECT && gSavedSettings.getBOOL("BulkChangeIncludeObjects" )) || ( asstype == LLAssetType::AT_LSL_TEXT && gSavedSettings.getBOOL("BulkChangeIncludeScripts" )) || @@ -317,7 +326,7 @@ void LLFloaterBulkPermission::handleInventory(LLViewerObject* viewer_obj, Invent status_text.setArg("[STATUS]", ""); } - list->addCommentText(status_text.getString()); + list->setCommentText(status_text.getString()); //TODO if we are an object inside an object we should check a recuse flag and if set //open the inventory of the object and recurse - Michelle2 Zenovka diff --git a/indra/newview/llfloaterbulkpermission.h b/indra/newview/llfloaterbulkpermission.h index a26b5b4f79163d33551159be938d4642f68126a8..2ea12fbe69ed0b9f6bd9d0f3dc7f42e1755a7c0c 100644 --- a/indra/newview/llfloaterbulkpermission.h +++ b/indra/newview/llfloaterbulkpermission.h @@ -51,6 +51,7 @@ class LLFloaterBulkPermission : public LLFloater, public LLVOInventoryListener, public: LLFloaterBulkPermission(const LLSD& seed); + BOOL postBuild(); private: virtual ~LLFloaterBulkPermission() {} diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index 96e51c2fa27ad9f36feae0beaf960c64806c7b4b..5cf4d90ece99b8656bffa63b49ce372ddb23cbd3 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -37,25 +37,19 @@ #include "llscrolllistctrl.h" +#include "llsd.h" #include "lluictrlfactory.h" #include "llviewermessage.h" #include "llappviewer.h" // gPacificDaylightTime -///---------------------------------------------------------------------------- -/// Local function declarations, constants, enums, and typedefs -///---------------------------------------------------------------------------- -LLFloaterBump* LLFloaterBump::sInstance = NULL; - ///---------------------------------------------------------------------------- /// Class LLFloaterBump ///---------------------------------------------------------------------------- // Default constructor -LLFloaterBump::LLFloaterBump() +LLFloaterBump::LLFloaterBump(const LLSD& key) : LLFloater() { - sInstance = this; - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_bumps.xml"); } @@ -63,29 +57,19 @@ LLFloaterBump::LLFloaterBump() // Destroys the object LLFloaterBump::~LLFloaterBump() { - sInstance = NULL; } -// static -void LLFloaterBump::show(void *contents) +// virtual +void LLFloaterBump::onOpen(const LLSD& key) { - if (gNoRender) - { + LLScrollListCtrl* list = getChild<LLScrollListCtrl>("bump_list"); + if (!list) return; - } - - if (!sInstance) - { - sInstance = new LLFloaterBump(); - } - - LLScrollListCtrl* list = sInstance->getChild<LLScrollListCtrl>("bump_list"); - if (!list) return; list->deleteAllItems(); if (gMeanCollisionList.empty()) { - std::string none_detected = sInstance->getString("none_detected"); + std::string none_detected = getString("none_detected"); LLSD row; row["columns"][0]["value"] = none_detected; row["columns"][0]["font"] = "SansSerifBold"; @@ -97,33 +81,23 @@ void LLFloaterBump::show(void *contents) iter != gMeanCollisionList.end(); ++iter) { LLMeanCollisionData *mcd = *iter; - LLFloaterBump::add(list, mcd); + add(list, mcd); } } - - sInstance->open(); /*Flawfinder: ignore*/ } void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) { - if (!sInstance) - { - new LLFloaterBump(); - } - if (mcd->mFirstName.empty() || list->getItemCount() >= 20) { return; } - // There's only one internal tm buffer. - struct tm* timep; - - // Convert to Pacific, based on server's opinion of whether - // it's daylight savings time there. - timep = utc_to_pacific_time(mcd->mTime, gPacificDaylightTime); - - std::string time = llformat("[%d:%02d]", timep->tm_hour, timep->tm_min); + std::string timeStr = getString ("timeStr"); + LLSD substitution; + + substitution["datetime"] = (S32) mcd->mTime; + LLStringUtil::format (timeStr, substitution); std::string action; switch(mcd->mType) @@ -150,8 +124,8 @@ void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) } // All above action strings are in XML file - LLUIString text = sInstance->getString(action); - text.setArg("[TIME]", time); + LLUIString text = getString(action); + text.setArg("[TIME]", timeStr); text.setArg("[FIRST]", mcd->mFirstName); text.setArg("[LAST]", mcd->mLastName); diff --git a/indra/newview/llfloaterbump.h b/indra/newview/llfloaterbump.h index eb15671d417415287527feb9bb5853e3005b7a2d..f55a9e6bc527dbd53c9aa31b128d15ef4272d8fe 100644 --- a/indra/newview/llfloaterbump.h +++ b/indra/newview/llfloaterbump.h @@ -40,18 +40,17 @@ class LLMeanCollisionData; class LLScrollListCtrl; class LLFloaterBump -: public LLFloater +: public LLFloater, public LLFloaterSingleton<LLFloaterBump> { -public: - static void show(void *); - -private: - LLFloaterBump(); + friend class LLUISingleton<LLFloaterBump, VisibilityPolicy<LLFloater> >; +protected: + LLFloaterBump(const LLSD& key); virtual ~LLFloaterBump(); - static void add(LLScrollListCtrl* list, LLMeanCollisionData *mcd); -private: - static LLFloaterBump* sInstance; + void add(LLScrollListCtrl* list, LLMeanCollisionData *mcd); + +public: + /*virtual*/ void onOpen(const LLSD& key); }; #endif diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index a33cabc749ec83d6c3dfe005bb0c382aab0459a6..9c523522fd0622781b8e61ff929fa15b65201bfe 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -49,14 +49,19 @@ #include "llviewerobject.h" #include "lluictrlfactory.h" #include "llviewerwindow.h" +#include "lltrans.h" LLFloaterBuy* LLFloaterBuy::sInstance = NULL; LLFloaterBuy::LLFloaterBuy() -: LLFloater(std::string("floater_buy_object"), std::string("FloaterBuyRect"), LLStringUtil::null) +: LLFloater() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_buy_object.xml"); +} + +BOOL LLFloaterBuy::postBuild() +{ childDisable("object_list"); childDisable("item_list"); @@ -64,6 +69,7 @@ LLFloaterBuy::LLFloaterBuy() childSetAction("buy_btn", onClickBuy, this); setDefaultBtn("cancel_btn"); // to avoid accidental buy (SL-43130) + return TRUE; } LLFloaterBuy::~LLFloaterBuy() @@ -102,7 +108,7 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) sInstance = new LLFloaterBuy(); } - sInstance->open(); /*Flawfinder: ignore*/ + sInstance->openFloater(); sInstance->setFocus(TRUE); sInstance->mSaleInfo = sale_info; sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); @@ -270,15 +276,15 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj, std::string text = obj->getName(); if (!(next_owner_mask & PERM_COPY)) { - text.append(" (no copy)"); + text.append(getString("no_copy")); } if (!(next_owner_mask & PERM_MODIFY)) { - text.append(" (no modify)"); + text.append(LLTrans::getString("no_modify")); } if (!(next_owner_mask & PERM_TRANSFER)) { - text.append(" (no transfer)"); + text.append(LLTrans::getString("no_transfer")); } row["columns"][1]["column"] = "text"; @@ -290,7 +296,6 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj, removeVOInventoryListener(); } - // static void LLFloaterBuy::onClickBuy(void*) { @@ -309,7 +314,7 @@ void LLFloaterBuy::onClickBuy(void*) // it doesn't match region info then sale is canceled. LLSelectMgr::getInstance()->sendBuy(gAgent.getID(), category_id, sInstance->mSaleInfo ); - sInstance->close(); + sInstance->closeFloater(); } @@ -318,7 +323,7 @@ void LLFloaterBuy::onClickCancel(void*) { if (sInstance) { - sInstance->close(); + sInstance->closeFloater(); } } @@ -326,5 +331,5 @@ void LLFloaterBuy::onClose(bool app_quitting) { // drop reference to current selection so selection goes away mObjectSelection = NULL; - LLFloater::onClose(app_quitting); + destroy(); } diff --git a/indra/newview/llfloaterbuy.h b/indra/newview/llfloaterbuy.h index 7473e6c85530e129760ef2c0213d389df57ed4fb..ffd3fa30c89b35bc56ae9c50cea383d10c428127 100644 --- a/indra/newview/llfloaterbuy.h +++ b/indra/newview/llfloaterbuy.h @@ -57,7 +57,7 @@ public: protected: LLFloaterBuy(); ~LLFloaterBuy(); - + /*virtual*/ BOOL postBuild(); /*virtual*/ void onClose(bool app_quitting); void reset(); diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index 95a8caac535a91b1ff5128e8321a538c83984546..7a902752011bd80e095f50bbe4d4c4a34bdb9546 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -57,10 +57,14 @@ LLFloaterBuyContents* LLFloaterBuyContents::sInstance = NULL; LLFloaterBuyContents::LLFloaterBuyContents() -: LLFloater(std::string("floater_buy_contents"), std::string("FloaterBuyContentsRect"), LLStringUtil::null) +: LLFloater() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_buy_contents.xml"); +} +BOOL LLFloaterBuyContents::postBuild() +{ + childSetAction("cancel_btn", onClickCancel, this); childSetAction("buy_btn", onClickBuy, this); @@ -69,6 +73,7 @@ LLFloaterBuyContents::LLFloaterBuyContents() childDisable("wear_check"); setDefaultBtn("cancel_btn"); // to avoid accidental buy (SL-43130) + return TRUE; } LLFloaterBuyContents::~LLFloaterBuyContents() @@ -99,7 +104,7 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) sInstance = new LLFloaterBuyContents(); } - sInstance->open(); /*Flawfinder: ignore*/ + sInstance->openFloater(); sInstance->setFocus(TRUE); sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); @@ -275,7 +280,7 @@ void LLFloaterBuyContents::onClickBuy(void*) if(!sInstance->childIsEnabled("buy_btn")) { // We shouldn't be enabled. Just close. - sInstance->close(); + sInstance->closeFloater(); return; } @@ -294,12 +299,12 @@ void LLFloaterBuyContents::onClickBuy(void*) // it doesn't match region info then sale is canceled. LLSelectMgr::getInstance()->sendBuy(gAgent.getID(), category_id, sInstance->mSaleInfo); - sInstance->close(); + sInstance->closeFloater(); } // static void LLFloaterBuyContents::onClickCancel(void*) { - sInstance->close(); + sInstance->closeFloater(); } diff --git a/indra/newview/llfloaterbuycontents.h b/indra/newview/llfloaterbuycontents.h index 908ff134e6e50d525a7a1d1a8753586d0c1a80d3..52114811bf1b93a8a5713aee419e6679d58718d5 100644 --- a/indra/newview/llfloaterbuycontents.h +++ b/indra/newview/llfloaterbuycontents.h @@ -55,7 +55,7 @@ public: protected: LLFloaterBuyContents(); ~LLFloaterBuyContents(); - + /*virtual*/ BOOL postBuild(); void requestObjectInventories(); /*virtual*/ void inventoryChanged(LLViewerObject* obj, InventoryObjectList* inv, diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index cfbc5da7618e9ba76e44f112f1e474ded3fd4df6..4274650f2c9deeebb4cfd1625366fb97b902a13d 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -80,7 +80,6 @@ public: virtual void draw(); virtual BOOL canClose(); - virtual void onClose(bool app_quitting); static void onClickBuy(void* data); static void onClickCancel(void* data); @@ -114,7 +113,7 @@ LLFloaterBuyCurrencyUI* LLFloaterBuyCurrencyUI::soleInstance(bool createIfNeeded #pragma warning(disable : 4355) #endif LLFloaterBuyCurrencyUI::LLFloaterBuyCurrencyUI() -: LLFloater(std::string("Buy Currency")), +: LLFloater(), mChildren(*this), mManager(*this) { @@ -162,7 +161,6 @@ BOOL LLFloaterBuyCurrencyUI::postBuild() childSetAction("error_web", onClickErrorWeb, this); updateUI(); - return TRUE; } @@ -172,7 +170,7 @@ void LLFloaterBuyCurrencyUI::draw() { if (mManager.bought()) { - close(); + closeFloater(); return; } @@ -187,12 +185,6 @@ BOOL LLFloaterBuyCurrencyUI::canClose() return mManager.canCancel(); } -void LLFloaterBuyCurrencyUI::onClose(bool app_quitting) -{ - LLFloater::onClose(app_quitting); - destroy(); -} - void LLFloaterBuyCurrencyUI::updateUI() { bool hasError = mManager.hasError(); @@ -341,7 +333,7 @@ void LLFloaterBuyCurrencyUI::onClickCancel(void* data) LLFloaterBuyCurrencyUI* self = LLFloaterBuyCurrencyUI::soleInstance(false); if (self) { - self->close(); + self->closeFloater(); } } @@ -352,7 +344,7 @@ void LLFloaterBuyCurrencyUI::onClickErrorWeb(void* data) if (self) { LLWeb::loadURLExternal(self->mManager.errorURI()); - self->close(); + self->closeFloater(); } } @@ -362,7 +354,7 @@ void LLFloaterBuyCurrency::buyCurrency() LLFloaterBuyCurrencyUI* ui = LLFloaterBuyCurrencyUI::soleInstance(true); ui->noTarget(); ui->updateUI(); - ui->open(); + ui->openFloater(); } void LLFloaterBuyCurrency::buyCurrency(const std::string& name, S32 price) @@ -370,7 +362,7 @@ void LLFloaterBuyCurrency::buyCurrency(const std::string& name, S32 price) LLFloaterBuyCurrencyUI* ui = LLFloaterBuyCurrencyUI::soleInstance(true); ui->target(name, price); ui->updateUI(); - ui->open(); + ui->openFloater(); } diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 29506e21d5b30d08865b9c6fc5942e7ea966efcd..3fbee83c7bb6b98ed74de3674ae9e6ac9026c2d2 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -187,7 +187,6 @@ public: virtual void draw(); virtual BOOL canClose(); - virtual void onClose(bool app_quitting); /*virtual*/ void setMinimized(BOOL b); private: @@ -199,7 +198,7 @@ private: }; static void cacheNameUpdateRefreshesBuyLand(const LLUUID&, - const std::string&, const std::string&, BOOL, void* data) + const std::string&, const std::string&, BOOL) { LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(false); if (ui) @@ -221,7 +220,7 @@ void LLFloaterBuyLand::buyLand( LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(true); ui->setForGroup(is_for_group); ui->setParcel(region, parcel); - ui->open(); /*Flawfinder: ignore*/ + ui->openFloater(); } // static @@ -298,7 +297,7 @@ LLFloaterBuyLandUI* LLFloaterBuyLandUI::soleInstance(bool createIfNeeded) static bool observingCacheName = false; if (!observingCacheName) { - gCacheName->addObserver(cacheNameUpdateRefreshesBuyLand); + gCacheName->addObserver(&cacheNameUpdateRefreshesBuyLand); observingCacheName = true; } @@ -322,7 +321,7 @@ LLFloaterBuyLandUI* LLFloaterBuyLandUI::soleInstance(bool createIfNeeded) #pragma warning(disable : 4355) #endif LLFloaterBuyLandUI::LLFloaterBuyLandUI() -: LLFloater(std::string("Buy Land")), +: LLFloater(), mParcel(0), mBought(false), mParcelValid(false), mSiteValid(false), @@ -350,7 +349,7 @@ void LLFloaterBuyLandUI::SelectionObserver::changed() { if (LLViewerParcelMgr::getInstance()->selectionEmpty()) { - ui->close(); + ui->closeFloater(); } else { ui->setParcel( @@ -566,8 +565,7 @@ void LLFloaterBuyLandUI::updateCovenantInfo() { check->set(false); check->setEnabled(true); - check->setCallbackUserData(this); - check->setCommitCallback(onChangeAgreeCovenant); + check->setCommitCallback(onChangeAgreeCovenant, this); } LLTextBox* box = getChild<LLTextBox>("covenant_text"); @@ -963,7 +961,7 @@ void LLFloaterBuyLandUI::draw() if (mBought) { - close(); + closeFloater(); } else if (needsUpdate) { @@ -999,13 +997,6 @@ void LLFloaterBuyLandUI::setMinimized(BOOL minimize) } } -void LLFloaterBuyLandUI::onClose(bool app_quitting) -{ - LLFloater::onClose(app_quitting); - destroy(); -} - - void LLFloaterBuyLandUI::refreshUI() { // section zero: title area @@ -1155,7 +1146,7 @@ void LLFloaterBuyLandUI::refreshUI() if (mIsForGroup) { LLStringUtil::format_map_t string_args; - string_args["[GROUP]"] = std::string(gAgent.mGroupName); + string_args["[GROUP]"] = std::string(gAgent.getGroupName()); message += getString("insufficient_land_credits", string_args); @@ -1169,7 +1160,7 @@ void LLFloaterBuyLandUI::refreshUI() if (!mParcelValid) { - message += "(no parcel selected)"; + message += getString("no_parcel_selected"); } else if (mParcelBillableArea == mParcelActualArea) { @@ -1225,12 +1216,10 @@ void LLFloaterBuyLandUI::refreshUI() ? LLViewChildren::BADGE_NOTE : LLViewChildren::BADGE_OK); - childSetText("purchase_action", - llformat( - "Pay L$ %d to %s for this land", - mParcelPrice, - mParcelSellerName.c_str() - )); + LLStringUtil::format_map_t string_args; + string_args["[AMOUNT]"] = llformat("%d", mParcelPrice); + string_args["[SELLER]"] = mParcelSellerName; + childSetText("purchase_action", getString("pay_to_for_land", string_args)); childSetVisible("purchase_action", mParcelValid); std::string reasonString; @@ -1368,7 +1357,7 @@ void LLFloaterBuyLandUI::onClickBuy(void* data) void LLFloaterBuyLandUI::onClickCancel(void* data) { LLFloaterBuyLandUI* self = (LLFloaterBuyLandUI*)data; - self->close(); + self->closeFloater(); } // static @@ -1376,7 +1365,7 @@ void LLFloaterBuyLandUI::onClickErrorWeb(void* data) { LLFloaterBuyLandUI* self = (LLFloaterBuyLandUI*)data; LLWeb::loadURLExternal(self->mCannotBuyURI); - self->close(); + self->closeFloater(); } diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index 7a4e5147fe73f78d585caa819d81559eff3152a0..6ca8944a19d6396bd3b340485b0634eb2ccc5c65 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -48,71 +48,31 @@ const F32 CAMERA_BUTTON_DELAY = 0.0f; // Member functions // + LLFloaterCamera::LLFloaterCamera(const LLSD& val) -: LLFloater("camera floater") // uses "FloaterCameraRect3" +: LLFloater() { setIsChrome(TRUE); // For now, only used for size and tooltip strings const BOOL DONT_OPEN = FALSE; - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_camera.xml", NULL, DONT_OPEN); - - S32 top = getRect().getHeight(); - S32 bottom = 0; - S32 left = 16; - - const S32 ROTATE_WIDTH = 64; - mRotate = new LLJoystickCameraRotate(std::string("cam rotate stick"), - LLRect( left, top, left + ROTATE_WIDTH, bottom ), - std::string("cam_rotate_out.tga"), - std::string("cam_rotate_in.tga") ); - mRotate->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); - mRotate->setHeldDownDelay(CAMERA_BUTTON_DELAY); - mRotate->setToolTip( getString("rotate_tooltip") ); - mRotate->setSoundFlags(MOUSE_DOWN | MOUSE_UP); - addChild(mRotate); - - left += ROTATE_WIDTH; + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_camera.xml", DONT_OPEN); - const S32 ZOOM_WIDTH = 16; - mZoom = new LLJoystickCameraZoom( - std::string("zoom"), - LLRect( left, top, left + ZOOM_WIDTH, bottom ), - std::string("cam_zoom_out.tga"), - std::string("cam_zoom_plus_in.tga"), - std::string("cam_zoom_minus_in.tga")); - mZoom->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); - mZoom->setHeldDownDelay(CAMERA_BUTTON_DELAY); - mZoom->setToolTip( getString("zoom_tooltip") ); - mZoom->setSoundFlags(MOUSE_DOWN | MOUSE_UP); - addChild(mZoom); - - left += ZOOM_WIDTH; - - const S32 TRACK_WIDTH = 64; - mTrack = new LLJoystickCameraTrack(std::string("cam track stick"), - LLRect( left, top, left + TRACK_WIDTH, bottom ), - std::string("cam_tracking_out.tga"), - std::string("cam_tracking_in.tga")); - mTrack->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); - mTrack->setHeldDownDelay(CAMERA_BUTTON_DELAY); - mTrack->setToolTip( getString("move_tooltip") ); - mTrack->setSoundFlags(MOUSE_DOWN | MOUSE_UP); - addChild(mTrack); + mRotate = getChild<LLJoystickCameraRotate>("cam_rotate_stick"); + mZoom = getChild<LLJoystickCameraZoom>("zoom"); + mTrack = getChild<LLJoystickCameraTrack>("cam_track_stick"); } // virtual -void LLFloaterCamera::onOpen() +void LLFloaterCamera::onOpen(const LLSD& key) { - LLFloater::onOpen(); - gSavedSettings.setBOOL("ShowCameraControls", TRUE); } // virtual void LLFloaterCamera::onClose(bool app_quitting) { - LLFloater::onClose(app_quitting); + destroy(); if (!app_quitting) { diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index 6862db7068747afe5fcad74739fb6027956b95a0..871e5c8ed13f501566389187b8de080168604665 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -49,7 +49,7 @@ private: LLFloaterCamera(const LLSD& val); ~LLFloaterCamera() {}; - /*virtual*/ void onOpen(); + /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onClose(bool app_quitting); public: diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index ea529d18830ec933e890ea38cc8a612ad7dab3b7..61ef3abda6c230d7f382576e9c973bd848d6214a 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -38,15 +38,6 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterchat.h" -#include "llfloateractivespeakers.h" -#include "llfloaterscriptdebug.h" - -#include "llchat.h" -#include "llfontgl.h" -#include "llrect.h" -#include "llerror.h" -#include "llstring.h" -#include "message.h" // project include #include "llagent.h" @@ -54,13 +45,17 @@ #include "llcheckboxctrl.h" #include "llcombobox.h" #include "llconsole.h" +#include "llfloateractivespeakers.h" #include "llfloaterchatterbox.h" #include "llfloatermute.h" +#include "llfloaterreg.h" +#include "llfloaterscriptdebug.h" #include "llkeyboard.h" //#include "lllineeditor.h" #include "llmutelist.h" //#include "llresizehandle.h" #include "llchatbar.h" +#include "llrecentpeople.h" #include "llstatusbar.h" #include "llviewertexteditor.h" #include "llviewergesture.h" // for triggering gestures @@ -76,16 +71,21 @@ #include "llweb.h" #include "llstylemap.h" -// Used for LCD display -extern void AddNewIMToLCD(const std::string &newLine); -extern void AddNewChatToLCD(const std::string &newLine); +// linden library includes +#include "audioengine.h" +#include "llchat.h" +#include "llfontgl.h" +#include "llrect.h" +#include "llerror.h" +#include "llstring.h" +#include "llwindow.h" +#include "message.h" + // // Constants // const F32 INSTANT_MSG_SIZE = 8.0f; const F32 CHAT_MSG_SIZE = 8.0f; -const LLColor4 MUTED_MSG_COLOR(0.5f, 0.5f, 0.5f, 1.f); -const S32 MAX_CHATTER_COUNT = 16; // // Global statics @@ -96,20 +96,13 @@ LLColor4 get_text_color(const LLChat& chat); // Member Functions // LLFloaterChat::LLFloaterChat(const LLSD& seed) -: LLFloater(std::string("chat floater"), std::string("FloaterChatRect"), LLStringUtil::null, - RESIZE_YES, 440, 100, DRAG_ON_TOP, MINIMIZE_NO, CLOSE_YES), - mPanel(NULL) + : LLFloater(), + mPanel(NULL) { mFactoryMap["chat_panel"] = LLCallbackMap(createChatPanel, NULL); mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, NULL); - // do not automatically open singleton floaters (as result of getInstance()) - BOOL no_open = FALSE; - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_chat_history.xml",&getFactoryMap(),no_open); + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_chat_history.xml"); - childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes - childSetVisible("Chat History Editor with mute",FALSE); - childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this); - setDefaultBtn("Chat"); } LLFloaterChat::~LLFloaterChat() @@ -120,8 +113,6 @@ LLFloaterChat::~LLFloaterChat() void LLFloaterChat::setVisible(BOOL visible) { LLFloater::setVisible( visible ); - - gSavedSettings.setBOOL("ShowChatHistory", visible); } void LLFloaterChat::draw() @@ -130,7 +121,7 @@ void LLFloaterChat::draw() childSetValue("toggle_active_speakers_btn", childIsVisible("active_speakers_panel")); - LLChatBar* chat_barp = getChild<LLChatBar>("chat_panel", TRUE); + LLChatBar* chat_barp = findChild<LLChatBar>("chat_panel", TRUE); if (chat_barp) { chat_barp->refresh(); @@ -144,22 +135,30 @@ BOOL LLFloaterChat::postBuild() { mPanel = (LLPanelActiveSpeakers*)getChild<LLPanel>("active_speakers_panel"); - LLChatBar* chat_barp = getChild<LLChatBar>("chat_panel", TRUE); + LLChatBar* chat_barp = findChild<LLChatBar>("chat_panel", TRUE); if (chat_barp) { chat_barp->setGestureCombo(getChild<LLComboBox>( "Gesture")); } + + childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes + childSetVisible("Chat History Editor with mute",FALSE); + childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this); + return TRUE; } // public virtual void LLFloaterChat::onClose(bool app_quitting) { - if (!app_quitting) + if (getHost()) + { + getHost()->setVisible(FALSE); + } + else { - gSavedSettings.setBOOL("ShowChatHistory", FALSE); + setVisible(FALSE); } - setVisible(FALSE); } void LLFloaterChat::onVisibilityChange(BOOL new_visibility) @@ -167,12 +166,6 @@ void LLFloaterChat::onVisibilityChange(BOOL new_visibility) // Hide the chat overlay when our history is visible. updateConsoleVisibility(); - // stop chat history tab from flashing when it appears - if (new_visibility) - { - LLFloaterChatterBox::getInstance()->setFloaterFlashing(this, FALSE); - } - LLFloater::onVisibilityChange(new_visibility); } @@ -257,7 +250,7 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) } // could flash the chat button in the status bar here. JC - LLFloaterChat* chat_floater = LLFloaterChat::getInstance(LLSD()); + LLFloaterChat* chat_floater = LLFloaterChat::getInstance(); LLViewerTextEditor* history_editor = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor"); LLViewerTextEditor* history_editor_with_mute = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor with mute"); @@ -295,8 +288,8 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) // static void LLFloaterChat::setHistoryCursorAndScrollToEnd() { - LLViewerTextEditor* history_editor = LLFloaterChat::getInstance(LLSD())->getChild<LLViewerTextEditor>("Chat History Editor"); - LLViewerTextEditor* history_editor_with_mute = LLFloaterChat::getInstance(LLSD())->getChild<LLViewerTextEditor>("Chat History Editor with mute"); + LLViewerTextEditor* history_editor = LLFloaterChat::getInstance()->getChild<LLViewerTextEditor>("Chat History Editor"); + LLViewerTextEditor* history_editor_with_mute = LLFloaterChat::getInstance()->getChild<LLViewerTextEditor>("Chat History Editor with mute"); if (history_editor) { @@ -324,8 +317,7 @@ void LLFloaterChat::onClickMute(void *data) LLMute mute(id); mute.setFromDisplayName(name); LLMuteList::getInstance()->add(mute); - - LLFloaterMute::showInstance(); + LLFloaterReg::showInstance("mute"); } //static @@ -368,20 +360,6 @@ void LLFloaterChat::addChat(const LLChat& chat, chat.mChatType == CHAT_TYPE_DEBUG_MSG && !gSavedSettings.getBOOL("ScriptErrorsAsChat"); -#if LL_LCD_COMPILE - // add into LCD displays - if (!invisible_script_debug_chat) - { - if (!from_instant_message) - { - AddNewChatToLCD(chat.mText); - } - else - { - AddNewIMToLCD(chat.mText); - } - } -#endif if (!invisible_script_debug_chat && !chat.mMuted && gConsole @@ -390,11 +368,11 @@ void LLFloaterChat::addChat(const LLChat& chat, F32 size = CHAT_MSG_SIZE; if (chat.mSourceType == CHAT_SOURCE_SYSTEM) { - text_color = gSavedSettings.getColor("SystemChatColor"); + text_color = gSavedSkinSettings.getColor("SystemChatColor"); } else if(from_instant_message) { - text_color = gSavedSettings.getColor("IMChatColor"); + text_color = gSavedSkinSettings.getColor("IMChatColor"); size = INSTANT_MSG_SIZE; } // We display anything if it's not an IM. If it's an IM, check pref... @@ -406,14 +384,62 @@ void LLFloaterChat::addChat(const LLChat& chat, if(from_instant_message && gSavedPerAccountSettings.getBOOL("LogChatIM")) log_chat_text(chat); + + if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory")) + addChatHistory(chat,false); + + triggerAlerts(chat.mText); - LLTextParser* highlight = LLTextParser::getInstance(); - highlight->triggerAlerts(gAgent.getID(), gAgent.getPositionGlobal(), chat.mText, gViewerWindow->getWindow()); + // Add the sender to the list of people with which we've recently interacted. + if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull()) + LLRecentPeople::instance().add(chat.mFromID); if(!from_instant_message) addChatHistory(chat); } +// Moved from lltextparser.cpp to break llui/llaudio library dependency. +//static +void LLFloaterChat::triggerAlerts(const std::string& text) +{ + LLTextParser* parser = LLTextParser::getInstance(); +// bool spoken=FALSE; + for (S32 i=0;i<parser->mHighlights.size();i++) + { + LLSD& highlight = parser->mHighlights[i]; + if (parser->findPattern(text,highlight) >= 0 ) + { + if(gAudiop) + { + if ((std::string)highlight["sound_lluuid"] != LLUUID::null.asString()) + { + gAudiop->triggerSound(highlight["sound_lluuid"].asUUID(), + gAgent.getID(), + 1.f, + LLAudioEngine::AUDIO_TYPE_UI, + gAgent.getPositionGlobal() ); + } +/* + if (!spoken) + { + LLTextToSpeech* text_to_speech = NULL; + text_to_speech = LLTextToSpeech::getInstance(); + spoken = text_to_speech->speak((LLString)highlight["voice"],text); + } + */ + } + if (highlight["flash"]) + { + LLWindow* viewer_window = gViewerWindow->getWindow(); + if (viewer_window && viewer_window->getMinimized()) + { + viewer_window->flashIcon(5.f); + } + } + } + } +} + LLColor4 get_text_color(const LLChat& chat) { LLColor4 text_color; @@ -427,37 +453,37 @@ LLColor4 get_text_color(const LLChat& chat) switch(chat.mSourceType) { case CHAT_SOURCE_SYSTEM: - text_color = gSavedSettings.getColor4("SystemChatColor"); + text_color = gSavedSkinSettings.getColor4("SystemChatColor"); break; case CHAT_SOURCE_AGENT: if (chat.mFromID.isNull()) { - text_color = gSavedSettings.getColor4("SystemChatColor"); + text_color = gSavedSkinSettings.getColor4("SystemChatColor"); } else { if(gAgent.getID() == chat.mFromID) { - text_color = gSavedSettings.getColor4("UserChatColor"); + text_color = gSavedSkinSettings.getColor4("UserChatColor"); } else { - text_color = gSavedSettings.getColor4("AgentChatColor"); + text_color = gSavedSkinSettings.getColor4("AgentChatColor"); } } break; case CHAT_SOURCE_OBJECT: if (chat.mChatType == CHAT_TYPE_DEBUG_MSG) { - text_color = gSavedSettings.getColor4("ScriptErrorColor"); + text_color = gSavedSkinSettings.getColor4("ScriptErrorColor"); } else if ( chat.mChatType == CHAT_TYPE_OWNER ) { - text_color = gSavedSettings.getColor4("llOwnerSayChatColor"); + text_color = gSavedSkinSettings.getColor4("llOwnerSayChatColor"); } else { - text_color = gSavedSettings.getColor4("ObjectChatColor"); + text_color = gSavedSkinSettings.getColor4("ObjectChatColor"); } break; default: @@ -482,7 +508,7 @@ LLColor4 get_text_color(const LLChat& chat) //static void LLFloaterChat::loadHistory() { - LLLogChat::loadHistory(std::string("chat"), &chatFromLogFile, (void *)LLFloaterChat::getInstance(LLSD())); + LLLogChat::loadHistory(std::string("chat"), &chatFromLogFile, (void *)LLFloaterChat::getInstance()); } //static @@ -498,6 +524,7 @@ void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , std::string l { LLChat chat; chat.mText = line; + get_text_color(chat); addChatHistory(chat, FALSE); } break; @@ -528,27 +555,9 @@ void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel")); } -//static -bool LLFloaterChat::visible(LLFloater* instance, const LLSD& key) -{ - return VisibilityPolicy<LLFloater>::visible(instance, key); -} - -//static -void LLFloaterChat::show(LLFloater* instance, const LLSD& key) -{ - VisibilityPolicy<LLFloater>::show(instance, key); -} - -//static -void LLFloaterChat::hide(LLFloater* instance, const LLSD& key) -{ - if(instance->getHost()) - { - LLFloaterChatterBox::hideInstance(); - } - else - { - VisibilityPolicy<LLFloater>::hide(instance, key); - } -} +//static + LLFloaterChat* LLFloaterChat::getInstance() + { + LLFloater* inst = LLFloaterReg::getInstance("chat", LLSD()) ; + return dynamic_cast<LLFloaterChat*>(inst); + } diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h index b5393866b8ba598d54bf752df8c081b51d47eeaf..2bae4ea0c29690b1fe5e2297116995c99e807a40 100644 --- a/indra/newview/llfloaterchat.h +++ b/indra/newview/llfloaterchat.h @@ -40,19 +40,18 @@ #include "llfloater.h" #include "lllogchat.h" -class LLButton; + class LLChat; -class LLComboBox; -class LLLineEditor; class LLViewerTextEditor; class LLMessageSystem; class LLUUID; class LLCheckBoxCtrl; class LLPanelActiveSpeakers; class LLLogChat; +class LLVector3d; +class LLWindow; -class LLFloaterChat - : public LLFloater, public LLUISingleton<LLFloaterChat, LLFloaterChat> +class LLFloaterChat : public LLFloater { public: LLFloaterChat(const LLSD& seed); @@ -67,14 +66,16 @@ public: void updateConsoleVisibility(); static void setHistoryCursorAndScrollToEnd(); - + + // *TODO:Skinning - move these to LLChat (or LLViewerChat?) // Add chat to console and history list. // Color based on source, type, distance. static void addChat(const LLChat& chat, BOOL from_im = FALSE, BOOL local_agent = FALSE); - // Add chat to history alone. static void addChatHistory(const LLChat& chat, bool log_to_file = true); + static void triggerAlerts(const std::string& text); + static void onClickMute(void *data); static void onClickToggleShowMute(LLUICtrl* caller, void *data); static void onClickToggleActiveSpeakers(void* userdata); @@ -82,12 +83,9 @@ public: static void loadHistory(); static void* createSpeakersPanel(void* data); static void* createChatPanel(void* data); - - // visibility policy for LLUISingleton - static bool visible(LLFloater* instance, const LLSD& key); - static void show(LLFloater* instance, const LLSD& key); - static void hide(LLFloater* instance, const LLSD& key); - + + static LLFloaterChat* getInstance(); // *TODO:Skinning Deprecate + LLPanelActiveSpeakers* mPanel; BOOL mScrolledToEnd; }; diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp index 0fa1aa15e66ea740cc8460cec65bf424eb664a86..a283b445f50967b17b6d9ef997600c30e23a9aef 100644 --- a/indra/newview/llfloaterchatterbox.cpp +++ b/indra/newview/llfloaterchatterbox.cpp @@ -35,6 +35,7 @@ #include "llviewerprecompiledheaders.h" +#include "llfloaterreg.h" #include "llfloaterchatterbox.h" #include "lluictrlfactory.h" #include "llfloaterchat.h" @@ -49,12 +50,11 @@ // LLFloaterMyFriends::LLFloaterMyFriends(const LLSD& seed) + : LLFloater() { mFactoryMap["friends_panel"] = LLCallbackMap(LLFloaterMyFriends::createFriendsPanel, NULL); mFactoryMap["groups_panel"] = LLCallbackMap(LLFloaterMyFriends::createGroupsPanel, NULL); - // do not automatically open singleton floaters (as result of getInstance()) - BOOL no_open = FALSE; - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_my_friends.xml", &getFactoryMap(), no_open); + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_my_friends.xml"); } LLFloaterMyFriends::~LLFloaterMyFriends() @@ -63,11 +63,20 @@ LLFloaterMyFriends::~LLFloaterMyFriends() BOOL LLFloaterMyFriends::postBuild() { - mTabs = getChild<LLTabContainer>("friends_and_groups"); - return TRUE; } +void LLFloaterMyFriends::onOpen(const LLSD& key) +{ + if (key.asString() == "friends") + { + childShowTab("friends_and_groups", "friends_panel"); + } + else if (key.asString() == "groups") + { + childShowTab("friends_and_groups", "groups_panel"); + } +} void LLFloaterMyFriends::onClose(bool app_quitting) { @@ -86,18 +95,34 @@ void* LLFloaterMyFriends::createGroupsPanel(void* data) return new LLPanelGroups(); } +//static +LLFloaterMyFriends* LLFloaterMyFriends::getInstance() +{ + LLFloater* inst = LLFloaterReg::getInstance("contacts", "friends") ; + return dynamic_cast<LLFloaterMyFriends*>(inst); +} + // // LLFloaterChatterBox // -LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : - mActiveVoiceFloater(NULL) +LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) + : LLMultiFloater(), + mActiveVoiceFloater(NULL) { mAutoResize = FALSE; - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox.xml", NULL, FALSE); + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox.xml", FALSE); +} + +LLFloaterChatterBox::~LLFloaterChatterBox() +{ +} + +BOOL LLFloaterChatterBox::postBuild() +{ if (gSavedSettings.getBOOL("ContactsTornOff")) { - LLFloaterMyFriends* floater_contacts = LLFloaterMyFriends::getInstance(0); + LLFloaterMyFriends* floater_contacts = LLFloaterMyFriends::getInstance(); // add then remove to set up relationship for re-attach addFloater(floater_contacts, FALSE); removeFloater(floater_contacts); @@ -106,7 +131,7 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : } else { - addFloater(LLFloaterMyFriends::getInstance(0), TRUE); + addFloater(LLFloaterMyFriends::getInstance(), TRUE); } if (gSavedSettings.getBOOL("ChatHistoryTornOff")) @@ -120,13 +145,10 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : } else { - addFloater(LLFloaterChat::getInstance(LLSD()), FALSE); + addFloater(LLFloaterChat::getInstance(), FALSE); } mTabContainer->lockTabs(); -} - -LLFloaterChatterBox::~LLFloaterChatterBox() -{ + return TRUE; } BOOL LLFloaterChatterBox::handleKeyHere(KEY key, MASK mask) @@ -139,13 +161,13 @@ BOOL LLFloaterChatterBox::handleKeyHere(KEY key, MASK mask) { if (floater->isCloseable()) { - floater->close(); + floater->closeFloater(); } else { // close chatterbox window if frontmost tab is reserved, non-closeable tab // such as contacts or near me - close(); + closeFloater(); } } return TRUE; @@ -200,15 +222,27 @@ void LLFloaterChatterBox::draw() LLMultiFloater::draw(); } -void LLFloaterChatterBox::onOpen() +void LLFloaterChatterBox::onOpen(const LLSD& key) { - gSavedSettings.setBOOL("ShowCommunicate", TRUE); + //*TODO:Skinning show the session id associated with key + if (key.asString() == "local") + { + LLFloaterChat* chat = LLFloaterReg::findTypedInstance<LLFloaterChat>("chat"); + chat->openFloater(); + } + else if (key.isDefined()) + { + LLFloaterIMPanel* impanel = gIMMgr->findFloaterBySession(key.asUUID()); + if (impanel) + { + impanel->openFloater(); + } + } } void LLFloaterChatterBox::onClose(bool app_quitting) { setVisible(FALSE); - gSavedSettings.setBOOL("ShowCommunicate", FALSE); } void LLFloaterChatterBox::setMinimized(BOOL minimized) @@ -244,7 +278,11 @@ void LLFloaterChatterBox::addFloater(LLFloater* floaterp, S32 num_locked_tabs = mTabContainer->getNumLockedTabs(); // already here - if (floaterp->getHost() == this) return; + if (floaterp->getHost() == this) + { + openFloater(floaterp->getKey()); + return; + } // make sure my friends and chat history both locked when re-attaching chat history if (floaterp->getName() == "chat floater") @@ -281,6 +319,7 @@ void LLFloaterChatterBox::addFloater(LLFloater* floaterp, else { LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point); + openFloater(floaterp->getKey()); } // make sure active voice icon shows up for new tab @@ -290,6 +329,13 @@ void LLFloaterChatterBox::addFloater(LLFloater* floaterp, } } +//static +LLFloaterChatterBox* LLFloaterChatterBox::getInstance() +{ + LLFloater* inst = LLFloaterReg::getInstance("communicate", LLSD()) ; + return dynamic_cast<LLFloaterChatterBox*>(inst); +} + //static LLFloater* LLFloaterChatterBox::getCurrentVoiceFloater() { @@ -300,11 +346,11 @@ LLFloater* LLFloaterChatterBox::getCurrentVoiceFloater() if (LLVoiceChannelProximal::getInstance() == LLVoiceChannel::getCurrentVoiceChannel()) { // show near me tab if in proximal channel - return LLFloaterChat::getInstance(LLSD()); + return LLFloaterChat::getInstance(); } else { - LLFloaterChatterBox* floater = LLFloaterChatterBox::getInstance(LLSD()); + LLFloaterChatterBox* floater = LLFloaterChatterBox::getInstance(); // iterator over all IM tabs (skip friends and near me) for (S32 i = 0; i < floater->getFloaterCount(); i++) { diff --git a/indra/newview/llfloaterchatterbox.h b/indra/newview/llfloaterchatterbox.h index 3adbd14370d9afb2e014143afe09a25accb02fe2..e6a2e30ba6d88eac62c130aa02a6c9777e170af1 100644 --- a/indra/newview/llfloaterchatterbox.h +++ b/indra/newview/llfloaterchatterbox.h @@ -42,15 +42,16 @@ class LLTabContainer; -class LLFloaterChatterBox : public LLMultiFloater, public LLUISingleton<LLFloaterChatterBox, LLFloaterChatterBox> +class LLFloaterChatterBox : public LLMultiFloater { public: LLFloaterChatterBox(const LLSD& seed); virtual ~LLFloaterChatterBox(); - + + /*virtual*/ BOOL postBuild(); /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ void draw(); - /*virtual*/ void onOpen(); + /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void setMinimized(BOOL minimized); @@ -59,108 +60,28 @@ public: BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); + static LLFloaterChatterBox* getInstance(); // *TODO:Skinning Deprecate static LLFloater* getCurrentVoiceFloater(); - // visibility policy for LLUISingleton - static bool visible(LLFloater* instance, const LLSD& key) - { - LLFloater* floater_to_check = ((LLFloaterChatterBox*)instance)->getFloater(key); - - if (floater_to_check) - { - return floater_to_check->isInVisibleChain(); - } - - // otherwise use default visibility rule for chatterbox - return VisibilityPolicy<LLFloater>::visible(instance, key); - } - - static void show(LLFloater* instance, const LLSD& key) - { - LLFloater* floater_to_show = ((LLFloaterChatterBox*)instance)->getFloater(key); - VisibilityPolicy<LLFloater>::show(instance, key); - - if (floater_to_show) - { - floater_to_show->open(); - } - } - - static void hide(LLFloater* instance, const LLSD& key) - { - VisibilityPolicy<LLFloater>::hide(instance, key); - } - -private: - LLFloater* getFloater(const LLSD& key) - { - LLFloater* floater = NULL; - - //try to show requested session - LLUUID session_id = key.asUUID(); - if (session_id.notNull()) - { - floater = LLIMMgr::getInstance()->findFloaterBySession(session_id); - } - - // if TRUE, show tab for active voice channel, otherwise, just show last tab - if (key.asBoolean()) - { - floater = getCurrentVoiceFloater(); - } - - return floater; - } - protected: LLFloater* mActiveVoiceFloater; }; -class LLFloaterMyFriends : public LLFloater, public LLUISingleton<LLFloaterMyFriends, LLFloaterMyFriends> +class LLFloaterMyFriends : public LLFloater { public: LLFloaterMyFriends(const LLSD& seed); virtual ~LLFloaterMyFriends(); - virtual BOOL postBuild(); - - void onClose(bool app_quitting); + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); + static LLFloaterMyFriends* getInstance(); // *TODO:Skinning Deprecate + static void* createFriendsPanel(void* data); static void* createGroupsPanel(void* data); - - // visibility policy for LLUISingleton - static bool visible(LLFloater* instance, const LLSD& key) - { - LLFloaterMyFriends* floaterp = (LLFloaterMyFriends*)instance; - return floaterp->isInVisibleChain() && floaterp->mTabs->getCurrentPanelIndex() == key.asInteger(); - } - - static void show(LLFloater* instance, const LLSD& key) - { - VisibilityPolicy<LLFloater>::show(instance, key); - // garbage values in id will be interpreted as 0, or the friends tab - ((LLFloaterMyFriends*)instance)->mTabs->selectTab(key); - } - - static void hide(LLFloater* instance, const LLSD& key) - { - if (visible(instance, key)) - { - if(instance->getHost()) - { - LLFloaterChatterBox::hideInstance(); - } - else - { - VisibilityPolicy<LLFloater>::hide(instance, key); - } - } - } - -protected: - LLTabContainer* mTabs; }; #endif // LL_LLFLOATERCHATTERBOX_H diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index f82d692dd3a8e31e1e18819531318f15e01a2399..4964f0455680f03259d51027b7138ad107028a23 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -32,11 +32,15 @@ #include "llviewerprecompiledheaders.h" -#include <sstream> -#include <iomanip> - #include "llfloatercolorpicker.h" +// Viewer project includes +#include "lltoolmgr.h" +#include "lltoolpipette.h" +#include "llviewercontrol.h" +#include "llworld.h" + +// Linden library includes #include "llfontgl.h" #include "llsys.h" #include "llgl.h" @@ -47,23 +51,23 @@ #include "lllineeditor.h" #include "v4coloru.h" #include "llbutton.h" -#include "llviewercontrol.h" #include "lluictrlfactory.h" -#include "llviewerwindow.h" #include "llgl.h" -#include "llmemory.h" +#include "llpointer.h" #include "llimage.h" #include "llmousehandler.h" #include "llimagegl.h" #include "llglheaders.h" #include "llcheckboxctrl.h" -#include "llworld.h" #include "lltextbox.h" #include "lluiconstants.h" #include "llfocusmgr.h" -#include "lltoolmgr.h" -#include "lltoolpipette.h" #include "lldraghandle.h" +#include "llwindow.h" + +// System includes +#include <sstream> +#include <iomanip> const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; @@ -75,11 +79,8 @@ const F32 CONTEXT_FADE_TIME = 0.08f; // ////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// default ctor -LLFloaterColorPicker:: -LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate ) - : LLFloater (std::string("Color Picker Floater")), +LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate ) + : LLFloater(), mComponents ( 3 ), mMouseDownInLumRegion ( FALSE ), mMouseDownInHueRegion ( FALSE ), @@ -123,10 +124,7 @@ LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate ) } } -////////////////////////////////////////////////////////////////////////////// -// dtor -LLFloaterColorPicker:: -~LLFloaterColorPicker() +LLFloaterColorPicker::~LLFloaterColorPicker() { // destroy the UI we created destroyUI (); @@ -134,9 +132,7 @@ LLFloaterColorPicker:: ////////////////////////////////////////////////////////////////////////////// // -void -LLFloaterColorPicker:: -createUI () +void LLFloaterColorPicker::createUI () { // build the majority of the gui using the factory builder LLUICtrlFactory::getInstance()->buildFloater ( this, "floater_color_picker.xml" ); @@ -177,19 +173,17 @@ createUI () // argh! const std::string s ( codec.str () ); - mPalette.push_back ( new LLColor4 ( gSavedSettings.getColor4 ( s ) ) ); + mPalette.push_back ( new LLColor4 ( gSavedSkinSettings.getColor4 ( s ) ) ); } } ////////////////////////////////////////////////////////////////////////////// // -void -LLFloaterColorPicker:: -showUI () +void LLFloaterColorPicker::showUI () { setVisible ( TRUE ); setFocus ( TRUE ); - open(); /*Flawfinder: ignore*/ + openFloater(getKey()); // HACK: if system color picker is required - close the SL one we made and use default system dialog if ( gSavedSettings.getBOOL ( "UseDefaultColorPicker" ) ) @@ -203,7 +197,7 @@ showUI () { LLColor4 curCol = swatch->get (); send_agent_pause(); - gViewerWindow->getWindow ()->dialog_color_picker ( &curCol [ 0 ], &curCol [ 1 ], &curCol [ 2 ] ); + getWindow()->dialogColorPicker( &curCol [ 0 ], &curCol [ 1 ], &curCol [ 2 ] ); send_agent_resume(); setOrigRgb ( curCol [ 0 ], curCol [ 1 ], curCol [ 2 ] ); @@ -212,36 +206,30 @@ showUI () LLColorSwatchCtrl::onColorChanged ( swatch, LLColorSwatchCtrl::COLOR_CHANGE ); } - close(); + closeFloater(); } } ////////////////////////////////////////////////////////////////////////////// // called after the dialog is rendered -BOOL -LLFloaterColorPicker:: -postBuild() +BOOL LLFloaterColorPicker::postBuild() { mCancelBtn = getChild<LLButton>( "cancel_btn" ); - mCancelBtn->setClickedCallback ( onClickCancel ); - mCancelBtn->setCallbackUserData ( this ); + mCancelBtn->setClickedCallback ( onClickCancel, this ); mSelectBtn = getChild<LLButton>( "select_btn"); - mSelectBtn->setClickedCallback ( onClickSelect ); - mSelectBtn->setCallbackUserData ( this ); + mSelectBtn->setClickedCallback ( onClickSelect, this ); mSelectBtn->setFocus ( TRUE ); mPipetteBtn = getChild<LLButton>("color_pipette" ); mPipetteBtn->setImages(std::string("eye_button_inactive.tga"), std::string("eye_button_active.tga")); - mPipetteBtn->setClickedCallback( onClickPipette ); - mPipetteBtn->setCallbackUserData ( this ); + mPipetteBtn->setCommitCallback( boost::bind(&LLFloaterColorPicker::onClickPipette, this )); mApplyImmediateCheck = getChild<LLCheckBoxCtrl>("apply_immediate"); mApplyImmediateCheck->set(gSavedSettings.getBOOL("ApplyColorImmediately")); - mApplyImmediateCheck->setCommitCallback(onImmediateCheck); - mApplyImmediateCheck->setCallbackUserData(this); + mApplyImmediateCheck->setCommitCallback(onImmediateCheck, this); childSetCommitCallback("rspin", onTextCommit, (void*)this ); childSetCommitCallback("gspin", onTextCommit, (void*)this ); @@ -250,18 +238,15 @@ postBuild() childSetCommitCallback("sspin", onTextCommit, (void*)this ); childSetCommitCallback("lspin", onTextCommit, (void*)this ); + LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterColorPicker::onColorSelect, this, _1)); + return TRUE; } ////////////////////////////////////////////////////////////////////////////// // -void -LLFloaterColorPicker:: -initUI ( F32 rValIn, F32 gValIn, F32 bValIn ) +void LLFloaterColorPicker::initUI ( F32 rValIn, F32 gValIn, F32 bValIn ) { - // start catching lose-focus events from entry widgets - enableTextCallbacks ( TRUE ); - // under some circumstances, we get rogue values that can be calmed by clamping... rValIn = llclamp ( rValIn, 0.0f, 1.0f ); gValIn = llclamp ( gValIn, 0.0f, 1.0f ); @@ -279,9 +264,7 @@ initUI ( F32 rValIn, F32 gValIn, F32 bValIn ) ////////////////////////////////////////////////////////////////////////////// // -void -LLFloaterColorPicker:: -destroyUI () +void LLFloaterColorPicker::destroyUI () { // shut down pipette tool if active stopUsingPipette(); @@ -305,9 +288,7 @@ destroyUI () ////////////////////////////////////////////////////////////////////////////// // -F32 -LLFloaterColorPicker:: -hueToRgb ( F32 val1In, F32 val2In, F32 valHUeIn ) +F32 LLFloaterColorPicker::hueToRgb ( F32 val1In, F32 val2In, F32 valHUeIn ) { if ( valHUeIn < 0.0f ) valHUeIn += 1.0f; if ( valHUeIn > 1.0f ) valHUeIn -= 1.0f; @@ -319,9 +300,7 @@ hueToRgb ( F32 val1In, F32 val2In, F32 valHUeIn ) ////////////////////////////////////////////////////////////////////////////// // -void -LLFloaterColorPicker:: -hslToRgb ( F32 hValIn, F32 sValIn, F32 lValIn, F32& rValOut, F32& gValOut, F32& bValOut ) +void LLFloaterColorPicker::hslToRgb ( F32 hValIn, F32 sValIn, F32 lValIn, F32& rValOut, F32& gValOut, F32& bValOut ) { if ( sValIn < 0.00001f ) { @@ -349,9 +328,7 @@ hslToRgb ( F32 hValIn, F32 sValIn, F32 lValIn, F32& rValOut, F32& gValOut, F32& ////////////////////////////////////////////////////////////////////////////// // mutator for original RGB value -void -LLFloaterColorPicker:: -setOrigRgb ( F32 origRIn, F32 origGIn, F32 origBIn ) +void LLFloaterColorPicker::setOrigRgb ( F32 origRIn, F32 origGIn, F32 origBIn ) { origR = origRIn; origG = origGIn; @@ -360,9 +337,7 @@ setOrigRgb ( F32 origRIn, F32 origGIn, F32 origBIn ) ////////////////////////////////////////////////////////////////////////////// // accessor for original RGB value -void -LLFloaterColorPicker:: -getOrigRgb ( F32& origROut, F32& origGOut, F32& origBOut ) +void LLFloaterColorPicker::getOrigRgb ( F32& origROut, F32& origGOut, F32& origBOut ) { origROut = origR; origGOut = origG; @@ -371,9 +346,7 @@ getOrigRgb ( F32& origROut, F32& origGOut, F32& origBOut ) ////////////////////////////////////////////////////////////////////////////// // mutator for current RGB value -void -LLFloaterColorPicker:: -setCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn ) +void LLFloaterColorPicker::setCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn ) { // save current RGB curR = curRIn; @@ -383,19 +356,13 @@ setCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn ) // update corresponding HSL values and LLColor3(curRIn, curGIn, curBIn).calcHSL(&curH, &curS, &curL); - // color changed so update text fields (fixes SL-16968) - // HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion - // CP: this was required when I first wrote the code but this may not be necessary anymore - leaving it there just in case - enableTextCallbacks( FALSE ); + // color changed so update text fields updateTextEntry(); - enableTextCallbacks( TRUE ); } ////////////////////////////////////////////////////////////////////////////// // accessor for current RGB value -void -LLFloaterColorPicker:: -getCurRgb ( F32& curROut, F32& curGOut, F32& curBOut ) +void LLFloaterColorPicker::getCurRgb ( F32& curROut, F32& curGOut, F32& curBOut ) { curROut = curR; curGOut = curG; @@ -404,9 +371,7 @@ getCurRgb ( F32& curROut, F32& curGOut, F32& curBOut ) ////////////////////////////////////////////////////////////////////////////// // mutator for current HSL value -void -LLFloaterColorPicker:: -setCurHsl ( F32 curHIn, F32 curSIn, F32 curLIn ) +void LLFloaterColorPicker::setCurHsl ( F32 curHIn, F32 curSIn, F32 curLIn ) { // save current HSL curH = curHIn; @@ -419,9 +384,7 @@ setCurHsl ( F32 curHIn, F32 curSIn, F32 curLIn ) ////////////////////////////////////////////////////////////////////////////// // accessor for current HSL value -void -LLFloaterColorPicker:: -getCurHsl ( F32& curHOut, F32& curSOut, F32& curLOut ) +void LLFloaterColorPicker::getCurHsl ( F32& curHOut, F32& curSOut, F32& curLOut ) { curHOut = curH; curSOut = curS; @@ -430,9 +393,7 @@ getCurHsl ( F32& curHOut, F32& curSOut, F32& curLOut ) ////////////////////////////////////////////////////////////////////////////// // called when 'cancel' clicked -void -LLFloaterColorPicker:: -onClickCancel ( void* data ) +void LLFloaterColorPicker::onClickCancel ( void* data ) { if (data) { @@ -441,16 +402,14 @@ onClickCancel ( void* data ) if ( self ) { self->cancelSelection (); - self->close(); + self->closeFloater(); } } } ////////////////////////////////////////////////////////////////////////////// // called when 'select' clicked -void -LLFloaterColorPicker:: -onClickSelect ( void* data ) +void LLFloaterColorPicker::onClickSelect ( void* data ) { if (data) { @@ -460,36 +419,28 @@ onClickSelect ( void* data ) { // apply to selection LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_SELECT ); - self->close(); + self->closeFloater(); } } } -void LLFloaterColorPicker::onClickPipette( void* data ) +void LLFloaterColorPicker::onClickPipette( ) { - LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data; - - if ( self) + BOOL pipette_active = mPipetteBtn->getToggleState(); + pipette_active = !pipette_active; + if (pipette_active) { - BOOL pipette_active = self->mPipetteBtn->getToggleState(); - pipette_active = !pipette_active; - if (pipette_active) - { - LLToolPipette::getInstance()->setSelectCallback(onColorSelect, self); - LLToolMgr::getInstance()->setTransientTool(LLToolPipette::getInstance()); - } - else - { - LLToolMgr::getInstance()->clearTransientTool(); - } + LLToolMgr::getInstance()->setTransientTool(LLToolPipette::getInstance()); + } + else + { + LLToolMgr::getInstance()->clearTransientTool(); } } ////////////////////////////////////////////////////////////////////////////// // called when 'text is committed' - i,e. focus moves from a text field -void -LLFloaterColorPicker:: -onTextCommit ( LLUICtrl* ctrl, void* data ) +void LLFloaterColorPicker::onTextCommit ( LLUICtrl* ctrl, void* data ) { if ( data ) { @@ -515,16 +466,12 @@ void LLFloaterColorPicker::onImmediateCheck( LLUICtrl* ctrl, void* data) } } -void LLFloaterColorPicker::onColorSelect( const LLTextureEntry& te, void *data ) +void LLFloaterColorPicker::onColorSelect( const LLTextureEntry& te ) { - LLFloaterColorPicker* self = (LLFloaterColorPicker*)data; - if (self) + setCurRgb(te.getColor().mV[VRED], te.getColor().mV[VGREEN], te.getColor().mV[VBLUE]); + if (mApplyImmediateCheck->get()) { - self->setCurRgb(te.getColor().mV[VRED], te.getColor().mV[VGREEN], te.getColor().mV[VBLUE]); - if (self->mApplyImmediateCheck->get()) - { - LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE ); - } + LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE ); } } @@ -673,9 +620,7 @@ void LLFloaterColorPicker::draw() ////////////////////////////////////////////////////////////////////////////// // find a complimentary color to the one passed in that can be used to highlight -const LLColor4& -LLFloaterColorPicker:: -getComplimentaryColor ( const LLColor4& backgroundColor ) +const LLColor4& LLFloaterColorPicker::getComplimentaryColor ( const LLColor4& backgroundColor ) { // going to base calculation on luminance F32 hVal, sVal, lVal; @@ -695,9 +640,7 @@ getComplimentaryColor ( const LLColor4& backgroundColor ) ////////////////////////////////////////////////////////////////////////////// // draw color palette -void -LLFloaterColorPicker:: -drawPalette () +void LLFloaterColorPicker::drawPalette () { S32 curEntry = 0; @@ -748,9 +691,7 @@ drawPalette () ////////////////////////////////////////////////////////////////////////////// // update text entry values for RGB/HSL (can't be done in ::draw () since this overwrites input -void -LLFloaterColorPicker:: -updateTextEntry () +void LLFloaterColorPicker::updateTextEntry () { // set values in spinners childSetValue("rspin", ( getCurR () * 255.0f ) ); @@ -761,38 +702,9 @@ updateTextEntry () childSetValue("lspin", ( getCurL () * 100.0f ) ); } -////////////////////////////////////////////////////////////////////////////// -// turns on or off text entry commit call backs -void -LLFloaterColorPicker:: -enableTextCallbacks ( BOOL stateIn ) -{ - if ( stateIn ) - { - childSetCommitCallback("rspin", onTextCommit, (void*)this ); - childSetCommitCallback("gspin", onTextCommit, (void*)this ); - childSetCommitCallback("bspin", onTextCommit, (void*)this ); - childSetCommitCallback("hspin", onTextCommit, (void*)this ); - childSetCommitCallback("sspin", onTextCommit, (void*)this ); - childSetCommitCallback("lspin", onTextCommit, (void*)this ); - } - else - { - childSetCommitCallback("rspin", 0, (void*)this ); - childSetCommitCallback("gspin", 0, (void*)this ); - childSetCommitCallback("bspin", 0, (void*)this ); - childSetCommitCallback("hspin", 0, (void*)this ); - childSetCommitCallback("sspin", 0, (void*)this ); - childSetCommitCallback("lspin", 0, (void*)this ); - } -} - - ////////////////////////////////////////////////////////////////////////////// // -void -LLFloaterColorPicker:: -onTextEntryChanged ( LLUICtrl* ctrl ) +void LLFloaterColorPicker::onTextEntryChanged ( LLUICtrl* ctrl ) { // value in RGB boxes changed std::string name = ctrl->getName(); @@ -821,10 +733,7 @@ onTextEntryChanged ( LLUICtrl* ctrl ) // update current RGB (and implicitly HSL) setCurRgb ( rVal, gVal, bVal ); - // HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion - enableTextCallbacks ( FALSE ); updateTextEntry (); - enableTextCallbacks ( TRUE ); } else // value in HSL boxes changed @@ -847,10 +756,7 @@ onTextEntryChanged ( LLUICtrl* ctrl ) // update current HSL (and implicitly RGB) setCurHsl ( hVal, sVal, lVal ); - // HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion - enableTextCallbacks ( FALSE ); updateTextEntry (); - enableTextCallbacks ( TRUE ); } if (mApplyImmediateCheck->get()) @@ -861,9 +767,7 @@ onTextEntryChanged ( LLUICtrl* ctrl ) ////////////////////////////////////////////////////////////////////////////// // -BOOL -LLFloaterColorPicker:: -updateRgbHslFromPoint ( S32 xPosIn, S32 yPosIn ) +BOOL LLFloaterColorPicker::updateRgbHslFromPoint ( S32 xPosIn, S32 yPosIn ) { if ( xPosIn >= mRGBViewerImageLeft && xPosIn <= mRGBViewerImageLeft + mRGBViewerImageWidth && @@ -899,9 +803,7 @@ updateRgbHslFromPoint ( S32 xPosIn, S32 yPosIn ) ////////////////////////////////////////////////////////////////////////////// // -BOOL -LLFloaterColorPicker:: -handleMouseDown ( S32 x, S32 y, MASK mask ) +BOOL LLFloaterColorPicker::handleMouseDown ( S32 x, S32 y, MASK mask ) { // make it the frontmost gFloaterView->bringToFront(this); @@ -987,10 +889,7 @@ handleMouseDown ( S32 x, S32 y, MASK mask ) LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE ); } - // HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion - enableTextCallbacks ( FALSE ); updateTextEntry (); - enableTextCallbacks ( TRUE ); } return TRUE; @@ -1003,9 +902,7 @@ handleMouseDown ( S32 x, S32 y, MASK mask ) ////////////////////////////////////////////////////////////////////////////// // -BOOL -LLFloaterColorPicker:: -handleHover ( S32 x, S32 y, MASK mask ) +BOOL LLFloaterColorPicker::handleHover ( S32 x, S32 y, MASK mask ) { // if we're the front most window if ( isFrontmost () ) @@ -1071,19 +968,9 @@ handleHover ( S32 x, S32 y, MASK mask ) return LLFloater::handleHover ( x, y, mask ); } -void LLFloaterColorPicker::onClose(bool app_quitting) -{ - //RN: this is consistent with texture picker in that closing the window leaves the current selection - // to change this to "close to cancel", uncomment the following line - //cancelSelection(); - LLFloater::onClose(app_quitting); -} - ////////////////////////////////////////////////////////////////////////////// // reverts state once mouse button is released -BOOL -LLFloaterColorPicker:: -handleMouseUp ( S32 x, S32 y, MASK mask ) +BOOL LLFloaterColorPicker::handleMouseUp ( S32 x, S32 y, MASK mask ) { getWindow()->setCursor ( UI_CURSOR_ARROW ); @@ -1130,7 +1017,7 @@ handleMouseUp ( S32 x, S32 y, MASK mask ) std::ostringstream codec; codec << "ColorPaletteEntry" << std::setfill ( '0' ) << std::setw ( 2 ) << curEntry + 1; const std::string s ( codec.str () ); - gSavedSettings.setColor4( s, *mPalette [ curEntry ] ); + gSavedSkinSettings.setColor4( s, *mPalette [ curEntry ] ); } } @@ -1158,16 +1045,11 @@ handleMouseUp ( S32 x, S32 y, MASK mask ) ////////////////////////////////////////////////////////////////////////////// // cancel current color selection, revert to original and close picker -void -LLFloaterColorPicker:: -cancelSelection () +void LLFloaterColorPicker::cancelSelection () { // restore the previous color selection setCurRgb ( getOrigR (), getOrigG (), getOrigB () ); - // we're going away and when we do and the entry widgets lose focus, they do bad things so turn them off - enableTextCallbacks ( FALSE ); - // update in world item with original color via current swatch LLColorSwatchCtrl::onColorChanged( getSwatch(), LLColorSwatchCtrl::COLOR_CANCEL ); diff --git a/indra/newview/llfloatercolorpicker.h b/indra/newview/llfloatercolorpicker.h index 7c8d36a7c7f2deb6595a9280b7b604440d9691dc..16f456b5bf05ff484d2d6ac1b1e4130ea71d8208 100644 --- a/indra/newview/llfloatercolorpicker.h +++ b/indra/newview/llfloatercolorpicker.h @@ -36,7 +36,7 @@ #include <vector> #include "llfloater.h" -#include "llmemory.h" +#include "llpointer.h" #include "llcolorswatch.h" #include "llspinctrl.h" #include "lltextureentry.h" @@ -61,7 +61,6 @@ class LLFloaterColorPicker virtual BOOL handleMouseUp ( S32 x, S32 y, MASK mask ); virtual BOOL handleHover ( S32 x, S32 y, MASK mask ); virtual void onMouseCaptureLost(); - virtual void onClose(bool app_quitting); // implicit methods void createUI (); @@ -123,14 +122,11 @@ class LLFloaterColorPicker // callbacks static void onClickCancel ( void* data ); static void onClickSelect ( void* data ); - static void onClickPipette ( void* data ); + void onClickPipette ( ); static void onTextCommit ( LLUICtrl* ctrl, void* data ); static void onImmediateCheck ( LLUICtrl* ctrl, void* data ); - static void onColorSelect( const LLTextureEntry& te, void *data ); + void onColorSelect( const LLTextureEntry& te ); private: - // turns on or off text entry commit call backs - void enableTextCallbacks ( BOOL stateIn ); - // draws color selection palette void drawPalette (); diff --git a/indra/newview/llfloaterdaycycle.cpp b/indra/newview/llfloaterdaycycle.cpp index 58876a8dec66fd4107a816e8078b9369c49a3a05..a448df792e5e6cd94e3238924eb26a220628e961 100644 --- a/indra/newview/llfloaterdaycycle.cpp +++ b/indra/newview/llfloaterdaycycle.cpp @@ -63,15 +63,20 @@ LLFloaterDayCycle* LLFloaterDayCycle::sDayCycle = NULL; std::map<std::string, LLWLSkyKey> LLFloaterDayCycle::sSliderToKey; const F32 LLFloaterDayCycle::sHoursPerDay = 24.0f; -LLFloaterDayCycle::LLFloaterDayCycle() : LLFloater(std::string("Day Cycle Floater")) +LLFloaterDayCycle::LLFloaterDayCycle() + : LLFloater() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_day_cycle_options.xml"); - +} + +BOOL LLFloaterDayCycle::postBuild() +{ // add the combo boxes LLComboBox* keyCombo = getChild<LLComboBox>("WLKeyPresets"); if(keyCombo != NULL) { + keyCombo->removeall(); std::map<std::string, LLWLParamSet>::iterator mIt = LLWLParamManager::instance()->mParamList.begin(); for(; mIt != LLWLParamManager::instance()->mParamList.end(); mIt++) @@ -90,6 +95,7 @@ LLFloaterDayCycle::LLFloaterDayCycle() : LLFloater(std::string("Day Cycle Floate // load it up initCallbacks(); + return TRUE; } LLFloaterDayCycle::~LLFloaterDayCycle() @@ -231,7 +237,7 @@ LLFloaterDayCycle* LLFloaterDayCycle::instance() if (!sDayCycle) { sDayCycle = new LLFloaterDayCycle(); - sDayCycle->open(); + sDayCycle->openFloater(); sDayCycle->setFocus(TRUE); } return sDayCycle; @@ -256,7 +262,7 @@ void LLFloaterDayCycle::show() //LLUICtrlFactory::getInstance()->buildFloater(dayCycle, "floater_day_cycle_options.xml"); //dayCycle->initCallbacks(); - dayCycle->open(); + dayCycle->openFloater(); } // virtual diff --git a/indra/newview/llfloaterdaycycle.h b/indra/newview/llfloaterdaycycle.h index d230035545327f1ef3bc2a96e2d422e59cf84742..a03a7f749aceac9e45c236f123de3adebc8f54ed 100644 --- a/indra/newview/llfloaterdaycycle.h +++ b/indra/newview/llfloaterdaycycle.h @@ -58,7 +58,7 @@ public: LLFloaterDayCycle(); virtual ~LLFloaterDayCycle(); - + /*virtual*/ BOOL postBuild(); /// help button stuff static void onClickHelp(void* data); void initHelpBtn(const std::string& name, const std::string& xml_alert); diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index 661c3988c0e3a6eda3a06687ff2f3e7aeafc0b3c..cfdf49373eba5ab599139fef5b2d5b1dcceff6aa 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -54,18 +54,22 @@ LLFloaterEnvSettings* LLFloaterEnvSettings::sEnvSettings = NULL; -LLFloaterEnvSettings::LLFloaterEnvSettings() : LLFloater(std::string("Environment Settings Floater")) +LLFloaterEnvSettings::LLFloaterEnvSettings() + : LLFloater() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_env_settings.xml"); - - // load it up - initCallbacks(); } - +// virtual LLFloaterEnvSettings::~LLFloaterEnvSettings() { } - +// virtual +BOOL LLFloaterEnvSettings::postBuild() +{ + // load it up + initCallbacks(); + return TRUE; +} void LLFloaterEnvSettings::onClickHelp(void* data) { LLFloaterEnvSettings* self = (LLFloaterEnvSettings*)data; @@ -174,7 +178,7 @@ LLFloaterEnvSettings* LLFloaterEnvSettings::instance() if (!sEnvSettings) { sEnvSettings = new LLFloaterEnvSettings(); - sEnvSettings->open(); + sEnvSettings->openFloater(); sEnvSettings->setFocus(TRUE); } return sEnvSettings; @@ -188,7 +192,7 @@ void LLFloaterEnvSettings::show() //LLUICtrlFactory::getInstance()->buildFloater(envSettings, "floater_env_settings.xml"); //envSettings->initCallbacks(); - envSettings->open(); + envSettings->openFloater(); } bool LLFloaterEnvSettings::isOpen() @@ -303,7 +307,6 @@ std::string LLFloaterEnvSettings::timeToString(F32 curTime) { S32 hours; S32 min; - bool isPM = false; // get hours and minutes hours = (S32) (24.0 * curTime); @@ -317,46 +320,19 @@ std::string LLFloaterEnvSettings::timeToString(F32 curTime) min = 0; } - // set for PM - if(hours >= 12 && hours < 24) - { - isPM = true; - } + std::string newTime = getString("timeStr"); + struct tm * timeT; + time_t secT = time(0); + timeT = gmtime (&secT); - // convert to non-military notation - if(hours >= 24) - { - hours = 12; - } - else if(hours > 12) - { - hours -= 12; - } - else if(hours == 0) - { - hours = 12; - } + timeT->tm_hour = hours; + timeT->tm_min = min; + secT = mktime (timeT); + secT -= LLStringOps::getLocalTimeOffset (); - // make the string - std::stringstream newTime; - newTime << hours << ":"; - - // double 0 - if(min < 10) - { - newTime << 0; - } - - // finish it - newTime << min << " "; - if(isPM) - { - newTime << "PM"; - } - else - { - newTime << "AM"; - } + LLSD substitution; + substitution["datetime"] = (S32) secT; - return newTime.str(); + LLStringUtil::format (newTime, substitution); + return newTime; } diff --git a/indra/newview/llfloaterenvsettings.h b/indra/newview/llfloaterenvsettings.h index 4cdf6036c6437c8a0a3757f1c4c3814c28bceda9..725fb9ed459925186e0c048e15bab07b03e5bb3f 100644 --- a/indra/newview/llfloaterenvsettings.h +++ b/indra/newview/llfloaterenvsettings.h @@ -46,8 +46,8 @@ class LLFloaterEnvSettings : public LLFloater public: LLFloaterEnvSettings(); - virtual ~LLFloaterEnvSettings(); - + /*virtual*/ ~LLFloaterEnvSettings(); + /*virtual*/ BOOL postBuild(); /// initialize all the callbacks for the menu void initCallbacks(void); diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp index 485c13c7b644a306f4592f43f9ab35e702eea726..6f8480756427761df9d8941fd2eda826e9bb9409 100644 --- a/indra/newview/llfloaterevent.cpp +++ b/indra/newview/llfloaterevent.cpp @@ -75,13 +75,13 @@ public: }; LLEventHandler gEventHandler; -LLFloaterEventInfo::LLFloaterEventInfo(const std::string& name, const U32 event_id) -: LLFloater(name), +LLFloaterEventInfo::LLFloaterEventInfo(const U32 event_id) +: LLFloater(), mEventID( event_id ) { mFactoryMap["event_details_panel"] = LLCallbackMap(LLFloaterEventInfo::createEventDetail, this); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_event.xml", &getFactoryMap()); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_event.xml"); gEventInfoInstances.addData(event_id, this); } @@ -115,14 +115,14 @@ LLFloaterEventInfo* LLFloaterEventInfo::show(const U32 event_id) { // ...bring that window to front floater = gEventInfoInstances.getData(event_id); - floater->open(); /*Flawfinder: ignore*/ + floater->openFloater(); floater->setFrontmost(true); } else { - floater = new LLFloaterEventInfo("eventinfo", event_id ); + floater = new LLFloaterEventInfo( event_id ); floater->center(); - floater->open(); /*Flawfinder: ignore*/ + floater->openFloater(); floater->displayEventInfo(event_id); floater->setFrontmost(true); } diff --git a/indra/newview/llfloaterevent.h b/indra/newview/llfloaterevent.h index 8f448b5fa2b805a18aae65c5943f1f248e2a9269..563ecc49da865c02da168eccc27789be65a507c0 100644 --- a/indra/newview/llfloaterevent.h +++ b/indra/newview/llfloaterevent.h @@ -42,7 +42,7 @@ class LLPanelEvent; class LLFloaterEventInfo : public LLFloater { public: - LLFloaterEventInfo(const std::string& name, const U32 event_id ); + LLFloaterEventInfo( const U32 event_id ); /*virtual*/ ~LLFloaterEventInfo(); void displayEventInfo(const U32 event_id); diff --git a/indra/newview/llfloaterfonttest.cpp b/indra/newview/llfloaterfonttest.cpp index 4bb1d9605dad392e5a94eec5a4d1c234933736d2..02791b711eb21cc9afb93e5acac4f55d42ebd0a5 100644 --- a/indra/newview/llfloaterfonttest.cpp +++ b/indra/newview/llfloaterfonttest.cpp @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008 Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -13,12 +13,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -44,7 +45,7 @@ LLFloaterFontTest* LLFloaterFontTest::sInstance = NULL; LLFloaterFontTest::LLFloaterFontTest() - : LLFloater(std::string("floater_font_test"), LLRect(0,500,700,0), std::string("Font Test")) + : LLFloater("floater_font_test") { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_font_test.xml"); } @@ -60,6 +61,6 @@ void LLFloaterFontTest::show(void *unused) if (!sInstance) sInstance = new LLFloaterFontTest(); - sInstance->open(); /*Flawfinder: ignore*/ + sInstance->openFloater(); sInstance->setFocus(TRUE); } diff --git a/indra/newview/llfloaterfonttest.h b/indra/newview/llfloaterfonttest.h index 45ff890423cb6c36248fde1f32df793f5dabfef4..eb2d410387b762ecab20922c36825badf0cf9c6d 100644 --- a/indra/newview/llfloaterfonttest.h +++ b/indra/newview/llfloaterfonttest.h @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -13,12 +13,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index 014a631a53eb225a9ce01193439d7821434ceb62..1e8129c7d3f64fefffcbbd65fe6e6bd2ca5d8aca 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -46,12 +46,14 @@ #include "llfloateravatarpicker.h" #include "llviewerwindow.h" #include "llbutton.h" -#include "llfloateravatarinfo.h" +#include "llfriendactions.h" #include "llinventorymodel.h" #include "llnamelistctrl.h" #include "llnotify.h" #include "llresmgr.h" -#include "llimview.h" +#include "llscrolllistctrl.h" +#include "llscrolllistitem.h" +#include "llscrolllistcell.h" #include "lluictrlfactory.h" #include "llmenucommands.h" #include "llviewercontrol.h" @@ -60,6 +62,8 @@ #include "lltextbox.h" #include "llvoiceclient.h" +// *TODO: Move more common stuff to LLFriendActions? + //Maximum number of people you can select to do an operation on at once. #define MAX_FRIEND_SELECT 20 #define DEFAULT_PERIOD 5.0 @@ -148,7 +152,7 @@ void LLPanelFriends::updateFriends(U32 changed_mask) // if the maximum amount of friends are selected mShowMaxSelectWarning = false; - LLDynamicArray<LLUUID> selected_friends = getSelectedIDs(); + std::vector<LLUUID> selected_friends = getSelectedIDs(); if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) { refreshNames(changed_mask); @@ -173,7 +177,7 @@ void LLPanelFriends::updateFriends(U32 changed_mask) // but we don't really care here, because refreshUI() will // clean up the interface. friends_list->setCurrentByID(selected_id); - for(LLDynamicArray<LLUUID>::iterator itr = selected_friends.begin(); itr != selected_friends.end(); ++itr) + for(std::vector<LLUUID>::iterator itr = selected_friends.begin(); itr != selected_friends.end(); ++itr) { friends_list->setSelectedByValue(*itr, true); } @@ -188,10 +192,10 @@ BOOL LLPanelFriends::postBuild() { mFriendsList = getChild<LLScrollListCtrl>("friend_list"); mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT); - mFriendsList->setMaximumSelectCallback(onMaximumSelect); + mFriendsList->setMaximumSelectCallback(boost::bind(&LLPanelFriends::onMaximumSelect)); mFriendsList->setCommitOnSelectionChange(TRUE); childSetCommitCallback("friend_list", onSelectName, this); - childSetDoubleClickCallback("friend_list", onClickIM); + getChild<LLScrollListCtrl>("friend_list")->setDoubleClickCallback(onClickIM, this); U32 changed_mask = LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE; refreshNames(changed_mask); @@ -233,7 +237,7 @@ BOOL LLPanelFriends::addFriend(const LLUUID& agent_id) friend_column["column"] = "friend_name"; friend_column["value"] = fullname; friend_column["font"] = "SANSSERIF"; - friend_column["font-style"] = "NORMAL"; + friend_column["font"]["style"] = "NORMAL"; LLSD& online_status_column = element["columns"][LIST_ONLINE_STATUS]; online_status_column["column"] = "icon_online_status"; @@ -241,12 +245,12 @@ BOOL LLPanelFriends::addFriend(const LLUUID& agent_id) if (isOnline) { - friend_column["font-style"] = "BOLD"; + friend_column["font"]["style"] = "BOLD"; online_status_column["value"] = "icon_avatar_online.tga"; } else if(isOnlineSIP) { - friend_column["font-style"] = "BOLD"; + friend_column["font"]["style"] = "BOLD"; online_status_column["value"] = ONLINE_SIP_ICON_NAME; } @@ -325,31 +329,14 @@ BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationsh void LLPanelFriends::refreshRightsChangeList() { - LLDynamicArray<LLUUID> friends = getSelectedIDs(); + std::vector<LLUUID> friends = getSelectedIDs(); S32 num_selected = friends.size(); bool can_offer_teleport = num_selected >= 1; bool selected_friends_online = true; - LLTextBox* processing_label = getChild<LLTextBox>("process_rights_label"); - - if(!mAllowRightsChange) - { - if(processing_label) - { - processing_label->setVisible(true); - // ignore selection for now - friends.clear(); - num_selected = 0; - } - } - else if(processing_label) - { - processing_label->setVisible(false); - } - const LLRelationship* friend_status = NULL; - for(LLDynamicArray<LLUUID>::iterator itr = friends.begin(); itr != friends.end(); ++itr) + for(std::vector<LLUUID>::iterator itr = friends.begin(); itr != friends.end(); ++itr) { friend_status = LLAvatarTracker::instance().getBuddyInfo(*itr); if (friend_status) @@ -391,7 +378,7 @@ struct SortFriendsByID void LLPanelFriends::refreshNames(U32 changed_mask) { - LLDynamicArray<LLUUID> selected_ids = getSelectedIDs(); + std::vector<LLUUID> selected_ids = getSelectedIDs(); S32 pos = mFriendsList->getScrollPos(); // get all buddies we know about @@ -499,17 +486,8 @@ void LLPanelFriends::refreshUI() single_selected = TRUE; if(num_selected > 1) { - childSetText("friend_name_label", getString("Multiple")); multiple_selected = TRUE; } - else - { - childSetText("friend_name_label", mFriendsList->getFirstSelected()->getColumn(LIST_FRIEND_NAME)->getValue().asString() + "..."); - } - } - else - { - childSetText("friend_name_label", LLStringUtil::null); } @@ -521,15 +499,15 @@ void LLPanelFriends::refreshUI() //(single_selected will always be true in this situations) childSetEnabled("remove_btn", single_selected); childSetEnabled("im_btn", single_selected); - childSetEnabled("friend_rights", single_selected); +// childSetEnabled("friend_rights", single_selected); refreshRightsChangeList(); } -LLDynamicArray<LLUUID> LLPanelFriends::getSelectedIDs() +std::vector<LLUUID> LLPanelFriends::getSelectedIDs() { LLUUID selected_id; - LLDynamicArray<LLUUID> friend_ids; + std::vector<LLUUID> friend_ids; std::vector<LLScrollListItem*> selected = mFriendsList->getAllSelected(); for(std::vector<LLScrollListItem*>::iterator itr = selected.begin(); itr != selected.end(); ++itr) { @@ -552,7 +530,7 @@ void LLPanelFriends::onSelectName(LLUICtrl* ctrl, void* user_data) } //static -void LLPanelFriends::onMaximumSelect(void* user_data) +void LLPanelFriends::onMaximumSelect() { LLSD args; args["MAX_SELECT"] = llformat("%d", MAX_FRIEND_SELECT); @@ -564,14 +542,11 @@ void LLPanelFriends::onClickProfile(void* user_data) { LLPanelFriends* panelp = (LLPanelFriends*)user_data; - //llinfos << "LLPanelFriends::onClickProfile()" << llendl; - LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs(); + std::vector<LLUUID> ids = panelp->getSelectedIDs(); if(ids.size() > 0) { LLUUID agent_id = ids[0]; - BOOL online; - online = LLAvatarTracker::instance().isBuddyOnline(agent_id); - LLFloaterAvatarInfo::showFromFriend(agent_id, online); + LLFriendActions::showProfile(agent_id); } } @@ -580,70 +555,18 @@ void LLPanelFriends::onClickIM(void* user_data) { LLPanelFriends* panelp = (LLPanelFriends*)user_data; - //llinfos << "LLPanelFriends::onClickIM()" << llendl; - LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs(); + std::vector<LLUUID> ids = panelp->getSelectedIDs(); if(ids.size() > 0) { if(ids.size() == 1) { - LLUUID agent_id = ids[0]; - const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(agent_id); - std::string fullname; - if(info && gCacheName->getFullName(agent_id, fullname)) - { - gIMMgr->setFloaterOpen(TRUE); - gIMMgr->addSession(fullname, IM_NOTHING_SPECIAL, agent_id); - } + LLFriendActions::startIM(ids[0]); } else { - gIMMgr->setFloaterOpen(TRUE); - gIMMgr->addSession("Friends Conference", IM_SESSION_CONFERENCE_START, ids[0], ids); + LLFriendActions::startConference(ids); } - make_ui_sound("UISndStartIM"); - } -} - -// static -void LLPanelFriends::requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message) -{ - LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD); - send_improved_im(target_id, - target_name, - message, - IM_ONLINE, - IM_FRIENDSHIP_OFFERED, - calling_card_folder_id); -} - -// static -bool LLPanelFriends::callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - if (option == 0) - { - requestFriendship(notification["payload"]["id"].asUUID(), - notification["payload"]["name"].asString(), - response["message"].asString()); } - return false; -} - -bool LLPanelFriends::callbackAddFriend(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - if (option == 0) - { - // Servers older than 1.25 require the text of the message to be the - // calling card folder ID for the offering user. JC - LLUUID calling_card_folder_id = - gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD); - std::string message = calling_card_folder_id.asString(); - requestFriendship(notification["payload"]["id"].asUUID(), - notification["payload"]["name"].asString(), - message); - } - return false; } // static @@ -653,35 +576,7 @@ void LLPanelFriends::onPickAvatar(const std::vector<std::string>& names, { if (names.empty()) return; if (ids.empty()) return; - requestFriendshipDialog(ids[0], names[0]); -} - -// static -void LLPanelFriends::requestFriendshipDialog(const LLUUID& id, - const std::string& name) -{ - if(id == gAgentID) - { - LLNotifications::instance().add("AddSelfFriend"); - return; - } - - LLSD args; - args["NAME"] = name; - LLSD payload; - payload["id"] = id; - payload["name"] = name; - // Look for server versions like: Second Life Server 1.24.4.95600 - if (gLastVersionChannel.find(" 1.24.") != std::string::npos) - { - // Old and busted server version, doesn't support friend - // requests with messages. - LLNotifications::instance().add("AddFriend", args, payload, &callbackAddFriend); - } - else - { - LLNotifications::instance().add("AddFriendWithMessage", args, payload, &callbackAddFriendWithMessage); - } + LLFriendActions::requestFriendshipDialog(ids[0], names[0]); } // static @@ -700,53 +595,14 @@ void LLPanelFriends::onClickAddFriend(void* user_data) void LLPanelFriends::onClickRemove(void* user_data) { LLPanelFriends* panelp = (LLPanelFriends*)user_data; - - //llinfos << "LLPanelFriends::onClickRemove()" << llendl; - LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs(); - LLSD args; - if(ids.size() > 0) - { - std::string msgType = "RemoveFromFriends"; - if(ids.size() == 1) - { - LLUUID agent_id = ids[0]; - std::string first, last; - if(gCacheName->getName(agent_id, first, last)) - { - args["FIRST_NAME"] = first; - args["LAST_NAME"] = last; - } - } - else - { - msgType = "RemoveMultipleFromFriends"; - } - LLSD payload; - - for (LLDynamicArray<LLUUID>::iterator it = ids.begin(); - it != ids.end(); - ++it) - { - payload["ids"].append(*it); - } - - LLNotifications::instance().add(msgType, - args, - payload, - &handleRemove); - } + LLFriendActions::removeFriendsDialog(panelp->getSelectedIDs()); } // static void LLPanelFriends::onClickOfferTeleport(void* user_data) { LLPanelFriends* panelp = (LLPanelFriends*)user_data; - - LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs(); - if(ids.size() > 0) - { - handle_lure(ids); - } + LLFriendActions::offerTeleport(panelp->getSelectedIDs()); } // static @@ -754,7 +610,7 @@ void LLPanelFriends::onClickPay(void* user_data) { LLPanelFriends* panelp = (LLPanelFriends*)user_data; - LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs(); + std::vector<LLUUID> ids = panelp->getSelectedIDs(); if(ids.size() == 1) { handle_pay_by_id(ids[0]); @@ -955,42 +811,3 @@ void LLPanelFriends::sendRightsGrant(rights_map_t& ids) mNumRightsChanged = ids.size(); gAgent.sendReliableMessage(); } - - - -// static -bool LLPanelFriends::handleRemove(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - - const LLSD& ids = notification["payload"]["ids"]; - for(LLSD::array_const_iterator itr = ids.beginArray(); itr != ids.endArray(); ++itr) - { - LLUUID id = itr->asUUID(); - const LLRelationship* ip = LLAvatarTracker::instance().getBuddyInfo(id); - if(ip) - { - switch(option) - { - case 0: // YES - if( ip->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS)) - { - LLAvatarTracker::instance().empower(id, FALSE); - LLAvatarTracker::instance().notifyObservers(); - } - LLAvatarTracker::instance().terminateBuddy(id); - LLAvatarTracker::instance().notifyObservers(); - gInventory.addChangedMask(LLInventoryObserver::LABEL | LLInventoryObserver::CALLING_CARD, LLUUID::null); - gInventory.notifyObservers(); - break; - - case 1: // NO - default: - llinfos << "No removal performed." << llendl; - break; - } - } - - } - return false; -} diff --git a/indra/newview/llfloaterfriends.h b/indra/newview/llfloaterfriends.h index a5c94ee485b2a2e583530b3143dde88a26064ce0..9242f00c912177a8fc113fd23bbe6589df78a9e5 100644 --- a/indra/newview/llfloaterfriends.h +++ b/indra/newview/llfloaterfriends.h @@ -74,15 +74,6 @@ public: virtual BOOL postBuild(); - // Show a dialog explaining what friendship entails, then request - // friendship. JC - static void requestFriendshipDialog(const LLUUID& target_id, - const std::string& target_name); - - // Just request friendship, no dialog. - static void requestFriendship(const LLUUID& target_id, - const std::string& target_name, const std::string& message); - private: enum FRIENDS_COLUMN_ORDER @@ -115,15 +106,15 @@ private: void confirmModifyRights(rights_map_t& ids, EGrantRevoke command); void sendRightsGrant(rights_map_t& ids); - // return LLUUID::null if nothing is selected - LLDynamicArray<LLUUID> getSelectedIDs(); + // return empty vector if nothing is selected + std::vector<LLUUID> getSelectedIDs(); // callback methods static void onSelectName(LLUICtrl* ctrl, void* user_data); static bool callbackAddFriend(const LLSD& notification, const LLSD& response); static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response); static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data); - static void onMaximumSelect(void* user_data); + static void onMaximumSelect(); static void onClickIM(void* user_data); static void onClickProfile(void* user_data); @@ -135,7 +126,6 @@ private: static void onClickModifyStatus(LLUICtrl* ctrl, void* user_data); - static bool handleRemove(const LLSD& notification, const LLSD& response); bool modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t* rights); private: diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 6d39d756630e3e35298ac324a7e1bac48f66bc34..c3448d52c95a86483bb0ed2ec248d6e307fbeb89 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -53,6 +53,7 @@ #include "llscrollcontainer.h" #include "llscrolllistctrl.h" #include "lltextbox.h" +#include "lltrans.h" #include "lluictrlfactory.h" #include "llviewergesture.h" #include "llviewerimagelist.h" @@ -81,10 +82,8 @@ public: // LLFloaterGesture //--------------------------------------------------------------------------- LLFloaterGesture::LLFloaterGesture() -: LLFloater(std::string("Gesture Floater")) +: LLFloater() { - sInstance = this; - sObserver = new LLFloaterGestureObserver; gGestureManager.addObserver(sObserver); } @@ -97,10 +96,6 @@ LLFloaterGesture::~LLFloaterGesture() sObserver = NULL; sInstance = NULL; - - // Custom saving rectangle, since load must be done - // after postBuild. - gSavedSettings.setRect("FloaterGestureRect2", getRect()); } // virtual @@ -108,13 +103,12 @@ BOOL LLFloaterGesture::postBuild() { std::string label; - // Translate title label = getTitle(); setTitle(label); childSetCommitCallback("gesture_list", onCommitList, this); - childSetDoubleClickCallback("gesture_list", onClickPlay); + getChild<LLScrollListCtrl>("gesture_list")->setDoubleClickCallback(onClickPlay, this); childSetAction("inventory_btn", onClickInventory, this); @@ -138,25 +132,20 @@ void LLFloaterGesture::show() { if (sInstance) { - sInstance->open(); /*Flawfinder: ignore*/ + sInstance->openFloater(); return; } - LLFloaterGesture *self = new LLFloaterGesture(); + sInstance = new LLFloaterGesture(); // Builds and adds to gFloaterView - LLUICtrlFactory::getInstance()->buildFloater(self, "floater_gesture.xml"); + LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_gesture.xml"); - // Fix up rectangle - LLRect rect = gSavedSettings.getRect("FloaterGestureRect2"); - self->reshape(rect.getWidth(), rect.getHeight()); - self->setRect(rect); + sInstance->buildGestureList(); - self->buildGestureList(); + sInstance->childSetFocus("gesture_list"); - self->childSetFocus("gesture_list"); - - LLCtrlListInterface *list = self->childGetListInterface("gesture_list"); + LLCtrlListInterface *list = sInstance->childGetListInterface("gesture_list"); if (list) { const BOOL ascending = TRUE; @@ -164,11 +153,11 @@ void LLFloaterGesture::show() list->selectFirstItem(); } - self->mSelectedID = LLUUID::null; + sInstance->mSelectedID = LLUUID::null; // Update button labels - onCommitList(NULL, self); - self->open(); /*Flawfinder: ignore*/ + onCommitList(NULL, sInstance); + sInstance->openFloater(); } // static @@ -176,7 +165,7 @@ void LLFloaterGesture::toggleVisibility() { if(sInstance && sInstance->getVisible()) { - sInstance->close(); + sInstance->closeFloater(); } else { @@ -231,7 +220,7 @@ void LLFloaterGesture::buildGestureList() LLMultiGesture* gesture = (*it).second; // Note: Can have NULL item if inventory hasn't arrived yet. - std::string item_name = "Loading..."; + std::string item_name = getString("loading"); LLInventoryItem* item = gInventory.getItem(item_id); if (item) { @@ -254,7 +243,7 @@ void LLFloaterGesture::buildGestureList() element["columns"][0]["column"] = "trigger"; element["columns"][0]["value"] = gesture->mTrigger; element["columns"][0]["font"] = "SANSSERIF"; - element["columns"][0]["font-style"] = font_style; + element["columns"][0]["font"]["style"] = font_style; std::string key_string = LLKeyboard::stringFromKey(gesture->mKey); std::string buffer; @@ -281,42 +270,42 @@ void LLFloaterGesture::buildGestureList() element["columns"][1]["column"] = "shortcut"; element["columns"][1]["value"] = buffer; element["columns"][1]["font"] = "SANSSERIF"; - element["columns"][1]["font-style"] = font_style; + element["columns"][1]["font"]["style"] = font_style; // hidden column for sorting element["columns"][2]["column"] = "key"; element["columns"][2]["value"] = key_string; element["columns"][2]["font"] = "SANSSERIF"; - element["columns"][2]["font-style"] = font_style; + element["columns"][2]["font"]["style"] = font_style; // Only add "playing" if we've got the name, less confusing. JC if (item && gesture->mPlaying) { - item_name += " (Playing)"; + item_name += " " + getString("playing"); } element["columns"][3]["column"] = "name"; element["columns"][3]["value"] = item_name; element["columns"][3]["font"] = "SANSSERIF"; - element["columns"][3]["font-style"] = font_style; + element["columns"][3]["font"]["style"] = font_style; } else { element["columns"][0]["column"] = "trigger"; element["columns"][0]["value"] = ""; element["columns"][0]["font"] = "SANSSERIF"; - element["columns"][0]["font-style"] = font_style; + element["columns"][0]["font"]["style"] = font_style; element["columns"][0]["column"] = "trigger"; element["columns"][0]["value"] = "---"; element["columns"][0]["font"] = "SANSSERIF"; - element["columns"][0]["font-style"] = font_style; + element["columns"][0]["font"]["style"] = font_style; element["columns"][2]["column"] = "key"; element["columns"][2]["value"] = "~~~"; element["columns"][2]["font"] = "SANSSERIF"; - element["columns"][2]["font-style"] = font_style; + element["columns"][2]["font"]["style"] = font_style; element["columns"][3]["column"] = "name"; element["columns"][3]["value"] = item_name; element["columns"][3]["font"] = "SANSSERIF"; - element["columns"][3]["font-style"] = font_style; + element["columns"][3]["font"]["style"] = font_style; } list->addElement(element, ADD_BOTTOM); } @@ -360,24 +349,16 @@ void LLFloaterGesture::onClickPlay(void* data) class GestureShowCallback : public LLInventoryCallback { public: - GestureShowCallback(std::string &title) - { - mTitle = title; - } void fire(const LLUUID &inv_item) { - LLPreviewGesture::show(mTitle, inv_item, LLUUID::null); + LLPreviewGesture::show(inv_item, LLUUID::null); } -private: - std::string mTitle; }; // static void LLFloaterGesture::onClickNew(void* data) { - std::string title("Gesture: "); - title.append("New Gesture"); - LLPointer<LLInventoryCallback> cb = new GestureShowCallback(title); + LLPointer<LLInventoryCallback> cb = new GestureShowCallback(); create_inventory_item(gAgent.getID(), gAgent.getSessionID(), LLUUID::null, LLTransactionID::tnull, "New Gesture", "", LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, NOT_WEARABLE, PERM_MOVE | PERM_TRANSFER, cb); @@ -396,10 +377,7 @@ void LLFloaterGesture::onClickEdit(void* data) LLInventoryItem* item = gInventory.getItem(item_id); if (!item) return; - std::string title("Gesture: "); - title.append(item->getName()); - - LLPreviewGesture* previewp = LLPreviewGesture::show(title, item_id, LLUUID::null); + LLPreviewGesture* previewp = LLPreviewGesture::show(item_id, LLUUID::null); if (!previewp->getHost()) { previewp->setRect(gFloaterView->findNeighboringPosition(self, previewp)); diff --git a/indra/newview/llfloatergesture.h b/indra/newview/llfloatergesture.h index 4e11a10e6162a2de4ee92736f9a97942c04594f1..f7c4e558ace1fda40dc5aafd56f9cabc4722b9a2 100644 --- a/indra/newview/llfloatergesture.h +++ b/indra/newview/llfloatergesture.h @@ -41,7 +41,7 @@ #include "lldarray.h" -class LLScrollableContainerView; +class LLScrollContainer; class LLView; class LLButton; class LLLineEditor; diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 4959a2913eccbed83b11093459ca35c9a771326f..58cbe02d6d0e839b6be3bd86859c7f877e2a7ad7 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -73,36 +73,39 @@ #include "llsurface.h" #include "llviewercontrol.h" #include "lluictrlfactory.h" +#include "lltrans.h" #include "lltransfertargetfile.h" #include "lltransfersourcefile.h" const F32 SECONDS_BETWEEN_UPDATE_REQUESTS = 5.0f; -static LLFloaterGodTools* sGodTools = NULL; - //***************************************************************************** // LLFloaterGodTools //***************************************************************************** -// static -LLFloaterGodTools* LLFloaterGodTools::instance() +void LLFloaterGodTools::onOpen(const LLSD& key) { - if (!sGodTools) + center(); + setFocus(TRUE); +// LLPanel *panel = childGetVisibleTab("GodTools Tabs"); +// if (panel) +// panel->setFocus(TRUE); + if (mPanelObjectTools) + mPanelObjectTools->setTargetAvatar(LLUUID::null); + + if (gAgent.getRegionHost() != mCurrentHost) { - sGodTools = new LLFloaterGodTools(); - sGodTools->open(); /*Flawfinder: ignore*/ - sGodTools->center(); - sGodTools->setFocus(TRUE); + // we're in a new region + sendRegionInfoRequest(); } - return sGodTools; } // static void LLFloaterGodTools::refreshAll() { - LLFloaterGodTools* god_tools = instance(); + LLFloaterGodTools* god_tools = getInstance(); if (god_tools) { if (gAgent.getRegionHost() != god_tools->mCurrentHost) @@ -115,22 +118,16 @@ void LLFloaterGodTools::refreshAll() -LLFloaterGodTools::LLFloaterGodTools() -: LLFloater(std::string("godtools floater")), +LLFloaterGodTools::LLFloaterGodTools(const LLSD& key) +: LLFloater(), mCurrentHost(LLHost::invalid), mUpdateTimer() { - LLCallbackMap::map_t factory_map; - factory_map["grid"] = LLCallbackMap(createPanelGrid, this); - factory_map["region"] = LLCallbackMap(createPanelRegion, this); - factory_map["objects"] = LLCallbackMap(createPanelObjects, this); - factory_map["request"] = LLCallbackMap(createPanelRequest, this); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_god_tools.xml", &factory_map); - - childSetTabChangeCallback("GodTools Tabs", "grid", onTabChanged, this); - childSetTabChangeCallback("GodTools Tabs", "region", onTabChanged, this); - childSetTabChangeCallback("GodTools Tabs", "objects", onTabChanged, this); - childSetTabChangeCallback("GodTools Tabs", "request", onTabChanged, this); + mFactoryMap["grid"] = LLCallbackMap(createPanelGrid, this); + mFactoryMap["region"] = LLCallbackMap(createPanelRegion, this); + mFactoryMap["objects"] = LLCallbackMap(createPanelObjects, this); + mFactoryMap["request"] = LLCallbackMap(createPanelRequest, this); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_god_tools.xml"); sendRegionInfoRequest(); @@ -140,14 +137,14 @@ LLFloaterGodTools::LLFloaterGodTools() // static void* LLFloaterGodTools::createPanelGrid(void *userdata) { - return new LLPanelGridTools("grid"); + return new LLPanelGridTools(); } // static void* LLFloaterGodTools::createPanelRegion(void *userdata) { LLFloaterGodTools* self = (LLFloaterGodTools*)userdata; - self->mPanelRegionTools = new LLPanelRegionTools("region"); + self->mPanelRegionTools = new LLPanelRegionTools(); return self->mPanelRegionTools; } @@ -155,20 +152,24 @@ void* LLFloaterGodTools::createPanelRegion(void *userdata) void* LLFloaterGodTools::createPanelObjects(void *userdata) { LLFloaterGodTools* self = (LLFloaterGodTools*)userdata; - self->mPanelObjectTools = new LLPanelObjectTools("objects"); + self->mPanelObjectTools = new LLPanelObjectTools(); return self->mPanelObjectTools; } // static void* LLFloaterGodTools::createPanelRequest(void *userdata) { - return new LLPanelRequestTools("region"); + return new LLPanelRequestTools(); } LLFloaterGodTools::~LLFloaterGodTools() { // children automatically deleted } +BOOL LLFloaterGodTools::postBuild() +{ + return TRUE; +} U32 LLFloaterGodTools::computeRegionFlags() const { @@ -186,9 +187,9 @@ void LLFloaterGodTools::updatePopup(LLCoordGL center, MASK mask) // virtual void LLFloaterGodTools::onClose(bool app_quitting) { - if (sGodTools) + if (getInstance()) { - sGodTools->setVisible(FALSE); + getInstance()->setVisible(FALSE); } } @@ -209,42 +210,15 @@ void LLFloaterGodTools::draw() LLFloater::draw(); } -// static -void LLFloaterGodTools::show(void *) -{ - LLFloaterGodTools* god_tools = instance(); - god_tools->open(); - LLPanel *panel = god_tools->childGetVisibleTab("GodTools Tabs"); - if (panel) panel->setFocus(TRUE); - if (god_tools->mPanelObjectTools) god_tools->mPanelObjectTools->setTargetAvatar(LLUUID::null); - - if (gAgent.getRegionHost() != god_tools->mCurrentHost) - { - // we're in a new region - god_tools->sendRegionInfoRequest(); - } -} - void LLFloaterGodTools::showPanel(const std::string& panel_name) { childShowTab("GodTools Tabs", panel_name); - open(); /*Flawfinder: ignore*/ + openFloater(); LLPanel *panel = childGetVisibleTab("GodTools Tabs"); - if (panel) panel->setFocus(TRUE); -} - - -// static -void LLFloaterGodTools::onTabChanged(void* data, bool from_click) -{ - LLPanel* panel = (LLPanel*)data; if (panel) - { panel->setFocus(TRUE); - } } - // static void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) { @@ -299,14 +273,14 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) } // push values to god tools, if available - if (sGodTools - && sGodTools->mPanelRegionTools - && sGodTools->mPanelObjectTools - && msg - && gAgent.isGodlike()) + if ( gAgent.isGodlike() + && instanceVisible() + && getInstance()->mPanelRegionTools + && getInstance()->mPanelObjectTools + && msg ) { - LLPanelRegionTools* rtool = sGodTools->mPanelRegionTools; - sGodTools->mCurrentHost = host; + LLPanelRegionTools* rtool = getInstance()->mPanelRegionTools; + getInstance()->mCurrentHost = host; // store locally rtool->setSimName(sim_name); @@ -319,7 +293,7 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) rtool->setRedirectGridY(redirect_grid_y); rtool->enableAllWidgets(); - LLPanelObjectTools *otool = sGodTools->mPanelObjectTools; + LLPanelObjectTools *otool = getInstance()->mPanelObjectTools; otool->setCheckFlags(region_flags); otool->enableAllWidgets(); @@ -364,12 +338,12 @@ void LLFloaterGodTools::sendGodUpdateRegionInfo() { LLViewerRegion *regionp = gAgent.getRegion(); if (gAgent.isGodlike() - && sGodTools->mPanelRegionTools + && getInstance()->mPanelRegionTools && regionp && gAgent.getRegionHost() == mCurrentHost) { LLMessageSystem *msg = gMessageSystem; - LLPanelRegionTools *rtool = sGodTools->mPanelRegionTools; + LLPanelRegionTools *rtool = getInstance()->mPanelRegionTools; msg->newMessage("GodUpdateRegionInfo"); msg->nextBlockFast(_PREHASH_AgentData); @@ -426,15 +400,15 @@ const F32 PRICE_PER_METER_MIN = 0.f; const F32 PRICE_PER_METER_MAX = 100.f; -LLPanelRegionTools::LLPanelRegionTools(const std::string& title) -: LLPanel(title) +LLPanelRegionTools::LLPanelRegionTools() +: LLPanel() { } BOOL LLPanelRegionTools::postBuild() { childSetCommitCallback("region name", onChangeAnything, this); - childSetKeystrokeCallback("region name", onChangeSimName, this); + getChild<LLLineEditor>("region name")->setKeystrokeCallback(onChangeSimName, this); childSetPrevalidate("region name", &LLLineEditor::prevalidatePrintableNotPipe); childSetCommitCallback("check prelude", onChangePrelude, this); @@ -768,9 +742,7 @@ void LLPanelRegionTools::setPricePerMeter(S32 price) // static void LLPanelRegionTools::onChangeAnything(LLUICtrl* ctrl, void* userdata) { - if (sGodTools - && userdata - && gAgent.isGodlike()) + if (userdata && gAgent.isGodlike()) { LLPanelRegionTools* region_tools = (LLPanelRegionTools*) userdata; region_tools->childEnable("Apply"); @@ -794,9 +766,7 @@ void LLPanelRegionTools::onChangePrelude(LLUICtrl* ctrl, void* data) // static void LLPanelRegionTools::onChangeSimName(LLLineEditor* caller, void* userdata ) { - if (sGodTools - && userdata - && gAgent.isGodlike()) + if (userdata && gAgent.isGodlike()) { LLPanelRegionTools* region_tools = (LLPanelRegionTools*) userdata; region_tools->childEnable("Apply"); @@ -807,11 +777,9 @@ void LLPanelRegionTools::onChangeSimName(LLLineEditor* caller, void* userdata ) void LLPanelRegionTools::onRefresh(void* userdata) { LLViewerRegion *region = gAgent.getRegion(); - if (region - && sGodTools - && gAgent.isGodlike()) + if (region && gAgent.isGodlike()) { - sGodTools->sendRegionInfoRequest(); + LLFloaterGodTools::getInstance()->sendRegionInfoRequest(); } } @@ -819,15 +787,12 @@ void LLPanelRegionTools::onRefresh(void* userdata) void LLPanelRegionTools::onApplyChanges(void* userdata) { LLViewerRegion *region = gAgent.getRegion(); - if (region - && sGodTools - && userdata - && gAgent.isGodlike()) + if (region && userdata && gAgent.isGodlike()) { LLPanelRegionTools* region_tools = (LLPanelRegionTools*) userdata; region_tools->childDisable("Apply"); - sGodTools->sendGodUpdateRegionInfo(); + LLFloaterGodTools::getInstance()->sendGodUpdateRegionInfo(); } } @@ -890,11 +855,10 @@ void LLPanelRegionTools::onSelectRegion(void* userdata) // LEFT R2 RIGHT const F32 HOURS_TO_RADIANS = (2.f*F_PI)/24.f; -const char FLOATER_GRID_ADMIN_TITLE[] = "Grid Administration"; -LLPanelGridTools::LLPanelGridTools(const std::string& name) : - LLPanel(name) +LLPanelGridTools::LLPanelGridTools() : + LLPanel() { } @@ -919,10 +883,6 @@ void LLPanelGridTools::refresh() // static void LLPanelGridTools::onClickKickAll(void* userdata) { - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect(left, top, left+400, top-300); - LLNotifications::instance().add("KickAllUsers", LLSD(), LLSD(), LLPanelGridTools::confirmKick); } @@ -1017,8 +977,9 @@ bool LLPanelGridTools::flushMapVisibilityCachesConfirm(const LLSD& notification, // LEFT RIGHT // Default constructor -LLPanelObjectTools::LLPanelObjectTools(const std::string& title) -: LLPanel(title), mTargetAvatar() +LLPanelObjectTools::LLPanelObjectTools() + : LLPanel(), + mTargetAvatar() { } @@ -1054,7 +1015,7 @@ void LLPanelObjectTools::setTargetAvatar(const LLUUID &target_id) mTargetAvatar = target_id; if (target_id.isNull()) { - childSetValue("target_avatar_name", "(no target)"); + childSetValue("target_avatar_name", getString("no_target")); } } @@ -1137,8 +1098,7 @@ void LLPanelObjectTools::enableAllWidgets() // static void LLPanelObjectTools::onGetTopColliders(void* userdata) { - if (sGodTools - && gAgent.isGodlike()) + if (gAgent.isGodlike()) { LLFloaterTopObjects::show(); LLFloaterTopObjects::setMode(STAT_REPORT_TOP_COLLIDERS); @@ -1149,8 +1109,7 @@ void LLPanelObjectTools::onGetTopColliders(void* userdata) // static void LLPanelObjectTools::onGetTopScripts(void* userdata) { - if (sGodTools - && gAgent.isGodlike()) + if (gAgent.isGodlike()) { LLFloaterTopObjects::show(); LLFloaterTopObjects::setMode(STAT_REPORT_TOP_SCRIPTS); @@ -1161,8 +1120,7 @@ void LLPanelObjectTools::onGetTopScripts(void* userdata) // static void LLPanelObjectTools::onGetScriptDigest(void* userdata) { - if (sGodTools - && gAgent.isGodlike()) + if (gAgent.isGodlike()) { // get the list of scripts and number of occurences of each // (useful for finding self-replicating objects) @@ -1272,7 +1230,10 @@ void LLPanelObjectTools::onClickSetBySelection(void* data) LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); panelp->mTargetAvatar = owner_id; - std::string name = "Object " + node->mName + " owned by " + owner_name; + LLStringUtil::format_map_t args; + args["[OBJECT]"] = node->mName; + args["[OWNER]"] = owner_name; + std::string name = LLTrans::getString("GodToolsObjectOwnedBy", args); panelp->childSetValue("target_avatar_name", name); } @@ -1290,9 +1251,7 @@ void LLPanelObjectTools::callbackAvatarID(const std::vector<std::string>& names, // static void LLPanelObjectTools::onChangeAnything(LLUICtrl* ctrl, void* userdata) { - if (sGodTools - && userdata - && gAgent.isGodlike()) + if (userdata && gAgent.isGodlike()) { LLPanelObjectTools* object_tools = (LLPanelObjectTools*) userdata; object_tools->childEnable("Apply"); @@ -1303,16 +1262,13 @@ void LLPanelObjectTools::onChangeAnything(LLUICtrl* ctrl, void* userdata) void LLPanelObjectTools::onApplyChanges(void* userdata) { LLViewerRegion *region = gAgent.getRegion(); - if (region - && sGodTools - && userdata - && gAgent.isGodlike()) + if (region && gAgent.isGodlike()) { LLPanelObjectTools* object_tools = (LLPanelObjectTools*) userdata; // TODO -- implement this object_tools->childDisable("Apply"); - sGodTools->sendGodUpdateRegionInfo(); + LLFloaterGodTools::getInstance()->sendGodUpdateRegionInfo(); } } @@ -1324,8 +1280,8 @@ void LLPanelObjectTools::onApplyChanges(void* userdata) const std::string SELECTION = "Selection"; const std::string AGENT_REGION = "Agent Region"; -LLPanelRequestTools::LLPanelRequestTools(const std::string& name): - LLPanel(name) +LLPanelRequestTools::LLPanelRequestTools(): + LLPanel() { } @@ -1348,9 +1304,13 @@ void LLPanelRequestTools::refresh() LLCtrlListInterface *list = childGetListInterface("destination"); if (!list) return; - list->operateOnAll(LLCtrlListInterface::OP_DELETE); - list->addSimpleElement(SELECTION); - list->addSimpleElement(AGENT_REGION); + S32 last_item = list->getItemCount(); + + if (last_item >=3) + { + list->selectItemRange(2,last_item); + list->operateOnSelection(LLCtrlListInterface::OP_DELETE); + } for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { @@ -1367,7 +1327,7 @@ void LLPanelRequestTools::refresh() } else { - list->selectByValue(SELECTION); + list->operateOnSelection(LLCtrlListInterface::OP_DESELECT); } } diff --git a/indra/newview/llfloatergodtools.h b/indra/newview/llfloatergodtools.h index 75813ca8865ac12315c9f4ca12c85b6856ad8771..6c4b43880806f73fdb8e1be392a25077c2e951f3 100644 --- a/indra/newview/llfloatergodtools.h +++ b/indra/newview/llfloatergodtools.h @@ -57,12 +57,11 @@ class LLTextBox; class LLMessageSystem; class LLFloaterGodTools -: public LLFloater + : public LLFloater, public LLFloaterSingleton<LLFloaterGodTools> { + friend class LLUISingleton<LLFloaterGodTools, VisibilityPolicy<LLFloater> >; public: - static LLFloaterGodTools* instance(); - enum EGodPanel { PANEL_GRID, @@ -72,9 +71,6 @@ public: PANEL_COUNT }; - static void show(void *); - static void hide(void *); - static void* createPanelGrid(void *userdata); static void* createPanelRegion(void *userdata); static void* createPanelObjects(void *userdata); @@ -84,6 +80,7 @@ public: void showPanel(const std::string& panel_name); + virtual void onOpen(const LLSD& key); virtual void onClose(bool app_quitting); virtual void draw(); @@ -101,21 +98,17 @@ public: // Send possibly changed values to simulator. void sendGodUpdateRegionInfo(); - static void onTabChanged(void *data, bool from_click); - protected: U32 computeRegionFlags() const; protected: - LLFloaterGodTools(); + LLFloaterGodTools(const LLSD& key); ~LLFloaterGodTools(); - + /*virtual*/ BOOL postBuild(); // When the floater is going away, reset any options that need to be // cleared. void resetToolState(); - static LLFloaterGodTools* sInstance; - public: LLPanelRegionTools *mPanelRegionTools; LLPanelObjectTools *mPanelObjectTools; @@ -133,7 +126,7 @@ class LLPanelRegionTools : public LLPanel { public: - LLPanelRegionTools(const std::string& name); + LLPanelRegionTools(); /*virtual*/ ~LLPanelRegionTools(); BOOL postBuild(); @@ -194,7 +187,7 @@ class LLPanelGridTools : public LLPanel { public: - LLPanelGridTools(const std::string& name); + LLPanelGridTools(); virtual ~LLPanelGridTools(); BOOL postBuild(); @@ -221,7 +214,7 @@ class LLPanelObjectTools : public LLPanel { public: - LLPanelObjectTools(const std::string& name); + LLPanelObjectTools(); /*virtual*/ ~LLPanelObjectTools(); BOOL postBuild(); @@ -262,7 +255,7 @@ protected: class LLPanelRequestTools : public LLPanel { public: - LLPanelRequestTools(const std::string& name); + LLPanelRequestTools(); /*virtual*/ ~LLPanelRequestTools(); BOOL postBuild(); diff --git a/indra/newview/llfloatergroupinvite.cpp b/indra/newview/llfloatergroupinvite.cpp index 08a6269a04444441e00ffdbdad3397abe0d83d5b..92db0b092635ac62a092773b0110c09fc4593951 100644 --- a/indra/newview/llfloatergroupinvite.cpp +++ b/indra/newview/llfloatergroupinvite.cpp @@ -34,9 +34,8 @@ #include "llfloatergroupinvite.h" #include "llpanelgroupinvite.h" - -const char FLOATER_TITLE[] = "Group Invitation"; -const LLRect FGI_RECT(0, 380, 210, 0); +#include "lltrans.h" +#include "lldraghandle.h" class LLFloaterGroupInvite::impl { @@ -73,25 +72,26 @@ void LLFloaterGroupInvite::impl::closeFloater(void* data) { LLFloaterGroupInvite* floaterp = (LLFloaterGroupInvite*) data; - if ( floaterp ) floaterp->close(); + if ( floaterp ) floaterp->closeFloater(); } //----------------------------------------------------------------------------- // Implementation //----------------------------------------------------------------------------- -LLFloaterGroupInvite::LLFloaterGroupInvite(const std::string& name, - const LLRect &rect, - const std::string& title, - const LLUUID& group_id) -: LLFloater(name, rect, title) +LLFloaterGroupInvite::LLFloaterGroupInvite(const LLUUID& group_id) +: LLFloater() { - LLRect contents(getRect()); - contents.mTop -= LLFLOATER_HEADER_SIZE; + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + LLRect contents; mImpl = new impl(group_id); - mImpl->mInvitePanelp = new LLPanelGroupInvite("Group Invite Panel", - group_id); + mImpl->mInvitePanelp = new LLPanelGroupInvite(group_id); + + contents = mImpl->mInvitePanelp->getRect(); + contents.mTop -= floater_header_size; + + setTitle (mImpl->mInvitePanelp->getString("GroupInvitation")); mImpl->mInvitePanelp->setCloseCallback(impl::closeFloater, this); @@ -114,6 +114,9 @@ LLFloaterGroupInvite::~LLFloaterGroupInvite() // static void LLFloaterGroupInvite::showForGroup(const LLUUID& group_id, std::vector<LLUUID> *agent_ids) { + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + LLRect contents; + // Make sure group_id isn't null if (group_id.isNull()) { @@ -127,10 +130,12 @@ void LLFloaterGroupInvite::showForGroup(const LLUUID& group_id, std::vector<LLUU (LLFloaterGroupInvite*)NULL); if (!fgi) { - fgi = new LLFloaterGroupInvite("groupinfo", - FGI_RECT, - FLOATER_TITLE, - group_id); + fgi = new LLFloaterGroupInvite(group_id); + contents = fgi->mImpl->mInvitePanelp->getRect(); + contents.mTop += floater_header_size; + fgi->setRect(contents); + fgi->getDragHandle()->setRect(contents); + fgi->getDragHandle()->setTitle(fgi->mImpl->mInvitePanelp->getString("GroupInvitation")); impl::sInstances[group_id] = fgi; @@ -143,6 +148,6 @@ void LLFloaterGroupInvite::showForGroup(const LLUUID& group_id, std::vector<LLUU } fgi->center(); - fgi->open(); /*Flawfinder: ignore*/ + fgi->openFloater(); fgi->mImpl->mInvitePanelp->update(); } diff --git a/indra/newview/llfloatergroupinvite.h b/indra/newview/llfloatergroupinvite.h index d1485ead916c5aea0c1a19d3b9cc660b39b81efd..b3f5d75ac1a72b9fc4c8a19bd5c57763cd808d51 100644 --- a/indra/newview/llfloatergroupinvite.h +++ b/indra/newview/llfloatergroupinvite.h @@ -46,10 +46,7 @@ public: static void showForGroup(const LLUUID &group_id, std::vector<LLUUID> *agent_ids = NULL); protected: - LLFloaterGroupInvite(const std::string& name, - const LLRect &rect, - const std::string& title, - const LLUUID& group_id = LLUUID::null); + LLFloaterGroupInvite(const LLUUID& group_id = LLUUID::null); class impl; impl* mImpl; diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 9e0b0d72308be4de199580a7672339ed9333d40e..a967a1833f3541da270d58e6d09669d5d45f2578 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -41,21 +41,15 @@ #include "llfloatergroups.h" -#include "message.h" #include "roles_constants.h" #include "llagent.h" #include "llbutton.h" -#include "llfloatergroupinfo.h" -#include "llfloaterdirectory.h" -#include "llfocusmgr.h" -#include "llalertdialog.h" -#include "llselectmgr.h" +#include "llgroupactions.h" #include "llscrolllistctrl.h" #include "lltextbox.h" #include "lluictrlfactory.h" -#include "llviewerwindow.h" -#include "llimview.h" +#include "lltrans.h" using namespace LLOldEvents; @@ -84,17 +78,16 @@ LLFloaterGroupPicker* LLFloaterGroupPicker::findInstance(const LLSD& seed) LLFloaterGroupPicker* LLFloaterGroupPicker::createInstance(const LLSD &seed) { LLFloaterGroupPicker* pickerp = new LLFloaterGroupPicker(seed); - LLUICtrlFactory::getInstance()->buildFloater(pickerp, "floater_choose_group.xml"); return pickerp; } -LLFloaterGroupPicker::LLFloaterGroupPicker(const LLSD& seed) : - mSelectCallback(NULL), - mCallbackUserdata(NULL), +LLFloaterGroupPicker::LLFloaterGroupPicker(const LLSD& seed) +: LLFloater(), mPowersMask(GP_ALL_POWERS) { mID = seed.asUUID(); sInstances.insert(std::make_pair(mID, this)); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_choose_group.xml"); } LLFloaterGroupPicker::~LLFloaterGroupPicker() @@ -102,13 +95,6 @@ LLFloaterGroupPicker::~LLFloaterGroupPicker() sInstances.erase(mID); } -void LLFloaterGroupPicker::setSelectCallback(void (*callback)(LLUUID, void*), - void* userdata) -{ - mSelectCallback = callback; - mCallbackUserdata = userdata; -} - void LLFloaterGroupPicker::setPowersMask(U64 powers_mask) { mPowersMask = powers_mask; @@ -126,8 +112,7 @@ BOOL LLFloaterGroupPicker::postBuild() setDefaultBtn("OK"); - childSetDoubleClickCallback("group list", onBtnOK); - childSetUserData("group list", this); + getChild<LLScrollListCtrl>("group list")->setDoubleClickCallback(onBtnOK, this); childEnable("OK"); @@ -143,7 +128,7 @@ void LLFloaterGroupPicker::onBtnOK(void* userdata) void LLFloaterGroupPicker::onBtnCancel(void* userdata) { LLFloaterGroupPicker* self = (LLFloaterGroupPicker*)userdata; - if(self) self->close(); + if(self) self->closeFloater(); } @@ -155,12 +140,9 @@ void LLFloaterGroupPicker::ok() { group_id = group_list->getCurrentID(); } - if(mSelectCallback) - { - mSelectCallback(group_id, mCallbackUserdata); - } + mGroupSelectSignal(group_id); - close(); + closeFloater(); } ///---------------------------------------------------------------------------- @@ -229,8 +211,7 @@ BOOL LLPanelGroups::postBuild() setDefaultBtn("IM"); - childSetDoubleClickCallback("group list", onBtnIM); - childSetUserData("group list", this); + getChild<LLScrollListCtrl>("group list")->setDoubleClickCallback(onBtnIM, this); reset(); @@ -315,113 +296,54 @@ void LLPanelGroups::onBtnSearch(void* userdata) void LLPanelGroups::create() { - llinfos << "LLPanelGroups::create" << llendl; - LLFloaterGroupInfo::showCreateGroup(NULL); + LLGroupActions::create(); } void LLPanelGroups::activate() { - llinfos << "LLPanelGroups::activate" << llendl; LLCtrlListInterface *group_list = childGetListInterface("group list"); LLUUID group_id; if (group_list) { group_id = group_list->getCurrentID(); } - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_ActivateGroup); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->addUUIDFast(_PREHASH_GroupID, group_id); - gAgent.sendReliableMessage(); + LLGroupActions::activate(group_id); } void LLPanelGroups::info() { - llinfos << "LLPanelGroups::info" << llendl; LLCtrlListInterface *group_list = childGetListInterface("group list"); LLUUID group_id; if (group_list && (group_id = group_list->getCurrentID()).notNull()) { - LLFloaterGroupInfo::showFromUUID(group_id); + LLGroupActions::info(group_id); } } void LLPanelGroups::startIM() { - //llinfos << "LLPanelFriends::onClickIM()" << llendl; LLCtrlListInterface *group_list = childGetListInterface("group list"); LLUUID group_id; if (group_list && (group_id = group_list->getCurrentID()).notNull()) { - LLGroupData group_data; - if (gAgent.getGroupData(group_id, group_data)) - { - gIMMgr->setFloaterOpen(TRUE); - gIMMgr->addSession( - group_data.mName, - IM_SESSION_GROUP_START, - group_id); - make_ui_sound("UISndStartIM"); - } - else - { - // this should never happen, as starting a group IM session - // relies on you belonging to the group and hence having the group data - make_ui_sound("UISndInvalidOp"); - } + LLGroupActions::startChat(group_id); } } void LLPanelGroups::leave() { - llinfos << "LLPanelGroups::leave" << llendl; LLCtrlListInterface *group_list = childGetListInterface("group list"); LLUUID group_id; if (group_list && (group_id = group_list->getCurrentID()).notNull()) { - S32 count = gAgent.mGroups.count(); - S32 i; - for(i = 0; i < count; ++i) - { - if(gAgent.mGroups.get(i).mID == group_id) - break; - } - if(i < count) - { - LLSD args; - args["GROUP"] = gAgent.mGroups.get(i).mName; - LLSD payload; - payload["group_id"] = group_id; - LLNotifications::instance().add("GroupLeaveConfirmMember", args, payload, callbackLeaveGroup); - } + LLGroupActions::leave(group_id); } } void LLPanelGroups::search() { - LLFloaterDirectory::showGroups(); -} - -// static -bool LLPanelGroups::callbackLeaveGroup(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - LLUUID group_id = notification["payload"]["group_id"].asUUID(); - if(option == 0) - { - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_LeaveGroupRequest); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_GroupData); - msg->addUUIDFast(_PREHASH_GroupID, group_id); - gAgent.sendReliableMessage(); - } - return false; + LLGroupActions::search(); } void LLPanelGroups::onGroupList(LLUICtrl* ctrl, void* userdata) @@ -456,7 +378,7 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow element["columns"][0]["column"] = "name"; element["columns"][0]["value"] = group_datap->mName; element["columns"][0]["font"] = "SANSSERIF"; - element["columns"][0]["font-style"] = style; + element["columns"][0]["font"]["style"] = style; group_list->addElement(element, ADD_SORTED); } @@ -472,9 +394,9 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow LLSD element; element["id"] = LLUUID::null; element["columns"][0]["column"] = "name"; - element["columns"][0]["value"] = "none"; // *TODO: Translate + element["columns"][0]["value"] = LLTrans::getString("GroupsNone"); element["columns"][0]["font"] = "SANSSERIF"; - element["columns"][0]["font-style"] = style; + element["columns"][0]["font"]["style"] = style; group_list->addElement(element, ADD_TOP); } diff --git a/indra/newview/llfloatergroups.h b/indra/newview/llfloatergroups.h index 3eb3e5af5230be482738a494dd86b02cf872dead..b49d38ccd03e02e577937446f3c8f45190451217 100644 --- a/indra/newview/llfloatergroups.h +++ b/indra/newview/llfloatergroups.h @@ -47,6 +47,8 @@ #include "lluuid.h" #include "llfloater.h" #include <map> +#include <boost/function.hpp> +#include <boost/signal.hpp> class LLUICtrl; class LLTextBox; @@ -59,8 +61,10 @@ class LLFloaterGroupPicker : public LLFloater, public LLUIFactory<LLFloaterGroup friend class LLUIFactory<LLFloaterGroupPicker>; public: ~LLFloaterGroupPicker(); - void setSelectCallback( void (*callback)(LLUUID, void*), - void* userdata); + + // Note: Don't return connection; use boost::bind + boost::signal::trackable to disconnect slots + typedef boost::signal<void (LLUUID id)> signal_t; + void setSelectGroupCallback(const signal_t::slot_type& cb) { mGroupSelectSignal.connect(cb); } void setPowersMask(U64 powers_mask); BOOL postBuild(); @@ -77,8 +81,7 @@ protected: protected: LLUUID mID; U64 mPowersMask; - void (*mSelectCallback)(LLUUID id, void* userdata); - void* mCallbackUserdata; + signal_t mGroupSelectSignal; typedef std::map<const LLUUID, LLFloaterGroupPicker*> instance_map_t; static instance_map_t sInstances; diff --git a/indra/newview/llfloaterhandler.cpp b/indra/newview/llfloaterhandler.cpp index f4c7e43a7d304c4f6f96cfa36f7af8f879741297..f229d3048853312fcdba25f7f60e1169f3db029f 100644 --- a/indra/newview/llfloaterhandler.cpp +++ b/indra/newview/llfloaterhandler.cpp @@ -70,7 +70,7 @@ bool LLFloaterHandler::handle(const LLSD ¶ms, const LLSD &query_map, LLWebBr { if (floater) { - floater->close(); + floater->closeFloater(); return true; } } diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 7886e394a3d251ba992e4037d61083dbabe5b591..38915ebff9181e97912d0d8a64e05f81b964cc25 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -33,27 +33,28 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterhardwaresettings.h" + +// Viewer includes #include "llfloaterpreference.h" #include "llviewerwindow.h" #include "llviewercontrol.h" #include "llviewerimagelist.h" #include "llfeaturemanager.h" #include "llstartup.h" +#include "pipeline.h" +// Linden library includes #include "llradiogroup.h" #include "lluictrlfactory.h" - +#include "llwindow.h" #include "llimagegl.h" -#include "pipeline.h" LLFloaterHardwareSettings* LLFloaterHardwareSettings::sHardwareSettings = NULL; -LLFloaterHardwareSettings::LLFloaterHardwareSettings() : LLFloater(std::string("Hardware Settings Floater")) +LLFloaterHardwareSettings::LLFloaterHardwareSettings() + : LLFloater() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hardware_settings.xml"); - - // load it up - initCallbacks(); } LLFloaterHardwareSettings::~LLFloaterHardwareSettings() @@ -114,7 +115,7 @@ LLFloaterHardwareSettings* LLFloaterHardwareSettings::instance() if (!sHardwareSettings) { sHardwareSettings = new LLFloaterHardwareSettings(); - sHardwareSettings->close(); + sHardwareSettings->closeFloater(); } return sHardwareSettings; } @@ -128,7 +129,7 @@ void LLFloaterHardwareSettings::show() //LLUICtrlFactory::getInstance()->buildFloater(hardSettings, "floater_hardware_settings.xml"); //hardSettings->initCallbacks(); - hardSettings->open(); + hardSettings->openFloater(); } bool LLFloaterHardwareSettings::isOpen() @@ -158,6 +159,8 @@ BOOL LLFloaterHardwareSettings::postBuild() refresh(); + // load it up + initCallbacks(); return TRUE; } @@ -203,7 +206,7 @@ void LLFloaterHardwareSettings::cancel() gSavedSettings.setF32("RenderFogRatio", mFogRatio); gSavedSettings.setBOOL("ProbeHardwareOnStartup", mProbeHardwareOnStartup ); - close(); + closeFloater(); } // static @@ -211,6 +214,6 @@ void LLFloaterHardwareSettings::onBtnOK( void* userdata ) { LLFloaterHardwareSettings *fp =(LLFloaterHardwareSettings *)userdata; fp->apply(); - fp->close(false); + fp->closeFloater(false); } diff --git a/indra/newview/llfloaterhardwaresettings.h b/indra/newview/llfloaterhardwaresettings.h index 04a33f69dc203341c3a56231e4ef4ca8e106c6a9..ec99638740f02f223ef0000df621f657fad34a36 100644 --- a/indra/newview/llfloaterhardwaresettings.h +++ b/indra/newview/llfloaterhardwaresettings.h @@ -35,19 +35,17 @@ #include "llfloater.h" -class LLSliderCtrl; - /// Menuing system for all of windlight's functionality class LLFloaterHardwareSettings : public LLFloater { - friend class LLPreferenceCore; + friend class LLFloaterPreference; public: LLFloaterHardwareSettings(); - virtual ~LLFloaterHardwareSettings(); + /*virtual*/ ~LLFloaterHardwareSettings(); - virtual BOOL postBuild(); + /*virtual*/ BOOL postBuild(); /// initialize all the callbacks for the menu void initCallbacks(void); @@ -85,8 +83,6 @@ public: void refreshEnabledState(); protected: - LLSliderCtrl* mCtrlVideoCardMem; - BOOL mUseVBO; BOOL mUseAniso; U32 mFSAASamples; diff --git a/indra/newview/llfloaterhud.cpp b/indra/newview/llfloaterhud.cpp index 9810bf1009b290d0efc195f82603be4c86f5deb0..4379d25a66ec764e2d83e8b3e1c7e7ecaf319cb1 100644 --- a/indra/newview/llfloaterhud.cpp +++ b/indra/newview/llfloaterhud.cpp @@ -52,7 +52,7 @@ LLFloaterHUD* LLFloaterHUD::sInstance = 0; // Default constructor LLFloaterHUD::LLFloaterHUD() -: LLFloater(std::string("floater_hud")), +: LLFloater(), mWebBrowser(0) { // Create floater from its XML definition @@ -69,11 +69,6 @@ LLFloaterHUD::LLFloaterHUD() // Opaque background since we never get the focus setBackgroundOpaque(TRUE); - // Position floater based on saved location - LLRect saved_position_rect = gSavedSettings.getRect("FloaterHUDRect2"); - reshape(saved_position_rect.getWidth(), saved_position_rect.getHeight(), FALSE); - setRect(saved_position_rect); - mWebBrowser = getChild<LLWebBrowserCtrl>("floater_hud_browser" ); if (mWebBrowser) { @@ -91,9 +86,6 @@ LLFloaterHUD::LLFloaterHUD() std::string url = base_url + language + "/"; mWebBrowser->navigateTo(url); } - - // Remember the one instance - sInstance = this; } // Get the instance @@ -101,7 +93,7 @@ LLFloaterHUD* LLFloaterHUD::getInstance() { if (!sInstance) { - new LLFloaterHUD(); + sInstance = new LLFloaterHUD(); } return sInstance; } @@ -109,9 +101,6 @@ LLFloaterHUD* LLFloaterHUD::getInstance() // Destructor LLFloaterHUD::~LLFloaterHUD() { - // Save floater position - gSavedSettings.setRect("FloaterHUDRect2", getRect() ); - // Clear out the one instance if it's ours if (sInstance == this) { @@ -131,7 +120,7 @@ void LLFloaterHUD::showHUD() // Create the instance if necessary LLFloaterHUD* hud = getInstance(); - hud->open(); + hud->openFloater(); hud->setFrontmost(FALSE); } diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index d39824ee05065137d595cbbb4d90e6b1af6e3dcf..faa4f0ec993d82bb0ba22025f3e932998be0ddab 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -214,13 +214,16 @@ void LLFloaterImagePreview::onPreviewTypeCommit(LLUICtrl* ctrl, void* userdata) //----------------------------------------------------------------------------- void LLFloaterImagePreview::clearAllPreviewTextures() { - mAvatarPreview->clearPreviewTexture("mHairMesh0"); - mAvatarPreview->clearPreviewTexture("mUpperBodyMesh0"); - mAvatarPreview->clearPreviewTexture("mLowerBodyMesh0"); - mAvatarPreview->clearPreviewTexture("mHeadMesh0"); - mAvatarPreview->clearPreviewTexture("mUpperBodyMesh0"); - mAvatarPreview->clearPreviewTexture("mLowerBodyMesh0"); - mAvatarPreview->clearPreviewTexture("mSkirtMesh0"); + if (mAvatarPreview) + { + mAvatarPreview->clearPreviewTexture("mHairMesh0"); + mAvatarPreview->clearPreviewTexture("mUpperBodyMesh0"); + mAvatarPreview->clearPreviewTexture("mLowerBodyMesh0"); + mAvatarPreview->clearPreviewTexture("mHeadMesh0"); + mAvatarPreview->clearPreviewTexture("mUpperBodyMesh0"); + mAvatarPreview->clearPreviewTexture("mLowerBodyMesh0"); + mAvatarPreview->clearPreviewTexture("mSkirtMesh0"); + } } //----------------------------------------------------------------------------- @@ -614,6 +617,7 @@ LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLDynamicTex mCameraZoom = 1.f; mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion()); + mDummyAvatar->initInstance(); mDummyAvatar->createDrawable(&gPipeline); mDummyAvatar->mIsDummy = TRUE; mDummyAvatar->mSpecialRenderMode = 2; @@ -671,11 +675,14 @@ void LLImagePreviewAvatar::setPreviewTarget(const std::string& joint_name, const //----------------------------------------------------------------------------- void LLImagePreviewAvatar::clearPreviewTexture(const std::string& mesh_name) { - LLViewerJointMesh *mesh = (LLViewerJointMesh*)mDummyAvatar->mRoot.findJoint(mesh_name); - // clear out existing test mesh - if (mesh) + if (mDummyAvatar) { - mesh->setTestTexture(0); + LLViewerJointMesh *mesh = (LLViewerJointMesh*)mDummyAvatar->mRoot.findJoint(mesh_name); + // clear out existing test mesh + if (mesh) + { + mesh->setTestTexture(0); + } } } @@ -796,27 +803,11 @@ LLImagePreviewSculpted::LLImagePreviewSculpted(S32 width, S32 height) : LLDynami F32 const HIGHEST_LOD = 4.0f; mVolume = new LLVolume(volume_params, HIGHEST_LOD); - - /* - mDummyAvatar = new LLVOAvatar(LLUUID::null, LL_PCODE_LEGACY_AVATAR, gAgent.getRegion()); - mDummyAvatar->createDrawable(&gPipeline); - mDummyAvatar->mIsDummy = TRUE; - mDummyAvatar->mSpecialRenderMode = 2; - mDummyAvatar->setPositionAgent(LLVector3::zero); - mDummyAvatar->slamPosition(); - mDummyAvatar->updateJointLODs(); - mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable); - gPipeline.markVisible(mDummyAvatar->mDrawable, *LLViewerCamera::getInstance()); - mTextureName = 0; - */ } LLImagePreviewSculpted::~LLImagePreviewSculpted() { - /* - mDummyAvatar->markDead(); - */ } diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index de8a094fa99c463f91896dbf52fb9fa59045e5f3..4b29a304acf9fd1522008ffeb72509263d9d70a5 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -31,11 +31,15 @@ */ #include "llviewerprecompiledheaders.h" -#include "llfloateravatarinfo.h" + #include "llfloaterinspect.h" + +#include "llfloaterreg.h" #include "llfloatertools.h" +#include "llfriendactions.h" #include "llcachename.h" #include "llscrolllistctrl.h" +#include "llscrolllistitem.h" #include "llselectmgr.h" #include "lltoolcomp.h" #include "lltoolmgr.h" @@ -45,17 +49,16 @@ LLFloaterInspect* LLFloaterInspect::sInstance = NULL; -LLFloaterInspect::LLFloaterInspect(void) : - LLFloater(std::string("Inspect Object")), +LLFloaterInspect::LLFloaterInspect(void) + : LLFloater(), mDirty(FALSE) { - sInstance = this; LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inspect.xml"); } LLFloaterInspect::~LLFloaterInspect(void) { - if(!gFloaterTools->getVisible()) + if(!LLFloaterReg::instanceVisible("build")) { if(LLToolMgr::getInstance()->getBaseTool() == LLToolCompInspect::getInstance()) { @@ -66,7 +69,7 @@ LLFloaterInspect::~LLFloaterInspect(void) } else { - gFloaterTools->setFocus(TRUE); + LLFloaterReg::showInstance("build", LLSD(), TRUE); } sInstance = NULL; } @@ -88,7 +91,7 @@ void LLFloaterInspect::show(void* ignored) sInstance = new LLFloaterInspect; } - sInstance->open(); + sInstance->openFloater(); LLToolMgr::getInstance()->setTransientTool(LLToolCompInspect::getInstance()); LLSelectMgr::getInstance()->setForceSelection(forcesel); // restore previouis value @@ -119,7 +122,7 @@ void LLFloaterInspect::onClickCreatorProfile(void* ctrl) LLSelectNode* node = sInstance->mObjectSelection->getFirstNode(&func); if(node) { - LLFloaterAvatarInfo::showFromDirectory(node->mPermissions->getCreator()); + LLFriendActions::showProfile(node->mPermissions->getCreator()); } } } @@ -146,7 +149,7 @@ void LLFloaterInspect::onClickOwnerProfile(void* ctrl) if(node) { const LLUUID& owner_id = node->mPermissions->getOwner(); - LLFloaterAvatarInfo::showFromDirectory(owner_id); + LLFriendActions::showProfile(owner_id); } } } @@ -156,7 +159,7 @@ BOOL LLFloaterInspect::postBuild() mObjectList = getChild<LLScrollListCtrl>("object_list"); childSetAction("button owner",onClickOwnerProfile, this); childSetAction("button creator",onClickCreatorProfile, this); - childSetCommitCallback("object_list", onSelectObject); + childSetCommitCallback("object_list", onSelectObject, NULL); return TRUE; } @@ -212,7 +215,6 @@ void LLFloaterInspect::refresh() { LLSelectNode* obj = *iter; LLSD row; - char time[MAX_STRING]; std::string owner_name, creator_name; if (obj->mCreationDate == 0) @@ -221,8 +223,11 @@ void LLFloaterInspect::refresh() } time_t timestamp = (time_t) (obj->mCreationDate/1000000); - LLStringUtil::copy(time, ctime(×tamp), MAX_STRING); - time[24] = '\0'; + std::string timeStr = getString("timeStamp"); + LLSD substitution; + substitution["datetime"] = (S32) timestamp; + LLStringUtil::format (timeStr, substitution); + gCacheName->getFullName(obj->mPermissions->getOwner(), owner_name); gCacheName->getFullName(obj->mPermissions->getCreator(), creator_name); row["id"] = obj->getObject()->getID(); @@ -246,7 +251,7 @@ void LLFloaterInspect::refresh() row["columns"][2]["value"] = creator_name; row["columns"][3]["column"] = "creation_date"; row["columns"][3]["type"] = "text"; - row["columns"][3]["value"] = time; + row["columns"][3]["value"] = timeStr; mObjectList->addElement(row, ADD_TOP); } if(selected_index > -1 && mObjectList->getItemIndex(selected_uuid) == selected_index) diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp index e5811671ed6d95db607d4880db7dd5538ec8364c..c73218cd0f287a550f44e4b37ffe2223461a714a 100644 --- a/indra/newview/llfloaterjoystick.cpp +++ b/indra/newview/llfloaterjoystick.cpp @@ -48,10 +48,10 @@ #include "llcheckboxctrl.h" LLFloaterJoystick::LLFloaterJoystick(const LLSD& data) - : LLFloater("floater_joystick") + : LLFloater() { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_joystick.xml"); - center(); + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_joystick.xml"); + } void LLFloaterJoystick::draw() @@ -68,14 +68,15 @@ void LLFloaterJoystick::draw() { F32 value = joystick->getJoystickAxis(i); mAxisStats[i]->addValue(value * gFrameIntervalSeconds); - - if (mAxisStatsBar[i]->mMinBar > value) - { - mAxisStatsBar[i]->mMinBar = value; - } - if (mAxisStatsBar[i]->mMaxBar < value) + if (mAxisStatsBar[i]) { - mAxisStatsBar[i]->mMaxBar = value; + F32 minbar, maxbar; + mAxisStatsBar[i]->getRange(minbar, maxbar); + if (llabs(value) > maxbar) + { + F32 range = llabs(value); + mAxisStatsBar[i]->setRange(-range, range, range * 0.25f, range * 0.5f); + } } } @@ -84,37 +85,20 @@ void LLFloaterJoystick::draw() BOOL LLFloaterJoystick::postBuild() { - F32 range = gSavedSettings.getBOOL("Cursor3D") ? 1024.f : 2.f; - LLUIString axis = getString("Axis"); - LLUIString joystick = getString("JoystickMonitor"); - - // use this child to get relative positioning info; we'll place the - // joystick monitor on its right, vertically aligned to it. - LLView* child = getChild<LLView>("FlycamAxisScale1"); - LLRect rect; - - if (child) - { - LLRect r = child->getRect(); - LLRect f = getRect(); - rect = LLRect(350, r.mTop, r.mRight + 200, 0); - } - - mAxisStatsView = new LLStatView("axis values", joystick, "", rect); - mAxisStatsView->setDisplayChildren(TRUE); + center(); + F32 range = gSavedSettings.getBOOL("Cursor3D") ? 128.f : 2.f; for (U32 i = 0; i < 6; i++) { - axis.setArg("[NUM]", llformat("%d", i)); mAxisStats[i] = new LLStat(4); - mAxisStatsBar[i] = mAxisStatsView->addStat(axis, mAxisStats[i]); - mAxisStatsBar[i]->mMinBar = -range; - mAxisStatsBar[i]->mMaxBar = range; - mAxisStatsBar[i]->mLabelSpacing = range * 0.5f; - mAxisStatsBar[i]->mTickSpacing = range * 0.25f; + std::string axisname = llformat("axis%d", i); + mAxisStatsBar[i] = getChild<LLStatBar>(axisname); + if (mAxisStatsBar[i]) + { + mAxisStatsBar[i]->setStat(mAxisStats[i]); + mAxisStatsBar[i]->setRange(-range, range, range * 0.25f, range * 0.5f); + } } - - addChild(mAxisStatsView); mCheckJoystickEnabled = getChild<LLCheckBoxCtrl>("enable_joystick"); childSetCommitCallback("enable_joystick",onCommitJoystickEnabled,this); @@ -310,7 +294,7 @@ void LLFloaterJoystick::onClickCancel(void *joy_panel) if (self) { self->cancel(); - self->close(); + self->closeFloater(); } } } @@ -323,7 +307,7 @@ void LLFloaterJoystick::onClickOK(void *joy_panel) if (self) { - self->close(); + self->closeFloater(); } } } diff --git a/indra/newview/llfloaterjoystick.h b/indra/newview/llfloaterjoystick.h index 3ce647e5bb189f7881d678ebfec8caf9167b9c33..9c66b3a8952f74152206238e9322410b6c9c6619 100644 --- a/indra/newview/llfloaterjoystick.h +++ b/indra/newview/llfloaterjoystick.h @@ -84,9 +84,8 @@ private: LLCheckBoxCtrl *mCheckFlycamEnabled; // stats view - LLStatView* mAxisStatsView; - LLStat* mAxisStats[6]; - LLStatBar* mAxisStatsBar[6]; + LLStat* mAxisStats[6]; + LLStatBar* mAxisStatsBar[6]; }; #endif diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp index 91471ca2d0ad8c6256754edb96997904ba9c1222..a97b270c4423dcaf2971f379d32f2957f8a97a58 100644 --- a/indra/newview/llfloaterlagmeter.cpp +++ b/indra/newview/llfloaterlagmeter.cpp @@ -51,7 +51,7 @@ const std::string LAG_WARNING_IMAGE_NAME = "lag_status_warning.tga"; const std::string LAG_GOOD_IMAGE_NAME = "lag_status_good.tga"; LLFloaterLagMeter::LLFloaterLagMeter(const LLSD& key) - : LLFloater(std::string("floater_lagmeter")) + : LLFloater() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_lagmeter.xml"); @@ -59,6 +59,15 @@ LLFloaterLagMeter::LLFloaterLagMeter(const LLSD& key) // lose arrow-key driving when testing lag. setIsChrome(TRUE); + // were we shrunk last time? + if (gSavedSettings.getBOOL("LagMeterShrunk")) + { + onClickShrink(this); + } +} + +BOOL LLFloaterLagMeter::postBuild() +{ mClientButton = getChild<LLButton>("client_lagmeter"); mClientText = getChild<LLTextBox>("client_text"); mClientCause = getChild<LLTextBox>("client_lag_cause"); @@ -113,13 +122,8 @@ LLFloaterLagMeter::LLFloaterLagMeter(const LLSD& key) childSetAction("minimize", onClickShrink, this); - // were we shrunk last time? - if (gSavedSettings.getBOOL("LagMeterShrunk")) - { - onClickShrink(this); - } + return TRUE; } - LLFloaterLagMeter::~LLFloaterLagMeter() { // save shrunk status for next time @@ -180,7 +184,7 @@ void LLFloaterLagMeter::determineClient() { mClientCause->setText( getString("client_texture_loading_cause_msg", mStringArgs) ); } - else if((LLViewerImage::sBoundTextureMemory >> 20) > LLViewerImage::sMaxBoundTextureMem) + else if((BYTES_TO_MEGA_BYTES(LLViewerImage::sBoundTextureMemoryInBytes)) > LLViewerImage::sMaxBoundTextureMemInMegaBytes) { mClientCause->setText( getString("client_texture_memory_cause_msg", mStringArgs) ); } diff --git a/indra/newview/llfloaterlagmeter.h b/indra/newview/llfloaterlagmeter.h index d9cea18305cfd8b9b9f2a2c04d145e8a1e264f6c..e8af68ac7a5b83339cf4204f4c99f4f69715a995 100644 --- a/indra/newview/llfloaterlagmeter.h +++ b/indra/newview/llfloaterlagmeter.h @@ -35,13 +35,15 @@ #include "llfloater.h" +class LLTextBox; + class LLFloaterLagMeter : public LLFloater, public LLFloaterSingleton<LLFloaterLagMeter> { friend class LLUISingleton<LLFloaterLagMeter, VisibilityPolicy<LLFloater> >; public: /*virtual*/ void draw(); - + /*virtual*/ BOOL postBuild(); private: LLFloaterLagMeter(const LLSD& key); /*virtual*/ ~LLFloaterLagMeter(); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 94a834502f130d3a6b857311c1e801900dade8c2..6f5bd5f27b1ee9652eef45248b3fa102c8dae20f 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -50,15 +50,17 @@ #include "llradiogroup.h" #include "llcombobox.h" #include "llfloaterauction.h" -#include "llfloateravatarinfo.h" #include "llfloatergroups.h" #include "llfloatergroupinfo.h" +#include "llfriendactions.h" #include "lllineeditor.h" #include "llnamelistctrl.h" #include "llnotify.h" #include "llpanellandmedia.h" #include "llradiogroup.h" #include "llscrolllistctrl.h" +#include "llscrolllistitem.h" +#include "llscrolllistcell.h" #include "llselectmgr.h" #include "llspinctrl.h" #include "lltabcontainer.h" @@ -75,6 +77,7 @@ #include "llviewerwindow.h" #include "llviewercontrol.h" #include "roles_constants.h" +#include "lltrans.h" static std::string OWNER_ONLINE = "0"; static std::string OWNER_OFFLINE = "1"; @@ -161,7 +164,7 @@ void LLFloaterLand::refreshAll() LLFloaterLand::getInstance()->refresh(); } -void LLFloaterLand::onOpen() +void LLFloaterLand::onOpen(const LLSD& key) { // Done automatically when the selected parcel's properties arrive // (and hence we have the local id). @@ -193,19 +196,16 @@ void LLFloaterLand::onClose(bool app_quitting) LLFloaterLand::LLFloaterLand(const LLSD& seed) -: LLFloater(std::string("floaterland"), std::string("FloaterLandRect5"), std::string("About Land")) +: LLFloater() { - LLCallbackMap::map_t factory_map; - factory_map["land_general_panel"] = LLCallbackMap(createPanelLandGeneral, this); + mFactoryMap["land_general_panel"] = LLCallbackMap(createPanelLandGeneral, this); + mFactoryMap["land_covenant_panel"] = LLCallbackMap(createPanelLandCovenant, this); + mFactoryMap["land_objects_panel"] = LLCallbackMap(createPanelLandObjects, this); + mFactoryMap["land_options_panel"] = LLCallbackMap(createPanelLandOptions, this); + mFactoryMap["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this); + mFactoryMap["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this); - - factory_map["land_covenant_panel"] = LLCallbackMap(createPanelLandCovenant, this); - factory_map["land_objects_panel"] = LLCallbackMap(createPanelLandObjects, this); - factory_map["land_options_panel"] = LLCallbackMap(createPanelLandOptions, this); - factory_map["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this); - factory_map["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this); - - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about_land.xml", &factory_map, false); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about_land.xml", false); sObserver = new LLParcelSelectionObserver(); LLViewerParcelMgr::getInstance()->addObserver( sObserver ); @@ -297,7 +297,7 @@ void* LLFloaterLand::createPanelLandAccess(void* data) LLPanelLandGeneral::LLPanelLandGeneral(LLParcelSelectionHandle& parcel) -: LLPanel(std::string("land_general_panel")), +: LLPanel(), mUncheckedSell(FALSE), mParcel(parcel) { @@ -306,15 +306,13 @@ LLPanelLandGeneral::LLPanelLandGeneral(LLParcelSelectionHandle& parcel) BOOL LLPanelLandGeneral::postBuild() { mEditName = getChild<LLLineEditor>("Name"); - mEditName->setCommitCallback(onCommitAny); + mEditName->setCommitCallback(onCommitAny, this); childSetPrevalidate("Name", LLLineEditor::prevalidatePrintableNotPipe); - childSetUserData("Name", this); mEditDesc = getChild<LLTextEditor>("Description"); mEditDesc->setCommitOnFocusLost(TRUE); - mEditDesc->setCommitCallback(onCommitAny); + mEditDesc->setCommitCallback(onCommitAny, this); childSetPrevalidate("Description", LLLineEditor::prevalidatePrintableNotPipe); - childSetUserData("Description", this); mTextSalePending = getChild<LLTextBox>("SalePending"); @@ -333,7 +331,7 @@ BOOL LLPanelLandGeneral::postBuild() mBtnSetGroup = getChild<LLButton>("Set..."); - mBtnSetGroup->setClickedCallback(onClickSetGroup, this); + mBtnSetGroup->setCommitCallback(boost::bind(&LLPanelLandGeneral::onClickSetGroup, this)); mCheckDeedToGroup = getChild<LLCheckBoxCtrl>( "check deed"); @@ -396,7 +394,7 @@ BOOL LLPanelLandGeneral::postBuild() mBtnReclaimLand->setClickedCallback(onClickReclaim, NULL); mBtnStartAuction = getChild<LLButton>("Linden Sale..."); - mBtnStartAuction->setClickedCallback(onClickStartAuction, NULL); + mBtnStartAuction->setClickedCallback(onClickStartAuction, this); return TRUE; } @@ -754,16 +752,14 @@ void LLPanelLandGeneral::draw() LLPanel::draw(); } -// static -void LLPanelLandGeneral::onClickSetGroup(void* userdata) +void LLPanelLandGeneral::onClickSetGroup() { - LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)userdata; LLFloaterGroupPicker* fg; - LLFloater* parent_floater = gFloaterView->getParentFloater(panelp); + LLFloater* parent_floater = gFloaterView->getParentFloater(this); fg = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); - fg->setSelectCallback( cbGroupID, userdata ); + fg->setSelectGroupCallback( boost::bind(&LLPanelLandGeneral::setGroup, this, _1 )); if (parent_floater) { @@ -788,17 +784,10 @@ void LLPanelLandGeneral::onClickProfile(void* data) else { const LLUUID& avatar_id = parcel->getOwnerID(); - LLFloaterAvatarInfo::showFromObject(avatar_id); + LLFriendActions::showProfile(avatar_id); } } -// static -void LLPanelLandGeneral::cbGroupID(LLUUID group_id, void* userdata) -{ - LLPanelLandGeneral* self = (LLPanelLandGeneral*)userdata; - self->setGroup(group_id); -} - // public void LLPanelLandGeneral::setGroup(const LLUUID& group_id) { @@ -900,7 +889,7 @@ void LLPanelLandGeneral::onClickStartAuction(void* data) } else { - LLFloaterAuction::show(); + LLFloaterAuction::showInstance(); } } } @@ -974,7 +963,8 @@ void LLPanelLandGeneral::onClickStopSellLand(void* data) // LLPanelLandObjects //--------------------------------------------------------------------------- LLPanelLandObjects::LLPanelLandObjects(LLParcelSelectionHandle& parcel) -: LLPanel(std::string("land_objects_panel")), mParcel(parcel) + : LLPanel(), + mParcel(parcel) { } @@ -1014,10 +1004,8 @@ BOOL LLPanelLandObjects::postBuild() mCleanOtherObjectsTime = getChild<LLLineEditor>("clean other time"); mCleanOtherObjectsTime->setFocusLostCallback(onLostFocus, this); - mCleanOtherObjectsTime->setCommitCallback(onCommitClean); - + mCleanOtherObjectsTime->setCommitCallback(onCommitClean, this); childSetPrevalidate("clean other time", LLLineEditor::prevalidateNonNegativeS32); - childSetUserData("clean other time", this); mBtnRefresh = getChild<LLButton>("Refresh List"); mBtnRefresh->setClickedCallback(onClickRefresh, this); @@ -1032,7 +1020,7 @@ BOOL LLPanelLandObjects::postBuild() mOwnerList = getChild<LLNameListCtrl>("owner list"); mOwnerList->sortByColumnIndex(3, FALSE); childSetCommitCallback("owner list", onCommitList, this); - mOwnerList->setDoubleClickCallback(onDoubleClickOwner); + mOwnerList->setDoubleClickCallback(onDoubleClickOwner, this); return TRUE; } @@ -1068,7 +1056,7 @@ void LLPanelLandObjects::onDoubleClickOwner(void *userdata) } else { - LLFloaterAvatarInfo::showFromDirectory(owner_id); + LLFriendActions::showProfile(owner_id); } } } @@ -1406,7 +1394,7 @@ void LLPanelLandObjects::onClickRefresh(void* userdata) // ready the list for results self->mOwnerList->deleteAllItems(); - self->mOwnerList->addCommentText(std::string("Searching...")); // *TODO: Translate + self->mOwnerList->setCommentText(LLTrans::getString("Searching")); self->mOwnerList->setEnabled(FALSE); self->mFirstReply = TRUE; @@ -1468,39 +1456,34 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo continue; } - LLScrollListItem *row = new LLScrollListItem( TRUE, NULL, owner_id); + LLNameListCtrl::NameItem item_params; + item_params.value = owner_id; + item_params.target = is_group_owned ? LLNameListCtrl::GROUP : LLNameListCtrl::INDIVIDUAL; + if (is_group_owned) { - row->addColumn(self->mIconGroup); - row->addColumn(OWNER_GROUP, FONT); + item_params.cells.add().type("icon").value(self->mIconGroup->getName()).column("type"); + item_params.cells.add().value(OWNER_GROUP).font(FONT).column("online_status"); } else if (is_online) { - row->addColumn(self->mIconAvatarOnline); - row->addColumn(OWNER_ONLINE, FONT); + item_params.cells.add().type("icon").value(self->mIconAvatarOnline->getName()).column("type"); + item_params.cells.add().value(OWNER_ONLINE).font(FONT).column("online_status"); } else // offline { - row->addColumn(self->mIconAvatarOffline); - row->addColumn(OWNER_OFFLINE, FONT); + item_params.cells.add().type("icon").value(self->mIconAvatarOffline->getName()).column("type"); + item_params.cells.add().value(OWNER_OFFLINE).font(FONT).column("online_status"); } + // Placeholder for name. - row->addColumn(LLStringUtil::null, FONT); + item_params.cells.add().font(FONT).column("name"); object_count_str = llformat("%d", object_count); - row->addColumn(object_count_str, FONT); - - row->addColumn(formatted_time((time_t)most_recent_time), FONT); + item_params.cells.add().value(object_count_str).font(FONT).column("count"); + item_params.cells.add().value(formatted_time((time_t)most_recent_time)).font(FONT).column("mostrecent"); - - if (is_group_owned) - { - self->mOwnerList->addGroupNameItem(row, ADD_BOTTOM); - } - else - { - self->mOwnerList->addNameItem(row, ADD_BOTTOM); - } + self->mOwnerList->addRow(item_params); lldebugs << "object owner " << owner_id << " (" << (is_group_owned ? "group" : "agent") << ") owns " << object_count << " objects." << llendl; @@ -1508,7 +1491,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo // check for no results if (0 == self->mOwnerList->getItemCount()) { - self->mOwnerList->addCommentText(std::string("None found.")); // *TODO: Translate + self->mOwnerList->setCommentText(LLTrans::getString("NoneFound")); } else { @@ -1699,7 +1682,7 @@ void LLPanelLandObjects::onCommitClean(LLUICtrl *caller, void* user_data) //--------------------------------------------------------------------------- LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) -: LLPanel(std::string("land_options_panel")), +: LLPanel(), mCheckEditObjects(NULL), mCheckEditGroupObjects(NULL), mCheckAllObjectEntry(NULL), @@ -1808,8 +1791,7 @@ BOOL LLPanelLandOptions::postBuild() mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl"); if (mSnapshotCtrl) { - mSnapshotCtrl->setCommitCallback( onCommitAny ); - mSnapshotCtrl->setCallbackUserData( this ); + mSnapshotCtrl->setCommitCallback( onCommitAny, this ); mSnapshotCtrl->setAllowNoTexture ( TRUE ); mSnapshotCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); mSnapshotCtrl->setNonImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); @@ -2262,7 +2244,8 @@ void LLPanelLandOptions::onClickPublishHelp(void*) //--------------------------------------------------------------------------- LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel) -: LLPanel(std::string("land_access_panel")), mParcel(parcel) + : LLPanel(), + mParcel(parcel) { } @@ -2301,6 +2284,8 @@ LLPanelLandAccess::~LLPanelLandAccess() void LLPanelLandAccess::refresh() { + LLFloater* parent_floater = gFloaterView->getParentFloater(this); + if (mListAccess) mListAccess->deleteAllItems(); if (mListBanned) @@ -2328,7 +2313,6 @@ void LLPanelLandAccess::refresh() childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",count)); childSetToolTipArg("AccessList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); - // *TODO: Translate for (access_map_const_iterator cit = parcel->mAccessList.begin(); cit != parcel->mAccessList.end(); ++cit) { @@ -2336,25 +2320,28 @@ void LLPanelLandAccess::refresh() std::string suffix; if (entry.mTime != 0) { + LLStringUtil::format_map_t args; S32 now = time(NULL); S32 seconds = entry.mTime - now; if (seconds < 0) seconds = 0; suffix.assign(" ("); if (seconds >= 120) { - std::string buf = llformat("%d minutes", (seconds/60)); + args["[MINUTES]"] = llformat("%d", (seconds/60)); + std::string buf = parent_floater->getString ("Minutes", args); suffix.append(buf); } else if (seconds >= 60) { - suffix.append("1 minute"); + suffix.append("1 " + parent_floater->getString("Minute")); } else { - std::string buf = llformat("%d seconds", seconds); + args["[SECONDS]"] = llformat("%d", seconds); + std::string buf = parent_floater->getString ("Seconds", args); suffix.append(buf); } - suffix.append(" remaining)"); + suffix.append(" " + parent_floater->getString("Remaining") + ")"); } if (mListAccess) mListAccess->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix); @@ -2375,25 +2362,28 @@ void LLPanelLandAccess::refresh() std::string suffix; if (entry.mTime != 0) { + LLStringUtil::format_map_t args; S32 now = time(NULL); S32 seconds = entry.mTime - now; if (seconds < 0) seconds = 0; suffix.assign(" ("); if (seconds >= 120) { - std::string buf = llformat("%d minutes", (seconds/60)); + args["[MINUTES]"] = llformat("%d", (seconds/60)); + std::string buf = parent_floater->getString ("Minutes", args); suffix.append(buf); } else if (seconds >= 60) { - suffix.append("1 minute"); + suffix.append("1 " + parent_floater->getString("Minute")); } else { - std::string buf = llformat("%d seconds", seconds); + args["[SECONDS]"] = llformat("%d", seconds); + std::string buf = parent_floater->getString ("Seconds", args); suffix.append(buf); } - suffix.append(" remaining)"); + suffix.append(" " + parent_floater->getString("Remaining") + ")"); } mListBanned->addNameItem(entry.mID, ADD_SORTED, TRUE, suffix); } @@ -2758,7 +2748,8 @@ void LLPanelLandAccess::onClickRemoveBanned(void* data) // LLPanelLandCovenant //--------------------------------------------------------------------------- LLPanelLandCovenant::LLPanelLandCovenant(LLParcelSelectionHandle& parcel) -: LLPanel(std::string("land_covenant_panel")), mParcel(parcel) + : LLPanel(), + mParcel(parcel) { } diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 4c3de65d71358a779cb04d04eba196dd6be28f5d..74c1205e1f0cdb6ab9ccd75784faed78eb00ad7d 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -38,8 +38,8 @@ #include <vector> #include "llfloater.h" -//#include "llviewerimagelist.h" -#include "llmemory.h" // LLPointer<> +#include "llpointer.h" // LLPointer<> +#include "llsafehandle.h" typedef std::set<LLUUID, lluuid_less> uuid_list_t; const F32 CACHE_REFRESH_TIME = 2.5f; @@ -82,7 +82,7 @@ public: // Destroys itself on close. virtual void onClose(bool app_quitting); - virtual void onOpen(); + virtual void onOpen(const LLSD& key); virtual BOOL postBuild(); protected: @@ -138,8 +138,7 @@ public: void setGroup(const LLUUID& group_id); static void onClickProfile(void*); - static void onClickSetGroup(void*); - static void cbGroupID(LLUUID group_id, void* userdata); + void onClickSetGroup(); static BOOL enableDeedToGroup(void*); static void onClickDeed(void*); static void onClickBuyLand(void* data); diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index bd1186b1519bc19d5c2070f3c8978c6f89e0e95f..223cca50b28c4d77105604fca6e584482518115b 100644 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -41,13 +41,16 @@ #include "message.h" #include "llagent.h" -#include "llbutton.h" +#include "llfloaterreg.h" #include "llfloatergroupinfo.h" #include "llfloaterworldmap.h" #include "llproductinforequest.h" #include "llscrolllistctrl.h" #include "llstatusbar.h" #include "lltextbox.h" +#include "llscrolllistctrl.h" +#include "llscrolllistitem.h" +#include "llscrolllistcell.h" #include "lltrans.h" #include "lluiconstants.h" #include "llviewermessage.h" @@ -78,13 +81,13 @@ void LLFloaterLandHoldings::show(void*) ""); // TODO: request updated L$ balance? - floater->open(); /* Flawfinder: ignore */ + floater->openFloater(); } // protected LLFloaterLandHoldings::LLFloaterLandHoldings() -: LLFloater(std::string("land holdings floater")), +: LLFloater(), mActualArea(0), mBillableArea(0), mFirstPacketReceived(FALSE), @@ -101,8 +104,7 @@ BOOL LLFloaterLandHoldings::postBuild() childSetAction("Show on Map", onClickMap, this); // Grant list - childSetDoubleClickCallback("grant list", onGrantList); - childSetUserData("grant list", this); + getChild<LLScrollListCtrl>("grant list")->setDoubleClickCallback(onGrantList, this); LLCtrlListInterface *list = childGetListInterface("grant list"); if (!list) return TRUE; @@ -295,11 +297,11 @@ void LLFloaterLandHoldings::buttonCore(S32 which) { case 0: gAgent.teleportViaLocation(pos_global); - gFloaterWorldMap->trackLocation(pos_global); + LLFloaterWorldMap::getInstance()->trackLocation(pos_global); break; case 1: - gFloaterWorldMap->trackLocation(pos_global); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::getInstance()->trackLocation(pos_global); + LLFloaterReg::showInstance("world_map", "center"); break; default: break; @@ -311,7 +313,7 @@ void LLFloaterLandHoldings::onClickTeleport(void* data) { LLFloaterLandHoldings* self = (LLFloaterLandHoldings*)data; self->buttonCore(0); - self->close(); + self->closeFloater(); } diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 3b1e4c7ac753172c0b7127a403707ab0acef252e..6660650c56d8d1211fd7b09c1c66e2bf0709d223 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -30,96 +30,188 @@ * $/LicenseInfo$ */ +#include <string> #include "llviewerprecompiledheaders.h" +// self include #include "llfloatermap.h" +// Library includes +#include "llfloaterreg.h" +#include "llfontgl.h" +#include "llglheaders.h" + +// Viewer includes #include "llagent.h" -#include "llcolorscheme.h" #include "llviewercontrol.h" -#include "lldraghandle.h" #include "llnetmap.h" -#include "llregionhandle.h" -#include "llresizebar.h" -#include "lluictrlfactory.h" - -LLFloaterMap::LLFloaterMap(const LLSD& key) - : - LLFloater(std::string("minimap")), - mPanelMap(NULL) +#include "lltracker.h" +#include "llviewercamera.h" +#include "lldraghandle.h" +#include "lltextbox.h" +#include "llviewermenu.h" + +// +// Constants +// +const F32 MAP_SCALE_MIN = 64; +const F32 MAP_SCALE_MID = 172; +const F32 MAP_SCALE_MAX = 512; + +// +// Member functions +// + +LLFloaterMap::LLFloaterMap(const LLSD& key) + : LLFloater(key) { - LLCallbackMap::map_t factory_map; - factory_map["mini_mapview"] = LLCallbackMap(createPanelMiniMap, this); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_mini_map.xml", &factory_map, FALSE); + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_map.xml", FALSE); } - -// static -void* LLFloaterMap::createPanelMiniMap(void* data) +LLFloaterMap::~LLFloaterMap() { - LLFloaterMap* self = (LLFloaterMap*)data; - self->mPanelMap = new LLNetMap("Mapview"); - return self->mPanelMap; } BOOL LLFloaterMap::postBuild() { - // Send the drag handle to the back, but make sure close stays on top + mMap = getChild<LLNetMap>("Net Map"); + mMap->setScale(gSavedSettings.getF32("MiniMapScale")); + mMap->setRotateMap(gSavedSettings.getBOOL( "MiniMapRotate" )); + mMap->setToolTipMsg(getString("ToolTipMsg")); + sendChildToBack(mMap); + + mTextBoxNorth = getChild<LLTextBox> ("floater_map_north"); + mTextBoxEast = getChild<LLTextBox> ("floater_map_east"); + mTextBoxWest = getChild<LLTextBox> ("floater_map_west"); + mTextBoxSouth = getChild<LLTextBox> ("floater_map_south"); + mTextBoxSouthEast = getChild<LLTextBox> ("floater_map_southeast"); + mTextBoxNorthEast = getChild<LLTextBox> ("floater_map_northeast"); + mTextBoxSouthWest = getChild<LLTextBox> ("floater_map_southwest"); + mTextBoxNorthWest = getChild<LLTextBox> ("floater_map_northwest"); + + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + + registrar.add("Minimap.Zoom", boost::bind(&LLFloaterMap::handleZoom, this, _2)); + registrar.add("Minimap.Tracker", boost::bind(&LLFloaterMap::handleStopTracking, this, _2)); + + mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_minimap.xml", gMenuHolder); + if (mPopupMenu && !LLTracker::isTracking(0)) + { + mPopupMenu->setItemEnabled ("Stop Tracking", false); + } + + // Get the drag handle all the way in back sendChildToBack(getDragHandle()); - sendChildToFront(getChild<LLButton>("llfloater_close_btn")); + setIsChrome(TRUE); + + // keep onscreen + gFloaterView->adjustToFitScreen(this, FALSE); + return TRUE; } - -LLFloaterMap::~LLFloaterMap() +BOOL LLFloaterMap::handleDoubleClick( S32 x, S32 y, MASK mask ) { + LLFloaterReg::showInstance("world_map"); + return TRUE; } +BOOL LLFloaterMap::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + if (mPopupMenu) + { + mPopupMenu->buildDrawLabels(); + mPopupMenu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(this, mPopupMenu, x, y); + } + return TRUE; +} -// virtual -void LLFloaterMap::onOpen() +void LLFloaterMap::setDirectionPos( LLTextBox* text_box, F32 rotation ) { - gFloaterView->adjustToFitScreen(this, FALSE); + // Rotation is in radians. + // Rotation of 0 means x = 1, y = 0 on the unit circle. - gSavedSettings.setBOOL("ShowMiniMap", TRUE); -} + F32 map_half_height = (F32)(getRect().getHeight() / 2); + F32 map_half_width = (F32)(getRect().getWidth() / 2); + F32 text_half_height = (F32)(text_box->getRect().getHeight() / 2); + F32 text_half_width = (F32)(text_box->getRect().getWidth() / 2); + F32 radius = llmin( map_half_height - text_half_height, map_half_width - text_half_width ); + // Inset by a little to account for position display. + radius -= 8.f; + + text_box->setOrigin( + llround(map_half_width - text_half_width + radius * cos( rotation )), + llround(map_half_height - text_half_height + radius * sin( rotation )) ); +} // virtual -void LLFloaterMap::onClose(bool app_quitting) +void LLFloaterMap::draw() { - LLFloater::setVisible(FALSE); + F32 rotation = 0; - if (!app_quitting) + if( mMap->getRotateMap() ) { - gSavedSettings.setBOOL("ShowMiniMap", FALSE); + // rotate subsequent draws to agent rotation + rotation = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); } -} -BOOL LLFloaterMap::canClose() -{ - return !LLApp::isExiting(); -} + setDirectionPos( mTextBoxEast, rotation ); + setDirectionPos( mTextBoxNorth, rotation + F_PI_BY_TWO ); + setDirectionPos( mTextBoxWest, rotation + F_PI ); + setDirectionPos( mTextBoxSouth, rotation + F_PI + F_PI_BY_TWO ); + setDirectionPos( mTextBoxNorthEast, rotation + F_PI_BY_TWO / 2); + setDirectionPos( mTextBoxNorthWest, rotation + F_PI_BY_TWO + F_PI_BY_TWO / 2); + setDirectionPos( mTextBoxSouthWest, rotation + F_PI + F_PI_BY_TWO / 2); + setDirectionPos( mTextBoxSouthEast, rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); -// virtual -void LLFloaterMap::draw() -{ // Note: we can't just gAgent.check cameraMouselook() because the transition states are wrong. if( gAgent.cameraMouselook()) { setMouseOpaque(FALSE); getDragHandle()->setMouseOpaque(FALSE); - - drawChild(mPanelMap); } else { setMouseOpaque(TRUE); getDragHandle()->setMouseOpaque(TRUE); + } + + if (LLTracker::isTracking(0)) + { + mPopupMenu->setItemEnabled ("Stop Tracking", true); + } + + LLFloater::draw(); +} + +void LLFloaterMap::handleZoom(const LLSD& userdata) +{ + std::string level = userdata.asString(); + + F32 scale = 0.0f; + if (level == std::string("close")) + scale = MAP_SCALE_MAX; + else if (level == std::string("medium")) + scale = MAP_SCALE_MID; + else if (level == std::string("far")) + scale = MAP_SCALE_MIN; + if (scale != 0.0f) + { + gSavedSettings.setF32("MiniMapScale", scale ); + mMap->setScale(scale); + } +} - LLFloater::draw(); +void LLFloaterMap::handleStopTracking (const LLSD& userdata) +{ + if (mPopupMenu) + { + mPopupMenu->setItemEnabled ("Stop Tracking", false); + LLTracker::stopTracking ((void*)LLTracker::isTracking(NULL)); } } diff --git a/indra/newview/llfloatermap.h b/indra/newview/llfloatermap.h index ec2db27f7a18992870e57defa86b86029807d389..501777ed0787fec381509c344931e6c6100ee286 100644 --- a/indra/newview/llfloatermap.h +++ b/indra/newview/llfloatermap.h @@ -35,28 +35,42 @@ #include "llfloater.h" +class LLMenuGL; class LLNetMap; +class LLTextBox; -class LLFloaterMap : - public LLFloater, - public LLFloaterSingleton<LLFloaterMap> +// +// Classes +// +class LLFloaterMap : public LLFloater { - friend class LLUISingleton<LLFloaterMap, VisibilityPolicy<LLFloater> >; public: + LLFloaterMap(const LLSD& key); virtual ~LLFloaterMap(); - - static void* createPanelMiniMap(void* data); - - BOOL postBuild(); - + + /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); + /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); /*virtual*/ void draw(); - /*virtual*/ void onOpen(); - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ BOOL canClose(); - + private: - LLFloaterMap(const LLSD& key = LLSD()); - LLNetMap* mPanelMap; + void handleZoom(const LLSD& userdata); + void handleStopTracking (const LLSD& userdata); + void setDirectionPos( LLTextBox* text_box, F32 rotation ); + + LLMenuGL* mPopupMenu; + + LLTextBox* mTextBoxEast; + LLTextBox* mTextBoxNorth; + LLTextBox* mTextBoxWest; + LLTextBox* mTextBoxSouth; + + LLTextBox* mTextBoxSouthEast; + LLTextBox* mTextBoxNorthEast; + LLTextBox* mTextBoxNorthWest; + LLTextBox* mTextBoxSouthWest; + + LLNetMap* mMap; }; #endif // LL_LLFLOATERMAP_H diff --git a/indra/newview/llfloatermemleak.cpp b/indra/newview/llfloatermemleak.cpp index df51918e35c1d73fc82a9ad3dad69ca4f5438617..3f2fcc26db8038892b89c304874e1e4650b6eef6 100644 --- a/indra/newview/llfloatermemleak.cpp +++ b/indra/newview/llfloatermemleak.cpp @@ -49,8 +49,10 @@ U32 LLFloaterMemLeak::sTotalLeaked = 0 ; S32 LLFloaterMemLeak::sStatus = LLFloaterMemLeak::STOP ; BOOL LLFloaterMemLeak::sbAllocationFailed = FALSE ; -LLFloaterMemLeak::LLFloaterMemLeak() : LLFloater("Memory Leaking Simulation Floater") +LLFloaterMemLeak::LLFloaterMemLeak() + : LLFloater() { + setTitle("Memory Leaking Simulation Floater"); } LLFloaterMemLeak::~LLFloaterMemLeak() @@ -224,7 +226,7 @@ LLFloaterMemLeak* LLFloaterMemLeak::instance() if (!sInstance) { sInstance = new LLFloaterMemLeak(); - LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_mem_leaking.xml", NULL, FALSE); + LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_mem_leaking.xml", FALSE); if(sInstance) { @@ -256,7 +258,7 @@ LLFloaterMemLeak* LLFloaterMemLeak::instance() void LLFloaterMemLeak::show(void*) { - instance()->open(); + instance()->openFloater(); } LLFloaterMemLeak* LLFloaterMemLeak::getInstance() diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index acfcfab445a627d11ff9d94462a4f84946a5ec09..6ef72d4c1a0f7f5826333f445f1047130ab3f872 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -41,6 +41,7 @@ #include "llbutton.h" #include "llviewerwindow.h" #include "llfocusmgr.h" +#include "llrootview.h" #include "llradiogroup.h" #include "lldbstrings.h" #include "lldir.h" @@ -69,8 +70,9 @@ const S32 PREF_BUTTON_HEIGHT = 16; // LLFloaterNameDesc() //----------------------------------------------------------------------------- LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename ) - : LLFloater(std::string("Name/Description Floater")) + : LLFloater() { + setTitle("Name/Description Floater"); mFilenameAndPath = filename; mFilename = gDirUtilp->getBaseFileName(filename, false); // SL-5521 Maintain capitalization of filename when making the inventory item. JC @@ -190,7 +192,7 @@ void LLFloaterNameDesc::onBtnOK( void* userdata ) 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE, LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(), display_name, callback, expected_upload_cost, nruserdata); - fp->close(false); + fp->closeFloater(false); } // static @@ -200,5 +202,5 @@ void LLFloaterNameDesc::onBtnOK( void* userdata ) void LLFloaterNameDesc::onBtnCancel( void* userdata ) { LLFloaterNameDesc *fp =(LLFloaterNameDesc *)userdata; - fp->close(false); + fp->closeFloater(false); } diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index e6250063f7865ec5da1912d57e0b0ac4fae88c31..11842b8b0e9a3849d1117ae417b3545dc423ce90 100644 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -36,6 +36,7 @@ #include "lluictrlfactory.h" #include "llbutton.h" #include "llscrolllistctrl.h" +#include "llscrolllistitem.h" #include "llpanel.h" #include "llcombobox.h" #include "llviewertexteditor.h" @@ -59,11 +60,12 @@ private: }; LLNotificationChannelPanel::LLNotificationChannelPanel(const std::string& channel_name) - : LLPanel(channel_name) + : LLPanel() { mChannelPtr = LLNotifications::instance().getChannel(channel_name); mChannelRejectsPtr = LLNotificationChannelPtr( - LLNotificationChannel::buildChannel(channel_name + "rejects", mChannelPtr->getParentChannelName(), !boost::bind(mChannelPtr->getFilter(), _1))); + LLNotificationChannel::buildChannel(channel_name + "rejects", mChannelPtr->getParentChannelName(), + !boost::bind(mChannelPtr->getFilter(), _1))); LLUICtrlFactory::instance().buildPanel(this, "panel_notifications_channel.xml"); } @@ -77,13 +79,11 @@ BOOL LLNotificationChannelPanel::postBuild() mChannelRejectsPtr->connectChanged(boost::bind(&LLNotificationChannelPanel::update, this, _1, false)); LLScrollListCtrl* scroll = getChild<LLScrollListCtrl>("notifications_list"); - scroll->setDoubleClickCallback(onClickNotification); - scroll->setCallbackUserData(this); - + scroll->setDoubleClickCallback(onClickNotification, this); + scroll->setRect(LLRect( getRect().mLeft, getRect().mTop, getRect().mRight, 0)); scroll = getChild<LLScrollListCtrl>("notification_rejects_list"); - scroll->setDoubleClickCallback(onClickNotificationReject); - scroll->setCallbackUserData(this); - + scroll->setDoubleClickCallback(onClickNotificationReject, this); + scroll->setRect(LLRect( getRect().mLeft, getRect().mTop, getRect().mRight, 0)); return TRUE; } @@ -161,6 +161,7 @@ bool LLNotificationChannelPanel::update(const LLSD& payload, bool passed_filter) // LLFloaterNotificationConsole // LLFloaterNotificationConsole::LLFloaterNotificationConsole(const LLSD& key) +: LLFloater() { LLUICtrlFactory::instance().buildFloater(this, "floater_notifications_console.xml"); } @@ -229,8 +230,10 @@ void LLFloaterNotificationConsole::removeChannel(const std::string& name) //static void LLFloaterNotificationConsole::updateResizeLimits() { + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + LLLayoutStack& stack = getChildRef<LLLayoutStack>("notification_channels"); - setResizeLimits(getMinWidth(), LLFLOATER_HEADER_SIZE + HEADER_PADDING + ((NOTIFICATION_PANEL_HEADER_HEIGHT + 3) * stack.getNumPanels())); + setResizeLimits(getMinWidth(), floater_header_size + HEADER_PADDING + ((NOTIFICATION_PANEL_HEADER_HEIGHT + 3) * stack.getNumPanels())); } void LLFloaterNotificationConsole::onClickAdd(void* user_data) @@ -247,7 +250,9 @@ void LLFloaterNotificationConsole::onClickAdd(void* user_data) //=============== LLFloaterNotification ================ -LLFloaterNotification::LLFloaterNotification(LLNotification* note) : mNote(note) +LLFloaterNotification::LLFloaterNotification(LLNotification* note) +: LLFloater(), + mNote(note) { LLUICtrlFactory::instance().buildFloater(this, "floater_notification.xml"); } @@ -265,8 +270,7 @@ BOOL LLFloaterNotification::postBuild() return TRUE; } - responses_combo->setCommitCallback(onCommitResponse); - responses_combo->setCallbackUserData(this); + responses_combo->setCommitCallback(onCommitResponse, this); LLSD form_sd = form->asLLSD(); diff --git a/indra/newview/llfloaternotificationsconsole.h b/indra/newview/llfloaternotificationsconsole.h index 1a436b8bfee70505c8228899441a67da49845fb1..037255318215243410f2be6721dafa4e733d6024 100644 --- a/indra/newview/llfloaternotificationsconsole.h +++ b/indra/newview/llfloaternotificationsconsole.h @@ -34,6 +34,7 @@ #define LL_LLFLOATER_NOTIFICATIONS_CONSOLE_H #include "llfloater.h" +#include "lllayoutstack.h" #include "llnotifications.h" class LLFloaterNotificationConsole : diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index f4984df6d9078e958cc58b97c182f3a276f3bdd5..4d782a1814c12beee5b93d38fb4f8cc1b75d3a1b 100644 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -45,6 +45,7 @@ #include "llagent.h" // for agent id #include "llalertdialog.h" +#include "llinventorybridge.h" #include "llinventoryview.h" #include "llinventorymodel.h" #include "llpanelinventory.h" @@ -58,24 +59,26 @@ LLFloaterOpenObject* LLFloaterOpenObject::sInstance = NULL; LLFloaterOpenObject::LLFloaterOpenObject() -: LLFloater(std::string("object_contents")), +: LLFloater(), mPanelInventory(NULL), mDirty(TRUE) { - LLCallbackMap::map_t factory_map; - factory_map["object_contents"] = LLCallbackMap(createPanelInventory, this); - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_openobject.xml",&factory_map); - - childSetAction("copy_to_inventory_button", onClickMoveToInventory, this); - childSetAction("copy_and_wear_button", onClickMoveAndWear, this); - childSetTextArg("object_name", "[DESC]", std::string("Object") ); // *Note: probably do not want to translate this + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_openobject.xml"); } LLFloaterOpenObject::~LLFloaterOpenObject() { sInstance = NULL; } - +// virtual +BOOL LLFloaterOpenObject::postBuild() +{ + childSetAction("copy_to_inventory_button", onClickMoveToInventory, this); + childSetAction("copy_and_wear_button", onClickMoveAndWear, this); + childSetTextArg("object_name", "[DESC]", std::string("Object") ); // *Note: probably do not want to translate this + mPanelInventory = getChild<LLPanelInventory>("object_contents"); + return TRUE; +} void LLFloaterOpenObject::refresh() { mPanelInventory->refresh(); @@ -135,7 +138,7 @@ void LLFloaterOpenObject::show() sInstance->center(); } - sInstance->open(); /* Flawfinder: ignore */ + sInstance->openFloater(); sInstance->setFocus(TRUE); sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); @@ -215,7 +218,7 @@ void LLFloaterOpenObject::onClickMoveToInventory(void* data) { LLFloaterOpenObject* self = (LLFloaterOpenObject*)data; self->moveToInventory(false); - self->close(); + self->closeFloater(); } // static @@ -223,13 +226,6 @@ void LLFloaterOpenObject::onClickMoveAndWear(void* data) { LLFloaterOpenObject* self = (LLFloaterOpenObject*)data; self->moveToInventory(true); - self->close(); + self->closeFloater(); } -//static -void* LLFloaterOpenObject::createPanelInventory(void* data) -{ - LLFloaterOpenObject* floater = (LLFloaterOpenObject*)data; - floater->mPanelInventory = new LLPanelInventory(std::string("Object Contents"), LLRect()); - return floater->mPanelInventory; -} diff --git a/indra/newview/llfloateropenobject.h b/indra/newview/llfloateropenobject.h index 27653a5c99f94d8b4355634bc64dd6f38770de35..0097a856901df85298bfb1459438bafc3da80c26 100644 --- a/indra/newview/llfloateropenobject.h +++ b/indra/newview/llfloateropenobject.h @@ -59,7 +59,7 @@ public: protected: LLFloaterOpenObject(); ~LLFloaterOpenObject(); - + /*virtual*/ BOOL postBuild(); void refresh(); void draw(); @@ -68,7 +68,6 @@ protected: static void onClickMoveToInventory(void* data); static void onClickMoveAndWear(void* data); static void callbackMoveInventory(S32 result, void* data); - static void* createPanelInventory(void* data); protected: static LLFloaterOpenObject* sInstance; diff --git a/indra/newview/llfloaterparcel.cpp b/indra/newview/llfloaterparcel.cpp index 4213150553591b86c0c1a4de4a692ad4d4a5d8c8..fa7403874e2142e7cc76a4cf27c7bc3adf173073 100644 --- a/indra/newview/llfloaterparcel.cpp +++ b/indra/newview/llfloaterparcel.cpp @@ -93,12 +93,12 @@ void* LLFloaterParcelInfo::createPanelPlace(void* data) //---------------------------------------------------------------------------- -LLFloaterParcelInfo::LLFloaterParcelInfo(const std::string& name, const LLUUID &parcel_id) -: LLFloater(name), +LLFloaterParcelInfo::LLFloaterParcelInfo(const LLUUID &parcel_id) +: LLFloater(), mParcelID( parcel_id ) { mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterParcelInfo::createPanelPlace, this); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml", &getFactoryMap()); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml"); gPlaceInfoInstances.addData(parcel_id, this); } @@ -128,14 +128,14 @@ LLFloaterParcelInfo* LLFloaterParcelInfo::show(const LLUUID &parcel_id) { // ...bring that window to front floater = gPlaceInfoInstances.getData(parcel_id); - floater->open(); /*Flawfinder: ignore*/ + floater->openFloater(); floater->setFrontmost(true); } else { - floater = new LLFloaterParcelInfo("parcelinfo", parcel_id ); + floater = new LLFloaterParcelInfo( parcel_id ); floater->center(); - floater->open(); /*Flawfinder: ignore*/ + floater->openFloater(); floater->displayParcelInfo(parcel_id); floater->setFrontmost(true); } diff --git a/indra/newview/llfloaterparcel.h b/indra/newview/llfloaterparcel.h index 4d698d64ae013c8c889169fe8f3c237189c2d37e..c2d5987d8e79dcd64d4a2247627ad51c10e7552e 100644 --- a/indra/newview/llfloaterparcel.h +++ b/indra/newview/llfloaterparcel.h @@ -43,7 +43,7 @@ class LLFloaterParcelInfo public: static void* createPanelPlace(void* data); - LLFloaterParcelInfo(const std::string& name, const LLUUID &parcel_id ); + LLFloaterParcelInfo( const LLUUID &parcel_id ); /*virtual*/ ~LLFloaterParcelInfo(); void displayParcelInfo(const LLUUID& parcel_id); diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index 52fba0aa202200a5f6be5ae03972d1ad87e40147..1ef71a9d532efe9eff743db30edd295e65cc3dde 100644 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -42,6 +42,7 @@ LLFloaterPerms::LLFloaterPerms(const LLSD& seed) +: LLFloater() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_perm_prefs.xml"); } @@ -64,7 +65,7 @@ void LLFloaterPerms::onClickOK(void* data) { LLFloaterPerms* self = static_cast<LLFloaterPerms*>(data); self->ok(); - self->close(); + self->closeFloater(); } //static @@ -72,7 +73,7 @@ void LLFloaterPerms::onClickCancel(void* data) { LLFloaterPerms* self = static_cast<LLFloaterPerms*>(data); self->cancel(); - self->close(); + self->closeFloater(); } //static @@ -117,7 +118,7 @@ void LLFloaterPerms::onClose(bool app_quitting) // Cancel any unsaved changes before closing. // Note: when closed due to the OK button this amounts to a no-op. cancel(); - LLFloater::onClose(app_quitting); + destroy(); } //static diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index b0ab0f96253327841964a7bf65ed51608d272250..4a68e3092e26bf63b14c0060c5f0fa36db429c42 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -78,30 +78,21 @@ LLFloaterPostcard::instance_list_t LLFloaterPostcard::sInstances; ///---------------------------------------------------------------------------- LLFloaterPostcard::LLFloaterPostcard(LLImageJPEG* jpeg, LLImageGL *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global) -: LLFloater(std::string("Postcard Floater")), +: LLFloater(), mJPEGImage(jpeg), mViewerImage(img), mImageScale(img_scale), mPosTakenGlobal(pos_taken_global), mHasFirstMsgFocus(false) { - init(); -} + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_postcard.xml"); -void LLFloaterPostcard::init() -{ + sInstances.insert(this); + // pick up the user's up-to-date email address - if(!gAgent.getID().isNull()) - { - // we're logged in, so we can get this info. - gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gAgent.sendReliableMessage(); - } + gAgent.sendAgentUserInfoRequest(); - sInstances.insert(this); + openFloater(); } // Destroys the object @@ -145,14 +136,6 @@ LLFloaterPostcard* LLFloaterPostcard::showFromSnapshot(LLImageJPEG *jpeg, LLImag // It's now our job to clean them up LLFloaterPostcard *instance = new LLFloaterPostcard(jpeg, img, image_scale, pos_taken_global); - LLUICtrlFactory::getInstance()->buildFloater(instance, "floater_postcard.xml"); - - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - instance->setOrigin(left, top - instance->getRect().getHeight()); - - instance->open(); /*Flawfinder: ignore*/ - return instance; } @@ -215,7 +198,7 @@ void LLFloaterPostcard::onClickCancel(void* data) { LLFloaterPostcard *self = (LLFloaterPostcard *)data; - self->close(false); + self->closeFloater(false); } } @@ -313,7 +296,7 @@ void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, gAgent.sendReliableMessage(); } - self->close(); + self->closeFloater(); } // static diff --git a/indra/newview/llfloaterpostcard.h b/indra/newview/llfloaterpostcard.h index 087649f159ded4facc5f83d32ca93d57fbc80d3b..5abb97e15fd4e1f12bf3b7b6b0fbec6082cf6caf 100644 --- a/indra/newview/llfloaterpostcard.h +++ b/indra/newview/llfloaterpostcard.h @@ -36,12 +36,13 @@ #include "llfloater.h" #include "llcheckboxctrl.h" -#include "llmemory.h" -#include "llimagegl.h" +#include "llpointer.h" class LLTextEditor; class LLLineEditor; class LLButton; +class LLImageGL; +class LLImageJPEG; class LLFloaterPostcard : public LLFloater @@ -50,7 +51,6 @@ public: LLFloaterPostcard(LLImageJPEG* jpeg, LLImageGL *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global); virtual ~LLFloaterPostcard(); - virtual void init(); virtual BOOL postBuild(); virtual void draw(); diff --git a/indra/newview/llfloaterpostprocess.cpp b/indra/newview/llfloaterpostprocess.cpp index de9b598b1eccf889eddcc2912f1794a5d414a5d7..a1015918d4323ebbb79f43e09c768528a1ea9f5b 100644 --- a/indra/newview/llfloaterpostprocess.cpp +++ b/indra/newview/llfloaterpostprocess.cpp @@ -47,10 +47,20 @@ LLFloaterPostProcess* LLFloaterPostProcess::sPostProcess = NULL; -LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater(std::string("Post-Process Floater")) +LLFloaterPostProcess::LLFloaterPostProcess() + : LLFloater() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_post_process.xml"); +} + +LLFloaterPostProcess::~LLFloaterPostProcess() +{ + + +} +BOOL LLFloaterPostProcess::postBuild() +{ /// Color Filter Callbacks childSetCommitCallback("ColorFilterToggle", &LLFloaterPostProcess::onBoolToggle, (char*)"enable_color_filter"); //childSetCommitCallback("ColorFilterGamma", &LLFloaterPostProcess::onFloatControlMoved, &(gPostProcess->tweaks.gamma())); @@ -78,19 +88,13 @@ LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater(std::string("Post-Proce // Effect loading and saving. LLComboBox* comboBox = getChild<LLComboBox>("PPEffectsCombo"); childSetAction("PPLoadEffect", &LLFloaterPostProcess::onLoadEffect, comboBox); - comboBox->setCommitCallback(onChangeEffectName); + comboBox->setCommitCallback(boost::bind(&LLFloaterPostProcess::onChangeEffectName, this, _1)); LLLineEditor* editBox = getChild<LLLineEditor>("PPEffectNameEditor"); childSetAction("PPSaveEffect", &LLFloaterPostProcess::onSaveEffect, editBox); syncMenu(); - -} - -LLFloaterPostProcess::~LLFloaterPostProcess() -{ - - + return TRUE; } LLFloaterPostProcess* LLFloaterPostProcess::instance() @@ -99,7 +103,7 @@ LLFloaterPostProcess* LLFloaterPostProcess::instance() if (!sPostProcess) { sPostProcess = new LLFloaterPostProcess(); - sPostProcess->open(); + sPostProcess->openFloater(); sPostProcess->setFocus(TRUE); } return sPostProcess; @@ -185,14 +189,13 @@ void LLFloaterPostProcess::onSaveEffect(void* userData) } } -void LLFloaterPostProcess::onChangeEffectName(LLUICtrl* ctrl, void * userData) +void LLFloaterPostProcess::onChangeEffectName(LLUICtrl* ctrl) { // get the combo box and name - LLComboBox * comboBox = static_cast<LLComboBox*>(ctrl); - LLLineEditor* editBox = sPostProcess->getChild<LLLineEditor>("PPEffectNameEditor"); + LLLineEditor* editBox = getChild<LLLineEditor>("PPEffectNameEditor"); // set the parameter's new name - editBox->setValue(comboBox->getSelectedValue()); + editBox->setValue(ctrl->getValue()); } bool LLFloaterPostProcess::saveAlertCallback(const LLSD& notification, const LLSD& response) @@ -215,7 +218,7 @@ void LLFloaterPostProcess::show() // and open the menu LLFloaterPostProcess* postProcess = instance(); postProcess->syncMenu(); - postProcess->open(); + postProcess->openFloater(); } // virtual diff --git a/indra/newview/llfloaterpostprocess.h b/indra/newview/llfloaterpostprocess.h index 08a3618c2b638fae541640acdb03dc53a3ffd78e..68e6d1e244e75df5d81de05b8686678d914ac450 100644 --- a/indra/newview/llfloaterpostprocess.h +++ b/indra/newview/llfloaterpostprocess.h @@ -53,7 +53,7 @@ public: LLFloaterPostProcess(); virtual ~LLFloaterPostProcess(); - + /*virtual*/ BOOL postBuild(); /// one and one instance only static LLFloaterPostProcess* instance(); @@ -66,7 +66,7 @@ public: static void onColorControlIMoved(LLUICtrl* ctrl, void* userData); static void onLoadEffect(void* userData); static void onSaveEffect(void* userData); - static void onChangeEffectName(LLUICtrl* ctrl, void * userData); + void onChangeEffectName(LLUICtrl* ctrl); /// prompts a user when overwriting an effect static bool saveAlertCallback(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 17a59ccb779c65b5e194b253cd0fc9eb07506d29..d0df2617b3a3fce6cc7859c9017663b8997f2bee 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -40,477 +40,953 @@ #include "llfloaterpreference.h" -#include "llbutton.h" -#include "llcheckboxctrl.h" -#include "lldir.h" -#include "llfocusmgr.h" -#include "llscrollbar.h" -#include "llspinctrl.h" #include "message.h" +#include "llagent.h" +#include "llavatarconstants.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" #include "llcommandhandler.h" +#include "lldirpicker.h" +#include "llfeaturemanager.h" +#include "llfocusmgr.h" +#include "llfirstuse.h" +#include "llfloaterreg.h" #include "llfloaterabout.h" -#include "llfloaterpreference.h" -#include "llpanelnetwork.h" -#include "llpanelaudioprefs.h" +#include "llfloaterhardwaresettings.h" +#include "llfloatervoicedevicesettings.h" +#include "llkeyboard.h" +#include "llmodaldialog.h" #include "llpaneldisplay.h" -#include "llpaneldebug.h" -#include "llpanelgeneral.h" -#include "llpanelinput.h" #include "llpanellogin.h" -#include "llpanelLCD.h" -#include "llpanelmsgs.h" -#include "llpanelweb.h" -#include "llpanelskins.h" -#include "llprefschat.h" -#include "llprefsvoice.h" -#include "llprefsim.h" -#include "llresizehandle.h" -#include "llresmgr.h" -#include "llassetstorage.h" -#include "llagent.h" +#include "llradiogroup.h" +#include "llstylemap.h" +#include "llscrolllistctrl.h" +#include "llscrolllistitem.h" +#include "llsliderctrl.h" +#include "lltabcontainer.h" +#include "lltexteditor.h" #include "llviewercontrol.h" -#include "llviewernetwork.h" -#include "lluictrlfactory.h" +#include "llviewercamera.h" #include "llviewerwindow.h" -#include "llkeyboard.h" -#include "llscrollcontainer.h" -#include "llfloaterhardwaresettings.h" -const S32 PREF_BORDER = 4; -const S32 PREF_PAD = 5; -const S32 PREF_BUTTON_WIDTH = 70; -const S32 PREF_CATEGORY_WIDTH = 150; - -const S32 PREF_FLOATER_MIN_HEIGHT = 2 * SCROLLBAR_SIZE + 2 * LLPANEL_BORDER_WIDTH + 96; - -LLFloaterPreference* LLFloaterPreference::sInstance = NULL; - - -class LLPreferencesHandler : public LLCommandHandler -{ -public: - // requires trusted browser - LLPreferencesHandler() : LLCommandHandler("preferences", true) { } - bool handle(const LLSD& tokens, const LLSD& query_map, - LLWebBrowserCtrl* web) +class LLVoiceSetKeyDialog : public LLModalDialog { - LLFloaterPreference::show(NULL); - return true; - } -}; - -LLPreferencesHandler gPreferencesHandler; - + public: + LLVoiceSetKeyDialog(LLFloaterPreference* parent); + ~LLVoiceSetKeyDialog(); + + BOOL handleKeyHere(KEY key, MASK mask); + static void onCancel(void* user_data); + + private: + LLFloaterPreference* mParent; + }; -// Must be done at run time, not compile time. JC -S32 pref_min_width() +LLVoiceSetKeyDialog::LLVoiceSetKeyDialog(LLFloaterPreference* parent) +: LLModalDialog(LLStringUtil::null, 240, 100), mParent(parent) { - return - 2 * PREF_BORDER + - 2 * PREF_BUTTON_WIDTH + - PREF_PAD + RESIZE_HANDLE_WIDTH + - PREF_CATEGORY_WIDTH + - PREF_PAD; + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_select_key.xml"); + childSetAction("Cancel", onCancel, this); + childSetFocus("Cancel"); + + gFocusMgr.setKeystrokesOnly(TRUE); } -S32 pref_min_height() +LLVoiceSetKeyDialog::~LLVoiceSetKeyDialog() { - return - 2 * PREF_BORDER + - 3*(BTN_HEIGHT + PREF_PAD) + - PREF_FLOATER_MIN_HEIGHT; } - -LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * default_btn) : - mTabContainer(tab_container), - mGeneralPanel(NULL), - mInputPanel(NULL), - mNetworkPanel(NULL), - mDisplayPanel(NULL), - mAudioPanel(NULL), - mMsgPanel(NULL), - mSkinsPanel(NULL), - mLCDPanel(NULL) +BOOL LLVoiceSetKeyDialog::handleKeyHere(KEY key, MASK mask) { - mGeneralPanel = new LLPanelGeneral(); - mTabContainer->addTabPanel(mGeneralPanel, mGeneralPanel->getLabel(), FALSE, onTabChanged, mTabContainer); - mGeneralPanel->setDefaultBtn(default_btn); + BOOL result = TRUE; + + if(key == 'Q' && mask == MASK_CONTROL) + { + result = FALSE; + } + else + { + mParent->setKey(key); + } + + closeFloater(); + return result; +} - mInputPanel = new LLPanelInput(); - mTabContainer->addTabPanel(mInputPanel, mInputPanel->getLabel(), FALSE, onTabChanged, mTabContainer); - mInputPanel->setDefaultBtn(default_btn); +//static +void LLVoiceSetKeyDialog::onCancel(void* user_data) +{ + LLVoiceSetKeyDialog* self = (LLVoiceSetKeyDialog*)user_data; + self->closeFloater(); +} - mNetworkPanel = new LLPanelNetwork(); - mTabContainer->addTabPanel(mNetworkPanel, mNetworkPanel->getLabel(), FALSE, onTabChanged, mTabContainer); - mNetworkPanel->setDefaultBtn(default_btn); - mWebPanel = new LLPanelWeb(); - mTabContainer->addTabPanel(mWebPanel, mWebPanel->getLabel(), FALSE, onTabChanged, mTabContainer); - mWebPanel->setDefaultBtn(default_btn); +// global functions - mDisplayPanel = new LLPanelDisplay(); - mTabContainer->addTabPanel(mDisplayPanel, mDisplayPanel->getLabel(), FALSE, onTabChanged, mTabContainer); - mDisplayPanel->setDefaultBtn(default_btn); +// helper functions for getting/freeing the web browser media +// if creating/destroying these is too slow, we'll need to create +// a static member and update all our static callbacks - mAudioPanel = new LLPanelAudioPrefs(); - mTabContainer->addTabPanel(mAudioPanel, mAudioPanel->getLabel(), FALSE, onTabChanged, mTabContainer); - mAudioPanel->setDefaultBtn(default_btn); +void free_web_media(LLMediaBase *media_source); +void handleHTMLLinkColorChanged(const LLSD& newvalue); +LLMediaBase *get_web_media(); +bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response); - mPrefsChat = new LLPrefsChat(); - mTabContainer->addTabPanel(mPrefsChat->getPanel(), mPrefsChat->getPanel()->getLabel(), FALSE, onTabChanged, mTabContainer); - mPrefsChat->getPanel()->setDefaultBtn(default_btn); +bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater); +bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater); - mPrefsVoice = new LLPrefsVoice(); - mTabContainer->addTabPanel(mPrefsVoice, mPrefsVoice->getLabel(), FALSE, onTabChanged, mTabContainer); - mPrefsVoice->setDefaultBtn(default_btn); +LLMediaBase *get_web_media() +{ + LLMediaBase *media_source; + LLMediaManager *mgr = LLMediaManager::getInstance(); + + if (!mgr) + { + llwarns << "cannot get media manager" << llendl; + return NULL; + } + + media_source = mgr->createSourceFromMimeType("http", "text/html" ); + if ( !media_source ) + { + llwarns << "media source create failed " << llendl; + return NULL; + } + + return media_source; +} - mPrefsIM = new LLPrefsIM(); - mTabContainer->addTabPanel(mPrefsIM->getPanel(), mPrefsIM->getPanel()->getLabel(), FALSE, onTabChanged, mTabContainer); - mPrefsIM->getPanel()->setDefaultBtn(default_btn); +void free_web_media(LLMediaBase *media_source) +{ + if (!media_source) + return; + + LLMediaManager *mgr = LLMediaManager::getInstance(); + if (!mgr) + { + llwarns << "cannot get media manager" << llendl; + return; + } + + mgr->destroySource(media_source); +} -#if LL_LCD_COMPILE - // only add this option if we actually have a logitech keyboard / speaker set - if (gLcdScreen->Enabled()) +bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + if ( option == 0 ) // YES { - mLCDPanel = new LLPanelLCD(); - mTabContainer->addTabPanel(mLCDPanel, mLCDPanel->getLabel(), FALSE, onTabChanged, mTabContainer); - mLCDPanel->setDefaultBtn(default_btn); + LLMediaBase *media_source = get_web_media(); + if (media_source) + media_source->clearCache(); + free_web_media(media_source); } + return false; +} -#else - mLCDPanel = NULL; -#endif - - mMsgPanel = new LLPanelMsgs(); - mTabContainer->addTabPanel(mMsgPanel, mMsgPanel->getLabel(), FALSE, onTabChanged, mTabContainer); - mMsgPanel->setDefaultBtn(default_btn); +void handleHTMLLinkColorChanged(const LLSD& newvalue) +{ + LLTextEditor::setLinkColor(LLColor4(newvalue)); + LLStyleMap::instance().update(); - mSkinsPanel = new LLPanelSkins(); - mTabContainer->addTabPanel(mSkinsPanel, mSkinsPanel->getLabel(), FALSE, onTabChanged, mTabContainer); - mSkinsPanel->setDefaultBtn(default_btn); +} - if (!mTabContainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) +bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + if (0 == option && floater ) { - mTabContainer->selectFirstTab(); + if ( floater ) + { + floater->setAllIgnored(); + LLFirstUse::disableFirstUse(); + LLFloaterPreference::buildLists(floater); + } } + return false; } -LLPreferenceCore::~LLPreferenceCore() +bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater) { - if (mGeneralPanel) + S32 option = LLNotification::getSelectedOption(notification, response); + if ( 0 == option && floater ) { - delete mGeneralPanel; - mGeneralPanel = NULL; + if ( floater ) + { + floater->resetAllIgnored(); + LLFirstUse::resetFirstUse(); + LLFloaterPreference::buildLists(floater); + } } - if (mInputPanel) + return false; +} + +// static +std::string LLFloaterPreference::sSkin = ""; +////////////////////////////////////////////// +// LLFloaterPreference + +LLFloaterPreference::LLFloaterPreference(const LLSD& key) + : LLFloater(key), + mGotPersonalInfo(false), + mOriginalIMViaEmail(false) +{ + //Build Floater is now Called from LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>); + + mFactoryMap["display"] = LLCallbackMap((LLCallbackMap::callback_t)LLCallbackMap::buildPanel<LLPanelDisplay>); /// done fixing the callbacks + + + mCommitCallbackRegistrar.add("Pref.Apply", boost::bind(&LLFloaterPreference::onBtnApply, this)); + mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreference::onBtnCancel, this)); + mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreference::onBtnOK, this)); + + mCommitCallbackRegistrar.add("Pref.ClearCache", boost::bind(&LLFloaterPreference::onClickClearCache, (void*)NULL)); + mCommitCallbackRegistrar.add("Pref.WebClearCache", boost::bind(&LLFloaterPreference::onClickBrowserClearCache, (void*)NULL)); + mCommitCallbackRegistrar.add("Pref.SetCache", boost::bind(&LLFloaterPreference::onClickSetCache, this)); + mCommitCallbackRegistrar.add("Pref.ResetCache", boost::bind(&LLFloaterPreference::onClickResetCache, this)); + mCommitCallbackRegistrar.add("Pref.ClickSkin", boost::bind(&LLFloaterPreference::onClickSkin, this,_1, _2)); + mCommitCallbackRegistrar.add("Pref.SelectSkin", boost::bind(&LLFloaterPreference::onSelectSkin, this)); + mCommitCallbackRegistrar.add("Pref.VoiceSetKey", boost::bind(&LLFloaterPreference::onClickSetKey, this)); + mCommitCallbackRegistrar.add("Pref.VoiceSetMiddleMouse", boost::bind(&LLFloaterPreference::onClickSetMiddleMouse, this)); + mCommitCallbackRegistrar.add("Pref.ClickSkipDialogs", boost::bind(&LLFloaterPreference::onClickSkipDialogs, this)); + mCommitCallbackRegistrar.add("Pref.ClickResetDialogs", boost::bind(&LLFloaterPreference::onClickResetDialogs, this)); + mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", boost::bind(&LLFloaterPreference::onClickEnablePopup, this)); + mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); + mCommitCallbackRegistrar.add("Pref.Logging", boost::bind(&LLFloaterPreference::onCommitLogging, this)); + mCommitCallbackRegistrar.add("Pref.OpenHelp", boost::bind(&LLFloaterPreference::onOpenHelp, this)); + mCommitCallbackRegistrar.add("Pref.ChangeCustom", boost::bind(&LLFloaterPreference::onChangeCustom, this)); + mCommitCallbackRegistrar.add("Pref.UpdateMeterText", boost::bind(&LLFloaterPreference::updateMeterText, this, _1)); + mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this)); + mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); + mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); + gSavedSkinSettings.getControl("HTMLLinkColor")->getCommitSignal()->connect(boost::bind(&handleHTMLLinkColorChanged, _2)); + //gSavedSettings.getControl("UseExternalBrowser")->getCommitSignal()->connect(boost::bind(&LLPanelPreference::handleUseExternalBrowserChanged, this)); + +} + +BOOL LLFloaterPreference::postBuild() +{ + LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); + if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) + tabcontainer->selectFirstTab(); + + + return TRUE; +} + +LLFloaterPreference::~LLFloaterPreference() +{ +} +void LLFloaterPreference::draw() +{ + BOOL has_first_selected = (getChildRef<LLScrollListCtrl>("disabled_popups").getFirstSelected()!=NULL); + gSavedSettings.setBOOL("FirstSelectedDisabledPopups", has_first_selected); + + + LLFloater::draw(); +} + +void LLFloaterPreference::apply() +{ + LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); + if (sSkin != gSavedSettings.getString("SkinCurrent")) { - delete mInputPanel; - mInputPanel = NULL; + LLNotifications::instance().add("ChangeSkin"); + refreshSkin(this); } - if (mNetworkPanel) + // Call apply() on all panels that derive from LLPanelPreference + for (child_list_t::const_iterator iter = tabcontainer->getChildList()->begin(); + iter != tabcontainer->getChildList()->end(); ++iter) { - delete mNetworkPanel; - mNetworkPanel = NULL; + LLView* view = *iter; + LLPanelPreference* panel = dynamic_cast<LLPanelPreference*>(view); + if (panel) + panel->apply(); } - if (mDisplayPanel) + // hardware menu apply + LLFloaterHardwareSettings::instance()->apply(); + + LLFloaterVoiceDeviceSettings* voice_device_settings = LLFloaterReg::findTypedInstance<LLFloaterVoiceDeviceSettings>("pref_voicedevicesettings"); + if(voice_device_settings) { - delete mDisplayPanel; - mDisplayPanel = NULL; + voice_device_settings->apply(); } + + gViewerWindow->requestResolutionUpdate(); // for UIScaleFactor - if (mAudioPanel) + LLSliderCtrl* fov_slider = getChild<LLSliderCtrl>("camera_fov"); + fov_slider->setMinValue(LLViewerCamera::getInstance()->getMinView()); + fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView()); + + std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); + childSetText("cache_location", cache_location); + + LLMediaBase *media_source = get_web_media(); + if (media_source) { - delete mAudioPanel; - mAudioPanel = NULL; + media_source->enableCookies(childGetValue("cookies_enabled")); + if(hasChild("web_proxy_enabled") &&hasChild("web_proxy_editor") && hasChild("web_proxy_port")) + { + bool proxy_enable = childGetValue("web_proxy_enabled"); + std::string proxy_address = childGetValue("web_proxy_editor"); + + int proxy_port = childGetValue("web_proxy_port"); + media_source->enableProxy(proxy_enable, proxy_address, proxy_port); + } } - if (mPrefsChat) + free_web_media(media_source); + + LLTextEditor* busy = getChild<LLTextEditor>("busy_response"); + LLWString busy_response; + if (busy) busy_response = busy->getWText(); + LLWStringUtil::replaceTabsWithSpaces(busy_response, 4); + + if(mGotPersonalInfo) + { + gSavedPerAccountSettings.setString("BusyModeResponse2", std::string(wstring_to_utf8str(busy_response))); + bool new_im_via_email = childGetValue("send_im_to_email").asBoolean(); + bool new_hide_online = childGetValue("online_visibility").asBoolean(); + + if((new_im_via_email != mOriginalIMViaEmail) + ||(new_hide_online != mOriginalHideOnlineStatus)) + { + // This hack is because we are representing several different + // possible strings with a single checkbox. Since most users + // can only select between 2 values, we represent it as a + // checkbox. This breaks down a little bit for liaisons, but + // works out in the end. + if(new_hide_online != mOriginalHideOnlineStatus) + { + if(new_hide_online) mDirectoryVisibility = VISIBILITY_HIDDEN; + else mDirectoryVisibility = VISIBILITY_DEFAULT; + //Update showonline value, otherwise multiple applys won't work + mOriginalHideOnlineStatus = new_hide_online; + } + gAgent.sendAgentUpdateUserInfo(new_im_via_email,mDirectoryVisibility); + } + } + +} + +void LLFloaterPreference::cancel() +{ + LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); + // Call cancel() on all panels that derive from LLPanelPreference + for (child_list_t::const_iterator iter = tabcontainer->getChildList()->begin(); + iter != tabcontainer->getChildList()->end(); ++iter) { - delete mPrefsChat; - mPrefsChat = NULL; + LLView* view = *iter; + LLPanelPreference* panel = dynamic_cast<LLPanelPreference*>(view); + if (panel) + panel->cancel(); } - if (mPrefsIM) + // hide joystick pref floater + LLFloaterReg::hideInstance("pref_joystick"); + + // cancel hardware menu + LLFloaterHardwareSettings::instance()->cancel(); // TODO: angela change the build of the floater to floater reg + + // reverts any changes to current skin + gSavedSettings.setString("SkinCurrent", sSkin); + + LLFloaterVoiceDeviceSettings* voice_device_settings = LLFloaterReg::findTypedInstance<LLFloaterVoiceDeviceSettings>("pref_voicedevicesettings"); + if (voice_device_settings) { - delete mPrefsIM; - mPrefsIM = NULL; + voice_device_settings ->cancel(); } - if (mMsgPanel) + LLFloaterReg::hideInstance("pref_voicedevicesettings"); +} + +void LLFloaterPreference::onOpen(const LLSD& key) +{ + gAgent.sendAgentUserInfoRequest(); + LLPanelLogin::setAlwaysRefresh(true); +} + +void LLFloaterPreference::onVertexShaderEnable() +{ + refreshEnabledGraphics(); +} + +void LLFloaterPreference::setHardwareDefaults() +{ + LLFeatureManager::getInstance()->applyRecommendedSettings(); + refreshEnabledGraphics(); +} +void LLFloaterPreference::onClose(bool app_quitting) +{ + gSavedSettings.setS32("LastPrefTab", getChild<LLTabContainer>("pref core")->getCurrentPanelIndex()); + LLPanelLogin::setAlwaysRefresh(false); + cancel(); // will be a no-op if OK or apply was performed just prior. + destroy(); +} +void LLFloaterPreference::onOpenHardwareSettings() +{ + LLFloaterHardwareSettings::show(); +} +// static +void LLFloaterPreference::onBtnOK() +{ + // commit any outstanding text entry + if (hasFocus()) { - delete mMsgPanel; - mMsgPanel = NULL; + LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); + if (cur_focus->acceptsTextInput()) + { + cur_focus->onCommit(); + } } - if (mWebPanel) + + if (canClose()) { - delete mWebPanel; - mWebPanel = NULL; + apply(); + closeFloater(false); + gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); + gSavedSkinSettings.saveToFile(gSavedSettings.getString("SkinningSettingsFile") , TRUE ); + std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); + // save all settings, even if equals defaults + gCrashSettings.saveToFile(crash_settings_filename, FALSE); } - if (mSkinsPanel) + else { - delete mSkinsPanel; - mSkinsPanel = NULL; + // Show beep, pop up dialog, etc. + llinfos << "Can't close preferences!" << llendl; } + LLPanelLogin::refreshLocation( false ); } +void LLFloaterPreference::onOpenHelp() +{ + const char* xml_alert = "GraphicsPreferencesHelp"; + LLNotifications::instance().add(this->contextualNotification(xml_alert)); +} -void LLPreferenceCore::apply() +// static +void LLFloaterPreference::onBtnApply( ) { - mGeneralPanel->apply(); - mInputPanel->apply(); - mNetworkPanel->apply(); - mDisplayPanel->apply(); - mAudioPanel->apply(); - mPrefsChat->apply(); - mPrefsVoice->apply(); - mPrefsIM->apply(); - mMsgPanel->apply(); - mSkinsPanel->apply(); + if (hasFocus()) + { + LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); + if (cur_focus->acceptsTextInput()) + { + cur_focus->onCommit(); + } + } + apply(); - // hardware menu apply - LLFloaterHardwareSettings::instance()->apply(); + LLPanelLogin::refreshLocation( false ); +} - mWebPanel->apply(); -#if LL_LCD_COMPILE - // only add this option if we actually have a logitech keyboard / speaker set - if (gLcdScreen->Enabled()) +// static +void LLFloaterPreference::onBtnCancel() +{ + if (hasFocus()) { - mLCDPanel->apply(); + LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); + if (cur_focus->acceptsTextInput()) + { + cur_focus->onCommit(); + } } -#endif -// mWebPanel->apply(); + closeFloater(); // side effect will also cancel any unsaved changes. } - -void LLPreferenceCore::cancel() +// static +void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_via_email, const std::string& email) { - mGeneralPanel->cancel(); - mInputPanel->cancel(); - mNetworkPanel->cancel(); - mDisplayPanel->cancel(); - mAudioPanel->cancel(); - mPrefsChat->cancel(); - mPrefsVoice->cancel(); - mPrefsIM->cancel(); - mMsgPanel->cancel(); - mSkinsPanel->cancel(); - - // cancel hardware menu - LLFloaterHardwareSettings::instance()->cancel(); - - mWebPanel->cancel(); -#if LL_LCD_COMPILE - // only add this option if we actually have a logitech keyboard / speaker set - if (gLcdScreen->Enabled()) + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences"); + if(instance) { - mLCDPanel->cancel(); + instance->setPersonalInfo(visibility, im_via_email, email); } -#endif -// mWebPanel->cancel(); } -// static -void LLPreferenceCore::onTabChanged(void* user_data, bool from_click) + +void LLFloaterPreference::onChangeCustom() { - LLTabContainer* self = (LLTabContainer*)user_data; + // if custom is turned off, reset everything to defaults + if (this && getChild<LLCheckBoxCtrl>("CustomSettings")->getValue()) + { + U32 set = (U32)getChild<LLSliderCtrl>("QualityPerformanceSelection")->getValueF32(); + LLFeatureManager::getInstance()->setGraphicsLevel(set, true); + updateMeterText(getChild<LLSliderCtrl>("DrawDistance")); + } - gSavedSettings.setS32("LastPrefTab", self->getCurrentPanelIndex()); + refreshEnabledGraphics(); +} +////////////////////////////////////////////////////////////////////////// +// static Note:(angela) NOT touching LLPanelDisplay for this milestone (skinning-11) +void LLFloaterPreference::refreshEnabledGraphics() +{ + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences"); + if(instance) + { + LLFloaterHardwareSettings::instance()->refreshEnabledState(); + + LLTabContainer* tabcontainer = instance->getChild<LLTabContainer>("pref core"); + for (child_list_t::const_iterator iter = tabcontainer->getChildList()->begin(); + iter != tabcontainer->getChildList()->end(); ++iter) + { + LLView* view = *iter; + if(!view) + return; + if(view->getName()=="display") + { + LLPanelDisplay* display_panel = dynamic_cast<LLPanelDisplay*>(view); + if(!display_panel) + return; + display_panel->refreshEnabledState(); + } + } + } } +void LLFloaterPreference::updateMeterText(LLUICtrl* ctrl) +{ + // get our UI widgets + LLSliderCtrl* slider = (LLSliderCtrl*) ctrl; + LLTextBox* m1 = getChild<LLTextBox>("DrawDistanceMeterText1"); + LLTextBox* m2 = getChild<LLTextBox>("DrawDistanceMeterText2"); -void LLPreferenceCore::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) -{ - mPrefsIM->setPersonalInfo(visibility, im_via_email, email); + // toggle the two text boxes based on whether we have 1 or two digits + F32 val = slider->getValueF32(); + bool two_digits = val < 100; + m1->setVisible(two_digits); + m2->setVisible(!two_digits); } -void LLPreferenceCore::refreshEnabledGraphics() +// static +void LLFloaterPreference::onClickClearCache(void*) { - LLFloaterHardwareSettings::instance()->refreshEnabledState(); - mDisplayPanel->refreshEnabledState(); + // flag client cache for clearing next time the client runs + gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE); + LLNotifications::instance().add("CacheWillClear"); } -////////////////////////////////////////////// -// LLFloaterPreference - -LLFloaterPreference::LLFloaterPreference() +// static +void LLFloaterPreference::onClickBrowserClearCache(void*) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preferences.xml"); + LLNotifications::instance().add("ConfirmClearBrowserCache", LLSD(), LLSD(), callback_clear_browser_cache); } -BOOL LLFloaterPreference::postBuild() +void LLFloaterPreference::onClickSetCache() { - requires<LLButton>("About..."); - requires<LLButton>("OK"); - requires<LLButton>("Cancel"); - requires<LLButton>("Apply"); - requires<LLTabContainer>("pref core"); + std::string cur_name(gSavedSettings.getString("CacheLocation")); + std::string proposed_name(cur_name); - if (!checkRequirements()) + LLDirPicker& picker = LLDirPicker::instance(); + if (! picker.getDir(&proposed_name ) ) { - return FALSE; + return; //Canceled! } - mAboutBtn = getChild<LLButton>("About..."); - mAboutBtn->setClickedCallback(onClickAbout, this); - - mApplyBtn = getChild<LLButton>("Apply"); - mApplyBtn->setClickedCallback(onBtnApply, this); - - mCancelBtn = getChild<LLButton>("Cancel"); - mCancelBtn->setClickedCallback(onBtnCancel, this); - - mOKBtn = getChild<LLButton>("OK"); - mOKBtn->setClickedCallback(onBtnOK, this); - - mPreferenceCore = new LLPreferenceCore( - getChild<LLTabContainer>("pref core"), - getChild<LLButton>("OK") - ); - - sInstance = this; - - return TRUE; + std::string dir_name = picker.getDirName(); + if (!dir_name.empty() && dir_name != cur_name) + { + childSetText("cache_location", dir_name); + LLNotifications::instance().add("CacheWillBeMoved"); + gSavedSettings.setString("NewCacheLocation", dir_name); + } + else + { + std::string cache_location = gDirUtilp->getCacheDir(); + childSetText("cache_location", cache_location); + } } - -LLFloaterPreference::~LLFloaterPreference() +void LLFloaterPreference::onClickResetCache() { - sInstance = NULL; - delete mPreferenceCore; + if (!gSavedSettings.getString("CacheLocation").empty()) + { + gSavedSettings.setString("NewCacheLocation", ""); + LLNotifications::instance().add("CacheWillBeMoved"); + } + std::string cache_location = gDirUtilp->getCacheDir(true); + childSetText("cache_location", cache_location); } -void LLFloaterPreference::apply() +void LLFloaterPreference::onClickSkin(LLUICtrl* ctrl, const LLSD& userdata) { - this->mPreferenceCore->apply(); + gSavedSettings.setString("SkinCurrent", userdata.asString()); + ctrl->setValue(userdata.asString()); } - -void LLFloaterPreference::cancel() +void LLFloaterPreference::onSelectSkin() { - this->mPreferenceCore->cancel(); + std::string skin_selection = getChild<LLRadioGroup>("skin_selection")->getValue().asString(); + gSavedSettings.setString("SkinCurrent", skin_selection); } +void LLFloaterPreference::refreshSkin(void* data) +{ + LLPanel*self = (LLPanel*)data; + sSkin = gSavedSettings.getString("SkinCurrent"); + self->getChild<LLRadioGroup>("skin_selection", true)->setValue(sSkin); +} // static -void LLFloaterPreference::show(void*) +void LLFloaterPreference::buildLists(void* data) { - if (!sInstance) + LLPanel*self = (LLPanel*)data; + LLScrollListCtrl& disabled_popups = self->getChildRef<LLScrollListCtrl>("disabled_popups"); + LLScrollListCtrl& enabled_popups = self->getChildRef<LLScrollListCtrl>("enabled_popups"); + + disabled_popups.deleteAllItems(); + enabled_popups.deleteAllItems(); + + for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin(); + iter != LLNotifications::instance().templatesEnd(); + ++iter) { - new LLFloaterPreference(); - sInstance->center(); + LLNotificationTemplatePtr templatep = iter->second; + LLNotificationFormPtr formp = templatep->mForm; + + LLNotificationForm::EIgnoreType ignore = formp->getIgnoreType(); + if (ignore == LLNotificationForm::IGNORE_NO) + continue; + + LLSD row; + row["columns"][0]["value"] = formp->getIgnoreMessage(); + row["columns"][0]["font"] = "SANSSERIF_SMALL"; + row["columns"][0]["width"] = 400; + + LLScrollListItem* item = NULL; + + bool show_popup = LLUI::sSettingGroups["ignores"]->getBOOL(templatep->mName); + if (!show_popup) + { + if (ignore == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE) + { + LLSD last_response = LLUI::sSettingGroups["config"]->getLLSD("Default" + templatep->mName); + if (!last_response.isUndefined()) + { + for (LLSD::map_const_iterator it = last_response.beginMap(); + it != last_response.endMap(); + ++it) + { + if (it->second.asBoolean()) + { + row["columns"][1]["value"] = formp->getElement(it->first)["ignore"].asString(); + break; + } + } + } + row["columns"][1]["font"] = "SANSSERIF_SMALL"; + row["columns"][1]["width"] = 360; + } + item = disabled_popups.addElement(row, + ADD_SORTED); + } + else + { + item = enabled_popups.addElement(row, + ADD_SORTED); + } + + if (item) + { + item->setUserdata((void*)&iter->first); + } } +} - sInstance->open(); /* Flawfinder: ignore */ - - if(!gAgent.getID().isNull()) +// static +// DEV-24146 - needs to be removed at a later date. jan-2009 +void LLFloaterPreference::cleanupBadSetting() +{ + if (gSavedPerAccountSettings.getString("BusyModeResponse2") == "|TOKEN COPY BusyModeResponse|") { - // we're logged in, so we can get this info. - gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gAgent.sendReliableMessage(); + llwarns << "cleaning old BusyModeResponse" << llendl; + gSavedPerAccountSettings.setString("BusyModeResponse2", gSavedPerAccountSettings.getText("BusyModeResponse")); } +} - LLPanelLogin::setAlwaysRefresh(true); +void LLFloaterPreference::onClickSetKey() +{ + LLVoiceSetKeyDialog* dialog = new LLVoiceSetKeyDialog(this); + dialog->startModal(); } +void LLFloaterPreference::setKey(KEY key) +{ + childSetValue("modifier_combo", LLKeyboard::stringFromKey(key)); +} -// static -void LLFloaterPreference::onClickAbout(void*) +void LLFloaterPreference::onClickSetMiddleMouse() { - LLFloaterAbout::show(NULL); + childSetValue("modifier_combo", "MiddleMouse"); } +void LLFloaterPreference::onClickSkipDialogs() +{ + LLNotifications::instance().add("SkipShowNextTimeDialogs", LLSD(), LLSD(), boost::bind(&callback_skip_dialogs, _1, _2, this)); +} -// static -void LLFloaterPreference::onBtnOK( void* userdata ) +void LLFloaterPreference::onClickResetDialogs() { - LLFloaterPreference *fp =(LLFloaterPreference *)userdata; - // commit any outstanding text entry - if (fp->hasFocus()) + LLNotifications::instance().add("ResetShowNextTimeDialogs", LLSD(), LLSD(), boost::bind(&callback_reset_dialogs, _1, _2, this)); +} + +void LLFloaterPreference::onClickEnablePopup() +{ + LLScrollListCtrl& disabled_popups = getChildRef<LLScrollListCtrl>("disabled_popups"); + + std::vector<LLScrollListItem*> items = disabled_popups.getAllSelected(); + std::vector<LLScrollListItem*>::iterator itor; + for (itor = items.begin(); itor != items.end(); ++itor) { - LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); - if (cur_focus->acceptsTextInput()) + LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate(*(std::string*)((*itor)->getUserdata())); + //gSavedSettings.setWarning(templatep->mName, TRUE); + std::string notification_name = templatep->mName; + LLUI::sSettingGroups["ignores"]->setBOOL(notification_name, TRUE); + } + + buildLists(this); +} + +void LLFloaterPreference::resetAllIgnored() +{ + for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin(); + iter != LLNotifications::instance().templatesEnd(); + ++iter) + { + if (iter->second->mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO) { - cur_focus->onCommit(); + LLUI::sSettingGroups["ignores"]->setBOOL(iter->first, TRUE); + } + } +} + +void LLFloaterPreference::setAllIgnored() +{ + for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin(); + iter != LLNotifications::instance().templatesEnd(); + ++iter) + { + if (iter->second->mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO) + { + LLUI::sSettingGroups["ignores"]->setBOOL(iter->first, FALSE); } } +} - if (fp->canClose()) +void LLFloaterPreference::onClickLogPath() +{ + std::string proposed_name(childGetText("log_path_string")); + + LLDirPicker& picker = LLDirPicker::instance(); + if (!picker.getDir(&proposed_name ) ) { - fp->apply(); - fp->close(false); + return; //Canceled! + } + + childSetText("log_path_string", picker.getDirName()); +} - gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); - - std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); - // save all settings, even if equals defaults - gCrashSettings.saveToFile(crash_settings_filename, FALSE); +void LLFloaterPreference::onCommitLogging() +{ + enableHistory(); +} +void LLFloaterPreference::enableHistory() +{ + + if (childGetValue("log_instant_messages").asBoolean() || childGetValue("log_chat").asBoolean()) + { + childEnable("log_show_history"); + childEnable("log_path_button"); } else { - // Show beep, pop up dialog, etc. - llinfos << "Can't close preferences!" << llendl; + childDisable("log_show_history"); + childDisable("log_path_button"); } - - LLPanelLogin::refreshLocation( false ); } - -// static -void LLFloaterPreference::onBtnApply( void* userdata ) +void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) { - LLFloaterPreference *fp =(LLFloaterPreference *)userdata; - if (fp->hasFocus()) + mGotPersonalInfo = true; + mOriginalIMViaEmail = im_via_email; + mDirectoryVisibility = visibility; + + if(visibility == VISIBILITY_DEFAULT) { - LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); - if (cur_focus->acceptsTextInput()) - { - cur_focus->onCommit(); - } + mOriginalHideOnlineStatus = false; + childEnable("online_visibility"); + } + else if(visibility == VISIBILITY_HIDDEN) + { + mOriginalHideOnlineStatus = true; + childEnable("online_visibility"); } - fp->apply(); + else + { + mOriginalHideOnlineStatus = true; + } + + childEnable("include_im_in_chat_history"); + childEnable("show_timestamps_check_im"); + childEnable("friends_online_notify_checkbox"); + + childSetValue("online_visibility", mOriginalHideOnlineStatus); + childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility); + childEnable("send_im_to_email"); + childSetValue("send_im_to_email", im_via_email); + childEnable("log_instant_messages"); + childEnable("log_chat"); + childEnable("busy_response"); + childEnable("log_instant_messages_timestamp"); + childEnable("log_chat_timestamp"); + childEnable("log_chat_IM"); + childEnable("log_date_timestamp"); + + childSetText("busy_response", gSavedPerAccountSettings.getString("BusyModeResponse2")); + + enableHistory(); + std::string display_email(email); + childSetText("email_address",display_email); - LLPanelLogin::refreshLocation( false ); } -void LLFloaterPreference::onClose(bool app_quitting) +//---------------------------------------------------------------------------- +static LLRegisterPanelClassWrapper<LLPanelPreference> t_places("panel_preference"); +LLPanelPreference::LLPanelPreference() +: LLPanel() { - LLPanelLogin::setAlwaysRefresh(false); - cancel(); // will be a no-op if OK or apply was performed just prior. - LLFloater::onClose(app_quitting); + // + mCommitCallbackRegistrar.add("setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2)); + } +//virtual +BOOL LLPanelPreference::postBuild() +{ + if (hasChild("maturity_desired_combobox")) + { + /////////////////////////// From LLPanelGeneral ////////////////////////// + // if we have no agent, we can't let them choose anything + // if we have an agent, then we only let them choose if they have a choice + bool canChoose = gAgent.getID().notNull() && + (gAgent.isMature() || gAgent.isGodlike()); -// static -void LLFloaterPreference::onBtnCancel( void* userdata ) -{ - LLFloaterPreference *fp =(LLFloaterPreference *)userdata; - if (fp->hasFocus()) + if (canChoose) + { + + // if they're not adult or a god, they shouldn't see the adult selection, so delete it + if (!gAgent.isAdult() && !gAgent.isGodlike()) + { + LLComboBox* pMaturityCombo = getChild<LLComboBox>("maturity_desired_combobox"); + // we're going to remove the adult entry from the combo. This obviously depends + // on the order of items in the XML file, but there doesn't seem to be a reasonable + // way to depend on the field in XML called 'name'. + pMaturityCombo->remove(0); + } + childSetVisible("maturity_desired_combobox", true); + childSetVisible("maturity_desired_textbox", false); + } + else + { + childSetVisible("maturity_desired_combobox", false); + std::string selectedItemLabel = getChild<LLComboBox>("maturity_desired_combobox")->getSelectedItemLabel(); + childSetValue("maturity_desired_textbox", selectedItemLabel); + childSetVisible("maturity_desired_textbox", true); + } + } + ////////////////////// PanelVoice /////////////////// + if(hasChild("voice_unavailable")) { - LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); - if (cur_focus->acceptsTextInput()) + BOOL voice_disabled = gSavedSettings.getBOOL("CmdLineDisableVoice"); + childSetVisible("voice_unavailable", voice_disabled); + childSetVisible("enable_voice_check", !voice_disabled); + } + + //////////////////////PanelSkins /////////////////// + + if (hasChild("skin_selection")) + { + LLFloaterPreference::refreshSkin(this); + + // if skin is set to a skin that no longer exists (silver) set back to default + if (getChild<LLRadioGroup>("skin_selection")->getSelectedIndex() < 0) { - cur_focus->onCommit(); + gSavedSettings.setString("SkinCurrent", "default"); + LLFloaterPreference::refreshSkin(this); } + } - fp->close(); // side effect will also cancel any unsaved changes. + ////////////////////////Panel Popups///////////////// + if(hasChild("disabled_popups") && hasChild("enabled_popups")) + { + LLFloaterPreference::buildLists(this); + } + ////// + if(hasChild("online_visibility") && hasChild("send_im_to_email")) + { + requires("online_visibility"); + requires("send_im_to_email"); + if (!checkRequirements()) + { + return FALSE; + } + childSetText("email_address",getString("log_in_to_change") ); + childSetText("busy_response", getString("log_in_to_change")); + + } + apply(); + return true; } +void LLPanelPreference::apply() +{ + // Save the value of all controls in the hierarchy + mSavedValues.clear(); + std::list<LLView*> view_stack; + view_stack.push_back(this); + while(!view_stack.empty()) + { + // Process view on top of the stack + LLView* curview = view_stack.front(); + view_stack.pop_front(); + LLUICtrl* ctrl = dynamic_cast<LLUICtrl*>(curview); + if (ctrl) + { + LLControlVariable* control = ctrl->getControlVariable(); + if (control) + { + mSavedValues[control] = control->getValue(); + } + } + + // Push children onto the end of the work stack + for (child_list_t::const_iterator iter = curview->getChildList()->begin(); + iter != curview->getChildList()->end(); ++iter) + { + view_stack.push_back(*iter); + } + } + +} -// static -void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_via_email, const std::string& email) +void LLPanelPreference::cancel() { - if(sInstance && sInstance->mPreferenceCore) + for (control_values_map_t::iterator iter = mSavedValues.begin(); + iter != mSavedValues.end(); ++iter) { - sInstance->mPreferenceCore->setPersonalInfo(visibility, im_via_email, email); + LLControlVariable* control = iter->first; + LLSD ctrl_value = iter->second; + control->set(ctrl_value); } } -void LLFloaterPreference::refreshEnabledGraphics() +void LLPanelPreference::setControlFalse(const LLSD& user_data) { - sInstance->mPreferenceCore->refreshEnabledGraphics(); + std::string control_name = user_data.asString(); + LLControlVariable* control = findControl(control_name); + + if (control) + control->set(LLSD(FALSE)); } + diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index f48696ffdbff3887b43cf72a6cebba46518bfb33..000bff4dea80596e6286a6ea4bfaac3e5dc53a87 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -40,94 +40,99 @@ #define LL_LLFLOATERPREFERENCE_H #include "llfloater.h" -#include "lltabcontainervertical.h" -class LLPanelGeneral; -class LLPanelInput; +class LLPanelPreference; class LLPanelLCD; class LLPanelDisplay; -class LLPanelAudioPrefs; class LLPanelDebug; -class LLPanelNetwork; -class LLPanelWeb; class LLMessageSystem; -class LLPrefsChat; -class LLPrefsVoice; -class LLPrefsIM; -class LLPanelMsgs; -class LLPanelSkins; class LLScrollListCtrl; -class LLPreferenceCore -{ - -public: - LLPreferenceCore(LLTabContainer* tab_container, LLButton * default_btn); - ~LLPreferenceCore(); - - void apply(); - void cancel(); - - LLTabContainer* getTabContainer() { return mTabContainer; } - - void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email); - - static void onTabChanged(void* user_data, bool from_click); - - // refresh all the graphics preferences menus - void refreshEnabledGraphics(); - -private: - LLTabContainer *mTabContainer; - LLPanelGeneral *mGeneralPanel; - LLPanelSkins *mSkinsPanel; - LLPanelInput *mInputPanel; - LLPanelNetwork *mNetworkPanel; - LLPanelDisplay *mDisplayPanel; - LLPanelAudioPrefs *mAudioPanel; -// LLPanelDebug *mDebugPanel; - LLPrefsChat *mPrefsChat; - LLPrefsVoice *mPrefsVoice; - LLPrefsIM *mPrefsIM; - LLPanelWeb *mWebPanel; - LLPanelMsgs *mMsgPanel; - LLPanelLCD *mLCDPanel; -}; +class LLSD; // Floater to control preferences (display, audio, bandwidth, general. class LLFloaterPreference : public LLFloater { public: - LLFloaterPreference(); + LLFloaterPreference(const LLSD& key); ~LLFloaterPreference(); void apply(); void cancel(); + /*virtual*/ void draw(); virtual BOOL postBuild(); - static void show(void*); + virtual void onOpen(const LLSD& key); + virtual void onClose(bool app_quitting); // static data update, called from message handler static void updateUserInfo(const std::string& visibility, bool im_via_email, const std::string& email); // refresh all the graphics preferences menus static void refreshEnabledGraphics(); - + protected: - LLPreferenceCore *mPreferenceCore; - - /*virtual*/ void onClose(bool app_quitting); + + void onBtnOK(); + void onBtnCancel(); + void onBtnApply(); + void onOpenHelp(); + + static void onClickClearCache(void*); + static void onClickBrowserClearCache(void*); + + // if the custom settings box is clicked + void onChangeCustom(); + void updateMeterText(LLUICtrl* ctrl); + void onOpenHardwareSettings(); + /// callback for defaults + void setHardwareDefaults(); + // callback for when client turns on shaders + void onVertexShaderEnable(); +public: - LLButton* mAboutBtn; - LLButton *mOKBtn; - LLButton *mCancelBtn; - LLButton *mApplyBtn; + void onClickSetCache(); + void onClickResetCache(); + void onClickSkin(LLUICtrl* ctrl,const LLSD& userdata); + void onSelectSkin(); + void onClickSetKey(); + void setKey(KEY key); + void onClickSetMiddleMouse(); + void onClickSkipDialogs(); + void onClickResetDialogs(); + void onClickEnablePopup(); + void resetAllIgnored(); + void setAllIgnored(); + void onClickLogPath(); + void enableHistory(); + void onCommitLogging(); + void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email); + + static void buildLists(void* data); + static void refreshSkin(void* data); + static void cleanupBadSetting(); + +private: + static std::string sSkin; + bool mGotPersonalInfo; + bool mOriginalIMViaEmail; + + bool mOriginalHideOnlineStatus; + std::string mDirectoryVisibility; - static void onClickAbout(void*); - static void onBtnOK(void*); - static void onBtnCancel(void*); - static void onBtnApply(void*); +}; - static LLFloaterPreference* sInstance; +class LLPanelPreference : public LLPanel +{ +public: + LLPanelPreference(); + /*virtual*/ BOOL postBuild(); + + 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; }; #endif // LL_LLPREFERENCEFLOATER_H diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index 406d940cf0fc1fa7503ae75efcaa5fcb64bc1e63..5a8afc227787fa1715035a91fbdfcf82b7a64e98 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -37,13 +37,14 @@ #include <functional> #include "llcachename.h" #include "lldbstrings.h" +#include "llfloaterreg.h" #include "llinventory.h" #include "llagent.h" #include "llbutton.h" #include "llcheckboxctrl.h" -#include "llfloateravatarinfo.h" #include "llfloatergroupinfo.h" +#include "llfriendactions.h" #include "llinventorymodel.h" #include "lllineeditor.h" #include "llradiogroup.h" @@ -51,11 +52,13 @@ #include "roles_constants.h" #include "llselectmgr.h" #include "lltextbox.h" +#include "lltrans.h" #include "lluiconstants.h" #include "llviewerinventory.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llviewercontrol.h" +#include "llviewerwindow.h" #include "lluictrlfactory.h" @@ -135,7 +138,13 @@ LLFloaterProperties* LLFloaterProperties::show(const LLUUID& item_id, } instance->refresh(); - instance->open(); /* Flawfinder: ignore */ + instance->openFloater(); + } + else + { + LLFloaterProperties* floater = new LLFloaterProperties(item_id, object_id); + // keep onscreen + gFloaterView->adjustToFitScreen(floater, FALSE); } return instance; } @@ -151,14 +160,14 @@ void LLFloaterProperties::dirtyAll() } // Default constructor -LLFloaterProperties::LLFloaterProperties(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_id, const LLUUID& object_id) : - LLFloater(name, rect, title), +LLFloaterProperties::LLFloaterProperties(const LLUUID& item_id, const LLUUID& object_id) + : LLFloater(), mItemID(item_id), mObjectID(object_id), mDirty(TRUE) { LLUICtrlFactory::getInstance()->buildFloater(this,"floater_inventory_item_properties.xml"); - + if (!sPropertiesObserver) { sPropertiesObserver = new LLPropertiesObserver; @@ -168,6 +177,28 @@ LLFloaterProperties::LLFloaterProperties(const std::string& name, const LLRect& // add the object to the static structure LLUUID key = mItemID ^ mObjectID; sInstances.insert(instance_map::value_type(key, this)); + +} + +// Destroys the object +LLFloaterProperties::~LLFloaterProperties() +{ + // clean up the static data. + instance_map::iterator it = sInstances.find(mItemID ^ mObjectID); + if(it != sInstances.end()) + { + sInstances.erase(it); + } + sPropertiesObserverCount--; + if (!sPropertiesObserverCount) + { + delete sPropertiesObserver; + sPropertiesObserver = NULL; + } +} +// virtual +BOOL LLFloaterProperties::postBuild() +{ // build the UI // item name & description childSetPrevalidate("LabelItemName",&LLLineEditor::prevalidatePrintableNotPipe); @@ -196,23 +227,8 @@ LLFloaterProperties::LLFloaterProperties(const std::string& name, const LLRect& childSetCommitCallback("EditPrice",&onCommitSaleInfo, this); // The UI has been built, now fill in all the values refresh(); -} -// Destroys the object -LLFloaterProperties::~LLFloaterProperties() -{ - // clean up the static data. - instance_map::iterator it = sInstances.find(mItemID ^ mObjectID); - if(it != sInstances.end()) - { - sInstances.erase(it); - } - sPropertiesObserverCount--; - if (!sPropertiesObserverCount) - { - delete sPropertiesObserver; - sPropertiesObserver = NULL; - } + return TRUE; } void LLFloaterProperties::refresh() @@ -372,8 +388,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) ////////////////// // ACQUIRE DATE // ////////////////// - - // *TODO: Localize / translate this + time_t time_utc = item->getCreationDate(); if (0 == time_utc) { @@ -381,7 +396,11 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) } else { - childSetText("LabelAcquiredDate", std::string(ctime(&time_utc)) ); + std::string timeStr = getString("acquiredDate"); + LLSD substitution; + substitution["datetime"] = (S32) time_utc; + LLStringUtil::format (timeStr, substitution); + childSetText ("LabelAcquiredDate", timeStr); } /////////////////////// @@ -586,7 +605,7 @@ void LLFloaterProperties::onClickCreator(void* data) if(!item) return; if(!item->getCreatorUUID().isNull()) { - LLFloaterAvatarInfo::showFromObject(item->getCreatorUUID()); + LLFriendActions::showProfile(item->getCreatorUUID()); } } @@ -603,10 +622,7 @@ void LLFloaterProperties::onClickOwner(void* data) } else { - if(!item->getPermissions().getOwner().isNull()) - { - LLFloaterAvatarInfo::showFromObject(item->getPermissions().getOwner()); - } + LLFriendActions::showProfile(item->getPermissions().getOwner()); } } @@ -938,7 +954,7 @@ void LLFloaterProperties::closeByID(const LLUUID& item_id, const LLUUID &object_ if (floaterp) { - floaterp->close(); + floaterp->closeFloater(); } } @@ -946,8 +962,24 @@ void LLFloaterProperties::closeByID(const LLUUID& item_id, const LLUUID &object_ /// LLMultiProperties ///---------------------------------------------------------------------------- -LLMultiProperties::LLMultiProperties(const LLRect &rect) : LLMultiFloater(std::string("Properties"), rect) +LLMultiProperties::LLMultiProperties() + : LLMultiFloater() { + // *TODO: There should be a .xml file for this + const LLRect& nextrect = LLFloaterReg::getFloaterRect("properties"); // place where the next properties should show up + if (nextrect.getWidth() > 0) + { + setRect(nextrect); + } + else + { + // start with a small rect in the top-left corner ; will get resized + LLRect rect; + rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeight(), 20, 20); + setRect(rect); + } + setTitle(LLTrans::getString("MultiPropertiesTitle")); + buildTabContainer(); } ///---------------------------------------------------------------------------- diff --git a/indra/newview/llfloaterproperties.h b/indra/newview/llfloaterproperties.h index 2f5d97d384ee0852717a54b9f322601ff1b02830..d0e5abefb8dcead17830368da4ed2b903f660024 100644 --- a/indra/newview/llfloaterproperties.h +++ b/indra/newview/llfloaterproperties.h @@ -34,7 +34,7 @@ #define LL_LLFLOATERPROPERTIES_H #include <map> -#include "llfloater.h" +#include "llmultifloater.h" #include "lliconctrl.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -54,16 +54,16 @@ class LLFloaterProperties : public LLFloater { public: static LLFloaterProperties* find(const LLUUID& item_id, - const LLUUID& object_id); + const LLUUID& object_id = LLUUID::null); static LLFloaterProperties* show(const LLUUID& item_id, - const LLUUID& object_id); + const LLUUID& object_id = LLUUID::null); static void dirtyAll(); static void closeByID(const LLUUID& item_id, const LLUUID& object_id); - LLFloaterProperties(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_id, const LLUUID& object_id); + LLFloaterProperties(const LLUUID& item_id, const LLUUID& object_id); virtual ~LLFloaterProperties(); - + /*virtual*/ BOOL postBuild(); // do everything necessary void dirty() { mDirty = TRUE; } void refresh(); @@ -104,7 +104,7 @@ protected: class LLMultiProperties : public LLMultiFloater { public: - LLMultiProperties(const LLRect& rect); + LLMultiProperties(); }; #endif // LL_LLFLOATERPROPERTIES_H diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 06c1b2c12b51a7edfd2af48285778cf80e93d399..57a3bf9445cba12c3df5a0fa2db1133521a7ae7a 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -64,6 +64,7 @@ #include "lllineeditor.h" #include "llalertdialog.h" #include "llnamelistctrl.h" +#include "llscrolllistitem.h" #include "llsliderctrl.h" #include "llspinctrl.h" #include "lltabcontainer.h" @@ -73,6 +74,7 @@ #include "lltrans.h" #include "llviewercontrol.h" #include "lluictrlfactory.h" +#include "llviewerinventory.h" #include "llviewerimage.h" #include "llviewerimagelist.h" #include "llviewerregion.h" @@ -80,6 +82,7 @@ #include "llviewertexteditor.h" #include "llviewerwindow.h" #include "llvlcomposition.h" +#include "lltrans.h" #define ELAR_ENABLED 0 // Enable when server support is implemented @@ -161,8 +164,9 @@ bool estate_dispatch_initialized = false; LLUUID LLFloaterRegionInfo::sRequestInvoice; LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) + : LLFloater() { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_info.xml", NULL, FALSE); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_info.xml", FALSE); } BOOL LLFloaterRegionInfo::postBuild() @@ -174,32 +178,32 @@ BOOL LLFloaterRegionInfo::postBuild() panel = new LLPanelRegionGeneralInfo; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_general.xml"); - mTab->addTabPanel(panel, panel->getLabel(), TRUE); + mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true)); panel = new LLPanelRegionDebugInfo; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_debug.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); + mTab->addTabPanel(panel); panel = new LLPanelRegionTextureInfo; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_texture.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); + mTab->addTabPanel(panel); panel = new LLPanelRegionTerrainInfo; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_terrain.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); + mTab->addTabPanel(panel); panel = new LLPanelEstateInfo; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_estate.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); + mTab->addTabPanel(panel); panel = new LLPanelEstateCovenant; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_covenant.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); + mTab->addTabPanel(panel); gMessageSystem->setHandlerFunc( "EstateOwnerMessage", @@ -212,22 +216,16 @@ LLFloaterRegionInfo::~LLFloaterRegionInfo() { } -void LLFloaterRegionInfo::onOpen() +void LLFloaterRegionInfo::onOpen(const LLSD& key) { - LLRect rect = gSavedSettings.getRect("FloaterRegionInfo"); - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - rect.translate(left,top); - refreshFromRegion(gAgent.getRegion()); requestRegionInfo(); - LLFloater::onOpen(); } // static void LLFloaterRegionInfo::requestRegionInfo() { - LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels"); + LLTabContainer* tab = getChild<LLTabContainer>("region_panels"); tab->getChild<LLPanel>("General")->setCtrlsEnabled(FALSE); tab->getChild<LLPanel>("Debug")->setCtrlsEnabled(FALSE); @@ -436,6 +434,11 @@ void LLFloaterRegionInfo::refresh() // LLPanelRegionInfo // +LLPanelRegionInfo::LLPanelRegionInfo() + : LLPanel() +{ +} + // static void LLPanelRegionInfo::onBtnSet(void* user_data) { @@ -719,7 +722,7 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L // static void LLPanelRegionGeneralInfo::onClickManageTelehub(void* data) { - LLFloaterRegionInfo::getInstance()->close(); + LLFloaterRegionInfo::getInstance()->closeFloater(); LLFloaterTelehub::show(); } @@ -1074,7 +1077,7 @@ BOOL LLPanelRegionTextureInfo::postBuild() initCtrl(buffer); } -// LLButton* btn = new LLButton("dump", LLRect(0, 20, 100, 0), "", onClickDump, this); +// LLButton* btn = ("dump", LLRect(0, 20, 100, 0), "", onClickDump, this); // btn->setFollows(FOLLOWS_TOP|FOLLOWS_LEFT); // addChild(btn); @@ -1363,9 +1366,10 @@ void LLPanelRegionTerrainInfo::onClickUploadRaw(void* data) // static void LLPanelRegionTerrainInfo::onClickBakeTerrain(void* data) { - LLNotifications::instance().add( - LLNotification::Params("ConfirmBakeTerrain") - .functor(boost::bind(&LLPanelRegionTerrainInfo::callbackBakeTerrain, (LLPanelRegionTerrainInfo*)data, _1, _2))); + LLNotification::Params::Functor functor_params; + functor_params.function(boost::bind(&LLPanelRegionTerrainInfo::callbackBakeTerrain, (LLPanelRegionTerrainInfo*)data, _1, _2)); + + LLNotifications::instance().add(LLNotification::Params("ConfirmBakeTerrain").functor(functor_params)); } bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, const LLSD& response) @@ -1478,11 +1482,9 @@ void LLPanelEstateInfo::onClickRemoveAllowedAgent(void* user_data) accessRemoveCore(ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, "EstateAllowedAgentRemove", "allowed_avatar_name_list"); } -// static -void LLPanelEstateInfo::onClickAddAllowedGroup(void* user_data) +void LLPanelEstateInfo::onClickAddAllowedGroup() { - LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data; - LLCtrlListInterface *list = self->childGetListInterface("allowed_group_name_list"); + LLCtrlListInterface *list = childGetListInterface("allowed_group_name_list"); if (!list) return; if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) { @@ -1493,7 +1495,7 @@ void LLPanelEstateInfo::onClickAddAllowedGroup(void* user_data) } LLNotification::Params params("ChangeLindenAccess"); - params.functor(boost::bind(&LLPanelEstateInfo::addAllowedGroup, self, _1, _2)); + params.functor.function(boost::bind(&LLPanelEstateInfo::addAllowedGroup, this, _1, _2)); if (isLindenEstate()) { LLNotifications::instance().add(params); @@ -1515,7 +1517,7 @@ bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& re widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); if (widget) { - widget->setSelectCallback(addAllowedGroup2, NULL); + widget->setSelectGroupCallback(boost::bind(&LLPanelEstateInfo::addAllowedGroup2, this, _1)); if (parent_floater) { LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, widget); @@ -1656,26 +1658,29 @@ bool LLPanelEstateInfo::kickUserConfirm(const LLSD& notification, const LLSD& re std::string all_estates_text() { LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); - if (!panel) return "(error)"; + if (!panel) return "(" + LLTrans::getString("RegionInfoError") + ")"; + LLStringUtil::format_map_t args; std::string owner = panel->getOwnerName(); LLViewerRegion* region = gAgent.getRegion(); if (gAgent.isGodlike()) { - return llformat("all estates\nowned by %s", owner.c_str()); + args["[OWNER]"] = owner.c_str(); + return LLTrans::getString("RegionInfoAllEstatesOwnedBy", args); } else if (region && region->getOwner() == gAgent.getID()) { - return "all estates you own"; + return LLTrans::getString("AllEstatesYouOwn"); } else if (region && region->isEstateManager()) { - return llformat("all estates that\nyou manage for %s", owner.c_str()); + args["[OWNER]"] = owner.c_str(); + return LLTrans::getString("RegionInfoAllEstatesYouManage", args); } else { - return "(error)"; + return "(" + LLTrans::getString("RegionInfoError") + ")"; } } @@ -1725,8 +1730,7 @@ struct LLEstateAccessChangeInfo }; // Special case callback for groups, since it has different callback format than names -// static -void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void* user_data) +void LLPanelEstateInfo::addAllowedGroup2(LLUUID id) { LLSD payload; payload["operation"] = (S32)ESTATE_ACCESS_ALLOWED_GROUP_ADD; @@ -1739,7 +1743,7 @@ void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void* user_data) LLNotification::Params params("EstateAllowedGroupAdd"); params.payload(payload) .substitutions(args) - .functor(accessCoreConfirm); + .functor.function(accessCoreConfirm); if (isLindenEstate()) { LLNotifications::instance().forceResponse(params, 0); @@ -1760,7 +1764,7 @@ void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const std::string& dia LLNotification::Params params("ChangeLindenAccess"); params.payload(payload) - .functor(accessAddCore2); + .functor.function(accessAddCore2); if (isLindenEstate()) { @@ -1848,7 +1852,7 @@ void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, co LLNotification::Params params(change_info->mDialogName); params.substitutions(args) .payload(change_info->asLLSD()) - .functor(accessCoreConfirm); + .functor.function(accessCoreConfirm); if (isLindenEstate()) { @@ -1888,7 +1892,7 @@ void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const std::string& LLNotification::Params params("ChangeLindenAccess"); params.payload(payload) - .functor(accessRemoveCore2); + .functor.function(accessRemoveCore2); if (isLindenEstate()) { @@ -2121,7 +2125,7 @@ BOOL LLPanelEstateInfo::postBuild() initCtrl("limit_age_verified"); initCtrl("voice_chat_check"); childSetCommitCallback("abuse_email_address", onChangeAnything, this); - childSetKeystrokeCallback("abuse_email_address", onChangeText, this); + getChild<LLLineEditor>("abuse_email_address")->setKeystrokeCallback(onChangeText, this); initHelpBtn("estate_manager_help", "HelpEstateEstateManager"); initHelpBtn("use_global_time_help", "HelpEstateUseGlobalTime"); @@ -2161,7 +2165,7 @@ BOOL LLPanelEstateInfo::postBuild() group_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); } - childSetAction("add_allowed_group_btn", onClickAddAllowedGroup, this); + getChild<LLUICtrl>("add_allowed_group_btn")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onClickAddAllowedGroup, this)); childSetAction("remove_allowed_group_btn", onClickRemoveAllowedGroup, this); childSetCommitCallback("banned_avatar_name_list", onChangeChildCtrl, this); @@ -2213,7 +2217,7 @@ BOOL LLPanelEstateInfo::sendUpdate() llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl; LLNotification::Params params("ChangeLindenEstate"); - params.functor(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2)); + params.functor.function(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2)); if (getEstateID() <= ESTATE_LAST_LINDEN) { @@ -2556,8 +2560,7 @@ void LLPanelEstateInfo::callbackCacheName( const LLUUID& id, const std::string& first, const std::string& last, - BOOL is_group, - void*) + BOOL is_group) { LLPanelEstateInfo* self = LLFloaterRegionInfo::getPanelEstate(); if (!self) return; @@ -2852,7 +2855,7 @@ void LLPanelEstateCovenant::loadInvItem(LLInventoryItem *itemp) else { mAssetStatus = ASSET_LOADED; - setCovenantTextEditor("There is no Covenant provided for this Estate."); + setCovenantTextEditor(LLTrans::getString("RegionNoCovenant")); sendChangeCovenantID(LLUUID::null); } } @@ -3063,7 +3066,7 @@ bool LLDispatchEstateUpdateInfo::operator()( regionp->setOwner(owner_id); // Update estate owner name in UI const BOOL is_group = FALSE; - gCacheName->get(owner_id, is_group, LLPanelEstateInfo::callbackCacheName); + gCacheName->get(owner_id, is_group, &LLPanelEstateInfo::callbackCacheName); U32 estate_id = strtoul(strings[2].c_str(), NULL, 10); panel->setEstateID(estate_id); @@ -3162,9 +3165,10 @@ bool LLDispatchSetEstateAccess::operator()( totalAllowedAgents += allowed_agent_name_list->getItemCount(); } - std::string msg = llformat("Allowed residents: (%d, max %d)", - totalAllowedAgents, - ESTATE_MAX_ACCESS_IDS); + LLStringUtil::format_map_t args; + args["[ALLOWEDAGENTS]"] = llformat ("%d", totalAllowedAgents); + args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_ACCESS_IDS); + std::string msg = LLTrans::getString("RegionInfoAllowedResidents", args); panel->childSetValue("allow_resident_label", LLSD(msg)); if (allowed_agent_name_list) @@ -3186,9 +3190,10 @@ bool LLDispatchSetEstateAccess::operator()( LLNameListCtrl* allowed_group_name_list; allowed_group_name_list = panel->getChild<LLNameListCtrl>("allowed_group_name_list"); - std::string msg = llformat("Allowed groups: (%d, max %d)", - num_allowed_groups, - (S32) ESTATE_MAX_GROUP_IDS); + LLStringUtil::format_map_t args; + args["[ALLOWEDGROUPS]"] = llformat ("%d", num_allowed_groups); + args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_GROUP_IDS); + std::string msg = LLTrans::getString("RegionInfoAllowedGroups", args); panel->childSetValue("allow_group_label", LLSD(msg)); if (allowed_group_name_list) diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 806d1f57d61ef7eb52b131119267cf883c58a226..b3a1fcb7caf0f1d509ca18957d513c73c1052bd0 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -65,7 +65,7 @@ class LLFloaterRegionInfo : public LLFloater, public LLFloaterSingleton<LLFloate public: ~LLFloaterRegionInfo(); - /*virtual*/ void onOpen(); + /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ BOOL postBuild(); static void processEstateOwnerRequest(LLMessageSystem* msg, void**); @@ -84,7 +84,7 @@ public: // from LLPanel virtual void refresh(); - static void requestRegionInfo(); + void requestRegionInfo(); protected: LLFloaterRegionInfo(const LLSD& seed); @@ -103,7 +103,8 @@ protected: class LLPanelRegionInfo : public LLPanel { public: - LLPanelRegionInfo() : LLPanel(std::string("Region Info Panel")) {} + LLPanelRegionInfo(); + static void onBtnSet(void* user_data); static void onChangeChildCtrl(LLUICtrl* ctrl, void* user_data); static void onChangeAnything(LLUICtrl* ctrl, void* user_data); @@ -261,7 +262,7 @@ public: static void onClickAddAllowedAgent(void* user_data); static void onClickRemoveAllowedAgent(void* user_data); - static void onClickAddAllowedGroup(void* user_data); + void onClickAddAllowedGroup(); static void onClickRemoveAllowedGroup(void* user_data); static void onClickAddBannedAgent(void* user_data); static void onClickRemoveBannedAgent(void* user_data); @@ -271,7 +272,7 @@ public: // Group picker callback is different, can't use core methods below bool addAllowedGroup(const LLSD& notification, const LLSD& response); - static void addAllowedGroup2(LLUUID id, void* data); + void addAllowedGroup2(LLUUID id); // Core methods for all above add/remove button clicks static void accessAddCore(U32 operation_flag, const std::string& dialog_name); @@ -339,8 +340,7 @@ public: const LLUUID& id, const std::string& first, const std::string& last, - BOOL is_group, - void*); + BOOL is_group); protected: virtual BOOL sendUpdate(); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 412494eeb32a3b6c8dd7108a411ffc9aca4638ca..8ddc929019ead3b28e6bded20d4a9942a23a2708 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -105,13 +105,9 @@ namespace { //----------------------------------------------------------------------------- // Member functions //----------------------------------------------------------------------------- -LLFloaterReporter::LLFloaterReporter( - const std::string& name, - const LLRect& rect, - const std::string& title, - EReportType report_type) - : - LLFloater(name, rect, title), + +LLFloaterReporter::LLFloaterReporter(EReportType report_type) +: LLFloater(), mReportType(report_type), mObjectID(), mScreenID(), @@ -122,37 +118,11 @@ LLFloaterReporter::LLFloaterReporter( mCopyrightWarningSeen( FALSE ), mResourceDatap(new LLResourceData()) { - if (report_type == BUG_REPORT) - { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_bug.xml"); - } - else - { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml"); - } - - childSetText("abuse_location_edit", gAgent.getSLURL() ); - - LLButton* pick_btn = getChild<LLButton>("pick_btn"); - if (pick_btn) - { - // XUI: Why aren't these in viewerart.ini? - pick_btn->setImages( std::string("UIImgFaceUUID"), - std::string("UIImgFaceSelectedUUID") ); - childSetAction("pick_btn", onClickObjPicker, this); - } - if (report_type != BUG_REPORT) - { - // abuser name is selected from a list - LLLineEditor* le = getChild<LLLineEditor>("abuser_name_edit"); - le->setEnabled( FALSE ); - } - - childSetAction("select_abuser", onClickSelectAbuser, this); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml"); + - childSetAction("send_btn", onClickSend, this); - childSetAction("cancel_btn", onClickCancel, this); + childSetText("abuse_location_edit", gAgent.getSLURL() ); enableControls(TRUE); @@ -182,18 +152,16 @@ LLFloaterReporter::LLFloaterReporter( gDialogVisible = TRUE; - // only request details for abuse reports (not BUG reports) - if (report_type != BUG_REPORT) - { - // send a message and ask for information about this region - - // result comes back in processRegionInfo(..) - LLMessageSystem* msg = gMessageSystem; - msg->newMessage("RequestRegionInfo"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - gAgent.sendReliableMessage(); - }; + + // send a message and ask for information about this region - + // result comes back in processRegionInfo(..) + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("RequestRegionInfo"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + gAgent.sendReliableMessage(); + } // static @@ -213,7 +181,25 @@ void LLFloaterReporter::processRegionInfo(LLMessageSystem* msg) LLNotifications::instance().add("HelpReportAbuseEmailLL"); }; } +// virtual +BOOL LLFloaterReporter::postBuild() +{ + // abuser name is selected from a list + LLLineEditor* le = getChild<LLLineEditor>("abuser_name_edit"); + le->setEnabled( FALSE ); + setPosBox(mPosition.getValue()); + LLButton* pick_btn = getChild<LLButton>("pick_btn"); + pick_btn->setImages(std::string("tool_face.tga"), + std::string("tool_face_active.tga") ); + childSetAction("pick_btn", onClickObjPicker, this); + + childSetAction("select_abuser", onClickSelectAbuser, this); + + childSetAction("send_btn", onClickSend, this); + childSetAction("cancel_btn", onClickCancel, this); + return TRUE; +} // virtual LLFloaterReporter::~LLFloaterReporter() { @@ -241,7 +227,7 @@ void LLFloaterReporter::draw() // this is set by a static callback sometime after the dialog is created. // Only disable screenshot for abuse reports to estate owners - bug reports always // allow screenshots to be taken. - if ( gEmailToEstateOwner && ( mReportType != BUG_REPORT ) ) + if ( gEmailToEstateOwner ) { childSetValue("screen_check", FALSE ); childSetEnabled("screen_check", FALSE ); @@ -257,11 +243,7 @@ void LLFloaterReporter::draw() void LLFloaterReporter::enableControls(BOOL enable) { childSetEnabled("category_combo", enable); - // bug reports never include the chat history - if (mReportType != BUG_REPORT) - { - childSetEnabled("chat_check", enable); - } + childSetEnabled("chat_check", enable); childSetEnabled("screen_check", enable); childDisable("screenshot"); childSetEnabled("pick_btn", enable); @@ -332,7 +314,7 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) // we have to query the simulator for information // about this object LLMessageSystem* msg = gMessageSystem; - U32 request_flags = (mReportType == BUG_REPORT) ? BUG_REPORT_REQUEST : COMPLAINT_REPORT_REQUEST; + U32 request_flags = COMPLAINT_REPORT_REQUEST; msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); @@ -363,15 +345,12 @@ void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, if (ids.empty() || names.empty()) return; - // this should never be called in a bug report but here for safety. - if ( self->mReportType != BUG_REPORT ) - { - self->childSetText("abuser_name_edit", names[0] ); - - self->mAbuserID = ids[0]; + self->childSetText("abuser_name_edit", names[0] ); + + self->mAbuserID = ids[0]; + + self->refresh(); - self->refresh(); - }; } // static @@ -386,9 +365,7 @@ void LLFloaterReporter::onClickSend(void *userdata) if(self->validateReport()) { - // only show copyright alert for abuse reports - if ( self->mReportType != BUG_REPORT ) - { + const int IP_CONTENT_REMOVAL = 66; const int IP_PERMISSONS_EXPLOIT = 37; LLComboBox* combo = self->getChild<LLComboBox>( "category_combo"); @@ -418,7 +395,7 @@ void LLFloaterReporter::onClickSend(void *userdata) LLNotifications::instance().add("HelpReportAbuseContainsCopyright"); return; } - } + LLUploadDialog::modalUploadDialog("Uploading...\n\nReport"); // *TODO don't upload image if checkbox isn't checked @@ -427,7 +404,7 @@ void LLFloaterReporter::onClickSend(void *userdata) if(!url.empty() || !sshot_url.empty()) { self->sendReportViaCaps(url, sshot_url, self->gatherReport()); - self->close(); + self->closeFloater(); } else { @@ -442,7 +419,7 @@ void LLFloaterReporter::onClickSend(void *userdata) { self->sendReportViaLegacy(self->gatherReport()); LLUploadDialog::modalUploadFinished(); - self->close(); + self->closeFloater(); } } } @@ -461,7 +438,7 @@ void LLFloaterReporter::onClickCancel(void *userdata) { closePickTool(self); } - self->close(); + self->closeFloater(); } @@ -501,16 +478,13 @@ void LLFloaterReporter::showFromMenu(EReportType report_type) { // ...bring that window to front LLFloaterReporter *f = gReporterInstances.getData(report_type); - f->open(); /* Flawfinder: ignore */ + f->openFloater(); } else { LLFloaterReporter *f; - if (BUG_REPORT == report_type) - { - f = LLFloaterReporter::createNewBugReporter(); - } - else if (COMPLAINT_REPORT == report_type) + + if (COMPLAINT_REPORT == report_type) { f = LLFloaterReporter::createNewAbuseReporter(); } @@ -557,7 +531,7 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id) // Need to deselect on close f->mDeselectOnClose = TRUE; - f->open(); /* Flawfinder: ignore */ + f->openFloater(); } @@ -575,21 +549,8 @@ LLFloaterReporter* LLFloaterReporter::getReporter(EReportType report_type) LLFloaterReporter* LLFloaterReporter::createNewAbuseReporter() { - return new LLFloaterReporter("complaint_reporter", - LLRect(), - "Report Abuse", - COMPLAINT_REPORT); -} - -//static -LLFloaterReporter* LLFloaterReporter::createNewBugReporter() -{ - return new LLFloaterReporter("bug_reporter", - LLRect(), - "Report Bug", - BUG_REPORT); + return new LLFloaterReporter(COMPLAINT_REPORT); } - void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id) @@ -619,21 +580,26 @@ bool LLFloaterReporter::validateReport() return false; } - if ( mReportType != BUG_REPORT ) + + if ( childGetText("abuser_name_edit").empty() ) + { + LLNotifications::instance().add("HelpReportAbuseAbuserNameEmpty"); + return false; + }; + + if ( childGetText("abuse_location_edit").empty() ) + { + LLNotifications::instance().add("HelpReportAbuseAbuserLocationEmpty"); + return false; + }; + + if ( childGetText("abuse_location_edit").empty() ) { - if ( childGetText("abuser_name_edit").empty() ) - { - LLNotifications::instance().add("HelpReportAbuseAbuserNameEmpty"); - return false; - }; - - if ( childGetText("abuse_location_edit").empty() ) - { - LLNotifications::instance().add("HelpReportAbuseAbuserLocationEmpty"); - return false; - }; + LLNotifications::instance().add("HelpReportAbuseAbuserLocationEmpty"); + return false; }; + if ( childGetText("summary_edit").empty() ) { if ( mReportType != BUG_REPORT ) @@ -685,50 +651,34 @@ LLSD LLFloaterReporter::gatherReport() #if LL_WINDOWS const char* platform = "Win"; - const char* short_platform = "O:W"; #elif LL_DARWIN const char* platform = "Mac"; - const char* short_platform = "O:M"; #elif LL_LINUX const char* platform = "Lnx"; - const char* short_platform = "O:L"; #elif LL_SOLARIS const char* platform = "Sol"; const char* short_platform = "O:S"; #else const char* platform = "???"; - const char* short_platform = "O:?"; #endif - if ( mReportType == BUG_REPORT) - { - summary << short_platform << " V" << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VIEWER_BUILD - << " (" << regionp->getName() << ")" - << "[" << category_name << "] " - << "\"" << childGetValue("summary_edit").asString() << "\""; - } - else - { - summary << "" - << " |" << regionp->getName() << "|" // region reporter is currently in. - << " (" << childGetText("abuse_location_edit") << ")" // region abuse occured in (freeform text - no LLRegionPicker tool) - << " [" << category_name << "] " // updated category - << " {" << childGetText("abuser_name_edit") << "} " // name of abuse entered in report (chosen using LLAvatarPicker) - << " \"" << childGetValue("summary_edit").asString() << "\""; // summary as entered - }; + + summary << "" + << " |" << regionp->getName() << "|" // region reporter is currently in. + << " (" << childGetText("abuse_location_edit") << ")" // region abuse occured in (freeform text - no LLRegionPicker tool) + << " [" << category_name << "] " // updated category + << " {" << childGetText("abuser_name_edit") << "} " // name of abuse entered in report (chosen using LLAvatarPicker) + << " \"" << childGetValue("summary_edit").asString() << "\""; // summary as entered + std::ostringstream details; - if (mReportType != BUG_REPORT) - { - details << "V" << LL_VERSION_MAJOR << "." // client version moved to body of email for abuse reports - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VIEWER_BUILD << std::endl << std::endl; - } + + details << "V" << LL_VERSION_MAJOR << "." // client version moved to body of email for abuse reports + << LL_VERSION_MINOR << "." + << LL_VERSION_PATCH << "." + << LL_VIEWER_BUILD << std::endl << std::endl; + std::string object_name = childGetText("object_name"); std::string owner_name = childGetText("owner_name"); if (!object_name.empty() && !owner_name.empty()) @@ -737,11 +687,9 @@ LLSD LLFloaterReporter::gatherReport() details << "Owner: " << owner_name << "\n"; } - if ( mReportType != BUG_REPORT ) - { - details << "Abuser name: " << childGetText("abuser_name_edit") << " \n"; - details << "Abuser location: " << childGetText("abuse_location_edit") << " \n"; - }; + + details << "Abuser name: " << childGetText("abuser_name_edit") << " \n"; + details << "Abuser location: " << childGetText("abuse_location_edit") << " \n"; details << childGetValue("details_edit").asString(); @@ -761,17 +709,11 @@ LLSD LLFloaterReporter::gatherReport() LLUUID screenshot_id = LLUUID::null; if (childGetValue("screen_check")) { - if ( mReportType != BUG_REPORT ) - { - if ( gEmailToEstateOwner == FALSE ) - { - screenshot_id = childGetValue("screenshot"); - } - } - else + + if ( gEmailToEstateOwner == FALSE ) { screenshot_id = childGetValue("screenshot"); - }; + } }; LLSD report = LLSD::emptyMap(); @@ -891,12 +833,8 @@ void LLFloaterReporter::takeScreenshot() mResourceDatap->mExpectedUploadCost = 0; // we expect that abuse screenshots are free mResourceDatap->mAssetInfo.mTransactionID.generate(); mResourceDatap->mAssetInfo.mUuid = mResourceDatap->mAssetInfo.mTransactionID.makeAssetID(gAgent.getSecureSessionID()); - if (BUG_REPORT == mReportType) - { - mResourceDatap->mAssetInfo.mType = LLAssetType::AT_TEXTURE; - mResourceDatap->mPreferredLocation = LLAssetType::EType(-1); - } - else if (COMPLAINT_REPORT == mReportType) + + if (COMPLAINT_REPORT == mReportType) { mResourceDatap->mAssetInfo.mType = LLAssetType::AT_TEXTURE; mResourceDatap->mPreferredLocation = LLAssetType::EType(-2); @@ -927,7 +865,7 @@ void LLFloaterReporter::takeScreenshot() { texture->setImageAssetID(mResourceDatap->mAssetInfo.mUuid); texture->setDefaultImageAssetID(mResourceDatap->mAssetInfo.mUuid); - texture->setCaption(std::string("Screenshot")); + texture->setCaption(getString("Screenshot")); } } @@ -967,11 +905,7 @@ void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data, } EReportType report_type = UNKNOWN_REPORT; - if (data->mPreferredLocation == -1) - { - report_type = BUG_REPORT; - } - else if (data->mPreferredLocation == -2) + if (data->mPreferredLocation == -2) { report_type = COMPLAINT_REPORT; } @@ -986,7 +920,7 @@ void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data, self->mScreenID = uuid; llinfos << "Got screen shot " << uuid << llendl; self->sendReportViaLegacy(self->gatherReport()); - self->close(); + self->closeFloater(); } } diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index 86bc60559e07588233af1a827ec0fc92682969f2..da1dda9c784609273a6c3b631dbdef28945c86c2 100644 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -82,12 +82,9 @@ class LLFloaterReporter : public LLFloater { public: - LLFloaterReporter(const std::string& name, - const LLRect &rect, - const std::string& title, - EReportType = UNKNOWN_REPORT); + LLFloaterReporter(EReportType = UNKNOWN_REPORT); /*virtual*/ ~LLFloaterReporter(); - + /*virtual*/ BOOL postBuild(); virtual void draw(); // Enables all buttons @@ -107,7 +104,6 @@ public: // returns a pointer to reporter of report_type static LLFloaterReporter* getReporter(EReportType report_type); static LLFloaterReporter* createNewAbuseReporter(); - static LLFloaterReporter* createNewBugReporter(); // static static void processRegionInfo(LLMessageSystem* msg); diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp index bc774e77ac978c4186e2c4bc346cebd5a8985c30..b2bb3436816908cb33e448199c7e3772ce41d9e4 100644 --- a/indra/newview/llfloaterscriptdebug.cpp +++ b/indra/newview/llfloaterscriptdebug.cpp @@ -52,12 +52,17 @@ // LLFloaterScriptDebug* LLFloaterScriptDebug::sInstance = NULL; +void* getOutputWindow(void* data); + // // Member Functions // -LLFloaterScriptDebug::LLFloaterScriptDebug() : - LLMultiFloater() +LLFloaterScriptDebug::LLFloaterScriptDebug(const std::string& filename) + : LLMultiFloater() { + mFactoryMap["all_scripts"] = LLCallbackMap(getOutputWindow, NULL); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_script_debug.xml"); + // avoid resizing of the window to match // the initial size of the tabbed-childs, whenever a tab is opened or closed mAutoResize = FALSE; @@ -73,8 +78,11 @@ void LLFloaterScriptDebug::show(const LLUUID& object_id) LLFloater* floaterp = addOutputWindow(object_id); if (sInstance) { - sInstance->open(); /* Flawfinder: ignore */ - sInstance->showFloater(floaterp); + sInstance->openFloater(object_id); + if (object_id.notNull()) + sInstance->showFloater(floaterp, LLTabContainer::END); +// else // Jump to [All scripts], but keep it on the left +// sInstance->showFloater(floaterp, LLTabContainer::START); } } @@ -95,25 +103,19 @@ BOOL LLFloaterScriptDebug::postBuild() void* getOutputWindow(void* data) { - return new LLFloaterScriptDebugOutput(); + return new LLFloaterScriptDebugOutput(LLUUID::null); } LLFloater* LLFloaterScriptDebug::addOutputWindow(const LLUUID &object_id) { if (!sInstance) { - sInstance = new LLFloaterScriptDebug(); - LLCallbackMap::map_t factory_map; - factory_map["all_scripts"] = LLCallbackMap(getOutputWindow, NULL); - LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_script_debug.xml", &factory_map); + sInstance = new LLFloaterScriptDebug("floater_script_debug.xml"); sInstance->setVisible(FALSE); } - LLFloater* floaterp = NULL; LLFloater::setFloaterHost(sInstance); - { - floaterp = LLFloaterScriptDebugOutput::show(object_id); - } + LLFloater* floaterp = LLFloaterScriptDebugOutput::show(object_id); LLFloater::setFloaterHost(NULL); // Tabs sometimes overlap resize handle @@ -155,54 +157,19 @@ void LLFloaterScriptDebug::addScriptLine(const std::string &utf8mesg, const std: std::map<LLUUID, LLFloaterScriptDebugOutput*> LLFloaterScriptDebugOutput::sInstanceMap; -LLFloaterScriptDebugOutput::LLFloaterScriptDebugOutput() -: mObjectID(LLUUID::null) -{ - sInstanceMap[mObjectID] = this; -} - LLFloaterScriptDebugOutput::LLFloaterScriptDebugOutput(const LLUUID& object_id) -: LLFloater(std::string("script instance floater"), LLRect(0, 200, 200, 0), std::string("Script"), TRUE), mObjectID(object_id) + : LLFloater(), + mObjectID(object_id) { - S32 y = getRect().getHeight() - LLFLOATER_HEADER_SIZE - LLFLOATER_VPAD; - S32 x = LLFLOATER_HPAD; - // History editor - // Give it a border on the top - LLRect history_editor_rect( - x, - y, - getRect().getWidth() - LLFLOATER_HPAD, - LLFLOATER_VPAD ); - mHistoryEditor = new LLViewerTextEditor( std::string("Chat History Editor"), - history_editor_rect, S32_MAX, LLStringUtil::null, LLFontGL::getFontSansSerif()); - mHistoryEditor->setWordWrap( TRUE ); - mHistoryEditor->setFollowsAll(); - mHistoryEditor->setEnabled( FALSE ); - mHistoryEditor->setTabStop( TRUE ); // We want to be able to cut or copy from the history. - addChild(mHistoryEditor); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_script_debug_panel.xml"); + sInstanceMap[object_id] = this; } -void LLFloaterScriptDebugOutput::initFloater(const std::string& title, BOOL resizable, - S32 min_width, S32 min_height, BOOL drag_on_left, - BOOL minimizable, BOOL close_btn) +BOOL LLFloaterScriptDebugOutput::postBuild() { - LLFloater::initFloater(title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn); - S32 y = getRect().getHeight() - LLFLOATER_HEADER_SIZE - LLFLOATER_VPAD; - S32 x = LLFLOATER_HPAD; - // History editor - // Give it a border on the top - LLRect history_editor_rect( - x, - y, - getRect().getWidth() - LLFLOATER_HPAD, - LLFLOATER_VPAD ); - mHistoryEditor = new LLViewerTextEditor( std::string("Chat History Editor"), - history_editor_rect, S32_MAX, LLStringUtil::null, LLFontGL::getFontSansSerif()); - mHistoryEditor->setWordWrap( TRUE ); - mHistoryEditor->setFollowsAll(); - mHistoryEditor->setEnabled( FALSE ); - mHistoryEditor->setTabStop( TRUE ); // We want to be able to cut or copy from the history. - addChild(mHistoryEditor); + LLFloater::postBuild(); + mHistoryEditor = getChild<LLViewerTextEditor>("Chat History Editor"); + return TRUE; } LLFloaterScriptDebugOutput::~LLFloaterScriptDebugOutput() @@ -214,13 +181,13 @@ void LLFloaterScriptDebugOutput::addLine(const std::string &utf8mesg, const std: { if (mObjectID.isNull()) { - //setTitle("[All scripts]"); setCanTearOff(FALSE); setCanClose(FALSE); } else { setTitle(user_name); + setShortTitle(user_name); } mHistoryEditor->appendColoredText(utf8mesg, false, true, color); @@ -234,8 +201,7 @@ LLFloaterScriptDebugOutput* LLFloaterScriptDebugOutput::show(const LLUUID& objec if (found_it == sInstanceMap.end()) { floaterp = new LLFloaterScriptDebugOutput(object_id); - sInstanceMap[object_id] = floaterp; - floaterp->open(); /* Flawfinder: ignore*/ + floaterp->openFloater(); } else { diff --git a/indra/newview/llfloaterscriptdebug.h b/indra/newview/llfloaterscriptdebug.h index 59c0ba1c8bbea5abcfcd6a086380c3d1d8c00f15..5f2cf48125bf6758d5f718ea4e669b504d984b94 100644 --- a/indra/newview/llfloaterscriptdebug.h +++ b/indra/newview/llfloaterscriptdebug.h @@ -33,7 +33,7 @@ #ifndef LL_LLFLOATERSCRIPTDEBUG_H #define LL_LLFLOATERSCRIPTDEBUG_H -#include "llfloater.h" +#include "llmultifloater.h" class LLTextEditor; class LLUUID; @@ -48,7 +48,7 @@ public: static void addScriptLine(const std::string &utf8mesg, const std::string &user_name, const LLColor4& color, const LLUUID& source_id); protected: - LLFloaterScriptDebug(); + LLFloaterScriptDebug(const std::string& filename); static LLFloater* addOutputWindow(const LLUUID& object_id); @@ -63,12 +63,10 @@ public: LLFloaterScriptDebugOutput(const LLUUID& object_id); ~LLFloaterScriptDebugOutput(); - virtual void initFloater(const std::string& title, BOOL resizable, - S32 min_width, S32 min_height, BOOL drag_on_left, - BOOL minimizable, BOOL close_btn); - void addLine(const std::string &utf8mesg, const std::string &user_name, const LLColor4& color); + virtual BOOL postBuild(); + static LLFloaterScriptDebugOutput* show(const LLUUID& object_id); static LLFloaterScriptDebugOutput* getFloaterByID(const LLUUID& id); diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index 92e070f766242730a32b2d77a6d425ae08ba36a6..6775e218cbc5fade657db1383633fcc1e0c149bc 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -88,7 +88,6 @@ private: public: virtual BOOL postBuild(); - virtual void onClose(bool app_quitting); static LLFloaterSellLandUI* soleInstance(bool createIfNeeded); @@ -109,7 +108,7 @@ void LLFloaterSellLand::sellLand( LLFloaterSellLandUI* ui = LLFloaterSellLandUI::soleInstance(true); if (ui->setParcel(region, parcel)) { - ui->open(); /* Flawfinder: ignore */ + ui->openFloater(); } } @@ -139,7 +138,7 @@ LLFloaterSellLandUI* LLFloaterSellLandUI::soleInstance(bool createIfNeeded) } LLFloaterSellLandUI::LLFloaterSellLandUI() -: LLFloater(std::string("Sell Land")), +: LLFloater(), mRegion(0) { } @@ -159,7 +158,7 @@ void LLFloaterSellLandUI::SelectionObserver::changed() { if (LLViewerParcelMgr::getInstance()->selectionEmpty()) { - ui->close(); + ui->closeFloater(); } else { ui->setParcel( @@ -169,12 +168,6 @@ void LLFloaterSellLandUI::SelectionObserver::changed() } } -void LLFloaterSellLandUI::onClose(bool app_quitting) -{ - LLFloater::onClose(app_quitting); - destroy(); -} - BOOL LLFloaterSellLandUI::postBuild() { childSetCommitCallback("sell_to", onChangeValue, this); @@ -432,7 +425,7 @@ void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& nam void LLFloaterSellLandUI::doCancel(void *userdata) { LLFloaterSellLandUI* self = (LLFloaterSellLandUI*)userdata; - self->close(); + self->closeFloater(); } // static @@ -490,7 +483,7 @@ void LLFloaterSellLandUI::doSellLand(void *userdata) LLNotification::Params params("ConfirmLandSaleChange"); params.substitutions(args) - .functor(boost::bind(&LLFloaterSellLandUI::onConfirmSale, self, _1, _2)); + .functor.function(boost::bind(&LLFloaterSellLandUI::onConfirmSale, self, _1, _2)); if (sell_to_anyone) { @@ -556,6 +549,6 @@ bool LLFloaterSellLandUI::onConfirmSale(const LLSD& notification, const LLSD& re // Send update to server LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); - close(); + closeFloater(); return false; } diff --git a/indra/newview/llfloatersellland.h b/indra/newview/llfloatersellland.h index 1b3a33ebb82012dcdff849bdbc371fd665dc6c2d..12b0ecbcef2c298f53a90f29c533d1b051b31e63 100644 --- a/indra/newview/llfloatersellland.h +++ b/indra/newview/llfloatersellland.h @@ -31,7 +31,8 @@ #ifndef LL_LLFLOATERSELLLAND_H #define LL_LLFLOATERSELLLAND_H -#include "llmemory.h" + +#include "llsafehandle.h" class LLParcel; class LLViewerRegion; diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index 267746761104598a6cc5a2e321ba97c3d545825d..339b90a0f58295b50f70bc37b1d0add6b6f4d7a9 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -40,16 +40,15 @@ #include "llcolorswatch.h" #include "llviewercontrol.h" -LLFloaterSettingsDebug* LLFloaterSettingsDebug::sInstance = NULL; -LLFloaterSettingsDebug::LLFloaterSettingsDebug() : LLFloater(std::string("Configuration Editor")) +LLFloaterSettingsDebug::LLFloaterSettingsDebug(const LLSD& key) +: LLFloater(key) { + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_settings_debug.xml"); } LLFloaterSettingsDebug::~LLFloaterSettingsDebug() -{ - sInstance = NULL; -} +{} BOOL LLFloaterSettingsDebug::postBuild() { @@ -68,29 +67,31 @@ BOOL LLFloaterSettingsDebug::postBuild() } } func(settings_combo); - gSavedSettings.applyToAll(&func); - gSavedPerAccountSettings.applyToAll(&func); - gColors.applyToAll(&func); + std::string key = getKey().asString(); + if (key == "all" || key == "base") + { + gSavedSettings.applyToAll(&func); + } + if (key == "all" || key == "account") + { + gSavedPerAccountSettings.applyToAll(&func); + } + if (key == "all" || key == "skin") + { + gSavedSkinSettings.applyToAll(&func); + } settings_combo->sortByName(); - settings_combo->setCommitCallback(onSettingSelect); - settings_combo->setCallbackUserData(this); + settings_combo->setCommitCallback(onSettingSelect, this); settings_combo->updateSelection(); - childSetCommitCallback("val_spinner_1", onCommitSettings); - childSetUserData("val_spinner_1", this); - childSetCommitCallback("val_spinner_2", onCommitSettings); - childSetUserData("val_spinner_2", this); - childSetCommitCallback("val_spinner_3", onCommitSettings); - childSetUserData("val_spinner_3", this); - childSetCommitCallback("val_spinner_4", onCommitSettings); - childSetUserData("val_spinner_4", this); - childSetCommitCallback("val_text", onCommitSettings); - childSetUserData("val_text", this); - childSetCommitCallback("boolean_combo", onCommitSettings); - childSetUserData("boolean_combo", this); - childSetCommitCallback("color_swatch", onCommitSettings); - childSetUserData("color_swatch", this); + childSetCommitCallback("val_spinner_1", onCommitSettings, this); + childSetCommitCallback("val_spinner_2", onCommitSettings, this); + childSetCommitCallback("val_spinner_3", onCommitSettings, this); + childSetCommitCallback("val_spinner_4", onCommitSettings, this); + childSetCommitCallback("val_text", onCommitSettings, this); + childSetCommitCallback("boolean_combo", onCommitSettings, this); + childSetCommitCallback("color_swatch", onCommitSettings, this); childSetAction("default_btn", onClickDefault, this); mComment = getChild<LLTextEditor>("comment_text"); return TRUE; @@ -105,19 +106,6 @@ void LLFloaterSettingsDebug::draw() LLFloater::draw(); } -//static -void LLFloaterSettingsDebug::show(void*) -{ - if (sInstance == NULL) - { - sInstance = new LLFloaterSettingsDebug(); - - LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_settings_debug.xml"); - } - - sInstance->open(); /* Flawfinder: ignore */ -} - //static void LLFloaterSettingsDebug::onSettingSelect(LLUICtrl* ctrl, void* user_data) { @@ -192,12 +180,6 @@ void LLFloaterSettingsDebug::onCommitSettings(LLUICtrl* ctrl, void* user_data) //col3.mV[VBLUE] = (F32)floaterp->childGetValue("val_spinner_3").asReal(); //controlp->set(col3.getValue()); break; - case TYPE_COL4U: - col3.setValue(floaterp->childGetValue("color_swatch")); - col4U.setVecScaleClamp(col3); - col4U.mV[VALPHA] = floaterp->childGetValue("val_spinner_4").asInteger(); - controlp->set(col4U.getValue()); - break; default: break; } @@ -464,29 +446,6 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) color_swatch->setValue(sd); break; } - case TYPE_COL4U: - { - LLColor4U clr; - clr.setValue(sd); - color_swatch->setVisible(TRUE); - if(LLColor4(clr) != LLColor4(color_swatch->getValue())) - { - color_swatch->set(LLColor4(clr), TRUE, FALSE); - } - spinner4->setVisible(TRUE); - spinner4->setLabel(std::string("Alpha")); - if(!spinner4->hasFocus()) - { - spinner4->setPrecision(0); - spinner4->setValue(clr.mV[VALPHA]); - } - - spinner4->setMinValue(0); - spinner4->setMaxValue(255); - spinner4->setIncrement(1.f); - - break; - } default: mComment->setText(std::string("unknown")); break; diff --git a/indra/newview/llfloatersettingsdebug.h b/indra/newview/llfloatersettingsdebug.h index e08e6b5d740ad81df80c985151e8ccc20d589191..0a98021c791b33e4ae8a79cc59810f2b44b6fa91 100644 --- a/indra/newview/llfloatersettingsdebug.h +++ b/indra/newview/llfloatersettingsdebug.h @@ -37,10 +37,14 @@ #include "llfloater.h" #include "lltexteditor.h" -class LLFloaterSettingsDebug : public LLFloater +class LLFloaterSettingsDebug +: public LLFloater, + public LLFloaterSingleton<LLFloaterSettingsDebug> { public: - LLFloaterSettingsDebug(); + // key - selects which settings to show, one of: + // "all", "base", "account", "skin" + LLFloaterSettingsDebug(const LLSD& key); virtual ~LLFloaterSettingsDebug(); virtual BOOL postBuild(); @@ -48,13 +52,11 @@ public: void updateControl(LLControlVariable* control); - static void show(void*); static void onSettingSelect(LLUICtrl* ctrl, void* user_data); static void onCommitSettings(LLUICtrl* ctrl, void* user_data); static void onClickDefault(void* user_data); protected: - static LLFloaterSettingsDebug* sInstance; LLTextEditor* mComment; }; diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index e68d699d0332263f19af4802cdb762b794251428..cb4f2a671120de4a28d23a27b8b165bfe5440384 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -34,15 +34,9 @@ #include "llfloatersnapshot.h" -#include "llfontgl.h" -#include "llsys.h" -#include "llgl.h" -#include "llrender.h" -#include "v3dmath.h" -#include "llmath.h" -#include "lldir.h" -#include "llsdserialize.h" +#include "llfloaterreg.h" +// Viewer includes #include "llagent.h" #include "llcallbacklist.h" #include "llcriticaldamp.h" @@ -67,14 +61,24 @@ #include "lltoolmgr.h" #include "llworld.h" +// Linden library includes +#include "llfontgl.h" +#include "llsys.h" +#include "llrender.h" +#include "v3dmath.h" +#include "llmath.h" +#include "lldir.h" +#include "llsdserialize.h" #include "llgl.h" #include "llglheaders.h" #include "llimagejpeg.h" #include "llimagepng.h" #include "llimagebmp.h" #include "llimagej2c.h" +#include "llresmgr.h" // LLLocale #include "llvfile.h" #include "llvfs.h" +#include "llwindow.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -85,8 +89,6 @@ S32 LLFloaterSnapshot::sUIWinWidth = 215 ; LLSnapshotFloaterView* gSnapshotFloaterView = NULL; -LLFloaterSnapshot* LLFloaterSnapshot::sInstance = NULL; - const F32 AUTO_SNAPSHOT_TIME_DELAY = 1.f; F32 SHINE_TIME = 0.5f; @@ -112,7 +114,17 @@ public: }; - LLSnapshotLivePreview(const LLRect& rect); + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Params() + { + name = "snapshot_live_preview"; + mouse_opaque = false; + } + }; + + + LLSnapshotLivePreview(const LLSnapshotLivePreview::Params& p); ~LLSnapshotLivePreview(); /*virtual*/ void draw(); @@ -200,8 +212,9 @@ public: }; std::set<LLSnapshotLivePreview*> LLSnapshotLivePreview::sList; -LLSnapshotLivePreview::LLSnapshotLivePreview (const LLRect& rect) : - LLView(std::string("snapshot_live_preview"), rect, FALSE), + +LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Params& p) +: LLView(p), mColor(1.f, 0.f, 0.f, 0.5f), mCurImageIndex(0), mPreviewImage(NULL), @@ -472,10 +485,6 @@ void LLSnapshotLivePreview::draw() } else if (mShineAnimTimer.getStarted()) { - //LLDebugVarMessageBox::show("Shine time", &SHINE_TIME, 10.f, 0.1f); - //LLDebugVarMessageBox::show("Shine width", &SHINE_WIDTH, 2.f, 0.05f); - //LLDebugVarMessageBox::show("Shine opacity", &SHINE_OPACITY, 1.f, 0.05f); - F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME); // draw "shine" effect @@ -959,7 +968,7 @@ void LLSnapshotLivePreview::saveTexture() { LLVFile::writeFile(formatted->getData(), formatted->getDataSize(), gVFS, new_asset_id, LLAssetType::AT_TEXTURE); std::string pos_string; - gAgent.buildLocationString(pos_string); + gAgent.buildLocationString(pos_string, LLAgent::LOCATION_FORMAT_FULL); std::string who_took_it; gAgent.buildFullname(who_took_it); LLAssetStorage::LLStoreAssetCallback callback = NULL; @@ -1053,9 +1062,6 @@ public: static void updateLayout(LLFloaterSnapshot* floater); static void updateResolutionTextEntry(LLFloaterSnapshot* floater); - static LLHandle<LLView> sPreviewHandle; - static BOOL sAspectRatioCheckOff ; - private: static LLSnapshotLivePreview::ESnapshotType getTypeIndex(LLFloaterSnapshot* floater); static ESnapshotFormat getFormatIndex(LLFloaterSnapshot* floater); @@ -1068,18 +1074,14 @@ public: std::vector<LLAnimPauseRequest> mAvatarPauseHandles; LLToolset* mLastToolset; + LLHandle<LLView> mPreviewHandle; + BOOL mAspectRatioCheckOff ; }; -// static -LLHandle<LLView> LLFloaterSnapshot::Impl::sPreviewHandle; - -//static -BOOL LLFloaterSnapshot::Impl::sAspectRatioCheckOff = FALSE ; - // static LLSnapshotLivePreview* LLFloaterSnapshot::Impl::getPreviewView(LLFloaterSnapshot *floater) { - LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)sPreviewHandle.get(); + LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)floater->impl.mPreviewHandle.get(); return previewp; } @@ -1186,7 +1188,7 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) iter != LLCharacter::sInstances.end(); ++iter) { avatarp = *iter; - sInstance->impl.mAvatarPauseHandles.push_back(avatarp->requestPause()); + floaterp->impl.mAvatarPauseHandles.push_back(avatarp->requestPause()); } // freeze everything else @@ -1194,7 +1196,7 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) if (LLToolMgr::getInstance()->getCurrentToolset() != gCameraToolset) { - sInstance->impl.mLastToolset = LLToolMgr::getInstance()->getCurrentToolset(); + floaterp->impl.mLastToolset = LLToolMgr::getInstance()->getCurrentToolset(); LLToolMgr::getInstance()->setCurrentToolset(gCameraToolset); } } @@ -1209,15 +1211,15 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) } //RN: thaw all avatars - sInstance->impl.mAvatarPauseHandles.clear(); + floaterp->impl.mAvatarPauseHandles.clear(); // thaw everything else gSavedSettings.setBOOL("FreezeTime", FALSE); // restore last tool (e.g. pie menu, etc) - if (sInstance->impl.mLastToolset) + if (floaterp->impl.mLastToolset) { - LLToolMgr::getInstance()->setCurrentToolset(sInstance->impl.mLastToolset); + LLToolMgr::getInstance()->setCurrentToolset(floaterp->impl.mLastToolset); } } } @@ -1248,7 +1250,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) floater->childSetVisible("upload_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE); floater->childSetVisible("send_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD); floater->childSetVisible("save_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); - floater->childSetEnabled("keep_aspect_check", shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !sAspectRatioCheckOff); + floater->childSetEnabled("keep_aspect_check", shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !floater->impl.mAspectRatioCheckOff); floater->childSetEnabled("layer_types", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); BOOL is_advance = gSavedSettings.getBOOL("AdvanceSnapshot"); @@ -1295,7 +1297,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) floater->childSetColor("file_size_label", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD && got_bytes - && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLColor4::red : gColors.getColor( "LabelTextColor" )); + && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLColor4::red : LLUI::sSettingGroups["color"]->getColor( "LabelTextColor" )); switch(shot_type) { @@ -1369,7 +1371,7 @@ void LLFloaterSnapshot::Impl::onClickDiscard(void* data) LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; if (view) { - view->close(); + view->closeFloater(); } } @@ -1415,7 +1417,7 @@ void LLFloaterSnapshot::Impl::onClickKeep(void* data) if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) { - view->close(); + view->closeFloater(); } else { @@ -1596,7 +1598,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde if(0 == index) //current window size { - sAspectRatioCheckOff = TRUE ; + view->impl.mAspectRatioCheckOff = TRUE ; view->childSetEnabled("keep_aspect_check", FALSE) ; if(previewp) @@ -1606,7 +1608,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde } else if(-1 == index) //custom { - sAspectRatioCheckOff = FALSE ; + view->impl.mAspectRatioCheckOff = FALSE ; //if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE != gSavedSettings.getS32("LastSnapshotType")) { view->childSetEnabled("keep_aspect_check", TRUE) ; @@ -1619,7 +1621,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde } else { - sAspectRatioCheckOff = TRUE ; + view->impl.mAspectRatioCheckOff = TRUE ; view->childSetEnabled("keep_aspect_check", FALSE) ; if(previewp) @@ -1955,21 +1957,17 @@ void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* dat ///---------------------------------------------------------------------------- // Default constructor -LLFloaterSnapshot::LLFloaterSnapshot() - : LLFloater(std::string("Snapshot Floater")), +LLFloaterSnapshot::LLFloaterSnapshot(const LLSD& key) + : LLFloater(key), impl (*(new Impl)) { + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_snapshot.xml", FALSE); } // Destroys the object LLFloaterSnapshot::~LLFloaterSnapshot() { - if (sInstance == this) - { - LLView::deleteViewByHandle(Impl::sPreviewHandle); - Impl::sPreviewHandle = LLHandle<LLView>(); - sInstance = NULL; - } + LLView::deleteViewByHandle(impl.mPreviewHandle); //unfreeze everything else gSavedSettings.setBOOL("FreezeTime", FALSE); @@ -2034,16 +2032,22 @@ BOOL LLFloaterSnapshot::postBuild() childSetCommitCallback("local_size_combo", Impl::onCommitResolution, this); // create preview window - LLRect full_screen_rect = sInstance->getRootView()->getRect(); - LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(full_screen_rect); - sInstance->getRootView()->removeChild(gSnapshotFloaterView); + LLRect full_screen_rect = getRootView()->getRect(); + LLSnapshotLivePreview::Params p; + p.rect(full_screen_rect); + LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); + getRootView()->removeChild(gSnapshotFloaterView); // make sure preview is below snapshot floater - sInstance->getRootView()->addChild(previewp); - sInstance->getRootView()->addChild(gSnapshotFloaterView); - - Impl::sPreviewHandle = previewp->getHandle(); + getRootView()->addChild(previewp); + getRootView()->addChild(gSnapshotFloaterView); + + //move snapshot floater to special purpose snapshotfloaterview + gFloaterView->removeChild(this); + gSnapshotFloaterView->addChild(this); + impl.mPreviewHandle = previewp->getHandle(); impl.updateControls(this); + impl.updateLayout(this); return TRUE; } @@ -2077,54 +2081,34 @@ void LLFloaterSnapshot::draw() } } -void LLFloaterSnapshot::onClose(bool app_quitting) -{ - gSnapshotFloaterView->setEnabled(FALSE); - // Set invisible so it doesn't eat tooltips. JC - gSnapshotFloaterView->setVisible(FALSE); - destroy(); -} - -// static -void LLFloaterSnapshot::show(void*) +void LLFloaterSnapshot::onOpen(const LLSD& key) { - if (!sInstance) - { - sInstance = new LLFloaterSnapshot(); - LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_snapshot.xml", NULL, FALSE); - //move snapshot floater to special purpose snapshotfloaterview - gFloaterView->removeChild(sInstance); - gSnapshotFloaterView->addChild(sInstance); - - sInstance->impl.updateLayout(sInstance); - } - else // just refresh the snapshot in the existing floater instance (DEV-12255) + LLSnapshotLivePreview* preview = LLFloaterSnapshot::Impl::getPreviewView(this); + if(preview) { - LLSnapshotLivePreview* preview = LLFloaterSnapshot::Impl::getPreviewView(sInstance); - if(preview) - { - preview->updateSnapshot(TRUE); - } + preview->updateSnapshot(TRUE); } - - sInstance->open(); /* Flawfinder: ignore */ - sInstance->focusFirstItem(FALSE); + focusFirstItem(FALSE); gSnapshotFloaterView->setEnabled(TRUE); gSnapshotFloaterView->setVisible(TRUE); - gSnapshotFloaterView->adjustToFitScreen(sInstance, FALSE); + gSnapshotFloaterView->adjustToFitScreen(this, FALSE); } -void LLFloaterSnapshot::hide(void*) +void LLFloaterSnapshot::onClose(bool app_quitting) { - if (sInstance && !sInstance->isDead()) - { - sInstance->close(); - } + gSnapshotFloaterView->setEnabled(FALSE); + // Set invisible so it doesn't eat tooltips. JC + gSnapshotFloaterView->setVisible(FALSE); + destroy(); } //static void LLFloaterSnapshot::update() { + LLFloaterSnapshot* inst = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot"); + if (!inst) + return; + BOOL changed = FALSE; for (std::set<LLSnapshotLivePreview*>::iterator iter = LLSnapshotLivePreview::sList.begin(); iter != LLSnapshotLivePreview::sList.end(); ++iter) @@ -2133,7 +2117,7 @@ void LLFloaterSnapshot::update() } if(changed) { - sInstance->impl.updateControls(sInstance); + inst->impl.updateControls(inst); } } @@ -2142,10 +2126,8 @@ void LLFloaterSnapshot::update() /// Class LLSnapshotFloaterView ///---------------------------------------------------------------------------- -LLSnapshotFloaterView::LLSnapshotFloaterView( const std::string& name, const LLRect& rect ) : LLFloaterView(name, rect) +LLSnapshotFloaterView::LLSnapshotFloaterView (const Params& p) : LLFloaterView (p) { - setMouseOpaque(TRUE); - setEnabled(FALSE); } LLSnapshotFloaterView::~LLSnapshotFloaterView() diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index 14f1872cd14e99330c4a80bfc7b288c7553a0aa0..1333497bd25f1211aad2746d177b8001e6d17f5e 100644 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -35,10 +35,6 @@ #include "llfloater.h" -#include "llmemory.h" -#include "llimagegl.h" -#include "llcharacter.h" - class LLFloaterSnapshot : public LLFloater { @@ -50,17 +46,16 @@ public: SNAPSHOT_FORMAT_BMP } ESnapshotFormat; - LLFloaterSnapshot(); + LLFloaterSnapshot(const LLSD& key); virtual ~LLFloaterSnapshot(); - + /*virtual*/ BOOL postBuild(); /*virtual*/ void draw(); + /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onClose(bool app_quitting); - - static void show(void*); - static void hide(void*); + static void update(); - + static S32 getUIWinHeightLong() {return sUIWinHeightLong ;} static S32 getUIWinHeightShort() {return sUIWinHeightShort ;} static S32 getUIWinWidth() {return sUIWinWidth ;} @@ -69,7 +64,6 @@ private: class Impl; Impl& impl; - static LLFloaterSnapshot* sInstance; static S32 sUIWinHeightLong ; static S32 sUIWinHeightShort ; static S32 sUIWinWidth ; @@ -78,7 +72,16 @@ private: class LLSnapshotFloaterView : public LLFloaterView { public: - LLSnapshotFloaterView( const std::string& name, const LLRect& rect ); + struct Params + : public LLInitParam::Block<Params, LLFloaterView::Params> + { + }; + +protected: + LLSnapshotFloaterView (const Params& p); + friend class LLUICtrlFactory; + +public: virtual ~LLSnapshotFloaterView(); /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); diff --git a/indra/newview/llfloatertelehub.cpp b/indra/newview/llfloatertelehub.cpp index 530bb87983d4a2c1777324081c5d65f002990ef1..1d2d3b98f245a5eceb0c9b5cf756216124465e02 100644 --- a/indra/newview/llfloatertelehub.cpp +++ b/indra/newview/llfloatertelehub.cpp @@ -81,7 +81,7 @@ void LLFloaterTelehub::show() } LLFloaterTelehub::LLFloaterTelehub() -: LLFloater(std::string("telehub")), +: LLFloater(), mTelehubObjectID(), mTelehubObjectName(), mTelehubPos(), @@ -94,6 +94,11 @@ LLFloaterTelehub::LLFloaterTelehub() LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_telehub.xml"); + mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); +} +BOOL LLFloaterTelehub::postBuild() +{ + childSetAction("connect_btn", onClickConnect, this); childSetAction("disconnect_btn", onClickDisconnect, this); childSetAction("add_spawn_point_btn", onClickAddSpawnPoint, this); @@ -106,9 +111,8 @@ LLFloaterTelehub::LLFloaterTelehub() list->setAllowKeyboardMovement(FALSE); } - mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); + return TRUE; } - LLFloaterTelehub::~LLFloaterTelehub() { sInstance = NULL; diff --git a/indra/newview/llfloatertelehub.h b/indra/newview/llfloatertelehub.h index 28c9d16573aefcf79bad6f41edeb719ca3f117db..b639338dfcefaa4e2a37c63fb89be2129f0f74d7 100644 --- a/indra/newview/llfloatertelehub.h +++ b/indra/newview/llfloatertelehub.h @@ -48,7 +48,7 @@ public: static void show(); virtual void draw(); - + /*virtual*/ BOOL postBuild(); static BOOL renderBeacons(); static void addBeacons(); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index a33b49563c4581bb62bf9294e5a19471a588a794..62a8c0d27e69e80fa1228696e007eb9f15b130ed 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -54,6 +54,7 @@ #include "llpanelobject.h" #include "llpanelvolume.h" #include "llpanelpermissions.h" +#include "llradiogroup.h" #include "llresmgr.h" #include "llselectmgr.h" #include "llslider.h" @@ -95,25 +96,21 @@ const std::string PANEL_NAMES[LLFloaterTools::PANEL_COUNT] = }; // Local prototypes -void commit_select_tool(LLUICtrl *ctrl, void *data); void commit_select_component(LLUICtrl *ctrl, void *data); void click_show_more(void*); void click_popup_info(void*); void click_popup_done(void*); void click_popup_minimize(void*); -void click_popup_grab_drag(LLUICtrl *, void*); -void click_popup_grab_lift(LLUICtrl *, void*); -void click_popup_grab_spin(LLUICtrl *, void*); void click_popup_rotate_left(void*); void click_popup_rotate_reset(void*); void click_popup_rotate_right(void*); -void click_popup_dozer_mode(LLUICtrl *, void *user); void commit_slider_dozer_size(LLUICtrl *, void*); void commit_slider_dozer_force(LLUICtrl *, void*); void click_apply_to_selection(void*); -void commit_radio_zoom(LLUICtrl *, void*); -void commit_radio_orbit(LLUICtrl *, void*); -void commit_radio_pan(LLUICtrl *, void*); +void commit_radio_group_focus(LLUICtrl* ctrl, void* data); +void commit_radio_group_move(LLUICtrl* ctrl, void* data); +void commit_radio_group_edit(LLUICtrl* ctrl, void* data); +void commit_radio_group_land(LLUICtrl* ctrl, void* data); void commit_grid_mode(LLUICtrl *, void*); void commit_slider_zoom(LLUICtrl *, void*); @@ -122,14 +119,14 @@ void commit_slider_zoom(LLUICtrl *, void*); void* LLFloaterTools::createPanelPermissions(void* data) { LLFloaterTools* floater = (LLFloaterTools*)data; - floater->mPanelPermissions = new LLPanelPermissions("General"); + floater->mPanelPermissions = new LLPanelPermissions(); return floater->mPanelPermissions; } //static void* LLFloaterTools::createPanelObject(void* data) { LLFloaterTools* floater = (LLFloaterTools*)data; - floater->mPanelObject = new LLPanelObject("Object"); + floater->mPanelObject = new LLPanelObject(); return floater->mPanelObject; } @@ -137,7 +134,7 @@ void* LLFloaterTools::createPanelObject(void* data) void* LLFloaterTools::createPanelVolume(void* data) { LLFloaterTools* floater = (LLFloaterTools*)data; - floater->mPanelVolume = new LLPanelVolume("Features"); + floater->mPanelVolume = new LLPanelVolume(); return floater->mPanelVolume; } @@ -145,7 +142,7 @@ void* LLFloaterTools::createPanelVolume(void* data) void* LLFloaterTools::createPanelFace(void* data) { LLFloaterTools* floater = (LLFloaterTools*)data; - floater->mPanelFace = new LLPanelFace("Texture"); + floater->mPanelFace = new LLPanelFace(); return floater->mPanelFace; } @@ -153,26 +150,51 @@ void* LLFloaterTools::createPanelFace(void* data) void* LLFloaterTools::createPanelContents(void* data) { LLFloaterTools* floater = (LLFloaterTools*)data; - floater->mPanelContents = new LLPanelContents("Contents"); + floater->mPanelContents = new LLPanelContents(); return floater->mPanelContents; } -//static -void* LLFloaterTools::createPanelContentsInventory(void* data) -{ - LLFloaterTools* floater = (LLFloaterTools*)data; - floater->mPanelContents->mPanelInventory = new LLPanelInventory(std::string("ContentsInventory"), LLRect()); - return floater->mPanelContents->mPanelInventory; -} - //static void* LLFloaterTools::createPanelLandInfo(void* data) { LLFloaterTools* floater = (LLFloaterTools*)data; - floater->mPanelLandInfo = new LLPanelLandInfo(std::string("land info panel")); + floater->mPanelLandInfo = new LLPanelLandInfo(); return floater->mPanelLandInfo; } +static const std::string toolNames[]={ + "ToolCube", + "ToolPrism", + "ToolPyramid", + "ToolTetrahedron", + "ToolCylinder", + "ToolHemiCylinder", + "ToolCone", + "ToolHemiCone", + "ToolSphere", + "ToolHemiSphere", + "ToolTorus", + "ToolTube", + "ToolRing", + "ToolTree", + "ToolGrass"}; +LLPCode toolData[]={ + LL_PCODE_CUBE, + LL_PCODE_PRISM, + LL_PCODE_PYRAMID, + LL_PCODE_TETRAHEDRON, + LL_PCODE_CYLINDER, + LL_PCODE_CYLINDER_HEMI, + LL_PCODE_CONE, + LL_PCODE_CONE_HEMI, + LL_PCODE_SPHERE, + LL_PCODE_SPHERE_HEMI, + LL_PCODE_TORUS, + LLViewerObject::LL_VO_SQUARE_TORUS, + LLViewerObject::LL_VO_TRIANGLE_TORUS, + LL_PCODE_LEGACY_TREE, + LL_PCODE_LEGACY_GRASS}; + BOOL LLFloaterTools::postBuild() { @@ -200,27 +222,15 @@ BOOL LLFloaterTools::postBuild() childSetCommitCallback("slider zoom",commit_slider_zoom,this); - mRadioZoom = getChild<LLCheckBoxCtrl>("radio zoom"); - childSetCommitCallback("radio zoom",commit_radio_zoom,this); - mRadioOrbit = getChild<LLCheckBoxCtrl>("radio orbit"); - childSetCommitCallback("radio orbit",commit_radio_orbit,this); - mRadioPan = getChild<LLCheckBoxCtrl>("radio pan"); - childSetCommitCallback("radio pan",commit_radio_pan,this); - - mRadioMove = getChild<LLCheckBoxCtrl>("radio move"); - childSetCommitCallback("radio move",click_popup_grab_drag,this); - mRadioLift = getChild<LLCheckBoxCtrl>("radio lift"); - childSetCommitCallback("radio lift",click_popup_grab_lift,this); - mRadioSpin = getChild<LLCheckBoxCtrl>("radio spin"); - childSetCommitCallback("radio spin",click_popup_grab_spin,NULL); - mRadioPosition = getChild<LLCheckBoxCtrl>("radio position"); - childSetCommitCallback("radio position",commit_select_tool,LLToolCompTranslate::getInstance()); - mRadioRotate = getChild<LLCheckBoxCtrl>("radio rotate"); - childSetCommitCallback("radio rotate",commit_select_tool,LLToolCompRotate::getInstance()); - mRadioStretch = getChild<LLCheckBoxCtrl>("radio stretch"); - childSetCommitCallback("radio stretch",commit_select_tool,LLToolCompScale::getInstance()); - mRadioSelectFace = getChild<LLCheckBoxCtrl>("radio select face"); - childSetCommitCallback("radio select face",commit_select_tool,LLToolFace::getInstance()); + mRadioGroupFocus = getChild<LLRadioGroup>("focus_radio_group"); + childSetCommitCallback("focus_radio_group", commit_radio_group_focus, this); + + mRadioGroupMove = getChild<LLRadioGroup>("move_radio_group"); + childSetCommitCallback("move_radio_group", commit_radio_group_move, this); + + mRadioGroupEdit = getChild<LLRadioGroup>("edit_radio_group"); + childSetCommitCallback("edit_radio_group", commit_radio_group_edit, this); + mCheckSelectIndividual = getChild<LLCheckBoxCtrl>("checkbox edit linked parts"); childSetValue("checkbox edit linked parts",(BOOL)gSavedSettings.getBOOL("EditLinkedParts")); childSetCommitCallback("checkbox edit linked parts",commit_select_component,this); @@ -239,44 +249,12 @@ BOOL LLFloaterTools::postBuild() // Create Buttons // - static const std::string toolNames[]={ - "ToolCube", - "ToolPrism", - "ToolPyramid", - "ToolTetrahedron", - "ToolCylinder", - "ToolHemiCylinder", - "ToolCone", - "ToolHemiCone", - "ToolSphere", - "ToolHemiSphere", - "ToolTorus", - "ToolTube", - "ToolRing", - "ToolTree", - "ToolGrass"}; - void* toolData[]={ - &LLToolPlacerPanel::sCube, - &LLToolPlacerPanel::sPrism, - &LLToolPlacerPanel::sPyramid, - &LLToolPlacerPanel::sTetrahedron, - &LLToolPlacerPanel::sCylinder, - &LLToolPlacerPanel::sCylinderHemi, - &LLToolPlacerPanel::sCone, - &LLToolPlacerPanel::sConeHemi, - &LLToolPlacerPanel::sSphere, - &LLToolPlacerPanel::sSphereHemi, - &LLToolPlacerPanel::sTorus, - &LLToolPlacerPanel::sSquareTorus, - &LLToolPlacerPanel::sTriangleTorus, - &LLToolPlacerPanel::sTree, - &LLToolPlacerPanel::sGrass}; for(size_t t=0; t<LL_ARRAY_SIZE(toolNames); ++t) { LLButton *found = getChild<LLButton>(toolNames[t]); if(found) { - found->setClickedCallback(setObjectType,toolData[t]); + found->setClickedCallback(boost::bind(&LLFloaterTools::setObjectType, toolData[t])); mButtons.push_back( found ); }else{ llwarns << "Tool button not found! DOA Pending." << llendl; @@ -290,20 +268,10 @@ BOOL LLFloaterTools::postBuild() childSetValue("checkbox copy centers",(BOOL)gSavedSettings.getBOOL("CreateToolCopyCenters")); mCheckCopyRotates = getChild<LLCheckBoxCtrl>("checkbox copy rotates"); childSetValue("checkbox copy rotates",(BOOL)gSavedSettings.getBOOL("CreateToolCopyRotates")); - mRadioSelectLand = getChild<LLCheckBoxCtrl>("radio select land"); - childSetCommitCallback("radio select land",commit_select_tool, LLToolSelectLand::getInstance()); - mRadioDozerFlatten = getChild<LLCheckBoxCtrl>("radio flatten"); - childSetCommitCallback("radio flatten",click_popup_dozer_mode, (void*)0); - mRadioDozerRaise = getChild<LLCheckBoxCtrl>("radio raise"); - childSetCommitCallback("radio raise",click_popup_dozer_mode, (void*)1); - mRadioDozerLower = getChild<LLCheckBoxCtrl>("radio lower"); - childSetCommitCallback("radio lower",click_popup_dozer_mode, (void*)2); - mRadioDozerSmooth = getChild<LLCheckBoxCtrl>("radio smooth"); - childSetCommitCallback("radio smooth",click_popup_dozer_mode, (void*)3); - mRadioDozerNoise = getChild<LLCheckBoxCtrl>("radio noise"); - childSetCommitCallback("radio noise",click_popup_dozer_mode, (void*)4); - mRadioDozerRevert = getChild<LLCheckBoxCtrl>("radio revert"); - childSetCommitCallback("radio revert",click_popup_dozer_mode, (void*)5); + + mRadioGroupLand = getChild<LLRadioGroup>("land_radio_group"); + childSetCommitCallback("land_radio_group", commit_radio_group_land, this); + mBtnApplyToSelection = getChild<LLButton>("button apply to selection"); childSetAction("button apply to selection",click_apply_to_selection, (void*)0); @@ -338,8 +306,8 @@ BOOL LLFloaterTools::postBuild() // Create the popupview with a dummy center. It will be moved into place // during LLViewerWindow's per-frame hover processing. -LLFloaterTools::LLFloaterTools() -: LLFloater(std::string("toolbox floater")), +LLFloaterTools::LLFloaterTools(const LLSD& key) +: LLFloater(key), mBtnFocus(NULL), mBtnMove(NULL), mBtnEdit(NULL), @@ -347,18 +315,10 @@ LLFloaterTools::LLFloaterTools() mBtnLand(NULL), mTextStatus(NULL), - mRadioOrbit(NULL), - mRadioZoom(NULL), - mRadioPan(NULL), - - mRadioMove(NULL), - mRadioLift(NULL), - mRadioSpin(NULL), + mRadioGroupFocus(NULL), + mRadioGroupMove(NULL), + mRadioGroupEdit(NULL), - mRadioPosition(NULL), - mRadioRotate(NULL), - mRadioStretch(NULL), - mRadioSelectFace(NULL), mCheckSelectIndividual(NULL), mCheckSnapToGrid(NULL), @@ -380,13 +340,7 @@ LLFloaterTools::LLFloaterTools() mCheckCopySelection(NULL), mCheckCopyCenters(NULL), mCheckCopyRotates(NULL), - mRadioSelectLand(NULL), - mRadioDozerFlatten(NULL), - mRadioDozerRaise(NULL), - mRadioDozerLower(NULL), - mRadioDozerSmooth(NULL), - mRadioDozerNoise(NULL), - mRadioDozerRevert(NULL), + mRadioGroupLand(NULL), mSliderDozerSize(NULL), mSliderDozerForce(NULL), mBtnApplyToSelection(NULL), @@ -402,22 +356,23 @@ LLFloaterTools::LLFloaterTools() mTabLand(NULL), mDirty(TRUE) { + gFloaterTools = this; + setAutoFocus(FALSE); - LLCallbackMap::map_t factory_map; - factory_map["General"] = LLCallbackMap(createPanelPermissions, this);//LLPanelPermissions - factory_map["Object"] = LLCallbackMap(createPanelObject, this);//LLPanelObject - factory_map["Features"] = LLCallbackMap(createPanelVolume, this);//LLPanelVolume - factory_map["Texture"] = LLCallbackMap(createPanelFace, this);//LLPanelFace - factory_map["Contents"] = LLCallbackMap(createPanelContents, this);//LLPanelContents - factory_map["ContentsInventory"] = LLCallbackMap(createPanelContentsInventory, this);//LLPanelContents - factory_map["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo - - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_tools.xml",&factory_map,FALSE); + mFactoryMap["General"] = LLCallbackMap(createPanelPermissions, this);//LLPanelPermissions + mFactoryMap["Object"] = LLCallbackMap(createPanelObject, this);//LLPanelObject + mFactoryMap["Features"] = LLCallbackMap(createPanelVolume, this);//LLPanelVolume + mFactoryMap["Texture"] = LLCallbackMap(createPanelFace, this);//LLPanelFace + mFactoryMap["Contents"] = LLCallbackMap(createPanelContents, this);//LLPanelContents + mFactoryMap["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo + + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_tools.xml",FALSE); } LLFloaterTools::~LLFloaterTools() { // children automatically deleted + gFloaterTools = NULL; } void LLFloaterTools::setStatusText(const std::string& text) @@ -525,26 +480,31 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) mBtnFocus ->setToggleState( focus_visible ); - mRadioZoom ->setVisible( focus_visible ); - mRadioOrbit ->setVisible( focus_visible ); - mRadioPan ->setVisible( focus_visible ); + mRadioGroupFocus->setVisible( focus_visible ); childSetVisible("slider zoom", focus_visible); childSetEnabled("slider zoom", gCameraBtnZoom); - mRadioZoom ->set( !gCameraBtnOrbit && - !gCameraBtnPan && - !(mask == MASK_ORBIT) && - !(mask == (MASK_ORBIT | MASK_ALT)) && - !(mask == MASK_PAN) && - !(mask == (MASK_PAN | MASK_ALT)) ); - - mRadioOrbit ->set( gCameraBtnOrbit || - (mask == MASK_ORBIT) || - (mask == (MASK_ORBIT | MASK_ALT)) ); - - mRadioPan ->set( gCameraBtnPan || - (mask == MASK_PAN) || - (mask == (MASK_PAN | MASK_ALT)) ); + if (!gCameraBtnOrbit && + !gCameraBtnPan && + !(mask == MASK_ORBIT) && + !(mask == (MASK_ORBIT | MASK_ALT)) && + !(mask == MASK_PAN) && + !(mask == (MASK_PAN | MASK_ALT)) ) + { + mRadioGroupFocus->setValue("radio zoom"); + } + else if ( gCameraBtnOrbit || + (mask == MASK_ORBIT) || + (mask == (MASK_ORBIT | MASK_ALT)) ) + { + mRadioGroupFocus->setValue("radio orbit"); + } + else if ( gCameraBtnPan || + (mask == MASK_PAN) || + (mask == (MASK_PAN | MASK_ALT)) ) + { + mRadioGroupFocus->setValue("radio pan"); + } // multiply by correction factor because volume sliders go [0, 0.5] childSetValue( "slider zoom", gAgent.getCameraZoomFraction() * 0.5f); @@ -555,27 +515,23 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) if (mBtnMove) mBtnMove ->setToggleState( move_visible ); // HACK - highlight buttons for next click - if (mRadioMove) + mRadioGroupMove->setVisible(move_visible); + if (!gGrabBtnSpin && + !gGrabBtnVertical && + !(mask == MASK_VERTICAL) && + !(mask == MASK_SPIN) ) { - mRadioMove ->setVisible( move_visible ); - mRadioMove ->set( !gGrabBtnSpin && - !gGrabBtnVertical && - !(mask == MASK_VERTICAL) && - !(mask == MASK_SPIN) ); + mRadioGroupMove->setValue("radio move"); } - - if (mRadioLift) + else if (gGrabBtnVertical || + (mask == MASK_VERTICAL) ) { - mRadioLift ->setVisible( move_visible ); - mRadioLift ->set( gGrabBtnVertical || - (mask == MASK_VERTICAL) ); + mRadioGroupMove->setValue("radio lift"); } - - if (mRadioSpin) + else if (gGrabBtnSpin || + (mask == MASK_SPIN) ) { - mRadioSpin ->setVisible( move_visible ); - mRadioSpin ->set( gGrabBtnSpin || - (mask == MASK_SPIN) ); + mRadioGroupMove->setValue("radio spin"); } // Edit buttons @@ -587,15 +543,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) tool == LLToolPipette::getInstance(); mBtnEdit ->setToggleState( edit_visible ); - - mRadioPosition ->setVisible( edit_visible ); - mRadioRotate ->setVisible( edit_visible ); - mRadioStretch ->setVisible( edit_visible ); - if (mRadioSelectFace) - { - mRadioSelectFace->setVisible( edit_visible ); - mRadioSelectFace->set( tool == LLToolFace::getInstance() ); - } + mRadioGroupEdit->setVisible( edit_visible ); if (mCheckSelectIndividual) { @@ -603,9 +551,22 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) //mCheckSelectIndividual->set(gSavedSettings.getBOOL("EditLinkedParts")); } - mRadioPosition ->set( tool == LLToolCompTranslate::getInstance() ); - mRadioRotate ->set( tool == LLToolCompRotate::getInstance() ); - mRadioStretch ->set( tool == LLToolCompScale::getInstance() ); + if ( tool == LLToolCompTranslate::getInstance() ) + { + mRadioGroupEdit->setValue("radio position"); + } + else if ( tool == LLToolCompRotate::getInstance() ) + { + mRadioGroupEdit->setValue("radio rotate"); + } + else if ( tool == LLToolCompScale::getInstance() ) + { + mRadioGroupEdit->setValue("radio stretch"); + } + else if ( tool == LLToolFace::getInstance() ) + { + mRadioGroupEdit->setValue("radio select face"); + } if (mComboGridMode) { @@ -662,15 +623,13 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) else { // Highlight the correct placer button - for( std::vector<LLButton*>::size_type i = 0; i < mButtons.size(); i++ ) + for( S32 t = 0; t < (S32)mButtons.size(); t++ ) { LLPCode pcode = LLToolPlacer::getObjectType(); - void *userdata = mButtons[i]->getCallbackUserData(); - LLPCode *cur = (LLPCode*) userdata; - - BOOL state = (pcode == *cur); - mButtons[i]->setToggleState( state ); - mButtons[i]->setVisible( create_visible ); + LLPCode button_pcode = toolData[t]; + BOOL state = (pcode == button_pcode); + mButtons[t]->setToggleState( state ); + mButtons[t]->setVisible( create_visible ); } } @@ -687,44 +646,39 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) if (mBtnLand) mBtnLand ->setToggleState( land_visible ); - // mRadioEditLand ->set( tool == LLToolBrushLand::getInstance() ); - if (mRadioSelectLand) mRadioSelectLand->set( tool == LLToolSelectLand::getInstance() ); - - // mRadioEditLand ->setVisible( land_visible ); - if (mRadioSelectLand) mRadioSelectLand->setVisible( land_visible ); - - S32 dozer_mode = gSavedSettings.getS32("RadioLandBrushAction"); - - if (mRadioDozerFlatten) + mRadioGroupLand->setVisible( land_visible ); + if ( tool == LLToolSelectLand::getInstance() ) { - mRadioDozerFlatten ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 0); - mRadioDozerFlatten ->setVisible( land_visible ); + mRadioGroupLand->setValue("radio select land"); } - if (mRadioDozerRaise) + else if ( tool == LLToolBrushLand::getInstance() ) { - mRadioDozerRaise ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 1); - mRadioDozerRaise ->setVisible( land_visible ); - } - if (mRadioDozerLower) - { - mRadioDozerLower ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 2); - mRadioDozerLower ->setVisible( land_visible ); - } - if (mRadioDozerSmooth) - { - mRadioDozerSmooth ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 3); - mRadioDozerSmooth ->setVisible( land_visible ); - } - if (mRadioDozerNoise) - { - mRadioDozerNoise ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 4); - mRadioDozerNoise ->setVisible( land_visible ); - } - if (mRadioDozerRevert) - { - mRadioDozerRevert ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 5); - mRadioDozerRevert ->setVisible( land_visible ); + S32 dozer_mode = gSavedSettings.getS32("RadioLandBrushAction"); + switch(dozer_mode) + { + case 0: + mRadioGroupLand->setValue("radio flatten"); + break; + case 1: + mRadioGroupLand->setValue("radio raise"); + break; + case 2: + mRadioGroupLand->setValue("radio lower"); + break; + case 3: + mRadioGroupLand->setValue("radio smooth"); + break; + case 4: + mRadioGroupLand->setValue("radio noise"); + break; + case 5: + mRadioGroupLand->setValue("radio revert"); + break; + default: + break; + } } + if (mBtnApplyToSelection) { mBtnApplyToSelection->setVisible( land_visible ); @@ -757,13 +711,18 @@ BOOL LLFloaterTools::canClose() } // virtual -void LLFloaterTools::onOpen() +void LLFloaterTools::onOpen(const LLSD& key) { mParcelSelection = LLViewerParcelMgr::getInstance()->getFloatingParcelSelection(); mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); - // gMenuBarView->setItemVisible(std::string("Tools"), TRUE); - // gMenuBarView->arrange(); + std::string panel = key.asString(); + if (!panel.empty()) + { + mTab->selectTabByName(panel); + } + + gMenuBarView->setItemVisible("BuildTools", TRUE); } // virtual @@ -796,19 +755,11 @@ void LLFloaterTools::onClose(bool app_quitting) // so manually reset tool to default (pie menu tool) LLToolMgr::getInstance()->getCurrentToolset()->selectFirstTool(); - // gMenuBarView->setItemVisible(std::string("Tools"), FALSE); - // gMenuBarView->arrange(); -} - -void LLFloaterTools::showPanel(EInfoPanel panel) -{ - llassert(panel >= 0 && panel < PANEL_COUNT); - mTab->selectTabByName(PANEL_NAMES[panel]); + gMenuBarView->setItemVisible("BuildTools", FALSE); } void click_popup_info(void*) { -// gBuildView->setPropertiesPanelOpen(TRUE); } void click_popup_done(void*) @@ -816,43 +767,49 @@ void click_popup_done(void*) handle_reset_view(); } -void click_popup_grab_drag(LLUICtrl*, void*) +void commit_radio_group_move(LLUICtrl* ctrl, void* data) { - gGrabBtnVertical = FALSE; - gGrabBtnSpin = FALSE; -} - -void click_popup_grab_lift(LLUICtrl*, void*) -{ - gGrabBtnVertical = TRUE; - gGrabBtnSpin = FALSE; -} - -void click_popup_grab_spin(LLUICtrl*, void*) -{ - gGrabBtnVertical = FALSE; - gGrabBtnSpin = TRUE; -} - -void commit_radio_zoom(LLUICtrl *, void*) -{ - gCameraBtnZoom = TRUE; - gCameraBtnOrbit = FALSE; - gCameraBtnPan = FALSE; -} - -void commit_radio_orbit(LLUICtrl *, void*) -{ - gCameraBtnZoom = FALSE; - gCameraBtnOrbit = TRUE; - gCameraBtnPan = FALSE; + LLRadioGroup* group = (LLRadioGroup*)ctrl; + std::string selected = group->getValue().asString(); + if (selected == "radio move") + { + gGrabBtnVertical = FALSE; + gGrabBtnSpin = FALSE; + } + else if (selected == "radio lift") + { + gGrabBtnVertical = TRUE; + gGrabBtnSpin = FALSE; + } + else if (selected == "radio spin") + { + gGrabBtnVertical = FALSE; + gGrabBtnSpin = TRUE; + } } -void commit_radio_pan(LLUICtrl *, void*) +void commit_radio_group_focus(LLUICtrl* ctrl, void* data) { - gCameraBtnZoom = FALSE; - gCameraBtnOrbit = FALSE; - gCameraBtnPan = TRUE; + LLRadioGroup* group = (LLRadioGroup*)ctrl; + std::string selected = group->getValue().asString(); + if (selected == "radio zoom") + { + gCameraBtnZoom = TRUE; + gCameraBtnOrbit = FALSE; + gCameraBtnPan = FALSE; + } + else if (selected == "radio orbit") + { + gCameraBtnZoom = FALSE; + gCameraBtnOrbit = TRUE; + gCameraBtnPan = FALSE; + } + else if (selected == "radio pan") + { + gCameraBtnZoom = FALSE; + gCameraBtnOrbit = FALSE; + gCameraBtnPan = TRUE; + } } void commit_slider_zoom(LLUICtrl *ctrl, void*) @@ -881,13 +838,6 @@ void click_popup_rotate_right(void*) } -void click_popup_dozer_mode(LLUICtrl *, void *user) -{ - S32 mode = (S32)(intptr_t) user; - gFloaterTools->setEditTool( LLToolBrushLand::getInstance() ); - gSavedSettings.setS32("RadioLandBrushAction", mode); -} - void commit_slider_dozer_size(LLUICtrl *ctrl, void*) { F32 size = (F32)ctrl->getValue().asReal(); @@ -901,21 +851,64 @@ void commit_slider_dozer_force(LLUICtrl *ctrl, void*) gSavedSettings.setF32("LandBrushForce", dozer_force); } - - - void click_apply_to_selection(void* user) { LLToolBrushLand::getInstance()->modifyLandInSelectionGlobal(); } -void commit_select_tool(LLUICtrl *ctrl, void *data) +void commit_radio_group_edit(LLUICtrl *ctrl, void *data) { S32 show_owners = gSavedSettings.getBOOL("ShowParcelOwners"); - gFloaterTools->setEditTool(data); + + LLRadioGroup* group = (LLRadioGroup*)ctrl; + std::string selected = group->getValue().asString(); + if (selected == "radio position") + { + LLFloaterTools::setEditTool( LLToolCompTranslate::getInstance() ); + } + else if (selected == "radio rotate") + { + LLFloaterTools::setEditTool( LLToolCompRotate::getInstance() ); + } + else if (selected == "radio stretch") + { + LLFloaterTools::setEditTool( LLToolCompScale::getInstance() ); + } + else if (selected == "radio select face") + { + LLFloaterTools::setEditTool( LLToolFace::getInstance() ); + } gSavedSettings.setBOOL("ShowParcelOwners", show_owners); } +void commit_radio_group_land(LLUICtrl* ctrl, void* data) +{ + LLRadioGroup* group = (LLRadioGroup*)ctrl; + std::string selected = group->getValue().asString(); + if (selected == "radio select land") + { + LLFloaterTools::setEditTool( LLToolSelectLand::getInstance() ); + } + else + { + LLFloaterTools::setEditTool( LLToolBrushLand::getInstance() ); + S32 dozer_mode = gSavedSettings.getS32("RadioLandBrushAction"); + if (selected == "radio flatten") + dozer_mode = 0; + else if (selected == "radio raise") + dozer_mode = 1; + else if (selected == "radio lower") + dozer_mode = 2; + else if (selected == "radio smooth") + dozer_mode = 3; + else if (selected == "radio noise") + dozer_mode = 4; + else if (selected == "radio revert") + dozer_mode = 5; + gSavedSettings.setS32("RadioLandBrushAction", dozer_mode); + } +} + void commit_select_component(LLUICtrl *ctrl, void *data) { LLFloaterTools* floaterp = (LLFloaterTools*)data; @@ -948,9 +941,8 @@ void commit_grid_mode(LLUICtrl *ctrl, void *data) } // static -void LLFloaterTools::setObjectType( void* data ) +void LLFloaterTools::setObjectType( LLPCode pcode ) { - LLPCode pcode = *(LLPCode*) data; LLToolPlacer::setObjectType( pcode ); gSavedSettings.setBOOL("CreateToolCopySelection", FALSE); gFocusMgr.setMouseCapture(NULL); @@ -960,14 +952,16 @@ void LLFloaterTools::setObjectType( void* data ) void LLFloaterTools::onClickGridOptions(void* data) { //LLFloaterTools* floaterp = (LLFloaterTools*)data; - LLFloaterBuildOptions::show(NULL); + LLFloaterBuildOptions::showInstance(); // RN: this makes grid options dependent on build tools window //floaterp->addDependentFloater(LLFloaterBuildOptions::getInstance(), FALSE); } +// static void LLFloaterTools::setEditTool(void* tool_pointer) { - select_tool(tool_pointer); + LLTool *tool = (LLTool *)tool_pointer; + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( tool ); } void LLFloaterTools::onFocusReceived() diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h index 833a8a7b73ec278b862389a198fc917f9d3dee50..7bb072232acc6cb1dffe5f568a8956130d43508e 100644 --- a/indra/newview/llfloatertools.h +++ b/indra/newview/llfloatertools.h @@ -38,18 +38,20 @@ #include "llparcelselection.h" class LLButton; -class LLTextBox; -class LLTool; +class LLComboBox; class LLCheckBoxCtrl; -class LLTabContainer; class LLPanelPermissions; class LLPanelObject; class LLPanelVolume; class LLPanelContents; class LLPanelFace; class LLPanelLandInfo; -class LLComboBox; +class LLRadioCtrl; +class LLRadioGroup; class LLSlider; +class LLTabContainer; +class LLTextBox; +class LLTool; class LLParcelSelection; class LLObjectSelection; @@ -65,15 +67,16 @@ public: static void* createPanelVolume(void* vdata); static void* createPanelFace(void* vdata); static void* createPanelContents(void* vdata); - static void* createPanelContentsInventory(void* vdata); static void* createPanelLandInfo(void* vdata); - LLFloaterTools(); + LLFloaterTools(const LLSD& key); virtual ~LLFloaterTools(); - virtual void onOpen(); - virtual void onClose(bool app_quitting); - virtual BOOL canClose(); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ BOOL canClose(); + /*virtual*/ void draw(); + /*virtual*/ void onFocusReceived(); // call this once per frame to handle visibility, rect location, // button highlights, etc. @@ -93,24 +96,20 @@ public: PANEL_COUNT }; - /*virtual*/ void draw(); - void dirty(); void showPanel(EInfoPanel panel); void setStatusText(const std::string& text); - virtual void onFocusReceived(); static void setEditTool(void* data); void saveLastTool(); private: - static void setObjectType( void* data ); + static void setObjectType( LLPCode pcode ); void refresh(); static void onClickGridOptions(void* data); public: - LLButton *mBtnFocus; LLButton *mBtnMove; LLButton *mBtnEdit; @@ -120,20 +119,13 @@ public: LLTextBox *mTextStatus; // Focus buttons - LLCheckBoxCtrl *mRadioOrbit; - LLCheckBoxCtrl *mRadioZoom; - LLCheckBoxCtrl *mRadioPan; + LLRadioGroup* mRadioGroupFocus; // Move buttons - LLCheckBoxCtrl *mRadioMove; - LLCheckBoxCtrl *mRadioLift; - LLCheckBoxCtrl *mRadioSpin; + LLRadioGroup* mRadioGroupMove; // Edit buttons - LLCheckBoxCtrl *mRadioPosition; - LLCheckBoxCtrl *mRadioRotate; - LLCheckBoxCtrl *mRadioStretch; - LLCheckBoxCtrl *mRadioSelectFace; + LLRadioGroup* mRadioGroupEdit; LLCheckBoxCtrl *mCheckSelectIndividual; @@ -159,15 +151,7 @@ public: LLCheckBoxCtrl *mCheckCopyRotates; // Land buttons -// LLCheckBoxCtrl *mRadioEditLand; - LLCheckBoxCtrl *mRadioSelectLand; - - LLCheckBoxCtrl *mRadioDozerFlatten; - LLCheckBoxCtrl *mRadioDozerRaise; - LLCheckBoxCtrl *mRadioDozerLower; - LLCheckBoxCtrl *mRadioDozerSmooth; - LLCheckBoxCtrl *mRadioDozerNoise; - LLCheckBoxCtrl *mRadioDozerRevert; + LLRadioGroup* mRadioGroupLand; LLSlider *mSliderDozerSize; LLSlider *mSliderDozerForce; diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index fa6ba162ec9f16ffd8d6affe194b384291b3c932..29ac0c66f867177d5bd2fe8dd13e84c689c417c5 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -42,6 +42,8 @@ #include "llfloatergodtools.h" #include "llparcel.h" #include "llscrolllistctrl.h" +#include "llscrolllistitem.h" +#include "llscrolllistcell.h" #include "lllineeditor.h" #include "lltextbox.h" #include "lltracker.h" @@ -71,7 +73,7 @@ void LLFloaterTopObjects::show() } LLFloaterTopObjects::LLFloaterTopObjects() -: LLFloater(std::string("top_objects")), +: LLFloater(), mInitialized(FALSE), mtotalScore(0.f) { @@ -86,14 +88,11 @@ LLFloaterTopObjects::~LLFloaterTopObjects() // virtual BOOL LLFloaterTopObjects::postBuild() { - childSetCommitCallback("objects_list", onCommitObjectsList, this); - childSetDoubleClickCallback("objects_list", onDoubleClickObjectsList); - childSetFocus("objects_list"); LLScrollListCtrl *objects_list = getChild<LLScrollListCtrl>("objects_list"); - if (objects_list) - { - objects_list->setCommitOnSelectionChange(TRUE); - } + childSetFocus("objects_list"); + childSetCommitCallback("objects_list", onCommitObjectsList, this); + objects_list->setDoubleClickCallback(onDoubleClickObjectsList, this); + objects_list->setCommitOnSelectionChange(TRUE); childSetAction("show_beacon_btn", onClickShowBeacon, this); setDefaultBtn("show_beacon_btn"); @@ -114,16 +113,14 @@ BOOL LLFloaterTopObjects::postBuild() if (line_editor) { line_editor->setCommitOnFocusLost(FALSE); - line_editor->setCommitCallback(onGetByOwnerName); - line_editor->setCallbackUserData(this); + line_editor->setCommitCallback(onGetByOwnerName, this); } line_editor = getChild<LLLineEditor>("object_name_editor"); if (line_editor) { line_editor->setCommitOnFocusLost(FALSE); - line_editor->setCommitCallback(onGetByObjectName); - line_editor->setCallbackUserData(this); + line_editor->setCommitCallback(onGetByObjectName, this); }*/ mCurrentMode = STAT_REPORT_TOP_SCRIPTS; @@ -234,7 +231,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) if (total_count == 0 && list->getItemCount() == 0) { - list->addCommentText(getString("none_descriptor")); + list->setCommentText(getString("none_descriptor")); } else { diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 6a392e03fbca0c6edd2659da127959c282ebedc0..764a6a3498f56c93b164ef0f736b9eacd5589a52 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -254,7 +254,7 @@ void LLFloaterTOS::onContinue( void* userdata ) #endif LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); // Go back and finish authentication - self->close(); // destroys this object + self->closeFloater(); // destroys this object } // static @@ -265,7 +265,7 @@ void LLFloaterTOS::onCancel( void* userdata ) LLNotifications::instance().add("MustAgreeToLogIn", LLSD(), LLSD(), login_alert_done); LLStartUp::setStartupState( STATE_LOGIN_SHOW ); self->mLoadCompleteCount = 0; // reset counter for next time we come to TOS - self->close(); // destroys this object + self->closeFloater(); // destroys this object } //virtual diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp new file mode 100644 index 0000000000000000000000000000000000000000..34db895b5289307d9b2be1d74a60b8c6343508f2 --- /dev/null +++ b/indra/newview/llfloateruipreview.cpp @@ -0,0 +1,1550 @@ +/** + * @file llfloateruipreview.cpp + * @brief Tool for previewing and editing floaters, plus localization tool integration + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +// Tool for previewing floaters and panels for localization and UI design purposes. +// See: https://wiki.lindenlab.com/wiki/GUI_Preview_And_Localization_Tools +// See: https://jira.lindenlab.com/browse/DEV-16869 + +// *TODO: Translate error messgaes using notifications/alerts.xml + +#include "llviewerprecompiledheaders.h" // Precompiled headers + +#include "llfloateruipreview.h" // Own header + +// Internal utility +#include "llrender.h" +#include "llsdutil.h" +#include "llxmltree.h" +#include "llviewerwindow.h" +#include "lllivefile.h" + +// XUI +#include "lluictrlfactory.h" +#include "llcombobox.h" +#include "llresizebar.h" +#include "llscrolllistitem.h" +#include "llscrolllistctrl.h" +#include "llfilepicker.h" +#include "lldraghandle.h" +#include "lllayoutstack.h" +#include "llviewermenu.h" + +// Boost (for linux/unix command-line execv) +#include <boost/tokenizer.hpp> +#include <boost/shared_ptr.hpp> + +// External utility +#include <string> + +#if LL_DARWIN +#include <CoreFoundation/CFURL.h> +#endif + +// Static initialization +LLFloaterUIPreview* LLFloaterUIPreview::sInstance = NULL; // initialization of static instance pointer to NULL +std::string LLFloaterUIPreview::mSavedEditorPath = std::string(""); +std::string LLFloaterUIPreview::mSavedEditorArgs = std::string(""); +std::string LLFloaterUIPreview::mSavedDiffPath = std::string(""); +static const S32 PRIMARY_FLOATER = 1; +static const S32 SECONDARY_FLOATER = 2; + +static std::string get_xui_dir() +{ + std::string delim = gDirUtilp->getDirDelimiter(); + return gDirUtilp->getAppRODataDir() + delim + std::string("skins") + delim + "default" + delim + "xui" + delim; +} + +// Localization reset forcer -- ensures that when localization is temporarily changed for previewed floater, it is reset +// Changes are made here +LLLocalizationResetForcer::LLLocalizationResetForcer(S32 ID) +{ + mSavedLocalization = LLUI::sSettingGroups["config"]->getString("Language"); // save current localization setting + LLUI::sSettingGroups["config"]->setString("Language", LLFloaterUIPreview::getLocStr(ID));// hack language to be the one we want to preview floaters in + LLUI::setupPaths(); // forcibly reset XUI paths with this new language +} + +// Actually reset in destructor +// Changes are reversed here +LLLocalizationResetForcer::~LLLocalizationResetForcer() +{ + LLUI::sSettingGroups["config"]->setString("Language", mSavedLocalization); // reset language to what it was before we changed it + LLUI::setupPaths(); // forcibly reset XUI paths with this new language +} + +// Live file constructor +// Needs full path for LLLiveFile but needs just file name for this code, hence the reduntant arguments; easier than separating later +LLGUIPreviewLiveFile::LLGUIPreviewLiveFile(std::string path, std::string name, LLFloaterUIPreview* parent) + : mFileName(name), + mParent(parent), + mFirstFade(TRUE), + mFadeTimer(NULL), + LLLiveFile(path, 1.0) +{} + +LLGUIPreviewLiveFile::~LLGUIPreviewLiveFile() +{ + mParent->mLiveFile = NULL; + if(mFadeTimer) + { + mFadeTimer->mParent = NULL; + // deletes itself; see lltimer.cpp + } +} + +// Live file load +bool LLGUIPreviewLiveFile::loadFile() +{ + mParent->displayFloater(FALSE,1); // redisplay the floater + if(mFirstFade) // only fade if it wasn't just clicked on; can't use "clicked" BOOL below because of an oddity with setting LLLiveFile initial state + { + mFirstFade = FALSE; + } + else + { + if(mFadeTimer) + { + mFadeTimer->mParent = NULL; + } + mFadeTimer = new LLFadeEventTimer(0.05f,this); + } + return true; +} + +// Initialize fade event timer +LLFadeEventTimer::LLFadeEventTimer(F32 refresh, LLGUIPreviewLiveFile* parent) + : mParent(parent), + mFadingOut(TRUE), + LLEventTimer(refresh) +{ + mOriginalColor = mParent->mParent->mDisplayedFloater->getBackgroundColor(); +} + +// Single tick of fade event timer: increment the color +BOOL LLFadeEventTimer::tick() +{ + float diff = 0.04f; + if(TRUE == mFadingOut) // set fade for in/out color direction + { + diff = -diff; + } + + if(NULL == mParent) // no more need to tick, so suicide + { + delete this; + return FALSE; + } + + // Set up colors + LLColor4 bg_color = mParent->mParent->mDisplayedFloater->getBackgroundColor(); + LLSD colors = bg_color.getValue(); + LLSD colors_old = colors; + + // Tick colors + colors[0] = colors[0].asReal() - diff; if(colors[0].asReal() < mOriginalColor.getValue()[0].asReal()) { colors[0] = colors_old[0]; } + colors[1] = colors[1].asReal() - diff; if(colors[1].asReal() < mOriginalColor.getValue()[1].asReal()) { colors[1] = colors_old[1]; } + colors[2] = colors[2].asReal() + diff; if(colors[2].asReal() > mOriginalColor.getValue()[2].asReal()) { colors[2] = colors_old[2]; } + + // Clamp and set colors + bg_color.setValue(colors); + bg_color.clamp(); // make sure we didn't exceed [0,1] + mParent->mParent->mDisplayedFloater->setBackgroundColor(bg_color); + + if(bg_color[2] <= 0.0f) // end of fade out, start fading in + { + mFadingOut = FALSE; + } + + return FALSE; +} + +void* create_overlap_panel(void* data) +{ + return new LLOverlapPanel(); +} + +// Constructor +LLFloaterUIPreview::LLFloaterUIPreview(const LLSD& key) + : LLFloater(key), + mDisplayedFloater(NULL), + mDisplayedFloater_2(NULL), + mLiveFile(NULL), + // sHighlightingDiffs(FALSE), + mHighlightingOverlaps(FALSE), + mLastDisplayedX(0), + mLastDisplayedY(0) + +{ + sInstance = this; + mFactoryMap["overlap_panel"] = LLCallbackMap(create_overlap_panel, NULL); + // called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_ui_preview.xml"); +} + +// Destructor +LLFloaterUIPreview::~LLFloaterUIPreview() +{ + // spawned floaters are deleted automatically, so we don't need to delete them here + + // save contents of textfields so it can be restored later if the floater is created again this session + LLFloaterUIPreview::mSavedEditorPath = mEditorPathTextBox->getText(); + LLFloaterUIPreview::mSavedEditorArgs = mEditorArgsTextBox->getText(); + LLFloaterUIPreview::mSavedDiffPath = mDiffPathTextBox->getText(); + + // delete live file if it exists + if(sInstance->mLiveFile) + { + delete sInstance->mLiveFile; + sInstance->mLiveFile = NULL; + } + + sInstance = NULL; // clear static pointer +} + +// Perform post-build setup (defined in superclass) +BOOL LLFloaterUIPreview::postBuild() +{ + LLPanel* main_panel_tmp = getChild<LLPanel>("main_panel"); // get a pointer to the main panel in order to... + mFileList = main_panel_tmp->getChild<LLScrollListCtrl>("name_list"); // save pointer to file list + // Double-click opens the floater, for convenience + mFileList->setDoubleClickCallback(onClickDisplayFloater, (void*)&PRIMARY_FLOATER); + + // get pointers to buttons and link to callbacks + mLanguageSelection = main_panel_tmp->getChild<LLComboBox>("language_select_combo"); + mLanguageSelection->setSelectionCallback(boost::bind(&LLFloaterUIPreview::onLanguageComboSelect, this, mLanguageSelection)); + mLanguageSelection_2 = main_panel_tmp->getChild<LLComboBox>("language_select_combo_2"); + mLanguageSelection_2->setSelectionCallback(boost::bind(&LLFloaterUIPreview::onLanguageComboSelect, this, mLanguageSelection)); + LLPanel* editor_panel_tmp = main_panel_tmp->getChild<LLPanel>("editor_panel"); + mDisplayFloaterBtn = main_panel_tmp->getChild<LLButton>("display_floater"); + mDisplayFloaterBtn->setClickedCallback(onClickDisplayFloater, (void*)&PRIMARY_FLOATER); + mDisplayFloaterBtn_2 = main_panel_tmp->getChild<LLButton>("display_floater_2"); + mDisplayFloaterBtn_2->setClickedCallback(onClickDisplayFloater, (void*)&SECONDARY_FLOATER); + mToggleOverlapButton = main_panel_tmp->getChild<LLButton>("toggle_overlap_panel"); + mToggleOverlapButton->setClickedCallback(onClickToggleOverlapping, this); + mCloseOtherButton = main_panel_tmp->getChild<LLButton>("close_displayed_floater"); + mCloseOtherButton->setClickedCallback(onClickCloseDisplayedFloater, (void*)&PRIMARY_FLOATER); + mCloseOtherButton_2 = main_panel_tmp->getChild<LLButton>("close_displayed_floater_2"); + mCloseOtherButton_2->setClickedCallback(onClickCloseDisplayedFloater, (void*)&SECONDARY_FLOATER); + mEditFloaterBtn = main_panel_tmp->getChild<LLButton>("edit_floater"); + mEditFloaterBtn->setClickedCallback(onClickEditFloater, this); + mExecutableBrowseButton = editor_panel_tmp->getChild<LLButton>("browse_for_executable"); + LLPanel* vlt_panel_tmp = main_panel_tmp->getChild<LLPanel>("vlt_panel"); + mExecutableBrowseButton->setClickedCallback(onClickBrowseForEditor, this); + mDiffBrowseButton = vlt_panel_tmp->getChild<LLButton>("browse_for_vlt_diffs"); + mDiffBrowseButton->setClickedCallback(onClickBrowseForDiffs, NULL); + mToggleHighlightButton = vlt_panel_tmp->getChild<LLButton>("toggle_vlt_diff_highlight"); + mToggleHighlightButton->setClickedCallback(onClickToggleDiffHighlighting, NULL); + main_panel_tmp->getChild<LLButton>("save_floater")->setClickedCallback(onClickSaveFloater, (void*)&PRIMARY_FLOATER); + main_panel_tmp->getChild<LLButton>("save_all_floaters")->setClickedCallback(onClickSaveAll, (void*)&PRIMARY_FLOATER); + + // get pointers to text fields + mEditorPathTextBox = editor_panel_tmp->getChild<LLLineEditor>("executable_path_field"); + mEditorArgsTextBox = editor_panel_tmp->getChild<LLLineEditor>("executable_args_field"); + mDiffPathTextBox = vlt_panel_tmp->getChild<LLLineEditor>("vlt_diff_path_field"); + + // *HACK: restored saved editor path and args to textfields + mEditorPathTextBox->setText(LLFloaterUIPreview::mSavedEditorPath); + mEditorArgsTextBox->setText(LLFloaterUIPreview::mSavedEditorArgs); + mDiffPathTextBox->setText(LLFloaterUIPreview::mSavedDiffPath); + + // Set up overlap panel + mOverlapPanel = getChild<LLOverlapPanel>("overlap_panel"); + + sInstance->childSetVisible("overlap_scroll", mHighlightingOverlaps); + + mDelim = gDirUtilp->getDirDelimiter(); // initialize delimiter to dir sep slash + + // refresh list of available languages (EN will still be default) + BOOL found = TRUE; + BOOL found_en_us = FALSE; + std::string language_directory; + std::string xui_dir = get_xui_dir(); // directory containing localizations -- don't forget trailing delim + mLanguageSelection->removeall(); // clear out anything temporarily in list from XML + while(found) // for every directory + { + if((found = gDirUtilp->getNextFileInDir(xui_dir, "*", language_directory, FALSE))) // get next directory + { + std::string full_path = xui_dir + language_directory; + if(LLFile::isfile(full_path.c_str())) // if it's not a directory, skip it + { + continue; + } + + if(strncmp("template",language_directory.c_str(),8) && -1 == language_directory.find(".")) // if it's not the template directory or a hidden directory + { + if(!strncmp("en",language_directory.c_str(),5)) // remember if we've seen en, so we can make it default + { + found_en_us = TRUE; + } + else + { + mLanguageSelection->add(std::string(language_directory)); // add it to the language selection dropdown menu + mLanguageSelection_2->add(std::string(language_directory)); + } + } + } + } + if(found_en_us) + { + mLanguageSelection->add(std::string("en"),ADD_TOP); // make en first item if we found it + mLanguageSelection_2->add(std::string("en"),ADD_TOP); + } + else + { + std::string warning = std::string("No EN localization found; check your XUI directories!"); + popupAndPrintWarning(warning); + } + mLanguageSelection->selectFirstItem(); // select the first item + mLanguageSelection_2->selectFirstItem(); + + refreshList(); // refresh the list of available floaters + + return TRUE; +} + +// Callback for language combo box selection: refresh current floater when you change languages +void LLFloaterUIPreview::onLanguageComboSelect(LLUICtrl* ctrl) +{ + LLComboBox* caller = dynamic_cast<LLComboBox*>(ctrl); + if (!caller) + return; + if(caller->getName() == std::string("language_select_combo")) + { + if(mDisplayedFloater) + { + onClickCloseDisplayedFloater((void*)&PRIMARY_FLOATER); + displayFloater(TRUE,1); + } + } + else + { + if(mDisplayedFloater_2) + { + onClickCloseDisplayedFloater((void*)&PRIMARY_FLOATER); + displayFloater(TRUE,2); // *TODO: make take an arg + } + } + +} + +// Close click handler -- delete my displayed floater if it exists +void LLFloaterUIPreview::onClose(bool app_quitting) +{ + if(!app_quitting && sInstance && sInstance->mDisplayedFloater) + { + onClickCloseDisplayedFloater((void*)&PRIMARY_FLOATER); + onClickCloseDisplayedFloater((void*)&SECONDARY_FLOATER); + delete sInstance->mDisplayedFloater; + sInstance->mDisplayedFloater = NULL; + } + destroy(); +} + +// Error handling (to avoid code repetition) +// *TODO: this is currently unlocalized. Add to alerts/notifications.xml, someday, maybe. +void LLFloaterUIPreview::popupAndPrintWarning(std::string& warning) +{ + llwarns << warning << llendl; + LLSD args; + args["MESSAGE"] = warning; + LLNotifications::instance().add("GenericAlert", args); +} + +// Get localization string from drop-down menu +std::string LLFloaterUIPreview::getLocStr(S32 ID) +{ + if(ID == 1) + { + return sInstance->mLanguageSelection->getSelectedItemLabel(0); + } + else + { + return sInstance->mLanguageSelection_2->getSelectedItemLabel(0); + } +} + +// Get localized directory (build path from data directory to XUI files, substituting localization string in for language) +std::string LLFloaterUIPreview::getLocalizedDirectory() +{ + return get_xui_dir() + (sInstance ? getLocStr(1) : "en") + mDelim; // e.g. "C:/Code/guipreview/indra/newview/skins/xui/en/"; +} + +// Refresh the list of floaters by doing a directory traverse for XML XUI floater files +// Could be used to grab any specific language's list of compatible floaters, but currently it's just used to get all of them +void LLFloaterUIPreview::refreshList() +{ + // Note: the mask doesn't seem to accept regular expressions, so there need to be two directory searches here + mFileList->clearRows(); // empty list + std::string name; + BOOL found = TRUE; + while(found) // for every floater file that matches the pattern + { + if((found = gDirUtilp->getNextFileInDir(getLocalizedDirectory(), "floater_*.xml", name, FALSE))) // get next file matching pattern + { + addFloaterEntry(name.c_str()); // and add it to the list (file name only; localization code takes care of rest of path) + } + } + found = TRUE; + while(found) // for every menu file that matches the pattern + { + if((found = gDirUtilp->getNextFileInDir(getLocalizedDirectory(), "menu_*.xml", name, FALSE))) // get next file matching pattern + { + addFloaterEntry(name.c_str()); // and add it to the list (file name only; localization code takes care of rest of path) + } + } + found = TRUE; + while(found) // for every panel file that matches the pattern + { + if((found = gDirUtilp->getNextFileInDir(getLocalizedDirectory(), "panel_*.xml", name, FALSE))) // get next file matching pattern + { + addFloaterEntry(name.c_str()); // and add it to the list (file name only; localization code takes care of rest of path) + } + } + + if(!mFileList->isEmpty()) // if there were any matching files, just select the first one (so we don't have to worry about disabling buttons when no entry is selected) + { + mFileList->selectFirstItem(); + } +} + +// Add a single entry to the list of available floaters +// Note: no deduplification (shouldn't be necessary) +void LLFloaterUIPreview::addFloaterEntry(const std::string& path) +{ + LLUUID* entry_id = new LLUUID(); // create a new UUID + entry_id->generate(path); + const LLUUID& entry_id_ref = *entry_id; // get a reference to the UUID for the LLSD block + + // fill LLSD column entry: initialize row/col structure + LLSD row; + row["id"] = entry_id_ref; + LLSD& columns = row["columns"]; + + // Get name of floater: + LLXmlTree xml_tree; + std::string full_path = getLocalizedDirectory() + path; // get full path + BOOL success = xml_tree.parseFile(full_path.c_str(), TRUE); // parse xml + std::string entry_name; + std::string entry_title; + if(success) + { + // get root (or error handle) + LLXmlTreeNode* root_floater = xml_tree.getRoot(); + if (!root_floater) + { + std::string warning = std::string("No root node found in XUI file: ") + path; + popupAndPrintWarning(warning); + return; + } + + // get name + root_floater->getAttributeString("name",entry_name); + if(std::string("") == entry_name) + { + entry_name = "Error: unable to load " + std::string(path); // set to error state if load fails + } + + // get title + root_floater->getAttributeString("title",entry_title); // some don't have a title, and some have title = "(unknown)", so just leave it blank if it fails + } + else + { + std::string warning = std::string("Unable to parse XUI file: ") + path; // error handling + popupAndPrintWarning(warning); + if(mLiveFile) + { + delete mLiveFile; + mLiveFile = NULL; + } + return; + } + + // Fill floater title column + columns[0]["column"] = "title_column"; + columns[0]["type"] = "text"; + columns[0]["value"] = entry_title; + + // Fill floater path column + columns[1]["column"] = "file_column"; + columns[1]["type"] = "text"; + columns[1]["value"] = std::string(path); + + // Fill floater name column + columns[2]["column"] = "top_level_node_column"; + columns[2]["type"] = "text"; + columns[2]["value"] = entry_name; + + mFileList->addElement(row); // actually add to list +} + +// Respond to button click to display/refresh currently-selected floater +void LLFloaterUIPreview::onClickDisplayFloater(void* data) +{ + S32 caller_id = *((S32*)data); + displayFloater(TRUE, caller_id); + if(caller_id == 1) + { + sInstance->mDisplayedFloater->center(); // move displayed floater to the center of the screen + } +} + +// Saves the current floater/panel +void LLFloaterUIPreview::onClickSaveFloater(void* data) +{ + S32 caller_id = *((S32*)data); + displayFloater(TRUE, caller_id, true); + if(caller_id == 1) + { + sInstance->mDisplayedFloater->center(); // move displayed floater to the center of the screen + } +} + +// Saves all floater/panels +void LLFloaterUIPreview::onClickSaveAll(void* data) +{ + S32 caller_id = *((S32*)data); + int listSize = sInstance->mFileList->getItemCount(); + + for (int index = 0; index < listSize; index++) + { + sInstance->mFileList->selectNthItem(index); + displayFloater(TRUE, caller_id, true); + } +} + +// Given path to floater or panel XML file "filename.xml", +// returns "filename_new.xml" +static std::string append_new_to_xml_filename(const std::string& path) +{ + std::string full_filename = gDirUtilp->findSkinnedFilename(LLUI::getLocalizedSkinPath(), path); + std::string::size_type extension_pos = full_filename.rfind(".xml"); + full_filename.resize(extension_pos); + full_filename += "_new.xml"; + return full_filename; +} + +// Actually display the floater +// Only set up a new live file if this came from a click (at which point there should be no existing live file), rather than from the live file's update itself; +// otherwise, we get an infinite loop as the live file keeps recreating itself. That means this function is generally called twice. +void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) +{ + // Convince UI that we're in a different language (the one selected on the drop-down menu) + LLLocalizationResetForcer reset_forcer(ID); // save old language in reset forcer object (to be reset upon destruction when it falls out of scope) + + LLPreviewedFloater** floaterp = (ID == 1 ? &(sInstance->mDisplayedFloater) : &(sInstance->mDisplayedFloater_2)); + if(ID == 1) + { + BOOL floater_already_open = sInstance->mDisplayedFloater != NULL; + if(floater_already_open) // if we are already displaying a floater + { + sInstance->mLastDisplayedX = sInstance->mDisplayedFloater->calcScreenRect().mLeft; // save floater's last known position to put the new one there + sInstance->mLastDisplayedY = sInstance->mDisplayedFloater->calcScreenRect().mBottom; + delete sInstance->mDisplayedFloater; // delete it (this closes it too) + sInstance->mDisplayedFloater = NULL; // and reset the pointer + } + } + else + { + if(sInstance->mDisplayedFloater_2 != NULL) + { + delete sInstance->mDisplayedFloater_2; + sInstance->mDisplayedFloater_2 = NULL; + } + } + + std::string path = sInstance->mFileList->getSelectedItemLabel(1); // get the path of the currently-selected floater + if(std::string("") == path) // if no item is selected + { + return; // ignore click (this can only happen with empty list; otherwise an item is always selected) + } + + *floaterp = new LLPreviewedFloater(); + + if(!strncmp(path.c_str(),"floater_",8)) // if it's a floater + { + if (save) + { + LLXMLNodePtr floater_write = new LLXMLNode(); + LLUICtrlFactory::getInstance()->buildFloater(*floaterp, path, FALSE, floater_write); // just build it + + if (!floater_write->isNull()) + { + std::string full_filename = append_new_to_xml_filename(path); + LLFILE* floater_temp = LLFile::fopen(full_filename.c_str(), "w"); + LLXMLNode::writeHeaderToFile(floater_temp); + floater_write->writeToFile(floater_temp); + fclose(floater_temp); + } + } + else + { + LLUICtrlFactory::getInstance()->buildFloater(*floaterp, path, TRUE); // just build it + } + + } + else if (!strncmp(path.c_str(),"menu_",5)) // if it's a menu + { + if (save) + { + LLXMLNodePtr menu_write = new LLXMLNode(); + LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>(path, gMenuHolder, menu_write); + + if (!menu_write->isNull()) + { + std::string full_filename = append_new_to_xml_filename(path); + LLFILE* menu_temp = LLFile::fopen(full_filename.c_str(), "w"); + LLXMLNode::writeHeaderToFile(menu_temp); + menu_write->writeToFile(menu_temp); + fclose(menu_temp); + } + + delete menu; + } + } + else // if it is a panel... + { + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + + LLPanel::Params panel_params; + LLPanel* panel = LLUICtrlFactory::create<LLPanel>(panel_params); // create a new panel + + if (save) + { + LLXMLNodePtr panel_write = new LLXMLNode(); + LLUICtrlFactory::getInstance()->buildPanel(panel, path, panel_write); // build it + + if (!panel_write->isNull()) + { + std::string full_filename = append_new_to_xml_filename(path); + LLFILE* panel_temp = LLFile::fopen(full_filename.c_str(), "w"); + LLXMLNode::writeHeaderToFile(panel_temp); + panel_write->writeToFile(panel_temp); + fclose(panel_temp); + } + } + else + { + LLUICtrlFactory::getInstance()->buildPanel(panel, path); // build it + LLRect new_size = panel->getRect(); // get its rectangle + panel->setOrigin(0,0); // reset its origin point so it's not offset by -left or other XUI attributes + (*floaterp)->setTitle(path); // use the file name as its title, since panels have no guaranteed meaningful name attribute + panel->setUseBoundingRect(TRUE); // enable the use of its outer bounding rect (normally disabled because it's O(n) on the number of sub-elements) + panel->updateBoundingRect(); // update bounding rect + LLRect bounding_rect = panel->getBoundingRect(); // get the bounding rect + LLRect panel_rect = panel->getRect(); // get the panel's rect + LLRect new_rect = panel_rect.unionWith(bounding_rect); // union them to make sure we get the biggest one possible + (*floaterp)->reshape(new_rect.getWidth(), new_rect.getHeight() + floater_header_size); // reshape floater to match the union rect's dimensions + panel->reshape(new_rect.getWidth(), new_rect.getHeight()); // reshape panel to match the union rect's dimensions as well (both are needed) + (*floaterp)->addChild(panel); // add panel as child + (*floaterp)->openFloater(); // open floater (needed?) + } + } + + if(ID == 1) + { + (*floaterp)->setOrigin(sInstance->mLastDisplayedX, sInstance->mLastDisplayedY); + } + + // *HACK: Remove ability to close it; if you close it, its destructor gets called, but we don't know it's null and try to delete it again, + // resulting in a double free + (*floaterp)->setCanClose(FALSE); + + if(ID == 1) + { + sInstance->mCloseOtherButton->setEnabled(TRUE); // enable my floater's close button + } + else + { + sInstance->mCloseOtherButton_2->setEnabled(TRUE); + } + + // *TODO: Make the secondary floater pop up next to the primary one. Doesn't seem to always work if secondary was up first... + if((sInstance->mDisplayedFloater && ID == 2) || (sInstance->mDisplayedFloater_2 && ID == 1)) + { + sInstance->mDisplayedFloater_2->setSnapTarget(sInstance->mDisplayedFloater->getHandle()); + sInstance->mDisplayedFloater->addDependentFloater(sInstance->mDisplayedFloater_2); + } + + // Add localization to title so user knows whether it's localized or defaulted to en + std::string full_path = sInstance->getLocalizedDirectory() + path; + std::string floater_lang = "EN"; + llstat dummy; + if(!LLFile::stat(full_path.c_str(), &dummy)) // if the file does not exist + { + floater_lang = getLocStr(ID); + } + std::string new_title = (*floaterp)->getTitle() + std::string(" [") + floater_lang + + (ID == 1 ? " - Primary" : " - Secondary") + std::string("]"); + (*floaterp)->setTitle(new_title); + + if(click && ID == 1 && !save) + { + // set up live file to track it + if(sInstance->mLiveFile) + { + delete sInstance->mLiveFile; + sInstance->mLiveFile = NULL; + } + sInstance->mLiveFile = new LLGUIPreviewLiveFile(std::string(full_path.c_str()),std::string(path.c_str()),sInstance); + sInstance->mLiveFile->checkAndReload(); + sInstance->mLiveFile->addToEventTimer(); + } + + if(ID == 1) + { + sInstance->mToggleOverlapButton->setEnabled(TRUE); + } + + if(LLView::sHighlightingDiffs && click && ID == 1) + { + sInstance->highlightChangedElements(); + } + + if(ID == 1) + { + sInstance->mOverlapMap.clear(); + LLView::sPreviewClickedElement = NULL; // stop overlapping elements from drawing + sInstance->mOverlapPanel->mLastClickedElement = NULL; + sInstance->findOverlapsInChildren((LLView*)sInstance->mDisplayedFloater); + + // highlight and enable them + if(sInstance->mHighlightingOverlaps) + { + for(OverlapMap::iterator iter = sInstance->mOverlapMap.begin(); iter != sInstance->mOverlapMap.end(); ++iter) + { + LLView* viewp = iter->first; + LLView::sPreviewHighlightedElements.insert(viewp); + } + } + else if(LLView::sHighlightingDiffs) + { + sInstance->highlightChangedElements(); + } + } + + // NOTE: language is reset here automatically when the reset forcer object falls out of scope (see header for details) +} + +// Respond to button click to edit currently-selected floater +void LLFloaterUIPreview::onClickEditFloater(void*) +{ + std::string file_name = sInstance->mFileList->getSelectedItemLabel(1); // get the file name of the currently-selected floater + if(std::string("") == file_name) // if no item is selected + { + return; // ignore click + } + std::string path = sInstance->getLocalizedDirectory() + file_name; + + // stat file to see if it exists (some localized versions may not have it there are no diffs, and then we try to open an nonexistent file) + llstat dummy; + if(LLFile::stat(path.c_str(), &dummy)) // if the file does not exist + { + std::string warning = "No file for this floater exists in the selected localization. Opening the EN version instead."; + popupAndPrintWarning(warning); + + path = get_xui_dir() + sInstance->mDelim + "en" + sInstance->mDelim + file_name; // open the en version instead, by default + } + + // get executable path + const char* exe_path_char; + std::string path_in_textfield = sInstance->mEditorPathTextBox->getText(); + if(std::string("") != path_in_textfield) // if the text field is not emtpy, use its path + { + exe_path_char = path_in_textfield.c_str(); + } + else // otherwise use the path specified by the environment variable + { + exe_path_char = getenv("LL_XUI_EDITOR"); + } + + // error check executable path + if(NULL == exe_path_char) + { + std::string warning = "Select an editor by setting the environment variable LL_XUI_EDITOR or specifying its path in the \"Editor Path\" field."; + popupAndPrintWarning(warning); + return; + } + std::string exe_path = exe_path_char; // do this after error check, otherwise internal strlen call fails on bad char* + + // remove any quotes; they're added back in later where necessary + int found_at; + while((found_at = exe_path.find("\"")) != -1 || (found_at = exe_path.find("'")) != -1) + { + exe_path.erase(found_at,1); + } + + llstat s; + if(!LLFile::stat(exe_path.c_str(), &s)) // If the executable exists + { + // build paths and arguments + std::string args; + std::string custom_args = sInstance->mEditorArgsTextBox->getText(); + int position_of_file = custom_args.find(std::string("%FILE%"), 0); // prepare to replace %FILE% with actual file path + std::string first_part_of_args = ""; + std::string second_part_of_args = ""; + if(-1 == position_of_file) // default: Executable.exe File.xml + { + args = std::string("\"") + path + std::string("\""); // execute the command Program.exe "File.xml" + } + else // use advanced command-line arguments, e.g. "Program.exe -safe File.xml" -windowed for "-safe %FILE% -windowed" + { + first_part_of_args = custom_args.substr(0,position_of_file); // get part of args before file name + second_part_of_args = custom_args.substr(position_of_file+6,custom_args.length()); // get part of args after file name + custom_args = first_part_of_args + std::string("\"") + path + std::string("\"") + second_part_of_args; // replace %FILE% with "<file path>" and put back together + args = custom_args; // and save in the variable that is actually used + } + + // find directory in which executable resides by taking everything after last slash + int last_slash_position = exe_path.find_last_of(sInstance->mDelim); + if(-1 == last_slash_position) + { + std::string warning = std::string("Unable to find a valid path to the specified executable for XUI XML editing: ") + exe_path; + popupAndPrintWarning(warning); + return; + } + std::string exe_dir = exe_path.substr(0,last_slash_position); // strip executable off, e.g. get "C:\Program Files\TextPad 5" (with or without trailing slash) + +#if LL_WINDOWS + PROCESS_INFORMATION pinfo; + STARTUPINFOA sinfo; + memset(&sinfo, 0, sizeof(sinfo)); + memset(&pinfo, 0, sizeof(pinfo)); + + std::string exe_name = exe_path.substr(last_slash_position+1); + args = exe_name + std::string(" ") + args; // and prepend the executable name, so we get 'Program.exe "Arg1"' + + char *args2 = new char[args.size() + 1]; // Windows requires that the second parameter to CreateProcessA be a writable (non-const) string... + strcpy(args2, args.c_str()); + + if(!CreateProcessA(exe_path.c_str(), args2, NULL, NULL, FALSE, 0, NULL, exe_dir.c_str(), &sinfo, &pinfo)) + { + // DWORD dwErr = GetLastError(); + std::string warning = "Creating editor process failed!"; + popupAndPrintWarning(warning); + } + else + { + // foo = pinfo.dwProcessId; // get your pid here if you want to use it later on + // sGatewayHandle = pinfo.hProcess; + CloseHandle(pinfo.hThread); // stops leaks - nothing else + } + + delete[] args2; +#else // if !LL_WINDOWS + // This code was copied from the code to run SLVoice, with some modification; should work in UNIX (Mac/Darwin or Linux) + { + std::vector<std::string> arglist; + arglist.push_back(exe_path.c_str()); + + // Split the argument string into separate strings for each argument + typedef boost::tokenizer< boost::char_separator<char> > tokenizer; + boost::char_separator<char> sep("","\" ", boost::drop_empty_tokens); + + tokenizer tokens(args, sep); + tokenizer::iterator token_iter; + BOOL inside_quotes = FALSE; + BOOL last_was_space = FALSE; + for(token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) + { + if(!strncmp("\"",(*token_iter).c_str(),2)) + { + inside_quotes = !inside_quotes; + } + else if(!strncmp(" ",(*token_iter).c_str(),2)) + { + if(inside_quotes) + { + arglist.back().append(std::string(" ")); + last_was_space = TRUE; + } + } + else + { + std::string to_push = *token_iter; + if(last_was_space) + { + arglist.back().append(to_push); + last_was_space = FALSE; + } + else + { + arglist.push_back(to_push); + } + } + } + + // create an argv vector for the child process + char **fakeargv = new char*[arglist.size() + 1]; + int i; + for(i=0; i < arglist.size(); i++) + fakeargv[i] = const_cast<char*>(arglist[i].c_str()); + + fakeargv[i] = NULL; + + fflush(NULL); // flush all buffers before the child inherits them + pid_t id = vfork(); + if(id == 0) + { + // child + execv(exe_path.c_str(), fakeargv); + + // If we reach this point, the exec failed. + // Use _exit() instead of exit() per the vfork man page. + std::string warning = "Creating editor process failed (vfork/execv)!"; + popupAndPrintWarning(warning); + _exit(0); + } + + // parent + delete[] fakeargv; + // sGatewayPID = id; + } +#endif // LL_WINDOWS + } + else + { + std::string warning = "Unable to find path to external XML editor for XUI preview tool"; + popupAndPrintWarning(warning); + } +} + +// Respond to button click to browse for an executable with which to edit XML files +void LLFloaterUIPreview::onClickBrowseForEditor(void*) +{ + // create load dialog box + LLFilePicker::ELoadFilter type = (LLFilePicker::ELoadFilter)((intptr_t)((void*)LLFilePicker::FFLOAD_ALL)); // nothing for *.exe so just use all + LLFilePicker& picker = LLFilePicker::instance(); + if (!picker.getOpenFile(type)) // user cancelled -- do nothing + { + return; + } + + // put the selected path into text field + const std::string chosen_path = picker.getFirstFile(); + std::string executable_path = chosen_path; +#if LL_DARWIN + // on Mac, if it's an application bundle, figure out the actual path from the Info.plist file + CFStringRef path_cfstr = CFStringCreateWithCString(kCFAllocatorDefault, chosen_path.c_str(), kCFStringEncodingMacRoman); // get path as a CFStringRef + CFURLRef path_url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, path_cfstr, kCFURLPOSIXPathStyle, TRUE); // turn it into a CFURLRef + CFBundleRef chosen_bundle = CFBundleCreate(kCFAllocatorDefault, path_url); // get a handle for the bundle + if(NULL != chosen_bundle) + { + CFDictionaryRef bundleInfoDict = CFBundleGetInfoDictionary(chosen_bundle); // get the bundle's dictionary + if(NULL != bundleInfoDict) + { + CFStringRef executable_cfstr = (CFStringRef)CFDictionaryGetValue(bundleInfoDict, CFSTR("CFBundleExecutable")); // get the name of the actual executable (e.g. TextEdit or firefox-bin) + int max_file_length = 256; // (max file name length is 255 in OSX) + char executable_buf[max_file_length]; + if(CFStringGetCString(executable_cfstr, executable_buf, max_file_length, kCFStringEncodingMacRoman)) // convert CFStringRef to char* + { + executable_path += std::string("/Contents/MacOS/") + std::string(executable_buf); // append path to executable directory and then executable name to exec path + } + else + { + std::string warning = "Unable to get CString from CFString for executable path"; + popupAndPrintWarning(warning); + } + } + else + { + std::string warning = "Unable to get bundle info dictionary from application bundle"; + popupAndPrintWarning(warning); + } + } + else + { + if(-1 != executable_path.find(".app")) // only warn if this path actually had ".app" in it, i.e. it probably just wasn'nt an app bundle and that's okay + { + std::string warning = std::string("Unable to get bundle from path \"") + chosen_path + std::string("\""); + popupAndPrintWarning(warning); + } + } + +#endif + sInstance->mEditorPathTextBox->setText(std::string(executable_path)); // copy the path to the executable to the textfield for display and later fetching +} + +// Respond to button click to browse for a VLT-generated diffs file +void LLFloaterUIPreview::onClickBrowseForDiffs(void*) +{ + // create load dialog box + LLFilePicker::ELoadFilter type = (LLFilePicker::ELoadFilter)((intptr_t)((void*)LLFilePicker::FFLOAD_XML)); // nothing for *.exe so just use all + LLFilePicker& picker = LLFilePicker::instance(); + if (!picker.getOpenFile(type)) // user cancelled -- do nothing + { + return; + } + + // put the selected path into text field + const std::string chosen_path = picker.getFirstFile(); + sInstance->mDiffPathTextBox->setText(std::string(chosen_path)); // copy the path to the executable to the textfield for display and later fetching + if(LLView::sHighlightingDiffs) // if we're already highlighting, toggle off and then on so we get the data from the new file + { + onClickToggleDiffHighlighting(NULL); + onClickToggleDiffHighlighting(NULL); + } +} + +void LLFloaterUIPreview::onClickToggleDiffHighlighting(void*) +{ + if(sInstance->mHighlightingOverlaps) + { + onClickToggleOverlapping(NULL); + sInstance->mToggleOverlapButton->toggleState(); + } + + LLView::sPreviewHighlightedElements.clear(); // clear lists first + sInstance->mDiffsMap.clear(); + sInstance->mFileList->clearHighlightedItems(); + + if(LLView::sHighlightingDiffs) // Turning highlighting off + { + LLView::sHighlightingDiffs = !sInstance->sHighlightingDiffs; + return; + } + else // Turning highlighting on + { + // Get the file and make sure it exists + std::string path_in_textfield = sInstance->mDiffPathTextBox->getText(); // get file path + BOOL error = FALSE; + + if(std::string("") == path_in_textfield) // check for blank file + { + std::string warning = "Unable to highlight differences because no file was provided; fill in the relevant text field"; + popupAndPrintWarning(warning); + error = TRUE; + } + + llstat dummy; + if(LLFile::stat(path_in_textfield.c_str(), &dummy) && !error) // check if the file exists (empty check is reduntant but useful for the informative error message) + { + std::string warning = std::string("Unable to highlight differences because an invalid path to a difference file was provided:\"") + path_in_textfield + "\""; + popupAndPrintWarning(warning); + error = TRUE; + } + + // Build a list of changed elements as given by the XML + std::list<std::string> changed_element_names; + LLXmlTree xml_tree; + BOOL success = xml_tree.parseFile(path_in_textfield.c_str(), TRUE); + + if(success && !error) + { + LLXmlTreeNode* root_floater = xml_tree.getRoot(); + if(!strncmp("XuiDelta",root_floater->getName().c_str(),9)) + { + for (LLXmlTreeNode* child = root_floater->getFirstChild(); // get the first child first, then below get the next one; otherwise the iterator is invalid (bug or feature in XML code?) + child != NULL; + child = root_floater->getNextChild()) // get child for next iteration + { + if(!strncmp("file",child->getName().c_str(),5)) + { + sInstance->scanDiffFile(child); + } + else if(!strncmp("error",child->getName().c_str(),6)) + { + std::string error_file, error_message; + child->getAttributeString("filename",error_file); + child->getAttributeString("message",error_message); + if(sInstance->mDiffsMap.find(error_file) != sInstance->mDiffsMap.end()) + { + sInstance->mDiffsMap.insert(std::make_pair(error_file,std::make_pair(StringListPtr(new StringList), StringListPtr(new StringList)))); + } + sInstance->mDiffsMap[error_file].second->push_back(error_message); + } + else + { + std::string warning = std::string("Child was neither a file or an error, but rather the following:\"") + std::string(child->getName()) + "\""; + popupAndPrintWarning(warning); + error = TRUE; + break; + } + } + } + else + { + std::string warning = std::string("Root node not named XuiDelta:\"") + path_in_textfield + "\""; + popupAndPrintWarning(warning); + error = TRUE; + } + } + else if(!error) + { + std::string warning = std::string("Unable to create tree from XML:\"") + path_in_textfield + "\""; + popupAndPrintWarning(warning); + error = TRUE; + } + + if(error) // if we encountered an error, reset the button to off + { + sInstance->mToggleHighlightButton->setToggleState(FALSE); + } + else // only toggle if we didn't encounter an error + { + LLView::sHighlightingDiffs = !sInstance->sHighlightingDiffs; + sInstance->highlightChangedElements(); // *TODO: this is extraneous, right? + sInstance->highlightChangedFiles(); // *TODO: this is extraneous, right? + } + } +} + +void LLFloaterUIPreview::scanDiffFile(LLXmlTreeNode* file_node) +{ + // Get file name + std::string file_name; + file_node->getAttributeString("name",file_name); + if(std::string("") == file_name) + { + std::string warning = std::string("Empty file name encountered in differences:\"") + file_name + "\""; + popupAndPrintWarning(warning); + return; + } + + // Get a list of changed elements + // Get the first child first, then below get the next one; otherwise the iterator is invalid (bug or feature in XML code?) + for (LLXmlTreeNode* child = file_node->getFirstChild(); child != NULL; child = file_node->getNextChild()) + { + if(!strncmp("delta",child->getName().c_str(),6)) + { + std::string id; + child->getAttributeString("id",id); + if(mDiffsMap.find(file_name) == mDiffsMap.end()) + { + mDiffsMap.insert(std::make_pair(file_name,std::make_pair(StringListPtr(new StringList), StringListPtr(new StringList)))); + } + mDiffsMap[file_name].first->push_back(std::string(id.c_str())); + } + else + { + std::string warning = std::string("Child of file was not a delta, but rather the following:\"") + std::string(child->getName()) + "\""; + popupAndPrintWarning(warning); + return; + } + } +} + +void LLFloaterUIPreview::highlightChangedElements() +{ + if(NULL == mLiveFile) + { + return; + } + + // Process differences first (we want their warnings to be shown underneath other warnings) + StringListPtr changed_element_paths; + DiffMap::iterator iterExists = mDiffsMap.find(mLiveFile->mFileName); + if(iterExists != mDiffsMap.end()) + { + changed_element_paths = mDiffsMap[mLiveFile->mFileName].first; // retrieve list of changed element paths from map + } + + for(std::list<std::string>::iterator iter = changed_element_paths->begin(); iter != changed_element_paths->end(); ++iter) // for every changed element path + { + LLView* element = sInstance->mDisplayedFloater; + if(!strncmp(iter->c_str(),".",1)) // if it's the root floater itself + { + continue; + } + + // Split element hierarchy path on period (*HACK: it's possible that the element name will have a period in it, in which case this won't work. See https://wiki.lindenlab.com/wiki/Viewer_Localization_Tool_Documentation.) + typedef boost::tokenizer<boost::char_separator<char> > tokenizer; + boost::char_separator<char> sep("."); + tokenizer tokens(*iter, sep); + tokenizer::iterator token_iter; + BOOL failed = FALSE; + for(token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) + { + element = element->getChild<LLView>(*token_iter,FALSE,FALSE); // try to find element: don't recur, and don't create if missing + + // if we still didn't find it... + if(NULL == element) + { + llinfos << "Unable to find element in XuiDelta file named \"" << *iter << "\" in file \"" << mLiveFile->mFileName << + "\". The element may no longer exist, the path may be incorrect, or it may not be a non-displayable element (not an LLView) such as a \"string\" type." << llendl; + failed = TRUE; + break; + } + } + + if(!failed) + { + // Now that we have a pointer to the actual element, add it to the list of elements to be highlighted + std::set<LLView*>::iterator iter2 = std::find(LLView::sPreviewHighlightedElements.begin(), LLView::sPreviewHighlightedElements.end(), element); + if(iter2 == LLView::sPreviewHighlightedElements.end()) + { + LLView::sPreviewHighlightedElements.insert(element); + } + } + } + + // Process errors second, so their warnings show up on top of other warnings + StringListPtr error_list; + if(iterExists != mDiffsMap.end()) + { + error_list = mDiffsMap[mLiveFile->mFileName].second; + } + for(std::list<std::string>::iterator iter = error_list->begin(); iter != error_list->end(); ++iter) // for every changed element path + { + std::string warning = std::string("Error listed among differences. Filename: \"") + mLiveFile->mFileName + "\". Message: \"" + *iter + "\""; + popupAndPrintWarning(warning); + } +} + +void LLFloaterUIPreview::highlightChangedFiles() +{ + for(DiffMap::iterator iter = mDiffsMap.begin(); iter != mDiffsMap.end(); ++iter) // for every file listed in diffs + { + LLScrollListItem* item = mFileList->getItemByLabel(std::string(iter->first), FALSE, 1); + if(item) + { + item->setHighlighted(TRUE); + } + } +} + +// Respond to button click to browse for an executable with which to edit XML files +void LLFloaterUIPreview::onClickCloseDisplayedFloater(void* data) +{ + S32 caller_id = *((S32*)data); + if(caller_id == 1) + { + sInstance->mCloseOtherButton->setEnabled(FALSE); + sInstance->mToggleOverlapButton->setEnabled(FALSE); + + if(sInstance->mDisplayedFloater) + { + sInstance->mLastDisplayedX = sInstance->mDisplayedFloater->calcScreenRect().mLeft; + sInstance->mLastDisplayedY = sInstance->mDisplayedFloater->calcScreenRect().mBottom; + delete sInstance->mDisplayedFloater; + sInstance->mDisplayedFloater = NULL; + } + + if(sInstance->mLiveFile) + { + delete sInstance->mLiveFile; + sInstance->mLiveFile = NULL; + } + + if(sInstance->mToggleOverlapButton->getToggleState()) + { + sInstance->mToggleOverlapButton->toggleState(); + onClickToggleOverlapping(NULL); + } + + LLView::sPreviewClickedElement = NULL; // stop overlapping elements panel from drawing + sInstance->mOverlapPanel->mLastClickedElement = NULL; + } + else + { + sInstance->mCloseOtherButton_2->setEnabled(FALSE); + delete sInstance->mDisplayedFloater_2; + sInstance->mDisplayedFloater_2 = NULL; + } + +} + +BOOL LLPreviewedFloater::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + selectElement(this,x,y,0); + return TRUE; +} + +// *NOTE: In order to hide all of the overlapping elements of the selected element so as to see it in context, here is what you would need to do: +// -This selectElement call fills the overlap panel as normal. The element which is "selected" here is actually just an intermediate selection step; +// what you've really selected is a list of elements: the one you clicked on and everything that overlaps it. +// -The user then selects one of the elements from this list the overlap panel (click handling to the overlap panel would have to be added). +// This becomes the final selection (as opposed to the intermediate selection that was just made). +// -Everything else that is currently displayed on the overlap panel should be hidden from view in the previewed floater itself (setVisible(FALSE)). +// -Subsequent clicks on other elements in the overlap panel (they should still be there) should make other elements the final selection. +// -On close or on the click of a new button, everything should be shown again and all selection state should be cleared. +// ~Jacob, 8/08 +BOOL LLPreviewedFloater::selectElement(LLView* parent, int x, int y, int depth) +{ + if(getVisible()) + { + BOOL handled = FALSE; + if(LLFloaterUIPreview::containerType(parent)) + { + for(child_list_const_iter_t child_it = parent->getChildList()->begin(); child_it != parent->getChildList()->end(); ++child_it) + { + LLView* child = *child_it; + S32 local_x = x - child->getRect().mLeft; + S32 local_y = y - child->getRect().mBottom; + if (child->pointInView(local_x, local_y) && + child->getVisible() && + selectElement(child, x, y, ++depth)) + { + handled = TRUE; + break; + } + } + } + + if(!handled) + { + LLView::sPreviewClickedElement = parent; + } + return TRUE; + } + else + { + return FALSE; + } +} + +void LLPreviewedFloater::draw() +{ + if(NULL != LLFloaterUIPreview::sInstance) + { + // Set and unset sDrawPreviewHighlights flag so as to avoid using two flags + if(LLFloaterUIPreview::sInstance->mHighlightingOverlaps) + { + LLView::sDrawPreviewHighlights = TRUE; + } + LLFloater::draw(); + if(LLFloaterUIPreview::sInstance->mHighlightingOverlaps) + { + LLView::sDrawPreviewHighlights = FALSE; + } + } +} + +void LLFloaterUIPreview::onClickToggleOverlapping(void*) +{ + if(LLView::sHighlightingDiffs) + { + onClickToggleDiffHighlighting(NULL); + sInstance->mToggleHighlightButton->toggleState(); + } + LLView::sPreviewHighlightedElements.clear(); // clear lists first + + S32 width, height; + sInstance->getResizeLimits(&width, &height); // illegal call of non-static member function + if(sInstance->mHighlightingOverlaps) + { + sInstance->mHighlightingOverlaps = !sInstance->mHighlightingOverlaps; + // reset list of preview highlighted elements + sInstance->setRect(LLRect(sInstance->getRect().mLeft,sInstance->getRect().mTop,sInstance->getRect().mRight - sInstance->mOverlapPanel->getRect().getWidth(),sInstance->getRect().mBottom)); + sInstance->setResizeLimits(width - sInstance->mOverlapPanel->getRect().getWidth(), height); + } + else + { + sInstance->mHighlightingOverlaps = !sInstance->mHighlightingOverlaps; + displayFloater(FALSE,1); + sInstance->setRect(LLRect(sInstance->getRect().mLeft,sInstance->getRect().mTop,sInstance->getRect().mRight + sInstance->mOverlapPanel->getRect().getWidth(),sInstance->getRect().mBottom)); + sInstance->setResizeLimits(width + sInstance->mOverlapPanel->getRect().getWidth(), height); + } + sInstance->childSetVisible("overlap_scroll", sInstance->mHighlightingOverlaps); +} + +void LLFloaterUIPreview::findOverlapsInChildren(LLView* parent) +{ + if(parent->getChildCount() == 0 || !containerType(parent)) // if it has no children or isn't a container type, skip it + { + return; + } + + // for every child of the parent + for(child_list_const_iter_t child_it = parent->getChildList()->begin(); child_it != parent->getChildList()->end(); ++child_it) + { + LLView* child = *child_it; + if(overlapIgnorable(child)) + { + continue; + } + + // for every sibling + for(child_list_const_iter_t sibling_it = parent->getChildList()->begin(); sibling_it != parent->getChildList()->end(); ++sibling_it) // for each sibling + { + LLView* sibling = *sibling_it; + if(overlapIgnorable(sibling)) + { + continue; + } + + // if they overlap... (we don't care if they're visible or enabled -- we want to check those anyway, i.e. hidden tabs that can be later shown) + if(sibling != child && elementOverlap(child, sibling)) + { + mOverlapMap[child].push_back(sibling); // add to the map + } + } + findOverlapsInChildren(child); // recur + } +} + +// *HACK: don't overlap with the drag handle and various other elements +// This is using dynamic casts because there is no object-oriented way to tell which elements contain localizable text. These are a few that are ignorable. +// *NOTE: If a list of elements which have localizable content were created, this function should return false if viewp's class is in that list. +BOOL LLFloaterUIPreview::overlapIgnorable(LLView* viewp) +{ + return NULL != dynamic_cast<LLDragHandle*>(viewp) || + NULL != dynamic_cast<LLViewBorder*>(viewp) || + NULL != dynamic_cast<LLResizeBar*>(viewp); +} + +// *HACK: these are the only two container types as of 8/08, per Richard +// This is using dynamic casts because there is no object-oriented way to tell which elements are containers. +BOOL LLFloaterUIPreview::containerType(LLView* viewp) +{ + return NULL != dynamic_cast<LLPanel*>(viewp) || NULL != dynamic_cast<LLLayoutStack*>(viewp); +} + +// Check if two llview's rectangles overlap, with some tolerance +BOOL LLFloaterUIPreview::elementOverlap(LLView* view1, LLView* view2) +{ + LLSD rec1 = view1->getRect().getValue(); + LLSD rec2 = view2->getRect().getValue(); + int tolerance = 2; + return (int)rec1[0] <= (int)rec2[2] - tolerance && + (int)rec2[0] <= (int)rec1[2] - tolerance && + (int)rec1[3] <= (int)rec2[1] - tolerance && + (int)rec2[3] <= (int)rec1[1] - tolerance; +} + +void LLOverlapPanel::draw() +{ + static const std::string current_selection_text("Current selection: "); + static const std::string overlapper_text("Overlapper: "); + LLColor4 text_color = LLColor4::grey; + gGL.color4fv(text_color.mV); + + if(!LLView::sPreviewClickedElement) + { + LLUI::translate(5,getRect().getHeight()-20); // translate to top-5,left-5 + LLView::sDrawPreviewHighlights = FALSE; + LLFontGL::getFontSansSerifSmall()->renderUTF8(current_selection_text, 0, 0, 0, text_color, + LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); + } + else + { + LLFloaterUIPreview::OverlapMap::iterator iterExists = LLFloaterUIPreview::sInstance->mOverlapMap.find(LLView::sPreviewClickedElement); + if(iterExists == LLFloaterUIPreview::sInstance->mOverlapMap.end()) + { + return; + } + + std::list<LLView*> overlappers = LLFloaterUIPreview::sInstance->mOverlapMap[LLView::sPreviewClickedElement]; + if(overlappers.size() == 0) + { + LLUI::translate(5,getRect().getHeight()-20); // translate to top-5,left-5 + LLView::sDrawPreviewHighlights = FALSE; + std::string current_selection = std::string(current_selection_text + LLView::sPreviewClickedElement->getName() + " (no elements overlap)"); + S32 text_width = LLFontGL::getFontSansSerifSmall()->getWidth(current_selection) + 10; + LLFontGL::getFontSansSerifSmall()->renderUTF8(current_selection, 0, 0, 0, text_color, + LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); + // widen panel enough to fit this text + LLRect rect = getRect(); + setRect(LLRect(rect.mLeft,rect.mTop,rect.getWidth() < text_width ? rect.mLeft + text_width : rect.mRight,rect.mTop)); + return; + } + + // recalculate required with and height; otherwise use cached + BOOL need_to_recalculate_bounds = FALSE; + if(mLastClickedElement == NULL) + { + need_to_recalculate_bounds = TRUE; + } + + if(NULL == mLastClickedElement) + { + mLastClickedElement = LLView::sPreviewClickedElement; + } + + // recalculate bounds for scroll panel + if(need_to_recalculate_bounds || LLView::sPreviewClickedElement->getName() != mLastClickedElement->getName()) + { + // reset panel's rectangle to its default width and height (300x600) + LLRect panel_rect = LLFloaterUIPreview::sInstance->mOverlapPanel->getRect(); + LLFloaterUIPreview::sInstance->mOverlapPanel->setRect(LLRect(panel_rect.mLeft,panel_rect.mTop,panel_rect.mLeft+LLFloaterUIPreview::sInstance->mOverlapPanel->getRect().getWidth(),panel_rect.mTop-LLFloaterUIPreview::sInstance->mOverlapPanel->getRect().getHeight())); + + LLRect rect; + + // change bounds for selected element + int height_sum = mLastClickedElement->getRect().getHeight() + mSpacing + 80; + rect = LLFloaterUIPreview::sInstance->mOverlapPanel->getRect(); + LLFloaterUIPreview::sInstance->mOverlapPanel->setRect(LLRect(rect.mLeft,rect.mTop,rect.getWidth() > mLastClickedElement->getRect().getWidth() + 5 ? rect.mRight : rect.mLeft + mLastClickedElement->getRect().getWidth() + 5, rect.mBottom)); + + // and widen to accomodate text if that's wider + std::string display_text = current_selection_text + LLView::sPreviewClickedElement->getName(); + S32 text_width = LLFontGL::getFontSansSerifSmall()->getWidth(display_text) + 10; + rect = getRect(); + setRect(LLRect(rect.mLeft,rect.mTop,rect.getWidth() < text_width ? rect.mLeft + text_width : rect.mRight,rect.mTop)); + + std::list<LLView*> overlappers = LLFloaterUIPreview::sInstance->mOverlapMap[LLView::sPreviewClickedElement]; + for(std::list<LLView*>::iterator overlap_it = overlappers.begin(); overlap_it != overlappers.end(); ++overlap_it) + { + LLView* viewp = *overlap_it; + height_sum += viewp->getRect().getHeight() + mSpacing*3; + + // widen panel's rectangle to accommodate widest overlapping element of this floater + rect = LLFloaterUIPreview::sInstance->mOverlapPanel->getRect(); + LLFloaterUIPreview::sInstance->mOverlapPanel->setRect(LLRect(rect.mLeft,rect.mTop,rect.getWidth() > viewp->getRect().getWidth() + 5 ? rect.mRight : rect.mLeft + viewp->getRect().getWidth() + 5, rect.mBottom)); + + // and widen to accomodate text if that's wider + std::string display_text = overlapper_text + viewp->getName(); + S32 text_width = LLFontGL::getFontSansSerifSmall()->getWidth(display_text) + 10; + rect = getRect(); + setRect(LLRect(rect.mLeft,rect.mTop,rect.getWidth() < text_width ? rect.mLeft + text_width : rect.mRight,rect.mTop)); + } + // change panel's height to accommodate all element heights plus spacing between them + rect = LLFloaterUIPreview::sInstance->mOverlapPanel->getRect(); + LLFloaterUIPreview::sInstance->mOverlapPanel->setRect(LLRect(rect.mLeft,rect.mTop,rect.mRight,rect.mTop-height_sum)); + } + + LLUI::translate(5,getRect().getHeight()-10); // translate to top left + LLView::sDrawPreviewHighlights = FALSE; + + // draw currently-selected element at top of overlappers + LLUI::translate(0,-mSpacing); + LLFontGL::getFontSansSerifSmall()->renderUTF8(current_selection_text + LLView::sPreviewClickedElement->getName(), 0, 0, 0, text_color, + LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); + LLUI::translate(0,-mSpacing-LLView::sPreviewClickedElement->getRect().getHeight()); // skip spacing distance + height + LLView::sPreviewClickedElement->draw(); + + for(std::list<LLView*>::iterator overlap_it = overlappers.begin(); overlap_it != overlappers.end(); ++overlap_it) + { + LLView* viewp = *overlap_it; + + // draw separating line + LLUI::translate(0,-mSpacing); + gl_line_2d(0,0,getRect().getWidth()-10,0,LLColor4(192.0f/255.0f,192.0f/255.0f,192.0f/255.0f)); + + // draw name + LLUI::translate(0,-mSpacing); + LLFontGL::getFontSansSerifSmall()->renderUTF8(overlapper_text + viewp->getName(), 0, 0, 0, text_color, + LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); + + // draw element + LLUI::translate(0,-mSpacing-viewp->getRect().getHeight()); // skip spacing distance + height + viewp->draw(); + } + mLastClickedElement = LLView::sPreviewClickedElement; + } +} diff --git a/indra/newview/llfloateruipreview.h b/indra/newview/llfloateruipreview.h new file mode 100644 index 0000000000000000000000000000000000000000..b0af841e11507801797d03ac0f3d6e6270a40a42 --- /dev/null +++ b/indra/newview/llfloateruipreview.h @@ -0,0 +1,216 @@ +/** + * @file llfloateruipreview.h + * @brief Tool for previewing and editing floaters + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +// Tool for previewing floaters and panels for localization and UI design purposes. +// See: https://wiki.lindenlab.com/wiki/GUI_Preview_And_Localization_Tools +// See: https://jira.lindenlab.com/browse/DEV-16869 + +#ifndef LL_LLUIPREVIEW_H +#define LL_LLUIPREVIEW_H + +#include "llfloater.h" // superclass +#include "llscrollcontainer.h" // scroll container for overlapping elements +#include "lllivefile.h" // live file poll/stat/reload +#include <list> +#include <map> + +// Forward declarations to avoid header dependencies +class LLEventTimer; +class LLColor; +class LLScrollListCtrl; +class LLComboBox; +class LLButton; +class LLXmlTreeNode; +class LLFloaterUIPreview; +class LLFadeEventTimer; + +// Reset object to ensure that when we change the current language setting for preview purposes, +// it automatically is reset. Constructed on the stack at the start of the method; the reset +// occurs as it falls out of scope at the end of the method. See llfloateruipreview.cpp for usage. +class LLLocalizationResetForcer +{ +public: + LLLocalizationResetForcer(S32 ID); + virtual ~LLLocalizationResetForcer(); + +private: + std::string mSavedLocalization; // the localization before we change it +}; + +// Implementation of live file +// When a floater is being previewed, any saved changes to its corresponding +// file cause the previewed floater to be reloaded +class LLGUIPreviewLiveFile : public LLLiveFile +{ +public: + LLGUIPreviewLiveFile(std::string path, std::string name, LLFloaterUIPreview* parent); + virtual ~LLGUIPreviewLiveFile(); + LLFloaterUIPreview* mParent; + LLFadeEventTimer* mFadeTimer; // timer for fade-to-yellow-and-back effect to warn that file has been reloaded + BOOL mFirstFade; // setting this avoids showing the fade reload warning on first load + std::string mFileName; +protected: + bool loadFile(); +}; + +// Implementation of graphical fade in/out (on timer) for when XUI files are updated +class LLFadeEventTimer : public LLEventTimer +{ +public: + LLFadeEventTimer(F32 refresh, LLGUIPreviewLiveFile* parent); + BOOL tick(); + LLGUIPreviewLiveFile* mParent; +private: + BOOL mFadingOut; // fades in then out; this is toggled in between + LLColor4 mOriginalColor; // original color; color is reset to this after fade is coimplete +}; + +// Implementation of previewed floater +// Used to override draw and mouse handler +class LLPreviewedFloater : public LLFloater +{ +public: + LLPreviewedFloater() : LLFloater() {} + virtual void draw(); + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + BOOL selectElement(LLView* parent, int x, int y, int depth); // select element to display its overlappers +}; + +// Implementation of custom overlapping element display panel +class LLOverlapPanel : public LLPanel +{ +public: + struct Params : public LLInitParam::Block<Params, LLPanel::Params> + { + Params() {} + }; + LLOverlapPanel(Params p = Params()) : LLPanel(p), + mSpacing(10), + // mClickedElement(NULL), + mLastClickedElement(NULL) + { + mOriginalWidth = getRect().getWidth(); + mOriginalHeight = getRect().getHeight(); + } + virtual void draw(); + // LLView *mClickedElement; + LLView *mLastClickedElement; + int mOriginalWidth, mOriginalHeight, mSpacing; +}; + +class LLFloaterUIPreview : public LLFloater +{ +public: + // Setup + LLFloaterUIPreview(const LLSD& key); + virtual ~LLFloaterUIPreview(); + + static std::string getLocStr(S32 ID); // fetches the localization string based on what is selected in the drop-down menu + static void displayFloater(BOOL click, S32 ID, bool save = false); // needs to be public so live file can call it when it finds an update + static BOOL containerType(LLView* viewp); // check if the element is a container type and tree traverses need to look at its children + static LLFloaterUIPreview* sInstance; // static instance of this (for references in handlers) + + BOOL postBuild(); // post-build setup (called by superclass' constructor) + void refreshList(); // refresh list (empty it out and fill it up from scratch) + void addFloaterEntry(const std::string& path); // add a single file's entry to the list of floaters + + LLPreviewedFloater* mDisplayedFloater; // the floater which is currently being displayed + LLPreviewedFloater* mDisplayedFloater_2; // the floater which is currently being displayed + LLGUIPreviewLiveFile* mLiveFile; // live file for checking for updates to the currently-displayed XML file + LLOverlapPanel* mOverlapPanel; // custom overlapping elements panel + // BOOL mHighlightingDiffs; // bool for whether localization diffs are being highlighted or not + BOOL mHighlightingOverlaps; // bool for whether overlapping elements are being highlighted + + typedef std::map<LLView*, std::list<LLView*> > OverlapMap; + OverlapMap mOverlapMap; // map, of XUI element to a list of XUI elements it overlaps + + // typedef std::map<std::string,std::pair<std::list<std::string>,std::list<std::string> > > DiffMap; // this version copies the lists etc., and thus is bad memory-wise + typedef std::list<std::string> StringList; + typedef boost::shared_ptr<StringList> StringListPtr; + typedef std::map<std::string, std::pair<StringListPtr,StringListPtr> > DiffMap; + DiffMap mDiffsMap; // map, of filename to pair of list of changed element paths and list of errors + +protected: + virtual void onClose(bool app_quitting); + +private: + // XUI elements for this floater + LLScrollListCtrl* mFileList; // scroll list control for file list + LLLineEditor* mEditorPathTextBox; // text field for path to editor executable + LLLineEditor* mEditorArgsTextBox; // text field for arguments to editor executable + LLLineEditor* mDiffPathTextBox; // text field for path to diff file + LLButton* mDisplayFloaterBtn; // button to display primary floater + LLButton* mDisplayFloaterBtn_2; // button to display secondary floater + LLButton* mEditFloaterBtn; // button to edit floater + LLButton* mExecutableBrowseButton; // button to browse for executable + LLButton* mCloseOtherButton; // button to close primary displayed floater + LLButton* mCloseOtherButton_2; // button to close secondary displayed floater + LLButton* mDiffBrowseButton; // button to browse for diff file + LLButton* mToggleHighlightButton; // button to toggle highlight of files/elements with diffs + LLButton* mToggleOverlapButton; // button to togle overlap panel/highlighting + LLComboBox* mLanguageSelection; // combo box for primary language selection + LLComboBox* mLanguageSelection_2; // combo box for secondary language selection + LLScrollContainer* mOverlapScrollView; // overlapping elements scroll container + S32 mLastDisplayedX, mLastDisplayedY; // stored position of last floater so the new one opens up in the same place + std::string mDelim; // the OS-specific delimiter character (/ or \) (*TODO: this shouldn't be needed, right?) + + static std::string mSavedEditorPath; // stored editor path so closing this floater doesn't reset it + static std::string mSavedEditorArgs; // stored editor args so closing this floater doesn't reset it + static std::string mSavedDiffPath; // stored diff file path so closing this floater doesn't reset it + + // Internal functionality + static void popupAndPrintWarning(std::string& warning); // pop up a warning + std::string getLocalizedDirectory(); // build and return the path to the XUI directory for the currently-selected localization + void scanDiffFile(LLXmlTreeNode* file_node); // scan a given XML node for diff entries and highlight them in its associated file + void highlightChangedElements(); // look up the list of elements to highlight and highlight them in the current floater + void highlightChangedFiles(); // look up the list of changed files to highlight and highlight them in the scroll list + void findOverlapsInChildren(LLView* parent); // fill the map below with element overlap information + static BOOL overlapIgnorable(LLView* viewp); // check it the element can be ignored for overlap/localization purposes + + // check if two elements overlap using their rectangles + // used instead of llrect functions because by adding a few pixels of leeway I can cut down drastically on the number of overlaps + BOOL elementOverlap(LLView* view1, LLView* view2); + + // Button/drop-down action listeners (self explanatory) + static void onClickDisplayFloater(void*); + static void onClickSaveFloater(void*); + static void onClickSaveAll(void*); + static void onClickEditFloater(void*); + static void onClickBrowseForEditor(void*); + static void onClickBrowseForDiffs(void*); + static void onClickToggleDiffHighlighting(void*); + static void onClickToggleOverlapping(void*); + static void onClickCloseDisplayedFloater(void*); + void onLanguageComboSelect(LLUICtrl* ctrl); +}; +#endif // LL_LLUIPREVIEW_H + diff --git a/indra/newview/llfloaterurldisplay.cpp b/indra/newview/llfloaterurldisplay.cpp index c265c6169a2d7777cd8d872d49c33777a61874c5..7f7d05e1d2793e19c24aa69ee442bf33b1832ff5 100644 --- a/indra/newview/llfloaterurldisplay.cpp +++ b/indra/newview/llfloaterurldisplay.cpp @@ -45,9 +45,10 @@ LLFloaterURLDisplay::LLFloaterURLDisplay(const LLSD& sd) + : LLFloater() { mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterURLDisplay::createPlaceDetail, this); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml", &getFactoryMap()); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml"); this->setVisible(false); // If positioned at 0,0 the teleport button is behind the toolbar. diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 9d91aa98680458fd4f17ebd1a4ee34e85622f5e9..1f5981202916539642de977086b721e2603a649d 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -86,12 +86,22 @@ public: // LLFloaterURLEntry() //----------------------------------------------------------------------------- LLFloaterURLEntry::LLFloaterURLEntry(LLHandle<LLPanel> parent) - : - LLFloater(), - mPanelLandMediaHandle(parent) + : LLFloater(), + mPanelLandMediaHandle(parent) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_url_entry.xml"); +} + +//----------------------------------------------------------------------------- +// ~LLFloaterURLEntry() +//----------------------------------------------------------------------------- +LLFloaterURLEntry::~LLFloaterURLEntry() +{ + sInstance = NULL; +} +BOOL LLFloaterURLEntry::postBuild() +{ mMediaURLEdit = getChild<LLComboBox>("media_entry"); // Cancel button @@ -99,7 +109,6 @@ LLFloaterURLEntry::LLFloaterURLEntry(LLHandle<LLPanel> parent) // Cancel button childSetAction("clear_btn", onBtnClear, this); - // clear media list button LLSD parcel_history = LLURLHistory::getURLHistory("parcel"); bool enable_clear_button = parcel_history.size() > 0 ? true : false; @@ -111,17 +120,8 @@ LLFloaterURLEntry::LLFloaterURLEntry(LLHandle<LLPanel> parent) setDefaultBtn("ok_btn"); buildURLHistory(); - sInstance = this; -} - -//----------------------------------------------------------------------------- -// ~LLFloaterURLEntry() -//----------------------------------------------------------------------------- -LLFloaterURLEntry::~LLFloaterURLEntry() -{ - sInstance = NULL; + return TRUE; } - void LLFloaterURLEntry::buildURLHistory() { LLCtrlListInterface* url_list = childGetListInterface("media_entry"); @@ -155,7 +155,7 @@ void LLFloaterURLEntry::headerFetchComplete(U32 status, const std::string& mime_ // Decrement the cursor getWindow()->decBusyCount(); childSetVisible("loading_label", false); - close(); + closeFloater(); } // static @@ -163,7 +163,7 @@ LLHandle<LLFloater> LLFloaterURLEntry::show(LLHandle<LLPanel> parent) { if (sInstance) { - sInstance->open(); + sInstance->openFloater(); } else { @@ -254,7 +254,7 @@ void LLFloaterURLEntry::onBtnOK( void* userdata ) void LLFloaterURLEntry::onBtnCancel( void* userdata ) { LLFloaterURLEntry *self =(LLFloaterURLEntry *)userdata; - self->close(); + self->closeFloater(); } // static diff --git a/indra/newview/llfloaterurlentry.h b/indra/newview/llfloaterurlentry.h index 6d04326cf814b5c94f576c7b6c20fc6f3c1dfb06..0aeca823b809958284a6d623695bba2dc171b85a 100644 --- a/indra/newview/llfloaterurlentry.h +++ b/indra/newview/llfloaterurlentry.h @@ -1,6 +1,6 @@ /** - * @file llfloaternamedesc.h - * @brief LLFloaterNameDesc class definition + * @file llfloaterurlentry.h + * @brief LLFloaterURLEntry class definition * * $LicenseInfo:firstyear=2007&license=viewergpl$ * @@ -45,7 +45,7 @@ public: // Can only be shown by LLPanelLandMedia, and pushes data back into // that panel via the handle. static LLHandle<LLFloater> show(LLHandle<LLPanel> panel_land_media_handle); - + /*virtual*/ BOOL postBuild(); void updateFromLandMediaPanel(); void headerFetchComplete(U32 status, const std::string& mime_type); diff --git a/indra/newview/llfloatervoicedevicesettings.cpp b/indra/newview/llfloatervoicedevicesettings.cpp index 2922628786b9ae20b41eb57d0a9b552ec5938d8c..12d12f37f2cbe4105319ab793b7f18e5ed8811f0 100644 --- a/indra/newview/llfloatervoicedevicesettings.cpp +++ b/indra/newview/llfloatervoicedevicesettings.cpp @@ -41,7 +41,6 @@ #include "llcombobox.h" #include "llfocusmgr.h" #include "lliconctrl.h" -#include "llprefsvoice.h" #include "llsliderctrl.h" #include "llviewercontrol.h" #include "llvoiceclient.h" @@ -52,6 +51,7 @@ LLPanelVoiceDeviceSettings::LLPanelVoiceDeviceSettings() + : LLPanel() { mCtrlInputDevices = NULL; mCtrlOutputDevices = NULL; @@ -113,7 +113,7 @@ void LLPanelVoiceDeviceSettings::draw() { if (power_bar_idx < discrete_power) { - LLColor4 color = (power_bar_idx >= 3) ? gSavedSettings.getColor4("OverdrivenColor") : gSavedSettings.getColor4("SpeakingColor"); + LLColor4 color = (power_bar_idx >= 3) ? gSavedSkinSettings.getColor4("OverdrivenColor") : gSavedSkinSettings.getColor4("SpeakingColor"); gl_rect_2d(bar_view->getRect(), color, TRUE); } gl_rect_2d(bar_view->getRect(), LLColor4::grey, FALSE); @@ -240,7 +240,7 @@ void LLPanelVoiceDeviceSettings::refresh() } } -void LLPanelVoiceDeviceSettings::onOpen() +void LLPanelVoiceDeviceSettings::initialize() { mInputDevice = gSavedSettings.getString("VoiceInputAudioDevice"); mOutputDevice = gSavedSettings.getString("VoiceOutputAudioDevice"); @@ -255,7 +255,7 @@ void LLPanelVoiceDeviceSettings::onOpen() LLVoiceChannel::suspend(); } -void LLPanelVoiceDeviceSettings::onClose(bool app_quitting) +void LLPanelVoiceDeviceSettings::cleanup() { gVoiceClient->tuningStop(); LLVoiceChannel::resume(); @@ -284,31 +284,32 @@ void LLPanelVoiceDeviceSettings::onCommitOutputDevice(LLUICtrl* ctrl, void* user // LLFloaterVoiceDeviceSettings::LLFloaterVoiceDeviceSettings(const LLSD& seed) - : LLFloater(std::string("floater_device_settings")), + : LLFloater(), mDevicePanel(NULL) { mFactoryMap["device_settings"] = LLCallbackMap(createPanelVoiceDeviceSettings, this); // do not automatically open singleton floaters (as result of getInstance()) - BOOL no_open = FALSE; - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_device_settings.xml", &mFactoryMap, no_open); +// BOOL no_open = FALSE; +// Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_device_settings.xml", no_open); +} +BOOL LLFloaterVoiceDeviceSettings::postBuild() +{ center(); + return TRUE; } - -void LLFloaterVoiceDeviceSettings::onOpen() +void LLFloaterVoiceDeviceSettings::onOpen(const LLSD& key) { if(mDevicePanel) { - mDevicePanel->onOpen(); + mDevicePanel->initialize(); } - - LLFloater::onOpen(); } void LLFloaterVoiceDeviceSettings::onClose(bool app_quitting) { if(mDevicePanel) { - mDevicePanel->onClose(app_quitting); + mDevicePanel->cleanup(); } setVisible(FALSE); diff --git a/indra/newview/llfloatervoicedevicesettings.h b/indra/newview/llfloatervoicedevicesettings.h index d30a57f161d236b0528f126b4804832a826b2d51..47f41d6d7ec9a0c3c04c0be7b4b8b458bf4da22b 100644 --- a/indra/newview/llfloatervoicedevicesettings.h +++ b/indra/newview/llfloatervoicedevicesettings.h @@ -36,8 +36,6 @@ #include "llfloater.h" -class LLPrefsVoiceLogic; - class LLPanelVoiceDeviceSettings : public LLPanel { public: @@ -49,8 +47,8 @@ public: void apply(); void cancel(); void refresh(); - void onOpen(); - void onClose(bool app_quitting); + void initialize(); + void cleanup(); protected: static void onCommitInputDevice(LLUICtrl* ctrl, void* user_data); @@ -68,7 +66,8 @@ class LLFloaterVoiceDeviceSettings : public LLFloater, public LLFloaterSingleton { public: LLFloaterVoiceDeviceSettings(const LLSD& seed); - /*virtual*/ void onOpen(); + virtual BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void draw(); void apply(); diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp index 730c1393ca330f9816828fef7fa72398181b601c..5b551af83659d2c972868f4d5dde78c3309b0e8d 100644 --- a/indra/newview/llfloaterwater.cpp +++ b/indra/newview/llfloaterwater.cpp @@ -66,25 +66,11 @@ LLFloaterWater* LLFloaterWater::sWaterMenu = NULL; std::set<std::string> LLFloaterWater::sDefaultPresets; -LLFloaterWater::LLFloaterWater() : LLFloater(std::string("water floater")) +LLFloaterWater::LLFloaterWater() + : LLFloater() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml"); - // add the combo boxes - LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); - - if(comboBox != NULL) { - - std::map<std::string, LLWaterParamSet>::iterator mIt = - LLWaterParamManager::instance()->mParamList.begin(); - for(; mIt != LLWaterParamManager::instance()->mParamList.end(); mIt++) - { - comboBox->add(mIt->first); - } - - // set defaults on combo boxes - comboBox->selectByValue(LLSD("Default")); - } std::string def_water = getString("WLDefaultWaterNames"); @@ -97,14 +83,33 @@ LLFloaterWater::LLFloaterWater() : LLFloater(std::string("water floater")) sDefaultPresets.insert(tok); } - // load it up - initCallbacks(); + } LLFloaterWater::~LLFloaterWater() { } +BOOL LLFloaterWater::postBuild() +{ + // add the combo boxes + LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); + + if(comboBox != NULL) { + + std::map<std::string, LLWaterParamSet>::iterator mIt = + LLWaterParamManager::instance()->mParamList.begin(); + for(; mIt != LLWaterParamManager::instance()->mParamList.end(); mIt++) + { + comboBox->add(mIt->first); + } + // set defaults on combo boxes + comboBox->selectByValue(LLSD("Default")); + } + // load it up + initCallbacks(); + return TRUE; +} void LLFloaterWater::initCallbacks(void) { // help buttons @@ -165,7 +170,7 @@ void LLFloaterWater::initCallbacks(void) { childSetCommitCallback("WaterWave2DirX", onVector2ControlXMoved, ¶m_mgr->mWave2Dir); childSetCommitCallback("WaterWave2DirY", onVector2ControlYMoved, ¶m_mgr->mWave2Dir); - comboBox->setCommitCallback(onChangePresetName); + comboBox->setCommitCallback(boost::bind(&LLFloaterWater::onChangePresetName, this, _1)); LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap"); textCtrl->setDefaultImageAssetID(DEFAULT_WATER_NORMAL); @@ -296,7 +301,7 @@ LLFloaterWater* LLFloaterWater::instance() if (!sWaterMenu) { sWaterMenu = new LLFloaterWater(); - sWaterMenu->open(); + sWaterMenu->openFloater(); sWaterMenu->setFocus(TRUE); } return sWaterMenu; @@ -310,7 +315,7 @@ void LLFloaterWater::show() //LLUICtrlFactory::getInstance()->buildFloater(water, "floater_water.xml"); //water->initCallbacks(); - water->open(); + water->openFloater(); } bool LLFloaterWater::isOpen() @@ -712,17 +717,13 @@ bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& r } -void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl, void * userData) +void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl) { - LLComboBox * combo_box = static_cast<LLComboBox*>(ctrl); - - if(combo_box->getSimple() == "") + std::string data = ctrl->getValue().asString(); + if(!data.empty()) { - return; + LLWaterParamManager::instance()->loadPreset(data); + sWaterMenu->syncMenu(); } - - LLWaterParamManager::instance()->loadPreset( - combo_box->getSelectedValue().asString()); - sWaterMenu->syncMenu(); } diff --git a/indra/newview/llfloaterwater.h b/indra/newview/llfloaterwater.h index 774d5c5a75a0eafc6b9b1d3bb2206569bbcb5c1d..50fd7dd450051a4193506446b3ecd75d5f886279 100644 --- a/indra/newview/llfloaterwater.h +++ b/indra/newview/llfloaterwater.h @@ -53,7 +53,7 @@ public: LLFloaterWater(); virtual ~LLFloaterWater(); - + /*virtual*/ BOOL postBuild(); /// initialize all void initCallbacks(void); @@ -107,7 +107,7 @@ public: static bool deleteAlertCallback(const LLSD& notification, const LLSD& response); /// what to do when you change the preset name - static void onChangePresetName(LLUICtrl* ctrl, void* userData); + void onChangePresetName(LLUICtrl* ctrl); //// menu management diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp index 98b315795a079506aa6d228ad81669fa4db6b8bf..2ba4002d944c714fba85ded486dc9b0bf211d4af 100644 --- a/indra/newview/llfloaterwindlight.cpp +++ b/indra/newview/llfloaterwindlight.cpp @@ -67,15 +67,36 @@ std::set<std::string> LLFloaterWindLight::sDefaultPresets; static const F32 WL_SUN_AMBIENT_SLIDER_SCALE = 3.0f; -LLFloaterWindLight::LLFloaterWindLight() : LLFloater(std::string("windlight floater")) +LLFloaterWindLight::LLFloaterWindLight() + : LLFloater() { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_windlight_options.xml"); + + + // add the list of presets + std::string def_days = getString("WLDefaultSkyNames"); + + // no editing or deleting of the blank string + sDefaultPresets.insert(""); + boost_tokenizer tokens(def_days, boost::char_separator<char>(":")); + for (boost_tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) + { + std::string tok(*token_iter); + sDefaultPresets.insert(tok); + } +} + +LLFloaterWindLight::~LLFloaterWindLight() +{ +} +BOOL LLFloaterWindLight::postBuild() +{ // add the combo boxes LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo"); if(comboBox != NULL) { - + std::map<std::string, LLWLParamSet>::iterator mIt = LLWLParamManager::instance()->mParamList.begin(); for(; mIt != LLWLParamManager::instance()->mParamList.end(); mIt++) @@ -89,27 +110,10 @@ LLFloaterWindLight::LLFloaterWindLight() : LLFloater(std::string("windlight floa // set defaults on combo boxes comboBox->selectByValue(LLSD("Default")); } - - // add the list of presets - std::string def_days = getString("WLDefaultSkyNames"); - - // no editing or deleting of the blank string - sDefaultPresets.insert(""); - boost_tokenizer tokens(def_days, boost::char_separator<char>(":")); - for (boost_tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) - { - std::string tok(*token_iter); - sDefaultPresets.insert(tok); - } - // load it up initCallbacks(); + return TRUE; } - -LLFloaterWindLight::~LLFloaterWindLight() -{ -} - void LLFloaterWindLight::initCallbacks(void) { // help buttons @@ -210,7 +214,7 @@ void LLFloaterWindLight::initCallbacks(void) { childSetCommitCallback("WLCloudScrollX", onCloudScrollXMoved, NULL); childSetCommitCallback("WLCloudScrollY", onCloudScrollYMoved, NULL); childSetCommitCallback("WLDistanceMult", onFloatControlMoved, ¶m_mgr->mDistanceMult); - childSetCommitCallback("DrawClassicClouds", LLSavedSettingsGlue::setBOOL, (void*)"SkyUseClassicClouds"); + getChild<LLUICtrl>("DrawClassicClouds")->setCommitCallback(boost::bind(LLSavedSettingsGlue::setBOOL, _1, "SkyUseClassicClouds")); // WL Top childSetAction("WLDayCycleMenuButton", onOpenDayCycle, NULL); @@ -222,7 +226,7 @@ void LLFloaterWindLight::initCallbacks(void) { childSetAction("WLSavePreset", onSavePreset, comboBox); childSetAction("WLDeletePreset", onDeletePreset, comboBox); - comboBox->setCommitCallback(onChangePresetName); + comboBox->setCommitCallback(boost::bind(&LLFloaterWindLight::onChangePresetName, this, _1)); // Dome @@ -444,7 +448,7 @@ LLFloaterWindLight* LLFloaterWindLight::instance() if (!sWindLight) { sWindLight = new LLFloaterWindLight(); - sWindLight->open(); + sWindLight->openFloater(); sWindLight->setFocus(TRUE); } return sWindLight; @@ -458,7 +462,7 @@ void LLFloaterWindLight::show() //LLUICtrlFactory::getInstance()->buildFloater(windLight, "floater_windlight_options.xml"); //windLight->initCallbacks(); - windLight->open(); + windLight->openFloater(); } bool LLFloaterWindLight::isOpen() @@ -903,20 +907,16 @@ bool LLFloaterWindLight::deleteAlertCallback(const LLSD& notification, const LLS } -void LLFloaterWindLight::onChangePresetName(LLUICtrl* ctrl, void * userData) +void LLFloaterWindLight::onChangePresetName(LLUICtrl* ctrl) { deactivateAnimator(); - LLComboBox * combo_box = static_cast<LLComboBox*>(ctrl); - - if(combo_box->getSimple() == "") + std::string data = ctrl->getValue().asString(); + if(!data.empty()) { - return; + LLWLParamManager::instance()->loadPreset( data); + sWindLight->syncMenu(); } - - LLWLParamManager::instance()->loadPreset( - combo_box->getSelectedValue().asString()); - sWindLight->syncMenu(); } void LLFloaterWindLight::onOpenDayCycle(void* userData) diff --git a/indra/newview/llfloaterwindlight.h b/indra/newview/llfloaterwindlight.h index 3447caa923890642bde3c99efc8ffec71ede6c3e..e527a5637ca43c3a5e7534f53e80027ddacf9f14 100644 --- a/indra/newview/llfloaterwindlight.h +++ b/indra/newview/llfloaterwindlight.h @@ -53,7 +53,7 @@ public: LLFloaterWindLight(); virtual ~LLFloaterWindLight(); - + /*virtual*/ BOOL postBuild(); /// initialize all void initCallbacks(void); @@ -104,7 +104,7 @@ public: bool deleteAlertCallback(const LLSD& notification, const LLSD& response); /// what to do when you change the preset name - static void onChangePresetName(LLUICtrl* ctrl, void* userData); + void onChangePresetName(LLUICtrl* ctrl); /// when user hits the save preset button static void onOpenDayCycle(void* userData); diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 8326557cf808cb182c77ba24d783d9cf8e411302..251539088be6e50a8fce128f3d968ae29b9f7f29 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -41,23 +41,22 @@ #include "llfloaterworldmap.h" #include "llagent.h" -#include "llviewerwindow.h" #include "llbutton.h" #include "llcallingcard.h" -#include "llcolorscheme.h" #include "llcombobox.h" #include "llviewercontrol.h" #include "lldraghandle.h" #include "llfirstuse.h" +#include "llfloaterreg.h" // getTypedInstance() #include "llfocusmgr.h" #include "lllandmarklist.h" #include "lllineeditor.h" #include "llpreviewlandmark.h" #include "llregionhandle.h" #include "llscrolllistctrl.h" +#include "llslurl.h" #include "lltextbox.h" #include "lltracker.h" -#include "llurldispatcher.h" #include "llviewermenu.h" #include "llviewerregion.h" #include "llviewerstats.h" @@ -69,6 +68,7 @@ #include "llweb.h" #include "llglheaders.h" +#include "llwindow.h" // copyTextToClipboard() //--------------------------------------------------------------------------- // Constants @@ -84,17 +84,10 @@ enum EPanDirection }; // Values in pixels per region -static const F32 ZOOM_MIN = -8.f; // initial value, updated by adjustZoomSlider -static const F32 ZOOM_MAX = 0.f; -static const F32 ZOOM_INC = 0.2f; +static const F32 ZOOM_MAX = 128.f; -static const F32 SIM_COORD_MIN = 0.f; -static const F32 SIM_COORD_MAX = 255.f; static const F32 SIM_COORD_DEFAULT = 128.f; -static const F64 MAX_FLY_DISTANCE = 363.f; // Diagonal size of one sim. -static const F64 MAX_FLY_DISTANCE_SQUARED = MAX_FLY_DISTANCE * MAX_FLY_DISTANCE; - //--------------------------------------------------------------------------- // Globals //--------------------------------------------------------------------------- @@ -148,8 +141,8 @@ const LLUUID LLFloaterWorldMap::sHomeID( "10000000-0000-0000-0000-000000000001" //--------------------------------------------------------------------------- -LLFloaterWorldMap::LLFloaterWorldMap() -: LLFloater(std::string("worldmap")), +LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) +: LLFloater(key), mInventory(NULL), mInventoryObserver(NULL), mFriendObserver(NULL), @@ -161,16 +154,18 @@ LLFloaterWorldMap::LLFloaterWorldMap() mTrackedLocation(0,0,0), mTrackedStatus(LLTracker::TRACKING_NOTHING) { - LLCallbackMap::map_t factory_map; - factory_map["objects_mapview"] = LLCallbackMap(createWorldMapView, NULL); - factory_map["terrain_mapview"] = LLCallbackMap(createWorldMapView, NULL); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_world_map.xml", &factory_map); + gFloaterWorldMap = this; + + mFactoryMap["objects_mapview"] = LLCallbackMap(createWorldMapView, NULL); + mFactoryMap["terrain_mapview"] = LLCallbackMap(createWorldMapView, NULL); + + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_world_map.xml", FALSE); } // static void* LLFloaterWorldMap::createWorldMapView(void* data) { - return new LLWorldMapView(std::string("mapview"), LLRect(0,300,400,0)); + return new LLWorldMapView(); } BOOL LLFloaterWorldMap::postBuild() @@ -178,27 +173,14 @@ BOOL LLFloaterWorldMap::postBuild() mTabs = getChild<LLTabContainer>("maptab"); if (!mTabs) return FALSE; - LLPanel *panel; - - panel = mTabs->getChild<LLPanel>("objects_mapview"); - if (panel) - { - mTabs->setTabChangeCallback(panel, onCommitBackground); - mTabs->setTabUserData(panel, this); - } - panel = mTabs->getChild<LLPanel>("terrain_mapview"); - if (panel) - { - mTabs->setTabChangeCallback(panel, onCommitBackground); - mTabs->setTabUserData(panel, this); - } + mTabs->setCommitCallback(boost::bind(&LLFloaterWorldMap::onCommitBackground, this)); // The following callback syncs the worlmap tabs with the images. // Commented out since it was crashing when LLWorldMap became a singleton. // We should be fine without it but override the onOpen method and put it // there if it turns out to be needed. -MG // - //onCommitBackground((void*)this, false); + //onCommitBackground(); childSetCommitCallback("friend combo", onAvatarComboCommit, this); @@ -206,22 +188,22 @@ BOOL LLFloaterWorldMap::postBuild() if (avatar_combo) { avatar_combo->selectFirstItem(); - avatar_combo->setPrearrangeCallback( onAvatarComboPrearrange ); - avatar_combo->setTextEntryCallback( onComboTextEntry ); + avatar_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onAvatarComboPrearrange, this) ); + avatar_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) ); } childSetAction("DoSearch", onLocationCommit, this); - childSetFocusChangedCallback("location", onLocationFocusChanged, this); + getChild<LLScrollListCtrl>("location")->setFocusChangedCallback(boost::bind(&LLFloaterWorldMap::onLocationFocusChanged, this, _1)); LLLineEditor *location_editor = getChild<LLLineEditor>("location"); if (location_editor) { - location_editor->setKeystrokeCallback( onSearchTextEntry ); + location_editor->setKeystrokeCallback( boost::bind(&LLFloaterWorldMap::onSearchTextEntry, this, _1), NULL ); } childSetCommitCallback("search_results", onCommitSearchResult, this); - childSetDoubleClickCallback("search_results", onClickTeleportBtn); + getChild<LLScrollListCtrl>("search_results")->setDoubleClickCallback(onClickTeleportBtn, this); childSetCommitCallback("spin x", onCommitLocation, this); childSetCommitCallback("spin y", onCommitLocation, this); childSetCommitCallback("spin z", onCommitLocation, this); @@ -232,8 +214,8 @@ BOOL LLFloaterWorldMap::postBuild() if (landmark_combo) { landmark_combo->selectFirstItem(); - landmark_combo->setPrearrangeCallback( onLandmarkComboPrearrange ); - landmark_combo->setTextEntryCallback( onComboTextEntry ); + landmark_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onLandmarkComboPrearrange, this) ); + landmark_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) ); } childSetAction("Go Home", onGoHome, this); @@ -267,28 +249,44 @@ LLFloaterWorldMap::~LLFloaterWorldMap() // avatar tracker will delete this for us. mFriendObserver = NULL; + + gFloaterWorldMap = NULL; } +//static +LLFloaterWorldMap* LLFloaterWorldMap::getInstance() +{ + return LLFloaterReg::getTypedInstance<LLFloaterWorldMap>("world_map"); +} // virtual void LLFloaterWorldMap::onClose(bool app_quitting) { + // While we're not visible, discard the overlay images we're using + LLWorldMap::getInstance()->clearImageRefs(); + +#if RELEASE_FOR_DOWNLOAD setVisible(FALSE); +#else + // Don't call destroy(), we need to delete this immediately + delete this; // sets gFloaterWorldMap = NULL; + // need to reconstruct gFloaterWorldMap so that code that assumes it exists doesn't crash + LLFloaterReg::getInstance("world_map"); // constructs a LLFloaterWorldMap and sets gFloaterWorldMap + gFloaterWorldMap->setVisible(FALSE); // hide it +#endif } -// static -void LLFloaterWorldMap::show(void*, BOOL center_on_target) +// virtual +void LLFloaterWorldMap::onOpen(const LLSD& key) { - BOOL was_visible = gFloaterWorldMap->getVisible(); + bool center_on_target = (key.asString() == "center"); - gFloaterWorldMap->mIsClosing = FALSE; - gFloaterWorldMap->open(); /* Flawfinder: ignore */ + mIsClosing = FALSE; LLWorldMapView* map_panel; - map_panel = (LLWorldMapView*)gFloaterWorldMap->mTabs->getCurrentPanel(); + map_panel = (LLWorldMapView*)mTabs->getCurrentPanel(); map_panel->clearLastClick(); - if (!was_visible) { // reset pan on show, so it centers on you again if (!center_on_target) @@ -303,13 +301,13 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target) // Reload any maps that may have changed LLWorldMap::getInstance()->clearSimFlags(); - const S32 panel_num = gFloaterWorldMap->mTabs->getCurrentPanelIndex(); + const S32 panel_num = mTabs->getCurrentPanelIndex(); const bool request_from_sim = true; LLWorldMap::getInstance()->setCurrentLayer(panel_num, request_from_sim); // We may already have a bounding box for the regions of the world, // so use that to adjust the view. - gFloaterWorldMap->adjustZoomSliderBounds(); + adjustZoomSliderBounds(); // Could be first show LLFirstUse::useMap(); @@ -318,19 +316,19 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target) LLUUID landmark_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); gInventory.startBackgroundFetch(landmark_folder_id); - gFloaterWorldMap->childSetFocus("location", TRUE); + childSetFocus("location", TRUE); gFocusMgr.triggerFocusFlash(); - gFloaterWorldMap->buildAvatarIDList(); - gFloaterWorldMap->buildLandmarkIDLists(); + buildAvatarIDList(); + buildLandmarkIDLists(); // If nothing is being tracked, set flag so the user position will be found - gFloaterWorldMap->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); + mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); } if (center_on_target) { - gFloaterWorldMap->centerOnTarget(FALSE); + centerOnTarget(FALSE); } } @@ -345,46 +343,6 @@ void LLFloaterWorldMap::reloadIcons(void*) } -// static -void LLFloaterWorldMap::toggle(void*) -{ - BOOL visible = gFloaterWorldMap->getVisible(); - - if (!visible) - { - show(NULL, FALSE); - } - else - { - gFloaterWorldMap->mIsClosing = TRUE; - gFloaterWorldMap->close(); - } -} - - -// static -void LLFloaterWorldMap::hide(void*) -{ - gFloaterWorldMap->mIsClosing = TRUE; - gFloaterWorldMap->close(); -} - - -// virtual -void LLFloaterWorldMap::setVisible( BOOL visible ) -{ - LLFloater::setVisible( visible ); - - gSavedSettings.setBOOL( "ShowWorldMap", visible ); - - if( !visible ) - { - // While we're not visible, discard the overlay images we're using - LLWorldMap::getInstance()->clearImageRefs(); - } -} - - // virtual BOOL LLFloaterWorldMap::handleHover(S32 x, S32 y, MASK mask) { @@ -428,6 +386,9 @@ void LLFloaterWorldMap::reshape( S32 width, S32 height, BOOL called_from_parent // virtual void LLFloaterWorldMap::draw() { + static LLCachedControl<LLColor4> map_track_color(gSavedSkinSettings, "MapTrackColor", LLColor4::white); + static LLCachedControl<LLColor4> map_track_disabled_color(gSavedSkinSettings, "MapTrackDisabledColor", LLColor4::white); + // Hide/Show Mature Events controls childSetVisible("events_mature_icon", gAgent.canAccessMature()); childSetVisible("events_mature_label", gAgent.canAccessMature()); @@ -456,25 +417,25 @@ void LLFloaterWorldMap::draw() LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); if (LLTracker::TRACKING_AVATAR == tracking_status) { - childSetColor("avatar_icon", gTrackColor); + childSetColor("avatar_icon", map_track_color); } else { - childSetColor("avatar_icon", gDisabledTrackColor); + childSetColor("avatar_icon", map_track_disabled_color); } if (LLTracker::TRACKING_LANDMARK == tracking_status) { - childSetColor("landmark_icon", gTrackColor); + childSetColor("landmark_icon", map_track_color); } else { - childSetColor("landmark_icon", gDisabledTrackColor); + childSetColor("landmark_icon", map_track_disabled_color); } if (LLTracker::TRACKING_LOCATION == tracking_status) { - childSetColor("location_icon", gTrackColor); + childSetColor("location_icon", map_track_color); } else { @@ -488,7 +449,7 @@ void LLFloaterWorldMap::draw() } else { - childSetColor("location_icon", gDisabledTrackColor); + childSetColor("location_icon", map_track_disabled_color); } } @@ -703,7 +664,7 @@ void LLFloaterWorldMap::updateLocation() childSetValue("spin z", LLSD(agent_z) ); // Set the current SLURL - mSLURL = LLURLDispatcher::buildSLURL(agent_sim_name, agent_x, agent_y, agent_z); + mSLURL = LLSLURL::buildSLURL(agent_sim_name, agent_x, agent_y, agent_z); } } @@ -740,7 +701,7 @@ void LLFloaterWorldMap::updateLocation() // simNameFromPosGlobal can fail, so don't give the user an invalid SLURL if ( gotSimName ) { - mSLURL = LLURLDispatcher::buildSLURL(sim_name, llround(region_x), llround(region_y), llround((F32)pos_global.mdV[VZ])); + mSLURL = LLSLURL::buildSLURL(sim_name, llround(region_x), llround(region_y), llround((F32)pos_global.mdV[VZ])); } else { // Empty SLURL will disable the "Copy SLURL to clipboard" button @@ -1024,7 +985,7 @@ void LLFloaterWorldMap::adjustZoomSliderBounds() // Make sure the zoom slider can be moved at least a little bit. // Likewise, less than the increment pixels per region is just silly. - pixels_per_region = llclamp(pixels_per_region, 1.f, (F32)(pow(2.f, ZOOM_MAX) * 128.f)); + pixels_per_region = llclamp(pixels_per_region, 1.f, ZOOM_MAX); F32 min_power = log(pixels_per_region/256.f)/log(2.f); childSetMinValue("zoom slider", min_power); @@ -1062,20 +1023,18 @@ void LLFloaterWorldMap::onPanBtn( void* userdata ) void LLFloaterWorldMap::onGoHome(void*) { gAgent.teleportHome(); - gFloaterWorldMap->close(); + gFloaterWorldMap->closeFloater(); } -// static -void LLFloaterWorldMap::onLandmarkComboPrearrange( LLUICtrl* ctrl, void* userdata ) +void LLFloaterWorldMap::onLandmarkComboPrearrange( ) { - LLFloaterWorldMap* self = gFloaterWorldMap; - if( !self || self->mIsClosing ) + if( mIsClosing ) { return; } - LLCtrlListInterface *list = self->childGetListInterface("landmark combo"); + LLCtrlListInterface *list = childGetListInterface("landmark combo"); if (!list) return; LLUUID current_choice = list->getCurrentID(); @@ -1089,7 +1048,7 @@ void LLFloaterWorldMap::onLandmarkComboPrearrange( LLUICtrl* ctrl, void* userdat } -void LLFloaterWorldMap::onComboTextEntry( LLLineEditor* ctrl, void* userdata ) +void LLFloaterWorldMap::onComboTextEntry() { // Reset the tracking whenever we start typing into any of the search fields, // so that hitting <enter> does an auto-complete versus teleporting us to the @@ -1097,11 +1056,10 @@ void LLFloaterWorldMap::onComboTextEntry( LLLineEditor* ctrl, void* userdata ) LLTracker::clearFocus(); } -// static -void LLFloaterWorldMap::onSearchTextEntry( LLLineEditor* ctrl, void* userdata ) +void LLFloaterWorldMap::onSearchTextEntry( LLLineEditor* ctrl ) { - onComboTextEntry(ctrl, userdata); - updateSearchEnabled(ctrl, userdata); + onComboTextEntry(); + updateSearchEnabled(); } // static @@ -1154,15 +1112,14 @@ void LLFloaterWorldMap::onLandmarkComboCommit( LLUICtrl* ctrl, void* userdata ) } // static -void LLFloaterWorldMap::onAvatarComboPrearrange( LLUICtrl* ctrl, void* userdata ) +void LLFloaterWorldMap::onAvatarComboPrearrange( ) { - LLFloaterWorldMap* self = gFloaterWorldMap; - if( !self || self->mIsClosing ) + if( mIsClosing ) { return; } - LLCtrlListInterface *list = self->childGetListInterface("friend combo"); + LLCtrlListInterface *list = childGetListInterface("friend combo"); if (!list) return; LLUUID current_choice; @@ -1172,7 +1129,7 @@ void LLFloaterWorldMap::onAvatarComboPrearrange( LLUICtrl* ctrl, void* userdata current_choice = LLAvatarTracker::instance().getAvatarID(); } - self->buildAvatarIDList(); + buildAvatarIDList(); if( !list->setCurrentByID( current_choice ) || current_choice.isNull() ) { @@ -1208,24 +1165,21 @@ void LLFloaterWorldMap::onAvatarComboCommit( LLUICtrl* ctrl, void* userdata ) } } -//static -void LLFloaterWorldMap::onLocationFocusChanged( LLFocusableElement* focus, void* userdata ) +void LLFloaterWorldMap::onLocationFocusChanged( LLFocusableElement* focus ) { - updateSearchEnabled((LLUICtrl*)focus, userdata); + updateSearchEnabled(); } -// static -void LLFloaterWorldMap::updateSearchEnabled( LLUICtrl* ctrl, void* userdata ) +void LLFloaterWorldMap::updateSearchEnabled() { - LLFloaterWorldMap *self = gFloaterWorldMap; - if (self->childHasKeyboardFocus("location") && - self->childGetValue("location").asString().length() > 0) + if (childHasKeyboardFocus("location") && + childGetValue("location").asString().length() > 0) { - self->setDefaultBtn("DoSearch"); + setDefaultBtn("DoSearch"); } else { - self->setDefaultBtn(NULL); + setDefaultBtn(NULL); } } @@ -1312,7 +1266,7 @@ void LLFloaterWorldMap::onClickTeleportBtn(void* data) void LLFloaterWorldMap::onCopySLURL(void* data) { LLFloaterWorldMap* self = (LLFloaterWorldMap*)data; - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(self->mSLURL)); + self->getWindow()->copyTextToClipboard(utf8str_to_wstring(self->mSLURL)); LLSD args; args["SLURL"] = self->mSLURL; @@ -1375,7 +1329,7 @@ void LLFloaterWorldMap::fly() if (!pos_global.isExactlyZero()) { gAgent.startAutoPilotGlobal( pos_global ); - close(); + closeFloater(); } else { @@ -1536,14 +1490,10 @@ void LLFloaterWorldMap::flyToAvatar() } } -// static -void LLFloaterWorldMap::onCommitBackground(void* userdata, bool from_click) +void LLFloaterWorldMap::onCommitBackground() { - LLFloaterWorldMap* self = (LLFloaterWorldMap*) userdata; - // Find my index - S32 index = self->mTabs->getCurrentPanelIndex(); - + S32 index = mTabs->getCurrentPanelIndex(); LLWorldMap::getInstance()->setCurrentLayer(index); } @@ -1612,7 +1562,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) } else if (num_results == 0) { - list->addCommentText(std::string("None found.")); + list->setCommentText(std::string("None found.")); list->operateOnAll(LLCtrlListInterface::OP_DESELECT); } } diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index b0e72f298ad858fbf3301ab5ba2902dcbb1a97a3..a7d7051b4074ad54ff5058aadadda7f6a81c4998 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -50,28 +50,27 @@ class LLInventoryModel; class LLInventoryObserver; class LLItemInfo; class LLTabContainer; -class LLWorldMapView; class LLFloaterWorldMap : public LLFloater { public: - LLFloaterWorldMap(); + LLFloaterWorldMap(const LLSD& key); virtual ~LLFloaterWorldMap(); + // Prefer this to gFloaterWorldMap + static LLFloaterWorldMap* getInstance(); + static void *createWorldMapView(void* data); BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onClose(bool app_quitting); - static void show(void*, BOOL center_on_target ); static void reloadIcons(void*); - static void toggle(void*); - static void hide(void*); /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE ); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - /*virtual*/ void setVisible(BOOL visible); /*virtual*/ void draw(); // methods for dealing with inventory. The observe() method is @@ -117,16 +116,16 @@ protected: static void onGoHome(void* data); - static void onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data ); + void onLandmarkComboPrearrange( ); static void onLandmarkComboCommit( LLUICtrl* ctrl, void* data ); - static void onAvatarComboPrearrange( LLUICtrl* ctrl, void* data ); + void onAvatarComboPrearrange( ); static void onAvatarComboCommit( LLUICtrl* ctrl, void* data ); - static void onCommitBackground(void* data, bool from_click); + void onCommitBackground(); - static void onComboTextEntry( LLLineEditor* ctrl, void* data ); - static void onSearchTextEntry( LLLineEditor* ctrl, void* data ); + void onComboTextEntry( ); + void onSearchTextEntry( LLLineEditor* ctrl ); static void onClearBtn(void*); static void onFlyBtn(void*); @@ -153,8 +152,8 @@ protected: void flyToAvatar(); void teleportToAvatar(); - static void updateSearchEnabled( LLUICtrl* ctrl, void* userdata ); - static void onLocationFocusChanged( LLFocusableElement* ctrl, void* userdata ); + void updateSearchEnabled( ); + void onLocationFocusChanged( LLFocusableElement* ctrl ); static void onLocationCommit( void* userdata ); static void onCommitLocation( LLUICtrl* ctrl, void* userdata ); static void onCommitSearchResult( LLUICtrl* ctrl, void* userdata ); diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 97a3bd7c50eba29950e33f09dce60a53318081f2..5b17c98ef0c5488ab4a5fdd8347e8e887d9d7c32 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -45,15 +45,16 @@ #include "llinventory.h" #include "llcallbacklist.h" +#include "llinventorybridge.h" #include "llinventoryclipboard.h" // *TODO: remove this once hack below gone. #include "llinventoryview.h"// hacked in for the bonus context menu items. #include "llkeyboard.h" #include "lllineeditor.h" #include "llmenugl.h" -#include "llresmgr.h" #include "llpreview.h" #include "llscrollcontainer.h" // hack to allow scrolling #include "lltooldraganddrop.h" +#include "lltrans.h" #include "llui.h" #include "llviewerimage.h" #include "llviewerimagelist.h" @@ -110,28 +111,16 @@ void renamer_focus_lost( LLFocusableElement* handler, void* user_data ); // statics const LLFontGL* LLFolderViewItem::sFont = NULL; const LLFontGL* LLFolderViewItem::sSmallFont = NULL; -LLColor4 LLFolderViewItem::sFgColor; -LLColor4 LLFolderViewItem::sHighlightBgColor; -LLColor4 LLFolderViewItem::sHighlightFgColor; -LLColor4 LLFolderViewItem::sFilterBGColor; -LLColor4 LLFolderViewItem::sFilterTextColor; -LLColor4 LLFolderViewItem::sSuffixColor; -LLColor4 LLFolderViewItem::sSearchStatusColor; LLUIImagePtr LLFolderViewItem::sArrowImage; LLUIImagePtr LLFolderViewItem::sBoxImage; +const LLColor4U DEFAULT_WHITE(255, 255, 255); + //static void LLFolderViewItem::initClass() { - sFont = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); - sSmallFont = LLResMgr::getInstance()->getRes( LLFONT_SMALL ); - sFgColor = gColors.getColor( "MenuItemEnabledColor" ); - sHighlightBgColor = gColors.getColor( "MenuItemHighlightBgColor" ); - sHighlightFgColor = gColors.getColor( "MenuItemHighlightFgColor" ); - sFilterBGColor = gColors.getColor( "FilterBackgroundColor" ); - sFilterTextColor = gColors.getColor( "FilterTextColor" ); - sSuffixColor = gColors.getColor( "InventoryItemSuffixColor" ); - sSearchStatusColor = gColors.getColor( "InventorySearchStatusColor" ); + sFont = LLFontGL::getFontSansSerifSmall(); + sSmallFont = LLFontGL::getFontMonospace(); sArrowImage = LLUI::getUIImage("folder_arrow.tga"); sBoxImage = LLUI::getUIImage("rounded_square.tga"); } @@ -143,23 +132,18 @@ void LLFolderViewItem::cleanupClass() sBoxImage = NULL; } -// Default constructor // NOTE: Optimize this, we call it a *lot* when opening a large inventory -LLFolderViewItem::LLFolderViewItem( const std::string& name, LLUIImagePtr icon, - time_t creation_date, - LLFolderView* root, - LLFolderViewEventListener* listener ) : - LLUICtrl( name, LLRect(0, 0, 0, 0), TRUE, NULL, NULL, FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_RIGHT), - mLabel( name ), + +// Default constructor +LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p) +: LLView(p), mLabelWidth(0), - mCreationDate(creation_date), + mLabelWidthDirty(false), mParentFolder( NULL ), - mListener( listener ), mIsSelected( FALSE ), mIsCurSelection( FALSE ), mSelectPending(FALSE), mLabelStyle( LLFontGL::NORMAL ), - mIcon(icon), mHasVisibleChildren(FALSE), mIndentation(0), mNumDescendantsSelected(0), @@ -167,12 +151,16 @@ LLFolderViewItem::LLFolderViewItem( const std::string& name, LLUIImagePtr icon, mLastFilterGeneration(-1), mStringMatchOffset(std::string::npos), mControlLabelRotation(0.f), - mRoot( root ), mDragAndDropTarget(FALSE), - mIsLoading(FALSE) + mIsLoading(FALSE), + mLabel(p.name), + mRoot(p.root), + mCreationDate(p.creation_date), + mListener(p.listener), + mArrowImage(p.folder_arrow_image), + mBoxImage(p.selection_image) { - refresh(); // possible opt: only call refreshFromListener() - setTabStop(FALSE); + refresh(); } // Destroys the object @@ -258,7 +246,7 @@ BOOL LLFolderViewItem::potentiallyVisible() BOOL LLFolderViewItem::getFiltered() { - return mFiltered && mLastFilterGeneration >= mRoot->getFilter()->getMinRequiredGeneration(); + return mFiltered && mLastFilterGeneration >= getRoot()->getFilter()->getMinRequiredGeneration(); } BOOL LLFolderViewItem::getFiltered(S32 filter_generation) @@ -283,6 +271,15 @@ void LLFolderViewItem::refreshFromListener() if(mListener) { mLabel = mListener->getDisplayName(); + LLAssetType::EType preferred_type = mListener->getPreferredType(); + + // *TODO: to be removed when database supports multi language. This is a + // temporary attempt to display the inventory folder in the user locale. + if (preferred_type != LLAssetType::AT_NONE) + { + mLabel = LLTrans::getString("InvFolder " + mLabel); + }; + setIcon(mListener->getIcon()); time_t creation_date = mListener->getCreationDate(); if (mCreationDate != creation_date) @@ -307,20 +304,15 @@ void LLFolderViewItem::refresh() { mSearchableLabel.assign(searchable_label); dirtyFilter(); - // some part of label has changed, so overall width has potentially changed + // some part of label has changed, so overall width has potentially changed, and sort order too if (mParentFolder) { + mParentFolder->requestSort(); mParentFolder->requestArrange(); } } - S32 label_width = sFont->getWidth(mLabel); - if( mLabelSuffix.size() ) - { - label_width += sFont->getWidth( mLabelSuffix ); - } - - mLabelWidth = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + label_width; + mLabelWidthDirty = true; } void LLFolderViewItem::applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor) @@ -397,6 +389,12 @@ BOOL LLFolderViewItem::addToFolder(LLFolderViewFolder* folder, LLFolderView* roo S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation) { mIndentation = mParentFolder ? mParentFolder->getIndentation() + LEFT_INDENTATION : 0; + if (mLabelWidthDirty) + { + mLabelWidth = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + sFont->getWidth(mSearchableLabel); + mLabelWidthDirty = false; + } + *width = llmax(*width, mLabelWidth + mIndentation); *height = getItemHeight(); return *height; @@ -574,14 +572,13 @@ void LLFolderViewItem::rename(const std::string& new_name) { if( !new_name.empty() ) { - mLabel = new_name; if( mListener ) { mListener->renameItem(new_name); if(mParentFolder) { - mParentFolder->resort(this); + mParentFolder->requestSort(); } } } @@ -796,6 +793,14 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFolderViewItem::draw() { + static LLCachedControl<LLColor4> sFgColor(gSavedSkinSettings, "MenuItemEnabledColor", DEFAULT_WHITE); + static LLCachedControl<LLColor4> sHighlightBgColor(gSavedSkinSettings, "MenuItemHighlightBgColor", DEFAULT_WHITE); + static LLCachedControl<LLColor4> sHighlightFgColor(gSavedSkinSettings, "MenuItemHighlightFgColor", DEFAULT_WHITE); + static LLCachedControl<LLColor4> sFilterBGColor(gSavedSkinSettings, "FilterBackgroundColor", DEFAULT_WHITE); + static LLCachedControl<LLColor4> sFilterTextColor(gSavedSkinSettings, "FilterTextColor", DEFAULT_WHITE); + static LLCachedControl<LLColor4> sSuffixColor(gSavedSkinSettings, "InventoryItemSuffixColor", DEFAULT_WHITE); + static LLCachedControl<LLColor4> sSearchStatusColor(gSavedSkinSettings, "InventorySearchStatusColor", DEFAULT_WHITE); + bool possibly_has_children = false; bool up_to_date = mListener && mListener->isUpToDate(); if((up_to_date && hasVisibleChildren() ) || // we fetched our children and some of them have passed the filter... @@ -816,7 +821,7 @@ void LLFolderViewItem::draw() // If we have keyboard focus, draw selection filled BOOL show_context = getRoot()->getShowSelectionContext(); - BOOL filled = show_context || (gFocusMgr.getKeyboardFocus() == getRoot()); + BOOL filled = show_context || (getRoot()->getParentPanel()->hasFocus()); // always render "current" item, only render other selected items if // mShowSingleSelection is FALSE @@ -920,7 +925,7 @@ void LLFolderViewItem::draw() LLColor4 filter_color = mLastFilterGeneration >= getRoot()->getFilter()->getCurrentGeneration() ? LLColor4(0.5f, 0.8f, 0.5f, 1.f) : LLColor4(0.8f, 0.5f, 0.5f, 1.f); sSmallFont->renderUTF8(mStatusText, 0, text_left, y, filter_color, - LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, &right_x, FALSE ); text_left = right_x; } @@ -928,26 +933,25 @@ void LLFolderViewItem::draw() if ( mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime") ) { - // *TODO: Translate - sFont->renderUTF8( std::string("Loading... "), 0, text_left, y, sSearchStatusColor, - LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, S32_MAX, S32_MAX, &right_x, FALSE); + sFont->renderUTF8(LLTrans::getString("LoadingData"), 0, text_left, y, sSearchStatusColor, + LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, &right_x, FALSE); text_left = right_x; } sFont->renderUTF8( mLabel, 0, text_left, y, color, - LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, + LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, &right_x, FALSE ); if (!mLabelSuffix.empty()) { sFont->renderUTF8( mLabelSuffix, 0, right_x, y, sSuffixColor, - LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, + LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, &right_x, FALSE ); } if (sBoxImage.notNull() && mStringMatchOffset != std::string::npos) { // don't draw backgrounds for zero-length strings - S32 filter_string_length = mRoot->getFilterSubString().size(); + S32 filter_string_length = getRoot()->getFilterSubString().size(); if (filter_string_length > 0) { std::string combined_string = mLabel + mLabelSuffix; @@ -961,7 +965,7 @@ void LLFolderViewItem::draw() F32 match_string_left = text_left + sFont->getWidthF32(combined_string, 0, mStringMatchOffset); F32 y = (F32)getRect().getHeight() - sFont->getLineHeight() - (F32)TEXT_PAD; sFont->renderUTF8( combined_string, mStringMatchOffset, match_string_left, y, - sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, + sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, LLFontGL::NO_SHADOW, filter_string_length, S32_MAX, &right_x, FALSE ); } } @@ -971,6 +975,13 @@ void LLFolderViewItem::draw() { drawDebugRect(); } + + //// *HACK: also draw debug rectangles around currently-being-edited LLView, and any elements that are being highlighted by GUI preview code (see LLFloaterUIPreview) + //std::set<LLView*>::iterator iter = std::find(sPreviewHighlightedElements.begin(), sPreviewHighlightedElements.end(), this); + //if ((sEditingUI && this == sEditingUIView) || (iter != sPreviewHighlightedElements.end() && sDrawPreviewHighlights)) + //{ + // drawDebugRect(); + //} } @@ -978,11 +989,8 @@ void LLFolderViewItem::draw() /// Class LLFolderViewFolder ///---------------------------------------------------------------------------- -// Default constructor -LLFolderViewFolder::LLFolderViewFolder( const std::string& name, LLUIImagePtr icon, - LLFolderView* root, - LLFolderViewEventListener* listener ): - LLFolderViewItem( name, icon, 0, root, listener ), // 0 = no create time +LLFolderViewFolder::LLFolderViewFolder( const LLFolderViewItem::Params& p ): + LLFolderViewItem( p ), // 0 = no create time mIsOpen(FALSE), mExpanderHighlighted(FALSE), mCurHeight(0.f), @@ -993,10 +1001,9 @@ LLFolderViewFolder::LLFolderViewFolder( const std::string& name, LLUIImagePtr ic mLastArrangeGeneration( -1 ), mLastCalculatedWidth(0), mCompletedFilterGeneration(-1), - mMostFilteredDescendantGeneration(-1) -{ - mType = std::string("(folder)"); -} + mMostFilteredDescendantGeneration(-1), + mNeedsSort(false) +{} // Destroys the object LLFolderViewFolder::~LLFolderViewFolder( void ) @@ -1022,6 +1029,14 @@ BOOL LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* r // makes sure that this view and it's children are the right size. S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) { + // sort before laying out contents + if (mNeedsSort) + { + mFolders.sort(mSortFunction); + mItems.sort(mSortFunction); + mNeedsSort = false; + } + mHasVisibleChildren = hasFilteredDescendants(filter_generation); LLInventoryFilter::EFolderShow show_folder_state = getRoot()->getShowFolderState(); @@ -1042,7 +1057,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) { // set last arrange generation first, in case children are animating // and need to be arranged again - mLastArrangeGeneration = mRoot->getArrangeGeneration(); + mLastArrangeGeneration = getRoot()->getArrangeGeneration(); if (mIsOpen) { // Add sizes of children @@ -1163,7 +1178,14 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) BOOL LLFolderViewFolder::needsArrange() { - return mLastArrangeGeneration < mRoot->getArrangeGeneration(); + return mLastArrangeGeneration < getRoot()->getArrangeGeneration(); +} + +void LLFolderViewFolder::requestSort() +{ + mNeedsSort = true; + // whenever item order changes, we need to lay things out again + requestArrange(); } void LLFolderViewFolder::setCompletedFilterGeneration(S32 generation, BOOL recurse_up) @@ -1256,7 +1278,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) if ((*fit)->getFiltered() || (*fit)->hasFilteredDescendants(filter.getMinRequiredGeneration())) { mMostFilteredDescendantGeneration = filter_generation; - if (mRoot->needsAutoSelect()) + if (getRoot()->needsAutoSelect()) { (*fit)->setOpenArrangeRecursively(TRUE); } @@ -1272,7 +1294,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) if ((*fit)->getFiltered() || (*fit)->hasFilteredDescendants(filter_generation)) { mMostFilteredDescendantGeneration = filter_generation; - if (mRoot->needsAutoSelect()) + if (getRoot()->needsAutoSelect()) { (*fit)->setOpenArrangeRecursively(TRUE); } @@ -1346,7 +1368,7 @@ void LLFolderViewFolder::dirtyFilter() BOOL LLFolderViewFolder::hasFilteredDescendants() { - return mMostFilteredDescendantGeneration >= mRoot->getFilter()->getCurrentGeneration(); + return mMostFilteredDescendantGeneration >= getRoot()->getFilter()->getCurrentGeneration(); } // Passes selection information on to children and record selection @@ -1702,14 +1724,6 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item ) removeChild(item); } -// This function is called by a child that needs to be resorted. -// This is only called for renaming an object because it won't work for date -void LLFolderViewFolder::resort(LLFolderViewItem* item) -{ - mItems.sort(mSortFunction); - mFolders.sort(mSortFunction); -} - bool LLFolderViewFolder::isTrash() const { if (mAmTrash == LLFolderViewFolder::UNKNOWN) @@ -1863,30 +1877,20 @@ BOOL LLFolderViewFolder::isRemovable() // this is an internal method used for adding items to folders. BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item) { - - items_t::iterator it = std::lower_bound( - mItems.begin(), - mItems.end(), - item, - mSortFunction); - mItems.insert(it,item); + mItems.push_back(item); item->setRect(LLRect(0, 0, getRect().getWidth(), 0)); item->setVisible(FALSE); addChild( item ); item->dirtyFilter(); requestArrange(); + requestSort(); return TRUE; } // this is an internal method used for adding items to folders. BOOL LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) { - folders_t::iterator it = std::lower_bound( - mFolders.begin(), - mFolders.end(), - folder, - mSortFunction); - mFolders.insert(it,folder); + mFolders.push_back(folder); folder->setOrigin(0, 0); folder->reshape(getRect().getWidth(), 0); folder->setVisible(FALSE); @@ -1894,6 +1898,7 @@ BOOL LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) folder->dirtyFilter(); // rearrange all descendants too, as our indentation level might have changed folder->requestArrange(TRUE); + requestSort(); return TRUE; } @@ -2209,7 +2214,7 @@ BOOL LLFolderViewFolder::potentiallyVisible() // folder should be visible by it's own filter status return LLFolderViewItem::potentiallyVisible() // or one or more of its descendants have passed the minimum filter requirement - || hasFilteredDescendants(mRoot->getFilter()->getMinRequiredGeneration()) + || hasFilteredDescendants(getRoot()->getFilter()->getMinRequiredGeneration()) // or not all of its descendants have been checked against minimum filter requirement || getCompletedFilterGeneration() < getRoot()->getFilter()->getMinRequiredGeneration(); } @@ -2494,21 +2499,13 @@ void LLCloseAllFoldersFunctor::doItem(LLFolderViewItem* item) ///---------------------------------------------------------------------------- // Default constructor -LLFolderView::LLFolderView( const std::string& name, LLUIImagePtr root_folder_icon, - const LLRect& rect, const LLUUID& source_id, LLView *parent_view ) : -#if LL_WINDOWS -#pragma warning( push ) -#pragma warning( disable : 4355 ) // warning C4355: 'this' : used in base member initializer list -#endif - LLFolderViewFolder( name, root_folder_icon, this, NULL ), -#if LL_WINDOWS -#pragma warning( pop ) -#endif +LLFolderView::LLFolderView(const Params& p) +: LLFolderViewFolder(p), mScrollContainer( NULL ), mPopupMenuHandle(), mAllowMultiSelect(TRUE), mShowFolderHierarchy(FALSE), - mSourceID(source_id), + mSourceID(p.task_id), mRenameItem( NULL ), mNeedsScroll( FALSE ), mLastScrollItem( NULL ), @@ -2517,16 +2514,18 @@ LLFolderView::LLFolderView( const std::string& name, LLUIImagePtr root_folder_ic mNeedsAutoRename(FALSE), mDebugFilters(FALSE), mSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME), // This gets overridden by a pref immediately - mFilter(name), + mFilter(p.name), mShowSelectionContext(FALSE), mShowSingleSelection(FALSE), mArrangeGeneration(0), - mUserData(NULL), - mSelectCallback(NULL), mSignalSelectCallback(0), mMinWidth(0), - mDragAndDropThisFrame(FALSE) + mDragAndDropThisFrame(FALSE), + mCallbackRegistrar(NULL), + mParentPanel(p.parent_panel) + { + LLRect rect = p.rect; LLRect new_rect(rect.mLeft, rect.mBottom + getRect().getHeight(), rect.mLeft + getRect().getWidth(), rect.mBottom); setRect( rect ); reshape(rect.getWidth(), rect.getHeight()); @@ -2543,30 +2542,29 @@ LLFolderView::LLFolderView( const std::string& name, LLUIImagePtr root_folder_ic // just make sure the label ("Inventory Folder") never shows up mLabel = LLStringUtil::null; - mRenamer = new LLLineEditor(std::string("ren"), getRect(), LLStringUtil::null, sFont, - DB_INV_ITEM_NAME_STR_LEN, - &LLFolderView::commitRename, - NULL, - NULL, - this, - &LLLineEditor::prevalidatePrintableNotPipe); //mRenamer->setWriteableBgColor(LLColor4::white); // Escape is handled by reverting the rename, not commiting it (default behavior) - mRenamer->setCommitOnFocusLost(TRUE); - mRenamer->setVisible(FALSE); + LLLineEditor::Params params; + params.name("ren"); + params.rect(getRect()); + params.font(sFont); + params.max_length_bytes(DB_INV_ITEM_NAME_STR_LEN); + params.commit_callback.function(boost::bind(&LLFolderView::commitRename, this, _2)); + params.prevalidate_callback(&LLLineEditor::prevalidatePrintableNotPipe); + params.commit_on_focus_lost(true); + params.visible(false); + mRenamer = LLUICtrlFactory::create<LLLineEditor> (params); addChild(mRenamer); // make the popup menu available - LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_inventory.xml", parent_view); + LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_inventory.xml", gMenuHolder); if (!menu) { - menu = new LLMenuGL(LLStringUtil::null); + menu = LLUICtrlFactory::createDummyWidget<LLMenuGL>("inventory_menu"); } - menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor")); - menu->setVisible(FALSE); + menu->setBackgroundColor(gSavedSkinSettings.getColor("MenuPopupBgColor")); mPopupMenuHandle = menu->getHandle(); - setTabStop(TRUE); } // Destroys the object @@ -2580,7 +2578,6 @@ LLFolderView::~LLFolderView( void ) mScrollContainer = NULL; mRenameItem = NULL; mRenamer = NULL; - gFocusMgr.releaseFocusIfNeeded( this ); if( gEditMenuHandler == this ) { @@ -2670,11 +2667,12 @@ void LLFolderView::closeAllFolders() { // Close all the folders setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_DOWN); + arrangeAll(); } void LLFolderView::openFolder(const std::string& foldername) { - LLFolderViewFolder* inv = getChild<LLFolderViewFolder>(foldername); + LLFolderViewFolder* inv = findChild<LLFolderViewFolder>(foldername); if (inv) { setSelection(inv, FALSE, FALSE); @@ -2700,7 +2698,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen mHasVisibleChildren = hasFilteredDescendants(filter_generation); // arrange always finishes, so optimistically set the arrange generation to the most current - mLastArrangeGeneration = mRoot->getArrangeGeneration(); + mLastArrangeGeneration = getRoot()->getArrangeGeneration(); LLInventoryFilter::EFolderShow show_folder_state = getRoot()->getShowFolderState(); @@ -2807,6 +2805,8 @@ void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent) } width = llmax(mMinWidth, min_width); LLView::reshape(width, height, called_from_parent); + + mReshapeSignal(mSelectedItems, FALSE); } void LLFolderView::addToSelectionList(LLFolderViewItem* item) @@ -2871,7 +2871,7 @@ BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL openitem, if( selection && take_keyboard_focus) { - setFocus(TRUE); + mParentPanel->setFocus(TRUE); } // clear selection down here because change of keyboard focus can potentially @@ -2896,6 +2896,30 @@ BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL openitem, return rv; } +void LLFolderView::setSelectionByID(const LLUUID& obj_id, BOOL take_keyboard_focus) +{ + LLFolderViewItem* itemp = getItemByID(obj_id); + if(itemp && itemp->getListener()) + { + itemp->getListener()->arrangeAndSet(itemp, TRUE, take_keyboard_focus); + mSelectThisID.setNull(); + return; + } + else + { + // save the desired item to be selected later (if/when ready) + mSelectThisID = obj_id; + } +} + +void LLFolderView::updateSelection() +{ + if (mSelectThisID.notNull()) + { + setSelectionByID(mSelectThisID, false); + } +} + BOOL LLFolderView::changeSelection(LLFolderViewItem* selection, BOOL selected) { BOOL rv = FALSE; @@ -3077,6 +3101,7 @@ void LLFolderView::clearSelection() recursiveDeselect(FALSE); mSelectedItems.clear(); } + mSelectThisID.setNull(); } BOOL LLFolderView::getSelectionList(std::set<LLUUID> &selection) @@ -3113,24 +3138,21 @@ BOOL LLFolderView::startDrag(LLToolDragAndDrop::ESource source) return can_drag; } -void LLFolderView::commitRename( LLUICtrl* renamer, void* user_data ) +void LLFolderView::commitRename( const LLSD& data ) { - LLFolderView* root = reinterpret_cast<LLFolderView*>(user_data); - if( root ) - { - root->finishRenamingItem(); - } + finishRenamingItem(); } void LLFolderView::draw() { + static LLCachedControl<LLColor4> sSearchStatusColor(gSavedSkinSettings, "InventorySearchStatusColor", DEFAULT_WHITE); if (mDebugFilters) { std::string current_filter_string = llformat("Current Filter: %d, Least Filter: %d, Auto-accept Filter: %d", mFilter.getCurrentGeneration(), mFilter.getMinRequiredGeneration(), mFilter.getMustPassGeneration()); sSmallFont->renderUTF8(current_filter_string, 0, 2, getRect().getHeight() - sSmallFont->getLineHeight(), LLColor4(0.5f, 0.5f, 0.8f, 1.f), - LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } // if cursor has moved off of me during drag and drop @@ -3139,10 +3161,6 @@ void LLFolderView::draw() { closeAutoOpenedFolders(); } - if(this == gFocusMgr.getKeyboardFocus() && !getVisible()) - { - gFocusMgr.setKeyboardFocus( NULL ); - } // while dragging, update selection rendering to reflect single/multi drag status if (LLToolDragAndDrop::getInstance()->hasMouseCapture()) @@ -3176,13 +3194,13 @@ void LLFolderView::draw() { if (gInventory.backgroundFetchActive() || mCompletedFilterGeneration < mFilter.getMinRequiredGeneration()) { - mStatusText = std::string("Searching..."); // *TODO:translate - sFont->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, S32_MAX, S32_MAX, NULL, FALSE ); + mStatusText = LLTrans::getString("Searching"); + sFont->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } else { - mStatusText = std::string("No matching items found in inventory."); // *TODO:translate - sFont->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, S32_MAX, S32_MAX, NULL, FALSE ); + mStatusText = LLTrans::getString("InventoryNoMatchingItems"); + sFont->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } } @@ -3280,11 +3298,11 @@ void LLFolderView::removeSelectedItems( void ) // change selection on successful delete if (new_selection) { - setSelectionFromRoot(new_selection, new_selection->isOpen(), gFocusMgr.childHasKeyboardFocus(this)); + setSelectionFromRoot(new_selection, new_selection->isOpen(), mParentPanel->hasFocus()); } else { - setSelectionFromRoot(NULL, gFocusMgr.childHasKeyboardFocus(this)); + setSelectionFromRoot(NULL, mParentPanel->hasFocus()); } } } @@ -3310,11 +3328,11 @@ void LLFolderView::removeSelectedItems( void ) } if (new_selection) { - setSelectionFromRoot(new_selection, new_selection->isOpen(), gFocusMgr.childHasKeyboardFocus(this)); + setSelectionFromRoot(new_selection, new_selection->isOpen(), mParentPanel->hasFocus()); } else { - setSelectionFromRoot(NULL, gFocusMgr.childHasKeyboardFocus(this)); + setSelectionFromRoot(NULL, mParentPanel->hasFocus()); } for(S32 i = 0; i < count; ++i) @@ -3347,11 +3365,8 @@ void LLFolderView::openSelectedItems( void ) } else { - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLMultiPreview* multi_previewp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100)); - gFloaterView->getNewFloaterPosition(&left, &top); - LLMultiProperties* multi_propertiesp = new LLMultiProperties(LLRect(left, top, left + 300, top - 100)); + LLMultiPreview* multi_previewp = new LLMultiPreview(); + LLMultiProperties* multi_propertiesp = new LLMultiProperties(); selected_items_t::iterator item_it; for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) @@ -3371,8 +3386,8 @@ void LLFolderView::openSelectedItems( void ) LLFloater::setFloaterHost(NULL); // *NOTE: LLMulti* will safely auto-delete when open'd // without any children. - multi_previewp->open(); - multi_propertiesp->open(); + multi_previewp->openFloater(LLSD()); + multi_propertiesp->openFloater(LLSD()); } } } @@ -3389,10 +3404,7 @@ void LLFolderView::propertiesSelectedItems( void ) } else { - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - - LLMultiProperties* multi_propertiesp = new LLMultiProperties(LLRect(left, top, left + 100, top - 100)); + LLMultiProperties* multi_propertiesp = new LLMultiProperties(); LLFloater::setFloaterHost(multi_propertiesp); @@ -3403,7 +3415,7 @@ void LLFolderView::propertiesSelectedItems( void ) } LLFloater::setFloaterHost(NULL); - multi_propertiesp->open(); /* Flawfinder: ignore */ + multi_propertiesp->openFloater(LLSD()); } } } @@ -3631,24 +3643,11 @@ void LLFolderView::startRenamingSelectedItem( void ) mRenamer->setVisible( TRUE ); // set focus will fail unless item is visible mRenamer->setFocus( TRUE ); - mRenamer->setLostTopCallback(onRenamerLost); + mRenamer->setTopLostCallback(onRenamerLost); gFocusMgr.setTopCtrl( mRenamer ); } } -void LLFolderView::setFocus(BOOL focus) -{ - if (focus) - { - if(!hasFocus()) - { - gEditMenuHandler = this; - } - } - - LLFolderViewFolder::setFocus(focus); -} - BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) { BOOL handled = FALSE; @@ -3851,7 +3850,7 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) break; } - if (!handled && hasFocus()) + if (!handled && mParentPanel->hasFocus()) { if (key == KEY_BACKSPACE) { @@ -3940,20 +3939,11 @@ BOOL LLFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) mKeyboardSelection = FALSE; mSearchString.clear(); - setFocus(TRUE); + mParentPanel->setFocus(TRUE); return LLView::handleMouseDown( x, y, mask ); } -void LLFolderView::onFocusLost( ) -{ - if( gEditMenuHandler == this ) - { - gEditMenuHandler = NULL; - } - LLUICtrl::onFocusLost(); -} - BOOL LLFolderView::search(LLFolderViewItem* first_item, const std::string &search_string, BOOL backward) { // get first selected item @@ -4030,13 +4020,15 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) { // all user operations move keyboard focus to inventory // this way, we know when to stop auto-updating a search - setFocus(TRUE); + mParentPanel->setFocus(TRUE); BOOL handled = childrenHandleRightMouseDown(x, y, mask) != NULL; S32 count = mSelectedItems.size(); LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get(); if(handled && (count > 0) && menu) { + if (mCallbackRegistrar) + mCallbackRegistrar->pushScope(); //menu->empty(); const LLView::child_list_t *list = menu->getChildList(); @@ -4056,9 +4048,10 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) flags = 0x0; } - menu->arrange(); menu->updateParent(LLMenuGL::sMenuContainer); LLMenuGL::showPopup(this, menu, x, y); + if (mCallbackRegistrar) + mCallbackRegistrar->popScope(); } else { @@ -4232,6 +4225,72 @@ LLFolderViewItem* LLFolderView::getItemByID(const LLUUID& id) return NULL; } +bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata) +{ + std::string action = userdata.asString(); + + if ("rename" == action) + { + startRenamingSelectedItem(); + return true; + } + if ("delete" == action) + { + removeSelectedItems(); + return true; + } + + if ("copy" == action) + { + LLInventoryClipboard::instance().reset(); + } + + std::set<LLUUID> selected_items; + getSelectionList(selected_items); + + LLMultiPreview* multi_previewp = NULL; + LLMultiProperties* multi_propertiesp = NULL; + + if (("task_open" == action || "open" == action) && selected_items.size() > 1) + { + multi_previewp = new LLMultiPreview(); + gFloaterView->addChild(multi_previewp); + + LLFloater::setFloaterHost(multi_previewp); + + } + else if (("task_properties" == action || "properties" == action) && selected_items.size() > 1) + { + multi_propertiesp = new LLMultiProperties(); + gFloaterView->addChild(multi_propertiesp); + + LLFloater::setFloaterHost(multi_propertiesp); + } + + std::set<LLUUID>::iterator set_iter; + + for (set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter) + { + LLFolderViewItem* folder_item = getItemByID(*set_iter); + if(!folder_item) continue; + LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getListener(); + if(!bridge) continue; + + bridge->performAction(this, model, action); + } + + LLFloater::setFloaterHost(NULL); + if (multi_previewp) + { + multi_previewp->openFloater(LLSD()); + } + else if (multi_propertiesp) + { + multi_propertiesp->openFloater(LLSD()); + } + + return true; +} // Main idle routine void LLFolderView::doIdle() @@ -4295,11 +4354,11 @@ void LLFolderView::doIdle() } } - if (mSignalSelectCallback && mSelectCallback) + if (mSignalSelectCallback) { //RN: we use keyboard focus as a proxy for user-explicit actions BOOL take_keyboard_focus = (mSignalSelectCallback == SIGNAL_KEYBOARD_FOCUS); - mSelectCallback(mSelectedItems, take_keyboard_focus, mUserData); + mSelectSignal(mSelectedItems, take_keyboard_focus); } mSignalSelectCallback = FALSE; } @@ -4315,7 +4374,6 @@ void LLFolderView::idle(void* user_data) } } - void LLFolderView::dumpSelectionInformation() { llinfos << "LLFolderView::dumpSelectionInformation()" << llendl; @@ -4400,9 +4458,13 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde } //static -void LLFolderView::onRenamerLost( LLUICtrl* renamer, void* user_data) +void LLFolderView::onRenamerLost( LLFocusableElement* renamer, void* user_data) { - renamer->setVisible(FALSE); + LLUICtrl* uictrl = dynamic_cast<LLUICtrl*>(renamer); + if (uictrl) + { + uictrl->setVisible(FALSE); + } } void delete_selected_item(void* user_data) @@ -4823,133 +4885,156 @@ std::string LLInventoryFilter::getFilterText() if (isFilterWith(LLInventoryType::IT_ANIMATION)) { - filtered_types += " Animations,"; + //filtered_types += " Animations,"; + filtered_types += LLTrans::getString("Animations"); filtered_by_type = TRUE; num_filter_types++; } else { - not_filtered_types += " Animations,"; + //not_filtered_types += " Animations,"; + not_filtered_types += LLTrans::getString("Animations"); + filtered_by_all_types = FALSE; } if (isFilterWith(LLInventoryType::IT_CALLINGCARD)) { - filtered_types += " Calling Cards,"; + //filtered_types += " Calling Cards,"; + filtered_types += LLTrans::getString("Calling Cards"); filtered_by_type = TRUE; num_filter_types++; } else { - not_filtered_types += " Calling Cards,"; + //not_filtered_types += " Calling Cards,"; + not_filtered_types += LLTrans::getString("Calling Cards"); filtered_by_all_types = FALSE; } if (isFilterWith(LLInventoryType::IT_WEARABLE)) { - filtered_types += " Clothing,"; + //filtered_types += " Clothing,"; + filtered_types += LLTrans::getString("Clothing"); filtered_by_type = TRUE; num_filter_types++; } else { - not_filtered_types += " Clothing,"; + //not_filtered_types += " Clothing,"; + not_filtered_types += LLTrans::getString("Clothing"); filtered_by_all_types = FALSE; } if (isFilterWith(LLInventoryType::IT_GESTURE)) { - filtered_types += " Gestures,"; + //filtered_types += " Gestures,"; + filtered_types += LLTrans::getString("Gestures"); filtered_by_type = TRUE; num_filter_types++; } else { - not_filtered_types += " Gestures,"; + //not_filtered_types += " Gestures,"; + not_filtered_types += LLTrans::getString("Gestures"); filtered_by_all_types = FALSE; } if (isFilterWith(LLInventoryType::IT_LANDMARK)) { - filtered_types += " Landmarks,"; + //filtered_types += " Landmarks,"; + filtered_types += LLTrans::getString("Landmarks"); filtered_by_type = TRUE; num_filter_types++; } else { - not_filtered_types += " Landmarks,"; + //not_filtered_types += " Landmarks,"; + not_filtered_types += LLTrans::getString("Landmarks"); filtered_by_all_types = FALSE; } if (isFilterWith(LLInventoryType::IT_NOTECARD)) { - filtered_types += " Notecards,"; + //filtered_types += " Notecards,"; + filtered_types += LLTrans::getString("Notecards"); filtered_by_type = TRUE; num_filter_types++; } else { - not_filtered_types += " Notecards,"; + //not_filtered_types += " Notecards,"; + not_filtered_types += LLTrans::getString("Notecards"); filtered_by_all_types = FALSE; } if (isFilterWith(LLInventoryType::IT_OBJECT) && isFilterWith(LLInventoryType::IT_ATTACHMENT)) { - filtered_types += " Objects,"; + //filtered_types += " Objects,"; + filtered_types += LLTrans::getString("Objects"); filtered_by_type = TRUE; num_filter_types++; } else { - not_filtered_types += " Objects,"; + //not_filtered_types += " Objects,"; + not_filtered_types += LLTrans::getString("Objects"); filtered_by_all_types = FALSE; } if (isFilterWith(LLInventoryType::IT_LSL)) { - filtered_types += " Scripts,"; + //filtered_types += " Scripts,"; + filtered_types += LLTrans::getString("Scripts"); filtered_by_type = TRUE; num_filter_types++; } else { - not_filtered_types += " Scripts,"; + //not_filtered_types += " Scripts,"; + not_filtered_types += LLTrans::getString("Scripts"); filtered_by_all_types = FALSE; } if (isFilterWith(LLInventoryType::IT_SOUND)) { - filtered_types += " Sounds,"; + //filtered_types += " Sounds,"; + filtered_types += LLTrans::getString("Sounds"); filtered_by_type = TRUE; num_filter_types++; } else { - not_filtered_types += " Sounds,"; + //not_filtered_types += " Sounds,"; + not_filtered_types += LLTrans::getString("Sounds"); filtered_by_all_types = FALSE; } if (isFilterWith(LLInventoryType::IT_TEXTURE)) { - filtered_types += " Textures,"; + //filtered_types += " Textures,"; + filtered_types += LLTrans::getString("Textures"); filtered_by_type = TRUE; num_filter_types++; } else { - not_filtered_types += " Textures,"; + //not_filtered_types += " Textures,"; + not_filtered_types += LLTrans::getString("Textures"); filtered_by_all_types = FALSE; } if (isFilterWith(LLInventoryType::IT_SNAPSHOT)) { - filtered_types += " Snapshots,"; + //filtered_types += " Snapshots,"; + filtered_types += LLTrans::getString("Snapshots"); filtered_by_type = TRUE; num_filter_types++; } else { - not_filtered_types += " Snapshots,"; + //not_filtered_types += " Snapshots,"; + not_filtered_types += LLTrans::getString("Snapshots"); filtered_by_all_types = FALSE; } @@ -4962,7 +5047,8 @@ std::string LLInventoryFilter::getFilterText() } else { - mFilterText += "No "; + //mFilterText += "No "; + mFilterText += LLTrans::getString("No Filters"); mFilterText += not_filtered_types; } // remove the ',' at the end @@ -4971,7 +5057,8 @@ std::string LLInventoryFilter::getFilterText() if (isSinceLogoff()) { - mFilterText += " - Since Logoff"; + //mFilterText += " - Since Logoff"; + mFilterText += LLTrans::getString("Since Logoff"); } return mFilterText; } diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 3fe3095c58e8fe057c57236f334641af2a1f58c4..2393aa627c5ea9f1f8384b9dd6d0a0feaa9dc7ca 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -44,6 +44,9 @@ #include <vector> #include <map> #include <deque> +#include <boost/function.hpp> +#include <boost/signal.hpp> +#include <boost/signals/connection.hpp> #include "lluictrl.h" #include "v4color.h" @@ -70,7 +73,7 @@ class LLMenuGL; class LLFolderViewItem; class LLFolderView; class LLInventoryModel; -class LLScrollableContainerView; +class LLScrollContainer; class LLFolderViewEventListener { @@ -81,6 +84,7 @@ public: virtual const LLUUID& getUUID() const = 0; virtual time_t getCreationDate() const = 0; // UTC seconds virtual PermissionMask getPermissionMask() const = 0; + virtual LLAssetType::EType getPreferredType() const {return LLAssetType::AT_NONE;}; virtual LLUIImagePtr getIcon() const = 0; virtual LLFontGL::StyleFlags getLabelStyle() const = 0; virtual std::string getLabelSuffix() const = 0; @@ -314,28 +318,46 @@ class LLFontGL; class LLFolderViewFolder; class LLFolderView; -class LLFolderViewItem : public LLUICtrl +class LLFolderViewItem : public LLView { +public: + static void initClass(); + static void cleanupClass(); + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<LLUIImage*> icon; + Optional<LLFolderView*> root; + Optional<LLFolderViewEventListener*> listener; + + Optional<LLUIImage*> folder_arrow_image; + Optional<LLUIImage*> selection_image; + + Optional<S32> creation_date; //UTC seconds + Params() + : folder_arrow_image("", LLUI::getUIImage("folder_arrow.tga")), + selection_image("", LLUI::getUIImage("rounded_square.tga")) + { + mouse_opaque(true); + follows.flags(FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_RIGHT); + tab_stop(false); + } + }; + protected: + friend class LLUICtrlFactory; friend class LLFolderViewEventListener; + LLFolderViewItem(Params = LLFolderViewItem::Params()); + static const LLFontGL* sFont; static const LLFontGL* sSmallFont; - static LLColor4 sFgColor; - static LLColor4 sHighlightBgColor; - static LLColor4 sHighlightFgColor; - static LLColor4 sFilterBGColor; - static LLColor4 sFilterTextColor; - static LLColor4 sSuffixColor; - static LLColor4 sSearchStatusColor; static LLUIImagePtr sArrowImage; static LLUIImagePtr sBoxImage; - std::string mLabel; std::string mSearchableLabel; - std::string mType; S32 mLabelWidth; - time_t mCreationDate; + bool mLabelWidthDirty; + time_t mCreationDate; LLFolderViewFolder* mParentFolder; LLFolderViewEventListener* mListener; BOOL mIsSelected; @@ -354,6 +376,8 @@ protected: F32 mControlLabelRotation; LLFolderView* mRoot; BOOL mDragAndDropTarget; + LLUIImagePtr mArrowImage; + LLUIImagePtr mBoxImage; BOOL mIsLoading; LLTimer mTimeSinceRequestStart; @@ -376,17 +400,12 @@ protected: virtual BOOL addFolder(LLFolderViewFolder*) { return FALSE; } public: - static void initClass(); - static void cleanupClass(); - // This function is called when the folder view is dirty. It's // implemented here but called by derived classes when folding the // views. void arrangeFromRoot(); void filterFromRoot( void ); - // creation_date is in UTC seconds - LLFolderViewItem( const std::string& name, LLUIImagePtr icon, time_t creation_date, LLFolderView* root, LLFolderViewEventListener* listener ); virtual ~LLFolderViewItem( void ); // addToFolder() returns TRUE if it succeeds. FALSE otherwise @@ -490,7 +509,7 @@ public: virtual BOOL isOpen() { return FALSE; } - LLFolderView* getRoot(); + virtual LLFolderView* getRoot(); BOOL isDescendantOf( const LLFolderViewFolder* potential_ancestor ); S32 getIndentation() { return mIndentation; } @@ -541,12 +560,16 @@ typedef bool (*sort_order_f)(LLFolderViewItem* a, LLFolderViewItem* b); class LLFolderViewFolder : public LLFolderViewItem { +protected: + LLFolderViewFolder( const LLFolderViewItem::Params& ); + friend class LLUICtrlFactory; + public: typedef enum e_trash { UNKNOWN, TRASH, NOT_TRASH } ETrash; - + protected: typedef std::list<LLFolderViewItem*> items_t; typedef std::list<LLFolderViewFolder*> folders_t; @@ -565,6 +588,7 @@ protected: S32 mLastCalculatedWidth; S32 mCompletedFilterGeneration; S32 mMostFilteredDescendantGeneration; + bool mNeedsSort; public: typedef enum e_recurse_type { @@ -574,9 +598,7 @@ public: RECURSE_UP_DOWN } ERecurseType; - LLFolderViewFolder( const std::string& name, LLUIImagePtr icon, - LLFolderView* root, - LLFolderViewEventListener* listener ); + virtual ~LLFolderViewFolder( void ); virtual BOOL potentiallyVisible(); @@ -592,6 +614,7 @@ public: virtual S32 arrange( S32* width, S32* height, S32 filter_generation ); BOOL needsArrange(); + void requestSort(); // Returns the sort group (system, trash, folder) for this folder. virtual EInventorySortGroup getSortGroup() const; @@ -691,7 +714,7 @@ public: virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor); virtual void openItem( void ); - virtual BOOL addItem(LLFolderViewItem* item); + virtual BOOL addItem(LLFolderViewItem* item); virtual BOOL addFolder( LLFolderViewFolder* folder); // LLView functionality @@ -721,27 +744,34 @@ public: class LLUICtrl; class LLLineEditor; -class LLFolderView : public LLFolderViewFolder, LLEditMenuHandler +class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler { public: - typedef void (*SelectCallback)(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data); - - static F32 sAutoOpenTime; - + struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params> + { + Mandatory<LLPanel*> parent_panel; + Optional<LLUUID> task_id; + }; LLFolderView( const std::string& name, LLUIImagePtr root_folder_icon, const LLRect& rect, - const LLUUID& source_id, LLView *parent_view ); + const LLUUID& source_id, LLPanel *parent_view ); + LLFolderView(const Params&); virtual ~LLFolderView( void ); virtual BOOL canFocusChildren() const; + virtual LLFolderView* getRoot() { return this; } + // FolderViews default to sort by name. This will change that, // and resort the items if necessary. void setSortOrder(U32 order); void checkTreeResortForModelChanged(); void setFilterPermMask(PermissionMask filter_perm_mask) { mFilter.setFilterPermissions(filter_perm_mask); } - void setSelectCallback(SelectCallback callback, void* user_data) { mSelectCallback = callback, mUserData = user_data; } void setAllowMultiSelect(BOOL allow) { mAllowMultiSelect = allow; } - + + typedef boost::signal<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)> signal_t; + void setSelectCallback(const signal_t::slot_type& cb) { mSelectSignal.connect(cb); } + void setReshapeCallback(const signal_t::slot_type& cb) { mReshapeSignal.connect(cb); } + LLInventoryFilter* getFilter() { return &mFilter; } const std::string getFilterSubString(BOOL trim = FALSE); U32 getFilterTypes() const { return mFilter.getFilterTypes(); } @@ -775,7 +805,13 @@ public: // Record the selected item and pass it down the hierachy. virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus); - + + // Used by menu callbacks + void setSelectionByID(const LLUUID& obj_id, BOOL take_keyboard_focus); + + // Called once a frame to update the selection if mSelectThisID has been set + void updateSelection(); + // This method is used to toggle the selection of an item. Walks // children, and keeps track of selected objects. virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected); @@ -828,9 +864,6 @@ public: //void dragItemIntoFolder( LLFolderViewItem* moving_item, LLFolderViewFolder* dst_folder, BOOL drop, BOOL* accept ); //void dragFolderIntoFolder( LLFolderViewFolder* moving_folder, LLFolderViewFolder* dst_folder, BOOL drop, BOOL* accept ); - // LLUICtrl Functionality - /*virtual*/ void setFocus(BOOL focus); - // LLView functionality ///*virtual*/ BOOL handleKey( KEY key, MASK mask, BOOL called_from_parent ); /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ); @@ -845,14 +878,13 @@ public: EAcceptance* accept, std::string& tooltip_msg); /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ void onFocusLost(); virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual void draw(); virtual void deleteAllChildren(); void scrollToShowSelection(); void scrollToShowItem(LLFolderViewItem* item); - void setScrollContainer( LLScrollableContainerView* parent ) { mScrollContainer = parent; } + void setScrollContainer( LLScrollContainer* parent ) { mScrollContainer = parent; } LLRect getVisibleRect(); BOOL search(LLFolderViewItem* first_item, const std::string &search_string, BOOL backward); @@ -865,7 +897,9 @@ public: void addItemID(const LLUUID& id, LLFolderViewItem* itemp); void removeItemID(const LLUUID& id); LLFolderViewItem* getItemByID(const LLUUID& id); - + + bool doToSelected(LLInventoryModel* model, const LLSD& userdata); + void doIdle(); // Real idle routine static void idle(void* user_data); // static glue to doIdle() @@ -873,20 +907,23 @@ public: BOOL needsAutoRename() { return mNeedsAutoRename; } void setNeedsAutoRename(BOOL val) { mNeedsAutoRename = val; } + void setCallbackRegistrar(LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* registrar) { mCallbackRegistrar = registrar; } + BOOL getDebugFilters() { return mDebugFilters; } + LLPanel* getParentPanel() { return mParentPanel; } // DEBUG only void dumpSelectionInformation(); protected: - LLScrollableContainerView* mScrollContainer; // NULL if this is not a child of a scroll container. + LLScrollContainer* mScrollContainer; // NULL if this is not a child of a scroll container. - static void commitRename( LLUICtrl* renamer, void* user_data ); - static void onRenamerLost( LLUICtrl* renamer, void* user_data); + void commitRename( const LLSD& data ); + static void onRenamerLost( LLFocusableElement* renamer, void* user_data); void finishRenamingItem( void ); void closeRenamer( void ); - + protected: LLHandle<LLView> mPopupMenuHandle; @@ -921,13 +958,21 @@ protected: LLFrameTimer mMultiSelectionFadeTimer; S32 mArrangeGeneration; - void* mUserData; - SelectCallback mSelectCallback; + signal_t mSelectSignal; + signal_t mReshapeSignal; S32 mSignalSelectCallback; S32 mMinWidth; std::map<LLUUID, LLFolderViewItem*> mItemMap; BOOL mDragAndDropThisFrame; + + LLUUID mSelectThisID; // if non null, select this item + + LLPanel* mParentPanel; + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* mCallbackRegistrar; + +public: + static F32 sAutoOpenTime; }; bool sort_item_name(LLFolderViewItem* a, LLFolderViewItem* b); diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 2dbff92ba04546274909e25498a3b59d8199e660..0f2951d9df370c68d72bf681e35cb7478752809d 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -55,8 +55,9 @@ #include "llinventorymodel.h" #include "llnotify.h" #include "llviewermessage.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llviewerstats.h" +#include "llbottomtray.h" LLGestureManager gGestureManager; @@ -868,9 +869,11 @@ void LLGestureManager::runStep(LLMultiGesture* gesture, LLGestureStep* step) std::string chat_text = chat_step->mChatText; // Don't animate the nodding, as this might not blend with // other playing animations. + const BOOL animate = FALSE; - gChatBar->sendChatFromViewer(chat_text, CHAT_TYPE_NORMAL, animate); + LLBottomTray::getInstance()->sendChatFromViewer(chat_text, CHAT_TYPE_NORMAL, animate); + gesture->mCurrentStep++; break; } diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 91beb801ad472b7106888d69c184b3d2711074cf..3b3ada46a8ff489eb5e325e69f52e9f6cae9f8b2 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -49,7 +49,7 @@ #include "lltextureentry.h" #include "llviewercamera.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llagent.h" #include "lltoolmgr.h" #include "llselectmgr.h" @@ -58,7 +58,6 @@ #include "llviewerobjectlist.h" #include "lltoolselectrect.h" #include "llviewerwindow.h" -#include "llcompass.h" #include "llsurface.h" #include "llwind.h" #include "llworld.h" @@ -338,127 +337,8 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) gViewerWindow->setup3DRender(); } - -const F32 COMPASS_SIZE = 64; -static const F32 COMPASS_RANGE = 0.33f; - -void LLCompass::draw() -{ - glMatrixMode(GL_MODELVIEW); - gGL.pushMatrix(); - - S32 width = 32; - S32 height = 32; - - LLGLSUIDefault gls_ui; - - gGL.translatef( COMPASS_SIZE/2.f, COMPASS_SIZE/2.f, 0.f); - - if (mBkgndTexture) - { - gGL.getTexUnit(0)->bind(mBkgndTexture.get()); - - gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f); - - gGL.begin(LLRender::QUADS); - - gGL.texCoord2f(1.f, 1.f); - gGL.vertex2i(width, height); - - gGL.texCoord2f(0.f, 1.f); - gGL.vertex2i(-width, height); - - gGL.texCoord2f(0.f, 0.f); - gGL.vertex2i(-width, -height); - - gGL.texCoord2f(1.f, 0.f); - gGL.vertex2i(width, -height); - - gGL.end(); - } - - // rotate subsequent draws to agent rotation - F32 rotation = atan2( gAgent.getFrameAgent().getAtAxis().mV[VX], gAgent.getFrameAgent().getAtAxis().mV[VY] ); - glRotatef( - rotation * RAD_TO_DEG, 0.f, 0.f, -1.f); - - if (mTexture) - { - gGL.getTexUnit(0)->bind(mTexture.get()); - gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f); - - gGL.begin(LLRender::QUADS); - - gGL.texCoord2f(1.f, 1.f); - gGL.vertex2i(width, height); - - gGL.texCoord2f(0.f, 1.f); - gGL.vertex2i(-width, height); - - gGL.texCoord2f(0.f, 0.f); - gGL.vertex2i(-width, -height); - - gGL.texCoord2f(1.f, 0.f); - gGL.vertex2i(width, -height); - - gGL.end(); - } - - gGL.popMatrix(); - -} - - - -void LLHorizontalCompass::draw() -{ - LLGLSUIDefault gls_ui; - - S32 width = getRect().getWidth(); - S32 height = getRect().getHeight(); - S32 half_width = width / 2; - - if( mTexture ) - { - const LLVector3& at_axis = LLViewerCamera::getInstance()->getAtAxis(); - F32 center = atan2( at_axis.mV[VX], at_axis.mV[VY] ); - - center += F_PI; - center = llclamp( center, 0.0f, F_TWO_PI ); // probably not necessary... - center /= F_TWO_PI; - F32 left = center - COMPASS_RANGE; - F32 right = center + COMPASS_RANGE; - - gGL.getTexUnit(0)->bind(mTexture.get()); - gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f ); - gGL.begin( LLRender::QUADS ); - - gGL.texCoord2f(right, 1.f); - gGL.vertex2i(width, height); - - gGL.texCoord2f(left, 1.f); - gGL.vertex2i(0, height); - - gGL.texCoord2f(left, 0.f); - gGL.vertex2i(0, 0); - - gGL.texCoord2f(right, 0.f); - gGL.vertex2i(width, 0); - - gGL.end(); - } - - // Draw the focus line - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4fv( mFocusColor.mV ); - gl_line_2d( half_width, 0, half_width, height ); - } -} - - const F32 WIND_ALTITUDE = 180.f; - void LLWind::renderVectors() { // Renders the wind as vectors (used for debug) @@ -1008,8 +888,6 @@ void LLViewerObjectList::renderObjectBeacons() return; } - //const LLFontGL *font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF); - LLGLSUIDefault gls_ui; { diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cda30d89003793876abfcab96b6cba75987ac412 --- /dev/null +++ b/indra/newview/llgroupactions.cpp @@ -0,0 +1,141 @@ +/** + * @file llgroupactions.cpp + * @brief Group-related actions (join, leave, new, delete, etc) + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#include "llviewerprecompiledheaders.h" + +#include "llgroupactions.h" + +#include "llagent.h" +#include "llfloatergroupinfo.h" +#include "llfloaterreg.h" +#include "llimview.h" // for gIMMgr + +// static +void LLGroupActions::search() +{ + LLFloaterReg::showInstance("search", LLSD().insert("panel", "group")); +} + +// static +void LLGroupActions::create() +{ + LLFloaterGroupInfo::showCreateGroup(NULL); +} + +// static +void LLGroupActions::leave(const LLUUID& group_id) +{ + if (group_id.isNull()) + return; + + S32 count = gAgent.mGroups.count(); + S32 i; + for (i = 0; i < count; ++i) + { + if(gAgent.mGroups.get(i).mID == group_id) + break; + } + if (i < count) + { + LLSD args; + args["GROUP"] = gAgent.mGroups.get(i).mName; + LLSD payload; + payload["group_id"] = group_id; + LLNotifications::instance().add("GroupLeaveConfirmMember", args, payload, onLeaveGroup); + } +} + +// static +void LLGroupActions::activate(const LLUUID& group_id) +{ + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_ActivateGroup); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_GroupID, group_id); + gAgent.sendReliableMessage(); +} + +// static +void LLGroupActions::info(const LLUUID& group_id) +{ + if (group_id.isNull()) + return; + + LLFloaterGroupInfo::showFromUUID(group_id); +} + +// static +void LLGroupActions::startChat(const LLUUID& group_id) +{ + if (group_id.isNull()) + return; + + LLGroupData group_data; + if (gAgent.getGroupData(group_id, group_data)) + { + gIMMgr->addSession( + group_data.mName, + IM_SESSION_GROUP_START, + group_id); + make_ui_sound("UISndStartIM"); + } + else + { + // this should never happen, as starting a group IM session + // relies on you belonging to the group and hence having the group data + make_ui_sound("UISndInvalidOp"); + } +} + +//-- Private methods ---------------------------------------------------------- + +// static +bool LLGroupActions::onLeaveGroup(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + LLUUID group_id = notification["payload"]["group_id"].asUUID(); + if(option == 0) + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_LeaveGroupRequest); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_GroupData); + msg->addUUIDFast(_PREHASH_GroupID, group_id); + gAgent.sendReliableMessage(); + } + return false; +} diff --git a/indra/newview/llgroupactions.h b/indra/newview/llgroupactions.h new file mode 100644 index 0000000000000000000000000000000000000000..1e6caea17c771a9bb6aaff3284a33b5b45348602 --- /dev/null +++ b/indra/newview/llgroupactions.h @@ -0,0 +1,79 @@ +/** + * @file llgroupactions.h + * @brief Group-related actions (join, leave, new, delete, etc) + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLGROUPACTIONS_H +#define LL_LLGROUPACTIONS_H + +#include "llsd.h" +#include "lluuid.h" + +/** + * Group-related actions (join, leave, new, delete, etc) + */ +class LLGroupActions +{ +public: + /** + * Invokes group search floater. + */ + static void search(); + + /** + * Invokes group creation floater. + */ + static void create(); + + /** + * Invokes "Leave Group" floater. + */ + static void leave(const LLUUID& group_id); + + /** + * Activate group. + */ + static void activate(const LLUUID& group_id); + + /** + * Show group information dialog. + */ + static void info(const LLUUID& group_id); + + /** + * Start group instant messaging session. + */ + static void startChat(const LLUUID& group_id); + +private: + static bool onLeaveGroup(const LLSD& notification, const LLSD& response); +}; + +#endif // LL_LLGROUPACTIONS_H diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5d0bcab07a5abec655c3a4228a9a03ac98c7ede0 --- /dev/null +++ b/indra/newview/llgrouplist.cpp @@ -0,0 +1,70 @@ +/** + * @file llgrouplist.cpp + * @brief List of the groups the agent belongs to. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llgrouplist.h" + +// newview +#include "llagent.h" + +static LLDefaultWidgetRegistry::Register<LLGroupList> r("group_list"); + +LLGroupList::LLGroupList(const Params& p) +: LLAvatarList(p) +{ +} + +BOOL LLGroupList::updateList() +{ + LLCtrlListInterface *group_list = getListInterface(); + const LLUUID& highlight_id = gAgent.getGroupID(); + S32 count = gAgent.mGroups.count(); + LLUUID id; + + group_list->operateOnAll(LLCtrlListInterface::OP_DELETE); + + for(S32 i = 0; i < count; ++i) + { + // *TODO: check powers mask? + id = gAgent.mGroups.get(i).mID; + const LLGroupData& group_data = gAgent.mGroups.get(i); + addItem(id, group_data.mName, highlight_id == id, ADD_BOTTOM); + } + + // add "none" to list at top + //name = LLTrans::getString("GroupsNone") + addItem(LLUUID::null, std::string("none"), highlight_id.isNull(), ADD_TOP); // *TODO: localize + + group_list->selectByValue(highlight_id); + return TRUE; +} diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h new file mode 100644 index 0000000000000000000000000000000000000000..ce26977fdb64c8cdf1ad8c66f1bfb27b7c65df31 --- /dev/null +++ b/indra/newview/llgrouplist.h @@ -0,0 +1,53 @@ +/** + * @file llgrouplist.h + * @brief List of the groups the agent belongs to. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLGROUPLIST_H +#define LL_LLGROUPLIST_H + +#include <llscrolllistctrl.h> + +#include "llavatarlist.h" + +// *TODO: derive from ListView when it's ready. +class LLGroupList: public LLAvatarList +{ + LOG_CLASS(LLGroupList); +public: + struct Params : public LLInitParam::Block<Params, LLAvatarList::Params> + { + }; + + LLGroupList(const Params&); + BOOL updateList(); +}; + +#endif // LL_LLGROUPLIST_H diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 003a02c3cd79df8e9af858233b422c4234711210..a8d97c6afbae099b6f2392a13624f26b32a434d1 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1293,7 +1293,7 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data) } else { - // *TODO:translate + // *TODO: Translate LLSD args; args["MESSAGE"] = message; LLNotifications::instance().add("UnableToCreateGroup", args); diff --git a/indra/newview/llhudeffect.h b/indra/newview/llhudeffect.h index 954cda7c8dcc3caa129848167f6496797fcefc07..781e57fa6a62a616b708bb6a2265856972156487 100644 --- a/indra/newview/llhudeffect.h +++ b/indra/newview/llhudeffect.h @@ -37,9 +37,6 @@ #include "lluuid.h" #include "v4coloru.h" -#include "llinterp.h" -#include "llframetimer.h" -#include "llmemory.h" const F32 LL_HUD_DUR_SHORT = 1.f; diff --git a/indra/newview/llhudicon.h b/indra/newview/llhudicon.h index 154e6df518025c8707d37a83efc5bb842ecb45cd..2c1c5495217508436cd9dee89c86715a82a2ed07 100644 --- a/indra/newview/llhudicon.h +++ b/indra/newview/llhudicon.h @@ -33,7 +33,7 @@ #ifndef LL_LLHUDICON_H #define LL_LLHUDICON_H -#include "llmemory.h" +#include "llpointer.h" #include "lldarrayptr.h" #include "llhudobject.h" diff --git a/indra/newview/llhudmanager.cpp b/indra/newview/llhudmanager.cpp index 955d7861879776b389d5e90102fe2066ba06b690..e1e9d9c51e1ee19d944916cb544ada999c54ecd7 100644 --- a/indra/newview/llhudmanager.cpp +++ b/indra/newview/llhudmanager.cpp @@ -52,9 +52,9 @@ LLColor4 LLHUDManager::sChildColor; LLHUDManager::LLHUDManager() { - LLHUDManager::sParentColor = gColors.getColor("FocusColor"); + LLHUDManager::sParentColor = gSavedSkinSettings.getColor("FocusColor"); // rdw commented out since it's not used. Also removed from colors_base.xml - //LLHUDManager::sChildColor = gColors.getColor("FocusSecondaryColor"); + //LLHUDManager::sChildColor =gSavedSkinSettings.getColor("FocusSecondaryColor"); } LLHUDManager::~LLHUDManager() diff --git a/indra/newview/llhudmanager.h b/indra/newview/llhudmanager.h index 615eb93a27cdbb5493fa6267013a6fd7c751ba81..b2b4ffb5595ff1c67a260e5717022357df7f11fa 100644 --- a/indra/newview/llhudmanager.h +++ b/indra/newview/llhudmanager.h @@ -36,7 +36,7 @@ // Responsible for managing all HUD elements. #include "llhudobject.h" -#include "lldarray.h" +#include "lldarrayptr.h" class LLViewerObject; class LLHUDEffect; diff --git a/indra/newview/llhudobject.h b/indra/newview/llhudobject.h index 2cd8abf886162390eec9fe4cb520d85cd66a701e..d304ac41af5ae8be07643f80bd9f43840a82c4f9 100644 --- a/indra/newview/llhudobject.h +++ b/indra/newview/llhudobject.h @@ -37,7 +37,7 @@ * Base class and manager for in-world 2.5D non-interactive objects */ -#include "llmemory.h" +#include "llpointer.h" #include "v4color.h" #include "v3math.h" diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index 95b8442ec720050c8afd02a2ad9c1c0c1a61d252..fe65a12c47abc53dda8dfc9589a355879c07e5bc 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -47,17 +47,19 @@ void hud_render_utf8text(const std::string &str, const LLVector3 &pos_agent, const LLFontGL &font, const U8 style, + const LLFontGL::ShadowType shadow, const F32 x_offset, const F32 y_offset, const LLColor4& color, const BOOL orthographic) { LLWString wstr(utf8str_to_wstring(str)); - hud_render_text(wstr, pos_agent, font, style, x_offset, y_offset, color, orthographic); + hud_render_text(wstr, pos_agent, font, style, shadow, x_offset, y_offset, color, orthographic); } void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, const LLFontGL &font, const U8 style, + const LLFontGL::ShadowType shadow, const F32 x_offset, const F32 y_offset, const LLColor4& color, const BOOL orthographic) @@ -75,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->getWindowHeight(), 0.f); - up_axis.setVec(0.f, 0.f, 1.f / gViewerWindow->getWindowHeight()); + right_axis.setVec(0.f, -1.f / gViewerWindow->getWorldViewWidth(), 0.f); + up_axis.setVec(0.f, 0.f, 1.f / gViewerWindow->getWorldViewHeight()); } else { @@ -104,26 +106,36 @@ 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(); + S32 viewport[4]; + viewport[0] = world_view_rect.mLeft; + viewport[1] = world_view_rect.mBottom; + viewport[2] = world_view_rect.getWidth(); + viewport[3] = world_view_rect.getHeight(); gluProject(render_pos.mV[0], render_pos.mV[1], render_pos.mV[2], - gGLModelView, gGLProjection, (GLint*) gGLViewport, + gGLModelView, gGLProjection, (GLint*) viewport, &winX, &winY, &winZ); - //fonts all render orthographically, set up projection + //fonts all render orthographically, set up projection`` glMatrixMode(GL_PROJECTION); glPushMatrix(); glMatrixMode(GL_MODELVIEW); LLUI::pushMatrix(); - gViewerWindow->setup2DRender(); + gl_state_for_2d(world_view_rect.getWidth(), world_view_rect.getHeight()); + gViewerWindow->setup3DViewport(); + //gViewerWindow->setup2DRender(); + winX -= world_view_rect.mLeft; + winY -= world_view_rect.mBottom; LLUI::loadIdentity(); LLUI::translate((F32) winX*1.0f/LLFontGL::sScaleX, (F32) winY*1.0f/(LLFontGL::sScaleY), -(((F32) winZ*2.f)-1.f)); //glRotatef(angle * RAD_TO_DEG, axis.mV[VX], axis.mV[VY], axis.mV[VZ]); //glScalef(right_scale, up_scale, 1.f); F32 right_x; - font.render(wstr, 0, 0, 0, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, wstr.length(), 1000, &right_x); + font.render(wstr, 0, 0, 0, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, shadow, wstr.length(), 1000, &right_x); LLUI::popMatrix(); glMatrixMode(GL_PROJECTION); diff --git a/indra/newview/llhudrender.h b/indra/newview/llhudrender.h index 5ca865737f293c0ac44310ed5b8a3f5e09bc7e87..93de89f7b028e645eb1285a5485ba3edc17dcef9 100644 --- a/indra/newview/llhudrender.h +++ b/indra/newview/llhudrender.h @@ -43,6 +43,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, const LLFontGL &font, const U8 style, + const LLFontGL::ShadowType, const F32 x_offset, const F32 y_offset, const LLColor4& color, @@ -53,6 +54,7 @@ void hud_render_utf8text(const std::string &str, const LLVector3 &pos_agent, const LLFontGL &font, const U8 style, + const LLFontGL::ShadowType, const F32 x_offset, const F32 y_offset, const LLColor4& color, diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 20140073f4bddfb64a23a5d50f9b84a6573d2237..efeac9c1978c5b127cc7caad56240bb17e3285a0 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -113,7 +113,6 @@ LLHUDText::LLHUDText(const U8 type) : mRadius = 0.1f; LLPointer<LLHUDText> ptr(this); sTextObjects.insert(ptr); - //LLDebugVarMessageBox::show("max width", &HUD_TEXT_MAX_WIDTH, 500.f, 1.f); } LLHUDText::~LLHUDText() @@ -293,7 +292,7 @@ void LLHUDText::renderText(BOOL for_select) LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); // *TODO: make this a per-text setting - LLColor4 bg_color = gSavedSettings.getColor4("BackgroundChatColor"); + LLColor4 bg_color = gSavedSkinSettings.getColor4("BackgroundChatColor"); bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); const S32 border_height = 16; @@ -319,8 +318,8 @@ void LLHUDText::renderText(BOOL for_select) 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->getWorldViewWidth(); + y_pixel_vec = LLVector3::z_axis / (F32)gViewerWindow->getWorldViewHeight(); } else { @@ -509,7 +508,7 @@ void LLHUDText::renderText(BOOL for_select) LLColor4 label_color(0.f, 0.f, 0.f, 1.f); label_color.mV[VALPHA] = alpha_factor; - hud_render_text(segment_iter->getText(), render_position, *fontp, segment_iter->mStyle, x_offset, y_offset, label_color, mOnHUDAttachment); + hud_render_text(segment_iter->getText(), render_position, *fontp, segment_iter->mStyle, LLFontGL::NO_SHADOW, x_offset, y_offset, label_color, mOnHUDAttachment); } } @@ -535,9 +534,10 @@ void LLHUDText::renderText(BOOL for_select) y_offset -= fontp->getLineHeight(); U8 style = segment_iter->mStyle; + LLFontGL::ShadowType shadow = LLFontGL::NO_SHADOW; if (mDropShadow) { - style |= LLFontGL::DROP_SHADOW; + shadow = LLFontGL::DROP_SHADOW; } F32 x_offset; @@ -553,7 +553,7 @@ void LLHUDText::renderText(BOOL for_select) text_color = segment_iter->mColor; text_color.mV[VALPHA] *= alpha_factor; - hud_render_text(segment_iter->getText(), render_position, *fontp, style, x_offset, y_offset, text_color, mOnHUDAttachment); + hud_render_text(segment_iter->getText(), render_position, *fontp, style, shadow, x_offset, y_offset, text_color, mOnHUDAttachment); } } /// Reset the default color to white. The renderer expects this to be the default. @@ -797,44 +797,26 @@ LLVector2 LLHUDText::updateScreenPos(LLVector2 &offset) if (!LLViewerCamera::getInstance()->projectPosAgentToScreen(world_pos, screen_pos, FALSE) && mVisibleOffScreen) { // bubble off-screen, so find a spot for it along screen edge - LLVector2 window_center(gViewerWindow->getWindowDisplayWidth() * 0.5f, gViewerWindow->getWindowDisplayHeight() * 0.5f); - LLVector2 delta_from_center(screen_pos.mX - window_center.mV[VX], - screen_pos.mY - window_center.mV[VY]); - delta_from_center.normVec(); - - F32 camera_aspect = LLViewerCamera::getInstance()->getAspect(); - F32 delta_aspect = llabs(delta_from_center.mV[VX] / delta_from_center.mV[VY]); - if (camera_aspect / llmax(delta_aspect, 0.001f) > 1.f) - { - // camera has wider aspect ratio than offset vector, so clamp to height - delta_from_center *= llabs(window_center.mV[VY] / delta_from_center.mV[VY]); - } - else - { - // camera has narrower aspect ratio than offset vector, so clamp to width - delta_from_center *= llabs(window_center.mV[VX] / delta_from_center.mV[VX]); - } - - screen_pos_vec = window_center + delta_from_center; - } - else - { - screen_pos_vec.setVec((F32)screen_pos.mX, (F32)screen_pos.mY); + LLViewerCamera::getInstance()->projectPosAgentToScreenEdge(world_pos, screen_pos); } - S32 bottom = STATUS_BAR_HEIGHT; - if (gChatBar->getVisible()) + + screen_pos_vec.setVec((F32)screen_pos.mX, (F32)screen_pos.mY); + + LLRect world_rect = gViewerWindow->getVirtualWorldViewRect(); + S32 bottom = world_rect.mBottom + STATUS_BAR_HEIGHT; + if (gChatBar && gChatBar->getVisible()) { bottom += CHAT_BAR_HEIGHT; } LLVector2 screen_center; - screen_center.mV[VX] = llclamp((F32)screen_pos_vec.mV[VX], mWidth * 0.5f, (F32)gViewerWindow->getWindowDisplayWidth() - mWidth * 0.5f); + screen_center.mV[VX] = llclamp((F32)screen_pos_vec.mV[VX], (F32)world_rect.mLeft + mWidth * 0.5f, (F32)world_rect.mRight - mWidth * 0.5f); if(mVertAlignment == ALIGN_VERT_TOP) { screen_center.mV[VY] = llclamp((F32)screen_pos_vec.mV[VY], (F32)bottom, - (F32)gViewerWindow->getWindowDisplayHeight() - mHeight - (F32)MENU_BAR_HEIGHT); + (F32)world_rect.mTop - mHeight - (F32)MENU_BAR_HEIGHT); mSoftScreenRect.setLeftTopAndSize(screen_center.mV[VX] - (mWidth + BUFFER_SIZE) * 0.5f, screen_center.mV[VY] + (mHeight + BUFFER_SIZE), mWidth + BUFFER_SIZE, mHeight + BUFFER_SIZE); } @@ -842,7 +824,7 @@ LLVector2 LLHUDText::updateScreenPos(LLVector2 &offset) { screen_center.mV[VY] = llclamp((F32)screen_pos_vec.mV[VY], (F32)bottom + mHeight * 0.5f, - (F32)gViewerWindow->getWindowDisplayHeight() - mHeight * 0.5f - (F32)MENU_BAR_HEIGHT); + (F32)world_rect.mTop - mHeight * 0.5f - (F32)MENU_BAR_HEIGHT); mSoftScreenRect.setCenterAndSize(screen_center.mV[VX], screen_center.mV[VY], mWidth + BUFFER_SIZE, mHeight + BUFFER_SIZE); } diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index 645cbc26980a8c9364c70d659cb4d83e022051b7..dc14a8c764ac825e6687c454791aa2f52ed15fea 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -33,7 +33,7 @@ #ifndef LL_LLHUDTEXT_H #define LL_LLHUDTEXT_H -#include "llmemory.h" +#include "llpointer.h" #include "lldarrayptr.h" #include "llhudobject.h" diff --git a/indra/newview/llhudview.cpp b/indra/newview/llhudview.cpp index 198514ce0c65eb20b4bf27bdd9a2d8d62c11583d..6f22a68327610200637493412bcee96b383eb16c 100644 --- a/indra/newview/llhudview.cpp +++ b/indra/newview/llhudview.cpp @@ -41,7 +41,6 @@ // viewer includes #include "llagent.h" #include "llcallingcard.h" -#include "llcolorscheme.h" #include "llviewercontrol.h" #include "llfloaterworldmap.h" #include "llworldmapview.h" @@ -55,10 +54,12 @@ const S32 HUD_ARROW_SIZE = 32; LLHUDView::LLHUDView() : LLPanel() -{ } +{ +} LLHUDView::~LLHUDView() -{ } +{ +} // virtual void LLHUDView::draw() diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 05864092830a1a34f1f7019ad4bc64324518b1d1..6acd174fc3f0e4d2d6bb92f613c6a5fa65c9b698 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -49,18 +49,21 @@ #include "llchat.h" #include "llconsole.h" #include "llfloater.h" +#include "llfloatercall.h" #include "llfloatergroupinfo.h" +#include "llfriendactions.h" #include "llimview.h" #include "llinventory.h" #include "llinventorymodel.h" #include "llinventoryview.h" #include "llfloateractivespeakers.h" -#include "llfloateravatarinfo.h" #include "llfloaterchat.h" #include "llkeyboard.h" #include "lllineeditor.h" #include "llnotify.h" +#include "llrecentpeople.h" #include "llresmgr.h" +#include "lltrans.h" #include "lltabcontainer.h" #include "llviewertexteditor.h" #include "llviewermessage.h" @@ -216,7 +219,7 @@ private: bool send_start_session_messages( const LLUUID& temp_session_id, const LLUUID& other_participant_id, - const LLDynamicArray<LLUUID>& ids, + const std::vector<LLUUID>& ids, EInstantMessage dialog) { if ( dialog == IM_SESSION_GROUP_START ) @@ -246,7 +249,7 @@ bool send_start_session_messages( LLSD agents; for (int i = 0; i < (S32) ids.size(); i++) { - agents.append(ids.get(i)); + agents.append(ids[i]); } //we have a new way of starting conference calls now @@ -587,7 +590,6 @@ LLVoiceChannel* LLVoiceChannel::getChannelByURI(std::string uri) } } - void LLVoiceChannel::updateSessionID(const LLUUID& new_session_id) { sVoiceChannelMap.erase(sVoiceChannelMap.find(mSessionID)); @@ -622,6 +624,17 @@ void LLVoiceChannel::setState(EState state) mState = state; } +void LLVoiceChannel::toggleCallWindowIfNeeded(EState state) +{ + if (state == STATE_CONNECTED) + LLFloaterCall::openInstance(mSessionID); + // By checking that current state is CONNECTED we make sure that the call window + // has been shown, hence there's something to hide. This helps when user presses + // the "End call" button right after initiating the call. + // *TODO: move this check to LLFloaterCall? + else if (state == STATE_HUNG_UP && mState == STATE_CONNECTED) + LLFloaterCall::closeInstance(mSessionID); +} //static void LLVoiceChannel::initClass() @@ -693,6 +706,15 @@ void LLVoiceChannelGroup::activate() LLVoiceClient::getInstance()->setNonSpatialChannel( mURI, mCredentials); + +#if 0 // *TODO + if (!gAgent.isInGroup(mSessionID)) // ad-hoc channel + { + // Add the party to the list of people with which we've recently interacted. + for (/*people in the chat*/) + LLRecentPeople::instance().add(buddy_id); + } +#endif } } @@ -814,6 +836,9 @@ void LLVoiceChannelGroup::handleError(EStatusType status) void LLVoiceChannelGroup::setState(EState state) { + // HACK: Open/close the call window if needed. + toggleCallWindowIfNeeded(state); + switch(state) { case STATE_RINGING: @@ -999,6 +1024,9 @@ void LLVoiceChannelP2P::activate() // using the session handle invalidates it. Clear it out here so we can't reuse it by accident. mSessionHandle.clear(); } + + // Add the party to the list of people with which we've recently interacted. + LLRecentPeople::instance().add(mOtherUserID); } } @@ -1056,6 +1084,9 @@ void LLVoiceChannelP2P::setSessionHandle(const std::string& handle, const std::s void LLVoiceChannelP2P::setState(EState state) { + // HACK: Open/close the call window if needed. + toggleCallWindowIfNeeded(state); + // you only "answer" voice invites in p2p mode // so provide a special purpose message here if (mReceivedCall && state == STATE_RINGING) @@ -1071,57 +1102,28 @@ void LLVoiceChannelP2P::setState(EState state) // // LLFloaterIMPanel // -LLFloaterIMPanel::LLFloaterIMPanel( - const std::string& session_label, - const LLUUID& session_id, - const LLUUID& other_participant_id, - EInstantMessage dialog) : - LLFloater(session_label, LLRect(), session_label), - mInputEditor(NULL), - mHistoryEditor(NULL), - mSessionUUID(session_id), - mVoiceChannel(NULL), - mSessionInitialized(FALSE), - mSessionStartMsgPos(0), - mOtherParticipantUUID(other_participant_id), - mDialog(dialog), - mTyping(FALSE), - mOtherTyping(FALSE), - mTypingLineStartIndex(0), - mSentTypingState(TRUE), - mNumUnreadMessages(0), - mShowSpeakersOnConnect(TRUE), - mAutoConnect(FALSE), - mTextIMPossible(TRUE), - mProfileButtonEnabled(TRUE), - mCallBackEnabled(TRUE), - mSpeakers(NULL), - mSpeakerPanel(NULL), - mFirstKeystrokeTimer(), - mLastKeystrokeTimer() -{ - init(session_label); -} -LLFloaterIMPanel::LLFloaterIMPanel( - const std::string& session_label, - const LLUUID& session_id, - const LLUUID& other_participant_id, - const LLDynamicArray<LLUUID>& ids, - EInstantMessage dialog) : - LLFloater(session_label, LLRect(), session_label), +LLFloaterIMPanel::LLFloaterIMPanel(const std::string& session_label, + const LLUUID& session_id, + const LLUUID& other_participant_id, + const std::vector<LLUUID>& ids, + EInstantMessage dialog) +: LLFloater(session_id), mInputEditor(NULL), mHistoryEditor(NULL), mSessionUUID(session_id), + mSessionLabel(session_label), mVoiceChannel(NULL), mSessionInitialized(FALSE), mSessionStartMsgPos(0), mOtherParticipantUUID(other_participant_id), mDialog(dialog), + mSessionInitialTargetIDs(ids), mTyping(FALSE), mOtherTyping(FALSE), mTypingLineStartIndex(0), mSentTypingState(TRUE), + mNumUnreadMessages(0), mShowSpeakersOnConnect(TRUE), mAutoConnect(FALSE), mTextIMPossible(TRUE), @@ -1132,15 +1134,6 @@ LLFloaterIMPanel::LLFloaterIMPanel( mFirstKeystrokeTimer(), mLastKeystrokeTimer() { - mSessionInitialTargetIDs = ids; - init(session_label); -} - - -void LLFloaterIMPanel::init(const std::string& session_label) -{ - mSessionLabel = session_label; - std::string xml_filename; switch(mDialog) { @@ -1188,11 +1181,10 @@ void LLFloaterIMPanel::init(const std::string& session_label) } mSpeakers = new LLIMSpeakerMgr(mVoiceChannel); + // All participants will be added to the list of people we've recently interacted with. + mSpeakers->addListener(&LLRecentPeople::instance(), "add"); - LLUICtrlFactory::getInstance()->buildFloater(this, - xml_filename, - &getFactoryMap(), - FALSE); + LLUICtrlFactory::getInstance()->buildFloater(this, xml_filename, FALSE); setTitle(mSessionLabel); mInputEditor->setMaxTextLength(1023); @@ -1230,7 +1222,7 @@ void LLFloaterIMPanel::init(const std::string& session_label) addHistoryLine( session_start, - gSavedSettings.getColor4("SystemChatColor"), + gSavedSkinSettings.getColor4("SystemChatColor"), false); } } @@ -1283,9 +1275,8 @@ BOOL LLFloaterIMPanel::postBuild() mInputEditor = getChild<LLLineEditor>("chat_editor"); mInputEditor->setFocusReceivedCallback( onInputEditorFocusReceived, this ); mInputEditor->setFocusLostCallback( onInputEditorFocusLost, this ); - mInputEditor->setKeystrokeCallback( onInputEditorKeystroke ); - mInputEditor->setCommitCallback( onCommitChat ); - mInputEditor->setCallbackUserData(this); + mInputEditor->setKeystrokeCallback( onInputEditorKeystroke, this ); + mInputEditor->setCommitCallback( onCommitChat, this ); mInputEditor->setCommitOnFocusLost( FALSE ); mInputEditor->setRevertOnEsc( FALSE ); mInputEditor->setReplaceNewlinesWithSpaces( FALSE ); @@ -1479,7 +1470,7 @@ private: LLUUID mSessionID; }; -BOOL LLFloaterIMPanel::inviteToSession(const LLDynamicArray<LLUUID>& ids) +BOOL LLFloaterIMPanel::inviteToSession(const std::vector<LLUUID>& ids) { LLViewerRegion* region = gAgent.getRegion(); if (!region) @@ -1487,7 +1478,7 @@ BOOL LLFloaterIMPanel::inviteToSession(const LLDynamicArray<LLUUID>& ids) return FALSE; } - S32 count = ids.count(); + S32 count = ids.size(); if( isInviteAllowed() && (count > 0) ) { @@ -1500,7 +1491,7 @@ BOOL LLFloaterIMPanel::inviteToSession(const LLDynamicArray<LLUUID>& ids) data["params"] = LLSD::emptyArray(); for (int i = 0; i < count; i++) { - data["params"].append(ids.get(i)); + data["params"].append(ids[i]); } data["method"] = "invite"; @@ -1637,24 +1628,11 @@ BOOL LLFloaterIMPanel::handleKeyHere( KEY key, MASK mask ) { sendMsg(); handled = TRUE; - - // Close talk panels on hitting return - // but not shift-return or control-return - if ( !gSavedSettings.getBOOL("PinTalkViewOpen") && !(mask & MASK_CONTROL) && !(mask & MASK_SHIFT) ) - { - gIMMgr->toggle(NULL); - } } else if ( KEY_ESCAPE == key ) { handled = TRUE; gFocusMgr.setKeyboardFocus(NULL); - - // Close talk panel with escape - if( !gSavedSettings.getBOOL("PinTalkViewOpen") ) - { - gIMMgr->toggle(NULL); - } } // May need to call base class LLPanel::handleKeyHere if not handled @@ -1705,8 +1683,8 @@ BOOL LLFloaterIMPanel::dropCallingCard(LLInventoryItem* item, BOOL drop) { if(drop) { - LLDynamicArray<LLUUID> ids; - ids.put(item->getCreatorUUID()); + std::vector<LLUUID> ids; + ids.push_back(item->getCreatorUUID()); inviteToSession(ids); } } @@ -1738,10 +1716,11 @@ BOOL LLFloaterIMPanel::dropCategory(LLInventoryCategory* category, BOOL drop) } else if(drop) { - LLDynamicArray<LLUUID> ids; + std::vector<LLUUID> ids; + ids.reserve(count); for(S32 i = 0; i < count; ++i) { - ids.put(items.get(i)->getCreatorUUID()); + ids.push_back(items.get(i)->getCreatorUUID()); } inviteToSession(ids); } @@ -1771,9 +1750,9 @@ void LLFloaterIMPanel::onClickProfile( void* userdata ) // Bring up the Profile window LLFloaterIMPanel* self = (LLFloaterIMPanel*) userdata; - if (self->mOtherParticipantUUID.notNull()) + if (self->getOtherParticipantID().notNull()) { - LLFloaterAvatarInfo::showFromDirectory(self->getOtherParticipantID()); + LLFriendActions::showProfile(self->getOtherParticipantID()); } } @@ -1792,7 +1771,7 @@ void LLFloaterIMPanel::onClickClose( void* userdata ) LLFloaterIMPanel* self = (LLFloaterIMPanel*) userdata; if(self) { - self->close(); + self->closeFloater(); } } @@ -1887,6 +1866,9 @@ void LLFloaterIMPanel::onClose(bool app_quitting) } gIMMgr->removeSession(mSessionUUID); + // *HACK hide the voice floater + LLFloaterCall::toggleInstanceVisibility(FALSE, mSessionUUID); + destroy(); } @@ -1896,6 +1878,10 @@ void LLFloaterIMPanel::onVisibilityChange(BOOL new_visibility) { mNumUnreadMessages = 0; } + + LLFloaterCall::toggleInstanceVisibility( + new_visibility && mVoiceChannel->getState() == LLVoiceChannel::STATE_CONNECTED, + mSessionUUID); } void deliver_message(const std::string& utf8_text, @@ -1966,6 +1952,9 @@ void deliver_message(const std::string& utf8_text, default: ; // do nothing } } + + // Add the recipient to the recent people list. + LLRecentPeople::instance().add(other_participant_id); } void LLFloaterIMPanel::sendMsg() @@ -2015,7 +2004,7 @@ void LLFloaterIMPanel::sendMsg() BOOL other_was_typing = mOtherTyping; - addHistoryLine(history_echo, gSavedSettings.getColor("IMChatColor"), true, gAgent.getID()); + addHistoryLine(history_echo, gSavedSkinSettings.getColor("IMChatColor"), true, gAgent.getID()); if (other_was_typing) { @@ -2186,7 +2175,7 @@ void LLFloaterIMPanel::addTypingIndicator(const std::string &name) mTypingLineStartIndex = mHistoryEditor->getWText().length(); LLUIString typing_start = sTypingStartString; typing_start.setArg("[NAME]", name); - addHistoryLine(typing_start, gSavedSettings.getColor4("SystemChatColor"), false); + addHistoryLine(typing_start, gSavedSkinSettings.getColor4("SystemChatColor"), false); mOtherTypingName = name; mOtherTyping = TRUE; } @@ -2224,14 +2213,14 @@ void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string // add warning log enabled message if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) { - message = LLFloaterChat::getInstance()->getString("IM_logging_string"); + message = LLTrans::getString("IM_logging_string"); } break; case LLLogChat::LOG_END: // add log end message if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) { - message = LLFloaterChat::getInstance()->getString("IM_logging_string"); + message = LLTrans::getString("IM_logging_string"); } break; case LLLogChat::LOG_LINE: @@ -2243,7 +2232,7 @@ void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string } //self->addHistoryLine(line, LLColor4::grey, FALSE); - self->mHistoryEditor->appendColoredText(message, false, true, LLColor4::grey); + self->mHistoryEditor->appendColoredText(message, false, true, gSavedSkinSettings.getColor4("ChatHistoryTextColor")); } void LLFloaterIMPanel::showSessionStartError( @@ -2325,7 +2314,7 @@ bool LLFloaterIMPanel::onConfirmForceCloseError(const LLSD& notification, const LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession( session_id); - if ( floaterp ) floaterp->close(FALSE); + if ( floaterp ) floaterp->closeFloater(FALSE); } return false; } diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 8b3ca202c7dd34748181d082e5906f70438b349b..7cd19d487247dc9406b3ffe1b9f2be63a5585fea 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -77,6 +77,7 @@ public: virtual void getChannelInfo(); virtual BOOL isActive(); virtual BOOL callStarted(); + const std::string& getSessionName() const { return mSessionName; } const LLUUID getSessionID() { return mSessionID; } EState getState() { return mState; } @@ -94,6 +95,7 @@ public: protected: virtual void setState(EState state); + void toggleCallWindowIfNeeded(EState state); void setURI(std::string uri); std::string mURI; @@ -185,11 +187,7 @@ public: LLFloaterIMPanel(const std::string& session_label, const LLUUID& session_id, const LLUUID& target_id, - EInstantMessage dialog); - LLFloaterIMPanel(const std::string& session_label, - const LLUUID& session_id, - const LLUUID& target_id, - const LLDynamicArray<LLUUID>& ids, + const std::vector<LLUUID>& ids, EInstantMessage dialog); virtual ~LLFloaterIMPanel(); @@ -202,7 +200,7 @@ public: // add target ids to the session. // Return TRUE if successful, otherwise FALSE. - BOOL inviteToSession(const LLDynamicArray<LLUUID>& agent_ids); + BOOL inviteToSession(const std::vector<LLUUID>& agent_ids); void addHistoryLine(const std::string &utf8msg, const LLColor4& color = LLColor4::white, @@ -246,6 +244,7 @@ public: const LLUUID& getSessionID() const { return mSessionUUID; } const LLUUID& getOtherParticipantID() const { return mOtherParticipantUUID; } + LLIMSpeakerMgr* getSpeakerManager() const { return mSpeakers; } void updateSpeakersList(const LLSD& speaker_updates); void processSessionUpdate(const LLSD& update); void setSpeakers(const LLSD& speaker_list); @@ -270,9 +269,6 @@ public: static bool onConfirmForceCloseError(const LLSD& notification, const LLSD& response); private: - // called by constructors - void init(const std::string& session_label); - // Called by UI methods. void sendMsg(); @@ -318,7 +314,7 @@ private: // inventory folder ==> first target id in list // 911 ==> sender LLUUID mOtherParticipantUUID; - LLDynamicArray<LLUUID> mSessionInitialTargetIDs; + std::vector<LLUUID> mSessionInitialTargetIDs; EInstantMessage mDialog; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index a90ea3926580650a9a5eafdc90d97b4d8a6a659d..d6569663a2ba51165896c61fc664cf0eb23d9b51 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -34,6 +34,7 @@ #include "llimview.h" +#include "llfloaterreg.h" #include "llfontgl.h" #include "llrect.h" #include "llerror.h" @@ -44,12 +45,12 @@ #include "lluictrlfactory.h" #include "llagent.h" +#include "llavatariconctrl.h" #include "llcallingcard.h" #include "llchat.h" #include "llresmgr.h" #include "llfloaterchat.h" #include "llfloaterchatterbox.h" -#include "llfloaternewim.h" #include "llhttpnode.h" #include "llimpanel.h" #include "llresizebar.h" @@ -67,6 +68,8 @@ #include "llviewerwindow.h" #include "llnotify.h" #include "llviewerregion.h" +#include "llviewertexteditor.h" +#include "lltrans.h" #include "llfirstuse.h" @@ -145,11 +148,11 @@ public: floaterp->requestAutoConnect(); LLFloaterIMPanel::onClickStartCall(floaterp); // always open IM window when connecting to voice - LLFloaterChatterBox::showInstance(TRUE); + LLFloaterReg::showInstance("communicate", LLSD(), TRUE); } else if ( mInvitiationType == LLIMMgr::INVITATION_TYPE_IMMEDIATE ) { - LLFloaterChatterBox::showInstance(TRUE); + LLFloaterReg::showInstance("communicate", LLSD(), TRUE); } } @@ -234,7 +237,8 @@ LLUUID LLIMMgr::computeSessionID( // LLFloaterIM //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LLFloaterIM::LLFloaterIM() +LLFloaterIM::LLFloaterIM() + : LLMultiFloater() { // autoresize=false is necessary to avoid resizing of the IM window whenever // a session is opened or closed (it would otherwise resize the window to match @@ -324,6 +328,168 @@ BOOL LLFloaterIM::postBuild() return TRUE; } +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLIncomingCallDialog +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LLIncomingCallDialog::LLIncomingCallDialog(const LLSD& payload) : + LLModalDialog(LLStringUtil::null, 240, 200), + mPayload(payload) +{ + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_incoming_call.xml"); +} + +BOOL LLIncomingCallDialog::postBuild() +{ + LLSD caller_id = mPayload["caller_id"]; + EInstantMessage type = (EInstantMessage)mPayload["type"].asInteger(); + + std::string call_type = getString("VoiceInviteP2P"); + std::string caller_name = mPayload["caller_name"].asString() + " "; + setTitle(caller_name + call_type); + + // If it is not a P2P invite, then it's an AdHoc invite + if ( type != IM_SESSION_P2P_INVITE ) + { + call_type = getString("VoiceInviteAdHoc"); + } + + LLViewerTextEditor* text = getChild<LLViewerTextEditor>("caller name"); + text->setEmbeddedText(caller_name + call_type); + LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); + icon->setValue(caller_id); + + childSetAction("Accept", onAccept, this); + childSetAction("Reject", onReject, this); + childSetAction("Start IM", onStartIM, this); + childSetFocus("Accept"); + + return TRUE; +} + +//static +void LLIncomingCallDialog::onAccept(void* user_data) +{ + LLIncomingCallDialog* self = (LLIncomingCallDialog*)user_data; + self->processCallResponse(0); + self->closeFloater(); +} + +//static +void LLIncomingCallDialog::onReject(void* user_data) +{ + LLIncomingCallDialog* self = (LLIncomingCallDialog*)user_data; + self->processCallResponse(1); + self->closeFloater(); +} + +//static +void LLIncomingCallDialog::onStartIM(void* user_data) +{ + LLIncomingCallDialog* self = (LLIncomingCallDialog*)user_data; + self->processCallResponse(2); + self->closeFloater(); +} + +void LLIncomingCallDialog::processCallResponse(S32 response) +{ + LLUUID session_id = mPayload["session_id"].asUUID(); + EInstantMessage type = (EInstantMessage)mPayload["type"].asInteger(); + LLIMMgr::EInvitationType inv_type = (LLIMMgr::EInvitationType)mPayload["inv_type"].asInteger(); + bool voice = true; + switch(response) + { + case 2: // start IM: just don't start the voice chat + { + voice = false; + /* FALLTHROUGH */ + } + case 0: // accept + { + if (type == IM_SESSION_P2P_INVITE) + { + // create a normal IM session + session_id = gIMMgr->addP2PSession( + mPayload["session_name"].asString(), + mPayload["caller_id"].asUUID(), + mPayload["session_handle"].asString()); + + if (voice) + { + LLFloaterIMPanel* im_floater = + gIMMgr->findFloaterBySession( + session_id); + + if (im_floater) + { + im_floater->requestAutoConnect(); + LLFloaterIMPanel::onClickStartCall(im_floater); + } + } + + // always open IM window when connecting to voice + LLFloaterReg::showInstance("communicate", session_id); + + gIMMgr->clearPendingAgentListUpdates(session_id); + gIMMgr->clearPendingInvitation(session_id); + } + else + { + gIMMgr->addSession( + mPayload["session_name"].asString(), + type, + session_id); + + std::string url = gAgent.getRegion()->getCapability( + "ChatSessionRequest"); + + if (voice) + { + LLSD data; + data["method"] = "accept invitation"; + data["session-id"] = session_id; + LLHTTPClient::post( + url, + data, + new LLViewerChatterBoxInvitationAcceptResponder( + session_id, + inv_type)); + } + } + if (voice) + { + break; + } + } + case 1: // decline + { + if (type == IM_SESSION_P2P_INVITE) + { + if(gVoiceClient) + { + std::string s = mPayload["session_handle"].asString(); + gVoiceClient->declineInvite(s); + } + } + else + { + std::string url = gAgent.getRegion()->getCapability( + "ChatSessionRequest"); + + LLSD data; + data["method"] = "decline invitation"; + data["session-id"] = session_id; + LLHTTPClient::post( + url, + data, + NULL); + } + } + + gIMMgr->clearPendingAgentListUpdates(session_id); + gIMMgr->clearPendingInvitation(session_id); + } +} + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLIMViewFriendObserver // @@ -375,7 +541,7 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response) im_floater->requestAutoConnect(); LLFloaterIMPanel::onClickStartCall(im_floater); // always open IM window when connecting to voice - LLFloaterChatterBox::showInstance(session_id); + LLFloaterReg::showInstance("communicate", session_id, TRUE); } gIMMgr->clearPendingAgentListUpdates(session_id); @@ -467,54 +633,6 @@ EInstantMessage LLIMMgr::defaultIMTypeForAgent(const LLUUID& agent_id) return type; } -// static -//void LLIMMgr::onPinButton(void*) -//{ -// BOOL state = gSavedSettings.getBOOL( "PinTalkViewOpen" ); -// gSavedSettings.setBOOL( "PinTalkViewOpen", !state ); -//} - -// static -void LLIMMgr::toggle(void*) -{ - static BOOL return_to_mouselook = FALSE; - - // Hide the button and show the floater or vice versa. - llassert( gIMMgr ); - BOOL old_state = gIMMgr->getFloaterOpen(); - - // If we're in mouselook and we triggered the Talk View, we want to talk. - if( gAgent.cameraMouselook() && old_state ) - { - return_to_mouselook = TRUE; - gAgent.changeCameraToDefault(); - return; - } - - BOOL new_state = !old_state; - - if (new_state) - { - // ...making visible - if ( gAgent.cameraMouselook() ) - { - return_to_mouselook = TRUE; - gAgent.changeCameraToDefault(); - } - } - else - { - // ...hiding - if ( gAgent.cameraThirdPerson() && return_to_mouselook ) - { - gAgent.changeCameraToMouselook(); - } - return_to_mouselook = FALSE; - } - - gIMMgr->setFloaterOpen( new_state ); -} - // // Member Functions // @@ -607,6 +725,8 @@ void LLIMMgr::addMessage( dialog, FALSE); + notifyObserverSessionAdded(floater->getSessionID(), name, other_participant_id); + // When we get a new IM, and if you are a god, display a bit // of information about the source. This is to help liaisons // when answering questions. @@ -614,10 +734,10 @@ void LLIMMgr::addMessage( { // *TODO:translate (low priority, god ability) std::ostringstream bonus_info; - bonus_info << "*** parent estate: " + bonus_info << LLTrans::getString("***")+ " "+ LLTrans::getString("IMParentEstate") + ":" + " " << parent_estate_id - << ((parent_estate_id == 1) ? ", mainland" : "") - << ((parent_estate_id == 5) ? ", teen" : ""); + << ((parent_estate_id == 1) ? "," + LLTrans::getString("IMMainland") : "") + << ((parent_estate_id == 5) ? "," + LLTrans::getString ("IMTeen") : ""); // once we have web-services (or something) which returns // information about a region id, we can print this out @@ -625,7 +745,7 @@ void LLIMMgr::addMessage( //<< "*** region_id: " << region_id << std::endl //<< "*** position: " << position << std::endl; - floater->addHistoryLine(bonus_info.str(), gSavedSettings.getColor4("SystemChatColor")); + floater->addHistoryLine(bonus_info.str(), gSavedSkinSettings.getColor4("SystemChatColor")); } make_ui_sound("UISndNewIncomingIMSession"); @@ -634,8 +754,8 @@ void LLIMMgr::addMessage( // now add message to floater bool is_from_system = target_id.isNull() || (from == SYSTEM_FROM); const LLColor4& color = ( is_from_system ? - gSavedSettings.getColor4("SystemChatColor") : - gSavedSettings.getColor("IMChatColor")); + gSavedSkinSettings.getColor4("SystemChatColor") : + gSavedSkinSettings.getColor("IMChatColor")); if ( !link_name ) { floater->addHistoryLine(msg,color); // No name to prepend, so just add the message normally @@ -645,10 +765,10 @@ void LLIMMgr::addMessage( floater->addHistoryLine(msg, color, true, other_participant_id, from); // Insert linked name to front of message } - LLFloaterChatterBox* chat_floater = LLFloaterChatterBox::getInstance(LLSD()); - - if( !chat_floater->getVisible() && !floater->getVisible()) + if( !LLFloaterReg::instanceVisible("communicate") && !floater->getVisible()) { + LLFloaterChatterBox* chat_floater = LLFloaterChatterBox::getInstance(); + //if the IM window is not open and the floater is not visible (i.e. not torn off) LLFloater* previouslyActiveFloater = chat_floater->getActiveFloater(); @@ -675,14 +795,12 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess // null session id means near me (chat history) if (session_id.isNull()) { - LLFloaterChat* floaterp = LLFloaterChat::getInstance(); - - message = floaterp->getString(message_name); + message = LLTrans::getString(message_name); message.setArgs(args); LLChat chat(message); chat.mSourceType = CHAT_SOURCE_SYSTEM; - LLFloaterChat::getInstance()->addChatHistory(chat); + LLFloaterChat::addChatHistory(chat); } else // going to IM session { @@ -699,7 +817,7 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess void LLIMMgr::notifyNewIM() { - if(!gIMMgr->getFloaterOpen()) + if(!LLFloaterReg::instanceVisible("communicate")) { mIMReceived = TRUE; } @@ -767,21 +885,21 @@ LLUUID LLIMMgr::addSession( TRUE); noteOfflineUsers(floater, ids); - LLFloaterChatterBox::showInstance(session_id); + LLFloaterReg::showInstance("communicate", session_id); // Only warn for regular IMs - not group IMs if( dialog == IM_NOTHING_SPECIAL ) { noteMutedUsers(floater, ids); } - LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater); } else { - floater->open(); + floater->openFloater(); } //mTabContainer->selectTabPanel(panel); floater->setInputFocus(TRUE); + notifyObserverSessionAdded(floater->getSessionID(), name, other_participant_id); return floater->getSessionID(); } @@ -818,7 +936,7 @@ LLUUID LLIMMgr::addSession( if ( !floater ) return LLUUID::null; noteOfflineUsers(floater, ids); - LLFloaterChatterBox::showInstance(session_id); + LLFloaterReg::showInstance("communicate", session_id); // Only warn for regular IMs - not group IMs if( dialog == IM_NOTHING_SPECIAL ) @@ -828,10 +946,11 @@ LLUUID LLIMMgr::addSession( } else { - floater->open(); + floater->openFloater(); } //mTabContainer->selectTabPanel(panel); floater->setInputFocus(TRUE); + notifyObserverSessionAdded(floater->getSessionID(), name, other_participant_id); return floater->getSessionID(); } @@ -843,12 +962,13 @@ void LLIMMgr::removeSession(const LLUUID& session_id) if(floater) { mFloaters.erase(floater->getHandle()); - LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater); + LLFloaterChatterBox::getInstance()->removeFloater(floater); //mTabContainer->removeTabPanel(floater); clearPendingInvitation(session_id); clearPendingAgentListUpdates(session_id); } + notifyObserverSessionRemoved(session_id); } void LLIMMgr::inviteToSession( @@ -932,65 +1052,60 @@ void LLIMMgr::inviteToSession( { if (caller_name.empty()) { - gCacheName->getName(caller_id, onInviteNameLookup, new LLSD(payload)); + gCacheName->get(caller_id, FALSE, boost::bind(&LLIMMgr::onInviteNameLookup, payload, _1, _2, _3, _4)); } else { - LLSD args; - args["NAME"] = caller_name; - args["GROUP"] = session_name; - - LLNotifications::instance().add(notify_box_type, - args, - payload, - &inviteUserResponse); - + if (notify_box_type == "VoiceInviteP2P" || notify_box_type == "VoiceInviteAdHoc") + { + LLIncomingCallDialog *dialog = new LLIncomingCallDialog(payload); + dialog->startModal(); + } + else + { + LLSD args; + args["NAME"] = caller_name; + args["GROUP"] = session_name; + + LLNotifications::instance().add(notify_box_type, + args, + payload, + &inviteUserResponse); + } } mPendingInvitations[session_id.asString()] = LLSD(); } } -//static -void LLIMMgr::onInviteNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* userdata) +void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) { - LLSD payload = *(LLSD*)userdata; - delete (LLSD*)userdata; - payload["caller_name"] = first + " " + last; payload["session_name"] = payload["caller_name"].asString(); - LLSD args; - args["NAME"] = payload["caller_name"].asString(); + std::string notify_box_type = payload["notify_box_type"].asString(); - LLNotifications::instance().add( - payload["notify_box_type"].asString(), - args, - payload, - &inviteUserResponse); -} - -void LLIMMgr::refresh() -{ -} - -void LLIMMgr::setFloaterOpen(BOOL set_open) -{ - if (set_open) + if (notify_box_type == "VoiceInviteP2P" || notify_box_type == "VoiceInviteAdHoc") { - LLFloaterChatterBox::showInstance(); + LLIncomingCallDialog *dialog = new LLIncomingCallDialog(payload); + dialog->startModal(); } else { - LLFloaterChatterBox::hideInstance(); + LLSD args; + args["NAME"] = payload["caller_name"].asString(); + + LLNotifications::instance().add( + payload["notify_box_type"].asString(), + args, + payload, + &inviteUserResponse); } } - -BOOL LLIMMgr::getFloaterOpen() +void LLIMMgr::refresh() { - return LLFloaterChatterBox::instanceVisible(LLSD()); } - + void LLIMMgr::disconnectAllSessions() { LLFloaterIMPanel* floater = NULL; @@ -1007,7 +1122,7 @@ void LLIMMgr::disconnectAllSessions() if (floater) { floater->setEnabled(FALSE); - floater->close(TRUE); + floater->closeFloater(TRUE); } } } @@ -1128,6 +1243,32 @@ void LLIMMgr::clearPendingAgentListUpdates(const LLUUID& session_id) } } +void LLIMMgr::notifyObserverSessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) +{ + for (session_observers_list_t::iterator it = mSessionObservers.begin(); it != mSessionObservers.end(); it++) + { + (*it)->sessionAdded(session_id, name, other_participant_id); + } +} + +void LLIMMgr::notifyObserverSessionRemoved(const LLUUID& session_id) +{ + for (session_observers_list_t::iterator it = mSessionObservers.begin(); it != mSessionObservers.end(); it++) + { + (*it)->sessionRemoved(session_id); + } +} + +void LLIMMgr::addSessionObserver(LLIMSessionObserver *observer) +{ + mSessionObservers.push_back(observer); +} + +void LLIMMgr::removeSessionObserver(LLIMSessionObserver *observer) +{ + mSessionObservers.remove(observer); +} + // create a floater and update internal representation for // consistency. Returns the pointer, caller (the class instance since // it is a private method) is not responsible for deleting the @@ -1146,12 +1287,14 @@ LLFloaterIMPanel* LLIMMgr::createFloater( llinfos << "LLIMMgr::createFloater: from " << other_participant_id << " in session " << session_id << llendl; + std::vector<LLUUID> ids; LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, session_id, other_participant_id, + ids, dialog); LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; - LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt); + LLFloaterChatterBox::getInstance()->addFloater(floater, FALSE, i_pt); mFloaters.insert(floater->getHandle()); return floater; } @@ -1177,7 +1320,7 @@ LLFloaterIMPanel* LLIMMgr::createFloater( ids, dialog); LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; - LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt); + LLFloaterChatterBox::getInstance()->addFloater(floater, FALSE, i_pt); mFloaters.insert(floater->getHandle()); return floater; } @@ -1189,7 +1332,7 @@ void LLIMMgr::noteOfflineUsers( S32 count = ids.count(); if(count == 0) { - floater->addHistoryLine(sOnlyUserMessage, gSavedSettings.getColor4("SystemChatColor")); + floater->addHistoryLine(sOnlyUserMessage, gSavedSkinSettings.getColor4("SystemChatColor")); } else { @@ -1205,7 +1348,7 @@ void LLIMMgr::noteOfflineUsers( LLUIString offline = sOfflineMessage; offline.setArg("[FIRST]", first); offline.setArg("[LAST]", last); - floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor")); + floater->addHistoryLine(offline, gSavedSkinSettings.getColor4("SystemChatColor")); } } } @@ -1267,11 +1410,6 @@ void LLIMMgr::updateFloaterSessionID( } } -LLFloaterChatterBox* LLIMMgr::getFloater() -{ - return LLFloaterChatterBox::getInstance(LLSD()); -} - class LLViewerChatterBoxSessionStartReply : public LLHTTPNode { public: diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index a4e419694df08060b977492836a3c53bb3ffbdaf..469f6ec21db06b73f4cf15bab7e79af8736df3d8 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -33,9 +33,10 @@ #ifndef LL_LLIMVIEW_H #define LL_LLIMVIEW_H -#include "llfloater.h" +#include "llmodaldialog.h" #include "llinstantmessage.h" #include "lluuid.h" +#include "llmultifloater.h" class LLFloaterChatterBox; class LLUUID; @@ -43,6 +44,14 @@ class LLFloaterIMPanel; class LLFriendObserver; class LLFloaterIM; +class LLIMSessionObserver +{ +public: + virtual ~LLIMSessionObserver() {} + virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0; + virtual void sessionRemoved(const LLUUID& session_id) = 0; +}; + class LLIMMgr : public LLSingleton<LLIMMgr> { public: @@ -134,19 +143,12 @@ public: // IM received that you haven't seen yet BOOL getIMReceived() const; - void setFloaterOpen(BOOL open); /*Flawfinder: ignore*/ - BOOL getFloaterOpen(); - - LLFloaterChatterBox* getFloater(); - // This method is used to go through all active sessions and // disable all of them. This method is usally called when you are // forced to log out or similar situations where you do not have a // good connection. void disconnectAllSessions(); - static void toggle(void*); - // This is a helper function to determine what kind of im session // should be used for the given agent. static EInstantMessage defaultIMTypeForAgent(const LLUUID& agent_id); @@ -171,6 +173,9 @@ public: //HACK: need a better way of enumerating existing session, or listening to session create/destroy events const std::set<LLHandle<LLFloater> >& getIMFloaterHandles() { return mFloaters; } + void addSessionObserver(LLIMSessionObserver *); + void removeSessionObserver(LLIMSessionObserver *); + private: // create a panel and update internal representation for // consistency. Returns the pointer, caller (the class instance @@ -198,12 +203,18 @@ private: void processIMTypingCore(const LLIMInfo* im_info, BOOL typing); - static void onInviteNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* userdata); + static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + + void notifyObserverSessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); + void notifyObserverSessionRemoved(const LLUUID& session_id); private: std::set<LLHandle<LLFloater> > mFloaters; LLFriendObserver* mFriendObserver; + typedef std::list <LLIMSessionObserver *> session_observers_list_t; + session_observers_list_t mSessionObservers; + // An IM has been received that you haven't seen yet. BOOL mIMReceived; @@ -223,6 +234,23 @@ public: static std::map<std::string,std::string> sForceCloseSessionMap; }; +class LLIncomingCallDialog : public LLModalDialog +{ +public: + LLIncomingCallDialog(const LLSD& payload); + + /*virtual*/ BOOL postBuild(); + + static void onAccept(void* user_data); + static void onReject(void* user_data); + static void onStartIM(void* user_data); + +private: + void processCallResponse(S32 response); + + LLSD mPayload; +}; + // Globals extern LLIMMgr *gIMMgr; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 5d09d8748fda8faf182ebd0fd297aef2ec26438f..540cefbc46019a67f37d63915ec55829d1f8e72e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -40,8 +40,10 @@ #include "message.h" #include "llagent.h" +#include "llagentwearables.h" #include "llcallingcard.h" #include "llcheckboxctrl.h" // for radio buttons +#include "llfloaterreg.h" #include "llradiogroup.h" #include "llspinctrl.h" #include "lltextbox.h" @@ -49,13 +51,13 @@ #include "llviewercontrol.h" #include "llfirstuse.h" -#include "llfloateravatarinfo.h" #include "llfloaterchat.h" #include "llfloatercustomize.h" #include "llfloaterproperties.h" #include "llfloaterworldmap.h" #include "llfocusmgr.h" #include "llfolderview.h" +#include "llfriendactions.h" #include "llgesturemgr.h" #include "lliconctrl.h" #include "llinventorymodel.h" @@ -82,10 +84,12 @@ #include "llwearablelist.h" #include "llviewermessage.h" #include "llviewerregion.h" +#include "llvoavatarself.h" #include "lltabcontainer.h" #include "lluictrlfactory.h" #include "llselectmgr.h" #include "llfloateropenobject.h" +#include "lltrans.h" using namespace LLOldEvents; @@ -106,12 +110,13 @@ void dec_busy_count() // Function declarations struct LLWearableHoldingPattern; +void wear_add_inventory_item_on_avatar(LLInventoryItem* item); void wear_inventory_category_on_avatar(LLInventoryCategory* category, BOOL append); -void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata); +void wear_inventory_category_on_avatar_step2( BOOL proceed, LLUUID category, BOOL append); void wear_inventory_category_on_avatar_loop(LLWearable* wearable, void*); void wear_inventory_category_on_avatar_step3(LLWearableHoldingPattern* holder, BOOL append); void remove_inventory_category_from_avatar(LLInventoryCategory* category); -void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata); +void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_id); bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*); bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response); @@ -144,17 +149,13 @@ std::string ICON_NAME[ICON_NAME_COUNT] = "inv_item_undershirt.tga", "inv_item_underpants.tga", "inv_item_skirt.tga", + "inv_item_alpha.tga", + "inv_item_tattoo.tga", "inv_item_animation.tga", "inv_item_gesture.tga", }; -struct LLWearInfo -{ - LLUUID mCategoryID; - BOOL mAppend; -}; - BOOL gAddToOutfit = FALSE; // +=================================================+ @@ -192,7 +193,7 @@ time_t LLInvFVBridge::getCreationDate() const // Can be destoryed (or moved to trash) BOOL LLInvFVBridge::isItemRemovable() { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; if(model->isObjectDescendentOf(mUUID, gAgent.getInventoryRootID())) { @@ -210,14 +211,14 @@ BOOL LLInvFVBridge::isItemMovable() // *TODO: make sure this does the right thing void LLInvFVBridge::showProperties() { - LLShowProps::showProperties(mUUID); + LLFloaterProperties::show(mUUID); } void LLInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batch) { // Deactivate gestures when moving them into Trash LLInvFVBridge* bridge; - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); LLViewerInventoryItem* item = NULL; LLViewerInventoryCategory* cat = NULL; LLInventoryModel::cat_array_t descendent_categories; @@ -265,7 +266,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener* // we call LLInventoryModel::moveObject() to move everything // around. LLInvFVBridge* bridge; - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return; LLMessageSystem* msg = gMessageSystem; LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); @@ -369,7 +370,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener* BOOL LLInvFVBridge::isClipboardPasteable() const { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; BOOL is_agent_inventory = model->isObjectDescendentOf(mUUID, gAgent.getInventoryRootID()); @@ -381,8 +382,8 @@ BOOL LLInvFVBridge::isClipboardPasteable() const } void hideContextEntries(LLMenuGL& menu, - const std::vector<std::string> &entries_to_show, - const std::vector<std::string> &disabled_entries) + const std::vector<std::string> &entries_to_show, + const std::vector<std::string> &disabled_entries) { const LLView::child_list_t *list = menu.getChildList(); @@ -426,10 +427,10 @@ void hideContextEntries(LLMenuGL& menu, } // Helper for commonly-used entries -void LLInvFVBridge::getClipboardEntries(bool show_asset_id, std::vector<std::string> &items, - std::vector<std::string> &disabled_items, U32 flags) +void LLInvFVBridge::getClipboardEntries(bool show_asset_id, + std::vector<std::string> &items, + std::vector<std::string> &disabled_items, U32 flags) { - // *TODO: Translate items.push_back(std::string("Rename")); if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0) { @@ -471,18 +472,17 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, std::vector<std::str void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { - // *TODO: Translate lldebugs << "LLInvFVBridge::buildContextMenu()" << llendl; std::vector<std::string> items; std::vector<std::string> disabled_items; if(isInTrash()) { - items.push_back(std::string("Purge Item")); + items.push_back(std::string("PurgeItem")); if (!isItemRemovable()) { - disabled_items.push_back(std::string("Purge Item")); + disabled_items.push_back(std::string("PurgeItem")); } - items.push_back(std::string("Restore Item")); + items.push_back(std::string("RestoreItem")); } else { @@ -526,7 +526,7 @@ BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const LLInventoryObject* LLInvFVBridge::getInventoryObject() const { LLInventoryObject* obj = NULL; - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(model) { obj = (LLInventoryObject*)model->getObject(mUUID); @@ -534,9 +534,15 @@ LLInventoryObject* LLInvFVBridge::getInventoryObject() const return obj; } +LLInventoryModel* LLInvFVBridge::getInventoryModel() const +{ + LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); + return panel ? panel->getModel() : NULL; +} + BOOL LLInvFVBridge::isInTrash() const { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); return model->isObjectDescendentOf(mUUID, trash_id); @@ -544,7 +550,7 @@ BOOL LLInvFVBridge::isInTrash() const BOOL LLInvFVBridge::isAgentInventory() const { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; if(gAgent.getInventoryRootID() == mUUID) return TRUE; return model->isObjectDescendentOf(mUUID, gAgent.getInventoryRootID()); @@ -602,22 +608,21 @@ void LLInvFVBridge::changeCategoryParent(LLInventoryModel* model, } -const char* safe_inv_type_lookup(LLInventoryType::EType inv_type) +const std::string safe_inv_type_lookup(LLInventoryType::EType inv_type) { - const char* rv = LLInventoryType::lookup(inv_type); - if(!rv) + const std::string rv= LLInventoryType::lookup(inv_type); + if(rv.empty()) { - const char* INVALID_TYPE = "<invalid>"; - rv = INVALID_TYPE; + return std::string("<invalid>"); } return rv; } LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, - LLInventoryType::EType inv_type, - LLInventoryPanel* inventory, - const LLUUID& uuid, - U32 flags) + LLInventoryType::EType inv_type, + LLInventoryPanel* inventory, + const LLUUID& uuid, + U32 flags) { LLInvFVBridge* new_listener = NULL; switch(asset_type) @@ -715,6 +720,10 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, case LLAssetType::AT_ROOT_CATEGORY: new_listener = new LLFolderBridge(inventory, uuid); break; + + case LLAssetType::AT_FAVORITE: + new_listener = new LLFolderBridge(inventory, uuid); + break; default: llinfos << "Unhandled asset type (llassetstorage.h): " @@ -811,7 +820,7 @@ void LLItemBridge::restoreItem() LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem(); if(item) { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); LLUUID new_parent = model->findCategoryUUIDForType(item->getType()); // do not restamp on restore. LLInvFVBridge::changeItemParent(model, item, new_parent, FALSE); @@ -906,6 +915,11 @@ void LLItemBridge::buildDisplayName(LLInventoryItem* item, std::string& name) std::string LLItemBridge::getLabelSuffix() const { + // assume that this won't be called before string table is loaded + static const char* NO_COPY =LLTrans::getString("NO_COPY").c_str(); + static const char* NO_MOD = LLTrans::getString("NO_MOD").c_str(); + static const char* NO_XFER = LLTrans::getString("NO_XFER").c_str(); + std::string suffix; LLInventoryItem* item = getItem(); if(item) @@ -918,11 +932,8 @@ std::string LLItemBridge::getLabelSuffix() const BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); - // *TODO: Translate + const char* EMPTY = ""; - const char* NO_COPY = " (no copy)"; - const char* NO_MOD = " (no modify)"; - const char* NO_XFER = " (no transfer)"; const char* scopy; if(copy) scopy = EMPTY; else scopy = NO_COPY; @@ -961,10 +972,12 @@ BOOL LLItemBridge::isItemRenameable() const BOOL LLItemBridge::renameItem(const std::string& new_name) { - if(!isItemRenameable()) return FALSE; - LLPreview::rename(mUUID, getPrefix() + new_name); - LLInventoryModel* model = mInventoryPanel->getModel(); - if(!model) return FALSE; + if(!isItemRenameable()) + return FALSE; + LLPreview::dirty(mUUID); + LLInventoryModel* model = getInventoryModel(); + if(!model) + return FALSE; LLViewerInventoryItem* item = getItem(); if(item && (item->getName() != new_name)) { @@ -989,7 +1002,7 @@ BOOL LLItemBridge::removeItem() } // move it to the trash LLPreview::hide(mUUID, TRUE); - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); LLViewerInventoryItem* item = getItem(); @@ -1015,7 +1028,7 @@ BOOL LLItemBridge::isItemCopyable() const if (item) { // can't copy worn objects. DEV-15183 - LLVOAvatar *avatarp = gAgent.getAvatarObject(); + LLVOAvatarSelf *avatarp = gAgent.getAvatarObject(); if( !avatarp ) { return FALSE; @@ -1044,7 +1057,7 @@ BOOL LLItemBridge::copyToClipboard() const LLViewerInventoryItem* LLItemBridge::getItem() const { LLViewerInventoryItem* item = NULL; - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(model) { item = (LLViewerInventoryItem*)model->getItem(mUUID); @@ -1091,7 +1104,7 @@ void LLFolderBridge::selectItem() // Can be destroyed (or moved to trash) BOOL LLFolderBridge::isItemRemovable() { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) { return FALSE; @@ -1102,7 +1115,7 @@ BOOL LLFolderBridge::isItemRemovable() return FALSE; } - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if( !avatar ) { return FALSE; @@ -1139,7 +1152,7 @@ BOOL LLFolderBridge::isItemRemovable() if( (item->getType() == LLAssetType::AT_CLOTHING) || (item->getType() == LLAssetType::AT_BODYPART) ) { - if( gAgent.isWearingItem( item->getUUID() ) ) + if( gAgentWearables.isWearingItem( item->getUUID() ) ) { return FALSE; } @@ -1159,7 +1172,7 @@ BOOL LLFolderBridge::isItemRemovable() BOOL LLFolderBridge::isUpToDate() const { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; LLViewerInventoryCategory* category = (LLViewerInventoryCategory*)model->getCategory(mUUID); if( !category ) @@ -1177,10 +1190,10 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // the UI will get confused and pass in a NULL. if(!inv_cat) return FALSE; - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if(!avatar) return FALSE; // cannot drag into library @@ -1233,7 +1246,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, if( (item->getType() == LLAssetType::AT_CLOTHING) || (item->getType() == LLAssetType::AT_BODYPART) ) { - if( gAgent.isWearingItem( item->getUUID() ) ) + if( gAgentWearables.isWearingItem( item->getUUID() ) ) { is_movable = FALSE; // It's generally movable, but not into the trash! break; @@ -1394,7 +1407,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id, else { LLNotification::Params params("MoveInventoryFromObject"); - params.functor(boost::bind(move_task_inventory_callback, _1, _2, move_inv)); + params.functor.function(boost::bind(move_task_inventory_callback, _1, _2, move_inv)); LLNotifications::instance().forceResponse(params, 0); } } @@ -1626,7 +1639,7 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model } else if ("removefromoutfit" == action) { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return; LLViewerInventoryCategory* cat = getCategory(); if(!cat) return; @@ -1657,7 +1670,7 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model void LLFolderBridge::openItem() { lldebugs << "LLFolderBridge::openItem()" << llendl; - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return; model->fetchDescendentsOf(mUUID); } @@ -1679,13 +1692,25 @@ void LLFolderBridge::restoreItem() cat = (LLViewerInventoryCategory*)getCategory(); if(cat) { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); LLUUID new_parent = model->findCategoryUUIDForType(cat->getType()); // do not restamp children on restore LLInvFVBridge::changeCategoryParent(model, cat, new_parent, FALSE); } } +LLAssetType::EType LLFolderBridge::getPreferredType() const +{ + LLAssetType::EType preferred_type = LLAssetType::AT_NONE; + LLViewerInventoryCategory* cat = getCategory(); + if(cat) + { + preferred_type = cat->getPreferredType(); + } + + return preferred_type; +} + // Icons for folders are based on the preferred type LLUIImagePtr LLFolderBridge::getIcon() const { @@ -1744,6 +1769,10 @@ LLUIImagePtr LLFolderBridge::getIcon() const case LLAssetType::AT_GESTURE: control = "inv_folder_gesture.tga"; break; + case LLAssetType::AT_FAVORITE: + //TODO - need icon + control = "inv_folder_plain_closed.tga"; + break; default: control = "inv_folder_plain_closed.tga"; break; @@ -1753,9 +1782,11 @@ LLUIImagePtr LLFolderBridge::getIcon() const BOOL LLFolderBridge::renameItem(const std::string& new_name) { - if(!isItemRenameable()) return FALSE; - LLInventoryModel* model = mInventoryPanel->getModel(); - if(!model) return FALSE; + if(!isItemRenameable()) + return FALSE; + LLInventoryModel* model = getInventoryModel(); + if(!model) + return FALSE; LLViewerInventoryCategory* cat = getCategory(); if(cat && (cat->getName() != new_name)) { @@ -1778,7 +1809,7 @@ BOOL LLFolderBridge::removeItem() } // move it to the trash LLPreview::hide(mUUID); - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; LLUUID trash_id; @@ -1822,7 +1853,7 @@ BOOL LLFolderBridge::isClipboardPasteable() const void LLFolderBridge::pasteFromClipboard() { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(model && isClipboardPasteable()) { LLInventoryItem* item = NULL; @@ -1857,9 +1888,7 @@ void LLFolderBridge::folderOptionsMenu() { std::vector<std::string> disabled_items; - // *TODO: Translate - - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return; const LLInventoryCategory* category = model->getCategory(mUUID); @@ -1919,10 +1948,9 @@ BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInv // Flags unused void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { - // *TODO: Translate lldebugs << "LLFolderBridge::buildContextMenu()" << llendl; // std::vector<std::string> disabled_items; - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return; LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); @@ -1952,31 +1980,6 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else if(isAgentInventory()) // do not allow creating in library { - // only mature accounts can create undershirts/underwear - /*if (!gAgent.isTeen()) - { - sub_menu->append(new LLMenuItemCallGL("New Undershirt", - &createNewUndershirt, - NULL, - (void*)this)); - sub_menu->append(new LLMenuItemCallGL("New Underpants", - &createNewUnderpants, - NULL, - (void*)this)); - }*/ - -/* BOOL contains_calling_cards = FALSE; - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t item_array; - - LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); - model->collectDescendentsIf(mUUID, - cat_array, - item_array, - LLInventoryModel::EXCLUDE_TRASH, - is_callingcard); - if(item_array.count() > 0) contains_calling_cards = TRUE; -*/ mItems.push_back(std::string("New Folder")); mItems.push_back(std::string("New Script")); mItems.push_back(std::string("New Note")); @@ -2037,7 +2040,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) BOOL LLFolderBridge::hasChildren() const { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; LLInventoryModel::EHasChildren has_children; has_children = gInventory.categoryHasChildren(mUUID); @@ -2079,7 +2082,7 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, LLViewerInventoryCategory* LLFolderBridge::getCategory() const { LLViewerInventoryCategory* cat = NULL; - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(model) { cat = (LLViewerInventoryCategory*)model->getCategory(mUUID); @@ -2099,7 +2102,8 @@ void LLFolderBridge::createNewCategory(void* user_data) { LLFolderBridge* bridge = (LLFolderBridge*)user_data; if(!bridge) return; - LLInventoryPanel* panel = bridge->mInventoryPanel; + LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(bridge->mInventoryPanel.get()); + if (!panel) return; LLInventoryModel* model = panel->getModel(); if(!model) return; LLUUID id; @@ -2191,7 +2195,7 @@ void LLFolderBridge::createWearable(LLFolderBridge* bridge, EWearableType type) // static void LLFolderBridge::createWearable(LLUUID parent_id, EWearableType type) { - LLWearable* wearable = gWearableList.createNewWearable(type); + LLWearable* wearable = LLWearableList::instance().createNewWearable(type); LLAssetType::EType asset_type = wearable->getAssetType(); LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE; create_inventory_item(gAgent.getID(), gAgent.getSessionID(), @@ -2203,7 +2207,7 @@ void LLFolderBridge::createWearable(LLUUID parent_id, EWearableType type) void LLFolderBridge::modifyOutfit(BOOL append) { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return; LLViewerInventoryCategory* cat = getCategory(); if(!cat) return; @@ -2254,7 +2258,7 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop) { - LLInventoryModel* model = mInventoryPanel->getModel(); + LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; // cannot drag into library @@ -2263,7 +2267,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, return FALSE; } - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if(!avatar) return FALSE; LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); @@ -2294,7 +2298,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { case LLAssetType::AT_CLOTHING: case LLAssetType::AT_BODYPART: - is_movable = !gAgent.isWearingItem(inv_item->getUUID()); + is_movable = !gAgentWearables.isWearingItem(inv_item->getUUID()); break; case LLAssetType::AT_OBJECT: @@ -2320,18 +2324,33 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if (LLInventoryView::getActiveInventory()) { LLInventoryPanel* active_panel = LLInventoryView::getActiveInventory()->getPanel(); - if (active_panel && (mInventoryPanel != active_panel)) + LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); + if (active_panel && (panel != active_panel)) { active_panel->unSelectAll(); } } - // restamp if the move is into the trash. - LLInvFVBridge::changeItemParent( - model, - (LLViewerInventoryItem*)inv_item, - mUUID, - move_is_into_trash); + LLUUID favorites_id = model->findCategoryUUIDForType(LLAssetType::AT_FAVORITE); + if (favorites_id == mUUID) // if target is the favorites folder we use copy + { + copy_inventory_item( + gAgent.getID(), + inv_item->getPermissions().getOwner(), + inv_item->getUUID(), + mUUID, + std::string(), + LLPointer<LLInventoryCallback>(NULL)); + } + else + { + // restamp if the move is into the trash. + LLInvFVBridge::changeItemParent( + model, + (LLViewerInventoryItem*)inv_item, + mUUID, + move_is_into_trash); + } } } else if(LLToolDragAndDrop::SOURCE_WORLD == source) @@ -2380,7 +2399,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, else { LLNotification::Params params("MoveInventoryFromObject"); - params.functor(boost::bind(move_task_inventory_callback, _1, _2, move_inv)); + params.functor.function(boost::bind(move_task_inventory_callback, _1, _2, move_inv)); LLNotifications::instance().forceResponse(params, 0); } } @@ -2433,49 +2452,18 @@ LLUIImagePtr LLScriptBridge::getIcon() const // | LLTextureBridge | // +=================================================+ -std::string LLTextureBridge::sPrefix("Texture: "); - - LLUIImagePtr LLTextureBridge::getIcon() const { return get_item_icon(LLAssetType::AT_TEXTURE, mInvType, 0, FALSE); } -void open_texture(const LLUUID& item_id, - const std::string& title, - BOOL show_keep_discard, - const LLUUID& source_id, - BOOL take_focus) -{ - // See if we can bring an exiting preview to the front - if( !LLPreview::show( item_id, take_focus ) ) - { - // There isn't one, so make a new preview - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("PreviewTextureRect"); - rect.translate( left - rect.mLeft, top - rect.mTop ); - - LLPreviewTexture* preview; - preview = new LLPreviewTexture("preview texture", - rect, - title, - item_id, - LLUUID::null, - show_keep_discard); - preview->setSourceID(source_id); - if(take_focus) preview->setFocus(TRUE); - - gFloaterView->adjustToFitScreen(preview, FALSE); - } -} - void LLTextureBridge::openItem() { LLViewerInventoryItem* item = getItem(); - if(item) + + if (item) { - open_texture(mUUID, getPrefix() + item->getName(), FALSE); + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); } } @@ -2483,9 +2471,6 @@ void LLTextureBridge::openItem() // | LLSoundBridge | // +=================================================+ -std::string LLSoundBridge::sPrefix("Sound: "); - - LLUIImagePtr LLSoundBridge::getIcon() const { return get_item_icon(LLAssetType::AT_SOUND, LLInventoryType::IT_SOUND, 0, FALSE); @@ -2493,6 +2478,13 @@ LLUIImagePtr LLSoundBridge::getIcon() const void LLSoundBridge::openItem() { + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } +/* // Changed this back to the way it USED to work: // only open the preview dialog through the contextual right-click menu // double-click just plays the sound @@ -2503,18 +2495,7 @@ void LLSoundBridge::openItem() openSoundPreview((void*)this); //send_uuid_sound_trigger(item->getAssetUUID(), 1.0); } - -// if(!LLPreview::show(mUUID)) -// { -// S32 left, top; -// gFloaterView->getNewFloaterPosition(&left, &top); -// LLRect rect = gSavedSettings.getRect("PreviewSoundRect"); -// rect.translate(left - rect.mLeft, top - rect.mTop); -// new LLPreviewSound("preview sound", -// rect, -// getPrefix() + getName(), -// mUUID)); -// } +*/ } void LLSoundBridge::previewItem() @@ -2529,20 +2510,7 @@ void LLSoundBridge::previewItem() void LLSoundBridge::openSoundPreview(void* which) { LLSoundBridge *me = (LLSoundBridge *)which; - if(!LLPreview::show(me->mUUID)) - { - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("PreviewSoundRect"); - rect.translate(left - rect.mLeft, top - rect.mTop); - LLPreviewSound* preview = new LLPreviewSound("preview sound", - rect, - me->getPrefix() + me->getName(), - me->mUUID); - preview->setFocus(TRUE); - // Keep entirely onscreen. - gFloaterView->adjustToFitScreen(preview, FALSE); - } + LLFloaterReg::showInstance("preview_sound", LLSD(me->mUUID), TAKE_FOCUS_YES); } void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) @@ -2551,7 +2519,6 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) std::vector<std::string> items; std::vector<std::string> disabled_items; - // *TODO: Translate if(isInTrash()) { items.push_back(std::string("Purge Item")); @@ -2580,8 +2547,6 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // | LLLandmarkBridge | // +=================================================+ -std::string LLLandmarkBridge::sPrefix("Landmark: "); - LLUIImagePtr LLLandmarkBridge::getIcon() const { return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, mVisited, FALSE); @@ -2592,7 +2557,6 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) std::vector<std::string> items; std::vector<std::string> disabled_items; - // *TODO: Translate lldebugs << "LLLandmarkBridge::buildContextMenu()" << llendl; if(isInTrash()) { @@ -2619,6 +2583,20 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } +// Convenience function for the two functions below. +void teleport_via_landmark(const LLUUID& asset_id) +{ + gAgent.teleportViaLandmark( asset_id ); + + // we now automatically track the landmark you're teleporting to + // because you'll probably arrive at a telehub instead + LLFloaterWorldMap* floater_world_map = LLFloaterWorldMap::getInstance(); + if( floater_world_map ) + { + floater_world_map->trackLandmark( asset_id ); + } +} + // virtual void LLLandmarkBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) { @@ -2627,52 +2605,20 @@ void LLLandmarkBridge::performAction(LLFolderView* folder, LLInventoryModel* mod LLViewerInventoryItem* item = getItem(); if(item) { - gAgent.teleportViaLandmark(item->getAssetUUID()); - - // we now automatically track the landmark you're teleporting to - // because you'll probably arrive at a telehub instead - if( gFloaterWorldMap ) - { - gFloaterWorldMap->trackLandmark( item->getAssetUUID() ); - } + teleport_via_landmark(item->getAssetUUID()); } } - if ("about" == action) + else if ("about" == action) { LLViewerInventoryItem* item = getItem(); if(item) { - open_landmark(item, std::string(" ") + getPrefix() + item->getName(), FALSE); + LLFloaterReg::showInstance("preview_landmark", LLSD(item->getUUID()), TAKE_FOCUS_YES); } } - else LLItemBridge::performAction(folder, model, action); -} - -void open_landmark(LLViewerInventoryItem* inv_item, - const std::string& title, - BOOL show_keep_discard, - const LLUUID& source_id, - BOOL take_focus) -{ - // See if we can bring an exiting preview to the front - if( !LLPreview::show( inv_item->getUUID(), take_focus ) ) + else { - // There isn't one, so make a new preview - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("PreviewLandmarkRect"); - rect.translate( left - rect.mLeft, top - rect.mTop ); - - LLPreviewLandmark* preview = new LLPreviewLandmark(title, - rect, - title, - inv_item->getUUID(), - show_keep_discard, - inv_item); - preview->setSourceID(source_id); - if(take_focus) preview->setFocus(TRUE); - // keep onscreen - gFloaterView->adjustToFitScreen(preview, FALSE); + LLItemBridge::performAction(folder, model, action); } } @@ -2683,15 +2629,7 @@ static bool open_landmark_callback(const LLSD& notification, const LLSD& respons LLUUID asset_id = notification["payload"]["asset_id"].asUUID(); if (option == 0) { - // HACK: This is to demonstrate teleport on double click for landmarks - gAgent.teleportViaLandmark( asset_id ); - - // we now automatically track the landmark you're teleporting to - // because you'll probably arrive at a telehub instead - if( gFloaterWorldMap ) - { - gFloaterWorldMap->trackLandmark( asset_id ); - } + teleport_via_landmark(asset_id); } return false; @@ -2702,15 +2640,23 @@ static LLNotificationFunctorRegistration open_landmark_callback_reg("TeleportFro void LLLandmarkBridge::openItem() { LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } +/* + LLViewerInventoryItem* item = getItem(); if( item ) { // Opening (double-clicking) a landmark immediately teleports, // but warns you the first time. - // open_landmark(item, std::string(" ") + getPrefix() + item->getName(), FALSE); + // open_landmark(item); LLSD payload; payload["asset_id"] = item->getAssetUUID(); LLNotifications::instance().add("TeleportFromLandmark", LLSD(), payload); } +*/ } @@ -2726,8 +2672,6 @@ void LLCallingCardObserver::changed(U32 mask) // | LLCallingCardBridge | // +=================================================+ -std::string LLCallingCardBridge::sPrefix("Calling Card: "); - LLCallingCardBridge::LLCallingCardBridge( LLInventoryPanel* inventory, const LLUUID& uuid ) : LLItemBridge(inventory, uuid) { @@ -2743,7 +2687,8 @@ LLCallingCardBridge::~LLCallingCardBridge() void LLCallingCardBridge::refreshFolderViewItem() { - LLFolderViewItem* itemp = mInventoryPanel->getRootFolder()->getItemByID(mUUID); + LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); + LLFolderViewItem* itemp = panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL; if (itemp) { itemp->refresh(); @@ -2759,7 +2704,6 @@ void LLCallingCardBridge::performAction(LLFolderView* folder, LLInventoryModel* if (item && (item->getCreatorUUID() != gAgent.getID()) && (!item->getCreatorUUID().isNull())) { - gIMMgr->setFloaterOpen(TRUE); gIMMgr->addSession(item->getName(), IM_NOTHING_SPECIAL, item->getCreatorUUID()); } } @@ -2769,7 +2713,7 @@ void LLCallingCardBridge::performAction(LLFolderView* folder, LLInventoryModel* if (item && (item->getCreatorUUID() != gAgent.getID()) && (!item->getCreatorUUID().isNull())) { - handle_lure(item->getCreatorUUID()); + LLFriendActions::offerTeleport(item->getCreatorUUID()); } } else LLItemBridge::performAction(folder, model, action); @@ -2802,17 +2746,22 @@ std::string LLCallingCardBridge::getLabelSuffix() const void LLCallingCardBridge::openItem() { LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } +/* + LLViewerInventoryItem* item = getItem(); if(item && !item->getCreatorUUID().isNull()) { - BOOL online; - online = LLAvatarTracker::instance().isBuddyOnline(item->getCreatorUUID()); - LLFloaterAvatarInfo::showFromFriend(item->getCreatorUUID(), online); + LLFriendActions::showProfile(item->getCreatorUUID()); } +*/ } void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { - // *TODO: Translate lldebugs << "LLCallingCardBridge::buildContextMenu()" << llendl; std::vector<std::string> items; std::vector<std::string> disabled_items; @@ -2933,68 +2882,27 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop, // | LLNotecardBridge | // +=================================================+ -std::string LLNotecardBridge::sPrefix("Note: "); - - LLUIImagePtr LLNotecardBridge::getIcon() const { return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE); } -void open_notecard(LLViewerInventoryItem* inv_item, - const std::string& title, - const LLUUID& object_id, - BOOL show_keep_discard, - const LLUUID& source_id, - BOOL take_focus) -{ - // See if we can bring an existing preview to the front - if(!LLPreview::show(inv_item->getUUID(), take_focus)) - { - // There isn't one, so make a new preview - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("NotecardEditorRect"); - rect.translate(left - rect.mLeft, top - rect.mTop); - LLPreviewNotecard* preview; - preview = new LLPreviewNotecard("preview notecard", rect, title, - inv_item->getUUID(), object_id, inv_item->getAssetUUID(), - show_keep_discard, inv_item); - preview->setSourceID(source_id); - if(take_focus) preview->setFocus(TRUE); - // Force to be entirely onscreen. - gFloaterView->adjustToFitScreen(preview, FALSE); - - //if (source_id.notNull()) - //{ - // // look for existing tabbed view for content from same source - // LLPreview* existing_preview = LLPreview::getPreviewForSource(source_id); - // if (existing_preview) - // { - // // found existing preview from this source - // // is it already hosted in a multi-preview window? - // LLMultiPreview* preview_hostp = (LLMultiPreview*)existing_preview->getHost(); - // if (!preview_hostp) - // { - // // create new multipreview if it doesn't exist - // LLMultiPreview* preview_hostp = new LLMultiPreview(existing_preview->getRect()); - // preview_hostp->addFloater(existing_preview); - // } - // // add this preview to existing host - // preview_hostp->addFloater(preview); - // } - //} - } -} - - void LLNotecardBridge::openItem() { LLViewerInventoryItem* item = getItem(); + if (item) { - open_notecard(item, getPrefix() + item->getName(), LLUUID::null, FALSE); + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); } + +/* + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLFloaterReg::showInstance("preview_notecard", LLSD(item->getUUID()), TAKE_FOCUS_YES); + } +*/ } @@ -3002,8 +2910,6 @@ void LLNotecardBridge::openItem() // | LLGestureBridge | // +=================================================+ -std::string LLGestureBridge::sPrefix("Gesture: "); - LLUIImagePtr LLGestureBridge::getIcon() const { return get_item_icon(LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, 0, FALSE); @@ -3066,22 +2972,19 @@ void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* mode void LLGestureBridge::openItem() { LLViewerInventoryItem* item = getItem(); - if (!item) return; - - // See if we can bring an existing preview to the front - if(!LLPreview::show(mUUID)) + + if (item) { - LLUUID item_id = mUUID; - std::string title = getPrefix() + item->getName(); - LLUUID object_id = LLUUID::null; - - // TODO: save the rectangle - LLPreviewGesture* preview = LLPreviewGesture::show(title, item_id, object_id); + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } +/* + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLPreviewGesture* preview = LLPreviewGesture::show(mUUID, LLUUID::null); preview->setFocus(TRUE); - - // Force to be entirely onscreen. - gFloaterView->adjustToFitScreen(preview, FALSE); } +*/ } BOOL LLGestureBridge::removeItem() @@ -3093,7 +2996,6 @@ BOOL LLGestureBridge::removeItem() void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { - // *TODO: Translate lldebugs << "LLGestureBridge::buildContextMenu()" << llendl; std::vector<std::string> items; std::vector<std::string> disabled_items; @@ -3117,15 +3019,6 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Gesture Separator")); items.push_back(std::string("Activate")); items.push_back(std::string("Deactivate")); - - /*menu.append(new LLMenuItemCallGL("Activate", - handleActivateGesture, - enableActivateGesture, - (void*)this)); - menu.append(new LLMenuItemCallGL("Deactivate", - handleDeactivateGesture, - enableDeactivateGesture, - (void*)this));*/ } hideContextEntries(menu, items, disabled_items); } @@ -3134,9 +3027,6 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // | LLAnimationBridge | // +=================================================+ -std::string LLAnimationBridge::sPrefix("Animation: "); - - LLUIImagePtr LLAnimationBridge::getIcon() const { return get_item_icon(LLAssetType::AT_ANIMATION, LLInventoryType::IT_ANIMATION, 0, FALSE); @@ -3144,7 +3034,6 @@ LLUIImagePtr LLAnimationBridge::getIcon() const void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { - // *TODO: Translate std::vector<std::string> items; std::vector<std::string> disabled_items; @@ -3178,32 +3067,18 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // virtual void LLAnimationBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) { - S32 activate = 0; - if ((action == "playworld") || (action == "playlocal")) { - - if ("playworld" == action) activate = 1; - if ("playlocal" == action) activate = 2; - - // See if we can bring an existing preview to the front - if( !LLPreview::show( mUUID ) ) + if (getItem()) { - // There isn't one, so make a new preview - LLViewerInventoryItem* item = getItem(); - if( item ) + LLPreviewAnim::e_activation_type activate = LLPreviewAnim::NONE; + if ("playworld" == action) activate = LLPreviewAnim::PLAY; + if ("playlocal" == action) activate = LLPreviewAnim::AUDITION; + + LLPreviewAnim* preview = LLFloaterReg::showTypedInstance<LLPreviewAnim>("preview_anim", LLSD(mUUID)); + if (preview) { - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("PreviewAnimRect"); - rect.translate( left - rect.mLeft, top - rect.mTop ); - LLPreviewAnim* preview = new LLPreviewAnim("preview anim", - rect, - getPrefix() + item->getName(), - mUUID, - activate); - // Force to be entirely onscreen. - gFloaterView->adjustToFitScreen(preview, FALSE); + preview->activate(activate); } } } @@ -3215,42 +3090,31 @@ void LLAnimationBridge::performAction(LLFolderView* folder, LLInventoryModel* mo void LLAnimationBridge::openItem() { - // See if we can bring an existing preview to the front - if( !LLPreview::show( mUUID ) ) + LLViewerInventoryItem* item = getItem(); + + if (item) { - // There isn't one, so make a new preview - LLViewerInventoryItem* item = getItem(); - if( item ) - { - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("PreviewAnimRect"); - rect.translate( left - rect.mLeft, top - rect.mTop ); - LLPreviewAnim* preview = new LLPreviewAnim("preview anim", - rect, - getPrefix() + item->getName(), - mUUID, - 0); - preview->setFocus(TRUE); - // Force to be entirely onscreen. - gFloaterView->adjustToFitScreen(preview, FALSE); - } + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); } +/* + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLFloaterReg::showInstance("preview_anim", LLSD(mUUID), TAKE_FOCUS_YES); + } +*/ } // +=================================================+ // | LLObjectBridge | // +=================================================+ -// static -std::string LLObjectBridge::sPrefix("Object: "); - // static LLUUID LLObjectBridge::sContextMenuItemID; BOOL LLObjectBridge::isItemRemovable() { - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if(!avatar) return FALSE; if(avatar->isWearingAttachment(mUUID)) return FALSE; return LLInvFVBridge::isItemRemovable(); @@ -3261,8 +3125,6 @@ LLUIImagePtr LLObjectBridge::getIcon() const return get_item_icon(LLAssetType::AT_OBJECT, mInvType, mAttachPt, mIsMultiObject ); } -void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment); - // virtual void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) { @@ -3318,15 +3180,21 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model void LLObjectBridge::openItem() { - /* Disabled -- this preview isn't useful. JC */ - // CP: actually, this code is required - made changes to match LLAnimationBridge::openItem() idiom - // The properties preview is useful, converting to show object properties. - DaveP - LLShowProps::showProperties(mUUID); + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } + + /* + LLFloaterProperties::show(mUUID); + */ } LLFontGL::StyleFlags LLObjectBridge::getLabelStyle() const { - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if( avatar && avatar->isWearingAttachment( mUUID ) ) { return LLFontGL::BOLD; @@ -3339,7 +3207,7 @@ LLFontGL::StyleFlags LLObjectBridge::getLabelStyle() const std::string LLObjectBridge::getLabelSuffix() const { - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if( avatar && avatar->isWearingAttachment( mUUID ) ) { std::string attachment_point_name = avatar->getAttachedPointName(mUUID); @@ -3413,7 +3281,6 @@ static LLNotificationFunctorRegistration confirm_replace_attachment_rez_reg("Rep void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { - // *TODO: Translate std::vector<std::string> items; std::vector<std::string> disabled_items; if(isInTrash()) @@ -3437,7 +3304,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLInventoryItem* item = getItem(); if(item) { - LLVOAvatar *avatarp = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); if( !avatarp ) { return; @@ -3460,35 +3327,36 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLMenuGL* attach_menu = menu.getChildMenuByName("Attach To", TRUE); LLMenuGL* attach_hud_menu = menu.getChildMenuByName("Attach To HUD", TRUE); LLVOAvatar *avatarp = gAgent.getAvatarObject(); - if (attach_menu && (attach_menu->getChildCount() == 0) && - attach_hud_menu && (attach_hud_menu->getChildCount() == 0) && - avatarp) + if (attach_menu + && (attach_menu->getChildCount() == 0) + && attach_hud_menu + && (attach_hud_menu->getChildCount() == 0) + && avatarp) { for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); iter != avatarp->mAttachmentPoints.end(); ) { LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; - LLMenuItemCallGL *new_item; - if (attachment->getIsHUDAttachment()) + LLMenuItemCallGL::Params p; + std::string submenu_name = attachment->getName(); + if (LLTrans::getString(submenu_name) != "") { - attach_hud_menu->append(new_item = new LLMenuItemCallGL(attachment->getName(), - NULL, //&LLObjectBridge::attachToAvatar, - NULL, &attach_label, (void*)attachment)); + p.name = (" ")+LLTrans::getString(submenu_name)+" "; } else { - attach_menu->append(new_item = new LLMenuItemCallGL(attachment->getName(), - NULL, //&LLObjectBridge::attachToAvatar, - NULL, &attach_label, (void*)attachment)); - } - - LLSimpleListener* callback = mInventoryPanel->getListenerByName("Inventory.AttachObject"); - - if (callback) - { - new_item->addListener(callback, "on_click", LLSD(attachment->getName())); + p.name = submenu_name; } + LLSD cbparams; + cbparams["index"] = curiter->first; + cbparams["label"] = attachment->getName(); + p.on_click.function_name = "Inventory.AttachObject"; + p.on_click.parameter = LLSD(attachment->getName()); + p.on_enable.function_name = "Attachment.Label"; + p.on_enable.parameter = cbparams; + LLView* parent = attachment->getIsHUDAttachment() ? attach_hud_menu : attach_menu; + LLUICtrlFactory::create<LLMenuItemCallGL>(p, parent); } } } @@ -3499,10 +3367,12 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) BOOL LLObjectBridge::renameItem(const std::string& new_name) { - if(!isItemRenameable()) return FALSE; - LLPreview::rename(mUUID, getPrefix() + new_name); - LLInventoryModel* model = mInventoryPanel->getModel(); - if(!model) return FALSE; + if(!isItemRenameable()) + return FALSE; + LLPreview::dirty(mUUID); + LLInventoryModel* model = getInventoryModel(); + if(!model) + return FALSE; LLViewerInventoryItem* item = getItem(); if(item && (item->getName() != new_name)) { @@ -3513,7 +3383,7 @@ BOOL LLObjectBridge::renameItem(const std::string& new_name) model->updateItem(new_item); model->notifyObservers(); - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if( avatar ) { LLViewerObject* obj = avatar->getWornAttachment( item->getUUID() ); @@ -3535,8 +3405,6 @@ BOOL LLObjectBridge::renameItem(const std::string& new_name) // | LLLSLTextBridge | // +=================================================+ -std::string LLLSLTextBridge::sPrefix("Script: "); - LLUIImagePtr LLLSLTextBridge::getIcon() const { return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE); @@ -3544,27 +3412,19 @@ LLUIImagePtr LLLSLTextBridge::getIcon() const void LLLSLTextBridge::openItem() { - // See if we can bring an exiting preview to the front - if(!LLPreview::show(mUUID)) + LLViewerInventoryItem* item = getItem(); + + if (item) { - LLViewerInventoryItem* item = getItem(); - if (item) - { - // There isn't one, so make a new preview - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("PreviewScriptRect"); - rect.translate(left - rect.mLeft, top - rect.mTop); - - LLPreviewLSL* preview = new LLPreviewLSL("preview lsl text", - rect, - getPrefix() + item->getName(), - mUUID); - preview->setFocus(TRUE); - // keep onscreen - gFloaterView->adjustToFitScreen(preview, FALSE); - } + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); } + /* + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLFloaterReg::showInstance("preview_script", LLSD(mUUID), TAKE_FOCUS_YES); + } + */ } // +=================================================+ @@ -3579,7 +3439,7 @@ void wear_inventory_item_on_avatar( LLInventoryItem* item ) lldebugs << "wear_inventory_item_on_avatar( " << item->getName() << " )" << llendl; - gWearableList.getAsset(item->getAssetUUID(), + LLWearableList::instance().getAsset(item->getAssetUUID(), item->getName(), item->getType(), LLWearableBridge::onWearOnAvatarArrived, @@ -3587,6 +3447,22 @@ void wear_inventory_item_on_avatar( LLInventoryItem* item ) } } +void wear_add_inventory_item_on_avatar( LLInventoryItem* item ) +{ + if(item) + { + lldebugs << "wear_add_inventory_item_on_avatar( " << item->getName() + << " )" << llendl; + + LLWearableList::instance().getAsset(item->getAssetUUID(), + item->getName(), + item->getType(), + LLWearableBridge::onWearAddOnAvatarArrived, + new LLUUID(item->getUUID())); + } +} + + struct LLFoundData { LLFoundData(const LLUUID& item_id, @@ -3900,30 +3776,18 @@ void wear_inventory_category_on_avatar( LLInventoryCategory* category, BOOL appe lldebugs << "wear_inventory_category_on_avatar( " << category->getName() << " )" << llendl; - LLWearInfo* userdata = new LLWearInfo; - userdata->mAppend = append; - userdata->mCategoryID = category->getUUID(); - if( gFloaterCustomize ) { - gFloaterCustomize->askToSaveIfDirty( - wear_inventory_category_on_avatar_step2, - userdata); + gFloaterCustomize->askToSaveIfDirty(boost::bind(wear_inventory_category_on_avatar_step2, _1, category->getUUID(), append)); } else { - wear_inventory_category_on_avatar_step2( - TRUE, - userdata ); + wear_inventory_category_on_avatar_step2(TRUE, category->getUUID(), append ); } } - -void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) +void wear_inventory_category_on_avatar_step2( BOOL proceed, LLUUID category, BOOL append ) { - LLWearInfo* wear_info = (LLWearInfo*)userdata; - if (!wear_info) return; - // Find all the wearables that are in the category's subtree. lldebugs << "wear_inventory_category_on_avatar_step2()" << llendl; if(proceed) @@ -3931,7 +3795,7 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; LLFindWearables is_wearable; - gInventory.collectDescendentsIf(wear_info->mCategoryID, + gInventory.collectDescendentsIf(category, cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH, @@ -3942,7 +3806,7 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) LLInventoryModel::cat_array_t obj_cat_array; LLInventoryModel::item_array_t obj_item_array; LLIsType is_object( LLAssetType::AT_OBJECT ); - gInventory.collectDescendentsIf(wear_info->mCategoryID, + gInventory.collectDescendentsIf(category, obj_cat_array, obj_item_array, LLInventoryModel::EXCLUDE_TRASH, @@ -3953,7 +3817,7 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) LLInventoryModel::cat_array_t gest_cat_array; LLInventoryModel::item_array_t gest_item_array; LLIsType is_gesture( LLAssetType::AT_GESTURE ); - gInventory.collectDescendentsIf(wear_info->mCategoryID, + gInventory.collectDescendentsIf(category, gest_cat_array, gest_item_array, LLInventoryModel::EXCLUDE_TRASH, @@ -3963,7 +3827,6 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) if( !wearable_count && !obj_count && !gest_count) { LLNotifications::instance().add("CouldNotPutOnOutfit"); - delete wear_info; return; } @@ -3982,7 +3845,7 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) // Update the inventory item labels to reflect the fact // they are active. - LLViewerInventoryCategory* catp = gInventory.getCategory(wear_info->mCategoryID); + LLViewerInventoryCategory* catp = gInventory.getCategory(category); if (catp) { gInventory.updateCategory(catp); @@ -4010,10 +3873,10 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) } for(i = 0; i < wearable_count; ++i) { - gAddToOutfit = wear_info->mAppend; + gAddToOutfit = append; found = found_container.get(i); - gWearableList.getAsset(found->mAssetID, + LLWearableList::instance().getAsset(found->mAssetID, found->mName, found->mAssetType, wear_inventory_category_on_avatar_loop, @@ -4023,10 +3886,10 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) //If not appending and the folder doesn't contain only gestures, take off all attachments. - if (!wear_info->mAppend + if (!append && !(wearable_count == 0 && obj_count == 0 && gest_count > 0) ) { - LLAgent::userRemoveAllAttachments(NULL); + LLAgentWearables::userRemoveAllAttachments(NULL); } if( obj_count > 0 ) @@ -4064,7 +3927,7 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) msg->nextBlockFast(_PREHASH_HeaderData); msg->addUUIDFast(_PREHASH_CompoundMsgID, compound_msg_id ); msg->addU8Fast(_PREHASH_TotalObjects, obj_count ); - msg->addBOOLFast(_PREHASH_FirstDetachAll, !wear_info->mAppend ); + msg->addBOOLFast(_PREHASH_FirstDetachAll, !append ); } LLInventoryItem* item = obj_item_array.get(i); @@ -4085,8 +3948,6 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) } } } - delete wear_info; - wear_info = NULL; } void wear_inventory_category_on_avatar_loop(LLWearable* wearable, void* data) @@ -4135,18 +3996,6 @@ void wear_inventory_category_on_avatar_step3(LLWearableHoldingPattern* holder, B item = (LLViewerInventoryItem*)gInventory.getItem(data->mItemID); if( item && (item->getAssetUUID() == wearable->getID()) ) { - //RN: after discussing with Brashears, I disabled this code - //Metadata should reside in the item, not the asset - //And this code does not handle failed asset uploads properly -// if(!wearable->isMatchedToInventoryItem(item )) -// { -// wearable = gWearableList.createWearableMatchedToInventoryItem( wearable, item ); -// // Now that we have an asset that matches the -// // item, update the item to point to the new -// // asset. -// item->setAssetUUID(wearable->getID()); -// item->updateAssetOnServer(); -// } items.put(item); wearables.put(wearable); } @@ -4157,7 +4006,7 @@ void wear_inventory_category_on_avatar_step3(LLWearableHoldingPattern* holder, B if(wearables.count() > 0) { - gAgent.setWearableOutfit(items, wearables, !append); + gAgentWearables.setWearableOutfit(items, wearables, !append); gInventory.notifyObservers(); } @@ -4173,36 +4022,29 @@ void remove_inventory_category_from_avatar( LLInventoryCategory* category ) << " )" << llendl; - LLUUID* uuid = new LLUUID(category->getUUID()); - if( gFloaterCustomize ) { gFloaterCustomize->askToSaveIfDirty( - remove_inventory_category_from_avatar_step2, - uuid); + boost::bind(remove_inventory_category_from_avatar_step2, _1, category->getUUID())); } else { - remove_inventory_category_from_avatar_step2( - TRUE, - uuid ); + remove_inventory_category_from_avatar_step2(TRUE, category->getUUID() ); } } -void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata) +void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_id) { // Find all the wearables that are in the category's subtree. - LLUUID* category_id = (LLUUID *)userdata; - lldebugs << "remove_inventory_category_from_avatar_step2()" << llendl; if(proceed) { LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; LLFindWearables is_wearable; - gInventory.collectDescendentsIf(*category_id, + gInventory.collectDescendentsIf(category_id, cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH, @@ -4213,7 +4055,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata) LLInventoryModel::cat_array_t obj_cat_array; LLInventoryModel::item_array_t obj_item_array; LLIsType is_object( LLAssetType::AT_OBJECT ); - gInventory.collectDescendentsIf(*category_id, + gInventory.collectDescendentsIf(category_id, obj_cat_array, obj_item_array, LLInventoryModel::EXCLUDE_TRASH, @@ -4224,7 +4066,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata) LLInventoryModel::cat_array_t gest_cat_array; LLInventoryModel::item_array_t gest_item_array; LLIsType is_gesture( LLAssetType::AT_GESTURE ); - gInventory.collectDescendentsIf(*category_id, + gInventory.collectDescendentsIf(category_id, gest_cat_array, gest_item_array, LLInventoryModel::EXCLUDE_TRASH, @@ -4235,9 +4077,9 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata) { for(i = 0; i < wearable_count; ++i) { - if( gAgent.isWearingItem (item_array.get(i)->getUUID()) ) + if( gAgentWearables.isWearingItem (item_array.get(i)->getUUID()) ) { - gWearableList.getAsset(item_array.get(i)->getAssetUUID(), + LLWearableList::instance().getAsset(item_array.get(i)->getAssetUUID(), item_array.get(i)->getName(), item_array.get(i)->getType(), LLWearableBridge::onRemoveFromAvatarArrived, @@ -4286,28 +4128,26 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata) } } } - delete category_id; - category_id = NULL; } BOOL LLWearableBridge::renameItem(const std::string& new_name) { - if( gAgent.isWearingItem( mUUID ) ) + if( gAgentWearables.isWearingItem( mUUID ) ) { - gAgent.setWearableName( mUUID, new_name ); + gAgentWearables.setWearableName( mUUID, new_name ); } return LLItemBridge::renameItem(new_name); } BOOL LLWearableBridge::isItemRemovable() { - if(gAgent.isWearingItem(mUUID)) return FALSE; + if(gAgentWearables.isWearingItem(mUUID)) return FALSE; return LLInvFVBridge::isItemRemovable(); } LLFontGL::StyleFlags LLWearableBridge::getLabelStyle() const { - if( gAgent.isWearingItem( mUUID ) ) + if( gAgentWearables.isWearingItem( mUUID ) ) { // llinfos << "BOLD" << llendl; return LLFontGL::BOLD; @@ -4320,7 +4160,7 @@ LLFontGL::StyleFlags LLWearableBridge::getLabelStyle() const std::string LLWearableBridge::getLabelSuffix() const { - if( gAgent.isWearingItem( mUUID ) ) + if( gAgentWearables.isWearingItem( mUUID ) ) { return LLItemBridge::getLabelSuffix() + " (worn)"; } @@ -4342,6 +4182,10 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod { wearOnAvatar(); } + else if ("wear_add" == action) + { + wearAddOnAvatar(); + } else if ("edit" == action) { editOnAvatar(); @@ -4349,12 +4193,12 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod } else if ("take_off" == action) { - if(gAgent.isWearingItem(mUUID)) + if(gAgentWearables.isWearingItem(mUUID)) { LLViewerInventoryItem* item = getItem(); if (item) { - gWearableList.getAsset(item->getAssetUUID(), + LLWearableList::instance().getAsset(item->getAssetUUID(), item->getName(), item->getType(), LLWearableBridge::onRemoveFromAvatarArrived, @@ -4367,13 +4211,20 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod void LLWearableBridge::openItem() { + LLViewerInventoryItem* item = getItem(); + + if (item) + { + LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); + } + /* if( isInTrash() ) { LLNotifications::instance().add("CannotWearTrash"); } else if(isAgentInventory()) { - if( !gAgent.isWearingItem( mUUID ) ) + if( !gAgentWearables.isWearingItem( mUUID ) ) { wearOnAvatar(); } @@ -4401,11 +4252,11 @@ void LLWearableBridge::openItem() LLNotifications::instance().add("CannotWearInfoNotComplete"); } } + */ } void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { - // *TODO: Translate lldebugs << "LLWearableBridge::buildContextMenu()" << llendl; std::vector<std::string> items; std::vector<std::string> disabled_items; @@ -4442,29 +4293,17 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Wearable Separator")); items.push_back(std::string("Wearable Wear")); + items.push_back(std::string("Wearable Add")); items.push_back(std::string("Wearable Edit")); if ((flags & FIRST_SELECTED_ITEM) == 0) { disabled_items.push_back(std::string("Wearable Edit")); } - //menu.appendSeparator(); - //menu.append(new LLMenuItemCallGL("Wear", - // LLWearableBridge::onWearOnAvatar, - // LLWearableBridge::canWearOnAvatar, - // (void*)this)); - //menu.append(new LLMenuItemCallGL("Edit", - // LLWearableBridge::onEditOnAvatar, - // LLWearableBridge::canEditOnAvatar, - // (void*)this)); if( item && (item->getType() == LLAssetType::AT_CLOTHING) ) { items.push_back(std::string("Take Off")); - /*menu.append(new LLMenuItemCallGL("Take Off", - LLWearableBridge::onRemoveFromAvatar, - LLWearableBridge::canRemoveFromAvatar, - (void*)this));*/ } } hideContextEntries(menu, items, disabled_items); @@ -4481,7 +4320,7 @@ BOOL LLWearableBridge::canWearOnAvatar(void* user_data) LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->getItem(); if(!item || !item->isComplete()) return FALSE; } - return (!gAgent.isWearingItem(self->mUUID)); + return (!gAgentWearables.isWearingItem(self->mUUID)); } // Called from menus @@ -4497,7 +4336,7 @@ void LLWearableBridge::wearOnAvatar() { // Don't wear anything until initial wearables are loaded, can // destroy clothing items. - if (!gAgent.areWearablesLoaded()) + if (!gAgentWearables.areWearablesLoaded()) { LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); return; @@ -4524,6 +4363,37 @@ void LLWearableBridge::wearOnAvatar() } } +void LLWearableBridge::wearAddOnAvatar() +{ + // Don't wear anything until initial wearables are loaded, can + // destroy clothing items. + if (!gAgentWearables.areWearablesLoaded()) + { + LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); + return; + } + + LLViewerInventoryItem* item = getItem(); + if(item) + { + if(!isAgentInventory()) + { + LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback(); + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + LLUUID::null, + std::string(), + cb); + } + else + { + wear_add_inventory_item_on_avatar(item); + } + } +} + // static void LLWearableBridge::onWearOnAvatarArrived( LLWearable* wearable, void* userdata ) { @@ -4536,22 +4406,33 @@ void LLWearableBridge::onWearOnAvatarArrived( LLWearable* wearable, void* userda { if(item->getAssetUUID() == wearable->getID()) { - //RN: after discussing with Brashears, I disabled this code - //Metadata should reside in the item, not the asset - //And this code does not handle failed asset uploads properly + gAgentWearables.setWearable(item, wearable); + gInventory.notifyObservers(); + //self->getFolderItem()->refreshFromRoot(); + } + else + { + llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl; + } + } + } + delete item_id; +} -// if(!wearable->isMatchedToInventoryItem(item)) -// { -// LLWearable* new_wearable = gWearableList.createWearableMatchedToInventoryItem( wearable, item ); -// -// // Now that we have an asset that matches the -// // item, update the item to point to the new -// // asset. -// item->setAssetUUID(new_wearable->getID()); -// item->updateAssetOnServer(); -// wearable = new_wearable; -// } - gAgent.setWearable(item, wearable); +// static +void LLWearableBridge::onWearAddOnAvatarArrived( LLWearable* wearable, void* userdata ) +{ + LLUUID* item_id = (LLUUID*) userdata; + if(wearable) + { + LLViewerInventoryItem* item = NULL; + item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); + if(item) + { + if(item->getAssetUUID() == wearable->getID()) + { + bool do_append = true; + gAgentWearables.setWearable(item, wearable, do_append); gInventory.notifyObservers(); //self->getFolderItem()->refreshFromRoot(); } @@ -4570,7 +4451,7 @@ BOOL LLWearableBridge::canEditOnAvatar(void* user_data) LLWearableBridge* self = (LLWearableBridge*)user_data; if(!self) return FALSE; - return (gAgent.isWearingItem(self->mUUID)); + return (gAgentWearables.isWearingItem(self->mUUID)); } // static @@ -4585,11 +4466,12 @@ void LLWearableBridge::onEditOnAvatar(void* user_data) void LLWearableBridge::editOnAvatar() { - LLWearable* wearable = gAgent.getWearableFromWearableItem(mUUID); + LLWearable* wearable = gAgentWearables.getWearableFromWearableItem(mUUID); if( wearable ) { // Set the tab to the right wearable. - LLFloaterCustomize::setCurrentWearableType( wearable->getType() ); + if (gFloaterCustomize) + gFloaterCustomize->setCurrentWearableType( wearable->getType() ); if( CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() ) { @@ -4605,7 +4487,7 @@ BOOL LLWearableBridge::canRemoveFromAvatar(void* user_data) LLWearableBridge* self = (LLWearableBridge*)user_data; if( self && (LLAssetType::AT_BODYPART != self->mAssetType) ) { - return gAgent.isWearingItem( self->mUUID ); + return gAgentWearables.isWearingItem( self->mUUID ); } return FALSE; } @@ -4615,12 +4497,12 @@ void LLWearableBridge::onRemoveFromAvatar(void* user_data) { LLWearableBridge* self = (LLWearableBridge*)user_data; if(!self) return; - if(gAgent.isWearingItem(self->mUUID)) + if(gAgentWearables.isWearingItem(self->mUUID)) { LLViewerInventoryItem* item = self->getItem(); if (item) { - gWearableList.getAsset(item->getAssetUUID(), + LLWearableList::instance().getAsset(item->getAssetUUID(), item->getName(), item->getType(), onRemoveFromAvatarArrived, @@ -4636,16 +4518,304 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, LLUUID* item_id = (LLUUID*) userdata; if(wearable) { - if( gAgent.isWearingItem( *item_id ) ) + if( gAgentWearables.isWearingItem( *item_id ) ) { EWearableType type = wearable->getType(); if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES ) ) //&& //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) { - gAgent.removeWearable( type ); + // MULTI_WEARABLE: FIXME HACK - always remove all + bool do_remove_all = false; + gAgentWearables.removeWearable( type, do_remove_all, 0 ); } } } delete item_id; } + + +LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_type, + const LLUUID& uuid,LLInventoryModel* model) +{ + LLInvFVBridgeAction* action = NULL; + switch(asset_type) + { + case LLAssetType::AT_TEXTURE: + action = new LLTextureBridgeAction(uuid,model); + break; + + case LLAssetType::AT_SOUND: + action = new LLSoundBridgeAction(uuid,model); + break; + + case LLAssetType::AT_LANDMARK: + action = new LLLandmarkBridgeAction(uuid,model); + break; + + case LLAssetType::AT_CALLINGCARD: + action = new LLCallingCardBridgeAction(uuid,model); + break; + + case LLAssetType::AT_OBJECT: + action = new LLObjectBridgeAction(uuid,model); + break; + + case LLAssetType::AT_NOTECARD: + action = new LLNotecardBridgeAction(uuid,model); + break; + + case LLAssetType::AT_ANIMATION: + action = new LLAnimationBridgeAction(uuid,model); + break; + + case LLAssetType::AT_GESTURE: + action = new LLGestureBridgeAction(uuid,model); + break; + + case LLAssetType::AT_LSL_TEXT: + action = new LLLSLTextBridgeAction(uuid,model); + break; + + case LLAssetType::AT_CLOTHING: + case LLAssetType::AT_BODYPART: + action = new LLWearableBridgeAction(uuid,model); + + break; + + default: + break; + } + return action; +} + +//static +void LLInvFVBridgeAction::doAction(LLAssetType::EType asset_type, + const LLUUID& uuid,LLInventoryModel* model) +{ + LLInvFVBridgeAction* action = createAction(asset_type,uuid,model); + if(action) + { + action->doIt(); + delete action; + } +} + +//static +void LLInvFVBridgeAction::doAction(const LLUUID& uuid, LLInventoryModel* model) +{ + LLAssetType::EType asset_type = model->getItem(uuid)->getType(); + LLInvFVBridgeAction* action = createAction(asset_type,uuid,model); + if(action) + { + action->doIt(); + delete action; + } +} + +LLViewerInventoryItem* LLInvFVBridgeAction::getItem() const +{ + if(mModel) + return (LLViewerInventoryItem*)mModel->getItem(mUUID); + return NULL; +} + +//virtual +void LLTextureBridgeAction::doIt() +{ + if (getItem()) + { + LLFloaterReg::showInstance("preview_texture", LLSD(mUUID), TAKE_FOCUS_YES); + } + + LLInvFVBridgeAction::doIt(); +} + +//virtual +void LLSoundBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if(item) + { + LLFloaterReg::showInstance("preview_sound", LLSD(mUUID), TAKE_FOCUS_YES); + } + + LLInvFVBridgeAction::doIt(); +} + + +//virtual +void LLLandmarkBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if( item ) + { + // Opening (double-clicking) a landmark immediately teleports, + // but warns you the first time. + LLSD payload; + payload["asset_id"] = item->getAssetUUID(); + LLNotifications::instance().add("TeleportFromLandmark", LLSD(), payload); + } + + LLInvFVBridgeAction::doIt(); +} + + +//virtual +void LLCallingCardBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if(item && item->getCreatorUUID().notNull()) + { + LLFriendActions::showProfile(item->getCreatorUUID()); + } + + LLInvFVBridgeAction::doIt(); +} + +//virtual +void +LLNotecardBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLFloaterReg::showInstance("preview_notecard", LLSD(item->getUUID()), TAKE_FOCUS_YES); + } + + LLInvFVBridgeAction::doIt(); +} + +//virtual +void LLGestureBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLPreviewGesture* preview = LLPreviewGesture::show(mUUID, LLUUID::null); + preview->setFocus(TRUE); + } + + LLInvFVBridgeAction::doIt(); +} + +//virtual +void LLAnimationBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLFloaterReg::showInstance("preview_anim", LLSD(mUUID), TAKE_FOCUS_YES); + } + + LLInvFVBridgeAction::doIt(); +} + + +//virtual +void LLObjectBridgeAction::doIt() +{ + LLFloaterProperties::show(mUUID); + + LLInvFVBridgeAction::doIt(); +} + + +//virtual +void LLLSLTextBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if (item) + { + LLFloaterReg::showInstance("preview_script", LLSD(mUUID), TAKE_FOCUS_YES); + } + + LLInvFVBridgeAction::doIt(); +} + + +BOOL LLWearableBridgeAction::isInTrash() const +{ + if(!mModel) return FALSE; + LLUUID trash_id = mModel->findCategoryUUIDForType(LLAssetType::AT_TRASH); + return mModel->isObjectDescendentOf(mUUID, trash_id); +} + +BOOL LLWearableBridgeAction::isAgentInventory() const +{ + if(!mModel) return FALSE; + if(gAgent.getInventoryRootID() == mUUID) return TRUE; + return mModel->isObjectDescendentOf(mUUID, gAgent.getInventoryRootID()); +} + +void LLWearableBridgeAction::wearOnAvatar() +{ + // Don't wear anything until initial wearables are loaded, can + // destroy clothing items. + if (!gAgentWearables.areWearablesLoaded()) + { + LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); + return; + } + + LLViewerInventoryItem* item = getItem(); + if(item) + { + if(!isAgentInventory()) + { + LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback(); + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + LLUUID::null, + std::string(), + cb); + } + else + { + wear_inventory_item_on_avatar(item); + } + } +} + +//virtual +void LLWearableBridgeAction::doIt() +{ + if( isInTrash() ) + { + LLNotifications::instance().add("CannotWearTrash"); + } + else if(isAgentInventory()) + { + if( !gAgentWearables.isWearingItem( mUUID ) ) + { + wearOnAvatar(); + } + } + else + { + // must be in the inventory library. copy it to our inventory + // and put it on right away. + LLViewerInventoryItem* item = getItem(); + if(item && item->isComplete()) + { + LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback(); + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + LLUUID::null, + std::string(), + cb); + } + else if(item) + { + // *TODO: We should fetch the item details, and then do + // the operation above. + LLNotifications::instance().add("CannotWearInfoNotComplete"); + } + } + + LLInvFVBridgeAction::doIt(); +} diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 526b30f2149a39d6e269af2b7332a800e8386184..3958f7e9c208e910d7c345f7bf1cd3fcd6ca4ba6 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -30,10 +30,15 @@ * $/LicenseInfo$ */ +#ifndef LL_LLINVENTORYBRIDGE_H +#define LL_LLINVENTORYBRIDGE_H + #include "llfloaterproperties.h" #include "llwearable.h" #include "llviewercontrol.h" #include "llcallingcard.h" +#include "llinventorymodel.h" +#include "llinventoryview.h" enum EInventoryIcon { @@ -64,6 +69,8 @@ enum EInventoryIcon CLOTHING_UNDERSHIRT_ICON_NAME, CLOTHING_UNDERPANTS_ICON_NAME, CLOTHING_SKIRT_ICON_NAME, + CLOTHING_ALPHA_ICON_NAME, + CLOTHING_TATTOO_ICON_NAME, ANIMATION_ICON_NAME, GESTURE_ICON_NAME, @@ -93,31 +100,6 @@ struct LLAttachmentRezAction }; -//helper functions -class LLShowProps -{ -public: - - static void showProperties(const LLUUID& uuid) - { - if(!LLFloaterProperties::show(uuid, LLUUID::null)) - { - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("PropertiesRect"); - rect.translate( left - rect.mLeft, top - rect.mTop ); - LLFloaterProperties* floater; - floater = new LLFloaterProperties("item properties", - rect, - "Inventory Item Properties", - uuid, - LLUUID::null); - // keep onscreen - gFloaterView->adjustToFitScreen(floater, FALSE); - } - } -}; - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryPanelObserver // @@ -158,7 +140,6 @@ public: virtual const LLUUID& getUUID() const { return mUUID; } - virtual const std::string& getPrefix() { return LLStringUtil::null; } virtual void restoreItem() {} virtual void restoreToWorld() {} @@ -201,9 +182,14 @@ public: protected: LLInvFVBridge(LLInventoryPanel* inventory, const LLUUID& uuid) : - mInventoryPanel(inventory), mUUID(uuid), mInvType(LLInventoryType::IT_NONE) {} + mUUID(uuid), mInvType(LLInventoryType::IT_NONE) + { + mInventoryPanel = inventory->getHandle(); + } LLInventoryObject* getInventoryObject() const; + LLInventoryModel* getInventoryModel() const; + BOOL isInTrash() const; // return true if the item is in agent inventory. if false, it // must be lost or in the inventory library. @@ -218,9 +204,9 @@ protected: const LLUUID& new_parent, BOOL restamp); void removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*>& batch); - + protected: - LLInventoryPanel* mInventoryPanel; + LLHandle<LLPanel> mInventoryPanel; LLUUID mUUID; // item id LLInventoryType::EType mInvType; }; @@ -277,6 +263,7 @@ public: virtual void selectItem(); virtual void restoreItem(); + virtual LLAssetType::EType getPreferredType() const; virtual LLUIImagePtr getIcon() const; virtual BOOL renameItem(const std::string& new_name); virtual BOOL removeItem(); @@ -351,15 +338,12 @@ class LLTextureBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual const std::string& getPrefix() { return sPrefix; } - virtual LLUIImagePtr getIcon() const; virtual void openItem(); protected: LLTextureBridge(LLInventoryPanel* inventory, const LLUUID& uuid, LLInventoryType::EType type) : LLItemBridge(inventory, uuid), mInvType(type) {} - static std::string sPrefix; LLInventoryType::EType mInvType; }; @@ -367,8 +351,6 @@ class LLSoundBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual const std::string& getPrefix() { return sPrefix; } - virtual LLUIImagePtr getIcon() const; virtual void openItem(); virtual void previewItem(); @@ -378,15 +360,12 @@ public: protected: LLSoundBridge(LLInventoryPanel* inventory, const LLUUID& uuid) : LLItemBridge(inventory, uuid) {} - static std::string sPrefix; }; class LLLandmarkBridge : public LLItemBridge { friend class LLInvFVBridge; public: - static const std::string& prefix() { return sPrefix; } - virtual const std::string& getPrefix() { return sPrefix; } virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual LLUIImagePtr getIcon() const; @@ -404,7 +383,6 @@ protected: } protected: - static std::string sPrefix; BOOL mVisited; }; @@ -425,8 +403,6 @@ class LLCallingCardBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual const std::string& getPrefix() { return sPrefix; } - virtual std::string getLabelSuffix() const; //virtual const std::string& getDisplayName() const; virtual LLUIImagePtr getIcon() const; @@ -445,7 +421,6 @@ protected: ~LLCallingCardBridge(); protected: - static std::string sPrefix; LLCallingCardObserver* mObserver; }; @@ -454,25 +429,18 @@ class LLNotecardBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual const std::string& getPrefix() { return sPrefix; } - virtual LLUIImagePtr getIcon() const; virtual void openItem(); protected: LLNotecardBridge(LLInventoryPanel* inventory, const LLUUID& uuid) : LLItemBridge(inventory, uuid) {} - -protected: - static std::string sPrefix; }; class LLGestureBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual const std::string& getPrefix() { return sPrefix; } - virtual LLUIImagePtr getIcon() const; // Only suffix for gesture items, not task items, because only @@ -489,9 +457,6 @@ public: protected: LLGestureBridge(LLInventoryPanel* inventory, const LLUUID& uuid) : LLItemBridge(inventory, uuid) {} - -protected: - static std::string sPrefix; }; @@ -499,7 +464,6 @@ class LLAnimationBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual const std::string& getPrefix() { return sPrefix; } virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); @@ -509,9 +473,6 @@ public: protected: LLAnimationBridge(LLInventoryPanel* inventory, const LLUUID& uuid) : LLItemBridge(inventory, uuid) {} - -protected: - static std::string sPrefix; }; @@ -519,8 +480,6 @@ class LLObjectBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual const std::string& getPrefix() { return sPrefix; } - virtual LLUIImagePtr getIcon() const; virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action); virtual void openItem(); @@ -540,7 +499,6 @@ protected: } protected: - static std::string sPrefix; static LLUUID sContextMenuItemID; // Only valid while the context menu is open. LLInventoryType::EType mInvType; U32 mAttachPt; @@ -552,17 +510,12 @@ class LLLSLTextBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual const std::string& getPrefix() { return sPrefix; } - virtual LLUIImagePtr getIcon() const; virtual void openItem(); protected: LLLSLTextBridge( LLInventoryPanel* inventory, const LLUUID& uuid ) : LLItemBridge(inventory, uuid) {} - -protected: - static std::string sPrefix; }; @@ -584,6 +537,9 @@ public: static void onWearOnAvatarArrived( LLWearable* wearable, void* userdata ); void wearOnAvatar(); + static void onWearAddOnAvatarArrived( LLWearable* wearable, void* userdata ); + void wearAddOnAvatar(); + static BOOL canEditOnAvatar( void* userdata ); // Access to editOnAvatar() from menu static void onEditOnAvatar( void* userdata ); void editOnAvatar(); @@ -605,3 +561,183 @@ protected: LLInventoryType::EType mInvType; EWearableType mWearableType; }; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInvFVBridgeAction (& it's derived classes) +// +// This is an implementation class to be able to +// perform action to view inventory items. +// +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLInvFVBridgeAction +{ +public: + // This method is a convenience function which creates the correct + // type of bridge action based on some basic information + static LLInvFVBridgeAction* createAction(LLAssetType::EType asset_type, + const LLUUID& uuid,LLInventoryModel* model); + + static void doAction(LLAssetType::EType asset_type, + const LLUUID& uuid, LLInventoryModel* model); + static void doAction(const LLUUID& uuid, LLInventoryModel* model); + + virtual void doIt() { }; + virtual ~LLInvFVBridgeAction(){}//need this because of warning on OSX +protected: + LLInvFVBridgeAction(const LLUUID& id,LLInventoryModel* model):mUUID(id),mModel(model){} + + LLViewerInventoryItem* getItem() const; +protected: + const LLUUID& mUUID; // item id + LLInventoryModel* mModel; + +}; + + + +class LLTextureBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLTextureBridgeAction(){} +protected: + LLTextureBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLSoundBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLSoundBridgeAction(){} +protected: + LLSoundBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLLandmarkBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLLandmarkBridgeAction(){} +protected: + LLLandmarkBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLCallingCardBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLCallingCardBridgeAction(){} +protected: + LLCallingCardBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLNotecardBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLNotecardBridgeAction(){} +protected: + LLNotecardBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLGestureBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLGestureBridgeAction(){} +protected: + LLGestureBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLAnimationBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLAnimationBridgeAction(){} +protected: + LLAnimationBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLObjectBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLObjectBridgeAction(){} +protected: + LLObjectBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLLSLTextBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLLSLTextBridgeAction(){} +protected: + LLLSLTextBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLWearableBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt(); + virtual ~LLWearableBridgeAction(){} +protected: + LLWearableBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + + + BOOL isInTrash() const; + // return true if the item is in agent inventory. if false, it + // must be lost or in the inventory library. + BOOL isAgentInventory() const; + + void wearOnAvatar(); + +}; + +void wear_inventory_item_on_avatar(LLInventoryItem* item); +void wear_outfit_by_name(const std::string& name); +void wear_inventory_category(LLInventoryCategory* category, bool copy, bool append); + +void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment); + +// Move items from an in-world object's "Contents" folder to a specified +// folder in agent inventory. +BOOL move_inv_category_world_to_agent(const LLUUID& object_id, + const LLUUID& category_id, + BOOL drop, + void (*callback)(S32, void*) = NULL, + void* user_data = NULL); + + + +void teleport_via_landmark(const LLUUID& asset_id); + +#endif // LL_LLINVENTORYBRIDGE_H diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index f98a3f9ee51d4e0cf99159aca5a8a5e8b5d539e6..9177d51d5c2088919d9c7419f303e6005d94c7de 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -42,8 +42,10 @@ #include "message.h" #include "llagent.h" +#include "llagentwearables.h" #include "llfloater.h" #include "llfocusmgr.h" +#include "llinventorybridge.h" #include "llinventoryview.h" #include "llviewerinventory.h" #include "llviewermessage.h" @@ -53,11 +55,11 @@ #include "lldbstrings.h" #include "llviewerstats.h" #include "llmutelist.h" -#include "llnotify.h" +#include "llnotifications.h" #include "llcallbacklist.h" #include "llpreview.h" #include "llviewercontrol.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llsdutil.h" #include <deque> @@ -87,33 +89,6 @@ static std::deque<LLUUID> sFetchQueue; const F32 MAX_TIME_FOR_SINGLE_FETCH = 10.f; const S32 MAX_FETCH_RETRIES = 10; const char CACHE_FORMAT_STRING[] = "%s.inv"; -const char* NEW_CATEGORY_NAME = "New Folder"; -const char* NEW_CATEGORY_NAMES[LLAssetType::AT_COUNT] = -{ - "Textures", // AT_TEXTURE - "Sounds", // AT_SOUND - "Calling Cards", // AT_CALLINGCARD - "Landmarks", // AT_LANDMARK - "Scripts", // AT_SCRIPT (deprecated?) - "Clothing", // AT_CLOTHING - "Objects", // AT_OBJECT - "Notecards", // AT_NOTECARD - "New Folder", // AT_CATEGORY - "Inventory", // AT_ROOT_CATEGORY - "Scripts", // AT_LSL_TEXT - "Scripts", // AT_LSL_BYTECODE - "Uncompressed Images", // AT_TEXTURE_TGA - "Body Parts", // AT_BODYPART - "Trash", // AT_TRASH - "Photo Album", // AT_SNAPSHOT_CATEGORY - "Lost And Found", // AT_LOST_AND_FOUND - "Uncompressed Sounds", // AT_SOUND_WAV - "Uncompressed Images", // AT_IMAGE_TGA - "Uncompressed Images", // AT_IMAGE_JPEG - "Animations", // AT_ANIMATION - "Gestures", // AT_GESTURE - "New Folder" // AT_SIMSTATE -}; struct InventoryIDPtrLess { @@ -388,14 +363,9 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, { name.assign(pname); } - else if((preferred_type >= LLAssetType::AT_TEXTURE) && - (preferred_type < LLAssetType::AT_SIMSTATE)) - { - name.assign(NEW_CATEGORY_NAMES[preferred_type]); - } else { - name.assign(NEW_CATEGORY_NAME); + name.assign(LLAssetType::lookupCategoryName(preferred_type)); } // Add the category to the internal representation @@ -545,7 +515,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item) LLViewerInventoryItem* old_item = getItem(item->getUUID()); if(old_item) { - // We already have an old item, modify it's values + // We already have an old item, modify its values LLUUID old_parent_id = old_item->getParentUUID(); LLUUID new_parent_id = item->getParentUUID(); if(old_parent_id != new_parent_id) @@ -1042,7 +1012,7 @@ void LLInventoryModel::mock(const LLUUID& root_id) root_id, LLUUID::null, LLAssetType::AT_CATEGORY, - NEW_CATEGORY_NAMES[LLAssetType::AT_ROOT_CATEGORY], + LLAssetType::lookupCategoryName(LLAssetType::AT_ROOT_CATEGORY), gAgent.getID()); addCategory(cat); gInventory.buildParentChildMap(); @@ -3158,6 +3128,63 @@ void LLInventoryModel::processMoveInventoryItem(LLMessageSystem* msg, void**) } } +//---------------------------------------------------------------------------- + +// Trash: LLAssetType::AT_TRASH, "ConfirmEmptyTrash" +// Lost&Found: LLAssetType::AT_LOST_AND_FOUND, "ConfirmEmptyLostAndFound" + +bool LLInventoryModel::callbackEmptyFolderType(const LLSD& notification, const LLSD& response, LLAssetType::EType folder_type) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + if (option == 0) // YES + { + LLUUID folder_id = findCategoryUUIDForType(folder_type); + purgeDescendentsOf(folder_id); + notifyObservers(); + } + return false; +} + +void LLInventoryModel::emptyFolderType(const std::string notification, LLAssetType::EType folder_type) +{ + if (!notification.empty()) + { + LLNotifications::instance().add(notification, LLSD(), LLSD(), + boost::bind(&LLInventoryModel::callbackEmptyFolderType, this, _1, _2, folder_type)); + } + else + { + LLUUID folder_id = findCategoryUUIDForType(folder_type); + purgeDescendentsOf(folder_id); + notifyObservers(); + } +} + +//---------------------------------------------------------------------------- + +void LLInventoryModel::removeItem(const LLUUID& item_id) +{ + LLViewerInventoryItem* item = getItem(item_id); + const LLUUID& new_parent = findCategoryUUIDForType(LLAssetType::AT_TRASH); + if (item && item->getParentUUID() != new_parent) + { + LLInventoryModel::update_list_t update; + LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1); + update.push_back(old_folder); + LLInventoryModel::LLCategoryUpdate new_folder(new_parent, 1); + update.push_back(new_folder); + accountForUpdate(update); + + LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); + new_item->setParent(new_parent); + new_item->updateParentOnServer(TRUE); + updateItem(new_item); + notifyObservers(); + } +} + +//---------------------------------------------------------------------------- + // *NOTE: DEBUG functionality void LLInventoryModel::dumpInventory() { @@ -3205,7 +3232,7 @@ bool LLInventoryCollectFunctor::itemTransferCommonlyAllowed(LLInventoryItem* ite return false; bool allowed = false; - LLVOAvatar* my_avatar = NULL; + LLVOAvatarSelf* my_avatar = NULL; switch(item->getType()) { @@ -3223,7 +3250,7 @@ bool LLInventoryCollectFunctor::itemTransferCommonlyAllowed(LLInventoryItem* ite case LLAssetType::AT_BODYPART: case LLAssetType::AT_CLOTHING: - if(!gAgent.isWearingItem(item->getUUID())) + if(!gAgentWearables.isWearingItem(item->getUUID())) { allowed = true; } diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index d73fef72072be177fc1b01325f6a78b5a0536064..2193552f4a4b9a41670f2f3bad05acaafd1120a5 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -365,7 +365,15 @@ public: // returns true iff category version is known and theoretical // descendents == actual descendents. bool isCategoryComplete(const LLUUID& cat_id) const; + + // callbacks + // Trigger a notification and empty the folder type (AT_TRASH or AT_LOST_AND_FOUND) if confirmed + void emptyFolderType(const std::string notification, LLAssetType::EType folder_type); + bool callbackEmptyFolderType(const LLSD& notification, const LLSD& response, LLAssetType::EType folder_type); + // Utility Functions + void removeItem(const LLUUID& item_id); + // start and stop background breadth-first fetching of inventory contents // this gets triggered when performing a filter-search static void startBackgroundFetch(const LLUUID& cat_id = LLUUID::null); // start fetch process diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp index 326c511fcf1e46de8ceb802cfaba7b7471beb8b0..8e6889a37942e23c2698949fbcaa9b6cddb1b221 100644 --- a/indra/newview/lljoystickbutton.cpp +++ b/indra/newview/lljoystickbutton.cpp @@ -49,8 +49,12 @@ #include "llglheaders.h" -static LLRegisterWidget<LLJoystickAgentSlide> r1("joystick_slide"); -static LLRegisterWidget<LLJoystickAgentTurn> r2("joystick_turn"); +static LLDefaultWidgetRegistry::Register<LLJoystickAgentSlide> r1("joystick_slide"); +static LLDefaultWidgetRegistry::Register<LLJoystickAgentTurn> r2("joystick_turn"); +static LLDefaultWidgetRegistry::Register<LLJoystickCameraRotate> r3("joystick_rotate"); +static LLDefaultWidgetRegistry::Register<LLJoystickCameraZoom> r4("joystick_zoom"); +static LLDefaultWidgetRegistry::Register<LLJoystickCameraTrack> r5("joystick_track"); + const F32 NUDGE_TIME = 0.25f; // in seconds @@ -59,15 +63,18 @@ const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed // // Public Methods // -LLJoystick::LLJoystick( - const std::string& name, - LLRect rect, - const std::string &default_image, - const std::string &selected_image, - EJoystickQuadrant initial_quadrant ) - : - LLButton(name, rect, default_image, selected_image, LLStringUtil::null, NULL, NULL), - mInitialQuadrant(initial_quadrant), +void QuadrantNames::declareValues() +{ + declare("origin", JQ_ORIGIN); + declare("up", JQ_UP); + declare("down", JQ_DOWN); + declare("left", JQ_LEFT); + declare("right", JQ_RIGHT); +} + + +LLJoystick::LLJoystick(const LLJoystick::Params& p) +: LLButton(p), mInitialOffset(0, 0), mLastMouse(0, 0), mFirstMouse(0, 0), @@ -76,10 +83,10 @@ LLJoystick::LLJoystick( mHorizSlopNear(0), mHorizSlopFar(0), mHeldDown(FALSE), - mHeldDownTimer() + mHeldDownTimer(), + mInitialQuadrant(p.quadrant) { - setHeldDownCallback(&LLJoystick::onHeldDown); - setCallbackUserData(this); + setHeldDownCallback(&LLJoystick::onBtnHeldDown, this); } @@ -178,16 +185,14 @@ F32 LLJoystick::getElapsedHeldDownTime() } // static -void LLJoystick::onHeldDown(void *userdata) +void LLJoystick::onBtnHeldDown(void *userdata) { LLJoystick *self = (LLJoystick *)userdata; - - // somebody removed this function without checking the - // build. Removed 2007-03-26. - //llassert( gViewerWindow->hasMouseCapture( self ) ); - - self->mHeldDown = TRUE; - self->onHeldDown(); + if (self) + { + self->mHeldDown = TRUE; + self->onHeldDown(); + } } EJoystickQuadrant LLJoystick::selectQuadrant(LLXMLNodePtr node) @@ -246,23 +251,6 @@ EJoystickQuadrant LLJoystick::quadrantFromName(const std::string& sQuadrant) } -LLXMLNodePtr LLJoystick::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(getHAlign())); - node->createChild("quadrant", TRUE)->setStringValue(nameFromQuadrant(mInitialQuadrant)); - - addImageAttributeToXML(node,getImageUnselectedName(),getImageUnselectedID(),std::string("image_unselected")); - addImageAttributeToXML(node,getImageSelectedName(),getImageSelectedID(),std::string("image_selected")); - - node->createChild("scale_image", TRUE)->setBoolValue(getScaleImage()); - - return node; -} - - - //------------------------------------------------------------------------------- // LLJoystickAgentTurn //------------------------------------------------------------------------------- @@ -327,46 +315,6 @@ void LLJoystickAgentTurn::onHeldDown() } } -LLView* LLJoystickAgentTurn::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("button"); - node->getAttributeString("name", name); - - std::string image_unselected; - if (node->hasAttribute("image_unselected")) node->getAttributeString("image_unselected",image_unselected); - - std::string image_selected; - if (node->hasAttribute("image_selected")) node->getAttributeString("image_selected",image_selected); - - EJoystickQuadrant quad = JQ_ORIGIN; - if (node->hasAttribute("quadrant")) quad = selectQuadrant(node); - - LLJoystickAgentTurn *button = new LLJoystickAgentTurn(name, - LLRect(), - image_unselected, - image_selected, - quad); - - if (node->hasAttribute("halign")) - { - LLFontGL::HAlign halign = selectFontHAlign(node); - button->setHAlign(halign); - } - - if (node->hasAttribute("scale_image")) - { - BOOL needsScale = FALSE; - node->getAttributeBOOL("scale_image",needsScale); - button->setScaleImage( needsScale ); - } - - button->initFromXML(node, parent); - - return button; -} - - - //------------------------------------------------------------------------------- // LLJoystickAgentSlide //------------------------------------------------------------------------------- @@ -435,54 +383,12 @@ void LLJoystickAgentSlide::onHeldDown() } -// static -LLView* LLJoystickAgentSlide::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("button"); - node->getAttributeString("name", name); - - std::string image_unselected; - if (node->hasAttribute("image_unselected")) node->getAttributeString("image_unselected",image_unselected); - - std::string image_selected; - if (node->hasAttribute("image_selected")) node->getAttributeString("image_selected",image_selected); - - - EJoystickQuadrant quad = JQ_ORIGIN; - if (node->hasAttribute("quadrant")) quad = selectQuadrant(node); - - LLJoystickAgentSlide *button = new LLJoystickAgentSlide(name, - LLRect(), - image_unselected, - image_selected, - quad); - - if (node->hasAttribute("halign")) - { - LLFontGL::HAlign halign = selectFontHAlign(node); - button->setHAlign(halign); - } - - if (node->hasAttribute("scale_image")) - { - BOOL needsScale = FALSE; - node->getAttributeBOOL("scale_image",needsScale); - button->setScaleImage( needsScale ); - } - - button->initFromXML(node, parent); - - return button; -} - - //------------------------------------------------------------------------------- // LLJoystickCameraRotate //------------------------------------------------------------------------------- -LLJoystickCameraRotate::LLJoystickCameraRotate(const std::string& name, LLRect rect, const std::string &out_img, const std::string &in_img) - : - LLJoystick(name, rect, out_img, in_img, JQ_ORIGIN), +LLJoystickCameraRotate::LLJoystickCameraRotate(const LLJoystickCameraRotate::Params& p) +: LLJoystick(p), mInLeft( FALSE ), mInTop( FALSE ), mInRight( FALSE ), @@ -636,6 +542,13 @@ void LLJoystickCameraRotate::draw() { drawDebugRect(); } + + //// *HACK: also draw debug rectangles around currently-being-edited LLView, and any elements that are being highlighted by GUI preview code (see LLFloaterUIPreview) + //std::set<LLView*>::iterator iter = std::find(sPreviewHighlightedElements.begin(), sPreviewHighlightedElements.end(), this); + //if ((sEditingUI && this == sEditingUIView) || (iter != sPreviewHighlightedElements.end() && sDrawPreviewHighlights)) + //{ + // drawDebugRect(); + //} } // Draws image rotated by multiples of 90 degrees @@ -679,6 +592,15 @@ void LLJoystickCameraRotate::drawRotatedImage( LLImageGL* image, S32 rotations ) // LLJoystickCameraTrack //------------------------------------------------------------------------------- +LLJoystickCameraTrack::Params::Params() +{ + held_down_delay.seconds(0.0); +} + +LLJoystickCameraTrack::LLJoystickCameraTrack(const LLJoystickCameraTrack::Params& p) +: LLJoystickCameraRotate(p) +{} + void LLJoystickCameraTrack::onHeldDown() { @@ -717,17 +639,15 @@ void LLJoystickCameraTrack::onHeldDown() // LLJoystickCameraZoom //------------------------------------------------------------------------------- -LLJoystickCameraZoom::LLJoystickCameraZoom(const std::string& name, LLRect rect, const std::string &out_img, const std::string &plus_in_img, const std::string &minus_in_img) - : - LLJoystick(name, rect, out_img, LLStringUtil::null, JQ_ORIGIN), +LLJoystickCameraZoom::LLJoystickCameraZoom(const LLJoystickCameraZoom::Params& p) +: LLJoystick(p), mInTop( FALSE ), - mInBottom( FALSE ) + mInBottom( FALSE ), + mPlusInImage(p.plus_image), + mMinusInImage(p.minus_image) { - mPlusInImage = LLUIImageList::getInstance()->getUIImage(plus_in_img); - mMinusInImage = LLUIImageList::getInstance()->getUIImage(minus_in_img); } - BOOL LLJoystickCameraZoom::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLJoystick::handleMouseDown(x, y, mask); @@ -808,6 +728,13 @@ void LLJoystickCameraZoom::draw() { drawDebugRect(); } + + //// *HACK: also draw debug rectangles around currently-being-edited LLView, and any elements that are being highlighted by GUI preview code (see LLFloaterUIPreview) + //std::set<LLView*>::iterator iter = std::find(sPreviewHighlightedElements.begin(), sPreviewHighlightedElements.end(), this); + //if ((sEditingUI && this == sEditingUIView) || (iter != sPreviewHighlightedElements.end() && sDrawPreviewHighlights)) + //{ + // drawDebugRect(); + //} } void LLJoystickCameraZoom::updateSlop() diff --git a/indra/newview/lljoystickbutton.h b/indra/newview/lljoystickbutton.h index 076a506f148b81564455e88ad0bd7762dc31e9d5..954a8c481d027eb8377d0825f72ae6aab5e09369 100644 --- a/indra/newview/lljoystickbutton.h +++ b/indra/newview/lljoystickbutton.h @@ -46,11 +46,27 @@ typedef enum e_joystick_quadrant JQ_RIGHT } EJoystickQuadrant; +struct QuadrantNames : public LLInitParam::TypeValuesHelper<EJoystickQuadrant, QuadrantNames> +{ + static void declareValues(); +}; + class LLJoystick : public LLButton { public: - LLJoystick(const std::string& name, LLRect rect, const std::string &default_image, const std::string &selected_image, EJoystickQuadrant initial); + struct Params + : public LLInitParam::Block<Params, LLButton::Params> + { + Optional<EJoystickQuadrant, QuadrantNames> quadrant; + + Params() + : quadrant("quadrant", JQ_ORIGIN) + { + label(""); + } + }; + LLJoystick(const Params&); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -60,10 +76,9 @@ public: virtual void onHeldDown() = 0; F32 getElapsedHeldDownTime(); - static void onHeldDown(void *userdata); // called by llbutton callback handler + static void onBtnHeldDown(void *userdata); // called by llbutton callback handler void setInitialQuadrant(EJoystickQuadrant initial) { mInitialQuadrant = initial; }; - virtual LLXMLNodePtr getXML(bool save_children = true) const; static std::string nameFromQuadrant(const EJoystickQuadrant quadrant); static EJoystickQuadrant quadrantFromName(const std::string& name); static EJoystickQuadrant selectQuadrant(LLXMLNodePtr node); @@ -91,14 +106,9 @@ class LLJoystickAgentTurn : public LLJoystick { public: - LLJoystickAgentTurn(const std::string& name, LLRect rect, const std::string &default_image, const std::string &selected_image, EJoystickQuadrant initial) - : LLJoystick(name, rect, default_image, selected_image, initial) - { } - + struct Params : public LLJoystick::Params {}; + LLJoystickAgentTurn(const Params& p) : LLJoystick(p) {} virtual void onHeldDown(); - - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - }; @@ -107,14 +117,11 @@ class LLJoystickAgentSlide : public LLJoystick { public: - LLJoystickAgentSlide(const std::string& name, LLRect rect, const std::string &default_image, const std::string &selected_image, EJoystickQuadrant initial) - : LLJoystick(name, rect, default_image, selected_image, initial) - { } - + struct Params : public LLJoystick::Params {}; + LLJoystickAgentSlide(const Params& p) : LLJoystick(p) {} + virtual void onHeldDown(); virtual void onMouseUp(); - - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); }; @@ -123,7 +130,16 @@ class LLJoystickCameraRotate : public LLJoystick { public: - LLJoystickCameraRotate(const std::string& name, LLRect rect, const std::string &out_img, const std::string &in_img); + struct Params + : public LLInitParam::Block<Params, LLJoystick::Params> + { + Params() + { + held_down_delay.seconds(0.0); + } + }; + + LLJoystickCameraRotate(const LLJoystickCameraRotate::Params&); virtual void setToggleState( BOOL left, BOOL top, BOOL right, BOOL bottom ); @@ -149,10 +165,13 @@ class LLJoystickCameraTrack : public LLJoystickCameraRotate { public: - LLJoystickCameraTrack(const std::string& name, LLRect rect, const std::string &out_img, const std::string &in_img) - : LLJoystickCameraRotate(name, rect, out_img, in_img) - { } + struct Params + : public LLInitParam::Block<Params, LLJoystickCameraRotate::Params> + { + Params(); + }; + LLJoystickCameraTrack(const LLJoystickCameraTrack::Params&); virtual void onHeldDown(); }; @@ -162,7 +181,20 @@ class LLJoystickCameraZoom : public LLJoystick { public: - LLJoystickCameraZoom(const std::string& name, LLRect rect, const std::string &out_img, const std::string &plus_in_img, const std::string &minus_in_img); + struct Params + : public LLInitParam::Block<Params, LLJoystick::Params> + { + Optional<LLUIImage*> plus_image; + Optional<LLUIImage*> minus_image; + + Params() + : plus_image ("plus_image", NULL), + minus_image ("minus_image", NULL) + { + held_down_delay.seconds(0.0); + } + }; + LLJoystickCameraZoom(const Params&); virtual void setToggleState( BOOL top, BOOL bottom ); diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index 2f43b41042b3625c61c14e27600d6b364343279a..318344f9eff3c8a74a782b79bca64094c2a6520f 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -54,7 +54,7 @@ LLLandmarkList::~LLLandmarkList() std::for_each(mList.begin(), mList.end(), DeletePairedPointer()); } -LLLandmark* LLLandmarkList::getAsset( const LLUUID& asset_uuid ) +LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t cb) { LLLandmark* landmark = get_ptr_in_map(mList, asset_uuid); if(landmark) @@ -65,6 +65,12 @@ LLLandmark* LLLandmarkList::getAsset( const LLUUID& asset_uuid ) { if ( gLandmarkList.mBadList.find(asset_uuid) == gLandmarkList.mBadList.end() ) { + if (cb) + { + loaded_callback_map_t::value_type vt(asset_uuid, cb); + mLoadedCallbackMap.insert(vt); + } + gAssetStorage->getAssetData( asset_uuid, LLAssetType::AT_LANDMARK, @@ -96,6 +102,8 @@ void LLLandmarkList::processGetAssetReply( LLLandmark* landmark = LLLandmark::constructFromString(&buffer[0]); if (landmark) { + gLandmarkList.mList[ uuid ] = landmark; + LLVector3d pos; if(!landmark->getGlobalPos(pos)) { @@ -106,10 +114,15 @@ void LLLandmarkList::processGetAssetReply( gMessageSystem, gAgent.getRegionHost(), region_id, - NULL); + boost::bind(&LLLandmarkList::onRegionHandle, &gLandmarkList, uuid)); } + + // the callback will be called when we get the region handle. + } + else + { + gLandmarkList.makeCallbacks(uuid); } - gLandmarkList.mList[ uuid ] = landmark; } } else @@ -134,3 +147,45 @@ BOOL LLLandmarkList::assetExists(const LLUUID& asset_uuid) { return mList.count(asset_uuid) != 0 || mBadList.count(asset_uuid) != 0; } + +void LLLandmarkList::onRegionHandle(const LLUUID& landmark_id) +{ + LLLandmark* landmark = getAsset(landmark_id); + + if (!landmark) + { + llwarns << "Got region handle but the landmark not found." << llendl; + return; + } + + // Calculate landmark global position. + // This should succeed since the region handle is available. + LLVector3d pos; + if (!landmark->getGlobalPos(pos)) + { + llwarns << "Got region handle but the landmark global position is still unknown." << llendl; + return; + } + + makeCallbacks(landmark_id); +} + +void LLLandmarkList::makeCallbacks(const LLUUID& landmark_id) +{ + LLLandmark* landmark = getAsset(landmark_id); + + if (!landmark) + { + llwarns << "Landmark to make callbacks for not found." << llendl; + } + + // make all the callbacks here. + loaded_callback_map_t::iterator it; + while((it = mLoadedCallbackMap.find(landmark_id)) != mLoadedCallbackMap.end()) + { + if (landmark) + (*it).second(landmark); + + mLoadedCallbackMap.erase(it); + } +} diff --git a/indra/newview/lllandmarklist.h b/indra/newview/lllandmarklist.h index c41ba7a0f0d643f3315b693bc7c3cba7665aa35b..ebf1b65e9755569e80407565b68d56234b88d406 100644 --- a/indra/newview/lllandmarklist.h +++ b/indra/newview/lllandmarklist.h @@ -33,6 +33,7 @@ #ifndef LL_LLLANDMARKLIST_H #define LL_LLLANDMARKLIST_H +#include <boost/function.hpp> #include <map> #include "lllandmark.h" #include "lluuid.h" @@ -45,6 +46,8 @@ class LLInventoryItem; class LLLandmarkList { public: + typedef boost::function<void(LLLandmark*)> loaded_callback_t; + LLLandmarkList() {} ~LLLandmarkList(); @@ -53,7 +56,7 @@ public: //const LLLandmark* getNext() { return mList.getNextData(); } BOOL assetExists(const LLUUID& asset_uuid); - LLLandmark* getAsset(const LLUUID& asset_uuid); + LLLandmark* getAsset(const LLUUID& asset_uuid, loaded_callback_t cb = NULL); static void processGetAssetReply( LLVFS *vfs, const LLUUID& uuid, @@ -63,11 +66,19 @@ public: LLExtStat ext_status ); protected: + void onRegionHandle(const LLUUID& landmark_id); + void makeCallbacks(const LLUUID& landmark_id); + typedef std::map<LLUUID, LLLandmark*> landmark_list_t; landmark_list_t mList; typedef std::set<LLUUID> landmark_bad_list_t; landmark_bad_list_t mBadList; + + // *TODO: make the callback multimap a template class and make use of it + // here and in LLLandmark. + typedef std::multimap<LLUUID, loaded_callback_t> loaded_callback_map_t; + loaded_callback_map_t mLoadedCallbackMap; }; diff --git a/indra/newview/lllocationhistory.cpp b/indra/newview/lllocationhistory.cpp new file mode 100644 index 0000000000000000000000000000000000000000..179eca2532be1df235e6fbf1c8da3c4adf5ca6e8 --- /dev/null +++ b/indra/newview/lllocationhistory.cpp @@ -0,0 +1,134 @@ +/** + * @file lllocationhistory.cpp + * @brief Typed locations history + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "lllocationhistory.h" + +#include <iomanip> // for std::setw() + +#include "llui.h" + +LLLocationHistory::LLLocationHistory() : + mFilename("typed_locations.txt"), + mLoadedCallback(NULL) +{ +} + +void LLLocationHistory::addItem(std::string item) +{ + static LLUICachedControl<S32> max_items("LocationHistoryMaxSize", 100); + + mItems.push_back(item); + + // If the vector size exceeds the maximum, purge the oldest items. + if ((S32)mItems.size() > max_items) + mItems.erase(mItems.begin(), mItems.end()-max_items); +} + + +bool LLLocationHistory::getMatchingItems(std::string substring, location_list_t& result) const +{ + // *TODO: an STL algorithm would look nicer + result.clear(); + + std::string needle = substring; + LLStringUtil::toLower(needle); + + for (location_list_t::const_iterator it = mItems.begin(); it != mItems.end(); ++it) + { + std::string haystack = *it; + LLStringUtil::toLower(haystack); + + if (haystack.find(needle) != std::string::npos) + result.push_back(*it); + } + + return result.size(); +} + +void LLLocationHistory::dump() const +{ + llinfos << "Location history dump:" << llendl; + int i = 0; + for (location_list_t::const_iterator it = mItems.begin(); it != mItems.end(); ++it, ++i) + { + llinfos << "#" << std::setw(2) << std::setfill('0') << i << ": " << *it << llendl; + } +} + +void LLLocationHistory::save() const +{ + // build filename for each user + std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); + + // open a file for writing + llofstream file (resolved_filename); + if (!file.is_open()) + { + llwarns << "can't open location history file \"" << mFilename << "\" for writing" << llendl; + return; + } + + for (location_list_t::const_iterator it = mItems.begin(); it != mItems.end(); ++it) + file << (*it) << std::endl; + + file.close(); +} + +void LLLocationHistory::load() +{ + llinfos << "Loading location history." << llendl; + + // build filename for each user + std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); + llifstream file(resolved_filename); + + if (!file.is_open()) + { + llwarns << "can't load location history from file \"" << mFilename << "\"" << llendl; + return; + } + + // remove current entries before we load over them + mItems.clear(); + + // add each line in the file to the list + std::string line; + while (std::getline(file, line)) + addItem(line); + + file.close(); + + if (mLoadedCallback) + mLoadedCallback(); +} diff --git a/indra/newview/lllocationhistory.h b/indra/newview/lllocationhistory.h new file mode 100644 index 0000000000000000000000000000000000000000..d2a959ae626efbc7b30a88b2484f033680d9a7d1 --- /dev/null +++ b/indra/newview/lllocationhistory.h @@ -0,0 +1,68 @@ +/** + * @file llocationhistory.h + * @brief Typed locations history + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLLOCATIONHISTORY_H +#define LL_LLLOCATIONHISTORY_H + +#include "llsingleton.h" // for LLSingleton + +#include <vector> +#include <string> +#include <boost/function.hpp> + +class LLLocationHistory: public LLSingleton<LLLocationHistory> +{ + LOG_CLASS(LLLocationHistory); + +public: + typedef std::vector<std::string> location_list_t; + typedef boost::function<void()> loaded_callback_t; + + LLLocationHistory(); + + void addItem(std::string item); + size_t getItemCount() const { return mItems.size(); } + const location_list_t& getItems() const { return mItems; } + bool getMatchingItems(std::string substring, location_list_t& result) const; + void setLoadedCallback(loaded_callback_t cb) { mLoadedCallback = cb; } + + void save() const; + void load(); + void dump() const; + +private: + std::vector<std::string> mItems; + std::string mFilename; /// File to store the history to. + loaded_callback_t mLoadedCallback; +}; + +#endif diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4aaa7ca6cb1dd00a1a0839f3d4bf50f602c89d34 --- /dev/null +++ b/indra/newview/lllocationinputctrl.cpp @@ -0,0 +1,513 @@ +/** + * @file lllocationinputctrl.cpp + * @brief Combobox-like location input control + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +// file includes +#include "lllocationinputctrl.h" + +// common includes +#include "llbutton.h" +#include "llfloaterreg.h" +#include "llfocusmgr.h" +#include "llkeyboard.h" +#include "llstring.h" +#include "lluictrlfactory.h" +#include "v2math.h" + +// newview includes +#include "llagent.h" +#include "llfloaterland.h" +#include "llinventorymodel.h" +#include "lllandmarklist.h" +#include "lllocationhistory.h" +#include "llpanelplaces.h" +#include "llsidetray.h" +#include "llviewerinventory.h" +#include "llviewerparcelmgr.h" + +//============================================================================ +/* + * "ADD LANDMARK" BUTTON UPDATING LOGIC + * + * If the current parcel has been landmarked, we should draw + * a special image on the button. + * + * To avoid determining the appropriate image on every draw() we do that + * only in the following cases: + * 1) Navbar is shown for the first time after login. + * 2) Agent moves to another parcel. + * 3) A landmark is created or removed. + * + * The first case is handled by the handleLoginComplete() method. + * + * The second case is handled by setting the "agent parcel changed" callback + * on LLViewerParcelMgr. + * + * The third case is the most complex one. We have two inventory observers for that: + * one is designated to handle adding landmarks, the other handles removal. + * Let's see how the former works. + * + * When we get notified about landmark addition, the landmark position is unknown yet. What we can + * do at that point is initiate loading the landmark data by LLLandmarkList and set the + * "loading finished" callback on it. Finally, when the callback is triggered, + * we can determine whether the landmark refers to a point within the current parcel + * and choose the appropriate image for the "Add landmark" button. + */ + +// Returns true if the given inventory item is a landmark pointing to the current parcel. +// Used to filter inventory items. +class LLIsAgentParcelLandmark : public LLInventoryCollectFunctor +{ +public: + /*virtual*/ bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + { + if (!item || item->getType() != LLAssetType::AT_LANDMARK) + return false; + + LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID()); + if (!landmark) // the landmark not been loaded yet + return false; + + LLVector3d landmark_global_pos; + if (!landmark->getGlobalPos(landmark_global_pos)) + return false; + + return LLViewerParcelMgr::getInstance()->inAgentParcel(landmark_global_pos); + } +}; + +/** + * Initiates loading the landmarks that have been just added. + * + * Once the loading is complete we'll be notified + * with the callback we set for LLLandmarkList. + */ +class LLAddLandmarkObserver : public LLInventoryAddedObserver +{ +public: + LLAddLandmarkObserver(LLLocationInputCtrl* input) : mInput(input) {} + +private: + /*virtual*/ void done() + { + std::vector<LLUUID>::const_iterator it = mAdded.begin(), end = mAdded.end(); + for(; it != end; ++it) + { + LLInventoryItem* item = gInventory.getItem(*it); + if (!item || item->getType() != LLAssetType::AT_LANDMARK) + continue; + + // Start loading the landmark. + LLLandmark* lm = gLandmarkList.getAsset( + item->getAssetUUID(), + boost::bind(&LLLocationInputCtrl::onLandmarkLoaded, mInput, _1)); + if (lm) + { + // Already loaded? Great, handle it immediately (the callback won't be called). + mInput->onLandmarkLoaded(lm); + } + } + + mAdded.clear(); + } + + LLLocationInputCtrl* mInput; +}; + +/** + * Updates the "Add landmark" button once a landmark gets removed. + */ +class LLRemoveLandmarkObserver : public LLInventoryObserver +{ +public: + LLRemoveLandmarkObserver(LLLocationInputCtrl* input) : mInput(input) {} + +private: + /*virtual*/ void changed(U32 mask) + { + if (mask & (~(LLInventoryObserver::LABEL|LLInventoryObserver::INTERNAL|LLInventoryObserver::ADD))) + { + mInput->updateAddLandmarkButton(); + } + } + + LLLocationInputCtrl* mInput; +}; + +//============================================================================ + + +static LLDefaultWidgetRegistry::Register<LLLocationInputCtrl> r("location_input"); + +LLLocationInputCtrl::Params::Params() +: add_landmark_image_enabled("add_landmark_image_enabled"), + add_landmark_image_disabled("add_landmark_image_disabled"), + add_landmark_button("add_landmark_button"), + add_landmark_hpad("add_landmark_hpad", 0), + info_button("info_button"), + background("background") +{ +} + +LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) +: LLComboBox(p), + mAddLandmarkHPad(p.add_landmark_hpad), + mInfoBtn(NULL), + mAddLandmarkBtn(NULL) +{ + // Background image. + LLButton::Params bg_params = p.background; + mBackground = LLUICtrlFactory::create<LLButton>(bg_params); + addChildInBack(mBackground); + + // "Place information" button. + LLButton::Params info_params = p.info_button; + mInfoBtn = LLUICtrlFactory::create<LLButton>(info_params); + mInfoBtn->setClickedCallback(boost::bind(&LLLocationInputCtrl::onInfoButtonClicked, this)); + addChild(mInfoBtn); + + // "Add landmark" button. + LLButton::Params al_params = p.add_landmark_button; + if (p.add_landmark_image_enabled()) + { + al_params.image_unselected = p.add_landmark_image_enabled; + al_params.image_selected = p.add_landmark_image_enabled; + } + if (p.add_landmark_image_disabled()) + { + al_params.image_disabled = p.add_landmark_image_disabled; + al_params.image_disabled_selected = p.add_landmark_image_disabled; + } + al_params.click_callback.function(boost::bind(&LLLocationInputCtrl::onAddLandmarkButtonClicked, this)); + mAddLandmarkBtn = LLUICtrlFactory::create<LLButton>(al_params); + enableAddLandmarkButton(true); + addChild(mAddLandmarkBtn); + + setFocusReceivedCallback(boost::bind(&LLLocationInputCtrl::onFocusReceived, this)); + setFocusLostCallback(boost::bind(&LLLocationInputCtrl::onFocusLost, this)); + setPrearrangeCallback(boost::bind(&LLLocationInputCtrl::onLocationPrearrange, this, _2)); + + updateWidgetlayout(); + + // - Make the "Add landmark" button updated when either current parcel gets changed + // or a landmark gets created or removed from the inventory. + // - Update the location string on parcel change. + LLViewerParcelMgr::getInstance()->setAgentParcelChangedCallback( + boost::bind(&LLLocationInputCtrl::onAgentParcelChange, this)); + + LLLocationHistory::getInstance()->setLoadedCallback( + boost::bind(&LLLocationInputCtrl::onLocationHistoryLoaded, this)); + + mRemoveLandmarkObserver = new LLRemoveLandmarkObserver(this); + mAddLandmarkObserver = new LLAddLandmarkObserver(this); + gInventory.addObserver(mRemoveLandmarkObserver); + gInventory.addObserver(mAddLandmarkObserver); +} + +LLLocationInputCtrl::~LLLocationInputCtrl() +{ + gInventory.removeObserver(mRemoveLandmarkObserver); + gInventory.removeObserver(mAddLandmarkObserver); + delete mRemoveLandmarkObserver; + delete mAddLandmarkObserver; +} + +void LLLocationInputCtrl::setEnabled(BOOL enabled) +{ + LLComboBox::setEnabled(enabled); + mAddLandmarkBtn->setEnabled(enabled); +} + +void LLLocationInputCtrl::hideList() +{ + LLComboBox::hideList(); + if (mTextEntry && hasFocus()) + focusTextEntry(); +} + +BOOL LLLocationInputCtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) +{ + // Let the buttons show their tooltips. + if (LLUICtrl::handleToolTip(x, y, msg, sticky_rect_screen) && !msg.empty()) + { + return TRUE; + } + + // Cursor is above the text entry. + msg = LLUI::sShowXUINames ? getShowNamesToolTip() : gAgent.getSLURL(); + if (mTextEntry && sticky_rect_screen) + { + *sticky_rect_screen = mTextEntry->calcScreenRect(); + } + + return TRUE; +} + +BOOL LLLocationInputCtrl::handleKeyHere(KEY key, MASK mask) +{ + BOOL result = LLComboBox::handleKeyHere(key, mask); + + if (key == KEY_DOWN && hasFocus() && mList->getItemCount() != 0) + { + showList(); + } + + return result; +} + +void LLLocationInputCtrl::onTextEntry(LLLineEditor* line_editor) +{ + KEY key = gKeyboard->currentKey(); + + if (line_editor->getText().empty()) + { + prearrangeList(); // resets filter + hideList(); + } + // Typing? (moving cursor should not affect showing the list) + else if (key != KEY_LEFT && key != KEY_RIGHT && key != KEY_HOME && key != KEY_END) + { + prearrangeList(line_editor->getText()); + if (mList->getItemCount() != 0) + { + showList(); + focusTextEntry(); + } + else + { + // Hide the list if it's empty. + hideList(); + } + } + + LLComboBox::onTextEntry(line_editor); +} + +/** + * Useful if we want to just set the text entry value, no matter what the list contains. + * + * This is faster than setTextEntry(). + */ +void LLLocationInputCtrl::setText(const LLStringExplicit& text) +{ + if (mTextEntry) + { + mTextEntry->setText(text); + mHasAutocompletedText = FALSE; + } +} + +void LLLocationInputCtrl::setFocus(BOOL b) +{ + LLComboBox::setFocus(b); + + if (mTextEntry && b && !mList->getVisible()) + mTextEntry->setFocus(TRUE); +} + +void LLLocationInputCtrl::handleLoginComplete() +{ + // An agent parcel update hasn't occurred yet, so we have to + // manually set location and the appropriate "Add landmark" icon. + refresh(); +} + +//== private methods ========================================================= + +void LLLocationInputCtrl::onFocusReceived() +{ + prearrangeList(); + setText(gAgent.getSLURL()); + if (mTextEntry) + mTextEntry->endSelection(); // we don't want handleMouseUp() to "finish" the selection +} + +void LLLocationInputCtrl::onFocusLost() +{ + refreshLocation(); +} + +void LLLocationInputCtrl::onInfoButtonClicked() +{ + LLSD key; + key["type"] = LLPanelPlaces::AGENT; + + LLSideTray::getInstance()->showPanel("panel_places", key); +} + +void LLLocationInputCtrl::onAddLandmarkButtonClicked() +{ + LLFloaterReg::showInstance("add_landmark"); +} + +void LLLocationInputCtrl::onAgentParcelChange() +{ + refresh(); +} + +void LLLocationInputCtrl::onLandmarkLoaded(LLLandmark* lm) +{ + (void) lm; + updateAddLandmarkButton(); +} + +void LLLocationInputCtrl::onLocationHistoryLoaded() +{ + rebuildLocationHistory(); +} + +void LLLocationInputCtrl::onLocationPrearrange(const LLSD& data) +{ + std::string filter = data.asString(); + rebuildLocationHistory(filter); + mList->mouseOverHighlightNthItem(-1); // Clear highlight on the last selected item. +} + +void LLLocationInputCtrl::refresh() +{ + refreshLocation(); // update location string + updateAddLandmarkButton(); // indicate whether current parcel has been landmarked +} + +void LLLocationInputCtrl::refreshLocation() +{ + // Is one of our children focused? + if (LLUICtrl::hasFocus() || mButton->hasFocus() || mList->hasFocus() || + (mTextEntry && mTextEntry->hasFocus()) || (mAddLandmarkBtn->hasFocus())) + + { + llwarns << "Location input should not be refreshed when having focus" << llendl; + return; + } + + // Update location field. + std::string location_name; + + if (!gAgent.buildLocationString(location_name, LLAgent::LOCATION_FORMAT_NORMAL)) + location_name = "Unknown"; + + setText(location_name); +} + +void LLLocationInputCtrl::rebuildLocationHistory(std::string filter) +{ + LLLocationHistory::location_list_t filtered_items; + const LLLocationHistory::location_list_t* itemsp = NULL; + LLLocationHistory* lh = LLLocationHistory::getInstance(); + + if (filter.empty()) + itemsp = &lh->getItems(); + else + { + lh->getMatchingItems(filter, filtered_items); + itemsp = &filtered_items; + } + + removeall(); + for (LLLocationHistory::location_list_t::const_reverse_iterator it = itemsp->rbegin(); it != itemsp->rend(); it++) + add(*it); +} + +void LLLocationInputCtrl::focusTextEntry() +{ + // We can't use "mTextEntry->setFocus(TRUE)" instead because + // if the "select_on_focus" parameter is true it places the cursor + // at the beginning (after selecting text), thus screwing up updateSelection(). + if (mTextEntry) + gFocusMgr.setKeyboardFocus(mTextEntry); +} + +void LLLocationInputCtrl::enableAddLandmarkButton(bool val) +{ + // Enable/disable the button. + mAddLandmarkBtn->setEnabled(val); +} + +// Change the "Add landmark" button image +// depending on whether current parcel has been landmarked. +void LLLocationInputCtrl::updateAddLandmarkButton() +{ + bool cur_parcel_landmarked = false; + + // Determine whether there are landmarks pointing to the current parcel. + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLIsAgentParcelLandmark is_current_parcel_landmark; + gInventory.collectDescendentsIf(gAgent.getInventoryRootID(), + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + is_current_parcel_landmark); + cur_parcel_landmarked = !items.empty(); + + enableAddLandmarkButton(!cur_parcel_landmarked); +} + +void LLLocationInputCtrl::updateWidgetlayout() +{ + const LLRect& rect = getLocalRect(); + const LLRect& hist_btn_rect = mButton->getRect(); + LLRect info_btn_rect = mButton->getRect(); + + // info button + info_btn_rect.setOriginAndSize( + 0, (rect.getHeight() - info_btn_rect.getHeight()) / 2, + info_btn_rect.getWidth(), info_btn_rect.getHeight()); + mInfoBtn->setRect(info_btn_rect); + + // background + mBackground->setRect(LLRect(info_btn_rect.getWidth(), rect.mTop, + rect.mRight - hist_btn_rect.getWidth(), rect.mBottom)); + + // history button + mButton->setRightHPad(0); + + // "Add Landmark" button + { + LLRect al_btn_rect = mAddLandmarkBtn->getRect(); + al_btn_rect.translate( + hist_btn_rect.mLeft - mAddLandmarkHPad - al_btn_rect.getWidth(), + (rect.getHeight() - al_btn_rect.getHeight()) / 2); + mAddLandmarkBtn->setRect(al_btn_rect); + } + + // text entry + if (mTextEntry) + { + LLRect text_entry_rect(rect); + text_entry_rect.mLeft = info_btn_rect.getWidth(); + text_entry_rect.mRight = mAddLandmarkBtn->getRect().mLeft; + text_entry_rect.stretch(0, -1); // make space for border + mTextEntry->setRect(text_entry_rect); + } +} diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h new file mode 100644 index 0000000000000000000000000000000000000000..17328532639a58c0c2ba390026d31138213a618c --- /dev/null +++ b/indra/newview/lllocationinputctrl.h @@ -0,0 +1,119 @@ +/** + * @file lllocationinputctrl.h + * @brief Combobox-like location input control + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLLOCATIONINPUTCTRL_H +#define LL_LLLOCATIONINPUTCTRL_H + +#include <llcombobox.h> + +class LLLandmark; + +// internals +class LLAddLandmarkObserver; +class LLRemoveLandmarkObserver; + +/** + * Location input control. + * + * @see LLNavigationBar + */ +class LLLocationInputCtrl +: public LLComboBox +{ + LOG_CLASS(LLLocationInputCtrl); + friend class LLAddLandmarkObserver; + friend class LLRemoveLandmarkObserver; + +public: + struct Params + : public LLInitParam::Block<Params, LLComboBox::Params> + { + Optional<LLUIImage*> add_landmark_image_enabled, + add_landmark_image_disabled; + Optional<S32> add_landmark_hpad; + Optional<LLButton::Params> add_landmark_button, + info_button, + background; + Params(); + }; + + // LLView interface + /*virtual*/ void setEnabled(BOOL enabled); + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + //======================================================================== + + // LLUICtrl interface + /*virtual*/ void setFocus(BOOL b); + //======================================================================== + + // LLComboBox interface + void hideList(); + void onTextEntry(LLLineEditor* line_editor); + //======================================================================== + + LLLineEditor* getTextEntry() const { return mTextEntry; } + void handleLoginComplete(); + +private: + friend class LLUICtrlFactory; + LLLocationInputCtrl(const Params&); + virtual ~LLLocationInputCtrl(); + + void focusTextEntry(); + void enableAddLandmarkButton(bool val); + void refresh(); + void refreshLocation(); + void rebuildLocationHistory(std::string filter = ""); + void setText(const LLStringExplicit& text); + void updateAddLandmarkButton(); + void updateWidgetlayout(); + + void onFocusReceived(); + void onFocusLost(); + void onInfoButtonClicked(); + void onLocationHistoryLoaded(); + void onLocationPrearrange(const LLSD& data); + void onLandmarkLoaded(LLLandmark* lm); + void onAddLandmarkButtonClicked(); + void onAgentParcelChange(); + + LLButton* mBackground; + LLButton* mAddLandmarkBtn; + LLButton* mInfoBtn; + S32 mAddLandmarkHPad; + + LLAddLandmarkObserver* mAddLandmarkObserver; + LLRemoveLandmarkObserver* mRemoveLandmarkObserver; +}; + +#endif diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 1709d6465d91a347262bac5bd92f05bbfa59f7f7..69214b5cab565e3e499f092d226205de578173f0 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -35,6 +35,7 @@ #include "lllogchat.h" #include "llappviewer.h" #include "llfloaterchat.h" +#include "lltrans.h" const S32 LOG_RECALL_SIZE = 2048; @@ -64,20 +65,26 @@ std::string LLLogChat::timestamp(bool withdate) time_t utc_time; utc_time = time_corrected(); - // There's only one internal tm buffer. - struct tm* timep; + std::string timeStr; + LLSD substitution; + substitution["datetime"] = (S32) utc_time; - // Convert to Pacific, based on server's opinion of whether - // it's daylight savings time there. - timep = utc_to_pacific_time(utc_time, gPacificDaylightTime); - - std::string text; if (withdate) - text = llformat("[%d/%02d/%02d %d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min); + { + timeStr = "["+LLTrans::getString ("TimeYear")+"]/[" + +LLTrans::getString ("TimeMonth")+"]/[" + +LLTrans::getString ("TimeDay")+"] [" + +LLTrans::getString ("TimeHour")+"]:[" + +LLTrans::getString ("TimeMin")+"] "; + } else - text = llformat("[%d:%02d] ", timep->tm_hour, timep->tm_min); + { + timeStr = "[" + LLTrans::getString("TimeHour") + "]:[" + + LLTrans::getString ("TimeMin")+"] "; + } - return text; + LLStringUtil::format (timeStr, substitution); + return timeStr; } @@ -114,7 +121,7 @@ void LLLogChat::loadHistory(std::string filename , void (*callback)(ELogLineType LLFILE* fptr = LLFile::fopen(makeLogFileName(filename), "r"); /*Flawfinder: ignore*/ if (!fptr) { - //LLUIString message = LLFloaterChat::getInstance()->getString("IM_logging_string"); + //LLUIString message = LLTrans::getString("IM_logging_string"); //callback(LOG_EMPTY,"IM_logging_string",userdata); callback(LOG_EMPTY,LLStringUtil::null,userdata); return; //No previous conversation with this name. diff --git a/indra/newview/llloginhandler.cpp b/indra/newview/llloginhandler.cpp index 053f79888273580a6efb72549dff43c43f654fb7..554163c8e1ef2f63948a8c7471feb240955bff1e 100644 --- a/indra/newview/llloginhandler.cpp +++ b/indra/newview/llloginhandler.cpp @@ -156,15 +156,9 @@ void LLLoginHandler::parse(const LLSD& queryMap) { LLURLSimString::setString(queryMap["region"].asString()); } - else if (startLocation == "home") + else if (!startLocation.empty()) // "last" or "home" or ??? (let LLURLSimString figure it out) { - gSavedSettings.setBOOL("LoginLastLocation", FALSE); - LLURLSimString::setString(LLStringUtil::null); - } - else if (startLocation == "last") - { - gSavedSettings.setBOOL("LoginLastLocation", TRUE); - LLURLSimString::setString(LLStringUtil::null); + LLURLSimString::setString(startLocation); } } diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 53c74aaec10c15ede42994ff1c151ecf88591819..703977658532f82c23878a2cc44a062d7c9a825f 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -452,35 +452,36 @@ void LLManip::renderXYZ(const LLVector3 &vec) gViewerWindow->setup3DRender(); { + LLFontGL* font = LLFontGL::getFontSansSerif(); LLLocale locale(LLLocale::USER_LOCALE); LLGLDepthTest gls_depth(GL_FALSE); // render drop shadowed text feedback_string = llformat("X: %.3f", vec.mV[VX]); - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -102.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); + hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -102.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); feedback_string = llformat("Y: %.3f", vec.mV[VY]); - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -27.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); + hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -27.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); feedback_string = llformat("Z: %.3f", vec.mV[VZ]); - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, 48.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); + hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 48.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); // render text on top feedback_string = llformat("X: %.3f", vec.mV[VX]); - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -102.f, (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), FALSE); + hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -102.f, (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), FALSE); glColor3f(0.5f, 1.f, 0.5f); feedback_string = llformat("Y: %.3f", vec.mV[VY]); - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -27.f, (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), FALSE); + hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -27.f, (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), FALSE); glColor3f(0.5f, 0.5f, 1.f); feedback_string = llformat("Z: %.3f", vec.mV[VZ]); - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, 48.f, (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), FALSE); + hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *font, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 48.f, (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), FALSE); } } void LLManip::renderTickText(const LLVector3& pos, const std::string& text, const LLColor4 &color) { - const LLFontGL* big_fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); + const LLFontGL* big_fontp = LLFontGL::getFontSansSerif(); BOOL hud_selection = mObjectSelection->getSelectType() == SELECT_TYPE_HUD; glMatrixMode(GL_MODELVIEW); @@ -498,10 +499,10 @@ void LLManip::renderTickText(const LLVector3& pos, const std::string& text, cons // render shadow first LLColor4 shadow_color = LLColor4::black; shadow_color.mV[VALPHA] = color.mV[VALPHA] * 0.5f; - gViewerWindow->setupViewport(1, -1); - hud_render_utf8text(text, render_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(text), 3.f, shadow_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); - gViewerWindow->setupViewport(); - hud_render_utf8text(text, render_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(text), 3.f, color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); + gViewerWindow->setup3DViewport(1, -1); + hud_render_utf8text(text, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(text), 3.f, shadow_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); + gViewerWindow->setup3DViewport(); + hud_render_utf8text(text, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(text), 3.f, color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); glPopMatrix(); } @@ -510,8 +511,8 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string { LLLocale locale(LLLocale::USER_LOCALE); - const LLFontGL* big_fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); - const LLFontGL* small_fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); + const LLFontGL* big_fontp = LLFontGL::getFontSansSerif(); + const LLFontGL* small_fontp = LLFontGL::getFontSansSerifSmall(); std::string val_string; std::string fraction_string; @@ -560,29 +561,29 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string { fraction_string = llformat("%c%02d%s", LLResMgr::getInstance()->getDecimalPoint(), fractional_portion, suffix.c_str()); - gViewerWindow->setupViewport(1, -1); - hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, -1.f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection); - hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, 1.f, 3.f, shadow_color, hud_selection); + gViewerWindow->setup3DViewport(1, -1); + hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -1.f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection); + hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 1.f, 3.f, shadow_color, hud_selection); - gViewerWindow->setupViewport(); - hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, -1.f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); - hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, 1.f, 3.f, color, hud_selection); + gViewerWindow->setup3DViewport(); + hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -1.f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); + hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 1.f, 3.f, color, hud_selection); } else { - gViewerWindow->setupViewport(1, -1); - hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection); - gViewerWindow->setupViewport(); - hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); + gViewerWindow->setup3DViewport(1, -1); + hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection); + gViewerWindow->setup3DViewport(); + hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); } glPopMatrix(); } LLColor4 LLManip::setupSnapGuideRenderPass(S32 pass) { - static LLColor4 grid_color_fg = gColors.getColor("GridlineColor"); - static LLColor4 grid_color_bg = gColors.getColor("GridlineBGColor"); - static LLColor4 grid_color_shadow = gColors.getColor("GridlineShadowColor"); + static LLColor4 grid_color_fg = gSavedSkinSettings.getColor("GridlineColor"); + static LLColor4 grid_color_bg = gSavedSkinSettings.getColor("GridlineBGColor"); + static LLColor4 grid_color_shadow = gSavedSkinSettings.getColor("GridlineShadowColor"); LLColor4 line_color; F32 line_alpha = gSavedSettings.getF32("GridOpacity"); @@ -591,14 +592,14 @@ LLColor4 LLManip::setupSnapGuideRenderPass(S32 pass) { case 0: // shadow - gViewerWindow->setupViewport(1, -1); + gViewerWindow->setup3DViewport(1, -1); line_color = grid_color_shadow; line_color.mV[VALPHA] *= line_alpha; LLUI::setLineWidth(2.f); break; case 1: // hidden lines - gViewerWindow->setupViewport(); + gViewerWindow->setup3DViewport(); line_color = grid_color_bg; line_color.mV[VALPHA] *= line_alpha; LLUI::setLineWidth(1.f); diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 8b0484bba60fc3caf5e35e72392853a78a1a90d0..f228ea624bd7a51e734558fb6f1639156d5aee7f 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -63,6 +63,7 @@ #include "pipeline.h" #include "lldrawable.h" #include "llglheaders.h" +#include "lltrans.h" const F32 RADIUS_PIXELS = 100.f; // size in screen space const F32 SQ_RADIUS = RADIUS_PIXELS * RADIUS_PIXELS; @@ -897,7 +898,6 @@ void LLManipRotate::renderSnapGuides() } gGL.end(); - // *TODO: Translate //RN: text rendering does own shadow pass, so only render once if (pass == 1 && render_text && i % 16 == 0) { @@ -905,32 +905,32 @@ void LLManipRotate::renderSnapGuides() { if (i == 0) { - renderTickText(text_point, mObjectSelection->isAttachment() ? std::string("Forward") : std::string("East"), LLColor4::white); + renderTickText(text_point, mObjectSelection->isAttachment() ? LLTrans::getString("Forward") : LLTrans::getString("East"), LLColor4::white); } else if (i == 16) { if (constraint_axis.mV[VZ] > 0.f) { - renderTickText(text_point, mObjectSelection->isAttachment() ? std::string("Left") : std::string("North"), LLColor4::white); + renderTickText(text_point, mObjectSelection->isAttachment() ? LLTrans::getString("Left") : LLTrans::getString("North"), LLColor4::white); } else { - renderTickText(text_point, mObjectSelection->isAttachment() ? std::string("Right") : std::string("South"), LLColor4::white); + renderTickText(text_point, mObjectSelection->isAttachment() ? LLTrans::getString("Right") : LLTrans::getString("South"), LLColor4::white); } } else if (i == 32) { - renderTickText(text_point, mObjectSelection->isAttachment() ? std::string("Back") : std::string("West"), LLColor4::white); + renderTickText(text_point, mObjectSelection->isAttachment() ? LLTrans::getString("Back") : LLTrans::getString("West"), LLColor4::white); } else { if (constraint_axis.mV[VZ] > 0.f) { - renderTickText(text_point, mObjectSelection->isAttachment() ? std::string("Right") : std::string("South"), LLColor4::white); + renderTickText(text_point, mObjectSelection->isAttachment() ? LLTrans::getString("Right") : LLTrans::getString("South"), LLColor4::white); } else { - renderTickText(text_point, mObjectSelection->isAttachment() ? std::string("Left") : std::string("North"), LLColor4::white); + renderTickText(text_point, mObjectSelection->isAttachment() ? LLTrans::getString("Left") : LLTrans::getString("North"), LLColor4::white); } } } @@ -938,32 +938,32 @@ void LLManipRotate::renderSnapGuides() { if (i == 0) { - renderTickText(text_point, mObjectSelection->isAttachment() ? std::string("Left") : std::string("North"), LLColor4::white); + renderTickText(text_point, mObjectSelection->isAttachment() ? LLTrans::getString("Left") : LLTrans::getString("North"), LLColor4::white); } else if (i == 16) { if (constraint_axis.mV[VX] > 0.f) { - renderTickText(text_point, std::string("Up"), LLColor4::white); + renderTickText(text_point, LLTrans::getString("Up"), LLColor4::white); } else { - renderTickText(text_point, std::string("Down"), LLColor4::white); + renderTickText(text_point, LLTrans::getString("Down"), LLColor4::white); } } else if (i == 32) { - renderTickText(text_point, mObjectSelection->isAttachment() ? std::string("Right") : std::string("South"), LLColor4::white); + renderTickText(text_point, mObjectSelection->isAttachment() ? LLTrans::getString("Right") : LLTrans::getString("South"), LLColor4::white); } else { if (constraint_axis.mV[VX] > 0.f) { - renderTickText(text_point, std::string("Down"), LLColor4::white); + renderTickText(text_point, LLTrans::getString("Down"), LLColor4::white); } else { - renderTickText(text_point, std::string("Up"), LLColor4::white); + renderTickText(text_point, LLTrans::getString("Up"), LLColor4::white); } } } @@ -971,32 +971,32 @@ void LLManipRotate::renderSnapGuides() { if (i == 0) { - renderTickText(text_point, std::string("Up"), LLColor4::white); + renderTickText(text_point, LLTrans::getString("Up"), LLColor4::white); } else if (i == 16) { if (constraint_axis.mV[VY] > 0.f) { - renderTickText(text_point, mObjectSelection->isAttachment() ? std::string("Forward") : std::string("East"), LLColor4::white); + renderTickText(text_point, mObjectSelection->isAttachment() ? LLTrans::getString("Forward") : LLTrans::getString("East"), LLColor4::white); } else { - renderTickText(text_point, mObjectSelection->isAttachment() ? std::string("Back") : std::string("West"), LLColor4::white); + renderTickText(text_point, mObjectSelection->isAttachment() ? LLTrans::getString("Back") : LLTrans::getString("West"), LLColor4::white); } } else if (i == 32) { - renderTickText(text_point, std::string("Down"), LLColor4::white); + renderTickText(text_point, LLTrans::getString("Down"), LLColor4::white); } else { if (constraint_axis.mV[VY] > 0.f) { - renderTickText(text_point, mObjectSelection->isAttachment() ? std::string("Back") : std::string("West"), LLColor4::white); + renderTickText(text_point, mObjectSelection->isAttachment() ? LLTrans::getString("Back") : LLTrans::getString("West"), LLColor4::white); } else { - renderTickText(text_point, mObjectSelection->isAttachment() ? std::string("Forward") : std::string("East"), LLColor4::white); + renderTickText(text_point, mObjectSelection->isAttachment() ? LLTrans::getString("Forward") : LLTrans::getString("East"), LLColor4::white); } } } diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index b1cdfe38867855a8779cbaa43f59a7e162b9ea8b..5261c130ea74ca7c4b25d1f2b92e97d16a636860 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -415,7 +415,7 @@ BOOL LLManipScale::handleHover(S32 x, S32 y, MASK mask) // Patch up textures, if possible. LLSelectMgr::getInstance()->adjustTexturesByScale(FALSE, getStretchTextures()); - gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLSCALE); + gViewerWindow->setCursor(UI_CURSOR_TOOLSCALE); return TRUE; } @@ -1827,10 +1827,10 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) std::string help_text = "Move mouse cursor over ruler"; LLColor4 help_text_color = LLColor4::white; help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, grid_alpha, 0.f); - hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); + hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); help_text = "to snap to grid"; help_text_pos -= LLViewerCamera::getInstance()->getUpAxis() * mSnapRegimeOffset * 0.4f; - hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); + hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); } } } diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index f2585c85432d8156f61245ec9ccd94d81c3c2a91..b8c2a3d64b73c2ecf310481441ff60f568ea767f 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -61,7 +61,7 @@ #include "llviewerjoint.h" #include "llviewerobject.h" #include "llviewerwindow.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llworld.h" #include "llui.h" #include "pipeline.h" @@ -1441,10 +1441,10 @@ void LLManipTranslate::renderSnapGuides() std::string help_text = "Move mouse cursor over ruler to snap"; LLColor4 help_text_color = LLColor4::white; help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f); - hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); + hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); help_text = "to snap to grid"; help_text_pos -= LLViewerCamera::getInstance()->getUpAxis() * mSnapOffsetMeters * 0.2f; - hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); + hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); } } } @@ -1522,7 +1522,7 @@ void LLManipTranslate::renderSnapGuides() float a = line_alpha; - LLColor4 col = gColors.getColor("SilhouetteChildColor"); + LLColor4 col = gSavedSkinSettings.getColor("SilhouetteChildColor"); { //draw grid behind objects LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); diff --git a/indra/newview/llmemoryview.cpp b/indra/newview/llmemoryview.cpp index 215cc6940b5abce588907c0eb7da00cafb037fbd..ab5db930279c3cb8bbaa82dcf1b2d1d9c4a32b0a 100644 --- a/indra/newview/llmemoryview.cpp +++ b/indra/newview/llmemoryview.cpp @@ -35,34 +35,20 @@ #include "indra_constants.h" #include "llmemoryview.h" -#include "llrect.h" -#include "llerror.h" -#include "llgl.h" -#include "llmath.h" -#include "llfontgl.h" -#include "llmemtype.h" - -#include "llcharacter.h" -#include "llui.h" +#include "llappviewer.h" +#include "llallocator_heap_profile.h" +#include "llviewerwindow.h" #include "llviewercontrol.h" -#include "llstat.h" -#include "llfasttimer.h" +#include <sstream> +#include <boost/algorithm/string/split.hpp> - -LLMemoryView::LLMemoryView(const std::string& name, const LLRect& rect) -: LLView(name, rect, TRUE), -mDelay(120) +LLMemoryView::LLMemoryView(const LLMemoryView::Params& p) +: LLView(p), + //mDelay(120), + mAlloc(NULL) { - setVisible(FALSE); - mDumpTimer.reset(); - -#ifdef MEM_DUMP_DATA - // clear out file. - LLFILE *dump = LLFile::fopen("memusagedump.txt", "w"); - fclose(dump); -#endif } LLMemoryView::~LLMemoryView() @@ -94,62 +80,101 @@ BOOL LLMemoryView::handleHover(S32 x, S32 y, MASK mask) return FALSE; } -////////////////////////////////////////////////////////////////////////////// - -struct mtv_display_info { - S32 memtype; - const char *desc; - const LLColor4 *color; -}; - -static const LLColor4 red0(0.5f, 0.0f, 0.0f, 1.0f); - -static const struct mtv_display_info mtv_display_table[] = +void LLMemoryView::refreshProfile() { - { LLMemType::MTYPE_INIT, "Init", &LLColor4::white }, - { LLMemType::MTYPE_STARTUP, "Startup", &LLColor4::cyan1 }, - { LLMemType::MTYPE_MAIN, "Main", &LLColor4::cyan2 }, - { LLMemType::MTYPE_IMAGEBASE, "ImageBase", &LLColor4::yellow1 }, - { LLMemType::MTYPE_IMAGERAW, "ImageRaw", &LLColor4::yellow2 }, - { LLMemType::MTYPE_IMAGEFORMATTED, "ImageFmtd", &LLColor4::yellow3 }, - { LLMemType::MTYPE_APPFMTIMAGE, "ViewerImageFmt", &LLColor4::orange1 }, - { LLMemType::MTYPE_APPRAWIMAGE, "ViewerImageRaw", &LLColor4::orange2 }, - { LLMemType::MTYPE_APPAUXRAWIMAGE, "ViewerImageAux", &LLColor4::orange3 }, - { LLMemType::MTYPE_DRAWABLE, "Drawable", &LLColor4::green1 }, - { LLMemType::MTYPE_OBJECT, "ViewerObject", &LLColor4::green2 }, - { LLMemType::MTYPE_PIPELINE, "Pipeline", &LLColor4::green3 }, - { LLMemType::MTYPE_PARTICLES, "Particles", &LLColor4::green4 }, - { LLMemType::MTYPE_SPACE_PARTITION, "Space Partition", &LLColor4::blue2 }, - { LLMemType::MTYPE_VERTEX_DATA, "Vertex Buffer", &LLColor4::blue3 }, - { LLMemType::MTYPE_AVATAR, "Avatar", &LLColor4::purple1 }, - { LLMemType::MTYPE_AVATAR_MESH, "Avatar Mesh", &LLColor4::purple2 }, - { LLMemType::MTYPE_ANIMATION, "Animation", &LLColor4::purple3 }, - { LLMemType::MTYPE_REGIONS, "Regions", &LLColor4::blue1 }, - { LLMemType::MTYPE_VOLUME, "Volume", &LLColor4::pink1 }, - { LLMemType::MTYPE_PRIMITIVE, "Profile", &LLColor4::pink2 }, - { LLMemType::MTYPE_TEMP1, "Temp1", &LLColor4::red1 }, - { LLMemType::MTYPE_TEMP2, "Temp2", &LLColor4::magenta1 }, - { LLMemType::MTYPE_TEMP3, "Temp3", &LLColor4::red2 }, - { LLMemType::MTYPE_TEMP4, "Temp4", &LLColor4::magenta2 }, - { LLMemType::MTYPE_TEMP5, "Temp5", &LLColor4::red3 }, - { LLMemType::MTYPE_TEMP6, "Temp6", &LLColor4::magenta3 }, - { LLMemType::MTYPE_TEMP7, "Temp7", &LLColor4::red4 }, - { LLMemType::MTYPE_TEMP8, "Temp8", &LLColor4::magenta4 }, - - { LLMemType::MTYPE_OTHER, "Other", &red0 }, -}; -static const int MTV_DISPLAY_NUM = LL_ARRAY_SIZE(mtv_display_table); + /* + LLAllocator & alloc = LLAppViewer::instance()->getAllocator(); + if(alloc.isProfiling()) { + std::string profile_text = alloc.getRawProfile(); + + boost::algorithm::split(mLines, profile_text, boost::bind(std::equal_to<llwchar>(), '\n', _1)); + } else { + mLines.clear(); + } + */ + if (mAlloc == NULL) { + mAlloc = &LLAppViewer::instance()->getAllocator(); + } + + mLines.clear(); + + if(mAlloc->isProfiling()) + { + const LLAllocatorHeapProfile &prof = mAlloc->getProfile(); + for(size_t i = 0; i < prof.mLines.size(); ++i) + { + std::stringstream ss; + ss << "Unfreed Mem: " << (prof.mLines[i].mLiveSize >> 20) << " M Trace: "; + for(size_t k = 0; k < prof.mLines[i].mTrace.size(); ++k) + { + ss << LLMemType::getNameFromID(prof.mLines[i].mTrace[k]) << " "; + } + mLines.push_back(utf8string_to_wstring(ss.str())); + } + } +} void LLMemoryView::draw() { - std::string tdesc; - S32 width = getRect().getWidth(); - S32 height = getRect().getHeight(); + const S32 UPDATE_INTERVAL = 60; + const S32 MARGIN_AMT = 10; + static S32 curUpdate = UPDATE_INTERVAL; + static LLCachedControl<LLColor4> s_console_color(gSavedSkinSettings, "ConsoleBackground", LLColor4U::black); + + // setup update interval + if (curUpdate >= UPDATE_INTERVAL) + { + refreshProfile(); + curUpdate = 0; + } + curUpdate++; + + // setup window properly + S32 height = (S32) (gViewerWindow->getVirtualWindowRect().getHeight()*0.75f); + S32 width = (S32) (gViewerWindow->getVirtualWindowRect().getWidth() * 0.9f); + setRect(LLRect().setLeftTopAndSize(getRect().mLeft, getRect().mTop, width, height)); + // setup window color + F32 console_opacity = llclamp(gSavedSettings.getF32("ConsoleBackgroundOpacity"), 0.f, 1.f); + LLColor4 color = s_console_color; + color.mV[VALPHA] *= console_opacity; + LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gl_rect_2d(0, height, width, 0, LLColor4(0.f, 0.f, 0.f, 0.25f)); + gl_rect_2d(0, height, width, 0, color); + LLFontGL * font = LLFontGL::getFontSansSerifSmall(); + + // draw remaining lines + F32 y_pos = 0.f; + F32 y_off = 0.f; + + F32 line_height = font->getLineHeight(); + S32 target_width = width - 2 * MARGIN_AMT; + + // cut off lines on bottom + U32 max_lines = U32((height - 2 * line_height) / line_height); + std::vector<LLWString>::const_iterator end = mLines.end(); + if(mLines.size() > max_lines) { + end = mLines.begin() + max_lines; + } + + y_pos = height - MARGIN_AMT - line_height; + y_off = 0.f; + for (std::vector<LLWString>::const_iterator i = mLines.begin(); i != end; ++i) + { + font->render(*i, 0, MARGIN_AMT, y_pos - y_off, + LLColor4::white, + LLFontGL::LEFT, + LLFontGL::BASELINE, + LLFontGL::NORMAL, + LLFontGL::DROP_SHADOW, + S32_MAX, + target_width + ); + y_off += line_height; + } + #if MEM_TRACK_TYPE S32 left, top, right, bottom; @@ -267,40 +292,3 @@ void LLMemoryView::draw() LLView::draw(); } - -void LLMemoryView::setDataDumpInterval(float delay) -{ - mDelay = delay; -} - -void LLMemoryView::dumpData() -{ -#if MEM_TRACK_TYPE && MEM_DUMP_DATA - if (mDelay && (mDumpTimer.getElapsedTimeF32() > mDelay )) - { - // reset timer - mDumpTimer.reset(); - // append dump info to text file - LLFILE *dump = LLFile::fopen("memusagedump.txt", "a"); - - if (dump) - { - // write out total memory usage - fprintf (dump, "Total memory in use = %09d (%03d MB)\n", LLMemType::sTotalMem, LLMemType::sTotalMem>>20); - fprintf (dump, "High Water Mark = %09d (%03d MB)\n\n", LLMemType::sMaxTotalMem, LLMemType::sMaxTotalMem>>20); - // dump out usage of 'new' for each memory type - for (S32 i=0; i<LLMemType::MTYPE_NUM_TYPES; i++) - { - if (LLMemType::sMemCount[i]) - { - std::string outData = llformat("MEM: % 20s %09d %03d MB (%09d %03d MB) in %06d News", LLMemType::sTypeDesc[i], LLMemType::sMemCount[i], LLMemType::sMemCount[i]>>20, LLMemType::sMaxMemCount[i], LLMemType::sMaxMemCount[i]>>20, LLMemType::sNewCount[i]); - fprintf (dump, "%s\n", outData.c_str()); - } - } - fprintf (dump, "\n\n"); - - fclose(dump); - } - } -#endif -} diff --git a/indra/newview/llmemoryview.h b/indra/newview/llmemoryview.h index 81466bd6b08866a548af8b413c6a9ae5a6ba6fd9..774a52b88b68ce96ccf828080ad3f46f2e5457b6 100644 --- a/indra/newview/llmemoryview.h +++ b/indra/newview/llmemoryview.h @@ -35,10 +35,20 @@ #include "llview.h" +class LLAllocator; + class LLMemoryView : public LLView { public: - LLMemoryView(const std::string& name, const LLRect& rect); + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Params() + { + mouse_opaque = true; + visible = false; + } + }; + LLMemoryView(const LLMemoryView::Params&); virtual ~LLMemoryView(); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); @@ -46,14 +56,12 @@ public: virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual void draw(); -private: - void setDataDumpInterval(float delay); - void dumpData(); - - float mDelay; - LLFrameTimer mDumpTimer; + void refreshProfile(); private: + std::vector<LLWString> mLines; + LLAllocator* mAlloc; + }; #endif diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index ac77a920a59fa6efdd1cf76a0b347c0209606948..80bc2ad8615e67138e5135d75acddbfd6bcd68c2 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -35,6 +35,7 @@ #include "llmenucommands.h" #include "imageids.h" +#include "llfloaterreg.h" #include "llfontgl.h" #include "llrect.h" #include "llerror.h" @@ -48,7 +49,6 @@ #include "llfirstuse.h" #include "llfloaterchat.h" #include "llfloaterdirectory.h" -#include "llfloatermap.h" #include "llfloaterworldmap.h" #include "llgivemoney.h" #include "llinventoryview.h" @@ -67,14 +67,7 @@ #include "llworld.h" #include "llworldmap.h" #include "llfocusmgr.h" - -void handle_track_avatar(const LLUUID& agent_id, const std::string& name) -{ - LLAvatarTracker::instance().track(agent_id, name); - - LLFloaterDirectory::hide(NULL); - LLFloaterWorldMap::show(NULL, TRUE); -} +#include "llbottomtray.h" void handle_pay_by_id(const LLUUID& agent_id) { @@ -88,43 +81,11 @@ void handle_mouselook(void*) } -void handle_map(void*) -{ - LLFloaterWorldMap::toggle(NULL); -} - -void handle_mini_map(void*) -{ - LLFloaterMap::toggleInstance(); -} - - -void handle_find(void*) -{ - LLFloaterDirectory::toggleFind(NULL); -} - - -void handle_events(void*) -{ - LLFloaterDirectory::toggleEvents(NULL); -} - - -void handle_inventory(void*) -{ - // We're using the inventory, possibly for the - // first time. - LLFirstUse::useInventory(); - - LLInventoryView::toggleVisibility(NULL); -} - - void handle_chat(void*) { // give focus to chatbar if it's open but not focused - if (gSavedSettings.getBOOL("ChatVisible") && gFocusMgr.childHasKeyboardFocus(gChatBar)) + if (gSavedSettings.getBOOL("ChatVisible") && gFocusMgr.childHasKeyboardFocus( + LLBottomTray::getInstance()->getChatBox())) { LLChatBar::stopChat(); } diff --git a/indra/newview/llmenucommands.h b/indra/newview/llmenucommands.h index 03f7a2571cbb223e437fa8b4ec0f9e03156f0d98..368c6fe7527f7feff69ca40101921799093bb287 100644 --- a/indra/newview/llmenucommands.h +++ b/indra/newview/llmenucommands.h @@ -35,14 +35,8 @@ class LLUUID; -void handle_track_avatar(const LLUUID& agent_id, const std::string& name); void handle_pay_by_id(const LLUUID& agent_id); void handle_mouselook(void*); -void handle_map(void*); -void handle_mini_map(void*); -void handle_find(void*); -void handle_events(void*); -void handle_inventory(void*); void handle_chat(void*); void handle_return_key(void*); void handle_slash_key(void*); diff --git a/indra/newview/llmetricperformancetester.cpp b/indra/newview/llmetricperformancetester.cpp new file mode 100644 index 0000000000000000000000000000000000000000..93288c98d74afb251728cc83c710e64b9f91af5d --- /dev/null +++ b/indra/newview/llmetricperformancetester.cpp @@ -0,0 +1,258 @@ +/** + * @file llmetricperformancetester.cpp + * @brief LLMetricPerformanceTester class implementation + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "indra_constants.h" +#include "llerror.h" +#include "llmath.h" +#include "llfontgl.h" +#include "llsdserialize.h" +#include "llstat.h" +#include "lltreeiterators.h" +#include "llmetricperformancetester.h" + +LLMetricPerformanceTester::name_tester_map_t LLMetricPerformanceTester::sTesterMap ; + +//static +void LLMetricPerformanceTester::initClass() +{ +} +//static +void LLMetricPerformanceTester::cleanClass() +{ + for(name_tester_map_t::iterator iter = sTesterMap.begin() ; iter != sTesterMap.end() ; ++iter) + { + delete iter->second ; + } + sTesterMap.clear() ; +} + +//static +void LLMetricPerformanceTester::addTester(LLMetricPerformanceTester* tester) +{ + if(!tester) + { + llerrs << "invalid tester!" << llendl ; + return ; + } + + std::string name = tester->getName() ; + if(getTester(name)) + { + llerrs << "Tester name is used by some other tester: " << name << llendl ; + return ; + } + + sTesterMap.insert(std::make_pair(name, tester)); + + return ; +} + +//static +LLMetricPerformanceTester* LLMetricPerformanceTester::getTester(std::string label) +{ + name_tester_map_t::iterator found_it = sTesterMap.find(label) ; + if(found_it != sTesterMap.end()) + { + return found_it->second ; + } + + return NULL ; +} + +LLMetricPerformanceTester::LLMetricPerformanceTester(std::string name, BOOL use_default_performance_analysis) + : mName(name), + mBaseSessionp(NULL), + mCurrentSessionp(NULL), + mCount(0), + mUseDefaultPerformanceAnalysis(use_default_performance_analysis) +{ + if(mName == std::string()) + { + llerrs << "invalid name." << llendl ; + } + + LLMetricPerformanceTester::addTester(this) ; +} + +/*virtual*/ +LLMetricPerformanceTester::~LLMetricPerformanceTester() +{ + if(mBaseSessionp) + { + delete mBaseSessionp ; + mBaseSessionp = NULL ; + } + if(mCurrentSessionp) + { + delete mCurrentSessionp ; + mCurrentSessionp = NULL ; + } +} + +void LLMetricPerformanceTester::incLabel() +{ + mCurLabel = llformat("%s-%d", mName.c_str(), mCount++) ; +} +void LLMetricPerformanceTester::preOutputTestResults(LLSD* sd) +{ + incLabel() ; + (*sd)[mCurLabel]["Name"] = mName ; +} +void LLMetricPerformanceTester::postOutputTestResults(LLSD* sd) +{ + LLMutexLock lock(LLFastTimer::sLogLock); + LLFastTimer::sLogQueue.push((*sd)); +} + +void LLMetricPerformanceTester::outputTestResults() +{ + LLSD sd ; + preOutputTestResults(&sd) ; + + outputTestRecord(&sd) ; + + postOutputTestResults(&sd) ; +} + +void LLMetricPerformanceTester::addMetricString(std::string str) +{ + mMetricStrings.push_back(str) ; +} + +const std::string& LLMetricPerformanceTester::getMetricString(U32 index) const +{ + return mMetricStrings[index] ; +} + +void LLMetricPerformanceTester::prePerformanceAnalysis() +{ + mCount = 0 ; + incLabel() ; +} + +// +//default analyzing the performance +// +/*virtual*/ +void LLMetricPerformanceTester::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) +{ + if(mUseDefaultPerformanceAnalysis)//use default performance analysis + { + prePerformanceAnalysis() ; + + BOOL in_base = (*base).has(mCurLabel) ; + BOOL in_current = (*current).has(mCurLabel) ; + + while(in_base || in_current) + { + LLSD::String label = mCurLabel ; + + if(in_base && in_current) + { + *os << llformat("%s\n", label.c_str()) ; + + for(U32 index = 0 ; index < mMetricStrings.size() ; index++) + { + switch((*current)[label][ mMetricStrings[index] ].type()) + { + case LLSD::TypeInteger: + compareTestResults(os, mMetricStrings[index], + (S32)((*base)[label][ mMetricStrings[index] ].asInteger()), (S32)((*current)[label][ mMetricStrings[index] ].asInteger())) ; + break ; + case LLSD::TypeReal: + compareTestResults(os, mMetricStrings[index], + (F32)((*base)[label][ mMetricStrings[index] ].asReal()), (F32)((*current)[label][ mMetricStrings[index] ].asReal())) ; + break; + default: + llerrs << "unsupported metric " << mMetricStrings[index] << " LLSD type: " << (S32)(*current)[label][ mMetricStrings[index] ].type() << llendl ; + } + } + } + + incLabel() ; + in_base = (*base).has(mCurLabel) ; + in_current = (*current).has(mCurLabel) ; + } + }//end of default + else + { + //load the base session + prePerformanceAnalysis() ; + mBaseSessionp = loadTestSession(base) ; + + //load the current session + prePerformanceAnalysis() ; + mCurrentSessionp = loadTestSession(current) ; + + if(!mBaseSessionp || !mCurrentSessionp) + { + llerrs << "memory error during loading test sessions." << llendl ; + } + + //compare + compareTestSessions(os) ; + + //release memory + if(mBaseSessionp) + { + delete mBaseSessionp ; + mBaseSessionp = NULL ; + } + if(mCurrentSessionp) + { + delete mCurrentSessionp ; + mCurrentSessionp = NULL ; + } + } +} + +//virtual +void LLMetricPerformanceTester::compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) +{ + *os << llformat(" ,%s, %d, %d, %d, %.4f\n", metric_string.c_str(), v_base, v_current, + v_current - v_base, (v_base != 0) ? 100.f * v_current / v_base : 0) ; +} + +//virtual +void LLMetricPerformanceTester::compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) +{ + *os << llformat(" ,%s, %.4f, %.4f, %.4f, %.4f\n", metric_string.c_str(), v_base, v_current, + v_current - v_base, (fabs(v_base) > 0.0001f) ? 100.f * v_current / v_base : 0.f ) ; +} + +//virtual +LLMetricPerformanceTester::LLTestSession::~LLTestSession() +{ +} + diff --git a/indra/newview/llmetricperformancetester.h b/indra/newview/llmetricperformancetester.h new file mode 100644 index 0000000000000000000000000000000000000000..ab5ccaeb8e7906a41d59a3f3dcbbd8bc7928902d --- /dev/null +++ b/indra/newview/llmetricperformancetester.h @@ -0,0 +1,159 @@ +/** + * @file LLMetricPerformanceTester.h + * @brief LLMetricPerformanceTester class definition + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_METRICPERFORMANCETESTER_H +#define LL_METRICPERFORMANCETESTER_H + +class LLMetricPerformanceTester +{ +public: + // + //name passed to the constructor is a unique string for each tester. + //an error is reported if the name is already used by some other tester. + // + LLMetricPerformanceTester(std::string name, BOOL use_default_performance_analysis) ; + virtual ~LLMetricPerformanceTester(); + + // + //return the name of the tester + // + std::string getName() const { return mName ;} + // + //return the number of the test metrics in this tester + // + S32 getNumOfMetricStrings() const { return mMetricStrings.size() ;} + // + //return the metric string at the index + // + const std::string& getMetricString(U32 index) const ; + + // + //this function to compare the test results. + //by default, it compares the test results against the baseline one by one, item by item, + //in the increasing order of the LLSD label counter, starting from the first one. + //you can define your own way to analyze performance by passing FALSE to "use_default_performance_analysis", + //and implement two abstract virtual functions below: loadTestSession(...) and compareTestSessions(...). + // + void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ; + +protected: + // + //insert metric strings used in the tester. + // + void addMetricString(std::string str) ; + + // + //increase LLSD label by 1 + // + void incLabel() ; + + // + //the function to write a set of test results to the log LLSD. + // + void outputTestResults() ; + + // + //compare the test results. + //you can write your own to overwrite the default one. + // + virtual void compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) ; + virtual void compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) ; + + // + //for performance analysis use + //it defines an interface for the two abstract virtual functions loadTestSession(...) and compareTestSessions(...). + //please make your own test session class derived from it. + // + class LLTestSession + { + public: + virtual ~LLTestSession() ; + }; + + // + //load a test session for log LLSD + //you need to implement it only when you define your own way to analyze performance. + //otherwise leave it empty. + // + virtual LLMetricPerformanceTester::LLTestSession* loadTestSession(LLSD* log) = 0 ; + // + //compare the base session and the target session + //you need to implement it only when you define your own way to analyze performance. + //otherwise leave it empty. + // + virtual void compareTestSessions(std::ofstream* os) = 0 ; + // + //the function to write a set of test results to the log LLSD. + //you have to write you own version of this function. + // + virtual void outputTestRecord(LLSD* sd) = 0 ; + +private: + void preOutputTestResults(LLSD* sd) ; + void postOutputTestResults(LLSD* sd) ; + void prePerformanceAnalysis() ; + +protected: + // + //the unique name string of the tester + // + std::string mName ; + // + //the current label counter for the log LLSD + // + std::string mCurLabel ; + S32 mCount ; + + BOOL mUseDefaultPerformanceAnalysis ; + LLTestSession* mBaseSessionp ; + LLTestSession* mCurrentSessionp ; + + //metrics strings + std::vector< std::string > mMetricStrings ; + +//static members +private: + static void addTester(LLMetricPerformanceTester* tester) ; + +public: + typedef std::map< std::string, LLMetricPerformanceTester* > name_tester_map_t; + static name_tester_map_t sTesterMap ; + + static LLMetricPerformanceTester* getTester(std::string label) ; + static BOOL hasMetricPerformanceTesters() {return !sTesterMap.empty() ;} + + static void initClass() ; + static void cleanClass() ; +}; + +#endif + diff --git a/indra/newview/llmorphview.cpp b/indra/newview/llmorphview.cpp index 18fd20d12a6e860d051ff33f62f9b934fe2dd874..f562e45770440758bf8bab17d8e7f9865f491e5d 100644 --- a/indra/newview/llmorphview.cpp +++ b/indra/newview/llmorphview.cpp @@ -47,7 +47,7 @@ #include "lltoolmgr.h" #include "lltoolmorph.h" #include "llviewercamera.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llviewerwindow.h" #include "pipeline.h" @@ -67,9 +67,8 @@ const F32 CAMERA_DIST_STEP = 1.5f; //----------------------------------------------------------------------------- // LLMorphView() //----------------------------------------------------------------------------- -LLMorphView::LLMorphView(const std::string& name, const LLRect& rect) - : - LLView(name, rect, FALSE, FOLLOWS_ALL), +LLMorphView::LLMorphView(const LLMorphView::Params& p) +: LLView(p), mCameraTargetJoint( NULL ), mCameraOffset(-0.5f, 0.05f, 0.07f ), mCameraTargetOffset(0.f, 0.f, 0.05f ), @@ -78,8 +77,7 @@ LLMorphView::LLMorphView(const std::string& name, const LLRect& rect) mCameraYaw( 0.f ), mCameraDist( -1.f ), mCameraDrivenByKeys( FALSE ) -{ -} +{} //----------------------------------------------------------------------------- // initialize() @@ -110,7 +108,7 @@ void LLMorphView::initialize() //----------------------------------------------------------------------------- void LLMorphView::shutdown() { - LLVOAvatar::onCustomizeEnd(); + LLVOAvatarSelf::onCustomizeEnd(); LLVOAvatar *avatarp = gAgent.getAvatarObject(); if(avatarp && !avatarp->isDead()) @@ -137,7 +135,7 @@ void LLMorphView::setVisible(BOOL visible) llassert( !gFloaterCustomize ); gFloaterCustomize = new LLFloaterCustomize(); gFloaterCustomize->fetchInventory(); - gFloaterCustomize->open(); /*Flawfinder: ignore*/ + gFloaterCustomize->openFloater(); // Must do this _after_ gFloaterView is initialized. gFloaterCustomize->switchToDefaultSubpart(); diff --git a/indra/newview/llmorphview.h b/indra/newview/llmorphview.h index 1dd8ef7a5fc5dfdda9e6706b9a207a228b394c28..493f906c6b0494c07c54416b8b789229bdc08884 100644 --- a/indra/newview/llmorphview.h +++ b/indra/newview/llmorphview.h @@ -43,7 +43,15 @@ class LLFloaterCustomize; class LLMorphView : public LLView { public: - LLMorphView(const std::string& name, const LLRect& rect); + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Params() + { + mouse_opaque(false); + follows.flags(FOLLOWS_ALL); + } + }; + LLMorphView(const LLMorphView::Params&); void initialize(); void shutdown(); diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index a1800478752f3e50c1b7f67b0854b17737e00eda..36ec2c779a182a03a7045d73ad2102a7d690f019 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -59,13 +59,28 @@ const F32 NUDGE_TIME = 0.25f; // in seconds // protected LLFloaterMove::LLFloaterMove(const LLSD& key) -: LLFloater(std::string("move floater")) +: LLFloater() { setIsChrome(TRUE); const BOOL DONT_OPEN = FALSE; - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_moveview.xml", NULL, DONT_OPEN); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_moveview.xml", DONT_OPEN); +} + +// virtual +void LLFloaterMove::onClose(bool app_quitting) +{ + destroy(); + + if (!app_quitting) + { + gSavedSettings.setBOOL("ShowMovementControls", FALSE); + } +} +// virtual +BOOL LLFloaterMove::postBuild() +{ mForwardButton = getChild<LLJoystickAgentTurn>("forward btn"); mForwardButton->setHeldDownDelay(MOVE_BUTTON_DELAY); @@ -80,41 +95,29 @@ LLFloaterMove::LLFloaterMove(const LLSD& key) mTurnLeftButton = getChild<LLButton>("turn left btn"); mTurnLeftButton->setHeldDownDelay(MOVE_BUTTON_DELAY); - mTurnLeftButton->setHeldDownCallback( turnLeft ); + mTurnLeftButton->setHeldDownCallback( turnLeft, NULL ); mTurnRightButton = getChild<LLButton>("turn right btn"); mTurnRightButton->setHeldDownDelay(MOVE_BUTTON_DELAY); - mTurnRightButton->setHeldDownCallback( turnRight ); + mTurnRightButton->setHeldDownCallback( turnRight, NULL ); mMoveUpButton = getChild<LLButton>("move up btn"); childSetAction("move up btn",moveUp,NULL); mMoveUpButton->setHeldDownDelay(MOVE_BUTTON_DELAY); - mMoveUpButton->setHeldDownCallback( moveUp ); + mMoveUpButton->setHeldDownCallback( moveUp, NULL ); mMoveDownButton = getChild<LLButton>("move down btn"); childSetAction("move down btn",moveDown,NULL); mMoveDownButton->setHeldDownDelay(MOVE_BUTTON_DELAY); - mMoveDownButton->setHeldDownCallback( moveDown ); -} - -// virtual -void LLFloaterMove::onClose(bool app_quitting) -{ - LLFloater::onClose(app_quitting); - - if (!app_quitting) - { - gSavedSettings.setBOOL("ShowMovementControls", FALSE); - } + mMoveDownButton->setHeldDownCallback( moveDown, NULL ); + return TRUE; } - // // Static member functions // -void LLFloaterMove::onOpen() +void LLFloaterMove::onOpen(const LLSD& key) { - LLFloater::onOpen(); gSavedSettings.setBOOL("ShowMovementControls", TRUE); } diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h index e772551efe5854eaf2be428ee9846b6c371c986f..8d7cdc881d765a639d2063313a008cfa6a825fa0 100644 --- a/indra/newview/llmoveview.h +++ b/indra/newview/llmoveview.h @@ -54,9 +54,9 @@ protected: ~LLFloaterMove() {} public: - /*virtual*/ void onOpen(); + /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onClose(bool app_quitting); - + /*virtual*/ BOOL postBuild(); static F32 getYawRate(F32 time); protected: diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 40b1c641460629484abe06d96492868b33ccfaca..b47d6f42143e51399374da6bbbb12e0de7d383f6 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -71,6 +71,7 @@ #include "lluistring.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" +#include "lltrans.h" namespace { @@ -111,11 +112,6 @@ static LLDispatchEmptyMuteList sDispatchEmptyMuteList; //----------------------------------------------------------------------------- // LLMute() //----------------------------------------------------------------------------- -const char BY_NAME_SUFFIX[] = " (by name)"; -const char AGENT_SUFFIX[] = " (resident)"; -const char OBJECT_SUFFIX[] = " (object)"; -const char GROUP_SUFFIX[] = " (group)"; - LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags) : mID(id), @@ -149,16 +145,16 @@ std::string LLMute::getDisplayName() const { case BY_NAME: default: - name_with_suffix += BY_NAME_SUFFIX; + name_with_suffix += " " + LLTrans::getString("MuteByName"); break; case AGENT: - name_with_suffix += AGENT_SUFFIX; + name_with_suffix += " " + LLTrans::getString("MuteAgent"); break; case OBJECT: - name_with_suffix += OBJECT_SUFFIX; + name_with_suffix += " " + LLTrans::getString("MuteObject"); break; case GROUP: - name_with_suffix += GROUP_SUFFIX; + name_with_suffix += " " + LLTrans::getString("MuteGroup"); break; } return name_with_suffix; @@ -169,7 +165,7 @@ void LLMute::setFromDisplayName(const std::string& display_name) size_t pos = 0; mName = display_name; - pos = mName.rfind(GROUP_SUFFIX); + pos = mName.rfind(" " + LLTrans::getString("MuteGroup")); if (pos != std::string::npos) { mName.erase(pos); @@ -177,7 +173,7 @@ void LLMute::setFromDisplayName(const std::string& display_name) return; } - pos = mName.rfind(OBJECT_SUFFIX); + pos = mName.rfind(" " + LLTrans::getString("MuteObject")); if (pos != std::string::npos) { mName.erase(pos); @@ -185,7 +181,7 @@ void LLMute::setFromDisplayName(const std::string& display_name) return; } - pos = mName.rfind(AGENT_SUFFIX); + pos = mName.rfind(" " + LLTrans::getString("MuteAgent")); if (pos != std::string::npos) { mName.erase(pos); @@ -193,7 +189,7 @@ void LLMute::setFromDisplayName(const std::string& display_name) return; } - pos = mName.rfind(BY_NAME_SUFFIX); + pos = mName.rfind(" " + LLTrans::getString("MuteByName")); if (pos != std::string::npos) { mName.erase(pos); @@ -501,11 +497,8 @@ void LLMuteList::updateRemove(const LLMute& mute) gAgent.sendReliableMessage(); } -void notify_automute_callback(const LLUUID& agent_id, const std::string& first_name, const std::string& last_name, BOOL is_group, void* user_data) +void notify_automute_callback(const LLUUID& agent_id, const std::string& first_name, const std::string& last_name, BOOL is_group, LLMuteList::EAutoReason reason) { - U32 temp_data = (U32) (uintptr_t) user_data; - LLMuteList::EAutoReason reason = (LLMuteList::EAutoReason)temp_data; - std::string notif_name; switch (reason) { @@ -561,18 +554,18 @@ BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason, co if (gCacheName->getName(agent_id, cache_first, cache_last)) { // name in cache, call callback directly - notify_automute_callback(agent_id, cache_first, cache_last, FALSE, (void *)reason); + notify_automute_callback(agent_id, cache_first, cache_last, FALSE, reason); } else { // not in cache, lookup name from cache - gCacheName->get(agent_id, FALSE, notify_automute_callback, (void *)reason); + gCacheName->get(agent_id, FALSE, boost::bind(¬ify_automute_callback, _1, _2, _3, _4, reason)); } } else { // call callback directly - notify_automute_callback(agent_id, first_name, last_name, FALSE, (void *)reason); + notify_automute_callback(agent_id, first_name, last_name, FALSE, reason); } } diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index 98c7a4b631195cc36fab914ed8bf0032cbc46aaf..b85c1c759dab01a7e979f095e84a97a9128eaa60 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -46,20 +46,15 @@ // statics std::set<LLNameBox*> LLNameBox::sInstances; +static LLDefaultWidgetRegistry::Register<LLNameBox> r("name_box"); -LLNameBox::LLNameBox(const std::string& name, const LLRect& rect, const LLUUID& name_id, BOOL is_group, const LLFontGL* font, BOOL mouse_opaque) -: LLTextBox(name, rect, std::string("(retrieving)"), font, mouse_opaque), - mNameID(name_id) + +LLNameBox::LLNameBox(const Params& p) +: LLTextBox(p) { + mNameID = LLUUID::null; LLNameBox::sInstances.insert(this); - if(!name_id.isNull()) - { - setNameID(name_id, is_group); - } - else - { - setText(LLStringUtil::null); - } + setText(LLStringUtil::null); } LLNameBox::~LLNameBox() diff --git a/indra/newview/llnamebox.h b/indra/newview/llnamebox.h index f76850bd3cd15a694183e2015b1d9f2a70d40302..3edb36883f9fec4a403b65e50509a16a189f99a7 100644 --- a/indra/newview/llnamebox.h +++ b/indra/newview/llnamebox.h @@ -44,10 +44,15 @@ class LLNameBox : public LLTextBox { public: - LLNameBox(const std::string& name, const LLRect& rect, const LLUUID& name_id = LLUUID::null, BOOL is_group = FALSE, const LLFontGL* font = NULL, BOOL mouse_opaque = TRUE ); - // By default, follows top and left and is mouse-opaque. - // If no text, text = name. - // If no font, uses default system font. + struct Params : public LLInitParam::Block<Params, LLTextBox::Params> + { + Optional<bool> is_group; + + Params() + : is_group("is_group", false) + {} + }; + virtual ~LLNameBox(); void setNameID(const LLUUID& name_id, BOOL is_group); @@ -57,6 +62,10 @@ public: static void refreshAll(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group); +protected: + LLNameBox (const Params&); + + friend class LLUICtrlFactory; private: static std::set<LLNameBox*> sInstances; diff --git a/indra/newview/llnameeditor.cpp b/indra/newview/llnameeditor.cpp index e4a65734d823e14c635c9dd37ce383f8e5bb03a6..7f9ba8ba5a954037d9e5e1143f2637fb092fbafd 100644 --- a/indra/newview/llnameeditor.cpp +++ b/indra/newview/llnameeditor.cpp @@ -43,40 +43,22 @@ #include "llstring.h" #include "llui.h" -static LLRegisterWidget<LLNameEditor> r("name_editor"); +static LLDefaultWidgetRegistry::Register<LLNameEditor> r("name_editor"); // statics std::set<LLNameEditor*> LLNameEditor::sInstances; -LLNameEditor::LLNameEditor(const std::string& name, const LLRect& rect, - const LLUUID& name_id, - BOOL is_group, - const LLFontGL* glfont, - S32 max_text_length, - void (*commit_callback)(LLUICtrl* caller, void* user_data), - void (*keystroke_callback)(LLLineEditor* caller, void* user_data), - void (*focus_lost_callback)(LLFocusableElement* caller, void* user_data), - void* userdata, - LLLinePrevalidateFunc prevalidate_func) -: LLLineEditor(name, rect, - std::string("(retrieving)"), - glfont, - max_text_length, - commit_callback, - keystroke_callback, - focus_lost_callback, - userdata, - prevalidate_func), - mNameID(name_id) +LLNameEditor::LLNameEditor(const LLNameEditor::Params& p) +: LLLineEditor(p) { LLNameEditor::sInstances.insert(this); - if(!name_id.isNull()) + + if(!p.name_id().isNull()) { - setNameID(name_id, is_group); + setNameID(p.name_id, p.is_group); } } - LLNameEditor::~LLNameEditor() { LLNameEditor::sInstances.erase(this); @@ -141,35 +123,3 @@ LLSD LLNameEditor::getValue() const return LLSD(mNameID); } -LLView* LLNameEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("name_editor"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - S32 max_text_length = 128; - node->getAttributeS32("max_length", max_text_length); - - LLFontGL* font = LLView::selectFont(node); - - LLUICtrlCallback commit_callback = NULL; - - LLNameEditor* line_editor = new LLNameEditor(name, - rect, - LLUUID::null, FALSE, - font, - max_text_length, - commit_callback); - - std::string label; - if(node->getAttributeString("label", label)) - { - line_editor->setLabel(label); - } - line_editor->setColorParameters(node); - line_editor->initFromXML(node, parent); - - return line_editor; -} diff --git a/indra/newview/llnameeditor.h b/indra/newview/llnameeditor.h index bc5a67866c264e8651383321cfa86fd64e1b24cf..f9cabb5831e580bd1e533748986a588556635f08 100644 --- a/indra/newview/llnameeditor.h +++ b/indra/newview/llnameeditor.h @@ -46,24 +46,18 @@ class LLNameEditor : public LLLineEditor { public: - LLNameEditor(const std::string& name, const LLRect& rect, - const LLUUID& name_id = LLUUID::null, - BOOL is_group = FALSE, - const LLFontGL* glfont = NULL, - S32 max_text_length = 254, - void (*commit_callback)(LLUICtrl* caller, void* user_data) = NULL, - void (*keystroke_callback)(LLLineEditor* caller, void* user_data) = NULL, - void (*focus_lost_callback)(LLFocusableElement* caller, void* user_data) = NULL, - void* userdata = NULL, - LLLinePrevalidateFunc prevalidate_func = NULL); - // By default, follows top and left and is mouse-opaque. - // If no text, text = name. - // If no font, uses default system font. - + struct Params : public LLInitParam::Block<Params, LLLineEditor::Params> + { + Optional<bool> is_group; + Optional<LLUUID> name_id; + }; + +protected: + LLNameEditor(const Params&); + friend class LLUICtrlFactory; +public: virtual ~LLNameEditor(); - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - void setNameID(const LLUUID& name_id, BOOL is_group); void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index baf06567c125db9aeeff4f44804713693bd5eb52..722113928bcea1b4f5d7c07d4b5a994bd042423c 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -39,51 +39,46 @@ #include "llcachename.h" #include "llagent.h" #include "llinventory.h" +#include "llscrolllistitem.h" +#include "llscrolllistcell.h" +#include "llscrolllistcolumn.h" +#include "llsdparam.h" -static LLRegisterWidget<LLNameListCtrl> r("name_list"); - -// statics -std::set<LLNameListCtrl*> LLNameListCtrl::sInstances; - -LLNameListCtrl::LLNameListCtrl(const std::string& name, - const LLRect& rect, - LLUICtrlCallback cb, - void* userdata, - BOOL allow_multiple_selection, - BOOL draw_border, - S32 name_column_index, - const std::string& tooltip) -: LLScrollListCtrl(name, rect, cb, userdata, allow_multiple_selection, - draw_border), - mNameColumnIndex(name_column_index), - mAllowCallingCardDrop(FALSE) +static LLDefaultWidgetRegistry::Register<LLNameListCtrl> r("name_list"); + +void LLNameListCtrl::NameTypeNames::declareValues() { - setToolTip(tooltip); - LLNameListCtrl::sInstances.insert(this); + declare("INDIVIDUAL", LLNameListCtrl::INDIVIDUAL); + declare("GROUP", LLNameListCtrl::GROUP); + declare("SPECIAL", LLNameListCtrl::SPECIAL); } - -// virtual -LLNameListCtrl::~LLNameListCtrl() +LLNameListCtrl::Params::Params() +: name_column(""), + allow_calling_card_drop("allow_calling_card_drop", false) { - LLNameListCtrl::sInstances.erase(this); + name = "name_list"; } +LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p) +: LLScrollListCtrl(p), + mAllowCallingCardDrop(p.allow_calling_card_drop), + mNameColumn(p.name_column.column_name), + mNameColumnIndex(p.name_column.column_index) +{} // public -BOOL LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos, +void LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos, BOOL enabled, std::string& suffix) { //llinfos << "LLNameListCtrl::addNameItem " << agent_id << llendl; std::string fullname; - BOOL result = gCacheName->getFullName(agent_id, fullname); + gCacheName->getFullName(agent_id, fullname); fullname.append(suffix); addStringUUIDItem(fullname, agent_id, pos, enabled); - - return result; } // virtual, public @@ -138,75 +133,70 @@ BOOL LLNameListCtrl::handleDragAndDrop( void LLNameListCtrl::addGroupNameItem(const LLUUID& group_id, EAddPosition pos, BOOL enabled) { - //llinfos << "LLNameListCtrl::addGroupNameItem " << group_id << llendl; - std::string group_name; - gCacheName->getGroupName(group_id, group_name); - addStringUUIDItem(group_name, group_id, pos, enabled); + NameItem item; + item.value = group_id; + item.enabled = enabled; + item.target = GROUP; + + addRow(item, pos); } // public -void LLNameListCtrl::addGroupNameItem(LLScrollListItem* item, EAddPosition pos) - +void LLNameListCtrl::addGroupNameItem(LLNameListCtrl::NameItem& item, EAddPosition pos) { - //llinfos << "LLNameListCtrl::addGroupNameItem " << item->getUUID() << llendl; - - std::string group_name; - gCacheName->getGroupName(item->getUUID(), group_name); - - LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); - ((LLScrollListText*)cell)->setText( std::string(group_name) ); - - addItem(item, pos); + item.target = GROUP; + addRow(item, pos); } -BOOL LLNameListCtrl::addNameItem(LLScrollListItem* item, EAddPosition pos) +void LLNameListCtrl::addNameItem(LLNameListCtrl::NameItem& item, EAddPosition pos) { - //llinfos << "LLNameListCtrl::addNameItem " << item->getUUID() << llendl; - - std::string fullname; - BOOL result = gCacheName->getFullName(item->getUUID(), fullname); - - LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); - ((LLScrollListText*)cell)->setText( fullname ); - - addItem(item, pos); - - // this column is resizable - LLScrollListColumn* columnp = getColumn(mNameColumnIndex); - if (columnp && columnp->mHeader) - { - columnp->mHeader->setHasResizableElement(TRUE); - } + item.target = INDIVIDUAL; + addRow(item, pos); +} - return result; +LLScrollListItem* LLNameListCtrl::addElement(const LLSD& element, EAddPosition pos, void* userdata) +{ + LLNameListCtrl::NameItem item_params; + LLParamSDParser::instance().readSD(element, item_params); + item_params.userdata = userdata; + return addRow(item_params, pos); } -LLScrollListItem* LLNameListCtrl::addElement(const LLSD& value, EAddPosition pos, void* userdata) + +LLScrollListItem* LLNameListCtrl::addRow(const LLNameListCtrl::NameItem& name_item, EAddPosition pos) { - LLScrollListItem* item = LLScrollListCtrl::addElement(value, pos, userdata); + LLScrollListItem* item = LLScrollListCtrl::addRow(name_item, pos); + if (!item) return NULL; // use supplied name by default - std::string fullname = value["name"].asString(); - if (value["target"].asString() == "GROUP") + std::string fullname = name_item.display_name; + switch(name_item.target) { - gCacheName->getGroupName(item->getUUID(), fullname); + case GROUP: + gCacheName->getGroupName(name_item.value().asUUID(), fullname); // fullname will be "nobody" if group not found - } - else if (value["target"].asString() == "SPECIAL") - { + break; + case SPECIAL: // just use supplied name - } - else // normal resident - { - std::string name; - if (gCacheName->getFullName(item->getUUID(), name)) + break; + case INDIVIDUAL: { - fullname = name; + std::string name; + if (gCacheName->getFullName(name_item.value().asUUID(), name)) + { + fullname = name; + } + break; } + default: + break; } - LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); - ((LLScrollListText*)cell)->setText( fullname ); + LLScrollListCell* cell = item->getColumn(mNameColumnIndex); + if (cell) + { + cell->setValue(fullname); + } dirtyColumns(); @@ -259,9 +249,11 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first, if (item->getUUID() == id) { LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(0); - cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); - - ((LLScrollListText*)cell)->setText( fullname ); + cell = item->getColumn(mNameColumnIndex); + if (cell) + { + cell->setValue(fullname); + } } } @@ -273,186 +265,24 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first, void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) { - std::set<LLNameListCtrl*>::iterator it; - for (it = LLNameListCtrl::sInstances.begin(); - it != LLNameListCtrl::sInstances.end(); - ++it) + LLInstanceTracker<LLNameListCtrl>::instance_iter it; + for (it = beginInstances(); it != endInstances(); ++it) { LLNameListCtrl* ctrl = *it; ctrl->refresh(id, first, last, is_group); } } -// virtual -LLXMLNodePtr LLNameListCtrl::getXML(bool save_children) const +void LLNameListCtrl::updateColumns() { - LLXMLNodePtr node = LLScrollListCtrl::getXML(); - - node->createChild("allow_calling_card_drop", TRUE)->setBoolValue(mAllowCallingCardDrop); - - if (mNameColumnIndex != 0) - { - node->createChild("name_column_index", TRUE)->setIntValue(mNameColumnIndex); - } - - // Don't save contents, probably filled by code - - return node; -} - -LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("name_list"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - BOOL multi_select = FALSE; - node->getAttributeBOOL("multi_select", multi_select); - - BOOL draw_border = TRUE; - node->getAttributeBOOL("draw_border", draw_border); - - BOOL draw_heading = FALSE; - node->getAttributeBOOL("draw_heading", draw_heading); - - S32 name_column_index = 0; - node->getAttributeS32("name_column_index", name_column_index); + LLScrollListCtrl::updateColumns(); - LLUICtrlCallback callback = NULL; - - LLNameListCtrl* name_list = new LLNameListCtrl(name, - rect, - callback, - NULL, - multi_select, - draw_border, - name_column_index); - - name_list->setDisplayHeading(draw_heading); - if (node->hasAttribute("heading_height")) - { - S32 heading_height; - node->getAttributeS32("heading_height", heading_height); - name_list->setHeadingHeight(heading_height); - } - - BOOL allow_calling_card_drop = FALSE; - if (node->getAttributeBOOL("allow_calling_card_drop", allow_calling_card_drop)) - { - name_list->setAllowCallingCardDrop(allow_calling_card_drop); - } - - name_list->setScrollListParameters(node); - - name_list->initFromXML(node, parent); - - LLSD columns; - S32 index = 0; - //S32 total_static = 0; - LLXMLNodePtr child; - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) - { - if (child->hasName("column")) - { - std::string labelname(""); - child->getAttributeString("label", labelname); - - std::string columnname(labelname); - child->getAttributeString("name", columnname); - - BOOL columndynamicwidth = FALSE; - child->getAttributeBOOL("dynamicwidth", columndynamicwidth); - - std::string sortname(columnname); - child->getAttributeString("sort", sortname); - - S32 columnwidth = -1; - if (child->hasAttribute("relwidth")) - { - F32 columnrelwidth = 0.f; - child->getAttributeF32("relwidth", columnrelwidth); - columns[index]["relwidth"] = columnrelwidth; - } - else - { - child->getAttributeS32("width", columnwidth); - columns[index]["width"] = columnwidth; - } - - LLFontGL::HAlign h_align = LLFontGL::LEFT; - h_align = LLView::selectFontHAlign(child); - - //if(!columndynamicwidth) total_static += llmax(0, columnwidth); - - columns[index]["name"] = columnname; - columns[index]["label"] = labelname; - columns[index]["halign"] = (S32)h_align; - columns[index]["dynamicwidth"] = columndynamicwidth; - columns[index]["sort"] = sortname; - - index++; - } - } - name_list->setColumnHeadings(columns); - - - for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) + if (!mNameColumn.empty()) { - if (child->hasName("row")) + LLScrollListColumn* name_column = getColumn(mNameColumn); + if (name_column) { - LLUUID id; - child->getAttributeUUID("id", id); - - LLSD row; - - row["id"] = id; - - S32 column_idx = 0; - LLXMLNodePtr row_child; - for (row_child = node->getFirstChild(); row_child.notNull(); row_child = row_child->getNextSibling()) - { - if (row_child->hasName("column")) - { - std::string value = row_child->getTextContents(); - - std::string columnname(""); - row_child->getAttributeString("name", columnname); - - std::string font(""); - row_child->getAttributeString("font", font); - - std::string font_style(""); - row_child->getAttributeString("font-style", font_style); - - row["columns"][column_idx]["column"] = columnname; - row["columns"][column_idx]["value"] = value; - row["columns"][column_idx]["font"] = font; - row["columns"][column_idx]["font-style"] = font_style; - column_idx++; - } - } - name_list->addElement(row); + mNameColumnIndex = name_column->mIndex; } } - - std::string contents = node->getTextContents(); - - typedef boost::tokenizer<boost::char_separator<char> > tokenizer; - boost::char_separator<char> sep("\t\n"); - tokenizer tokens(contents, sep); - tokenizer::iterator token_iter = tokens.begin(); - - while(token_iter != tokens.end()) - { - const std::string& line = *token_iter; - name_list->addCommentText(line); - ++token_iter; - } - - return name_list; } - - - diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 1b7795ddff97e33d5bc195fba130efb83f1eb2f4..379cd48a6a6167b920f7600e992b77d2d2044c76 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -39,35 +39,68 @@ class LLNameListCtrl -: public LLScrollListCtrl +: public LLScrollListCtrl, protected LLInstanceTracker<LLNameListCtrl> { public: - LLNameListCtrl(const std::string& name, - const LLRect& rect, - LLUICtrlCallback callback, - void* userdata, - BOOL allow_multiple_selection, - BOOL draw_border = TRUE, - S32 name_column_index = 0, - const std::string& tooltip = LLStringUtil::null); - virtual ~LLNameListCtrl(); - - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - + typedef enum e_name_type + { + INDIVIDUAL, + GROUP, + SPECIAL + } ENameType; + + // provide names for enums + struct NameTypeNames : public LLInitParam::TypeValuesHelper<LLNameListCtrl::ENameType, NameTypeNames> + { + static void declareValues(); + }; + + struct NameItem : public LLInitParam::Block<NameItem, LLScrollListItem::Params> + { + Optional<std::string> display_name; + Optional<ENameType, NameTypeNames> target; + + NameItem() + : display_name("name"), + target("target", INDIVIDUAL) + {} + }; + + struct NameColumn : public LLInitParam::Choice<NameColumn> + { + Option<S32> column_index; + Option<std::string> column_name; + NameColumn() + : column_name("name_column"), + column_index("name_column_index", 0) + {} + }; + + struct Params : public LLInitParam::Block<Params, LLScrollListCtrl::Params> + { + Optional<NameColumn> name_column; + Optional<bool> allow_calling_card_drop; + Params(); + }; + +protected: + LLNameListCtrl(const Params&); + friend class LLUICtrlFactory; +public: // Add a user to the list by name. It will be added, the name // requested from the cache, and updated as necessary. - BOOL addNameItem(const LLUUID& agent_id, EAddPosition pos = ADD_BOTTOM, + void addNameItem(const LLUUID& agent_id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE, std::string& suffix = LLStringUtil::null); - BOOL addNameItem(LLScrollListItem* item, EAddPosition pos = ADD_BOTTOM); + void addNameItem(NameItem& item, EAddPosition pos = ADD_BOTTOM); - virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); + /*virtual*/ LLScrollListItem* addElement(const LLSD& element, EAddPosition pos = ADD_BOTTOM, void* userdata = NULL); + LLScrollListItem* addRow(const NameItem& value, EAddPosition pos = ADD_BOTTOM); // Add a user to the list by name. It will be added, the name // requested from the cache, and updated as necessary. void addGroupNameItem(const LLUUID& group_id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); - void addGroupNameItem(LLScrollListItem* item, EAddPosition pos = ADD_BOTTOM); + void addGroupNameItem(NameItem& item, EAddPosition pos = ADD_BOTTOM); void removeNameItem(const LLUUID& agent_id); @@ -84,10 +117,11 @@ public: void setAllowCallingCardDrop(BOOL b) { mAllowCallingCardDrop = b; } + /*virtual*/ void updateColumns(); private: - static std::set<LLNameListCtrl*> sInstances; - S32 mNameColumnIndex; - BOOL mAllowCallingCardDrop; + S32 mNameColumnIndex; + std::string mNameColumn; + BOOL mAllowCallingCardDrop; }; #endif diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cf1d9a5d86755fd52e579d706df0c9f82389b188 --- /dev/null +++ b/indra/newview/llnavigationbar.cpp @@ -0,0 +1,533 @@ +/** + * @file llnavigationbar.cpp + * @brief Navigation bar implementation + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llnavigationbar.h" + +#include <llfloaterreg.h> +#include <llfocusmgr.h> +#include <lliconctrl.h> +#include <llmenugl.h> +#include <llwindow.h> + +#include "llagent.h" +#include "llfloaterhtmlhelp.h" +#include "lllocationhistory.h" +#include "lllocationinputctrl.h" +#include "llteleporthistory.h" +#include "llslurl.h" +#include "llurlsimstring.h" +#include "llviewerinventory.h" +#include "llviewermenu.h" +#include "llviewerparcelmgr.h" +#include "llworldmap.h" + +//-- LLTeleportHistoryMenuItem ----------------------------------------------- + +/** + * Item look varies depending on the type (backward/current/forward). + */ +class LLTeleportHistoryMenuItem : public LLMenuItemCallGL +{ +public: + typedef enum e_item_type + { + TYPE_BACKWARD, + TYPE_CURRENT, + TYPE_FORWARD, + } EType; + + struct Params : public LLInitParam::Block<Params, LLMenuItemCallGL::Params> + { + Mandatory<EType> item_type; + + Params() {} + Params(EType type, std::string title); + }; + + /*virtual*/ void draw(); + /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); + +private: + LLTeleportHistoryMenuItem(const Params&); + friend class LLUICtrlFactory; + + static const S32 ICON_WIDTH = 16; + static const S32 ICON_HEIGHT = 16; + static const std::string ICON_IMG_BACKWARD; + static const std::string ICON_IMG_FORWARD; + + LLIconCtrl* mArrowIcon; +}; + +const std::string LLTeleportHistoryMenuItem::ICON_IMG_BACKWARD("teleport_history_backward.tga"); +const std::string LLTeleportHistoryMenuItem::ICON_IMG_FORWARD("teleport_history_forward.tga"); + +LLTeleportHistoryMenuItem::Params::Params(EType type, std::string title) +{ + item_type(type); + font.name("SansSerif"); + + if (type == TYPE_CURRENT) + font.style("BOLD"); + else + title = " " + title; + + name(title); + label(title); +} + +LLTeleportHistoryMenuItem::LLTeleportHistoryMenuItem(const Params& p) +: LLMenuItemCallGL(p), + mArrowIcon(NULL) +{ + LLIconCtrl::Params icon_params; + icon_params.name("icon"); + icon_params.rect(LLRect(0, ICON_HEIGHT, ICON_WIDTH, 0)); + icon_params.mouse_opaque(false); + icon_params.follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP); + icon_params.tab_stop(false); + icon_params.visible(false); + + mArrowIcon = LLUICtrlFactory::create<LLIconCtrl> (icon_params); + + // no image for the current item + if (p.item_type == TYPE_BACKWARD) + mArrowIcon->setValue(ICON_IMG_BACKWARD); + else if (p.item_type == TYPE_FORWARD) + mArrowIcon->setValue(ICON_IMG_FORWARD); + + addChild(mArrowIcon); +} + +void LLTeleportHistoryMenuItem::draw() +{ + // Draw menu item itself. + LLMenuItemCallGL::draw(); + + // Draw children if any. *TODO: move this to LLMenuItemGL? + LLUICtrl::draw(); +} + +void LLTeleportHistoryMenuItem::onMouseEnter(S32 x, S32 y, MASK mask) +{ + mArrowIcon->setVisible(TRUE); +} + +void LLTeleportHistoryMenuItem::onMouseLeave(S32 x, S32 y, MASK mask) +{ + mArrowIcon->setVisible(FALSE); +} + +//-- LNavigationBar ---------------------------------------------------------- + +/* +TODO: +- Load navbar height from saved settings (as it's done for status bar) or think of a better way. +*/ + +S32 NAVIGATION_BAR_HEIGHT = 60; // *HACK +LLNavigationBar* LLNavigationBar::sInstance = 0; + +LLNavigationBar* LLNavigationBar::getInstance() +{ + if (!sInstance) + sInstance = new LLNavigationBar(); + + return sInstance; +} + +LLNavigationBar::LLNavigationBar() +: mTeleportHistoryMenu(NULL), + mLocationContextMenu(NULL), + mBtnBack(NULL), + mBtnForward(NULL), + mBtnHome(NULL), + mBtnHelp(NULL), + mCmbLocation(NULL), + mLeSearch(NULL) +{ + setIsChrome(TRUE); + + // Register callbacks and load the location field context menu (NB: the order matters). + mCommitCallbackRegistrar.add("Navbar.Action", boost::bind(&LLNavigationBar::onLocationContextMenuItemClicked, this, _2)); + mEnableCallbackRegistrar.add("Navbar.EnableMenuItem", boost::bind(&LLNavigationBar::onLocationContextMenuItemEnabled, this, _2)); + + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_navigation_bar.xml"); + + // navigation bar can never get a tab + setFocusRoot(FALSE); +} + +LLNavigationBar::~LLNavigationBar() +{ + sInstance = 0; +} + +BOOL LLNavigationBar::postBuild() +{ + mBtnBack = getChild<LLButton>("back_btn"); + mBtnForward = getChild<LLButton>("forward_btn"); + mBtnHome = getChild<LLButton>("home_btn"); + mBtnHelp = getChild<LLButton>("help_btn"); + + mCmbLocation= getChild<LLLocationInputCtrl>("location_combo"); + mLeSearch = getChild<LLLineEditor>("search_input"); + + LLButton* search_btn = getChild<LLButton>("search_btn"); + + if (!mBtnBack || !mBtnForward || !mBtnHome || !mBtnHelp || + !mCmbLocation || !mLeSearch || !search_btn) + { + llwarns << "Malformed navigation bar" << llendl; + return FALSE; + } + + mBtnBack->setEnabled(FALSE); + mBtnBack->setClickedCallback(boost::bind(&LLNavigationBar::onBackButtonClicked, this)); + mBtnBack->setHeldDownCallback(boost::bind(&LLNavigationBar::onBackOrForwardButtonHeldDown, this, _2)); + + mBtnForward->setEnabled(FALSE); + mBtnForward->setClickedCallback(boost::bind(&LLNavigationBar::onForwardButtonClicked, this)); + mBtnForward->setHeldDownCallback(boost::bind(&LLNavigationBar::onBackOrForwardButtonHeldDown, this, _2)); + + mBtnHome->setClickedCallback(boost::bind(&LLNavigationBar::onHomeButtonClicked, this)); + mBtnHelp->setClickedCallback(boost::bind(&LLNavigationBar::onHelpButtonClicked, this)); + + mCmbLocation->setSelectionCallback(boost::bind(&LLNavigationBar::onLocationSelection, this)); + + mLeSearch->setCommitCallback(boost::bind(&LLNavigationBar::onSearchCommit, this)); + search_btn->setClickedCallback(boost::bind(&LLNavigationBar::onSearchCommit, this)); + + // Load the location field context menu + mLocationContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_navbar.xml", gMenuHolder); + if (!mLocationContextMenu) + { + llwarns << "Error loading navigation bar context menu" << llendl; + return FALSE; + } + + // we'll be notified on teleport history changes + LLTeleportHistory::getInstance()->setHistoryChangedCallback( + boost::bind(&LLNavigationBar::onTeleportHistoryChanged, this)); + + return TRUE; +} + +void LLNavigationBar::draw() +{ + LLPanel::draw(); +} + +BOOL LLNavigationBar::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + // *HACK. We should use mCmbLocation's right click callback instead. + + // If the location field is clicked then show its context menu. + if (mCmbLocation->getRect().pointInRect(x, y)) + { + // Pass the focus to the line editor when it is right-clicked + mCmbLocation->setFocus(TRUE); + + if (mLocationContextMenu) + { + mLocationContextMenu->buildDrawLabels(); + mLocationContextMenu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(this, mLocationContextMenu, x, y); + } + return TRUE; + } + return LLPanel:: handleRightMouseDown(x, y, mask); +} + +void LLNavigationBar::onBackButtonClicked() +{ + LLTeleportHistory::getInstance()->goBack(); +} + +void LLNavigationBar::onBackOrForwardButtonHeldDown(const LLSD& param) +{ + if (param["count"].asInteger() == 0) + showTeleportHistoryMenu(); +} + +void LLNavigationBar::onForwardButtonClicked() +{ + LLTeleportHistory::getInstance()->goForward(); +} + +void LLNavigationBar::onHomeButtonClicked() +{ + gAgent.teleportHome(); +} + +void LLNavigationBar::onHelpButtonClicked() +{ + gViewerHtmlHelp.show(); +} + +void LLNavigationBar::onSearchCommit() +{ + invokeSearch(mLeSearch->getText()); +} + +void LLNavigationBar::onTeleportHistoryMenuItemClicked(const LLSD& userdata) +{ + int idx = userdata.asInteger(); + LLTeleportHistory::getInstance()->goToItem(idx); +} + +// This is called when user presses enter in the location input +// or selects a location from the typed locations dropdown. +void LLNavigationBar::onLocationSelection() +{ + std::string typed_location = mCmbLocation->getSimple(); + + // Will not teleport to empty location. + if (typed_location.empty()) + return; + + std::string region_name; + LLVector3 local_coords(128, 128, 0); + + // Is the typed location a SLURL? + if (LLSLURL::isSLURL(typed_location)) + { + // Yes. Extract region name and local coordinates from it. + S32 x = 0, y = 0, z = 0; + if (LLURLSimString::parse(LLSLURL::stripProtocol(typed_location), ®ion_name, &x, &y, &z)) + local_coords.set(x, y, z); + else + return; + } + else + { + // Treat it as region name. + region_name = typed_location; + } + + // Resolve the region name to its global coordinates. + // If resolution succeeds we'll teleport. + LLWorldMap::url_callback_t cb = boost::bind( + &LLNavigationBar::onRegionNameResponse, this, + typed_location, region_name, local_coords, _1, _2, _3, _4); + LLWorldMap::getInstance()->sendNamedRegionRequest(region_name, cb, std::string("unused"), false); +} + +void LLNavigationBar::onTeleportHistoryChanged() +{ + // Update navigation controls. + LLTeleportHistory* h = LLTeleportHistory::getInstance(); + int cur_item = h->getCurrentItemIndex(); + mBtnBack->setEnabled(cur_item > 0); + mBtnForward->setEnabled(cur_item < ((int)h->getItems().size() - 1)); +} + +void LLNavigationBar::rebuildTeleportHistoryMenu() +{ + // Has the pop-up menu been built? + if (mTeleportHistoryMenu) + { + // Clear it. + mTeleportHistoryMenu->empty(); + } + else + { + // Create it. + LLMenuGL::Params menu_p; + menu_p.name("popup"); + menu_p.can_tear_off(false); + menu_p.visible(false); + menu_p.bg_visible(true); + menu_p.scrollable(true); + mTeleportHistoryMenu = LLUICtrlFactory::create<LLMenuGL>(menu_p); + + addChild(mTeleportHistoryMenu); + } + + // Populate the menu with teleport history items. + LLTeleportHistory* hist = LLTeleportHistory::getInstance(); + const LLTeleportHistory::slurl_list_t& hist_items = hist->getItems(); + int cur_item = hist->getCurrentItemIndex(); + + // Items will be shown in the reverse order, just like in Firefox. + for (int i = (int)hist_items.size()-1; i >= 0; i--) + { + LLTeleportHistoryMenuItem::EType type; + if (i < cur_item) + type = LLTeleportHistoryMenuItem::TYPE_BACKWARD; + else if (i > cur_item) + type = LLTeleportHistoryMenuItem::TYPE_FORWARD; + else + type = LLTeleportHistoryMenuItem::TYPE_CURRENT; + + LLTeleportHistoryMenuItem::Params item_params(type, hist_items[i].mTitle); + item_params.on_click.function(boost::bind(&LLNavigationBar::onTeleportHistoryMenuItemClicked, this, i)); + mTeleportHistoryMenu->addChild(LLUICtrlFactory::create<LLTeleportHistoryMenuItem>(item_params)); + } +} + +void LLNavigationBar::onRegionNameResponse( + std::string typed_location, + std::string region_name, + LLVector3 local_coords, + U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport) +{ + // Invalid location? + if (!region_handle) + { + invokeSearch(typed_location); + return; + } + + // Location is valid. Add it to the typed locations history. + S32 selected_item = mCmbLocation->getCurrentIndex(); + if (selected_item == -1) // user has typed text + { + LLLocationHistory* lh = LLLocationHistory::getInstance(); + mCmbLocation->add(typed_location); + lh->addItem(typed_location); + lh->save(); + } + + // Teleport to the location. + LLVector3d region_pos = from_region_handle(region_handle); + LLVector3d global_pos = region_pos + (LLVector3d) local_coords; + + llinfos << "Teleporting to: " << global_pos << llendl; + gAgent.teleportViaLocation(global_pos); +} + +void LLNavigationBar::showTeleportHistoryMenu() +{ + // Don't show the popup if teleport history is empty. + if (LLTeleportHistory::getInstance()->isEmpty()) + { + lldebugs << "Teleport history is empty, will not show the menu." << llendl; + return; + } + + rebuildTeleportHistoryMenu(); + + if (mTeleportHistoryMenu == NULL) + return; + + // *TODO: why to draw/update anything before showing the menu? + mTeleportHistoryMenu->buildDrawLabels(); + mTeleportHistoryMenu->updateParent(LLMenuGL::sMenuContainer); + LLRect btnBackRect = mBtnBack->getRect(); + LLMenuGL::showPopup(this, mTeleportHistoryMenu, btnBackRect.mLeft, btnBackRect.mBottom); + + // *HACK pass the mouse capturing to the drop-down menu + gFocusMgr.setMouseCapture( NULL ); +} + +void LLNavigationBar::onLocationContextMenuItemClicked(const LLSD& userdata) +{ + std::string item = userdata.asString(); + LLLineEditor* location_entry = mCmbLocation->getTextEntry(); + + if (item == std::string("copy_url")) + { + std::string sl_url = gAgent.getSLURL(); + LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(sl_url)); + + LLSD args; + args["SLURL"] = sl_url; + LLNotifications::instance().add("CopySLURL", args); + } + else if (item == std::string("landmark")) + { + LLFloaterReg::showInstance("add_landmark"); + } + else if (item == std::string("cut")) + { + location_entry->cut(); + } + else if (item == std::string("copy")) + { + location_entry->copy(); + } + else if (item == std::string("paste")) + { + location_entry->paste(); + } + else if (item == std::string("delete")) + { + location_entry->deleteSelection(); + } + else if (item == std::string("select_all")) + { + location_entry->selectAll(); + } +} + +bool LLNavigationBar::onLocationContextMenuItemEnabled(const LLSD& userdata) +{ + std::string item = userdata.asString(); + const LLLineEditor* location_entry = mCmbLocation->getTextEntry(); + + if (item == std::string("can_cut")) + { + return location_entry->canCut(); + } + else if (item == std::string("can_copy")) + { + return location_entry->canCopy(); + } + else if (item == std::string("can_paste")) + { + return location_entry->canPaste(); + } + else if (item == std::string("can_delete")) + { + return location_entry->canDeselect(); + } + else if (item == std::string("can_select_all")) + { + return location_entry->canSelectAll(); + } + + return false; +} + +void LLNavigationBar::handleLoginComplete() +{ + mCmbLocation->handleLoginComplete(); +} + +void LLNavigationBar::invokeSearch(std::string search_text) +{ + LLFloaterReg::showInstance("search", LLSD().insert("panel", "all").insert("id", LLSD(search_text))); +} diff --git a/indra/newview/llnavigationbar.h b/indra/newview/llnavigationbar.h new file mode 100644 index 0000000000000000000000000000000000000000..4c8375839e87d1f07fce52b801981cdf60979452 --- /dev/null +++ b/indra/newview/llnavigationbar.h @@ -0,0 +1,103 @@ +/** + * @file llnavigationbar.h + * @brief Navigation bar definition + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLNAVIGATIONBAR_H +#define LL_LLNAVIGATIONBAR_H + +#include "llpanel.h" + +extern S32 NAVIGATION_BAR_HEIGHT; + +class LLButton; +class LLLocationInputCtrl; +class LLMenuGL; +class LLLineEditor; + +/** + * Web browser-like navigation bar. + */ +class LLNavigationBar +: public LLPanel +{ + LOG_CLASS(LLNavigationBar); + +public: + static LLNavigationBar* getInstance(); + virtual ~LLNavigationBar(); + + /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + + void handleLoginComplete(); + +private: + LLNavigationBar(); + + void rebuildTeleportHistoryMenu(); + void showTeleportHistoryMenu(); + void invokeSearch(std::string search_text); + + // callbacks + bool onLocationContextMenuItemEnabled(const LLSD& userdata); + void onLocationContextMenuItemClicked(const LLSD& userdata); + void onTeleportHistoryMenuItemClicked(const LLSD& userdata); + void onTeleportHistoryChanged(); + void onBackButtonClicked(); + void onBackOrForwardButtonHeldDown(const LLSD& param); + void onForwardButtonClicked(); + void onHomeButtonClicked(); + void onHelpButtonClicked(); + void onLocationSelection(); + void onLocationPrearrange(const LLSD& data); + void onLocationHistoryLoaded(); + void onSearchCommit(); + void onRegionNameResponse( + std::string typed_location, + std::string region_name, + LLVector3 local_coords, + U64 region_handle, const std::string& url, + const LLUUID& snapshot_id, bool teleport); + + static LLNavigationBar *sInstance; + + LLMenuGL* mLocationContextMenu; + LLMenuGL* mTeleportHistoryMenu; + LLButton* mBtnBack; + LLButton* mBtnForward; + LLButton* mBtnHome; + LLButton* mBtnHelp; + LLLineEditor* mLeSearch; + LLLocationInputCtrl* mCmbLocation; +}; + +#endif diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 23d32fee81e3923e2c5d03c30e18199b12e24acb..b40af37f7ec1df8b9baa76ce5a4d34a319cf82d3 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -1,7 +1,7 @@ /** * @file llnetmap.cpp * @author James Cook - * @brief Display of surrounding regions, objects, and agents. View contained by LLFloaterMap. + * @brief Display of surrounding regions, objects, and agents. * * $LicenseInfo:firstyear=2001&license=viewergpl$ * @@ -36,83 +36,43 @@ #include "llnetmap.h" #include "indra_constants.h" -#include "llui.h" -#include "llmath.h" // clampf() +#include "llmath.h" +#include "llfloaterreg.h" #include "llfocusmgr.h" #include "llrender.h" +#include "llui.h" + +#include "llglheaders.h" #include "llagent.h" -#include "llcallingcard.h" -#include "llcolorscheme.h" -#include "llviewercontrol.h" -#include "llfloateravatarinfo.h" -#include "llfloaterworldmap.h" -#include "llframetimer.h" +#include "llappviewer.h" // for gDisconnected +#include "llcallingcard.h" // LLAvatarTracker #include "lltracker.h" -#include "llmenugl.h" #include "llsurface.h" -#include "lltextbox.h" -#include "lluictrlfactory.h" -#include "lluuid.h" #include "llviewercamera.h" -#include "llviewerimage.h" -#include "llviewerimagelist.h" -#include "llviewermenu.h" +#include "llviewercontrol.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" -#include "llviewerwindow.h" -#include "llvoavatar.h" #include "llworld.h" #include "llworldmapview.h" // shared draw code -#include "llappviewer.h" // Only for constants! - -#include "llglheaders.h" -using namespace LLOldEvents; +static LLDefaultWidgetRegistry::Register<LLNetMap> r1("net_map"); const F32 MAP_SCALE_MIN = 64; const F32 MAP_SCALE_MID = 172; const F32 MAP_SCALE_MAX = 512; const F32 MAP_SCALE_INCREMENT = 16; const F32 MAP_MIN_PICK_DIST = 4; -const F32 MAP_MINOR_DIR_THRESHOLD = 0.08f; - -const S32 TRACKING_RADIUS = 3; - -LLNetMap::LLNetMap(const std::string& name) : - LLPanel(name), - mScale(128.f), - mObjectMapTPM(1.f), - mObjectMapPixels(255.f), - mTargetPanX( 0.f ), - mTargetPanY( 0.f ), - mCurPanX( 0.f ), - mCurPanY( 0.f ), - mUpdateNow( FALSE ) -{ - mScale = gSavedSettings.getF32("MiniMapScale"); - mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); +const F32 MAX_PRIM_RADIUS = 256.0f; // Don't try to draw giant mega-prims on the mini map +LLNetMap::LLNetMap (const Params & p) : + LLUICtrl (p), + mScale(128.0f), + mBackgroundColor (p.bg_color()), + mRotateMap(FALSE) +{ mObjectImageCenterGlobal = gAgent.getCameraPositionGlobal(); - - // Register event listeners for popup menu - (new LLScaleMap())->registerListener(this, "MiniMap.ZoomLevel"); - (new LLStopTracking())->registerListener(this, "MiniMap.StopTracking"); - (new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking"); - (new LLShowAgentProfile())->registerListener(this, "MiniMap.ShowProfile"); - (new LLEnableProfile())->registerListener(this, "MiniMap.EnableProfile"); - - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_mini_map.xml"); - - updateMinorDirections(); - - LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_mini_map.xml", this); - if (!menu) - { - menu = new LLMenuGL(LLStringUtil::null); - } - menu->setVisible(FALSE); - mPopupMenuHandle = menu->getHandle(); + mPixelsPerMeter = mScale / REGION_WIDTH_METERS; } LLNetMap::~LLNetMap() @@ -121,26 +81,21 @@ LLNetMap::~LLNetMap() void LLNetMap::setScale( F32 scale ) { - mScale = scale; - if (mScale == 0.f) - { - mScale = 0.1f; - } - gSavedSettings.setF32("MiniMapScale", mScale); - + mScale = llclamp(scale, 0.1f, 16.f*1024.f); // [reasonably small , unreasonably large] + if (mObjectImagep.notNull()) { - F32 width = (F32)(getRect().getWidth()); - F32 height = (F32)(getRect().getHeight()); - F32 diameter = sqrt(width * width + height * height); - F32 region_widths = diameter / mScale; + F32 half_width = (F32)(getRect().getWidth() / 2); + F32 half_height = (F32)(getRect().getHeight() / 2); + F32 radius = sqrt( half_width * half_width + half_height * half_height ); + F32 region_widths = (2.f*radius)/mScale; F32 meters = region_widths * LLWorld::getInstance()->getRegionWidthInMeters(); F32 num_pixels = (F32)mObjectImagep->getWidth(); - mObjectMapTPM = num_pixels / meters; - mObjectMapPixels = diameter; + mObjectMapTPM = num_pixels/meters; + mObjectMapPixels = 2.f*radius; } - mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); + mPixelsPerMeter = mScale / REGION_WIDTH_METERS; mUpdateNow = TRUE; } @@ -157,21 +112,27 @@ void LLNetMap::translatePan( F32 delta_x, F32 delta_y ) void LLNetMap::draw() { static LLFrameTimer map_timer; - + static LLCachedControl<LLColor4> map_avatar_color(gSavedSkinSettings, "MapAvatarColor", LLColor4::white); + static LLCachedControl<LLColor4> map_avatar_friend_color(gSavedSkinSettings, "MapAvatarFriendColor", LLColor4::white); + static LLCachedControl<LLColor4> map_track_color(gSavedSkinSettings, "MapTrackColor", LLColor4::white); + static LLCachedControl<LLColor4> map_track_disabled_color(gSavedSkinSettings, "MapTrackDisabledColor", LLColor4::white); + static LLCachedControl<LLColor4> map_frustum_color(gSavedSkinSettings, "MapFrustumColor", LLColor4::white); + static LLCachedControl<LLColor4> map_frustum_rotating_color(gSavedSkinSettings, "MapFrustumRotatingColor", LLColor4::white); + if (mObjectImagep.isNull()) { createObjectImage(); } - + mCurPanX = lerp(mCurPanX, mTargetPanX, LLCriticalDamp::getInterpolant(0.1f)); mCurPanY = lerp(mCurPanY, mTargetPanY, LLCriticalDamp::getInterpolant(0.1f)); + // Prepare a scissor region F32 rotation = 0; - // Prepare a scissor region { LLGLEnable scissor(GL_SCISSOR_TEST); - + { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLLocalClipRect clip(getLocalRect()); @@ -179,11 +140,9 @@ void LLNetMap::draw() glMatrixMode(GL_MODELVIEW); // Draw background rectangle - if(isBackgroundVisible()) - { - gGL.color4fv(isBackgroundOpaque() ? getBackgroundColor().mV : getTransparentColor().mV); - gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0); - } + LLColor4 background_color = mBackgroundColor.get(); + gGL.color4fv( background_color.mV ); + gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0); } // region 0,0 is in the middle @@ -194,8 +153,7 @@ void LLNetMap::draw() gGL.translatef( (F32) center_sw_left, (F32) center_sw_bottom, 0.f); - BOOL rotate_map = gSavedSettings.getBOOL( "MiniMapRotate" ); - if( rotate_map ) + if( mRotateMap ) { // rotate subsequent draws to agent rotation rotation = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); @@ -204,9 +162,6 @@ void LLNetMap::draw() // figure out where agent is S32 region_width = llround(LLWorld::getInstance()->getRegionWidthInMeters()); - LLColor4 this_region_color = gColors.getColor( "NetMapThisRegion" ); - LLColor4 live_region_color = gColors.getColor( "NetMapLiveRegion" ); - LLColor4 dead_region_color = gColors.getColor( "NetMapDeadRegion" ); for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) @@ -224,10 +179,18 @@ void LLNetMap::draw() F32 top = bottom + mScale ; F32 right = left + mScale ; - gGL.color4fv(regionp == gAgent.getRegion() ? this_region_color.mV : live_region_color.mV); + if (regionp == gAgent.getRegion()) + { + gGL.color4f(1.f, 1.f, 1.f, 1.f); + } + else + { + gGL.color4f(0.8f, 0.8f, 0.8f, 1.f); + } + if (!regionp->isAlive()) { - gGL.color4fv(dead_region_color.mV); + gGL.color4f(1.f, 0.5f, 0.5f, 1.f); } @@ -319,57 +282,86 @@ void LLNetMap::draw() // Mouse pointer in local coordinates S32 local_mouse_x; S32 local_mouse_y; + //localMouse(&local_mouse_x, &local_mouse_y); LLUI::getCursorPositionLocal(this, &local_mouse_x, &local_mouse_y); mClosestAgentToCursor.setNull(); F32 closest_dist = F32_MAX; // Draw avatars - LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); - LLColor4 friend_color = gColors.getColor( "MapFriend" ); - std::vector<LLUUID> avatar_ids; - std::vector<LLVector3d> positions; - LLWorld::getInstance()->getAvatars(&avatar_ids, &positions); - for(U32 i=0; i<avatar_ids.size(); i++) + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { + LLViewerRegion* regionp = *iter; + const LLVector3d& origin_global = regionp->getOriginGlobal(); + + S32 count = regionp->mMapAvatars.count(); + S32 i; + LLVector3 pos_local; + U32 compact_local; + U8 bits; // TODO: it'd be very cool to draw these in sorted order from lowest Z to highest. // just be careful to sort the avatar IDs along with the positions. -MG - pos_map = globalPosToView(positions[i], rotate_map); + for (i = 0; i < count; i++) + { + compact_local = regionp->mMapAvatars.get(i); - LLWorldMapView::drawAvatar( - pos_map.mV[VX], pos_map.mV[VY], - is_agent_friend(avatar_ids[i]) ? friend_color : avatar_color, - pos_map.mV[VZ]); + bits = compact_local & 0xFF; + pos_local.mV[VZ] = F32(bits) * 4.f; + compact_local >>= 8; - F32 dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), LLVector2(local_mouse_x,local_mouse_y)); - if(dist_to_cursor < MAP_MIN_PICK_DIST && dist_to_cursor < closest_dist) - { - closest_dist = dist_to_cursor; - mClosestAgentToCursor = avatar_ids[i]; + bits = compact_local & 0xFF; + pos_local.mV[VY] = (F32)bits; + compact_local >>= 8; + + bits = compact_local & 0xFF; + pos_local.mV[VX] = (F32)bits; + + pos_global.setVec( pos_local ); + pos_global += origin_global; + + pos_map = globalPosToView(pos_global); + + BOOL show_as_friend = FALSE; + if( i < regionp->mMapAvatarIDs.count()) + { + show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(regionp->mMapAvatarIDs.get(i)) != NULL); + } + LLWorldMapView::drawAvatar( + pos_map.mV[VX], pos_map.mV[VY], + show_as_friend ? map_avatar_friend_color : map_avatar_color, + pos_map.mV[VZ]); + + F32 dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), LLVector2(local_mouse_x,local_mouse_y)); + if(dist_to_cursor < MAP_MIN_PICK_DIST && dist_to_cursor < closest_dist) + { + closest_dist = dist_to_cursor; + mClosestAgentToCursor = regionp->mMapAvatarIDs.get(i); + } } } // Draw dot for autopilot target if (gAgent.getAutoPilot()) { - drawTracking( gAgent.getAutoPilotTargetGlobal(), rotate_map, gTrackColor ); + drawTracking( gAgent.getAutoPilotTargetGlobal(), map_track_color ); } else { LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); if ( LLTracker::TRACKING_AVATAR == tracking_status ) { - drawTracking( LLAvatarTracker::instance().getGlobalPos(), rotate_map, gTrackColor ); + drawTracking( LLAvatarTracker::instance().getGlobalPos(), map_track_color ); } else if ( LLTracker::TRACKING_LANDMARK == tracking_status || LLTracker::TRACKING_LOCATION == tracking_status ) { - drawTracking( LLTracker::getTrackedPositionGlobal(), rotate_map, gTrackColor ); + drawTracking( LLTracker::getTrackedPositionGlobal(), map_track_color ); } } // Draw dot for self avatar position pos_global = gAgent.getPositionGlobal(); - pos_map = globalPosToView(pos_global, rotate_map); + pos_map = globalPosToView(pos_global); LLUIImagePtr you = LLWorldMapView::sAvatarYouSmallImage; you->draw( llround(pos_map.mV[VX]) - you->getWidth()/2, @@ -391,9 +383,9 @@ void LLNetMap::draw() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - if( rotate_map ) + if( mRotateMap ) { - gGL.color4fv(gColors.getColor("NetMapFrustum").mV); + gGL.color4fv((map_frustum_color()).mV); gGL.begin( LLRender::TRIANGLES ); gGL.vertex2f( ctr_x, ctr_y ); @@ -403,7 +395,7 @@ void LLNetMap::draw() } else { - gGL.color4fv(gColors.getColor("NetMapFrustumRotating").mV); + gGL.color4fv((map_frustum_rotating_color()).mV); // If we don't rotate the map, we have to rotate the frustum. gGL.pushMatrix(); @@ -418,27 +410,11 @@ void LLNetMap::draw() } } - // Rotation of 0 means that North is up - setDirectionPos( getChild<LLTextBox>("e_label"), rotation); - setDirectionPos( getChild<LLTextBox>("n_label"), rotation + F_PI_BY_TWO); - setDirectionPos( getChild<LLTextBox>("w_label"), rotation + F_PI); - setDirectionPos( getChild<LLTextBox>("s_label"), rotation + F_PI + F_PI_BY_TWO); - - setDirectionPos( getChild<LLTextBox>("ne_label"), rotation + F_PI_BY_TWO / 2); - setDirectionPos( getChild<LLTextBox>("nw_label"), rotation + F_PI_BY_TWO + F_PI_BY_TWO / 2); - setDirectionPos( getChild<LLTextBox>("sw_label"), rotation + F_PI + F_PI_BY_TWO / 2); - setDirectionPos( getChild<LLTextBox>("se_label"), rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); - - LLView::draw(); + LLUICtrl::draw(); } -void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent) +LLVector3 LLNetMap::globalPosToView( const LLVector3d& global_pos ) { - LLPanel::reshape(width, height, called_from_parent); - updateMinorDirections(); -} - -LLVector3 LLNetMap::globalPosToView( const LLVector3d& global_pos, BOOL rotated ){ LLVector3d relative_pos_global = global_pos - gAgent.getCameraPositionGlobal(); LLVector3 pos_local; pos_local.setVec(relative_pos_global); // convert to floats from doubles @@ -447,7 +423,7 @@ LLVector3 LLNetMap::globalPosToView( const LLVector3d& global_pos, BOOL rotated pos_local.mV[VY] *= mPixelsPerMeter; // leave Z component in meters - if( rotated ) + if( mRotateMap ) { F32 radians = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); LLQuaternion rot(radians, LLVector3(0.f, 0.f, 1.f)); @@ -460,10 +436,10 @@ LLVector3 LLNetMap::globalPosToView( const LLVector3d& global_pos, BOOL rotated return pos_local; } -void LLNetMap::drawTracking(const LLVector3d& pos_global, BOOL rotated, - const LLColor4& color, BOOL draw_arrow ) +void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, + BOOL draw_arrow ) { - LLVector3 pos_local = globalPosToView( pos_global, rotated ); + LLVector3 pos_local = globalPosToView( pos_global ); if( (pos_local.mV[VX] < 0) || (pos_local.mV[VY] < 0) || (pos_local.mV[VX] >= getRect().getWidth()) || @@ -486,16 +462,16 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, BOOL rotated, } } -LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y, BOOL rotated ) +LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y ) { x -= llround(getRect().getWidth() / 2 + mCurPanX); y -= llround(getRect().getHeight() / 2 + mCurPanY); - LLVector3 pos_local( (F32)x, (F32)y, 0.f ); + LLVector3 pos_local( (F32)x, (F32)y, 0 ); F32 radians = - atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); - if( rotated ) + if( mRotateMap ) { LLQuaternion rot(radians, LLVector3(0.f, 0.f, 1.f)); pos_local.rotVec( rot ); @@ -524,87 +500,55 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rec { return FALSE; } - LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y , gSavedSettings.getBOOL( "MiniMapRotate" )) ); + + // mToolTipMsg = "[AGENT][REGION](Double-click to open Map)" + + LLStringUtil::format_map_t args; + std::string fullname; + if(mClosestAgentToCursor.notNull() && gCacheName->getFullName(mClosestAgentToCursor, fullname)) + { + args["[AGENT]"] = fullname + "\n"; + } + else + { + args["[AGENT]"] = ""; + } + + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y ) ); if( region ) { - msg.assign(""); - std::string fullname; - if(mClosestAgentToCursor.notNull() && gCacheName->getFullName(mClosestAgentToCursor, fullname)) - { - msg.append(fullname); - msg.append("\n"); - } - msg.append( region->getName() ); - -#ifndef LL_RELEASE_FOR_DOWNLOAD - std::string buffer; - msg.append("\n"); - buffer = region->getHost().getHostName(); - msg.append(buffer); - msg.append("\n"); - buffer = region->getHost().getString(); - msg.append(buffer); -#endif - msg.append("\n"); - msg.append(getToolTip()); - + args["[REGION]"] = region->getName() + "\n"; + } + else + { + args["[REGION]"] = ""; + } + + msg = mToolTipMsg; + LLStringUtil::format(msg, args); + + // set sticky_rect + if (region) + { S32 SLOP = 4; localPointToScreen( x - SLOP, y - SLOP, &(sticky_rect_screen->mLeft), &(sticky_rect_screen->mBottom) ); sticky_rect_screen->mRight = sticky_rect_screen->mLeft + 2 * SLOP; sticky_rect_screen->mTop = sticky_rect_screen->mBottom + 2 * SLOP; - handled = TRUE; - } - if(!handled) - { - return LLPanel::handleToolTip(x, y, msg, sticky_rect_screen); } + + handled = TRUE; return handled; } -void LLNetMap::setDirectionPos( LLTextBox* text_box, F32 rotation ) -{ - // Rotation is in radians. - // Rotation of 0 means x = 1, y = 0 on the unit circle. - - F32 half_height = (F32)( (getRect().getHeight() - text_box->getRect().getHeight()) / 2); - F32 half_width = (F32)( (getRect().getWidth() - text_box->getRect().getWidth()) / 2); - F32 radius = llmin( half_height, half_width ); - - // Inset by a little to account for position display. - radius -= 8.f; - - text_box->setOrigin(llround(half_width + radius * cos( rotation )), - llround(half_height + radius * sin( rotation ))); -} - -void LLNetMap::updateMinorDirections() -{ - if (getChild<LLTextBox>("ne_label") == NULL) - { - return; - } - - // Hide minor directions if they cover too much of the map - bool show_minors = getChild<LLTextBox>("ne_label")->getRect().getHeight() < MAP_MINOR_DIR_THRESHOLD * - llmin(getRect().getWidth(), getRect().getHeight()); - - getChild<LLTextBox>("ne_label")->setVisible(show_minors); - getChild<LLTextBox>("nw_label")->setVisible(show_minors); - getChild<LLTextBox>("sw_label")->setVisible(show_minors); - getChild<LLTextBox>("se_label")->setVisible(show_minors); -} - void LLNetMap::renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius_meters ) { LLVector3 local_pos; local_pos.setVec( pos - mObjectImageCenterGlobal ); - // DEV-17370 - megaprims of size > 4096 cause lag. (go figger.) - const F32 MAX_RADIUS = 256.0f; - F32 radius_clamped = llmin(radius_meters, MAX_RADIUS); + F32 radius_clamped = llmin(radius_meters, MAX_PRIM_RADIUS); S32 diameter_pixels = llround(2 * radius_clamped * mObjectMapTPM); renderPoint( local_pos, color, diameter_pixels ); @@ -699,10 +643,10 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color, void LLNetMap::createObjectImage() { // Find the size of the side of a square that surrounds the circle that surrounds getRect(). - // ... which is, the diagonal of the rect. - F32 width = getRect().getWidth(); - F32 height = getRect().getHeight(); - S32 square_size = llround( sqrt(width*width + height*height) ); + F32 half_width = (F32)(getRect().getWidth() / 2); + F32 half_height = (F32)(getRect().getHeight() / 2); + F32 radius = sqrt( half_width * half_width + half_height * half_height ); + S32 square_size = S32( 2 * radius ); // Find the least power of two >= the minimum size. const S32 MIN_SIZE = 32; @@ -725,75 +669,3 @@ void LLNetMap::createObjectImage() } mUpdateNow = TRUE; } - -BOOL LLNetMap::handleDoubleClick( S32 x, S32 y, MASK mask ) -{ - LLFloaterWorldMap::show(NULL, FALSE); - return TRUE; -} - -BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask) -{ - mClosestAgentAtLastRightClick = mClosestAgentToCursor; - LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get(); - if (menu) - { - menu->buildDrawLabels(); - menu->updateParent(LLMenuGL::sMenuContainer); - LLMenuGL::showPopup(this, menu, x, y); - } - return TRUE; -} - - -// static -bool LLNetMap::LLScaleMap::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; - - S32 level = userdata.asInteger(); - - switch(level) - { - case 0: - self->setScale(MAP_SCALE_MIN); - break; - case 1: - self->setScale(MAP_SCALE_MID); - break; - case 2: - self->setScale(MAP_SCALE_MAX); - break; - default: - break; - } - - return true; -} - -bool LLNetMap::LLStopTracking::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) -{ - LLTracker::stopTracking(NULL); - return true; -} - -bool LLNetMap::LLEnableTracking::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; - self->findControl(userdata["control"].asString())->setValue(LLTracker::isTracking(NULL)); - return true; -} - -bool LLNetMap::LLShowAgentProfile::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; - LLFloaterAvatarInfo::show(self->mClosestAgentAtLastRightClick); - return true; -} - -bool LLNetMap::LLEnableProfile::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; - self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); - return true; -} diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 9fbd5097fdf5fa51ba5416a099bba04b76ee79ec..cebc4af16530bc8d36600f699ef68fa9d0a29a2d 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -33,55 +33,67 @@ #ifndef LL_LLNETMAP_H #define LL_LLNETMAP_H -#include "llpanel.h" -#include "llmemberlistener.h" +#include "llmath.h" +#include "lluictrl.h" #include "v3math.h" #include "v3dmath.h" #include "v4color.h" #include "llimage.h" #include "llimagegl.h" - +class LLColor4U; +class LLCoordGL; class LLTextBox; -class LLNetMap : public LLPanel +class LLNetMap : public LLUICtrl { public: - LLNetMap(const std::string& name); - virtual ~LLNetMap(); + struct Params + : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<LLUIColor> bg_color; - virtual void draw(); - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); - virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); - virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - virtual BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen ); + Params() + : bg_color("bg_color") + {} + }; - void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius ); +protected: + LLNetMap (const Params & p); + friend class LLUICtrlFactory; -private: +public: + virtual ~LLNetMap(); + /*virtual*/ void draw(); + /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + /*virtual*/ BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen ); + void setScale( F32 scale ); - - // *TODO: Enable panning of the mini-map + void setRotateMap( BOOL b ) { mRotateMap = b; } + void setToolTipMsg(const std::string& msg) { mToolTipMsg = msg; } + BOOL getRotateMap( ) { return mRotateMap; } + void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius ); + +private: void translatePan( F32 delta_x, F32 delta_y ); void setPan( F32 x, F32 y ) { mTargetPanX = x; mTargetPanY = y; } - void renderPoint(const LLVector3 &pos, const LLColor4U &color, - S32 diameter, S32 relative_height = 0); - LLVector3 globalPosToView(const LLVector3d& global_pos, BOOL rotated); - LLVector3d viewPosToGlobal(S32 x,S32 y, BOOL rotated); + const LLVector3d& getObjectImageCenterGlobal() { return mObjectImageCenterGlobal; } + void renderPoint(const LLVector3 &pos, const LLColor4U &color, + S32 diameter, S32 relative_height = 0); - void drawTracking( const LLVector3d& pos_global, - BOOL rotated, - const LLColor4& color, - BOOL draw_arrow = TRUE); + LLVector3 globalPosToView(const LLVector3d& global_pos); + LLVector3d viewPosToGlobal(S32 x,S32 y); - void setDirectionPos( LLTextBox* text_box, F32 rotation ); - void updateMinorDirections(); - void createObjectImage(); + void drawTracking( const LLVector3d& pos_global, + const LLColor4& color, + BOOL draw_arrow = TRUE); - LLHandle<LLView> mPopupMenuHandle; + void createObjectImage(); + +private: + LLUIColor mBackgroundColor; F32 mScale; // Size of a region in pixels F32 mPixelsPerMeter; // world meters to map pixels @@ -96,45 +108,11 @@ private: LLPointer<LLImageRaw> mObjectRawImagep; LLPointer<LLImageGL> mObjectImagep; -private: LLUUID mClosestAgentToCursor; LLUUID mClosestAgentAtLastRightClick; - static BOOL sRotateMap; - static LLNetMap* sInstance; - static BOOL isAgentUnderCursor(void*) { return sInstance && sInstance->mClosestAgentToCursor.notNull(); } - static void showAgentProfile(void*); - BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); } - - class LLScaleMap : public LLMemberListener<LLNetMap> - { - public: - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); - }; - - class LLStopTracking : public LLMemberListener<LLNetMap> - { - public: - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); - }; - - class LLEnableTracking : public LLMemberListener<LLNetMap> - { - public: - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); - }; - - class LLShowAgentProfile : public LLMemberListener<LLNetMap> - { - public: - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); - }; - - class LLEnableProfile : public LLMemberListener<LLNetMap> - { - public: - /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); - }; + BOOL mRotateMap; + std::string mToolTipMsg; }; diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ff26707a561b6d9a06f7ec3a1cd9cd3fb104836e --- /dev/null +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -0,0 +1,141 @@ +/** + * @file lloutputmonitorctrl.cpp + * @brief LLOutputMonitorCtrl base class + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "lloutputmonitorctrl.h" + +// library includes +#include "llui.h" + +// viewer includes +#include "llvoiceclient.h" + +static LLDefaultWidgetRegistry::Register<LLOutputMonitorCtrl> r("output_monitor"); + +// The defaults will be initialized in the constructor. +LLColor4 LLOutputMonitorCtrl::sColorMuted; +LLColor4 LLOutputMonitorCtrl::sColorOverdriven; +LLColor4 LLOutputMonitorCtrl::sColorNormal; +LLColor4 LLOutputMonitorCtrl::sColorBound; +S32 LLOutputMonitorCtrl::sRectsNumber = 0; +F32 LLOutputMonitorCtrl::sRectWidthRatio = 0.f; +F32 LLOutputMonitorCtrl::sRectHeightRatio = 0.f; + +LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) +: LLView(p), + mPower(0), + mIsMuted(true) +{ + static LLUICachedControl<LLColor4> output_monitor_muted_color("OutputMonitorMutedColor", LLColor4::orange); + static LLUICachedControl<LLColor4> output_monitor_overdriven_color("OutputMonitorOverdrivenColor", LLColor4::red); + static LLUICachedControl<LLColor4> output_monitor_normal_color("OutputMonitorNotmalColor", LLColor4::green); + static LLUICachedControl<LLColor4> output_monitor_bound_color("OutputMonitorBoundColor", LLColor4::white); + static LLUICachedControl<S32> output_monitor_rects_number("OutputMonitorRectanglesNumber", 20); + static LLUICachedControl<F32> output_monitor_rect_width_ratio("OutputMonitorRectangleWidthRatio", 0.5f); + static LLUICachedControl<F32> output_monitor_rect_height_ratio("OutputMonitorRectangleHeightRatio", 0.8f); + + // IAN BUG compare to existing pattern where these are members - some will change per-widget and need to be anyway + // sent feedback to PE + + // *TODO: it looks suboptimal to load the defaults every time an output monitor is constructed. + sColorMuted = output_monitor_muted_color; + sColorOverdriven = output_monitor_overdriven_color; + sColorNormal = output_monitor_normal_color; + sColorBound = output_monitor_bound_color; + sRectsNumber = output_monitor_rects_number; + sRectWidthRatio = output_monitor_rect_width_ratio; + sRectHeightRatio = output_monitor_rect_height_ratio; + + mBorder = p.draw_border; +} + +LLOutputMonitorCtrl::~LLOutputMonitorCtrl() +{ +} + +void LLOutputMonitorCtrl::setPower(F32 val) +{ + mPower = llmax(0.f, llmin(1.f, val)); +} + +void LLOutputMonitorCtrl::draw() +{ + // + // Fill the monitor with a bunch of small rectangles. + // The rectangles will be filled with gradient color, + // beginning with sColorNormal and ending with sColorOverdriven. + // + // *TODO: would using a (partially drawn) pixmap instead be faster? + // + const int monh = getRect().getHeight(); + const int monw = getRect().getWidth(); + int maxrects = sRectsNumber; + const int period = llmax(1, monw / maxrects, 0, 0); // "1" - min value for the period + const int rectw = llmax(1, llfloor(period * sRectWidthRatio), 0, 0); // "1" - min value for the rect's width + const int recth = llfloor(monh * sRectHeightRatio); + + if(period == 1 && rectw == 1) //if we have so small control, then "maxrects = monitor's_width - 2*monitor_border's_width + maxrects = monw-2; + + const int nrects = mIsMuted ? maxrects : llfloor(mPower * maxrects); // how many rects to draw? + const int rectbtm = (monh - recth) / 2; + const int recttop = rectbtm + recth; + + LLColor4 rect_color; + + for (int i=1, xpos = 0; i <= nrects; i++) + { + // Calculate color to use for the current rectangle. + if (mIsMuted) + { + rect_color = sColorMuted; + } + else + { + F32 frac = (mPower * i/nrects) / LLVoiceClient::OVERDRIVEN_POWER_LEVEL; + // Use overdriven color if the power exceeds overdriven level. + if (frac > 1.0f) + frac = 1.0f; + rect_color = lerp(sColorNormal, sColorOverdriven, frac); + } + + // Draw rectangle filled with the color. + gl_rect_2d(xpos, recttop, xpos+rectw, rectbtm, rect_color, TRUE); + xpos += period; + } + + // + // Draw bounding box. + // + if(mBorder) + gl_rect_2d(0, monh, monw, 0, sColorBound, FALSE); +} diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h new file mode 100644 index 0000000000000000000000000000000000000000..881ad0f010d7d4dee1ab11b430ddd4a333198ae8 --- /dev/null +++ b/indra/newview/lloutputmonitorctrl.h @@ -0,0 +1,92 @@ +/** + * @file lloutputmonitorctrl.h + * @brief LLOutputMonitorCtrl base class + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLOUTPUTMONITORCTRL_H +#define LL_LLOUTPUTMONITORCTRL_H + +#include "v4color.h" +#include "llview.h" + +class LLTextBox; +class LLUICtrlFactory; + +// +// Classes +// + +class LLOutputMonitorCtrl +: public LLView +{ +public: + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Optional<bool> draw_border; + + Params() + { + draw_border = true; + name = "output_monitor"; + follows.flags(FOLLOWS_LEFT|FOLLOWS_TOP); + mouse_opaque = false; + }; + }; +protected: + bool mBorder; + LLOutputMonitorCtrl(const Params&); + friend class LLUICtrlFactory; + +public: + virtual ~LLOutputMonitorCtrl(); + + // llview overrides + virtual void draw(); + + void setPower(F32 val); + F32 getPower(F32 val) const { return mPower; } + + bool getIsMuted() const { return mIsMuted; } + void setIsMuted(bool val) { mIsMuted = val; } + +private: + static LLColor4 sColorMuted; + static LLColor4 sColorNormal; + static LLColor4 sColorOverdriven; + static LLColor4 sColorBound; + static S32 sRectsNumber; + static F32 sRectWidthRatio; + static F32 sRectHeightRatio; + + F32 mPower; + bool mIsMuted; +}; + +#endif diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp index b16f56d0d807ce9ebf4d4a3ef4bfddc0a2699b01..2ccd729e0a2821770b0d413478012a029a9f3825 100644 --- a/indra/newview/lloverlaybar.cpp +++ b/indra/newview/lloverlaybar.cpp @@ -45,7 +45,6 @@ #include "llfocusmgr.h" #include "llimview.h" #include "llmediaremotectrl.h" -#include "llpanelaudiovolume.h" #include "llparcel.h" #include "lltextbox.h" #include "llui.h" @@ -60,7 +59,7 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llvoiceclient.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llvoiceremotectrl.h" #include "llwebbrowserctrl.h" #include "llselectmgr.h" @@ -89,7 +88,7 @@ void* LLOverlayBar::createMediaRemote(void* userdata) void* LLOverlayBar::createVoiceRemote(void* userdata) { LLOverlayBar *self = (LLOverlayBar*)userdata; - self->mVoiceRemote = new LLVoiceRemoteCtrl(std::string("voice_remote")); + self->mVoiceRemote = new LLVoiceRemoteCtrl(); return self->mVoiceRemote; } @@ -110,23 +109,24 @@ LLOverlayBar::LLOverlayBar() mBuilt = false; - LLCallbackMap::map_t factory_map; - factory_map["media_remote"] = LLCallbackMap(LLOverlayBar::createMediaRemote, this); - factory_map["voice_remote"] = LLCallbackMap(LLOverlayBar::createVoiceRemote, this); - factory_map["chat_bar"] = LLCallbackMap(LLOverlayBar::createChatBar, this); + mFactoryMap["media_remote"] = LLCallbackMap(LLOverlayBar::createMediaRemote, this); + mFactoryMap["voice_remote"] = LLCallbackMap(LLOverlayBar::createVoiceRemote, this); + mFactoryMap["chat_bar"] = LLCallbackMap(LLOverlayBar::createChatBar, this); - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml", &factory_map); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml"); } BOOL LLOverlayBar::postBuild() { - childSetAction("IM Received",onClickIMReceived,this); childSetAction("Set Not Busy",onClickSetNotBusy,this); childSetAction("Mouselook",onClickMouselook,this); childSetAction("Stand Up",onClickStandUp,this); childSetAction("Flycam",onClickFlycam,this); childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible")); + mVoiceRemote->expandOrCollapse(); + mMediaRemote->expandOrCollapse(); + setFocusRoot(TRUE); mBuilt = true; @@ -168,8 +168,9 @@ void LLOverlayBar::layoutButtons() // calculate button widths const S32 MAX_BUTTON_WIDTH = 150; + const S32 STATUS_BAR_PAD = 10; S32 segment_width = llclamp(lltrunc((F32)(bar_width) / (F32)button_list.size()), 0, MAX_BUTTON_WIDTH); - S32 btn_width = segment_width - gSavedSettings.getS32("StatusBarPad"); + S32 btn_width = segment_width - STATUS_BAR_PAD; // Evenly space all buttons, starting from left S32 left = 0; @@ -282,13 +283,6 @@ void LLOverlayBar::refresh() // Static functions //----------------------------------------------------------------------- -// static -void LLOverlayBar::onClickIMReceived(void*) -{ - gIMMgr->setFloaterOpen(TRUE); -} - - // static void LLOverlayBar::onClickSetNotBusy(void*) { diff --git a/indra/newview/lloverlaybar.h b/indra/newview/lloverlaybar.h index 852d033a103d9733b8d34fefac2b6c533fd7a2ad..f0cf48045829b74df49edc66586cc3ff215e7428 100644 --- a/indra/newview/lloverlaybar.h +++ b/indra/newview/lloverlaybar.h @@ -67,7 +67,6 @@ public: // helpers for returning desired state BOOL musicPlaying() { return mMusicState == PLAYING; } - static void onClickIMReceived(void* data); static void onClickSetNotBusy(void* data); static void onClickMouselook(void* data); static void onClickStandUp(void* data); diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 9d5a4ad01c879738e54e5797de6e1310611de9cf..d7929cc5c2232e817bdc923cb39db0de6fd510e4 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -34,58 +34,17 @@ #include "llpanelavatar.h" -#include "llclassifiedflags.h" -#include "llfontgl.h" -#include "llcachename.h" - -#include "llavatarconstants.h" -#include "lluiconstants.h" -#include "lltextbox.h" -#include "llviewertexteditor.h" -#include "lltexturectrl.h" #include "llagent.h" -#include "llviewerwindow.h" -#include "llbutton.h" +#include "llavatarconstants.h" #include "llcallingcard.h" -#include "llcheckboxctrl.h" -#include "llfloater.h" - -#include "llfloaterfriends.h" -#include "llfloatergroupinfo.h" -#include "llfloaterworldmap.h" -#include "llfloatermute.h" -#include "llfloateravatarinfo.h" -#include "lliconctrl.h" -#include "llinventoryview.h" -#include "lllineeditor.h" -#include "llnameeditor.h" -#include "llmutelist.h" -#include "llpanelclassified.h" -#include "llpanelpick.h" -#include "llscrolllistctrl.h" -#include "llstatusbar.h" -#include "lltabcontainer.h" -#include "lltabcontainervertical.h" +#include "llcombobox.h" +#include "llfriendactions.h" #include "llimview.h" +#include "lltexteditor.h" +#include "lltexturectrl.h" #include "lltooldraganddrop.h" -#include "lluiconstants.h" -#include "llvoavatar.h" -#include "llviewercontrol.h" #include "llviewermenu.h" // *FIX: for is_agent_friend() -#include "llviewergenericmessage.h" // send_generic_message -#include "llviewerobjectlist.h" -#include "llviewerregion.h" -#include "llweb.h" -#include "llinventorymodel.h" -#include "roles_constants.h" -#include "lluictrlfactory.h" - -// Statics -std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels; -BOOL LLPanelAvatar::sAllowFirstLife = FALSE; - -extern void handle_lure(const LLUUID& invitee); -extern void handle_pay_by_id(const LLUUID& payee); +#include "llscrollcontainer.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLDropTarget @@ -98,7 +57,17 @@ extern void handle_pay_by_id(const LLUUID& payee); class LLDropTarget : public LLView { public: - LLDropTarget(const std::string& name, const LLRect& rect, const LLUUID& agent_id); + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + Optional<LLUUID> agent_id; + Params() + { + mouse_opaque(false); + follows.flags(FOLLOWS_ALL); + } + }; + + LLDropTarget(const Params&); ~LLDropTarget(); void doDrop(EDragAndDropType cargo_type, void* cargo_data); @@ -115,17 +84,13 @@ protected: LLUUID mAgentID; }; - -LLDropTarget::LLDropTarget(const std::string& name, const LLRect& rect, - const LLUUID& agent_id) : - LLView(name, rect, NOT_MOUSE_OPAQUE, FOLLOWS_ALL), - mAgentID(agent_id) -{ -} +LLDropTarget::LLDropTarget(const LLDropTarget::Params& p) +: LLView(p), + mAgentID(p.agent_id) +{} LLDropTarget::~LLDropTarget() -{ -} +{} void LLDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) { @@ -149,2156 +114,553 @@ BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return FALSE; } +static LLDefaultWidgetRegistry::Register<LLDropTarget> r("drop_target"); +////////////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- -// LLPanelAvatarTab() +// LLPanelProfileTab() //----------------------------------------------------------------------------- -LLPanelAvatarTab::LLPanelAvatarTab(const std::string& name, const LLRect &rect, - LLPanelAvatar* panel_avatar) -: LLPanel(name, rect), - mPanelAvatar(panel_avatar), - mDataRequested(false) -{ } - -// virtual -void LLPanelAvatarTab::draw() +////////////////////////////////////////////////////////////////////////// +LLPanelProfileTab::LLPanelProfileTab(const LLUUID& avatar_id) + : LLPanel() + , mAvatarId(LLUUID::null) + , mProfileType(PT_UNKNOWN) { - refresh(); - - LLPanel::draw(); + setAvatarId(avatar_id); } -void LLPanelAvatarTab::sendAvatarProfileRequestIfNeeded(const std::string& method) +LLPanelProfileTab::LLPanelProfileTab(const Params& params ) + : LLPanel() + , mAvatarId(LLUUID::null) + , mProfileType(PT_UNKNOWN) { - if (!mDataRequested) - { - std::vector<std::string> strings; - strings.push_back( mPanelAvatar->getAvatarID().asString() ); - send_generic_message(method, strings); - mDataRequested = true; - } -} -//----------------------------------------------------------------------------- -// LLPanelAvatarSecondLife() -//----------------------------------------------------------------------------- -LLPanelAvatarSecondLife::LLPanelAvatarSecondLife(const std::string& name, - const LLRect &rect, - LLPanelAvatar* panel_avatar ) -: LLPanelAvatarTab(name, rect, panel_avatar), - mPartnerID() -{ } -void LLPanelAvatarSecondLife::refresh() +LLPanelProfileTab::~LLPanelProfileTab() { - updatePartnerName(); + // *TODO Vadim: use notNull() instead. (there are several similar cases below) + if(mAvatarId.notNull()) + { + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); + } } -void LLPanelAvatarSecondLife::updatePartnerName() +void LLPanelProfileTab::setAvatarId(const LLUUID& avatar_id) { - if (mPartnerID.notNull()) + if(avatar_id.notNull()) { - std::string first, last; - BOOL found = gCacheName->getName(mPartnerID, first, last); - if (found) + if(mAvatarId.notNull()) { - childSetTextArg("partner_edit", "[FIRST]", first); - childSetTextArg("partner_edit", "[LAST]", last); + LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarId,this); } - childSetEnabled("partner_info", TRUE); + mAvatarId = avatar_id; + LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(),this); + setProfileType(); } } -//----------------------------------------------------------------------------- -// clearControls() -// Empty the data out of the controls, since we have to wait for new -// data off the network. -//----------------------------------------------------------------------------- -void LLPanelAvatarSecondLife::clearControls() +void LLPanelProfileTab::setProfileType() { - LLTextureCtrl* image_ctrl = getChild<LLTextureCtrl>("img"); - if(image_ctrl) - { - image_ctrl->setImageAssetID(LLUUID::null); - } - childSetValue("about", ""); - childSetValue("born", ""); - childSetValue("acct", ""); - - childSetTextArg("partner_edit", "[FIRST]", LLStringUtil::null); - childSetTextArg("partner_edit", "[LAST]", LLStringUtil::null); - - mPartnerID = LLUUID::null; - - LLScrollListCtrl* group_list = getChild<LLScrollListCtrl>("groups"); - if(group_list) - { - group_list->deleteAllItems(); - } - LLScrollListCtrl* ratings_list = getChild<LLScrollListCtrl>("ratings"); - if(ratings_list) - { - ratings_list->deleteAllItems(); - } - + mProfileType = (gAgentID == mAvatarId) ? PT_OWN : PT_OTHER; } - -//----------------------------------------------------------------------------- -// enableControls() -//----------------------------------------------------------------------------- -void LLPanelAvatarSecondLife::enableControls(BOOL self) +void LLPanelProfileTab::onActivate(const LLUUID& id) { - childSetEnabled("img", self); - childSetEnabled("about", self); - childSetVisible("allow_publish", self); - childSetEnabled("allow_publish", self); - childSetVisible("?", self); - childSetEnabled("?", self); + setAvatarId(id); + updateData(); } - -// static -void LLPanelAvatarSecondLife::onClickImage(void *) -{ } - -// static -void LLPanelAvatarSecondLife::onDoubleClickGroup(void* data) +void LLPanelProfileTab::onAddFriend() { - LLPanelAvatarSecondLife* self = (LLPanelAvatarSecondLife*)data; - - - LLScrollListCtrl* group_list = self->getChild<LLScrollListCtrl>("groups"); - if(group_list) + if (getAvatarId().notNull()) { - LLScrollListItem* item = group_list->getFirstSelected(); - - if(item && item->getUUID().notNull()) - { - llinfos << "Show group info " << item->getUUID() << llendl; - - LLFloaterGroupInfo::showFromUUID(item->getUUID()); - } + std::string name; + gCacheName->getFullName(getAvatarId(),name); + LLFriendActions::requestFriendshipDialog(getAvatarId(), name); } } -// static -void LLPanelAvatarSecondLife::onClickPublishHelp(void *) -{ - LLNotifications::instance().add("ClickPublishHelpAvatar"); -} - -// static -void LLPanelAvatarSecondLife::onClickPartnerHelp(void *) +void LLPanelProfileTab::onIM() { - LLNotifications::instance().add("ClickPartnerHelpAvatar", LLSD(), LLSD(), onClickPartnerHelpLoadURL); -} - -// static -bool LLPanelAvatarSecondLife::onClickPartnerHelpLoadURL(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - if (option == 0) + if (getAvatarId().notNull()) { - LLWeb::loadURL("http://secondlife.com/partner"); + std::string name; + gCacheName->getFullName(getAvatarId(), name); + gIMMgr->addSession(name, IM_NOTHING_SPECIAL, getAvatarId()); } - return false; } -// static -void LLPanelAvatarSecondLife::onClickPartnerInfo(void *data) +void LLPanelProfileTab::onTeleport() { - LLPanelAvatarSecondLife* self = (LLPanelAvatarSecondLife*) data; - if (self->mPartnerID.notNull()) + if(getAvatarId().notNull()) { - LLFloaterAvatarInfo::showFromProfile(self->mPartnerID, - self->getScreenRect()); + LLFriendActions::offerTeleport(getAvatarId()); } } +////////////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- -// LLPanelAvatarFirstLife() +// LLPanelAvatarProfile() //----------------------------------------------------------------------------- -LLPanelAvatarFirstLife::LLPanelAvatarFirstLife(const std::string& name, - const LLRect &rect, - LLPanelAvatar* panel_avatar ) -: LLPanelAvatarTab(name, rect, panel_avatar) +////////////////////////////////////////////////////////////////////////// +LLPanelAvatarProfile::LLPanelAvatarProfile(const LLUUID& avatar_id /* = LLUUID::null */) + : LLPanelProfileTab(avatar_id), mUpdated(false), mEditMode(false), mStatusCombobox(NULL), mStatusMessage(NULL) { + updateData(); } -void LLPanelAvatarFirstLife::enableControls(BOOL self) +LLPanelAvatarProfile::LLPanelAvatarProfile(const Params& params ) + : LLPanelProfileTab(params), mUpdated(false), mEditMode(false), mStatusCombobox(NULL), mStatusMessage(NULL) { - childSetEnabled("img", self); - childSetEnabled("about", self); } -//----------------------------------------------------------------------------- -// postBuild -//----------------------------------------------------------------------------- - -BOOL LLPanelAvatarSecondLife::postBuild(void) +LLPanelAvatarProfile::~LLPanelAvatarProfile() { - childSetEnabled("born", FALSE); - childSetEnabled("partner_edit", FALSE); - childSetAction("partner_help",onClickPartnerHelp,this); - childSetAction("partner_info", onClickPartnerInfo, this); - childSetEnabled("partner_info", mPartnerID.notNull()); - - childSetAction("?",onClickPublishHelp,this); - BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() ); - enableControls(own_avatar); - - childSetVisible("About:",LLPanelAvatar::sAllowFirstLife); - childSetVisible("(500 chars)",LLPanelAvatar::sAllowFirstLife); - childSetVisible("about",LLPanelAvatar::sAllowFirstLife); - - childSetVisible("allow_publish",LLPanelAvatar::sAllowFirstLife); - childSetVisible("?",LLPanelAvatar::sAllowFirstLife); - - childSetVisible("online_yes",FALSE); - - // These are cruft but may still exist in some xml files - // TODO: remove the following 2 lines once translators grab these changes - childSetVisible("online_unknown",FALSE); - childSetVisible("online_no",FALSE); - - childSetAction("Find on Map", LLPanelAvatar::onClickTrack, getPanelAvatar()); - childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar()); - - childSetAction("Add Friend...", LLPanelAvatar::onClickAddFriend, getPanelAvatar()); - childSetAction("Pay...", LLPanelAvatar::onClickPay, getPanelAvatar()); - childSetAction("Mute", LLPanelAvatar::onClickMute, getPanelAvatar() ); - - childSetAction("Offer Teleport...", LLPanelAvatar::onClickOfferTeleport, - getPanelAvatar() ); - - childSetDoubleClickCallback("groups", onDoubleClickGroup, this ); - - getChild<LLTextureCtrl>("img")->setFallbackImageName("default_profile_picture.j2c"); - - return TRUE; + if(getAvatarId().notNull()) + { + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); + } } -BOOL LLPanelAvatarFirstLife::postBuild(void) +void* LLPanelAvatarProfile::create(void* data /* = NULL */) { - BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() ); - enableControls(own_avatar); - - getChild<LLTextureCtrl>("img")->setFallbackImageName("default_profile_picture.j2c"); - - return TRUE; + LLSD* id = NULL; + if(data) + { + id = static_cast<LLSD*>(data); + return new LLPanelAvatarProfile(LLUUID(id->asUUID())); + } + return new LLPanelAvatarProfile(); } -BOOL LLPanelAvatarNotes::postBuild(void) +void LLPanelAvatarProfile::updateData() { - childSetCommitCallback("notes edit",onCommitNotes,this); - - LLTextEditor* te = getChild<LLTextEditor>("notes edit"); - if(te) te->setCommitOnFocusLost(TRUE); - return TRUE; + if (getAvatarId().notNull()) + { + LLAvatarPropertiesProcessor::getInstance()->sendDataRequest(getAvatarId(),APT_PROPERTIES); + LLAvatarPropertiesProcessor::getInstance()->sendDataRequest(getAvatarId(),APT_GROUPS); + } } -BOOL LLPanelAvatarWeb::postBuild(void) +void LLPanelAvatarProfile::processProperties(void* data, EAvatarProcessorType type) { - childSetKeystrokeCallback("url_edit", onURLKeystroke, this); - childSetCommitCallback("load", onCommitLoad, this); - - childSetAction("web_profile_help",onClickWebProfileHelp,this); - - childSetCommitCallback("url_edit",onCommitURL,this); - - childSetControlName("auto_load","AutoLoadWebProfiles"); - - mWebBrowser = getChild<LLWebBrowserCtrl>("profile_html"); - - // links open in internally - mWebBrowser->setOpenInExternalBrowser( false ); - - // observe browser events - mWebBrowser->addObserver( this ); + if(APT_PROPERTIES == type) + { + const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data); + if(avatar_data && getAvatarId() == avatar_data->avatar_id) + { + childSetValue("register_date", avatar_data->born_on); + childSetValue("sl_description_edit", avatar_data->about_text); + childSetValue("fl_description_edit",avatar_data->fl_about_text); + childSetValue("2nd_life_pic", avatar_data->image_id); + childSetValue("1st_life_pic", avatar_data->fl_image_id); + childSetValue("homepage_edit", avatar_data->profile_url); - return TRUE; -} + if (!isEditMode()) + { + setCaptionText(avatar_data); + } + childSetValue("show_in_search_checkbox", (BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); -BOOL LLPanelAvatarClassified::postBuild(void) -{ - childSetAction("New...",onClickNew,NULL); - childSetAction("Delete...",onClickDelete,NULL); - return TRUE; -} + if (avatar_data->partner_id.notNull()) + { + std::string first, last; + BOOL found = gCacheName->getName(avatar_data->partner_id, first, last); + if (found) + { + childSetTextArg("partner_text", "[FIRST]", first); + childSetTextArg("partner_text", "[LAST]", last); + } + } + //http://secondlife.com/partner -BOOL LLPanelAvatarPicks::postBuild(void) -{ - childSetAction("New...",onClickNew,NULL); - childSetAction("Delete...",onClickDelete,NULL); - return TRUE; -} + bool online = avatar_data->flags & AVATAR_ONLINE; + if(is_agent_friend(avatar_data->avatar_id)) + { + // Online status NO could be because they are hidden + // If they are a friend, we may know the truth! + online = LLAvatarTracker::instance().isBuddyOnline(avatar_data->avatar_id); + } + childSetValue("online_status", online ? + "Online" : "Offline"); + childSetColor("online_status", online ? + LLColor4::green : LLColor4::red); -BOOL LLPanelAvatarAdvanced::postBuild() -{ - for(size_t ii = 0; ii < LL_ARRAY_SIZE(mWantToCheck); ++ii) - mWantToCheck[ii] = NULL; - for(size_t ii = 0; ii < LL_ARRAY_SIZE(mSkillsCheck); ++ii) - mSkillsCheck[ii] = NULL; - mWantToCount = (8>LL_ARRAY_SIZE(mWantToCheck))?LL_ARRAY_SIZE(mWantToCheck):8; - for(S32 tt=0; tt < mWantToCount; ++tt) - { - std::string ctlname = llformat("chk%d", tt); - mWantToCheck[tt] = getChild<LLCheckBoxCtrl>(ctlname); - } - mSkillsCount = (6>LL_ARRAY_SIZE(mSkillsCheck))?LL_ARRAY_SIZE(mSkillsCheck):6; - - for(S32 tt=0; tt < mSkillsCount; ++tt) + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); + } + if (isOwnProfile() && NULL != mStatusCombobox) + { + std::string status; + if (gAgent.getAFK()) + { + status = "away"; + } + else if (gAgent.getBusy()) + { + status = "busy"; + } + else + { + status = "online"; + } + mStatusCombobox->setValue(status); + } + } + else if(APT_GROUPS == type) { - //Find the Skills checkboxes and save off thier controls - std::string ctlname = llformat("schk%d",tt); - mSkillsCheck[tt] = getChild<LLCheckBoxCtrl>(ctlname); + LLAvatarGroups* avatar_groups = static_cast<LLAvatarGroups*>(data); + if(avatar_groups) + { + std::string groups; + LLAvatarGroups::group_list_t::const_iterator it = avatar_groups->group_list.begin(); + for(; avatar_groups->group_list.end() != it; ++it) + { + LLAvatarGroups::LLGroupData group_data = *it; + groups += group_data.group_name; + groups += ", "; + } + childSetValue("sl_groups",groups); + } } - - mWantToEdit = getChild<LLLineEditor>("want_to_edit"); - mSkillsEdit = getChild<LLLineEditor>("skills_edit"); - childSetVisible("skills_edit",LLPanelAvatar::sAllowFirstLife); - childSetVisible("want_to_edit",LLPanelAvatar::sAllowFirstLife); - - return TRUE; } -//----------------------------------------------------------------------------- -// LLPanelAvatarWeb -//----------------------------------------------------------------------------- -LLPanelAvatarWeb::LLPanelAvatarWeb(const std::string& name, const LLRect& rect, - LLPanelAvatar* panel_avatar) -: LLPanelAvatarTab(name, rect, panel_avatar), - mWebBrowser(NULL) +void LLPanelAvatarProfile::clear() { + clearControls(); } -LLPanelAvatarWeb::~LLPanelAvatarWeb() +void LLPanelAvatarProfile::clearControls() { - // stop observing browser events - if ( mWebBrowser ) - { - mWebBrowser->remObserver( this ); - }; + childSetValue("2nd_life_pic",LLUUID::null); + childSetValue("1st_life_pic",LLUUID::null); + childSetValue("online_status",LLStringUtil::null); + childSetValue("status_message",LLStringUtil::null); + childSetValue("sl_description_edit",LLStringUtil::null); + childSetValue("fl_description_edit",LLStringUtil::null); + childSetValue("sl_groups",LLStringUtil::null); + childSetValue("homepage_edit",LLStringUtil::null); + childSetValue("register_date",LLStringUtil::null); + childSetValue("acc_status_text",LLStringUtil::null); + childSetTextArg("partner_text", "[FIRST]", LLStringUtil::null); + childSetTextArg("partner_text", "[LAST]", LLStringUtil::null); } -void LLPanelAvatarWeb::refresh() +void LLPanelAvatarProfile::setCaptionText(const LLAvatarData* avatar_data) { - if (mNavigateTo != "") + std::string caption_text = avatar_data->caption_text; + if(caption_text.empty()) { - llinfos << "Loading " << mNavigateTo << llendl; - mWebBrowser->navigateTo( mNavigateTo ); - mNavigateTo = ""; - } -} - - -void LLPanelAvatarWeb::enableControls(BOOL self) -{ - childSetEnabled("url_edit",self); -} - -void LLPanelAvatarWeb::setWebURL(std::string url) -{ - bool changed_url = (mHome != url); + LLStringUtil::format_map_t args; + caption_text = getString("CaptionTextAcctInfo"); + BOOL transacted = (avatar_data->flags & AVATAR_TRANSACTED); + BOOL identified = (avatar_data->flags & AVATAR_IDENTIFIED); + BOOL age_verified = (avatar_data->flags & AVATAR_AGEVERIFIED); // Not currently getting set in dataserver/lldataavatar.cpp for privacy considerations - mHome = url; - bool have_url = !mHome.empty(); - - childSetText("url_edit", mHome); - childSetEnabled("load", mHome.length() > 0); + const char* ACCT_TYPE[] = { + "AcctTypeResident", + "AcctTypeTrial", + "AcctTypeCharterMember", + "AcctTypeEmployee" + }; + U8 caption_index = llclamp(avatar_data->caption_index, (U8)0, (U8)(LL_ARRAY_SIZE(ACCT_TYPE)-1)); + args["[ACCTTYPE]"] = getString(ACCT_TYPE[caption_index]); + + std::string payment_text = " "; + const S32 DEFAULT_CAPTION_LINDEN_INDEX = 3; + if(caption_index != DEFAULT_CAPTION_LINDEN_INDEX) + { + if(transacted) + { + payment_text = "PaymentInfoUsed"; + } + else if (identified) + { + payment_text = "PaymentInfoOnFile"; + } + else + { + payment_text = "NoPaymentInfoOnFile"; + } + args["[PAYMENTINFO]"] = getString(payment_text); - if (have_url - && gSavedSettings.getBOOL("AutoLoadWebProfiles")) - { - if (changed_url) + std::string age_text = age_verified ? "AgeVerified" : "NotAgeVerified"; + // Do not display age verification status at this time + //args["[[AGEVERIFICATION]]"] = mPanelSecondLife->getString(age_text); + args["[AGEVERIFICATION]"] = " "; + } + else { - load(mHome); + args["[PAYMENTINFO]"] = " "; + args["[AGEVERIFICATION]"] = " "; } + LLStringUtil::format(caption_text, args); } - else - { - childSetVisible("profile_html",false); - childSetVisible("status_text", false); - } + + childSetValue("acc_status_text", caption_text); } -// static -void LLPanelAvatarWeb::onCommitURL(LLUICtrl* ctrl, void* data) +void LLPanelAvatarProfile::onAddFriendButtonClick() { - LLPanelAvatarWeb* self = (LLPanelAvatarWeb*)data; - - if (!self) return; - - self->load( self->childGetText("url_edit") ); + onAddFriend(); } -// static -void LLPanelAvatarWeb::onClickWebProfileHelp(void *) +void LLPanelAvatarProfile::onIMButtonClick() { - LLNotifications::instance().add("ClickWebProfileHelpAvatar"); + onIM(); } -void LLPanelAvatarWeb::load(std::string url) +void LLPanelAvatarProfile::onTeleportButtonClick() { - bool have_url = (!url.empty()); - - - childSetVisible("profile_html", have_url); - childSetVisible("status_text", have_url); - childSetText("status_text", LLStringUtil::null); - - if (have_url) - { - mNavigateTo = url; - } + onTeleport(); } -//static -void LLPanelAvatarWeb::onURLKeystroke(LLLineEditor* editor, void* data) +void LLPanelAvatarProfile::onCallButtonClick() { - LLPanelAvatarWeb* self = (LLPanelAvatarWeb*)data; - if (!self) return; - LLSD::String url = editor->getText(); - self->childSetEnabled("load", url.length() > 0); - return; + } -// static -void LLPanelAvatarWeb::onCommitLoad(LLUICtrl* ctrl, void* data) +void LLPanelAvatarProfile::onShareButtonClick() { - LLPanelAvatarWeb* self = (LLPanelAvatarWeb*)data; - if (!self) return; +} - LLSD::String valstr = ctrl->getValue().asString(); - LLSD::String urlstr = self->childGetText("url_edit"); - if (valstr == "") // load url string into browser panel +/*virtual*/ BOOL LLPanelAvatarProfile::postBuild(void) +{ + mStatusCombobox = getChild<LLComboBox>("status_combo", TRUE, FALSE); + if (NULL != mStatusCombobox) { - self->load(urlstr); + mStatusCombobox->setCommitCallback(boost::bind(&LLPanelAvatarProfile::onStatusChanged, this)); } - else if (valstr == "open") // open in user's external browser + mStatusMessage = getChild<LLLineEditor>("status_me_message_edit", TRUE, FALSE); + if (NULL != mStatusMessage) { - if (!urlstr.empty()) - { - LLWeb::loadURLExternal(urlstr); - } + mStatusMessage->setCommitCallback(boost::bind(&LLPanelAvatarProfile::onStatusMessageChanged, this)); } - else if (valstr == "home") // reload profile owner's home page + + childSetCommitCallback("add_friend",(boost::bind(&LLPanelAvatarProfile::onAddFriendButtonClick,this)),NULL); + childSetCommitCallback("im",(boost::bind(&LLPanelAvatarProfile::onIMButtonClick,this)),NULL); + childSetCommitCallback("call",(boost::bind(&LLPanelAvatarProfile::onCallButtonClick,this)),NULL); + childSetCommitCallback("teleport",(boost::bind(&LLPanelAvatarProfile::onTeleportButtonClick,this)),NULL); + childSetCommitCallback("share",(boost::bind(&LLPanelAvatarProfile::onShareButtonClick,this)),NULL); + + LLTextureCtrl* pic = getChild<LLTextureCtrl>("2nd_life_pic",TRUE,FALSE); + if(pic) { - if (!self->mHome.empty()) - { - self->load(self->mHome); - } + pic->setFallbackImageName("default_land_picture.j2c"); + } + pic = getChild<LLTextureCtrl>("1st_life_pic",TRUE,FALSE); + if(pic) + { + pic->setFallbackImageName("default_land_picture.j2c"); } -} -void LLPanelAvatarWeb::onStatusTextChange( const EventType& eventIn ) -{ - childSetText("status_text", eventIn.getStringValue() ); -} + clearControls(); + updateChildrenList(); -void LLPanelAvatarWeb::onLocationChange( const EventType& eventIn ) -{ - childSetText("url_edit", eventIn.getStringValue() ); + return TRUE; } - - -//----------------------------------------------------------------------------- -// LLPanelAvatarAdvanced -//----------------------------------------------------------------------------- -LLPanelAvatarAdvanced::LLPanelAvatarAdvanced(const std::string& name, - const LLRect& rect, - LLPanelAvatar* panel_avatar) -: LLPanelAvatarTab(name, rect, panel_avatar), - mWantToCount(0), - mSkillsCount(0), - mWantToEdit( NULL ), - mSkillsEdit( NULL ) +void LLPanelAvatarProfile::onOpen(const LLSD& key) { + setAvatarId(key); + scrollToTop(); + updateChildrenList(); + updateData(); } -void LLPanelAvatarAdvanced::enableControls(BOOL self) +void LLPanelAvatarProfile::scrollToTop() { - S32 t; - for(t=0;t<mWantToCount;t++) - { - if(mWantToCheck[t])mWantToCheck[t]->setEnabled(self); - } - for(t=0;t<mSkillsCount;t++) + LLScrollContainer* scrollContainer = getChild<LLScrollContainer>("profile_scroll", FALSE, FALSE); + if (NULL != scrollContainer) { - if(mSkillsCheck[t])mSkillsCheck[t]->setEnabled(self); + scrollContainer->goToTop(); } - - if (mWantToEdit) mWantToEdit->setEnabled(self); - if (mSkillsEdit) mSkillsEdit->setEnabled(self); - childSetEnabled("languages_edit",self); } -void LLPanelAvatarAdvanced::setWantSkills(U32 want_to_mask, const std::string& want_to_text, - U32 skills_mask, const std::string& skills_text, - const std::string& languages_text) +void LLPanelAvatarProfile::updateChildrenList() { - for(int id =0;id<mWantToCount;id++) - { - mWantToCheck[id]->set( want_to_mask & 1<<id ); - } - for(int id =0;id<mSkillsCount;id++) + if (mUpdated || isEditMode()) { - mSkillsCheck[id]->set( skills_mask & 1<<id ); + return; } - if (mWantToEdit && mSkillsEdit) + switch (mProfileType) { - mWantToEdit->setText( want_to_text ); - mSkillsEdit->setText( skills_text ); - } + case PT_OWN: + childSetVisible("status_panel",FALSE); + childSetVisible("profile_buttons_panel",FALSE); + childSetVisible("title_groups_text",FALSE); + childSetVisible("sl_groups",FALSE); + mUpdated = true; + childSetVisible("status_me_panel",TRUE); + childSetVisible("profile_me_buttons_panel",TRUE); - childSetText("languages_edit",languages_text); -} + break; + case PT_OTHER: + childSetVisible("status_me_panel",FALSE); + childSetVisible("profile_me_buttons_panel",FALSE); + + childSetVisible("status_panel",TRUE); + childSetVisible("profile_buttons_panel",TRUE); + childSetVisible("title_groups_text",TRUE); + childSetVisible("sl_groups",TRUE); -void LLPanelAvatarAdvanced::getWantSkills(U32* want_to_mask, std::string& want_to_text, - U32* skills_mask, std::string& skills_text, - std::string& languages_text) + // account actions + childSetVisible("account_actions_panel", FALSE); + childSetVisible("partner_edit_link", FALSE); + + mUpdated = true; + break; + case PT_UNKNOWN: break;//do nothing + default: + llassert(false); + } +} +void LLPanelAvatarProfile::onStatusChanged() { - if (want_to_mask) + LLSD::String status = mStatusCombobox->getValue().asString(); + + if ("online" == status) { - *want_to_mask = 0; - for(int t=0;t<mWantToCount;t++) - { - if(mWantToCheck[t]->get()) - *want_to_mask |= 1<<t; - } + gAgent.clearAFK(); + gAgent.clearBusy(); } - if (skills_mask) + else if ("away" == status) { - *skills_mask = 0; - for(int t=0;t<mSkillsCount;t++) - { - if(mSkillsCheck[t]->get()) - *skills_mask |= 1<<t; - } + gAgent.clearBusy(); + gAgent.setAFK(); } - if (mWantToEdit) + else if ("busy" == status) { - want_to_text = mWantToEdit->getText(); + gAgent.clearAFK(); + gAgent.setBusy(); + LLNotifications::instance().add("BusyModeSet"); } - - if (mSkillsEdit) + else { - skills_text = mSkillsEdit->getText(); } - languages_text = childGetText("languages_edit"); -} - -//----------------------------------------------------------------------------- -// LLPanelAvatarNotes() -//----------------------------------------------------------------------------- -LLPanelAvatarNotes::LLPanelAvatarNotes(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar) -: LLPanelAvatarTab(name, rect, panel_avatar) -{ -} - -void LLPanelAvatarNotes::refresh() -{ - sendAvatarProfileRequestIfNeeded("avatarnotesrequest"); -} - -void LLPanelAvatarNotes::clearControls() -{ - childSetText("notes edit", getString("Loading")); - childSetEnabled("notes edit", false); } -// static -void LLPanelAvatarNotes::onCommitNotes(LLUICtrl*, void* userdata) +void LLPanelAvatarProfile::onStatusMessageChanged() { - LLPanelAvatarNotes* self = (LLPanelAvatarNotes*)userdata; - - self->getPanelAvatar()->sendAvatarNotesUpdate(); + updateData(); } //----------------------------------------------------------------------------- -// LLPanelAvatarClassified() +// LLPanelAvatarNotes() //----------------------------------------------------------------------------- -LLPanelAvatarClassified::LLPanelAvatarClassified(const std::string& name, const LLRect& rect, - LLPanelAvatar* panel_avatar) -: LLPanelAvatarTab(name, rect, panel_avatar) +LLPanelAvatarNotes::LLPanelAvatarNotes(const LLUUID& id /* = LLUUID::null */) +:LLPanelProfileTab(id) { + updateData(); } - -void LLPanelAvatarClassified::refresh() +LLPanelAvatarNotes::LLPanelAvatarNotes(const Params& params) +: LLPanelProfileTab(params) { - BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID()); - - LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); - - S32 tab_count = tabs ? tabs->getTabCount() : 0; - - bool allow_new = tab_count < MAX_CLASSIFIEDS; - bool allow_delete = (tab_count > 0); - bool show_help = (tab_count == 0); - - // *HACK: Don't allow making new classifieds from inside the directory. - // The logic for save/don't save when closing is too hairy, and the - // directory is conceptually read-only. JC - bool in_directory = false; - LLView* view = this; - while (view) - { - if (view->getName() == "directory") - { - in_directory = true; - break; - } - view = view->getParent(); - } - childSetEnabled("New...", self && !in_directory && allow_new); - childSetVisible("New...", !in_directory); - childSetEnabled("Delete...", self && !in_directory && allow_delete); - childSetVisible("Delete...", !in_directory); - childSetVisible("classified tab",!show_help); - sendAvatarProfileRequestIfNeeded("avatarclassifiedsrequest"); } - -BOOL LLPanelAvatarClassified::canClose() +LLPanelAvatarNotes::~LLPanelAvatarNotes() { - LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); - for (S32 i = 0; i < tabs->getTabCount(); i++) + if(getAvatarId().notNull()) { - LLPanelClassified* panel = (LLPanelClassified*)tabs->getPanelByIndex(i); - if (!panel->canClose()) - { - return FALSE; - } + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); } - return TRUE; } -BOOL LLPanelAvatarClassified::titleIsValid() +void* LLPanelAvatarNotes::create(void* data) { - LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); - if ( tabs ) + if(data) { - LLPanelClassified* panel = (LLPanelClassified*)tabs->getCurrentPanel(); - if ( panel ) - { - if ( ! panel->titleIsValid() ) - { - return FALSE; - }; - }; - }; - - return TRUE; + LLSD* id = static_cast<LLSD*>(data); + return new LLPanelAvatarNotes(LLUUID(id->asUUID())); + } + return new LLPanelAvatarNotes(); } -void LLPanelAvatarClassified::apply() +void LLPanelAvatarNotes::updateData() { - LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); - for (S32 i = 0; i < tabs->getTabCount(); i++) + LLAvatarPropertiesProcessor::getInstance()->sendDataRequest(getAvatarId(),APT_NOTES); + + const LLRelationship* relation = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); + if(relation) { - LLPanelClassified* panel = (LLPanelClassified*)tabs->getPanelByIndex(i); - panel->apply(); - } -} + childSetEnabled("status_check",TRUE); + childSetEnabled("map_check",TRUE); + childSetEnabled("objects_check",TRUE); + S32 rights = relation->getRightsGrantedTo(); -void LLPanelAvatarClassified::deleteClassifiedPanels() -{ - LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); - if (tabs) - { - tabs->deleteAllTabs(); + childSetValue("status_check",LLRelationship::GRANT_ONLINE_STATUS & rights ? TRUE : FALSE); + childSetValue("map_check",LLRelationship::GRANT_MAP_LOCATION & rights ? TRUE : FALSE); + childSetValue("objects_check",LLRelationship::GRANT_MODIFY_OBJECTS & rights ? TRUE : FALSE); } - - childSetVisible("New...", false); - childSetVisible("Delete...", false); - childSetVisible("loading_text", true); } - -void LLPanelAvatarClassified::processAvatarClassifiedReply(LLMessageSystem* msg, void**) +BOOL LLPanelAvatarNotes::postBuild() { - S32 block = 0; - S32 block_count = 0; - LLUUID classified_id; - std::string classified_name; - LLPanelClassified* panel_classified = NULL; + childSetCommitCallback("status_check",boost::bind(&LLPanelAvatarNotes::onCommitRights,this),NULL); + childSetCommitCallback("map_check",boost::bind(&LLPanelAvatarNotes::onCommitRights,this),NULL); + childSetCommitCallback("objects_check",boost::bind(&LLPanelAvatarNotes::onCommitRights,this),NULL); - LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); + childSetCommitCallback("add_friend",(boost::bind(&LLPanelAvatarProfile::onAddFriend,this)),NULL); + childSetCommitCallback("im",(boost::bind(&LLPanelAvatarProfile::onIM,this)),NULL); +// childSetCommitCallback("call",(boost::bind(&LLPanelAvatarProfile::onCallButtonClick,this))); + childSetCommitCallback("teleport",(boost::bind(&LLPanelAvatarProfile::onTeleport,this)),NULL); +// childSetCommitCallback("share",(boost::bind(&LLPanelAvatarProfile::onShareButtonClick,this))); - // Don't remove old panels. We need to be able to process multiple - // packets for people who have lots of classifieds. JC - - block_count = msg->getNumberOfBlocksFast(_PREHASH_Data); - for (block = 0; block < block_count; block++) + LLTextEditor* te = getChild<LLTextEditor>("notes_edit",TRUE,FALSE); + if(te) { - msg->getUUIDFast(_PREHASH_Data, _PREHASH_ClassifiedID, classified_id, block); - msg->getStringFast(_PREHASH_Data, _PREHASH_Name, classified_name, block); - - panel_classified = new LLPanelClassified(false, false); + te->setCommitCallback(boost::bind(&LLPanelAvatarNotes::onCommitNotes,this)); + te->setCommitOnFocusLost(TRUE); + } - panel_classified->setClassifiedID(classified_id); + return TRUE; +} - // This will request data from the server when the pick is first drawn. - panel_classified->markForServerRequest(); +void LLPanelAvatarNotes::onCommitNotes() +{ + std::string notes = childGetValue("notes_edit").asString(); + LLAvatarPropertiesProcessor::getInstance()-> sendNotes(getAvatarId(),notes); +} - // The button should automatically truncate long names for us - if(tabs) - { - tabs->addTabPanel(panel_classified, classified_name); - } - } +void LLPanelAvatarNotes::onCommitRights() +{ + S32 rights = 0; - // Make sure somebody is highlighted. This works even if there - // are no tabs in the container. - if(tabs) - { - tabs->selectFirstTab(); - } + if(childGetValue("status_check").asBoolean()) + rights |= LLRelationship::GRANT_ONLINE_STATUS; + if(childGetValue("map_check").asBoolean()) + rights |= LLRelationship::GRANT_MAP_LOCATION; + if(childGetValue("objects_check").asBoolean()) + rights |= LLRelationship::GRANT_MODIFY_OBJECTS; - childSetVisible("New...", true); - childSetVisible("Delete...", true); - childSetVisible("loading_text", false); + LLAvatarPropertiesProcessor::getInstance()->sendFriendRights(getAvatarId(),rights); } - -// Create a new classified panel. It will automatically handle generating -// its own id when it's time to save. -// static -void LLPanelAvatarClassified::onClickNew(void* data) +void LLPanelAvatarNotes::clear() { - LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data; + childSetValue("notes_edit",LLStringUtil::null); - LLNotifications::instance().add("AddClassified", LLSD(), LLSD(), boost::bind(&LLPanelAvatarClassified::callbackNew, self, _1, _2)); - + childSetEnabled("status_check",FALSE); + childSetEnabled("map_check",FALSE); + childSetEnabled("objects_check",FALSE); } -bool LLPanelAvatarClassified::callbackNew(const LLSD& notification, const LLSD& response) +void LLPanelAvatarNotes::processProperties(void* data, EAvatarProcessorType type) { - S32 option = LLNotification::getSelectedOption(notification, response); - if (0 == option) + if(APT_NOTES == type) { - LLPanelClassified* panel_classified = new LLPanelClassified(false, false); - panel_classified->initNewClassified(); - LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); - if(tabs) + LLAvatarNotes* avatar_notes = static_cast<LLAvatarNotes*>(data); + if(avatar_notes && getAvatarId() == avatar_notes->target_id) { - tabs->addTabPanel(panel_classified, panel_classified->getClassifiedName()); - tabs->selectLastTab(); + childSetValue("notes_edit",avatar_notes->notes); + childSetEnabled("notes edit", true); + + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); } } - return false; -} - - -// static -void LLPanelAvatarClassified::onClickDelete(void* data) -{ - LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data; - - LLTabContainer* tabs = self->getChild<LLTabContainer>("classified tab"); - LLPanelClassified* panel_classified = NULL; - if(tabs) - { - panel_classified = (LLPanelClassified*)tabs->getCurrentPanel(); - } - if (!panel_classified) return; - - LLSD args; - args["NAME"] = panel_classified->getClassifiedName(); - LLNotifications::instance().add("DeleteClassified", args, LLSD(), boost::bind(&LLPanelAvatarClassified::callbackDelete, self, _1, _2)); - -} - - -bool LLPanelAvatarClassified::callbackDelete(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); - LLPanelClassified* panel_classified=NULL; - if(tabs) - { - panel_classified = (LLPanelClassified*)tabs->getCurrentPanel(); - } - - LLMessageSystem* msg = gMessageSystem; - - if (!panel_classified) return false; - - if (0 == option) - { - msg->newMessageFast(_PREHASH_ClassifiedDelete); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_Data); - msg->addUUIDFast(_PREHASH_ClassifiedID, panel_classified->getClassifiedID()); - gAgent.sendReliableMessage(); - - if(tabs) - { - tabs->removeTabPanel(panel_classified); - } - delete panel_classified; - panel_classified = NULL; - } - return false; -} - - -//----------------------------------------------------------------------------- -// LLPanelAvatarPicks() -//----------------------------------------------------------------------------- -LLPanelAvatarPicks::LLPanelAvatarPicks(const std::string& name, - const LLRect& rect, - LLPanelAvatar* panel_avatar) -: LLPanelAvatarTab(name, rect, panel_avatar) -{ -} - - -void LLPanelAvatarPicks::refresh() -{ - BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID()); - LLTabContainer* tabs = getChild<LLTabContainer>("picks tab"); - S32 tab_count = tabs ? tabs->getTabCount() : 0; - childSetEnabled("New...", self && tab_count < MAX_AVATAR_PICKS); - childSetEnabled("Delete...", self && tab_count > 0); - childSetVisible("New...", self && getPanelAvatar()->isEditable()); - childSetVisible("Delete...", self && getPanelAvatar()->isEditable()); - - sendAvatarProfileRequestIfNeeded("avatarpicksrequest"); -} - - -void LLPanelAvatarPicks::deletePickPanels() -{ - LLTabContainer* tabs = getChild<LLTabContainer>("picks tab"); - if(tabs) - { - tabs->deleteAllTabs(); - } - - childSetVisible("New...", false); - childSetVisible("Delete...", false); - childSetVisible("loading_text", true); -} - -void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**) -{ - S32 block = 0; - S32 block_count = 0; - LLUUID pick_id; - std::string pick_name; - LLPanelPick* panel_pick = NULL; - - LLTabContainer* tabs = getChild<LLTabContainer>("picks tab"); - - // Clear out all the old panels. We'll replace them with the correct - // number of new panels. - deletePickPanels(); - - // The database needs to know for which user to look up picks. - LLUUID avatar_id = getPanelAvatar()->getAvatarID(); - - block_count = msg->getNumberOfBlocks("Data"); - for (block = 0; block < block_count; block++) - { - msg->getUUID("Data", "PickID", pick_id, block); - msg->getString("Data", "PickName", pick_name, block); - - panel_pick = new LLPanelPick(FALSE); - - panel_pick->setPickID(pick_id, avatar_id); - - // This will request data from the server when the pick is first - // drawn. - panel_pick->markForServerRequest(); - - // The button should automatically truncate long names for us - if(tabs) - { - tabs->addTabPanel(panel_pick, pick_name); - } - } - - // Make sure somebody is highlighted. This works even if there - // are no tabs in the container. - if(tabs) - { - tabs->selectFirstTab(); - } - - childSetVisible("New...", true); - childSetVisible("Delete...", true); - childSetVisible("loading_text", false); -} - - -// Create a new pick panel. It will automatically handle generating -// its own id when it's time to save. -// static -void LLPanelAvatarPicks::onClickNew(void* data) -{ - LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; - LLPanelPick* panel_pick = new LLPanelPick(FALSE); - LLTabContainer* tabs = self->getChild<LLTabContainer>("picks tab"); - - panel_pick->initNewPick(); - if(tabs) - { - tabs->addTabPanel(panel_pick, panel_pick->getPickName()); - tabs->selectLastTab(); - } -} - - -// static -void LLPanelAvatarPicks::onClickDelete(void* data) -{ - LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; - LLTabContainer* tabs = self->getChild<LLTabContainer>("picks tab"); - LLPanelPick* panel_pick = tabs?(LLPanelPick*)tabs->getCurrentPanel():NULL; - - if (!panel_pick) return; - - LLSD args; - args["PICK"] = panel_pick->getPickName(); - - LLNotifications::instance().add("DeleteAvatarPick", args, LLSD(), - boost::bind(&LLPanelAvatarPicks::callbackDelete, self, _1, _2)); -} - - -// static -bool LLPanelAvatarPicks::callbackDelete(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - LLTabContainer* tabs = getChild<LLTabContainer>("picks tab"); - LLPanelPick* panel_pick = tabs ? (LLPanelPick*)tabs->getCurrentPanel() : NULL; - LLMessageSystem* msg = gMessageSystem; - - if (!panel_pick) return false; - - if (0 == option) - { - // If the viewer has a hacked god-mode, then this call will - // fail. - if(gAgent.isGodlike()) - { - msg->newMessage("PickGodDelete"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("Data"); - msg->addUUID("PickID", panel_pick->getPickID()); - // *HACK: We need to send the pick's creator id to accomplish - // the delete, and we don't use the query id for anything. JC - msg->addUUID( "QueryID", panel_pick->getPickCreatorID() ); - } - else - { - msg->newMessage("PickDelete"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("Data"); - msg->addUUID("PickID", panel_pick->getPickID()); - } - gAgent.sendReliableMessage(); - - if(tabs) - { - tabs->removeTabPanel(panel_pick); - } - delete panel_pick; - panel_pick = NULL; - } - return false; -} - - -//----------------------------------------------------------------------------- -// LLPanelAvatar -//----------------------------------------------------------------------------- -LLPanelAvatar::LLPanelAvatar( - const std::string& name, - const LLRect &rect, - BOOL allow_edit) - : - LLPanel(name, rect, FALSE), - mPanelSecondLife(NULL), - mPanelAdvanced(NULL), - mPanelClassified(NULL), - mPanelPicks(NULL), - mPanelNotes(NULL), - mPanelFirstLife(NULL), - mPanelWeb(NULL), - mDropTarget(NULL), - mAvatarID( LLUUID::null ), // mAvatarID is set with 'setAvatar' or 'setAvatarID' - mHaveProperties(FALSE), - mHaveStatistics(FALSE), - mHaveNotes(false), - mLastNotes(), - mAllowEdit(allow_edit) -{ - - sAllPanels.push_back(this); - - LLCallbackMap::map_t factory_map; - - factory_map["2nd Life"] = LLCallbackMap(createPanelAvatarSecondLife, this); - factory_map["WebProfile"] = LLCallbackMap(createPanelAvatarWeb, this); - factory_map["Interests"] = LLCallbackMap(createPanelAvatarInterests, this); - factory_map["Picks"] = LLCallbackMap(createPanelAvatarPicks, this); - factory_map["Classified"] = LLCallbackMap(createPanelAvatarClassified, this); - factory_map["1st Life"] = LLCallbackMap(createPanelAvatarFirstLife, this); - factory_map["My Notes"] = LLCallbackMap(createPanelAvatarNotes, this); - - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar.xml", &factory_map); - - selectTab(0); - - -} - -BOOL LLPanelAvatar::postBuild(void) -{ - mTab = getChild<LLTabContainer>("tab"); - childSetAction("Kick",onClickKick,this); - childSetAction("Freeze",onClickFreeze, this); - childSetAction("Unfreeze", onClickUnfreeze, this); - childSetAction("csr_btn", onClickCSR, this); - childSetAction("OK", onClickOK, this); - childSetAction("Cancel", onClickCancel, this); - - if(mTab && !sAllowFirstLife) - { - LLPanel* panel = mTab->getPanelByName("1st Life"); - if (panel) mTab->removeTabPanel(panel); - - panel = mTab->getPanelByName("WebProfile"); - if (panel) mTab->removeTabPanel(panel); - } - childSetVisible("Kick",FALSE); - childSetEnabled("Kick",FALSE); - childSetVisible("Freeze",FALSE); - childSetEnabled("Freeze",FALSE); - childSetVisible("Unfreeze",FALSE); - childSetEnabled("Unfreeze",FALSE); - childSetVisible("csr_btn", FALSE); - childSetEnabled("csr_btn", FALSE); - - return TRUE; -} - - -LLPanelAvatar::~LLPanelAvatar() -{ - sAllPanels.remove(this); -} - - -BOOL LLPanelAvatar::canClose() -{ - return mPanelClassified && mPanelClassified->canClose(); -} - -void LLPanelAvatar::setAvatar(LLViewerObject *avatarp) -{ - // find the avatar and grab the name - LLNameValue *firstname = avatarp->getNVPair("FirstName"); - LLNameValue *lastname = avatarp->getNVPair("LastName"); - - std::string name; - if (firstname && lastname) - { - name.assign( firstname->getString() ); - name.append(" "); - name.append( lastname->getString() ); - } - else - { - name.assign(""); - } - - // If we have an avatar pointer, they must be online. - setAvatarID(avatarp->getID(), name, ONLINE_STATUS_YES); -} - -void LLPanelAvatar::setOnlineStatus(EOnlineStatus online_status) -{ - // Online status NO could be because they are hidden - // If they are a friend, we may know the truth! - if ((ONLINE_STATUS_YES != online_status) - && mIsFriend - && (LLAvatarTracker::instance().isBuddyOnline( mAvatarID ))) - { - online_status = ONLINE_STATUS_YES; - } - - mPanelSecondLife->childSetVisible("online_yes", (online_status == ONLINE_STATUS_YES)); - - // Since setOnlineStatus gets called after setAvatarID - // need to make sure that "Offer Teleport" doesn't get set - // to TRUE again for yourself - if (mAvatarID != gAgent.getID()) - { - childSetVisible("Offer Teleport...",TRUE); - } - - BOOL in_prelude = gAgent.inPrelude(); - if(gAgent.isGodlike()) - { - childSetEnabled("Offer Teleport...", TRUE); - childSetToolTip("Offer Teleport...", childGetValue("TeleportGod").asString()); - } - else if (in_prelude) - { - childSetEnabled("Offer Teleport...",FALSE); - childSetToolTip("Offer Teleport...",childGetValue("TeleportPrelude").asString()); - } - else - { - childSetEnabled("Offer Teleport...", (online_status == ONLINE_STATUS_YES)); - childSetToolTip("Offer Teleport...", childGetValue("TeleportNormal").asString()); - } -} - -void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name, - EOnlineStatus online_status) -{ - if (avatar_id.isNull()) return; - - BOOL avatar_changed = FALSE; - if (avatar_id != mAvatarID) - { - avatar_changed = TRUE; - } - mAvatarID = avatar_id; - - // Determine if we have their calling card. - mIsFriend = is_agent_friend(mAvatarID); - - // setOnlineStatus uses mIsFriend - setOnlineStatus(online_status); - - BOOL own_avatar = (mAvatarID == gAgent.getID() ); - BOOL avatar_is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarID) != NULL; - - mPanelSecondLife->enableControls(own_avatar && mAllowEdit); - mPanelWeb->enableControls(own_avatar && mAllowEdit); - mPanelAdvanced->enableControls(own_avatar && mAllowEdit); - // Teens don't have this. - if (mPanelFirstLife) mPanelFirstLife->enableControls(own_avatar && mAllowEdit); - - LLView *target_view = getChild<LLView>("drop_target_rect"); - if(target_view) - { - if (mDropTarget) - { - delete mDropTarget; - } - mDropTarget = new LLDropTarget("drop target", target_view->getRect(), mAvatarID); - addChild(mDropTarget); - mDropTarget->setAgentID(mAvatarID); - } - - LLNameEditor* name_edit = getChild<LLNameEditor>("name"); - if(name_edit) - { - if (name.empty()) - { - name_edit->setNameID(avatar_id, FALSE); - } - else - { - name_edit->setText(name); - } - } -// if (avatar_changed) - { - // While we're waiting for data off the network, clear out the - // old data. - mPanelSecondLife->clearControls(); - - mPanelPicks->deletePickPanels(); - mPanelPicks->setDataRequested(false); - - mPanelClassified->deleteClassifiedPanels(); - mPanelClassified->setDataRequested(false); - - mPanelNotes->clearControls(); - mPanelNotes->setDataRequested(false); - mHaveNotes = false; - mLastNotes.clear(); - - // Request just the first two pages of data. The picks, - // classifieds, and notes will be requested when that panel - // is made visible. JC - sendAvatarPropertiesRequest(); - - if (own_avatar) - { - if (mAllowEdit) - { - // OK button disabled until properties data arrives - childSetVisible("OK", true); - childSetEnabled("OK", false); - childSetVisible("Cancel",TRUE); - childSetEnabled("Cancel",TRUE); - } - else - { - childSetVisible("OK",FALSE); - childSetEnabled("OK",FALSE); - childSetVisible("Cancel",FALSE); - childSetEnabled("Cancel",FALSE); - } - childSetVisible("Instant Message...",FALSE); - childSetEnabled("Instant Message...",FALSE); - childSetVisible("Mute",FALSE); - childSetEnabled("Mute",FALSE); - childSetVisible("Offer Teleport...",FALSE); - childSetEnabled("Offer Teleport...",FALSE); - childSetVisible("drop target",FALSE); - childSetEnabled("drop target",FALSE); - childSetVisible("Find on Map",FALSE); - childSetEnabled("Find on Map",FALSE); - childSetVisible("Add Friend...",FALSE); - childSetEnabled("Add Friend...",FALSE); - childSetVisible("Pay...",FALSE); - childSetEnabled("Pay...",FALSE); - } - else - { - childSetVisible("OK",FALSE); - childSetEnabled("OK",FALSE); - - childSetVisible("Cancel",FALSE); - childSetEnabled("Cancel",FALSE); - - childSetVisible("Instant Message...",TRUE); - childSetEnabled("Instant Message...",FALSE); - childSetVisible("Mute",TRUE); - childSetEnabled("Mute",FALSE); - - childSetVisible("drop target",TRUE); - childSetEnabled("drop target",FALSE); - - childSetVisible("Find on Map",TRUE); - // Note: we don't always know online status, so always allow gods to try to track - BOOL enable_track = gAgent.isGodlike() || is_agent_mappable(mAvatarID); - childSetEnabled("Find on Map",enable_track); - if (!mIsFriend) - { - childSetToolTip("Find on Map",childGetValue("ShowOnMapNonFriend").asString()); - } - else if (ONLINE_STATUS_YES != online_status) - { - childSetToolTip("Find on Map",childGetValue("ShowOnMapFriendOffline").asString()); - } - else - { - childSetToolTip("Find on Map",childGetValue("ShowOnMapFriendOnline").asString()); - } - childSetVisible("Add Friend...", true); - childSetEnabled("Add Friend...", !avatar_is_friend); - childSetVisible("Pay...",TRUE); - childSetEnabled("Pay...",FALSE); - } - } - - BOOL is_god = FALSE; - if (gAgent.isGodlike()) is_god = TRUE; - - childSetVisible("Kick", is_god); - childSetEnabled("Kick", is_god); - childSetVisible("Freeze", is_god); - childSetEnabled("Freeze", is_god); - childSetVisible("Unfreeze", is_god); - childSetEnabled("Unfreeze", is_god); - childSetVisible("csr_btn", is_god); - childSetEnabled("csr_btn", is_god); -} - - -void LLPanelAvatar::resetGroupList() -{ - // only get these updates asynchronously via the group floater, which works on the agent only - if (mAvatarID != gAgent.getID()) - { - return; - } - - if (mPanelSecondLife) - { - LLScrollListCtrl* group_list = mPanelSecondLife->getChild<LLScrollListCtrl>("groups"); - if (group_list) - { - group_list->deleteAllItems(); - - S32 count = gAgent.mGroups.count(); - LLUUID id; - - for(S32 i = 0; i < count; ++i) - { - LLGroupData group_data = gAgent.mGroups.get(i); - id = group_data.mID; - std::string group_string; - /* Show group title? DUMMY_POWER for Don Grep - if(group_data.mOfficer) - { - group_string = "Officer of "; - } - else - { - group_string = "Member of "; - } - */ - - group_string += group_data.mName; - - LLSD row; - - row["id"] = id ; - row["columns"][0]["value"] = group_string; - row["columns"][0]["font"] = "SANSSERIF_SMALL"; - row["columns"][0]["width"] = 0; - group_list->addElement(row); - } - group_list->sortByColumnIndex(0, TRUE); - } - } -} - -// static -//----------------------------------------------------------------------------- -// onClickIM() -//----------------------------------------------------------------------------- -void LLPanelAvatar::onClickIM(void* userdata) -{ - LLPanelAvatar* self = (LLPanelAvatar*) userdata; - gIMMgr->setFloaterOpen(TRUE); - - std::string name; - LLNameEditor* nameedit = self->mPanelSecondLife->getChild<LLNameEditor>("name"); - if (nameedit) name = nameedit->getText(); - gIMMgr->addSession(name, IM_NOTHING_SPECIAL, self->mAvatarID); -} - - -// static -//----------------------------------------------------------------------------- -// onClickTrack() -//----------------------------------------------------------------------------- -void LLPanelAvatar::onClickTrack(void* userdata) -{ - LLPanelAvatar* self = (LLPanelAvatar*) userdata; - - if( gFloaterWorldMap ) - { - std::string name; - LLNameEditor* nameedit = self->mPanelSecondLife->getChild<LLNameEditor>("name"); - if (nameedit) name = nameedit->getText(); - gFloaterWorldMap->trackAvatar(self->mAvatarID, name); - LLFloaterWorldMap::show(NULL, TRUE); - } -} - - -// static -void LLPanelAvatar::onClickAddFriend(void* userdata) -{ - LLPanelAvatar* self = (LLPanelAvatar*) userdata; - LLNameEditor* name_edit = self->mPanelSecondLife->getChild<LLNameEditor>("name"); - if (name_edit) - { - LLPanelFriends::requestFriendshipDialog(self->getAvatarID(), - name_edit->getText()); - } -} - -//----------------------------------------------------------------------------- -// onClickMute() -//----------------------------------------------------------------------------- -void LLPanelAvatar::onClickMute(void *userdata) -{ - LLPanelAvatar* self = (LLPanelAvatar*) userdata; - - LLUUID agent_id = self->getAvatarID(); - LLNameEditor* name_edit = self->mPanelSecondLife->getChild<LLNameEditor>("name"); - - if (name_edit) - { - std::string agent_name = name_edit->getText(); - LLFloaterMute::showInstance(); - - if (LLMuteList::getInstance()->isMuted(agent_id)) - { - LLFloaterMute::getInstance()->selectMute(agent_id); - } - else - { - LLMute mute(agent_id, agent_name, LLMute::AGENT); - LLMuteList::getInstance()->add(mute); - } - } -} - - -// static -void LLPanelAvatar::onClickOfferTeleport(void *userdata) -{ - LLPanelAvatar* self = (LLPanelAvatar*) userdata; - - handle_lure(self->mAvatarID); -} - - -// static -void LLPanelAvatar::onClickPay(void *userdata) -{ - LLPanelAvatar* self = (LLPanelAvatar*) userdata; - handle_pay_by_id(self->mAvatarID); -} - - -// static -void LLPanelAvatar::onClickOK(void *userdata) -{ - LLPanelAvatar *self = (LLPanelAvatar *)userdata; - - // JC: Only save the data if we actually got the original - // properties. Otherwise we might save blanks into - // the database. - if (self - && self->mHaveProperties) - { - self->sendAvatarPropertiesUpdate(); - - LLTabContainer* tabs = self->getChild<LLTabContainer>("tab"); - if ( tabs->getCurrentPanel() != self->mPanelClassified ) - { - self->mPanelClassified->apply(); - - LLFloaterAvatarInfo *infop = LLFloaterAvatarInfo::getInstance(self->mAvatarID); - if (infop) - { - infop->close(); - } - } - else - { - if ( self->mPanelClassified->titleIsValid() ) - { - self->mPanelClassified->apply(); - - LLFloaterAvatarInfo *infop = LLFloaterAvatarInfo::getInstance(self->mAvatarID); - if (infop) - { - infop->close(); - } - } - } - } -} - -// static -void LLPanelAvatar::onClickCancel(void *userdata) -{ - LLPanelAvatar *self = (LLPanelAvatar *)userdata; - - if (self) - { - LLFloaterAvatarInfo *infop; - if ((infop = LLFloaterAvatarInfo::getInstance(self->mAvatarID))) - { - infop->close(); - } - else - { - // We're in the Search directory and are cancelling an edit - // to our own profile, so reset. - self->sendAvatarPropertiesRequest(); - } - } -} - - -void LLPanelAvatar::sendAvatarPropertiesRequest() -{ - lldebugs << "LLPanelAvatar::sendAvatarPropertiesRequest()" << llendl; - LLMessageSystem *msg = gMessageSystem; - - msg->newMessageFast(_PREHASH_AvatarPropertiesRequest); - msg->nextBlockFast( _PREHASH_AgentData); - msg->addUUIDFast( _PREHASH_AgentID, gAgent.getID() ); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->addUUIDFast( _PREHASH_AvatarID, mAvatarID); - gAgent.sendReliableMessage(); -} - -void LLPanelAvatar::sendAvatarNotesUpdate() -{ - std::string notes = mPanelNotes->childGetValue("notes edit").asString(); - - if (!mHaveNotes - && (notes.empty() || notes == getString("Loading"))) - { - // no notes from server and no user updates - return; - } - if (notes == mLastNotes) - { - // Avatar notes unchanged - return; - } - - LLMessageSystem *msg = gMessageSystem; - - msg->newMessage("AvatarNotesUpdate"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlock("Data"); - msg->addUUID("TargetID", mAvatarID); - msg->addString("Notes", notes); - - gAgent.sendReliableMessage(); -} - - -// static -void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) -{ - LLUUID agent_id; // your id - LLUUID avatar_id; // target of this panel - LLUUID image_id; - LLUUID fl_image_id; - LLUUID partner_id; - std::string about_text; - std::string fl_about_text; - std::string born_on; - S32 charter_member_size = 0; - BOOL allow_publish = FALSE; - //BOOL mature = FALSE; - BOOL identified = FALSE; - BOOL transacted = FALSE; - BOOL age_verified = FALSE; - BOOL online = FALSE; - std::string profile_url; - - U32 flags = 0x0; - - //llinfos << "properties packet size " << msg->getReceiveSize() << llendl; - - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_id ); - - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) - { - LLPanelAvatar* self = *iter; - if (self->mAvatarID != avatar_id) - { - continue; - } - self->childSetEnabled("Instant Message...",TRUE); - self->childSetEnabled("Pay...",TRUE); - self->childSetEnabled("Mute",TRUE); - - self->childSetEnabled("drop target",TRUE); - - self->mHaveProperties = TRUE; - self->enableOKIfReady(); - - msg->getUUIDFast( _PREHASH_PropertiesData, _PREHASH_ImageID, image_id ); - msg->getUUIDFast( _PREHASH_PropertiesData, _PREHASH_FLImageID, fl_image_id ); - msg->getUUIDFast(_PREHASH_PropertiesData, _PREHASH_PartnerID, partner_id); - msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_AboutText, about_text ); - msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_FLAboutText, fl_about_text ); - msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_BornOn, born_on); - msg->getString("PropertiesData","ProfileURL", profile_url); - msg->getU32Fast(_PREHASH_PropertiesData, _PREHASH_Flags, flags); - - identified = (flags & AVATAR_IDENTIFIED); - transacted = (flags & AVATAR_TRANSACTED); - age_verified = (flags & AVATAR_AGEVERIFIED); // Not currently getting set in dataserver/lldataavatar.cpp for privacy considerations - allow_publish = (flags & AVATAR_ALLOW_PUBLISH); - online = (flags & AVATAR_ONLINE); - - U8 caption_index = 0; - std::string caption_text; - charter_member_size = msg->getSize("PropertiesData", "CharterMember"); - if(1 == charter_member_size) - { - msg->getBinaryData("PropertiesData", "CharterMember", &caption_index, 1); - } - else if(1 < charter_member_size) - { - msg->getString("PropertiesData", "CharterMember", caption_text); - } - - - if(caption_text.empty()) - { - LLStringUtil::format_map_t args; - caption_text = self->mPanelSecondLife->getString("CaptionTextAcctInfo"); - - const char* ACCT_TYPE[] = { - "AcctTypeResident", - "AcctTypeTrial", - "AcctTypeCharterMember", - "AcctTypeEmployee" - }; - caption_index = llclamp(caption_index, (U8)0, (U8)(LL_ARRAY_SIZE(ACCT_TYPE)-1)); - args["[ACCTTYPE]"] = self->mPanelSecondLife->getString(ACCT_TYPE[caption_index]); - - std::string payment_text = " "; - const S32 DEFAULT_CAPTION_LINDEN_INDEX = 3; - if(caption_index != DEFAULT_CAPTION_LINDEN_INDEX) - { - if(transacted) - { - payment_text = "PaymentInfoUsed"; - } - else if (identified) - { - payment_text = "PaymentInfoOnFile"; - } - else - { - payment_text = "NoPaymentInfoOnFile"; - } - args["[PAYMENTINFO]"] = self->mPanelSecondLife->getString(payment_text); - std::string age_text = age_verified ? "AgeVerified" : "NotAgeVerified"; - // Do not display age verification status at this time - //args["[[AGEVERIFICATION]]"] = self->mPanelSecondLife->getString(age_text); - args["[AGEVERIFICATION]"] = " "; - } - else - { - args["[PAYMENTINFO]"] = " "; - args["[AGEVERIFICATION]"] = " "; - } - LLStringUtil::format(caption_text, args); - } - - self->mPanelSecondLife->childSetValue("acct", caption_text); - self->mPanelSecondLife->childSetValue("born", born_on); - - EOnlineStatus online_status = (online) ? ONLINE_STATUS_YES : ONLINE_STATUS_NO; - - self->setOnlineStatus(online_status); - - self->mPanelWeb->setWebURL(profile_url); - - LLTextureCtrl* image_ctrl = self->mPanelSecondLife->getChild<LLTextureCtrl>("img"); - if(image_ctrl) - { - image_ctrl->setImageAssetID(image_id); - } - self->childSetValue("about", about_text); - - self->mPanelSecondLife->setPartnerID(partner_id); - self->mPanelSecondLife->updatePartnerName(); - - if (self->mPanelFirstLife) - { - // Teens don't get these - self->mPanelFirstLife->childSetValue("about", fl_about_text); - LLTextureCtrl* image_ctrl = self->mPanelFirstLife->getChild<LLTextureCtrl>("img"); - if(image_ctrl) - { - image_ctrl->setImageAssetID(fl_image_id); - } - - self->mPanelSecondLife->childSetValue("allow_publish", allow_publish); - - } - } -} - -// static -void LLPanelAvatar::processAvatarInterestsReply(LLMessageSystem *msg, void**) -{ - LLUUID agent_id; // your id - LLUUID avatar_id; // target of this panel - - U32 want_to_mask; - std::string want_to_text; - U32 skills_mask; - std::string skills_text; - std::string languages_text; - - //llinfos << "properties packet size " << msg->getReceiveSize() << llendl; - - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_id ); - - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) - { - LLPanelAvatar* self = *iter; - if (self->mAvatarID != avatar_id) - { - continue; - } - - msg->getU32Fast( _PREHASH_PropertiesData, _PREHASH_WantToMask, want_to_mask ); - msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_WantToText, want_to_text ); - msg->getU32Fast( _PREHASH_PropertiesData, _PREHASH_SkillsMask, skills_mask ); - msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_SkillsText, skills_text ); - msg->getString(_PREHASH_PropertiesData, "LanguagesText", languages_text ); - - self->mPanelAdvanced->setWantSkills(want_to_mask, want_to_text, skills_mask, skills_text, languages_text); - } -} - -// Separate function because the groups list can be very long, almost -// filling a packet. JC -// static -void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**) -{ - LLUUID agent_id; // your id - LLUUID avatar_id; // target of this panel - U64 group_powers; - std::string group_title; - LLUUID group_id; - std::string group_name; - LLUUID group_insignia_id; - - llinfos << "groups packet size " << msg->getReceiveSize() << llendl; - - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_id ); - - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) - { - LLPanelAvatar* self = *iter; - if (self->mAvatarID != avatar_id) - { - continue; - } - - LLScrollListCtrl* group_list = self->mPanelSecondLife->getChild<LLScrollListCtrl>("groups"); -// if(group_list) -// { -// group_list->deleteAllItems(); -// } - - S32 group_count = msg->getNumberOfBlocksFast(_PREHASH_GroupData); - if (0 == group_count) - { - if(group_list) group_list->addCommentText(std::string("None")); // *TODO: Translate - } - else - { - for(S32 i = 0; i < group_count; ++i) - { - msg->getU64( _PREHASH_GroupData, "GroupPowers", group_powers, i ); - msg->getStringFast(_PREHASH_GroupData, _PREHASH_GroupTitle, group_title, i ); - msg->getUUIDFast( _PREHASH_GroupData, _PREHASH_GroupID, group_id, i); - msg->getStringFast(_PREHASH_GroupData, _PREHASH_GroupName, group_name, i ); - msg->getUUIDFast( _PREHASH_GroupData, _PREHASH_GroupInsigniaID, group_insignia_id, i ); - - std::string group_string; - if (group_id.notNull()) - { - group_string.assign(group_name); - } - else - { - group_string.assign(""); - } - - // Is this really necessary? Remove existing entry if it exists. - // TODO: clear the whole list when a request for data is made - if (group_list) - { - S32 index = group_list->getItemIndex(group_id); - if ( index >= 0 ) - { - group_list->deleteSingleItem(index); - } - } - - LLSD row; - row["id"] = group_id; - row["columns"][0]["value"] = group_string; - row["columns"][0]["font"] = "SANSSERIF_SMALL"; - if (group_list) - { - group_list->addElement(row); - } - } - } - if(group_list) group_list->sortByColumnIndex(0, TRUE); - } -} - -// Don't enable the OK button until you actually have the data. -// Otherwise you will write blanks back into the database. -void LLPanelAvatar::enableOKIfReady() -{ - if(mHaveProperties && childIsVisible("OK")) - { - childSetEnabled("OK", TRUE); - } - else - { - childSetEnabled("OK", FALSE); - } -} - -void LLPanelAvatar::sendAvatarPropertiesUpdate() -{ - llinfos << "Sending avatarinfo update" << llendl; - BOOL allow_publish = FALSE; - BOOL mature = FALSE; - if (LLPanelAvatar::sAllowFirstLife) - { - allow_publish = childGetValue("allow_publish"); - //A profile should never be mature. - mature = FALSE; - } - U32 want_to_mask = 0x0; - U32 skills_mask = 0x0; - std::string want_to_text; - std::string skills_text; - std::string languages_text; - mPanelAdvanced->getWantSkills(&want_to_mask, want_to_text, &skills_mask, skills_text, languages_text); - - LLUUID first_life_image_id; - std::string first_life_about_text; - if (mPanelFirstLife) - { - first_life_about_text = mPanelFirstLife->childGetValue("about").asString(); - LLTextureCtrl* image_ctrl = mPanelFirstLife->getChild<LLTextureCtrl>("img"); - if(image_ctrl) - { - first_life_image_id = image_ctrl->getImageAssetID(); - } - } - - std::string about_text = mPanelSecondLife->childGetValue("about").asString(); - - LLMessageSystem *msg = gMessageSystem; - - msg->newMessageFast(_PREHASH_AvatarPropertiesUpdate); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast( _PREHASH_AgentID, gAgent.getID() ); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); - msg->nextBlockFast(_PREHASH_PropertiesData); - - LLTextureCtrl* image_ctrl = mPanelSecondLife->getChild<LLTextureCtrl>("img"); - if(image_ctrl) - { - msg->addUUIDFast( _PREHASH_ImageID, image_ctrl->getImageAssetID()); - } - else - { - msg->addUUIDFast( _PREHASH_ImageID, LLUUID::null); - } -// msg->addUUIDFast( _PREHASH_ImageID, mPanelSecondLife->mimage_ctrl->getImageAssetID() ); - msg->addUUIDFast( _PREHASH_FLImageID, first_life_image_id); - msg->addStringFast( _PREHASH_AboutText, about_text); - msg->addStringFast( _PREHASH_FLAboutText, first_life_about_text); - - msg->addBOOL("AllowPublish", allow_publish); - msg->addBOOL("MaturePublish", mature); - msg->addString("ProfileURL", mPanelWeb->childGetText("url_edit")); - gAgent.sendReliableMessage(); - - msg->newMessage("AvatarInterestsUpdate"); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast( _PREHASH_AgentID, gAgent.getID() ); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); - msg->nextBlockFast(_PREHASH_PropertiesData); - msg->addU32Fast( _PREHASH_WantToMask, want_to_mask); - msg->addStringFast( _PREHASH_WantToText, want_to_text); - msg->addU32Fast( _PREHASH_SkillsMask, skills_mask); - msg->addStringFast( _PREHASH_SkillsText, skills_text); - msg->addString( "LanguagesText", languages_text); - gAgent.sendReliableMessage(); -} - -void LLPanelAvatar::selectTab(S32 tabnum) -{ - if(mTab) - { - mTab->selectTab(tabnum); - } -} - -void LLPanelAvatar::selectTabByName(std::string tab_name) -{ - if (mTab) - { - if (tab_name.empty()) - { - mTab->selectFirstTab(); - } - else - { - mTab->selectTabByName(tab_name); - } - } -} - - -void LLPanelAvatar::processAvatarNotesReply(LLMessageSystem *msg, void**) -{ - // extract the agent id - LLUUID agent_id; - msg->getUUID("AgentData", "AgentID", agent_id); - - LLUUID target_id; - msg->getUUID("Data", "TargetID", target_id); - - // look up all panels which have this avatar - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) - { - LLPanelAvatar* self = *iter; - if (self->mAvatarID != target_id) - { - continue; - } - - std::string text; - msg->getString("Data", "Notes", text); - self->childSetValue("notes edit", text); - self->childSetEnabled("notes edit", true); - self->mHaveNotes = true; - self->mLastNotes = text; - } -} - - -void LLPanelAvatar::processAvatarClassifiedReply(LLMessageSystem *msg, void** userdata) -{ - LLUUID agent_id; - LLUUID target_id; - - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TargetID, target_id); - - // look up all panels which have this avatar target - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) - { - LLPanelAvatar* self = *iter; - if (self->mAvatarID != target_id) - { - continue; - } - - self->mPanelClassified->processAvatarClassifiedReply(msg, userdata); - } -} - -void LLPanelAvatar::processAvatarPicksReply(LLMessageSystem *msg, void** userdata) -{ - LLUUID agent_id; - LLUUID target_id; - - msg->getUUID("AgentData", "AgentID", agent_id); - msg->getUUID("AgentData", "TargetID", target_id); - - // look up all panels which have this avatar target - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) - { - LLPanelAvatar* self = *iter; - if (self->mAvatarID != target_id) - { - continue; - } - - self->mPanelPicks->processAvatarPicksReply(msg, userdata); - } -} - -// static -void LLPanelAvatar::onClickKick(void* userdata) -{ - LLPanelAvatar* self = (LLPanelAvatar*) userdata; - - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect(left, top, left+400, top-300); - - LLSD payload; - payload["avatar_id"] = self->mAvatarID; - LLNotifications::instance().add("KickUser", LLSD(), payload, finishKick); -} - -//static -bool LLPanelAvatar::finishKick(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - - if (option == 0) - { - LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID(); - LLMessageSystem* msg = gMessageSystem; - - msg->newMessageFast(_PREHASH_GodKickUser); - msg->nextBlockFast(_PREHASH_UserInfo); - msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() ); - msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID()); - msg->addUUIDFast(_PREHASH_AgentID, avatar_id ); - msg->addU32("KickFlags", KICK_FLAGS_DEFAULT ); - msg->addStringFast(_PREHASH_Reason, response["message"].asString() ); - gAgent.sendReliableMessage(); - } - return false; -} - -// static -void LLPanelAvatar::onClickFreeze(void* userdata) -{ - LLPanelAvatar* self = (LLPanelAvatar*) userdata; - LLSD payload; - payload["avatar_id"] = self->mAvatarID; - LLNotifications::instance().add("FreezeUser", LLSD(), payload, LLPanelAvatar::finishFreeze); -} - -// static -bool LLPanelAvatar::finishFreeze(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - - if (option == 0) - { - LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID(); - LLMessageSystem* msg = gMessageSystem; - - msg->newMessageFast(_PREHASH_GodKickUser); - msg->nextBlockFast(_PREHASH_UserInfo); - msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() ); - msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID()); - msg->addUUIDFast(_PREHASH_AgentID, avatar_id ); - msg->addU32("KickFlags", KICK_FLAGS_FREEZE ); - msg->addStringFast(_PREHASH_Reason, response["message"].asString() ); - gAgent.sendReliableMessage(); - } - return false; -} - -// static -void LLPanelAvatar::onClickUnfreeze(void* userdata) -{ - LLPanelAvatar* self = (LLPanelAvatar*) userdata; - LLSD payload; - payload["avatar_id"] = self->mAvatarID; - LLNotifications::instance().add("UnFreezeUser", LLSD(), payload, LLPanelAvatar::finishUnfreeze); -} - -// static -bool LLPanelAvatar::finishUnfreeze(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - std::string text = response["message"].asString(); - if (option == 0) - { - LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID(); - LLMessageSystem* msg = gMessageSystem; - - msg->newMessageFast(_PREHASH_GodKickUser); - msg->nextBlockFast(_PREHASH_UserInfo); - msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() ); - msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID()); - msg->addUUIDFast(_PREHASH_AgentID, avatar_id ); - msg->addU32("KickFlags", KICK_FLAGS_UNFREEZE ); - msg->addStringFast(_PREHASH_Reason, text ); - gAgent.sendReliableMessage(); - } - return false; -} - -// static -void LLPanelAvatar::onClickCSR(void* userdata) -{ - LLPanelAvatar* self = (LLPanelAvatar*)userdata; - if (!self) return; - - LLNameEditor* name_edit = self->getChild<LLNameEditor>("name"); - if (!name_edit) return; - - std::string name = name_edit->getText(); - if (name.empty()) return; - - std::string url = "http://csr.lindenlab.com/agent/"; - - // slow and stupid, but it's late - S32 len = name.length(); - for (S32 i = 0; i < len; i++) - { - if (name[i] == ' ') - { - url += "%20"; - } - else - { - url += name[i]; - } - } - - LLWeb::loadURL(url); -} - - -void* LLPanelAvatar::createPanelAvatarSecondLife(void* data) -{ - LLPanelAvatar* self = (LLPanelAvatar*)data; - self->mPanelSecondLife = new LLPanelAvatarSecondLife(std::string("2nd Life"),LLRect(),self); - return self->mPanelSecondLife; -} - -void* LLPanelAvatar::createPanelAvatarWeb(void* data) -{ - LLPanelAvatar* self = (LLPanelAvatar*)data; - self->mPanelWeb = new LLPanelAvatarWeb(std::string("Web"),LLRect(),self); - return self->mPanelWeb; -} - -void* LLPanelAvatar::createPanelAvatarInterests(void* data) -{ - LLPanelAvatar* self = (LLPanelAvatar*)data; - self->mPanelAdvanced = new LLPanelAvatarAdvanced(std::string("Interests"),LLRect(),self); - return self->mPanelAdvanced; -} - - -void* LLPanelAvatar::createPanelAvatarPicks(void* data) -{ - LLPanelAvatar* self = (LLPanelAvatar*)data; - self->mPanelPicks = new LLPanelAvatarPicks(std::string("Picks"),LLRect(),self); - return self->mPanelPicks; -} - -void* LLPanelAvatar::createPanelAvatarClassified(void* data) -{ - LLPanelAvatar* self = (LLPanelAvatar*)data; - self->mPanelClassified = new LLPanelAvatarClassified(std::string("Classified"),LLRect(),self); - return self->mPanelClassified; -} - -void* LLPanelAvatar::createPanelAvatarFirstLife(void* data) -{ - LLPanelAvatar* self = (LLPanelAvatar*)data; - self->mPanelFirstLife = new LLPanelAvatarFirstLife(std::string("1st Life"), LLRect(), self); - return self->mPanelFirstLife; -} - -void* LLPanelAvatar::createPanelAvatarNotes(void* data) -{ - LLPanelAvatar* self = (LLPanelAvatar*)data; - self->mPanelNotes = new LLPanelAvatarNotes(std::string("My Notes"),LLRect(),self); - return self->mPanelNotes; } diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 12e1b99360c1b5b6b1f2870c6c7cfc4fbbbc8674..f72eb1990d7635946d462f340ae44fc972f058ad 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -38,8 +38,11 @@ #include "lluuid.h" #include "llwebbrowserctrl.h" +#include "llavatarpropertiesprocessor.h" + class LLButton; class LLCheckBoxCtrl; +class LLComboBox; class LLDropTarget; class LLInventoryItem; class LLLineEditor; @@ -56,6 +59,12 @@ class LLViewerObject; class LLMessageSystem; class LLIconCtrl; class LLWebBrowserCtrl; +class LLVector3d; +class LLFloaterReg; + +class LLPanelMeProfile; +class LLPanelPick; +class LLAgent; enum EOnlineStatus { @@ -63,321 +72,127 @@ enum EOnlineStatus ONLINE_STATUS_YES = 1 }; -// Base class for all sub-tabs inside the avatar profile. Many of these -// panels need to keep track of the parent panel (to get the avatar id) -// and only request data from the database when they are first drawn. JC -class LLPanelAvatarTab : public LLPanel -{ -public: - LLPanelAvatarTab(const std::string& name, const LLRect &rect, - LLPanelAvatar* panel_avatar); - - // Calls refresh() once per frame when panel is visible - /*virtual*/ void draw(); - - LLPanelAvatar* getPanelAvatar() const { return mPanelAvatar; } - - void setDataRequested(bool requested) { mDataRequested = requested; } - bool isDataRequested() const { return mDataRequested; } - - // If the data for this tab has not yet been requested, - // send the request. Used by tabs that are filled in only - // when they are first displayed. - // type is one of "avatarnotesrequest", "avatarpicksrequest", - // or "avatarclassifiedsrequest" - void sendAvatarProfileRequestIfNeeded(const std::string& method); - -private: - LLPanelAvatar* mPanelAvatar; - bool mDataRequested; -}; - -class LLPanelAvatarFirstLife : public LLPanelAvatarTab +class LLPanelProfileTab + : public LLPanel + , public LLAvatarPropertiesObserver { public: - LLPanelAvatarFirstLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar); - - /*virtual*/ BOOL postBuild(void); + + LLPanelProfileTab(const LLUUID& avatar_id); + LLPanelProfileTab(const Params& params ); - void enableControls(BOOL own_avatar); -}; + void setAvatarId(const LLUUID& avatar_id); + const LLUUID& getAvatarId(){return mAvatarId;} -class LLPanelAvatarSecondLife -: public LLPanelAvatarTab -{ -public: - LLPanelAvatarSecondLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar ); - - /*virtual*/ BOOL postBuild(void); - /*virtual*/ void refresh(); - - static void onClickImage( void *userdata); - static void onClickFriends( void *userdata); - static void onDoubleClickGroup(void* userdata); - static void onClickPublishHelp(void *userdata); - static void onClickPartnerHelp(void *userdata); - static bool onClickPartnerHelpLoadURL(const LLSD& notification, const LLSD& response); - static void onClickPartnerInfo(void *userdata); - - // Clear out the controls anticipating new network data. - void clearControls(); - void enableControls(BOOL own_avatar); - void updateOnlineText(BOOL online, BOOL have_calling_card); - void updatePartnerName(); - - void setPartnerID(LLUUID id) { mPartnerID = id; } + virtual void updateData() = 0; -private: - LLUUID mPartnerID; -}; + virtual void onActivate(const LLUUID& id); + typedef enum e_profile_type + { + PT_UNKNOWN, + PT_OWN, + PT_OTHER + } EProfileType; -// WARNING! The order of the inheritance here matters!! Do not change. - KLW -class LLPanelAvatarWeb : - public LLPanelAvatarTab - , public LLWebBrowserCtrlObserver -{ -public: - LLPanelAvatarWeb(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); - /*virtual*/ ~LLPanelAvatarWeb(); - /*virtual*/ BOOL postBuild(void); - - /*virtual*/ void refresh(); + virtual void onAddFriend(); - void enableControls(BOOL own_avatar); + virtual void onIM(); - void setWebURL(std::string url); + virtual void onTeleport(); - void load(std::string url); - static void onURLKeystroke(LLLineEditor* editor, void* data); - static void onCommitLoad(LLUICtrl* ctrl, void* data); - static void onCommitURL(LLUICtrl* ctrl, void* data); - static void onClickWebProfileHelp(void *); + virtual void clear(){}; - // browser observer impls - virtual void onStatusTextChange( const EventType& eventIn ); - virtual void onLocationChange( const EventType& eventIn ); +protected: + virtual ~LLPanelProfileTab(); + void setProfileType(); -private: - std::string mHome; - std::string mNavigateTo; - LLWebBrowserCtrl* mWebBrowser; +protected: + e_profile_type mProfileType; + LLUUID mAvatarId; }; - -class LLPanelAvatarAdvanced : public LLPanelAvatarTab +class LLPanelAvatarProfile + : public LLPanelProfileTab { public: - LLPanelAvatarAdvanced(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); - - /*virtual*/ BOOL postBuild(void); - - void enableControls(BOOL own_avatar); - void setWantSkills(U32 want_to_mask, const std::string& want_to_text, - U32 skills_mask, const std::string& skills_text, - const std::string& languages_text); - void getWantSkills(U32* want_to_mask, std::string& want_to_text, - U32* skills_mask, std::string& skills_text, - std::string& languages_text); - -private: - S32 mWantToCount; - S32 mSkillsCount; - LLCheckBoxCtrl *mWantToCheck[8]; - LLLineEditor *mWantToEdit; - LLCheckBoxCtrl *mSkillsCheck[8]; - LLLineEditor *mSkillsEdit; -}; - - -class LLPanelAvatarNotes : public LLPanelAvatarTab -{ -public: - LLPanelAvatarNotes(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); + LLPanelAvatarProfile(const LLUUID& avatar_id = LLUUID::null); + LLPanelAvatarProfile(const Params& params ); + ~LLPanelAvatarProfile(); + + static void* create(void* data); - /*virtual*/ BOOL postBuild(void); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); - /*virtual*/ void refresh(); + void updateData(); - void clearControls(); + void clear(); - static void onCommitNotes(LLUICtrl* field, void* userdata); -}; - - -class LLPanelAvatarClassified : public LLPanelAvatarTab -{ -public: - LLPanelAvatarClassified(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); + virtual void clearControls(); /*virtual*/ BOOL postBuild(void); + void onOpen(const LLSD& key); - /*virtual*/ void refresh(); + void onAddFriendButtonClick(); - // If can close, return TRUE. If cannot close, pop save/discard dialog - // and return FALSE. - BOOL canClose(); + void onIMButtonClick(); - void apply(); + void onCallButtonClick(); - BOOL titleIsValid(); + void onTeleportButtonClick(); - // Delete all the classified sub-panels from the tab container - void deleteClassifiedPanels(); - - // Unpack the outline of classified for this avatar (count, names, but not - // actual data). - void processAvatarClassifiedReply(LLMessageSystem* msg, void**); + void onShareButtonClick(); private: - static void onClickNew(void* data); - static void onClickDelete(void* data); + bool isOwnProfile(){return PT_OWN == mProfileType;} + bool isEditMode(){return mEditMode;} + void updateChildrenList(); + void onStatusChanged(); + void onStatusMessageChanged(); + void setCaptionText(const LLAvatarData* avatar_data); + void scrollToTop(); - bool callbackDelete(const LLSD& notification, const LLSD& response); - bool callbackNew(const LLSD& notification, const LLSD& response); -}; - -class LLPanelAvatarPicks : public LLPanelAvatarTab -{ -public: - LLPanelAvatarPicks(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); - - /*virtual*/ BOOL postBuild(void); - - /*virtual*/ void refresh(); - - // Delete all the pick sub-panels from the tab container - void deletePickPanels(); - - // Unpack the outline of picks for this avatar (count, names, but not - // actual data). - void processAvatarPicksReply(LLMessageSystem* msg, void**); - void processAvatarClassifiedReply(LLMessageSystem* msg, void**); +protected: + bool mEditMode; private: - static void onClickNew(void* data); - static void onClickDelete(void* data); - - bool callbackDelete(const LLSD& notification, const LLSD& response); + bool mUpdated; + LLComboBox * mStatusCombobox; + LLLineEditor * mStatusMessage; }; -class LLPanelAvatar : public LLPanel +class LLPanelAvatarNotes + : public LLPanelProfileTab { public: - LLPanelAvatar(const std::string& name, const LLRect &rect, BOOL allow_edit); - /*virtual*/ ~LLPanelAvatar(); + LLPanelAvatarNotes(const LLUUID& id = LLUUID::null); + LLPanelAvatarNotes(const Params& params ); + ~LLPanelAvatarNotes(); - /*virtual*/ BOOL postBuild(void); + static void* create(void* data); - // If can close, return TRUE. If cannot close, pop save/discard dialog - // and return FALSE. - BOOL canClose(); + BOOL postBuild(void); - void setAvatar(LLViewerObject *avatarp); + void onCommitRights(); - // Fill in the avatar ID and handle some field fill-in, as well as - // button enablement. - // Pass one of the ONLINE_STATUS_foo constants above. - void setAvatarID(const LLUUID &avatar_id, const std::string &name, EOnlineStatus online_status); + void onCommitNotes(); - void setOnlineStatus(EOnlineStatus online_status); + void clear(); - const LLUUID& getAvatarID() const { return mAvatarID; } - - void resetGroupList(); - - void sendAvatarStatisticsRequest(); - - void sendAvatarPropertiesRequest(); - void sendAvatarPropertiesUpdate(); - - void sendAvatarNotesRequest(); - void sendAvatarNotesUpdate(); - - void sendAvatarPicksRequest(); + void processProperties(void* data, EAvatarProcessorType type); - void selectTab(S32 tabnum); - void selectTabByName(std::string tab_name); + void updateData(); - BOOL haveData() { return mHaveProperties && mHaveStatistics; } - BOOL isEditable() const { return mAllowEdit; } - - static void processAvatarPropertiesReply(LLMessageSystem *msg, void **); - static void processAvatarInterestsReply(LLMessageSystem *msg, void **); - static void processAvatarGroupsReply(LLMessageSystem* msg, void**); - static void processAvatarNotesReply(LLMessageSystem *msg, void **); - static void processAvatarPicksReply(LLMessageSystem *msg, void **); - static void processAvatarClassifiedReply(LLMessageSystem *msg, void **); - - static void onClickTrack( void *userdata); - static void onClickIM( void *userdata); - static void onClickOfferTeleport( void *userdata); - static void onClickPay( void *userdata); - static void onClickAddFriend(void* userdata); - static void onClickOK( void *userdata); - static void onClickCancel( void *userdata); - static void onClickKick( void *userdata); - static void onClickFreeze( void *userdata); - static void onClickUnfreeze(void *userdata); - static void onClickCSR( void *userdata); - static void onClickMute( void *userdata); - -private: - void enableOKIfReady(); - - static bool finishKick(const LLSD& notification, const LLSD& response); - static bool finishFreeze(const LLSD& notification, const LLSD& response); - static bool finishUnfreeze(const LLSD& notification, const LLSD& response); - - static void showProfileCallback(S32 option, void *userdata); +protected: +}; - static void* createPanelAvatar(void* data); - static void* createFloaterAvatarInfo(void* data); - static void* createPanelAvatarSecondLife(void* data); - static void* createPanelAvatarWeb(void* data); - static void* createPanelAvatarInterests(void* data); - static void* createPanelAvatarPicks(void* data); - static void* createPanelAvatarClassified(void* data); - static void* createPanelAvatarFirstLife(void* data); - static void* createPanelAvatarNotes(void* data); -public: - LLPanelAvatarSecondLife* mPanelSecondLife; - LLPanelAvatarAdvanced* mPanelAdvanced; - LLPanelAvatarClassified* mPanelClassified; - LLPanelAvatarPicks* mPanelPicks; - LLPanelAvatarNotes* mPanelNotes; - LLPanelAvatarFirstLife* mPanelFirstLife; - LLPanelAvatarWeb* mPanelWeb; - - LLDropTarget* mDropTarget; - - // Teen users are not allowed to see or enter data into the first life page, - // or their own about/interests text entry fields. - static BOOL sAllowFirstLife; - -private: - LLUUID mAvatarID; // for which avatar is this window? - BOOL mIsFriend; // Are we friends? - BOOL mHaveProperties; - BOOL mHaveStatistics; - // only update note if data received from database and - // note is changed from database version - bool mHaveNotes; - std::string mLastNotes; - LLTabContainer* mTab; - BOOL mAllowEdit; - - typedef std::list<LLPanelAvatar*> panel_list_t; - static panel_list_t sAllPanels; -}; // helper funcs void add_left_label(LLPanel *panel, const std::string& name, S32 y); - #endif // LL_LLPANELAVATAR_H diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 9e4f9709a89b338861f8a9f8aa1ab48a78904728..c328bcb7f99f04d8900574e13fdc6e4002110662 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -40,6 +40,7 @@ #include "lldir.h" #include "lldispatcher.h" +#include "llfloaterreg.h" #include "llparcel.h" #include "message.h" @@ -54,7 +55,6 @@ #include "lllineeditor.h" #include "llfloateravatarinfo.h" #include "llfloaterclassified.h" -#include "lltabcontainervertical.h" #include "lltextbox.h" #include "llcombobox.h" #include "llviewertexteditor.h" @@ -70,6 +70,7 @@ #include "llviewerregion.h" #include "llviewerwindow.h" // for window width, height #include "llappviewer.h" // abortQuit() +#include "lltrans.h" const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ const S32 MATURE_UNDEFINED = -1; @@ -151,7 +152,7 @@ LLClassifiedTeleportHandler gClassifiedTeleportHandler; */ LLPanelClassified::LLPanelClassified(bool in_finder, bool from_search) -: LLPanel(std::string("Classified Panel")), +: LLPanel(), mInFinder(in_finder), mFromSearch(from_search), mDirty(false), @@ -231,44 +232,37 @@ void LLPanelClassified::reset() BOOL LLPanelClassified::postBuild() { mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl"); - mSnapshotCtrl->setCommitCallback(onCommitAny); - mSnapshotCtrl->setCallbackUserData(this); + mSnapshotCtrl->setCommitCallback(onCommitAny, this); mSnapshotSize = mSnapshotCtrl->getRect(); mNameEditor = getChild<LLLineEditor>("given_name_editor"); mNameEditor->setMaxTextLength(DB_PARCEL_NAME_LEN); mNameEditor->setCommitOnFocusLost(TRUE); mNameEditor->setFocusReceivedCallback(focusReceived, this); - mNameEditor->setCommitCallback(onCommitAny); - mNameEditor->setCallbackUserData(this); + mNameEditor->setCommitCallback(onCommitAny, this); mNameEditor->setPrevalidate( LLLineEditor::prevalidateASCII ); mDescEditor = getChild<LLTextEditor>("desc_editor"); mDescEditor->setCommitOnFocusLost(TRUE); mDescEditor->setFocusReceivedCallback(focusReceived, this); - mDescEditor->setCommitCallback(onCommitAny); - mDescEditor->setCallbackUserData(this); + mDescEditor->setCommitCallback(onCommitAny, this); mDescEditor->setTabsToNextField(TRUE); mLocationEditor = getChild<LLLineEditor>("location_editor"); mSetBtn = getChild<LLButton>( "set_location_btn"); - mSetBtn->setClickedCallback(onClickSet); - mSetBtn->setCallbackUserData(this); + mSetBtn->setClickedCallback(onClickSet, this); mTeleportBtn = getChild<LLButton>( "classified_teleport_btn"); - mTeleportBtn->setClickedCallback(onClickTeleport); - mTeleportBtn->setCallbackUserData(this); + mTeleportBtn->setClickedCallback(onClickTeleport, this); mMapBtn = getChild<LLButton>( "classified_map_btn"); - mMapBtn->setClickedCallback(onClickMap); - mMapBtn->setCallbackUserData(this); + mMapBtn->setClickedCallback(onClickMap, this); if(mInFinder) { mProfileBtn = getChild<LLButton>( "classified_profile_btn"); - mProfileBtn->setClickedCallback(onClickProfile); - mProfileBtn->setCallbackUserData(this); + mProfileBtn->setClickedCallback(onClickProfile, this); } mCategoryCombo = getChild<LLComboBox>( "classified_category_combo"); @@ -277,16 +271,14 @@ BOOL LLPanelClassified::postBuild() iter != LLClassifiedInfo::sCategories.end(); iter++) { - mCategoryCombo->add(iter->second, (void *)((intptr_t)iter->first), ADD_BOTTOM); + mCategoryCombo->add(LLTrans::getString(iter->second), (void *)((intptr_t)iter->first), ADD_BOTTOM); } mCategoryCombo->setCurrentByIndex(0); - mCategoryCombo->setCommitCallback(onCommitAny); - mCategoryCombo->setCallbackUserData(this); + mCategoryCombo->setCommitCallback(onCommitAny, this); mMatureCombo = getChild<LLComboBox>( "classified_mature_check"); mMatureCombo->setCurrentByIndex(0); - mMatureCombo->setCommitCallback(onCommitAny); - mMatureCombo->setCallbackUserData(this); + mMatureCombo->setCommitCallback(onCommitAny, this); if (gAgent.wantsPGOnly()) { // Teens don't get to set mature flag. JC @@ -297,13 +289,11 @@ BOOL LLPanelClassified::postBuild() if (!mInFinder) { mAutoRenewCheck = getChild<LLCheckBoxCtrl>( "auto_renew_check"); - mAutoRenewCheck->setCommitCallback(onCommitAny); - mAutoRenewCheck->setCallbackUserData(this); + mAutoRenewCheck->setCommitCallback(onCommitAny, this); } mUpdateBtn = getChild<LLButton>("classified_update_btn"); - mUpdateBtn->setClickedCallback(onClickUpdate); - mUpdateBtn->setCallbackUserData(this); + mUpdateBtn->setClickedCallback(onClickUpdate, this); if (!mInFinder) { @@ -360,7 +350,7 @@ bool LLPanelClassified::saveCallback(const LLSD& notification, const LLSD& respo LLFloater* parent_floater = gFloaterView->getParentFloater(this); if (parent_floater) { - parent_floater->close(); + parent_floater->closeFloater(); } } break; @@ -455,10 +445,11 @@ void LLPanelClassified::setClickThrough(const LLUUID& classified_id, if (self->mClickThroughText) { - std::string msg = llformat("Clicks: %d teleport, %d map, %d profile", - self->mTeleportClicksNew + self->mTeleportClicksOld, - self->mMapClicksNew + self->mMapClicksOld, - self->mProfileClicksNew + self->mProfileClicksOld); + LLStringUtil::format_map_t args; + args["[TELEPORT]"] = llformat ("%d", self->mTeleportClicksNew + self->mTeleportClicksOld); + args["[MAP]"] = llformat ("%d", self->mMapClicksNew + self->mMapClicksOld); + args["[PROFILE]"] = llformat ("%d", self->mProfileClicksNew + self->mProfileClicksOld); + std::string msg = LLTrans::getString ("ClassifiedClicksTxt", args); self->mClickThroughText->setText(msg); } } @@ -623,7 +614,6 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void ** U32 date = 0; msg->getU32Fast(_PREHASH_Data, _PREHASH_CreationDate, date); time_t tim = date; - tm *now=localtime(&tim); // future use U32 expiration_date = 0; @@ -674,9 +664,13 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void ** self->mAutoRenewCheck->set(auto_renew); } - std::string datestr = llformat("%02d/%02d/%d", now->tm_mon+1, now->tm_mday, now->tm_year+1900); + std::string dateStr = self->getString("dateStr"); + LLSD substitution; + substitution["datetime"] = (S32) tim; + LLStringUtil::format (dateStr, substitution); + LLStringUtil::format_map_t string_args; - string_args["[DATE]"] = datestr; + string_args["[DATE]"] = dateStr; string_args["[AMT]"] = llformat("%d", price_for_listing); self->childSetText("classified_info_text", self->getString("ad_placed_paid", string_args)); @@ -846,7 +840,7 @@ void LLPanelClassified::gotMature() if (mPaidFor) { LLNotification::Params params("PublishClassified"); - params.functor(boost::bind(&LLPanelClassified::confirmPublish, this, _1, _2)); + params.functor.function(boost::bind(&LLPanelClassified::confirmPublish, this, _1, _2)); LLNotifications::instance().forceResponse(params, 0); } else @@ -941,7 +935,7 @@ void LLPanelClassified::onClickTeleport(void* data) if (!self->mPosGlobal.isExactlyZero()) { gAgent.teleportViaLocation(self->mPosGlobal); - gFloaterWorldMap->trackLocation(self->mPosGlobal); + LLFloaterWorldMap::getInstance()->trackLocation(self->mPosGlobal); self->sendClassifiedClickMessage("teleport"); } @@ -952,8 +946,8 @@ void LLPanelClassified::onClickTeleport(void* data) void LLPanelClassified::onClickMap(void* data) { LLPanelClassified* self = (LLPanelClassified*)data; - gFloaterWorldMap->trackLocation(self->mPosGlobal); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::getInstance()->trackLocation(self->mPosGlobal); + LLFloaterReg::showInstance("world_map", "center"); self->sendClassifiedClickMessage("map"); } @@ -984,7 +978,7 @@ void LLPanelClassified::onClickSet(void* data) self->mPosGlobal = gAgent.getPositionGlobal(); std::string location_text; - std::string regionName = "(will update after publish)"; + std::string regionName = LLTrans::getString("ClassifiedUpdateAfterPublish"); LLViewerRegion* pRegion = gAgent.getRegion(); if (pRegion) { @@ -1065,7 +1059,7 @@ void LLPanelClassified::sendClassifiedClickMessage(const std::string& type) //////////////////////////////////////////////////////////////////////////////////////////// LLFloaterPriceForListing::LLFloaterPriceForListing() -: LLFloater(std::string("PriceForListing")), +: LLFloater(), mCallback(NULL), mUserData(NULL) { } @@ -1129,7 +1123,7 @@ void LLFloaterPriceForListing::buttonCore(S32 button, void* data) { std::string text = self->childGetText("price_edit"); self->mCallback(button, text, self->mUserData); - self->close(); + self->closeFloater(); } } diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index a2f3d9e12c49a2da9736ee337c0f463454825a81..b7ec485872f3a51007b35786c89e0c95cf710e6f 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -36,37 +36,33 @@ #include "llpanelcontents.h" // linden library includes +#include "lleconomy.h" #include "llerror.h" +#include "llfloaterreg.h" +#include "llfontgl.h" +#include "llmaterialtable.h" +#include "llpermissionsflags.h" #include "llrect.h" #include "llstring.h" -#include "llmaterialtable.h" -#include "llfontgl.h" +#include "llui.h" #include "m3math.h" -#include "llpermissionsflags.h" -#include "lleconomy.h" #include "material_codes.h" // project includes -#include "llui.h" -#include "llspinctrl.h" -#include "llcheckboxctrl.h" -#include "lltextbox.h" -#include "llbutton.h" -#include "llcombobox.h" -#include "llfloaterbulkpermission.h" - #include "llagent.h" -#include "llviewerwindow.h" -#include "llworld.h" -#include "llviewerobject.h" -#include "llviewerregion.h" +#include "llfloaterbulkpermission.h" +#include "llpanelinventory.h" +#include "llpreviewscript.h" #include "llresmgr.h" #include "llselectmgr.h" -#include "llpreviewscript.h" #include "lltool.h" -#include "lltoolmgr.h" #include "lltoolcomp.h" -#include "llpanelinventory.h" +#include "lltoolmgr.h" +#include "lltrans.h" +#include "llviewerobject.h" +#include "llviewerregion.h" +#include "llviewerwindow.h" +#include "llworld.h" // // Imported globals @@ -86,11 +82,13 @@ BOOL LLPanelContents::postBuild() childSetAction("button new script",&LLPanelContents::onClickNewScript, this); childSetAction("button permissions",&LLPanelContents::onClickPermissions, this); + mPanelInventory = getChild<LLPanelInventory>("contents_inventory"); + return TRUE; } -LLPanelContents::LLPanelContents(const std::string& name) - : LLPanel(name), +LLPanelContents::LLPanelContents() + : LLPanel(), mPanelInventory(NULL) { } @@ -171,7 +169,7 @@ void LLPanelContents::onClickNewScript(void *userdata) LLUUID::null, LLAssetType::AT_LSL_TEXT, LLInventoryType::IT_LSL, - std::string("New Script"), + LLTrans::getString("PanelContentsNewScript"), desc, LLSaleInfo::DEFAULT, LLViewerInventoryItem::II_FLAGS_NONE, @@ -185,21 +183,7 @@ void LLPanelContents::onClickNewScript(void *userdata) // viewer so the viewer can auto-open the script and start // editing ASAP. #if 0 - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("PreviewScriptRect"); - rect.translate( left - rect.mLeft, top - rect.mTop ); - - LLLiveLSLEditor* editor; - editor = new LLLiveLSLEditor("script ed", - rect, - "Script: New Script", - object->mID, - LLUUID::null); - editor->open(); /*Flawfinder: ignore*/ - - // keep onscreen - gFloaterView->adjustToFitScreen(editor, FALSE); + LLFloaterReg::showInstance("preview_scriptedit", LLSD(inv_item->getUUID()), TAKE_FOCUS_YES); #endif } } diff --git a/indra/newview/llpanelcontents.h b/indra/newview/llpanelcontents.h index ea06707494e6141a21df14d9f748636901c24703..de1914bff9c879f834e46ea3d4917ffe5f322e21 100644 --- a/indra/newview/llpanelcontents.h +++ b/indra/newview/llpanelcontents.h @@ -46,7 +46,7 @@ class LLPanelContents : public LLPanel { public: virtual BOOL postBuild(); - LLPanelContents(const std::string& name); + LLPanelContents(); virtual ~LLPanelContents(); void refresh(); diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index e93a5be8ed5776f5cfbc4b5bd4f6eb388162708d..2ff22416ecb0515ac0999b32fac84b5d2204265e 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -87,11 +87,10 @@ BOOL LLPanelFace::postBuild() if(mTextureCtrl) { mTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectTexture" ))); - mTextureCtrl->setCommitCallback( LLPanelFace::onCommitTexture ); - mTextureCtrl->setOnCancelCallback( LLPanelFace::onCancelTexture ); - mTextureCtrl->setOnSelectCallback( LLPanelFace::onSelectTexture ); - mTextureCtrl->setDragCallback(LLPanelFace::onDragTexture); - mTextureCtrl->setCallbackUserData( this ); + mTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitTexture, this, _2) ); + mTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelTexture, this, _2) ); + mTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectTexture, this, _2) ); + mTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, _2)); mTextureCtrl->setFollowsTop(); mTextureCtrl->setFollowsLeft(); // Don't allow (no copy) or (no transfer) textures to be selected during immediate mode @@ -118,10 +117,9 @@ BOOL LLPanelFace::postBuild() mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(mColorSwatch) { - mColorSwatch->setCommitCallback(LLPanelFace::onCommitColor); - mColorSwatch->setOnCancelCallback(LLPanelFace::onCancelColor); - mColorSwatch->setOnSelectCallback(LLPanelFace::onSelectColor); - mColorSwatch->setCallbackUserData( this ); + mColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitColor, this, _2)); + mColorSwatch->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelColor, this, _2)); + mColorSwatch->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectColor, this, _2)); mColorSwatch->setFollowsTop(); mColorSwatch->setFollowsLeft(); mColorSwatch->setCanApplyImmediately(TRUE); @@ -137,8 +135,7 @@ BOOL LLPanelFace::postBuild() mCtrlColorTransp = getChild<LLSpinCtrl>("ColorTrans"); if(mCtrlColorTransp) { - mCtrlColorTransp->setCommitCallback(LLPanelFace::onCommitAlpha); - mCtrlColorTransp->setCallbackUserData(this); + mCtrlColorTransp->setCommitCallback(boost::bind(&LLPanelFace::onCommitAlpha, this, _2)); mCtrlColorTransp->setPrecision(0); mCtrlColorTransp->setFollowsTop(); mCtrlColorTransp->setFollowsLeft(); @@ -147,23 +144,20 @@ BOOL LLPanelFace::postBuild() mCheckFullbright = getChild<LLCheckBoxCtrl>("checkbox fullbright"); if (mCheckFullbright) { - mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright); - mCheckFullbright->setCallbackUserData( this ); + mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright, this); } mComboTexGen = getChild<LLComboBox>("combobox texgen"); if(mComboTexGen) { - mComboTexGen->setCommitCallback(LLPanelFace::onCommitTexGen); + mComboTexGen->setCommitCallback(LLPanelFace::onCommitTexGen, this); mComboTexGen->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP); - mComboTexGen->setCallbackUserData( this ); } mCtrlGlow = getChild<LLSpinCtrl>("glow"); if(mCtrlGlow) { - mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow); - mCtrlGlow->setCallbackUserData(this); + mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow, this); } childSetCommitCallback("combobox shininess",&LLPanelFace::onCommitShiny,this); @@ -183,8 +177,8 @@ BOOL LLPanelFace::postBuild() return TRUE; } -LLPanelFace::LLPanelFace(const std::string& name) -: LLPanel(name) +LLPanelFace::LLPanelFace() +: LLPanel() { } @@ -807,32 +801,25 @@ F32 LLPanelFace::valueGlow(LLViewerObject* object, S32 face) } -// static -void LLPanelFace::onCommitColor(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitColor(const LLSD& data) { - LLPanelFace* self = (LLPanelFace*) userdata; - self->sendColor(); + sendColor(); } -// static -void LLPanelFace::onCommitAlpha(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitAlpha(const LLSD& data) { - LLPanelFace* self = (LLPanelFace*) userdata; - self->sendAlpha(); + sendAlpha(); } -// static -void LLPanelFace::onCancelColor(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCancelColor(const LLSD& data) { LLSelectMgr::getInstance()->selectionRevertColors(); } -// static -void LLPanelFace::onSelectColor(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onSelectColor(const LLSD& data) { - LLPanelFace* self = (LLPanelFace*) userdata; LLSelectMgr::getInstance()->saveSelectedObjectColors(); - self->sendColor(); + sendColor(); } // static @@ -871,7 +858,7 @@ void LLPanelFace::onCommitGlow(LLUICtrl* ctrl, void* userdata) } // static -BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item, void*) +BOOL LLPanelFace::onDragTexture(LLInventoryItem* item) { BOOL accept = TRUE; for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin(); @@ -888,28 +875,21 @@ BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item, void*) return accept; } -// static -void LLPanelFace::onCommitTexture( LLUICtrl* ctrl, void* userdata ) +void LLPanelFace::onCommitTexture( const LLSD& data ) { - LLPanelFace* self = (LLPanelFace*) userdata; - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); - - self->sendTexture(); + sendTexture(); } -// static -void LLPanelFace::onCancelTexture(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCancelTexture(const LLSD& data) { LLSelectMgr::getInstance()->selectionRevertTextures(); } -// static -void LLPanelFace::onSelectTexture(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onSelectTexture(const LLSD& data) { - LLPanelFace* self = (LLPanelFace*) userdata; LLSelectMgr::getInstance()->saveSelectedObjectTextures(); - self->sendTexture(); + sendTexture(); } diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index a2ead0c8a2fe0bf15a2bd4fc3924901cfcdbbf3a..96001296963ad781eafbefff4ba42c77b666518a 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -52,7 +52,7 @@ class LLPanelFace : public LLPanel { public: virtual BOOL postBuild(); - LLPanelFace(const std::string& name); + LLPanelFace(); virtual ~LLPanelFace(); void refresh(); @@ -70,17 +70,18 @@ protected: void sendFullbright(); // applies and sends full bright void sendGlow(); - // this function is to return TRUE if the dra should succeed. - static BOOL onDragTexture(LLUICtrl* ctrl, LLInventoryItem* item, void* ud); + // this function is to return TRUE if the drag should succeed. + static BOOL onDragTexture(LLInventoryItem* item); - static void onCommitTexture( LLUICtrl* ctrl, void* userdata); - static void onCancelTexture( LLUICtrl* ctrl, void* userdata); - static void onSelectTexture( LLUICtrl* ctrl, void* userdata); - static void onCommitTextureInfo( LLUICtrl* ctrl, void* userdata); - static void onCommitColor( LLUICtrl* ctrl, void* userdata); - static void onCommitAlpha( LLUICtrl* ctrl, void* userdata); - static void onCancelColor( LLUICtrl* ctrl, void* userdata); - static void onSelectColor( LLUICtrl* ctrl, void* userdata); + void onCommitTexture(const LLSD& data); + void onCancelTexture(const LLSD& data); + void onSelectTexture(const LLSD& data); + void onCommitColor(const LLSD& data); + void onCommitAlpha(const LLSD& data); + void onCancelColor(const LLSD& data); + void onSelectColor(const LLSD& data); + + static void onCommitTextureInfo( LLUICtrl* ctrl, void* userdata); static void onCommitBump( LLUICtrl* ctrl, void* userdata); static void onCommitTexGen( LLUICtrl* ctrl, void* userdata); static void onCommitShiny( LLUICtrl* ctrl, void* userdata); diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index d9d796fd9e0d29fba649ec7251bd158c774607e1..3acaa6b68ecf166575392191d0a6add543bd965e 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -46,12 +46,21 @@ #include "llviewerwindow.h" #include "llappviewer.h" #include "llnotifications.h" +#include "llfloater.h" // static void* LLPanelGroupTab::createTab(void* data) { LLUUID* group_id = static_cast<LLUUID*>(data); - return new LLPanelGroupTab("panel group tab", *group_id); + return new LLPanelGroupTab(*group_id); +} + +LLPanelGroupTab::LLPanelGroupTab(const LLUUID& group_id) + : LLPanel(), + mGroupID(group_id), + mAllowEdit(TRUE), + mHasModal(FALSE) +{ } LLPanelGroupTab::~LLPanelGroupTab() @@ -68,13 +77,11 @@ BOOL LLPanelGroupTab::isVisibleByAgent(LLAgent* agentp) BOOL LLPanelGroupTab::postBuild() { // Hook up the help button callback. - LLButton* button = getChild<LLButton>("help_button"); + LLButton* button = findChild<LLButton>("help_button"); if (button) { - button->setClickedCallback(onClickHelp); - button->setCallbackUserData(this); + button->setCommitCallback(boost::bind(&LLPanelGroupTab::handleClickHelp, this)); } - mHelpText = getString("help_text"); return TRUE; } @@ -103,13 +110,6 @@ void LLPanelGroupTab::notifyObservers() } } -// static -void LLPanelGroupTab::onClickHelp(void* user_data) -{ - LLPanelGroupTab* self = static_cast<LLPanelGroupTab*>(user_data); - self->handleClickHelp(); -} - void LLPanelGroupTab::handleClickHelp() { // Display the help text. @@ -125,67 +125,48 @@ void LLPanelGroupTab::handleClickHelp() } } -LLPanelGroup::LLPanelGroup(const std::string& filename, - const std::string& name, - const LLUUID& group_id, - const std::string& initial_tab_selected) -: LLPanel(name, LLRect(), FALSE), +LLPanelGroup::LLPanelGroup(const LLUUID& group_id) +: LLPanel(), LLGroupMgrObserver( group_id ), mCurrentTab( NULL ), mRequestedTab( NULL ), mTabContainer( NULL ), mIgnoreTransition( FALSE ), + mApplyBtn( NULL ), mForceClose( FALSE ), - mInitialTab(initial_tab_selected), mAllowEdit( TRUE ), mShowingNotifyDialog( FALSE ) { // Set up the factory callbacks. - mFactoryMap["general_tab"] = LLCallbackMap(LLPanelGroupGeneral::createTab, - &mID); - mFactoryMap["roles_tab"] = LLCallbackMap(LLPanelGroupRoles::createTab, - &mID); - mFactoryMap["notices_tab"] = LLCallbackMap(LLPanelGroupNotices::createTab, - &mID); - mFactoryMap["land_money_tab"]= LLCallbackMap(LLPanelGroupLandMoney::createTab, - &mID); + mFactoryMap["general_tab"] = LLCallbackMap(LLPanelGroupGeneral::createTab, &mID); + mFactoryMap["roles_tab"] = LLCallbackMap(LLPanelGroupRoles::createTab, &mID); + mFactoryMap["notices_tab"] = LLCallbackMap(LLPanelGroupNotices::createTab, &mID); + mFactoryMap["land_money_tab"]= LLCallbackMap(LLPanelGroupLandMoney::createTab, &mID); // Roles sub tabs mFactoryMap["members_sub_tab"] = LLCallbackMap(LLPanelGroupMembersSubTab::createTab, &mID); mFactoryMap["roles_sub_tab"] = LLCallbackMap(LLPanelGroupRolesSubTab::createTab, &mID); mFactoryMap["actions_sub_tab"] = LLCallbackMap(LLPanelGroupActionsSubTab::createTab, &mID); LLGroupMgr::getInstance()->addObserver(this); - - // Pass on construction of this panel to the control factory. - LLUICtrlFactory::getInstance()->buildPanel(this, filename, &getFactoryMap()); - mFilename = filename; } LLPanelGroup::~LLPanelGroup() { LLGroupMgr::getInstance()->removeObserver(this); - int i; - int tab_count = mTabContainer->getTabCount(); - - for (i = tab_count - 1; i >=0; --i) + for (S32 i=mTabContainer->getTabCount() - 1; i >=0; --i) { - LLPanelGroupTab* panelp = - (LLPanelGroupTab*) mTabContainer->getPanelByIndex(i); - - if ( panelp ) panelp->removeObserver(this); + LLPanelGroupTab* panelp = (LLPanelGroupTab*) mTabContainer->getPanelByIndex(i); + if ( panelp ) + panelp->removeObserver(this); } } void LLPanelGroup::updateTabVisibility() { - S32 i; - S32 tab_count = mTabContainer->getTabCount(); - - for (i = tab_count - 1; i >=0; --i) + for (S32 i = mTabContainer->getTabCount() - 1; i >=0; --i) { - LLPanelGroupTab* panelp = - (LLPanelGroupTab*) mTabContainer->getPanelByIndex(i); + LLPanelGroupTab* panelp = (LLPanelGroupTab*) mTabContainer->getPanelByIndex(i); BOOL visible = panelp->isVisibleByAgent(&gAgent) || gAgent.isGodlike(); mTabContainer->enableTabButton(i, visible); @@ -195,8 +176,7 @@ void LLPanelGroup::updateTabVisibility() //we are disabling the currently selected tab //select the previous one mTabContainer->selectPrevTab(); - mCurrentTab = - (LLPanelGroupTab*) mTabContainer->getCurrentPanel(); + mCurrentTab = (LLPanelGroupTab*) mTabContainer->getCurrentPanel(); } } } @@ -209,49 +189,24 @@ BOOL LLPanelGroup::postBuild() if (mTabContainer) { - // Select the initial tab specified via constructor - const BOOL recurse = TRUE; - LLPanelGroupTab* tabp = - getChild<LLPanelGroupTab>(mInitialTab, recurse); - - if (!tabp) + mCurrentTab = dynamic_cast<LLPanelGroupTab*>(mTabContainer->getCurrentPanel()); + llassert_always(mCurrentTab); + + // Add click callback. + mTabContainer->setCommitCallback(boost::bind(&LLPanelGroup::handleClickTab, this)); + + // Setup pabels + for (S32 i = mTabContainer->getTabCount() - 1; i >=0; --i) { - //our initial tab selection was invalid, just select the - //first tab then or default to selecting the initial - //selected tab specified in the layout file - tabp = (LLPanelGroupTab*) mTabContainer->getCurrentPanel(); - - //no tab was initially selected through constructor - //or the XML, select the first tab - if (!tabp) + LLPanel* tab_panel = mTabContainer->getPanelByIndex(i); + LLPanelGroupTab* panelp = dynamic_cast<LLPanelGroupTab*>(tab_panel); + if (panelp) { - mTabContainer->selectFirstTab(); - tabp = (LLPanelGroupTab*) mTabContainer->getCurrentPanel(); + // Pass on whether or not to allow edit to tabs. + panelp->setAllowEdit(mAllowEdit); + panelp->addObserver(this); } } - else - { - mTabContainer->selectTabPanel(tabp); - } - - mCurrentTab = tabp; - - // Add click callbacks. - S32 i; - S32 tab_count = mTabContainer->getTabCount(); - - for (i = tab_count - 1; i >=0; --i) - { - LLPanel* tab_panel = mTabContainer->getPanelByIndex(i); - LLPanelGroupTab* panelp =(LLPanelGroupTab*)tab_panel; // bit of a hack - - // Pass on whether or not to allow edit to tabs. - panelp->setAllowEdit(mAllowEdit); - panelp->addObserver(this); - - mTabContainer->setTabChangeCallback(panelp, onClickTab); - mTabContainer->setTabUserData(panelp, this); - } updateTabVisibility(); // Act as though this tab was just activated. @@ -262,38 +217,22 @@ BOOL LLPanelGroup::postBuild() mWantApplyMesg = getString("want_apply_text"); LLButton* button = getChild<LLButton>("btn_ok"); - if (button) - { - button->setClickedCallback(onBtnOK); - button->setCallbackUserData(this); - button->setVisible(mAllowEdit); - } + button->setClickedCallback(onBtnOK, this); + button->setVisible(mAllowEdit); button = getChild<LLButton>("btn_cancel"); - if (button) - { - button->setClickedCallback(onBtnCancel); - button->setCallbackUserData(this); - button->setVisible(mAllowEdit); - } + button->setClickedCallback(onBtnCancel, this); + button->setVisible(mAllowEdit); button = getChild<LLButton>("btn_apply"); - if (button) - { - button->setClickedCallback(onBtnApply); - button->setVisible(mAllowEdit); - button->setEnabled(FALSE); - - mApplyBtn = button; - } + button->setClickedCallback(onBtnApply, this); + button->setVisible(mAllowEdit); + button->setEnabled(FALSE); + mApplyBtn = button; button = getChild<LLButton>("btn_refresh"); - if (button) - { - button->setClickedCallback(onBtnRefresh); - button->setCallbackUserData(this); - button->setVisible(mAllowEdit); - } + button->setClickedCallback(onBtnRefresh, this); + button->setVisible(mAllowEdit); return TRUE; } @@ -322,13 +261,6 @@ void LLPanelGroup::tabChanged() } } -// static -void LLPanelGroup::onClickTab(void* user_data, bool from_click) -{ - LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); - self->handleClickTab(); -} - void LLPanelGroup::handleClickTab() { // If we are already handling a transition, @@ -357,7 +289,8 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) LLGroupMgr::getInstance()->removeObserver(this); mID = group_id; LLGroupMgr::getInstance()->addObserver(this); - //TODO: this is really bad, we should add a method + + //*TODO: this is really bad, we should add a method // where the panels can just update themselves // on a group id change. Similar to update() but with a group // id change. @@ -365,20 +298,19 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) // For now, rebuild panel //delete children and rebuild panel deleteAllChildren(); - LLUICtrlFactory::getInstance()->buildPanel(this, mFilename, &getFactoryMap()); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group.xml"); } void LLPanelGroup::selectTab(std::string tab_name) { const BOOL recurse = TRUE; - LLPanelGroupTab* tabp = - getChild<LLPanelGroupTab>(tab_name, recurse); + LLPanelGroupTab* tabp = findChild<LLPanelGroupTab>(tab_name, recurse); if ( tabp && mTabContainer ) { mTabContainer->selectTabPanel(tabp); - onClickTab(this, false); + handleClickTab(); } } @@ -455,7 +387,7 @@ void LLPanelGroup::transitionToTab() } else // NULL requested indicates a close action. { - close(); + closePanel(); } } @@ -507,7 +439,7 @@ void LLPanelGroup::onBtnOK(void* user_data) // If we are able to apply changes, then close. if(self->apply()) { - self->close(); + self->closePanel(); } } @@ -515,7 +447,7 @@ void LLPanelGroup::onBtnOK(void* user_data) void LLPanelGroup::onBtnCancel(void* user_data) { LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); - self->close(); + self->closePanel(); } // static @@ -528,10 +460,12 @@ void LLPanelGroup::onBtnApply(void* user_data) bool LLPanelGroup::apply() { // Pass this along to the currently visible tab. - if (!mTabContainer) return false; + if (!mTabContainer) + return false; - LLPanelGroupTab* panelp = (LLPanelGroupTab*) mTabContainer->getCurrentPanel(); - if (!panelp) return false; + LLPanelGroupTab* panelp = dynamic_cast<LLPanelGroupTab*>(mTabContainer->getCurrentPanel()); + if (!panelp) + return false; std::string mesg; if ( !panelp->needsApply(mesg) ) @@ -598,7 +532,7 @@ void LLPanelGroup::refreshData() mRefreshTimer.setTimerExpirySec(5); } -void LLPanelGroup::close() +void LLPanelGroup::closePanel() { // Pass this to the parent, if it is a floater. LLView* viewp = getParent(); @@ -609,7 +543,7 @@ void LLPanelGroup::close() // will be asking us whether it can close. mForceClose = TRUE; // Tell the parent floater to close. - floaterp->close(); + floaterp->closeFloater(); } } diff --git a/indra/newview/llpanelgroup.h b/indra/newview/llpanelgroup.h index 445fb285023c1bcd8a6b49de200ca1edc9203a2c..55c7494a4452aac310f6a2e3f629d20dc76a77cc 100644 --- a/indra/newview/llpanelgroup.h +++ b/indra/newview/llpanelgroup.h @@ -58,10 +58,7 @@ class LLPanelGroup : public LLPanel, public LLPanelGroupTabObserver { public: - LLPanelGroup(const std::string& filename, - const std::string& name, - const LLUUID& group_id, - const std::string& initial_tab_selected = std::string()); + LLPanelGroup(const LLUUID& group_id); virtual ~LLPanelGroup(); virtual BOOL postBuild(); @@ -70,7 +67,6 @@ public: static void onBtnCancel(void*); static void onBtnApply(void*); static void onBtnRefresh(void*); - static void onClickTab(void*,bool); void handleClickTab(); void setGroupID(const LLUUID& group_id); @@ -92,7 +88,7 @@ public: bool apply(); void refreshData(); - void close(); + void closePanel(); void draw(); // Group manager observer trigger. @@ -120,9 +116,6 @@ protected: BOOL mForceClose; - std::string mInitialTab; - std::string mFilename; - std::string mDefaultNeedsApplyMesg; std::string mWantApplyMesg; @@ -133,8 +126,7 @@ protected: class LLPanelGroupTab : public LLPanel { public: - LLPanelGroupTab(const std::string& name, const LLUUID& group_id) - : LLPanel(name), mGroupID(group_id), mAllowEdit(TRUE), mHasModal(FALSE) { } + LLPanelGroupTab(const LLUUID& group_id); virtual ~LLPanelGroupTab(); // Factory that returns a new LLPanelGroupFoo tab. @@ -167,7 +159,6 @@ public: virtual std::string getHelpText() const { return mHelpText; } // Display anything returned by getHelpText - static void onClickHelp(void* data); void handleClickHelp(); // This just connects the help button callback. diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 3dc5e032c5b41f6a152d8a4fc610c4b3f79313d7..d495373cc4bbc22a5b043da08cabecb7ba78b39c 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -37,7 +37,6 @@ #include "lluictrlfactory.h" #include "llagent.h" #include "roles_constants.h" -#include "llfloateravatarinfo.h" #include "llfloatergroupinfo.h" // UI elements @@ -45,14 +44,17 @@ #include "llcheckboxctrl.h" #include "llcombobox.h" #include "lldbstrings.h" +#include "llfriendactions.h" #include "lllineeditor.h" #include "llnamebox.h" #include "llnamelistctrl.h" +#include "llscrolllistitem.h" #include "llspinctrl.h" #include "llstatusbar.h" // can_afford_transaction() #include "lltextbox.h" #include "lltexteditor.h" #include "lltexturectrl.h" +#include "lltrans.h" #include "llviewerwindow.h" // consts @@ -64,13 +66,12 @@ const S32 DECLINE_TO_STATE = 0; void* LLPanelGroupGeneral::createTab(void* data) { LLUUID* group_id = static_cast<LLUUID*>(data); - return new LLPanelGroupGeneral("panel group general", *group_id); + return new LLPanelGroupGeneral(*group_id); } -LLPanelGroupGeneral::LLPanelGroupGeneral(const std::string& name, - const LLUUID& group_id) -: LLPanelGroupTab(name, group_id), +LLPanelGroupGeneral::LLPanelGroupGeneral(const LLUUID& group_id) +: LLPanelGroupTab(group_id), mPendingMemberUpdate(FALSE), mChanged(FALSE), mFirstUse(TRUE), @@ -100,8 +101,6 @@ LLPanelGroupGeneral::~LLPanelGroupGeneral() BOOL LLPanelGroupGeneral::postBuild() { - llinfos << "LLPanelGroupGeneral::postBuild()" << llendl; - bool recurse = true; // General info @@ -111,63 +110,50 @@ BOOL LLPanelGroupGeneral::postBuild() mInsignia = getChild<LLTextureCtrl>("insignia", recurse); if (mInsignia) { - mInsignia->setCommitCallback(onCommitAny); - mInsignia->setCallbackUserData(this); + mInsignia->setCommitCallback(onCommitAny, this); mDefaultIconID = mInsignia->getImageAssetID(); } mEditCharter = getChild<LLTextEditor>("charter", recurse); if(mEditCharter) { - mEditCharter->setCommitCallback(onCommitAny); + mEditCharter->setCommitCallback(onCommitAny, this); mEditCharter->setFocusReceivedCallback(onFocusEdit, this); mEditCharter->setFocusChangedCallback(onFocusEdit, this); - mEditCharter->setCallbackUserData(this); } mBtnJoinGroup = getChild<LLButton>("join_button", recurse); if ( mBtnJoinGroup ) { - mBtnJoinGroup->setClickedCallback(onClickJoin); - mBtnJoinGroup->setCallbackUserData(this); + mBtnJoinGroup->setClickedCallback(onClickJoin, this); } mBtnInfo = getChild<LLButton>("info_button", recurse); if ( mBtnInfo ) { - mBtnInfo->setClickedCallback(onClickInfo); - mBtnInfo->setCallbackUserData(this); + mBtnInfo->setClickedCallback(onClickInfo, this); } - LLTextBox* founder = getChild<LLTextBox>("founder_name"); - if (founder) - { - mFounderName = new LLNameBox(founder->getName(),founder->getRect(),LLUUID::null,FALSE,founder->getFont(),founder->getMouseOpaque()); - removeChild(founder, TRUE); - addChild(mFounderName); - } + mFounderName = getChild<LLNameBox>("founder_name"); mListVisibleMembers = getChild<LLNameListCtrl>("visible_members", recurse); if (mListVisibleMembers) { - mListVisibleMembers->setDoubleClickCallback(openProfile); - mListVisibleMembers->setCallbackUserData(this); + mListVisibleMembers->setDoubleClickCallback(openProfile, this); } // Options mCtrlShowInGroupList = getChild<LLCheckBoxCtrl>("show_in_group_list", recurse); if (mCtrlShowInGroupList) { - mCtrlShowInGroupList->setCommitCallback(onCommitAny); - mCtrlShowInGroupList->setCallbackUserData(this); + mCtrlShowInGroupList->setCommitCallback(onCommitAny, this); } mComboMature = getChild<LLComboBox>("group_mature_check", recurse); if(mComboMature) { mComboMature->setCurrentByIndex(0); - mComboMature->setCommitCallback(onCommitAny); - mComboMature->setCallbackUserData(this); + mComboMature->setCommitCallback(onCommitAny, this); if (gAgent.isTeen()) { // Teens don't get to set mature flag. JC @@ -178,22 +164,19 @@ BOOL LLPanelGroupGeneral::postBuild() mCtrlOpenEnrollment = getChild<LLCheckBoxCtrl>("open_enrollement", recurse); if (mCtrlOpenEnrollment) { - mCtrlOpenEnrollment->setCommitCallback(onCommitAny); - mCtrlOpenEnrollment->setCallbackUserData(this); + mCtrlOpenEnrollment->setCommitCallback(onCommitAny, this); } mCtrlEnrollmentFee = getChild<LLCheckBoxCtrl>("check_enrollment_fee", recurse); if (mCtrlEnrollmentFee) { - mCtrlEnrollmentFee->setCommitCallback(onCommitEnrollment); - mCtrlEnrollmentFee->setCallbackUserData(this); + mCtrlEnrollmentFee->setCommitCallback(onCommitEnrollment, this); } mSpinEnrollmentFee = getChild<LLSpinCtrl>("spin_enrollment_fee", recurse); if (mSpinEnrollmentFee) { - mSpinEnrollmentFee->setCommitCallback(onCommitAny); - mSpinEnrollmentFee->setCallbackUserData(this); + mSpinEnrollmentFee->setCommitCallback(onCommitAny, this); mSpinEnrollmentFee->setPrecision(0); mSpinEnrollmentFee->resetDirty(); } @@ -209,8 +192,7 @@ BOOL LLPanelGroupGeneral::postBuild() mCtrlReceiveNotices = getChild<LLCheckBoxCtrl>("receive_notices", recurse); if (mCtrlReceiveNotices) { - mCtrlReceiveNotices->setCommitCallback(onCommitUserOnly); - mCtrlReceiveNotices->setCallbackUserData(this); + mCtrlReceiveNotices->setCommitCallback(onCommitUserOnly, this); mCtrlReceiveNotices->set(accept_notices); mCtrlReceiveNotices->setEnabled(data.mID.notNull()); } @@ -218,8 +200,7 @@ BOOL LLPanelGroupGeneral::postBuild() mCtrlListGroup = getChild<LLCheckBoxCtrl>("list_groups_in_profile", recurse); if (mCtrlListGroup) { - mCtrlListGroup->setCommitCallback(onCommitUserOnly); - mCtrlListGroup->setCallbackUserData(this); + mCtrlListGroup->setCommitCallback(onCommitUserOnly, this); mCtrlListGroup->set(list_in_profile); mCtrlListGroup->setEnabled(data.mID.notNull()); mCtrlListGroup->resetDirty(); @@ -230,8 +211,7 @@ BOOL LLPanelGroupGeneral::postBuild() mComboActiveTitle = getChild<LLComboBox>("active_title", recurse); if (mComboActiveTitle) { - mComboActiveTitle->setCommitCallback(onCommitTitle); - mComboActiveTitle->setCallbackUserData(this); + mComboActiveTitle->setCommitCallback(onCommitTitle, this); mComboActiveTitle->resetDirty(); } @@ -395,7 +375,7 @@ void LLPanelGroupGeneral::openProfile(void* data) LLScrollListItem* selected = self->mListVisibleMembers->getFirstSelected(); if (selected) { - LLFloaterAvatarInfo::showFromDirectory( selected->getUUID() ); + LLFriendActions::showProfile(selected->getUUID()); } } } @@ -480,8 +460,7 @@ bool LLPanelGroupGeneral::apply(std::string& mesg) LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { - // *TODO: Translate - mesg = std::string("No group data found for group "); + mesg = LLTrans::getString("NoGroupDataFound"); mesg.append(mGroupID.asString()); return false; } @@ -730,7 +709,9 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) if ( visible ) { - fee_buff = llformat( "Join (L$%d)", gdatap->mMembershipFee); + LLStringUtil::format_map_t string_args; + string_args["[AMOUNT]"] = llformat("%d", gdatap->mMembershipFee); + fee_buff = getString("group_join_btn", string_args); mBtnJoinGroup->setLabelSelected(fee_buff); mBtnJoinGroup->setLabelUnselected(fee_buff); } @@ -842,16 +823,16 @@ void LLPanelGroupGeneral::updateMembers() row["id"] = member->getID(); row["columns"][0]["column"] = "name"; - row["columns"][0]["font-style"] = style; + row["columns"][0]["font"]["style"] = style; // value is filled in by name list control row["columns"][1]["column"] = "title"; row["columns"][1]["value"] = member->getTitle(); - row["columns"][1]["font-style"] = style; + row["columns"][1]["font"]["style"] = style; row["columns"][2]["column"] = "online"; row["columns"][2]["value"] = member->getOnlineStatus(); - row["columns"][2]["font-style"] = style; + row["columns"][2]["font"]["style"] = style; sSDTime += sd_timer.getElapsedTimeF32(); diff --git a/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h index 71356677fcd3823327f596ff2d9df25a6bc1b8da..5d673d52195c1aabdfb930b5dd96f590684f2a0e 100644 --- a/indra/newview/llpanelgroupgeneral.h +++ b/indra/newview/llpanelgroupgeneral.h @@ -49,7 +49,7 @@ class LLSpinCtrl; class LLPanelGroupGeneral : public LLPanelGroupTab { public: - LLPanelGroupGeneral(const std::string& name, const LLUUID& group_id); + LLPanelGroupGeneral(const LLUUID& group_id); virtual ~LLPanelGroupGeneral(); // LLPanelGroupTab diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index eedec9c8ebecbfb46837571569bb0c22c9fe37b0..1e6eb8ed440adfb1b8cea55cc8282bca7cd5af36 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -39,6 +39,7 @@ #include "llcombobox.h" #include "llgroupmgr.h" #include "llnamelistctrl.h" +#include "llscrolllistitem.h" #include "llspinctrl.h" #include "lltextbox.h" #include "llviewerobject.h" @@ -351,18 +352,13 @@ void LLPanelGroupInvite::impl::callbackAddUsers(const std::vector<std::string>& if ( selfp) selfp->addUsers(names, ids); } -LLPanelGroupInvite::LLPanelGroupInvite(const std::string& name, - const LLUUID& group_id) - : LLPanel(name) +LLPanelGroupInvite::LLPanelGroupInvite(const LLUUID& group_id) + : LLPanel(), + mImplementation(new impl(group_id)), + mPendingUpdate(FALSE) { - mImplementation = new impl(group_id); - mPendingUpdate = FALSE; - mStoreSelected = LLUUID::null; - - std::string panel_def_file; - // Pass on construction of this panel to the control factory. - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_invite.xml", &getFactoryMap()); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_invite.xml"); } LLPanelGroupInvite::~LLPanelGroupInvite() @@ -519,9 +515,8 @@ BOOL LLPanelGroupInvite::postBuild() getChild<LLNameListCtrl>("invitee_list", recurse); if ( mImplementation->mInvitees ) { - mImplementation->mInvitees->setCallbackUserData(mImplementation); mImplementation->mInvitees->setCommitOnSelectionChange(TRUE); - mImplementation->mInvitees->setCommitCallback(impl::callbackSelect); + mImplementation->mInvitees->setCommitCallback(impl::callbackSelect, mImplementation); } LLButton* button = getChild<LLButton>("add_button", recurse); @@ -529,17 +524,14 @@ BOOL LLPanelGroupInvite::postBuild() { // default to opening avatarpicker automatically // (*impl::callbackClickAdd)((void*)this); - button->setClickedCallback(impl::callbackClickAdd); - button->setCallbackUserData(this); + button->setClickedCallback(impl::callbackClickAdd, this); } mImplementation->mRemoveButton = getChild<LLButton>("remove_button", recurse); if ( mImplementation->mRemoveButton ) { - mImplementation->mRemoveButton-> - setClickedCallback(impl::callbackClickRemove); - mImplementation->mRemoveButton->setCallbackUserData(mImplementation); + mImplementation->mRemoveButton->setClickedCallback(impl::callbackClickRemove, mImplementation); mImplementation->mRemoveButton->setEnabled(FALSE); } @@ -547,17 +539,14 @@ BOOL LLPanelGroupInvite::postBuild() getChild<LLButton>("ok_button", recurse); if ( mImplementation->mOKButton ) { - mImplementation->mOKButton-> - setClickedCallback(impl::callbackClickOK); - mImplementation->mOKButton->setCallbackUserData(mImplementation); + mImplementation->mOKButton->setClickedCallback(impl::callbackClickOK, mImplementation); mImplementation->mOKButton->setEnabled(FALSE); } button = getChild<LLButton>("cancel_button", recurse); if ( button ) { - button->setClickedCallback(impl::callbackClickCancel); - button->setCallbackUserData(mImplementation); + button->setClickedCallback(impl::callbackClickCancel, mImplementation); } mImplementation->mOwnerWarning = getString("confirm_invite_owner_str"); diff --git a/indra/newview/llpanelgroupinvite.h b/indra/newview/llpanelgroupinvite.h index 9117b83e7dcced6a467e5be623d8e4c97af6042e..37135b488ada716f6557bd3a53ec3dfc7ac5802c 100644 --- a/indra/newview/llpanelgroupinvite.h +++ b/indra/newview/llpanelgroupinvite.h @@ -39,7 +39,7 @@ class LLPanelGroupInvite : public LLPanel { public: - LLPanelGroupInvite(const std::string& name, const LLUUID& group_id); + LLPanelGroupInvite(const LLUUID& group_id); ~LLPanelGroupInvite(); void addUsers(std::vector<LLUUID>& agent_ids); diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 73a986896249e12fc550e4f81b5d3ce9d4944645..ea092645e7d3b08a383f58aa4576e40756ff83a3 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -42,13 +42,17 @@ #include "llagent.h" #include "lliconctrl.h" +#include "llfloaterreg.h" #include "lllineeditor.h" #include "llproductinforequest.h" #include "llscrolllistctrl.h" +#include "llscrolllistitem.h" +#include "llscrolllistcell.h" #include "lltextbox.h" #include "lltabcontainer.h" #include "lltrans.h" #include "lltransactiontypes.h" +#include "lltrans.h" #include "lluictrlfactory.h" #include "llstatusbar.h" @@ -80,7 +84,6 @@ public: static void clickEarlierCallback(void* data); static void clickLaterCallback(void* data); - static void clickTabCallback(void* user_data, bool from_click); static LLMap<LLUUID, LLGroupMoneyTabEventHandler*> sInstanceIDs; static std::map<LLPanel*, LLGroupMoneyTabEventHandler*> sTabsToHandlers; @@ -244,9 +247,9 @@ void LLPanelGroupLandMoney::impl::onMapButton() F64 global_z = gAgent.getPositionGlobal().mdV[VZ]; LLVector3d pos_global(global_x, global_y, global_z); - gFloaterWorldMap->trackLocation(pos_global); + LLFloaterWorldMap::getInstance()->trackLocation(pos_global); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterReg::showInstance("world_map", "center"); } bool LLPanelGroupLandMoney::impl::applyContribution() @@ -399,12 +402,6 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) //if ( !gAgent.hasPowerInGroup(mGroupID, GP_LAND_VIEW_OWNED) ) return; if (!gAgent.isInGroup(mGroupID)) return; - //we updated more than just the available area special block - if ( count > 1) - { - mMapButtonp->setEnabled(TRUE); - } - std::string name; std::string desc; S32 actual_area; @@ -460,15 +457,15 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) row["columns"][0]["column"] = "name"; row["columns"][0]["value"] = name; - row["columns"][0]["font"] = "SANSSERIFSMALL"; + row["columns"][0]["font"] = "SANSSERIF_SMALL"; row["columns"][1]["column"] = "location"; row["columns"][1]["value"] = location; - row["columns"][1]["font"] = "SANSSERIFSMALL"; + row["columns"][1]["font"] = "SANSSERIF_SMALL"; row["columns"][2]["column"] = "area"; row["columns"][2]["value"] = area; - row["columns"][2]["font"] = "SANSSERIFSMALL"; + row["columns"][2]["font"] = "SANSSERIF_SMALL"; row["columns"][3]["column"] = "type"; row["columns"][3]["value"] = land_type; @@ -491,15 +488,14 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) void* LLPanelGroupLandMoney::createTab(void* data) { LLUUID* group_id = static_cast<LLUUID*>(data); - return new LLPanelGroupLandMoney("panel group land money", *group_id); + return new LLPanelGroupLandMoney(*group_id); } //static LLMap<LLUUID, LLPanelGroupLandMoney*> LLPanelGroupLandMoney::sGroupIDs; -LLPanelGroupLandMoney::LLPanelGroupLandMoney(const std::string& name, - const LLUUID& group_id) : - LLPanelGroupTab(name, group_id) +LLPanelGroupLandMoney::LLPanelGroupLandMoney(const LLUUID& group_id) : + LLPanelGroupTab(group_id) { mImplementationp = new impl(*this, group_id); @@ -553,6 +549,7 @@ void LLPanelGroupLandMoney::activate() mImplementationp->setYourMaxContributionTextBox(max_avail); } + mImplementationp->mMapButtonp->setEnabled(false); update(GC_ALL); } @@ -634,9 +631,8 @@ BOOL LLPanelGroupLandMoney::postBuild() { LLLineEditor* editor = mImplementationp->mYourContributionEditorp; - editor->setCommitCallback(mImplementationp->contributionCommitCallback); - editor->setKeystrokeCallback(mImplementationp->contributionKeystrokeCallback); - editor->setCallbackUserData(this); + editor->setCommitCallback(mImplementationp->contributionCommitCallback, this); + editor->setKeystrokeCallback(mImplementationp->contributionKeystrokeCallback, this); } mImplementationp->mMapButtonp = getChild<LLButton>("map_button"); @@ -644,6 +640,12 @@ BOOL LLPanelGroupLandMoney::postBuild() mImplementationp->mGroupParcelsp = getChild<LLScrollListCtrl>("group_parcel_list"); + if ( mImplementationp->mGroupParcelsp ) + { + mImplementationp->mGroupParcelsp->setCommitCallback(boost::bind(&LLButton::setEnabled, mImplementationp->mMapButtonp, true)); + mImplementationp->mGroupParcelsp->setCommitOnSelectionChange(true); + } + mImplementationp->mCantViewParcelsText = getString("cant_view_group_land_text"); mImplementationp->mCantViewAccountsText = getString("cant_view_group_accounting_text"); @@ -662,16 +664,11 @@ BOOL LLPanelGroupLandMoney::postBuild() mImplementationp->mGroupOverLimitIconp->setVisible(FALSE); } - if ( mImplementationp->mMapButtonp ) - { - mImplementationp->mMapButtonp->setEnabled(FALSE); - } - if ( !can_view ) { if ( mImplementationp->mGroupParcelsp ) { - mImplementationp->mGroupParcelsp->addCommentText( + mImplementationp->mGroupParcelsp->setCommentText( mImplementationp->mCantViewParcelsText); mImplementationp->mGroupParcelsp->setEnabled(FALSE); } @@ -917,8 +914,7 @@ LLGroupMoneyTabEventHandler::LLGroupMoneyTabEventHandler(LLButton* earlier_butto if ( tab_containerp && panelp ) { - tab_containerp->setTabChangeCallback(panelp, clickTabCallback); - tab_containerp->setTabUserData(panelp, this); + tab_containerp->setCommitCallback(boost::bind(&LLGroupMoneyTabEventHandler::onClickTab, this)); } sInstanceIDs.addData(mImplementationp->mPanelID, this); @@ -990,13 +986,6 @@ void LLGroupMoneyTabEventHandler::clickLaterCallback(void* data) if ( selfp ) selfp->onClickLater(); } -//static -void LLGroupMoneyTabEventHandler::clickTabCallback(void* data, bool from_click) -{ - LLGroupMoneyTabEventHandler* selfp = (LLGroupMoneyTabEventHandler*) data; - if ( selfp && from_click ) selfp->onClickTab(); -} - //************************************************** //** LLGroupMoneyDetailsTabEventHandler Functions ** //************************************************** @@ -1100,7 +1089,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg, text.append(1, '\n'); - text.append(llformat("%-24s %6d\n", "Total", total_amount)); + text.append(llformat("%-24s %6d\n", LLTrans::getString("GroupMoneyTotal").c_str(), total_amount)); if ( mImplementationp->mTextEditorp ) { @@ -1220,7 +1209,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg, S32 transactions = msg->getNumberOfBlocksFast(_PREHASH_HistoryData); if (transactions == 0) { - text.append("(none)"); + text.append(LLTrans::getString("none_text")); } else { @@ -1245,22 +1234,22 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg, switch(type) { case TRANS_OBJECT_SALE: - verb = "bought"; + verb = LLTrans::getString("GroupMoneyBought").c_str(); break; case TRANS_GIFT: - verb = "paid you"; + verb = LLTrans::getString("GroupMoneyPaidYou").c_str(); break; case TRANS_PAY_OBJECT: - verb = "paid into"; + verb = LLTrans::getString("GroupMoneyPaidInto").c_str(); break; case TRANS_LAND_PASS_SALE: - verb = "bought pass to"; + verb = LLTrans::getString("GroupMoneyBoughtPassTo").c_str(); break; case TRANS_EVENT_FEE: - verb = "paid fee for event"; + verb = LLTrans::getString("GroupMoneyPaidFeeForEvent").c_str(); break; case TRANS_EVENT_PRIZE: - verb = "paid prize for event"; + verb = LLTrans::getString("GroupMoneyPaidPrizeForEvent").c_str(); break; default: verb = ""; @@ -1420,24 +1409,24 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, return; } - text.append("Summary for this week, beginning on "); + text.append(LLTrans::getString("SummaryForTheWeek")); text.append(start_date); if (current_interval == 0) { - text.append("The next stipend day is "); + text.append(LLTrans::getString("NextStipendDay")); text.append(next_stipend_date); text.append("\n\n"); - text.append(llformat("%-24sL$%6d\n", "Balance", balance )); + text.append(llformat("%-24sL$%6d\n", LLTrans::getString("GroupMoneyBalance").c_str(), balance )); text.append(1, '\n'); } // [DEV-29503] Hide the individual info since // non_exempt_member here is a wrong choice to calculate individual shares. - // text.append( " Group Individual Share\n"); - // text.append(llformat( "%-24s %6d %6d \n", "Credits", total_credits, (S32)floor((F32)total_credits/(F32)non_exempt_members))); - // text.append(llformat( "%-24s %6d %6d \n", "Debits", total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members))); - // text.append(llformat( "%-24s %6d %6d \n", "Total", total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members))); +// text.append( LLTrans::getString("GroupIndividualShare")); +// text.append(llformat( "%-24s %6d %6d \n", LLTrans::getString("GroupMoneyCredits").c_str(), total_credits, (S32)floor((F32)total_credits/(F32)non_exempt_members))); +// text.append(llformat( "%-24s %6d %6d \n", LLTrans::getString("GroupMoneyDebits").c_str(), total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members))); +// text.append(llformat( "%-24s %6d %6d \n", LLTrans::getString("GroupMoneyTotal").c_str(), total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members))); text.append( " Group\n"); text.append(llformat( "%-24s %6d\n", "Credits", total_credits)); diff --git a/indra/newview/llpanelgrouplandmoney.h b/indra/newview/llpanelgrouplandmoney.h index 591511a5fbd6ce1af0a8f22b54289a213cbc33be..748485745b2c9d701e01fbe68083f0c797e9490c 100644 --- a/indra/newview/llpanelgrouplandmoney.h +++ b/indra/newview/llpanelgrouplandmoney.h @@ -44,7 +44,7 @@ class LLPanelGroupLandMoney : public LLPanelGroupTab { public: - LLPanelGroupLandMoney(const std::string& name, const LLUUID& group_id); + LLPanelGroupLandMoney(const LLUUID& group_id); virtual ~LLPanelGroupLandMoney(); virtual BOOL postBuild(); virtual BOOL isVisibleByAgent(LLAgent* agentp); diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 5824df46e23fb16e7db76fefd50ec9f0c872d992..201cf5a0237d8696f9b2e41ca2c021b10327be54 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -49,7 +49,9 @@ #include "lliconctrl.h" #include "llcheckboxctrl.h" #include "llscrolllistctrl.h" +#include "llscrolllistitem.h" #include "lltextbox.h" +#include "lltrans.h" #include "roles_constants.h" #include "llviewerwindow.h" @@ -69,7 +71,21 @@ class LLGroupDropTarget : public LLView { public: - LLGroupDropTarget(const std::string& name, const LLRect& rect, LLPanelGroupNotices* panel, const LLUUID& group_id); + struct Params : public LLInitParam::Block<Params, LLView::Params> + { + // *NOTE: These parameters logically Mandatory, but are not + // specified in XML files, hence Optional + Optional<LLPanelGroupNotices*> panel; + Optional<LLUUID> group_id; + Params() + : panel("panel"), + group_id("group_id") + { + mouse_opaque(false); + follows.flags(FOLLOWS_ALL); + } + }; + LLGroupDropTarget(const Params&); ~LLGroupDropTarget() {}; void doDrop(EDragAndDropType cargo_type, void* cargo_data); @@ -81,18 +97,21 @@ public: void* cargo_data, EAcceptance* accept, std::string& tooltip_msg); + void setPanel (LLPanelGroupNotices* panel) {mGroupNoticesPanel = panel;}; + void setGroup (LLUUID group) {mGroupID = group;}; + protected: LLPanelGroupNotices* mGroupNoticesPanel; LLUUID mGroupID; }; -LLGroupDropTarget::LLGroupDropTarget(const std::string& name, const LLRect& rect, - LLPanelGroupNotices* panel, const LLUUID& group_id) : - LLView(name, rect, NOT_MOUSE_OPAQUE, FOLLOWS_ALL), - mGroupNoticesPanel(panel), - mGroupID(group_id) -{ -} +static LLDefaultWidgetRegistry::Register<LLGroupDropTarget> r("group_drop_target"); + +LLGroupDropTarget::LLGroupDropTarget(const LLGroupDropTarget::Params& p) +: LLView(p), + mGroupNoticesPanel(p.panel), + mGroupID(p.group_id) +{} void LLGroupDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) { @@ -179,18 +198,17 @@ std::string build_notice_date(const U32& the_time) time(&t); } - tm* lt = localtime(&t); - - //for some reason, the month is off by 1. See other uses of - //"local" time in the code... - std::string buffer = llformat("%04i-%02i-%02i", lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday); - - return buffer; + std::string dateStr = "["+LLTrans::getString("LTimeMthNum")+"]/[" + +LLTrans::getString("LTimeDay")+"]/[" + +LLTrans::getString("LTimeYear")+"]"; + LLSD substitution; + substitution["datetime"] = (S32) t; + LLStringUtil::format (dateStr, substitution); + return dateStr; } -LLPanelGroupNotices::LLPanelGroupNotices(const std::string& name, - const LLUUID& group_id) : - LLPanelGroupTab(name,group_id), +LLPanelGroupNotices::LLPanelGroupNotices(const LLUUID& group_id) : + LLPanelGroupTab(group_id), mInventoryItem(NULL), mInventoryOffer(NULL) { @@ -214,7 +232,7 @@ LLPanelGroupNotices::~LLPanelGroupNotices() void* LLPanelGroupNotices::createTab(void* data) { LLUUID* group_id = static_cast<LLUUID*>(data); - return new LLPanelGroupNotices("panel group notices", *group_id); + return new LLPanelGroupNotices(*group_id); } BOOL LLPanelGroupNotices::isVisibleByAgent(LLAgent* agentp) @@ -229,17 +247,14 @@ BOOL LLPanelGroupNotices::postBuild() mNoticesList = getChild<LLScrollListCtrl>("notice_list",recurse); mNoticesList->setCommitOnSelectionChange(TRUE); - mNoticesList->setCommitCallback(onSelectNotice); - mNoticesList->setCallbackUserData(this); + mNoticesList->setCommitCallback(onSelectNotice, this); mBtnNewMessage = getChild<LLButton>("create_new_notice",recurse); - mBtnNewMessage->setClickedCallback(onClickNewMessage); - mBtnNewMessage->setCallbackUserData(this); + mBtnNewMessage->setClickedCallback(onClickNewMessage, this); mBtnNewMessage->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_NOTICES_SEND)); mBtnGetPastNotices = getChild<LLButton>("refresh_notices",recurse); - mBtnGetPastNotices->setClickedCallback(onClickRefreshNotices); - mBtnGetPastNotices->setCallbackUserData(this); + mBtnGetPastNotices->setClickedCallback(onClickRefreshNotices, this); // Create mCreateSubject = getChild<LLLineEditor>("create_subject",recurse); @@ -253,12 +268,10 @@ BOOL LLPanelGroupNotices::postBuild() mCreateInventoryIcon->setVisible(FALSE); mBtnSendMessage = getChild<LLButton>("send_notice",recurse); - mBtnSendMessage->setClickedCallback(onClickSendMessage); - mBtnSendMessage->setCallbackUserData(this); + mBtnSendMessage->setClickedCallback(onClickSendMessage, this); mBtnRemoveAttachment = getChild<LLButton>("remove_attachment",recurse); - mBtnRemoveAttachment->setClickedCallback(onClickRemoveAttachment); - mBtnRemoveAttachment->setCallbackUserData(this); + mBtnRemoveAttachment->setClickedCallback(onClickRemoveAttachment, this); mBtnRemoveAttachment->setEnabled(FALSE); // View @@ -273,24 +286,16 @@ BOOL LLPanelGroupNotices::postBuild() mViewInventoryIcon->setVisible(FALSE); mBtnOpenAttachment = getChild<LLButton>("open_attachment",recurse); - mBtnOpenAttachment->setClickedCallback(onClickOpenAttachment); - mBtnOpenAttachment->setCallbackUserData(this); + mBtnOpenAttachment->setClickedCallback(onClickOpenAttachment, this); mNoNoticesStr = getString("no_notices_text"); mPanelCreateNotice = getChild<LLPanel>("panel_create_new_notice",recurse); mPanelViewNotice = getChild<LLPanel>("panel_view_past_notice",recurse); - // Must be in front of all other UI elements. - LLPanel* dtv = getChild<LLPanel>("drop_target",recurse); - LLGroupDropTarget* target = new LLGroupDropTarget("drop_target", - dtv->getRect(), - this, mGroupID); - target->setEnabled(TRUE); - target->setToolTip(dtv->getToolTip()); - - mPanelCreateNotice->addChild(target); - mPanelCreateNotice->removeChild(dtv, TRUE); + LLGroupDropTarget* target = getChild<LLGroupDropTarget> ("drop_target"); + target->setPanel (this); + target->setGroup (mGroupID); arrangeNoticeView(VIEW_PAST_NOTICE); @@ -331,7 +336,7 @@ void LLPanelGroupNotices::setItem(LLPointer<LLInventoryItem> inv_item) inv_item->getFlags(), item_is_multi ); - mCreateInventoryIcon->setImage(icon_name); + mCreateInventoryIcon->setValue(icon_name); mCreateInventoryIcon->setVisible(TRUE); std::stringstream ss; @@ -466,7 +471,7 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) if (1 == count && id.isNull()) { // Only one entry, the dummy entry. - mNoticesList->addCommentText(mNoNoticesStr); + mNoticesList->setCommentText(mNoNoticesStr); mNoticesList->setEnabled(FALSE); return; } @@ -554,7 +559,7 @@ void LLPanelGroupNotices::showNotice(const std::string& subject, LLInventoryType::IT_TEXTURE, 0, FALSE); - mViewInventoryIcon->setImage(icon_name); + mViewInventoryIcon->setValue(icon_name); mViewInventoryIcon->setVisible(TRUE); std::stringstream ss; diff --git a/indra/newview/llpanelgroupnotices.h b/indra/newview/llpanelgroupnotices.h index 916032c1b69ca391eac91d84d897e8be2315457f..a0712f1770465ceda8e9933659bd21a014fac7b4 100644 --- a/indra/newview/llpanelgroupnotices.h +++ b/indra/newview/llpanelgroupnotices.h @@ -34,7 +34,7 @@ #define LL_LLPANELGROUPNOTICES_H #include "llpanelgroup.h" -#include "llmemory.h" +#include "llpointer.h" #include "llinventory.h" class LLLineEditor; @@ -47,7 +47,7 @@ class LLScrollListCtrl; class LLPanelGroupNotices : public LLPanelGroupTab { public: - LLPanelGroupNotices(const std::string& name, const LLUUID& group_id); + LLPanelGroupNotices(const LLUUID& group_id); virtual ~LLPanelGroupNotices(); // LLPanelGroupTab diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 6e65181f99fb41d395cd22f5d8062143f9670bfc..9e537be4256d63c3a7ba89296d70cdb57c900503 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -36,14 +36,16 @@ #include "llagent.h" #include "llbutton.h" -#include "llfloateravatarinfo.h" #include "llfloatergroupinvite.h" +#include "llfriendactions.h" #include "lliconctrl.h" #include "lllineeditor.h" #include "llnamelistctrl.h" #include "llnotify.h" #include "llpanelgrouproles.h" #include "llscrolllistctrl.h" +#include "llscrolllistitem.h" +#include "llscrolllistcell.h" #include "lltabcontainer.h" #include "lltextbox.h" #include "lltexteditor.h" @@ -109,11 +111,11 @@ bool agentCanAddToRole(const LLUUID& group_id, void* LLPanelGroupRoles::createTab(void* data) { LLUUID* group_id = static_cast<LLUUID*>(data); - return new LLPanelGroupRoles("panel group roles", *group_id); + return new LLPanelGroupRoles(*group_id); } -LLPanelGroupRoles::LLPanelGroupRoles(const std::string& name, const LLUUID& group_id) -: LLPanelGroupTab(name, group_id), +LLPanelGroupRoles::LLPanelGroupRoles(const LLUUID& group_id) +: LLPanelGroupTab(group_id), mCurrentTab(NULL), mRequestedTab( NULL ), mSubTabContainer( NULL ), @@ -148,8 +150,7 @@ BOOL LLPanelGroupRoles::postBuild() LLPanelGroupSubTab* subtabp = (LLPanelGroupSubTab*) mSubTabContainer->getPanelByIndex(i); // Add click callbacks to all the tabs. - mSubTabContainer->setTabChangeCallback(subtabp, onClickSubTab); - mSubTabContainer->setTabUserData(subtabp, this); + mSubTabContainer->setCommitCallback(boost::bind(&LLPanelGroupRoles::handleClickSubTab, this)); // Hand the subtab a pointer to this LLPanelGroupRoles, so that it can // look around for the widgets it is interested in. @@ -198,13 +199,6 @@ BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp) } -// static -void LLPanelGroupRoles::onClickSubTab(void* user_data, bool from_click) -{ - LLPanelGroupRoles* self = static_cast<LLPanelGroupRoles*>(user_data); - self->handleClickSubTab(); -} - void LLPanelGroupRoles::handleClickSubTab() { // If we are already handling a transition, @@ -474,8 +468,8 @@ void LLPanelGroupRoles::tabChanged() //////////////////////////// // LLPanelGroupSubTab //////////////////////////// -LLPanelGroupSubTab::LLPanelGroupSubTab(const std::string& name, const LLUUID& group_id) -: LLPanelGroupTab(name, group_id), +LLPanelGroupSubTab::LLPanelGroupSubTab(const LLUUID& group_id) +: LLPanelGroupTab(group_id), mHeader(NULL), mFooter(NULL), mSearchLineEditor(NULL), @@ -495,47 +489,36 @@ BOOL LLPanelGroupSubTab::postBuild() mSearchLineEditor = getChild<LLLineEditor>("search_text", recurse); if (!mSearchLineEditor) return FALSE; - mSearchLineEditor->setKeystrokeCallback(onSearchKeystroke); - mSearchLineEditor->setCallbackUserData(this); + mSearchLineEditor->setKeystrokeCallback(onSearchKeystroke, this); mSearchButton = getChild<LLButton>("search_button", recurse); if (!mSearchButton) return FALSE; - mSearchButton->setClickedCallback(onClickSearch); - mSearchButton->setCallbackUserData(this); + mSearchButton->setClickedCallback(onClickSearch, this); mSearchButton->setEnabled(FALSE); mShowAllButton = getChild<LLButton>("show_all_button", recurse); if (!mShowAllButton) return FALSE; - mShowAllButton->setClickedCallback(onClickShowAll); - mShowAllButton->setCallbackUserData(this); + mShowAllButton->setClickedCallback(onClickShowAll, this); mShowAllButton->setEnabled(FALSE); // Get icons for later use. mActionIcons.clear(); - bool no_recurse = false; - - LLIconCtrl* icon = getChild<LLIconCtrl>("power_folder_icon",no_recurse); - if (icon && !icon->getImageName().empty()) + if (hasString("power_folder_icon")) { - mActionIcons["folder"] = icon->getImageName(); - removeChild(icon, TRUE); + mActionIcons["folder"] = getString("power_folder_icon"); } - icon = getChild<LLIconCtrl>("power_all_have_icon",no_recurse); - if (icon && !icon->getImageName().empty()) + if (hasString("power_all_have_icon")) { - mActionIcons["full"] = icon->getImageName(); - removeChild(icon, TRUE); + mActionIcons["full"] = getString("power_all_have_icon"); } - icon = getChild<LLIconCtrl>("power_partial_icon",no_recurse); - if (icon && !icon->getImageName().empty()) + if (hasString("power_partial_icon")) { - mActionIcons["partial"] = icon->getImageName(); - removeChild(icon, TRUE); + mActionIcons["partial"] = getString("power_partial_icon"); } return LLPanelGroupTab::postBuild(); @@ -663,7 +646,7 @@ void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl, U64 allowed_by_some, U64 allowed_by_all, icon_map_t& icons, - void (*commit_callback)(LLUICtrl*,void*), + LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, BOOL is_owner_role) @@ -696,7 +679,7 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, U64 allowed_by_all, LLRoleActionSet* action_set, icon_map_t& icons, - void (*commit_callback)(LLUICtrl*,void*), + LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, BOOL is_owner_role) @@ -718,7 +701,7 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, row["columns"][1]["column"] = "action"; row["columns"][1]["value"] = action_set->mActionSetData->mName; - row["columns"][1]["font-style"] = "BOLD"; + row["columns"][1]["font"]["style"] = "BOLD"; LLScrollListItem* title_row = ctrl->addElement(row, ADD_BOTTOM, action_set->mActionSetData); @@ -799,7 +782,7 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, row["columns"][column_index]["column"] = "action"; row["columns"][column_index]["value"] = (*ra_it)->mDescription; - row["columns"][column_index]["font"] = "SANSSERIFSMALL"; + row["columns"][column_index]["font"] = "SANSSERIF_SMALL"; LLScrollListItem* item = ctrl->addElement(row, ADD_BOTTOM, (*ra_it)); @@ -810,7 +793,6 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, LLCheckBoxCtrl* check = check_cell->getCheckBox(); check->setEnabled(can_change_actions); check->setCommitCallback(commit_callback); - check->setCallbackUserData(ctrl->getCallbackUserData()); check->setToolTip( check->getLabel() ); if (show_all) @@ -864,11 +846,11 @@ void LLPanelGroupSubTab::setFooterEnabled(BOOL enable) void* LLPanelGroupMembersSubTab::createTab(void* data) { LLUUID* group_id = static_cast<LLUUID*>(data); - return new LLPanelGroupMembersSubTab("panel group members sub tab", *group_id); + return new LLPanelGroupMembersSubTab(*group_id); } -LLPanelGroupMembersSubTab::LLPanelGroupMembersSubTab(const std::string& name, const LLUUID& group_id) -: LLPanelGroupSubTab(name, group_id), +LLPanelGroupMembersSubTab::LLPanelGroupMembersSubTab(const LLUUID& group_id) +: LLPanelGroupSubTab(group_id), mMembersList(NULL), mAssignedRolesList(NULL), mAllowedActionsList(NULL), @@ -900,25 +882,22 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) if (!mMembersList || !mAssignedRolesList || !mAllowedActionsList) return FALSE; // We want to be notified whenever a member is selected. - mMembersList->setCallbackUserData(this); mMembersList->setCommitOnSelectionChange(TRUE); - mMembersList->setCommitCallback(onMemberSelect); + mMembersList->setCommitCallback(onMemberSelect, this); // Show the member's profile on double click. - mMembersList->setDoubleClickCallback(onMemberDoubleClick); + mMembersList->setDoubleClickCallback(onMemberDoubleClick, this); LLButton* button = parent->getChild<LLButton>("member_invite", recurse); if ( button ) { - button->setClickedCallback(onInviteMember); - button->setCallbackUserData(this); + button->setClickedCallback(onInviteMember, this); button->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_INVITE)); } mEjectBtn = parent->getChild<LLButton>("member_eject", recurse); if ( mEjectBtn ) { - mEjectBtn->setClickedCallback(onEjectMembers); - mEjectBtn->setCallbackUserData(this); + mEjectBtn->setClickedCallback(onEjectMembers, this); mEjectBtn->setEnabled(FALSE); } @@ -1097,8 +1076,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() // Extract the checkbox that was created. LLScrollListCheck* check_cell = (LLScrollListCheck*) item->getColumn(0); LLCheckBoxCtrl* check = check_cell->getCheckBox(); - check->setCommitCallback(onRoleCheck); - check->setCallbackUserData(this); + check->setCommitCallback(onRoleCheck, this); check->set( count > 0 ); check->setTentative( (0 != count) @@ -1311,7 +1289,7 @@ void LLPanelGroupMembersSubTab::handleMemberDoubleClick() LLScrollListItem* selected = mMembersList->getFirstSelected(); if (selected) { - LLFloaterAvatarInfo::showFromDirectory( selected->getUUID() ); + LLFriendActions::showProfile(selected->getUUID()); } } @@ -1628,7 +1606,7 @@ void LLPanelGroupMembersSubTab::update(LLGroupChange gc) retrieved << "Retrieving role member mappings..."; } mMembersList->setEnabled(FALSE); - mMembersList->addCommentText(retrieved.str()); + mMembersList->setCommentText(retrieved.str()); } } @@ -1691,7 +1669,7 @@ void LLPanelGroupMembersSubTab::updateMembers() row["columns"][2]["column"] = "online"; row["columns"][2]["value"] = mMemberProgress->second->getOnlineStatus(); - row["columns"][2]["font"] = "SANSSERIFSMALL"; + row["columns"][2]["font"] = "SANSSERIF_SMALL"; mMembersList->addElement(row);//, ADD_SORTED); mHasMatch = TRUE; @@ -1707,7 +1685,7 @@ void LLPanelGroupMembersSubTab::updateMembers() else { mMembersList->setEnabled(FALSE); - mMembersList->addCommentText(std::string("No match.")); + mMembersList->setCommentText(std::string("No match.")); } } else @@ -1729,11 +1707,11 @@ void LLPanelGroupMembersSubTab::updateMembers() void* LLPanelGroupRolesSubTab::createTab(void* data) { LLUUID* group_id = static_cast<LLUUID*>(data); - return new LLPanelGroupRolesSubTab("panel group roles sub tab", *group_id); + return new LLPanelGroupRolesSubTab(*group_id); } -LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab(const std::string& name, const LLUUID& group_id) -: LLPanelGroupSubTab(name, group_id), mHasRoleChange(FALSE) +LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab(const LLUUID& group_id) +: LLPanelGroupSubTab(group_id), mHasRoleChange(FALSE) { } @@ -1775,8 +1753,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) parent->getChild<LLButton>("role_create", recurse); if ( mCreateRoleButton ) { - mCreateRoleButton->setCallbackUserData(this); - mCreateRoleButton->setClickedCallback(onCreateRole); + mCreateRoleButton->setClickedCallback(onCreateRole, this); mCreateRoleButton->setEnabled(FALSE); } @@ -1784,32 +1761,25 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) parent->getChild<LLButton>("role_delete", recurse); if ( mDeleteRoleButton ) { - mDeleteRoleButton->setCallbackUserData(this); - mDeleteRoleButton->setClickedCallback(onDeleteRole); + mDeleteRoleButton->setClickedCallback(onDeleteRole, this); mDeleteRoleButton->setEnabled(FALSE); } mRolesList->setCommitOnSelectionChange(TRUE); - mRolesList->setCallbackUserData(this); - mRolesList->setCommitCallback(onRoleSelect); + mRolesList->setCommitCallback(onRoleSelect, this); - mMemberVisibleCheck->setCallbackUserData(this); - mMemberVisibleCheck->setCommitCallback(onMemberVisibilityChange); + mMemberVisibleCheck->setCommitCallback(onMemberVisibilityChange, this); mAllowedActionsList->setCommitOnSelectionChange(TRUE); - mAllowedActionsList->setCallbackUserData(this); mRoleName->setCommitOnFocusLost(TRUE); - mRoleName->setCallbackUserData(this); - mRoleName->setKeystrokeCallback(onPropertiesKey); + mRoleName->setKeystrokeCallback(onPropertiesKey, this); mRoleTitle->setCommitOnFocusLost(TRUE); - mRoleTitle->setCallbackUserData(this); - mRoleTitle->setKeystrokeCallback(onPropertiesKey); + mRoleTitle->setKeystrokeCallback(onPropertiesKey, this); mRoleDescription->setCommitOnFocusLost(TRUE); - mRoleDescription->setCallbackUserData(this); - mRoleDescription->setCommitCallback(onDescriptionCommit); + mRoleDescription->setCommitCallback(onDescriptionCommit, this); mRoleDescription->setFocusReceivedCallback(onDescriptionFocus, this); setFooterEnabled(FALSE); @@ -2060,7 +2030,7 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() rd.mRolePowers, 0LL, mActionIcons, - onActionCheck, + boost::bind(&LLPanelGroupRolesSubTab::handleActionCheck, this, _1, false), TRUE, FALSE, is_owner_role); @@ -2157,24 +2127,18 @@ void LLPanelGroupRolesSubTab::buildMembersList() } } -// static -void LLPanelGroupRolesSubTab::onActionCheck(LLUICtrl* ctrl, void* user_data) -{ - LLPanelGroupRolesSubTab* self = static_cast<LLPanelGroupRolesSubTab*>(user_data); - LLCheckBoxCtrl* check = static_cast<LLCheckBoxCtrl*>(ctrl); - if (!check || !self) return; - - self->handleActionCheck(check); -} - struct ActionCBData { LLPanelGroupRolesSubTab* mSelf; LLCheckBoxCtrl* mCheck; }; -void LLPanelGroupRolesSubTab::handleActionCheck(LLCheckBoxCtrl* check, bool force) +void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force) { + LLCheckBoxCtrl* check = dynamic_cast<LLCheckBoxCtrl*>(ctrl); + if (!check) + return; + lldebugs << "LLPanelGroupRolesSubTab::handleActionSelect()" << llendl; LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); @@ -2442,11 +2406,11 @@ void LLPanelGroupRolesSubTab::saveRoleChanges() void* LLPanelGroupActionsSubTab::createTab(void* data) { LLUUID* group_id = static_cast<LLUUID*>(data); - return new LLPanelGroupActionsSubTab("panel group actions sub tab", *group_id); + return new LLPanelGroupActionsSubTab(*group_id); } -LLPanelGroupActionsSubTab::LLPanelGroupActionsSubTab(const std::string& name, const LLUUID& group_id) -: LLPanelGroupSubTab(name, group_id) +LLPanelGroupActionsSubTab::LLPanelGroupActionsSubTab(const LLUUID& group_id) +: LLPanelGroupSubTab(group_id) { } @@ -2472,12 +2436,8 @@ BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root) if (!mActionList || !mActionDescription || !mActionRoles || !mActionMembers) return FALSE; - mActionList->setCallbackUserData(this); mActionList->setCommitOnSelectionChange(TRUE); - mActionList->setCommitCallback(onActionSelect); - - mActionMembers->setCallbackUserData(this); - mActionRoles->setCallbackUserData(this); + mActionList->setCommitCallback(boost::bind(&LLPanelGroupActionsSubTab::handleActionSelect, this)); update(GC_ALL); @@ -2537,13 +2497,6 @@ void LLPanelGroupActionsSubTab::update(LLGroupChange gc) FALSE); } -// static -void LLPanelGroupActionsSubTab::onActionSelect(LLUICtrl* scroll, void* data) -{ - LLPanelGroupActionsSubTab* self = static_cast<LLPanelGroupActionsSubTab*>(data); - self->handleActionSelect(); -} - void LLPanelGroupActionsSubTab::handleActionSelect() { mActionMembers->deleteAllItems(); diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 95057bbfaf10ddaeb0b577807dee107ef9d93a20..3ceaae131392f885333325d2d40a5e98bbd88a72 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -42,6 +42,7 @@ class LLPanelGroupRolesSubTab; class LLPanelGroupActionsSubTab; class LLScrollListCtrl; class LLScrollListItem; +class LLTextEditor; // Forward declare for friend usage. //virtual BOOL LLPanelGroupSubTab::postBuildSubTab(LLView*); @@ -52,7 +53,7 @@ class LLPanelGroupRoles : public LLPanelGroupTab, public LLPanelGroupTabObserver { public: - LLPanelGroupRoles(const std::string& name, const LLUUID& group_id); + LLPanelGroupRoles(const LLUUID& group_id); virtual ~LLPanelGroupRoles(); // Allow sub tabs to ask for sibling controls. @@ -64,7 +65,6 @@ public: virtual BOOL isVisibleByAgent(LLAgent* agentp); static void* createTab(void* data); - static void onClickSubTab(void*,bool); void handleClickSubTab(); // Checks if the current tab needs to be applied, and tries to switch to the requested tab. @@ -104,7 +104,7 @@ protected: class LLPanelGroupSubTab : public LLPanelGroupTab { public: - LLPanelGroupSubTab(const std::string& name, const LLUUID& group_id); + LLPanelGroupSubTab(const LLUUID& group_id); virtual ~LLPanelGroupSubTab(); virtual BOOL postBuild(); @@ -131,7 +131,7 @@ public: U64 allowed_by_some, U64 allowed_by_all, icon_map_t& icons, - void (*commit_callback)(LLUICtrl*,void*), + LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, BOOL is_owner_role); @@ -140,7 +140,7 @@ public: U64 allowed_by_all, LLRoleActionSet* action_set, icon_map_t& icons, - void (*commit_callback)(LLUICtrl*,void*), + LLUICtrl::commit_callback_t commit_callback, BOOL show_all, BOOL filter, BOOL is_owner_role); @@ -164,7 +164,7 @@ protected: class LLPanelGroupMembersSubTab : public LLPanelGroupSubTab { public: - LLPanelGroupMembersSubTab(const std::string& name, const LLUUID& group_id); + LLPanelGroupMembersSubTab(const LLUUID& group_id); virtual ~LLPanelGroupMembersSubTab(); virtual BOOL postBuildSubTab(LLView* root); @@ -229,7 +229,7 @@ protected: class LLPanelGroupRolesSubTab : public LLPanelGroupSubTab { public: - LLPanelGroupRolesSubTab(const std::string& name, const LLUUID& group_id); + LLPanelGroupRolesSubTab(const LLUUID& group_id); virtual ~LLPanelGroupRolesSubTab(); virtual BOOL postBuildSubTab(LLView* root); @@ -249,7 +249,6 @@ public: void buildMembersList(); static void onActionCheck(LLUICtrl*, void*); - void handleActionCheck(LLCheckBoxCtrl*, bool force=false); bool addActionCB(const LLSD& notification, const LLSD& response, LLCheckBoxCtrl* check); static void onPropertiesKey(LLLineEditor*, void*); @@ -268,10 +267,8 @@ public: void saveRoleChanges(); protected: - LLSD createRoleItem(const LLUUID& role_id, - std::string name, - std::string title, - S32 members); + void handleActionCheck(LLUICtrl* ctrl, bool force); + LLSD createRoleItem(const LLUUID& role_id, std::string name, std::string title, S32 members); LLScrollListCtrl* mRolesList; LLNameListCtrl* mAssignedMembersList; @@ -293,7 +290,7 @@ protected: class LLPanelGroupActionsSubTab : public LLPanelGroupSubTab { public: - LLPanelGroupActionsSubTab(const std::string& name, const LLUUID& group_id); + LLPanelGroupActionsSubTab(const LLUUID& group_id); virtual ~LLPanelGroupActionsSubTab(); virtual BOOL postBuildSubTab(LLView* root); @@ -306,7 +303,6 @@ public: virtual bool apply(std::string& mesg); virtual void update(LLGroupChange gc); - static void onActionSelect(LLUICtrl*, void*); void handleActionSelect(); protected: LLScrollListCtrl* mActionList; diff --git a/indra/newview/llpanelland.cpp b/indra/newview/llpanelland.cpp index 8bb100d335a921664ec3e5a4c5ec1fc8f6e876de..92fe082ef2ff60e9cd7e41695a5ef870c2d0d513 100644 --- a/indra/newview/llpanelland.cpp +++ b/indra/newview/llpanelland.cpp @@ -79,8 +79,8 @@ BOOL LLPanelLandInfo::postBuild() // // Methods // -LLPanelLandInfo::LLPanelLandInfo(const std::string& name) -: LLPanel(name), +LLPanelLandInfo::LLPanelLandInfo() +: LLPanel(), mCheckShowOwners(NULL) { if (!sInstance) diff --git a/indra/newview/llpanelland.h b/indra/newview/llpanelland.h index 9a7e977711bb53c35e5f8b28b3982c0d61bb23f4..92fe3134052984afeede523848294e571f5aae5b 100644 --- a/indra/newview/llpanelland.h +++ b/indra/newview/llpanelland.h @@ -46,7 +46,7 @@ class LLPanelLandInfo : public LLPanel { public: - LLPanelLandInfo(const std::string& name); + LLPanelLandInfo(); virtual ~LLPanelLandInfo(); void refresh(); diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp new file mode 100644 index 0000000000000000000000000000000000000000..24b4082630f39833c4e3dde2b5b37a889b7e3966 --- /dev/null +++ b/indra/newview/llpanellandmarks.cpp @@ -0,0 +1,252 @@ +/** + * @file llpanellandmarks.cpp + * @brief Landmarks tab for Side Bar "Places" panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterreg.h" +#include "lllandmark.h" + +#include "llfloaterworldmap.h" +#include "lllandmarklist.h" +#include "llpanellandmarks.h" +#include "llsidetray.h" +#include "lltabcontainer.h" +#include "llworldmap.h" + +// Not yet implemented; need to remove buildPanel() from constructor when we switch +//static LLRegisterPanelClassWrapper<LLLandmarksPanel> t_landmarks("panel_landmarks"); + +LLLandmarksPanel::LLLandmarksPanel() + : LLPanelPlacesTab(), + mInventoryPanel(NULL) +{ + mSavedFolderState = new LLSaveFolderState(); + mSavedFolderState->setApply(FALSE); + + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_landmarks.xml"); +} + +LLLandmarksPanel::~LLLandmarksPanel() +{ + delete mSavedFolderState; +} + +BOOL LLLandmarksPanel::postBuild() +{ + if (!gInventory.isInventoryUsable()) + return FALSE; + + mInventoryPanel = getChild<LLInventoryPanel>("landmarks_list"); + mInventoryPanel->setFilterTypes(0x1 << LLInventoryType::IT_LANDMARK); + mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_LANDMARK); + mInventoryPanel->setSelectCallback(boost::bind(&LLLandmarksPanel::onSelectionChange, this, _1, _2)); + + LLFolderView* root_folder = mInventoryPanel->getRootFolder(); + root_folder->setReshapeCallback(boost::bind(&LLLandmarksPanel::onSelectionChange, this, _1, _2)); + + mActionBtn = getChild<LLButton>("selector"); + root_folder->addChild(mActionBtn); + mActionBtn->setEnabled(TRUE); + childSetAction("selector", boost::bind(&LLLandmarksPanel::onSelectorButtonClicked, this), this); + + return TRUE; +} + +// virtual +void LLLandmarksPanel::onSearchEdit(const std::string& string) +{ + if (string == "") + { + mInventoryPanel->setFilterSubString(LLStringUtil::null); + + // re-open folders that were initially open + mSavedFolderState->setApply(TRUE); + mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState); + LLOpenFoldersWithSelection opener; + mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener); + mInventoryPanel->getRootFolder()->scrollToShowSelection(); + } + + gInventory.startBackgroundFetch(); + + if (mInventoryPanel->getFilterSubString().empty() && string.empty()) + { + // current filter and new filter empty, do nothing + return; + } + + // save current folder open state if no filter currently applied + if (mInventoryPanel->getRootFolder()->getFilterSubString().empty()) + { + mSavedFolderState->setApply(FALSE); + mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState); + } + + // set new filter string + mInventoryPanel->setFilterSubString(string); +} + +// virtual +void LLLandmarksPanel::onShowOnMap() +{ + LLFolderViewItem* current_item = mInventoryPanel->getRootFolder()->getCurSelectedItem(); + if (!current_item) + return; + + LLFolderViewEventListener* listenerp = current_item->getListener(); + if (listenerp->getInventoryType() != LLInventoryType::IT_LANDMARK) + return; + + LLInventoryItem* inventory_item = gInventory.getItem(listenerp->getUUID()); + if (!inventory_item) + return; + + LLLandmark* landmark = gLandmarkList.getAsset(inventory_item->getAssetUUID()); + if (!landmark) + return; + + LLVector3d landmark_global_pos; + if (!landmark->getGlobalPos(landmark_global_pos)) + return; + + if (!landmark_global_pos.isExactlyZero()) + { + LLFloaterWorldMap::getInstance()->trackLocation(landmark_global_pos); + LLFloaterReg::showInstance("world_map", "center"); + } +} + +// virtual +void LLLandmarksPanel::onTeleport() +{ + LLFolderViewItem* current_item = mInventoryPanel->getRootFolder()->getCurSelectedItem(); + if (!current_item) + return; + + LLFolderViewEventListener* listenerp = current_item->getListener(); + if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK) + { + listenerp->openItem(); + } + + togglePanelPlacesButtons(TRUE); +} + +/* +// virtual +void LLLandmarksPanel::onCopySLURL() +{ + LLFolderViewItem* current_item = mInventoryPanel->getRootFolder()->getCurSelectedItem(); + if (!current_item) + return; + + LLFolderViewEventListener* listenerp = current_item->getListener(); + if (listenerp->getInventoryType() != LLInventoryType::IT_LANDMARK) + return; + + LLInventoryItem* inventory_item = gInventory.getItem(listenerp->getUUID()); + if (!inventory_item) + return; + + LLLandmark* landmark = gLandmarkList.getAsset(inventory_item->getAssetUUID()); + if (!landmark) + return; + + LLVector3d landmark_global_pos; + if (!landmark->getGlobalPos(landmark_global_pos)) + return; + + U64 new_region_handle = to_region_handle(landmark_global_pos); + + LLWorldMap::url_callback_t cb = boost::bind( + &LLPanelPlacesTab::onRegionResponse, this, + landmark_global_pos, _1, _2, _3, _4); + + LLWorldMap::getInstance()->sendHandleRegionRequest(new_region_handle, cb, std::string("unused"), false); +} +*/ + +void LLLandmarksPanel::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action) +{ + LLFolderViewItem* current_item = mInventoryPanel->getRootFolder()->getCurSelectedItem(); + if (!current_item) + return; + + LLFolderViewEventListener* listenerp = current_item->getListener(); + if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK) + { + S32 bottom = 0; + LLFolderViewItem* folder = current_item->getParentFolder(); + + while ( folder->getParentFolder() != NULL ) + { + bottom += folder->getRect().mBottom; + folder = folder->getParentFolder(); + } + + LLRect rect = current_item->getRect(); + LLRect btn_rect( + rect.mRight - mActionBtn->getRect().getWidth(), + bottom + rect.mTop, + rect.mRight, + bottom + rect.mBottom); + + mActionBtn->setRect(btn_rect); + + if (!mActionBtn->getVisible()) + mActionBtn->setVisible(TRUE); + + togglePanelPlacesButtons(TRUE); + } + else + { + if (mActionBtn->getVisible()) + mActionBtn->setVisible(FALSE); + + togglePanelPlacesButtons(FALSE); + } +} + +void LLLandmarksPanel::onSelectorButtonClicked() +{ + LLFolderViewItem* cur_item = mInventoryPanel->getRootFolder()->getCurSelectedItem(); + + LLFolderViewEventListener* listenerp = cur_item->getListener(); + if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK) + { + LLSD key; + key["type"] = LLPanelPlaces::LANDMARK; + key["id"] = listenerp->getUUID(); + + LLSideTray::getInstance()->showPanel("panel_places", key); + } +} diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h new file mode 100644 index 0000000000000000000000000000000000000000..0f400a722ee6c0882c2e7d85c9cde15d2a15366d --- /dev/null +++ b/indra/newview/llpanellandmarks.h @@ -0,0 +1,61 @@ +/** + * @file llpanellandmarks.h + * @brief Landmarks tab for Side Bar "Places" panel + * class definition + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELLANDMARKS_H +#define LL_LLPANELLANDMARKS_H + +#include "llinventoryview.h" +#include "llinventorymodel.h" +#include "llpanelplacestab.h" + +class LLLandmarksPanel : public LLPanelPlacesTab +{ +public: + LLLandmarksPanel(); + virtual ~LLLandmarksPanel(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onSearchEdit(const std::string& string); + /*virtual*/ void onShowOnMap(); + /*virtual*/ void onTeleport(); + ///*virtual*/ void onCopySLURL(); + + void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); + void onSelectorButtonClicked(); + +private: + LLInventoryPanel* mInventoryPanel; + LLSaveFolderState* mSavedFolderState; + LLButton* mActionBtn; +}; + +#endif //LL_LLPANELLANDMARKS_H diff --git a/indra/newview/llpanellandmedia.cpp b/indra/newview/llpanellandmedia.cpp index b8886c949310d94c4699da525d7013c5aeb4e179..d1ab3510cd718fab74ad23cb8465bed158f2cac2 100644 --- a/indra/newview/llpanellandmedia.cpp +++ b/indra/newview/llpanellandmedia.cpp @@ -60,8 +60,7 @@ //--------------------------------------------------------------------------- LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) -: LLPanel(std::string("land_media_panel")), - +: LLPanel(), mParcel(parcel), mCheckSoundLocal(NULL), mSoundHelpButton(NULL), @@ -118,8 +117,7 @@ BOOL LLPanelLandMedia::postBuild() childSetCommitCallback("music_url", onCommitAny, this); mMediaTextureCtrl = getChild<LLTextureCtrl>("media texture"); - mMediaTextureCtrl->setCommitCallback( onCommitAny ); - mMediaTextureCtrl->setCallbackUserData( this ); + mMediaTextureCtrl->setCommitCallback( onCommitAny, this ); mMediaTextureCtrl->setAllowNoTexture ( TRUE ); mMediaTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); mMediaTextureCtrl->setNonImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index bc5e8f2482e5f008ba70a821bfbda7d84e009679..75df49e5e37d7a90b541a6c48d2ed5bbd86e3ecb 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -34,9 +34,8 @@ #include "llpanellogin.h" -#include "llpanelgeneral.h" - #include "indra_constants.h" // for key and mask constants +#include "llfloaterreg.h" #include "llfontgl.h" #include "llmd5.h" #include "llsecondlifeurls.h" @@ -49,8 +48,6 @@ #include "llcombobox.h" #include "llcurl.h" #include "llviewercontrol.h" -#include "llfloaterabout.h" -#include "llfloatertest.h" #include "llfloaterpreference.h" #include "llfocusmgr.h" #include "lllineeditor.h" @@ -70,12 +67,12 @@ #include "llhttpclient.h" #include "llweb.h" #include "llwebbrowserctrl.h" - #include "llfloaterhtml.h" +#include "llrootview.h" #include "llfloaterhtmlhelp.h" #include "llfloatertos.h" - +#include "lltrans.h" #include "llglheaders.h" #define USE_VIEWER_AUTH 0 @@ -166,7 +163,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, BOOL show_server, void (*callback)(S32 option, void* user_data), void *cb_data) -: LLPanel(std::string("panel_login"), LLRect(0,600,800,0), FALSE), // not bordered +: LLPanel(), mLogoImage(), mCallback(callback), mCallbackData(cb_data), @@ -190,7 +187,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLPanelLogin::sInstance = this; // add to front so we are the bottom-most child - gViewerWindow->getRootView()->addChildAtEnd(this); + gViewerWindow->getRootView()->addChildInBack(this); // Logo mLogoImage = LLUI::getUIImage("startup_logo.j2c"); @@ -207,9 +204,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, childSetPrevalidate("first_name_edit", LLLineEditor::prevalidatePrintableNoSpace); childSetPrevalidate("last_name_edit", LLLineEditor::prevalidatePrintableNoSpace); - childSetCommitCallback("password_edit", mungePassword); - childSetKeystrokeCallback("password_edit", onPassKey, this); - childSetUserData("password_edit", this); + childSetCommitCallback("password_edit", mungePassword, this); + getChild<LLLineEditor>("password_edit")->setKeystrokeCallback(onPassKey, this); // change z sort of clickable text to be behind buttons sendChildToBack(getChildView("channel_text")); @@ -219,14 +215,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, if (edit) edit->setDrawAsterixes(TRUE); LLComboBox* combo = getChild<LLComboBox>("start_location_combo"); - combo->setAllowTextEntry(TRUE, 128, FALSE); - // The XML file loads the combo with the following labels: - // 0 - "My Home" - // 1 - "My Last Location" - // 2 - "<Type region name>" - - BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation"); std::string sim_string = LLURLSimString::sInstance.mSimString; if (!sim_string.empty()) { @@ -236,19 +225,11 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, combo->setTextEntry(sim_string); combo->setCurrentByIndex( 2 ); } - else if (login_last) - { - combo->setCurrentByIndex( 1 ); - } - else - { - combo->setCurrentByIndex( 0 ); - } - combo->setCommitCallback( &set_start_location ); + combo->setCommitCallback( &set_start_location, NULL ); LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo"); - server_choice_combo->setCommitCallback(onSelectServer); + server_choice_combo->setCommitCallback(onSelectServer, NULL); server_choice_combo->setFocusLostCallback(onServerComboLostFocus); childSetAction("connect_btn", onClickConnect, this); @@ -266,14 +247,13 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLTextBox* channel_text = getChild<LLTextBox>("channel_text"); channel_text->setTextArg("[CHANNEL]", channel); // though not displayed channel_text->setTextArg("[VERSION]", version); - channel_text->setClickedCallback(onClickVersion); - channel_text->setCallbackUserData(this); + channel_text->setClickedCallback(onClickVersion, this); LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text"); - forgot_password_text->setClickedCallback(onClickForgotPassword); + forgot_password_text->setClickedCallback(onClickForgotPassword, NULL); LLTextBox* create_new_account_text = getChild<LLTextBox>("create_new_account_text"); - create_new_account_text->setClickedCallback(onClickNewAccount); + create_new_account_text->setClickedCallback(onClickNewAccount, NULL); #endif // get the web browser control @@ -432,16 +412,13 @@ BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask) return TRUE; } - if (('P' == key) && (MASK_CONTROL == mask)) - { - LLFloaterPreference::show(NULL); - return TRUE; - } - if (('T' == key) && (MASK_CONTROL == mask)) - { - new LLFloaterSimple("floater_test.xml"); - return TRUE; + { // previously was "Test Floater" + if(gSavedSettings.getBOOL("QAMode")) + { + LLFloaterReg::showInstance("ui_preview", LLSD(), TRUE); + return TRUE; + } } if ( KEY_F1 == key ) @@ -656,19 +633,6 @@ void LLPanelLogin::refreshLocation( bool force_visible ) #if USE_VIEWER_AUTH loadLoginPage(); #else - LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo"); - - if (LLURLSimString::parse()) - { - combo->setCurrentByIndex( 3 ); // BUG? Maybe 2? - combo->setTextEntry(LLURLSimString::sInstance.mSimString); - } - else - { - BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation"); - combo->setCurrentByIndex( login_last ? 1 : 0 ); - } - BOOL show_start = TRUE; if ( ! force_visible ) @@ -688,7 +652,7 @@ void LLPanelLogin::refreshLocation( bool force_visible ) } // static -void LLPanelLogin::close() +void LLPanelLogin::closePanel() { if (sInstance) { @@ -787,14 +751,7 @@ void LLPanelLogin::loadLoginPage() } else { - if (gSavedSettings.getBOOL("LoginLastLocation")) - { - location = "last"; - } - else - { - location = "home"; - } + location = gSavedSettings.getString("LoginLocation"); } std::string firstname, lastname; @@ -899,13 +856,12 @@ void LLPanelLogin::onClickConnect(void *) } else { - LLNotifications::instance().add("MustHaveAccountToLogIn", LLSD(), LLSD(), - LLPanelLogin::newAccountAlertCallback); + LLNotifications::instance().add("MustHaveAccountToLogIn"); } } } - +/* // static bool LLPanelLogin::newAccountAlertCallback(const LLSD& notification, const LLSD& response) { @@ -913,7 +869,7 @@ bool LLPanelLogin::newAccountAlertCallback(const LLSD& notification, const LLSD& if (0 == option) { llinfos << "Going to account creation URL" << llendl; - LLWeb::loadURLExternal( CREATE_ACCOUNT_URL ); + LLWeb::loadURLExternal( LLNotifications::instance().getGlobalString("CREATE_ACCOUNT_URL")); } else { @@ -921,12 +877,12 @@ bool LLPanelLogin::newAccountAlertCallback(const LLSD& notification, const LLSD& } return false; } - +*/ // static void LLPanelLogin::onClickNewAccount(void*) { - LLWeb::loadURLExternal( CREATE_ACCOUNT_URL ); + LLWeb::loadURLExternal(sInstance->getString("create_account_url")); } @@ -949,7 +905,7 @@ void LLPanelLogin::onClickQuit(void*) // static void LLPanelLogin::onClickVersion(void*) { - LLFloaterAbout::show(NULL); + LLFloaterReg::showInstance("sl_about"); } //static @@ -1023,6 +979,8 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*) void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) { + if (!sInstance) return; + LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); if(fe == combo) { diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 47d42da7f1aa5a3e9ad2f32f2a6284d3470ede51..540f93805344356f85e63afe9b0d00cb766403db 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -34,7 +34,7 @@ #define LL_LLPANELLOGIN_H #include "llpanel.h" -#include "llmemory.h" // LLPointer<> +#include "llpointer.h" // LLPointer<> #include "llwebbrowserctrl.h" // LLWebBrowserCtrlObserver class LLUIImage; @@ -72,7 +72,7 @@ public: static BOOL isGridComboDirty(); static void getLocation(std::string &location); - static void close(); + static void closePanel(); void setSiteIsAlive( bool alive ); @@ -84,7 +84,7 @@ public: private: static void onClickConnect(void*); static void onClickNewAccount(void*); - static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response); +// static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response); static void onClickQuit(void*); static void onClickVersion(void*); virtual void onNavigateComplete( const EventType& eventIn ); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 75f479c16f82ea71f2326320339227a7786f3ad6..9ec98743844409dcb48f4f40ffa56866405e1026 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -52,7 +52,6 @@ #include "llcombobox.h" #include "llfocusmgr.h" #include "llmanipscale.h" -#include "llpanelinventory.h" #include "llpreviewscript.h" #include "llresmgr.h" #include "llselectmgr.h" @@ -62,6 +61,7 @@ #include "lltool.h" #include "lltoolcomp.h" #include "lltoolmgr.h" +#include "lltrans.h" #include "llui.h" #include "llviewerobject.h" #include "llviewerregion.h" @@ -99,13 +99,23 @@ enum { MI_HOLE_COUNT }; -//*TODO:translate (depricated, so very low priority) -static const std::string LEGACY_FULLBRIGHT_DESC("Fullbright (Legacy)"); +//static const std::string LEGACY_FULLBRIGHT_DESC =LLTrans::getString("Fullbright"); BOOL LLPanelObject::postBuild() { setMouseOpaque(FALSE); - + + std::map<std::string, std::string> material_name_map; + material_name_map["Stone"]= LLTrans::getString("Stone"); + material_name_map["Metal"]= LLTrans::getString("Metal"); + material_name_map["Glass"]= LLTrans::getString("Glass"); + material_name_map["Wood"]= LLTrans::getString("Wood"); + material_name_map["Flesh"]= LLTrans::getString("Flesh"); + material_name_map["Plastic"]= LLTrans::getString("Plastic"); + material_name_map["Rubber"]= LLTrans::getString("Rubber"); + material_name_map["Light"]= LLTrans::getString("Light"); + + LLMaterialTable::basic.initTableTransNames(material_name_map); //-------------------------------------------------------- // Top //-------------------------------------------------------- @@ -164,14 +174,14 @@ BOOL LLPanelObject::postBuild() mComboMaterial = getChild<LLComboBox>("material"); childSetCommitCallback("material",onCommitMaterial,this); mComboMaterial->removeall(); - // *TODO:translate + for (LLMaterialTable::info_list_t::iterator iter = LLMaterialTable::basic.mMaterialInfoList.begin(); iter != LLMaterialTable::basic.mMaterialInfoList.end(); ++iter) { LLMaterialInfo* minfop = *iter; if (minfop->mMCode != LL_MCODE_LIGHT) { - mComboMaterial->add(minfop->mName); + mComboMaterial->add(minfop->mName); } } mComboMaterialItemCount = mComboMaterial->getItemCount(); @@ -263,11 +273,10 @@ BOOL LLPanelObject::postBuild() if (mCtrlSculptTexture) { mCtrlSculptTexture->setDefaultImageAssetID(LLUUID(SCULPT_DEFAULT_TEXTURE)); - mCtrlSculptTexture->setCommitCallback( LLPanelObject::onCommitSculpt ); - mCtrlSculptTexture->setOnCancelCallback( LLPanelObject::onCancelSculpt ); - mCtrlSculptTexture->setOnSelectCallback( LLPanelObject::onSelectSculpt ); - mCtrlSculptTexture->setDropCallback(LLPanelObject::onDropSculpt); - mCtrlSculptTexture->setCallbackUserData( this ); + mCtrlSculptTexture->setCommitCallback( boost::bind(&LLPanelObject::onCommitSculpt, this, _2 )); + mCtrlSculptTexture->setOnCancelCallback( boost::bind(&LLPanelObject::onCancelSculpt, this, _2 )); + mCtrlSculptTexture->setOnSelectCallback( boost::bind(&LLPanelObject::onSelectSculpt, this, _2 )); + mCtrlSculptTexture->setDropCallback( boost::bind(&LLPanelObject::onDropSculpt, this, _2 )); // Don't allow (no copy) or (no transfer) textures to be selected during immediate mode mCtrlSculptTexture->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); // Allow any texture to be used during non-immediate mode. @@ -303,8 +312,8 @@ BOOL LLPanelObject::postBuild() return TRUE; } -LLPanelObject::LLPanelObject(const std::string& name) -: LLPanel(name), +LLPanelObject::LLPanelObject() +: LLPanel(), mIsPhysical(FALSE), mIsTemporary(FALSE), mIsPhantom(FALSE), @@ -530,7 +539,7 @@ void LLPanelObject::getState( ) } } func; bool material_same = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, material_code ); - + std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); if (editable && single_volume && material_same) { mComboMaterial->setEnabled( TRUE ); @@ -549,7 +558,7 @@ void LLPanelObject::getState( ) { mComboMaterial->remove(LEGACY_FULLBRIGHT_DESC); } - // *TODO:Translate + mComboMaterial->setSimple(std::string(LLMaterialTable::basic.getName(material_code))); } } @@ -1163,7 +1172,7 @@ void LLPanelObject::getState( ) } // static -BOOL LLPanelObject::precommitValidate( LLUICtrl* ctrl, void* userdata ) +bool LLPanelObject::precommitValidate( const LLSD& data ) { // TODO: Richard will fill this in later. return TRUE; // FALSE means that validation failed and new value should not be commited. @@ -1244,6 +1253,7 @@ void LLPanelObject::onCommitMaterial( LLUICtrl* ctrl, void* userdata ) { // apply the currently selected material to the object const std::string& material_name = box->getSimple(); + std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); if (material_name != LEGACY_FULLBRIGHT_DESC) { U8 material_code = LLMaterialTable::basic.getMCode(material_name); @@ -1992,60 +2002,49 @@ void LLPanelObject::onCommitCastShadows( LLUICtrl* ctrl, void* userdata ) } -// static -void LLPanelObject::onSelectSculpt(LLUICtrl* ctrl, void* userdata) +void LLPanelObject::onSelectSculpt(const LLSD& data) { - LLPanelObject* self = (LLPanelObject*) userdata; - - LLTextureCtrl* mTextureCtrl = self->getChild<LLTextureCtrl>("sculpt texture control"); + LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control"); if (mTextureCtrl) { - self->mSculptTextureRevert = mTextureCtrl->getImageAssetID(); + mSculptTextureRevert = mTextureCtrl->getImageAssetID(); } - self->sendSculpt(); + sendSculpt(); } -void LLPanelObject::onCommitSculpt( LLUICtrl* ctrl, void* userdata ) +void LLPanelObject::onCommitSculpt( const LLSD& data ) { - LLPanelObject* self = (LLPanelObject*) userdata; - - self->sendSculpt(); + sendSculpt(); } -// static -BOOL LLPanelObject::onDropSculpt(LLUICtrl*, LLInventoryItem* item, void* userdata) +BOOL LLPanelObject::onDropSculpt(LLInventoryItem* item) { - LLPanelObject* self = (LLPanelObject*) userdata; - - LLTextureCtrl* mTextureCtrl = self->getChild<LLTextureCtrl>("sculpt texture control"); + LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control"); if (mTextureCtrl) { LLUUID asset = item->getAssetUUID(); mTextureCtrl->setImageAssetID(asset); - self->mSculptTextureRevert = asset; + mSculptTextureRevert = asset; } return TRUE; } -// static -void LLPanelObject::onCancelSculpt(LLUICtrl* ctrl, void* userdata) +void LLPanelObject::onCancelSculpt(const LLSD& data) { - LLPanelObject* self = (LLPanelObject*) userdata; - - LLTextureCtrl* mTextureCtrl = self->getChild<LLTextureCtrl>("sculpt texture control"); + LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control"); if(!mTextureCtrl) return; - mTextureCtrl->setImageAssetID(self->mSculptTextureRevert); + mTextureCtrl->setImageAssetID(mSculptTextureRevert); - self->sendSculpt(); + sendSculpt(); } // static diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index 9ed091ed5f228359280f930a311c8cb59f8d13be..1ab4ff581ee1bcf80457c2730fc4fd5721d77f4b 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -35,7 +35,7 @@ #include "v3math.h" #include "llpanel.h" -#include "llmemory.h" +#include "llpointer.h" #include "llvolume.h" class LLSpinCtrl; @@ -54,7 +54,7 @@ class LLUUID; class LLPanelObject : public LLPanel { public: - LLPanelObject(const std::string& name); + LLPanelObject(); virtual ~LLPanelObject(); virtual BOOL postBuild(); @@ -63,7 +63,7 @@ public: void refresh(); - static BOOL precommitValidate(LLUICtrl* ctrl,void* userdata); + static bool precommitValidate(const LLSD& data); static void onCommitLock(LLUICtrl *ctrl, void *data); static void onCommitPosition( LLUICtrl* ctrl, void* userdata); @@ -78,10 +78,10 @@ public: static void onCommitMaterial( LLUICtrl* ctrl, void* userdata); - static void onCommitSculpt( LLUICtrl* ctrl, void* userdata); - static void onCancelSculpt( LLUICtrl* ctrl, void* userdata); - static void onSelectSculpt( LLUICtrl* ctrl, void* userdata); - static BOOL onDropSculpt( LLUICtrl* ctrl, LLInventoryItem* item, void* ud); + void onCommitSculpt(const LLSD& data); + void onCancelSculpt(const LLSD& data); + void onSelectSculpt(const LLSD& data); + BOOL onDropSculpt(LLInventoryItem* item); static void onCommitSculptType( LLUICtrl *ctrl, void* userdata); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1d7a2748cc833d3e11425cb98f765542f47ed24c --- /dev/null +++ b/indra/newview/llpanelpeople.cpp @@ -0,0 +1,729 @@ +/** + * @file llpanelpeople.cpp + * @brief Side tray "People" panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +// libs +#include "llfloaterreg.h" +#include "llmenugl.h" +#include "llsearcheditor.h" +#include "lltabcontainer.h" +#include "lluictrlfactory.h" + +#include "llpanelpeople.h" + +// newview +#include "llagent.h" +#include "llavatarlist.h" +#include "llcallingcard.h" // for LLAvatarTracker +#include "llfloateravatarpicker.h" +#include "llfloaterminiinspector.h" +#include "llfriendactions.h" +#include "llgroupactions.h" +#include "llgrouplist.h" +#include "llrecentpeople.h" +#include "llviewercontrol.h" // for gSavedSettings +#include "llviewermenu.h" // for gMenuHolder +#include "llvoiceclient.h" +#include "llworld.h" + +using namespace LLOldEvents; + +#define FRIEND_LIST_UPDATE_TIMEOUT 0.5 +#define NEARBY_LIST_UPDATE_INTERVAL 1 +#define RECENT_LIST_UPDATE_DELAY 1 + +static LLRegisterPanelClassWrapper<LLPanelPeople> t_people("panel_people"); + +//============================================================================= + +class LLPanelPeople::Updater +{ +public: + typedef boost::function<bool(U32)> callback_t; + Updater(callback_t cb) + : mCallback(cb) + { + } + virtual ~Updater() + { + } + virtual void setActive(bool) {} +protected: + bool updateList(U32 mask = 0) + { + return mCallback(mask); + } + callback_t mCallback; +}; + +class LLAvatarListUpdater : public LLPanelPeople::Updater, public LLEventTimer +{ +public: + LLAvatarListUpdater(callback_t cb, F32 period) + : LLEventTimer(period), + LLPanelPeople::Updater(cb) + { + mEventTimer.stop(); + } +}; + +/** + * Updates the friends list. + */ +class LLFriendListUpdater : public LLAvatarListUpdater, public LLFriendObserver +{ + LOG_CLASS(LLFriendListUpdater); +public: + LLFriendListUpdater(callback_t cb) + : LLAvatarListUpdater(cb, FRIEND_LIST_UPDATE_TIMEOUT) + { + LLAvatarTracker::instance().addObserver(this); + // For notification when SIP online status changes. + LLVoiceClient::getInstance()->addObserver(this); + } + ~LLFriendListUpdater() + { + LLVoiceClient::getInstance()->removeObserver(this); + LLAvatarTracker::instance().removeObserver(this); + } + /*virtual*/ void setActive(bool val) + { + if (!val) + return; + + // Perform updates until all names are loaded. + if (!updateList(LLFriendObserver::ADD)) + changed(LLFriendObserver::ADD); + } + /*virtual*/ void changed(U32 mask) + { + // events can arrive quickly in bulk - we need not process EVERY one of them - + // so we wait a short while to let others pile-in, and process them in aggregate. + mEventTimer.start(); + + // save-up all the mask-bits which have come-in + mMask |= mask; + } + /*virtual*/ BOOL tick() + { + if (updateList(mMask)) + { + // Got all names, stop updates. + mEventTimer.stop(); + mMask = 0; + } + + return FALSE; + } +private: + U32 mMask; +}; + +/** + * Periodically updates the nearby people list while the Nearby tab is active. + */ +class LLNearbyListUpdater : public LLAvatarListUpdater +{ + LOG_CLASS(LLNearbyListUpdater); +public: + LLNearbyListUpdater(callback_t cb) + : LLAvatarListUpdater(cb, NEARBY_LIST_UPDATE_INTERVAL) + { + setActive(false); + } + /*virtual*/ BOOL tick() + { + updateList(); + return FALSE; + } + /*virtual*/ void setActive(bool val) + { + if (val) + { + // update immediately and start regular updates + tick(); + mEventTimer.start(); + } + else + { + // stop regular updates + mEventTimer.stop(); + } + } +private: +}; + +/** + * Updates the recent people list (those the agent has recently interacted with). + */ +class LLRecentListUpdater : public LLAvatarListUpdater +{ + LOG_CLASS(LLRecentListUpdater); +public: + LLRecentListUpdater(callback_t cb) + : LLAvatarListUpdater(cb, RECENT_LIST_UPDATE_DELAY) + { + LLRecentPeople::instance().setChangedCallback(boost::bind(&LLRecentListUpdater::onRecentPeopleChanged, this)); + } +private: + /*virtual*/ BOOL tick() + { + // Update the list until we get all the names. + if (updateList()) + { + // Got all names, stop updates. + mEventTimer.stop(); + } + + return FALSE; + } + void onRecentPeopleChanged() + { + if (!updateList()) + { + // Some names are incomplete, schedule another update. + mEventTimer.start(); + } + } +}; + +/** + * Updates the group list on events from LLAgent. + */ +class LLGroupListUpdater : public LLPanelPeople::Updater, public LLSimpleListener +{ + LOG_CLASS(LLGroupListUpdater); +public: + LLGroupListUpdater(callback_t cb) + : LLPanelPeople::Updater(cb) + { + gAgent.addListener(this, "new group"); + } + ~LLGroupListUpdater() + { + gAgent.removeListener(this); + } + /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + { + // Why is "new group" sufficient? + if (event->desc() == "new group") + { + updateList(); + return true; + } + + return false; + } +}; + +//============================================================================= + +LLPanelPeople::LLPanelPeople() + : LLPanel(), + mFilterSubString(LLStringUtil::null), + mSearchEditor(NULL), + mTabContainer(NULL), + mFriendList(NULL), + mNearbyList(NULL), + mRecentList(NULL) +{ + mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::onFriendListUpdate,this, _1)); + mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList, this)); + mRecentListUpdater = new LLRecentListUpdater(boost::bind(&LLPanelPeople::updateRecentList, this)); + mGroupListUpdater = new LLGroupListUpdater (boost::bind(&LLPanelPeople::updateGroupList, this)); +} + +LLPanelPeople::~LLPanelPeople() +{ + delete mNearbyListUpdater; + delete mFriendListUpdater; + delete mRecentListUpdater; + delete mGroupListUpdater; + + LLView::deleteViewByHandle(mGroupPlusMenuHandle); + LLView::deleteViewByHandle(mGroupMinusMenuHandle); +} + +BOOL LLPanelPeople::postBuild() +{ + mSearchEditor = getChild<LLSearchEditor>("filter_input"); + + mTabContainer = getChild<LLTabContainer>("tabs"); + mTabContainer->setCommitCallback(boost::bind(&LLPanelPeople::onTabSelected, this, _2)); + mTabContainer->selectTabByName("friends_panel"); // must go after setting commit callback + + mFriendList = getChild<LLPanel>("friends_panel")->getChild<LLAvatarList>("avatar_list"); + mNearbyList = getChild<LLPanel>("nearby_panel")->getChild<LLAvatarList>("avatar_list"); + mRecentList = getChild<LLPanel>("recent_panel")->getChild<LLAvatarList>("avatar_list"); + mGroupList = getChild<LLGroupList>("group_list"); + + LLPanel* groups_panel = getChild<LLPanel>("groups_panel"); + groups_panel->childSetAction("activate_btn", boost::bind(&LLPanelPeople::onActivateButtonClicked, this)); + groups_panel->childSetAction("plus_btn", boost::bind(&LLPanelPeople::onGroupPlusButtonClicked, this)); + groups_panel->childSetAction("minus_btn", boost::bind(&LLPanelPeople::onGroupMinusButtonClicked, this)); + + LLPanel* friends_panel = getChild<LLPanel>("friends_panel"); + friends_panel->childSetAction("add_btn", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this)); + friends_panel->childSetAction("del_btn", boost::bind(&LLPanelPeople::onDeleteFriendButtonClicked, this)); + + mFriendList->setDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, mFriendList)); + mNearbyList->setDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, mNearbyList)); + mRecentList->setDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, mRecentList)); + mFriendList->setCommitCallback(boost::bind(&LLPanelPeople::onAvatarListCommitted, this, mFriendList)); + mNearbyList->setCommitCallback(boost::bind(&LLPanelPeople::onAvatarListCommitted, this, mNearbyList)); + mRecentList->setCommitCallback(boost::bind(&LLPanelPeople::onAvatarListCommitted, this, mRecentList)); + + mGroupList->setDoubleClickCallback(boost::bind(&LLPanelPeople::onGroupInfoButtonClicked, this)); + mGroupList->setCommitCallback(boost::bind(&LLPanelPeople::updateButtons, this)); + + buttonSetAction("view_profile_btn", boost::bind(&LLPanelPeople::onViewProfileButtonClicked, this)); + buttonSetAction("add_friend_btn", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); + buttonSetAction("group_info_btn", boost::bind(&LLPanelPeople::onGroupInfoButtonClicked, this)); + buttonSetAction("chat_btn", boost::bind(&LLPanelPeople::onChatButtonClicked, this)); + buttonSetAction("im_btn", boost::bind(&LLPanelPeople::onImButtonClicked, this)); + buttonSetAction("call_btn", boost::bind(&LLPanelPeople::onCallButtonClicked, this)); + buttonSetAction("teleport_btn", boost::bind(&LLPanelPeople::onTeleportButtonClicked, this)); + buttonSetAction("share_btn", boost::bind(&LLPanelPeople::onShareButtonClicked, this)); + buttonSetAction("more_btn", boost::bind(&LLPanelPeople::onMoreButtonClicked, this)); + + // Create menus. + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + registrar.add("People.Group.Plus.Action", boost::bind(&LLPanelPeople::onGroupPlusMenuItemClicked, this, _2)); + LLMenuGL* plus_menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_group_plus.xml", gMenuHolder); + mGroupPlusMenuHandle = plus_menu->getHandle(); + registrar.add("People.Group.Minus.Action", boost::bind(&LLPanelPeople::onGroupMinusMenuItemClicked, this, _2)); + LLMenuGL* minus_menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_group_minus.xml", gMenuHolder); + mGroupMinusMenuHandle = minus_menu->getHandle(); + + // Perform initial update. + mFriendListUpdater->setActive(true); + updateGroupList(); + updateRecentList(); + + return TRUE; +} + +bool LLPanelPeople::refreshFriendNames(U32 changed_mask) +{ + // get all buddies we know about + LLAvatarTracker::buddy_map_t all_buddies; + LLAvatarTracker::instance().copyBuddyList(all_buddies); + + bool have_names = true; + + if (changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) + { + // *TODO: it's suboptimal to rebuild the whole list on online status change. + + // convert the buddy map to vector + std::vector<LLUUID> avatar_ids; + LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin(); + for (; buddy_it != all_buddies.end(); ++buddy_it) + avatar_ids.push_back(buddy_it->first); + + // do refresh the friend list + if (avatar_ids.size() > 0) + have_names = mFriendList->updateList(avatar_ids); + else + mFriendList->setCommentText(getString("no_friends")); + } + + return have_names; +} + +bool LLPanelPeople::updateFriendList(U32 changed_mask) +{ + // Refresh names. + if (changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) + { + return refreshFriendNames(changed_mask); + } + + return true; +} + +bool LLPanelPeople::updateNearbyList() +{ + std::vector<LLUUID> avatar_ids; + + LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); + + mNearbyList->updateList(avatar_ids); + + if (avatar_ids.size() == 0) + mNearbyList->setCommentText(getString("no_one_near")); + + return true; +} + +bool LLPanelPeople::updateRecentList() +{ + std::vector<LLUUID> avatar_ids; + + LLRecentPeople::instance().get(avatar_ids); + + if (avatar_ids.size() > 0) + return mRecentList->updateList(avatar_ids); + + mRecentList->setCommentText(getString("no_people")); + return true; +} + +bool LLPanelPeople::updateGroupList() +{ + return mGroupList->updateList(); +} + +void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible) +{ + // Currently all bottom buttons are wrapped with layout panels. + // Hiding a button has no effect: the panel still occupies its space. + // So we have to hide the whole panel (along with its button) + // to free some space up. + LLButton* btn = getChild<LLView>("button_bar")->getChild<LLButton>(btn_name); + LLPanel* btn_parent = dynamic_cast<LLPanel*>(btn->getParent()); + if (btn_parent) + btn_parent->setVisible(visible); +} + +void LLPanelPeople::buttonSetEnabled(const std::string& btn_name, bool enabled) +{ + // To make sure we're referencing the right widget (a child of the button bar). + LLButton* button = getChild<LLView>("button_bar")->getChild<LLButton>(btn_name); + button->setEnabled(enabled); +} + +void LLPanelPeople::buttonSetAction(const std::string& btn_name, const commit_signal_t::slot_type& cb) +{ + // To make sure we're referencing the right widget (a child of the button bar). + LLButton* button = getChild<LLView>("button_bar")->getChild<LLButton>(btn_name); + button->setClickedCallback(cb); +} + +void LLPanelPeople::updateButtons() +{ + std::string cur_tab = mTabContainer->getCurrentPanel()->getName(); + bool nearby_tab_active = (cur_tab == "nearby_panel"); + bool friends_tab_active = (cur_tab == "friends_panel"); + bool group_tab_active = (cur_tab == "groups_panel"); + bool recent_tab_active = (cur_tab == "recent_panel"); + LLUUID selected_id; + + buttonSetVisible("group_info_btn", group_tab_active); + buttonSetVisible("chat_btn", group_tab_active); + buttonSetVisible("add_friend_btn", nearby_tab_active || recent_tab_active); + buttonSetVisible("view_profile_btn", !group_tab_active); + buttonSetVisible("im_btn", !group_tab_active); + buttonSetVisible("teleport_btn", friends_tab_active || group_tab_active); + buttonSetVisible("share_btn", !recent_tab_active && false); // not implemented yet + + if (group_tab_active) + { + bool cur_group_active = true; + + selected_id = mGroupList->getCurrentID(); + if (selected_id.notNull()) + cur_group_active = (gAgent.getGroupID() == selected_id); + + bool item_selected = selected_id.notNull(); + LLPanel* groups_panel = mTabContainer->getCurrentPanel(); + groups_panel->childSetEnabled("activate_btn", !item_selected || !cur_group_active); // "none" or a non-active group selected + groups_panel->childSetEnabled("plus_btn", item_selected); + groups_panel->childSetEnabled("minus_btn", item_selected); + } + else + { + bool is_friend = true; + LLAvatarList* list; + + // Check whether selected avatar is our friend. + if ((list = getActiveAvatarList()) && (selected_id = list->getCurrentID()).notNull()) + { + is_friend = LLAvatarTracker::instance().getBuddyInfo(selected_id) != NULL; + } + + childSetEnabled("add_friend_btn", !is_friend); + } + + bool item_selected = selected_id.notNull(); + buttonSetEnabled("teleport_btn", friends_tab_active && item_selected); + buttonSetEnabled("view_profile_btn", item_selected); + buttonSetEnabled("im_btn", item_selected); + buttonSetEnabled("call_btn", item_selected && false); // not implemented yet + buttonSetEnabled("share_btn", item_selected && false); // not implemented yet + buttonSetEnabled("group_info_btn", item_selected); + buttonSetEnabled("chat_btn", item_selected); +} + +LLAvatarList* LLPanelPeople::getActiveAvatarList() const +{ + std::string cur_tab = mTabContainer->getCurrentPanel()->getName(); + + if (cur_tab == "friends_panel") + return mFriendList; + if (cur_tab == "nearby_panel") + return mNearbyList; + if (cur_tab == "recent_panel") + return mRecentList; + + return NULL; +} + +LLUUID LLPanelPeople::getCurrentItemID() const +{ + LLAvatarList* alist = getActiveAvatarList(); + if (alist) + return alist->getCurrentID(); + return mGroupList->getCurrentID(); +} + +void LLPanelPeople::showGroupMenu(LLMenuGL* menu) +{ + // Shows the menu at the top of the button bar. + + // Calculate its coordinates. + // (assumes that groups panel is the current tab) + LLPanel* bottom_panel = mTabContainer->getCurrentPanel()->getChild<LLPanel>("bottom_panel"); + LLPanel* parent_panel = mTabContainer->getCurrentPanel(); + menu->arrangeAndClear(); + S32 menu_height = menu->getRect().getHeight(); + S32 menu_x = -2; // *HACK: compensates HPAD in showPopup() + S32 menu_y = bottom_panel->getRect().mTop + menu_height; + + // Actually show the menu. + menu->buildDrawLabels(); + menu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(parent_panel, menu, menu_x, menu_y); +} + +void LLPanelPeople::onVisibilityChange(BOOL new_visibility) +{ + if (new_visibility == FALSE) + { + // Don't update anything while we're invisible. + mNearbyListUpdater->setActive(FALSE); + } + else + { + // Make the tab-container re-select current tab + // for onTabSelected() callback to get called. + // (currently this is needed to reactivate nearby list updates + // when we get visible) + mTabContainer->selectTab(mTabContainer->getCurrentPanelIndex()); + } +} + +void LLPanelPeople::onSearchEdit(const std::string& search_string) +{ + if (mFilterSubString == search_string) + return; + + mFilterSubString = search_string; + + LLStringUtil::toUpper(mFilterSubString); + LLStringUtil::trimHead(mFilterSubString); + mSearchEditor->setText(mFilterSubString); +} + +void LLPanelPeople::onTabSelected(const LLSD& param) +{ + std::string tab_name = getChild<LLPanel>(param.asString())->getName(); + mNearbyListUpdater->setActive(tab_name == "nearby_panel"); + updateButtons(); +} + +void LLPanelPeople::onAvatarListDoubleClicked(LLAvatarList* list) +{ + LLUUID clicked_id = list->getCurrentID(); + + if (clicked_id.isNull()) + return; + + // Open mini-inspector for the avatar being clicked + LLFloaterReg::showInstance("mini_inspector", clicked_id); + // inspector will delete itself on close +} + +void LLPanelPeople::onAvatarListCommitted(LLAvatarList* list) +{ + (void) list; + updateButtons(); +} + +void LLPanelPeople::onViewProfileButtonClicked() +{ + LLUUID id = getCurrentItemID(); + LLFriendActions::showProfile(id); +} + +void LLPanelPeople::onAddFriendButtonClicked() +{ + LLUUID id = getCurrentItemID(); + if (id.notNull()) + { + std::string name; + gCacheName->getFullName(id, name); + LLFriendActions::requestFriendshipDialog(id, name); + } +} + +void LLPanelPeople::onAddFriendWizButtonClicked() +{ + // Show add friend wizard. + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(onAvatarPicked, NULL, FALSE, TRUE); + LLFloater* root_floater = gFloaterView->getParentFloater(this); + if (root_floater) + { + root_floater->addDependentFloater(picker); + } +} + +void LLPanelPeople::onDeleteFriendButtonClicked() +{ + LLFriendActions::removeFriendDialog(getCurrentItemID()); +} + +void LLPanelPeople::onGroupInfoButtonClicked() +{ + LLUUID group_id = getCurrentItemID(); + if (group_id.notNull()) + LLGroupActions::info(group_id); +} + +void LLPanelPeople::onChatButtonClicked() +{ + LLUUID group_id = getCurrentItemID(); + if (group_id.notNull()) + LLGroupActions::startChat(group_id); +} + +void LLPanelPeople::onImButtonClicked() +{ + LLUUID id = getCurrentItemID(); + if (id.notNull()) + { + LLFriendActions::startIM(id); + } +} + +void LLPanelPeople::onActivateButtonClicked() +{ + LLGroupActions::activate(mGroupList->getCurrentID()); +} + +// static +void LLPanelPeople::onAvatarPicked( + const std::vector<std::string>& names, + const std::vector<LLUUID>& ids, + void*) +{ + if (!names.empty() && !ids.empty()) + LLFriendActions::requestFriendshipDialog(ids[0], names[0]); +} + +bool LLPanelPeople::onFriendListUpdate(U32 changed_mask) +{ + bool have_names = updateFriendList(changed_mask); + + // Update online status in the Recent tab. + // *TODO: isn't it too much to update the whole list? + updateRecentList(); + + return have_names; +} + +void LLPanelPeople::onGroupPlusButtonClicked() +{ + LLMenuGL* plus_menu = (LLMenuGL*)mGroupPlusMenuHandle.get(); + if (!plus_menu) + return; + + showGroupMenu(plus_menu); +} + +void LLPanelPeople::onGroupMinusButtonClicked() +{ + LLMenuGL* minus_menu = (LLMenuGL*)mGroupMinusMenuHandle.get(); + if (!minus_menu) + return; + + showGroupMenu(minus_menu); +} + +void LLPanelPeople::onGroupPlusMenuItemClicked(const LLSD& userdata) +{ + std::string chosen_item = userdata.asString(); + + if (chosen_item == "join_group") + LLGroupActions::search(); + else if (chosen_item == "new_group") + LLGroupActions::create(); +} + +void LLPanelPeople::onGroupMinusMenuItemClicked(const LLSD& userdata) +{ + std::string chosen_item = userdata.asString(); + + LLUUID group_id = getCurrentItemID(); + if (chosen_item == "leave_group") + LLGroupActions::leave(group_id); + /* + else if (chosen_item == "delete_group") + ; // *TODO: how to delete a group? + */ +} + +void LLPanelPeople::onCallButtonClicked() +{ + // *TODO: not implemented yet +} + +void LLPanelPeople::onTeleportButtonClicked() +{ + LLFriendActions::offerTeleport(getCurrentItemID()); +} + +void LLPanelPeople::onShareButtonClicked() +{ + // *TODO: not implemented yet +} + +void LLPanelPeople::onMoreButtonClicked() +{ + // *TODO: not implemented yet +} + +void LLPanelPeople::onOpen(const LLSD& key) +{ + mTabContainer->selectTab(key.asInteger()); +} diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h new file mode 100644 index 0000000000000000000000000000000000000000..4d535f287cd6a1e8bb62c8c76a7e7075236bd9d8 --- /dev/null +++ b/indra/newview/llpanelpeople.h @@ -0,0 +1,122 @@ +/** + * @file llpanelpeople.h + * @brief Side tray "People" panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELPEOPLE_H +#define LL_LLPANELPEOPLE_H + +#include <llpanel.h> + +#include "llcallingcard.h" // for avatar tracker + +class LLSearchEditor; +class LLTabContainer; +class LLAvatarList; +class LLGroupList; + +class LLPanelPeople : public LLPanel +{ + LOG_CLASS(LLPanelPeople); +public: + LLPanelPeople(); + virtual ~LLPanelPeople(); + + /*virtual*/ BOOL postBuild(); + + virtual void onOpen(const LLSD& key); + + // internals + class Updater; + +private: + bool updateFriendList(U32 changed_mask); + bool updateNearbyList(); + bool updateRecentList(); + bool updateGroupList(); + void updateButtons(); + bool refreshFriendNames(U32 changed_mask); + LLAvatarList* getActiveAvatarList() const; + LLUUID getCurrentItemID() const; + void buttonSetVisible(std::string btn_name, BOOL visible); + void buttonSetEnabled(const std::string& btn_name, bool enabled); + void buttonSetAction(const std::string& btn_name, const commit_signal_t::slot_type& cb); + void showGroupMenu(LLMenuGL* menu); + + /*virtual*/ void onVisibilityChange(BOOL new_visibility); + + // UI callbacks + void onSearchEdit(const std::string& search_string); + void onTabSelected(const LLSD& param); + void onViewProfileButtonClicked(); + void onAddFriendButtonClicked(); + void onAddFriendWizButtonClicked(); + void onDeleteFriendButtonClicked(); + void onGroupInfoButtonClicked(); + void onChatButtonClicked(); + void onImButtonClicked(); + void onCallButtonClicked(); + void onTeleportButtonClicked(); + void onShareButtonClicked(); + void onMoreButtonClicked(); + void onActivateButtonClicked(); + void onAvatarListDoubleClicked(LLAvatarList* list); + void onAvatarListCommitted(LLAvatarList* list); + void onGroupPlusButtonClicked(); + void onGroupMinusButtonClicked(); + void onGroupPlusMenuItemClicked(const LLSD& userdata); + void onGroupMinusMenuItemClicked(const LLSD& userdata); + + // misc callbacks + bool onFriendListUpdate(U32 changed_mask); + static void onAvatarPicked( + const std::vector<std::string>& names, + const std::vector<LLUUID>& ids, + void*); + + LLSearchEditor* mSearchEditor; + LLTabContainer* mTabContainer; + LLAvatarList* mFriendList; + LLAvatarList* mNearbyList; + LLAvatarList* mRecentList; + LLGroupList* mGroupList; + + LLHandle<LLView> mGroupPlusMenuHandle; + LLHandle<LLView> mGroupMinusMenuHandle; + + Updater* mFriendListUpdater; + Updater* mNearbyListUpdater; + Updater* mRecentListUpdater; + Updater* mGroupListUpdater; + + std::string mFilterSubString; +}; + +#endif //LL_LLPANELPEOPLE_H diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 389f06f355a349cfea4cc41eb3b631830d52051c..9fdde9e757d8f1905631de99d71ada3202a3576e 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -55,11 +55,11 @@ #include "lllineeditor.h" #include "llradiogroup.h" #include "llcombobox.h" -#include "llfloateravatarinfo.h" #include "lluiconstants.h" #include "lldbstrings.h" #include "llfloatergroupinfo.h" #include "llfloatergroups.h" +#include "llfriendactions.h" #include "llnamebox.h" #include "llviewercontrol.h" #include "lluictrlfactory.h" @@ -70,56 +70,44 @@ ///---------------------------------------------------------------------------- // Default constructor -LLPanelPermissions::LLPanelPermissions(const std::string& title) : - LLPanel(title) +LLPanelPermissions::LLPanelPermissions() : + LLPanel() { setMouseOpaque(FALSE); } BOOL LLPanelPermissions::postBuild() { - this->childSetCommitCallback("Object Name",LLPanelPermissions::onCommitName,this); - this->childSetPrevalidate("Object Name",LLLineEditor::prevalidatePrintableNotPipe); - this->childSetCommitCallback("Object Description",LLPanelPermissions::onCommitDesc,this); - this->childSetPrevalidate("Object Description",LLLineEditor::prevalidatePrintableNotPipe); + childSetCommitCallback("Object Name",LLPanelPermissions::onCommitName,this); + childSetPrevalidate("Object Name",LLLineEditor::prevalidatePrintableNotPipe); + childSetCommitCallback("Object Description",LLPanelPermissions::onCommitDesc,this); + childSetPrevalidate("Object Description",LLLineEditor::prevalidatePrintableNotPipe); - this->childSetAction("button owner profile",LLPanelPermissions::onClickOwner,this); - this->childSetAction("button creator profile",LLPanelPermissions::onClickCreator,this); + childSetAction("button owner profile",LLPanelPermissions::onClickOwner,this); + childSetAction("button creator profile",LLPanelPermissions::onClickCreator,this); - this->childSetAction("button set group",LLPanelPermissions::onClickGroup,this); + getChild<LLUICtrl>("button set group")->setCommitCallback(boost::bind(&LLPanelPermissions::onClickGroup,this)); - this->childSetCommitCallback("checkbox share with group",LLPanelPermissions::onCommitGroupShare,this); + childSetCommitCallback("checkbox share with group",LLPanelPermissions::onCommitGroupShare,this); - this->childSetAction("button deed",LLPanelPermissions::onClickDeedToGroup,this); + childSetAction("button deed",LLPanelPermissions::onClickDeedToGroup,this); - this->childSetCommitCallback("checkbox allow everyone move",LLPanelPermissions::onCommitEveryoneMove,this); + childSetCommitCallback("checkbox allow everyone move",LLPanelPermissions::onCommitEveryoneMove,this); - this->childSetCommitCallback("checkbox allow everyone copy",LLPanelPermissions::onCommitEveryoneCopy,this); + childSetCommitCallback("checkbox allow everyone copy",LLPanelPermissions::onCommitEveryoneCopy,this); - this->childSetCommitCallback("checkbox for sale",LLPanelPermissions::onCommitSaleInfo,this); + childSetCommitCallback("checkbox for sale",LLPanelPermissions::onCommitSaleInfo,this); - this->childSetCommitCallback("Edit Cost",LLPanelPermissions::onCommitSaleInfo,this); - this->childSetPrevalidate("Edit Cost",LLLineEditor::prevalidateNonNegativeS32); - - this->childSetCommitCallback("sale type",LLPanelPermissions::onCommitSaleType,this); + childSetCommitCallback("sale type",LLPanelPermissions::onCommitSaleType,this); - this->childSetCommitCallback("checkbox next owner can modify",LLPanelPermissions::onCommitNextOwnerModify,this); - this->childSetCommitCallback("checkbox next owner can copy",LLPanelPermissions::onCommitNextOwnerCopy,this); - this->childSetCommitCallback("checkbox next owner can transfer",LLPanelPermissions::onCommitNextOwnerTransfer,this); - this->childSetCommitCallback("clickaction",LLPanelPermissions::onCommitClickAction,this); - this->childSetCommitCallback("search_check",LLPanelPermissions::onCommitIncludeInSearch,this); + childSetCommitCallback("checkbox next owner can modify",LLPanelPermissions::onCommitNextOwnerModify,this); + childSetCommitCallback("checkbox next owner can copy",LLPanelPermissions::onCommitNextOwnerCopy,this); + childSetCommitCallback("checkbox next owner can transfer",LLPanelPermissions::onCommitNextOwnerTransfer,this); + childSetCommitCallback("clickaction",LLPanelPermissions::onCommitClickAction,this); + childSetCommitCallback("search_check",LLPanelPermissions::onCommitIncludeInSearch,this); - LLTextBox* group_rect_proxy = getChild<LLTextBox>("Group Name Proxy"); - if(group_rect_proxy ) - { - mLabelGroupName = new LLNameBox("Group Name", group_rect_proxy->getRect()); - addChild(mLabelGroupName); - } - else - { - mLabelGroupName = NULL; - } + mLabelGroupName = getChild<LLNameBox>("Group Name Proxy"); return TRUE; } @@ -137,7 +125,7 @@ void LLPanelPermissions::refresh() if(BtnDeedToGroup) { std::string deedText; - if (gSavedSettings.getWarning("DeedObject")) + if (gWarningSettings.getBOOL("DeedObject")) { deedText = getString("text deed continued"); } @@ -823,7 +811,7 @@ void LLPanelPermissions::onClickCreator(void *data) { LLPanelPermissions *self = (LLPanelPermissions *)data; - LLFloaterAvatarInfo::showFromObject(self->mCreatorID); + LLFriendActions::showProfile(self->mCreatorID); } // static @@ -839,23 +827,22 @@ void LLPanelPermissions::onClickOwner(void *data) } else { - LLFloaterAvatarInfo::showFromObject(self->mOwnerID); + LLFriendActions::showProfile(self->mOwnerID); } } -void LLPanelPermissions::onClickGroup(void* data) +void LLPanelPermissions::onClickGroup() { - LLPanelPermissions* panelp = (LLPanelPermissions*)data; LLUUID owner_id; std::string name; BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, name); - LLFloater* parent_floater = gFloaterView->getParentFloater(panelp); + LLFloater* parent_floater = gFloaterView->getParentFloater(this); if(owners_identical && (owner_id == gAgent.getID())) { LLFloaterGroupPicker* fg; fg = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); - fg->setSelectCallback( cbGroupID, data ); + fg->setSelectGroupCallback( boost::bind(&LLPanelPermissions::cbGroupID, this, _1) ); if (parent_floater) { @@ -866,13 +853,11 @@ void LLPanelPermissions::onClickGroup(void* data) } } -// static -void LLPanelPermissions::cbGroupID(LLUUID group_id, void* userdata) +void LLPanelPermissions::cbGroupID(LLUUID group_id) { - LLPanelPermissions* self = (LLPanelPermissions*)userdata; - if(self->mLabelGroupName) + if(mLabelGroupName) { - self->mLabelGroupName->setNameID(group_id, TRUE); + mLabelGroupName->setNameID(group_id, TRUE); } LLSelectMgr::getInstance()->sendGroup(group_id); } diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h index bb816acd0726b53aebfca1cd8144241007c98abf..481efe178e0d07f13733261e448c6ed50a09bc4f 100644 --- a/indra/newview/llpanelpermissions.h +++ b/indra/newview/llpanelpermissions.h @@ -53,24 +53,22 @@ class LLNameBox; class LLPanelPermissions : public LLPanel { public: - LLPanelPermissions(const std::string& title); + LLPanelPermissions(); virtual ~LLPanelPermissions(); virtual BOOL postBuild(); // MANIPULATORS void refresh(); // refresh all labels as needed -// void setPermCheckboxes(U32 mask_on, U32 mask_off, -// LLCheckBoxCtrl* move, LLCheckboxCtrl* edit, -// LLCheckBoxCtrl* copy); + protected: // statics static void onClickClaim(void*); static void onClickRelease(void*); static void onClickCreator(void*); static void onClickOwner(void*); - static void onClickGroup(void*); - static void cbGroupID(LLUUID group_id, void* userdata); + void onClickGroup(); + void cbGroupID(LLUUID group_id); static void onClickDeedToGroup(void*); static void onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 perm); @@ -101,10 +99,6 @@ protected: protected: LLNameBox* mLabelGroupName; // group name - //LLTextBox* mBuyerLabel; - //LLCheckBoxCtrl* mCheckBuyerModify; - //LLCheckBoxCtrl* mCheckBuyerCopy; - LLUUID mCreatorID; LLUUID mOwnerID; LLUUID mLastOwnerID; diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 43ecd273c242d43d22ec866deb4c7a1bfc16b224..65be4718efad8e2015a82e434abaa369ad5151ac 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -35,481 +35,358 @@ // profile. #include "llviewerprecompiledheaders.h" - -#include "llpanelpick.h" - -#include "lldir.h" -#include "llparcel.h" +#include "llpanel.h" #include "message.h" - #include "llagent.h" -#include "llbutton.h" -#include "llcheckboxctrl.h" -#include "llviewercontrol.h" -#include "lllineeditor.h" -#include "lltabcontainervertical.h" -#include "lltextbox.h" -#include "llviewertexteditor.h" +#include "llparcel.h" +#include "llviewerparcelmgr.h" #include "lltexturectrl.h" #include "lluiconstants.h" -#include "llviewergenericmessage.h" -#include "lluictrlfactory.h" -#include "llviewerparcelmgr.h" -#include "llworldmap.h" -#include "llfloaterworldmap.h" -#include "llviewerregion.h" -#include "llviewerwindow.h" +#include "llavatarpropertiesprocessor.h" +#include "llpanelpick.h" +#include "llpanelmeprofile.h" -//static -std::list<LLPanelPick*> LLPanelPick::sAllPanels; - -LLPanelPick::LLPanelPick(BOOL top_pick) -: LLPanel(std::string("Top Picks Panel")), - mTopPick(top_pick), - mPickID(), - mCreatorID(), - mParcelID(), - mDataRequested(FALSE), - mDataReceived(FALSE), - mPosGlobal(), - mSnapshotCtrl(NULL), - mNameEditor(NULL), - mDescEditor(NULL), - mLocationEditor(NULL), - mTeleportBtn(NULL), - mMapBtn(NULL), - //mLandmarkBtn(NULL), - mSortOrderText(NULL), - mSortOrderEditor(NULL), - mEnabledCheck(NULL), - mSetBtn(NULL) -{ - sAllPanels.push_back(this); - std::string pick_def_file; - if (top_pick) +#define XML_PANEL_EDIT_PICK "panel_edit_pick.xml" +#define XML_PANEL_PICK_INFO "panel_pick_info.xml" + +#define XML_NAME "pick_name" +#define XML_DESC "pick_desc" +#define XML_SNAPSHOT "pick_snapshot" +#define XML_LOCATION "pick_location" + + +LLPanelPick::LLPanelPick(BOOL edit_mode/* = FALSE */) +: LLPanel(), LLAvatarPropertiesObserver(), + mEditMode(edit_mode), + mSnapshotCtrl(NULL), + mPickId(LLUUID::null), + mCreatorId(LLUUID::null), + mDataReceived(FALSE) +{ + if (edit_mode) { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_top_pick.xml"); + LLUICtrlFactory::getInstance()->buildPanel(this, XML_PANEL_EDIT_PICK); + LLAvatarPropertiesProcessor::instance().addObserver(gAgentID, this); } else { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_pick.xml"); - } -} + LLUICtrlFactory::getInstance()->buildPanel(this, XML_PANEL_PICK_INFO); + } +} LLPanelPick::~LLPanelPick() { - sAllPanels.remove(this); + if (!mCreatorId.isNull()) LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorId, this); } - void LLPanelPick::reset() { - mPickID.setNull(); - mCreatorID.setNull(); - mParcelID.setNull(); - - // Don't request data, this isn't valid - mDataRequested = TRUE; + mPickId.setNull(); + mCreatorId.setNull(); + mParcelId.setNull(); + mDataReceived = FALSE; mPosGlobal.clearVec(); - - clearCtrls(); } - BOOL LLPanelPick::postBuild() { - mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl"); - mSnapshotCtrl->setCommitCallback(onCommitAny); - mSnapshotCtrl->setCallbackUserData(this); - - mNameEditor = getChild<LLLineEditor>("given_name_editor"); - mNameEditor->setCommitOnFocusLost(TRUE); - mNameEditor->setCommitCallback(onCommitAny); - mNameEditor->setCallbackUserData(this); - - mDescEditor = getChild<LLTextEditor>("desc_editor"); - mDescEditor->setCommitOnFocusLost(TRUE); - mDescEditor->setCommitCallback(onCommitAny); - mDescEditor->setCallbackUserData(this); - mDescEditor->setTabsToNextField(TRUE); + mSnapshotCtrl = getChild<LLTextureCtrl>(XML_SNAPSHOT); - mLocationEditor = getChild<LLLineEditor>("location_editor"); + if (mEditMode) + { + childSetAction("cancel_btn", onClickCancel, this); + childSetAction("set_to_curr_location_btn", onClickSet, this); + childSetAction("save_changes_btn", onClickSave, this); + } + else + { + childSetAction("edit_btn", onClickEdit, this); + childSetAction("teleport_btn", onClickTeleport, this); + childSetAction("show_on_map_btn", onClickMap, this); + childSetAction("back_btn", onClickBack, this); + //*TODO set on menu + } - mSetBtn = getChild<LLButton>( "set_location_btn"); - mSetBtn->setClickedCallback(onClickSet); - mSetBtn->setCallbackUserData(this); + return TRUE; +} - mTeleportBtn = getChild<LLButton>( "pick_teleport_btn"); - mTeleportBtn->setClickedCallback(onClickTeleport); - mTeleportBtn->setCallbackUserData(this); +void LLPanelPick::init(LLUUID creator_id, LLUUID pick_id) +{ + mCreatorId = creator_id; + mPickId = pick_id; - mMapBtn = getChild<LLButton>( "pick_map_btn"); - mMapBtn->setClickedCallback(onClickMap); - mMapBtn->setCallbackUserData(this); + // on Pick Info panel (for non-Agent picks) edit_btn should be invisible + if (!mEditMode) + { + if (mCreatorId != gAgentID) + { + childSetEnabled("edit_btn", FALSE); + childSetVisible("edit_btn", FALSE); + } + else + { + childSetEnabled("edit_btn", TRUE); + childSetVisible("edit_btn", TRUE); + } + } - mSortOrderText = getChild<LLTextBox>("sort_order_text"); + LLAvatarPropertiesProcessor::instance().addObserver(mCreatorId, this); + LLAvatarPropertiesProcessor::instance().sendDataRequest(mCreatorId, APT_PICK_INFO, &mPickId); +} - mSortOrderEditor = getChild<LLLineEditor>("sort_order_editor"); - mSortOrderEditor->setPrevalidate(LLLineEditor::prevalidateInt); - mSortOrderEditor->setCommitOnFocusLost(TRUE); - mSortOrderEditor->setCommitCallback(onCommitAny); - mSortOrderEditor->setCallbackUserData(this); +void LLPanelPick::init(LLPickData *pick_data) +{ + mPickId = pick_data->pick_id; + mCreatorId = pick_data->creator_id; - mEnabledCheck = getChild<LLCheckBoxCtrl>( "enabled_check"); - mEnabledCheck->setCommitCallback(onCommitAny); - mEnabledCheck->setCallbackUserData(this); + setName(pick_data->name); + setDesc(pick_data->desc); + setLocation(pick_data->location_text); + mSnapshotCtrl->setImageAssetID(pick_data->snapshot_id); - return TRUE; + mPosGlobal = pick_data->pos_global; + mSimName = pick_data->sim_name; + mParcelId = pick_data->parcel_id; } - // Fill in some reasonable defaults for a new pick. -void LLPanelPick::initNewPick() +void LLPanelPick::createNewPick() { - mPickID.generate(); - - mCreatorID = gAgent.getID(); - + mPickId.generate(); + mCreatorId = gAgent.getID(); mPosGlobal = gAgent.getPositionGlobal(); // Try to fill in the current parcel LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (parcel) { - mNameEditor->setText(parcel->getName()); - mDescEditor->setText(parcel->getDesc()); + setName(parcel->getName()); + setDesc(parcel->getDesc()); mSnapshotCtrl->setImageAssetID(parcel->getSnapshotID()); } - // Commit to the database, since we've got "new" values. - sendPickInfoUpdate(); + sendUpdate(); } - -void LLPanelPick::setPickID(const LLUUID& pick_id, const LLUUID& creator_id) +/*virtual*/ void LLPanelPick::processProperties(void* data, EAvatarProcessorType type) { - mPickID = pick_id; - mCreatorID = creator_id; -} + if (APT_PICK_INFO != type) return; + if (!data) return; + LLPickData* pick_data = static_cast<LLPickData *>(data); + if (!pick_data) return; + if (mPickId != pick_data->pick_id) return; -// Schedules the panel to request data -// from the server next time it is drawn. -void LLPanelPick::markForServerRequest() -{ - mDataRequested = FALSE; - mDataReceived = FALSE; + init(pick_data); + mDataReceived = TRUE; + LLAvatarPropertiesProcessor::instance().removeObserver(gAgentID, this); } -std::string LLPanelPick::getPickName() +void LLPanelPick::setEditMode( BOOL edit_mode ) { - return mNameEditor->getText(); -} + if (mEditMode == edit_mode) return; + mEditMode = edit_mode; + if (edit_mode) + { + // preserve data before killing controls + std::string name = getName(); + std::string desc = getDesc(); + std::string location = getLocation(); + LLUUID snapshot_id = mSnapshotCtrl->getImageAssetID(); + LLRect old_rect = getRect(); + + deleteAllChildren(); + + LLUICtrlFactory::getInstance()->buildPanel(this, XML_PANEL_EDIT_PICK); + + //*NOTE this code is from LLPanelMeProfile.togglePanel()... doubt this is a right way to do things + reshape(old_rect.getWidth(), old_rect.getHeight()); + old_rect.setLeftTopAndSize(0, old_rect.getHeight(), old_rect.getWidth(), old_rect.getHeight()); + setRect(old_rect); + + // time to restore data + setName(name); + setDesc(desc); + setLocation(location); + mSnapshotCtrl->setImageAssetID(snapshot_id); + } + else + { + // returning to VIEW mode - need to perform cleanup + // this is the case when that panel is reused between viewing/editing different picks + deleteAllChildren(); + reset(); + LLUICtrlFactory::getInstance()->buildPanel(this, XML_PANEL_PICK_INFO); + } +} -void LLPanelPick::sendPickInfoRequest() +//*HACK need to be redone - control panel toggling from parent (Me Panel/Avatar Profile Panel) +void LLPanelPick::setPanelMeProfile(LLPanelMeProfile* meProfilePanel) { - // Must ask for a pick based on the creator id because - // the pick database is distributed to the inventory cluster. JC - std::vector<std::string> strings; - strings.push_back( mCreatorID.asString() ); - strings.push_back( mPickID.asString() ); - send_generic_message("pickinforequest", strings); - - mDataRequested = TRUE; + mMeProfilePanel = meProfilePanel; } - -void LLPanelPick::sendPickInfoUpdate() +void LLPanelPick::setName(std::string name) { - // If we don't have a pick id yet, we'll need to generate one, - // otherwise we'll keep overwriting pick_id 00000 in the database. - if (mPickID.isNull()) + if (mEditMode) { - mPickID.generate(); - } - - LLMessageSystem* msg = gMessageSystem; - - msg->newMessage("PickInfoUpdate"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("Data"); - msg->addUUID("PickID", mPickID); - msg->addUUID("CreatorID", mCreatorID); - msg->addBOOL("TopPick", mTopPick); - // fills in on simulator if null - msg->addUUID("ParcelID", mParcelID); - msg->addString("Name", mNameEditor->getText()); - msg->addString("Desc", mDescEditor->getText()); - msg->addUUID("SnapshotID", mSnapshotCtrl->getImageAssetID()); - msg->addVector3d("PosGlobal", mPosGlobal); - - // Only top picks have a sort order - S32 sort_order; - if (mTopPick) - { - sort_order = atoi(mSortOrderEditor->getText().c_str()); + childSetValue(XML_NAME, name); } else { - sort_order = 0; + childSetWrappedText(XML_NAME, name); } - msg->addS32("SortOrder", sort_order); - msg->addBOOL("Enabled", mEnabledCheck->get()); - gAgent.sendReliableMessage(); } - -//static -void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **) +void LLPanelPick::setDesc(std::string desc) { - // Extract the agent id and verify the message is for this - // client. - LLUUID agent_id; - msg->getUUID("AgentData", "AgentID", agent_id ); - if (agent_id != gAgent.getID()) - { - llwarns << "Agent ID mismatch in processPickInfoReply" - << llendl; - return; - } - - LLUUID pick_id; - msg->getUUID("Data", "PickID", pick_id); - - LLUUID creator_id; - msg->getUUID("Data", "CreatorID", creator_id); - - BOOL top_pick; - msg->getBOOL("Data", "TopPick", top_pick); - - LLUUID parcel_id; - msg->getUUID("Data", "ParcelID", parcel_id); - - std::string name; - msg->getString("Data", "Name", name); - - std::string desc; - msg->getString("Data", "Desc", desc); - - LLUUID snapshot_id; - msg->getUUID("Data", "SnapshotID", snapshot_id); - - // "Location text" is actually the owner name, the original - // name that owner gave the parcel, and the location. - std::string location_text; - msg->getString("Data", "User", location_text); - location_text.append(", "); - - std::string original_name; - msg->getString("Data", "OriginalName", original_name); - if (!original_name.empty()) + if (mEditMode) { - location_text.append(original_name); - location_text.append(", "); + childSetValue(XML_DESC, desc); } - - std::string sim_name; - msg->getString("Data", "SimName", sim_name); - location_text.append(sim_name); - location_text.append(" "); - - LLVector3d pos_global; - msg->getVector3d("Data", "PosGlobal", pos_global); - - S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)pos_global.mdV[VZ]); - - location_text.append(llformat("(%d, %d, %d)", region_x, region_y, region_z)); - - S32 sort_order; - msg->getS32("Data", "SortOrder", sort_order); - - BOOL enabled; - msg->getBOOL("Data", "Enabled", enabled); - - // Look up the panel to fill in - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) + else { - LLPanelPick* self = *iter; - // For top picks, must match pick id - if (self->mPickID != pick_id) - { - continue; - } - - self->mDataReceived = TRUE; - - // Found the panel, now fill in the information - self->mPickID = pick_id; - self->mCreatorID = creator_id; - self->mParcelID = parcel_id; - self->mSimName.assign(sim_name); - self->mPosGlobal = pos_global; - - // Update UI controls - self->mNameEditor->setText(std::string(name)); - self->mDescEditor->setText(std::string(desc)); - self->mSnapshotCtrl->setImageAssetID(snapshot_id); - self->mLocationEditor->setText(location_text); - self->mEnabledCheck->set(enabled); - - self->mSortOrderEditor->setText(llformat("%d", sort_order)); - } + childSetWrappedText(XML_DESC, desc); + } } -void LLPanelPick::draw() +void LLPanelPick::setLocation(std::string location) { - refresh(); - - LLPanel::draw(); + childSetWrappedText(XML_LOCATION, location); } - -void LLPanelPick::refresh() +std::string LLPanelPick::getName() { - if (!mDataRequested) - { - sendPickInfoRequest(); - } - - // Check for god mode - BOOL godlike = gAgent.isGodlike(); - BOOL is_self = (gAgent.getID() == mCreatorID); - - // Set button visibility/enablement appropriately - if (mTopPick) - { - mSnapshotCtrl->setEnabled(godlike); - mNameEditor->setEnabled(godlike); - mDescEditor->setEnabled(godlike); + return childGetValue(XML_NAME).asString(); +} - mSortOrderText->setVisible(godlike); +std::string LLPanelPick::getDesc() +{ + return childGetValue(XML_DESC).asString(); +} - mSortOrderEditor->setVisible(godlike); - mSortOrderEditor->setEnabled(godlike); +std::string LLPanelPick::getLocation() +{ + return childGetValue(XML_LOCATION).asString(); +} - mEnabledCheck->setVisible(godlike); - mEnabledCheck->setEnabled(godlike); +void LLPanelPick::sendUpdate() +{ + LLPickData pick_data; - mSetBtn->setVisible(godlike); - mSetBtn->setEnabled(godlike); - } - else - { - mSnapshotCtrl->setEnabled(is_self); - mNameEditor->setEnabled(is_self); - mDescEditor->setEnabled(is_self); + // If we don't have a pick id yet, we'll need to generate one, + // otherwise we'll keep overwriting pick_id 00000 in the database. + if (mPickId.isNull()) mPickId.generate(); + + pick_data.agent_id = gAgent.getID(); + pick_data.session_id = gAgent.getSessionID(); + pick_data.pick_id = mPickId; + pick_data.creator_id = gAgentID; + + //legacy var need to be deleted + pick_data.top_pick = FALSE; + pick_data.parcel_id = mParcelId; + pick_data.name = getName(); + pick_data.desc = getDesc(); + pick_data.snapshot_id = mSnapshotCtrl->getImageAssetID(); + pick_data.pos_global = mPosGlobal; + pick_data.sort_order = 0; + pick_data.enabled = TRUE; + + LLAvatarPropertiesProcessor::instance().sendDataUpdate(&pick_data, APT_PICK_INFO); +} - mSortOrderText->setVisible(FALSE); - mSortOrderEditor->setVisible(FALSE); - mSortOrderEditor->setEnabled(FALSE); +//----------------------------------------- +// "PICK INFO" (VIEW MODE) BUTTON HANDLERS +//----------------------------------------- - mEnabledCheck->setVisible(FALSE); - mEnabledCheck->setEnabled(FALSE); +//static +void LLPanelPick::onClickEdit(void* data) +{ + LLPanelPick* self = (LLPanelPick*)data; + if (!self) return; + if (self->mEditMode) return; + if (!self->mDataReceived) return; - mSetBtn->setVisible(is_self); - mSetBtn->setEnabled(is_self); - } + self->setEditMode(TRUE); } - -// static +//static void LLPanelPick::onClickTeleport(void* data) { - LLPanelPick* self = (LLPanelPick*)data; - - if (!self->mPosGlobal.isExactlyZero()) - { - gAgent.teleportViaLocation(self->mPosGlobal); - gFloaterWorldMap->trackLocation(self->mPosGlobal); - } + //LLPanelPick* self = (LLPanelPick*)data; + //*TODO implement } - -// static +//static void LLPanelPick::onClickMap(void* data) +{ + //LLPanelPick* self = (LLPanelPick*)data; + //*TODO implement +} + +//*HACK need to move panel toggling to parent panels +//static +void LLPanelPick::onClickBack(void* data) { LLPanelPick* self = (LLPanelPick*)data; - gFloaterWorldMap->trackLocation(self->mPosGlobal); - LLFloaterWorldMap::show(NULL, TRUE); + if (!self) return; + self->mMeProfilePanel->togglePanel(self); } -// static -/* -void LLPanelPick::onClickLandmark(void* data) + + +//----------------------------------------- +// "EDIT PICK" (EDIT MODE) BUTTON HANDLERS +//----------------------------------------- + +//static +void LLPanelPick::onClickCancel(void* data) { - LLPanelPick* self = (LLPanelPick*)data; - create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal); + LLPanelPick* self = (LLPanelPick*) data; + if (!self) return; + if (!self->mEditMode) return; + self->mMeProfilePanel->togglePanel(self); } -*/ // static void LLPanelPick::onClickSet(void* data) { - LLPanelPick* self = (LLPanelPick*)data; + //TODO check whether pick data was received before + + LLPanelPick* self = (LLPanelPick*) data; + if (!self) return; + if (!self->mEditMode) return; // Save location for later. self->mPosGlobal = gAgent.getPositionGlobal(); - std::string location_text; - location_text.assign("(will update after save)"); - location_text.append(", "); - - S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)self->mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = llround((F32)self->mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; S32 region_z = llround((F32)self->mPosGlobal.mdV[VZ]); + std::string location_text = "(will update after save), "; location_text.append(self->mSimName); - location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); - - // if sim name in pick is different from current sim name - // make sure it's clear that all that's being changed - // is the location and nothing else - if ( gAgent.getRegion ()->getName () != self->mSimName ) - { - LLNotifications::instance().add("SetPickLocation"); - }; - - self->mLocationEditor->setText(location_text); + location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); - onCommitAny(NULL, data); + self->setLocation(location_text); } - // static -void LLPanelPick::onCommitAny(LLUICtrl* ctrl, void* data) +void LLPanelPick::onClickSave(void* data) { LLPanelPick* self = (LLPanelPick*)data; + if (!self->mEditMode) return; + if (!self->mDataReceived) return; - // have we received up to date data for this pick? - if (self->mDataReceived) - { - self->sendPickInfoUpdate(); - - // Big hack - assume that top picks are always in a browser, - // and non-top-picks are always in a tab container. - /*if (self->mTopPick) - { - LLPanelDirPicks* panel = (LLPanelDirPicks*)self->getParent(); - panel->renamePick(self->mPickID, self->mNameEditor->getText()); - } - else - {*/ - LLTabContainer* tab = (LLTabContainer*)self->getParent(); - if (tab) - { - if(tab) tab->setCurrentTabName(self->mNameEditor->getText()); - } - //} - } + //*TODO check if data was received before + self->sendUpdate(); + self->mMeProfilePanel->togglePanel(self); } diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h index 450fa78801790473bf8cf5e600ab0be0191ec3e8..8ada1a39fb55e08dbb3de4b93acc89f16111fa4a 100644 --- a/indra/newview/llpanelpick.h +++ b/indra/newview/llpanelpick.h @@ -38,90 +38,78 @@ #define LL_LLPANELPICK_H #include "llpanel.h" -#include "v3dmath.h" -#include "lluuid.h" - -class LLButton; -class LLCheckBoxCtrl; -class LLIconCtrl; -class LLLineEditor; -class LLTextBox; -class LLTextEditor; + class LLTextureCtrl; -class LLUICtrl; class LLMessageSystem; +class LLPanelMeProfile; +class LLAvatarPropertiesObserver; -class LLPanelPick : public LLPanel +class LLPanelPick : public LLPanel, public LLAvatarPropertiesObserver { + LOG_CLASS(LLPanelPick); public: - LLPanelPick(BOOL top_pick); - /*virtual*/ ~LLPanelPick(); + LLPanelPick(BOOL edit_mode = FALSE); + /*virtual*/ ~LLPanelPick(); void reset(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); + // Create a new pick, including creating an id, giving a sane + // initial position, etc. + void createNewPick(); - /*virtual*/ void refresh(); + void init(LLUUID creator_id, LLUUID pick_id); - // Setup a new pick, including creating an id, giving a sane - // initial position, etc. - void initNewPick(); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); - // We need to know the creator id so the database knows which partition - // to query for the pick data. - void setPickID(const LLUUID& pick_id, const LLUUID& creator_id); + void setEditMode(BOOL edit_mode); - // Schedules the panel to request data - // from the server next time it is drawn. - void markForServerRequest(); + //TODO redo panel toggling + void setPanelMeProfile(LLPanelMeProfile* meProfilePanel); - std::string getPickName(); - const LLUUID& getPickID() const { return mPickID; } - const LLUUID& getPickCreatorID() const { return mCreatorID; } +protected: - void sendPickInfoRequest(); - void sendPickInfoUpdate(); + void setName(std::string name); + void setDesc(std::string desc); + void setLocation(std::string location); - static void processPickInfoReply(LLMessageSystem* msg, void**); + std::string getName(); + std::string getDesc(); + std::string getLocation(); -protected: - static void onClickTeleport(void* data); - static void onClickMap(void* data); - //static void onClickLandmark(void* data); - static void onClickSet(void* data); + void sendUpdate(); + void init(LLPickData *pick_data); - static void onCommitAny(LLUICtrl* ctrl, void* data); + //----------------------------------------- + // "PICK INFO" (VIEW MODE) BUTTON HANDLERS + //----------------------------------------- + static void onClickEdit(void* data); + static void onClickTeleport(void* data); + static void onClickMap(void* data); + static void onClickBack(void* data); -protected: - BOOL mTopPick; - LLUUID mPickID; - LLUUID mCreatorID; - LLUUID mParcelID; + //----------------------------------------- + // "EDIT PICK" (EDIT MODE) BUTTON HANDLERS + //----------------------------------------- + static void onClickSet(void* data); + static void onClickSave(void* data); + static void onClickCancel(void* data); - // Data will be requested on first draw +protected: + BOOL mEditMode; + LLTextureCtrl* mSnapshotCtrl; BOOL mDataRequested; BOOL mDataReceived; + LLUUID mPickId; + LLUUID mCreatorId; + LLVector3d mPosGlobal; + LLUUID mParcelId; std::string mSimName; - LLVector3d mPosGlobal; - - LLTextureCtrl* mSnapshotCtrl; - LLLineEditor* mNameEditor; - LLTextEditor* mDescEditor; - LLLineEditor* mLocationEditor; - - LLButton* mTeleportBtn; - LLButton* mMapBtn; - - LLTextBox* mSortOrderText; - LLLineEditor* mSortOrderEditor; - LLCheckBoxCtrl* mEnabledCheck; - LLButton* mSetBtn; - typedef std::list<LLPanelPick*> panel_list_t; - static panel_list_t sAllPanels; + //TODO redo panel toggling + LLPanelMeProfile* mMeProfilePanel; }; #endif // LL_LLPANELPICK_H diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1a3aa8a33a921ca780722d80e5e95a855860e0c2 --- /dev/null +++ b/indra/newview/llpanelpicks.cpp @@ -0,0 +1,469 @@ +/** + * @file llpanelpicks.cpp + * @brief LLPanelPicks and related class implementations + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llagent.h" +#include "llavatarconstants.h" +#include "lltexturectrl.h" +#include "llviewergenericmessage.h" // send_generic_message +#include "llworldmap.h" +#include "llfloaterworldmap.h" +#include "llpanelmeprofile.h" +#include "llfloaterreg.h" +#include "llpanelpicks.h" +#include "llavatarpropertiesprocessor.h" +#include "llpanelpick.h" + +#define XML_BTN_NEW "new_btn" +#define XML_BTN_DELETE "trash_btn" +#define XML_BTN_INFO "info_btn" + + +//----------------------------------------------------------------------------- +// LLPanelPicks +//----------------------------------------------------------------------------- +LLPanelPicks::LLPanelPicks(const LLUUID& avatar_id /* = LLUUID::null */) +:LLPanelProfileTab(avatar_id), mMeProfilePanel(NULL) +{ + updateData(); +} + +LLPanelPicks::LLPanelPicks(const Params& params) +:LLPanelProfileTab(params), mMeProfilePanel(NULL) +{ + +} + +LLPanelPicks::~LLPanelPicks() +{ + if(!getAvatarId().isNull()) + { + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); + } +} + +void* LLPanelPicks::create(void* data /* = NULL */) +{ + LLSD* id = NULL; + if(data) + { + id = static_cast<LLSD*>(data); + return new LLPanelPicks(LLUUID(id->asUUID())); + } + return new LLPanelPicks(); +} + +void LLPanelPicks::updateData() +{ + LLAvatarPropertiesProcessor::getInstance()->sendDataRequest(getAvatarId(),APT_PICKS); +} + +void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) +{ + if(APT_PICKS == type) + { + LLAvatarPicks* avatar_picks = static_cast<LLAvatarPicks*>(data); + if(avatar_picks && getAvatarId() == avatar_picks->target_id) + { + std::string name, second_name; + gCacheName->getName(getAvatarId(),name,second_name); + childSetTextArg("pick_title", "[NAME]",name); + + LLView* picks_list = getChild<LLView>("back_panel",TRUE,FALSE); + if(!picks_list) return; + clear(); + + //*TODO move it somewhere else? + picks_list->setEnabled(FALSE); + childSetEnabled(XML_BTN_NEW, false); + childSetEnabled(XML_BTN_DELETE, false); + childSetEnabled(XML_BTN_INFO, false); + + S32 height = avatar_picks->picks_list.size() * 85; + LLRect rc = picks_list->getRect(); + rc.setLeftTopAndSize(rc.mLeft,rc.mTop,rc.getWidth(),height); + picks_list->setRect(rc); + picks_list->reshape(rc.getWidth(),rc.getHeight()); + + LLAvatarPicks::picks_list_t::const_iterator it = avatar_picks->picks_list.begin(); + for(; avatar_picks->picks_list.end() != it; ++it) + { + LLUUID pick_id = it->first; + std::string pick_name = it->second; + + LLPickItem* picture = LLPickItem::create(); + picks_list->addChild(picture); + + picture->setPictureName(pick_name); + picture->setPictureId(pick_id); + picture->setCreatorId(getAvatarId()); + + S32 last_bottom = picks_list->getRect().getHeight(); + if(mPickItemList.size() > 0) + { + last_bottom = mPickItemList[mPickItemList.size()-1]->getRect().mBottom; + last_bottom -= 5; + } + LLRect rc = picture->getRect(); + rc.mBottom = last_bottom - rc.getHeight(); + rc.mTop = last_bottom; + picture->reshape(rc.getWidth(),rc.getHeight()); + picture->setRect(rc); + + + LLAvatarPropertiesProcessor::instance().addObserver(mAvatarId, picture); + picture->update(); + mPickItemList.push_back(picture); + } + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); + + updateButtons(); + picks_list->setEnabled(TRUE); + + } + } +} + +void LLPanelPicks::clear() +{ + LLView* scroll = getChild<LLView>("back_panel",TRUE,FALSE); + if(scroll) + { + picture_list_t::const_iterator it = mPickItemList.begin(); + for(; mPickItemList.end() != it; ++it) + { + scroll->removeChild(*it); + delete *it; + } + } + mPickItemList.clear(); +} + +BOOL LLPanelPicks::postBuild(void) +{ + childSetAction(XML_BTN_INFO, onClickInfo, this); + childSetAction(XML_BTN_NEW, onClickNew, this); + childSetAction(XML_BTN_DELETE, onClickDelete, this); + + childSetAction("teleport_btn", onClickTeleport, this); + childSetAction("show_on_map_btn", onClickMap, this); + return TRUE; +} + +void LLPanelPicks::onActivate(const LLUUID& id) +{ + BOOL self = (gAgent.getID() == id); + + // only agent can edit her picks + childSetEnabled("edit_panel", self); + childSetVisible("edit_panel", self); + + // and see a special title - set as invisible by default in xml file + if (self) + { + childSetVisible("pick_title", !self); + childSetVisible("pick_title_agent", self); + } + + LLPanelProfileTab::onActivate(id); +} + + +//static +void LLPanelPicks::onClickInfo(void *data) +{ + LLPanelPicks* self = (LLPanelPicks*) data; + if (self) + { + LLPanelPick* panel_pick_info = new LLPanelPick(); + + //*TODO redo, use the selected pick from List View, but not the first (last) one + LLView* scroll = self->getChild<LLView>("back_panel", TRUE, FALSE); + LLPickItem* pick = static_cast<LLPickItem*>(scroll->getFirstChild()); + if (!pick) return; + + panel_pick_info->init(pick->getCreatorId(), pick->getPickId()); + + //*HACK redo toggling of panels (should work on both "profiles") + if (self->mMeProfilePanel) + { + panel_pick_info->setPanelMeProfile(self->mMeProfilePanel); + //self->mMeProfilePanel->addChildInBack(panel_pick_info); + self->mMeProfilePanel->togglePanel(panel_pick_info); + } + } +} + +//static +void LLPanelPicks::onClickNew(void *data) +{ + LLPanelPicks* self = (LLPanelPicks*) data; + if(self && self->mMeProfilePanel) + { + if (self->mPickItemList.size() >= MAX_AVATAR_PICKS) + { + //*TODO show warning message + return; + } + + //in edit mode + LLPanelPick* panel_edit_pick = new LLPanelPick(TRUE); + panel_edit_pick->createNewPick(); + + //*HACK redo toggling of panels + panel_edit_pick->setPanelMeProfile(self->mMeProfilePanel); + self->mMeProfilePanel->togglePanel(panel_edit_pick); + } +} + +//static +void LLPanelPicks::onClickDelete(void *data) +{ + LLPanelPicks* self = (LLPanelPicks*) data; + if(self && self->mMeProfilePanel) + { + //*TODO redo, use the selected pick from List View, but not the first (last) one + LLView* scroll = self->getChild<LLView>("back_panel", TRUE, FALSE); + LLPickItem* first_pick = static_cast<LLPickItem*>(scroll->getFirstChild()); + if (!first_pick) return; + + LLSD args; + args["PICK"] = first_pick->getPickName(); + LLNotifications::instance().add("DeleteAvatarPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackDelete, self, _1, _2)); + } +} + +bool LLPanelPicks::callbackDelete(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + + //*TODO redo, use the selected pick from List View, but not the first (last) one + LLView* scroll = getChild<LLView>("back_panel",TRUE,FALSE); + LLPickItem* first_pick = static_cast<LLPickItem*>(scroll->getFirstChild()); + if (!first_pick) return false; + + if (0 == option) + { + LLAvatarPropertiesProcessor::instance().sendPickDelete(first_pick->getPickId()); + + scroll->removeChild(first_pick); + mPickItemList.pop_back(); + first_pick = NULL; + } + updateButtons(); + return false; +} + +void LLPanelPicks::setPanelMeProfile(LLPanelMeProfile* meProfilePanel) +{ + mMeProfilePanel = meProfilePanel; +} + +//static +void LLPanelPicks::teleport(const LLVector3d& position) +{ + if (!position.isExactlyZero()) + { + gAgent.teleportViaLocation(position); + LLFloaterWorldMap::getInstance()->trackLocation(position); + } +} + +//static +void LLPanelPicks::onClickTeleport(void* data) +{ + LLPanelPicks* self = (LLPanelPicks*)data; + + if (!self->mPickItemList.size()) return; + + //*TODO use the selected Pick instead of the last one in the list of Picks + LLPickItem* last_pick = self->mPickItemList.back(); + if (!last_pick) return; + + teleport(last_pick->getPosGlobal()); +} + +//static +void LLPanelPicks::onClickMap(void* data) +{ + LLPanelPicks* self = (LLPanelPicks*)data; + + if (!self->mPickItemList.size()) return; + + //*TODO use the selected Pick instead of the last one in the list of Picks + LLPickItem* last_pick = self->mPickItemList.back(); + if (!last_pick) return; + + showOnMap(last_pick->getPosGlobal()); + +} + +//static +void LLPanelPicks::showOnMap(const LLVector3d& position) +{ + LLFloaterWorldMap::getInstance()->trackLocation(position); + LLFloaterReg::showInstance("world_map", "center"); +} + +void LLPanelPicks::updateButtons() +{ + int picks_num = mPickItemList.size(); + childSetEnabled(XML_BTN_INFO, picks_num > 0); + + if (mAvatarId == gAgentID) + { + childSetEnabled(XML_BTN_NEW, picks_num < MAX_AVATAR_PICKS); + childSetEnabled(XML_BTN_DELETE, picks_num > 0); + } +} + + +//----------------------------------------------------------------------------- +// LLPanelPicks +//----------------------------------------------------------------------------- +LLPickItem::LLPickItem() +: LLPanel() +, mPicID(LLUUID::null) +, mCreatorID(LLUUID::null) +, mParcelID(LLUUID::null) +, mSnapshotID(LLUUID::null) +, mNeedData(true) +{ + LLUICtrlFactory::getInstance()->buildPanel(this,"panel_pic_list_item.xml"); +} + +LLPickItem::~LLPickItem() +{ + if (!mCreatorID.isNull()) + { + LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorID, this); + } + +} + +LLPickItem* LLPickItem::create() +{ + return new LLPickItem(); +} + +void LLPickItem::init(LLPickData* pick_data) +{ + setPictureDescription(pick_data->desc); + setSnapshotId(pick_data->snapshot_id); + mPosGlobal = pick_data->pos_global; + mLocation = pick_data->location_text; + + LLTextureCtrl* picture = getChild<LLTextureCtrl>("picture", TRUE, FALSE); + if (picture) + { + picture->setImageAssetID(pick_data->snapshot_id); + } +} + +void LLPickItem::setPicture() +{ + +} + +void LLPickItem::setPictureName(const std::string& name) +{ + mPickName = name; + childSetValue("picture_name",name); + +} + +const std::string& LLPickItem::getPickName() +{ + return mPickName; +} + +const LLUUID& LLPickItem::getCreatorId() +{ + return mCreatorID; +} + +const LLUUID& LLPickItem::getSnapshotId() +{ + return mSnapshotID; +} + +void LLPickItem::setPictureDescription(const std::string& descr) +{ + childSetValue("picture_descr",descr); +} + +void LLPickItem::setPictureId(const LLUUID& id) +{ + mPicID = id; +} + +const LLUUID& LLPickItem::getPickId() +{ + return mPicID; +} + +const LLVector3d& LLPickItem::getPosGlobal() +{ + return mPosGlobal; +} + +const std::string& LLPickItem::getLocation() +{ + return mLocation; +} + +const std::string LLPickItem::getDescription() +{ + return childGetValue("picture_descr").asString(); +} + +void LLPickItem::update() +{ + mNeedData = true; + LLAvatarPropertiesProcessor::instance().sendDataRequest(mCreatorID, APT_PICK_INFO, &mPicID); + mNeedData = false; +} + +void LLPickItem::processProperties(void *data, EAvatarProcessorType type) +{ + if (APT_PICK_INFO != type) return; + if (!data) return; + + LLPickData* pick_data = static_cast<LLPickData *>(data); + if (!pick_data) return; + if (mPicID != pick_data->pick_id) return; + + init(pick_data); + LLAvatarPropertiesProcessor::instance().removeObserver(pick_data->agent_id, this); +} + diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h new file mode 100644 index 0000000000000000000000000000000000000000..bb1ee067807e4c1f2bf63e24d7f38d208c9c1917 --- /dev/null +++ b/indra/newview/llpanelpicks.h @@ -0,0 +1,153 @@ +/** + * @file llpanelpicks.h + * @brief LLPanelPicks and related class definitions + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELPICKS_H +#define LL_LLPANELPICKS_H + +#include "llpanel.h" +#include "v3dmath.h" +#include "lluuid.h" +#include "llavatarpropertiesprocessor.h" + +class LLMessageSystem; +class LLVector3d; +class LLPanelProfileTab; +class LLPanelMeProfile; +class LLPanelPick; +class LLAgent; +class LLPickItem; + + +class LLPanelPicks + : public LLPanelProfileTab +{ +public: + LLPanelPicks(const LLUUID& avatar_id = LLUUID::null); + LLPanelPicks(const Params& params ); + ~LLPanelPicks(); + + static void* create(void* data); + + static void teleport(const LLVector3d& position); + + static void showOnMap(const LLVector3d& position); + + /*virtual*/ BOOL postBuild(void); + + /*virtual*/ void onActivate(const LLUUID& id); + + void processProperties(void* data, EAvatarProcessorType type); + + void updateData(); + + void setPanelMeProfile(LLPanelMeProfile*); + + void clear(); + + //*TODO implement + //LLPickItem& getSelectedPick(); + +private: + static void onClickInfo(void* data); + static void onClickNew(void* data); + static void onClickDelete(void* data); + static void onClickTeleport(void* data); + static void onClickMap(void* data); + + bool callbackDelete(const LLSD& notification, const LLSD& response); + + void updateButtons(); + + typedef std::vector<LLPickItem*> picture_list_t; + picture_list_t mPickItemList; + LLPanelMeProfile* mMeProfilePanel; + +}; + +class LLPickItem : public LLPanel, public LLAvatarPropertiesObserver +{ +public: + + LLPickItem(); + + static LLPickItem* create(); + + void init(LLPickData* pick_data); + + void setPictureName(const std::string& name); + + void setPictureDescription(const std::string& descr); + + void setPicture(); + + void setPictureId(const LLUUID& id); + + void setCreatorId(const LLUUID& id) {mCreatorID = id;}; + + void setSnapshotId(const LLUUID& id) {mSnapshotID = id;}; + + void setNeedData(bool need){mNeedData = need;}; + + const LLUUID& getPickId(); + + const std::string& getPickName(); + + const LLUUID& getCreatorId(); + + const LLUUID& getSnapshotId(); + + const LLVector3d& getPosGlobal(); + + const std::string& getLocation(); + + const std::string getDescription(); + + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + + void update(); + + ~LLPickItem(); + +protected: + + LLUUID mPicID; + LLUUID mCreatorID; + LLUUID mParcelID; + LLUUID mSnapshotID; + LLVector3d mPosGlobal; + bool mNeedData; + + std::string mPickName; + std::string mLocation; +}; + +#endif // LL_LLPANELPICKS_H diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp index 7ca362263427da3656eb589402aab9322f2d18de..d4c2f4b6b244352c0e450d449d99875d84f2fb8c 100644 --- a/indra/newview/llpanelplace.cpp +++ b/indra/newview/llpanelplace.cpp @@ -36,11 +36,10 @@ #include "llviewercontrol.h" #include "llqueryflags.h" -#include "message.h" #include "llui.h" #include "llsecondlifeurls.h" -#include "llremoteparcelrequest.h" #include "llfloater.h" +#include "llfloaterreg.h" #include "llagent.h" #include "llviewerwindow.h" @@ -51,18 +50,17 @@ #include "lltextbox.h" #include "llviewertexteditor.h" #include "lltexturectrl.h" +#include "lltrans.h" #include "llworldmap.h" #include "llviewerregion.h" +#include "llvoavatarself.h" #include "lluictrlfactory.h" //#include "llviewermenu.h" // create_landmark() #include "llweb.h" #include "llsdutil.h" -//static -std::list<LLPanelPlace*> LLPanelPlace::sAllPanels; - LLPanelPlace::LLPanelPlace() -: LLPanel(std::string("Places Panel")), +: LLPanel(), mParcelID(), mRequestedID(), mRegionID(), @@ -70,17 +68,16 @@ LLPanelPlace::LLPanelPlace() mPosRegion(), mAuctionID(0), mLandmarkAssetID() -{ - sAllPanels.push_back(this); -} - +{} LLPanelPlace::~LLPanelPlace() { - sAllPanels.remove(this); + if (mParcelID.notNull()) + { + LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelID, this); + } } - BOOL LLPanelPlace::postBuild() { // Since this is only used in the directory browser, always @@ -102,20 +99,16 @@ BOOL LLPanelPlace::postBuild() mLocationDisplay = getChild<LLTextBox>("location_editor"); mTeleportBtn = getChild<LLButton>( "teleport_btn"); - mTeleportBtn->setClickedCallback(onClickTeleport); - mTeleportBtn->setCallbackUserData(this); + mTeleportBtn->setClickedCallback(onClickTeleport, this); mMapBtn = getChild<LLButton>( "map_btn"); - mMapBtn->setClickedCallback(onClickMap); - mMapBtn->setCallbackUserData(this); + mMapBtn->setClickedCallback(onClickMap, this); //mLandmarkBtn = getChild<LLButton>( "landmark_btn"); - //mLandmarkBtn->setClickedCallback(onClickLandmark); - //mLandmarkBtn->setCallbackUserData(this); + //mLandmarkBtn->setClickedCallback(onClickLandmark, this); mAuctionBtn = getChild<LLButton>( "auction_btn"); - mAuctionBtn->setClickedCallback(onClickAuction); - mAuctionBtn->setCallbackUserData(this); + mAuctionBtn->setClickedCallback(onClickAuction, this); // Default to no auction button. We'll show it if we get an auction id mAuctionBtn->setVisible(FALSE); @@ -128,8 +121,11 @@ BOOL LLPanelPlace::postBuild() void LLPanelPlace::displayItemInfo(const LLInventoryItem* pItem) { - mNameEditor->setText(pItem->getName()); - mDescEditor->setText(pItem->getDescription()); + if (pItem) + { + mNameEditor->setText(pItem->getName()); + mDescEditor->setText(pItem->getDescription()); + } } // Use this for search directory clicks, because we are totally @@ -177,6 +173,7 @@ void LLPanelPlace::resetName(const std::string& name) } } +//virtual void LLPanelPlace::setParcelID(const LLUUID& parcel_id) { mParcelID = parcel_id; @@ -188,7 +185,6 @@ void LLPanelPlace::setSnapshot(const LLUUID& snapshot_id) mSnapshotCtrl->setImageAssetID(snapshot_id); } - void LLPanelPlace::setLocationString(const std::string& location) { mLocationDisplay->setText(location); @@ -201,27 +197,22 @@ void LLPanelPlace::setLandTypeString(const std::string& land_type) void LLPanelPlace::sendParcelInfoRequest() { - LLMessageSystem *msg = gMessageSystem; - if (mParcelID != mRequestedID) { - msg->newMessage("ParcelInfoRequest"); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("Data"); - msg->addUUID("ParcelID", mParcelID); - gAgent.sendReliableMessage(); + LLRemoteParcelInfoProcessor::getInstance()->addObserver(mParcelID, this); + LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(mParcelID); + mRequestedID = mParcelID; } } +//virtual void LLPanelPlace::setErrorStatus(U32 status, const std::string& reason) { // We only really handle 404 and 499 errors std::string error_text; if(status == 404) - { + { error_text = getString("server_error_text"); } else if(status == 499) @@ -231,140 +222,91 @@ void LLPanelPlace::setErrorStatus(U32 status, const std::string& reason) mDescEditor->setText(error_text); } -//static -void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **) +//virtual +void LLPanelPlace::processParcelInfo(const LLParcelData& parcel_data) { - LLUUID agent_id; - LLUUID parcel_id; - LLUUID owner_id; - std::string name; - std::string desc; - S32 actual_area; - S32 billable_area; - U8 flags; - F32 global_x; - F32 global_y; - F32 global_z; - std::string sim_name; - LLUUID snapshot_id; - F32 dwell; - S32 sale_price; - S32 auction_id; - - msg->getUUID("AgentData", "AgentID", agent_id ); - msg->getUUID("Data", "ParcelID", parcel_id); - - // look up all panels which have this avatar - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) - { - LLPanelPlace* self = *iter; - if (self->mParcelID != parcel_id) - { - continue; - } - - msg->getUUID ("Data", "OwnerID", owner_id); - msg->getString ("Data", "Name", name); - msg->getString ("Data", "Desc", desc); - msg->getS32 ("Data", "ActualArea", actual_area); - msg->getS32 ("Data", "BillableArea", billable_area); - msg->getU8 ("Data", "Flags", flags); - msg->getF32 ("Data", "GlobalX", global_x); - msg->getF32 ("Data", "GlobalY", global_y); - msg->getF32 ("Data", "GlobalZ", global_z); - msg->getString ("Data", "SimName", sim_name); - msg->getUUID ("Data", "SnapshotID", snapshot_id); - msg->getF32 ("Data", "Dwell", dwell); - msg->getS32 ("Data", "SalePrice", sale_price); - msg->getS32 ("Data", "AuctionID", auction_id); - - - self->mAuctionID = auction_id; - - if(snapshot_id.notNull()) - { - self->mSnapshotCtrl->setImageAssetID(snapshot_id); - } - - // Only assign the name and description if they are not empty and there is not a - // value present (passed in from a landmark, e.g.) + mAuctionID = parcel_data.auction_id; - if( !name.empty() - && self->mNameEditor && self->mNameEditor->getText().empty()) - { - self->mNameEditor->setText(name); - } + if(parcel_data.snapshot_id.notNull()) + { + mSnapshotCtrl->setImageAssetID(parcel_data.snapshot_id); + } - if( !desc.empty() - && self->mDescEditor && self->mDescEditor->getText().empty()) - { - self->mDescEditor->setText(desc); - } + if( !parcel_data.name.empty() + && mNameEditor && mNameEditor->getText().empty()) + { + mNameEditor->setText(parcel_data.name); + } - std::string info_text; - LLUIString traffic = self->getString("traffic_text"); - traffic.setArg("[TRAFFIC]", llformat("%d ", (int)dwell)); - info_text = traffic; - LLUIString area = self->getString("area_text"); - area.setArg("[AREA]", llformat("%d", actual_area)); - info_text += area; - if (flags & DFQ_FOR_SALE) - { - LLUIString forsale = self->getString("forsale_text"); - forsale.setArg("[PRICE]", llformat("%d", sale_price)); - info_text += forsale; - } - if (auction_id != 0) - { - LLUIString auction = self->getString("auction_text"); - auction.setArg("[ID]", llformat("%010d ", auction_id)); - info_text += auction; - } - if (self->mInfoEditor) - { - self->mInfoEditor->setText(info_text); - } + if( !parcel_data.desc.empty() + && mDescEditor && mDescEditor->getText().empty()) + { + mDescEditor->setText(parcel_data.desc); + } - // HACK: Flag 0x2 == adult region, - // Flag 0x1 == mature region, otherwise assume PG - std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG); - if (flags & 0x2) - { - rating = LLViewerRegion::accessToString(SIM_ACCESS_ADULT); - } - else if (flags & 0x1) - { - rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); - } + std::string info_text; + LLUIString traffic = getString("traffic_text"); + traffic.setArg("[TRAFFIC]", llformat("%d ", (int)parcel_data.dwell)); + info_text = traffic; + LLUIString area = getString("area_text"); + area.setArg("[AREA]", llformat("%d", parcel_data.actual_area)); + info_text += area; + if (parcel_data.flags & DFQ_FOR_SALE) + { + LLUIString forsale = getString("forsale_text"); + forsale.setArg("[PRICE]", llformat("%d", parcel_data.sale_price)); + info_text += forsale; + } + if (parcel_data.auction_id != 0) + { + LLUIString auction = getString("auction_text"); + auction.setArg("[ID]", llformat("%010d ", parcel_data.auction_id)); + info_text += auction; + } + if (mInfoEditor) + { + mInfoEditor->setText(info_text); + } - // Just use given region position for display - S32 region_x = llround(self->mPosRegion.mV[0]); - S32 region_y = llround(self->mPosRegion.mV[1]); - S32 region_z = llround(self->mPosRegion.mV[2]); + // HACK: Flag 0x2 == adult region, + // Flag 0x1 == mature region, otherwise assume PG + std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG); + if (parcel_data.flags & 0x2) + { + rating = LLViewerRegion::accessToString(SIM_ACCESS_ADULT); + } + else if (parcel_data.flags & 0x1) + { + rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); + } - // If the region position is zero, grab position from the global - if(self->mPosRegion.isExactlyZero()) - { - region_x = llround(global_x) % REGION_WIDTH_UNITS; - region_y = llround(global_y) % REGION_WIDTH_UNITS; - region_z = llround(global_z); - } + // Just use given region position for display + S32 region_x = llround(mPosRegion.mV[0]); + S32 region_y = llround(mPosRegion.mV[1]); + S32 region_z = llround(mPosRegion.mV[2]); - if(self->mPosGlobal.isExactlyZero()) - { - self->mPosGlobal.setVec(global_x, global_y, global_z); - } + // If the region position is zero, grab position from the global + if(mPosRegion.isExactlyZero()) + { + region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS; + region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS; + region_z = llround(parcel_data.global_z); + } - std::string location = llformat("%s %d, %d, %d (%s)", - sim_name.c_str(), region_x, region_y, region_z, rating.c_str()); - if (self->mLocationDisplay) - { - self->mLocationDisplay->setText(location); - } + if(mPosGlobal.isExactlyZero()) + { + mPosGlobal.setVec(parcel_data.global_x, parcel_data.global_y, parcel_data.global_z); + } - BOOL show_auction = (auction_id > 0); - self->mAuctionBtn->setVisible(show_auction); + std::string location = llformat("%s %d, %d, %d (%s)", + parcel_data.sim_name.c_str(), region_x, region_y, region_z, rating.c_str()); + if (mLocationDisplay) + { + mLocationDisplay->setText(location); } + + BOOL show_auction = (parcel_data.auction_id > 0); + mAuctionBtn->setVisible(show_auction); } @@ -390,7 +332,7 @@ void LLPanelPlace::displayParcelInfo(const LLVector3& pos_region, U64 region_handle = to_region_handle(pos_global); body["region_handle"] = ll_sd_from_U64(region_handle); } - LLHTTPClient::post(url, body, new LLRemoteParcelRequestResponder(this->getHandle())); + LLHTTPClient::post(url, body, new LLRemoteParcelRequestResponder(getObserverHandle())); } else { @@ -400,7 +342,6 @@ void LLPanelPlace::displayParcelInfo(const LLVector3& pos_region, mSnapshotCtrl->setFallbackImageName("default_land_picture.j2c"); } - // static void LLPanelPlace::onClickTeleport(void* data) { @@ -410,20 +351,20 @@ void LLPanelPlace::onClickTeleport(void* data) LLFloater* parent_floaterp = dynamic_cast<LLFloater*>(parent_viewp); if (parent_floaterp) { - parent_floaterp->close(); + parent_floaterp->closeFloater(); } // LLFloater* parent_floaterp = (LLFloater*)self->getParent(); parent_viewp->setVisible(false); if(self->mLandmarkAssetID.notNull()) { gAgent.teleportViaLandmark(self->mLandmarkAssetID); - gFloaterWorldMap->trackLandmark(self->mLandmarkAssetID); + LLFloaterWorldMap::getInstance()->trackLandmark(self->mLandmarkAssetID); } else if (!self->mPosGlobal.isExactlyZero()) { gAgent.teleportViaLocation(self->mPosGlobal); - gFloaterWorldMap->trackLocation(self->mPosGlobal); + LLFloaterWorldMap::getInstance()->trackLocation(self->mPosGlobal); } } @@ -433,8 +374,8 @@ void LLPanelPlace::onClickMap(void* data) LLPanelPlace* self = (LLPanelPlace*)data; if (!self->mPosGlobal.isExactlyZero()) { - gFloaterWorldMap->trackLocation(self->mPosGlobal); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::getInstance()->trackLocation(self->mPosGlobal); + LLFloaterReg::showInstance("world_map", "center"); } } @@ -453,12 +394,12 @@ void LLPanelPlace::onClickLandmark(void* data) void LLPanelPlace::onClickAuction(void* data) { LLPanelPlace* self = (LLPanelPlace*)data; - LLSD payload; - payload["auction_id"] = self->mAuctionID; + LLSD args; + args["AUCTION_ID"] = self->mAuctionID; - LLNotifications::instance().add("GoToAuctionPage", LLSD(), payload, callbackAuctionWebPage); + LLNotifications::instance().add("GoToAuctionPage", args); } - +/* // static bool LLPanelPlace::callbackAuctionWebPage(const LLSD& notification, const LLSD& response) { @@ -466,8 +407,7 @@ bool LLPanelPlace::callbackAuctionWebPage(const LLSD& notification, const LLSD& if (0 == option) { std::string url; - S32 auction_id = notification["payload"]["auction_id"].asInteger(); - url = AUCTION_URL + llformat("%010d", auction_id ); + url = LLNotifications::instance().getGlobalString("AUCTION_URL") + llformat("%010d", response["auction_id"].asInteger()); llinfos << "Loading auction page " << url << llendl; @@ -475,3 +415,5 @@ bool LLPanelPlace::callbackAuctionWebPage(const LLSD& notification, const LLSD& } return false; } +*/ + diff --git a/indra/newview/llpanelplace.h b/indra/newview/llpanelplace.h index b11290493a6e135dbe598d50add752d373d3da0e..f90a1b0567c99a0ee6ad20a4e34ded0d9341e550 100644 --- a/indra/newview/llpanelplace.h +++ b/indra/newview/llpanelplace.h @@ -38,6 +38,8 @@ #include "v3dmath.h" #include "lluuid.h" +#include "llremoteparcelrequest.h" + class LLButton; class LLTextBox; class LLLineEditor; @@ -46,7 +48,7 @@ class LLTextureCtrl; class LLMessageSystem; class LLInventoryItem; -class LLPanelPlace : public LLPanel +class LLPanelPlace : public LLPanel, LLRemoteParcelInfoObserver { public: LLPanelPlace(); @@ -58,7 +60,7 @@ public: // Ignore all old location information, useful if you are // recycling an existing dialog and need to clear it. - void setParcelID(const LLUUID& parcel_id); + /*virtual*/ void setParcelID(const LLUUID& parcel_id); // Sends a request for data about the given parcel, which will // only update the location if there is none already available. @@ -67,7 +69,7 @@ public: void setSnapshot(const LLUUID& snapshot_id); void setLocationString(const std::string& location); void setLandTypeString(const std::string& land_type); - void setErrorStatus(U32 status, const std::string& reason); + /*virtual*/ void setErrorStatus(U32 status, const std::string& reason); void resetName(const std::string& name); void sendParcelInfoRequest(); @@ -75,7 +77,7 @@ public: const LLUUID& landmark_asset_id, const LLUUID& region_id, const LLVector3d& pos_global); - static void processParcelInfoReply(LLMessageSystem* msg, void**); + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); LLTextureCtrl *getSnapshotCtrl() const { return mSnapshotCtrl; } @@ -113,9 +115,6 @@ protected: LLButton* mMapBtn; //LLButton* mLandmarkBtn; LLButton* mAuctionBtn; - - typedef std::list<LLPanelPlace*> panel_list_t; - static panel_list_t sAllPanels; }; #endif // LL_LLPANELPLACE_H diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3ed93e5598858e749e6df0e420007fbaf493982e --- /dev/null +++ b/indra/newview/llpanelplaceinfo.cpp @@ -0,0 +1,382 @@ +/** + * @file llpanelplaceinfo.cpp + * @brief Displays place information in Side Tray. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelplaceinfo.h" + +// *TODO: reorder includes to match the coding standard +#include "llinventory.h" +#include "llviewercontrol.h" +#include "llqueryflags.h" +#include "llui.h" +#include "llsecondlifeurls.h" +#include "llfloater.h" +#include "llfloaterreg.h" + +#include "llagent.h" +#include "llviewerwindow.h" +#include "llviewerinventory.h" +#include "llbutton.h" +#include "llfloaterworldmap.h" +#include "lllineeditor.h" +#include "llinventorymodel.h" +#include "lluiconstants.h" +#include "roles_constants.h" +#include "lltextbox.h" +#include "llviewertexteditor.h" +#include "lltexturectrl.h" +#include "lltrans.h" +#include "llworldmap.h" +#include "llviewerregion.h" +#include "lluictrlfactory.h" +#include "llweb.h" +#include "llsdutil.h" + +static LLRegisterPanelClassWrapper<LLPanelPlaceInfo> t_places("panel_landmark_info"); + +LLPanelPlaceInfo::LLPanelPlaceInfo() +: LLPanel(), + mParcelID(), + mRequestedID(), + mPosRegion(), + mLandmarkID() +{} + +LLPanelPlaceInfo::~LLPanelPlaceInfo() +{ + if (mParcelID.notNull()) + { + LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelID, this); + } +} + +BOOL LLPanelPlaceInfo::postBuild() +{ + // Since this is only used in the directory browser, always + // disable the snapshot control. Otherwise clicking on it will + // open a texture picker. + mSnapshotCtrl = getChild<LLTextureCtrl>("logo"); + mSnapshotCtrl->setEnabled(FALSE); + + mRegionName = getChild<LLTextBox>("region_name"); + mParcelName = getChild<LLTextBox>("parcel_name"); + mDescEditor = getChild<LLTextEditor>("description"); + mRating = getChild<LLIconCtrl>("maturity"); + + mOwner = getChild<LLTextBox>("owner"); + mCreator = getChild<LLTextBox>("creator"); + mCreated = getChild<LLTextBox>("created"); + + mTitleEditor = getChild<LLLineEditor>("title_editor"); + mTitleEditor->setCommitCallback(boost::bind(&LLPanelPlaceInfo::onCommitTitleOrNote, this, TITLE)); + + mNotesEditor = getChild<LLTextEditor>("notes_editor"); + mNotesEditor->setCommitCallback(boost::bind(&LLPanelPlaceInfo::onCommitTitleOrNote, this, NOTE)); + mNotesEditor->setCommitOnFocusLost(true); + + mInfoPanel = getChild<LLPanel>("info_panel"); + + return TRUE; +} + +void LLPanelPlaceInfo::displayItemInfo(const LLInventoryItem* pItem) +{ + if (!pItem) + return; + + mLandmarkID = pItem->getUUID(); + + if(!gCacheName) + return; + + const LLPermissions& perm = pItem->getPermissions(); + + ////////////////// + // CREATOR NAME // + ////////////////// + if (pItem->getCreatorUUID().notNull()) + { + std::string name; + LLUUID creator_id = pItem->getCreatorUUID(); + if (!gCacheName->getFullName(creator_id, name)) + { + gCacheName->get(creator_id, FALSE, + boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, this, mCreator, _2, _3)); + } + mCreator->setText(name); + } + else + { + mCreator->setText(getString("unknown")); + } + + //////////////// + // OWNER NAME // + //////////////// + if(perm.isOwned()) + { + std::string name; + if (perm.isGroupOwned()) + { + LLUUID group_id = perm.getGroup(); + if (!gCacheName->getGroupName(group_id, name)) + { + gCacheName->get(group_id, TRUE, + boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, this, mOwner, _2, _3)); + } + } + else + { + LLUUID owner_id = perm.getOwner(); + if (!gCacheName->getFullName(owner_id, name)) + { + gCacheName->get(owner_id, FALSE, + boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, this, mOwner, _2, _3)); + } + } + mOwner->setText(name); + } + else + { + mOwner->setText(getString("public")); + } + + ////////////////// + // ACQUIRE DATE // + ////////////////// + time_t time_utc = pItem->getCreationDate(); + if (0 == time_utc) + { + mCreated->setText(getString("unknown")); + } + else + { + std::string timeStr = getString("acquired_date"); + LLSD substitution; + substitution["datetime"] = (S32) time_utc; + LLStringUtil::format (timeStr, substitution); + mCreated->setText(timeStr); + } + + mTitleEditor->setText(pItem->getName()); + mNotesEditor->setText(pItem->getDescription()); +} + +void LLPanelPlaceInfo::nameUpdatedCallback( + LLTextBox* text, + const std::string& first, + const std::string& last) +{ + text->setText(first + " " + last); +} + +void LLPanelPlaceInfo::resetLocation() +{ + mParcelID.setNull(); + mRequestedID.setNull(); + mLandmarkID.setNull(); + mPosRegion.clearVec(); + std::string not_available = getString("not_available"); + mRating->setValue(not_available); + mRegionName->setText(not_available); + mParcelName->setText(not_available); + mDescEditor->setText(not_available); + mCreator->setText(not_available); + mOwner->setText(not_available); + mCreated->setText(not_available); + mTitleEditor->setText(LLStringUtil::null); + mNotesEditor->setText(LLStringUtil::null); +} + +//virtual +void LLPanelPlaceInfo::setParcelID(const LLUUID& parcel_id) +{ + mParcelID = parcel_id; + sendParcelInfoRequest(); +} + +void LLPanelPlaceInfo::sendParcelInfoRequest() +{ + if (mParcelID != mRequestedID) + { + LLRemoteParcelInfoProcessor::getInstance()->addObserver(mParcelID, this); + LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(mParcelID); + + mRequestedID = mParcelID; + } +} + +// virtual +void LLPanelPlaceInfo::setErrorStatus(U32 status, const std::string& reason) +{ + // We only really handle 404 and 499 errors + std::string error_text; + if(status == 404) + { + error_text = getString("server_error_text"); + } + else if(status == 499) + { + error_text = getString("server_forbidden_text"); + } + mDescEditor->setText(error_text); +} + +// virtual +void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) +{ + if(parcel_data.snapshot_id.notNull()) + { + mSnapshotCtrl->setImageAssetID(parcel_data.snapshot_id); + } + + if( !parcel_data.name.empty()) + { + mParcelName->setText(parcel_data.name); + } + + if( !parcel_data.desc.empty()) + { + mDescEditor->setText(parcel_data.desc); + } + + // HACK: Flag 0x2 == adult region, + // Flag 0x1 == mature region, otherwise assume PG + std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG); + std::string rating_icon = "icon_event.tga"; + if (parcel_data.flags & 0x2) + { + rating = LLViewerRegion::accessToString(SIM_ACCESS_ADULT); + rating_icon = "icon_event_adult.tga"; + } + else if (parcel_data.flags & 0x1) + { + rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); + rating_icon = "icon_event_mature.tga"; + } + mRating->setValue(rating_icon); + + // Just use given region position for display + S32 region_x = llround(mPosRegion.mV[0]); + S32 region_y = llround(mPosRegion.mV[1]); + S32 region_z = llround(mPosRegion.mV[2]); + + // If the region position is zero, grab position from the global + if(mPosRegion.isExactlyZero()) + { + region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS; + region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS; + region_z = llround(parcel_data.global_z); + } + + if (!parcel_data.sim_name.empty()) + { + std::string name = llformat("%s (%d, %d, %d)", + parcel_data.sim_name.c_str(), region_x, region_y, region_z); + mRegionName->setText(name); + } +} + +void LLPanelPlaceInfo::displayParcelInfo(const LLVector3& pos_region, + const LLUUID& region_id, + const LLVector3d& pos_global) +{ + LLSD body; + mPosRegion = pos_region; + std::string url = gAgent.getRegion()->getCapability("RemoteParcelRequest"); + if (!url.empty()) + { + body["location"] = ll_sd_from_vector3(pos_region); + if (!region_id.isNull()) + { + body["region_id"] = region_id; + } + if (!pos_global.isExactlyZero()) + { + U64 region_handle = to_region_handle(pos_global); + body["region_handle"] = ll_sd_from_U64(region_handle); + } + LLHTTPClient::post(url, body, new LLRemoteParcelRequestResponder(getObserverHandle())); + } + else + { + mDescEditor->setText(getString("server_update_text")); + } + mSnapshotCtrl->setImageAssetID(LLUUID::null); + mSnapshotCtrl->setFallbackImageName("default_land_picture.j2c"); +} + +void LLPanelPlaceInfo::onCommitTitleOrNote(LANDMARK_INFO_TYPE type) +{ + LLInventoryItem* item = gInventory.getItem(mLandmarkID); + if (!item) + return; + + std::string current_value; + std::string item_value; + if (type == TITLE) + { + if (mTitleEditor) + { + current_value = mTitleEditor->getText(); + item_value = item->getName(); + } + } + else + { + if (mNotesEditor) + { + current_value = mNotesEditor->getText(); + item_value = item->getDescription(); + } + } + + if (item_value != current_value && + gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE)) + { + LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); + + if (type == TITLE) + { + new_item->rename(current_value); + } + else + { + new_item->setDescription(current_value); + } + + new_item->updateServer(FALSE); + gInventory.updateItem(new_item); + gInventory.notifyObservers(); + } +} diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h new file mode 100644 index 0000000000000000000000000000000000000000..f88e29bc915941f79829b8237336d2da3cb8d648 --- /dev/null +++ b/indra/newview/llpanelplaceinfo.h @@ -0,0 +1,109 @@ +/** + * @file llpanelplace.h + * @brief Displays place information in Side Tray. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELPLACEINFO_H +#define LL_LLPANELPLACEINFO_H + +#include "llpanel.h" + +#include "v3dmath.h" +#include "lluuid.h" + +#include "lliconctrl.h" + +#include "llremoteparcelrequest.h" + +class LLButton; +class LLTextBox; +class LLLineEditor; +class LLTextEditor; +class LLTextureCtrl; +class LLInventoryItem; + +class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver +{ +public: + LLPanelPlaceInfo(); + /*virtual*/ ~LLPanelPlaceInfo(); + + /*virtual*/ BOOL postBuild(); + + void resetLocation(); + // Ignore all old location information, useful if you are + // recycling an existing dialog and need to clear it. + + /*virtual*/ void setParcelID(const LLUUID& parcel_id); + // Sends a request for data about the given parcel, which will + // only update the location if there is none already available. + + void displayItemInfo(const LLInventoryItem* pItem); + /*virtual*/ void setErrorStatus(U32 status, const std::string& reason); + + void sendParcelInfoRequest(); + void displayParcelInfo(const LLVector3& pos_region, + const LLUUID& region_id, + const LLVector3d& pos_global); + void nameUpdatedCallback(LLTextBox* text, + const std::string& first, + const std::string& last); + + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); + +private: + enum LANDMARK_INFO_TYPE + { + TITLE, + NOTE + }; + + void onCommitTitleOrNote(LANDMARK_INFO_TYPE type); + + LLUUID mParcelID; + LLUUID mRequestedID; + LLUUID mLandmarkID; + LLVector3 mPosRegion; + + LLTextureCtrl* mSnapshotCtrl; + LLTextBox* mRegionName; + LLTextBox* mParcelName; + LLTextEditor* mDescEditor; + LLIconCtrl* mRating; + LLTextBox* mOwner; + LLTextBox* mCreator; + LLTextBox* mCreated; + LLLineEditor* mTitleEditor; + LLTextEditor* mNotesEditor; + LLTextBox* mLocationEditor; + LLPanel* mInfoPanel; +}; + +#endif // LL_LLPANELPLACEINFO_H diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d18cac9f42011edd5d4489d990e3ea29ac3bc715 --- /dev/null +++ b/indra/newview/llpanelplaces.cpp @@ -0,0 +1,293 @@ +/** + * @file llpanelplaces.cpp + * @brief Side Bar "Places" panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterreg.h" +#include "llsearcheditor.h" +#include "lltabcontainer.h" +#include "lluictrlfactory.h" + +#include "lllandmark.h" + +#include "llagent.h" +#include "lllandmarklist.h" +#include "llfloaterworldmap.h" +#include "llpanelplaces.h" +#include "llpanellandmarks.h" +#include "llpanelteleporthistory.h" +#include "llviewerregion.h" + +static LLRegisterPanelClassWrapper<LLPanelPlaces> t_places("panel_places"); + +LLPanelPlaces::LLPanelPlaces() + : LLPanel(), + mFilterSubString(LLStringUtil::null), + mActivePanel(NULL), + mSearchEditor(NULL), + mPlaceInfo(NULL) +{ + gInventory.addObserver(this); + + //LLUICtrlFactory::getInstance()->buildPanel(this, "panel_places.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() +} + +LLPanelPlaces::~LLPanelPlaces() +{ + if (gInventory.containsObserver(this)) + gInventory.removeObserver(this); +} + +BOOL LLPanelPlaces::postBuild() +{ + mTabContainer = getChild<LLTabContainer>("Places Tabs"); + if (mTabContainer) + { + mTabContainer->setCommitCallback(boost::bind(&LLPanelPlaces::onTabSelected, this)); + } + + mSearchEditor = getChild<LLSearchEditor>("Filter"); + if (mSearchEditor) + { + mSearchEditor->setSearchCallback(boost::bind(&LLPanelPlaces::onSearchEdit, this, _1)); + } + + mPlaceInfo = dynamic_cast<LLPanelPlaceInfo*>(getChild<LLPanel>("panel_landmark_info")); + if (mPlaceInfo) + { + LLButton* back_btn = mPlaceInfo->getChild<LLButton>("back_btn"); + if (back_btn) + { + back_btn->setClickedCallback(boost::bind(&LLPanelPlaces::onBackButtonClicked, this)); + } + } + + //childSetAction("share_btn", boost::bind(&LLPanelPlaces::onShareButtonClicked, this), this); + childSetAction("teleport_btn", boost::bind(&LLPanelPlaces::onTeleportButtonClicked, this), this); + childSetAction("map_btn", boost::bind(&LLPanelPlaces::onShowOnMapButtonClicked, this), this); + + return TRUE; +} + +void LLPanelPlaces::draw() +{ + LLPanel::draw(); +} + +void LLPanelPlaces::onOpen(const LLSD& key) +{ + if(key.size() == 0) + return; + + togglePlaceInfoPanel(TRUE); + + mPlaceInfoType = key["type"].asInteger(); + + if (mPlaceInfoType == AGENT) + { + // We don't need to teleport to the current location so disable the button + getChild<LLButton>("teleport_btn")->setEnabled(FALSE); + + mPlaceInfo->displayParcelInfo(gAgent.getPositionAgent(), + gAgent.getRegion()->getRegionID(), + gAgent.getPositionGlobal()); + } + else if (mPlaceInfoType == LANDMARK) + { + LLInventoryItem* item = gInventory.getItem(key["id"].asUUID()); + if (!item) + return; + + mPlaceInfo->displayItemInfo(item); + + LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID()); + if (!landmark) + return; + + LLUUID region_id; + landmark->getRegionID(region_id); + LLVector3d pos_global; + landmark->getGlobalPos(pos_global); + mPlaceInfo->displayParcelInfo(landmark->getRegionPos(), + region_id, + pos_global); + + } + else if (mPlaceInfoType == TELEPORT_HISTORY) + { + S32 index = key["id"].asInteger(); + + const LLTeleportHistory::slurl_list_t& hist_items = + LLTeleportHistory::getInstance()->getItems(); + + LLVector3d pos_global = hist_items[index].mGlobalPos; + + F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); + F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); + + LLVector3 pos_local(region_x, region_y, (F32)pos_global.mdV[VZ]); + + mPlaceInfo->displayParcelInfo(pos_local, + hist_items[index].mRegionID, + pos_global); + } +} + +void LLPanelPlaces::onSearchEdit(const std::string& search_string) +{ + if (mFilterSubString != search_string) + { + mFilterSubString = search_string; + + LLStringUtil::toUpper(mFilterSubString); + LLStringUtil::trimHead(mFilterSubString); + + mSearchEditor->setText(mFilterSubString); + + mActivePanel->onSearchEdit(mFilterSubString); + } +} + +void LLPanelPlaces::onTabSelected() +{ + if (!mActivePanel) + return; + + mActivePanel = dynamic_cast<LLPanelPlacesTab*>(mTabContainer->getCurrentPanel()); + + if (mActivePanel) + { + mActivePanel->onSearchEdit(mFilterSubString); + mActivePanel->onTabSelected(); + } +} + +void LLPanelPlaces::onShareButtonClicked() +{ + // TODO: Launch the "Things" Share wizard +} + +/* +void LLPanelPlaces::onAddLandmarkButtonClicked() +{ + LLFloaterReg::showInstance("add_landmark"); +} + +void LLPanelPlaces::onCopySLURLButtonClicked() +{ + mActivePanel->onCopySLURL(); +} +*/ + +void LLPanelPlaces::onTeleportButtonClicked() +{ + mActivePanel->onTeleport(); +} + +void LLPanelPlaces::onShowOnMapButtonClicked() +{ + if (!mPlaceInfoType) + { + LLVector3d global_pos = gAgent.getPositionGlobal(); + if (!global_pos.isExactlyZero()) + { + LLFloaterWorldMap::getInstance()->trackLocation(global_pos); + LLFloaterReg::showInstance("world_map", "center"); + } + } + else + { + mActivePanel->onShowOnMap(); + } +} + +void LLPanelPlaces::onBackButtonClicked() +{ + togglePlaceInfoPanel(FALSE); +} + +void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) +{ + if (!mPlaceInfo) + return; + + mPlaceInfo->setVisible(visible); + mSearchEditor->setVisible(!visible); + mTabContainer->setVisible(!visible); + + if (visible) + { + mPlaceInfo->resetLocation(); + + LLRect rect = getRect(); + LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom); + mPlaceInfo->reshape(new_rect.getWidth(),new_rect.getHeight()); + } +} + +//virtual +void LLPanelPlaces::changed(U32 mask) +{ + if (!(gInventory.isInventoryUsable() && LLTeleportHistory::getInstance())) + return; + + LLLandmarksPanel* landmarks_panel = new LLLandmarksPanel(); + if (landmarks_panel) + { + landmarks_panel->setPanelPlacesButtons(this); + + mTabContainer->addTabPanel( + LLTabContainer::TabPanelParams(). + panel(landmarks_panel). + label("Landmarks"). + insert_at(LLTabContainer::END)); + } + + LLTeleportHistoryPanel* teleport_history_panel = new LLTeleportHistoryPanel(); + if (teleport_history_panel) + { + teleport_history_panel->setPanelPlacesButtons(this); + + mTabContainer->addTabPanel( + LLTabContainer::TabPanelParams(). + panel(teleport_history_panel). + label("Teleport History"). + insert_at(LLTabContainer::END)); + } + + mTabContainer->selectFirstTab(); + + mActivePanel = dynamic_cast<LLPanelPlacesTab*>(mTabContainer->getCurrentPanel()); + + // we don't need to monitor inventory changes anymore, + // so remove the observer + gInventory.removeObserver(this); +} diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h new file mode 100644 index 0000000000000000000000000000000000000000..533fb8dd8289d14ead36fff8e122d8e8e6c7a07e --- /dev/null +++ b/indra/newview/llpanelplaces.h @@ -0,0 +1,85 @@ +/** + * @file llpanelplaces.h + * @brief Side Bar "Places" panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELPLACES_H +#define LL_LLPANELPLACES_H + +#include "llpanel.h" + +#include "llinventory.h" + +#include "llinventorymodel.h" +#include "llpanelplaceinfo.h" + +class LLPanelPlacesTab; +class LLSearchEditor; +class LLTabContainer; + +class LLPanelPlaces : public LLPanel, LLInventoryObserver +{ +public: + enum PLACE_INFO_TYPE + { + AGENT, + LANDMARK, + TELEPORT_HISTORY + }; + + LLPanelPlaces(); + virtual ~LLPanelPlaces(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void draw(); + /*virtual*/ void changed(U32 mask); + /*virtual*/ void onOpen(const LLSD& key); + + void onSearchEdit(const std::string& search_string); + void onTabSelected(); + //void onAddLandmarkButtonClicked(); + //void onCopySLURLButtonClicked(); + void onShareButtonClicked(); + void onTeleportButtonClicked(); + void onShowOnMapButtonClicked(); + void onBackButtonClicked(); + void togglePlaceInfoPanel(BOOL visible); + +private: + LLSearchEditor* mSearchEditor; + LLPanelPlacesTab* mActivePanel; + LLTabContainer* mTabContainer; + LLPanelPlaceInfo* mPlaceInfo; + std::string mFilterSubString; + + // Place information type currently shown in Information panel + S32 mPlaceInfoType; +}; + +#endif //LL_LLPANELPLACES_H diff --git a/indra/newview/llpanelplacestab.cpp b/indra/newview/llpanelplacestab.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2b38aa0890751eb43974bf1f01a08d818d5772bd --- /dev/null +++ b/indra/newview/llpanelplacestab.cpp @@ -0,0 +1,98 @@ +/** + * @file llpanelplacestab.cpp + * @brief Tabs interface for Side Bar "Places" panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llwindow.h" + +#include "llnotifications.h" + +#include "llslurl.h" +#include "llpanelplacestab.h" +#include "llworldmap.h" + +void LLPanelPlacesTab::setPanelPlacesButtons(LLPanelPlaces* panel) +{ + //mShareBtn = panel->getChild<LLButton>("share_btn"); + mTeleportBtn = panel->getChild<LLButton>("teleport_btn"); + mShowOnMapBtn = panel->getChild<LLButton>("map_btn"); +} + +void LLPanelPlacesTab::onRegionResponse(const LLVector3d& landmark_global_pos, + U64 region_handle, + const std::string& url, + const LLUUID& snapshot_id, + bool teleport) +{ + std::string sim_name; + bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( landmark_global_pos, sim_name ); + + std::string sl_url; + if ( gotSimName ) + { + F32 region_x = (F32)fmod( landmark_global_pos.mdV[VX], (F64)REGION_WIDTH_METERS ); + F32 region_y = (F32)fmod( landmark_global_pos.mdV[VY], (F64)REGION_WIDTH_METERS ); + + sl_url = LLSLURL::buildSLURL(sim_name, llround(region_x), llround(region_y), llround((F32)landmark_global_pos.mdV[VZ])); + } + else + { + sl_url = ""; + } + + LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(sl_url)); + + LLSD args; + args["SLURL"] = sl_url; + + LLNotifications::instance().add("CopySLURL", args); +} + +void LLPanelPlacesTab::onTabSelected() +{ + togglePanelPlacesButtons(TRUE); +} + +void LLPanelPlacesTab::togglePanelPlacesButtons(BOOL enabled) +{ + if (enabled) + { + //mShareBtn->setEnabled(TRUE); + mTeleportBtn->setEnabled(TRUE); + mShowOnMapBtn->setEnabled(TRUE); + } + else + { + //mShareBtn->setEnabled(FALSE); + mTeleportBtn->setEnabled(FALSE); + mShowOnMapBtn->setEnabled(FALSE); + } +} diff --git a/indra/newview/llpanelplacestab.h b/indra/newview/llpanelplacestab.h new file mode 100644 index 0000000000000000000000000000000000000000..5d6b7d1090c36f6f594a54eedd21ce8603ca06a3 --- /dev/null +++ b/indra/newview/llpanelplacestab.h @@ -0,0 +1,68 @@ +/** + * @file llpanelplacestab.h + * @brief Tabs interface for Side Bar "Places" panel + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELPLACESTAB_H +#define LL_LLPANELPLACESTAB_H + +#include "llpanel.h" + +#include "llpanelplaces.h" + +class LLPanelPlacesTab : public LLPanel +{ +public: + LLPanelPlacesTab() : LLPanel() {} + virtual ~LLPanelPlacesTab() {} + + virtual void onSearchEdit(const std::string& string) = 0; + //virtual void onShare() = 0; + virtual void onShowOnMap() = 0; + virtual void onTeleport() = 0; + //virtual void onCopySLURL() = 0; + + void setPanelPlacesButtons(LLPanelPlaces* panel); + void onRegionResponse(const LLVector3d& landmark_global_pos, + U64 region_handle, + const std::string& url, + const LLUUID& snapshot_id, + bool teleport); + void onTabSelected(); + +protected: + void togglePanelPlacesButtons(BOOL enabled); + +private: + //LLButton* mShareBtn; + LLButton* mTeleportBtn; + LLButton* mShowOnMapBtn; +}; + +#endif //LL_LLPANELPLACESTAB_H diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp new file mode 100644 index 0000000000000000000000000000000000000000..457397a379c72c3d3244ad0346868720ec123898 --- /dev/null +++ b/indra/newview/llpanelprofileview.cpp @@ -0,0 +1,112 @@ +/** +* @file llpanelprofileview.cpp +* @brief Side tray "Profile View" panel +* +* $LicenseInfo:firstyear=2009&license=viewergpl$ +* +* Copyright (c) 2009, Linden Research, Inc. +* +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at +* http://secondlifegrid.net/programs/open_source/licensing/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" +#include "llpanelprofileview.h" +#include <llfloaterreg.h> +#include <lltabcontainer.h> +#include <lluictrlfactory.h> +#include "llpanelavatar.h" +#include "llpanelpicks.h" + +static LLRegisterPanelClassWrapper<LLPanelProfileView> t_panel_target_profile("panel_profile_view"); +static LLRegisterPanelClassWrapper<LLPanelAvatarNotes> t_panel_notes("panel_notes"); + +static std::string PANEL_PROFILE = "panel_profile"; +static std::string PANEL_PICKS = "panel_picks"; +static std::string PANEL_NOTES = "panel_notes"; + +LLPanelProfileView::LLPanelProfileView(const LLPanel::Params& p) +: LLPanel(p) +{ +} + +LLPanelProfileView::~LLPanelProfileView(void) +{ +} + +/*virtual*/ +void LLPanelProfileView::onOpen(const LLSD& key) +{ + if (!getVisible()) + setVisible(TRUE); + + LLUUID id(key.asUUID()); + if(id.notNull() && mProfileId.notNull() && mProfileId != id) + { + mTabs[PANEL_PROFILE]->clear(); + mTabs[PANEL_PICKS]->clear(); + mTabs[PANEL_NOTES]->clear(); + } + + mProfileId = id; + mTabs[PANEL_PROFILE]->onOpen(mProfileId); + mTabs[PANEL_PICKS]->setAvatarId(mProfileId); + mTabs[PANEL_PICKS]->updateData(); + mTabs[PANEL_NOTES]->setAvatarId(mProfileId); + mTabs[PANEL_NOTES]->updateData(); + + std::string full_name; + gCacheName->getFullName(key,full_name); + childSetValue("user_name",full_name); +} + + +BOOL LLPanelProfileView::postBuild() +{ + mTabContainer = getChild<LLTabContainer>("profile_tabs"); + mTabContainer->setCommitCallback(boost::bind(&LLPanelProfileView::onTabSelected, this, _2)); + + mTabs[PANEL_PROFILE] = (getChild<LLPanelAvatarProfile>(PANEL_PROFILE)); + mTabs[PANEL_PICKS] = (getChild<LLPanelPicks>(PANEL_PICKS)); + mTabs[PANEL_NOTES] = (getChild<LLPanelAvatarNotes>(PANEL_NOTES)); + + childSetCommitCallback("back",boost::bind(&LLPanelProfileView::onBackBtnClick,this),NULL); + + return TRUE; +} + + +//private + +void LLPanelProfileView::initTabs(const LLSD& key) +{ +} + +void LLPanelProfileView::onTabSelected(const LLSD& param) +{ +} + +void LLPanelProfileView::onBackBtnClick() +{ + setVisible(FALSE); +} diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h new file mode 100644 index 0000000000000000000000000000000000000000..4d8170452239d99eaba1640fac4498152b452b4a --- /dev/null +++ b/indra/newview/llpanelprofileview.h @@ -0,0 +1,69 @@ +/** +* @file llpanelprofileview.h +* @brief Side tray "Profile View" panel +* +* $LicenseInfo:firstyear=2009&license=viewergpl$ +* +* Copyright (c) 2009, Linden Research, Inc. +* +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 +* +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at +* http://secondlifegrid.net/programs/open_source/licensing/flossexception +* +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. +* +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. +* $/LicenseInfo$ +*/ + +#ifndef LL_LLPANELPROFILEVIEW_H +#define LL_LLPANELPROFILEVIEW_H + +#include <llpanel.h> + +class LLPanelProfileTab; +class LLTabContainer; + +class LLPanelProfileView : public LLPanel +{ + LOG_CLASS(LLPanelProfileView); + friend class LLUICtrlFactory; + +public: + LLPanelProfileView(const LLPanel::Params& p = defaultParams()); + + ~LLPanelProfileView(void); + + void onTabSelected(const LLSD& param); + + void onOpen(const LLSD& key); + + BOOL postBuild(); + + void initTabs(const LLSD& key); + + void onBackBtnClick(); + +private: + LLTabContainer* mTabContainer; + + typedef std::map<std::string, LLPanelProfileTab*> profile_tabs_t; + profile_tabs_t mTabs; + LLUUID mProfileId; +}; + +#endif //LL_LLPANELPROFILEVIEW_H diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp new file mode 100644 index 0000000000000000000000000000000000000000..22e8ada2eaaaf077f16aac1df09e46cbb3915466 --- /dev/null +++ b/indra/newview/llpanelteleporthistory.cpp @@ -0,0 +1,218 @@ +/** + * @file llpanelteleporthistory.cpp + * @brief Teleport history represented by a scrolling list + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterreg.h" + +#include "llfloaterworldmap.h" +#include "llpanelteleporthistory.h" +#include "llsidetray.h" +#include "llworldmap.h" + +// Not yet implemented; need to remove buildPanel() from constructor when we switch +//static LLRegisterPanelClassWrapper<LLTeleportHistoryPanel> t_teleport_history("panel_teleport_history"); + +LLTeleportHistoryPanel::LLTeleportHistoryPanel() + : LLPanelPlacesTab(), + mFilterSubString(LLStringUtil::null), + mTeleportHistory(NULL), + mHistoryItems(NULL) +{ + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_teleport_history.xml"); +} + +LLTeleportHistoryPanel::~LLTeleportHistoryPanel() +{ +} + +BOOL LLTeleportHistoryPanel::postBuild() +{ + mTeleportHistory = LLTeleportHistory::getInstance(); + if (mTeleportHistory) + { + mTeleportHistory->setHistoryChangedCallback(boost::bind(&LLTeleportHistoryPanel::showTeleportHistory, this)); + } + + mHistoryItems = getChild<LLScrollListCtrl>("history_items"); + if (mHistoryItems) + { + mHistoryItems->setDoubleClickCallback(onDoubleClickItem, this); + mHistoryItems->setCommitOnSelectionChange(FALSE); + mHistoryItems->setCommitCallback(boost::bind(&LLTeleportHistoryPanel::handleItemSelect, this, _2)); + } + + return TRUE; +} + +// virtual +void LLTeleportHistoryPanel::onSearchEdit(const std::string& string) +{ + if (mFilterSubString != string) + { + mFilterSubString = string; + showTeleportHistory(); + } +} + +// virtual +void LLTeleportHistoryPanel::onShowOnMap() +{ + LLScrollListItem* itemp = mHistoryItems->getFirstSelected(); + if(!itemp) + return; + + S32 index = itemp->getColumn(LIST_INDEX)->getValue().asInteger(); + + const LLTeleportHistory::slurl_list_t& hist_items = mTeleportHistory->getItems(); + + LLVector3d global_pos = hist_items[index].mGlobalPos; + + if (!global_pos.isExactlyZero()) + { + LLFloaterWorldMap::getInstance()->trackLocation(global_pos); + LLFloaterReg::showInstance("world_map", "center"); + } +} + +// virtual +void LLTeleportHistoryPanel::onTeleport() +{ + LLScrollListItem* itemp = mHistoryItems->getFirstSelected(); + if(!itemp) + return; + + S32 index = itemp->getColumn(LIST_INDEX)->getValue().asInteger(); + + mTeleportHistory->goToItem(index); +} + +/* +// virtual +void LLTeleportHistoryPanel::onCopySLURL() +{ + LLScrollListItem* itemp = mHistoryItems->getFirstSelected(); + if(!itemp) + return; + + S32 index = itemp->getColumn(LIST_INDEX)->getValue().asInteger(); + + const LLTeleportHistory::slurl_list_t& hist_items = mTeleportHistory->getItems(); + + LLVector3d global_pos = hist_items[index].mGlobalPos; + + U64 new_region_handle = to_region_handle(global_pos); + + LLWorldMap::url_callback_t cb = boost::bind( + &LLPanelPlacesTab::onRegionResponse, this, + global_pos, _1, _2, _3, _4); + + LLWorldMap::getInstance()->sendHandleRegionRequest(new_region_handle, cb, std::string("unused"), false); +} +*/ + +void LLTeleportHistoryPanel::showTeleportHistory() +{ + const LLTeleportHistory::slurl_list_t& hist_items = mTeleportHistory->getItems(); + + mHistoryItems->deleteAllItems(); + + S32 cur_item = mTeleportHistory->getCurrentItemIndex(); + + for (LLTeleportHistory::slurl_list_t::const_iterator iter = hist_items.begin(); + iter != hist_items.end(); ++iter) + { + std::string landmark_title = (*iter).mTitle; + LLStringUtil::toUpper(landmark_title); + + std::string::size_type match_offset = mFilterSubString.size() ? landmark_title.find(mFilterSubString) : std::string::npos; + bool passed = mFilterSubString.size() == 0 || match_offset != std::string::npos; + + if (!passed) + continue; + + S32 index = iter - hist_items.begin(); + + LLSD row; + row["id"] = index; + + LLSD& icon_column = row["columns"][LIST_ICON]; + icon_column["column"] = "landmark_icon"; + icon_column["type"] = "icon"; + icon_column["value"] = "inv_item_landmark.tga"; + + LLSD& region_column = row["columns"][LIST_ITEM_TITLE]; + region_column["column"] = "region"; + region_column["type"] = "text"; + region_column["value"] = (*iter).mTitle; + + LLSD& index_column = row["columns"][LIST_INDEX]; + index_column["column"] = "index"; + index_column["type"] = "text"; + index_column["value"] = index; + + mHistoryItems->addElement(row); + + if (cur_item == index) + { + LLScrollListItem* itemp = mHistoryItems->getItem(index); + ((LLScrollListText*)itemp->getColumn(LIST_ITEM_TITLE))->setFontStyle(LLFontGL::BOLD); + } + } + + togglePanelPlacesButtons(mHistoryItems->getFirstSelected() != NULL); +} + +void LLTeleportHistoryPanel::handleItemSelect(const LLSD& data) +{ + LLScrollListItem* itemp = mHistoryItems->getFirstSelected(); + + if (!itemp) + return; + + togglePanelPlacesButtons(TRUE); +} + +//static +void LLTeleportHistoryPanel::onDoubleClickItem(void* user_data) +{ + LLTeleportHistoryPanel* self = (LLTeleportHistoryPanel*)user_data; + + LLScrollListItem* itemp = self->mHistoryItems->getFirstSelected(); + if(!itemp) + return; + + LLSD key; + key["type"] = LLPanelPlaces::TELEPORT_HISTORY; + key["id"] = itemp->getColumn(LIST_INDEX)->getValue().asInteger(); + + LLSideTray::getInstance()->showPanel("panel_places", key); +} diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h new file mode 100644 index 0000000000000000000000000000000000000000..6f41c97eec99b6d98275a392e2b3b8b5db1a2d6f --- /dev/null +++ b/indra/newview/llpanelteleporthistory.h @@ -0,0 +1,72 @@ +/** + * @file llpanelteleporthistory.h + * @brief Teleport history represented by a scrolling list + * class definition + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELTELEPORTHISTORY_H +#define LL_LLPANELTELEPORTHISTORY_H + +#include "lluictrlfactory.h" +#include "llscrolllistctrl.h" + +#include "llpanelplacestab.h" +#include "llteleporthistory.h" + +class LLTeleportHistoryPanel : public LLPanelPlacesTab +{ +public: + LLTeleportHistoryPanel(); + virtual ~LLTeleportHistoryPanel(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onSearchEdit(const std::string& string); + /*virtual*/ void onShowOnMap(); + /*virtual*/ void onTeleport(); + ///*virtual*/ void onCopySLURL(); + + void showTeleportHistory(); + void handleItemSelect(const LLSD& data); + + static void onDoubleClickItem(void* user_data); + +private: + enum TELEPORT_HISTORY_COLUMN_ORDER + { + LIST_ICON, + LIST_ITEM_TITLE, + LIST_INDEX + }; + + LLTeleportHistory* mTeleportHistory; + LLScrollListCtrl* mHistoryItems; + std::string mFilterSubString; +}; + +#endif //LL_LLPANELTELEPORTHISTORY_H diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 6d014a23de14b726269d56e11bd360b21193df67..1e44a294b0db80d65595e7b4d4cff20b41155a63 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -107,8 +107,8 @@ BOOL LLPanelVolume::postBuild() childSetCommitCallback("Light Checkbox Ctrl",onCommitIsLight,this); LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch){ - LightColorSwatch->setOnCancelCallback(onLightCancelColor); - LightColorSwatch->setOnSelectCallback(onLightSelectColor); + LightColorSwatch->setOnCancelCallback(boost::bind(&LLPanelVolume::onLightCancelColor, this, _2)); + LightColorSwatch->setOnSelectCallback(boost::bind(&LLPanelVolume::onLightSelectColor, this, _2)); childSetCommitCallback("colorswatch",onCommitLight,this); } childSetCommitCallback("Light Intensity",onCommitLight,this); @@ -125,8 +125,8 @@ BOOL LLPanelVolume::postBuild() return TRUE; } -LLPanelVolume::LLPanelVolume(const std::string& name) - : LLPanel(name) +LLPanelVolume::LLPanelVolume() + : LLPanel() { setMouseOpaque(FALSE); @@ -317,7 +317,7 @@ void LLPanelVolume::getState( ) } // static -BOOL LLPanelVolume::precommitValidate( LLUICtrl* ctrl, void* userdata ) +bool LLPanelVolume::precommitValidate( const LLSD& data ) { // TODO: Richard will fill this in later. return TRUE; // FALSE means that validation failed and new value should not be commited. @@ -427,21 +427,19 @@ void LLPanelVolume::sendIsFlexible() llinfos << "update flexible sent" << llendl; } -void LLPanelVolume::onLightCancelColor(LLUICtrl* ctrl, void* userdata) +void LLPanelVolume::onLightCancelColor(const LLSD& data) { - LLPanelVolume* self = (LLPanelVolume*) userdata; - LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch"); + LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) { - LightColorSwatch->setColor(self->mLightSavedColor); + LightColorSwatch->setColor(mLightSavedColor); } - onLightSelectColor(NULL, userdata); + onLightSelectColor(data); } -void LLPanelVolume::onLightSelectColor(LLUICtrl* ctrl, void* userdata) +void LLPanelVolume::onLightSelectColor(const LLSD& data) { - LLPanelVolume* self = (LLPanelVolume*) userdata; - LLViewerObject* objectp = self->mObject; + LLViewerObject* objectp = mObject; if (!objectp || (objectp->getPCode() != LL_PCODE_VOLUME)) { return; @@ -449,13 +447,13 @@ void LLPanelVolume::onLightSelectColor(LLUICtrl* ctrl, void* userdata) LLVOVolume *volobjp = (LLVOVolume *)objectp; - LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch"); + LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) { LLColor4 clr = LightColorSwatch->get(); LLColor3 clr3( clr ); volobjp->setLightColor(clr3); - self->mLightSavedColor = clr; + mLightSavedColor = clr; } } diff --git a/indra/newview/llpanelvolume.h b/indra/newview/llpanelvolume.h index 841880b147d704b3a9dc51b145df1e28a3fd56ea..f285141bbee35e9bf1c86fa33567ae673c158242 100644 --- a/indra/newview/llpanelvolume.h +++ b/indra/newview/llpanelvolume.h @@ -35,7 +35,7 @@ #include "v3math.h" #include "llpanel.h" -#include "llmemory.h" +#include "llpointer.h" #include "llvolume.h" class LLSpinCtrl; @@ -51,7 +51,7 @@ class LLColorSwatchCtrl; class LLPanelVolume : public LLPanel { public: - LLPanelVolume(const std::string& name); + LLPanelVolume(); virtual ~LLPanelVolume(); virtual void draw(); @@ -64,15 +64,15 @@ public: void sendIsLight(); void sendIsFlexible(); - static BOOL precommitValidate(LLUICtrl* ctrl,void* userdata); + static bool precommitValidate(const LLSD& data); static void onCommitIsLight( LLUICtrl* ctrl, void* userdata); static void onCommitLight( LLUICtrl* ctrl, void* userdata); static void onCommitIsFlexible( LLUICtrl* ctrl, void* userdata); static void onCommitFlexible( LLUICtrl* ctrl, void* userdata); - static void onLightCancelColor(LLUICtrl* ctrl, void* userdata); - static void onLightSelectColor(LLUICtrl* ctrl, void* userdata); + void onLightCancelColor(const LLSD& data); + void onLightSelectColor(const LLSD& data); protected: void getState(); diff --git a/indra/newview/llparcelselection.h b/indra/newview/llparcelselection.h index 5f26fafc33dcfdde13128b5994a16f855b300caf..0481bea6f70055c4342da892c7fe24fa7577846a 100644 --- a/indra/newview/llparcelselection.h +++ b/indra/newview/llparcelselection.h @@ -33,7 +33,8 @@ #ifndef LLPARCELSELECTION_H #define LLPARCELSELECTION_H -#include "llmemory.h" +#include "llrefcount.h" +#include "llsafehandle.h" class LLParcel; diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 6d7082bf9a627fae0aa98595e5d9e805a9f68141..64713108aff4c4e0671848f4d692e17a49bd00c4 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -34,11 +34,13 @@ #include "stdenums.h" #include "llpreview.h" + #include "lllineeditor.h" #include "llinventory.h" #include "llinventorymodel.h" #include "llresmgr.h" #include "lltextbox.h" +#include "llfloaterreg.h" #include "llfocusmgr.h" #include "lltooldraganddrop.h" #include "llradiogroup.h" @@ -47,129 +49,72 @@ #include "llviewerobjectlist.h" #include "lldbstrings.h" #include "llagent.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llselectmgr.h" #include "llinventoryview.h" #include "llviewerinventory.h" +#include "llviewerwindow.h" +#include "lltrans.h" // Constants -// Globals and statics -LLPreview::preview_multimap_t LLPreview::sPreviewsBySource; -LLPreview::preview_map_t LLPreview::sInstances; -std::map<LLUUID, LLHandle<LLFloater> > LLMultiPreview::sAutoOpenPreviewHandles; - -// Functions -LLPreview::LLPreview(const std::string& name) : - LLFloater(name), - mCopyToInvBtn(NULL), +LLPreview::LLPreview(const LLSD& key) +: LLFloater(key), + mItemUUID(key.asUUID()), + mCopyToInvBtn( NULL ), mForceClose(FALSE), mUserResized(FALSE), mCloseAfterSave(FALSE), mAssetStatus(PREVIEW_ASSET_UNLOADED), - mItem(NULL), mDirty(TRUE) { - // don't add to instance list, since ItemID is null - mAuxItem = new LLInventoryItem; // (LLPointer is auto-deleted) + mAuxItem = new LLInventoryItem; // don't necessarily steal focus on creation -- sometimes these guys pop up without user action setAutoFocus(FALSE); + gInventory.addObserver(this); + + refreshFromItem(); } -LLPreview::LLPreview(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const LLUUID& object_uuid, BOOL allow_resize, S32 min_width, S32 min_height, LLPointer<LLViewerInventoryItem> inv_item ) -: LLFloater(name, rect, title, allow_resize, min_width, min_height ), - mItemUUID(item_uuid), - mSourceID(LLUUID::null), - mObjectUUID(object_uuid), - mCopyToInvBtn( NULL ), - mForceClose( FALSE ), - mUserResized(FALSE), - mCloseAfterSave(FALSE), - mAssetStatus(PREVIEW_ASSET_UNLOADED), - mItem(inv_item), - mDirty(TRUE) +BOOL LLPreview::postBuild() { - mAuxItem = new LLInventoryItem; - // don't necessarily steal focus on creation -- sometimes these guys pop up without user action - setAutoFocus(FALSE); - - if (mItemUUID.notNull()) - { - sInstances[mItemUUID] = this; - } - gInventory.addObserver(this); + refreshFromItem(); + return TRUE; } LLPreview::~LLPreview() { gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() - - if (mItemUUID.notNull()) - { - sInstances.erase( mItemUUID ); - } - - if (mSourceID.notNull()) - { - preview_multimap_t::iterator found_it = sPreviewsBySource.find(mSourceID); - for (; found_it != sPreviewsBySource.end(); ++found_it) - { - if (found_it->second == getHandle()) - { - sPreviewsBySource.erase(found_it); - break; - } - } - } gInventory.removeObserver(this); } -void LLPreview::setItemID(const LLUUID& item_id) -{ - if (mItemUUID.notNull()) - { - sInstances.erase(mItemUUID); - } - - mItemUUID = item_id; - - if (mItemUUID.notNull()) - { - sInstances[mItemUUID] = this; - } -} - void LLPreview::setObjectID(const LLUUID& object_id) { mObjectUUID = object_id; + if (getAssetStatus() == PREVIEW_ASSET_UNLOADED) + { + loadAsset(); + } } -void LLPreview::setSourceID(const LLUUID& source_id) +void LLPreview::setItem( LLInventoryItem* item ) { - if (mSourceID.notNull()) + mItem = item; + if (mItem && getAssetStatus() == PREVIEW_ASSET_UNLOADED) { - // erase old one - preview_multimap_t::iterator found_it = sPreviewsBySource.find(mSourceID); - for (; found_it != sPreviewsBySource.end(); ++found_it) - { - if (found_it->second == getHandle()) - { - sPreviewsBySource.erase(found_it); - break; - } - } + loadAsset(); } - mSourceID = source_id; - sPreviewsBySource.insert(preview_multimap_t::value_type(mSourceID, getHandle())); } -const LLViewerInventoryItem *LLPreview::getItem() const +const LLInventoryItem *LLPreview::getItem() const { - if(mItem) - return mItem; - const LLViewerInventoryItem *item = NULL; - if(mObjectUUID.isNull()) + const LLInventoryItem *item = NULL; + if (mItem.notNull()) + { + item = mItem; + } + else if (mObjectUUID.isNull()) { // it's an inventory item, so get the item. item = gInventory.getItem(mItemUUID); @@ -180,7 +125,7 @@ const LLViewerInventoryItem *LLPreview::getItem() const LLViewerObject* object = gObjectList.findObject(mObjectUUID); if(object) { - item = (LLViewerInventoryItem*)object->getInventoryObject(mItemUUID); + item = dynamic_cast<LLInventoryItem*>(object->getInventoryObject(mItemUUID)); } } return item; @@ -189,7 +134,7 @@ const LLViewerInventoryItem *LLPreview::getItem() const // Sub-classes should override this function if they allow editing void LLPreview::onCommit() { - const LLViewerInventoryItem *item = getItem(); + const LLViewerInventoryItem *item = dynamic_cast<const LLViewerInventoryItem*>(getItem()); if(item) { if (!item->isComplete()) @@ -226,7 +171,7 @@ void LLPreview::onCommit() // update the object itself. if( item->getType() == LLAssetType::AT_OBJECT ) { - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if( avatar ) { LLViewerObject* obj = avatar->getWornAttachment( item->getUUID() ); @@ -255,17 +200,24 @@ void LLPreview::draw() if (mDirty) { mDirty = FALSE; - const LLViewerInventoryItem *item = getItem(); - if (item) - { - refreshFromItem(item); - } + refreshFromItem(); } } -void LLPreview::refreshFromItem(const LLInventoryItem* item) +void LLPreview::refreshFromItem() { - setTitle(llformat("%s: %s",getTitleName(),item->getName().c_str())); + const LLInventoryItem* item = getItem(); + if (!item) + { + return; + } + if (hasString("Title")) + { + LLStringUtil::format_map_t args; + args["[NAME]"] = item->getName(); + LLUIString title = getString("Title", args); + setTitle(title.getString()); + } childSetText("desc",item->getDescription()); BOOL can_agent_manipulate = item->getPermissions().allowModifyBy(gAgent.getID()); @@ -286,81 +238,33 @@ void LLPreview::onRadio(LLUICtrl*, void* userdata) self->onCommit(); } -// static -LLPreview* LLPreview::find(const LLUUID& item_uuid) -{ - LLPreview* instance = NULL; - preview_map_t::iterator found_it = LLPreview::sInstances.find(item_uuid); - if(found_it != LLPreview::sInstances.end()) - { - instance = found_it->second; - } - return instance; -} - -// static -LLPreview* LLPreview::show( const LLUUID& item_uuid, BOOL take_focus ) -{ - LLPreview* instance = LLPreview::find(item_uuid); - if(instance) - { - if (LLFloater::getFloaterHost() && LLFloater::getFloaterHost() != instance->getHost()) - { - // this preview window is being opened in a new context - // needs to be rehosted - LLFloater::getFloaterHost()->addFloater(instance, TRUE); - } - instance->open(); /*Flawfinder: ignore*/ - if (take_focus) - { - instance->setFocus(TRUE); - } - } - - return instance; -} - -// static -bool LLPreview::save( const LLUUID& item_uuid, LLPointer<LLInventoryItem>* itemptr ) -{ - bool res = false; - LLPreview* instance = LLPreview::find(item_uuid); - if(instance) - { - res = instance->saveItem(itemptr); - } - if (!res) - { - delete itemptr; - } - return res; -} - // static void LLPreview::hide(const LLUUID& item_uuid, BOOL no_saving /* = FALSE */ ) { - preview_map_t::iterator found_it = LLPreview::sInstances.find(item_uuid); - if(found_it != LLPreview::sInstances.end()) + LLFloater* floater = LLFloaterReg::findInstance("preview", LLSD(item_uuid)); + if (!floater) floater = LLFloaterReg::findInstance("preview_avatar", LLSD(item_uuid)); + + LLPreview* preview = dynamic_cast<LLPreview*>(floater); + if (preview) { - LLPreview* instance = found_it->second; - if ( no_saving ) { - instance->mForceClose = TRUE; + preview->mForceClose = TRUE; } - - instance->close(); + preview->closeFloater(); } } // static -void LLPreview::rename(const LLUUID& item_uuid, const std::string& new_name) +void LLPreview::dirty(const LLUUID& item_uuid) { - preview_map_t::iterator found_it = LLPreview::sInstances.find(item_uuid); - if(found_it != LLPreview::sInstances.end()) + LLFloater* floater = LLFloaterReg::findInstance("preview", LLSD(item_uuid)); + if (!floater) floater = LLFloaterReg::findInstance("preview_avatar", LLSD(item_uuid)); + + LLPreview* preview = dynamic_cast<LLPreview*>(floater); + if(preview) { - LLPreview* instance = found_it->second; - instance->setTitle( new_name ); + preview->mDirty = TRUE; } } @@ -397,7 +301,7 @@ BOOL LLPreview::handleHover(S32 x, S32 y, MASK mask) { S32 screen_x; S32 screen_y; - const LLViewerInventoryItem *item = getItem(); + const LLInventoryItem *item = getItem(); localPointToScreen(x, y, &screen_x, &screen_y ); if(item @@ -426,22 +330,14 @@ BOOL LLPreview::handleHover(S32 x, S32 y, MASK mask) return LLFloater::handleHover(x,y,mask); } -void LLPreview::open() /*Flawfinder: ignore*/ +void LLPreview::onOpen(const LLSD& key) { if (!getFloaterHost() && !getHost() && getAssetStatus() == PREVIEW_ASSET_UNLOADED) { loadAsset(); } - LLFloater::open(); /*Flawfinder: ignore*/ -} - -// virtual -bool LLPreview::saveItem(LLPointer<LLInventoryItem>* itemptr) -{ - return false; } - // static void LLPreview::onBtnCopyToInv(void* userdata) { @@ -468,14 +364,14 @@ void LLPreview::onBtnCopyToInv(void* userdata) cb); } } - self->close(); + self->closeFloater(); } // static void LLPreview::onKeepBtn(void* data) { LLPreview* self = (LLPreview*)data; - self->close(); + self->closeFloater(); } // static @@ -483,11 +379,11 @@ void LLPreview::onDiscardBtn(void* data) { LLPreview* self = (LLPreview*)data; - const LLViewerInventoryItem* item = self->getItem(); + const LLInventoryItem* item = self->getItem(); if (!item) return; self->mForceClose = TRUE; - self->close(); + self->closeFloater(); // Delete the item entirely /* @@ -517,55 +413,60 @@ void LLPreview::onDiscardBtn(void* data) } } -//static -LLPreview* LLPreview::getFirstPreviewForSource(const LLUUID& source_id) +void LLPreview::handleReshape(const LLRect& new_rect, bool by_user) { - preview_multimap_t::iterator found_it = sPreviewsBySource.find(source_id); - if (found_it != sPreviewsBySource.end()) - { - // just return first one - return (LLPreview*)found_it->second.get(); - } - return NULL; -} - -void LLPreview::userSetShape(const LLRect& new_rect) -{ - if(new_rect.getWidth() != getRect().getWidth() || new_rect.getHeight() != getRect().getHeight()) + if(by_user + && (new_rect.getWidth() != getRect().getWidth() || new_rect.getHeight() != getRect().getHeight())) { userResized(); } - LLFloater::userSetShape(new_rect); + LLFloater::handleReshape(new_rect, by_user); } // // LLMultiPreview // -LLMultiPreview::LLMultiPreview(const LLRect& rect) : LLMultiFloater(std::string("Preview"), rect) +LLMultiPreview::LLMultiPreview() + : LLMultiFloater() { + // *TODO: There should be a .xml file for this + const LLRect& nextrect = LLFloaterReg::getFloaterRect("preview"); // place where the next preview should show up + if (nextrect.getWidth() > 0) + { + setRect(nextrect); + } + else + { + // start with a rect in the top-left corner ; will get resized + LLRect rect; + rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeight(), 200, 200); + setRect(rect); + } + setTitle(LLTrans::getString("MultiPreviewTitle")); + buildTabContainer(); setCanResize(TRUE); } -void LLMultiPreview::open() /*Flawfinder: ignore*/ +void LLMultiPreview::onOpen(const LLSD& key) { - LLMultiFloater::open(); /*Flawfinder: ignore*/ LLPreview* frontmost_preview = (LLPreview*)mTabContainer->getCurrentPanel(); if (frontmost_preview && frontmost_preview->getAssetStatus() == LLPreview::PREVIEW_ASSET_UNLOADED) { frontmost_preview->loadAsset(); } + LLMultiFloater::onOpen(key); } -void LLMultiPreview::userSetShape(const LLRect& new_rect) +void LLMultiPreview::handleReshape(const LLRect& new_rect, bool by_user) { if(new_rect.getWidth() != getRect().getWidth() || new_rect.getHeight() != getRect().getHeight()) { LLPreview* frontmost_preview = (LLPreview*)mTabContainer->getCurrentPanel(); if (frontmost_preview) frontmost_preview->userResized(); } - LLFloater::userSetShape(new_rect); + LLFloater::handleReshape(new_rect, by_user); } @@ -578,22 +479,3 @@ void LLMultiPreview::tabOpen(LLFloater* opened_floater, bool from_click) } } -//static -LLMultiPreview* LLMultiPreview::getAutoOpenInstance(const LLUUID& id) -{ - handle_map_t::iterator found_it = sAutoOpenPreviewHandles.find(id); - if (found_it != sAutoOpenPreviewHandles.end()) - { - return (LLMultiPreview*)found_it->second.get(); - } - return NULL; -} - -//static -void LLMultiPreview::setAutoOpenInstance(LLMultiPreview* previewp, const LLUUID& id) -{ - if (previewp) - { - sAutoOpenPreviewHandles[id] = previewp->getHandle(); - } -} diff --git a/indra/newview/llpreview.h b/indra/newview/llpreview.h index ff084bea270be1ef25aa01654043f1a56f6f49ad..f6042f065bb3bbefb20be232982271913178b7f7 100644 --- a/indra/newview/llpreview.h +++ b/indra/newview/llpreview.h @@ -33,7 +33,7 @@ #ifndef LL_LLPREVIEW_H #define LL_LLPREVIEW_H -#include "llfloater.h" +#include "llmultifloater.h" #include "llresizehandle.h" #include "llmap.h" #include "lluuid.h" @@ -49,18 +49,12 @@ class LLPreview; class LLMultiPreview : public LLMultiFloater { public: - LLMultiPreview(const LLRect& rect); + LLMultiPreview(); - /*virtual*/void open(); /*Flawfinder: ignore*/ + /*virtual*/void onOpen(const LLSD& key); /*virtual*/void tabOpen(LLFloater* opened_floater, bool from_click); - /*virtual*/ void userSetShape(const LLRect& new_rect); + /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); - static LLMultiPreview* getAutoOpenInstance(const LLUUID& id); - static void setAutoOpenInstance(LLMultiPreview* previewp, const LLUUID& id); - -protected: - typedef std::map<LLUUID, LLHandle<LLFloater> > handle_map_t; - static handle_map_t sAutoOpenPreviewHandles; }; // https://wiki.lindenlab.com/mediawiki/index.php?title=LLPreview&oldid=81373 @@ -76,28 +70,24 @@ public: PREVIEW_ASSET_LOADED } EAssetStatus; public: - // Used for XML-based construction. - LLPreview(const std::string& name); - LLPreview(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const LLUUID& object_uuid, BOOL allow_resize = FALSE, S32 min_width = 0, S32 min_height = 0, LLPointer<LLViewerInventoryItem> inv_item = NULL ); + LLPreview(const LLSD& key ); virtual ~LLPreview(); - - void setItemID(const LLUUID& item_id); + + /*virtual*/ BOOL postBuild(); + void setObjectID(const LLUUID& object_id); - void setSourceID(const LLUUID& source_id); - const LLViewerInventoryItem *getItem() const; // searches if not constructed with it - - static LLPreview* find(const LLUUID& item_uuid); - static LLPreview* show(const LLUUID& item_uuid, BOOL take_focus = TRUE ); - static void hide(const LLUUID& item_uuid, BOOL no_saving = FALSE ); - static void rename(const LLUUID& item_uuid, const std::string& new_name); - static bool save(const LLUUID& item_uuid, LLPointer<LLInventoryItem>* itemptr); + void setItem( LLInventoryItem* item ); + + const LLInventoryItem* getItem() const; // searches if not constructed with it + static void hide(const LLUUID& item_uuid, BOOL no_saving = FALSE ); + static void dirty(const LLUUID& item_uuid); + virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual void open(); /*Flawfinder: ignore*/ - virtual bool saveItem(LLPointer<LLInventoryItem>* itemptr); - + virtual void onOpen(const LLSD& key); + void setAuxItem( const LLInventoryItem* item ) { if ( mAuxItem ) @@ -109,7 +99,7 @@ public: void addKeepDiscardButtons(); static void onKeepBtn(void* data); static void onDiscardBtn(void* data); - /*virtual*/ void userSetShape(const LLRect& new_rect); + /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); void userResized() { mUserResized = TRUE; }; @@ -122,7 +112,7 @@ public: // llview virtual void draw(); - void refreshFromItem(const LLInventoryItem* item); + void refreshFromItem(); protected: virtual void onCommit(); @@ -135,11 +125,9 @@ protected: // for LLInventoryObserver virtual void changed(U32 mask); BOOL mDirty; - virtual const char *getTitleName() const { return "Preview"; } protected: LLUUID mItemUUID; - LLUUID mSourceID; // mObjectID will have a value if it is associated with a task in // the world, and will be == LLUUID::null if it's in the agent @@ -149,6 +137,7 @@ protected: LLRect mClientRect; LLPointer<LLInventoryItem> mAuxItem; // HACK! + LLPointer<LLInventoryItem> mItem; // For embedded items (Landmarks) LLButton* mCopyToInvBtn; // Close without saving changes @@ -162,27 +151,18 @@ protected: EAssetStatus mAssetStatus; - typedef std::map<LLUUID, LLPreview*> preview_map_t; - typedef std::multimap<LLUUID, LLHandle<LLFloater> > preview_multimap_t; - - static preview_multimap_t sPreviewsBySource; - static preview_map_t sInstances; LLUUID mNotecardInventoryID; LLUUID mObjectID; - LLPointer<LLViewerInventoryItem> mItem; }; const S32 PREVIEW_BORDER = 4; const S32 PREVIEW_PAD = 5; -const S32 PREVIEW_BUTTON_WIDTH = 100; const S32 PREVIEW_LINE_HEIGHT = 19; -const S32 PREVIEW_CLOSE_BOX_SIZE = 16; const S32 PREVIEW_BORDER_WIDTH = 2; const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH; const S32 PREVIEW_VPAD = 2; -const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; const S32 PREVIEW_HEADER_SIZE = 2*PREVIEW_LINE_HEIGHT + 2 * PREVIEW_VPAD; #endif // LL_LLPREVIEW_H diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index 3212de0639b4581b8a79b41567ccb212dc6ac3aa..6857d14fff80cc25e300f9fef7bae3bf7019b191 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -37,7 +37,7 @@ #include "llresmgr.h" #include "llinventory.h" #include "llinventoryview.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llagent.h" // gAgent #include "llkeyframemotion.h" #include "llfilepicker.h" @@ -47,42 +47,54 @@ extern LLAgent gAgent; -LLPreviewAnim::LLPreviewAnim(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const S32& activate, const LLUUID& object_uuid ) : - LLPreview( name, rect, title, item_uuid, object_uuid) +LLPreviewAnim::LLPreviewAnim(const LLSD& key) + : LLPreview( key ) { - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_animation.xml"); - - childSetAction("Anim play btn",playAnim,this); - childSetAction("Anim audition btn",auditionAnim,this); - - const LLInventoryItem* item = getItem(); - - childSetCommitCallback("desc", LLPreview::onText, this); - childSetText("desc", item->getDescription()); - childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); - - setTitle(title); + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_animation.xml", FALSE); +} - if (!getHost()) +// static +void LLPreviewAnim::endAnimCallback( void *userdata ) +{ + LLHandle<LLFloater>* handlep = ((LLHandle<LLFloater>*)userdata); + LLFloater* self = handlep->get(); + delete handlep; // done with the handle + if (self) { - LLRect curRect = getRect(); - translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop); + self->childSetValue("Anim play btn", FALSE); + self->childSetValue("Anim audition btn", FALSE); } +} - // preload the animation +// virtual +BOOL LLPreviewAnim::postBuild() +{ + const LLInventoryItem* item = getItem(); if(item) { - gAgent.getAvatarObject()->createMotion(item->getAssetUUID()); + gAgent.getAvatarObject()->createMotion(item->getAssetUUID()); // preload the animation + childSetText("desc", item->getDescription()); } + + childSetAction("Anim play btn",playAnim, this); + childSetAction("Anim audition btn",auditionAnim, this); + + childSetCommitCallback("desc", LLPreview::onText, this); + childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); - switch ( activate ) + return LLPreview::postBuild(); +} + +void LLPreviewAnim::activate(e_activation_type type) +{ + switch ( type ) { - case 1: + case PLAY: { playAnim( (void *) this ); break; } - case 2: + case AUDITION: { auditionAnim( (void *) this ); break; @@ -94,19 +106,6 @@ LLPreviewAnim::LLPreviewAnim(const std::string& name, const LLRect& rect, const } } -// static -void LLPreviewAnim::endAnimCallback( void *userdata ) -{ - LLHandle<LLFloater>* handlep = ((LLHandle<LLFloater>*)userdata); - LLFloater* self = handlep->get(); - delete handlep; // done with the handle - if (self) - { - self->childSetValue("Anim play btn", FALSE); - self->childSetValue("Anim audition btn", FALSE); - } -} - // static void LLPreviewAnim::playAnim( void *userdata ) { diff --git a/indra/newview/llpreviewanim.h b/indra/newview/llpreviewanim.h index fe794d4283de893b4f501db47e81493b5fbc7737..ca42b7e731d26e68e671a9423364430013344120 100644 --- a/indra/newview/llpreviewanim.h +++ b/indra/newview/llpreviewanim.h @@ -39,18 +39,17 @@ class LLPreviewAnim : public LLPreview { public: - LLPreviewAnim(const std::string& name, const LLRect& rect, const std::string& title, - const LLUUID& item_uuid, - const S32& activate, - const LLUUID& object_uuid = LLUUID::null); + enum e_activation_type { NONE = 0, PLAY = 1, AUDITION = 2 }; + LLPreviewAnim(const LLSD& key); static void playAnim( void* userdata ); static void auditionAnim( void* userdata ); static void endAnimCallback( void *userdata ); - + /*virtual*/ BOOL postBuild(); + void activate(e_activation_type type); + protected: virtual void onClose(bool app_quitting); - virtual const char *getTitleName() const { return "Animation"; } LLAnimPauseRequest mPauseRequest; LLUUID mItemID; diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 76a9b80645db8e155c9d293cf62eae837053cf3a..dc6ee44936f4b804e4d36a3e8faa8514539d0009 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -41,11 +41,13 @@ #include "lldarray.h" #include "llstring.h" #include "lldir.h" +#include "llfloaterreg.h" #include "llmultigesture.h" #include "llvfile.h" // newview #include "llagent.h" // todo: remove +#include "llanimationstates.h" #include "llassetuploadresponders.h" #include "llbutton.h" #include "llcheckboxctrl.h" @@ -59,6 +61,8 @@ #include "llnotify.h" #include "llradiogroup.h" #include "llscrolllistctrl.h" +#include "llscrolllistitem.h" +#include "llscrolllistcell.h" #include "lltextbox.h" #include "lluictrlfactory.h" #include "llviewerinventory.h" @@ -67,15 +71,16 @@ #include "llviewerregion.h" #include "llviewerstats.h" #include "llviewerwindow.h" // busycount +#include "llvoavatarself.h" #include "llappviewer.h" // gVFS #include "llanimstatelabels.h" #include "llresmgr.h" +#include "lltrans.h" -// *TODO: Translate? -const std::string NONE_LABEL = "---"; -const std::string SHIFT_LABEL = "Shift"; -const std::string CTRL_LABEL = "Ctrl"; +std::string NONE_LABEL; +std::string SHIFT_LABEL; +std::string CTRL_LABEL; void dialog_refresh_all(); @@ -92,12 +97,9 @@ protected: void LLInventoryGestureAvailable::done() { - LLPreview* preview = NULL; - item_ref_t::iterator it = mComplete.begin(); - item_ref_t::iterator end = mComplete.end(); - for(; it < end; ++it) + for(item_ref_t::iterator it = mComplete.begin(); it != mComplete.end(); ++it) { - preview = LLPreview::find((*it)); + LLPreviewGesture* preview = LLFloaterReg::findTypedInstance<LLPreviewGesture>("preview_gesture", *it); if(preview) { preview->refresh(); @@ -117,43 +119,16 @@ struct SortItemPtrsByName }; // static -LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID& item_id, const LLUUID& object_id, BOOL take_focus) +LLPreviewGesture* LLPreviewGesture::show(const LLUUID& item_id, const LLUUID& object_id) { - LLPreviewGesture* previewp = (LLPreviewGesture*)LLPreview::find(item_id); - if (previewp) + LLPreviewGesture* preview = LLFloaterReg::showTypedInstance<LLPreviewGesture>("preview_gesture", LLSD(item_id), TAKE_FOCUS_YES); + if (!preview) { - previewp->open(); /*Flawfinder: ignore*/ - if (take_focus) - { - previewp->setFocus(TRUE); - } - return previewp; - } - - LLPreviewGesture* self = new LLPreviewGesture(); - - // Finish internal construction - self->init(item_id, object_id); - - // Builds and adds to gFloaterView - LLUICtrlFactory::getInstance()->buildFloater(self, "floater_preview_gesture.xml"); - self->setTitle(title); - - // Move window to top-left of screen - LLMultiFloater* hostp = self->getHost(); - if (hostp == NULL) - { - LLRect r = self->getRect(); - LLRect screen = gFloaterView->getRect(); - r.setLeftTopAndSize(0, screen.getHeight(), r.getWidth(), r.getHeight()); - self->setRect(r); - } - else - { - // re-add to host to update title - hostp->addFloater(self, TRUE); + return NULL; } - + + preview->setObjectID(object_id); + // Start speculative download of sounds and animations LLUUID animation_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_ANIMATION); gInventory.startBackgroundFetch(animation_folder_id); @@ -162,8 +137,8 @@ LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID& gInventory.startBackgroundFetch(sound_folder_id); // this will call refresh when we have everything. - LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->getItem(); - if(item && !item->isComplete()) + LLViewerInventoryItem* item = (LLViewerInventoryItem*)preview->getItem(); + if (item && !item->isComplete()) { LLInventoryGestureAvailable* observer; observer = new LLInventoryGestureAvailable(); @@ -174,18 +149,12 @@ LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID& else { // not sure this is necessary. - self->refresh(); - } - - if (take_focus) - { - self->setFocus(TRUE); + preview->refresh(); } - return self; + return preview; } - // virtual BOOL LLPreviewGesture::handleKeyHere(KEY key, MASK mask) { @@ -334,7 +303,7 @@ bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const L case 1: // "No" gGestureManager.stopGesture(mPreviewGesture); mDirty = FALSE; // Force the dirty flag because user has clicked NO on confirm save dialog... - close(); + closeFloater(); break; case 2: // "Cancel" @@ -347,8 +316,8 @@ bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const L } -LLPreviewGesture::LLPreviewGesture() -: LLPreview("Gesture Preview"), +LLPreviewGesture::LLPreviewGesture(const LLSD& key) +: LLPreview(key), mTriggerEditor(NULL), mModifierCombo(NULL), mKeyCombo(NULL), @@ -368,6 +337,12 @@ LLPreviewGesture::LLPreviewGesture() mPreviewGesture(NULL), mDirty(FALSE) { + NONE_LABEL = LLTrans::getString("---"); + SHIFT_LABEL = LLTrans::getString("KBShift"); + CTRL_LABEL = LLTrans::getString("KBCtrl"); + + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_gesture.xml", FALSE); + } @@ -396,10 +371,9 @@ BOOL LLPreviewGesture::postBuild() LLCheckBoxCtrl* check; edit = getChild<LLLineEditor>("trigger_editor"); - edit->setKeystrokeCallback(onKeystrokeCommit); - edit->setCommitCallback(onCommitSetDirty); + edit->setKeystrokeCallback(onKeystrokeCommit, this); + edit->setCommitCallback(onCommitSetDirty, this); edit->setCommitOnFocusLost(TRUE); - edit->setCallbackUserData(this); edit->setIgnoreTab(TRUE); mTriggerEditor = edit; @@ -409,56 +383,47 @@ BOOL LLPreviewGesture::postBuild() edit = getChild<LLLineEditor>("replace_editor"); edit->setEnabled(FALSE); - edit->setKeystrokeCallback(onKeystrokeCommit); - edit->setCommitCallback(onCommitSetDirty); + edit->setKeystrokeCallback(onKeystrokeCommit, this); + edit->setCommitCallback(onCommitSetDirty, this); edit->setCommitOnFocusLost(TRUE); - edit->setCallbackUserData(this); edit->setIgnoreTab(TRUE); mReplaceEditor = edit; combo = getChild<LLComboBox>( "modifier_combo"); - combo->setCommitCallback(onCommitSetDirty); - combo->setCallbackUserData(this); + combo->setCommitCallback(onCommitSetDirty, this); mModifierCombo = combo; combo = getChild<LLComboBox>( "key_combo"); - combo->setCommitCallback(onCommitSetDirty); - combo->setCallbackUserData(this); + combo->setCommitCallback(onCommitSetDirty, this); mKeyCombo = combo; list = getChild<LLScrollListCtrl>("library_list"); - list->setCommitCallback(onCommitLibrary); - list->setDoubleClickCallback(onClickAdd); - list->setCallbackUserData(this); + list->setCommitCallback(onCommitLibrary, this); + list->setDoubleClickCallback(onClickAdd, this); mLibraryList = list; btn = getChild<LLButton>( "add_btn"); - btn->setClickedCallback(onClickAdd); - btn->setCallbackUserData(this); + btn->setClickedCallback(onClickAdd, this); btn->setEnabled(FALSE); mAddBtn = btn; btn = getChild<LLButton>( "up_btn"); - btn->setClickedCallback(onClickUp); - btn->setCallbackUserData(this); + btn->setClickedCallback(onClickUp, this); btn->setEnabled(FALSE); mUpBtn = btn; btn = getChild<LLButton>( "down_btn"); - btn->setClickedCallback(onClickDown); - btn->setCallbackUserData(this); + btn->setClickedCallback(onClickDown, this); btn->setEnabled(FALSE); mDownBtn = btn; btn = getChild<LLButton>( "delete_btn"); - btn->setClickedCallback(onClickDelete); - btn->setCallbackUserData(this); + btn->setClickedCallback(onClickDelete, this); btn->setEnabled(FALSE); mDeleteBtn = btn; list = getChild<LLScrollListCtrl>("step_list"); - list->setCommitCallback(onCommitStep); - list->setCallbackUserData(this); + list->setCommitCallback(onCommitStep, this); mStepList = list; // Options @@ -468,69 +433,59 @@ BOOL LLPreviewGesture::postBuild() combo = getChild<LLComboBox>( "animation_list"); combo->setVisible(FALSE); - combo->setCommitCallback(onCommitAnimation); - combo->setCallbackUserData(this); + combo->setCommitCallback(onCommitAnimation, this); mAnimationCombo = combo; LLRadioGroup* group; group = getChild<LLRadioGroup>("animation_trigger_type"); group->setVisible(FALSE); - group->setCommitCallback(onCommitAnimationTrigger); - group->setCallbackUserData(this); + group->setCommitCallback(onCommitAnimationTrigger, this); mAnimationRadio = group; combo = getChild<LLComboBox>( "sound_list"); combo->setVisible(FALSE); - combo->setCommitCallback(onCommitSound); - combo->setCallbackUserData(this); + combo->setCommitCallback(onCommitSound, this); mSoundCombo = combo; edit = getChild<LLLineEditor>("chat_editor"); edit->setVisible(FALSE); - edit->setCommitCallback(onCommitChat); - //edit->setKeystrokeCallback(onKeystrokeCommit); + edit->setCommitCallback(onCommitChat, this); + //edit->setKeystrokeCallback(onKeystrokeCommit, this); edit->setCommitOnFocusLost(TRUE); - edit->setCallbackUserData(this); edit->setIgnoreTab(TRUE); mChatEditor = edit; check = getChild<LLCheckBoxCtrl>( "wait_anim_check"); check->setVisible(FALSE); - check->setCommitCallback(onCommitWait); - check->setCallbackUserData(this); + check->setCommitCallback(onCommitWait, this); mWaitAnimCheck = check; check = getChild<LLCheckBoxCtrl>( "wait_time_check"); check->setVisible(FALSE); - check->setCommitCallback(onCommitWait); - check->setCallbackUserData(this); + check->setCommitCallback(onCommitWait, this); mWaitTimeCheck = check; edit = getChild<LLLineEditor>("wait_time_editor"); edit->setEnabled(FALSE); edit->setVisible(FALSE); edit->setPrevalidate(LLLineEditor::prevalidateFloat); -// edit->setKeystrokeCallback(onKeystrokeCommit); +// edit->setKeystrokeCallback(onKeystrokeCommit, this); edit->setCommitOnFocusLost(TRUE); - edit->setCommitCallback(onCommitWaitTime); - edit->setCallbackUserData(this); + edit->setCommitCallback(onCommitWaitTime, this); edit->setIgnoreTab(TRUE); mWaitTimeEditor = edit; // Buttons at the bottom check = getChild<LLCheckBoxCtrl>( "active_check"); - check->setCommitCallback(onCommitActive); - check->setCallbackUserData(this); + check->setCommitCallback(onCommitActive, this); mActiveCheck = check; btn = getChild<LLButton>( "save_btn"); - btn->setClickedCallback(onClickSave); - btn->setCallbackUserData(this); + btn->setClickedCallback(onClickSave, this); mSaveBtn = btn; btn = getChild<LLButton>( "preview_btn"); - btn->setClickedCallback(onClickPreview); - btn->setCallbackUserData(this); + btn->setClickedCallback(onClickPreview, this); mPreviewBtn = btn; @@ -540,7 +495,6 @@ BOOL LLPreviewGesture::postBuild() addAnimations(); addSounds(); - const LLInventoryItem* item = getItem(); if (item) @@ -550,7 +504,7 @@ BOOL LLPreviewGesture::postBuild() childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); } - return TRUE; + return LLPreview::postBuild(); } @@ -680,16 +634,9 @@ void LLPreviewGesture::addSounds() } -void LLPreviewGesture::init(const LLUUID& item_id, const LLUUID& object_id) -{ - // Sets ID and adds to instance list - setItemID(item_id); - setObjectID(object_id); -} - - void LLPreviewGesture::refresh() { + LLPreview::refresh(); // If previewing or item is incomplete, all controls are disabled LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem(); bool is_complete = (item && item->isComplete()) ? true : false; @@ -850,7 +797,7 @@ void LLPreviewGesture::initDefaultGesture() item = addStep( STEP_ANIMATION ); LLGestureStepAnimation* anim = (LLGestureStepAnimation*)item->getUserdata(); anim->mAnimAssetID = ANIM_AGENT_HELLO; - anim->mAnimName = "Wave"; + anim->mAnimName = LLTrans::getString("Wave"); updateLabel(item); item = addStep( STEP_WAIT ); @@ -860,7 +807,7 @@ void LLPreviewGesture::initDefaultGesture() item = addStep( STEP_CHAT ); LLGestureStepChat* chat_step = (LLGestureStepChat*)item->getUserdata(); - chat_step->mChatText = "Hello, avatar!"; + chat_step->mChatText = LLTrans::getString("HelloAvatar"); updateLabel(item); // Start with item list selected @@ -874,7 +821,11 @@ void LLPreviewGesture::initDefaultGesture() void LLPreviewGesture::loadAsset() { const LLInventoryItem* item = getItem(); - if (!item) return; + if (!item) + { + mAssetStatus = PREVIEW_ASSET_ERROR; + return; + } LLUUID asset_id = item->getAssetUUID(); if (asset_id.isNull()) @@ -883,6 +834,7 @@ void LLPreviewGesture::loadAsset() // Blank gesture will be fine. initDefaultGesture(); refresh(); + mAssetStatus = PREVIEW_ASSET_LOADED; return; } @@ -910,11 +862,10 @@ void LLPreviewGesture::onLoadComplete(LLVFS *vfs, void* user_data, S32 status, LLExtStat ext_status) { LLUUID* item_idp = (LLUUID*)user_data; - LLPreview* preview = LLPreview::find(*item_idp); - if (preview) - { - LLPreviewGesture* self = (LLPreviewGesture*)preview; + LLPreviewGesture* self = LLFloaterReg::findTypedInstance<LLPreviewGesture>("preview_gesture", *item_idp); + if (self) + { if (0 == status) { LLVFile file(vfs, asset_uuid, type, LLVFile::READ); @@ -1016,7 +967,7 @@ void LLPreviewGesture::loadUIFromGesture(LLMultiGesture* gesture) LLGestureStep* step = gesture->mSteps[i]; LLGestureStep* new_step = NULL; - + switch(step->getType()) { case STEP_ANIMATION: @@ -1061,7 +1012,7 @@ void LLPreviewGesture::loadUIFromGesture(LLMultiGesture* gesture) // Create an enabled item with this step LLSD row; - row["columns"][0]["value"] = new_step->getLabel(); + row["columns"][0]["value"] = getLabel( new_step->getLabel()); row["columns"][0]["font"] = "SANSSERIF_SMALL"; LLScrollListItem* item = mStepList->addElement(row); item->setUserdata(new_step); @@ -1262,10 +1213,10 @@ void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data, } // Find our window and close it if requested. - LLPreviewGesture* previewp = (LLPreviewGesture*)LLPreview::find(info->mItemUUID); + LLPreviewGesture* previewp = LLFloaterReg::findTypedInstance<LLPreviewGesture>("preview_gesture", info->mItemUUID); if (previewp && previewp->mCloseAfterSave) { - previewp->close(); + previewp->closeFloater(); } } else @@ -1374,7 +1325,7 @@ void LLPreviewGesture::updateLabel(LLScrollListItem* item) LLScrollListCell* cell = item->getColumn(0); LLScrollListText* text_cell = (LLScrollListText*)cell; - std::string label = step->getLabel(); + std::string label = getLabel( step->getLabel()); text_cell->setText(label); } @@ -1619,24 +1570,26 @@ LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type ) { case STEP_ANIMATION: step = new LLGestureStepAnimation(); + break; case STEP_SOUND: step = new LLGestureStepSound(); break; case STEP_CHAT: - step = new LLGestureStepChat(); + step = new LLGestureStepChat(); break; case STEP_WAIT: - step = new LLGestureStepWait(); + step = new LLGestureStepWait(); break; default: llerrs << "Unknown step type: " << (S32)step_type << llendl; return NULL; } + // Create an enabled item with this step LLSD row; - row["columns"][0]["value"] = step->getLabel(); + row["columns"][0]["value"] = getLabel(step->getLabel()); row["columns"][0]["font"] = "SANSSERIF_SMALL"; LLScrollListItem* step_item = mStepList->addElement(row); step_item->setUserdata(step); @@ -1650,6 +1603,42 @@ LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type ) return step_item; } +// static +std::string LLPreviewGesture::getLabel(std::vector<std::string> labels) +{ + std::vector<std::string> v_labels = labels ; + std::string result(""); + + if( v_labels.size() != 2) + { + return result; + } + + if(v_labels[0]=="Chat") + { + result=LLTrans::getString("Chat"); + } + else if(v_labels[0]=="Sound") + { + result=LLTrans::getString("Sound"); + } + else if(v_labels[0]=="Wait") + { + result=LLTrans::getString("Wait"); + } + else if(v_labels[0]=="AnimFlagStop") + { + result=LLTrans::getString("AnimFlagStop"); + } + else if(v_labels[0]=="AnimFlagStart") + { + result=LLTrans::getString("AnimFlagStart"); + } + + result.append(v_labels[1]); + return result; + +} // static void LLPreviewGesture::onClickUp(void* data) { diff --git a/indra/newview/llpreviewgesture.h b/indra/newview/llpreviewgesture.h index c245c0e8da5c841d47697db9a7d96c282275dcf8..d3e9c77789911e048502279fbd5f4dffb79aec5f 100644 --- a/indra/newview/llpreviewgesture.h +++ b/indra/newview/llpreviewgesture.h @@ -52,40 +52,38 @@ class LLPreviewGesture : public LLPreview public: // Pass an object_id if this gesture is inside an object in the world, // otherwise use LLUUID::null. - static LLPreviewGesture* show(const std::string& title, const LLUUID& item_id, const LLUUID& object_id, BOOL take_focus = TRUE); + static LLPreviewGesture* show(const LLUUID& item_id, const LLUUID& object_id); + + LLPreviewGesture(const LLSD& key); + virtual ~LLPreviewGesture(); // LLView - virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg); // LLPanel - virtual BOOL postBuild(); + /*virtual*/ BOOL postBuild(); // LLFloater - virtual BOOL canClose(); - virtual void setMinimized(BOOL minimize); - virtual void onClose(bool app_quitting); - virtual void onUpdateSucceeded(); + /*virtual*/ BOOL canClose(); + /*virtual*/ void setMinimized(BOOL minimize); + /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onUpdateSucceeded(); + /*virtual*/ void refresh(); + protected: - LLPreviewGesture(); - virtual ~LLPreviewGesture(); - - void init(const LLUUID& item_id, const LLUUID& object_id); - // Populate various comboboxes void addModifiers(); void addKeys(); void addAnimations(); void addSounds(); - void refresh(); - void initDefaultGesture(); void loadAsset(); @@ -112,6 +110,7 @@ protected: // "Sound", "Chat", or "Wait" LLScrollListItem* addStep(const enum EStepType step_type); + static std::string getLabel(std::vector<std::string> labels); static void updateLabel(LLScrollListItem* item); static void onCommitSetDirty(LLUICtrl* ctrl, void* data); @@ -139,8 +138,6 @@ protected: static void onDonePreview(LLMultiGesture* gesture, void* data); - virtual const char *getTitleName() const { return "Gesture"; } - protected: // LLPreview contains mDescEditor LLLineEditor* mTriggerEditor; diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 4abe390bc5478fd9722e3f2a532dfd6a9dd98680..f3d0dc538d5d881623b42eeebbd3ed4437daf22e 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -40,6 +40,7 @@ #include "llassetuploadresponders.h" #include "llviewerwindow.h" #include "llbutton.h" +#include "llfloaterreg.h" #include "llinventorymodel.h" #include "lllineeditor.h" #include "llnotify.h" @@ -61,122 +62,71 @@ #include "lllineeditor.h" #include "lluictrlfactory.h" -///---------------------------------------------------------------------------- -/// Local function declarations, constants, enums, and typedefs -///---------------------------------------------------------------------------- - -const S32 PREVIEW_MIN_WIDTH = - 2 * PREVIEW_BORDER + - 2 * PREVIEW_BUTTON_WIDTH + - PREVIEW_PAD + RESIZE_HANDLE_WIDTH + - PREVIEW_PAD; -const S32 PREVIEW_MIN_HEIGHT = - 2 * PREVIEW_BORDER + - 3*(20 + PREVIEW_PAD) + - 2 * SCROLLBAR_SIZE + 128; - ///---------------------------------------------------------------------------- /// Class LLPreviewNotecard ///---------------------------------------------------------------------------- // Default constructor -LLPreviewNotecard::LLPreviewNotecard(const std::string& name, - const LLRect& rect, - const std::string& title, - const LLUUID& item_id, - const LLUUID& object_id, - const LLUUID& asset_id, - BOOL show_keep_discard, - LLPointer<LLViewerInventoryItem> inv_item) : - LLPreview(name, rect, title, item_id, object_id, TRUE, - PREVIEW_MIN_WIDTH, - PREVIEW_MIN_HEIGHT, - inv_item), - mAssetID( asset_id ), - mNotecardItemID(item_id), - mObjectID(object_id) +LLPreviewNotecard::LLPreviewNotecard(const LLSD& key) //const LLUUID& item_id, + : LLPreview( key ) +{ + const LLInventoryItem *item = getItem(); + if (item) + { + mShowKeepDiscard = item->getPermissions().getCreator() != gAgent.getID(); + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_notecard.xml", FALSE); + mAssetID = item->getAssetUUID(); + } +} + +LLPreviewNotecard::~LLPreviewNotecard() { - LLRect curRect = rect; +} - if (show_keep_discard) +BOOL LLPreviewNotecard::postBuild() +{ + LLViewerTextEditor *ed = getChild<LLViewerTextEditor>("Notecard Editor"); + if (ed) + { + ed->setNotecardInfo(mItemUUID, mObjectID, getKey()); + ed->makePristine(); + } + if (mShowKeepDiscard) { - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_notecard_keep_discard.xml"); childSetAction("Keep",onKeepBtn,this); childSetAction("Discard",onDiscardBtn,this); } else { - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_notecard.xml"); - childSetAction("Save",onClickSave,this); - - if( mAssetID.isNull() ) - { - const LLInventoryItem* item = getItem(); - if( item ) - { - mAssetID = item->getAssetUUID(); - } - } - } - - // only assert shape if not hosted in a multifloater - if (!getHost()) - { - reshape(curRect.getWidth(), curRect.getHeight(), TRUE); - setRect(curRect); + getChild<LLButton>("Keep")->setLabel(getString("Save")); + childSetAction("Keep",onClickSave,this); + childSetVisible("Discard", false); } - + childSetVisible("lock", FALSE); - + const LLInventoryItem* item = getItem(); - + childSetCommitCallback("desc", LLPreview::onText, this); if (item) childSetText("desc", item->getDescription()); childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); - setTitle(title); - LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); if (editor) { editor->setWordWrap(TRUE); - editor->setSourceID(item_id); editor->setHandleEditKeysDirectly(TRUE); } - - gAgent.changeCameraToDefault(); -} - -LLPreviewNotecard::~LLPreviewNotecard() -{ -} - -BOOL LLPreviewNotecard::postBuild() -{ - LLViewerTextEditor *ed = getChild<LLViewerTextEditor>("Notecard Editor"); - if (ed) - { - ed->setNotecardInfo(mNotecardItemID, mObjectID); - ed->makePristine(); - } - return TRUE; + + return LLPreview::postBuild(); } -bool LLPreviewNotecard::saveItem(LLPointer<LLInventoryItem>* itemptr) +bool LLPreviewNotecard::saveItem() { - LLInventoryItem* item = NULL; - if (itemptr && itemptr->notNull()) - { - item = (LLInventoryItem*)(*itemptr); - } - bool res = saveIfNeeded(item); - if (res) - { - delete itemptr; - } - return res; + LLInventoryItem* item = gInventory.getItem(mItemUUID); + return saveIfNeeded(item); } void LLPreviewNotecard::setEnabled( BOOL enabled ) @@ -187,7 +137,7 @@ void LLPreviewNotecard::setEnabled( BOOL enabled ) childSetEnabled("Notecard Editor", enabled); childSetVisible("lock", !enabled); childSetEnabled("desc", enabled); - childSetEnabled("Save", enabled && editor && (!editor->isPristine())); + childSetEnabled("Keep", enabled && editor && (!editor->isPristine())); } @@ -195,13 +145,10 @@ void LLPreviewNotecard::setEnabled( BOOL enabled ) void LLPreviewNotecard::draw() { - - //childSetFocus("Save", FALSE); - LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); BOOL script_changed = !editor->isPristine(); - childSetEnabled("Save", script_changed && getEnabled()); + childSetEnabled("Keep", script_changed && getEnabled()); LLPreview::draw(); } @@ -255,8 +202,13 @@ bool LLPreviewNotecard::hasEmbeddedInventory() return editor->hasEmbeddedInventory(); } -void LLPreviewNotecard::refreshFromInventory() +void LLPreviewNotecard::refreshFromInventory(const LLUUID& new_item_id) { + if (new_item_id.notNull()) + { + mItemUUID = new_item_id; + setKey(LLSD(new_item_id)); + } lldebugs << "LLPreviewNotecard::refreshFromInventory()" << llendl; loadAsset(); } @@ -287,7 +239,6 @@ void LLPreviewNotecard::loadAsset() } else { - LLUUID* new_uuid = new LLUUID(mItemUUID); LLHost source_sim = LLHost::invalid; if (mObjectUUID.notNull()) { @@ -305,7 +256,6 @@ void LLPreviewNotecard::loadAsset() editor->makePristine(); editor->setEnabled(FALSE); mAssetStatus = PREVIEW_ASSET_LOADED; - delete new_uuid; return; } } @@ -318,7 +268,7 @@ void LLPreviewNotecard::loadAsset() item->getAssetUUID(), item->getType(), &onLoadComplete, - (void*)new_uuid, + (void*)new LLUUID(mItemUUID), TRUE); mAssetStatus = PREVIEW_ASSET_LOADING; } @@ -355,7 +305,8 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, { llinfos << "LLPreviewNotecard::onLoadComplete()" << llendl; LLUUID* item_id = (LLUUID*)user_data; - LLPreviewNotecard* preview = LLPreviewNotecard::getInstance(*item_id); + + LLPreviewNotecard* preview = LLFloaterReg::findTypedInstance<LLPreviewNotecard>("preview_notecard", LLSD(*item_id)); if( preview ) { if(0 == status) @@ -419,18 +370,6 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, delete item_id; } -// static -LLPreviewNotecard* LLPreviewNotecard::getInstance(const LLUUID& item_id) -{ - LLPreview* instance = NULL; - preview_map_t::iterator found_it = LLPreview::sInstances.find(item_id); - if(found_it != LLPreview::sInstances.end()) - { - instance = found_it->second; - } - return (LLPreviewNotecard*)instance; -} - // static void LLPreviewNotecard::onClickSave(void* user_data) { @@ -590,10 +529,11 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data } // Find our window and close it if requested. - LLPreviewNotecard* previewp = (LLPreviewNotecard*)LLPreview::find(info->mItemUUID); + + LLPreviewNotecard* previewp = LLFloaterReg::findTypedInstance<LLPreviewNotecard>("preview_notecard", info->mItemUUID); if (previewp && previewp->mCloseAfterSave) { - previewp->close(); + previewp->closeFloater(); } } else @@ -624,7 +564,7 @@ bool LLPreviewNotecard::handleSaveChangesDialog(const LLSD& notification, const case 1: // "No" mForceClose = TRUE; - close(); + closeFloater(); break; case 2: // "Cancel" @@ -636,16 +576,4 @@ bool LLPreviewNotecard::handleSaveChangesDialog(const LLSD& notification, const return false; } -void LLPreviewNotecard::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - LLPreview::reshape( width, height, called_from_parent ); - - if( !isMinimized() ) - { - // So that next time you open a script it will have the same height and width - // (although not the same position). - gSavedSettings.setRect("NotecardEditorRect", getRect()); - } -} - // EOF diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index f5cd2bb2a948c564423f0301ec502319ad57dcb3..2a008be1e6ceb677cacc9eb74e507ca39cc51203 100644 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -49,28 +49,21 @@ class LLButton; class LLPreviewNotecard : public LLPreview { public: - LLPreviewNotecard(const std::string& name, const LLRect& rect, const std::string& title, - const LLUUID& item_id, - const LLUUID& object_id = LLUUID::null, - const LLUUID& asset_id = LLUUID::null, - BOOL show_keep_discard = FALSE, - LLPointer<LLViewerInventoryItem> inv_item = NULL); + LLPreviewNotecard(const LLSD& key); virtual ~LLPreviewNotecard(); - // llpreview - virtual bool saveItem(LLPointer<LLInventoryItem>* itemptr); + bool saveItem(); // llview virtual void draw(); virtual BOOL handleKeyHere(KEY key, MASK mask); virtual void setEnabled( BOOL enabled ); - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); // llfloater virtual BOOL canClose(); // llpanel - virtual BOOL postBuild(); + virtual BOOL postBuild(); // reach into the text editor, and grab the drag item const LLInventoryItem* getDragItem(); @@ -82,15 +75,13 @@ public: // After saving a notecard, the tcp based upload system will // change the asset, therefore, we need to re-fetch it from the // asset system. :( - void refreshFromInventory(); + void refreshFromInventory(const LLUUID& item_id = LLUUID::null); protected: virtual void loadAsset(); bool saveIfNeeded(LLInventoryItem* copyitem = NULL); - static LLPreviewNotecard* getInstance(const LLUUID& uuid); - static void onLoadComplete(LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type, @@ -104,16 +95,14 @@ protected: bool handleSaveChangesDialog(const LLSD& notification, const LLSD& response); - virtual const char *getTitleName() const { return "Note"; } - protected: LLViewerTextEditor* mEditor; LLButton* mSaveBtn; LLUUID mAssetID; - LLUUID mNotecardItemID; LLUUID mObjectID; + BOOL mShowKeepDiscard; }; diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 0bacb95d2dccdb41222a02d85fe135a91126cc3f..9de2f38afffd96bb7c24ff67cc46a80786f90c83 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -40,6 +40,7 @@ #include "llcheckboxctrl.h" #include "llcombobox.h" #include "lldir.h" +#include "llfloaterreg.h" #include "llinventorymodel.h" #include "llkeyboard.h" #include "lllineeditor.h" @@ -48,6 +49,8 @@ #include "llscrollbar.h" #include "llscrollcontainer.h" #include "llscrolllistctrl.h" +#include "llscrolllistitem.h" +#include "llscrolllistcell.h" #include "llslider.h" #include "lscript_rt_interface.h" #include "lscript_export.h" @@ -87,7 +90,7 @@ #include "llappviewer.h" #include "llpanelinventory.h" - +#include "lltrans.h" const std::string HELLO_LSL = "default\n" @@ -109,34 +112,8 @@ const std::string DEFAULT_SCRIPT_DESC = "(No Description)"; // *TODO:Translate? // Description and header information -const S32 SCRIPT_BORDER = 4; -const S32 SCRIPT_PAD = 5; -const S32 SCRIPT_BUTTON_WIDTH = 128; -const S32 SCRIPT_BUTTON_HEIGHT = 24; // HACK: Use BTN_HEIGHT where possible. -const S32 LINE_COLUMN_HEIGHT = 14; -const S32 BTN_PAD = 8; - -const S32 SCRIPT_EDITOR_MIN_HEIGHT = 2 * SCROLLBAR_SIZE + 2 * LLPANEL_BORDER_WIDTH + 128; - -const S32 SCRIPT_MIN_WIDTH = - 2 * SCRIPT_BORDER + - 2 * SCRIPT_BUTTON_WIDTH + - SCRIPT_PAD + RESIZE_HANDLE_WIDTH + - SCRIPT_PAD; - -const S32 SCRIPT_MIN_HEIGHT = - 2 * SCRIPT_BORDER + - 3*(SCRIPT_BUTTON_HEIGHT + SCRIPT_PAD) + - LINE_COLUMN_HEIGHT + - SCRIPT_EDITOR_MIN_HEIGHT; - const S32 MAX_EXPORT_SIZE = 1000; -const S32 SCRIPT_SEARCH_WIDTH = 300; -const S32 SCRIPT_SEARCH_HEIGHT = 120; -const S32 SCRIPT_SEARCH_LABEL_WIDTH = 50; -const S32 SCRIPT_SEARCH_BUTTON_WIDTH = 80; -const S32 TEXT_EDIT_COLUMN_HEIGHT = 16; const S32 MAX_HISTORY_COUNT = 10; const F32 LIVE_HELP_REFRESH_TIME = 1.f; @@ -152,9 +129,10 @@ static bool have_script_upload_cap(LLUUID& object_id) class LLFloaterScriptSearch : public LLFloater { public: - LLFloaterScriptSearch(std::string title, LLRect rect, LLScriptEdCore* editor_core); + LLFloaterScriptSearch(LLScriptEdCore* editor_core); ~LLFloaterScriptSearch(); + /*virtual*/ BOOL postBuild(); static void show(LLScriptEdCore* editor_core); static void onBtnSearch(void* userdata); void handleBtnSearch(); @@ -168,8 +146,6 @@ public: LLScriptEdCore* getEditorCore() { return mEditorCore; } static LLFloaterScriptSearch* getInstance() { return sInstance; } - void open(); /*Flawfinder: ignore*/ - private: LLScriptEdCore* mEditorCore; @@ -179,28 +155,14 @@ private: LLFloaterScriptSearch* LLFloaterScriptSearch::sInstance = NULL; -LLFloaterScriptSearch::LLFloaterScriptSearch(std::string title, LLRect rect, LLScriptEdCore* editor_core) - : LLFloater("script search",rect,title), mEditorCore(editor_core) +LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core) +: LLFloater(), + mEditorCore(editor_core) { - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_search.xml"); - childSetAction("search_btn", onBtnSearch,this); - childSetAction("replace_btn", onBtnReplace,this); - childSetAction("replace_all_btn", onBtnReplaceAll,this); - - setDefaultBtn("search_btn"); - - if (!getHost()) - { - LLRect curRect = getRect(); - translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop); - } - sInstance = this; - - childSetFocus("search_text", TRUE); - + // find floater in which script panel is embedded LLView* viewp = (LLView*)editor_core; while(viewp) @@ -215,26 +177,33 @@ LLFloaterScriptSearch::LLFloaterScriptSearch(std::string title, LLRect rect, LLS } } +BOOL LLFloaterScriptSearch::postBuild() +{ + childSetAction("search_btn", onBtnSearch,this); + childSetAction("replace_btn", onBtnReplace,this); + childSetAction("replace_all_btn", onBtnReplaceAll,this); + + setDefaultBtn("search_btn"); + + return TRUE; +} + //static void LLFloaterScriptSearch::show(LLScriptEdCore* editor_core) { if (sInstance && sInstance->mEditorCore && sInstance->mEditorCore != editor_core) { - sInstance->close(); + sInstance->closeFloater(); delete sInstance; } if (!sInstance) { - S32 left = 0; - S32 top = 0; - gFloaterView->getNewFloaterPosition(&left,&top); - // sInstance will be assigned in the constructor. - new LLFloaterScriptSearch("Script Search",LLRect(left,top,left + SCRIPT_SEARCH_WIDTH,top - SCRIPT_SEARCH_HEIGHT),editor_core); + new LLFloaterScriptSearch(editor_core); } - sInstance->open(); /*Flawfinder: ignore*/ + sInstance->openFloater(); } LLFloaterScriptSearch::~LLFloaterScriptSearch() @@ -281,19 +250,11 @@ void LLFloaterScriptSearch::handleBtnReplaceAll() mEditorCore->mEditor->replaceTextAll(childGetText("search_text"), childGetText("replace_text"), caseChk->get()); } -void LLFloaterScriptSearch::open() /*Flawfinder: ignore*/ -{ - LLFloater::open(); /*Flawfinder: ignore*/ - childSetFocus("search_text", TRUE); -} - /// --------------------------------------------------------------------------- /// LLScriptEdCore /// --------------------------------------------------------------------------- LLScriptEdCore::LLScriptEdCore( - const std::string& name, - const LLRect& rect, const std::string& sample, const std::string& help_url, const LLHandle<LLFloater>& floater_handle, @@ -303,7 +264,7 @@ LLScriptEdCore::LLScriptEdCore( void* userdata, S32 bottom_pad) : - LLPanel( std::string("name"), rect ), + LLPanel(), mSampleText(sample), mHelpURL(help_url), mEditor( NULL ), @@ -321,19 +282,7 @@ LLScriptEdCore::LLScriptEdCore( setBorderVisible(FALSE); - LLUICtrlFactory::getInstance()->buildPanel(this, "floater_script_ed_panel.xml"); - - mErrorList = getChild<LLScrollListCtrl>("lsl errors"); - - mFunctions = getChild<LLComboBox>( "Insert..."); - - childSetCommitCallback("Insert...", &LLScriptEdCore::onBtnInsertFunction, this); - - mEditor = getChild<LLViewerTextEditor>("Script Editor"); - mEditor->setFollowsAll(); - mEditor->setHandleEditKeysDirectly(TRUE); - mEditor->setEnabled(TRUE); - mEditor->setWordWrap(TRUE); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_script_ed.xml"); std::vector<std::string> funcs; std::vector<std::string> tooltips; @@ -366,20 +315,6 @@ LLScriptEdCore::LLScriptEdCore( if (token->getColor() != color) mFunctions->add(wstring_to_utf8str(token->getToken())); } - - - childSetCommitCallback("lsl errors", &LLScriptEdCore::onErrorList, this); - childSetAction("Save_btn", onBtnSave,this); - - initMenu(); - - // Do the work that addTabPanel() normally does. - //LLRect tab_panel_rect( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - //tab_panel_rect.stretch( -LLPANEL_BORDER_WIDTH ); - //mCodePanel->setFollowsAll(); - //mCodePanel->translate( tab_panel_rect.mLeft - mCodePanel->getRect().mLeft, tab_panel_rect.mBottom - mCodePanel->getRect().mBottom); - //mCodePanel->reshape( tab_panel_rect.getWidth(), tab_panel_rect.getHeight(), TRUE ); - } LLScriptEdCore::~LLScriptEdCore() @@ -390,57 +325,78 @@ LLScriptEdCore::~LLScriptEdCore() LLFloaterScriptSearch* script_search = LLFloaterScriptSearch::getInstance(); if (script_search && script_search->getEditorCore() == this) { - script_search->close(); + script_search->closeFloater(); delete script_search; } } -void LLScriptEdCore::initMenu() +BOOL LLScriptEdCore::postBuild() { - LLMenuItemCallGL* menuItem = getChild<LLMenuItemCallGL>("Save"); - menuItem->setMenuCallback(onBtnSave, this); - menuItem->setEnabledCallback(hasChanged); + mErrorList = getChild<LLScrollListCtrl>("lsl errors"); + + mFunctions = getChild<LLComboBox>( "Insert..."); + + childSetCommitCallback("Insert...", &LLScriptEdCore::onBtnInsertFunction, this); + + mEditor = getChild<LLViewerTextEditor>("Script Editor"); + mEditor->setFollowsAll(); + mEditor->setHandleEditKeysDirectly(TRUE); + mEditor->setEnabled(TRUE); + mEditor->setWordWrap(TRUE); + + childSetCommitCallback("lsl errors", &LLScriptEdCore::onErrorList, this); + childSetAction("Save_btn", boost::bind(&LLScriptEdCore::doSave,this,FALSE)); + + initMenu(); + return TRUE; +} + +void LLScriptEdCore::initMenu() +{ + // *TODO: Skinning - make these callbacks data driven + LLMenuItemCallGL* menuItem; + + menuItem = getChild<LLMenuItemCallGL>("Save"); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::doSave, this, FALSE)); + menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::hasChanged, this)); menuItem = getChild<LLMenuItemCallGL>("Revert All Changes"); - menuItem->setMenuCallback(onBtnUndoChanges, this); - menuItem->setEnabledCallback(hasChanged); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnUndoChanges, this)); + menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::hasChanged, this)); menuItem = getChild<LLMenuItemCallGL>("Undo"); - menuItem->setMenuCallback(onUndoMenu, this); - menuItem->setEnabledCallback(enableUndoMenu); + menuItem->setClickCallback(boost::bind(&LLTextEditor::undo, mEditor)); + menuItem->setEnableCallback(boost::bind(&LLTextEditor::canUndo, mEditor)); menuItem = getChild<LLMenuItemCallGL>("Redo"); - menuItem->setMenuCallback(onRedoMenu, this); - menuItem->setEnabledCallback(enableRedoMenu); + menuItem->setClickCallback(boost::bind(&LLTextEditor::redo, mEditor)); + menuItem->setEnableCallback(boost::bind(&LLTextEditor::canRedo, mEditor)); menuItem = getChild<LLMenuItemCallGL>("Cut"); - menuItem->setMenuCallback(onCutMenu, this); - menuItem->setEnabledCallback(enableCutMenu); + menuItem->setClickCallback(boost::bind(&LLTextEditor::cut, mEditor)); + menuItem->setEnableCallback(boost::bind(&LLTextEditor::canCut, mEditor)); menuItem = getChild<LLMenuItemCallGL>("Copy"); - menuItem->setMenuCallback(onCopyMenu, this); - menuItem->setEnabledCallback(enableCopyMenu); + menuItem->setClickCallback(boost::bind(&LLTextEditor::copy, mEditor)); + menuItem->setEnableCallback(boost::bind(&LLTextEditor::canCopy, mEditor)); menuItem = getChild<LLMenuItemCallGL>("Paste"); - menuItem->setMenuCallback(onPasteMenu, this); - menuItem->setEnabledCallback(enablePasteMenu); + menuItem->setClickCallback(boost::bind(&LLTextEditor::paste, mEditor)); + menuItem->setEnableCallback(boost::bind(&LLTextEditor::canPaste, mEditor)); menuItem = getChild<LLMenuItemCallGL>("Select All"); - menuItem->setMenuCallback(onSelectAllMenu, this); - menuItem->setEnabledCallback(enableSelectAllMenu); + menuItem->setClickCallback(boost::bind(&LLTextEditor::selectAll, mEditor)); + menuItem->setEnableCallback(boost::bind(&LLTextEditor::canSelectAll, mEditor)); menuItem = getChild<LLMenuItemCallGL>("Search / Replace..."); - menuItem->setMenuCallback(onSearchMenu, this); - menuItem->setEnabledCallback(NULL); + menuItem->setClickCallback(boost::bind(&LLFloaterScriptSearch::show, this)); menuItem = getChild<LLMenuItemCallGL>("Help..."); - menuItem->setMenuCallback(onBtnHelp, this); - menuItem->setEnabledCallback(NULL); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnHelp, this)); menuItem = getChild<LLMenuItemCallGL>("LSL Wiki Help..."); - menuItem->setMenuCallback(onBtnDynamicHelp, this); - menuItem->setEnabledCallback(NULL); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnDynamicHelp, this)); } void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid) @@ -452,17 +408,16 @@ void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid) } } -BOOL LLScriptEdCore::hasChanged(void* userdata) +bool LLScriptEdCore::hasChanged() { - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return FALSE; + if (!mEditor) return false; - return ((!self->mEditor->isPristine() || self->mEnableSave) && self->mHasScriptData); + return !mEditor->isPristine(); } void LLScriptEdCore::draw() { - BOOL script_changed = hasChanged(this); + BOOL script_changed = hasChanged(); childSetEnabled("Save_btn", script_changed); if( mEditor->hasFocus() ) @@ -470,8 +425,11 @@ void LLScriptEdCore::draw() S32 line = 0; S32 column = 0; mEditor->getCurrentLineAndColumn( &line, &column, FALSE ); // don't include wordwrap + LLStringUtil::format_map_t args; std::string cursor_pos; - cursor_pos = llformat("Line %d, Column %d", line, column ); + args["[LINE]"] = llformat ("%d", line); + args["[COLUMN]"] = llformat ("%d", column); + cursor_pos = LLTrans::getString("CursorPos", args); childSetText("line_col", cursor_pos); } else @@ -580,9 +538,7 @@ void LLScriptEdCore::addHelpItemToHistory(const std::string& help_string) // separate history items from full item list if (mLiveHelpHistorySize == 0) { - LLSD row; - row["columns"][0]["type"] = "separator"; - history_combo->addElement(row, ADD_TOP); + history_combo->addSeparator(ADD_TOP); } // delete all history items over history limit while(mLiveHelpHistorySize > MAX_HISTORY_COUNT - 1) @@ -612,7 +568,7 @@ void LLScriptEdCore::addHelpItemToHistory(const std::string& help_string) BOOL LLScriptEdCore::canClose() { - if(mForceClose || !hasChanged(this)) + if(mForceClose || !hasChanged()) { return TRUE; } @@ -631,14 +587,14 @@ bool LLScriptEdCore::handleSaveChangesDialog(const LLSD& notification, const LLS { case 0: // "Yes" // close after saving - LLScriptEdCore::doSave( this, TRUE ); + doSave( TRUE ); break; case 1: // "No" mForceClose = TRUE; // This will close immediately because mForceClose is true, so we won't // infinite loop with these dialogs. JC - ((LLFloater*) getParent())->close(); + ((LLFloater*) getParent())->closeFloater(); break; case 2: // "Cancel" @@ -666,37 +622,33 @@ bool LLScriptEdCore::onHelpWebDialog(const LLSD& notification, const LLSD& respo return false; } -// static -void LLScriptEdCore::onBtnHelp(void* userdata) +void LLScriptEdCore::onBtnHelp() { - LLScriptEdCore* corep = (LLScriptEdCore*)userdata; LLSD payload; - payload["help_url"] = corep->mHelpURL; + payload["help_url"] = mHelpURL; LLNotifications::instance().add("WebLaunchLSLGuide", LLSD(), payload, onHelpWebDialog); } -// static -void LLScriptEdCore::onBtnDynamicHelp(void* userdata) +void LLScriptEdCore::onBtnDynamicHelp() { - LLScriptEdCore* corep = (LLScriptEdCore*)userdata; - - LLFloater* live_help_floater = corep->mLiveHelpHandle.get(); + LLFloater* live_help_floater = mLiveHelpHandle.get(); if (live_help_floater) { live_help_floater->setFocus(TRUE); - corep->updateDynamicHelp(TRUE); + updateDynamicHelp(TRUE); return; } - live_help_floater = new LLFloater(std::string("lsl_help")); + live_help_floater = new LLFloater(); LLUICtrlFactory::getInstance()->buildFloater(live_help_floater, "floater_lsl_guide.xml"); - ((LLFloater*)corep->getParent())->addDependentFloater(live_help_floater, TRUE); - live_help_floater->childSetCommitCallback("lock_check", onCheckLock, userdata); + LLFloater* parent = dynamic_cast<LLFloater*>(getParent()); + parent->addDependentFloater(live_help_floater, TRUE); + live_help_floater->childSetCommitCallback("lock_check", onCheckLock, this); live_help_floater->childSetValue("lock_check", gSavedSettings.getBOOL("ScriptHelpFollowsCursor")); - live_help_floater->childSetCommitCallback("history_combo", onHelpComboCommit, userdata); - live_help_floater->childSetAction("back_btn", onClickBack, userdata); - live_help_floater->childSetAction("fwd_btn", onClickForward, userdata); + live_help_floater->childSetCommitCallback("history_combo", onHelpComboCommit, this); + live_help_floater->childSetAction("back_btn", onClickBack, this); + live_help_floater->childSetAction("fwd_btn", onClickForward, this); LLWebBrowserCtrl* browser = live_help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); browser->setAlwaysRefresh(TRUE); @@ -704,8 +656,8 @@ void LLScriptEdCore::onBtnDynamicHelp(void* userdata) LLComboBox* help_combo = live_help_floater->getChild<LLComboBox>("history_combo"); LLKeywordToken *token; LLKeywords::keyword_iterator_t token_it; - for (token_it = corep->mEditor->keywordsBegin(); - token_it != corep->mEditor->keywordsEnd(); + for (token_it = mEditor->keywordsBegin(); + token_it != mEditor->keywordsEnd(); ++token_it) { token = token_it->second; @@ -714,10 +666,10 @@ void LLScriptEdCore::onBtnDynamicHelp(void* userdata) help_combo->sortByName(); // re-initialize help variables - corep->mLastHelpToken = NULL; - corep->mLiveHelpHandle = live_help_floater->getHandle(); - corep->mLiveHelpHistorySize = 0; - corep->updateDynamicHelp(TRUE); + mLastHelpToken = NULL; + mLiveHelpHandle = live_help_floater->getHandle(); + mLiveHelpHistorySize = 0; + updateDynamicHelp(TRUE); } //static @@ -805,154 +757,25 @@ void LLScriptEdCore::onBtnInsertFunction(LLUICtrl *ui, void* userdata) self->setHelpPage(self->mFunctions->getSimple()); } -// static -void LLScriptEdCore::doSave( void* userdata, BOOL close_after_save ) +void LLScriptEdCore::doSave( BOOL close_after_save ) { LLViewerStats::getInstance()->incStat( LLViewerStats::ST_LSL_SAVE_COUNT ); - LLScriptEdCore* self = (LLScriptEdCore*) userdata; - - if( self->mSaveCallback ) + if( mSaveCallback ) { - self->mSaveCallback( self->mUserdata, close_after_save ); + mSaveCallback( mUserdata, close_after_save ); } } -// static -void LLScriptEdCore::onBtnSave(void* data) -{ - // do the save, but don't close afterwards - doSave(data, FALSE); -} -// static -void LLScriptEdCore::onBtnUndoChanges( void* userdata ) +void LLScriptEdCore::onBtnUndoChanges() { - LLScriptEdCore* self = (LLScriptEdCore*) userdata; - if( !self->mEditor->tryToRevertToPristineState() ) + if( !mEditor->tryToRevertToPristineState() ) { - LLNotifications::instance().add("ScriptCannotUndo", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleReloadFromServerDialog, self, _1, _2)); + LLNotifications::instance().add("ScriptCannotUndo", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleReloadFromServerDialog, this, _1, _2)); } } -void LLScriptEdCore::onSearchMenu(void* userdata) -{ - LLScriptEdCore* sec = (LLScriptEdCore*)userdata; - LLFloaterScriptSearch::show(sec); -} - -// static -void LLScriptEdCore::onUndoMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return; - self->mEditor->undo(); -} - -// static -void LLScriptEdCore::onRedoMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return; - self->mEditor->redo(); -} - -// static -void LLScriptEdCore::onCutMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return; - self->mEditor->cut(); -} - -// static -void LLScriptEdCore::onCopyMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return; - self->mEditor->copy(); -} - -// static -void LLScriptEdCore::onPasteMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return; - self->mEditor->paste(); -} - -// static -void LLScriptEdCore::onSelectAllMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return; - self->mEditor->selectAll(); -} - -// static -void LLScriptEdCore::onDeselectMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return; - self->mEditor->deselect(); -} - -// static -BOOL LLScriptEdCore::enableUndoMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return FALSE; - return self->mEditor->canUndo(); -} - -// static -BOOL LLScriptEdCore::enableRedoMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return FALSE; - return self->mEditor->canRedo(); -} - -// static -BOOL LLScriptEdCore::enableCutMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return FALSE; - return self->mEditor->canCut(); -} - -// static -BOOL LLScriptEdCore::enableCopyMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return FALSE; - return self->mEditor->canCopy(); -} - -// static -BOOL LLScriptEdCore::enablePasteMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return FALSE; - return self->mEditor->canPaste(); -} - -// static -BOOL LLScriptEdCore::enableSelectAllMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return FALSE; - return self->mEditor->canSelectAll(); -} - -// static -BOOL LLScriptEdCore::enableDeselectMenu(void* userdata) -{ - LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return FALSE; - return self->mEditor->canDeselect(); -} - // static void LLScriptEdCore::onErrorList(LLUICtrl*, void* user_data) { @@ -960,8 +783,7 @@ void LLScriptEdCore::onErrorList(LLUICtrl*, void* user_data) LLScrollListItem* item = self->mErrorList->getFirstSelected(); if(item) { - // *FIX: This fucked up little hack is here because we don't - // have a grep library. This is very brittle code. + // *FIX: replace with boost grep S32 row = 0; S32 column = 0; const LLScrollListCell* cell = item->getColumn(0); @@ -1080,8 +902,7 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata) LLPreviewLSL *self = (LLPreviewLSL*)userdata; - self->mScriptEd = new LLScriptEdCore("script panel", - LLRect(), + self->mScriptEd = new LLScriptEdCore( HELLO_LSL, HELP_LSL_URL, self->getHandle(), @@ -1095,49 +916,32 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata) } -LLPreviewLSL::LLPreviewLSL(const std::string& name, const LLRect& rect, - const std::string& title, const LLUUID& item_id ) -: LLPreview( name, rect, title, item_id, LLUUID::null, TRUE, - SCRIPT_MIN_WIDTH, SCRIPT_MIN_HEIGHT ), - mPendingUploads(0) +LLPreviewLSL::LLPreviewLSL(const LLSD& key ) + : LLPreview( key ), + mPendingUploads(0) { + mFactoryMap["script panel"] = LLCallbackMap(LLPreviewLSL::createScriptEdPanel, this); + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_preview.xml", FALSE); +} - LLRect curRect = rect; - - - LLCallbackMap::map_t factory_map; - factory_map["script panel"] = LLCallbackMap(LLPreviewLSL::createScriptEdPanel, this); - - - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_preview.xml", &factory_map); - +// virtual +BOOL LLPreviewLSL::postBuild() +{ const LLInventoryItem* item = getItem(); childSetCommitCallback("desc", LLPreview::onText, this); childSetText("desc", item->getDescription()); childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); - if (!getFloaterHost() && !getHost() && getAssetStatus() == PREVIEW_ASSET_UNLOADED) - { - loadAsset(); - } - - setTitle(title); - - if (!getHost()) - { - reshape(curRect.getWidth(), curRect.getHeight(), TRUE); - setRect(curRect); - } + return LLPreview::postBuild(); } // virtual void LLPreviewLSL::callbackLSLCompileSucceeded() { llinfos << "LSL Bytecode saved" << llendl; - // *TODO: Translate - mScriptEd->mErrorList->addCommentText(std::string("Compile successful!")); - mScriptEd->mErrorList->addCommentText(std::string("Save complete.")); + mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful")); + mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete")); closeIfNeeded(); } @@ -1228,16 +1032,10 @@ void LLPreviewLSL::closeIfNeeded() mPendingUploads--; if (mPendingUploads <= 0 && mCloseAfterSave) { - close(); + closeFloater(); } } -//override the llpreview open which attempts to load asset, load after xml ui made -void LLPreviewLSL::open() /*Flawfinder: ignore*/ -{ - LLFloater::open(); /*Flawfinder: ignore*/ -} - void LLPreviewLSL::onSearchReplace(void* userdata) { LLPreviewLSL* self = (LLPreviewLSL*)userdata; @@ -1267,7 +1065,7 @@ void LLPreviewLSL::onSave(void* userdata, BOOL close_after_save) void LLPreviewLSL::saveIfNeeded() { // llinfos << "LLPreviewLSL::saveIfNeeded()" << llendl; - if(!LLScriptEdCore::hasChanged(mScriptEd)) + if(!mScriptEd->hasChanged()) { return; } @@ -1440,7 +1238,7 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 } // Find our window and close it if requested. - LLPreviewLSL* self = (LLPreviewLSL*)LLPreview::find(info->mItemUUID); + LLPreviewLSL* self = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", info->mItemUUID); if (self) { getWindow()->decBusyCount(); @@ -1448,7 +1246,7 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 if (self->mPendingUploads <= 0 && self->mCloseAfterSave) { - self->close(); + self->closeFloater(); } } } @@ -1470,7 +1268,7 @@ void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_d LLPreviewLSL* self = NULL; if(instance_uuid) { - self = LLPreviewLSL::getInstance(*instance_uuid); + self = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", *instance_uuid); } if (0 == status) { @@ -1487,7 +1285,7 @@ void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_d if (self->mPendingUploads <= 0 && self->mCloseAfterSave) { - self->close(); + self->closeFloater(); } } } @@ -1508,7 +1306,7 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset lldebugs << "LLPreviewLSL::onLoadComplete: got uuid " << asset_uuid << llendl; LLUUID* item_uuid = (LLUUID*)user_data; - LLPreviewLSL* preview = LLPreviewLSL::getInstance(*item_uuid); + LLPreviewLSL* preview = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", *item_uuid); if( preview ) { if(0 == status) @@ -1559,37 +1357,10 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset delete item_uuid; } -// static -LLPreviewLSL* LLPreviewLSL::getInstance( const LLUUID& item_uuid ) -{ - LLPreview* instance = NULL; - preview_map_t::iterator found_it = LLPreview::sInstances.find(item_uuid); - if(found_it != LLPreview::sInstances.end()) - { - instance = found_it->second; - } - return (LLPreviewLSL*)instance; -} - -void LLPreviewLSL::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - LLPreview::reshape( width, height, called_from_parent ); - - if( !isMinimized() ) - { - // So that next time you open a script it will have the same height and width - // (although not the same position). - gSavedSettings.setRect("PreviewScriptRect", getRect()); - } -} - /// --------------------------------------------------------------------------- /// LLLiveLSLEditor /// --------------------------------------------------------------------------- -LLMap<LLUUID, LLLiveLSLEditor*> LLLiveLSLEditor::sInstances; - - //static void* LLLiveLSLEditor::createScriptEdPanel(void* userdata) @@ -1597,8 +1368,7 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata) LLLiveLSLEditor *self = (LLLiveLSLEditor*)userdata; - self->mScriptEd = new LLScriptEdCore("script ed panel", - LLRect(), + self->mScriptEd = new LLScriptEdCore( HELLO_LSL, HELP_LSL_URL, self->getHandle(), @@ -1612,72 +1382,40 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata) } -LLLiveLSLEditor::LLLiveLSLEditor(const std::string& name, - const LLRect& rect, - const std::string& title, - const LLUUID& object_id, - const LLUUID& item_id) : - LLPreview(name, rect, title, item_id, object_id, TRUE, SCRIPT_MIN_WIDTH, SCRIPT_MIN_HEIGHT), - mObjectID(object_id), - mItemID(item_id), +LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) : + LLPreview(key), mScriptEd(NULL), mAskedForRunningInfo(FALSE), mHaveRunningInfo(FALSE), mCloseAfterSave(FALSE), mPendingUploads(0), - mIsModifiable(FALSE) + mIsModifiable(FALSE), + mIsNew(false) { + mFactoryMap["script ed panel"] = LLCallbackMap(LLLiveLSLEditor::createScriptEdPanel, this); + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_live_lsleditor.xml", FALSE); +} - - BOOL is_new = FALSE; - if(mItemID.isNull()) - { - mItemID.generate(); - is_new = TRUE; - } - - - LLLiveLSLEditor::sInstances.addData(mItemID ^ mObjectID, this); - - LLCallbackMap::map_t factory_map; - factory_map["script ed panel"] = LLCallbackMap(LLLiveLSLEditor::createScriptEdPanel, this); - - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_live_lsleditor.xml", &factory_map); - - mMonoCheckbox = getChild<LLCheckBoxCtrl>("mono"); - childSetCommitCallback("mono", &LLLiveLSLEditor::onMonoCheckboxClicked, this); - childSetEnabled("mono", FALSE); - +BOOL LLLiveLSLEditor::postBuild() +{ childSetCommitCallback("running", LLLiveLSLEditor::onRunningCheckboxClicked, this); childSetEnabled("running", FALSE); childSetAction("Reset",&LLLiveLSLEditor::onReset,this); childSetEnabled("Reset", TRUE); + mMonoCheckbox = getChild<LLCheckBoxCtrl>("mono"); + childSetCommitCallback("mono", &LLLiveLSLEditor::onMonoCheckboxClicked, this); + childSetEnabled("mono", FALSE); mScriptEd->mEditor->makePristine(); - loadAsset(is_new); mScriptEd->mEditor->setFocus(TRUE); - - if (!getHost()) - { - LLRect curRect = getRect(); - translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop); - } - - setTitle(title); + return LLPreview::postBuild(); } LLLiveLSLEditor::~LLLiveLSLEditor() { - LLLiveLSLEditor::sInstances.removeData(mItemID ^ mObjectID); -} - -// this is called via LLPreview::loadAsset() virtual method -void LLLiveLSLEditor::loadAsset() -{ - loadAsset(FALSE); } // virtual @@ -1686,9 +1424,8 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id, bool is_script_running) { lldebugs << "LSL Bytecode saved" << llendl; - // *TODO: Translate - mScriptEd->mErrorList->addCommentText(std::string("Compile successful!")); - mScriptEd->mErrorList->addCommentText(std::string("Save complete.")); + mScriptEd->mErrorList->setCommentText(LLTrans::getString("Compilesuccessful")); + mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete")); closeIfNeeded(); } @@ -1711,16 +1448,15 @@ void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors) closeIfNeeded(); } -void LLLiveLSLEditor::loadAsset(BOOL is_new) +void LLLiveLSLEditor::loadAsset() { //llinfos << "LLLiveLSLEditor::loadAsset()" << llendl; - if(!is_new) + if(!mIsNew) { - LLViewerObject* object = gObjectList.findObject(mObjectID); + LLViewerObject* object = gObjectList.findObject(mObjectUUID); if(object) { - // HACK! we "know" that mItemID refers to a LLViewerInventoryItem... - LLViewerInventoryItem* item = (LLViewerInventoryItem*)object->getInventoryObject(mItemID); + LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(object->getInventoryObject(mItemUUID)); if(item && (gAgent.allowOperation(PERM_COPY, item->getPermissions(), GP_OBJECT_MANIPULATE) || gAgent.isGodlike())) @@ -1744,23 +1480,23 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new) else if(item && mItem.notNull()) { // request the text from the object - LLUUID* user_data = new LLUUID(mItemID ^ mObjectID); + LLUUID* user_data = new LLUUID(mItemUUID); // ^ mObjectUUID gAssetStorage->getInvItemAsset(object->getRegion()->getHost(), - gAgent.getID(), - gAgent.getSessionID(), - item->getPermissions().getOwner(), - object->getID(), - item->getUUID(), - item->getAssetUUID(), - item->getType(), - &LLLiveLSLEditor::onLoadComplete, - (void*)user_data, - TRUE); + gAgent.getID(), + gAgent.getSessionID(), + item->getPermissions().getOwner(), + object->getID(), + item->getUUID(), + item->getAssetUUID(), + item->getType(), + &LLLiveLSLEditor::onLoadComplete, + (void*)user_data, + TRUE); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_GetScriptRunning); msg->nextBlockFast(_PREHASH_Script); - msg->addUUIDFast(_PREHASH_ObjectID, mObjectID); - msg->addUUIDFast(_PREHASH_ItemID, mItemID); + msg->addUUIDFast(_PREHASH_ObjectID, mObjectUUID); + msg->addUUIDFast(_PREHASH_ItemID, mItemUUID); msg->sendReliable(object->getRegion()->getHost()); mAskedForRunningInfo = TRUE; mAssetStatus = PREVIEW_ASSET_LOADING; @@ -1789,26 +1525,12 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new) gMessageSystem->addUUID("AgentID", gAgent.getID()); U32 local_id = object->getLocalID(); gMessageSystem->addData("LocalID", &local_id); - gMessageSystem->addUUID("ItemID", mItemID); + gMessageSystem->addUUID("ItemID", mItemUUID); LLHost host(object->getRegion()->getIP(), object->getRegion()->getPort()); gMessageSystem->sendReliable(host); */ } - - // Initialization of the asset failed. Probably the result - // of a bug somewhere else. Set up this editor in a no-go mode. - if(mItem.isNull()) - { - // Set the inventory item to an incomplete item. - // This may be better than having a accessible null pointer around, - // though this newly allocated object will most likely be replaced. - mItem = new LLViewerInventoryItem(); - mScriptEd->setScriptText(LLStringUtil::null, FALSE); - mScriptEd->mEditor->makePristine(); - mScriptEd->mEditor->setEnabled(FALSE); - mAssetStatus = PREVIEW_ASSET_LOADED; - } } else { @@ -1817,17 +1539,17 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new) LLPermissions perm; perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, gAgent.getGroupID()); perm.initMasks(PERM_ALL, PERM_ALL, PERM_NONE, PERM_NONE, PERM_MOVE | PERM_TRANSFER); - mItem = new LLViewerInventoryItem(mItemID, - mObjectID, - perm, - LLUUID::null, - LLAssetType::AT_LSL_TEXT, - LLInventoryType::IT_LSL, - DEFAULT_SCRIPT_NAME, - DEFAULT_SCRIPT_DESC, - LLSaleInfo::DEFAULT, - LLInventoryItem::II_FLAGS_NONE, - time_corrected()); + mItem = new LLViewerInventoryItem(mItemUUID, + mObjectUUID, + perm, + LLUUID::null, + LLAssetType::AT_LSL_TEXT, + LLInventoryType::IT_LSL, + DEFAULT_SCRIPT_NAME, + DEFAULT_SCRIPT_DESC, + LLSaleInfo::DEFAULT, + LLInventoryItem::II_FLAGS_NONE, + time_corrected()); mAssetStatus = PREVIEW_ASSET_LOADED; } } @@ -1839,12 +1561,12 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id, { lldebugs << "LLLiveLSLEditor::onLoadComplete: got uuid " << asset_id << llendl; - LLLiveLSLEditor* instance = NULL; LLUUID* xored_id = (LLUUID*)user_data; - - if( LLLiveLSLEditor::sInstances.checkData(*xored_id) ) + + LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", *xored_id); + + if(instance ) { - instance = LLLiveLSLEditor::sInstances[*xored_id]; if( LL_ERR_NOERR == status ) { instance->loadScriptText(vfs, asset_id, type); @@ -1930,7 +1652,7 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType void LLLiveLSLEditor::onRunningCheckboxClicked( LLUICtrl*, void* userdata ) { LLLiveLSLEditor* self = (LLLiveLSLEditor*) userdata; - LLViewerObject* object = gObjectList.findObject( self->mObjectID ); + LLViewerObject* object = gObjectList.findObject( self->mObjectUUID ); LLCheckBoxCtrl* runningCheckbox = self->getChild<LLCheckBoxCtrl>("running"); BOOL running = runningCheckbox->get(); //self->mRunningCheckbox->get(); @@ -1942,8 +1664,8 @@ void LLLiveLSLEditor::onRunningCheckboxClicked( LLUICtrl*, void* userdata ) msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_Script); - msg->addUUIDFast(_PREHASH_ObjectID, self->mObjectID); - msg->addUUIDFast(_PREHASH_ItemID, self->mItemID); + msg->addUUIDFast(_PREHASH_ObjectID, self->mObjectUUID); + msg->addUUIDFast(_PREHASH_ItemID, self->mItemUUID); msg->addBOOLFast(_PREHASH_Running, running); msg->sendReliable(object->getRegion()->getHost()); } @@ -1958,7 +1680,7 @@ void LLLiveLSLEditor::onReset(void *userdata) { LLLiveLSLEditor* self = (LLLiveLSLEditor*) userdata; - LLViewerObject* object = gObjectList.findObject( self->mObjectID ); + LLViewerObject* object = gObjectList.findObject( self->mObjectUUID ); if(object) { LLMessageSystem* msg = gMessageSystem; @@ -1967,8 +1689,8 @@ void LLLiveLSLEditor::onReset(void *userdata) msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_Script); - msg->addUUIDFast(_PREHASH_ObjectID, self->mObjectID); - msg->addUUIDFast(_PREHASH_ItemID, self->mItemID); + msg->addUUIDFast(_PREHASH_ObjectID, self->mObjectUUID); + msg->addUUIDFast(_PREHASH_ItemID, self->mItemUUID); msg->sendReliable(object->getRegion()->getHost()); } else @@ -1979,7 +1701,7 @@ void LLLiveLSLEditor::onReset(void *userdata) void LLLiveLSLEditor::draw() { - LLViewerObject* object = gObjectList.findObject(mObjectID); + LLViewerObject* object = gObjectList.findObject(mObjectUUID); LLCheckBoxCtrl* runningCheckbox = getChild<LLCheckBoxCtrl>( "running"); if(object && mAskedForRunningInfo && mHaveRunningInfo) { @@ -2024,14 +1746,13 @@ void LLLiveLSLEditor::draw() { // HACK: Display this information in the title bar. // Really ought to put in main window. - // *TODO: Translate - setTitle(std::string("Script (object out of range)")); + setTitle(LLTrans::getString("ObjectOutOfRange")); runningCheckbox->setEnabled(FALSE); // object may have fallen out of range. mHaveRunningInfo = FALSE; } - LLFloater::draw(); + LLPreview::draw(); } @@ -2083,15 +1804,14 @@ void LLLiveLSLEditor::saveIfNeeded() // name on save, because the viewer object version of the item, // and the editor version would get out of synch. Here's a good // place to synch them back up. - // HACK! we "know" that mItemID refers to a LLInventoryItem... - LLInventoryItem* inv_item = (LLInventoryItem*)object->getInventoryObject(mItemID); + LLInventoryItem* inv_item = dynamic_cast<LLInventoryItem*>(object->getInventoryObject(mItemUUID)); if(inv_item) { mItem->copyItem(inv_item); } // Don't need to save if we're pristine - if(!LLScriptEdCore::hasChanged(mScriptEd)) + if(!mScriptEd->hasChanged()) { return; } @@ -2145,8 +1865,7 @@ void LLLiveLSLEditor::saveIfNeeded() BOOL is_running = getChild<LLCheckBoxCtrl>( "running")->get(); if (!url.empty()) { - uploadAssetViaCaps(url, filename, mObjectID, - mItemID, is_running); + uploadAssetViaCaps(url, filename, mObjectID, mItemUUID, is_running); } else if (gAssetStorage) { @@ -2238,8 +1957,7 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename, else { llinfos << "Compile worked!" << llendl; - // *TODO: Translate - mScriptEd->mErrorList->addCommentText(std::string("Compile successful, saving...")); + mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessfulSaving")); if(gAssetStorage) { llinfos << "LLLiveLSLEditor::saveAsset " @@ -2283,7 +2001,7 @@ void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_da } else { - LLLiveLSLEditor* self = sInstances.getIfThere(data->mItem->getUUID() ^ data->mObjectID); + LLLiveLSLEditor* self = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", data->mItem->getUUID()); // ^ data->mObjectID if (self) { self->getWindow()->decBusyCount(); @@ -2291,7 +2009,7 @@ void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_da if (self->mPendingUploads <= 0 && self->mCloseAfterSave) { - self->close(); + self->closeFloater(); } } } @@ -2308,20 +2026,18 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use if(0 ==status) { llinfos << "LSL Bytecode saved" << llendl; - LLUUID xor_id = data->mItem->getUUID() ^ data->mObjectID; - LLLiveLSLEditor* self = sInstances.getIfThere(xor_id); - if(self) + LLLiveLSLEditor* self = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", data->mItem->getUUID()); // ^ data->mObjectID + if (self) { // Tell the user that the compile worked. - // *TODO: Translate - self->mScriptEd->mErrorList->addCommentText(std::string("Save complete.")); + self->mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete")); // close the window if this completes both uploads self->getWindow()->decBusyCount(); self->mPendingUploads--; if (self->mPendingUploads <= 0 && self->mCloseAfterSave) { - self->close(); + self->closeFloater(); } } LLViewerObject* object = gObjectList.findObject(data->mObjectID); @@ -2349,11 +2065,6 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use delete data; } -void LLLiveLSLEditor::open() -{ - LLFloater::open(); /*Flawfinder: ignore*/ -} - BOOL LLLiveLSLEditor::canClose() { return (mScriptEd->canClose()); @@ -2365,7 +2076,7 @@ void LLLiveLSLEditor::closeIfNeeded() mPendingUploads--; if (mPendingUploads <= 0 && mCloseAfterSave) { - close(); + closeFloater(); } } @@ -2384,42 +2095,6 @@ void LLLiveLSLEditor::onSave(void* userdata, BOOL close_after_save) self->saveIfNeeded(); } -// static -LLLiveLSLEditor* LLLiveLSLEditor::show(const LLUUID& script_id, const LLUUID& object_id) -{ - LLLiveLSLEditor* instance = NULL; - LLUUID xored_id = script_id ^ object_id; - if(LLLiveLSLEditor::sInstances.checkData(xored_id)) - { - // Move the existing view to the front - instance = LLLiveLSLEditor::sInstances[xored_id]; - instance->open(); /*Flawfinder: ignore*/ - } - return instance; -} - -// static -void LLLiveLSLEditor::hide(const LLUUID& script_id, const LLUUID& object_id) -{ - LLUUID xored_id = script_id ^ object_id; - if( LLLiveLSLEditor::sInstances.checkData( xored_id ) ) - { - LLLiveLSLEditor* instance = LLLiveLSLEditor::sInstances[xored_id]; - if(instance->getParent()) - { - instance->getParent()->removeChild(instance); - } - delete instance; - } -} -// static -LLLiveLSLEditor* LLLiveLSLEditor::find(const LLUUID& script_id, const LLUUID& object_id) -{ - LLUUID xored_id = script_id ^ object_id; - return sInstances.getIfThere(xored_id); -} - - // static void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) { @@ -2427,10 +2102,10 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) LLUUID object_id; msg->getUUIDFast(_PREHASH_Script, _PREHASH_ObjectID, object_id); msg->getUUIDFast(_PREHASH_Script, _PREHASH_ItemID, item_id); - LLUUID xored_id = item_id ^ object_id; - if(LLLiveLSLEditor::sInstances.checkData(xored_id)) + + LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", item_id); // ^ object_id + if(instance) { - LLLiveLSLEditor* instance = LLLiveLSLEditor::sInstances[xored_id]; instance->mHaveRunningInfo = TRUE; BOOL running; msg->getBOOLFast(_PREHASH_Script, _PREHASH_Running, running); @@ -2444,18 +2119,6 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) } } -void LLLiveLSLEditor::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - LLFloater::reshape( width, height, called_from_parent ); - - if( !isMinimized() ) - { - // So that next time you open a script it will have the same height and width - // (although not the same position). - gSavedSettings.setRect("PreviewScriptRect", getRect()); - } -} - void LLLiveLSLEditor::onMonoCheckboxClicked(LLUICtrl*, void* userdata) { LLLiveLSLEditor* self = static_cast<LLLiveLSLEditor*>(userdata); diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index eb8b4147093b01bd9cc461be0835e89b2a3c33bc..623886101ae8289b2a76b5e87e482743ab0cdcc8 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -63,8 +63,6 @@ class LLScriptEdCore : public LLPanel public: LLScriptEdCore( - const std::string& name, - const LLRect& rect, const std::string& sample, const std::string& help_url, const LLHandle<LLFloater>& floater_handle, @@ -78,45 +76,30 @@ public: void initMenu(); virtual void draw(); - + /*virtual*/ BOOL postBuild(); BOOL canClose(); void setScriptText(const std::string& text, BOOL is_valid); + + void doSave( BOOL close_after_save ); bool handleSaveChangesDialog(const LLSD& notification, const LLSD& response); bool handleReloadFromServerDialog(const LLSD& notification, const LLSD& response); static bool onHelpWebDialog(const LLSD& notification, const LLSD& response); - static void onBtnHelp(void* userdata); - static void onBtnDynamicHelp(void* userdata); static void onCheckLock(LLUICtrl*, void*); static void onHelpComboCommit(LLUICtrl* ctrl, void* userdata); static void onClickBack(void* userdata); static void onClickForward(void* userdata); static void onBtnInsertSample(void*); static void onBtnInsertFunction(LLUICtrl*, void*); - static void doSave( void* userdata, BOOL close_after_save ); - static void onBtnSave(void*); - static void onBtnUndoChanges(void*); - static void onSearchMenu(void* userdata); - - static void onUndoMenu(void* userdata); - static void onRedoMenu(void* userdata); - static void onCutMenu(void* userdata); - static void onCopyMenu(void* userdata); - static void onPasteMenu(void* userdata); - static void onSelectAllMenu(void* userdata); - static void onDeselectMenu(void* userdata); - - static BOOL enableUndoMenu(void* userdata); - static BOOL enableRedoMenu(void* userdata); - static BOOL enableCutMenu(void* userdata); - static BOOL enableCopyMenu(void* userdata); - static BOOL enablePasteMenu(void* userdata); - static BOOL enableSelectAllMenu(void* userdata); - static BOOL enableDeselectMenu(void* userdata); - - static BOOL hasChanged(void* userdata); + +private: + void onBtnHelp(); + void onBtnDynamicHelp(); + void onBtnUndoChanges(); + + bool hasChanged(); void selectFirstError(); @@ -131,8 +114,6 @@ protected: void addHelpItemToHistory(const std::string& help_string); static void onErrorList(LLUICtrl*, void* user_data); - virtual const char *getTitleName() const { return "Script"; } - private: std::string mSampleText; std::string mHelpURL; @@ -160,17 +141,15 @@ private: class LLPreviewLSL : public LLPreview { public: - LLPreviewLSL(const std::string& name, const LLRect& rect, const std::string& title, - const LLUUID& item_uuid ); + LLPreviewLSL(const LLSD& key ); virtual void callbackLSLCompileSucceeded(); virtual void callbackLSLCompileFailed(const LLSD& compile_errors); - /*virtual*/ void open(); /*Flawfinder: ignore*/ + /*virtual*/ BOOL postBuild(); protected: virtual BOOL canClose(); void closeIfNeeded(); - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); virtual void loadAsset(); void saveIfNeeded(); @@ -190,15 +169,13 @@ protected: void* user_data, S32 status, LLExtStat ext_status); static void onSaveComplete(const LLUUID& uuid, void* user_data, S32 status, LLExtStat ext_status); static void onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status); -public: - static LLPreviewLSL* getInstance(const LLUUID& uuid); + protected: static void* createScriptEdPanel(void* userdata); protected: - virtual const char *getTitleName() const { return "Script"; } LLScriptEdCore* mScriptEd; // Can safely close only after both text and bytecode are uploaded S32 mPendingUploads; @@ -210,16 +187,10 @@ protected: class LLLiveLSLEditor : public LLPreview { public: - LLLiveLSLEditor(const std::string& name, const LLRect& rect, - const std::string& title, - const LLUUID& object_id, const LLUUID& item_id); + LLLiveLSLEditor(const LLSD& key); ~LLLiveLSLEditor(); - static LLLiveLSLEditor* show(const LLUUID& item_id, const LLUUID& object_id); - static void hide(const LLUUID& item_id, const LLUUID& object_id); - static LLLiveLSLEditor* find(const LLUUID& item_id, const LLUUID& object_id); - static void processScriptRunningReply(LLMessageSystem* msg, void**); virtual void callbackLSLCompileSucceeded(const LLUUID& task_id, @@ -227,14 +198,14 @@ public: bool is_script_running); virtual void callbackLSLCompileFailed(const LLSD& compile_errors); - // Overide LLPreview::open() to avoid calling loadAsset twice. - /*virtual*/ void open(); /*Flawfinder: ignore*/ - -protected: + /*virtual*/ BOOL postBuild(); + + void setIsNew() { mIsNew = TRUE; } + +private: virtual BOOL canClose(); void closeIfNeeded(); virtual void draw(); - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); virtual void loadAsset(); void loadAsset(BOOL is_new); @@ -248,6 +219,8 @@ protected: LLViewerObject* object, const LLTransactionID& tid, BOOL is_running); + BOOL monoChecked() const; + static void onSearchReplace(void* userdata); static void onLoad(void* userdata); @@ -268,30 +241,23 @@ protected: static void* createScriptEdPanel(void* userdata); + static void onMonoCheckboxClicked(LLUICtrl*, void* userdata); -protected: - LLUUID mObjectID; - LLUUID mItemID; // The inventory item this script is associated with - BOOL mIsNew; - LLScriptEdCore* mScriptEd; +private: + bool mIsNew; + LLScriptEdCore* mScriptEd; //LLUUID mTransmitID; - LLCheckBoxCtrl *mRunningCheckbox; - BOOL mAskedForRunningInfo; - BOOL mHaveRunningInfo; - LLButton *mResetButton; + LLCheckBoxCtrl* mRunningCheckbox; + BOOL mAskedForRunningInfo; + BOOL mHaveRunningInfo; + LLButton* mResetButton; LLPointer<LLViewerInventoryItem> mItem; - BOOL mCloseAfterSave; + BOOL mCloseAfterSave; // need to save both text and script, so need to decide when done - S32 mPendingUploads; + S32 mPendingUploads; - static LLMap<LLUUID, LLLiveLSLEditor*> sInstances; BOOL getIsModifiable() const { return mIsModifiable; } // Evaluated on load assert -private: - - static void onMonoCheckboxClicked(LLUICtrl*, void* userdata); - BOOL monoChecked() const; - LLCheckBoxCtrl* mMonoCheckbox; BOOL mIsModifiable; }; diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index 26d8da5a6b8f3ed1d18753ffab311accb05fb0da..7e7be5b2c68cbb9ce7f641c6ce4d9ff0138d90d2 100644 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -49,12 +49,23 @@ extern LLAgent gAgent; const F32 SOUND_GAIN = 1.0f; -LLPreviewSound::LLPreviewSound(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const LLUUID& object_uuid) : - LLPreview( name, rect, title, item_uuid, object_uuid) +LLPreviewSound::LLPreviewSound(const LLSD& key) + : LLPreview( key ) { - - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_sound.xml"); + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_sound.xml", FALSE); +} +// virtual +BOOL LLPreviewSound::postBuild() +{ + const LLInventoryItem* item = getItem(); + if (item) + { + childSetText("desc", item->getDescription()); + if (gAudiop) + gAudiop->preloadSound(item->getAssetUUID()); // preload the sound + } + childSetAction("Sound play btn",&LLPreviewSound::playSound,this); childSetAction("Sound audition btn",&LLPreviewSound::auditionSound,this); @@ -64,26 +75,10 @@ LLPreviewSound::LLPreviewSound(const std::string& name, const LLRect& rect, cons button = getChild<LLButton>("Sound audition btn"); button->setSoundFlags(LLView::SILENT); - const LLInventoryItem* item = getItem(); - childSetCommitCallback("desc", LLPreview::onText, this); - childSetText("desc", item->getDescription()); childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); - - // preload the sound - if(item && gAudiop) - { - gAudiop->preloadSound(item->getAssetUUID()); - } - - setTitle(title); - - if (!getHost()) - { - LLRect curRect = getRect(); - translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop); - } + return LLPreview::postBuild(); } // static diff --git a/indra/newview/llpreviewsound.h b/indra/newview/llpreviewsound.h index 061fbdf685a27119542d3e0dd6da07b69db316e8..c4bf8c9a3066f99485a24100fc1ce5550a45293b 100644 --- a/indra/newview/llpreviewsound.h +++ b/indra/newview/llpreviewsound.h @@ -38,16 +38,13 @@ class LLPreviewSound : public LLPreview { public: - LLPreviewSound(const std::string& name, const LLRect& rect, const std::string& title, - const LLUUID& item_uuid, - const LLUUID& object_uuid = LLUUID::null); + LLPreviewSound(const LLSD& key); static void playSound( void* userdata ); static void auditionSound( void* userdata ); protected: - virtual const char *getTitleName() const { return "Sound"; } - + /* virtual */ BOOL postBuild(); }; #endif // LL_LLPREVIEWSOUND_H diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 13e7cca464ee881a95a5086d5c5766899ff5155c..3204006e43bf52a1a738cbb99b626ba35899c9b2 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -37,10 +37,12 @@ #include "llagent.h" #include "llbutton.h" #include "llfilepicker.h" +#include "llfloaterreg.h" #include "llimagetga.h" #include "llinventoryview.h" #include "llinventory.h" #include "llresmgr.h" +#include "lltrans.h" #include "lltextbox.h" #include "lltextureview.h" #include "llui.h" @@ -50,30 +52,24 @@ #include "llviewerwindow.h" #include "lllineeditor.h" -const S32 PREVIEW_TEXTURE_MIN_WIDTH = 300; -const S32 PREVIEW_TEXTURE_MIN_HEIGHT = 120; - const S32 CLIENT_RECT_VPAD = 4; const F32 SECONDS_TO_SHOW_FILE_SAVED_MSG = 8.f; -LLPreviewTexture::LLPreviewTexture(const std::string& name, - const LLRect& rect, - const std::string& title, - const LLUUID& item_uuid, - const LLUUID& object_id, - BOOL show_keep_discard) -: LLPreview(name, rect, title, item_uuid, object_id, TRUE, PREVIEW_TEXTURE_MIN_WIDTH, PREVIEW_TEXTURE_MIN_HEIGHT ), - mLoadingFullImage( FALSE ), - mShowKeepDiscard(show_keep_discard), - mCopyToInv(FALSE), - mIsCopyable(FALSE), - mLastHeight(0), - mLastWidth(0) +LLPreviewTexture::LLPreviewTexture(const LLSD& key) + : LLPreview( key ), + mLoadingFullImage( FALSE ), + mShowKeepDiscard(FALSE), + mCopyToInv(FALSE), + mIsCopyable(FALSE), + mUpdateDimensions(TRUE), + mLastHeight(0), + mLastWidth(0) { const LLInventoryItem *item = getItem(); if(item) { + mShowKeepDiscard = item->getPermissions().getCreator() != gAgent.getID(); mImageID = item->getAssetUUID(); const LLPermissions& perm = item->getPermissions(); U32 mask = PERM_NONE; @@ -94,52 +90,14 @@ LLPreviewTexture::LLPreviewTexture(const std::string& name, mIsCopyable = TRUE; } } - - init(); - - setTitle(title); - - if (!getHost()) + else // not an item, assume it's an asset id { - LLRect curRect = getRect(); - translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop); + mImageID = mItemUUID; + mCopyToInv = TRUE; + mIsCopyable = TRUE; } -} - - -// Note: uses asset_id as a dummy item id. -LLPreviewTexture::LLPreviewTexture( - const std::string& name, - const LLRect& rect, - const std::string& title, - const LLUUID& asset_id, - BOOL copy_to_inv) - : - LLPreview( - name, - rect, - title, - asset_id, - LLUUID::null, - TRUE, - PREVIEW_TEXTURE_MIN_WIDTH, - PREVIEW_TEXTURE_MIN_HEIGHT ), - mImageID(asset_id), - mLoadingFullImage( FALSE ), - mShowKeepDiscard(FALSE), - mCopyToInv(copy_to_inv), - mIsCopyable(TRUE), - mLastHeight(0), - mLastWidth(0) -{ - init(); - - setTitle(title); - - LLRect curRect = getRect(); - translate(curRect.mLeft - rect.mLeft, curRect.mTop - rect.mTop); - + //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_texture.xml", FALSE); } @@ -153,32 +111,26 @@ LLPreviewTexture::~LLPreviewTexture() mImage = NULL; } - -void LLPreviewTexture::init() +// virtual +BOOL LLPreviewTexture::postBuild() { - - if (mCopyToInv) { - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_embedded_texture.xml"); - - childSetAction("Copy To Inventory",LLPreview::onBtnCopyToInv,this); + getChild<LLButton>("Keep")->setLabel(getString("Copy")); + childSetAction("Keep",LLPreview::onBtnCopyToInv,this); + childSetVisible("Discard", false); } - else if (mShowKeepDiscard) { - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_texture_keep_discard.xml"); - childSetAction("Keep",onKeepBtn,this); childSetAction("Discard",onDiscardBtn,this); } - - else + else { - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_texture.xml"); + childSetVisible("Keep", false); + childSetVisible("Discard", false); } - - + if (!mCopyToInv) { const LLInventoryItem* item = getItem(); @@ -190,12 +142,17 @@ void LLPreviewTexture::init() childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); } } + + return LLPreview::postBuild(); } void LLPreviewTexture::draw() { - updateDimensions(); - + if (mUpdateDimensions) + { + updateDimensions(); + } + LLPreview::draw(); if (!isMinimized()) @@ -241,11 +198,11 @@ void LLPreviewTexture::draw() if( mLoadingFullImage ) { - // *TODO: Translate - LLFontGL::getFontSansSerif()->renderUTF8(std::string("Receiving:"), 0, + LLFontGL::getFontSansSerif()->renderUTF8(LLTrans::getString("Receiving:"), 0, interior.mLeft + 4, interior.mBottom + 4, LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM, + LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); F32 data_progress = mImage->mDownloadProgress; @@ -278,11 +235,11 @@ void LLPreviewTexture::draw() else if( !mSavedFileTimer.hasExpired() ) { - // *TODO: Translate - LLFontGL::getFontSansSerif()->renderUTF8(std::string("File Saved"), 0, + LLFontGL::getFontSansSerif()->renderUTF8(LLTrans::getString("FileSaved"), 0, interior.mLeft + 4, interior.mBottom + 4, LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM, + LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); } } @@ -300,10 +257,11 @@ BOOL LLPreviewTexture::canSaveAs() const // virtual void LLPreviewTexture::saveAs() { - if( mLoadingFullImage ) return; + if( mLoadingFullImage ) + return; LLFilePicker& file_picker = LLFilePicker::instance(); - const LLViewerInventoryItem* item = getItem() ; + const LLInventoryItem* item = getItem() ; if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_TGA, item ? LLDir::getScrubbedFileName(item->getName()) : LLStringUtil::null) ) { // User canceled or we failed to acquire save file. @@ -317,6 +275,23 @@ void LLPreviewTexture::saveAs() 0, TRUE, FALSE, new LLUUID( mItemUUID ) ); } +// virtual +void LLPreviewTexture::reshape(S32 width, S32 height, BOOL called_from_parent) +{ +// mLastHeight = 0; +// mLastWidth = 0; + mUpdateDimensions = TRUE; + LLPreview::reshape(width, height, called_from_parent); +} + +// virtual +void LLPreviewTexture::onFocusReceived() +{ + mLastHeight = 0; + mLastWidth = 0; + mUpdateDimensions = TRUE; + LLPreview::onFocusReceived(); +} // static void LLPreviewTexture::onFileLoadedForSave(BOOL success, @@ -328,12 +303,8 @@ void LLPreviewTexture::onFileLoadedForSave(BOOL success, void* userdata) { LLUUID* item_uuid = (LLUUID*) userdata; - LLPreviewTexture* self = NULL; - preview_map_t::iterator found_it = LLPreview::sInstances.find(*item_uuid); - if(found_it != LLPreview::sInstances.end()) - { - self = (LLPreviewTexture*) found_it->second; - } + + LLPreviewTexture* self = LLFloaterReg::findTypedInstance<LLPreviewTexture>("preview_texture", *item_uuid); if( final || !success ) { @@ -381,8 +352,11 @@ void LLPreviewTexture::onFileLoadedForSave(BOOL success, // When we receive it, reshape the window accordingly. void LLPreviewTexture::updateDimensions() { - if (!mImage) return; - + if (!mImage) + return; + + mUpdateDimensions = FALSE; + S32 image_height = llmax(1, mImage->getHeight(0)); S32 image_width = llmax(1, mImage->getWidth(0)); // Attempt to make the image 1:1 on screen. @@ -400,7 +374,7 @@ void LLPreviewTexture::updateDimensions() client_width /= 2; client_height /= 2; } - + S32 view_width = client_width + horiz_pad; S32 view_height = client_height + vert_pad; @@ -427,27 +401,36 @@ void LLPreviewTexture::updateDimensions() view_width = llmax(view_width, getMinWidth()); view_height = llmax(view_height, getMinHeight()); - if (client_height != mLastHeight || client_width != mLastWidth) + if (view_height != mLastHeight || view_width != mLastWidth) { - mLastWidth = client_width; - mLastHeight = client_height; - - S32 old_top = getRect().mTop; - S32 old_left = getRect().mLeft; if (getHost()) { getHost()->growToFit(view_width, view_height); + reshape( view_width, view_height ); + setOrigin( 0, getHost()->getRect().getHeight() - (view_height + PREVIEW_HEADER_SIZE) ); } else { + S32 old_top = getRect().mTop; + S32 old_left = getRect().mLeft; reshape( view_width, view_height ); S32 new_bottom = old_top - getRect().getHeight(); setOrigin( old_left, new_bottom ); - // Try to keep whole view onscreen, don't allow partial offscreen. + } + + // Try to keep whole view onscreen, don't allow partial offscreen. + if (getHost()) + gFloaterView->adjustToFitScreen(getHost(), FALSE); + else gFloaterView->adjustToFitScreen(this, FALSE); + + if (image_height > 1 && image_width > 1) + { + // Resize until we know the image's height + mLastWidth = view_width; + mLastHeight = view_height; } } - if (!mUserResized) { @@ -484,6 +467,7 @@ void LLPreviewTexture::loadAsset() mImage = gImageList.getImage(mImageID, MIPMAP_TRUE, FALSE); mImage->setBoostLevel(LLViewerImage::BOOST_PREVIEW); mAssetStatus = PREVIEW_ASSET_LOADING; + updateDimensions(); } LLPreview::EAssetStatus LLPreviewTexture::getAssetStatus() diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index 75fd39eab0c3d618fbc5ded8e4ba86cfc2f4a115..45b173e7bfe9e33f08b9a40e385678f413383ee4 100644 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -43,19 +43,7 @@ class LLImageRaw; class LLPreviewTexture : public LLPreview { public: - LLPreviewTexture( - const std::string& name, - const LLRect& rect, - const std::string& title, - const LLUUID& item_uuid, - const LLUUID& object_id, - BOOL show_keep_discard = FALSE); - LLPreviewTexture( - const std::string& name, - const LLRect& rect, - const std::string& title, - const LLUUID& asset_id, - BOOL copy_to_inv = FALSE); + LLPreviewTexture(const LLSD& key); ~LLPreviewTexture(); virtual void draw(); @@ -65,7 +53,10 @@ public: virtual void loadAsset(); virtual EAssetStatus getAssetStatus(); - + + virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + virtual void onFocusReceived(); + static void saveToFile(void* userdata); static void onFileLoadedForSave( BOOL success, @@ -79,9 +70,8 @@ public: protected: void init(); + /* virtual */ BOOL postBuild(); - virtual const char *getTitleName() const { return "Texture"; } - private: void updateDimensions(); LLUUID mImageID; @@ -91,13 +81,14 @@ private: LLFrameTimer mSavedFileTimer; BOOL mShowKeepDiscard; BOOL mCopyToInv; - + // This is stored off in a member variable, because the save-as // button and drag and drop functionality need to know. BOOL mIsCopyable; S32 mLastHeight; S32 mLastWidth; + BOOL mUpdateDimensions; }; diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index bfd14f709ad14090b554584df6a8693c91dea84b..38d617e4687a5a1fca5c41cb2cfa86f4e4e3b28f 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -42,6 +42,7 @@ #include "llfontgl.h" #include "llimagegl.h" #include "lltimer.h" +#include "lltextbox.h" #include "llglheaders.h" #include "llagent.h" @@ -68,9 +69,9 @@ const F32 TOTAL_LOGIN_TIME = 10.f; // seconds, wild guess at time from GL contex S32 gLastStartAnimationFrame = 0; // human-style indexing, first image = 1 const S32 ANIMATION_FRAMES = 1; //13; -// XUI:translate -LLProgressView::LLProgressView(const std::string& name, const LLRect &rect) -: LLPanel(name, rect, FALSE), +// XUI: Translate +LLProgressView::LLProgressView(const LLRect &rect) +: LLPanel(), mPercentDone( 0.f ), mURLInMessage(false), mMouseDownInActiveArea( false ) @@ -84,7 +85,7 @@ BOOL LLProgressView::postBuild() mProgressBar = getChild<LLProgressBar>("login_progress_bar"); mCancelBtn = getChild<LLButton>("cancel_btn"); - mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked ); + mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL ); mFadeTimer.stop(); getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle())); diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index 9517ee1321e88af464cf826887a27fe7ba4324ba..83574ff52ad5526037755c876788875d58a45dff 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -43,7 +43,7 @@ class LLProgressBar; class LLProgressView : public LLPanel { public: - LLProgressView(const std::string& name, const LLRect& rect); + LLProgressView(const LLRect& rect); virtual ~LLProgressView(); BOOL postBuild(); diff --git a/indra/newview/llrecentpeople.cpp b/indra/newview/llrecentpeople.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0c16cea00499ad90d19b18ae30dc933bb4414df8 --- /dev/null +++ b/indra/newview/llrecentpeople.cpp @@ -0,0 +1,69 @@ +/** + * @file llrecentpeople.cpp + * @brief List of people with which the user has recently interacted. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llrecentpeople.h" + +#include "llagent.h" + +using namespace LLOldEvents; + +bool LLRecentPeople::add(const LLUUID& id) +{ + if (contains(id) || id == gAgent.getID()) + return false; + + mList.insert(id); + mChangedSignal(); + return true; +} + +bool LLRecentPeople::contains(const LLUUID& id) const +{ + return mList.find(id) != mList.end(); +} + +void LLRecentPeople::get(std::vector<LLUUID>& result) const +{ + result.clear(); + for (std::set<LLUUID>::const_iterator pos = mList.begin(); pos != mList.end(); ++pos) + result.push_back(*pos); +} + +// virtual +bool LLRecentPeople::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) +{ + (void) userdata; + add(event->getValue().asUUID()); + return true; +} diff --git a/indra/newview/llrecentpeople.h b/indra/newview/llrecentpeople.h new file mode 100644 index 0000000000000000000000000000000000000000..fce4b8d42b558765ab8dc9c19786b98b32748bff --- /dev/null +++ b/indra/newview/llrecentpeople.h @@ -0,0 +1,101 @@ +/** + * @file llrecentpeople.h + * @brief List of people with which the user has recently interacted. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLRECENTPEOPLE_H +#define LL_LLRECENTPEOPLE_H + +#include "llevent.h" +#include "llsingleton.h" +#include "lluuid.h" + +#include <vector> +#include <set> +#include <boost/signal.hpp> + +/** + * List of people the agent recently interacted with. + * + * Includes: anyone with whom the user IM'd or called + * (1:1 and ad-hoc but not SL Group chat), + * anyone with whom the user has had a transaction + * (inventory offer, friend request, etc), + * and anyone that has chatted within chat range of the user in-world. + * + *TODO: purge least recently added items? + */ +class LLRecentPeople: public LLSingleton<LLRecentPeople>, public LLOldEvents::LLSimpleListener +{ + LOG_CLASS(LLRecentPeople); +public: + typedef boost::signal<void ()> signal_t; + + /** + * Add specified avatar to the list if it's not there already. + * + * @param id avatar to add. + * @return false if the avatar is in the list already, true otherwisr + */ + bool add(const LLUUID& id); + + /** + * @param id avatar to search. + * @return true if the avatar is in the list, false otherwise. + */ + bool contains(const LLUUID& id) const; + + /** + * Get the whole list. + * + * @param result where to put the result. + */ + void get(std::vector<LLUUID>& result) const; + + /** + * Set callback to be called when the list changed. + * + * Multiple callbacks can be set. + * + * @return no connection; use boost::bind + boost::signal::trackable to disconnect slots. + */ + void setChangedCallback(const signal_t::slot_type& cb) { mChangedSignal.connect(cb); } + + /** + * LLSimpleListener interface. + */ + /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); + +private: + std::set<LLUUID> mList; + signal_t mChangedSignal; +}; + +#endif // LL_LLRECENTPEOPLE_H diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp index 8ff4dea2b1b01177943a75d869b1b200f04a22be..fe4e8b5d0c8017c7074ca26bc1aea6ae7020bdaa 100644 --- a/indra/newview/llremoteparcelrequest.cpp +++ b/indra/newview/llremoteparcelrequest.cpp @@ -34,8 +34,7 @@ #include "llviewerprecompiledheaders.h" -#include "llagent.h" -#include "llremoteparcelrequest.h" +#include "message.h" #include "llpanelplace.h" #include "llpanel.h" @@ -43,37 +42,120 @@ #include "llsdserialize.h" #include "llviewerregion.h" #include "llview.h" -#include "message.h" -LLRemoteParcelRequestResponder::LLRemoteParcelRequestResponder(LLHandle<LLPanel> place_panel_handle) -{ - mPlacePanelHandle = place_panel_handle; -} -/*virtual*/ +#include "llagent.h" +#include "llremoteparcelrequest.h" + + +LLRemoteParcelRequestResponder::LLRemoteParcelRequestResponder(LLHandle<LLRemoteParcelInfoObserver> observer_handle) + : mObserverHandle(observer_handle) +{} + +//If we get back a normal response, handle it here +//virtual void LLRemoteParcelRequestResponder::result(const LLSD& content) { LLUUID parcel_id = content["parcel_id"]; - LLPanelPlace* place_panelp = (LLPanelPlace*)mPlacePanelHandle.get(); + mObserverHandle.get()->setParcelID(parcel_id); +} + +//If we get back an error (not found, etc...), handle it here +//virtual +void LLRemoteParcelRequestResponder::error(U32 status, const std::string& reason) +{ + llinfos << "LLRemoteParcelRequest::error(" + << status << ": " << reason << ")" << llendl; + + mObserverHandle.get()->setErrorStatus(status, reason); +} - if(place_panelp) +void LLRemoteParcelInfoProcessor::addObserver(const LLUUID& parcel_id, LLRemoteParcelInfoObserver* observer) +{ + // Check if the observer is alredy in observsrs list for this UUID + observer_multimap_t::iterator it; + + it = mObservers.find(parcel_id); + while (it != mObservers.end()) { - place_panelp->setParcelID(parcel_id); + if (it->second == observer) + { + return; + } + else + { + ++it; + } } + mObservers.insert(std::pair<LLUUID, LLRemoteParcelInfoObserver*>(parcel_id, observer)); } -/*virtual*/ -void LLRemoteParcelRequestResponder::error(U32 status, const std::string& reason) +void LLRemoteParcelInfoProcessor::removeObserver(const LLUUID& parcel_id, LLRemoteParcelInfoObserver* observer) { - llinfos << "LLRemoteParcelRequest::error(" - << status << ": " << reason << ")" << llendl; - LLPanelPlace* place_panelp = (LLPanelPlace*)mPlacePanelHandle.get(); + if (!observer) + { + return; + } - if(place_panelp) + observer_multimap_t::iterator it; + + it = mObservers.find(parcel_id); + while (it != mObservers.end()) { - place_panelp->setErrorStatus(status, reason); + if (it->second == observer) + { + mObservers.erase(it); + break; + } + else + { + ++it; + } } +} +//static +void LLRemoteParcelInfoProcessor::processParcelInfoReply(LLMessageSystem* msg, void**) +{ + LLParcelData parcel_data; + + msg->getUUID ("Data", "ParcelID", parcel_data.parcel_id); + msg->getUUID ("Data", "OwnerID", parcel_data.owner_id); + msg->getString ("Data", "Name", parcel_data.name); + msg->getString ("Data", "Desc", parcel_data.desc); + msg->getS32 ("Data", "ActualArea", parcel_data.actual_area); + msg->getS32 ("Data", "BillableArea", parcel_data.billable_area); + msg->getU8 ("Data", "Flags", parcel_data.flags); + msg->getF32 ("Data", "GlobalX", parcel_data.global_x); + msg->getF32 ("Data", "GlobalY", parcel_data.global_y); + msg->getF32 ("Data", "GlobalZ", parcel_data.global_z); + msg->getString ("Data", "SimName", parcel_data.sim_name); + msg->getUUID ("Data", "SnapshotID", parcel_data.snapshot_id); + msg->getF32 ("Data", "Dwell", parcel_data.dwell); + msg->getS32 ("Data", "SalePrice", parcel_data.sale_price); + msg->getS32 ("Data", "AuctionID", parcel_data.auction_id); + + LLRemoteParcelInfoProcessor::observer_multimap_t observers = LLRemoteParcelInfoProcessor::getInstance()->mObservers; + + observer_multimap_t::iterator oi = observers.find(parcel_data.parcel_id); + observer_multimap_t::iterator end = observers.upper_bound(parcel_data.parcel_id); + for (; oi != end; ++oi) + { + oi->second->processParcelInfo(parcel_data); + LLRemoteParcelInfoProcessor::getInstance()->removeObserver(parcel_data.parcel_id, oi->second); + } } +void LLRemoteParcelInfoProcessor::sendParcelInfoRequest(const LLUUID& parcel_id) +{ + LLMessageSystem *msg = gMessageSystem; + + msg->newMessage("ParcelInfoRequest"); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->nextBlock("Data"); + msg->addUUID("ParcelID", parcel_id); + gAgent.sendReliableMessage(); +} diff --git a/indra/newview/llremoteparcelrequest.h b/indra/newview/llremoteparcelrequest.h index c92ee3ff3a268b12c13f9c069a6d6fe3137161ba..3a16e25ef619cc136c8579443698c1f6622056cb 100644 --- a/indra/newview/llremoteparcelrequest.h +++ b/indra/newview/llremoteparcelrequest.h @@ -38,17 +38,73 @@ #include "llhttpclient.h" #include "llpanel.h" +class LLRemoteParcelInfoObserver; + class LLRemoteParcelRequestResponder : public LLHTTPClient::Responder { public: - LLRemoteParcelRequestResponder(LLHandle<LLPanel> place_panel_handle); + LLRemoteParcelRequestResponder(LLHandle<LLRemoteParcelInfoObserver> observer_handle); + //If we get back a normal response, handle it here - virtual void result(const LLSD& content); + /*virtual*/ void result(const LLSD& content); + //If we get back an error (not found, etc...), handle it here - virtual void error(U32 status, const std::string& reason); + /*virtual*/ void error(U32 status, const std::string& reason); + +protected: + LLHandle<LLRemoteParcelInfoObserver> mObserverHandle; +}; + +struct LLParcelData +{ + LLUUID parcel_id; + LLUUID owner_id; + std::string name; + std::string desc; + S32 actual_area; + S32 billable_area; + U8 flags; + F32 global_x; + F32 global_y; + F32 global_z; + std::string sim_name; + LLUUID snapshot_id; + F32 dwell; + S32 sale_price; + S32 auction_id; +}; + +// An interface class for panels which display parcel information +// like name, description, area, snapshot etc. +class LLRemoteParcelInfoObserver +{ +public: + LLRemoteParcelInfoObserver() { mObserverHandle.bind(this); } + virtual ~LLRemoteParcelInfoObserver() {} + virtual void processParcelInfo(const LLParcelData& parcel_data) = 0; + virtual void setParcelID(const LLUUID& parcel_id) = 0; + virtual void setErrorStatus(U32 status, const std::string& reason) = 0; + LLHandle<LLRemoteParcelInfoObserver> getObserverHandle() const { return mObserverHandle; } protected: - LLHandle<LLPanel> mPlacePanelHandle; + LLRootHandle<LLRemoteParcelInfoObserver> mObserverHandle; +}; + +class LLRemoteParcelInfoProcessor : public LLSingleton<LLRemoteParcelInfoProcessor> +{ +public: + virtual ~LLRemoteParcelInfoProcessor() {} + + void addObserver(const LLUUID& parcel_id, LLRemoteParcelInfoObserver* observer); + void removeObserver(const LLUUID& parcel_id, LLRemoteParcelInfoObserver* observer); + + void sendParcelInfoRequest(const LLUUID& parcel_id); + + static void processParcelInfoReply(LLMessageSystem* msg, void**); + +private: + typedef std::multimap<LLUUID, LLRemoteParcelInfoObserver*> observer_multimap_t; + observer_multimap_t mObservers; }; #endif // LL_LLREMOTEPARCELREQUEST_H diff --git a/indra/newview/llrootview.h b/indra/newview/llrootview.h new file mode 100644 index 0000000000000000000000000000000000000000..af9517f922c7448a04a5e72d470ec60170369bf1 --- /dev/null +++ b/indra/newview/llrootview.h @@ -0,0 +1,55 @@ +/** + * @file llrootview.h + * @brief Mother of all Views + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLROOTVIEW_H +#define LL_LLROOTVIEW_H + +#include "llview.h" +#include "lluictrlfactory.h" + +class LLRootViewRegistry : public LLWidgetRegistry<LLRootViewRegistry> +{}; + +class LLRootView : public LLView +{ +public: + LLRootView(const Params& p) + : LLView(p) + {} + + const widget_registry_t& getChildRegistry() const + { + // use default widget registry + return LLRootViewRegistry::instance(); + } +}; +#endif //LL_LLROOTVIEW_H diff --git a/indra/newview/llsavedsettingsglue.cpp b/indra/newview/llsavedsettingsglue.cpp index 073b51f80e8a14e501c3780b797274242da7ec40..4736afa7ba1c504b9037763fb4b52c6b367f7376 100644 --- a/indra/newview/llsavedsettingsglue.cpp +++ b/indra/newview/llsavedsettingsglue.cpp @@ -39,37 +39,27 @@ #include "llviewercontrol.h" -void LLSavedSettingsGlue::setBOOL(LLUICtrl* ctrl, void* data) +void LLSavedSettingsGlue::setBOOL(LLUICtrl* ctrl, const std::string& name) { - const char* name = (const char*)data; - LLSD value = ctrl->getValue(); - gSavedSettings.setBOOL(name, value.asBoolean()); + gSavedSettings.setBOOL(name, ctrl->getValue().asBoolean()); } -void LLSavedSettingsGlue::setS32(LLUICtrl* ctrl, void* data) +void LLSavedSettingsGlue::setS32(LLUICtrl* ctrl, const std::string& name) { - const char* name = (const char*)data; - LLSD value = ctrl->getValue(); - gSavedSettings.setS32(name, value.asInteger()); + gSavedSettings.setS32(name, ctrl->getValue().asInteger()); } -void LLSavedSettingsGlue::setF32(LLUICtrl* ctrl, void* data) +void LLSavedSettingsGlue::setF32(LLUICtrl* ctrl, const std::string& name) { - const char* name = (const char*)data; - LLSD value = ctrl->getValue(); - gSavedSettings.setF32(name, (F32)value.asReal()); + gSavedSettings.setF32(name, (F32)ctrl->getValue().asReal()); } -void LLSavedSettingsGlue::setU32(LLUICtrl* ctrl, void* data) +void LLSavedSettingsGlue::setU32(LLUICtrl* ctrl, const std::string& name) { - const char* name = (const char*)data; - LLSD value = ctrl->getValue(); - gSavedSettings.setU32(name, (U32)value.asInteger()); + gSavedSettings.setU32(name, (U32)ctrl->getValue().asInteger()); } -void LLSavedSettingsGlue::setString(LLUICtrl* ctrl, void* data) +void LLSavedSettingsGlue::setString(LLUICtrl* ctrl, const std::string& name) { - const char* name = (const char*)data; - LLSD value = ctrl->getValue(); - gSavedSettings.setString(name, value.asString()); + gSavedSettings.setString(name, ctrl->getValue().asString()); } diff --git a/indra/newview/llsavedsettingsglue.h b/indra/newview/llsavedsettingsglue.h index 8a0f36945c8da275bf3f290fdd7d9724425fc709..6c8662dd58a30e170f318d0f8da08d2c3171fc4f 100644 --- a/indra/newview/llsavedsettingsglue.h +++ b/indra/newview/llsavedsettingsglue.h @@ -42,11 +42,11 @@ class LLUICtrl; class LLSavedSettingsGlue { public: - static void setBOOL(LLUICtrl* ctrl, void* name); - static void setS32(LLUICtrl* ctrl, void* name); - static void setF32(LLUICtrl* ctrl, void* name); - static void setU32(LLUICtrl* ctrl, void* name); - static void setString(LLUICtrl* ctrl, void* name); + static void setBOOL(LLUICtrl* ctrl, const std::string& name); + static void setS32(LLUICtrl* ctrl, const std::string& name); + static void setF32(LLUICtrl* ctrl, const std::string& name); + static void setU32(LLUICtrl* ctrl, const std::string& name); + static void setString(LLUICtrl* ctrl, const std::string& name); }; #endif diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 0c6b2980dc8fddaff942556c27612d7d07775556..ed7c7dce12baf2a7a441241091df283b5af049a0 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -79,7 +79,7 @@ #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llviewerstats.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llvovolume.h" #include "pipeline.h" @@ -100,10 +100,10 @@ const S32 MAX_OBJECTS_PER_PACKET = 254; // Globals // -BOOL gDebugSelectMgr = FALSE; +//BOOL gDebugSelectMgr = FALSE; -BOOL gHideSelectedObjects = FALSE; -BOOL gAllowSelectAvatar = FALSE; +//BOOL gHideSelectedObjects = FALSE; +//BOOL gAllowSelectAvatar = FALSE; BOOL LLSelectMgr::sRectSelectInclusive = TRUE; BOOL LLSelectMgr::sRenderHiddenSelections = TRUE; @@ -172,6 +172,9 @@ LLObjectSelection *get_null_object_selection() // LLSelectMgr() //----------------------------------------------------------------------------- LLSelectMgr::LLSelectMgr() + : mHideSelectedObjects(LLCachedControl<bool>(gSavedSettings, "HideSelectedObjects", FALSE)), + mAllowSelectAvatar( LLCachedControl<bool>(gSavedSettings, "AllowSelectAvatar", FALSE)), + mDebugSelectMgr(LLCachedControl<bool>(gSavedSettings, "DebugSelectMgr", FALSE)) { mTEMode = FALSE; mLastCameraPos.clearVec(); @@ -184,12 +187,12 @@ LLSelectMgr::LLSelectMgr() sHighlightUAnim = gSavedSettings.getF32("SelectionHighlightUAnim"); sHighlightVAnim = gSavedSettings.getF32("SelectionHighlightVAnim"); - sSilhouetteParentColor = gColors.getColor("SilhouetteParentColor"); - sSilhouetteChildColor = gColors.getColor("SilhouetteChildColor"); - sHighlightParentColor = gColors.getColor("HighlightParentColor"); - sHighlightChildColor = gColors.getColor("HighlightChildColor"); - sHighlightInspectColor = gColors.getColor("HighlightInspectColor"); - sContextSilhouetteColor = gColors.getColor("ContextSilhouetteColor")*0.5f; + sSilhouetteParentColor =gSavedSkinSettings.getColor("SilhouetteParentColor"); + sSilhouetteChildColor = gSavedSkinSettings.getColor("SilhouetteChildColor"); + sHighlightParentColor = gSavedSkinSettings.getColor("HighlightParentColor"); + sHighlightChildColor = gSavedSkinSettings.getColor("HighlightChildColor"); + sHighlightInspectColor = gSavedSkinSettings.getColor("HighlightInspectColor"); + sContextSilhouetteColor = gSavedSkinSettings.getColor("ContextSilhouetteColor")*0.5f; sRenderLightRadius = gSavedSettings.getBOOL("RenderLightRadius"); @@ -202,6 +205,8 @@ LLSelectMgr::LLSelectMgr() mSelectedObjects = new LLObjectSelection(); mHoverObjects = new LLObjectSelection(); mHighlightedObjects = new LLObjectSelection(); + + } @@ -673,7 +678,7 @@ void LLSelectMgr::addAsFamily(std::vector<LLViewerObject*>& objects, BOOL add_to // Can't select yourself if (objectp->mID == gAgentID - && !gAllowSelectAvatar) + && !LLSelectMgr::getInstance()->mAllowSelectAvatar) { continue; } @@ -2691,7 +2696,7 @@ void LLSelectMgr::selectDelete() } LLNotification::Params params("ConfirmObjectDeleteLock"); - params.functor(boost::bind(&LLSelectMgr::confirmDelete, _1, _2, getSelection())); + params.functor.function(boost::bind(&LLSelectMgr::confirmDelete, _1, _2, getSelection())); if(locked_but_deleteable_object || no_copy_but_deleteable_object || @@ -3443,7 +3448,7 @@ void LLSelectMgr::deselectAllIfTooFar() if (select_dist_sq > deselect_dist_sq) { - if (gDebugSelectMgr) + if (mDebugSelectMgr) { llinfos << "Selection manager: auto-deselecting, select_dist = " << fsqrtf(select_dist_sq) << llendl; llinfos << "agent pos global = " << gAgent.getPositionGlobal() << llendl; @@ -4444,9 +4449,9 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, desc); // the reporter widget askes the server for info about picked objects - if (request_flags & (COMPLAINT_REPORT_REQUEST | BUG_REPORT_REQUEST)) + if (request_flags & COMPLAINT_REPORT_REQUEST ) { - EReportType report_type = (COMPLAINT_REPORT_REQUEST & request_flags) ? COMPLAINT_REPORT : BUG_REPORT; + EReportType report_type = COMPLAINT_REPORT ; LLFloaterReporter *reporterp = LLFloaterReporter::getReporter(report_type); if (reporterp) { @@ -5387,10 +5392,7 @@ void dialog_refresh_all() gFloaterTools->dirty(); - if( gPieObject->getVisible() ) - { - gPieObject->arrange(); - } + gPieObject->needsArrange(); if( gPieAttachment->getVisible() ) { diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index d6c4b5485db646083942006bf3c3e8b67844febd..992cc1e9062c1dc1a4c6b8346c4eea7059cb2f16 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -38,7 +38,8 @@ #include "llstring.h" #include "llundo.h" #include "lluuid.h" -#include "llmemory.h" +#include "llpointer.h" +#include "llsafehandle.h" #include "llsaleinfo.h" #include "llcategory.h" #include "v3dmath.h" @@ -48,7 +49,7 @@ #include "llbbox.h" #include "llpermissions.h" #include "llviewerobject.h" - +#include "llcontrol.h" #include <deque> #include "boost/iterator/filter_iterator.hpp" @@ -338,6 +339,7 @@ public: static BOOL sRectSelectInclusive; // do we need to surround an object to pick it? static BOOL sRenderHiddenSelections; // do we show selection silhouettes that are occluded? static BOOL sRenderLightRadius; // do we show the radius of selected lights? + static F32 sHighlightThickness; static F32 sHighlightUScale; static F32 sHighlightVScale; @@ -352,6 +354,10 @@ public: static LLColor4 sHighlightInspectColor; static LLColor4 sContextSilhouetteColor; + LLCachedControl<bool> mHideSelectedObjects; + LLCachedControl<bool> mAllowSelectAvatar; + LLCachedControl<bool> mDebugSelectMgr; + public: LLSelectMgr(); ~LLSelectMgr(); diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e7008abe605f27729ed6d4a3f97bae0654937aa5 --- /dev/null +++ b/indra/newview/llsidetray.cpp @@ -0,0 +1,746 @@ +/** + * @file llsidetray.cpp + * @brief SideBar implementation + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "lltextbox.h" + +#include "llsidetray.h" +#include "llviewerwindow.h" +#include "llaccordionpanel.h" +#include "llfocusmgr.h" +#include "llrootview.h" + +#include "llcollapsiblectrl.h" + +#include "llfloater.h" //for gFloaterView +#include "lliconctrl.h"//for Home tab icon +#include "llwindow.h"//for SetCursor +#include "llbottomtray.h"//for reshape + +//#include "llscrollcontainer.h" + +using namespace std; + +static LLRootViewRegistry::Register<LLSideTray> t1("side_tray"); +static LLDefaultWidgetRegistry::Register<LLSideTrayTab> t2("sidetray_tab"); + +static const std::string COLLAPSED_NAME = "<<"; +static const std::string EXPANDED_NAME = ">>"; + +static const std::string TAB_PANEL_CAPTION_NAME = "sidetray_tab_panel"; +static const std::string TAB_PANEL_CAPTION_TITLE_BOX = "sidetray_tab_title"; + +LLSideTray* LLSideTray::sInstance = 0; + +class LLSideTrayInfoPanel: public LLPanel +{ +protected: + LLSideTrayInfoPanel(){} +public: + static LLSideTrayInfoPanel* createInstance(const string& image, const string& name,const string& description) + { + LLSideTrayInfoPanel* panel = new LLSideTrayInfoPanel(); + LLUICtrlFactory::getInstance()->buildPanel(panel,"panel_sidetray_tab_info.xml"); + if(panel) + panel->setData(image, name,description); + panel->setBorderVisible(true); + return panel; + + } + void setData(const string& image, const string& name,const string& description) + { + getChild<LLTextBox>("tab_name",false,false)->setValue(name); + getChild<LLTextBox>("tab_description",false,false)->setValue(description); + getChild<LLIconCtrl>("tab_icon",false,false)->setValue(image); + } + + BOOL handleHover(S32 x, S32 y, MASK mask) + { + getWindow()->setCursor(UI_CURSOR_HAND); + return TRUE; + } + + BOOL handleMouseUp(S32 x, S32 y, MASK mask) + { + onCommit(); + return LLPanel::handleMouseUp(x,y,mask); + } + +}; + + +LLSideTray* LLSideTray::getInstance() +{ + if (!sInstance) + { + sInstance = LLUICtrlFactory::createFromFile<LLSideTray>("panel_side_tray.xml",gViewerWindow->getRootView()); + } + + return sInstance; +} + +bool LLSideTray::instanceCreated () +{ + return sInstance!=0; +} + +LLSideTrayTab::LLSideTrayTab(const Params& params):mAccordionPanel(0) + +{ + mImagePath = params.image_path; + mTabTitle = params.tab_title; + mDescription = params.tab_description; +} +LLSideTrayTab::~LLSideTrayTab() +{ +} + +void LLSideTrayTab::addPanel(LLPanel* panel) +{ + //addChild(panel,false); +} + +bool LLSideTrayTab::addChild(LLView* view, S32 tab_group) +{ + if(mAccordionPanel == 0) + { + mAccordionPanel = new LLAccordionPanel(); + mAccordionPanel->setVisible(TRUE); + LLPanel::addChild(mAccordionPanel,tab_group); + } + + + bool res = true; + if(TAB_PANEL_CAPTION_NAME != view->getName())//skip our caption panel + { + mAccordionPanel->addCollapsibleCtrl(view); + } + else + res = LLPanel::addChild(view,tab_group); + + return res; +} + + + +//virtual +BOOL LLSideTrayTab::postBuild() +{ + LLPanel* title_panel = LLUICtrlFactory::getInstance()->createFromFile<LLPanel>("panel_side_tray_tab_caption.xml",this); + string name = title_panel->getName(); + LLPanel::addChild(title_panel); + + title_panel->getChild<LLTextBox>(TAB_PANEL_CAPTION_TITLE_BOX)->setValue(mTabTitle); + + static LLUICachedControl<LLColor4> default_background_color ("FloaterDefaultBackgroundColor", *(new LLColor4)); + static LLUICachedControl<LLColor4> focus_background_color ("FloaterFocusBackgroundColor", *(new LLColor4)); + + setTransparentColor(default_background_color); + setBackgroundColor(focus_background_color); + + return true; +} + +S32 LLSideTrayTab::getMaxSideBarTabWidth() +{ + return (mAccordionPanel)?mAccordionPanel->getMaxPanelWidth():0; +} + +static const S32 splitter_margin = 1; + +//virtual +void LLSideTrayTab::arrange(S32 width, S32 height ) +{ + S32 offset = 0; + + LLView* title_panel = getChildView(TAB_PANEL_CAPTION_NAME, true, false); + + if(title_panel) + { + title_panel->setOrigin( 0, height - title_panel->getRect().getHeight() ); + offset = title_panel->getRect().getHeight(); + } + + LLRect sRect = mAccordionPanel->getRect(); + sRect.setLeftTopAndSize( splitter_margin, height - offset - splitter_margin, width - 2*splitter_margin, height - offset - 2*splitter_margin); + mAccordionPanel->setRect(sRect); + + mAccordionPanel->setMaxWidth(sRect.getWidth()); + mAccordionPanel->arrange(); +} + +void LLSideTrayTab::reshape (S32 width, S32 height, BOOL called_from_parent ) +{ + if(!mAccordionPanel) + return; + S32 offset = 0; + + LLView* title_panel = getChildView(TAB_PANEL_CAPTION_NAME, true, false); + + 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(); + } + + + + LLRect sRect = mAccordionPanel->getRect(); + sRect.setLeftTopAndSize( splitter_margin, height - offset - splitter_margin, width - 2*splitter_margin, height - offset - 2*splitter_margin); + mAccordionPanel->setMaxWidth(sRect.getWidth()); + mAccordionPanel->reshape(sRect.getWidth(), sRect.getHeight()); + + mAccordionPanel->setRect(sRect); + +} + +void LLSideTrayTab::draw() +{ + LLPanel::draw(); + + //border + gl_rect_2d(0,0,getRect().getWidth() - 1,getRect().getHeight() - 1,LLColor4::black,false); + + +} + +void LLSideTrayTab::onOpen (const LLSD& key) +{ + mAccordionPanel->onOpen(key); +} + +LLSideTrayTab* LLSideTrayTab::createInstance () +{ + LLSideTrayTab::Params tab_params; + tab_params.tab_title("Home"); + + LLSideTrayTab* tab = LLUICtrlFactory::create<LLSideTrayTab>(tab_params); + return tab; +} + + +//virtual +LLSideTray::LLSideTray(Params& params) + :mActiveTab(0) + ,mCollapsed(false) + ,mCollapseButton(0) + ,mMaxBarWidth(0) + ,mHomeTab(0) +{ + mCollapsed=params.collapsed; +} + + +BOOL LLSideTray::postBuild() +{ + calcMaxSideBarWidth(); + + createButtons(); + + createHomeTab(); + + arrange(); + selectTabByName("home_tab"); + + if(mCollapsed) + collapseSideBar(); + + setMouseOpaque(false); + return true; +} + +/** + * add new panel to tab with tab_name name + * @param tab_name - name of sidebar tab to add new panel + * @param panel - pointer to panel + */ +bool LLSideTray::addPanel ( const std::string& tab_name + ,LLPanel* panel ) +{ + return false; +} +/** + * Add new tab to side bar + * @param tab_name - name of the new tab + * @param image - image for new sidebar button + * @param title - title for new tab + */ +bool LLSideTray::addTab ( const std::string& tab_name + ,const std::string& image + ,const std::string& title) +{ + LLSideTrayTab::Params params; + params.image_path = image; + params.tab_title = title; + LLSideTrayTab* tab = LLUICtrlFactory::create<LLSideTrayTab> (params); + addChild(tab,1); + return true; +} + + +LLSideTrayTab* LLSideTray::getTab(const std::string& name) +{ + return getChild<LLSideTrayTab>(name,false,false); +} + + + +void LLSideTray::toggleTabButton (LLSideTrayTab* tab) +{ + if(tab == NULL) + return; + string name = tab->getName(); + std::map<std::string,LLButton*>::iterator tIt = mTabButtons.find(name); + if(tIt!=mTabButtons.end()) + tIt->second->setToggleState(!tIt->second->getToggleState()); +} + +bool LLSideTray::selectTabByIndex(size_t index) +{ + if(index>=mTabs.size()) + return false; + + LLSideTrayTab* sidebar_tab = dynamic_cast<LLSideTrayTab*>(mTabs[index]); + if(sidebar_tab == NULL) + return false; + return selectTabByName(sidebar_tab->getName()); +} + +bool LLSideTray::selectTabByName (const std::string& name) +{ + LLSideTrayTab* side_bar = getTab(name); + if(side_bar == 0 && name == "home_tab") + side_bar = mHomeTab; + + if(side_bar == NULL || side_bar == mActiveTab) + return false; + //deselect old tab + toggleTabButton(mActiveTab); + if(mActiveTab) + mActiveTab->setVisible(false); + + //select new tab + mActiveTab = side_bar; + toggleTabButton(mActiveTab); + LLSD key;//empty + mActiveTab->onOpen(key); + + mActiveTab->setVisible(true); + + //arrange(); + + //hide all tabs - show active tab + child_vector_const_iter_t child_it; + for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) + { + LLSideTrayTab* sidebar_tab = dynamic_cast<LLSideTrayTab*>(*child_it); + if(sidebar_tab == NULL) + continue; + sidebar_tab->setVisible(sidebar_tab == mActiveTab); + } + return true; +} + +LLButton* LLSideTray::createButton (const std::string& name,const std::string& image,LLUICtrl::commit_callback_t callback) +{ + static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray::Params>()); + + LLButton::Params bparams; + + LLRect rect; + 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.rect (rect); + bparams.tab_stop(false); + bparams.image_unselected.name(sidetray_params.tab_btn_image_normal); + bparams.image_selected.name(sidetray_params.tab_btn_image_selected); + bparams.image_disabled.name(sidetray_params.tab_btn_image_normal); + bparams.image_disabled_selected.name(sidetray_params.tab_btn_image_selected); + + LLButton* button = LLUICtrlFactory::create<LLButton> (bparams); + button->setLabel(name); + button->setClickedCallback(callback); + + if(image.length()) + { + button->setImageOverlay(image); + } + + addChildInBack(button); + + return button; +} + +bool LLSideTray::addChild(LLView* view, S32 tab_group) +{ + LLSideTrayTab* tab_panel = dynamic_cast<LLSideTrayTab*>(view); + + if (tab_panel) + { + mTabs.push_back(tab_panel); + } + + return LLUICtrl::addChild(view, tab_group); +} + + +void LLSideTray::createButtons () +{ + //create show/hide button + mCollapseButton = createButton(EXPANDED_NAME,"",boost::bind(&LLSideTray::onToggleCollapse, this)); + + //create buttons for tabs + child_vector_const_iter_t child_it; + + for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) + { + LLSideTrayTab* sidebar_tab = dynamic_cast<LLSideTrayTab*>(*child_it); + if(sidebar_tab == NULL) + continue; + + string name = sidebar_tab->getName(); + + LLButton* button = createButton("",sidebar_tab->mImagePath,boost::bind(&LLSideTray::onTabButtonClick, this, sidebar_tab->getName())); + mTabButtons[sidebar_tab->getName()] = button; + } + +} + +void LLSideTray::onTabButtonClick(string name) +{ + + selectTabByName (name); + if(mCollapsed) + expandSideBar(); +} + +void LLSideTray::onToggleCollapse() +{ + if(mCollapsed) + { + expandSideBar(); + selectTabByName("home_tab"); + } + else + collapseSideBar(); +} + + +void LLSideTray::reflectCollapseChange() +{ + setPanelRect(); + + if(mCollapsed) + gFloaterView->setSnapOffsetRight(0); + else + gFloaterView->setSnapOffsetRight(mMaxBarWidth); + + gFloaterView->refresh(); + + setFocus( FALSE ); +} + +void LLSideTray::arrange () +{ + static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray::Params>()); + + calcMaxSideBarWidth(); + + + + 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 + //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 = dynamic_cast<LLSideTrayTab*>(*child_it); + if(sidebar_tab == NULL) + continue; + + 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); + } + + 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) + { + LLSideTrayTab* sidebar_tab = dynamic_cast<LLSideTrayTab*>(*child_it); + if(sidebar_tab == NULL) + continue; + + sidebar_tab->setRect(ctrl_rect); + sidebar_tab->arrange(mMaxBarWidth,getRect().getHeight()); + } + + mHomeTab->setRect(ctrl_rect); + mHomeTab->arrange(mMaxBarWidth,getRect().getHeight()); + +} + +void LLSideTray::collapseSideBar () +{ + mCollapsed = true; + mCollapseButton->setLabel(COLLAPSED_NAME); + mActiveTab->setVisible(FALSE); + reflectCollapseChange(); + setFocus( FALSE ); + +} +void LLSideTray::expandSideBar () +{ + mCollapsed = false; + mCollapseButton->setLabel(EXPANDED_NAME); + mActiveTab->setVisible(TRUE); + + reflectCollapseChange(); + +} + +void LLSideTray::calcMaxSideBarWidth() +{ + + S32 max_bar_width = 0; + + + child_vector_const_iter_t child_it; + for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) + { + LLSideTrayTab* sidebar_tab = dynamic_cast<LLSideTrayTab*>(*child_it); + if(sidebar_tab == NULL) + continue; + max_bar_width = llmax(max_bar_width,sidebar_tab->getMaxSideBarTabWidth()); + } + + if(max_bar_width > 0) + mMaxBarWidth = max_bar_width; + +} +void LLSideTray::highlightFocused() +{ + if(!mActiveTab) + return; + /* uncomment in case something change + BOOL dependent_has_focus = gFocusMgr.childHasKeyboardFocus(this); + setBackgroundOpaque( dependent_has_focus ); + mActiveTab->setBackgroundOpaque( dependent_has_focus ); + */ + mActiveTab->setBackgroundOpaque( true ); + + +} +//virtual +BOOL LLSideTray::handleMouseDown (S32 x, S32 y, MASK mask) +{ + BOOL ret = LLPanel::handleMouseDown(x,y,mask); + if(ret) + setFocus(true); + return ret; +} +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::Params>()); + + 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 = dynamic_cast<LLSideTrayTab*>(*child_it); + if(sidebar_tab == NULL) + continue; + + 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 = dynamic_cast<LLSideTrayTab*>(*child_it); + if(sidebar_tab == NULL) + continue; + sidebar_tab->reshape(mMaxBarWidth,getRect().getHeight()); + ctrl_rect.setLeftTopAndSize(sidetray_params.default_button_width,getRect().getHeight(),mMaxBarWidth,getRect().getHeight()); + sidebar_tab->setRect(ctrl_rect); + + } + + mHomeTab->reshape(mMaxBarWidth,getRect().getHeight()); + ctrl_rect.setLeftTopAndSize(sidetray_params.default_button_width,getRect().getHeight(),mMaxBarWidth,getRect().getHeight()); + mHomeTab->setRect(ctrl_rect); + + +} + +/** + * Activate tab with "panel_name" panel + * if no such tab - return false, otherwise true + */ +bool LLSideTray::showPanel (const std::string& panel_name, const LLSD& params) +{ + //arrange tabs + child_vector_const_iter_t child_it; + for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) + { + LLView* view = (*child_it)->getChildView(panel_name,true,false); + if(view) + { + onTabButtonClick((*child_it)->getName()); + LLPanel* panel = dynamic_cast<LLPanel*>(view); + if(panel) + panel->onOpen(params); + return true; + } + } + return false; +} + +void LLSideTray::createHomeTab() +{ + mHomeTab = LLSideTrayTab::createInstance(); + child_vector_iter_t child_it; + for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) + { + LLSideTrayTab* sidebar_tab = dynamic_cast<LLSideTrayTab*>(*child_it); + if(sidebar_tab == NULL) + continue; + + LLPanel* panel = LLSideTrayInfoPanel::createInstance(sidebar_tab->mImagePath,sidebar_tab->getTabTitle(),sidebar_tab->getDescription()); + + panel->setCommitCallback(boost::bind(&LLSideTray::onTabButtonClick, this, sidebar_tab->getName())); + + LLCollapsibleCtrl::Params panel_params; + panel_params.display_children(true); + panel_params.collapsible(false); + panel_params.header_visible(false); + panel_params.can_resize(false); + panel_params.min_height(200); + panel_params.padding_left(10); + panel_params.padding_right(10); + panel_params.padding_top(5); + panel_params.padding_bottom(5); + + LLCollapsibleCtrl* ctrl = LLUICtrlFactory::create<LLCollapsibleCtrl>(panel_params); + + + ctrl->setPanel(panel); + ctrl->postBuild(); + mHomeTab->addChild(ctrl,0); + } + + mHomeTab->setBackgroundVisible(true); + mHomeTab->postBuild(); + + LLUICtrl::addChild(mHomeTab, 0); +} +static const S32 fake_offset = 132; +static const S32 fake_top_offset = 78; + +void LLSideTray::setPanelRect () +{ + static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray::Params>()); + + const LLRect& parent_rect = gViewerWindow->getRootView()->getRect(); + + S32 panel_width = sidetray_params.default_button_width+sidetray_params.default_button_margin; + if(!mCollapsed) + panel_width+=mMaxBarWidth; + + S32 panel_height = parent_rect.getHeight()-fake_top_offset; + panel_height -= LLBottomTray::getInstance()->getRect().getHeight(); + + LLRect panel_rect; + panel_rect.setLeftTopAndSize( parent_rect.mRight-panel_width, parent_rect.mTop-fake_top_offset, panel_width, panel_height); + setRect(panel_rect); +} + +S32 LLSideTray::getTrayWidth() +{ + static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray::Params>()); + 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 new file mode 100644 index 0000000000000000000000000000000000000000..7d269257535fa69ab674e915dc38dba64b35c444 --- /dev/null +++ b/indra/newview/llsidetray.h @@ -0,0 +1,240 @@ +/** + * @file LLSideTray.h + * @brief SideBar header file + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLSIDETRAY_H_ +#define LL_LLSIDETRAY_H_ + +#include "llpanel.h" +#include "string" + +class LLSideTray; +class LLAccordionPanel; + +class LLSideTrayTab: public LLPanel +{ + friend class LLUICtrlFactory; + friend class LLSideTray; +public: + + struct Params + : public LLInitParam::Block<Params, LLPanel::Params> + { + // image name + Optional<std::string> image_path; + Optional<std::string> tab_title; + Optional<std::string> tab_description; + Params():image_path("image","") + ,tab_title("tab_title","no title") + ,tab_description("description","no description") + {}; + }; +protected: + LLSideTrayTab(const Params& params); + + + S32 getMaxSideBarTabWidth(); +public: + virtual ~LLSideTrayTab(); + + void addPanel (LLPanel* panel); + /*virtual*/ BOOL postBuild (); + /*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 (); + + const std::string& getDescription () const { return mDescription;} + const std::string& getTabTitle() const { return mTabTitle;} + + void draw(); + + void onOpen (const LLSD& key); + +private: + std::string mTabTitle; + std::string mImagePath; + std::string mDescription; + + LLAccordionPanel* mAccordionPanel; +}; + + +class LLSideTray : public LLPanel +{ + friend class LLUICtrlFactory; +public: + + LOG_CLASS(LLSideTray); + + struct Params + : public LLInitParam::Block<Params, LLPanel::Params> + { + // initial state + Optional<bool> collapsed; + Optional<std::string> tab_btn_image_normal; + Optional<std::string> tab_btn_image_selected; + + Optional<S32> default_button_width; + Optional<S32> default_button_height; + Optional<S32> default_button_margin; + + Params(): + collapsed("collapsed",false) + ,tab_btn_image_normal("tab_btn_image","sidebar_tab_left.tga") + ,tab_btn_image_selected("tab_btn_image_selected","button_enabled_selected_32x128.tga") + ,default_button_width("tab_btn_width",32) + ,default_button_height("tab_btn_height",32) + ,default_button_margin("tab_btn_margin",0) + {}; + }; + + static LLSideTray* getInstance (); + static bool instanceCreated (); +protected: + LLSideTray(Params& params); + typedef std::vector<LLView*> child_vector_t; + typedef child_vector_t::iterator child_vector_iter_t; + typedef child_vector_t::const_iterator child_vector_const_iter_t; + typedef child_vector_t::reverse_iterator child_vector_reverse_iter_t; + typedef child_vector_t::const_reverse_iterator child_vector_const_reverse_iter_t; + +public: + + // interface functions + + /** + * Select tab with specific name and set it active + */ + bool selectTabByName (const std::string& name); + + /** + * Select tab with specific index and set it active + */ + bool selectTabByIndex(size_t index); + + /** + * add new panel to tab with tab_name name + * @param tab_name - name of sidebar tab to add new panel + * @param panel - pointer to panel + */ + bool addPanel ( const std::string& tab_name + ,LLPanel* panel ); + /** + * Add new tab to side bar + * @param tab_name - name of the new tab + * @param image - image for new sidebar button + * @param title - title for new tab + */ + bool addTab ( const std::string& tab_name + ,const std::string& image + ,const std::string& title); + + /** + * Activate tab with "panel_name" panel + * if no such tab - return false, otherwise true + */ + bool showPanel (const std::string& panel_name, const LLSD& params); + + /* + * collapse SideBar, hiding visible tab and moving tab buttons + * to the right corner of the screen + */ + void collapseSideBar (); + + /* + * expand SideBar + */ + void expandSideBar (); + + + /** + *hightlight if focused. manly copypaste from highlightFocusedFloater + */ + void highlightFocused(); + + void setVisible(BOOL visible) + { + LLPanel::setVisible(visible); + } + +public: + virtual ~LLSideTray(){}; + + virtual BOOL postBuild(); + + void onTabButtonClick(std::string name); + void onToggleCollapse(); + + bool addChild (LLView* view, S32 tab_group); + + BOOL handleMouseDown (S32 x, S32 y, MASK mask); + + void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); + S32 getTrayWidth(); + +protected: + LLSideTrayTab* getTab (const std::string& name); + + void createButtons (); + LLButton* createButton (const std::string& name,const std::string& image,LLUICtrl::commit_callback_t callback); + void createHomeTab (); + void arrange (); + void reflectCollapseChange(); + + void toggleTabButton (LLSideTrayTab* tab); + + + void calcMaxSideBarWidth(); + + void setPanelRect (); + + +private: + + std::map<std::string,LLButton*> mTabButtons; + child_vector_t mTabs; + LLSideTrayTab* mHomeTab; + LLSideTrayTab* mActiveTab; + + LLButton* mCollapseButton; + bool mCollapsed; + + S32 mMaxBarWidth; + + static LLSideTray* sInstance; +}; + +#endif + diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bd93f5dd28085aec0a9458144084e68aa53372a8 --- /dev/null +++ b/indra/newview/llslurl.cpp @@ -0,0 +1,114 @@ +/** + * @file llslurl.cpp + * @brief SLURL manipulation + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llslurl.h" + +#include "llweb.h" + +const std::string LLSLURL::PREFIX_SL_HELP = "secondlife://app."; +const std::string LLSLURL::PREFIX_SL = "sl://"; +const std::string LLSLURL::PREFIX_SECONDLIFE = "secondlife://"; +const std::string LLSLURL::PREFIX_SLURL = "http://slurl.com/secondlife/"; + +const std::string LLSLURL::APP_TOKEN = "app/"; + +// static +std::string LLSLURL::stripProtocol(const std::string& url) +{ + std::string stripped = url; + if (matchPrefix(stripped, PREFIX_SL_HELP)) + { + stripped.erase(0, PREFIX_SL_HELP.length()); + } + else if (matchPrefix(stripped, PREFIX_SL)) + { + stripped.erase(0, PREFIX_SL.length()); + } + else if (matchPrefix(stripped, PREFIX_SECONDLIFE)) + { + stripped.erase(0, PREFIX_SECONDLIFE.length()); + } + else if (matchPrefix(stripped, PREFIX_SLURL)) + { + stripped.erase(0, PREFIX_SLURL.length()); + } + + return stripped; +} + +// static +bool LLSLURL::isSLURL(const std::string& url) +{ + if (matchPrefix(url, PREFIX_SL_HELP)) return true; + if (matchPrefix(url, PREFIX_SL)) return true; + if (matchPrefix(url, PREFIX_SECONDLIFE)) return true; + if (matchPrefix(url, PREFIX_SLURL)) return true; + + return false; +} + +// static +bool LLSLURL::isSLURLCommand(const std::string& url) +{ + if (matchPrefix(url, PREFIX_SL + APP_TOKEN) || + matchPrefix(url, PREFIX_SECONDLIFE + "/" + APP_TOKEN) || + matchPrefix(url, PREFIX_SLURL + APP_TOKEN) ) + { + return true; + } + + return false; +} + +// static +bool LLSLURL::isSLURLHelp(const std::string& url) +{ + return matchPrefix(url, PREFIX_SL_HELP); +} + +// static +std::string LLSLURL::buildSLURL(const std::string& regionname, S32 x, S32 y, S32 z) +{ + std::string slurl = PREFIX_SLURL + regionname + llformat("/%d/%d/%d",x,y,z); + slurl = LLWeb::escapeURL( slurl ); + return slurl; +} + +// static +bool LLSLURL::matchPrefix(const std::string& url, const std::string& prefix) +{ + std::string test_prefix = url.substr(0, prefix.length()); + LLStringUtil::toLower(test_prefix); + return test_prefix == prefix; +} diff --git a/indra/newview/llslurl.h b/indra/newview/llslurl.h new file mode 100644 index 0000000000000000000000000000000000000000..05788623d9e386ca76259a349d568dcafc728eee --- /dev/null +++ b/indra/newview/llslurl.h @@ -0,0 +1,85 @@ +/** + * @file llslurl.h + * @brief SLURL manipulation + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_SLURL_H +#define LL_SLURL_H + +#include <string> + +// IAN BUG: where should this live? +// IAN BUG: are static utility functions right? See LLUUID. +// question of whether to have a LLSLURL object or a +// some of this was moved from LLURLDispatcher + +/** + * SLURL manipulation + */ +class LLSLURL +{ +public: + static const std::string PREFIX_SL_HELP; + static const std::string PREFIX_SL; + static const std::string PREFIX_SECONDLIFE; + static const std::string PREFIX_SLURL; + + static const std::string APP_TOKEN; + + /** + * Is this any sort of secondlife:// or sl:// URL? + */ + static bool isSLURL(const std::string& url); + + /** + * Is this a special secondlife://app/ URL? + */ + static bool isSLURLCommand(const std::string& url); + + /** + * Not sure what it is. + */ + static bool isSLURLHelp(const std::string& url); + + /** + * builds: http://slurl.com/secondlife/RegionName/x/y/z/ + */ + static std::string buildSLURL(const std::string& regionname, S32 x, S32 y, S32 z); + + /** + * Strip protocol part from the URL. + */ + static std::string stripProtocol(const std::string& url); + +private: + static bool matchPrefix(const std::string& url, const std::string& prefix); +}; + +#endif diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 4d67b374c818ced28d6de0eeadd5179f6f3f2122..8aec5c8377cb3f70a2cc1f64ea3bc09def51df18 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -35,9 +35,10 @@ #define SG_MIN_DIST_RATIO 0.00001f -#include "llmemory.h" #include "lldrawable.h" #include "lloctree.h" +#include "llpointer.h" +#include "llrefcount.h" #include "llvertexbuffer.h" #include "llgltypes.h" #include "llcubemap.h" @@ -399,7 +400,7 @@ public: virtual void updateSpatialExtents(); virtual void updateBinRadius(); virtual void setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results = NULL, BOOL for_select = FALSE); - virtual void updateDistance(LLCamera& camera_in); + virtual void updateDistance(LLCamera& camera_in, bool force_update); virtual void makeActive(); virtual void move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL immediate = FALSE); virtual BOOL updateMove(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 2c0d11baabc7eb638a099cf14371f169b97d304c..d287f25181dd997609055396ca084669341ad87a 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -51,15 +51,15 @@ #endif #include "llares.h" +#include "lllandmark.h" #include "llcachename.h" -#include "llviewercontrol.h" #include "lldir.h" #include "llerrorcontrol.h" #include "llfiltersd2xmlrpc.h" +#include "llfloaterreg.h" #include "llfocusmgr.h" #include "llhttpsender.h" -#include "imageids.h" -#include "lllandmark.h" +#include "lllocationhistory.h" #include "llloginflags.h" #include "llmd5.h" #include "llmemorystream.h" @@ -73,20 +73,21 @@ #include "llstring.h" #include "lluserrelations.h" #include "llversionviewer.h" +#include "llviewercontrol.h" #include "llvfs.h" #include "llxorcipher.h" // saved password, MAC address +#include "imageids.h" #include "message.h" #include "v3math.h" #include "llagent.h" +#include "llagentwearables.h" #include "llagentpilot.h" #include "llfloateravatarpicker.h" #include "llcallbacklist.h" #include "llcallingcard.h" -#include "llcolorscheme.h" #include "llconsole.h" #include "llcontainerview.h" -#include "llfloaterstats.h" #include "lldebugview.h" #include "lldrawable.h" #include "lleventnotifier.h" @@ -100,26 +101,26 @@ #include "llfloatergesture.h" #include "llfloaterhud.h" #include "llfloaterland.h" +#include "llfloaterpreference.h" #include "llfloatertopobjects.h" #include "llfloatertos.h" #include "llfloaterworldmap.h" -#include "llframestats.h" -#include "llframestatview.h" #include "llgesturemgr.h" #include "llgroupmgr.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" #include "llhttpclient.h" #include "llimagebmp.h" +#include "llinventorybridge.h" #include "llinventorymodel.h" #include "llinventoryview.h" #include "llkeyboard.h" #include "llloginhandler.h" // gLoginHandler, SLURL support #include "llpanellogin.h" -#include "llprefsim.h" #include "llmutelist.h" #include "llnotify.h" #include "llpanelavatar.h" +#include "llavatarpropertiesprocessor.h" #include "llpaneldirbrowser.h" #include "llpaneldirland.h" #include "llpanelevent.h" @@ -167,6 +168,7 @@ #include "llviewerthrottle.h" #include "llviewerwindow.h" #include "llvoavatar.h" +#include "llvoavatarself.h" #include "llvoclouds.h" #include "llweb.h" #include "llworld.h" @@ -185,6 +187,8 @@ #include "llwlparammanager.h" #include "llwaterparammanager.h" #include "llagentlanguage.h" +#include "llwearable.h" +#include "llinventorybridge.h" #if LL_LIBXUL_ENABLED #include "llmozlib.h" @@ -245,7 +249,6 @@ bool update_dialog_callback(const LLSD& notification, const LLSD& response); void login_packet_failed(void**, S32 result); void use_circuit_callback(void**, S32 result); void register_viewer_callbacks(LLMessageSystem* msg); -void init_stat_view(); void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S32); bool callback_choose_gender(const LLSD& notification, const LLSD& response); void init_start_screen(S32 location_id); @@ -253,7 +256,7 @@ void release_start_screen(); void reset_login(); void apply_udp_blacklist(const std::string& csv); -void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data) +void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group) { LLNameListCtrl::refreshAll(id, firstname, lastname, is_group); LLNameBox::refreshAll(id, firstname, lastname, is_group); @@ -355,15 +358,25 @@ bool idle_startup() static bool stipend_since_login = false; - static bool samename = false; - // HACK: These are things from the main loop that usually aren't done // until initialization is complete, but need to be done here for things // to work. gIdleCallbacks.callFunctions(); - gViewerWindow->handlePerFrameHover(); + gViewerWindow->updateUI(); LLMortician::updateClass(); + const std::string delims (" "); + std::string system; + int begIdx, endIdx; + std::string osString = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + + begIdx = osString.find_first_not_of (delims); + endIdx = osString.find_first_of (delims, begIdx); + system = osString.substr (begIdx, endIdx - begIdx); + system += "Locale"; + + LLStringUtil::setLocale (LLTrans::getString(system)); + if (gNoRender) { // HACK, skip optional updates if you're running drones @@ -431,8 +444,6 @@ bool idle_startup() // Load autopilot and stats stuff gAgentPilot.load(gSavedSettings.getString("StatsPilotFile")); - gFrameStats.setFilename(gSavedSettings.getString("StatsFile")); - gFrameStats.setSummaryFilename(gSavedSettings.getString("StatsSummaryFile")); //gErrorStream.setTime(gSavedSettings.getBOOL("LogTimestamps")); @@ -780,15 +791,11 @@ bool idle_startup() // *NOTE: This is where gMuteList used to get allocated before becoming LLMuteList::getInstance(). - // Initialize UI - if (!gNoRender) + // Login screen needs menus for preferences, but we can enter + // this startup phase more than once. + if (gLoginMenuBarView == NULL) { - // Initialize all our tools. Must be done after saved settings loaded. - // NOTE: This also is where gToolMgr used to be instantiated before being turned into a singleton. - LLToolMgr::getInstance()->initTools(); - - // Quickly get something onscreen to look at. - gViewerWindow->initWorldUI(); + init_menus(); } gViewerWindow->setNormalControlsVisible( FALSE ); @@ -854,13 +861,15 @@ bool idle_startup() gDirUtilp->setLindenUserDir(firstname, lastname); LLFile::mkdir(gDirUtilp->getLindenUserDir()); + LLLocationHistory::getInstance()->load(); + // Set PerAccountSettingsFile to the default value. gSavedSettings.setString("PerAccountSettingsFile", gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, - LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount") - ) - ); + LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount"))); + // Note: can't store warnings files per account because some come up before login + // Overwrite default user settings with user settings LLAppViewer::instance()->loadSettingsFromDirectory("Account"); @@ -915,12 +924,12 @@ bool idle_startup() LLURLSimString::setString( location ); // END TODO - LLPanelLogin::close(); + LLPanelLogin::closePanel(); } //For HTML parsing in text boxes. - LLTextEditor::setLinkColor( gSavedSettings.getColor4("HTMLLinkColor") ); + LLTextEditor::setLinkColor( gSavedSkinSettings.getColor4("HTMLLinkColor") ); // Load URL History File LLURLHistory::loadFile("url_history.xml"); @@ -943,7 +952,7 @@ bool idle_startup() // UserLoginLocationReply arrives location_which = START_LOCATION_ID_LAST; } - else if (gSavedSettings.getBOOL("LoginLastLocation")) + else if (gSavedSettings.getString("LoginLocation") == "last" ) { agent_location_id = START_LOCATION_ID_LAST; // last location location_which = START_LOCATION_ID_LAST; @@ -963,7 +972,7 @@ bool idle_startup() // Display the startup progress bar. gViewerWindow->setShowProgress(TRUE); - gViewerWindow->setProgressCancelButtonVisible(TRUE, std::string("Quit")); // *TODO: Translate + gViewerWindow->setProgressCancelButtonVisible(TRUE, LLTrans::getString("Quit")); // Poke the VFS, which could potentially block for a while if // Windows XP is acting up @@ -972,9 +981,6 @@ bool idle_startup() gVFS->pokeFiles(); - // color init must be after saved settings loaded - init_colors(); - // skipping over STATE_UPDATE_CHECK because that just waits for input LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); @@ -1037,9 +1043,7 @@ bool idle_startup() sAuthUriNum = 0; auth_method = "login_to_simulator"; - LLStringUtil::format_map_t args; - args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle(); - auth_desc = LLTrans::getString("LoginInProgress", args); + auth_desc = LLTrans::getString("LoginInProgress"); LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); } @@ -1063,13 +1067,9 @@ bool idle_startup() start << xml_escape_string(unescaped_start.str()); } - else if (gSavedSettings.getBOOL("LoginLastLocation")) - { - start << "last"; - } else { - start << "home"; + start << gSavedSettings.getString("LoginLocation"); } char hashed_mac_string[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ @@ -1107,7 +1107,7 @@ bool idle_startup() LL_DEBUGS("AppInit") << "STATE_LOGIN_NO_DATA_YET" << LL_ENDL; // If we get here we have gotten past the potential stall // in curl, so take "may appear frozen" out of progress bar. JC - auth_desc = "Logging in..."; + auth_desc = LLTrans::getString("LoginInProgressNoFrozen"); set_startup_status(progress, auth_desc, auth_message); // Process messages to keep from dropping circuit. LLMessageSystem* msg = gMessageSystem; @@ -1455,7 +1455,7 @@ bool idle_startup() it = options[0].find("folder_id"); if(it != options[0].end()) { - gAgent.mInventoryRootID.set((*it).second); + gAgent.getInventoryRootID().set((*it).second); //gInventory.mock(gAgent.getInventoryRootID()); } } @@ -1487,6 +1487,9 @@ bool idle_startup() if((*it).second == "Y") gPacificDaylightTime = TRUE; else gPacificDaylightTime = FALSE; } + + //setup map of datetime strings to codes and slt & local time offset from utc + LLStringOps::setupDatetimeInfo (gPacificDaylightTime); } options.clear(); if (LLUserAuth::getInstance()->getOptions("initial-outfit", options) @@ -1541,7 +1544,7 @@ bool idle_startup() && gAgentSessionID.notNull() && gMessageSystem->mOurCircuitCode && first_sim.isOk() - && gAgent.mInventoryRootID.notNull()) + && gAgent.getInventoryRootID().notNull()) { LLStartUp::setStartupState( STATE_WORLD_INIT ); } @@ -1589,7 +1592,7 @@ bool idle_startup() //--------------------------------------------------------------------- if (STATE_WORLD_INIT == LLStartUp::getStartupState()) { - set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); + set_startup_status(0.30f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); display_startup(); // We should have an agent id by this point. llassert(!(gAgentID == LLUUID::null)); @@ -1601,6 +1604,7 @@ bool idle_startup() // Since we connected, save off the settings so the user doesn't have to // type the name/password again if we crash. gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); + gSavedSkinSettings.saveToFile(gSavedSettings.getString("SkinningSettingsFile"), TRUE); // // Initialize classes w/graphics stuff. @@ -1617,9 +1621,16 @@ bool idle_startup() LLWLParamManager::initClass(); LLWaterParamManager::initClass(); - // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering LLViewerObject::initVOClasses(); + // Initialize all our tools. Must be done after saved settings loaded. + // NOTE: This also is where gToolMgr used to be instantiated before being turned into a singleton. + LLToolMgr::getInstance()->initTools(); + + // Pre-load floaters, like the world map, that are slow to spawn + // due to XML complexity. + gViewerWindow->initWorldUI(); + display_startup(); // This is where we used to initialize gWorldp. Original comment said: @@ -1662,6 +1673,14 @@ bool idle_startup() if (STATE_MULTIMEDIA_INIT == LLStartUp::getStartupState()) { LLStartUp::multimediaInit(); + LLStartUp::setStartupState( STATE_FONT_INIT ); + return FALSE; + } + + // Loading fonts takes several seconds + if (STATE_FONT_INIT == LLStartUp::getStartupState()) + { + LLStartUp::fontInit(); LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT ); return FALSE; } @@ -1689,14 +1708,8 @@ bool idle_startup() } gLoginMenuBarView->setVisible( FALSE ); gLoginMenuBarView->setEnabled( FALSE ); - - LLRect window(0, gViewerWindow->getWindowHeight(), gViewerWindow->getWindowWidth(), 0); - gViewerWindow->adjustControlRectanglesForFirstUse(window); - - if(gSavedSettings.getBOOL("ShowMiniMap")) - { - LLFloaterMap::showInstance(); - } + + LLFloaterReg::showInitialVisibleInstances(); if (gSavedSettings.getBOOL("ShowCameraControls")) { @@ -1725,10 +1738,6 @@ bool idle_startup() LLError::logToFixedBuffer(gDebugView->mDebugConsolep); // set initial visibility of debug console gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole")); - if (gSavedSettings.getBOOL("ShowDebugStats")) - { - LLFloaterStats::showInstance(); - } } // @@ -1752,8 +1761,10 @@ bool idle_startup() if ( gCacheName == NULL ) { gCacheName = new LLCacheName(gMessageSystem); - gCacheName->addObserver(callback_cache_name); - + gCacheName->addObserver(&callback_cache_name); + gCacheName->LocalizeCacheName("waiting", LLTrans::getString("CacheWaiting")); + gCacheName->LocalizeCacheName("nobody", LLTrans::getString("CacheNobody")); + gCacheName->LocalizeCacheName("none", LLTrans::getString("CacheNone")); // Load stored cache if possible LLAppViewer::instance()->loadNameCache(); } @@ -1767,14 +1778,6 @@ bool idle_startup() //reset statistics LLViewerStats::getInstance()->resetStats(); - if (!gNoRender) - { - // - // Set up all of our statistics UI stuff. - // - init_stat_view(); - } - display_startup(); // // Set up region and surface defaults @@ -1796,15 +1799,8 @@ 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->getWindowDisplayHeight()); - if (gViewerWindow->mWindow->getFullscreen()) - { - LLViewerCamera::getInstance()->setAspect(gViewerWindow->getDisplayAspectRatio()); - } - else - { - LLViewerCamera::getInstance()->setAspect( (F32) gViewerWindow->getWindowWidth() / (F32) gViewerWindow->getWindowHeight()); - } + LLViewerCamera::getInstance()->setViewHeightInPixels(gViewerWindow->getWorldViewHeight()); + LLViewerCamera::getInstance()->setAspect(gViewerWindow->getWorldViewAspectRatio()); // Initialize FOV LLViewerCamera::getInstance()->setDefaultFOV(gSavedSettings.getF32("CameraAngle")); @@ -2052,24 +2048,7 @@ bool idle_startup() } options.clear(); - if(LLUserAuth::getInstance()->getOptions("ui-config", options)) - { - LLUserAuth::options_t::iterator it = options.begin(); - LLUserAuth::options_t::iterator end = options.end(); - for (; it != end; ++it) - { - LLUserAuth::response_t::const_iterator option_it; - option_it = (*it).find("allow_first_life"); - if(option_it != (*it).end()) - { - if (option_it->second == "Y") - { - LLPanelAvatar::sAllowFirstLife = TRUE; - } - } - } - } - options.clear(); + bool show_hud = false; if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) { @@ -2117,6 +2096,11 @@ bool idle_startup() { LLClassifiedInfo::loadCategories(options); } + + + //all categories loaded. lets create "My Favourites" category + gInventory.findCategoryUUIDForType(LLAssetType::AT_FAVORITE,true); + gInventory.buildParentChildMap(); llinfos << "Setting Inventory changed mask and notifying observers" << llendl; @@ -2145,17 +2129,9 @@ bool idle_startup() llinfos << "Requesting Agent Data" << llendl; gAgent.sendAgentDataUpdateRequest(); - bool shown_at_exit = gSavedSettings.getBOOL("ShowInventory"); - // Create the inventory views llinfos << "Creating Inventory Views" << llendl; - LLInventoryView::showAgentInventory(); - - // Hide the inventory if it wasn't shown at exit - if(!shown_at_exit) - { - LLInventoryView::toggleVisibility(NULL); - } + LLFloaterReg::getInstance("inventory"); LLStartUp::setStartupState( STATE_MISC ); return FALSE; @@ -2211,6 +2187,7 @@ bool idle_startup() // and make sure it's saved gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); + gSavedSkinSettings.saveToFile( gSavedSettings.getString("SkinningSettingsFile") , TRUE ); }; if (!gNoRender) @@ -2296,38 +2273,20 @@ bool idle_startup() //{ //} + // The reason we show the alert is because we want to + // reduce confusion for when you log in and your provided + // location is not your expected location. So, if this is + // your first login, then you do not have an expectation, + // thus, do not show this alert. if (!gAgent.isFirstLogin()) { bool url_ok = LLURLSimString::sInstance.parse(); - if (!((agent_start_location == "url" && url_ok) || - (!url_ok && ((agent_start_location == "last" && gSavedSettings.getBOOL("LoginLastLocation")) || - (agent_start_location == "home" && !gSavedSettings.getBOOL("LoginLastLocation")))))) - { - // The reason we show the alert is because we want to - // reduce confusion for when you log in and your provided - // location is not your expected location. So, if this is - // your first login, then you do not have an expectation, - // thus, do not show this alert. - LLSD args; - if (url_ok) - { - args["TYPE"] = "desired"; - args["HELP"] = ""; - } - else if (gSavedSettings.getBOOL("LoginLastLocation")) - { - args["TYPE"] = "last"; - args["HELP"] = ""; - } - else - { - args["TYPE"] = "home"; - args["HELP"] = "You may want to set a new home location."; - } - LLNotifications::instance().add("AvatarMoved", args); - } - else + if ((url_ok && agent_start_location == "url") || + (!url_ok && ((agent_start_location == gSavedSettings.getString("LoginLocation"))))) { + // Start location is OK + // Disabled code to restore camera location and focus if logging in to default location + static bool samename = false; if (samename) { // restore old camera pos @@ -2342,13 +2301,30 @@ bool idle_startup() gAgent.stopCameraAnimation(); } } + else + { + std::string msg; + if (url_ok) + { + msg = "AvatarMovedDesired"; + } + else if (gSavedSettings.getString("LoginLocation") == "home") + { + msg = "AvatarMovedHome"; + } + else + { + msg = "AvatarMovedLast"; + } + LLNotifications::instance().add(msg); + } } //DEV-17797. get null folder. Any items found here moved to Lost and Found LLInventoryModel::findLostItems(); //DEV-10530. do cleanup. remove at some later date. jan-2009 - LLPrefsIM::cleanupBadSetting(); + LLFloaterPreference::cleanupBadSetting(); LLStartUp::setStartupState( STATE_PRECACHE ); timeout.reset(); @@ -2456,7 +2432,7 @@ bool idle_startup() else { // OK to just get the wearables - if ( gAgent.areWearablesLoaded() ) + if ( gAgentWearables.areWearablesLoaded() ) { // We have our clothing, proceed. //llinfos << "wearables loaded" << llendl; @@ -2477,11 +2453,9 @@ bool idle_startup() set_startup_status(1.0, "", ""); // Let the map know about the inventory. - if(gFloaterWorldMap) - { - gFloaterWorldMap->observeInventory(&gInventory); - gFloaterWorldMap->observeFriends(); - } + LLFloaterWorldMap* floater_world_map = LLFloaterWorldMap::getInstance(); + floater_world_map->observeInventory(&gInventory); + floater_world_map->observeFriends(); gViewerWindow->showCursor(); gViewerWindow->getWindow()->resetBusyCount(); @@ -2502,13 +2476,15 @@ bool idle_startup() } // Start automatic replay if the flag is set. - if (gSavedSettings.getBOOL("StatsAutoRun")) + if (gSavedSettings.getBOOL("StatsAutoRun") || LLAgentPilot::sReplaySession) { LLUUID id; LL_DEBUGS("AppInit") << "Starting automatic playback" << LL_ENDL; gAgentPilot.startPlayback(); } + show_debug_menus(); // Debug menu visiblity and First Use trigger + // If we've got a startup URL, dispatch it LLStartUp::dispatchURL(); @@ -2539,6 +2515,9 @@ bool idle_startup() LLAppViewer::instance()->handleLoginComplete(); + // reset timers now that we are running "logged in" logic + LLFastTimer::reset(); + return TRUE; } @@ -2597,6 +2576,7 @@ void login_callback(S32 option, void *userdata) { // turn off the setting and write out to disk gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); + gSavedSkinSettings.saveToFile( gSavedSettings.getString("SkinningSettingsFile") , TRUE ); } // Next iteration through main loop should shut down the app cleanly. @@ -2604,7 +2584,7 @@ void login_callback(S32 option, void *userdata) if (LLAppViewer::instance()->quitRequested()) { - LLPanelLogin::close(); + LLPanelLogin::closePanel(); } return; } @@ -2761,7 +2741,7 @@ bool first_run_dialog_callback(const LLSD& notification, const LLSD& response) if (0 == option) { LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL; - LLWeb::loadURL( CREATE_ACCOUNT_URL ); + LLWeb::loadURLExternal(LLTrans::getString("create_account_url") ); } LLPanelLogin::giveFocus(); @@ -2786,12 +2766,12 @@ bool login_alert_status(const LLSD& notification, const LLSD& response) { case 0: // OK break; - case 1: // Help - LLWeb::loadURL( SUPPORT_URL ); - break; + // case 1: // Help + // LLWeb::loadURL(LLNotifications::instance().getGlobalString("SUPPORT_URL") ); + // break; case 2: // Teleport // Restart the login process, starting at our home locaton - LLURLSimString::setString(LLURLSimString::sLocationStringHome); + LLURLSimString::setString("home"); LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); break; default: @@ -2806,14 +2786,13 @@ void update_app(BOOL mandatory, const std::string& auth_msg) { // store off config state, as we might quit soon gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); - + gSavedSkinSettings.saveToFile(gSavedSettings.getString("SkinningSettingsFile"), TRUE); std::ostringstream message; - //*TODO:translate std::string msg; if (!auth_msg.empty()) { - msg = "(" + auth_msg + ") \n"; + msg = "("+ auth_msg + ") \n"; } LLSD args; @@ -2986,9 +2965,7 @@ bool update_dialog_callback(const LLSD& notification, const LLSD& response) system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ #elif LL_LINUX || LL_SOLARIS - OSMessageBox("Automatic updating is not yet implemented for Linux.\n" - "Please download the latest version from www.secondlife.com.", - LLStringUtil::null, OSMB_OK); + OSMessageBox(LLTrans::getString("MBNoAutoUpdate"), LLStringUtil::null, OSMB_OK); #endif LLAppViewer::instance()->forceQuit(); return false; @@ -3049,7 +3026,7 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation); msg->setHandlerFuncFast(_PREHASH_AvatarAppearance, process_avatar_appearance); msg->setHandlerFunc("AgentCachedTextureResponse", LLAgent::processAgentCachedTextureResponse); - msg->setHandlerFunc("RebakeAvatarTextures", LLVOAvatar::processRebakeAvatarTextures); + msg->setHandlerFunc("RebakeAvatarTextures", LLVOAvatarSelf::processRebakeAvatarTextures); msg->setHandlerFuncFast(_PREHASH_CameraConstraint, process_camera_constraint); msg->setHandlerFuncFast(_PREHASH_AvatarSitResponse, process_avatar_sit_response); msg->setHandlerFunc("SetFollowCamProperties", process_set_follow_cam_properties); @@ -3093,20 +3070,20 @@ void register_viewer_callbacks(LLMessageSystem* msg) LLViewerParcelMgr::processParcelDwellReply); msg->setHandlerFunc("AvatarPropertiesReply", - LLPanelAvatar::processAvatarPropertiesReply); + &LLAvatarPropertiesProcessor::processAvatarPropertiesReply); msg->setHandlerFunc("AvatarInterestsReply", - LLPanelAvatar::processAvatarInterestsReply); + &LLAvatarPropertiesProcessor::processAvatarInterestsReply); msg->setHandlerFunc("AvatarGroupsReply", - LLPanelAvatar::processAvatarGroupsReply); + &LLAvatarPropertiesProcessor::processAvatarGroupsReply); // ratings deprecated //msg->setHandlerFuncFast(_PREHASH_AvatarStatisticsReply, // LLPanelAvatar::processAvatarStatisticsReply); msg->setHandlerFunc("AvatarNotesReply", - LLPanelAvatar::processAvatarNotesReply); + &LLAvatarPropertiesProcessor::processAvatarNotesReply); msg->setHandlerFunc("AvatarPicksReply", - LLPanelAvatar::processAvatarPicksReply); - msg->setHandlerFunc("AvatarClassifiedReply", - LLPanelAvatar::processAvatarClassifiedReply); + &LLAvatarPropertiesProcessor::processAvatarPicksReply); + msg->setHandlerFunc("AvatarClassifiedReply", + &LLAvatarPropertiesProcessor::processAvatarClassifiedReply); msg->setHandlerFuncFast(_PREHASH_CreateGroupReply, LLGroupMgr::processCreateGroupReply); @@ -3124,7 +3101,7 @@ void register_viewer_callbacks(LLMessageSystem* msg) // LLFloaterRate::processReputationIndividualReply); msg->setHandlerFuncFast(_PREHASH_AgentWearablesUpdate, - LLAgent::processAgentInitialWearablesUpdate ); + LLAgentWearables::processAgentInitialWearablesUpdate ); msg->setHandlerFunc("ScriptControlChange", LLAgent::processScriptControlChange ); @@ -3180,9 +3157,9 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFunc("MapItemReply", LLWorldMap::processMapItemReply); msg->setHandlerFunc("EventInfoReply", LLPanelEvent::processEventInfoReply); - msg->setHandlerFunc("PickInfoReply", LLPanelPick::processPickInfoReply); + msg->setHandlerFunc("PickInfoReply", &LLAvatarPropertiesProcessor::processPickInfoReply); msg->setHandlerFunc("ClassifiedInfoReply", LLPanelClassified::processClassifiedInfoReply); - msg->setHandlerFunc("ParcelInfoReply", LLPanelPlace::processParcelInfoReply); + msg->setHandlerFunc("ParcelInfoReply", LLRemoteParcelInfoProcessor::processParcelInfoReply); msg->setHandlerFunc("ScriptDialog", process_script_dialog); msg->setHandlerFunc("LoadURL", process_load_url); msg->setHandlerFunc("ScriptTeleportRequest", process_script_teleport_request); @@ -3202,14 +3179,6 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_FeatureDisabled, process_feature_disabled_message); } - -void init_stat_view() -{ - LLFrameStatView *frameviewp = gDebugView->mFrameStatView; - frameviewp->setup(gFrameStats); - frameviewp->mShowPercent = FALSE; -} - void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S32) { // nothing @@ -3271,7 +3240,7 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, has_name); if (0 == cat_array.count()) { - gAgent.createStandardWearables(gender); + gAgentWearables.createStandardWearables(gender); } else { @@ -3287,8 +3256,6 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, } // Loads a bitmap to display during load -// location_id = 0 => last position -// location_id = 1 => home position void init_start_screen(S32 location_id) { if (gStartImageGL.notNull()) @@ -3406,7 +3373,7 @@ void reset_login() } // Hide any other stuff - LLFloaterMap::hideInstance(); + LLFloaterReg::hideVisibleInstances(); } //--------------------------------------------------------------------------- @@ -3431,6 +3398,16 @@ void LLStartUp::multimediaInit() LLViewerParcelMedia::initClass(); } +void LLStartUp::fontInit() +{ + LL_DEBUGS("AppInit") << "Initializing fonts...." << LL_ENDL; + std::string msg = LLTrans::getString("LoginInitializingFonts"); + set_startup_status(0.45f, msg.c_str(), gAgent.mMOTD.c_str()); + display_startup(); + + LLFontGL::loadDefaultFonts(); +} + bool LLStartUp::dispatchURL() { // ok, if we've gotten this far and have a startup URL diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index fe347e9efe26c796f09be5c5177b8e1b5d94cf31..93701800e9f6f8cb0ef1eabebea9b727ee67d380 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -58,6 +58,7 @@ typedef enum { STATE_LOGIN_PROCESS_RESPONSE, // Check authentication reply STATE_WORLD_INIT, // Start building the world STATE_MULTIMEDIA_INIT, // Init the rest of multimedia library + STATE_FONT_INIT, // Load default fonts STATE_SEED_GRANTED_WAIT, // Wait for seed cap grant STATE_SEED_CAP_GRANTED, // Have seed cap grant STATE_WORLD_WAIT, // Waiting for simulator @@ -92,6 +93,9 @@ public: static void multimediaInit(); // Initialize LLViewerMedia multimedia engine. + // Load default fonts not already loaded at start screen + static void fontInit(); + // outfit_folder_name can be a folder anywhere in your inventory, // but the name must be a case-sensitive exact match. // gender_name is either "male" or "female" diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index f36d12d638975e495bc1e50afec1873cf249f665..981a843d9447ee4934642fb3ccf25a8e274bfb2a 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -53,6 +53,7 @@ #include "llmenugl.h" #include "llnotify.h" #include "llimview.h" +#include "llsd.h" #include "lltextbox.h" #include "llui.h" #include "llviewerparceloverlay.h" @@ -60,7 +61,7 @@ #include "llviewerstats.h" #include "llviewerwindow.h" #include "llframetimer.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llresmgr.h" #include "llworld.h" #include "llstatgraph.h" @@ -73,9 +74,10 @@ #include "lltoolmgr.h" #include "llfocusmgr.h" #include "llappviewer.h" - +#include "lltrans.h" // library includes #include "imageids.h" +#include "llfloaterreg.h" #include "llfontgl.h" #include "llrect.h" #include "llerror.h" @@ -91,7 +93,7 @@ // Globals // LLStatusBar *gStatusBar = NULL; -S32 STATUS_BAR_HEIGHT = 0; +S32 STATUS_BAR_HEIGHT = 26; extern S32 MENU_BAR_HEIGHT; @@ -107,8 +109,6 @@ const F32 ICON_TIMER_EXPIRY = 3.f; // How long the balance and health icons sho const F32 ICON_FLASH_FREQUENCY = 2.f; const S32 TEXT_HEIGHT = 18; -static void onClickParcelInfo(void*); -static void onClickBalance(void*); static void onClickBuyCurrency(void*); static void onClickHealth(void*); static void onClickFly(void*); @@ -123,13 +123,15 @@ std::vector<std::string> LLStatusBar::sDays; std::vector<std::string> LLStatusBar::sMonths; const U32 LLStatusBar::MAX_DATE_STRING_LENGTH = 2000; -LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect) -: LLPanel(name, LLRect(), FALSE), // not mouse opaque -mBalance(0), -mHealth(100), -mSquareMetersCredit(0), -mSquareMetersCommitted(0) +LLStatusBar::LLStatusBar(const LLRect& rect) +: LLPanel(), + mBalance(0), + mHealth(100), + mSquareMetersCredit(0), + mSquareMetersCommitted(0) { + setRect(rect); + // status bar can possible overlay menus? setMouseOpaque(FALSE); setIsChrome(TRUE); @@ -149,17 +151,16 @@ mSquareMetersCommitted(0) // build date necessary data (must do after panel built) setupDate(); - mTextParcelName = getChild<LLTextBox>("ParcelNameText" ); - mTextBalance = getChild<LLTextBox>("BalanceText" ); - mTextHealth = getChild<LLTextBox>("HealthText" ); mTextTime = getChild<LLTextBox>("TimeText" ); + + mBtnBuyCurrency = getChild<LLButton>( "buycurrency" ); + mBtnBuyCurrency->setClickedCallback( onClickBuyCurrency, this ); childSetAction("scriptout", onClickScriptDebug, this); childSetAction("health", onClickHealth, this); childSetAction("no_fly", onClickFly, this); childSetAction("buyland", onClickBuyLand, this ); - childSetAction("buycurrency", onClickBuyCurrency, this ); childSetAction("no_build", onClickBuild, this ); childSetAction("no_scripts", onClickScripts, this ); childSetAction("restrictpush", onClickPush, this ); @@ -172,33 +173,33 @@ mSquareMetersCommitted(0) childSetVisible("search_btn", gSavedSettings.getBOOL("ShowSearchBar")); childSetVisible("menubar_search_bevel_bg", gSavedSettings.getBOOL("ShowSearchBar")); - childSetActionTextbox("ParcelNameText", onClickParcelInfo ); - childSetActionTextbox("BalanceText", onClickBalance ); - // Adding Net Stat Graph S32 x = getRect().getWidth() - 2; S32 y = 0; LLRect r; r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1); - mSGBandwidth = new LLStatGraph("BandwidthGraph", r); - mSGBandwidth->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); + LLStatGraph::Params sgp; + sgp.name("BandwidthGraph"); + sgp.rect(r); + sgp.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); + sgp.mouse_opaque(false); + mSGBandwidth = LLUICtrlFactory::create<LLStatGraph>(sgp); mSGBandwidth->setStat(&LLViewerStats::getInstance()->mKBitStat); - std::string text = childGetText("bandwidth_tooltip") + " "; - LLUIString bandwidth_tooltip = text; // get the text from XML until this widget is XML driven - mSGBandwidth->setLabel(bandwidth_tooltip.getString()); mSGBandwidth->setUnits("Kbps"); mSGBandwidth->setPrecision(0); - mSGBandwidth->setMouseOpaque(FALSE); addChild(mSGBandwidth); x -= SIM_STAT_WIDTH + 2; r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1); - mSGPacketLoss = new LLStatGraph("PacketLossPercent", r); - mSGPacketLoss->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); + //these don't seem to like being reused + LLStatGraph::Params pgp; + pgp.name("PacketLossPercent"); + pgp.rect(r); + pgp.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); + pgp.mouse_opaque(false); + + mSGPacketLoss = LLUICtrlFactory::create<LLStatGraph>(pgp); mSGPacketLoss->setStat(&LLViewerStats::getInstance()->mPacketsLostPercentStat); - text = childGetText("packet_loss_tooltip") + " "; - LLUIString packet_loss_tooltip = text; // get the text from XML until this widget is XML driven - mSGPacketLoss->setLabel(packet_loss_tooltip.getString()); mSGPacketLoss->setUnits("%"); mSGPacketLoss->setMin(0.f); mSGPacketLoss->setMax(5.f); @@ -206,7 +207,6 @@ mSquareMetersCommitted(0) mSGPacketLoss->setThreshold(1, 1.f); mSGPacketLoss->setThreshold(2, 3.f); mSGPacketLoss->setPrecision(1); - mSGPacketLoss->setMouseOpaque(FALSE); mSGPacketLoss->mPerSec = FALSE; addChild(mSGPacketLoss); @@ -236,9 +236,10 @@ void LLStatusBar::draw() if (isBackgroundVisible()) { + static LLUICachedControl<S32> drop_shadow_floater ("DropShadowFloater", 0); + static LLUICachedControl<LLColor4> color_drop_shadow ("ColorDropShadow"); gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, - LLUI::sColorsGroup->getColor("ColorDropShadow"), - LLUI::sConfigGroup->getS32("DropShadowFloater") ); + color_drop_shadow, drop_shadow_floater ); } LLPanel::draw(); } @@ -247,66 +248,40 @@ void LLStatusBar::draw() // Per-frame updates of visibility void LLStatusBar::refresh() { - // Adding Net Stat Meter back in - F32 bwtotal = gViewerThrottle.getMaxBandwidth() / 1000.f; - mSGBandwidth->setMin(0.f); - mSGBandwidth->setMax(bwtotal*1.25f); - mSGBandwidth->setThreshold(0, bwtotal*0.75f); - mSGBandwidth->setThreshold(1, bwtotal); - mSGBandwidth->setThreshold(2, bwtotal); - - // *TODO: Localize / translate time - + bool net_stats_visible = gSavedSettings.getBOOL("ShowNetStats"); + + if (net_stats_visible) + { + // Adding Net Stat Meter back in + F32 bwtotal = gViewerThrottle.getMaxBandwidth() / 1000.f; + mSGBandwidth->setMin(0.f); + mSGBandwidth->setMax(bwtotal*1.25f); + mSGBandwidth->setThreshold(0, bwtotal*0.75f); + mSGBandwidth->setThreshold(1, bwtotal); + mSGBandwidth->setThreshold(2, bwtotal); + } + // Get current UTC time, adjusted for the user's clock // being off. time_t utc_time; utc_time = time_corrected(); - // There's only one internal tm buffer. - struct tm* internal_time; - - // Convert to Pacific, based on server's opinion of whether - // it's daylight savings time there. - internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime); - - S32 hour = internal_time->tm_hour; - S32 min = internal_time->tm_min; - - std::string am_pm = "AM"; - if (hour > 11) - { - hour -= 12; - am_pm = "PM"; - } - - std::string tz = "PST"; - if (gPacificDaylightTime) - { - tz = "PDT"; - } - // Zero hour is 12 AM - if (hour == 0) hour = 12; - std::ostringstream t; - t << std::setfill(' ') << std::setw(2) << hour << ":" - << std::setfill('0') << std::setw(2) << min - << " " << am_pm << " " << tz; - mTextTime->setText(t.str()); + std::string timeStr = getString("time"); + LLSD substitution; + substitution["datetime"] = (S32) utc_time; + LLStringUtil::format (timeStr, substitution); + mTextTime->setText(timeStr); - // Year starts at 1900, set the tooltip to have the date - std::ostringstream date; - date << sDays[internal_time->tm_wday] << ", " - << std::setfill('0') << std::setw(2) << internal_time->tm_mday << " " - << sMonths[internal_time->tm_mon] << " " - << internal_time->tm_year + 1900; - mTextTime->setToolTip(date.str()); + // set the tooltip to have the date + std::string dtStr = getString("timeTooltip"); + LLStringUtil::format (dtStr, substitution); + mTextTime->setToolTip (dtStr); LLRect r; const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge(); S32 x = MENU_RIGHT + MENU_PARCEL_SPACING; S32 y = 0; - bool search_visible = gSavedSettings.getBOOL("ShowSearchBar"); - // reshape menu bar to its content's width if (MENU_RIGHT != gMenuBarView->getRect().getWidth()) { @@ -461,172 +436,8 @@ void LLStatusBar::refresh() x += buttonRect.getWidth(); } - std::string location_name; - if (region) - { - const LLVector3& agent_pos_region = gAgent.getPositionAgent(); - S32 pos_x = lltrunc( agent_pos_region.mV[VX] ); - S32 pos_y = lltrunc( agent_pos_region.mV[VY] ); - S32 pos_z = lltrunc( agent_pos_region.mV[VZ] ); - - // Round the numbers based on the velocity - LLVector3 agent_velocity = gAgent.getVelocity(); - F32 velocity_mag_sq = agent_velocity.magVecSquared(); - - const F32 FLY_CUTOFF = 6.f; // meters/sec - const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; - const F32 WALK_CUTOFF = 1.5f; // meters/sec - const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; - - if (velocity_mag_sq > FLY_CUTOFF_SQ) - { - pos_x -= pos_x % 4; - pos_y -= pos_y % 4; - } - else if (velocity_mag_sq > WALK_CUTOFF_SQ) - { - pos_x -= pos_x % 2; - pos_y -= pos_y % 2; - } - - mRegionDetails.mTime = mTextTime->getText(); - mRegionDetails.mBalance = mBalance; - mRegionDetails.mAccessString = region->getSimAccessString(); - mRegionDetails.mPing = region->getNetDetailsForLCD(); - if (parcel) - { - location_name = region->getName() - + llformat(" %d, %d, %d (%s) - %s", - pos_x, pos_y, pos_z, - region->getSimAccessString().c_str(), - parcel->getName().c_str()); - - // keep these around for the LCD to use - mRegionDetails.mRegionName = region->getName(); - mRegionDetails.mParcelName = parcel->getName(); - mRegionDetails.mX = pos_x; - mRegionDetails.mY = pos_y; - mRegionDetails.mZ = pos_z; - - mRegionDetails.mArea = parcel->getArea(); - mRegionDetails.mForSale = parcel->getForSale(); - mRegionDetails.mTraffic = LLViewerParcelMgr::getInstance()->getDwelling(); - - if (parcel->isPublic()) - { - mRegionDetails.mOwner = "Public"; - } - else - { - if (parcel->getIsGroupOwned()) - { - if(!parcel->getGroupID().isNull()) - { - gCacheName->getGroupName(parcel->getGroupID(), mRegionDetails.mOwner); - } - else - { - mRegionDetails.mOwner = "Group Owned"; - } - } - else - { - // Figure out the owner's name - gCacheName->getFullName(parcel->getOwnerID(), mRegionDetails.mOwner); - } - } - } - else - { - location_name = region->getName() - + llformat(" %d, %d, %d (%s)", - pos_x, pos_y, pos_z, - region->getSimAccessString().c_str()); - // keep these around for the LCD to use - mRegionDetails.mRegionName = region->getName(); - mRegionDetails.mParcelName = "Unknown"; - - mRegionDetails.mX = pos_x; - mRegionDetails.mY = pos_y; - mRegionDetails.mZ = pos_z; - mRegionDetails.mArea = 0; - mRegionDetails.mForSale = FALSE; - mRegionDetails.mOwner = "Unknown"; - mRegionDetails.mTraffic = 0.0f; - } - } - else - { - // no region - location_name = "(Unknown)"; - // keep these around for the LCD to use - mRegionDetails.mRegionName = "Unknown"; - mRegionDetails.mParcelName = "Unknown"; - mRegionDetails.mAccessString = "Unknown"; - mRegionDetails.mX = 0; - mRegionDetails.mY = 0; - mRegionDetails.mZ = 0; - mRegionDetails.mArea = 0; - mRegionDetails.mForSale = FALSE; - mRegionDetails.mOwner = "Unknown"; - mRegionDetails.mTraffic = 0.0f; - } - - mTextParcelName->setText(location_name); - - - - // x = right edge - // loop through: stat graphs, search btn, search text editor, money, buy money, clock - // adjust rect - // finally adjust parcel name rect - - S32 new_right = getRect().getWidth(); - if (search_visible) - { - childGetRect("search_btn", r); - //r.translate( new_right - r.mRight, 0); - //childSetRect("search_btn", r); - new_right -= r.getWidth(); - - childGetRect("search_editor", r); - //r.translate( new_right - r.mRight, 0); - //childSetRect("search_editor", r); - new_right -= r.getWidth() + 6; - } - else - { - childGetRect("stat_btn", r); - r.translate( new_right - r.mRight, 0); - childSetRect("stat_btn", r); - new_right -= r.getWidth() + 6; - } - - // Set rects of money, buy money, time - childGetRect("BalanceText", r); - r.translate( new_right - r.mRight, 0); - childSetRect("BalanceText", r); - new_right -= r.getWidth() - 18; - - childGetRect("buycurrency", r); - r.translate( new_right - r.mRight, 0); - childSetRect("buycurrency", r); - new_right -= r.getWidth() + 6; - - childGetRect("TimeText", r); - // mTextTime->getTextPixelWidth(); - r.translate( new_right - r.mRight, 0); - childSetRect("TimeText", r); - // new_right -= r.getWidth() + MENU_PARCEL_SPACING; - - - // Adjust region name and parcel name - x += 8; - - const S32 PARCEL_RIGHT = llmin(mTextTime->getRect().mLeft, mTextParcelName->getTextPixelWidth() + x + 5); - r.set(x+4, getRect().getHeight() - 2, PARCEL_RIGHT, 0); - mTextParcelName->setRect(r); - + bool search_visible = gSavedSettings.getBOOL("ShowSearchBar"); + // Set search bar visibility if (gAgent.getCameraMode() != CAMERA_MODE_MOUSELOOK) @@ -638,16 +449,15 @@ void LLStatusBar::refresh() childSetVisible("menubar_search_bevel_bg", search_visible); } - mSGBandwidth->setVisible(! search_visible); - mSGPacketLoss->setVisible(! search_visible); - childSetEnabled("stat_btn", ! search_visible); + mSGBandwidth->setVisible(net_stats_visible); + mSGPacketLoss->setVisible(net_stats_visible); + childSetEnabled("stat_btn", net_stats_visible); } void LLStatusBar::setVisibleForMouselook(bool visible) { - mTextBalance->setVisible(visible); mTextTime->setVisible(visible); - childSetVisible("buycurrency", visible); + mBtnBuyCurrency->setVisible(visible); childSetVisible("search_editor", visible); childSetVisible("search_btn", visible); childSetVisible("menubar_search_bevel_bg", visible); @@ -671,7 +481,15 @@ void LLStatusBar::setBalance(S32 balance) std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance ); std::string balance_str = "L$"; balance_str += money_str; - mTextBalance->setText( balance_str ); + mBtnBuyCurrency->setLabel( balance_str ); + + // Resize the balance button so that the label fits it, and the button expands to the left. + // *TODO: LLButton should have an option where to expand. + { + S32 saved_right = mBtnBuyCurrency->getRect().mRight; + mBtnBuyCurrency->autoResize(); + mBtnBuyCurrency->translate(saved_right - mBtnBuyCurrency->getRect().mRight, 0); + } if (mBalance && (fabs((F32)(mBalance - balance)) > gSavedSettings.getF32("UISndMoneyChangeThreshold"))) { @@ -775,18 +593,6 @@ S32 LLStatusBar::getSquareMetersLeft() const return mSquareMetersCredit - mSquareMetersCommitted; } -static void onClickParcelInfo(void* data) -{ - LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); - - LLFloaterLand::showInstance(); -} - -static void onClickBalance(void* data) -{ - onClickBuyCurrency(data); -} - static void onClickBuyCurrency(void* data) { LLFloaterBuyCurrency::buyCurrency(); @@ -920,7 +726,7 @@ void LLStatusBar::onClickSearch(void* data) { LLStatusBar* self = (LLStatusBar*)data; std::string search_text = self->childGetText("search_editor"); - LLFloaterDirectory::showFindAll(search_text); + LLFloaterReg::showInstance("search", LLSD().insert("panel", "all").insert("id", LLSD(search_text))); } // static diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index c5b4be035ab5a18e6f050e41973fbed8ab5f6aba..84dd761930012361104990d21c7a801531f11c07 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -48,45 +48,11 @@ class LLUUID; class LLFrameTimer; class LLStatGraph; -// used by LCD screen -class LLRegionDetails -{ -public: - LLRegionDetails() : - mRegionName("Unknown"), - mParcelName("Unknown"), - mAccessString("Unknown"), - mX(0), - mY(0), - mZ(0), - mArea (0), - mForSale(FALSE), - mOwner("Unknown"), - mTraffic(0), - mBalance(0), - mPing(0) - { - } - std::string mRegionName; - std::string mParcelName; - std::string mAccessString; - S32 mX; - S32 mY; - S32 mZ; - S32 mArea; - BOOL mForSale; - std::string mOwner; - F32 mTraffic; - S32 mBalance; - std::string mTime; - U32 mPing; -}; - class LLStatusBar : public LLPanel { public: - LLStatusBar(const std::string& name, const LLRect& rect ); + LLStatusBar(const LLRect& rect ); /*virtual*/ ~LLStatusBar(); /*virtual*/ void draw(); @@ -116,7 +82,6 @@ public: S32 getSquareMetersCredit() const; S32 getSquareMetersCommitted() const; S32 getSquareMetersLeft() const; - LLRegionDetails mRegionDetails; private: // simple method to setup the part that holds the date @@ -127,12 +92,9 @@ private: static void onClickStatGraph(void* data); private: - LLTextBox *mTextBalance; LLTextBox *mTextHealth; LLTextBox *mTextTime; - LLTextBox* mTextParcelName; - LLStatGraph *mSGBandwidth; LLStatGraph *mSGPacketLoss; diff --git a/indra/newview/llstylemap.cpp b/indra/newview/llstylemap.cpp index a34b4b83f30f3929059cf4e05eaf4448ebeac9bf..a1384c28bae154b3fad69671e4a4cf69e23238e4 100644 --- a/indra/newview/llstylemap.cpp +++ b/indra/newview/llstylemap.cpp @@ -64,7 +64,7 @@ const LLStyleSP &LLStyleMap::lookupAgent(const LLUUID &source) style->setFontName(LLStringUtil::null); if (source != LLUUID::null && source != gAgent.getID() ) { - style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); + style->setColor(gSavedSkinSettings.getColor4("HTMLLinkColor")); std::string link = llformat("secondlife:///app/agent/%s/about",source.asString().c_str()); style->setLinkHREF(link); } @@ -90,7 +90,7 @@ const LLStyleSP &LLStyleMap::lookup(const LLUUID& id, const std::string& link) style->setFontName(LLStringUtil::null); if (id != LLUUID::null && !link.empty()) { - style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); + style->setColor(gSavedSkinSettings.getColor4("HTMLLinkColor")); style->setLinkHREF(link); } else @@ -115,6 +115,6 @@ void LLStyleMap::update() { LLStyleSP &style = iter->second; // Update the link color in case it has been changed. - style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); + style->setColor(gSavedSkinSettings.getColor4("HTMLLinkColor")); } } diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index a27f0e22540dc487560c5c7cc734da9dd1a7fde6..27a08e7d7ba3bf06f7eefe58e506d24582408bc2 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -68,7 +68,6 @@ LLColor4U MAX_WATER_COLOR(0, 48, 96, 240); S32 LLSurface::sTextureSize = 256; S32 LLSurface::sTexelsUpdated = 0; F32 LLSurface::sTextureUpdateTime = 0.f; -LLStat LLSurface::sTexelsUpdatedPerSecStat; // ---------------- LLSurface:: Public Members --------------- @@ -629,6 +628,7 @@ void LLSurface::updatePatchVisibilities(LLAgent &agent) BOOL LLSurface::idleUpdate(F32 max_update_time) { + LLMemType mt_ius(LLMemType::MTYPE_IDLE_UPDATE_SURFACE); if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_TERRAIN)) { return FALSE; diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h index 003b2f25059153cf307e03a416a36815c93b4eb5..310ab5d2c3807b51b2e8995515f52c857801f3e7 100644 --- a/indra/newview/llsurface.h +++ b/indra/newview/llsurface.h @@ -173,7 +173,6 @@ public: static F32 sTextureUpdateTime; static S32 sTexelsUpdated; - static LLStat sTexelsUpdatedPerSecStat; protected: void createSTexture(); diff --git a/indra/newview/llsurfacepatch.h b/indra/newview/llsurfacepatch.h index 7e84f7f6c5d29e79d3d831dd6ceeafac788467b3..4cac9773059d752faf19f50339a551f9ef75124b 100644 --- a/indra/newview/llsurfacepatch.h +++ b/indra/newview/llsurfacepatch.h @@ -35,7 +35,7 @@ #include "v3math.h" #include "v3dmath.h" -#include "llmemory.h" +#include "llpointer.h" class LLSurface; class LLVOSurfacePatch; diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6fc120d920c57741a2c340d01570793cc6ee806c --- /dev/null +++ b/indra/newview/llteleporthistory.cpp @@ -0,0 +1,198 @@ +/** + * @file llteleporthistory.cpp + * @brief Teleport history + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llteleporthistory.h" + +#include "llparcel.h" +#include "llsdserialize.h" + +#include "llagent.h" +#include "llslurl.h" +#include "llurlsimstring.h" +#include "llviewerparcelmgr.h" +#include "llviewerregion.h" +#include "llworldmap.h" + +////////////////////////////////////////////////////////////////////////////// +// LLTeleportHistoryItem +////////////////////////////////////////////////////////////////////////////// + +LLTeleportHistoryItem::LLTeleportHistoryItem(const LLSD& val) +{ + mTitle = val["title"].asString(); + mGlobalPos.setValue(val["global_pos"]); +} + +LLSD LLTeleportHistoryItem::toLLSD() const +{ + LLSD val; + + val["title"] = mTitle; + val["global_pos"] = mGlobalPos.getValue(); + + return val; +} + +////////////////////////////////////////////////////////////////////////////// +// LLTeleportHistory +////////////////////////////////////////////////////////////////////////////// + +LLTeleportHistory::LLTeleportHistory(): + mCurrentItem(-1), + mRequestedItem(-1), + mGotInitialUpdate(false) +{ + mTeleportFinishedConn = LLViewerParcelMgr::getInstance()-> + setTeleportFinishedCallback(boost::bind(&LLTeleportHistory::updateCurrentLocation, this)); + mTeleportFailedConn = LLViewerParcelMgr::getInstance()-> + setTeleportFailedCallback(boost::bind(&LLTeleportHistory::onTeleportFailed, this)); +} + +LLTeleportHistory::~LLTeleportHistory() +{ + mTeleportFinishedConn.disconnect(); + mTeleportFailedConn.disconnect(); +} + +void LLTeleportHistory::goToItem(int idx) + +{ + // Validate specified index. + if (idx < 0 || idx >= (int)mItems.size()) + { + llwarns << "Invalid teleport history index (" << idx << ") specified" << llendl; + dump(); + return; + } + + if (idx == mCurrentItem) + { + llwarns << "Will not teleport to the same location." << llendl; + dump(); + return; + } + + // Attempt to teleport to the requested item. + gAgent.teleportViaLocation(mItems[idx].mGlobalPos); + mRequestedItem = idx; +} + +void LLTeleportHistory::onTeleportFailed() +{ + // Are we trying to teleport within the history? + if (mRequestedItem != -1) + { + // Not anymore. + mRequestedItem = -1; + } +} + +void LLTeleportHistory::updateCurrentLocation() +{ + if (mRequestedItem != -1) // teleport within the history in progress? + { + mCurrentItem = mRequestedItem; + mRequestedItem = -1; + } + else + { + // If we're getting the initial location update + // while we already have a (loaded) non-empty history, + // there's no need to purge forward items or add a new item. + + if (mGotInitialUpdate || mItems.size() == 0) + { + // Purge forward items (if any). + if(mItems.size()) + mItems.erase (mItems.begin() + mCurrentItem + 1, mItems.end()); + + // Append an empty item to the history and make it current. + mItems.push_back(LLTeleportHistoryItem("", LLVector3d())); + mCurrentItem++; + } + + // Update current history item. + if (mCurrentItem < 0 || mCurrentItem >= (int) mItems.size()) // sanity check + { + llwarns << "Invalid current item. (this should not happen)" << llendl; + return; + } + mItems[mCurrentItem].mTitle = getCurrentLocationTitle(); + mItems[mCurrentItem].mGlobalPos = gAgent.getPositionGlobal(); + mItems[mCurrentItem].mRegionID = gAgent.getRegion()->getRegionID(); + } + + dump(); + + if (!mGotInitialUpdate) + mGotInitialUpdate = true; + + // Signal the interesting party that we've changed. + onHistoryChanged(); +} + +boost::signals::connection LLTeleportHistory::setHistoryChangedCallback(history_callback_t cb) +{ + return mHistoryChangedSignal.connect(cb); +} + +void LLTeleportHistory::onHistoryChanged() +{ + mHistoryChangedSignal(); +} + +// static +std::string LLTeleportHistory::getCurrentLocationTitle() +{ + std::string location_name; + + if (!gAgent.buildLocationString(location_name, LLAgent::LOCATION_FORMAT_NORMAL)) + location_name = "Unknown"; + + return location_name; +} + +void LLTeleportHistory::dump() const +{ + llinfos << "Teleport history dump (" << mItems.size() << " items):" << llendl; + + for (size_t i=0; i<mItems.size(); i++) + { + std::stringstream line; + line << ((i == mCurrentItem) ? " * " : " "); + line << i << ": " << mItems[i].mTitle; + line << " REGION_ID: " << mItems[i].mRegionID; + llinfos << line.str() << llendl; + } +} diff --git a/indra/newview/llteleporthistory.h b/indra/newview/llteleporthistory.h new file mode 100644 index 0000000000000000000000000000000000000000..5be3dc171ffdda49582e57fe8fac71a7a8cc1e9a --- /dev/null +++ b/indra/newview/llteleporthistory.h @@ -0,0 +1,225 @@ +/** + * @file llteleporthistory.h + * @brief Teleport history + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLTELEPORTHISTORY_H +#define LL_LLTELEPORTHISTORY_H + +#include "llsingleton.h" // for LLSingleton + +#include <vector> +#include <string> +#include <boost/function.hpp> +#include <boost/signal.hpp> +#include <boost/signals/connection.hpp> + + +/** + * An item of the teleport history. + * + * Contains the location's global coordinates and its title. + */ +class LLTeleportHistoryItem +{ +public: + LLTeleportHistoryItem() + {} + + LLTeleportHistoryItem(std::string title, LLVector3d global_pos) + : mTitle(title), mGlobalPos(global_pos) + {} + + LLTeleportHistoryItem(const LLSD& val); + LLSD toLLSD() const; + + std::string mTitle; // human-readable location title + LLVector3d mGlobalPos; // global position + LLUUID mRegionID; // region ID for getting the region info +}; + +/** + * Teleport history. + * + * Along with the navigation bar "Back" and "Forward" buttons + * implements web browser-like navigation functionality. + * + * @see LLNavigationBar + */ +class LLTeleportHistory: public LLSingleton<LLTeleportHistory> +{ + LOG_CLASS(LLTeleportHistory); + +public: + + typedef std::vector<LLTeleportHistoryItem> slurl_list_t; + typedef boost::function<void()> history_callback_t; + typedef boost::signal <void()> history_signal_t; + + LLTeleportHistory(); + ~LLTeleportHistory(); + + /** + * Go back in the history. + */ + void goBack() { goToItem(getCurrentItemIndex() - 1); } + + /** + * Go forward in the history. + */ + void goForward() { goToItem(getCurrentItemIndex() + 1); } + + /** + * Go to specific item in the history. + * + * The item is specified by its index (starting from 0). + */ + void goToItem(int idx); + + /** + * @return history items. + */ + const slurl_list_t& getItems() const { return mItems; } + + /** + * Is the history empty? + * + * History containing single item is treated as empty + * because the item points to the current location. + */ + bool isEmpty() const { return mItems.size() <= 1; } + + /** + * Get index of the current location in the history. + */ + int getCurrentItemIndex() const { return mCurrentItem; } + + /** + * Set a callback to be called upon history changes. + * + * Multiple callbacks can be set. + */ + boost::signals::connection setHistoryChangedCallback(history_callback_t cb); + + /** + * Save history to a file so that we can restore it on startup. + * + * @see load() + */ + void dump() const; + +private: + + /** + * Called by when a teleport fails. + * + * Called via callback set on the LLViewerParcelMgr "teleport failed" signal. + * + * @see mTeleportFailedConn + */ + void onTeleportFailed(); + + /** + * Update current location. + * + * Called when a teleport finishes. + * Called via callback set on the LLViewerParcelMgr "teleport finished" signal. + * + * Takes mRequestedItem into consideration: if it's not -1 + * (i.e. user is teleporting to an arbitrary location, not to a history item) + * we purge forward items and append a new one, making it current. Otherwise + * we just modify mCurrentItem. + * + * @see mRequestedItem + * @see mGotInitialUpdate + */ + void updateCurrentLocation(); + + /** + * Invokes the "history changed" callback(s). + */ + void onHistoryChanged(); + + static std::string getCurrentLocationTitle(); + + /** + * Actually, the teleport history. + */ + slurl_list_t mItems; + + /** + * Current position within the history. + */ + int mCurrentItem; + + /** + * Requested position within the history. + * + * When a teleport succeeds, this is checked by updateCurrentLocation() to tell + * if this is a teleport within the history (mRequestedItem >=0) or not (-1). + * + * Set by goToItem(); reset by onTeleportFailed() (if teleport fails). + * + * @see goToItem() + * @see updateCurrentLocation() + */ + int mRequestedItem; + + /** + * Have we received the initial location update? + * + * @see updateCurrentLocation() + */ + bool mGotInitialUpdate; + + /** + * Signal emitted when the history gets changed. + * + * Invokes callbacks set with setHistoryChangedCallback(). + */ + history_signal_t mHistoryChangedSignal; + + /** + * Teleport success notification connection. + * + * Using this connection we get notified when a teleport finishes + * or initial location update occurs. + */ + boost::signals::connection mTeleportFinishedConn; + + /** + * Teleport failure notification connection. + * + * Using this connection we get notified when a teleport fails. + */ + boost::signals::connection mTeleportFailedConn; +}; + +#endif diff --git a/indra/newview/lltexglobalcolor.cpp b/indra/newview/lltexglobalcolor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e81c3731f76d6b42e528a272cc9b42e5c8325e2b --- /dev/null +++ b/indra/newview/lltexglobalcolor.cpp @@ -0,0 +1,150 @@ +/** + * @file lltexlayerglobalcolor.cpp + * @brief SERAPH - ADD IN + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llagent.h" +#include "lltexlayer.h" +#include "llvoavatar.h" +#include "lltexglobalcolor.h" + +//----------------------------------------------------------------------------- +// LLTexGlobalColor +//----------------------------------------------------------------------------- + +LLTexGlobalColor::LLTexGlobalColor(LLVOAvatar* avatar) + : + mAvatar(avatar), + mInfo(NULL) +{ +} + +LLTexGlobalColor::~LLTexGlobalColor() +{ + // mParamColorList are LLViewerVisualParam's and get deleted with ~LLCharacter() + //std::for_each(mParamColorList.begin(), mParamColorList.end(), DeletePointer()); +} + +BOOL LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info) +{ + llassert(mInfo == NULL); + mInfo = info; + //mID = info->mID; // No ID + + mParamGlobalColorList.reserve(mInfo->mParamColorInfoList.size()); + for (param_color_info_list_t::iterator iter = mInfo->mParamColorInfoList.begin(); + iter != mInfo->mParamColorInfoList.end(); + iter++) + { + LLTexParamGlobalColor* param_color = new LLTexParamGlobalColor(this); + if (!param_color->setInfo(*iter)) + { + mInfo = NULL; + return FALSE; + } + mParamGlobalColorList.push_back(param_color); + } + + return TRUE; +} + +LLColor4 LLTexGlobalColor::getColor() const +{ + // Sum of color params + if (mParamGlobalColorList.empty()) + return LLColor4(1.f, 1.f, 1.f, 1.f); + + LLColor4 net_color(0.f, 0.f, 0.f, 0.f); + LLTexLayer::calculateTexLayerColor(mParamGlobalColorList, net_color); + return net_color; +} + +const std::string& LLTexGlobalColor::getName() const +{ + return mInfo->mName; +} + +//----------------------------------------------------------------------------- +// LLTexParamGlobalColor +//----------------------------------------------------------------------------- +LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) : + LLTexLayerParamColor((LLTexLayer*)NULL), + mTexGlobalColor(tex_global_color) +{ + mAvatar = tex_global_color->getAvatar(); +} + +void LLTexParamGlobalColor::onGlobalColorChanged(bool set_by_user) +{ + mAvatar->onGlobalColorChanged(mTexGlobalColor, set_by_user); +} + +//----------------------------------------------------------------------------- +// LLTexGlobalColorInfo +//----------------------------------------------------------------------------- + +LLTexGlobalColorInfo::LLTexGlobalColorInfo() +{ +} + + +LLTexGlobalColorInfo::~LLTexGlobalColorInfo() +{ + for_each(mParamColorInfoList.begin(), mParamColorInfoList.end(), DeletePointer()); +} + +BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node) +{ + // name attribute + static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); + if (!node->getFastAttributeString(name_string, mName)) + { + llwarns << "<global_color> element is missing name attribute." << llendl; + return FALSE; + } + // <param> sub-element + for (LLXmlTreeNode* child = node->getChildByName("param"); + child; + child = node->getNextNamedChild()) + { + if (child->getChildByName("param_color")) + { + // <param><param_color/></param> + LLTexLayerParamColorInfo* info = new LLTexLayerParamColorInfo(); + if (!info->parseXml(child)) + { + delete info; + return FALSE; + } + mParamColorInfoList.push_back(info); + } + } + return TRUE; +} diff --git a/indra/newview/lltexglobalcolor.h b/indra/newview/lltexglobalcolor.h new file mode 100644 index 0000000000000000000000000000000000000000..154b8143922a0315f5c77ab8fb87e6ad577bba63 --- /dev/null +++ b/indra/newview/lltexglobalcolor.h @@ -0,0 +1,86 @@ +/** + * @file lltexglobalcolor.h + * @brief This is global texture color info used by llvoavatar. + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLTEXGLOBALCOLOR_H +#define LL_LLTEXGLOBALCOLOR_H + +#include "lltexlayer.h" +#include "lltexlayerparams.h" + +class LLVOAvatar; +class LLTexGlobalColorInfo; + +class LLTexGlobalColor +{ +public: + LLTexGlobalColor( LLVOAvatar* avatar ); + ~LLTexGlobalColor(); + + LLTexGlobalColorInfo* getInfo() const { return mInfo; } + // This sets mInfo and calls initialization functions + BOOL setInfo(LLTexGlobalColorInfo *info); + + LLVOAvatar* getAvatar() const { return mAvatar; } + LLColor4 getColor() const; + const std::string& getName() const; + +private: + param_color_list_t mParamGlobalColorList; + LLVOAvatar* mAvatar; // just backlink, don't LLPointer + LLTexGlobalColorInfo *mInfo; +}; + +// Used by llvoavatar to determine skin/eye/hair color. +class LLTexGlobalColorInfo +{ + friend class LLTexGlobalColor; +public: + LLTexGlobalColorInfo(); + ~LLTexGlobalColorInfo(); + + BOOL parseXml(LLXmlTreeNode* node); + +private: + param_color_info_list_t mParamColorInfoList; + std::string mName; +}; + +class LLTexParamGlobalColor : public LLTexLayerParamColor +{ +public: + LLTexParamGlobalColor(LLTexGlobalColor *tex_color); +protected: + /*virtual*/ void onGlobalColorChanged(bool set_by_user); +private: + LLTexGlobalColor* mTexGlobalColor; +}; + +#endif diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index b05da8c6d8dcff424935dabbfe611a49dcbebaf6..716ab8eef424510893bddde332d03adbd336b137 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -31,80 +31,56 @@ */ #include "llviewerprecompiledheaders.h" - -#include "imageids.h" #include "llagent.h" -#include "llcrc.h" -#include "lldir.h" -#include "llglheaders.h" -#include "llimagebmp.h" -#include "llimagej2c.h" -#include "llimagetga.h" -#include "llpolymorph.h" -#include "llquantize.h" #include "lltexlayer.h" -#include "llui.h" -#include "llvfile.h" -#include "llviewerimagelist.h" -#include "llviewerimagelist.h" -#include "llviewerregion.h" #include "llviewerstats.h" -#include "llviewerwindow.h" +#include "llviewerregion.h" #include "llvoavatar.h" -#include "llxmltree.h" +#include "llvoavatarself.h" #include "pipeline.h" -#include "v4coloru.h" -#include "llrender.h" #include "llassetuploadresponders.h" +#include "lltexlayerparams.h" +#include "llui.h" //#include "../tools/imdebug/imdebug.h" using namespace LLVOAvatarDefines; -// static -S32 LLTexLayerSetBuffer::sGLByteCount = 0; -S32 LLTexLayerSetBuffer::sGLBumpByteCount = 0; - //----------------------------------------------------------------------------- // LLBakedUploadData() //----------------------------------------------------------------------------- -LLBakedUploadData::LLBakedUploadData( LLVOAvatar* avatar, - LLTexLayerSet* layerset, - LLTexLayerSetBuffer* layerset_buffer, - const LLUUID & id ) : - mAvatar( avatar ), - mLayerSet( layerset ), - mLayerSetBuffer( layerset_buffer ), - mID(id) +LLBakedUploadData::LLBakedUploadData(const LLVOAvatarSelf* avatar, + LLTexLayerSet* layerset, + const LLUUID& id) : + mAvatar(avatar), + mTexLayerSet(layerset), + mID(id), + mStartTime(LLFrameTimer::getTotalTime()) // Record starting time { - mStartTime = LLFrameTimer::getTotalTime(); // Record starting time - for( S32 i = 0; i < WT_COUNT; i++ ) - { - LLWearable* wearable = gAgent.getWearable( (EWearableType)i); - if( wearable ) - { - mWearableAssets[i] = wearable->getID(); - } - } } //----------------------------------------------------------------------------- // LLTexLayerSetBuffer // The composite image that a LLTexLayerSet writes to. Each LLTexLayerSet has one. //----------------------------------------------------------------------------- -LLTexLayerSetBuffer::LLTexLayerSetBuffer( LLTexLayerSet* owner, S32 width, S32 height, BOOL has_bump ) - : + +// static +S32 LLTexLayerSetBuffer::sGLByteCount = 0; +S32 LLTexLayerSetBuffer::sGLBumpByteCount = 0; + +LLTexLayerSetBuffer::LLTexLayerSetBuffer(LLTexLayerSet* const owner, + S32 width, S32 height, + BOOL has_bump) : // ORDER_LAST => must render these after the hints are created. LLDynamicTexture( width, height, 4, LLDynamicTexture::ORDER_LAST, TRUE ), mNeedsUpdate( TRUE ), mNeedsUpload( FALSE ), mUploadPending( FALSE ), // Not used for any logic here, just to sync sending of updates - mTexLayerSet( owner ) + mTexLayerSet(owner), + mHasBump(has_bump), + mBumpTex(NULL) { LLTexLayerSetBuffer::sGLByteCount += getSize(); - mHasBump = has_bump ; - mBumpTex = NULL ; - createBumpTexture() ; } @@ -115,10 +91,11 @@ LLTexLayerSetBuffer::~LLTexLayerSetBuffer() if( mBumpTex.notNull()) { mBumpTex = NULL ; - LLImageGL::sGlobalTextureMemory -= mWidth * mHeight * 4; + LLImageGL::sGlobalTextureMemoryInBytes -= mWidth * mHeight * 4; LLTexLayerSetBuffer::sGLBumpByteCount -= mWidth * mHeight * 4; } } + //virtual void LLTexLayerSetBuffer::restoreGLTexture() { @@ -132,7 +109,7 @@ void LLTexLayerSetBuffer::destroyGLTexture() if( mBumpTex.notNull() ) { mBumpTex = NULL ; - LLImageGL::sGlobalTextureMemory -= mWidth * mHeight * 4; + LLImageGL::sGlobalTextureMemoryInBytes -= mWidth * mHeight * 4; LLTexLayerSetBuffer::sGLBumpByteCount -= mWidth * mHeight * 4; } @@ -163,7 +140,7 @@ void LLTexLayerSetBuffer::createBumpTexture() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLImageGL::sGlobalTextureMemory += mWidth * mHeight * 4; + LLImageGL::sGlobalTextureMemoryInBytes += mWidth * mHeight * 4; LLTexLayerSetBuffer::sGLBumpByteCount += mWidth * mHeight * 4; } } @@ -202,7 +179,7 @@ void LLTexLayerSetBuffer::cancelUpload() mUploadPending = FALSE; } -void LLTexLayerSetBuffer::pushProjection() +void LLTexLayerSetBuffer::pushProjection() const { glMatrixMode(GL_PROJECTION); gGL.pushMatrix(); @@ -214,7 +191,7 @@ void LLTexLayerSetBuffer::pushProjection() glLoadIdentity(); } -void LLTexLayerSetBuffer::popProjection() +void LLTexLayerSetBuffer::popProjection() const { glMatrixMode(GL_PROJECTION); gGL.popMatrix(); @@ -225,12 +202,12 @@ void LLTexLayerSetBuffer::popProjection() BOOL LLTexLayerSetBuffer::needsRender() { - LLVOAvatar* avatar = mTexLayerSet->getAvatar(); + const LLVOAvatarSelf* avatar = mTexLayerSet->getAvatar(); BOOL upload_now = mNeedsUpload && mTexLayerSet->isLocalTextureDataFinal(); - BOOL needs_update = gAgent.mNumPendingQueries == 0 && (mNeedsUpdate || upload_now) && !avatar->mAppearanceAnimating; + BOOL needs_update = gAgentQueryManager.hasNoPendingQueries() && (mNeedsUpdate || upload_now) && !avatar->mAppearanceAnimating; if (needs_update) { - BOOL invalid_skirt = avatar->getBakedTE(mTexLayerSet) == TEX_SKIRT_BAKED && !avatar->isWearingWearableType(WT_SKIRT); + BOOL invalid_skirt = avatar->getBakedTE(mTexLayerSet) == LLVOAvatarDefines::TEX_SKIRT_BAKED && !avatar->isWearingWearableType(WT_SKIRT); if (invalid_skirt) { // we were trying to create a skirt texture @@ -272,7 +249,7 @@ BOOL LLTexLayerSetBuffer::render() // do we need to upload, and do we have sufficient data to create an uploadable composite? // When do we upload the texture if gAgent.mNumPendingQueries is non-zero? - BOOL upload_now = (gAgent.mNumPendingQueries == 0 && mNeedsUpload && mTexLayerSet->isLocalTextureDataFinal()); + BOOL upload_now = (gAgentQueryManager.hasNoPendingQueries() && mNeedsUpload && mTexLayerSet->isLocalTextureDataFinal()); BOOL success = TRUE; // Composite bump @@ -312,7 +289,6 @@ BOOL LLTexLayerSetBuffer::render() { if (!success) { - delete [] baked_bump_data; llinfos << "Failed attempt to bake " << mTexLayerSet->getBodyRegion() << llendl; mUploadPending = FALSE; } @@ -330,6 +306,7 @@ BOOL LLTexLayerSetBuffer::render() mTexture->setGLTextureCreated(true); mNeedsUpdate = FALSE; + delete [] baked_bump_data; return success; } @@ -353,7 +330,7 @@ BOOL LLTexLayerSetBuffer::updateImmediate() return result; } -void LLTexLayerSetBuffer::readBackAndUpload(U8* baked_bump_data) +void LLTexLayerSetBuffer::readBackAndUpload(const U8* baked_bump_data) { // pointers for storing data to upload U8* baked_color_data = new U8[ mWidth * mHeight * 4 ]; @@ -375,10 +352,8 @@ void LLTexLayerSetBuffer::readBackAndUpload(U8* baked_bump_data) LLPointer<LLImageRaw> baked_mask_image = new LLImageRaw(mWidth, mHeight, 1 ); U8* baked_mask_data = baked_mask_image->getData(); - - mTexLayerSet->gatherAlphaMasks(baked_mask_data, mWidth, mHeight); -// imdebug("lum b=8 w=%d h=%d %p", mWidth, mHeight, baked_mask_data); - + + mTexLayerSet->gatherMorphMaskAlpha(baked_mask_data, mWidth, mHeight); // writes into baked_color_data const char* comment_text = NULL; @@ -387,13 +362,11 @@ void LLTexLayerSetBuffer::readBackAndUpload(U8* baked_bump_data) LLPointer<LLImageRaw> baked_image = new LLImageRaw( mWidth, mHeight, baked_image_components ); U8* baked_image_data = baked_image->getData(); + if( mBumpTex.notNull() ) { comment_text = LINDEN_J2C_COMMENT_PREFIX "RGBHM"; // 5 channels: rgb, heightfield/alpha, mask - // Hide the alpha for the eyelashes in a corner of the bump map - if (mTexLayerSet->getBodyRegion() == "head") - { S32 i = 0; for( S32 u = 0; u < mWidth; u++ ) { @@ -409,25 +382,6 @@ void LLTexLayerSetBuffer::readBackAndUpload(U8* baked_bump_data) } } else - { - S32 i = 0; - for( S32 u = 0; u < mWidth; u++ ) - { - for( S32 v = 0; v < mHeight; v++ ) - { - baked_image_data[5*i + 0] = baked_color_data[4*i + 0]; - baked_image_data[5*i + 1] = baked_color_data[4*i + 1]; - baked_image_data[5*i + 2] = baked_color_data[4*i + 2]; - baked_image_data[5*i + 3] = 255; // reserve for alpha - baked_image_data[5*i + 4] = baked_mask_data[i]; - i++; - } - } - } - } - else - { - if (mTexLayerSet->getBodyRegion() == "skirt" || mTexLayerSet->getBodyRegion() == "hair") { S32 i = 0; for( S32 u = 0; u < mWidth; u++ ) @@ -442,22 +396,6 @@ void LLTexLayerSetBuffer::readBackAndUpload(U8* baked_bump_data) } } } - else - { - S32 i = 0; - for( S32 u = 0; u < mWidth; u++ ) - { - for( S32 v = 0; v < mHeight; v++ ) - { - baked_image_data[4*i + 0] = baked_color_data[4*i + 0]; - baked_image_data[4*i + 1] = baked_color_data[4*i + 1]; - baked_image_data[4*i + 2] = baked_color_data[4*i + 2]; - baked_image_data[4*i + 3] = 255; // eyes should have no mask - reserve for alpha - i++; - } - } - } - } LLPointer<LLImageJ2C> compressedImage = new LLImageJ2C; compressedImage->setRate(0.f); @@ -490,7 +428,7 @@ void LLTexLayerSetBuffer::readBackAndUpload(U8* baked_bump_data) { // baked_upload_data is owned by the responder and deleted after the request completes LLBakedUploadData* baked_upload_data = - new LLBakedUploadData( gAgent.getAvatarObject(), this->mTexLayerSet, this, asset_id ); + new LLBakedUploadData(gAgent.getAvatarObject(), this->mTexLayerSet, asset_id); mUploadID = asset_id; // upload the image @@ -536,73 +474,74 @@ void LLTexLayerSetBuffer::readBackAndUpload(U8* baked_bump_data) } delete [] baked_color_data; - delete [] baked_bump_data; } // static -void LLTexLayerSetBuffer::onTextureUploadComplete(const LLUUID& uuid, void* userdata, S32 result, LLExtStat ext_status) // StoreAssetData callback (not fixed) +void LLTexLayerSetBuffer::onTextureUploadComplete(const LLUUID& uuid, + void* userdata, + S32 result, + LLExtStat ext_status) // StoreAssetData callback (not fixed) { LLBakedUploadData* baked_upload_data = (LLBakedUploadData*)userdata; - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); - if (0 == result && avatar && !avatar->isDead()) + if (0 == result && + avatar && + !avatar->isDead() && + baked_upload_data->mAvatar == avatar && // Sanity check: only the user's avatar should be uploading textures. + baked_upload_data->mTexLayerSet->hasComposite() + ) { - // Sanity check: only the user's avatar should be uploading textures. - if( baked_upload_data->mAvatar == avatar ) + LLTexLayerSetBuffer* layerset_buffer = baked_upload_data->mTexLayerSet->getComposite(); + + if (layerset_buffer->mUploadID.isNull()) { - // Composite may have changed since the pointer was stored - need to do some checking. - LLTexLayerSetBuffer* prev_layerset_buffer = baked_upload_data->mLayerSetBuffer; - // Can't just call getComposite() because this will trigger creation if none exists. - LLTexLayerSetBuffer* curr_layerset_buffer = - baked_upload_data->mLayerSet->hasComposite()?baked_upload_data->mLayerSet->getComposite():NULL; + // The upload got canceled, we should be in the + // process of baking a new texture so request an + // upload with the new data - if (prev_layerset_buffer != curr_layerset_buffer) + // BAP: does this really belong in this callback, as + // opposed to where the cancellation takes place? + // suspect this does nothing. + layerset_buffer->requestUpload(); + } + else if (baked_upload_data->mID == layerset_buffer->mUploadID) + { + // This is the upload we're currently waiting for. + layerset_buffer->mUploadID.setNull(); + layerset_buffer->mUploadPending = FALSE; + + if (result >= 0) { - llinfos << "Baked texture out of date, composite no longer valid, ignored" << llendl; + LLVOAvatarDefines::ETextureIndex baked_te = avatar->getBakedTE(layerset_buffer->mTexLayerSet); + // Update baked texture info with the new UUID + U64 now = LLFrameTimer::getTotalTime(); // Record starting time + llinfos << "Baked texture upload took " << (S32)((now - baked_upload_data->mStartTime) / 1000) << " ms" << llendl; + avatar->setNewBakedTexture(baked_te, uuid); } else - { - curr_layerset_buffer->mUploadPending = FALSE; - - if (curr_layerset_buffer->mUploadID.isNull()) - { - // The upload got canceled, we should be in the process of baking a new texture - // so request an upload with the new data - curr_layerset_buffer->requestUpload(); - } - else if( baked_upload_data->mID == curr_layerset_buffer->mUploadID ) - { - // This is the upload we're currently waiting for. - curr_layerset_buffer->mUploadID.setNull(); - - if( result >= 0 ) - { - ETextureIndex baked_te = avatar->getBakedTE( curr_layerset_buffer->mTexLayerSet ); - U64 now = LLFrameTimer::getTotalTime(); // Record starting time - llinfos << "Baked texture upload took " << (S32)((now - baked_upload_data->mStartTime) / 1000) << " ms" << llendl; - avatar->setNewBakedTexture( baked_te, uuid ); - } - else - { - llinfos << "Baked upload failed. Reason: " << result << llendl; - // *FIX: retry upload after n seconds, asset server could be busy - } - } - else - { - llinfos << "Received baked texture out of date, ignored." << llendl; - } - - avatar->dirtyMesh(); + { + // Avatar appearance is changing, ignore the upload results + llinfos << "Baked upload failed. Reason: " << result << llendl; + // *FIX: retry upload after n seconds, asset server could be busy } } + else + { + llinfos << "Received baked texture out of date, ignored." << llendl; + } + + avatar->dirtyMesh(); } else { - // Baked texture failed to upload, but since we didn't set the new baked texture, it means that they'll - // try and rebake it at some point in the future (after login?) + // Baked texture failed to upload (in which case since we + // didn't set the new baked texture, it means that they'll try + // and rebake it at some point in the future (after login?)), + // or this response to upload is out of date, in which case a + // current response should be on the way or already processed. llwarns << "Baked upload failed" << llendl; } @@ -635,8 +574,7 @@ void LLTexLayerSetBuffer::bindBumpTexture( U32 stage ) // An ordered set of texture layers that get composited into a single texture. //----------------------------------------------------------------------------- -LLTexLayerSetInfo::LLTexLayerSetInfo( ) - : +LLTexLayerSetInfo::LLTexLayerSetInfo() : mBodyRegion( "" ), mWidth( 512 ), mHeight( 512 ), @@ -701,6 +639,19 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node) return TRUE; } +// creates visual params without generating layersets or layers +void LLTexLayerSetInfo::createVisualParams(LLVOAvatar *avatar) +{ + //layer_info_list_t mLayerInfoList; + for (layer_info_list_t::iterator layer_iter = mLayerInfoList.begin(); + layer_iter != mLayerInfoList.end(); + layer_iter++) + { + LLTexLayerInfo *layer_info = *layer_iter; + layer_info->createVisualParams(avatar); + } +} + //----------------------------------------------------------------------------- // LLTexLayerSet // An ordered set of texture layers that get composited into a single texture. @@ -708,8 +659,7 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node) BOOL LLTexLayerSet::sHasCaches = FALSE; -LLTexLayerSet::LLTexLayerSet( LLVOAvatar* avatar ) - : +LLTexLayerSet::LLTexLayerSet(LLVOAvatarSelf* const avatar) : mComposite( NULL ), mAvatar( avatar ), mUpdatesEnabled( FALSE ), @@ -720,7 +670,9 @@ LLTexLayerSet::LLTexLayerSet( LLVOAvatar* avatar ) LLTexLayerSet::~LLTexLayerSet() { + deleteCaches(); std::for_each(mLayerList.begin(), mLayerList.end(), DeletePointer()); + std::for_each(mMaskLayerList.begin(), mMaskLayerList.end(), DeletePointer()); delete mComposite; } @@ -728,15 +680,16 @@ LLTexLayerSet::~LLTexLayerSet() // setInfo //----------------------------------------------------------------------------- -BOOL LLTexLayerSet::setInfo(LLTexLayerSetInfo *info) +BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info) { llassert(mInfo == NULL); mInfo = info; //mID = info->mID; // No ID - LLTexLayerSetInfo::layer_info_list_t::iterator iter; mLayerList.reserve(info->mLayerInfoList.size()); - for (iter = info->mLayerInfoList.begin(); iter != info->mLayerInfoList.end(); iter++) + for (LLTexLayerSetInfo::layer_info_list_t::const_iterator iter = info->mLayerInfoList.begin(); + iter != info->mLayerInfoList.end(); + iter++) { LLTexLayer* layer = new LLTexLayer( this ); if (!layer->setInfo(*iter)) @@ -744,8 +697,15 @@ BOOL LLTexLayerSet::setInfo(LLTexLayerSetInfo *info) mInfo = NULL; return FALSE; } + if (!layer->isVisibilityMask()) + { mLayerList.push_back( layer ); } + else + { + mMaskLayerList.push_back(layer); + } + } requestUpdate(); @@ -784,19 +744,26 @@ void LLTexLayerSet::deleteCaches() LLTexLayer* layer = *iter; layer->deleteCaches(); } + for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++) + { + LLTexLayer* layer = *iter; + layer->deleteCaches(); + } } // Returns TRUE if at least one packet of data has been received for each of the textures that this layerset depends on. -BOOL LLTexLayerSet::isLocalTextureDataAvailable() +BOOL LLTexLayerSet::isLocalTextureDataAvailable() const { - return mAvatar->isLocalTextureDataAvailable( this ); + if (!mAvatar->isSelf()) return FALSE; + return ((LLVOAvatarSelf *)mAvatar)->isLocalTextureDataAvailable(this); } // Returns TRUE if all of the data for the textures that this layerset depends on have arrived. -BOOL LLTexLayerSet::isLocalTextureDataFinal() +BOOL LLTexLayerSet::isLocalTextureDataFinal() const { - return mAvatar->isLocalTextureDataFinal( this ); + if (!mAvatar->isSelf()) return FALSE; + return ((LLVOAvatarSelf *)mAvatar)->isLocalTextureDataFinal(this); } @@ -808,62 +775,26 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height ) LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE); gGL.setColorMask(true, true); + BOOL render_morph = mAvatar->morphMaskNeedsUpdate(mBakedTexIndex); + // composite color layers for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) { LLTexLayer* layer = *iter; - if( layer->getRenderPass() == RP_COLOR ) + if (layer->getRenderPass() == LLTexLayer::RP_COLOR) { gGL.flush(); - success &= layer->render( x, y, width, height ); + success &= layer->render(x, y, width, height, render_morph); gGL.flush(); - } - } - - // (Optionally) replace alpha with a single component image from a tga file. - if( !getInfo()->mStaticAlphaFileName.empty() ) - { - LLGLSNoAlphaTest gls_no_alpha_test; - gGL.flush(); - gGL.setColorMask(false, true); - gGL.setSceneBlendType(LLRender::BT_REPLACE); - - { - LLImageGL* image_gl = gTexStaticImageList.getImageGL( getInfo()->mStaticAlphaFileName, TRUE ); - if( image_gl ) + if (layer->isMorphValid()) { - LLGLSUIDefault gls_ui; - gGL.getTexUnit(0)->bind(image_gl); - gGL.getTexUnit(0)->setTextureBlendType( LLTexUnit::TB_REPLACE ); - gl_rect_2d_simple_tex( width, height ); - } - else - { - success = FALSE; + mAvatar->setMorphMasksValid(TRUE, mBakedTexIndex); } } - gGL.flush(); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); - gGL.setColorMask(true, true); - gGL.setSceneBlendType(LLRender::BT_ALPHA); } - else - if( getInfo()->mClearAlpha ) - { - // Set the alpha channel to one (clean up after previous blending) - LLGLDisable no_alpha(GL_ALPHA_TEST); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4f( 0.f, 0.f, 0.f, 1.f ); - gGL.flush(); - gGL.setColorMask(false, true); + + renderAlphaMaskTextures(width, height, false); - gl_rect_2d_simple( width, height ); - - gGL.flush(); - gGL.setColorMask(true, true); - } stop_glerror(); return success; @@ -881,9 +812,9 @@ BOOL LLTexLayerSet::renderBump( S32 x, S32 y, S32 width, S32 height ) for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) { LLTexLayer* layer = *iter; - if( layer->getRenderPass() == RP_BUMP ) + if (layer->getRenderPass() == LLTexLayer::RP_BUMP) { - success &= layer->render( x, y, width, height ); +// success &= layer->render(x, y, width, height); } } @@ -901,6 +832,16 @@ BOOL LLTexLayerSet::renderBump( S32 x, S32 y, S32 width, S32 height ) return success; } +BOOL LLTexLayerSet::isBodyRegion(const std::string& region) const +{ + return mInfo->mBodyRegion == region; +} + +const std::string LLTexLayerSet::getBodyRegion() const +{ + return mInfo->mBodyRegion; +} + void LLTexLayerSet::requestUpdate() { if( mUpdatesEnabled ) @@ -933,8 +874,9 @@ void LLTexLayerSet::createComposite() // Composite other avatars at reduced resolution if( !mAvatar->isSelf() ) { - width /= 2; - height /= 2; + // TODO: replace with sanity check to ensure not called for non-self avatars +// width /= 2; +// height /= 2; } mComposite = new LLTexLayerSetBuffer( this, width, height, mHasBump ); } @@ -967,12 +909,14 @@ LLTexLayerSetBuffer* LLTexLayerSet::getComposite() return mComposite; } -void LLTexLayerSet::gatherAlphaMasks(U8 *data, S32 width, S32 height) +void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 width, S32 height) { S32 size = width * height; memset(data, 255, width * height); + BOOL render_morph = mAvatar->morphMaskNeedsUpdate(mBakedTexIndex); + for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) { LLTexLayer* layer = *iter; @@ -981,8 +925,10 @@ void LLTexLayerSet::gatherAlphaMasks(U8 *data, S32 width, S32 height) { LLColor4 net_color; layer->findNetColor( &net_color ); + // TODO: eliminate need for layer morph mask valid flag layer->invalidateMorphMasks(); - layer->renderAlphaMasks(mComposite->getOriginX(), mComposite->getOriginY(), width, height, &net_color); + mAvatar->invalidateMorphMasks(mBakedTexIndex); + layer->renderMorphMasks(mComposite->getOriginX(), mComposite->getOriginY(), width, height, net_color, render_morph); alphaData = layer->getAlphaData(); } if (alphaData) @@ -997,35 +943,111 @@ void LLTexLayerSet::gatherAlphaMasks(U8 *data, S32 width, S32 height) } } } + + // Set alpha back to that of our alpha masks. + renderAlphaMaskTextures(width, height, true); +} + +void LLTexLayerSet::renderAlphaMaskTextures(S32 width, S32 height, bool forceClear) +{ + const LLTexLayerSetInfo *info = getInfo(); + + gGL.setColorMask(false, true); + gGL.setSceneBlendType(LLRender::BT_REPLACE); + // (Optionally) replace alpha with a single component image from a tga file. + if (!info->mStaticAlphaFileName.empty() && mMaskLayerList.empty()) + { + LLGLSNoAlphaTest gls_no_alpha_test; + gGL.flush(); + { + LLImageGL* image_gl = LLTexLayerStaticImageList::getInstance()->getImageGL(info->mStaticAlphaFileName, TRUE); + if( image_gl ) + { + LLGLSUIDefault gls_ui; + gGL.getTexUnit(0)->bind(image_gl); + gGL.getTexUnit(0)->setTextureBlendType( LLTexUnit::TB_REPLACE ); + gl_rect_2d_simple_tex( width, height ); + } + } + gGL.flush(); + } + else if (forceClear || info->mClearAlpha || (mMaskLayerList.size() > 0)) + { + // Set the alpha channel to one (clean up after previous blending) + gGL.flush(); + LLGLDisable no_alpha(GL_ALPHA_TEST); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.color4f( 0.f, 0.f, 0.f, 1.f ); + + gl_rect_2d_simple( width, height ); + + gGL.flush(); + } + + // (Optional) Mask out part of the baked texture with alpha masks + // will still have an effect even if mClearAlpha is set or the alpha component was replaced + if (mMaskLayerList.size() > 0) + { + gGL.setSceneBlendType(LLRender::BT_MULT_ALPHA); + gGL.getTexUnit(0)->setTextureBlendType( LLTexUnit::TB_REPLACE ); + for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++) + { + LLTexLayer* layer = *iter; + gGL.flush(); + layer->blendAlphaTexture(width, height); + gGL.flush(); + } + + } + + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + + gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + gGL.setColorMask(true, true); + gGL.setSceneBlendType(LLRender::BT_ALPHA); } void LLTexLayerSet::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components) +{ + mAvatar->applyMorphMask(tex_data, width, height, num_components, mBakedTexIndex); +} + +//----------------------------------------------------------------------------- +// finds a specific layer based on a passed in name +//----------------------------------------------------------------------------- +LLTexLayer* LLTexLayerSet::findLayerByName(std::string name) { for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) { LLTexLayer* layer = *iter; - layer->applyMorphMask(tex_data, width, height, num_components); + + if (layer->getName().compare(name) == 0) + { + return layer; + } } + return NULL; } + //----------------------------------------------------------------------------- // LLTexLayerInfo //----------------------------------------------------------------------------- -LLTexLayerInfo::LLTexLayerInfo( ) - : +LLTexLayerInfo::LLTexLayerInfo() : mWriteAllChannels( FALSE ), - mRenderPass( RP_COLOR ), + mRenderPass(LLTexLayer::RP_COLOR), mFixedColor( 0.f, 0.f, 0.f, 0.f ), mLocalTexture( -1 ), mStaticImageIsMask( FALSE ), - mUseLocalTextureAlphaOnly( FALSE ) + mUseLocalTextureAlphaOnly(FALSE), + mIsVisibilityMask(FALSE) { } LLTexLayerInfo::~LLTexLayerInfo( ) { - std::for_each(mColorInfoList.begin(), mColorInfoList.end(), DeletePointer()); - std::for_each(mAlphaInfoList.begin(), mAlphaInfoList.end(), DeletePointer()); + std::for_each(mParamColorInfoList.begin(), mParamColorInfoList.end(), DeletePointer()); + std::for_each(mParamAlphaInfoList.begin(), mParamAlphaInfoList.end(), DeletePointer()); } BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) @@ -1048,7 +1070,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) { if( render_pass_name == "bump" ) { - mRenderPass = RP_BUMP; + mRenderPass = LLTexLayer::RP_BUMP; } } @@ -1057,6 +1079,14 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) static LLStdStringHandle global_color_string = LLXmlTree::addAttributeString("global_color"); node->getFastAttributeString( global_color_string, mGlobalColor ); + // Visibility mask (optional) + BOOL is_visibility; + static LLStdStringHandle visibility_mask_string = LLXmlTree::addAttributeString("visibility_mask"); + if (node->getFastAttributeBOOL(visibility_mask_string, is_visibility)) + { + mIsVisibilityMask = is_visibility; + } + // color attribute (optional) LLColor4U color4u; static LLStdStringHandle fixed_color_string = LLXmlTree::addAttributeString("fixed_color"); @@ -1070,7 +1100,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) texture_node; texture_node = node->getNextNamedChild()) { - std::string local_texture; + std::string local_texture_name; static LLStdStringHandle tga_file_string = LLXmlTree::addAttributeString("tga_file"); static LLStdStringHandle local_texture_string = LLXmlTree::addAttributeString("local_texture"); static LLStdStringHandle file_is_mask_string = LLXmlTree::addAttributeString("file_is_mask"); @@ -1079,73 +1109,27 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) { texture_node->getFastAttributeBOOL( file_is_mask_string, mStaticImageIsMask ); } - else if( texture_node->getFastAttributeString( local_texture_string, local_texture ) ) + else if (texture_node->getFastAttributeString(local_texture_string, local_texture_name)) { texture_node->getFastAttributeBOOL( local_texture_alpha_only_string, mUseLocalTextureAlphaOnly ); - if( "upper_shirt" == local_texture ) - { - mLocalTexture = TEX_UPPER_SHIRT; - } - else if( "upper_bodypaint" == local_texture ) - { - mLocalTexture = TEX_UPPER_BODYPAINT; - } - else if( "lower_pants" == local_texture ) - { - mLocalTexture = TEX_LOWER_PANTS; - } - else if( "lower_bodypaint" == local_texture ) - { - mLocalTexture = TEX_LOWER_BODYPAINT; - } - else if( "lower_shoes" == local_texture ) - { - mLocalTexture = TEX_LOWER_SHOES; - } - else if( "head_bodypaint" == local_texture ) - { - mLocalTexture = TEX_HEAD_BODYPAINT; - } - else if( "lower_socks" == local_texture ) - { - mLocalTexture = TEX_LOWER_SOCKS; - } - else if( "upper_jacket" == local_texture ) - { - mLocalTexture = TEX_UPPER_JACKET; - } - else if( "lower_jacket" == local_texture ) - { - mLocalTexture = TEX_LOWER_JACKET; - } - else if( "upper_gloves" == local_texture ) - { - mLocalTexture = TEX_UPPER_GLOVES; - } - else if( "upper_undershirt" == local_texture ) - { - mLocalTexture = TEX_UPPER_UNDERSHIRT; - } - else if( "lower_underpants" == local_texture ) + /* if ("upper_shirt" == local_texture_name) + mLocalTexture = TEX_UPPER_SHIRT; */ + mLocalTexture = TEX_NUM_INDICES; + for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); + iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); + iter++) { - mLocalTexture = TEX_LOWER_UNDERPANTS; - } - else if( "eyes_iris" == local_texture ) + const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second; + if (local_texture_name == texture_dict->mName) { - mLocalTexture = TEX_EYES_IRIS; + mLocalTexture = iter->first; + break; } - else if( "skirt" == local_texture ) - { - mLocalTexture = TEX_SKIRT; - } - else if( "hair_grain" == local_texture ) - { - mLocalTexture = TEX_HAIR; } - else + if (mLocalTexture == TEX_NUM_INDICES) { - llwarns << "<texture> element has invalid local_texure attribute: " << mName << " " << local_texture << llendl; + llwarns << "<texture> element has invalid local_texure attribute: " << mName << " " << local_texture_name << llendl; return FALSE; } } @@ -1179,13 +1163,13 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) if( child->getChildByName( "param_color" ) ) { // <param><param_color/></param> - LLTexParamColorInfo* info = new LLTexParamColorInfo( ); + LLTexLayerParamColorInfo* info = new LLTexLayerParamColorInfo(); if (!info->parseXml(child)) { delete info; return FALSE; } - mColorInfoList.push_back( info ); + mParamColorInfoList.push_back(info); } else if( child->getChildByName( "param_alpha" ) ) { @@ -1196,13 +1180,47 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) delete info; return FALSE; } - mAlphaInfoList.push_back( info ); + mParamAlphaInfoList.push_back(info); } } return TRUE; } +BOOL LLTexLayerInfo::createVisualParams(LLVOAvatar *avatar) +{ + BOOL success = TRUE; + for (param_color_info_list_t::iterator color_info_iter = mParamColorInfoList.begin(); + color_info_iter != mParamColorInfoList.end(); + color_info_iter++) + { + LLTexLayerParamColorInfo * color_info = *color_info_iter; + LLTexLayerParamColor* param_color = new LLTexLayerParamColor(avatar); + if (!param_color->setInfo(color_info)) + { + llwarns << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << llendl; + delete param_color; + success = FALSE; + } + } + + for (param_alpha_info_list_t::iterator alpha_info_iter = mParamAlphaInfoList.begin(); + alpha_info_iter != mParamAlphaInfoList.end(); + alpha_info_iter++) + { + LLTexLayerParamAlphaInfo * alpha_info = *alpha_info_iter; + LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(avatar); + if (!param_alpha->setInfo(alpha_info)) + { + llwarns << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << llendl; + delete param_alpha; + success = FALSE; + } + } + + return success; +} + //----------------------------------------------------------------------------- // LLTexLayer // A single texture layer, consisting of: @@ -1216,12 +1234,12 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) // * a texture entry index (TE) // * (optional) one or more alpha parameters (weighted alpha textures) //----------------------------------------------------------------------------- -LLTexLayer::LLTexLayer( LLTexLayerSet* layer_set ) - : +LLTexLayer::LLTexLayer(LLTexLayerSet* layer_set) : mTexLayerSet( layer_set ), mMorphMasksValid( FALSE ), mStaticImageInvalid( FALSE ), - mInfo( NULL ) + mInfo(NULL), + mHasMorph(FALSE) { } @@ -1238,45 +1256,28 @@ LLTexLayer::~LLTexLayer() U8* alpha_data = iter->second; delete [] alpha_data; } + } //----------------------------------------------------------------------------- // setInfo //----------------------------------------------------------------------------- -BOOL LLTexLayer::setInfo(LLTexLayerInfo* info) +BOOL LLTexLayer::setInfo(const LLTexLayerInfo* info) { llassert(mInfo == NULL); mInfo = info; //mID = info->mID; // No ID - if (info->mRenderPass == RP_BUMP) + if (info->mRenderPass == LLTexLayer::RP_BUMP) mTexLayerSet->setBump(TRUE); + mParamColorList.reserve(mInfo->mParamColorInfoList.size()); + for (param_color_info_list_t::const_iterator iter = mInfo->mParamColorInfoList.begin(); + iter != mInfo->mParamColorInfoList.end(); + iter++) { - LLTexLayerInfo::morph_name_list_t::iterator iter; - for (iter = mInfo->mMorphNameList.begin(); iter != mInfo->mMorphNameList.end(); iter++) - { - // *FIX: we assume that the referenced visual param is a - // morph target, need a better way of actually looking - // this up. - LLPolyMorphTarget *morph_param; - std::string *name = &(iter->first); - morph_param = (LLPolyMorphTarget *)(getTexLayerSet()->getAvatar()->getVisualParam(name->c_str())); - if (morph_param) - { - BOOL invert = iter->second; - addMaskedMorph(morph_param, invert); - } - } - } - - { - LLTexLayerInfo::color_info_list_t::iterator iter; - mParamColorList.reserve(mInfo->mColorInfoList.size()); - for (iter = mInfo->mColorInfoList.begin(); iter != mInfo->mColorInfoList.end(); iter++) - { - LLTexParamColor* param_color = new LLTexParamColor( this ); + LLTexLayerParamColor* param_color = new LLTexLayerParamColor(this); if (!param_color->setInfo(*iter)) { mInfo = NULL; @@ -1284,11 +1285,11 @@ BOOL LLTexLayer::setInfo(LLTexLayerInfo* info) } mParamColorList.push_back( param_color ); } - } - { - LLTexLayerInfo::alpha_info_list_t::iterator iter; - mParamAlphaList.reserve(mInfo->mAlphaInfoList.size()); - for (iter = mInfo->mAlphaInfoList.begin(); iter != mInfo->mAlphaInfoList.end(); iter++) + + mParamAlphaList.reserve(mInfo->mParamAlphaInfoList.size()); + for (param_alpha_info_list_t::const_iterator iter = mInfo->mParamAlphaInfoList.begin(); + iter != mInfo->mParamAlphaInfoList.end(); + iter++) { LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha( this ); if (!param_alpha->setInfo(*iter)) @@ -1298,84 +1299,83 @@ BOOL LLTexLayer::setInfo(LLTexLayerInfo* info) } mParamAlphaList.push_back( param_alpha ); } - } return TRUE; } -#if 0 // obsolete -//----------------------------------------------------------------------------- -// parseData -//----------------------------------------------------------------------------- -BOOL LLTexLayer::parseData( LLXmlTreeNode* node ) +//static +void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LLColor4 &net_color) { - LLTexLayerInfo *info = new LLTexLayerInfo; - - if (!info->parseXml(node)) + for (param_color_list_t::const_iterator iter = param_list.begin(); + iter != param_list.end(); iter++) +{ + const LLTexLayerParamColor* param = *iter; + LLColor4 param_net = param->getNetColor(); + const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)param->getInfo(); + switch(info->getOperation()) { - delete info; - return FALSE; + case LLTexLayerParamColor::OP_ADD: + net_color += param_net; + break; + case LLTexLayerParamColor::OP_MULTIPLY: + net_color = net_color * param_net; + break; + case LLTexLayerParamColor::OP_BLEND: + net_color = lerp(net_color, param_net, param->getWeight()); + break; + default: + llassert(0); + break; } - if (!setInfo(info)) - { - delete info; - return FALSE; } - return TRUE; + net_color.clamp(); } -#endif - -//----------------------------------------------------------------------------- - void LLTexLayer::deleteCaches() { - for( alpha_list_t::iterator iter = mParamAlphaList.begin(); + for (param_alpha_list_t::iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++ ) { LLTexLayerParamAlpha* param = *iter; param->deleteCaches(); } - mStaticImageRaw = NULL; } -BOOL LLTexLayer::render( S32 x, S32 y, S32 width, S32 height ) +BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, BOOL render_morph) { LLGLEnable color_mat(GL_COLOR_MATERIAL); gPipeline.disableLights(); - BOOL success = TRUE; - - BOOL color_specified = FALSE; - BOOL alpha_mask_specified = FALSE; - LLColor4 net_color; - color_specified = findNetColor( &net_color ); - + BOOL color_specified = findNetColor(&net_color); + if (mTexLayerSet->getAvatar()->mIsDummy) { color_specified = true; net_color = LLVOAvatar::getDummyColor(); } + BOOL success = TRUE; + // If you can't see the layer, don't render it. if( is_approx_zero( net_color.mV[VW] ) ) { return success; } - alpha_list_t::iterator iter = mParamAlphaList.begin(); + BOOL alpha_mask_specified = FALSE; + param_alpha_list_t::const_iterator iter = mParamAlphaList.begin(); if( iter != mParamAlphaList.end() ) { // If we have alpha masks, but we're skipping all of them, skip the whole layer. // However, we can't do this optimization if we have morph masks that need updating. - if( mMaskedMorphs.empty() ) + if (!mHasMorph) { BOOL skip_layer = TRUE; while( iter != mParamAlphaList.end() ) { - LLTexLayerParamAlpha* param = *iter; + const LLTexLayerParamAlpha* param = *iter; if( !param->getSkip() ) { @@ -1392,7 +1392,7 @@ BOOL LLTexLayer::render( S32 x, S32 y, S32 width, S32 height ) } } - renderAlphaMasks( x, y, width, height, &net_color ); + renderMorphMasks(x, y, width, height, net_color, render_morph); alpha_mask_specified = TRUE; gGL.flush(); gGL.blendFunc(LLRender::BF_DEST_ALPHA, LLRender::BF_ONE_MINUS_DEST_ALPHA); @@ -1437,7 +1437,7 @@ BOOL LLTexLayer::render( S32 x, S32 y, S32 width, S32 height ) if( !getInfo()->mStaticImageFileName.empty() ) { { - LLImageGL* image_gl = gTexStaticImageList.getImageGL( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask ); + LLImageGL* image_gl = LLTexLayerStaticImageList::getInstance()->getImageGL(getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask); if( image_gl ) { gGL.getTexUnit(0)->bind(image_gl); @@ -1451,14 +1451,14 @@ BOOL LLTexLayer::render( S32 x, S32 y, S32 width, S32 height ) } } - if( ((-1 == getInfo()->mLocalTexture) || + if(((-1 == getInfo()->mLocalTexture) || getInfo()->mUseLocalTextureAlphaOnly) && getInfo()->mStaticImageFileName.empty() && color_specified ) { LLGLDisable no_alpha(GL_ALPHA_TEST); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4fv( net_color.mV); + gGL.color4fv( net_color.mV ); gl_rect_2d_simple( width, height ); } @@ -1483,9 +1483,9 @@ U8* LLTexLayer::getAlphaData() const LLUUID& uuid = mTexLayerSet->getAvatar()->getLocalTextureID((ETextureIndex)getInfo()->mLocalTexture); alpha_mask_crc.update((U8*)(&uuid.mData), UUID_BYTES); - for( alpha_list_t::iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++ ) + for (param_alpha_list_t::const_iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++) { - LLTexLayerParamAlpha* param = *iter; + const LLTexLayerParamAlpha* param = *iter; F32 param_weight = param->getWeight(); alpha_mask_crc.update((U8*)¶m_weight, sizeof(F32)); } @@ -1496,7 +1496,7 @@ U8* LLTexLayer::getAlphaData() return (iter2 == mAlphaCache.end()) ? 0 : iter2->second; } -BOOL LLTexLayer::findNetColor( LLColor4* net_color ) +BOOL LLTexLayer::findNetColor(LLColor4* net_color) const { // Color is either: // * one or more color parameters (weighted colors) (which may make use of a global color or fixed color) @@ -1510,8 +1510,7 @@ BOOL LLTexLayer::findNetColor( LLColor4* net_color ) { net_color->setVec( mTexLayerSet->getAvatar()->getGlobalColor( getInfo()->mGlobalColor ) ); } - else - if( getInfo()->mFixedColor.mV[VW] ) + else if (getInfo()->mFixedColor.mV[VW]) { net_color->setVec( getInfo()->mFixedColor ); } @@ -1520,30 +1519,7 @@ BOOL LLTexLayer::findNetColor( LLColor4* net_color ) net_color->setVec( 0.f, 0.f, 0.f, 0.f ); } - for( color_list_t::iterator iter = mParamColorList.begin(); - iter != mParamColorList.end(); iter++ ) - { - LLTexParamColor* param = *iter; - LLColor4 param_net = param->getNetColor(); - switch( param->getOperation() ) - { - case OP_ADD: - *net_color += param_net; - break; - case OP_MULTIPLY: - net_color->mV[VX] *= param_net.mV[VX]; - net_color->mV[VY] *= param_net.mV[VY]; - net_color->mV[VZ] *= param_net.mV[VZ]; - net_color->mV[VW] *= param_net.mV[VW]; - break; - case OP_BLEND: - net_color->setVec( lerp(*net_color, param_net, param->getWeight()) ); - break; - default: - llassert(0); - break; - } - } + calculateTexLayerColor(mParamColorList, *net_color); return TRUE; } @@ -1564,8 +1540,51 @@ BOOL LLTexLayer::findNetColor( LLColor4* net_color ) return FALSE; // No need to draw a separate colored polygon } +BOOL LLTexLayer::blendAlphaTexture(S32 width, S32 height) +{ + BOOL success = TRUE; + + gGL.flush(); + + if( !getInfo()->mStaticImageFileName.empty() ) + { + LLImageGL* image_gl = LLTexLayerStaticImageList::getInstance()->getImageGL( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask ); + if( image_gl ) + { + LLGLSNoAlphaTest gls_no_alpha_test; + gGL.getTexUnit(0)->bind(image_gl); + gl_rect_2d_simple_tex( width, height ); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + } + else + { + success = FALSE; + } + } + else + { + if (getInfo()->mLocalTexture >=0 && getInfo()->mLocalTexture < TEX_NUM_INDICES) + { + LLImageGL* image_gl = NULL; + if (mTexLayerSet->getAvatar()->getLocalTextureGL((ETextureIndex)getInfo()->mLocalTexture, &image_gl)) + { + if (image_gl) + { + LLGLSNoAlphaTest gls_no_alpha_test; + gGL.getTexUnit(0)->bind(image_gl); + gl_rect_2d_simple_tex( width, height ); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + success = TRUE; + } + } + } + } + + return success; +} + -BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4* colorp ) +BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLColor4 &layer_color, BOOL render_morph) { BOOL success = TRUE; @@ -1573,9 +1592,7 @@ BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4 gGL.setColorMask(false, true); - alpha_list_t::iterator iter = mParamAlphaList.begin(); - LLTexLayerParamAlpha* first_param = *iter; - + LLTexLayerParamAlpha* first_param = *mParamAlphaList.begin(); // Note: if the first param is a mulitply, multiply against the current buffer's alpha if( !first_param || !first_param->getMultiplyBlend() ) { @@ -1593,8 +1610,7 @@ BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4 // Accumulate alphas LLGLSNoAlphaTest gls_no_alpha_test; gGL.color4f( 1.f, 1.f, 1.f, 1.f ); - - for( iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++ ) + for (param_alpha_list_t::iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++) { LLTexLayerParamAlpha* param = *iter; success &= param->render( x, y, width, height ); @@ -1602,12 +1618,11 @@ BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4 // Approximates a min() function gGL.flush(); - gGL.blendFunc(LLRender::BF_DEST_ALPHA, LLRender::BF_ZERO); + gGL.setSceneBlendType(LLRender::BT_MULT_ALPHA); // Accumulate the alpha component of the texture if( getInfo()->mLocalTexture != -1 ) { - { LLImageGL* image_gl = NULL; if( mTexLayerSet->getAvatar()->getLocalTextureGL((ETextureIndex)getInfo()->mLocalTexture, &image_gl ) ) { @@ -1631,12 +1646,10 @@ BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4 success = FALSE; } } - } if( !getInfo()->mStaticImageFileName.empty() ) { - { - LLImageGL* image_gl = gTexStaticImageList.getImageGL( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask ); + LLImageGL* image_gl = LLTexLayerStaticImageList::getInstance()->getImageGL(getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask); if( image_gl ) { if( (image_gl->getComponents() == 4) || @@ -1653,15 +1666,14 @@ BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4 success = FALSE; } } - } // Draw a rectangle with the layer color to multiply the alpha by that color's alpha. // Note: we're still using gGL.blendFunc( GL_DST_ALPHA, GL_ZERO ); - if( colorp->mV[VW] != 1.f ) + if (layer_color.mV[VW] != 1.f) { LLGLDisable no_alpha(GL_ALPHA_TEST); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4fv( colorp->mV ); + gGL.color4fv(layer_color.mV); gl_rect_2d_simple( width, height ); } @@ -1670,34 +1682,28 @@ BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4 gGL.setColorMask(true, true); - if (!mMorphMasksValid && !mMaskedMorphs.empty()) + if (render_morph && mHasMorph) { LLCRC alpha_mask_crc; const LLUUID& uuid = mTexLayerSet->getAvatar()->getLocalTextureID((ETextureIndex)getInfo()->mLocalTexture); alpha_mask_crc.update((U8*)(&uuid.mData), UUID_BYTES); - for( alpha_list_t::iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++ ) + for (param_alpha_list_t::const_iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++) { - LLTexLayerParamAlpha* param = *iter; + const LLTexLayerParamAlpha* param = *iter; F32 param_weight = param->getWeight(); alpha_mask_crc.update((U8*)¶m_weight, sizeof(F32)); } U32 cache_index = alpha_mask_crc.getCRC(); - - alpha_cache_t::iterator iter2 = mAlphaCache.find(cache_index); - U8* alpha_data; - if (iter2 != mAlphaCache.end()) - { - alpha_data = iter2->second; - } - else + U8* alpha_data = get_if_there(mAlphaCache,cache_index,(U8*)NULL); + if (!alpha_data) { // clear out a slot if we have filled our cache S32 max_cache_entries = getTexLayerSet()->getAvatar()->isSelf() ? 4 : 1; while ((S32)mAlphaCache.size() >= max_cache_entries) { - iter2 = mAlphaCache.begin(); // arbitrarily grab the first entry + alpha_cache_t::iterator iter2 = mAlphaCache.begin(); // arbitrarily grab the first entry alpha_data = iter2->second; delete [] alpha_data; mAlphaCache.erase(iter2); @@ -1710,28 +1716,12 @@ BOOL LLTexLayer::renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4 getTexLayerSet()->getAvatar()->dirtyMesh(); mMorphMasksValid = TRUE; - - for( morph_list_t::iterator iter3 = mMaskedMorphs.begin(); - iter3 != mMaskedMorphs.end(); iter3++ ) - { - LLMaskedMorph* maskedMorph = &(*iter3); - maskedMorph->mMorphTarget->applyMask(alpha_data, width, height, 1, maskedMorph->mInvert); - } + getTexLayerSet()->applyMorphMask(alpha_data, width, height, 1); } return success; } -void LLTexLayer::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components) -{ - for( morph_list_t::iterator iter = mMaskedMorphs.begin(); - iter != mMaskedMorphs.end(); iter++ ) - { - LLMaskedMorph* maskedMorph = &(*iter); - maskedMorph->mMorphTarget->applyMask(tex_data, width, height, num_components, maskedMorph->mInvert); - } -} - // Returns TRUE on success. BOOL LLTexLayer::renderImageRaw( U8* in_data, S32 in_width, S32 in_height, S32 in_components, S32 width, S32 height, BOOL is_mask ) { @@ -1808,666 +1798,54 @@ void LLTexLayer::requestUpdate() mTexLayerSet->requestUpdate(); } -void LLTexLayer::addMaskedMorph(LLPolyMorphTarget* morph_target, BOOL invert) +const std::string& LLTexLayer::getName() const { - mMaskedMorphs.push_front(LLMaskedMorph(morph_target, invert)); + return mInfo->mName; } -void LLTexLayer::invalidateMorphMasks() +LLTexLayer::ERenderPass LLTexLayer::getRenderPass() const { - mMorphMasksValid = FALSE; + return mInfo->mRenderPass; } - -//----------------------------------------------------------------------------- -// LLTexLayerParamAlphaInfo -//----------------------------------------------------------------------------- -LLTexLayerParamAlphaInfo::LLTexLayerParamAlphaInfo( ) - : - mMultiplyBlend( FALSE ), - mSkipIfZeroWeight( FALSE ), - mDomain( 0.f ) +const std::string& LLTexLayer::getGlobalColor() const { + return mInfo->mGlobalColor; } -BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node) -{ - llassert( node->hasName( "param" ) && node->getChildByName( "param_alpha" ) ); - - if( !LLViewerVisualParamInfo::parseXml(node) ) - return FALSE; - - LLXmlTreeNode* param_alpha_node = node->getChildByName( "param_alpha" ); - if( !param_alpha_node ) - { - return FALSE; - } - - static LLStdStringHandle tga_file_string = LLXmlTree::addAttributeString("tga_file"); - if( param_alpha_node->getFastAttributeString( tga_file_string, mStaticImageFileName ) ) - { - // Don't load the image file until it's actually needed. - } -// else -// { -// llwarns << "<param_alpha> element is missing tga_file attribute." << llendl; -// } - - static LLStdStringHandle multiply_blend_string = LLXmlTree::addAttributeString("multiply_blend"); - param_alpha_node->getFastAttributeBOOL( multiply_blend_string, mMultiplyBlend ); - - static LLStdStringHandle skip_if_zero_string = LLXmlTree::addAttributeString("skip_if_zero"); - param_alpha_node->getFastAttributeBOOL( skip_if_zero_string, mSkipIfZeroWeight ); - - static LLStdStringHandle domain_string = LLXmlTree::addAttributeString("domain"); - param_alpha_node->getFastAttributeF32( domain_string, mDomain ); - - return TRUE; -} - -//----------------------------------------------------------------------------- -// LLTexLayerParamAlpha -//----------------------------------------------------------------------------- - -// static -LLTexLayerParamAlpha::param_alpha_ptr_list_t LLTexLayerParamAlpha::sInstances; - -// static -void LLTexLayerParamAlpha::dumpCacheByteCount() -{ - S32 gl_bytes = 0; - getCacheByteCount( &gl_bytes ); - llinfos << "Processed Alpha Texture Cache GL:" << (gl_bytes/1024) << "KB" << llendl; -} - -// static -void LLTexLayerParamAlpha::getCacheByteCount( S32* gl_bytes ) -{ - *gl_bytes = 0; - - for( param_alpha_ptr_list_t::iterator iter = sInstances.begin(); - iter != sInstances.end(); iter++ ) - { - LLTexLayerParamAlpha* instance = *iter; - LLImageGL* image_gl = instance->mCachedProcessedImageGL; - if( image_gl ) - { - S32 bytes = (S32)image_gl->getWidth() * image_gl->getHeight() * image_gl->getComponents(); - - if( image_gl->getHasGLTexture() ) - { - *gl_bytes += bytes; - } - } - } -} - -LLTexLayerParamAlpha::LLTexLayerParamAlpha( LLTexLayer* layer ) - : - mCachedProcessedImageGL( NULL ), - mTexLayer( layer ), - mNeedsCreateTexture( FALSE ), - mStaticImageInvalid( FALSE ), - mAvgDistortionVec(1.f, 1.f, 1.f), - mCachedEffectiveWeight(0.f) -{ - sInstances.push_front( this ); -} - -LLTexLayerParamAlpha::~LLTexLayerParamAlpha() -{ - deleteCaches(); - sInstances.remove( this ); -} - -//----------------------------------------------------------------------------- -// setInfo() -//----------------------------------------------------------------------------- -BOOL LLTexLayerParamAlpha::setInfo(LLTexLayerParamAlphaInfo *info) -{ - llassert(mInfo == NULL); - if (info->mID < 0) - return FALSE; - mInfo = info; - mID = info->mID; - - mTexLayer->getTexLayerSet()->getAvatar()->addVisualParam( this ); - setWeight(getDefaultWeight(), FALSE ); - - return TRUE; -} - -//----------------------------------------------------------------------------- - -void LLTexLayerParamAlpha::deleteCaches() -{ - mStaticImageTGA = NULL; // deletes image - mCachedProcessedImageGL = NULL; - mStaticImageRaw = NULL; - mNeedsCreateTexture = FALSE; -} - -void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL set_by_user) -{ - if (mIsAnimating) - { - return; - } - F32 min_weight = getMinWeight(); - F32 max_weight = getMaxWeight(); - F32 new_weight = llclamp(weight, min_weight, max_weight); - U8 cur_u8 = F32_to_U8( mCurWeight, min_weight, max_weight ); - U8 new_u8 = F32_to_U8( new_weight, min_weight, max_weight ); - if( cur_u8 != new_u8) - { - mCurWeight = new_weight; - - LLVOAvatar* avatar = mTexLayer->getTexLayerSet()->getAvatar(); - if( avatar->getSex() & getSex() ) - { - if ( gAgent.cameraCustomizeAvatar() ) - { - set_by_user = FALSE; - } - avatar->invalidateComposite( mTexLayer->getTexLayerSet(), set_by_user ); - mTexLayer->invalidateMorphMasks(); - avatar->updateMeshTextures(); - } - } -} - -void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL set_by_user) -{ - mTargetWeight = target_value; - setWeight(target_value, set_by_user); - mIsAnimating = TRUE; - if (mNext) - { - mNext->setAnimationTarget(target_value, set_by_user); - } -} - -void LLTexLayerParamAlpha::animate(F32 delta, BOOL set_by_user) -{ - if (mNext) - { - mNext->animate(delta, set_by_user); - } -} - -BOOL LLTexLayerParamAlpha::getSkip() -{ - LLVOAvatar *avatar = mTexLayer->getTexLayerSet()->getAvatar(); - - if( getInfo()->mSkipIfZeroWeight ) - { - F32 effective_weight = ( avatar->getSex() & getSex() ) ? mCurWeight : getDefaultWeight(); - if (is_approx_zero( effective_weight )) - { - return TRUE; - } - } - - EWearableType type = (EWearableType)getWearableType(); - if( (type != WT_INVALID) && !avatar->isWearingWearableType( type ) ) - { - return TRUE; - } - - return FALSE; -} - - -BOOL LLTexLayerParamAlpha::render( S32 x, S32 y, S32 width, S32 height ) -{ - BOOL success = TRUE; - - F32 effective_weight = ( mTexLayer->getTexLayerSet()->getAvatar()->getSex() & getSex() ) ? mCurWeight : getDefaultWeight(); - BOOL weight_changed = effective_weight != mCachedEffectiveWeight; - if( getSkip() ) - { - return success; - } - - gGL.flush(); - if( getInfo()->mMultiplyBlend ) - { - gGL.blendFunc(LLRender::BF_DEST_ALPHA, LLRender::BF_ZERO); // Multiplication: approximates a min() function - } - else - { - gGL.setSceneBlendType(LLRender::BT_ADD); // Addition: approximates a max() function - } - - if( !getInfo()->mStaticImageFileName.empty() && !mStaticImageInvalid) - { - if( mStaticImageTGA.isNull() ) - { - // Don't load the image file until we actually need it the first time. Like now. - mStaticImageTGA = gTexStaticImageList.getImageTGA( getInfo()->mStaticImageFileName ); - // We now have something in one of our caches - LLTexLayerSet::sHasCaches |= mStaticImageTGA.notNull() ? TRUE : FALSE; - - if( mStaticImageTGA.isNull() ) - { - llwarns << "Unable to load static file: " << getInfo()->mStaticImageFileName << llendl; - mStaticImageInvalid = TRUE; // don't try again. - return FALSE; - } - } - - const S32 image_tga_width = mStaticImageTGA->getWidth(); - const S32 image_tga_height = mStaticImageTGA->getHeight(); - if( !mCachedProcessedImageGL || - (mCachedProcessedImageGL->getWidth() != image_tga_width) || - (mCachedProcessedImageGL->getHeight() != image_tga_height) || - (weight_changed) ) - { -// llinfos << "Building Cached Alpha: " << mName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << effective_weight << llendl; - mCachedEffectiveWeight = effective_weight; - - if( !mCachedProcessedImageGL ) - { - mCachedProcessedImageGL = new LLImageGL( image_tga_width, image_tga_height, 1, FALSE); - - // We now have something in one of our caches - LLTexLayerSet::sHasCaches |= mCachedProcessedImageGL ? TRUE : FALSE; - - mCachedProcessedImageGL->setExplicitFormat( GL_ALPHA8, GL_ALPHA ); - } - - // Applies domain and effective weight to data as it is decoded. Also resizes the raw image if needed. - mStaticImageRaw = NULL; - mStaticImageRaw = new LLImageRaw; - mStaticImageTGA->decodeAndProcess( mStaticImageRaw, getInfo()->mDomain, effective_weight ); - mNeedsCreateTexture = TRUE; - } - - if( mCachedProcessedImageGL ) - { - { - // Create the GL texture, and then hang onto it for future use. - if( mNeedsCreateTexture ) - { - mCachedProcessedImageGL->createGLTexture(0, mStaticImageRaw); - mNeedsCreateTexture = FALSE; - gGL.getTexUnit(0)->bind(mCachedProcessedImageGL); - mCachedProcessedImageGL->setAddressMode(LLTexUnit::TAM_CLAMP); - } - - LLGLSNoAlphaTest gls_no_alpha_test; - gGL.getTexUnit(0)->bind(mCachedProcessedImageGL); - gl_rect_2d_simple_tex( width, height ); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - stop_glerror(); - } - } - - // Don't keep the cache for other people's avatars - // (It's not really a "cache" in that case, but the logic is the same) - if( !mTexLayer->getTexLayerSet()->getAvatar()->isSelf() ) - { - mCachedProcessedImageGL = NULL; - } - } - else - { - LLGLDisable no_alpha(GL_ALPHA_TEST); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4f( 0.f, 0.f, 0.f, effective_weight ); - gl_rect_2d_simple( width, height ); - } - - return success; -} - -//----------------------------------------------------------------------------- -// LLTexGlobalColorInfo -//----------------------------------------------------------------------------- - -LLTexGlobalColorInfo::LLTexGlobalColorInfo() -{ -} - - -LLTexGlobalColorInfo::~LLTexGlobalColorInfo() -{ - for_each(mColorInfoList.begin(), mColorInfoList.end(), DeletePointer()); -} - -BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node) -{ - // name attribute - static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); - if( !node->getFastAttributeString( name_string, mName ) ) - { - llwarns << "<global_color> element is missing name attribute." << llendl; - return FALSE; - } - // <param> sub-element - for (LLXmlTreeNode* child = node->getChildByName( "param" ); - child; - child = node->getNextNamedChild()) - { - if( child->getChildByName( "param_color" ) ) - { - // <param><param_color/></param> - LLTexParamColorInfo* info = new LLTexParamColorInfo(); - if (!info->parseXml(child)) - { - delete info; - return FALSE; - } - mColorInfoList.push_back( info ); - } - } - return TRUE; -} - -//----------------------------------------------------------------------------- -// LLTexGlobalColor -//----------------------------------------------------------------------------- - -LLTexGlobalColor::LLTexGlobalColor( LLVOAvatar* avatar ) - : - mAvatar( avatar ), - mInfo( NULL ) -{ -} - - -LLTexGlobalColor::~LLTexGlobalColor() -{ - // mParamList are LLViewerVisualParam's and get deleted with ~LLCharacter() - //std::for_each(mParamList.begin(), mParamList.end(), DeletePointer()); -} - -BOOL LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info) -{ - llassert(mInfo == NULL); - mInfo = info; - //mID = info->mID; // No ID - - LLTexGlobalColorInfo::color_info_list_t::iterator iter; - mParamList.reserve(mInfo->mColorInfoList.size()); - for (iter = mInfo->mColorInfoList.begin(); iter != mInfo->mColorInfoList.end(); iter++) - { - LLTexParamColor* param_color = new LLTexParamColor( this ); - if (!param_color->setInfo(*iter)) - { - mInfo = NULL; - return FALSE; - } - mParamList.push_back( param_color ); - } - - return TRUE; -} - -//----------------------------------------------------------------------------- - -LLColor4 LLTexGlobalColor::getColor() -{ - // Sum of color params - if( !mParamList.empty() ) - { - LLColor4 net_color( 0.f, 0.f, 0.f, 0.f ); - - for( param_list_t::iterator iter = mParamList.begin(); - iter != mParamList.end(); iter++ ) - { - LLTexParamColor* param = *iter; - LLColor4 param_net = param->getNetColor(); - switch( param->getOperation() ) - { - case OP_ADD: - net_color += param_net; - break; - case OP_MULTIPLY: - net_color.mV[VX] *= param_net.mV[VX]; - net_color.mV[VY] *= param_net.mV[VY]; - net_color.mV[VZ] *= param_net.mV[VZ]; - net_color.mV[VW] *= param_net.mV[VW]; - break; - case OP_BLEND: - net_color = lerp(net_color, param_net, param->getWeight()); - break; - default: - llassert(0); - break; - } - } - - net_color.mV[VX] = llclampf( net_color.mV[VX] ); - net_color.mV[VY] = llclampf( net_color.mV[VY] ); - net_color.mV[VZ] = llclampf( net_color.mV[VZ] ); - net_color.mV[VW] = llclampf( net_color.mV[VW] ); - - return net_color; - } - return LLColor4( 1.f, 1.f, 1.f, 1.f ); -} - -//----------------------------------------------------------------------------- -// LLTexParamColorInfo -//----------------------------------------------------------------------------- -LLTexParamColorInfo::LLTexParamColorInfo() - : - mOperation( OP_ADD ), - mNumColors( 0 ) -{ -} - -BOOL LLTexParamColorInfo::parseXml(LLXmlTreeNode *node) +void LLTexLayer::invalidateMorphMasks() { - llassert( node->hasName( "param" ) && node->getChildByName( "param_color" ) ); - - if (!LLViewerVisualParamInfo::parseXml(node)) - return FALSE; - - LLXmlTreeNode* param_color_node = node->getChildByName( "param_color" ); - if( !param_color_node ) - { - return FALSE; - } - - std::string op_string; - static LLStdStringHandle operation_string = LLXmlTree::addAttributeString("operation"); - if( param_color_node->getFastAttributeString( operation_string, op_string ) ) - { - LLStringUtil::toLower(op_string); - if ( op_string == "add" ) mOperation = OP_ADD; - else if ( op_string == "multiply" ) mOperation = OP_MULTIPLY; - else if ( op_string == "blend" ) mOperation = OP_BLEND; - } - - mNumColors = 0; - - LLColor4U color4u; - for (LLXmlTreeNode* child = param_color_node->getChildByName( "value" ); - child; - child = param_color_node->getNextNamedChild()) - { - if( (mNumColors < MAX_COLOR_VALUES) ) - { - static LLStdStringHandle color_string = LLXmlTree::addAttributeString("color"); - if( child->getFastAttributeColor4U( color_string, color4u ) ) - { - mColors[ mNumColors ].setVec(color4u); - mNumColors++; - } - } - } - if( !mNumColors ) - { - llwarns << "<param_color> is missing <value> sub-elements" << llendl; - return FALSE; + mMorphMasksValid = FALSE; } - if( (mOperation == OP_BLEND) && (mNumColors != 1) ) +BOOL LLTexLayer::isVisibilityMask() const { - llwarns << "<param_color> with operation\"blend\" must have exactly one <value>" << llendl; - return FALSE; - } - - return TRUE; + return mInfo->mIsVisibilityMask; } //----------------------------------------------------------------------------- -// LLTexParamColor +// LLTexLayerStaticImageList //----------------------------------------------------------------------------- -LLTexParamColor::LLTexParamColor( LLTexGlobalColor* tex_global_color ) - : - mAvgDistortionVec(1.f, 1.f, 1.f), - mTexGlobalColor( tex_global_color ), - mTexLayer( NULL ), - mAvatar( tex_global_color->getAvatar() ) -{ -} -LLTexParamColor::LLTexParamColor( LLTexLayer* layer ) - : - mAvgDistortionVec(1.f, 1.f, 1.f), - mTexGlobalColor( NULL ), - mTexLayer( layer ), - mAvatar( layer->getTexLayerSet()->getAvatar() ) +LLTexLayerStaticImageList::LLTexLayerStaticImageList() : + mGLBytes(0), + mTGABytes(0), + mImageNames(16384) { } - -LLTexParamColor::~LLTexParamColor() -{ -} - -//----------------------------------------------------------------------------- -// setInfo() -//----------------------------------------------------------------------------- - -BOOL LLTexParamColor::setInfo(LLTexParamColorInfo *info) -{ - llassert(mInfo == NULL); - if (info->mID < 0) - return FALSE; - mID = info->mID; - mInfo = info; - - mAvatar->addVisualParam( this ); - setWeight( getDefaultWeight(), FALSE ); - - return TRUE; -} - -LLColor4 LLTexParamColor::getNetColor() -{ - llassert( getInfo()->mNumColors >= 1 ); - - F32 effective_weight = ( mAvatar && (mAvatar->getSex() & getSex()) ) ? mCurWeight : getDefaultWeight(); - - S32 index_last = getInfo()->mNumColors - 1; - F32 scaled_weight = effective_weight * index_last; - S32 index_start = (S32) scaled_weight; - S32 index_end = index_start + 1; - if( index_start == index_last ) - { - return getInfo()->mColors[index_last]; - } - else - { - F32 weight = scaled_weight - index_start; - const LLColor4 *start = &getInfo()->mColors[ index_start ]; - const LLColor4 *end = &getInfo()->mColors[ index_end ]; - return LLColor4( - (1.f - weight) * start->mV[VX] + weight * end->mV[VX], - (1.f - weight) * start->mV[VY] + weight * end->mV[VY], - (1.f - weight) * start->mV[VZ] + weight * end->mV[VZ], - (1.f - weight) * start->mV[VW] + weight * end->mV[VW] ); - } -} - -void LLTexParamColor::setWeight(F32 weight, BOOL set_by_user) -{ - if (mIsAnimating) - { - return; - } - F32 min_weight = getMinWeight(); - F32 max_weight = getMaxWeight(); - F32 new_weight = llclamp(weight, min_weight, max_weight); - U8 cur_u8 = F32_to_U8( mCurWeight, min_weight, max_weight ); - U8 new_u8 = F32_to_U8( new_weight, min_weight, max_weight ); - if( cur_u8 != new_u8) - { - mCurWeight = new_weight; - - if( getInfo()->mNumColors <= 0 ) - { - // This will happen when we set the default weight the first time. - return; - } - - if( mAvatar->getSex() & getSex() ) - { - if( mTexGlobalColor ) - { - mAvatar->onGlobalColorChanged( mTexGlobalColor, set_by_user ); - } - else - if( mTexLayer ) - { - mAvatar->invalidateComposite( mTexLayer->getTexLayerSet(), set_by_user ); - } - } -// llinfos << "param " << mName << " = " << new_weight << llendl; - } -} - -void LLTexParamColor::setAnimationTarget(F32 target_value, BOOL set_by_user) -{ - // set value first then set interpolating flag to ignore further updates - mTargetWeight = target_value; - setWeight(target_value, set_by_user); - mIsAnimating = TRUE; - if (mNext) - { - mNext->setAnimationTarget(target_value, set_by_user); - } -} - -void LLTexParamColor::animate(F32 delta, BOOL set_by_user) -{ - if (mNext) - { - mNext->animate(delta, set_by_user); - } -} - - -//----------------------------------------------------------------------------- -// LLTexStaticImageList -//----------------------------------------------------------------------------- - -// static -LLTexStaticImageList gTexStaticImageList; -LLStringTable LLTexStaticImageList::sImageNames(16384); - -LLTexStaticImageList::LLTexStaticImageList() - : - mGLBytes( 0 ), - mTGABytes( 0 ) -{} - -LLTexStaticImageList::~LLTexStaticImageList() +LLTexLayerStaticImageList::~LLTexLayerStaticImageList() { deleteCachedImages(); } -void LLTexStaticImageList::dumpByteCount() +void LLTexLayerStaticImageList::dumpByteCount() { llinfos << "Avatar Static Textures " << "KB GL:" << (mGLBytes / 1024) << "KB TGA:" << (mTGABytes / 1024) << "KB" << llendl; } -void LLTexStaticImageList::deleteCachedImages() +void LLTexLayerStaticImageList::deleteCachedImages() { if( mGLBytes || mTGABytes ) { @@ -2491,10 +1869,10 @@ void LLTexStaticImageList::deleteCachedImages() // Returns an LLImageTGA that contains the encoded data from a tga file named file_name. // Caches the result to speed identical subsequent requests. -LLImageTGA* LLTexStaticImageList::getImageTGA(const std::string& file_name) +LLImageTGA* LLTexLayerStaticImageList::getImageTGA(const std::string& file_name) { - const char *namekey = sImageNames.addString(file_name); - image_tga_map_t::iterator iter = mStaticImageListTGA.find(namekey); + const char *namekey = mImageNames.addString(file_name); + image_tga_map_t::const_iterator iter = mStaticImageListTGA.find(namekey); if( iter != mStaticImageListTGA.end() ) { return iter->second; @@ -2517,16 +1895,14 @@ LLImageTGA* LLTexStaticImageList::getImageTGA(const std::string& file_name) } } - - // Returns a GL Image (without a backing ImageRaw) that contains the decoded data from a tga file named file_name. // Caches the result to speed identical subsequent requests. -LLImageGL* LLTexStaticImageList::getImageGL(const std::string& file_name, BOOL is_mask ) +LLImageGL* LLTexLayerStaticImageList::getImageGL(const std::string& file_name, BOOL is_mask) { LLPointer<LLImageGL> image_gl; - const char *namekey = sImageNames.addString(file_name); + const char *namekey = mImageNames.addString(file_name); - image_gl_map_t::iterator iter = mStaticImageListGL.find(namekey); + image_gl_map_t::const_iterator iter = mStaticImageListGL.find(namekey); if( iter != mStaticImageListGL.end() ) { image_gl = iter->second; @@ -2562,7 +1938,7 @@ LLImageGL* LLTexStaticImageList::getImageGL(const std::string& file_name, BOOL i // Reads a .tga file, decodes it, and puts the decoded data in image_raw. // Returns TRUE if successful. -BOOL LLTexStaticImageList::loadImageRaw( const std::string& file_name, LLImageRaw* image_raw ) +BOOL LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLImageRaw* image_raw) { BOOL success = FALSE; std::string path; @@ -2577,11 +1953,4 @@ BOOL LLTexStaticImageList::loadImageRaw( const std::string& file_name, LLImageRa return success; } -//----------------------------------------------------------------------------- -// LLMaskedMorph() -//----------------------------------------------------------------------------- -LLMaskedMorph::LLMaskedMorph( LLPolyMorphTarget *morph_target, BOOL invert ) : mMorphTarget(morph_target), mInvert(invert) -{ - morph_target->addPendingMorphMask(); -} diff --git a/indra/newview/lltexlayer.h b/indra/newview/lltexlayer.h index 1924d0bee39da91ca0f6da051023db4c2dce98bf..589044010804dc003421a619ec10dc3abf4429c6 100644 --- a/indra/newview/lltexlayer.h +++ b/indra/newview/lltexlayer.h @@ -34,136 +34,94 @@ #define LL_LLTEXLAYER_H #include <deque> -#include "llassetstorage.h" #include "lldynamictexture.h" -#include "llrect.h" -#include "llstring.h" -#include "lluuid.h" -#include "llviewerimage.h" -#include "llviewervisualparam.h" #include "llwearable.h" -#include "v4color.h" -#include "llfloater.h" +#include "llvoavatardefines.h" -class LLTexLayerSetInfo; -class LLTexLayerSet; -class LLTexLayerInfo; -class LLTexLayer; +class LLVOAvatar; +class LLVOAvatarSelf; class LLImageGL; class LLImageTGA; -class LLTexGlobalColorInfo; -class LLTexLayerParamAlphaInfo; -class LLTexLayerParamAlpha; -class LLTexParamColorInfo; -class LLTexParamColor; -class LLPolyMesh; -class LLXmlTreeNode; class LLImageRaw; +class LLXmlTreeNode; class LLPolyMorphTarget; +class LLTexLayerSet; +class LLTexLayerSetInfo; +class LLTexLayerInfo; +class LLTexLayerSetBuffer; +class LLTexLayerParamColor; +class LLTexLayerParamColorInfo; +class LLTexLayerParamAlpha; +class LLTexLayerParamAlphaInfo; -class LLTextureCtrl; -class LLVOAvatar; - - -enum EColorOperation -{ - OP_ADD = 0, - OP_MULTIPLY = 1, - OP_BLEND = 2, - OP_COUNT = 3 // Number of operations -}; - +typedef std::vector<LLTexLayerParamColor *> param_color_list_t; +typedef std::vector<LLTexLayerParamAlpha *> param_alpha_list_t; +typedef std::vector<LLTexLayerParamColorInfo *> param_color_info_list_t; +typedef std::vector<LLTexLayerParamAlphaInfo *> param_alpha_info_list_t; //----------------------------------------------------------------------------- -// LLTexLayerParamAlphaInfo -//----------------------------------------------------------------------------- -class LLTexLayerParamAlphaInfo : public LLViewerVisualParamInfo +// LLTexLayer +// A single texture layer +// Only exists for llvoavatarself + +class LLTexLayer { - friend class LLTexLayerParamAlpha; public: - LLTexLayerParamAlphaInfo(); - /*virtual*/ ~LLTexLayerParamAlphaInfo() {}; + enum ERenderPass + { + RP_COLOR, + RP_BUMP, + RP_SHINE + }; + + LLTexLayer(LLTexLayerSet* const layer_set); + ~LLTexLayer(); - /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); + const LLTexLayerInfo* getInfo() const { return mInfo; } + BOOL setInfo(const LLTexLayerInfo *info); // This sets mInfo and calls initialization functions + BOOL render(S32 x, S32 y, S32 width, S32 height, BOOL render_morph); + void requestUpdate(); + LLTexLayerSet* const getTexLayerSet() const { return mTexLayerSet; } -protected: - std::string mStaticImageFileName; - BOOL mMultiplyBlend; - BOOL mSkipIfZeroWeight; - F32 mDomain; -}; + void deleteCaches(); + U8* getAlphaData(); + void invalidateMorphMasks(); + void setHasMorph(BOOL newval) { mHasMorph = newval; } + BOOL isMorphValid() { return mMorphMasksValid; } -//----------------------------------------------------------------------------- -// LLTexParamColorInfo -//----------------------------------------------------------------------------- -class LLTexParamColorInfo : public LLViewerVisualParamInfo -{ - friend class LLTexParamColor; + const std::string& getName() const; + ERenderPass getRenderPass() const; + const std::string& getGlobalColor() const; -public: - LLTexParamColorInfo(); - virtual ~LLTexParamColorInfo() {}; - BOOL parseXml( LLXmlTreeNode* node ); - -protected: - enum { MAX_COLOR_VALUES = 20 }; - EColorOperation mOperation; - LLColor4 mColors[MAX_COLOR_VALUES]; - S32 mNumColors; -}; + BOOL findNetColor(LLColor4* color) const; + BOOL renderImageRaw(U8* in_data, S32 in_width, S32 in_height, S32 in_components, S32 width, S32 height, BOOL is_mask); + BOOL blendAlphaTexture(S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer + BOOL renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLColor4 &layer_color, BOOL render_morph); + BOOL hasAlphaParams() const { return !mParamAlphaList.empty(); } + BOOL isVisibilityMask() const; -//----------------------------------------------------------------------------- -// LLTexGlobalColorInfo -//----------------------------------------------------------------------------- -class LLTexGlobalColorInfo -{ - friend class LLTexGlobalColor; -public: - LLTexGlobalColorInfo(); - ~LLTexGlobalColorInfo(); + static void calculateTexLayerColor(const param_color_list_t ¶m_list, LLColor4 &net_color); - BOOL parseXml(LLXmlTreeNode* node); - -protected: - typedef std::vector<LLTexParamColorInfo *> color_info_list_t; - color_info_list_t mColorInfoList; - std::string mName; -}; +private: + LLTexLayerSet* const mTexLayerSet; -//----------------------------------------------------------------------------- -// LLTexLayerSetInfo -// Containes shared layer set data -//----------------------------------------------------------------------------- -class LLTexLayerSetInfo -{ - friend class LLTexLayerSet; -public: - LLTexLayerSetInfo(); - ~LLTexLayerSetInfo(); + // Layers can have either mParamColorList, mGlobalColor, or mFixedColor. They are looked for in that order. + param_color_list_t mParamColorList; + // mGlobalColor name stored in mInfo + // mFixedColor value stored in mInfo + param_alpha_list_t mParamAlphaList; - BOOL parseXml(LLXmlTreeNode* node); + BOOL mMorphMasksValid; + typedef std::map<U32, U8*> alpha_cache_t; + alpha_cache_t mAlphaCache; + BOOL mStaticImageInvalid; -protected: - std::string mBodyRegion; - S32 mWidth; - S32 mHeight; - std::string mStaticAlphaFileName; - BOOL mClearAlpha; // Set alpha to 1 for this layerset (if there is no mStaticAlphaFileName) - - typedef std::vector<LLTexLayerInfo*> layer_info_list_t; - layer_info_list_t mLayerInfoList; -}; + BOOL mHasMorph; -//----------------------------------------------------------------------------- -// LLTexLayerInfo -//----------------------------------------------------------------------------- -enum ERenderPass -{ - RP_COLOR, - RP_BUMP, - RP_SHINE + const LLTexLayerInfo *mInfo; }; +// Make private class LLTexLayerInfo { friend class LLTexLayer; @@ -172,12 +130,13 @@ public: ~LLTexLayerInfo(); BOOL parseXml(LLXmlTreeNode* node); + BOOL createVisualParams(LLVOAvatar *avatar); -protected: +private: std::string mName; - BOOL mWriteAllChannels; // Don't use masking. Just write RGBA into buffer, - ERenderPass mRenderPass; + BOOL mWriteAllChannels; // Don't use masking. Just write RGBA into buffer, + LLTexLayer::ERenderPass mRenderPass; std::string mGlobalColor; LLColor4 mFixedColor; @@ -185,377 +144,200 @@ protected: S32 mLocalTexture; std::string mStaticImageFileName; BOOL mStaticImageIsMask; - BOOL mUseLocalTextureAlphaOnly; // Ignore RGB channels from the input texture. Use alpha as a mask - - typedef std::vector<std::pair<std::string,BOOL> > morph_name_list_t; - morph_name_list_t mMorphNameList; + BOOL mUseLocalTextureAlphaOnly; // Ignore RGB channels from the input texture. Use alpha as a mask + BOOL mIsVisibilityMask; - typedef std::vector<LLTexParamColorInfo*> color_info_list_t; - color_info_list_t mColorInfoList; - - typedef std::vector<LLTexLayerParamAlphaInfo*> alpha_info_list_t; - alpha_info_list_t mAlphaInfoList; - + typedef std::vector< std::pair< std::string,BOOL > > morph_name_list_t; + morph_name_list_t mMorphNameList; + param_color_info_list_t mParamColorInfoList; + param_alpha_info_list_t mParamAlphaInfoList; }; +// +// LLTexLayer //----------------------------------------------------------------------------- -// LLTexLayerSetBuffer -// The composite image that a LLTexLayerSet writes to. Each LLTexLayerSet has one. -//----------------------------------------------------------------------------- -class LLTexLayerSetBuffer : public LLDynamicTexture -{ -public: - LLTexLayerSetBuffer( LLTexLayerSet* owner, S32 width, S32 height, BOOL has_bump ); - virtual ~LLTexLayerSetBuffer(); - - virtual void preRender(BOOL clear_depth); - virtual void postRender(BOOL success); - virtual BOOL render(); - BOOL updateImmediate(); - void bindBumpTexture( U32 stage ); - bool isInitialized(void) const; - BOOL needsRender(); - void requestUpdate(); - void requestUpload(); - void cancelUpload(); - BOOL uploadPending() { return mUploadPending; } - BOOL render( S32 x, S32 y, S32 width, S32 height ); - void readBackAndUpload(U8* baked_bump_data); - void createBumpTexture() ; - - static void onTextureUploadComplete( const LLUUID& uuid, - void* userdata, - S32 result, LLExtStat ext_status); - static void dumpTotalByteCount(); - - virtual void restoreGLTexture() ; - virtual void destroyGLTexture() ; - -private: - void pushProjection(); - void popProjection(); - -private: - BOOL mHasBump ; - BOOL mNeedsUpdate; - BOOL mNeedsUpload; - BOOL mUploadPending; - LLUUID mUploadID; // Identifys the current upload process (null if none). Used to avoid overlaps (eg, when the user rapidly makes two changes outside of Face Edit) - LLTexLayerSet* mTexLayerSet; - LLPointer<LLImageGL> mBumpTex; // zero if none - - static S32 sGLByteCount; - static S32 sGLBumpByteCount; -}; //----------------------------------------------------------------------------- // LLTexLayerSet // An ordered set of texture layers that get composited into a single texture. -//----------------------------------------------------------------------------- +// Only exists for llvoavatarself + class LLTexLayerSet { + friend class LLTexLayerSetBuffer; public: - LLTexLayerSet( LLVOAvatar* avatar ); + LLTexLayerSet(LLVOAvatarSelf* const avatar); ~LLTexLayerSet(); - //BOOL parseData(LLXmlTreeNode* node); - LLTexLayerSetInfo* getInfo() const { return mInfo; } - // This sets mInfo and calls initialization functions - BOOL setInfo(LLTexLayerSetInfo *info); - - BOOL render( S32 x, S32 y, S32 width, S32 height ); - BOOL renderBump( S32 x, S32 y, S32 width,S32 height ); - BOOL isBodyRegion( const std::string& region ) { return mInfo->mBodyRegion == region; } + const LLTexLayerSetInfo* getInfo() const { return mInfo; } + BOOL setInfo(const LLTexLayerSetInfo *info); // This sets mInfo and calls initialization functions + + BOOL render(S32 x, S32 y, S32 width, S32 height); + BOOL renderBump(S32 x, S32 y, S32 width,S32 height); + + BOOL isBodyRegion(const std::string& region) const; LLTexLayerSetBuffer* getComposite(); void requestUpdate(); void requestUpload(); void cancelUpload(); - LLVOAvatar* getAvatar() { return mAvatar; } void updateComposite(); - BOOL isLocalTextureDataAvailable(); - BOOL isLocalTextureDataFinal(); + BOOL isLocalTextureDataAvailable() const; + BOOL isLocalTextureDataFinal() const; void createComposite(); void destroyComposite(); - void setUpdatesEnabled( BOOL b ); - BOOL getUpdatesEnabled() { return mUpdatesEnabled; } + void setUpdatesEnabled(BOOL b); + BOOL getUpdatesEnabled() const { return mUpdatesEnabled; } void deleteCaches(); - void gatherAlphaMasks(U8 *data, S32 width, S32 height); + void gatherMorphMaskAlpha(U8 *data, S32 width, S32 height); void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components); - const std::string getBodyRegion() { return mInfo->mBodyRegion; } - BOOL hasComposite() { return (mComposite != NULL); } - void setBump( BOOL b ) { mHasBump = b; } - BOOL hasBump() { return mHasBump; } + void renderAlphaMaskTextures(S32 width, S32 height, bool forceClear = false); + LLTexLayer* findLayerByName(std::string name); + + LLVOAvatarSelf* getAvatar() const { return mAvatar; } + const std::string getBodyRegion() const; + BOOL hasComposite() const { return (mComposite != NULL); } + void setBump(BOOL b) { mHasBump = b; } + BOOL hasBump() const { return mHasBump; } + LLVOAvatarDefines::EBakedTextureIndex getBakedTexIndex() { return mBakedTexIndex; } + void setBakedTexIndex( LLVOAvatarDefines::EBakedTextureIndex index) { mBakedTexIndex = index; } public: static BOOL sHasCaches; -protected: +private: typedef std::vector<LLTexLayer *> layer_list_t; layer_list_t mLayerList; + layer_list_t mMaskLayerList; LLTexLayerSetBuffer* mComposite; - // Backlink only; don't make this an LLPointer. - LLVOAvatar* mAvatar; + LLVOAvatarSelf* const mAvatar; // Backlink only; don't make this an LLPointer. BOOL mUpdatesEnabled; BOOL mHasBump; - LLTexLayerSetInfo *mInfo; -}; + LLVOAvatarDefines::EBakedTextureIndex mBakedTexIndex; -//----------------------------------------------------------------------------- -// LLMaskedMorph -//----------------------------------------------------------------------------- - -class LLMaskedMorph -{ -public: - LLMaskedMorph( LLPolyMorphTarget *morph_target, BOOL invert ); - -public: - LLPolyMorphTarget *mMorphTarget; - BOOL mInvert; + const LLTexLayerSetInfo *mInfo; }; -//----------------------------------------------------------------------------- -// LLTexLayer -// A single texture layer -//----------------------------------------------------------------------------- -class LLTexLayer +// Contains shared layer set data +class LLTexLayerSetInfo { + friend class LLTexLayerSet; public: - LLTexLayer( LLTexLayerSet* layer_set ); - ~LLTexLayer(); - - //BOOL parseData(LLXmlTreeNode* node); - LLTexLayerInfo* getInfo() const { return mInfo; } - // This sets mInfo and calls initialization functions - BOOL setInfo(LLTexLayerInfo *info); + LLTexLayerSetInfo(); + ~LLTexLayerSetInfo(); - BOOL render( S32 x, S32 y, S32 width, S32 height ); - void requestUpdate(); - LLTexLayerSet* getTexLayerSet() { return mTexLayerSet; } - - const std::string& getName() { return mInfo->mName; } - - void addMaskedMorph(LLPolyMorphTarget* morph_target, BOOL invert); - void deleteCaches(); - U8* getAlphaData(); - void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components); - - void invalidateMorphMasks(); - ERenderPass getRenderPass() { return mInfo->mRenderPass; } - const std::string& getGlobalColor() { return mInfo->mGlobalColor; } - BOOL findNetColor( LLColor4* color ); - BOOL renderImageRaw( U8* in_data, S32 in_width, S32 in_height, S32 in_components, S32 width, S32 height, BOOL is_mask ); - BOOL renderAlphaMasks( S32 x, S32 y, S32 width, S32 height, LLColor4* colorp ); - BOOL hasAlphaParams() { return (!mParamAlphaList.empty());} - -protected: - LLTexLayerSet* mTexLayerSet; - LLPointer<LLImageRaw> mStaticImageRaw; - - // Layers can have either mParamColorList, mGlobalColor, or mFixedColor. They are looked for in that order. - typedef std::vector<LLTexParamColor *> color_list_t; - color_list_t mParamColorList; - // mGlobalColor name stored in mInfo - // mFixedColor value stored in mInfo + BOOL parseXml(LLXmlTreeNode* node); + void createVisualParams(LLVOAvatar *avatar); - typedef std::vector<LLTexLayerParamAlpha *> alpha_list_t; - alpha_list_t mParamAlphaList; - +private: + std::string mBodyRegion; + S32 mWidth; + S32 mHeight; + std::string mStaticAlphaFileName; + BOOL mClearAlpha; // Set alpha to 1 for this layerset (if there is no mStaticAlphaFileName) - typedef std::deque<LLMaskedMorph> morph_list_t; - morph_list_t mMaskedMorphs; - typedef std::map<U32, U8*> alpha_cache_t; - alpha_cache_t mAlphaCache; - BOOL mMorphMasksValid; - BOOL mStaticImageInvalid; - - LLTexLayerInfo *mInfo; + typedef std::vector<LLTexLayerInfo*> layer_info_list_t; + layer_info_list_t mLayerInfoList; }; -//----------------------------------------------------------------------------- -// LLTexLayerParamAlpha -//----------------------------------------------------------------------------- -class LLTexLayerParamAlpha : public LLViewerVisualParam +// The composite image that a LLTexLayerSet writes to. Each LLTexLayerSet has one. +class LLTexLayerSetBuffer : public LLDynamicTexture { public: - LLTexLayerParamAlpha( LLTexLayer* layer ); - /*virtual*/ ~LLTexLayerParamAlpha(); + LLTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height, BOOL has_bump); + virtual ~LLTexLayerSetBuffer(); - // Special: These functions are overridden by child classes - LLTexLayerParamAlphaInfo* getInfo() const { return (LLTexLayerParamAlphaInfo*)mInfo; } - // This sets mInfo and calls initialization functions - BOOL setInfo(LLTexLayerParamAlphaInfo *info); - - // LLVisualParam Virtual functions - ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); - /*virtual*/ void apply( ESex avatar_sex ) {} - /*virtual*/ void setWeight(F32 weight, BOOL set_by_user); - /*virtual*/ void setAnimationTarget(F32 target_value, BOOL set_by_user); - /*virtual*/ void animate(F32 delta, BOOL set_by_user); - - // LLViewerVisualParam Virtual functions - /*virtual*/ F32 getTotalDistortion() { return 1.f; } - /*virtual*/ const LLVector3& getAvgDistortion() { return mAvgDistortionVec; } - /*virtual*/ F32 getMaxDistortion() { return 3.f; } - /*virtual*/ LLVector3 getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { return LLVector3(1.f, 1.f, 1.f);} - /*virtual*/ const LLVector3* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return &mAvgDistortionVec;}; - /*virtual*/ const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return NULL;}; - - // New functions + virtual void preRender(BOOL clear_depth); + virtual void postRender(BOOL success); + virtual BOOL render(); + BOOL updateImmediate(); + void bindBumpTexture(U32 stage); + bool isInitialized(void) const; + BOOL needsRender(); + void requestUpdate(); + void requestUpload(); + void cancelUpload(); + BOOL uploadPending() { return mUploadPending; } BOOL render( S32 x, S32 y, S32 width, S32 height ); - BOOL getSkip(); - void deleteCaches(); - LLTexLayer* getTexLayer() { return mTexLayer; } - BOOL getMultiplyBlend() { return getInfo()->mMultiplyBlend; } - -protected: - LLPointer<LLImageGL> mCachedProcessedImageGL; - LLTexLayer* mTexLayer; - LLPointer<LLImageTGA> mStaticImageTGA; - LLPointer<LLImageRaw> mStaticImageRaw; - BOOL mNeedsCreateTexture; - BOOL mStaticImageInvalid; - LLVector3 mAvgDistortionVec; - F32 mCachedEffectiveWeight; + void readBackAndUpload(const U8* baked_bump_data); + void createBumpTexture(); -public: - // Global list of instances for gathering statistics - static void dumpCacheByteCount(); - static void getCacheByteCount( S32* gl_bytes ); - - typedef std::list< LLTexLayerParamAlpha* > param_alpha_ptr_list_t; - static param_alpha_ptr_list_t sInstances; -}; + static void onTextureUploadComplete(const LLUUID& uuid, + void* userdata, + S32 result, LLExtStat ext_status); + static void dumpTotalByteCount(); + virtual void restoreGLTexture(); + virtual void destroyGLTexture(); -//----------------------------------------------------------------------------- -// LLTexGlobalColor -//----------------------------------------------------------------------------- -class LLTexGlobalColor -{ -public: - LLTexGlobalColor( LLVOAvatar* avatar ); - ~LLTexGlobalColor(); +private: + void pushProjection() const; + void popProjection() const; - //BOOL parseData(LLXmlTreeNode* node); - LLTexGlobalColorInfo* getInfo() const { return mInfo; } - // This sets mInfo and calls initialization functions - BOOL setInfo(LLTexGlobalColorInfo *info); - - void requstUpdate(); - LLVOAvatar* getAvatar() { return mAvatar; } - LLColor4 getColor(); - const std::string& getName() { return mInfo->mName; } +private: + const BOOL mHasBump; + LLTexLayerSet* const mTexLayerSet; -protected: - typedef std::vector<LLTexParamColor *> param_list_t; - param_list_t mParamList; - LLVOAvatar* mAvatar; // just backlink, don't LLPointer + BOOL mNeedsUpdate; + BOOL mNeedsUpload; + BOOL mUploadPending; + LLUUID mUploadID; // Identifys the current upload process (null if none). Used to avoid overlaps (eg, when the user rapidly makes two changes outside of Face Edit) + LLPointer<LLImageGL> mBumpTex; // zero if none - LLTexGlobalColorInfo *mInfo; + static S32 sGLByteCount; + static S32 sGLBumpByteCount; }; - -//----------------------------------------------------------------------------- -// LLTexParamColor +// +// LLTexLayerSet //----------------------------------------------------------------------------- -class LLTexParamColor : public LLViewerVisualParam -{ -public: - LLTexParamColor( LLTexGlobalColor* tex_color ); - LLTexParamColor( LLTexLayer* layer ); - /* virtual */ ~LLTexParamColor(); - - // Special: These functions are overridden by child classes - LLTexParamColorInfo* getInfo() const { return (LLTexParamColorInfo*)mInfo; } - // This sets mInfo and calls initialization functions - BOOL setInfo(LLTexParamColorInfo *info); - - // LLVisualParam Virtual functions - ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); - /*virtual*/ void apply( ESex avatar_sex ) {} - /*virtual*/ void setWeight(F32 weight, BOOL set_by_user); - /*virtual*/ void setAnimationTarget(F32 target_value, BOOL set_by_user); - /*virtual*/ void animate(F32 delta, BOOL set_by_user); - - - // LLViewerVisualParam Virtual functions - /*virtual*/ F32 getTotalDistortion() { return 1.f; } - /*virtual*/ const LLVector3& getAvgDistortion() { return mAvgDistortionVec; } - /*virtual*/ F32 getMaxDistortion() { return 3.f; } - /*virtual*/ LLVector3 getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { return LLVector3(1.f, 1.f, 1.f); } - /*virtual*/ const LLVector3* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return &mAvgDistortionVec;}; - /*virtual*/ const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return NULL;}; - - // New functions - LLColor4 getNetColor(); - EColorOperation getOperation() const { return getInfo()->mOperation; } - -protected: - LLVector3 mAvgDistortionVec; - LLTexGlobalColor* mTexGlobalColor; // either has mTexGlobalColor or mTexLayer as its parent - LLTexLayer* mTexLayer; - LLVOAvatar* mAvatar; // redundant, but simplifies the code (don't LLPointer) -}; - -//----------------------------------------------------------------------------- -// LLTexStaticImageList //----------------------------------------------------------------------------- +// LLTexLayerStaticImageList +// -class LLTexStaticImageList +class LLTexLayerStaticImageList : public LLSingleton<LLTexLayerStaticImageList> { public: - LLTexStaticImageList(); - ~LLTexStaticImageList(); + LLTexLayerStaticImageList(); + ~LLTexLayerStaticImageList(); - LLImageRaw* getImageRaw( const std::string& file_name ); - LLImageGL* getImageGL( const std::string& file_name, BOOL is_mask ); - LLImageTGA* getImageTGA( const std::string& file_name ); + LLImageGL* getImageGL(const std::string& file_name, BOOL is_mask); + LLImageTGA* getImageTGA(const std::string& file_name); void deleteCachedImages(); void dumpByteCount(); private: - BOOL loadImageRaw( const std::string& file_name, LLImageRaw* image_raw ); + BOOL loadImageRaw(const std::string& file_name, LLImageRaw* image_raw); private: - static LLStringTable sImageNames; + LLStringTable mImageNames; - typedef std::map< const char *, LLPointer<LLImageGL> > image_gl_map_t; - typedef std::map< const char *, LLPointer<LLImageTGA> > image_tga_map_t; + typedef std::map< const char*, LLPointer<LLImageGL> > image_gl_map_t; image_gl_map_t mStaticImageListGL; + typedef std::map< const char*, LLPointer<LLImageTGA> > image_tga_map_t; image_tga_map_t mStaticImageListTGA; -public: S32 mGLBytes; S32 mTGABytes; }; // Used by LLTexLayerSetBuffer for a callback. - -// For DEV-DEV-31590, "Heap corruption and crash after outfit -// changes", added the mLayerSet member. The current -// LLTexLayerSetBuffer can be found by querying mLayerSet->mComposite, -// but we still store the original mLayerSetBuffer here so we can -// detect when an upload is out of date. This prevents a memory -// stomp. See LLTexLayerSetBuffer::onTextureUploadComplete() for usage. +// Note to anyone merging branches - this supercedes the previous fix +// for DEV-31590 "Heap corruption and crash after outfit changes", +// here and in lltexlayer.cpp. Equally correct and a bit simpler. class LLBakedUploadData { public: - LLBakedUploadData( LLVOAvatar* avatar, LLTexLayerSet* layerset, LLTexLayerSetBuffer* layerset_buffer, const LLUUID & id); + LLBakedUploadData(const LLVOAvatarSelf* avatar, LLTexLayerSet* layerset, const LLUUID& id); ~LLBakedUploadData() {} - LLUUID mID; - LLVOAvatar* mAvatar; // just backlink, don't LLPointer - LLTexLayerSet* mLayerSet; - LLTexLayerSetBuffer* mLayerSetBuffer; - LLUUID mWearableAssets[WT_COUNT]; - U64 mStartTime; // Used to measure time baked texture upload requires + const LLUUID mID; + const LLVOAvatarSelf* mAvatar; // just backlink, don't LLPointer + LLTexLayerSet* mTexLayerSet; + const U64 mStartTime; // Used to measure time baked texture upload requires }; -extern LLTexStaticImageList gTexStaticImageList; - #endif // LL_LLTEXLAYER_H diff --git a/indra/newview/lltexlayerparams.cpp b/indra/newview/lltexlayerparams.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e00f6aeb04445908472b2b2ebe2f8b7dd73ef244 --- /dev/null +++ b/indra/newview/lltexlayerparams.cpp @@ -0,0 +1,541 @@ +/** + * @file lltexlayerparams.cpp + * @brief SERAPH - ADD IN + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llagent.h" +#include "lltexlayer.h" +#include "llvoavatarself.h" +#include "lltexlayerparams.h" +#include "llui.h" + +//----------------------------------------------------------------------------- +// LLTexLayerParam +//----------------------------------------------------------------------------- +LLTexLayerParam::LLTexLayerParam(LLTexLayer *layer) : + mTexLayer(layer), + mAvatar(NULL) +{ + if (mTexLayer != NULL) + { + mAvatar = mTexLayer->getTexLayerSet()->getAvatar(); + } +} + +LLTexLayerParam::LLTexLayerParam(LLVOAvatar *avatar) : + mTexLayer(NULL) +{ + mAvatar = avatar; +} + + +BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info) +{ + LLViewerVisualParam::setInfo(info); + mAvatar->addVisualParam( this); + return TRUE; +} + + + +//----------------------------------------------------------------------------- +// LLTexLayerParamAlpha +//----------------------------------------------------------------------------- + +// static +LLTexLayerParamAlpha::param_alpha_ptr_list_t LLTexLayerParamAlpha::sInstances; + +// static +void LLTexLayerParamAlpha::dumpCacheByteCount() +{ + S32 gl_bytes = 0; + getCacheByteCount( &gl_bytes); + llinfos << "Processed Alpha Texture Cache GL:" << (gl_bytes/1024) << "KB" << llendl; +} + +// static +void LLTexLayerParamAlpha::getCacheByteCount(S32* gl_bytes) +{ + *gl_bytes = 0; + + for (param_alpha_ptr_list_t::iterator iter = sInstances.begin(); + iter != sInstances.end(); iter++) + { + LLTexLayerParamAlpha* instance = *iter; + LLImageGL* image_gl = instance->mCachedProcessedImageGL; + if (image_gl) + { + S32 bytes = (S32)image_gl->getWidth() * image_gl->getHeight() * image_gl->getComponents(); + + if (image_gl->getHasGLTexture()) + { + *gl_bytes += bytes; + } + } + } +} + +LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayer* layer) : + LLTexLayerParam(layer), + mCachedProcessedImageGL(NULL), + mNeedsCreateTexture(FALSE), + mStaticImageInvalid(FALSE), + mAvgDistortionVec(1.f, 1.f, 1.f), + mCachedEffectiveWeight(0.f) +{ + sInstances.push_front(this); +} + +LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLVOAvatar* avatar) : + LLTexLayerParam(avatar), + mCachedProcessedImageGL(NULL), + mNeedsCreateTexture(FALSE), + mStaticImageInvalid(FALSE), + mAvgDistortionVec(1.f, 1.f, 1.f), + mCachedEffectiveWeight(0.f) +{ + sInstances.push_front(this); +} + + +LLTexLayerParamAlpha::~LLTexLayerParamAlpha() +{ + deleteCaches(); + sInstances.remove(this); +} + +void LLTexLayerParamAlpha::deleteCaches() +{ + mStaticImageTGA = NULL; // deletes image + mCachedProcessedImageGL = NULL; + mStaticImageRaw = NULL; + mNeedsCreateTexture = FALSE; +} + +BOOL LLTexLayerParamAlpha::getMultiplyBlend() const +{ + return ((LLTexLayerParamAlphaInfo *)getInfo())->mMultiplyBlend; +} + +void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL set_by_user) +{ + if (mIsAnimating || mTexLayer == NULL) + { + return; + } + F32 min_weight = getMinWeight(); + F32 max_weight = getMaxWeight(); + F32 new_weight = llclamp(weight, min_weight, max_weight); + U8 cur_u8 = F32_to_U8(mCurWeight, min_weight, max_weight); + U8 new_u8 = F32_to_U8(new_weight, min_weight, max_weight); + if (cur_u8 != new_u8) + { + mCurWeight = new_weight; + + LLVOAvatar* avatar = mTexLayer->getTexLayerSet()->getAvatar(); + if (avatar->getSex() & getSex()) + { + if (gAgent.cameraCustomizeAvatar()) + { + set_by_user = FALSE; + } + avatar->invalidateComposite(mTexLayer->getTexLayerSet(), set_by_user); + mTexLayer->invalidateMorphMasks(); + avatar->updateMeshTextures(); + } + } +} + +void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL set_by_user) +{ + mTargetWeight = target_value; + setWeight(target_value, set_by_user); + mIsAnimating = TRUE; + if (mNext) + { + mNext->setAnimationTarget(target_value, set_by_user); + } +} + +void LLTexLayerParamAlpha::animate(F32 delta, BOOL set_by_user) +{ + if (mNext) + { + mNext->animate(delta, set_by_user); + } +} + +BOOL LLTexLayerParamAlpha::getSkip() const +{ + if (!mTexLayer) + { + return TRUE; + } + + const LLVOAvatar *avatar = mTexLayer->getTexLayerSet()->getAvatar(); + + if (((LLTexLayerParamAlphaInfo *)getInfo())->mSkipIfZeroWeight) + { + F32 effective_weight = (avatar->getSex() & getSex()) ? mCurWeight : getDefaultWeight(); + if (is_approx_zero(effective_weight)) + { + return TRUE; + } + } + + EWearableType type = (EWearableType)getWearableType(); + if ((type != WT_INVALID) && !avatar->isWearingWearableType(type)) + { + return TRUE; + } + + return FALSE; +} + + +BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) +{ + BOOL success = TRUE; + + if (!mTexLayer) + { + return success; + } + + F32 effective_weight = (mTexLayer->getTexLayerSet()->getAvatar()->getSex() & getSex()) ? mCurWeight : getDefaultWeight(); + BOOL weight_changed = effective_weight != mCachedEffectiveWeight; + if (getSkip()) + { + return success; + } + + LLTexLayerParamAlphaInfo *info = (LLTexLayerParamAlphaInfo *)getInfo(); + gGL.flush(); + if (info->mMultiplyBlend) + { + gGL.blendFunc(LLRender::BF_DEST_ALPHA, LLRender::BF_ZERO); // Multiplication: approximates a min() function + } + else + { + gGL.setSceneBlendType(LLRender::BT_ADD); // Addition: approximates a max() function + } + + if (!info->mStaticImageFileName.empty() && !mStaticImageInvalid) + { + if (mStaticImageTGA.isNull()) + { + // Don't load the image file until we actually need it the first time. Like now. + mStaticImageTGA = LLTexLayerStaticImageList::getInstance()->getImageTGA(info->mStaticImageFileName); + // We now have something in one of our caches + LLTexLayerSet::sHasCaches |= mStaticImageTGA.notNull() ? TRUE : FALSE; + + if (mStaticImageTGA.isNull()) + { + llwarns << "Unable to load static file: " << info->mStaticImageFileName << llendl; + mStaticImageInvalid = TRUE; // don't try again. + return FALSE; + } + } + + const S32 image_tga_width = mStaticImageTGA->getWidth(); + const S32 image_tga_height = mStaticImageTGA->getHeight(); + if (!mCachedProcessedImageGL || + (mCachedProcessedImageGL->getWidth() != image_tga_width) || + (mCachedProcessedImageGL->getHeight() != image_tga_height) || + (weight_changed)) + { +// llinfos << "Building Cached Alpha: " << mName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << effective_weight << llendl; + mCachedEffectiveWeight = effective_weight; + + if (!mCachedProcessedImageGL) + { + mCachedProcessedImageGL = new LLImageGL(image_tga_width, image_tga_height, 1, FALSE); + + // We now have something in one of our caches + LLTexLayerSet::sHasCaches |= mCachedProcessedImageGL ? TRUE : FALSE; + + mCachedProcessedImageGL->setExplicitFormat(GL_ALPHA8, GL_ALPHA); + } + + // Applies domain and effective weight to data as it is decoded. Also resizes the raw image if needed. + mStaticImageRaw = NULL; + mStaticImageRaw = new LLImageRaw; + mStaticImageTGA->decodeAndProcess(mStaticImageRaw, info->mDomain, effective_weight); + mNeedsCreateTexture = TRUE; + } + + if (mCachedProcessedImageGL) + { + { + // Create the GL texture, and then hang onto it for future use. + if (mNeedsCreateTexture) + { + mCachedProcessedImageGL->createGLTexture(0, mStaticImageRaw); + mNeedsCreateTexture = FALSE; + gGL.getTexUnit(0)->bind(mCachedProcessedImageGL); + mCachedProcessedImageGL->setAddressMode(LLTexUnit::TAM_CLAMP); + } + + LLGLSNoAlphaTest gls_no_alpha_test; + gGL.getTexUnit(0)->bind(mCachedProcessedImageGL); + gl_rect_2d_simple_tex(width, height); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + stop_glerror(); + } + } + + // Don't keep the cache for other people's avatars + // (It's not really a "cache" in that case, but the logic is the same) + if (mAvatar->isSelf()) + { + mCachedProcessedImageGL = NULL; + } + } + else + { + LLGLDisable no_alpha(GL_ALPHA_TEST); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.color4f(0.f, 0.f, 0.f, effective_weight); + gl_rect_2d_simple(width, height); + } + + return success; +} + +//----------------------------------------------------------------------------- +// LLTexLayerParamAlphaInfo +//----------------------------------------------------------------------------- +LLTexLayerParamAlphaInfo::LLTexLayerParamAlphaInfo() : + mMultiplyBlend(FALSE), + mSkipIfZeroWeight(FALSE), + mDomain(0.f) +{ +} + +BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node) +{ + llassert(node->hasName("param") && node->getChildByName("param_alpha")); + + if (!LLViewerVisualParamInfo::parseXml(node)) + return FALSE; + + LLXmlTreeNode* param_alpha_node = node->getChildByName("param_alpha"); + if (!param_alpha_node) + { + return FALSE; + } + + static LLStdStringHandle tga_file_string = LLXmlTree::addAttributeString("tga_file"); + if (param_alpha_node->getFastAttributeString(tga_file_string, mStaticImageFileName)) + { + // Don't load the image file until it's actually needed. + } +// else +// { +// llwarns << "<param_alpha> element is missing tga_file attribute." << llendl; +// } + + static LLStdStringHandle multiply_blend_string = LLXmlTree::addAttributeString("multiply_blend"); + param_alpha_node->getFastAttributeBOOL(multiply_blend_string, mMultiplyBlend); + + static LLStdStringHandle skip_if_zero_string = LLXmlTree::addAttributeString("skip_if_zero"); + param_alpha_node->getFastAttributeBOOL(skip_if_zero_string, mSkipIfZeroWeight); + + static LLStdStringHandle domain_string = LLXmlTree::addAttributeString("domain"); + param_alpha_node->getFastAttributeF32(domain_string, mDomain); + + return TRUE; +} + + + + +LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayer* layer) : + LLTexLayerParam(layer), + mAvgDistortionVec(1.f, 1.f, 1.f) +{ +} + +LLTexLayerParamColor::LLTexLayerParamColor(LLVOAvatar *avatar) : + LLTexLayerParam(avatar), + mAvgDistortionVec(1.f, 1.f, 1.f) +{ +} + +LLTexLayerParamColor::~LLTexLayerParamColor() +{ +} + +LLColor4 LLTexLayerParamColor::getNetColor() const +{ + const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo(); + + llassert(info->mNumColors >= 1); + + F32 effective_weight = (mAvatar && (mAvatar->getSex() & getSex())) ? mCurWeight : getDefaultWeight(); + + S32 index_last = info->mNumColors - 1; + F32 scaled_weight = effective_weight * index_last; + S32 index_start = (S32) scaled_weight; + S32 index_end = index_start + 1; + if (index_start == index_last) + { + return info->mColors[index_last]; + } + else + { + F32 weight = scaled_weight - index_start; + const LLColor4 *start = &info->mColors[ index_start ]; + const LLColor4 *end = &info->mColors[ index_end ]; + return LLColor4((1.f - weight) * start->mV[VX] + weight * end->mV[VX], + (1.f - weight) * start->mV[VY] + weight * end->mV[VY], + (1.f - weight) * start->mV[VZ] + weight * end->mV[VZ], + (1.f - weight) * start->mV[VW] + weight * end->mV[VW]); + } +} + +void LLTexLayerParamColor::setWeight(F32 weight, BOOL set_by_user) +{ + if (mIsAnimating) + { + return; + } + + const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo(); + F32 min_weight = getMinWeight(); + F32 max_weight = getMaxWeight(); + F32 new_weight = llclamp(weight, min_weight, max_weight); + U8 cur_u8 = F32_to_U8(mCurWeight, min_weight, max_weight); + U8 new_u8 = F32_to_U8(new_weight, min_weight, max_weight); + if (cur_u8 != new_u8) + { + mCurWeight = new_weight; + + if (info->mNumColors <= 0) + { + // This will happen when we set the default weight the first time. + return; + } + + if (mAvatar->getSex() & getSex()) + { + onGlobalColorChanged(set_by_user); + if (mTexLayer) + { + mAvatar->invalidateComposite(mTexLayer->getTexLayerSet(), set_by_user); + } + } +// llinfos << "param " << mName << " = " << new_weight << llendl; + } +} + +void LLTexLayerParamColor::setAnimationTarget(F32 target_value, BOOL set_by_user) +{ + // set value first then set interpolating flag to ignore further updates + mTargetWeight = target_value; + setWeight(target_value, set_by_user); + mIsAnimating = TRUE; + if (mNext) + { + mNext->setAnimationTarget(target_value, set_by_user); + } +} + +void LLTexLayerParamColor::animate(F32 delta, BOOL set_by_user) +{ + if (mNext) + { + mNext->animate(delta, set_by_user); + } +} + +//----------------------------------------------------------------------------- +// LLTexLayerParamColorInfo +//----------------------------------------------------------------------------- +LLTexLayerParamColorInfo::LLTexLayerParamColorInfo() : + mOperation(LLTexLayerParamColor::OP_ADD), + mNumColors(0) +{ +} + +BOOL LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node) +{ + llassert(node->hasName("param") && node->getChildByName("param_color")); + + if (!LLViewerVisualParamInfo::parseXml(node)) + return FALSE; + + LLXmlTreeNode* param_color_node = node->getChildByName("param_color"); + if (!param_color_node) + { + return FALSE; + } + + std::string op_string; + static LLStdStringHandle operation_string = LLXmlTree::addAttributeString("operation"); + if (param_color_node->getFastAttributeString(operation_string, op_string)) + { + LLStringUtil::toLower(op_string); + if (op_string == "add") mOperation = LLTexLayerParamColor::OP_ADD; + else if (op_string == "multiply") mOperation = LLTexLayerParamColor::OP_MULTIPLY; + else if (op_string == "blend") mOperation = LLTexLayerParamColor::OP_BLEND; + } + + mNumColors = 0; + + LLColor4U color4u; + for (LLXmlTreeNode* child = param_color_node->getChildByName("value"); + child; + child = param_color_node->getNextNamedChild()) + { + if ((mNumColors < MAX_COLOR_VALUES)) + { + static LLStdStringHandle color_string = LLXmlTree::addAttributeString("color"); + if (child->getFastAttributeColor4U(color_string, color4u)) + { + mColors[ mNumColors ].setVec(color4u); + mNumColors++; + } + } + } + if (!mNumColors) + { + llwarns << "<param_color> is missing <value> sub-elements" << llendl; + return FALSE; + } + + if ((mOperation == LLTexLayerParamColor::OP_BLEND) && (mNumColors != 1)) + { + llwarns << "<param_color> with operation\"blend\" must have exactly one <value>" << llendl; + return FALSE; + } + + return TRUE; +} diff --git a/indra/newview/lltexlayerparams.h b/indra/newview/lltexlayerparams.h new file mode 100644 index 0000000000000000000000000000000000000000..8c01738317412092a2f156d5c6da38cfb99cefc4 --- /dev/null +++ b/indra/newview/lltexlayerparams.h @@ -0,0 +1,180 @@ +/** + * @file lltexlayerparams.h + * @brief Texture layer parameters, used by lltexlayer. + * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * + * Copyright (c) 2002-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLTEXLAYERPARAMS_H +#define LL_LLTEXLAYERPARAMS_H + +#include "llviewervisualparam.h" + +class LLTexLayer; +class LLVOAvatar; + +class LLTexLayerParam : public LLViewerVisualParam +{ +public: + LLTexLayerParam(LLTexLayer *layer); + LLTexLayerParam(LLVOAvatar *avatar); + /* Virtual */ BOOL setInfo(LLViewerVisualParamInfo *info); +protected: + LLTexLayer* mTexLayer; + LLVOAvatar* mAvatar; +}; + +//----------------------------------------------------------------------------- +// LLTexLayerParamAlpha +// +class LLTexLayerParamAlpha : public LLTexLayerParam +{ +public: + LLTexLayerParamAlpha( LLTexLayer* layer ); + LLTexLayerParamAlpha( LLVOAvatar* avatar ); + /*virtual*/ ~LLTexLayerParamAlpha(); + + // LLVisualParam Virtual functions + ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); + /*virtual*/ void apply( ESex avatar_sex ) {} + /*virtual*/ void setWeight(F32 weight, BOOL set_by_user); + /*virtual*/ void setAnimationTarget(F32 target_value, BOOL set_by_user); + /*virtual*/ void animate(F32 delta, BOOL set_by_user); + + // LLViewerVisualParam Virtual functions + /*virtual*/ F32 getTotalDistortion() { return 1.f; } + /*virtual*/ const LLVector3& getAvgDistortion() { return mAvgDistortionVec; } + /*virtual*/ F32 getMaxDistortion() { return 3.f; } + /*virtual*/ LLVector3 getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { return LLVector3(1.f, 1.f, 1.f);} + /*virtual*/ const LLVector3* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return &mAvgDistortionVec;}; + /*virtual*/ const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return NULL;}; + + // New functions + BOOL render( S32 x, S32 y, S32 width, S32 height ); + BOOL getSkip() const; + void deleteCaches(); + BOOL getMultiplyBlend() const; + +private: + LLPointer<LLImageGL> mCachedProcessedImageGL; + LLPointer<LLImageTGA> mStaticImageTGA; + LLPointer<LLImageRaw> mStaticImageRaw; + BOOL mNeedsCreateTexture; + BOOL mStaticImageInvalid; + LLVector3 mAvgDistortionVec; + F32 mCachedEffectiveWeight; + +public: + // Global list of instances for gathering statistics + static void dumpCacheByteCount(); + static void getCacheByteCount( S32* gl_bytes ); + + typedef std::list< LLTexLayerParamAlpha* > param_alpha_ptr_list_t; + static param_alpha_ptr_list_t sInstances; +}; +class LLTexLayerParamAlphaInfo : public LLViewerVisualParamInfo +{ + friend class LLTexLayerParamAlpha; +public: + LLTexLayerParamAlphaInfo(); + /*virtual*/ ~LLTexLayerParamAlphaInfo() {}; + + /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); + +private: + std::string mStaticImageFileName; + BOOL mMultiplyBlend; + BOOL mSkipIfZeroWeight; + F32 mDomain; +}; +// +// LLTexLayerParamAlpha +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// LLTexLayerParamColor +// +class LLTexLayerParamColor : public LLTexLayerParam +{ +public: + enum EColorOperation + { + OP_ADD = 0, + OP_MULTIPLY = 1, + OP_BLEND = 2, + OP_COUNT = 3 // Number of operations + }; + + LLTexLayerParamColor( LLTexLayer* layer ); + LLTexLayerParamColor( LLVOAvatar* avatar ); + /* virtual */ ~LLTexLayerParamColor(); + + // LLVisualParam Virtual functions + ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); + /*virtual*/ void apply( ESex avatar_sex ) {} + /*virtual*/ void setWeight(F32 weight, BOOL set_by_user); + /*virtual*/ void setAnimationTarget(F32 target_value, BOOL set_by_user); + /*virtual*/ void animate(F32 delta, BOOL set_by_user); + + + // LLViewerVisualParam Virtual functions + /*virtual*/ F32 getTotalDistortion() { return 1.f; } + /*virtual*/ const LLVector3& getAvgDistortion() { return mAvgDistortionVec; } + /*virtual*/ F32 getMaxDistortion() { return 3.f; } + /*virtual*/ LLVector3 getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { return LLVector3(1.f, 1.f, 1.f); } + /*virtual*/ const LLVector3* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return &mAvgDistortionVec;}; + /*virtual*/ const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return NULL;}; + + // New functions + LLColor4 getNetColor() const; +protected: + virtual void onGlobalColorChanged(bool set_by_user) {} +private: + LLVector3 mAvgDistortionVec; +}; + +class LLTexLayerParamColorInfo : public LLViewerVisualParamInfo +{ + friend class LLTexLayerParamColor; + +public: + LLTexLayerParamColorInfo(); + virtual ~LLTexLayerParamColorInfo() {}; + BOOL parseXml( LLXmlTreeNode* node ); + LLTexLayerParamColor::EColorOperation getOperation() const { return mOperation; } +private: + enum { MAX_COLOR_VALUES = 20 }; + LLTexLayerParamColor::EColorOperation mOperation; + LLColor4 mColors[MAX_COLOR_VALUES]; + S32 mNumColors; +}; + +// +// LLTexLayerParamColor +//----------------------------------------------------------------------------- + +#endif diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index a3966ed6666583037e103412967639b0ec21da19..1b249d75d15320c454ffd63d50059100c5cb0ed1 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -946,7 +946,7 @@ std::string LLTextureCache::getLocalFileName(const LLUUID& id) // Does not include extension std::string idstr = id.asString(); // TODO: should we be storing cached textures in skin directory? - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "default", "textures", idstr); + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_LOCAL_ASSETS, idstr); return filename; } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index dc34c5ad37ed9c47547a878f218eb37839469a91..3c9290aceab3f80fec26107045603f228f0a2201 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -59,6 +59,7 @@ #include "llscrollcontainer.h" #include "lltoolmgr.h" #include "lltoolpipette.h" +#include "llsearcheditor.h" #include "lltool.h" #include "llviewerwindow.h" @@ -69,26 +70,9 @@ #include "lltrans.h" -static const S32 CLOSE_BTN_WIDTH = 100; -const S32 PIPETTE_BTN_WIDTH = 32; static const S32 HPAD = 4; static const S32 VPAD = 4; static const S32 LINE = 16; -static const S32 SMALL_BTN_WIDTH = 64; -static const S32 TEX_PICKER_MIN_WIDTH = - (HPAD + - CLOSE_BTN_WIDTH + - HPAD + - CLOSE_BTN_WIDTH + - HPAD + - SMALL_BTN_WIDTH + - HPAD + - SMALL_BTN_WIDTH + - HPAD + - 30 + - RESIZE_HANDLE_WIDTH * 2); -static const S32 CLEAR_BTN_WIDTH = 50; -static const S32 TEX_PICKER_MIN_HEIGHT = 290; static const S32 FOOTER_HEIGHT = 100; static const S32 BORDER_PAD = HPAD; static const S32 TEXTURE_INVENTORY_PADDING = 30; @@ -108,7 +92,6 @@ class LLFloaterTexturePicker : public LLFloater public: LLFloaterTexturePicker( LLTextureCtrl* owner, - const LLRect& rect, const std::string& label, PermissionMask immediate_filter_perm_mask, PermissionMask non_immediate_filter_perm_mask, @@ -136,8 +119,6 @@ public: const LLUUID& findItemID(const LLUUID& asset_id, BOOL copyable_only); void setCanApplyImmediately(BOOL b); - void setDirty( BOOL b ) { mIsDirty = b; } - BOOL isDirty() const { return mIsDirty; } void setActive( BOOL active ); LLTextureCtrl* getOwner() const { return mOwner; } @@ -147,20 +128,21 @@ public: PermissionMask getFilterPermMask(); void updateFilterPermMask(); void commitIfImmediateSet(); - + + void onSearchEdit(const std::string& search_string ); + static void onBtnSetToDefault( void* userdata ); static void onBtnSelect( void* userdata ); static void onBtnCancel( void* userdata ); - static void onBtnPipette( void* userdata ); + void onBtnPipette( ); //static void onBtnRevert( void* userdata ); static void onBtnWhite( void* userdata ); static void onBtnNone( void* userdata ); static void onBtnClear( void* userdata ); - static void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data); + void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); static void onShowFolders(LLUICtrl* ctrl, void* userdata); static void onApplyImmediateCheck(LLUICtrl* ctrl, void* userdata); - static void onSearchEdit(const std::string& search_string, void* user_data ); - static void onTextureSelect( const LLTextureEntry& te, void *data ); + void onTextureSelect( const LLTextureEntry& te ); protected: LLPointer<LLViewerImage> mTexturep; @@ -179,7 +161,6 @@ protected: LLTextBox* mResolutionLabel; std::string mPendingName; - BOOL mIsDirty; BOOL mActive; LLSearchEditor* mSearchEdit; @@ -194,18 +175,12 @@ protected: LLFloaterTexturePicker::LLFloaterTexturePicker( LLTextureCtrl* owner, - const LLRect& rect, const std::string& label, PermissionMask immediate_filter_perm_mask, PermissionMask non_immediate_filter_perm_mask, BOOL can_apply_immediately, const std::string& fallback_image_name) - : - LLFloater( std::string("texture picker"), - rect, - std::string( "Pick: " ) + label, - TRUE, - TEX_PICKER_MIN_WIDTH, TEX_PICKER_MIN_HEIGHT ), +: LLFloater(), mOwner( owner ), mImageAssetID( owner->getImageAssetID() ), mFallbackImageName( fallback_image_name ), @@ -214,78 +189,15 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mLabel(label), mTentativeLabel(NULL), mResolutionLabel(NULL), - mIsDirty( FALSE ), mActive( TRUE ), mSearchEdit(NULL), mImmediateFilterPermMask(immediate_filter_perm_mask), mNonImmediateFilterPermMask(non_immediate_filter_perm_mask), mContextConeOpacity(0.f) { - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_texture_ctrl.xml"); - - mTentativeLabel = getChild<LLTextBox>("Multiple"); - - mResolutionLabel = getChild<LLTextBox>("unknown"); - - - childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this); - childSetAction("None", LLFloaterTexturePicker::onBtnNone,this); - childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this); - - - childSetCommitCallback("show_folders_check", onShowFolders, this); - childSetVisible("show_folders_check", FALSE); - - mSearchEdit = getChild<LLSearchEditor>("inventory search editor"); - mSearchEdit->setSearchCallback(onSearchEdit, this); - - mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); - - if(mInventoryPanel) - { - U32 filter_types = 0x0; - filter_types |= 0x1 << LLInventoryType::IT_TEXTURE; - filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT; - - mInventoryPanel->setFilterTypes(filter_types); - //mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss. - mInventoryPanel->setFilterPermMask(immediate_filter_perm_mask); - mInventoryPanel->setSelectCallback(onSelectionChange, this); - mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mInventoryPanel->setAllowMultiSelect(FALSE); - - // store this filter as the default one - mInventoryPanel->getRootFolder()->getFilter()->markDefault(); - - // Commented out to stop opening all folders with textures - // mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_TEXTURE); - - // don't put keyboard focus on selected item, because the selection callback - // will assume that this was user input - mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); - } - mCanApplyImmediately = can_apply_immediately; - mNoCopyTextureSelected = FALSE; - - childSetValue("apply_immediate_check", gSavedSettings.getBOOL("ApplyTextureImmediately")); - childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this); - - if (!can_apply_immediately) - { - childSetEnabled("show_folders_check", FALSE); - } - - childSetAction("Pipette", LLFloaterTexturePicker::onBtnPipette,this); - childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this); - childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this); - - // update permission filter once UI is fully initialized - updateFilterPermMask(); - + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_texture_ctrl.xml"); setCanMinimize(FALSE); - - mSavedFolderState.setApply(FALSE); } LLFloaterTexturePicker::~LLFloaterTexturePicker() @@ -297,7 +209,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id) if( mImageAssetID != image_id && mActive) { mNoCopyTextureSelected = FALSE; - mIsDirty = TRUE; + mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? mImageAssetID = image_id; LLUUID item_id = findItemID(mImageAssetID, FALSE); if (item_id.isNull()) @@ -360,6 +272,10 @@ void LLFloaterTexturePicker::updateImageStats() mResolutionLabel->setTextArg("[DIMENSIONS]", std::string("[? x ?]")); } } + else + { + mResolutionLabel->setTextArg("[DIMENSIONS]", std::string("")); + } } // virtual @@ -435,7 +351,7 @@ BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask) root_folder->scrollToShowSelection(); // move focus to inventory proper - root_folder->setFocus(TRUE); + mInventoryPanel->setFocus(TRUE); // treat this as a user selection of the first filtered result commitIfImmediateSet(); @@ -443,7 +359,7 @@ BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask) return TRUE; } - if (root_folder->hasFocus() && key == KEY_UP) + if (mInventoryPanel->hasFocus() && key == KEY_UP) { mSearchEdit->focusFirstItem(TRUE); } @@ -474,13 +390,76 @@ BOOL LLFloaterTexturePicker::postBuild() setTitle(pick + mLabel); } + mTentativeLabel = getChild<LLTextBox>("Multiple"); + + mResolutionLabel = getChild<LLTextBox>("unknown"); + + + childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this); + childSetAction("None", LLFloaterTexturePicker::onBtnNone,this); + childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this); + + + childSetCommitCallback("show_folders_check", onShowFolders, this); + childSetVisible("show_folders_check", FALSE); + + mSearchEdit = getChild<LLSearchEditor>("inventory search editor"); + mSearchEdit->setSearchCallback(boost::bind(&LLFloaterTexturePicker::onSearchEdit, this, _1)); + + mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); + + if(mInventoryPanel) + { + U32 filter_types = 0x0; + filter_types |= 0x1 << LLInventoryType::IT_TEXTURE; + filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT; + + mInventoryPanel->setFilterTypes(filter_types); + //mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss. + mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask); + mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); + mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + mInventoryPanel->setAllowMultiSelect(FALSE); + + // store this filter as the default one + mInventoryPanel->getRootFolder()->getFilter()->markDefault(); + + // Commented out to stop opening all folders with textures + // mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_TEXTURE); + + // don't put keyboard focus on selected item, because the selection callback + // will assume that this was user input + mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); + } + + + mNoCopyTextureSelected = FALSE; + + childSetValue("apply_immediate_check", gSavedSettings.getBOOL("ApplyTextureImmediately")); + childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this); + + if (!mCanApplyImmediately) + { + childSetEnabled("show_folders_check", FALSE); + } + + getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this)); + childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this); + childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this); + // update permission filter once UI is fully initialized + updateFilterPermMask(); + mSavedFolderState.setApply(FALSE); + + LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1)); + return TRUE; } // virtual void LLFloaterTexturePicker::draw() { + static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); if (mOwner) { // draw cone of context pointing back to texture swatch @@ -579,9 +558,9 @@ void LLFloaterTexturePicker::draw() // Border LLRect border( BORDER_PAD, - getRect().getHeight() - LLFLOATER_HEADER_SIZE - BORDER_PAD, - ((TEX_PICKER_MIN_WIDTH / 2) - TEXTURE_INVENTORY_PADDING - HPAD) - BORDER_PAD, - BORDER_PAD + FOOTER_HEIGHT + (getRect().getHeight() - TEX_PICKER_MIN_HEIGHT)); + getRect().getHeight() - floater_header_size - BORDER_PAD, + ((getMinWidth() / 2) - TEXTURE_INVENTORY_PADDING - HPAD) - BORDER_PAD, + BORDER_PAD + FOOTER_HEIGHT + (getRect().getHeight() - getMinHeight())); gl_rect_2d( border, LLColor4::black, FALSE ); @@ -602,7 +581,7 @@ void LLFloaterTexturePicker::draw() mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) ); // Draw Tentative Label over the image - if( mOwner->getTentative() && !mIsDirty ) + if( mOwner->getTentative() && !mViewModel->isDirty() ) { mTentativeLabel->setVisible( TRUE ); drawChild(mTentativeLabel); @@ -719,7 +698,7 @@ void LLFloaterTexturePicker::onBtnRevert(void* userdata) // TODO: Change this to tell the owner to cancel. It needs to be // smart enough to restore multi-texture selections. self->mOwner->onFloaterCommit(); - self->mIsDirty = FALSE; + self->mViewModel->resetDirty(); }*/ // static @@ -731,8 +710,8 @@ void LLFloaterTexturePicker::onBtnCancel(void* userdata) { self->mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CANCEL); } - self->mIsDirty = FALSE; - self->close(); + self->mViewModel->resetDirty(); + self->closeFloater(); } // static @@ -743,52 +722,42 @@ void LLFloaterTexturePicker::onBtnSelect(void* userdata) { self->mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_SELECT); } - self->close(); + self->closeFloater(); } -// static -void LLFloaterTexturePicker::onBtnPipette( void* userdata ) +void LLFloaterTexturePicker::onBtnPipette() { - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - - if ( self) + BOOL pipette_active = childGetValue("Pipette").asBoolean(); + pipette_active = !pipette_active; + if (pipette_active) { - BOOL pipette_active = self->childGetValue("Pipette").asBoolean(); - pipette_active = !pipette_active; - if (pipette_active) - { - LLToolPipette::getInstance()->setSelectCallback(onTextureSelect, self); - LLToolMgr::getInstance()->setTransientTool(LLToolPipette::getInstance()); - } - else - { - LLToolMgr::getInstance()->clearTransientTool(); - } + LLToolMgr::getInstance()->setTransientTool(LLToolPipette::getInstance()); + } + else + { + LLToolMgr::getInstance()->clearTransientTool(); } - } -// static -void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data) +void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action) { - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*)data; if (items.size()) { LLFolderViewItem* first_item = items.front(); LLInventoryItem* itemp = gInventory.getItem(first_item->getListener()->getUUID()); - self->mNoCopyTextureSelected = FALSE; + mNoCopyTextureSelected = FALSE; if (itemp) { if (!itemp->getPermissions().allowCopyBy(gAgent.getID())) { - self->mNoCopyTextureSelected = TRUE; + mNoCopyTextureSelected = TRUE; } - self->mImageAssetID = itemp->getAssetUUID(); - self->mIsDirty = TRUE; + mImageAssetID = itemp->getAssetUUID(); + mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? if (user_action) { // only commit intentional selections, not implicit ones - self->commitIfImmediateSet(); + commitIfImmediateSet(); } } } @@ -827,107 +796,97 @@ void LLFloaterTexturePicker::updateFilterPermMask() //mInventoryPanel->setFilterPermMask( getFilterPermMask() ); Commented out due to no-copy texture loss. } -void LLFloaterTexturePicker::onSearchEdit(const std::string& search_string, void* user_data ) +void LLFloaterTexturePicker::onSearchEdit(const std::string& search_string ) { - LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data; - std::string upper_case_search_string = search_string; LLStringUtil::toUpper(upper_case_search_string); if (upper_case_search_string.empty()) { - if (picker->mInventoryPanel->getFilterSubString().empty()) + if (mInventoryPanel->getFilterSubString().empty()) { // current filter and new filter empty, do nothing return; } - picker->mSavedFolderState.setApply(TRUE); - picker->mInventoryPanel->getRootFolder()->applyFunctorRecursively(picker->mSavedFolderState); + mSavedFolderState.setApply(TRUE); + mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState); // add folder with current item to list of previously opened folders LLOpenFoldersWithSelection opener; - picker->mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener); - picker->mInventoryPanel->getRootFolder()->scrollToShowSelection(); + mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener); + mInventoryPanel->getRootFolder()->scrollToShowSelection(); } - else if (picker->mInventoryPanel->getFilterSubString().empty()) + else if (mInventoryPanel->getFilterSubString().empty()) { // first letter in search term, save existing folder open state - if (!picker->mInventoryPanel->getRootFolder()->isFilterModified()) + if (!mInventoryPanel->getRootFolder()->isFilterModified()) { - picker->mSavedFolderState.setApply(FALSE); - picker->mInventoryPanel->getRootFolder()->applyFunctorRecursively(picker->mSavedFolderState); + mSavedFolderState.setApply(FALSE); + mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState); } } - picker->mInventoryPanel->setFilterSubString(upper_case_search_string); + mInventoryPanel->setFilterSubString(upper_case_search_string); } -//static -void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te, void *data ) +void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) { - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*)data; - - LLUUID inventory_item_id = self->findItemID(te.getID(), TRUE); - if (self && inventory_item_id.notNull()) + LLUUID inventory_item_id = findItemID(te.getID(), TRUE); + if (inventory_item_id.notNull()) { LLToolPipette::getInstance()->setResult(TRUE, ""); - self->setImageID(te.getID()); + setImageID(te.getID()); - self->mNoCopyTextureSelected = FALSE; + mNoCopyTextureSelected = FALSE; LLInventoryItem* itemp = gInventory.getItem(inventory_item_id); if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) { // no copy texture - self->mNoCopyTextureSelected = TRUE; + mNoCopyTextureSelected = TRUE; } - self->commitIfImmediateSet(); + commitIfImmediateSet(); } else { - LLToolPipette::getInstance()->setResult(FALSE, "You do not have a copy this \nof texture in your inventory"); + LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture")); } } /////////////////////////////////////////////////////////////////////// // LLTextureCtrl -static LLRegisterWidget<LLTextureCtrl> r("texture_picker"); +static LLDefaultWidgetRegistry::Register<LLTextureCtrl> r("texture_picker"); -LLTextureCtrl::LLTextureCtrl( - const std::string& name, - const LLRect &rect, - const std::string& label, - const LLUUID &image_id, - const LLUUID &default_image_id, - const std::string& default_image_name ) - : - LLUICtrl(name, rect, TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), +LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) +: LLUICtrl(p), mDragCallback(NULL), mDropCallback(NULL), mOnCancelCallback(NULL), mOnSelectCallback(NULL), - mBorderColor( gColors.getColor("DefaultHighlightLight") ), - mImageAssetID( image_id ), - mDefaultImageAssetID( default_image_id ), - mDefaultImageName( default_image_name ), - mLabel( label ), + mBorderColor( p.border_color() ), mAllowNoTexture( FALSE ), mImmediateFilterPermMask( PERM_NONE ), mNonImmediateFilterPermMask( PERM_NONE ), mCanApplyImmediately( FALSE ), mNeedsRawImageData( FALSE ), mValid( TRUE ), - mDirty( FALSE ), - mShowLoadingPlaceholder( TRUE ) + mShowLoadingPlaceholder( TRUE ), + mImageAssetID(p.image_id), + mDefaultImageAssetID(p.default_image_id), + mDefaultImageName(p.default_image_name) { - mCaption = new LLTextBox( label, - LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 ), - label, - LLFontGL::getFontSansSerifSmall() ); - mCaption->setFollows( FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM ); + setAllowNoTexture(p.allow_no_texture); + setCanApplyImmediately(p.can_apply_immediately); + + LLTextBox::Params params(p.caption_text); + params.name(p.label); + params.rect(LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 )); + params.text(p.label); + params.follows.flags(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM); + mCaption = LLUICtrlFactory::create<LLTextBox> (params); addChild( mCaption ); S32 image_top = getRect().getHeight(); @@ -935,92 +894,27 @@ LLTextureCtrl::LLTextureCtrl( S32 image_middle = (image_top + image_bottom) / 2; S32 line_height = llround(LLFontGL::getFontSansSerifSmall()->getLineHeight()); - mTentativeLabel = new LLTextBox( std::string("Multiple"), - LLRect( - 0, image_middle + line_height / 2, - getRect().getWidth(), image_middle - line_height / 2 ), - std::string("Multiple"), - LLFontGL::getFontSansSerifSmall() ); - mTentativeLabel->setHAlign( LLFontGL::HCENTER ); - mTentativeLabel->setFollowsAll(); + LLTextBox::Params tentative_label_p(p.multiselect_text); + tentative_label_p.name("Multiple"); + tentative_label_p.rect(LLRect (0, image_middle + line_height / 2, getRect().getWidth(), image_middle - line_height / 2 )); + tentative_label_p.follows.flags(FOLLOWS_ALL); + mTentativeLabel = LLUICtrlFactory::create<LLTextBox> (tentative_label_p); addChild( mTentativeLabel ); - LLRect border_rect(0, getRect().getHeight(), getRect().getWidth(), 0); + LLRect border_rect = getLocalRect(); border_rect.mBottom += BTN_HEIGHT_SMALL; - mBorder = new LLViewBorder(std::string("border"), border_rect, LLViewBorder::BEVEL_IN); - mBorder->setFollowsAll(); + LLViewBorder::Params vbparams(p.border); + vbparams.name("border"); + vbparams.rect(border_rect); + mBorder = LLUICtrlFactory::create<LLViewBorder> (vbparams); addChild(mBorder); - setEnabled(TRUE); // for the tooltip mLoadingPlaceholderString = LLTrans::getString("texture_loading"); } - LLTextureCtrl::~LLTextureCtrl() { - closeFloater(); -} - -// virtual -LLXMLNodePtr LLTextureCtrl::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLUICtrl::getXML(); - - node->createChild("label", TRUE)->setStringValue(getLabel()); - - node->createChild("default_image_name", TRUE)->setStringValue(getDefaultImageName()); - - node->createChild("allow_no_texture", TRUE)->setBoolValue(mAllowNoTexture); - - node->createChild("can_apply_immediately", TRUE)->setBoolValue(mCanApplyImmediately ); - - return node; -} - -LLView* LLTextureCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("texture_picker"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent); - - std::string label; - node->getAttributeString("label", label); - - std::string image_id(""); - node->getAttributeString("image", image_id); - - std::string default_image_id(""); - node->getAttributeString("default_image", default_image_id); - - std::string default_image_name("Default"); - node->getAttributeString("default_image_name", default_image_name); - - BOOL allow_no_texture = FALSE; - node->getAttributeBOOL("allow_no_texture", allow_no_texture); - - BOOL can_apply_immediately = FALSE; - node->getAttributeBOOL("can_apply_immediately", can_apply_immediately); - - if (label.empty()) - { - label.assign(node->getValue()); - } - - LLTextureCtrl* texture_picker = new LLTextureCtrl( - name, - rect, - label, - LLUUID(image_id), - LLUUID(default_image_id), - default_image_name ); - texture_picker->setAllowNoTexture(allow_no_texture); - texture_picker->setCanApplyImmediately(can_apply_immediately); - - texture_picker->initFromXML(node, parent); - - return texture_picker; + closeDependentFloater(); } void LLTextureCtrl::setShowLoadingPlaceholder(BOOL showLoadingPlaceholder) @@ -1047,7 +941,7 @@ void LLTextureCtrl::setVisible( BOOL visible ) { if( !visible ) { - closeFloater(); + closeDependentFloater(); } LLUICtrl::setVisible( visible ); } @@ -1066,7 +960,7 @@ void LLTextureCtrl::setEnabled( BOOL enabled ) setToolTip( std::string() ); // *TODO: would be better to keep floater open and show // disabled state. - closeFloater(); + closeDependentFloater(); } if( floaterp ) @@ -1092,18 +986,6 @@ void LLTextureCtrl::setValid(BOOL valid ) } } -// virtual -BOOL LLTextureCtrl::isDirty() const -{ - return mDirty; -} - -// virtual -void LLTextureCtrl::resetDirty() -{ - mDirty = FALSE; -} - // virtual void LLTextureCtrl::clear() @@ -1119,25 +1001,20 @@ void LLTextureCtrl::setLabel(const std::string& label) void LLTextureCtrl::showPicker(BOOL take_focus) { + // show hourglass cursor when loading inventory window + // because inventory construction is slooow + getWindow()->setCursor(UI_CURSOR_WAIT); LLFloater* floaterp = mFloaterHandle.get(); // Show the dialog if( floaterp ) { - floaterp->open( ); /* Flawfinder: ignore */ + floaterp->openFloater(); } else { - if( !mLastFloaterLeftTop.mX && !mLastFloaterLeftTop.mY ) - { - gFloaterView->getNewFloaterPosition(&mLastFloaterLeftTop.mX, &mLastFloaterLeftTop.mY); - } - LLRect rect = gSavedSettings.getRect("TexturePickerRect"); - rect.translate( mLastFloaterLeftTop.mX - rect.mLeft, mLastFloaterLeftTop.mY - rect.mTop ); - floaterp = new LLFloaterTexturePicker( this, - rect, mLabel, mImmediateFilterPermMask, mNonImmediateFilterPermMask, @@ -1146,8 +1023,10 @@ void LLTextureCtrl::showPicker(BOOL take_focus) mFloaterHandle = floaterp->getHandle(); - gFloaterView->getParentFloater(this)->addDependentFloater(floaterp); - floaterp->open(); /* Flawfinder: ignore */ + LLFloater* root_floater = gFloaterView->getParentFloater(this); + if (root_floater) + root_floater->addDependentFloater(floaterp); + floaterp->openFloater(); } if (take_focus) @@ -1157,13 +1036,13 @@ void LLTextureCtrl::showPicker(BOOL take_focus) } -void LLTextureCtrl::closeFloater() +void LLTextureCtrl::closeDependentFloater() { LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); if( floaterp ) { floaterp->setOwner(NULL); - floaterp->close(); + floaterp->closeFloater(); } } @@ -1210,7 +1089,6 @@ void LLTextureCtrl::onFloaterClose() if (floaterp) { floaterp->setOwner(NULL); - mLastFloaterLeftTop.set( floaterp->getRect().mLeft, floaterp->getRect().mTop ); } mFloaterHandle.markDead(); @@ -1222,7 +1100,11 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op) if( floaterp && getEnabled()) { - mDirty = (op != TEXTURE_CANCEL); + if (op == TEXTURE_CANCEL) + mViewModel->resetDirty(); + else + mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? + if( floaterp->isDirty() ) { setTentative( FALSE ); @@ -1232,11 +1114,11 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op) lldebugs << "mImageAssetID: " << mImageAssetID << llendl; if (op == TEXTURE_SELECT && mOnSelectCallback) { - mOnSelectCallback(this, mCallbackUserData); + mOnSelectCallback( this, LLSD() ); } else if (op == TEXTURE_CANCEL && mOnCancelCallback) { - mOnCancelCallback(this, mCallbackUserData); + mOnCancelCallback( this, LLSD() ); } else { @@ -1256,7 +1138,7 @@ void LLTextureCtrl::setImageAssetID( const LLUUID& asset_id ) if( floaterp && getEnabled() ) { floaterp->setImageID( asset_id ); - floaterp->setDirty( FALSE ); + floaterp->resetDirty(); } } } @@ -1320,7 +1202,7 @@ void LLTextureCtrl::draw() // Border LLRect border( 0, getRect().getHeight(), getRect().getWidth(), BTN_HEIGHT_SMALL ); - gl_rect_2d( border, mBorderColor, FALSE ); + gl_rect_2d( border, mBorderColor.get(), FALSE ); // Interior LLRect interior = border; @@ -1388,7 +1270,7 @@ BOOL LLTextureCtrl::allowDrop(LLInventoryItem* item) { if(mDragCallback) { - return mDragCallback(this, item, mCallbackUserData); + return mDragCallback(this, item); } else { @@ -1408,7 +1290,7 @@ BOOL LLTextureCtrl::doDrop(LLInventoryItem* item) { // if it returns TRUE, we return TRUE, and therefore the // commit is called above. - return mDropCallback(this, item, mCallbackUserData); + return mDropCallback(this, item); } // no callback installed, so just set the image ids and carry on. @@ -1438,66 +1320,6 @@ LLSD LLTextureCtrl::getValue() const } -///////////////////////////////////////////////////////////////////////////////// -// LLToolTexEyedropper - -class LLToolTexEyedropper : public LLTool -{ -public: - LLToolTexEyedropper( void (*callback)(const LLUUID& obj_id, const LLUUID& image_id, void* userdata ), void* userdata ); - virtual ~LLToolTexEyedropper(); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleHover(S32 x, S32 y, MASK mask); - -protected: - void (*mCallback)(const LLUUID& obj_id, const LLUUID& image_id, void* userdata ); - void* mCallbackUserData; -}; - - -LLToolTexEyedropper::LLToolTexEyedropper( - void (*callback)(const LLUUID& obj_id, const LLUUID& image_id, void* userdata ), - void* userdata ) - : LLTool(std::string("texeyedropper")), - mCallback( callback ), - mCallbackUserData( userdata ) -{ -} - -LLToolTexEyedropper::~LLToolTexEyedropper() -{ -} - - -BOOL LLToolTexEyedropper::handleMouseDown(S32 x, S32 y, MASK mask) -{ - // this will affect framerate on mouse down - const LLPickInfo& pick = gViewerWindow->pickImmediate(x, y, FALSE); - LLViewerObject* hit_obj = pick.getObject(); - if (hit_obj && - !hit_obj->isAvatar()) - { - if( (0 <= pick.mObjectFace) && (pick.mObjectFace < hit_obj->getNumTEs()) ) - { - LLViewerImage* image = hit_obj->getTEImage( pick.mObjectFace ); - if( image ) - { - if( mCallback ) - { - mCallback( hit_obj->getID(), image->getID(), mCallbackUserData ); - } - } - } - } - return TRUE; -} - -BOOL LLToolTexEyedropper::handleHover(S32 x, S32 y, MASK mask) -{ - lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolTexEyedropper" << llendl; - gViewerWindow->getWindow()->setCursor(UI_CURSOR_CROSS); // TODO: better cursor - return TRUE; -} diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 623f15eef5e04ec1de218280443162e11e83cad8..ebe2cd2e5f4822be5f122b36fdbbf2d962ad760c 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -39,16 +39,17 @@ #include "llstring.h" #include "lluictrl.h" #include "llpermissionsflags.h" +#include "lltextbox.h" // for params +#include "llviewborder.h" // for params class LLButton; class LLFloaterTexturePicker; class LLInventoryItem; -class LLTextBox; -class LLViewBorder; class LLViewerImage; // used for setting drag & drop callbacks. -typedef BOOL (*drag_n_drop_callback)(LLUICtrl*, LLInventoryItem*, void*); +typedef boost::function<BOOL (LLUICtrl*, LLInventoryItem*)> drag_n_drop_callback; + ////////////////////////////////////////////////////////////////////////////////////////// // LLTextureCtrl @@ -66,17 +67,45 @@ public: } ETexturePickOp; public: - LLTextureCtrl( - const std::string& name, const LLRect& rect, - const std::string& label, - const LLUUID& image_id, - const LLUUID& default_image_id, - const std::string& default_image_name ); + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<LLUUID> image_id; + Optional<LLUUID> default_image_id; + Optional<std::string> default_image_name; + Optional<bool> allow_no_texture; + Optional<bool> can_apply_immediately; + Optional<S32> label_width; + Optional<LLUIColor> border_color; + + Optional<LLTextBox::Params> multiselect_text, + caption_text; + + Optional<LLViewBorder::Params> border; + + Params() + : image_id("image"), + default_image_id("default_image"), + default_image_name("default_image_name"), + allow_no_texture("allow_no_texture"), + can_apply_immediately("can_apply_immediately"), + label_width("label_width", -1), + border_color("border_color"), + multiselect_text("multiselect_text"), + caption_text("caption_text"), + border("border") + { + name = "texture picker"; + mouse_opaque(true); + follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP); + } + }; +protected: + LLTextureCtrl(const Params&); + friend class LLUICtrlFactory; +public: virtual ~LLTextureCtrl(); // LLView interface - virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, @@ -90,9 +119,6 @@ public: virtual void setVisible( BOOL visible ); virtual void setEnabled( BOOL enabled ); - virtual BOOL isDirty() const; - virtual void resetDirty(); - void setValid(BOOL valid); // LLUICtrl interface @@ -105,6 +131,7 @@ public: // LLTextureCtrl interface void showPicker(BOOL take_focus); void setLabel(const std::string& label); + void setLabelWidth(S32 label_width) {mLabelWidth =label_width;} const std::string& getLabel() const { return mLabel; } void setAllowNoTexture( BOOL b ) { mAllowNoTexture = b; } @@ -133,7 +160,7 @@ public: PermissionMask getImmediateFilterPermMask() { return mImmediateFilterPermMask; } PermissionMask getNonImmediateFilterPermMask() { return mNonImmediateFilterPermMask; } - void closeFloater(); + void closeDependentFloater(); void onFloaterClose(); void onFloaterCommit(ETexturePickOp op); @@ -146,10 +173,10 @@ public: // the drop happened - resulting in an on commit callback, but not // necessariliy any other change. void setDropCallback(drag_n_drop_callback cb) { mDropCallback = cb; } - - void setOnCancelCallback(LLUICtrlCallback cb) { mOnCancelCallback = cb; } - void setOnSelectCallback(LLUICtrlCallback cb) { mOnSelectCallback = cb; } + void setOnCancelCallback(commit_callback_t cb) { mOnCancelCallback = cb; } + + void setOnSelectCallback(commit_callback_t cb) { mOnSelectCallback = cb; } void setShowLoadingPlaceholder(BOOL showLoadingPlaceholder); @@ -160,10 +187,10 @@ private: private: drag_n_drop_callback mDragCallback; drag_n_drop_callback mDropCallback; - LLUICtrlCallback mOnCancelCallback; - LLUICtrlCallback mOnSelectCallback; + commit_callback_t mOnCancelCallback; + commit_callback_t mOnSelectCallback; LLPointer<LLViewerImage> mTexturep; - LLColor4 mBorderColor; + LLUIColor mBorderColor; LLUUID mImageItemID; LLUUID mImageAssetID; LLUUID mDefaultImageAssetID; @@ -174,16 +201,15 @@ private: LLTextBox* mCaption; std::string mLabel; BOOL mAllowNoTexture; // If true, the user can select "none" as an option - LLCoordGL mLastFloaterLeftTop; PermissionMask mImmediateFilterPermMask; PermissionMask mNonImmediateFilterPermMask; BOOL mCanApplyImmediately; BOOL mNeedsRawImageData; LLViewBorder* mBorder; BOOL mValid; - BOOL mDirty; BOOL mShowLoadingPlaceholder; std::string mLoadingPlaceholderString; + S32 mLabelWidth; }; // XUI HACK: When floaters converted, switch this file to lltexturepicker.h/cpp diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index e9dd7921cd3e8a469461b4de1e6a7dd9deb693f0..be535761fcd680ca48b0159865bfbef10ad3c8e4 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1877,6 +1877,21 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1 } ////////////////////////////////////////////////////////////////////////////// +BOOL LLTextureFetch::isFromLocalCache(const LLUUID& id) +{ + BOOL from_cache = FALSE ; + + LLMutexLock lock(&mQueueMutex); + LLTextureFetchWorker* worker = getWorker(id); + if (worker) + { + worker->lockWorkData(); + from_cache = worker->mInLocalCache ; + worker->unlockWorkData(); + } + + return from_cache ; +} S32 LLTextureFetch::getFetchState(const LLUUID& id, F32& data_progress_p, F32& requested_priority_p, U32& fetch_priority_p, F32& fetch_dtime_p, F32& request_dtime_p) diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 56650e721c9509acb5ae3d585e2db7aed0dc87d4..282fbb648149acf5eef75f10d71320d244a1b0be 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -67,6 +67,7 @@ public: bool receiveImagePacket(const LLHost& host, const LLUUID& id, U16 packet_num, U16 data_size, U8* data); // Debug + BOOL isFromLocalCache(const LLUUID& id); S32 getFetchState(const LLUUID& id, F32& decode_progress_p, F32& requested_priority_p, U32& fetch_priority_p, F32& fetch_dtime_p, F32& request_dtime_p); void dump(); diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index f00d5e5b48d0a6dbb233516a8db4b6a0094a82ca..50b73bfbc7b3c144dcc8aebf2f6d5303735cc1cc 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -83,12 +83,20 @@ public: S32 mHilite; public: - LLTextureBar(const std::string& name, const LLRect& r, LLTextureView* texview) - : LLView(name, r, FALSE), - mHilite(0), - mTextureView(texview) + struct Params : public LLInitParam::Block<Params, LLView::Params> { - } + Mandatory<LLTextureView*> texture_view; + Params() + : texture_view("texture_view") + { + mouse_opaque(false); + } + }; + LLTextureBar(const Params& p) + : LLView(p), + mHilite(0), + mTextureView(p.texture_view) + {} virtual void draw(); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); @@ -366,13 +374,21 @@ LLRect LLTextureBar::getRequiredRect() class LLGLTexMemBar : public LLView { public: - LLGLTexMemBar(const std::string& name, LLTextureView* texview) - : LLView(name, FALSE), - mTextureView(texview) + struct Params : public LLInitParam::Block<Params, LLView::Params> { - S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f); - setRect(LLRect(0,0,100,line_height * 4)); - } + Mandatory<LLTextureView*> texture_view; + Params() + : texture_view("texture_view") + { + S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f); + rect(LLRect(0,0,100,line_height * 4)); + } + }; + + LLGLTexMemBar(const Params& p) + : LLView(p), + mTextureView(p.texture_view) + {} virtual void draw(); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); @@ -384,10 +400,10 @@ private: void LLGLTexMemBar::draw() { - S32 bound_mem = (LLViewerImage::sBoundTextureMemory >> 20); - S32 max_bound_mem = LLViewerImage::sMaxBoundTextureMem; - S32 total_mem = (LLViewerImage::sTotalTextureMemory >> 20); - S32 max_total_mem = LLViewerImage::sMaxTotalTextureMem; + S32 bound_mem = BYTES_TO_MEGA_BYTES(LLViewerImage::sBoundTextureMemoryInBytes); + S32 max_bound_mem = LLViewerImage::sMaxBoundTextureMemInMegaBytes; + S32 total_mem = BYTES_TO_MEGA_BYTES(LLViewerImage::sTotalTextureMemoryInBytes); + S32 max_total_mem = LLViewerImage::sMaxTotalTextureMemInMegaBytes; F32 discard_bias = LLViewerImage::sDesiredDiscardBias; S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f); @@ -521,8 +537,8 @@ LLRect LLGLTexMemBar::getRequiredRect() //////////////////////////////////////////////////////////////////////////// -LLTextureView::LLTextureView(const std::string& name, const LLRect& rect) - : LLContainerView(name, rect), +LLTextureView::LLTextureView(const LLTextureView::Params& p) + : LLContainerView(p), mFreezeView(FALSE), mOrderFetch(FALSE), mPrintList(FALSE), @@ -709,7 +725,10 @@ void LLTextureView::draw() else sortChildren(LLTextureBar::sort()); - mGLTexMemBar = new LLGLTexMemBar("gl texmem bar", this); + LLGLTexMemBar::Params tmbp; + tmbp.name("gl texmem bar"); + tmbp.texture_view(this); + mGLTexMemBar = LLUICtrlFactory::create<LLGLTexMemBar>(tmbp); addChild(mGLTexMemBar); reshape(getRect().getWidth(), getRect().getHeight(), TRUE); @@ -746,7 +765,11 @@ BOOL LLTextureView::addBar(LLViewerImage *imagep, S32 hilite) mNumTextureBars++; - barp = new LLTextureBar("texture bar", r, this); + LLTextureBar::Params tbp; + tbp.name("texture bar"); + tbp.rect(r); + tbp.texture_view(this); + barp = LLUICtrlFactory::create<LLTextureBar>(tbp); barp->mImagep = imagep; barp->mHilite = hilite; diff --git a/indra/newview/lltextureview.h b/indra/newview/lltextureview.h index f91a296b971a33524cb491d919ad6d5cf4372b88..99b6db9662d0e7e67eefa23ad00b22dffdba8cd3 100644 --- a/indra/newview/lltextureview.h +++ b/indra/newview/lltextureview.h @@ -43,8 +43,10 @@ class LLTextureView : public LLContainerView { friend class LLTextureBar; friend class LLGLTexMemBar; +protected: + LLTextureView(const Params&); + friend class LLUICtrlFactory; public: - LLTextureView(const std::string& name, const LLRect& rect); ~LLTextureView(); /*virtual*/ void draw(); diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index 6a3ada0474e7254108eaa9478bdbf6115faf0203..7b058e9efa2b431e1f5f7181267f047a0be81cb0 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -91,7 +91,7 @@ BOOL LLTool::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLTool::handleHover(S32 x, S32 y, MASK mask) { - gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); + gViewerWindow->setCursor(UI_CURSOR_ARROW); lldebugst(LLERR_USER_INPUT) << "hover handled by a tool" << llendl; // by default, do nothing, say we handled it return TRUE; diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index 33edb3ef27f304accd81df82bffd7b2aa3b7b412..d27958c2ac03510eab68e8adb961b804393588cb 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -36,18 +36,21 @@ #include "lltoolbar.h" #include "imageids.h" +#include "llfloaterreg.h" #include "llfontgl.h" +#include "llflyoutbutton.h" #include "llrect.h" #include "llparcel.h" #include "llagent.h" +#include "llagentwearables.h" #include "llbutton.h" #include "llfocusmgr.h" #include "llviewercontrol.h" #include "llmenucommands.h" #include "llimview.h" #include "lluiconstants.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "lltooldraganddrop.h" #include "llinventoryview.h" #include "llfloaterchatterbox.h" @@ -57,6 +60,9 @@ #include "llui.h" #include "llviewermenu.h" #include "llfirstuse.h" +#include "llscrolllistctrl.h" +#include "llscrolllistitem.h" +#include "llscrolllistcell.h" #include "llviewerparcelmgr.h" #include "lluictrlfactory.h" #include "llviewerwindow.h" @@ -65,29 +71,12 @@ #include "llfloaterchat.h" #include "llfloatermute.h" #include "llimpanel.h" -#include "llscrolllistctrl.h" +#include "lllayoutstack.h" #if LL_DARWIN #include "llresizehandle.h" - // This class draws like an LLResizeHandle but has no interactivity. - // It's just there to provide a cue to the user that the lower right corner of the window functions as a resize handle. - class LLFakeResizeHandle : public LLResizeHandle - { - public: - LLFakeResizeHandle(const std::string& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner = RIGHT_BOTTOM ) - : LLResizeHandle(name, rect, min_width, min_height, corner ) - { - - } - - virtual BOOL handleHover(S32 x, S32 y, MASK mask) { return FALSE; }; - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; }; - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask) { return FALSE; }; - - }; - #endif // LL_DARWIN // @@ -95,7 +84,6 @@ // LLToolBar *gToolBar = NULL; -S32 TOOL_BAR_HEIGHT = 20; // // Statics @@ -114,44 +102,13 @@ LLToolBar::LLToolBar() { setIsChrome(TRUE); setFocusRoot(TRUE); + + mCommitCallbackRegistrar.add("HandleCommunicate", &LLToolBar::onClickCommunicate); } BOOL LLToolBar::postBuild() { - childSetCommitCallback("communicate_btn", onClickCommunicate, this); - childSetControlName("communicate_btn", "ShowCommunicate"); - - childSetAction("chat_btn", onClickChat, this); - childSetControlName("chat_btn", "ChatVisible"); - - childSetAction("appearance_btn", onClickAppearance, this); - childSetControlName("appearance_btn", ""); - - childSetAction("fly_btn", onClickFly, this); - childSetControlName("fly_btn", "FlyBtnState"); - - childSetAction("sit_btn", onClickSit, this); - childSetControlName("sit_btn", "SitBtnState"); - - childSetAction("snapshot_btn", onClickSnapshot, this); - childSetControlName("snapshot_btn", ""); - - childSetAction("directory_btn", onClickDirectory, this); - childSetControlName("directory_btn", "ShowDirectory"); - - childSetAction("build_btn", onClickBuild, this); - childSetControlName("build_btn", "BuildBtnState"); - - childSetAction("radar_btn", onClickRadar, this); - childSetControlName("radar_btn", "ShowMiniMap"); - - childSetAction("map_btn", onClickMap, this); - childSetControlName("map_btn", "ShowWorldMap"); - - childSetAction("inventory_btn", onClickInventory, this); - childSetControlName("inventory_btn", "ShowInventory"); - for (child_list_const_iter_t child_iter = getChildList()->begin(); child_iter != getChildList()->end(); ++child_iter) { @@ -167,8 +124,14 @@ BOOL LLToolBar::postBuild() if(mResizeHandle == NULL) { LLRect rect(0, 0, RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT); - mResizeHandle = new LLFakeResizeHandle(std::string(""), rect, RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT); - this->addChildAtEnd(mResizeHandle); + LLResizeHandle::Params p; + p.name(""); + p.rect(rect); + p.min_width(RESIZE_HANDLE_WIDTH); + p.min_height(RESIZE_HANDLE_HEIGHT); + p.enabled(false); + mResizeHandle = LLUICtrlFactory::create<LLResizeHandle>(p); + addChildInBack(mResizeHandle); LLLayoutStack* toolbar_stack = getChild<LLLayoutStack>("toolbar_stack"); toolbar_stack->reshape(toolbar_stack->getRect().getWidth() - RESIZE_HANDLE_WIDTH, toolbar_stack->getRect().getHeight()); } @@ -196,11 +159,14 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, LLInventoryView* active_inventory = LLInventoryView::getActiveInventory(); + LLRect button_screen_rect; + inventory_btn->localRectToScreen(inventory_btn->getRect(),&button_screen_rect); + if(active_inventory && active_inventory->getVisible()) { mInventoryAutoOpen = FALSE; } - else if (inventory_btn->getRect().pointInRect(x, y)) + else if (button_screen_rect.pointInRect(x, y)) { if (mInventoryAutoOpen) { @@ -290,18 +256,34 @@ void LLToolBar::refresh() sitting = gAgent.getAvatarObject()->mIsSitting; } - childSetEnabled("fly_btn", (gAgent.canFly() || gAgent.getFlying()) && !sitting ); - - childSetEnabled("build_btn", LLViewerParcelMgr::getInstance()->agentCanBuild() ); + if (!gAgent.canFly()) + { + gSavedSettings.setBOOL("FlyBtnEnabled", gAgent.getFlying() ? true : false); + gSavedSettings.setBOOL("FlyBtnState", false); + } + else + { + gSavedSettings.setBOOL("FlyBtnEnabled", sitting ? false : true); + } // Check to see if we're in build mode - BOOL build_mode = LLToolMgr::getInstance()->inEdit(); - // And not just clicking on a scripted object - if (LLToolGrab::getInstance()->getHideBuildHighlight()) + bool build_enabled = LLToolMgr::getInstance()->canEdit(); + if (build_enabled) + { + gSavedSettings.setBOOL("BuildBtnEnabled", true); + bool build_mode = LLToolMgr::getInstance()->inEdit(); + // HACK: Not in mouselook and not just clicking on a scripted object + if (gAgent.cameraMouselook() || LLToolGrab::getInstance()->getHideBuildHighlight()) { build_mode = FALSE; } gSavedSettings.setBOOL("BuildBtnState", build_mode); + } + else + { + gSavedSettings.setBOOL("BuildBtnEnabled", false); + gSavedSettings.setBOOL("BuildBtnState", false); + } if (isInVisibleChain()) { @@ -319,29 +301,38 @@ void LLToolBar::updateCommunicateList() LLFloater* frontmost_floater = LLFloaterChatterBox::getInstance()->getActiveFloater(); LLScrollListItem* itemp = NULL; - itemp = communicate_button->add(LLFloaterMyFriends::getInstance()->getShortTitle(), LLSD("contacts"), ADD_TOP); + LLSD contact_sd; + contact_sd["value"] = "contacts"; + contact_sd["columns"][0]["value"] = LLFloaterMyFriends::getInstance()->getShortTitle(); if (LLFloaterMyFriends::getInstance() == frontmost_floater) { - ((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD); + contact_sd["columns"][0]["font"]["style"] = "BOLD"; // make sure current tab is selected in list if (selected.isUndefined()) { - selected = itemp->getValue(); + selected = "contacts"; } } - itemp = communicate_button->add(LLFloaterChat::getInstance()->getShortTitle(), LLSD("local chat"), ADD_TOP); + itemp = communicate_button->addElement(contact_sd, ADD_TOP); + + LLSD communicate_sd; + communicate_sd["value"] = "local chat"; + communicate_sd["columns"][0]["value"] = LLFloaterChat::getInstance()->getShortTitle(); + if (LLFloaterChat::getInstance() == frontmost_floater) { - ((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD); + communicate_sd["columns"][0]["font"]["style"] = "BOLD"; if (selected.isUndefined()) { - selected = itemp->getValue(); + selected = "local chat"; } } + itemp = communicate_button->addElement(communicate_sd, ADD_TOP); + communicate_button->addSeparator(ADD_TOP); communicate_button->add(getString("Redock Windows"), LLSD("redock"), ADD_TOP); communicate_button->addSeparator(ADD_TOP); - communicate_button->add(LLFloaterMute::getInstance()->getShortTitle(), LLSD("mute list"), ADD_TOP); + communicate_button->add(LLFloaterReg::getTypedInstance<LLFloaterMute>("mute")->getShortTitle(), LLSD("mute list"), ADD_TOP); std::set<LLHandle<LLFloater> >::const_iterator floater_handle_it; @@ -357,38 +348,40 @@ void LLToolBar::updateCommunicateList() { std::string floater_title = im_floaterp->getNumUnreadMessages() > 0 ? "*" : ""; floater_title.append(im_floaterp->getShortTitle()); - itemp = communicate_button->add(floater_title, im_floaterp->getSessionID(), ADD_TOP); + LLSD im_sd; + im_sd["value"] = im_floaterp->getSessionID(); + im_sd["columns"][0]["value"] = floater_title; if (im_floaterp == frontmost_floater) { - ((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD); + im_sd["columns"][0]["font"]["style"] = "BOLD"; if (selected.isUndefined()) { - selected = itemp->getValue(); + selected = im_floaterp->getSessionID(); } } + itemp = communicate_button->addElement(im_sd, ADD_TOP); } } - communicate_button->setToggleState(gSavedSettings.getBOOL("ShowCommunicate")); communicate_button->setValue(selected); } // static -void LLToolBar::onClickCommunicate(LLUICtrl* ctrl, void* user_data) +void LLToolBar::onClickCommunicate(LLUICtrl* ctrl, const LLSD& user_data) { - LLToolBar* toolbar = (LLToolBar*)user_data; - LLFlyoutButton* communicate_button = toolbar->getChild<LLFlyoutButton>("communicate_btn"); + LLFlyoutButton* communicate_button = dynamic_cast<LLFlyoutButton*>(ctrl); + llassert_always(communicate_button); LLSD selected_option = communicate_button->getValue(); if (selected_option.asString() == "contacts") { - LLFloaterMyFriends::showInstance(); + LLFloaterReg::showInstance("contacts", "friends"); } else if (selected_option.asString() == "local chat") { - LLFloaterChat::showInstance(); + LLFloaterReg::showInstance("communicate", "local"); } else if (selected_option.asString() == "redock") { @@ -410,112 +403,20 @@ void LLToolBar::onClickCommunicate(LLUICtrl* ctrl, void* user_data) } } - LLFloaterChatterBox::showInstance(session_to_show); + LLFloaterReg::showInstance("communicate", session_to_show); } else if (selected_option.asString() == "mute list") { - LLFloaterMute::showInstance(); + LLFloaterReg::showInstance("mute"); } else if (selected_option.isUndefined()) // user just clicked the communicate button, treat as toggle { - if (LLFloaterChatterBox::getInstance()->getFloaterCount() == 0) - { - LLFloaterMyFriends::toggleInstance(); + LLFloaterReg::toggleInstance("communicate"); } - else - { - LLFloaterChatterBox::toggleInstance(); - } - } - else // otherwise selection_option is a specific IM session id - { - LLFloaterChatterBox::showInstance(selected_option); - } -} - - -// static -void LLToolBar::onClickChat(void* user_data) -{ - handle_chat(NULL); -} - -// static -void LLToolBar::onClickAppearance(void*) -{ - if (gAgent.areWearablesLoaded()) - { - gAgent.changeCameraToCustomizeAvatar(); - } -} - - -// static -void LLToolBar::onClickFly(void*) -{ - gAgent.toggleFlying(); -} - - -// static -void LLToolBar::onClickSit(void*) -{ - if (!(gAgent.getControlFlags() & AGENT_CONTROL_SIT_ON_GROUND)) - { - // sit down - gAgent.setFlying(FALSE); - gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); - - // Might be first sit - LLFirstUse::useSit(); - } - else + else // otherwise selection_option is undifined or a specific IM session id { - // stand up - gAgent.setFlying(FALSE); - gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); + LLFloaterReg::showInstance("communicate", selected_option); } } -// static -void LLToolBar::onClickSnapshot(void*) -{ - LLFloaterSnapshot::show (0); -} - - -// static -void LLToolBar::onClickDirectory(void*) -{ - handle_find(NULL); -} - - -// static -void LLToolBar::onClickBuild(void*) -{ - toggle_build_mode(); -} - - -// static -void LLToolBar::onClickRadar(void*) -{ - handle_mini_map(NULL); -} - - -// static -void LLToolBar::onClickMap(void*) -{ - handle_map(NULL); -} - - -// static -void LLToolBar::onClickInventory(void*) -{ - handle_inventory(NULL); -} - diff --git a/indra/newview/lltoolbar.h b/indra/newview/lltoolbar.h index 094d016e393a86a3cde579da9451fcd1445142bf..954c6270a6a9f64c83ab78ad0419225881324c3d 100644 --- a/indra/newview/lltoolbar.h +++ b/indra/newview/lltoolbar.h @@ -37,12 +37,7 @@ #include "llframetimer.h" -// "Constants" loaded from settings.xml at start time -extern S32 TOOL_BAR_HEIGHT; - -#if LL_DARWIN - class LLFakeResizeHandle; -#endif // LL_DARWIN +class LLResizeHandle; class LLToolBar : public LLPanel @@ -71,17 +66,7 @@ public: void refresh(); // callbacks - static void onClickCommunicate(LLUICtrl*, void*); - static void onClickChat(void* data); - static void onClickAppearance(void* data); - static void onClickFly(void*); - static void onClickSit(void*); - static void onClickSnapshot(void* data); - static void onClickDirectory(void* data); - static void onClickBuild(void* data); - static void onClickRadar(void* data); - static void onClickMap(void* data); - static void onClickInventory(void* data); + static void onClickCommunicate(LLUICtrl*, const LLSD&); static F32 sInventoryAutoOpenTime; @@ -94,7 +79,7 @@ private: LLFrameTimer mInventoryAutoOpenTimer; S32 mNumUnreadIMs; #if LL_DARWIN - LLFakeResizeHandle *mResizeHandle; + LLResizeHandle *mResizeHandle; #endif // LL_DARWIN }; diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index c42693d03fb56da80f19bd4e62e86618129fe3b3..0088a6a2a48a9061982739beadaf3ca8fc237c71 100644 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -412,7 +412,7 @@ BOOL LLToolBrushLand::handleHover( S32 x, S32 y, MASK mask ) mMouseX = x; mMouseY = y; mGotHover = TRUE; - gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLLAND); + gViewerWindow->setCursor(UI_CURSOR_TOOLLAND); return TRUE; } diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index 0b6e01886a98aab2c1a77b7631ab683d8585df76..cb964082b846c4a803f12ad802741a0c27e3ff40 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -34,6 +34,7 @@ #include "lltoolcomp.h" +#include "llfloaterreg.h" #include "llgl.h" #include "indra_constants.h" @@ -64,6 +65,9 @@ const S32 HPAD = 4; extern LLControlGroup gSavedSettings; +// we use this in various places instead of NULL +static LLTool* sNullTool = new LLTool(std::string("null"), NULL); + //----------------------------------------------------------------------- // LLToolComposite @@ -87,7 +91,9 @@ void LLToolComposite::setCurrentTool( LLTool* new_tool ) LLToolComposite::LLToolComposite(const std::string& name) : LLTool(name), - mCur(NULL), mDefault(NULL), mSelected(FALSE), + mCur(sNullTool), + mDefault(sNullTool), + mSelected(FALSE), mMouseDown(FALSE), mManip(NULL), mSelectRect(NULL) { } @@ -290,7 +296,7 @@ BOOL LLToolCompTranslate::handleDoubleClick(S32 x, S32 y, MASK mask) { // You should already have an object selected from the mousedown. // If so, show its properties - gFloaterTools->showPanel(LLFloaterTools::PANEL_CONTENTS); + LLFloaterReg::showInstance("build", "Content"); return TRUE; } // Nothing selected means the first mouse click was probably @@ -407,8 +413,7 @@ BOOL LLToolCompScale::handleDoubleClick(S32 x, S32 y, MASK mask) { // You should already have an object selected from the mousedown. // If so, show its properties - gFloaterTools->showPanel(LLFloaterTools::PANEL_CONTENTS); - //gBuildView->setPropertiesPanelOpen(TRUE); + LLFloaterReg::showInstance("build", "Content"); return TRUE; } else @@ -605,8 +610,7 @@ BOOL LLToolCompRotate::handleDoubleClick(S32 x, S32 y, MASK mask) { // You should already have an object selected from the mousedown. // If so, show its properties - gFloaterTools->showPanel(LLFloaterTools::PANEL_CONTENTS); - //gBuildView->setPropertiesPanelOpen(TRUE); + LLFloaterReg::showInstance("build", "Content"); return TRUE; } else @@ -638,7 +642,7 @@ LLToolCompGun::LLToolCompGun() { mGun = new LLToolGun(this); mGrab = new LLToolGrab(this); - mNull = new LLTool(std::string("null"), this); + mNull = sNullTool; setCurrentTool(mGun); mDefault = mGun; @@ -653,7 +657,8 @@ LLToolCompGun::~LLToolCompGun() delete mGrab; mGrab = NULL; - delete mNull; + // don't delete a static object + // delete mNull; mNull = NULL; } diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 156093a21a49fb7e67fc5b7d9d921890483a509b..0c0253a76a273ee9fe6b08f6e0b2367c5719ae50 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -35,10 +35,12 @@ #include "message.h" #include "lltooldraganddrop.h" +#include "llfloaterreg.h" #include "llinstantmessage.h" #include "lldir.h" #include "llagent.h" +#include "llagentwearables.h" #include "llviewercontrol.h" #include "llfirstuse.h" #include "llfloater.h" @@ -47,6 +49,7 @@ #include "llgesturemgr.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" +#include "llinventorybridge.h" #include "llinventorymodel.h" #include "llinventoryview.h" #include "llmutelist.h" @@ -63,11 +66,12 @@ #include "llviewerregion.h" #include "llviewerstats.h" #include "llviewerwindow.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llvolume.h" #include "llworld.h" #include "object_flags.h" #include "llimview.h" +#include "llrootview.h" // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES @@ -846,7 +850,7 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop, { handled = TRUE; - LLView* root_view = gViewerWindow->getRootView(); + LLRootView* root_view = gViewerWindow->getRootView(); for (mCurItemIndex = 0; mCurItemIndex < (S32)mCargoIDs.size(); mCurItemIndex++) { @@ -1461,10 +1465,10 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, } } hit_obj->updateInventory(new_item, TASK_INVENTORY_ITEM_KEY, true); - if (gFloaterTools->getVisible()) + if (LLFloaterReg::instanceVisible("build")) { // *FIX: only show this if panel not expanded? - gFloaterTools->showPanel(LLFloaterTools::PANEL_CONTENTS); + LLFloaterReg::showInstance("build", "Content"); } // VEFFECT: AddToInventory @@ -1827,7 +1831,7 @@ BOOL LLToolDragAndDrop::isInventoryGiveAcceptable(LLInventoryItem* item) BOOL copyable = FALSE; if(item->getPermissions().allowCopyBy(gAgent.getID())) copyable = TRUE; - LLVOAvatar* my_avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* my_avatar = gAgent.getAvatarObject(); if(!my_avatar) { return FALSE; @@ -1847,7 +1851,7 @@ BOOL LLToolDragAndDrop::isInventoryGiveAcceptable(LLInventoryItem* item) break; case LLAssetType::AT_BODYPART: case LLAssetType::AT_CLOTHING: - if(!copyable && gAgent.isWearingItem(item->getUUID())) + if(!copyable && gAgentWearables.isWearingItem(item->getUUID())) { acceptable = FALSE; } @@ -1877,7 +1881,7 @@ BOOL LLToolDragAndDrop::isInventoryGroupGiveAcceptable(LLInventoryItem* item) return FALSE; } - LLVOAvatar* my_avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* my_avatar = gAgent.getAvatarObject(); if(!my_avatar) { return FALSE; @@ -1924,7 +1928,7 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL // gAgent.getGroupID()) // && (obj->mPermModify || obj->mFlagAllowInventoryAdd)); BOOL worn = FALSE; - LLVOAvatar* my_avatar = NULL; + LLVOAvatarSelf* my_avatar = NULL; switch(item->getType()) { case LLAssetType::AT_OBJECT: @@ -1936,7 +1940,7 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL break; case LLAssetType::AT_BODYPART: case LLAssetType::AT_CLOTHING: - if(gAgent.isWearingItem(item->getUUID())) + if(gAgentWearables.isWearingItem(item->getUUID())) { worn = TRUE; } @@ -2080,7 +2084,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( } // must not be already wearing it - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if( !avatar || avatar->isWearingAttachment(item->getUUID()) ) { return ACCEPT_NO; @@ -2122,7 +2126,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( locateInventory(item, cat); if(!item || !item->isComplete()) return ACCEPT_NO; - LLVOAvatar* my_avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* my_avatar = gAgent.getAvatarObject(); if( !my_avatar || my_avatar->isWearingAttachment( item->getUUID() ) ) { return ACCEPT_NO; @@ -2185,7 +2189,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject( LLViewerInventoryCategory* cat; locateInventory(item, cat); if(!item || !item->isComplete()) return ACCEPT_NO; - LLVOAvatar* my_avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* my_avatar = gAgent.getAvatarObject(); if( !my_avatar || my_avatar->isWearingAttachment( item->getUUID() ) ) { return ACCEPT_NO; @@ -2383,7 +2387,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearItem( { // Don't wear anything until initial wearables are loaded, can // destroy clothing items. - if (!gAgent.areWearablesLoaded()) + if (!gAgentWearables.areWearablesLoaded()) { LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); return ACCEPT_NO; @@ -2478,7 +2482,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory( { // Don't wear anything until initial wearables are loaded, can // destroy clothing items. - if (!gAgent.areWearablesLoaded()) + if (!gAgentWearables.areWearablesLoaded()) { LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); return ACCEPT_NO; @@ -2679,7 +2683,7 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventoryObject( // cannot give away no-transfer objects return ACCEPT_NO; } - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if(avatar && avatar->isWearingAttachment( item->getUUID() ) ) { // You can't give objects that are attached to you @@ -2897,11 +2901,10 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory( } else if(mSource == SOURCE_NOTECARD) { - LLPreviewNotecard* card; - card = (LLPreviewNotecard*)LLPreview::find(mSourceID); - if(card) + LLPreviewNotecard* preview = LLFloaterReg::findTypedInstance<LLPreviewNotecard>("preview_notecard", mSourceID); + if(preview) { - item = (LLViewerInventoryItem*)card->getDragItem(); + item = (LLViewerInventoryItem*)preview->getDragItem(); } } if(item) return item; diff --git a/indra/newview/lltoolface.cpp b/indra/newview/lltoolface.cpp index d06e41c771875177cfe58c9b60c4e08edd7e22eb..b335d7125a5b4a21918be71fcd8a90946e68708c 100644 --- a/indra/newview/lltoolface.cpp +++ b/indra/newview/lltoolface.cpp @@ -36,14 +36,13 @@ #include "lltoolface.h" // Library includes +#include "llfloaterreg.h" #include "v3math.h" // Viewer includes #include "llagent.h" -//#include "llbuildview.h" #include "llviewercontrol.h" #include "llselectmgr.h" -#include "lltoolview.h" #include "llviewerobject.h" #include "llviewerwindow.h" #include "llfloatertools.h" @@ -67,9 +66,7 @@ BOOL LLToolFace::handleDoubleClick(S32 x, S32 y, MASK mask) { // You should already have an object selected from the mousedown. // If so, show its properties - //gBuildView->showFacePanel(); - gFloaterTools->showPanel( LLFloaterTools::PANEL_FACE ); - //gBuildView->showMore(LLBuildView::PANEL_FACE); + LLFloaterReg::showInstance("build", "Texture"); return TRUE; } else diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 4e8274a6ef72385560443ff0261cceeb302753fa..ca7807357529f6328e310ffe5a5f01695e4330cb 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -54,7 +54,7 @@ #include "llviewercamera.h" #include "llviewerobject.h" #include "llviewerwindow.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llmorphview.h" // Globals diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index d9811dac6c04274c5e379f3643dbc65f27185471..409549a66b9a0e64ac92765014f0441b39eb78ec 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -61,7 +61,7 @@ #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llviewerwindow.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llworld.h" const S32 SLOP_DIST_SQ = 4; @@ -885,7 +885,7 @@ void LLToolGrab::handleHoverInactive(S32 x, S32 y, MASK mask) // Look for cursor against the edge of the screen // Only works in fullscreen - if (gSavedSettings.getBOOL("FullScreen")) + if (!gSavedSettings.getBOOL("NotFullScreen")) { if (gAgent.cameraThirdPerson() ) { diff --git a/indra/newview/lltoolgrab.h b/indra/newview/lltoolgrab.h index cf2405cafc659548d2eff1ddf755de38c063ec1c..16ccb3f24f496091109d338db34daa7324477170 100644 --- a/indra/newview/lltoolgrab.h +++ b/indra/newview/lltoolgrab.h @@ -36,7 +36,7 @@ #include "lltool.h" #include "v3math.h" #include "llquaternion.h" -#include "llmemory.h" +#include "llsingleton.h" #include "lluuid.h" #include "llviewerwindow.h" // for LLPickInfo diff --git a/indra/newview/lltoolgun.cpp b/indra/newview/lltoolgun.cpp index d21fd496478d4155092d341ecd109302f1062494..72fd8b3bacc1e9d1aba1b5a6e7aa963f6d6816fd 100644 --- a/indra/newview/lltoolgun.cpp +++ b/indra/newview/lltoolgun.cpp @@ -48,6 +48,9 @@ #include "lltoolmgr.h" #include "lltoolgrab.h" +// Linden library includes +#include "llwindow.h" // setMouseClipping() + LLToolGun::LLToolGun( LLToolComposite* composite ) : LLTool( std::string("gun"), composite ) { @@ -132,7 +135,7 @@ void LLToolGun::draw() { if( gSavedSettings.getBOOL("ShowCrosshairs") ) { - LLUIImagePtr crosshair = LLUI::getUIImage("UIImgCrosshairsUUID"); + LLUIImagePtr crosshair = LLUI::getUIImage("crosshairs.tga"); crosshair->draw( ( gViewerWindow->getWindowWidth() - crosshair->getWidth() ) / 2, ( gViewerWindow->getWindowHeight() - crosshair->getHeight() ) / 2); diff --git a/indra/newview/lltoolindividual.cpp b/indra/newview/lltoolindividual.cpp index 8382e0d72d59785c99fbaaf817ed8241bdb595a3..163c7cbd9b83f82557c9bd53e2484ed4b2c272cb 100644 --- a/indra/newview/lltoolindividual.cpp +++ b/indra/newview/lltoolindividual.cpp @@ -41,6 +41,7 @@ #include "llviewerprecompiledheaders.h" #include "lltoolindividual.h" +#include "llfloaterreg.h" #include "llselectmgr.h" #include "llviewerobject.h" #include "llviewerwindow.h" @@ -93,9 +94,7 @@ BOOL LLToolIndividual::handleDoubleClick(S32 x, S32 y, MASK mask) { // You should already have an object selected from the mousedown. // If so, show its inventory. - //gBuildView->showInventoryPanel(); - //gBuildView->showPanel(LLBuildView::PANEL_CONTENTS); - gFloaterTools->showPanel(LLFloaterTools::PANEL_CONTENTS); + LLFloaterReg::showInstance("build", "Content"); return TRUE; } else diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 5ba7217c9973b69b2147c0b5246513eee31476d7..e3ee209030e01319cc3ee5f14da3a8ec0799fca6 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -34,8 +34,13 @@ #include "lltoolmgr.h" -#include "lltool.h" +#include "lluictrl.h" +#include "llmenugl.h" +#include "llfloaterreg.h" + +#include "llfirstuse.h" // tools and manipulators +#include "lltool.h" #include "llmanipscale.h" #include "llselectmgr.h" #include "lltoolbrush.h" @@ -47,12 +52,14 @@ #include "lltoolindividual.h" #include "lltoolmorph.h" #include "lltoolpie.h" -#include "lltoolplacer.h" #include "lltoolselectland.h" #include "lltoolobjpicker.h" #include "lltoolpipette.h" #include "llagent.h" #include "llviewercontrol.h" +#include "llviewerjoystick.h" +#include "llviewermenu.h" +#include "llviewerparcelmgr.h" // Used when app not active to avoid processing hover. @@ -76,6 +83,11 @@ LLToolMgr::LLToolMgr() mSelectedTool( NULL ), mCurrentToolset( NULL ) { + // Not a panel, register these callbacks globally. + LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this)); + LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this)); + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this)); + gToolNull = new LLTool(LLStringUtil::null); // Does nothing setCurrentTool(gToolNull); @@ -172,7 +184,7 @@ void LLToolMgr::setCurrentTool( LLTool* tool ) LLTool* LLToolMgr::getCurrentTool() { - MASK override_mask = gKeyboard->currentMask(TRUE); + MASK override_mask = gKeyboard ? gKeyboard->currentMask(TRUE) : 0; LLTool* cur_tool = NULL; // always use transient tools if available @@ -226,11 +238,77 @@ void LLToolMgr::updateToolStatus() getCurrentTool(); } -BOOL LLToolMgr::inEdit() +bool LLToolMgr::inEdit() { return mBaseTool != LLToolPie::getInstance() && mBaseTool != gToolNull; } +bool LLToolMgr::canEdit() +{ + return LLViewerParcelMgr::getInstance()->agentCanBuild(); +} + +void LLToolMgr::toggleBuildMode() +{ + if (inBuildMode()) + { + if (gSavedSettings.getBOOL("EditCameraMovement")) + { + // just reset the view, will pull us out of edit mode + handle_reset_view(); + } + else + { + // manually disable edit mode, but do not affect the camera + gAgent.resetView(false); + LLFloaterReg::hideInstance("build"); + gViewerWindow->showCursor(); + } + // avoid spurious avatar movements pulling out of edit mode + LLViewerJoystick::getInstance()->setNeedsReset(); + } + else + { + ECameraMode camMode = gAgent.getCameraMode(); + if (CAMERA_MODE_MOUSELOOK == camMode || CAMERA_MODE_CUSTOMIZE_AVATAR == camMode) + { + // pull the user out of mouselook or appearance mode when entering build mode + handle_reset_view(); + } + + if (gSavedSettings.getBOOL("EditCameraMovement")) + { + // camera should be set + if (LLViewerJoystick::getInstance()->getOverrideCamera()) + { + handle_toggle_flycam(); + } + + if (gAgent.getFocusOnAvatar()) + { + // zoom in if we're looking at the avatar + gAgent.setFocusOnAvatar(FALSE, ANIMATE); + gAgent.setFocusGlobal(gAgent.getPositionGlobal() + 2.0 * LLVector3d(gAgent.getAtAxis())); + gAgent.cameraZoomIn(0.666f); + gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); + } + } + + + setCurrentToolset(gBasicToolset); + getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); + + // Could be first use + LLFirstUse::useBuild(); + + gAgent.resetView(false); + + // avoid spurious avatar movements + LLViewerJoystick::getInstance()->setNeedsReset(); + + } +} + bool LLToolMgr::inBuildMode() { // when entering mouselook inEdit() immediately returns true before @@ -396,8 +474,6 @@ void LLToolset::selectPrevTool() } } -void select_tool( void *tool_pointer ) -{ - LLTool *tool = (LLTool *)tool_pointer; - LLToolMgr::getInstance()->getCurrentToolset()->selectTool( tool ); -} +//////////////////////////////////////////////////////////////////////////// + + diff --git a/indra/newview/lltoolmgr.h b/indra/newview/lltoolmgr.h index 92647c99debb1304ed8f0d6ce979376a582b4b01..22aec97864baa6f54838b1945a0a986d9aac088b 100644 --- a/indra/newview/lltoolmgr.h +++ b/indra/newview/lltoolmgr.h @@ -58,7 +58,9 @@ public: LLTool* getCurrentTool(); // returns active tool, taking into account keyboard state LLTool* getBaseTool(); // returns active tool when overrides are deactivated - BOOL inEdit(); + bool inEdit(); + bool canEdit(); + void toggleBuildMode(); /* Determines if we are in Build mode or not. */ bool inBuildMode(); @@ -115,10 +117,6 @@ protected: tool_list_t mToolList; }; -// Handy callbacks for switching tools -void select_tool(void *tool); - - // Globals extern LLToolset* gBasicToolset; diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index 75e19645a6d5f42fdec7cf22b885099785d1a5fd..af0d784a3eb31a6f6c5a051e13d9d537b805440a 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -56,13 +56,12 @@ #include "llsky.h" #include "lltexlayer.h" #include "lltoolmgr.h" -#include "lltoolview.h" #include "llui.h" #include "llviewercamera.h" #include "llviewerimagelist.h" #include "llviewerobject.h" #include "llviewerwindow.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "pipeline.h" @@ -145,7 +144,7 @@ BOOL LLVisualParamHint::needsRender() void LLVisualParamHint::preRender(BOOL clear_depth) { - LLVOAvatar* avatarp = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); mLastParamWeight = avatarp->getVisualParamWeight(mVisualParam); avatarp->setVisualParamWeight(mVisualParam, mVisualParamWeight); @@ -292,7 +291,7 @@ BOOL LLVisualParamReset::render() { if (sDirty) { - LLVOAvatar* avatarp = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); avatarp->updateComposites(); avatarp->updateVisualParams(); avatarp->updateGeometry(avatarp->mDrawable); diff --git a/indra/newview/lltoolobjpicker.cpp b/indra/newview/lltoolobjpicker.cpp index d69688706f3295fe64e579f65feb09c2c18ca7d4..b2088a8232c8a80d6a431d93cb6c238512a026f9 100644 --- a/indra/newview/lltoolobjpicker.cpp +++ b/indra/newview/lltoolobjpicker.cpp @@ -48,6 +48,7 @@ #include "llviewercamera.h" #include "llviewerwindow.h" #include "lldrawable.h" +#include "llrootview.h" LLToolObjPicker::LLToolObjPicker() @@ -62,7 +63,7 @@ LLToolObjPicker::LLToolObjPicker() // returns TRUE if an object was selected BOOL LLToolObjPicker::handleMouseDown(S32 x, S32 y, MASK mask) { - LLView* viewp = gViewerWindow->getRootView(); + LLRootView* viewp = gViewerWindow->getRootView(); BOOL handled = viewp->handleMouseDown(x, y, mask); mHitObjectID.setNull(); @@ -131,7 +132,7 @@ BOOL LLToolObjPicker::handleHover(S32 x, S32 y, MASK mask) cursor = UI_CURSOR_TOOLPICKOBJECT3; - gViewerWindow->getWindow()->setCursor(cursor); + gViewerWindow->setCursor(cursor); } return handled; } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 986555db49e0f8b8cb993d3d34b57ee732aca971..a6dcebc3b567fe0e5e07bb381f23530185becb12 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -63,7 +63,7 @@ #include "llviewerparcelmgr.h" #include "llviewerwindow.h" #include "llviewermedia.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llworld.h" #include "llui.h" #include "llweb.h" @@ -79,7 +79,6 @@ static ECursorType cursor_from_parcel_media(U8 click_action); LLToolPie::LLToolPie() : LLTool(std::string("Select")), - mPieMouseButtonDown( FALSE ), mGrabMouseButtonDown( FALSE ), mMouseOutsideSlop( FALSE ), mClickAction(0) @@ -98,32 +97,35 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) void LLToolPie::leftMouseCallback(const LLPickInfo& pick_info) { LLToolPie::getInstance()->mPick = pick_info; - LLToolPie::getInstance()->pickAndShowMenu(FALSE); + LLToolPie::getInstance()->pickLeftMouseDownCallback(); } BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask) { - // don't pick transparent so users can't "pay" transparent objects - gViewerWindow->pickAsync(x, y, mask, rightMouseCallback, FALSE, TRUE); - mPieMouseButtonDown = TRUE; - // don't steal focus from UI return FALSE; } +BOOL LLToolPie::handleRightMouseUp(S32 x, S32 y, MASK mask) +{ + LLToolMgr::getInstance()->clearTransientTool(); + gViewerWindow->pickAsync(x, y, mask, rightMouseCallback, FALSE, TRUE); + return LLTool::handleRightMouseUp(x, y, mask); +} + // static void LLToolPie::rightMouseCallback(const LLPickInfo& pick_info) { LLToolPie::getInstance()->mPick = pick_info; - LLToolPie::getInstance()->pickAndShowMenu(TRUE); + LLToolPie::getInstance()->pickRightMouseUpCallback(); } // True if you selected an object. -BOOL LLToolPie::pickAndShowMenu(BOOL always_show) +BOOL LLToolPie::pickLeftMouseDownCallback() { S32 x = mPick.mMousePt.mX; S32 y = mPick.mMousePt.mY; MASK mask = mPick.mKeyMask; - if (!always_show && mPick.mPickType == LLPickInfo::PICK_PARCEL_WALL) + if (mPick.mPickType == LLPickInfo::PICK_PARCEL_WALL) { LLParcel* parcel = LLViewerParcelMgr::getInstance()->getCollisionParcel(); if (parcel) @@ -164,7 +166,7 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) || (parent && parent->flagHandleTouch()); // If it's a left-click, and we have a special action, do it. - if (useClickAction(always_show, mask, object, parent)) + if (useClickAction(mask, object, parent)) { mClickAction = 0; if (object && object->getClickAction()) @@ -240,8 +242,8 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) // Switch to grab tool if physical or triggerable if (object && !object->isAvatar() && - ((object->usePhysics() || (parent && !parent->isAvatar() && parent->usePhysics())) || touchable) && - !always_show) + ((object->usePhysics() || (parent && !parent->isAvatar() && parent->usePhysics())) || touchable) + ) { gGrabTransientTool = this; LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() ); @@ -256,8 +258,7 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) // If left-click never selects or spawns a menu // Eat the event. - if (!gSavedSettings.getBOOL("LeftClickShowMenu") - && !always_show) + if (!gSavedSettings.getBOOL("LeftClickShowMenu")) { // mouse already released if (!mGrabMouseButtonDown) @@ -292,7 +293,7 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) return LLTool::handleMouseDown(x, y, mask); } - if (!always_show && gAgent.leftButtonGrabbed()) + if (gAgent.leftButtonGrabbed()) { // if the left button is grabbed, don't put up the pie menu return LLTool::handleMouseDown(x, y, mask); @@ -302,116 +303,15 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE); // Spawn pie menu - if (mPick.mPickType == LLPickInfo::PICK_LAND) - { - LLParcelSelectionHandle selection = LLViewerParcelMgr::getInstance()->selectParcelAt( mPick.mPosGlobal ); - gMenuHolder->setParcelSelection(selection); - gPieLand->show(x, y, mPieMouseButtonDown); - - // VEFFECT: ShowPie - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE); - effectp->setPositionGlobal(mPick.mPosGlobal); - effectp->setColor(LLColor4U(gAgent.getEffectColor())); - effectp->setDuration(0.25f); - } - else if (mPick.mObjectID == gAgent.getID() ) - { - if(!gPieSelf) - { - //either at very early startup stage or at late quitting stage, - //this event is ignored. - return TRUE ; - } - - gPieSelf->show(x, y, mPieMouseButtonDown); - } - else if (object) - { - gMenuHolder->setObjectSelection(LLSelectMgr::getInstance()->getSelection()); - - if (object->isAvatar() - || (object->isAttachment() && !object->isHUDAttachment() && !object->permYouOwner())) - { - // Find the attachment's avatar - while( object && object->isAttachment()) - { - object = (LLViewerObject*)object->getParent(); - } - - // Object is an avatar, so check for mute by id. - LLVOAvatar* avatar = (LLVOAvatar*)object; - std::string name = avatar->getFullname(); - if (LLMuteList::getInstance()->isMuted(avatar->getID(), name)) - { - gMenuHolder->childSetText("Avatar Mute", std::string("Unmute")); // *TODO:Translate - //gMutePieMenu->setLabel("Unmute"); - } - else - { - gMenuHolder->childSetText("Avatar Mute", std::string("Mute")); // *TODO:Translate - //gMutePieMenu->setLabel("Mute"); - } - - gPieAvatar->show(x, y, mPieMouseButtonDown); - } - else if (object->isAttachment()) - { - gPieAttachment->show(x, y, mPieMouseButtonDown); - } - else - { - // BUG: What about chatting child objects? - std::string name; - LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); - if (node) - { - name = node->mName; - } - if (LLMuteList::getInstance()->isMuted(object->getID(), name)) - { - gMenuHolder->childSetText("Object Mute", std::string("Unmute")); // *TODO:Translate - //gMuteObjectPieMenu->setLabel("Unmute"); - } - else - { - gMenuHolder->childSetText("Object Mute", std::string("Mute")); // *TODO:Translate - //gMuteObjectPieMenu->setLabel("Mute"); - } - - gPieObject->show(x, y, mPieMouseButtonDown); - - // VEFFECT: ShowPie object - // Don't show when you click on someone else, it freaks them - // out. - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE); - effectp->setPositionGlobal(mPick.mPosGlobal); - effectp->setColor(LLColor4U(gAgent.getEffectColor())); - effectp->setDuration(0.25f); - } - } - - if (always_show) - { - // ignore return value - LLTool::handleRightMouseDown(x, y, mask); - } - else - { - // ignore return value - LLTool::handleMouseDown(x, y, mask); - } - - // We handled the event. + LLTool::handleRightMouseDown(x, y, mask); return TRUE; } -BOOL LLToolPie::useClickAction(BOOL always_show, - MASK mask, +BOOL LLToolPie::useClickAction(MASK mask, LLViewerObject* object, LLViewerObject* parent) { - return !always_show - && mask == MASK_NONE + return mask == MASK_NONE && object && !object->isAttachment() && LLPrimitive::isPrimitive(object->getPCode()) @@ -567,27 +467,27 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) parent = object->getRootEdit(); } - if (object && useClickAction(FALSE, mask, object, parent)) + if (object && useClickAction(mask, object, parent)) { ECursorType cursor = cursor_from_object(object); - gViewerWindow->getWindow()->setCursor(cursor); + gViewerWindow->setCursor(cursor); lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; } else if ((object && !object->isAvatar() && object->usePhysics()) || (parent && !parent->isAvatar() && parent->usePhysics())) { - gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLGRAB); + gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB); lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; } else if ( (object && object->flagHandleTouch()) || (parent && parent->flagHandleTouch())) { - gViewerWindow->getWindow()->setCursor(UI_CURSOR_HAND); + gViewerWindow->setCursor(UI_CURSOR_HAND); lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; } else { - gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); + gViewerWindow->setCursor(UI_CURSOR_ARROW); lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; } @@ -610,7 +510,7 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) // the world. Keep the cursor an arrow, assuming that // after the user moves off the UI, they won't be on the // same object anymore. - gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); + gViewerWindow->setCursor(UI_CURSOR_ARROW); // Make sure the hover-picked object is ignored. gHoverView->resetLastHoverObject(); break; @@ -624,13 +524,6 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) return LLTool::handleMouseUp(x, y, mask); } -BOOL LLToolPie::handleRightMouseUp(S32 x, S32 y, MASK mask) -{ - mPieMouseButtonDown = FALSE; - LLToolMgr::getInstance()->clearTransientTool(); - return LLTool::handleRightMouseUp(x, y, mask); -} - BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) { @@ -832,3 +725,116 @@ static ECursorType cursor_from_parcel_media(U8 click_action) return UI_CURSOR_TOOLPLAY; } } + + +// True if you selected an object. +BOOL LLToolPie::pickRightMouseUpCallback() +{ + S32 x = mPick.mMousePt.mX; + S32 y = mPick.mMousePt.mY; + MASK mask = mPick.mKeyMask; + + if (mPick.mPickType != LLPickInfo::PICK_LAND) + { + LLViewerParcelMgr::getInstance()->deselectLand(); + } + + // didn't click in any UI object, so must have clicked in the world + LLViewerObject *object = mPick.getObject(); + LLViewerObject *parent = NULL; + if(object) + parent = object->getRootEdit(); + + // Can't ignore children here. + LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE); + + // Spawn pie menu + if (mPick.mPickType == LLPickInfo::PICK_LAND) + { + LLParcelSelectionHandle selection = LLViewerParcelMgr::getInstance()->selectParcelAt( mPick.mPosGlobal ); + gMenuHolder->setParcelSelection(selection); + gPieLand->show(x, y); + + showVisualContextMenuEffect(); + + } + else if (mPick.mObjectID == gAgent.getID() ) + { + if(!gPieSelf) + { + //either at very early startup stage or at late quitting stage, + //this event is ignored. + return TRUE ; + } + + gPieSelf->show(x, y); + } + else if (object) + { + gMenuHolder->setObjectSelection(LLSelectMgr::getInstance()->getSelection()); + + if (object->isAvatar() + || (object->isAttachment() && !object->isHUDAttachment() && !object->permYouOwner())) + { + // Find the attachment's avatar + while( object && object->isAttachment()) + { + object = (LLViewerObject*)object->getParent(); + } + + // Object is an avatar, so check for mute by id. + LLVOAvatar* avatar = (LLVOAvatar*)object; + std::string name = avatar->getFullname(); + if (LLMuteList::getInstance()->isMuted(avatar->getID(), avatar->getFullname())) + { + gMenuHolder->childSetText("Avatar Mute", std::string("Unmute")); // *TODO:Translate + } + else + { + gMenuHolder->childSetText("Avatar Mute", std::string("Mute")); // *TODO:Translate + } + + gPieAvatar->show(x, y); + } + else if (object->isAttachment()) + { + gPieAttachment->show(x, y); + } + else + { + // BUG: What about chatting child objects? + std::string name; + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); + if (node) + { + name = node->mName; + } + if (LLMuteList::getInstance()->isMuted(object->getID(), name)) + { + gMenuHolder->childSetText("Object Mute", std::string("Unmute")); // *TODO:Translate + } + else + { + gMenuHolder->childSetText("Object Mute", std::string("Mute")); // *TODO:Translate + } + + gPieObject->show(x, y); + + showVisualContextMenuEffect(); + } + } + + LLTool::handleRightMouseUp(x, y, mask); + // We handled the event. + return TRUE; +} + +void LLToolPie::showVisualContextMenuEffect() +{ + // VEFFECT: ShowPie + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE); + effectp->setPositionGlobal(mPick.mPosGlobal); + effectp->setColor(LLColor4U(gAgent.getEffectColor())); + effectp->setDuration(0.25f); + +} diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index 83df03cda28e44f04dd722c4cb46debf0ff8ac56..82de2b363e122ed85fdc48cd08b56d3e10da488e 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -73,13 +73,13 @@ public: private: - BOOL outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y); - BOOL pickAndShowMenu(BOOL edit_menu); - BOOL useClickAction(BOOL always_show, MASK mask, LLViewerObject* object, - LLViewerObject* parent); + BOOL outsideSlop (S32 x, S32 y, S32 start_x, S32 start_y); + BOOL pickLeftMouseDownCallback(); + BOOL pickRightMouseUpCallback(); + BOOL useClickAction (MASK mask, LLViewerObject* object,LLViewerObject* parent); + void showVisualContextMenuEffect(); private: - BOOL mPieMouseButtonDown; BOOL mGrabMouseButtonDown; BOOL mMouseOutsideSlop; // for this drag, has mouse moved outside slop region LLPickInfo mPick; diff --git a/indra/newview/lltoolpipette.cpp b/indra/newview/lltoolpipette.cpp index 9d95ccc06f22af8f21b2ebb36e3fbfd99346d73b..878ed0f9a96b308bcb6631a3eb648193a6d6d67b 100644 --- a/indra/newview/lltoolpipette.cpp +++ b/indra/newview/lltoolpipette.cpp @@ -55,8 +55,6 @@ LLToolPipette::LLToolPipette() : LLTool(std::string("Pipette")), mSuccess(TRUE) { - mSelectCallback = NULL; - mUserData = NULL; } @@ -106,6 +104,15 @@ BOOL LLToolPipette::handleToolTip(S32 x, S32 y, std::string& msg, LLRect *sticky return TRUE; } +void LLToolPipette::setTextureEntry(const LLTextureEntry* entry) +{ + if (entry) + { + mTextureEntry = *entry; + mSignal(mTextureEntry); + } +} + void LLToolPipette::pickCallback(const LLPickInfo& pick_info) { LLViewerObject* hit_obj = pick_info.getObject(); @@ -118,20 +125,11 @@ void LLToolPipette::pickCallback(const LLPickInfo& pick_info) { //TODO: this should highlight the selected face only LLSelectMgr::getInstance()->highlightObjectOnly(hit_obj); - LLToolPipette::getInstance()->mTextureEntry = *hit_obj->getTE(pick_info.mObjectFace); - if (LLToolPipette::getInstance()->mSelectCallback) - { - LLToolPipette::getInstance()->mSelectCallback(LLToolPipette::getInstance()->mTextureEntry, LLToolPipette::getInstance()->mUserData); - } + const LLTextureEntry* entry = hit_obj->getTE(pick_info.mObjectFace); + LLToolPipette::getInstance()->setTextureEntry(entry); } } -void LLToolPipette::setSelectCallback(select_callback callback, void* user_data) -{ - mSelectCallback = callback; - mUserData = user_data; -} - void LLToolPipette::setResult(BOOL success, const std::string& msg) { mTooltipMsg = msg; diff --git a/indra/newview/lltoolpipette.h b/indra/newview/lltoolpipette.h index 54c24e9467384fdc1f0c6ba484c36dad03d63f45..fcccafe1a4f785a1d9ab465f5c118a2bd17b8ff8 100644 --- a/indra/newview/lltoolpipette.h +++ b/indra/newview/lltoolpipette.h @@ -40,6 +40,8 @@ #include "lltool.h" #include "lltextureentry.h" +#include <boost/function.hpp> +#include <boost/signal.hpp> class LLViewerObject; class LLPickInfo; @@ -56,18 +58,19 @@ public: virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect *sticky_rect_screen); - typedef void (*select_callback)(const LLTextureEntry& te, void *data); - void setSelectCallback(select_callback callback, void* user_data); + // Note: Don't return connection; use boost::bind + boost::signal::trackable to disconnect slots + typedef boost::signal<void (const LLTextureEntry& te)> signal_t; + void setToolSelectCallback(const signal_t::slot_type& cb) { mSignal.connect(cb); } void setResult(BOOL success, const std::string& msg); - + + void setTextureEntry(const LLTextureEntry* entry); static void pickCallback(const LLPickInfo& pick_info); protected: LLTextureEntry mTextureEntry; - select_callback mSelectCallback; + signal_t mSignal; BOOL mSuccess; std::string mTooltipMsg; - void* mUserData; }; #endif //LL_LLTOOLPIPETTE_H diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp index 88fddd93361c0be276bdd917252c46831fe7b92b..607818305eb3f4a96f49d21d00fba6323daf69a5 100644 --- a/indra/newview/lltoolplacer.cpp +++ b/indra/newview/lltoolplacer.cpp @@ -35,9 +35,6 @@ // self header #include "lltoolplacer.h" -// linden library headers -#include "llprimitive.h" - // viewer headers #include "llbutton.h" #include "llviewercontrol.h" @@ -65,13 +62,17 @@ #include "llviewercamera.h" #include "llviewerstats.h" +// linden library headers +#include "llprimitive.h" +#include "llwindow.h" // incBusyCount() + const LLVector3 DEFAULT_OBJECT_SCALE(0.5f, 0.5f, 0.5f); //static LLPCode LLToolPlacer::sObjectType = LL_PCODE_CUBE; LLToolPlacer::LLToolPlacer() -: LLTool( std::string("Create") ) +: LLTool( "Create" ) { } @@ -521,7 +522,7 @@ BOOL LLToolPlacer::placeObject(S32 x, S32 y, MASK mask) BOOL LLToolPlacer::handleHover(S32 x, S32 y, MASK mask) { lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPlacer" << llendl; - gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLCREATE); + gViewerWindow->setCursor(UI_CURSOR_TOOLCREATE); return TRUE; } @@ -534,92 +535,3 @@ void LLToolPlacer::handleDeselect() { } -////////////////////////////////////////////////////// -// LLToolPlacerPanel - -// static -LLPCode LLToolPlacerPanel::sCube = LL_PCODE_CUBE; -LLPCode LLToolPlacerPanel::sPrism = LL_PCODE_PRISM; -LLPCode LLToolPlacerPanel::sPyramid = LL_PCODE_PYRAMID; -LLPCode LLToolPlacerPanel::sTetrahedron = LL_PCODE_TETRAHEDRON; -LLPCode LLToolPlacerPanel::sCylinder = LL_PCODE_CYLINDER; -LLPCode LLToolPlacerPanel::sCylinderHemi= LL_PCODE_CYLINDER_HEMI; -LLPCode LLToolPlacerPanel::sCone = LL_PCODE_CONE; -LLPCode LLToolPlacerPanel::sConeHemi = LL_PCODE_CONE_HEMI; -LLPCode LLToolPlacerPanel::sTorus = LL_PCODE_TORUS; -LLPCode LLToolPlacerPanel::sSquareTorus = LLViewerObject::LL_VO_SQUARE_TORUS; -LLPCode LLToolPlacerPanel::sTriangleTorus = LLViewerObject::LL_VO_TRIANGLE_TORUS; -LLPCode LLToolPlacerPanel::sSphere = LL_PCODE_SPHERE; -LLPCode LLToolPlacerPanel::sSphereHemi = LL_PCODE_SPHERE_HEMI; -LLPCode LLToolPlacerPanel::sTree = LL_PCODE_LEGACY_TREE; -LLPCode LLToolPlacerPanel::sGrass = LL_PCODE_LEGACY_GRASS; - -S32 LLToolPlacerPanel::sButtonsAdded = 0; -LLButton* LLToolPlacerPanel::sButtons[ TOOL_PLACER_NUM_BUTTONS ]; - -LLToolPlacerPanel::LLToolPlacerPanel(const std::string& name, const LLRect& rect) - : - LLPanel( name, rect ) -{ - /* DEPRECATED - JC - addButton( "UIImgCubeUUID", "UIImgCubeSelectedUUID", &LLToolPlacerPanel::sCube ); - addButton( "UIImgPrismUUID", "UIImgPrismSelectedUUID", &LLToolPlacerPanel::sPrism ); - addButton( "UIImgPyramidUUID", "UIImgPyramidSelectedUUID", &LLToolPlacerPanel::sPyramid ); - addButton( "UIImgTetrahedronUUID", "UIImgTetrahedronSelectedUUID", &LLToolPlacerPanel::sTetrahedron ); - addButton( "UIImgCylinderUUID", "UIImgCylinderSelectedUUID", &LLToolPlacerPanel::sCylinder ); - addButton( "UIImgHalfCylinderUUID", "UIImgHalfCylinderSelectedUUID",&LLToolPlacerPanel::sCylinderHemi ); - addButton( "UIImgConeUUID", "UIImgConeSelectedUUID", &LLToolPlacerPanel::sCone ); - addButton( "UIImgHalfConeUUID", "UIImgHalfConeSelectedUUID", &LLToolPlacerPanel::sConeHemi ); - addButton( "UIImgSphereUUID", "UIImgSphereSelectedUUID", &LLToolPlacerPanel::sSphere ); - addButton( "UIImgHalfSphereUUID", "UIImgHalfSphereSelectedUUID", &LLToolPlacerPanel::sSphereHemi ); - addButton( "UIImgTreeUUID", "UIImgTreeSelectedUUID", &LLToolPlacerPanel::sTree ); - addButton( "UIImgGrassUUID", "UIImgGrassSelectedUUID", &LLToolPlacerPanel::sGrass ); - addButton( "ObjectTorusImageID", "ObjectTorusActiveImageID", &LLToolPlacerPanel::sTorus ); - addButton( "ObjectTubeImageID", "ObjectTubeActiveImageID", &LLToolPlacerPanel::sSquareTorus ); - */ -} - -void LLToolPlacerPanel::addButton( const std::string& up_state, const std::string& down_state, LLPCode* pcode ) -{ - const S32 TOOL_SIZE = 32; - const S32 HORIZ_SPACING = TOOL_SIZE + 5; - const S32 VERT_SPACING = TOOL_SIZE + 5; - const S32 VPAD = 10; - const S32 HPAD = 7; - - S32 row = sButtonsAdded / 4; - S32 column = sButtonsAdded % 4; - - LLRect help_rect = gSavedSettings.getRect("ToolHelpRect"); - - // Build the rectangle, recalling the origin is at lower left - // and we want the icons to build down from the top. - LLRect rect; - rect.setLeftTopAndSize( - HPAD + (column * HORIZ_SPACING), - help_rect.mBottom - VPAD - (row * VERT_SPACING), - TOOL_SIZE, - TOOL_SIZE ); - - LLButton* btn = new LLButton( - std::string("ToolPlacerOptBtn"), - rect, - up_state, - down_state, - LLStringUtil::null, &LLToolPlacerPanel::setObjectType, - pcode, - LLFontGL::getFontSansSerif()); - btn->setFollowsBottom(); - btn->setFollowsLeft(); - addChild(btn); - - sButtons[sButtonsAdded] = btn; - sButtonsAdded++; -} - -// static -void LLToolPlacerPanel::setObjectType( void* data ) -{ - LLPCode pcode = *(LLPCode*) data; - LLToolPlacer::setObjectType( pcode ); -} diff --git a/indra/newview/lltoolplacer.h b/indra/newview/lltoolplacer.h index d478f7b1c2b398d253304a18524ad0be2beaffa2..b7422380d43b9567f5ccf09a485cc10e0f2b131a 100644 --- a/indra/newview/lltoolplacer.h +++ b/indra/newview/lltoolplacer.h @@ -67,43 +67,4 @@ private: BOOL addDuplicate(S32 x, S32 y); }; -//////////////////////////////////////////////////// -// LLToolPlacerPanel - - -const S32 TOOL_PLACER_NUM_BUTTONS = 14; - - -class LLToolPlacerPanel : public LLPanel -{ -public: - - LLToolPlacerPanel(const std::string& name, const LLRect& rect); - - static void setObjectType( void* data ); - - static LLPCode sCube; - static LLPCode sPrism; - static LLPCode sPyramid; - static LLPCode sTetrahedron; - static LLPCode sCylinder; - static LLPCode sCylinderHemi; - static LLPCode sCone; - static LLPCode sConeHemi; - static LLPCode sTorus; - static LLPCode sSquareTorus; - static LLPCode sTriangleTorus; - static LLPCode sSphere; - static LLPCode sSphereHemi; - static LLPCode sTree; - static LLPCode sGrass; - -private: - void addButton( const std::string& up_state, const std::string& down_state, LLPCode* pcode ); - -private: - static S32 sButtonsAdded; - static LLButton* sButtons[ TOOL_PLACER_NUM_BUTTONS ]; -}; - #endif diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index 80e99174c77ca9183ecd8db175146951bc8e2f95..97e2865179a476a7835d07982bf53a57f5f0c015 100644 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -48,11 +48,11 @@ #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llviewerwindow.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llworld.h" // Globals -extern BOOL gAllowSelectAvatar; +//extern BOOL gAllowSelectAvatar; const F32 SELECTION_ROTATION_TRESHOLD = 0.1f; @@ -87,7 +87,7 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi BOOL select_movable = gSavedSettings.getBOOL("SelectMovableOnly"); // *NOTE: These settings must be cleaned up at bottom of function. - if (temp_select || gAllowSelectAvatar) + if (temp_select || LLSelectMgr::getInstance()->mAllowSelectAvatar) { gSavedSettings.setBOOL("SelectOwnedOnly", FALSE); gSavedSettings.setBOOL("SelectMovableOnly", FALSE); @@ -217,7 +217,7 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi } //if(!object) // Cleanup temp select settings above. - if (temp_select || gAllowSelectAvatar) + if (temp_select ||LLSelectMgr::getInstance()->mAllowSelectAvatar) { gSavedSettings.setBOOL("SelectOwnedOnly", select_owned); gSavedSettings.setBOOL("SelectMovableOnly", select_movable); diff --git a/indra/newview/lltoolselectland.cpp b/indra/newview/lltoolselectland.cpp index 91223904b7abf26158e45ee02ca0443dbe314402..07c996a84f96063375c30db552c45243e3064772 100644 --- a/indra/newview/lltoolselectland.cpp +++ b/indra/newview/lltoolselectland.cpp @@ -43,7 +43,6 @@ #include "llfloatertools.h" #include "llselectmgr.h" #include "llstatusbar.h" -#include "lltoolview.h" #include "llviewerparcelmgr.h" #include "llviewerwindow.h" @@ -177,13 +176,13 @@ BOOL LLToolSelectLand::handleHover(S32 x, S32 y, MASK mask) roundXY(mEastNorthTop); lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectLand (active, land)" << llendl; - gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); + gViewerWindow->setCursor(UI_CURSOR_ARROW); } else { mDragEndValid = FALSE; lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectLand (active, no land)" << llendl; - gViewerWindow->getWindow()->setCursor(UI_CURSOR_NO); + gViewerWindow->setCursor(UI_CURSOR_NO); } mDragEndX = x; @@ -192,13 +191,13 @@ BOOL LLToolSelectLand::handleHover(S32 x, S32 y, MASK mask) else { lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectLand (active, in slop)" << llendl; - gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); + gViewerWindow->setCursor(UI_CURSOR_ARROW); } } else { lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectLand (inactive)" << llendl; - gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); + gViewerWindow->setCursor(UI_CURSOR_ARROW); } return TRUE; diff --git a/indra/newview/lltoolselectrect.cpp b/indra/newview/lltoolselectrect.cpp index d544bff9924f1b779efab82f9b16f8310c5d3f74..f87d1480d7eabd37f139b88e7b1c8fc532881a4e 100644 --- a/indra/newview/lltoolselectrect.cpp +++ b/indra/newview/lltoolselectrect.cpp @@ -44,7 +44,6 @@ #include "llviewercontrol.h" #include "llui.h" #include "llselectmgr.h" -#include "lltoolview.h" #include "lltoolmgr.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" @@ -159,7 +158,7 @@ BOOL LLToolSelectRect::handleHover(S32 x, S32 y, MASK mask) lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectRect (inactive)" << llendl; } - gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); + gViewerWindow->setCursor(UI_CURSOR_ARROW); return TRUE; } diff --git a/indra/newview/lltoolview.cpp b/indra/newview/lltoolview.cpp index 9f6a77d245a3c4b1d395ff551e8d464db8499b57..f8393ebc471776ee0dfeadbc6bd940f5360d0d1f 100644 --- a/indra/newview/lltoolview.cpp +++ b/indra/newview/lltoolview.cpp @@ -65,9 +65,9 @@ LLToolContainer::~LLToolContainer() LLToolView::LLToolView(const std::string& name, const LLRect& rect) -: LLView(name, rect, MOUSE_OPAQUE), - mButtonCount(0) +: mButtonCount(0) { + LLView::init(LLView::Params().name(name).rect(rect).mouse_opaque(true)); } diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index d54cc798d246ac3cb6e66922734f002ec668cd94..8e4f63783255f466e01193c01d2e78b23bdac798 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -39,7 +39,7 @@ #include "llgl.h" #include "llrender.h" #include "llinventory.h" -#include "llmemory.h" +#include "llpointer.h" #include "llstring.h" #include "lluuid.h" #include "v3math.h" @@ -51,7 +51,6 @@ #include "lltracker.h" #include "llagent.h" #include "llcallingcard.h" -#include "llcolorscheme.h" #include "llfloaterworldmap.h" #include "llhudtext.h" #include "llhudview.h" @@ -113,12 +112,14 @@ void LLTracker::stopTracking(void* userdata) // static virtual void LLTracker::drawHUDArrow() { + static LLCachedControl<LLColor4> map_track_color(gSavedSkinSettings, "MapTrackColor", LLColor4::white); + /* tracking autopilot destination has been disabled -- 2004.01.09, Leviathan // Draw dot for autopilot target if (gAgent.getAutoPilot()) { - instance()->drawMarker( gAgent.getAutoPilotTargetGlobal(), gTrackColor ); + instance()->drawMarker( gAgent.getAutoPilotTargetGlobal(), map_track_color ); return; } */ @@ -128,12 +129,12 @@ void LLTracker::drawHUDArrow() // Tracked avatar if(LLAvatarTracker::instance().haveTrackingInfo()) { - instance()->drawMarker( LLAvatarTracker::instance().getGlobalPos(), gTrackColor ); + instance()->drawMarker( LLAvatarTracker::instance().getGlobalPos(), map_track_color ); } break; case TRACKING_LANDMARK: - instance()->drawMarker( getTrackedPositionGlobal(), gTrackColor ); + instance()->drawMarker( getTrackedPositionGlobal(), map_track_color ); break; case TRACKING_LOCATION: @@ -145,7 +146,7 @@ void LLTracker::drawHUDArrow() + 0.1f * (LLWorld::getInstance()->resolveLandHeightGlobal(getTrackedPositionGlobal()) + 1.5f); #endif instance()->mTrackedPositionGlobal.mdV[VZ] = llclamp((F32)instance()->mTrackedPositionGlobal.mdV[VZ], LLWorld::getInstance()->resolveLandHeightGlobal(getTrackedPositionGlobal()) + 1.5f, (F32)instance()->getTrackedPositionGlobal().mdV[VZ]); - instance()->drawMarker( getTrackedPositionGlobal(), gTrackColor ); + instance()->drawMarker( getTrackedPositionGlobal(), map_track_color ); break; default: @@ -161,7 +162,9 @@ void LLTracker::render3D() { return; } - + + static LLCachedControl<LLColor4> map_track_color(gSavedSkinSettings, "MapTrackColor", LLColor4::white); + // Arbitary location beacon if( instance()->mIsTrackingLocation ) { @@ -181,7 +184,7 @@ void LLTracker::render3D() } else { - renderBeacon( instance()->mTrackedPositionGlobal, gTrackColor, + renderBeacon( instance()->mTrackedPositionGlobal, map_track_color, instance()->mBeaconText, instance()->mTrackedLocationName ); } } @@ -223,7 +226,7 @@ void LLTracker::render3D() // and back again instance()->mHasReachedLandmark = FALSE; } - renderBeacon( instance()->mTrackedPositionGlobal, gTrackColor, + renderBeacon( instance()->mTrackedPositionGlobal, map_track_color, instance()->mBeaconText, instance()->mTrackedLandmarkName ); } } @@ -252,7 +255,7 @@ void LLTracker::render3D() } else { - renderBeacon( av_tracker.getGlobalPos(), gTrackColor, + renderBeacon( av_tracker.getGlobalPos(), map_track_color, instance()->mBeaconText, av_tracker.getName() ); } } diff --git a/indra/newview/lltracker.h b/indra/newview/lltracker.h index 2850365272549d62b8344aa19dd682a9509778d5..bfe9d6c6b546e6b26d1070aca9c6143aec0244db 100644 --- a/indra/newview/lltracker.h +++ b/indra/newview/lltracker.h @@ -40,7 +40,7 @@ #define LL_LLTRACKER_H #include "lldarray.h" -#include "llmemory.h" +#include "llpointer.h" #include "llstring.h" #include "lluuid.h" #include "v3dmath.h" diff --git a/indra/newview/lluploaddialog.cpp b/indra/newview/lluploaddialog.cpp index 7f63972c8d67a4fbaca9b7ee954bd5ad1c271ad4..f5160fd26c206dd27a67fcd6540c8cd83ea646bf 100644 --- a/indra/newview/lluploaddialog.cpp +++ b/indra/newview/lluploaddialog.cpp @@ -41,6 +41,7 @@ #include "llkeyboard.h" #include "llfocusmgr.h" #include "llviewercontrol.h" +#include "llrootview.h" // static LLUploadDialog* LLUploadDialog::sDialog = NULL; @@ -64,8 +65,7 @@ void LLUploadDialog::modalUploadFinished() // Private methods LLUploadDialog::LLUploadDialog( const std::string& msg) - : - LLPanel( std::string("Uploading..."), LLRect(0,100,100,0) ) // dummy rect. Will reshape below. + : LLPanel() { setBackgroundVisible( TRUE ); @@ -75,11 +75,16 @@ LLUploadDialog::LLUploadDialog( const std::string& msg) } LLUploadDialog::sDialog = this; - const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); + const LLFontGL* font = LLFontGL::getFontSansSerif(); LLRect msg_rect; for (int line_num=0; line_num<16; ++line_num) { - mLabelBox[line_num] = new LLTextBox( std::string("Filename"), msg_rect, std::string("Filename"), font ); + LLTextBox::Params params; + params.name("Filename"); + params.rect(msg_rect); + params.text("Filename"); + params.font(font); + mLabelBox[line_num] = LLUICtrlFactory::create<LLTextBox> (params); addChild(mLabelBox[line_num]); } @@ -91,7 +96,7 @@ LLUploadDialog::LLUploadDialog( const std::string& msg) void LLUploadDialog::setMessage( const std::string& msg) { - const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); + const LLFontGL* font = LLFontGL::getFontSansSerif(); const S32 VPAD = 16; const S32 HPAD = 25; @@ -139,7 +144,7 @@ void LLUploadDialog::setMessage( const std::string& msg) msg_rect.setOriginAndSize( msg_x, msg_y, max_msg_width, line_height ); mLabelBox[line_num]->setRect(msg_rect); mLabelBox[line_num]->setText(cur_line); - mLabelBox[line_num]->setColor( gColors.getColor( "LabelTextColor" ) ); + mLabelBox[line_num]->setColor( gSavedSkinSettings.getColor( "LabelTextColor" ) ); mLabelBox[line_num]->setVisible(TRUE); msg_y -= line_height; ++line_num; diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 85ab44bc13dfc154f7da5f449281cc008deb6e00..6c8e7e1f69aeb5c0a70e99290accf239e9f59256 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -42,6 +42,7 @@ #include "llfloaterworldmap.h" #include "llfloaterhtmlhelp.h" #include "llpanellogin.h" +#include "llslurl.h" #include "llstartup.h" // gStartupState #include "llurlsimstring.h" #include "llweb.h" @@ -50,20 +51,9 @@ // library includes #include "llsd.h" -const std::string SLURL_SL_HELP_PREFIX = "secondlife://app."; -const std::string SLURL_SL_PREFIX = "sl://"; -const std::string SLURL_SECONDLIFE_PREFIX = "secondlife://"; -const std::string SLURL_SLURL_PREFIX = "http://slurl.com/secondlife/"; - -const std::string SLURL_APP_TOKEN = "app/"; - class LLURLDispatcherImpl { public: - static bool isSLURL(const std::string& url); - - static bool isSLURLCommand(const std::string& url); - static bool dispatch(const std::string& url, LLWebBrowserCtrl* web, bool trusted_browser); @@ -104,35 +94,9 @@ private: // Called by LLWorldMap when a region name has been resolved to a // location in-world, used by places-panel display. - static bool matchPrefix(const std::string& url, const std::string& prefix); - - static std::string stripProtocol(const std::string& url); - friend class LLTeleportHandler; }; -// static -bool LLURLDispatcherImpl::isSLURL(const std::string& url) -{ - if (matchPrefix(url, SLURL_SL_HELP_PREFIX)) return true; - if (matchPrefix(url, SLURL_SL_PREFIX)) return true; - if (matchPrefix(url, SLURL_SECONDLIFE_PREFIX)) return true; - if (matchPrefix(url, SLURL_SLURL_PREFIX)) return true; - return false; -} - -// static -bool LLURLDispatcherImpl::isSLURLCommand(const std::string& url) -{ - if (matchPrefix(url, SLURL_SL_PREFIX + SLURL_APP_TOKEN) - || matchPrefix(url, SLURL_SECONDLIFE_PREFIX + "/" + SLURL_APP_TOKEN) - || matchPrefix(url, SLURL_SLURL_PREFIX + SLURL_APP_TOKEN) ) - { - return true; - } - return false; -} - // static bool LLURLDispatcherImpl::dispatchCore(const std::string& url, bool right_mouse, @@ -178,7 +142,7 @@ bool LLURLDispatcherImpl::dispatchRightClick(const std::string& url) bool LLURLDispatcherImpl::dispatchHelp(const std::string& url, bool right_mouse) { #if LL_LIBXUL_ENABLED - if (matchPrefix(url, SLURL_SL_HELP_PREFIX)) + if (LLSLURL::isURLHelp(url)) { gViewerHtmlHelp.show(); return true; @@ -193,7 +157,7 @@ bool LLURLDispatcherImpl::dispatchApp(const std::string& url, LLWebBrowserCtrl* web, bool trusted_browser) { - if (!isSLURL(url)) + if (!LLSLURL::isSLURL(url)) { return false; } @@ -211,7 +175,7 @@ bool LLURLDispatcherImpl::dispatchApp(const std::string& url, // static bool LLURLDispatcherImpl::dispatchRegion(const std::string& url, bool right_mouse) { - if (!isSLURL(url)) + if (!LLSLURL::isSLURL(url)) { return false; } @@ -230,7 +194,7 @@ bool LLURLDispatcherImpl::dispatchRegion(const std::string& url, bool right_mous return true; } - std::string sim_string = stripProtocol(url); + std::string sim_string = LLSLURL::stripProtocol(url); std::string region_name; S32 x = 128; S32 y = 128; @@ -251,7 +215,7 @@ bool LLURLDispatcherImpl::dispatchRegion(const std::string& url, bool right_mous /*static*/ void LLURLDispatcherImpl::regionNameCallback(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport) { - std::string sim_string = stripProtocol(url); + std::string sim_string = LLSLURL::stripProtocol(url); std::string region_name; S32 x = 128; S32 y = 128; @@ -289,7 +253,7 @@ void LLURLDispatcherImpl::regionNameCallback(U64 region_handle, const std::strin /* static */ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport) { - std::string sim_string = stripProtocol(url); + std::string sim_string = LLSLURL::stripProtocol(url); std::string region_name; S32 x = 128; S32 y = 128; @@ -316,10 +280,7 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const std::str LLVector3d global_pos = from_region_handle(region_handle); global_pos += LLVector3d(local_pos); gAgent.teleportViaLocation(global_pos); - if(gFloaterWorldMap) - { - gFloaterWorldMap->trackLocation(global_pos); - } + LLFloaterWorldMap::getInstance()->trackLocation(global_pos); } else { @@ -337,37 +298,6 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const std::str } } -// static -bool LLURLDispatcherImpl::matchPrefix(const std::string& url, const std::string& prefix) -{ - std::string test_prefix = url.substr(0, prefix.length()); - LLStringUtil::toLower(test_prefix); - return test_prefix == prefix; -} - -// static -std::string LLURLDispatcherImpl::stripProtocol(const std::string& url) -{ - std::string stripped = url; - if (matchPrefix(stripped, SLURL_SL_HELP_PREFIX)) - { - stripped.erase(0, SLURL_SL_HELP_PREFIX.length()); - } - else if (matchPrefix(stripped, SLURL_SL_PREFIX)) - { - stripped.erase(0, SLURL_SL_PREFIX.length()); - } - else if (matchPrefix(stripped, SLURL_SECONDLIFE_PREFIX)) - { - stripped.erase(0, SLURL_SECONDLIFE_PREFIX.length()); - } - else if (matchPrefix(stripped, SLURL_SLURL_PREFIX)) - { - stripped.erase(0, SLURL_SLURL_PREFIX.length()); - } - return stripped; -} - //--------------------------------------------------------------------------- // Teleportation links are handled here because they are tightly coupled // to URL parsing and sim-fragment parsing @@ -390,7 +320,7 @@ public: std::string region_name = LLURLSimString::unescapeRegionName(tokens[0]); // build secondlife://De%20Haro/123/45/67 for use in callback - std::string url = SLURL_SECONDLIFE_PREFIX; + std::string url = LLSLURL::PREFIX_SECONDLIFE; for (int i = 0; i < tokens.size(); ++i) { url += tokens[i].asString() + "/"; @@ -406,18 +336,6 @@ LLTeleportHandler gTeleportHandler; //--------------------------------------------------------------------------- -// static -bool LLURLDispatcher::isSLURL(const std::string& url) -{ - return LLURLDispatcherImpl::isSLURL(url); -} - -// static -bool LLURLDispatcher::isSLURLCommand(const std::string& url) -{ - return LLURLDispatcherImpl::isSLURLCommand(url); -} - // static bool LLURLDispatcher::dispatch(const std::string& url, LLWebBrowserCtrl* web, @@ -445,12 +363,3 @@ bool LLURLDispatcher::dispatchFromTextEditor(const std::string& url) LLWebBrowserCtrl* web = NULL; return LLURLDispatcherImpl::dispatch(url, web, trusted_browser); } - -// static -std::string LLURLDispatcher::buildSLURL(const std::string& regionname, - S32 x, S32 y, S32 z) -{ - std::string slurl = SLURL_SLURL_PREFIX + regionname + llformat("/%d/%d/%d",x,y,z); - slurl = LLWeb::escapeURL( slurl ); - return slurl; -} diff --git a/indra/newview/llurldispatcher.h b/indra/newview/llurldispatcher.h index a4f6866a0759d47f1e0fd654229fb64adeb40c8f..15e3ec73d8a68391664c784bb46dffc2fafdc198 100644 --- a/indra/newview/llurldispatcher.h +++ b/indra/newview/llurldispatcher.h @@ -38,12 +38,6 @@ class LLWebBrowserCtrl; class LLURLDispatcher { public: - static bool isSLURL(const std::string& url); - // Is this any sort of secondlife:// or sl:// URL? - - static bool isSLURLCommand(const std::string& url); - // Is this a special secondlife://app/ URL? - static bool dispatch(const std::string& url, LLWebBrowserCtrl* web, bool trusted_browser); @@ -63,9 +57,6 @@ public: static bool dispatchRightClick(const std::string& url); static bool dispatchFromTextEditor(const std::string& url); - - static std::string buildSLURL(const std::string& regionname, S32 x, S32 y, S32 z); - // builds: http://slurl.com/secondlife/RegionName/x/y/z/ }; #endif diff --git a/indra/newview/llviewchildren.cpp b/indra/newview/llviewchildren.cpp index 1a66b2489115b07f869d4e18f3f19ce9a64c31bb..842ffc7f9a39e605bb6582ddd4aea13309b067c6 100644 --- a/indra/newview/llviewchildren.cpp +++ b/indra/newview/llviewchildren.cpp @@ -94,10 +94,10 @@ void LLViewChildren::setBadge(const std::string& id, Badge badge, bool visible) switch (badge) { default: - case BADGE_OK: child->setImage(std::string("badge_ok.j2c")); break; - case BADGE_NOTE: child->setImage(std::string("badge_note.j2c")); break; - case BADGE_WARN: child->setImage(std::string("badge_warn.j2c")); break; - case BADGE_ERROR: child->setImage(std::string("badge_error.j2c")); break; + case BADGE_OK: child->setValue(std::string("badge_ok.j2c")); break; + case BADGE_NOTE: child->setValue(std::string("badge_note.j2c")); break; + case BADGE_WARN: child->setValue(std::string("badge_warn.j2c")); break; + case BADGE_ERROR: child->setValue(std::string("badge_error.j2c")); break; } } } diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index 72d1494d9632b9bbe2a163db08d6ea6a00591eb5..3f3c10a7c79d21ea8a59bca9d0f7f90762fcf972 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -31,18 +31,12 @@ */ #include "llviewerprecompiledheaders.h" -#include "llviewercamera.h" - -#include <iomanip> // for setprecision -#include "llquaternion.h" +#include "llviewercamera.h" +// Viewer includes #include "llagent.h" #include "llviewercontrol.h" -#include "lldrawable.h" -#include "llface.h" -#include "llgl.h" -#include "llglheaders.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llviewerwindow.h" @@ -51,6 +45,17 @@ #include "lltoolmgr.h" #include "llviewerjoystick.h" +// Linden library includes +#include "lldrawable.h" +#include "llface.h" +#include "llgl.h" +#include "llglheaders.h" +#include "llquaternion.h" +#include "llwindow.h" // getPixelAspectRatio() + +// System includes +#include <iomanip> // for setprecision + //glu pick matrix implementation borrowed from Mesa3D glh::matrix4f gl_pick_matrix(GLfloat x, GLfloat y, GLfloat width, GLfloat height, GLint* viewport) { @@ -106,6 +111,7 @@ LLViewerCamera::LLViewerCamera() : LLCamera() mScreenPixelArea = 0; mZoomFactor = 1.f; mZoomSubregion = 1; + gSavedSettings.getControl("CameraAngle")->getCommitSignal()->connect(boost::bind(&LLViewerCamera::updateCameraAngle, this, _2)); } void LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, @@ -452,8 +458,15 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord } } + LLRect world_view_rect = gViewerWindow->getWorldViewRect(); + S32 viewport[4]; + viewport[0] = world_view_rect.mLeft; + viewport[1] = world_view_rect.mBottom; + viewport[2] = world_view_rect.getWidth(); + viewport[3] = world_view_rect.getHeight(); + if (GL_TRUE == gluProject(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ], - gGLModelView, gGLProjection, (GLint*)gGLViewport, + gGLModelView, gGLProjection, (GLint*)viewport, &x, &y, &z)) { // convert screen coordinates to virtual UI coordinates @@ -461,9 +474,9 @@ 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 - const LLRect& window_rect = gViewerWindow->getWindowRect(); + LLRect world_view_rect = gViewerWindow->getVirtualWorldViewRect(); - // ...sanity check + // convert to pixel coordinates S32 int_x = lltrunc(x); S32 int_y = lltrunc(y); @@ -471,14 +484,14 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord if (clamp) { - if (int_x < window_rect.mLeft) + if (int_x < world_view_rect.mLeft) { - out_point.mX = window_rect.mLeft; + out_point.mX = world_view_rect.mLeft; valid = FALSE; } - else if (int_x > window_rect.mRight) + else if (int_x > world_view_rect.mRight) { - out_point.mX = window_rect.mRight; + out_point.mX = world_view_rect.mRight; valid = FALSE; } else @@ -486,14 +499,14 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord out_point.mX = int_x; } - if (int_y < window_rect.mBottom) + if (int_y < world_view_rect.mBottom) { - out_point.mY = window_rect.mBottom; + out_point.mY = world_view_rect.mBottom; valid = FALSE; } - else if (int_y > window_rect.mTop) + else if (int_y > world_view_rect.mTop) { - out_point.mY = window_rect.mTop; + out_point.mY = world_view_rect.mTop; valid = FALSE; } else @@ -507,19 +520,19 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord out_point.mX = int_x; out_point.mY = int_y; - if (int_x < window_rect.mLeft) + if (int_x < world_view_rect.mLeft) { valid = FALSE; } - else if (int_x > window_rect.mRight) + else if (int_x > world_view_rect.mRight) { valid = FALSE; } - if (int_y < window_rect.mBottom) + if (int_y < world_view_rect.mBottom) { valid = FALSE; } - else if (int_y > window_rect.mTop) + else if (int_y > world_view_rect.mTop) { valid = FALSE; } @@ -548,24 +561,30 @@ BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent, in_front = FALSE; } + LLRect world_view_rect = gViewerWindow->getWorldViewRect(); + S32 viewport[4]; + viewport[0] = world_view_rect.mLeft; + viewport[1] = world_view_rect.mBottom; + viewport[2] = world_view_rect.getWidth(); + viewport[3] = world_view_rect.getHeight(); GLdouble x, y, z; // object's window coords, GL-style if (GL_TRUE == gluProject(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ], gGLModelView, - gGLProjection, (GLint*)gGLViewport, + gGLProjection, (GLint*)viewport, &x, &y, &z)) { 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& window_rect = gViewerWindow->getVirtualWindowRect(); + const LLRect& world_rect = gViewerWindow->getVirtualWorldViewRect(); // ...sanity check S32 int_x = lltrunc(x); S32 int_y = lltrunc(y); // find the center - GLdouble center_x = (GLdouble)(0.5f * (window_rect.mLeft + window_rect.mRight)); - GLdouble center_y = (GLdouble)(0.5f * (window_rect.mBottom + window_rect.mTop)); + GLdouble center_x = (GLdouble)world_rect.getCenterX(); + GLdouble center_y = (GLdouble)world_rect.getCenterY(); if (x == center_x && y == center_y) { @@ -586,41 +605,41 @@ BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent, // the slope of the line is undefined if (line_y > 0.f) { - int_y = window_rect.mTop; + int_y = world_rect.mTop; } else { - int_y = window_rect.mBottom; + int_y = world_rect.mBottom; } } - else if (0 == window_rect.getWidth()) + else if (0 == world_rect.getWidth()) { // the diagonal slope of the view is undefined - if (y < window_rect.mBottom) + if (y < world_rect.mBottom) { - int_y = window_rect.mBottom; + int_y = world_rect.mBottom; } - else if ( y > window_rect.mTop) + else if ( y > world_rect.mTop) { - int_y = window_rect.mTop; + int_y = world_rect.mTop; } } else { F32 line_slope = (F32)(line_y / line_x); - F32 rect_slope = ((F32)window_rect.getHeight()) / ((F32)window_rect.getWidth()); + F32 rect_slope = ((F32)world_rect.getHeight()) / ((F32)world_rect.getWidth()); if (fabs(line_slope) > rect_slope) { if (line_y < 0.f) { // bottom - int_y = window_rect.mBottom; + int_y = world_rect.mBottom; } else { // top - int_y = window_rect.mTop; + int_y = world_rect.mTop; } int_x = lltrunc(((GLdouble)int_y - center_y) / line_slope + center_x); } @@ -629,12 +648,12 @@ BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent, if (line_x < 0.f) { // left - int_x = window_rect.mLeft; + int_x = world_rect.mLeft; } else { // right - int_x = window_rect.mRight; + int_x = world_rect.mRight; } int_y = lltrunc(((GLdouble)int_x - center_x) * line_slope + center_y); } @@ -643,29 +662,30 @@ BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent, // exactly parallel ==> push to the corners if (line_x > 0.f) { - int_x = window_rect.mRight; + int_x = world_rect.mRight; } else { - int_x = window_rect.mLeft; + int_x = world_rect.mLeft; } if (line_y > 0.0f) { - int_y = window_rect.mTop; + int_y = world_rect.mTop; } else { - int_y = window_rect.mBottom; + int_y = world_rect.mBottom; } } } if (!in_front) { - int_x = window_rect.mLeft + window_rect.mRight - int_x; - int_y = window_rect.mBottom + window_rect.mTop - int_y; + int_x = world_rect.mLeft + world_rect.mRight - int_x; + int_y = world_rect.mBottom + world_rect.mTop - int_y; } - out_point.mX = int_x; - out_point.mY = int_y; + + out_point.mX = int_x + world_rect.mLeft; + out_point.mY = int_y + world_rect.mBottom; return TRUE; } return FALSE; @@ -803,3 +823,11 @@ void LLViewerCamera::setDefaultFOV(F32 vertical_fov_rads) { mCameraFOVDefault = vertical_fov_rads; } + +// static +void LLViewerCamera::updateCameraAngle( void* user_data, const LLSD& value) +{ + LLViewerCamera* self=(LLViewerCamera*)user_data; + self->setDefaultFOV(value.asReal()); +} + diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index 6a0c42beecda541e7643946615793b9371c97be0..9615d00200854256e827d6e294ed03b355c6b0f0 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -61,6 +61,7 @@ public: const LLVector3 &point_of_interest); static void updateFrustumPlanes(LLCamera& camera, BOOL ortho = FALSE, BOOL zflip = FALSE, BOOL no_hacks = FALSE); + static void updateCameraAngle(void* user_data, const LLSD& value); void setPerspective(BOOL for_selection, S32 x, S32 y_from_bot, S32 width, S32 height, BOOL limit_select_distance, F32 z_near = 0, F32 z_far = 0); const LLMatrix4 &getProjection() const; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index eb8cdd82b3cdf1718b2db100a83b5d2291035144..320b950649cce63521787103c982d6863b586afa 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -35,7 +35,8 @@ #include "llviewercontrol.h" -#include "indra_constants.h" +// Library includes +#include "llwindow.h" // getGamma() // For Listeners #include "audioengine.h" @@ -45,14 +46,13 @@ #include "llflexibleobject.h" #include "llfeaturemanager.h" #include "llviewershadermgr.h" -#include "llpanelgeneral.h" -#include "llpanelinput.h" + #include "llsky.h" #include "llvieweraudio.h" #include "llviewerimagelist.h" #include "llviewerthrottle.h" #include "llviewerwindow.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llvoiceclient.h" #include "llvosky.h" #include "llvotree.h" @@ -77,11 +77,11 @@ BOOL gHackGodmode = FALSE; #endif -std::map<std::string, LLControlGroup*> gSettings; -LLControlGroup gSavedSettings; // saved at end of session -LLControlGroup gSavedPerAccountSettings; // saved at end of session -LLControlGroup gColors; // read-only -LLControlGroup gCrashSettings; // saved at end of session +LLControlGroup gSavedSettings("Global"); // saved at end of session +LLControlGroup gSavedSkinSettings("Skinning"); // saved at end of session +LLControlGroup gSavedPerAccountSettings("PerAccount"); // saved at end of session +LLControlGroup gCrashSettings("CrashSettings"); // saved at end of session +LLControlGroup gWarningSettings("Warnings"); // persists ignored dialogs/warnings std::string gLastRunVersion; std::string gCurrentVersion; @@ -121,7 +121,7 @@ static bool handleSetShaderChanged(const LLSD& newvalue) static bool handleSetSelfInvisible( const LLSD& newvalue) { - LLVOAvatar::onChangeSelfInvisible( newvalue.asBoolean() ); + LLVOAvatarSelf::onChangeSelfInvisible( newvalue.asBoolean() ); return true; } @@ -378,7 +378,7 @@ static bool handleRenderUseImpostorsChanged(const LLSD& newvalue) static bool handleRenderDebugGLChanged(const LLSD& newvalue) { - gDebugGL = newvalue.asBoolean(); + gDebugGL = newvalue.asBoolean() || gDebugSession; gGL.clearErrors(); return true; } @@ -427,6 +427,16 @@ bool handleVectorizeChanged(const LLSD& newvalue) return true; } +bool handleHighResSnapshotChanged(const LLSD& newvalue) +{ + // High Res Snapshot active, must uncheck RenderUIInSnapshot + if (newvalue.asBoolean()) + { + gSavedSettings.setBOOL( "RenderUIInSnapshot", FALSE ); + } + return true; +} + bool handleVoiceClientPrefsChanged(const LLSD& newvalue) { if(gVoiceClient) @@ -436,214 +446,161 @@ bool handleVoiceClientPrefsChanged(const LLSD& newvalue) return true; } +bool handleVelocityInterpolate(const LLSD& newvalue) +{ + LLMessageSystem* msg = gMessageSystem; + if ( newvalue.asBoolean() ) + { + msg->newMessageFast(_PREHASH_VelocityInterpolateOn); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gAgent.sendReliableMessage(); + llinfos << "Velocity Interpolation On" << llendl; + } + else + { + msg->newMessageFast(_PREHASH_VelocityInterpolateOff); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gAgent.sendReliableMessage(); + llinfos << "Velocity Interpolation Off" << llendl; + } + return true; +} + //////////////////////////////////////////////////////////////////////////// void settings_setup_listeners() { - gSavedSettings.getControl("FirstPersonAvatarVisible")->getSignal()->connect(boost::bind(&handleRenderAvatarMouselookChanged, _1)); - gSavedSettings.getControl("RenderFarClip")->getSignal()->connect(boost::bind(&handleRenderFarClipChanged, _1)); - gSavedSettings.getControl("RenderTerrainDetail")->getSignal()->connect(boost::bind(&handleTerrainDetailChanged, _1)); - gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1)); - gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1)); - gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("EnableRippleWater")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("RenderGlowResolutionPow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1)); - gSavedSettings.getControl("RenderAvatarCloth")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("RenderAvatarMaxVisible")->getSignal()->connect(boost::bind(&handleAvatarMaxVisibleChanged, _1)); - gSavedSettings.getControl("RenderAvatarInvisible")->getSignal()->connect(boost::bind(&handleSetSelfInvisible, _1)); - gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _1)); - gSavedSettings.getControl("RenderAvatarLODFactor")->getSignal()->connect(boost::bind(&handleAvatarLODChanged, _1)); - gSavedSettings.getControl("RenderTerrainLODFactor")->getSignal()->connect(boost::bind(&handleTerrainLODChanged, _1)); - gSavedSettings.getControl("RenderTreeLODFactor")->getSignal()->connect(boost::bind(&handleTreeLODChanged, _1)); - gSavedSettings.getControl("RenderFlexTimeFactor")->getSignal()->connect(boost::bind(&handleFlexLODChanged, _1)); - gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&handleBandwidthChanged, _1)); - gSavedSettings.getControl("RenderGamma")->getSignal()->connect(boost::bind(&handleGammaChanged, _1)); - gSavedSettings.getControl("RenderFogRatio")->getSignal()->connect(boost::bind(&handleFogRatioChanged, _1)); - gSavedSettings.getControl("RenderMaxPartCount")->getSignal()->connect(boost::bind(&handleMaxPartCountChanged, _1)); - gSavedSettings.getControl("RenderDynamicLOD")->getSignal()->connect(boost::bind(&handleRenderDynamicLODChanged, _1)); - gSavedSettings.getControl("RenderDebugTextureBind")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1)); - gSavedSettings.getControl("RenderFastAlpha")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1)); - gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1)); - gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1)); - gSavedSettings.getControl("RenderUseFBO")->getSignal()->connect(boost::bind(&handleRenderUseFBOChanged, _1)); - gSavedSettings.getControl("RenderDeferredNoise")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1)); - gSavedSettings.getControl("RenderUseImpostors")->getSignal()->connect(boost::bind(&handleRenderUseImpostorsChanged, _1)); - gSavedSettings.getControl("RenderDebugGL")->getSignal()->connect(boost::bind(&handleRenderDebugGLChanged, _1)); - gSavedSettings.getControl("RenderDebugPipeline")->getSignal()->connect(boost::bind(&handleRenderDebugPipelineChanged, _1)); - gSavedSettings.getControl("RenderResolutionDivisor")->getSignal()->connect(boost::bind(&handleRenderResolutionDivisorChanged, _1)); - gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _1)); - gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&handleChatFontSizeChanged, _1)); - gSavedSettings.getControl("ChatPersistTime")->getSignal()->connect(boost::bind(&handleChatPersistTimeChanged, _1)); - gSavedSettings.getControl("ConsoleMaxLines")->getSignal()->connect(boost::bind(&handleConsoleMaxLinesChanged, _1)); - gSavedSettings.getControl("UploadBakedTexOld")->getSignal()->connect(boost::bind(&handleUploadBakedTexOldChanged, _1)); - gSavedSettings.getControl("UseOcclusion")->getSignal()->connect(boost::bind(&handleUseOcclusionChanged, _1)); - gSavedSettings.getControl("AudioLevelMaster")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelSFX")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelDistance")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelDoppler")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelRolloff")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioStreamingMusic")->getSignal()->connect(boost::bind(&handleAudioStreamMusicChanged, _1)); - gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("MuteMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("MuteMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("MuteVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("MuteAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("MuteUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleRenderUseVBOChanged, _1)); - gSavedSettings.getControl("WLSkyDetail")->getSignal()->connect(boost::bind(&handleWLSkyDetailChanged, _1)); - gSavedSettings.getControl("RenderLightingDetail")->getSignal()->connect(boost::bind(&handleRenderLightingDetailChanged, _1)); - gSavedSettings.getControl("NumpadControl")->getSignal()->connect(boost::bind(&handleNumpadControlChanged, _1)); - gSavedSettings.getControl("JoystickAxis0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("JoystickAxis1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("JoystickAxis2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("JoystickAxis3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("JoystickAxis4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("JoystickAxis5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("JoystickAxis6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisScale0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisScale1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisScale2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisScale3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisScale4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisScale5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisScale6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisDeadZone0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisDeadZone1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisDeadZone2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxisDeadZone6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("AvatarAxisScale0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("AvatarAxisScale1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("AvatarAxisScale2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("AvatarAxisScale3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("AvatarAxisScale4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("AvatarAxisScale5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("AvatarAxisDeadZone0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("AvatarAxisDeadZone1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("AvatarAxisDeadZone2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("AvatarAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("AvatarAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("AvatarAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("BuildAxisScale0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("BuildAxisScale1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("BuildAxisScale2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("BuildAxisScale3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("BuildAxisScale4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("BuildAxisScale5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("BuildAxisDeadZone0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("BuildAxisDeadZone1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("BuildAxisDeadZone2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("BuildAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("BuildAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("BuildAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("DebugViews")->getSignal()->connect(boost::bind(&handleDebugViewsChanged, _1)); - gSavedSettings.getControl("UserLogFile")->getSignal()->connect(boost::bind(&handleLogFileChanged, _1)); - gSavedSettings.getControl("RenderHideGroupTitle")->getSignal()->connect(boost::bind(handleHideGroupTitleChanged, _1)); - gSavedSettings.getControl("EffectColor")->getSignal()->connect(boost::bind(handleEffectColorChanged, _1)); - gSavedSettings.getControl("VectorizePerfTest")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1)); - gSavedSettings.getControl("VectorizeEnable")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1)); - gSavedSettings.getControl("VectorizeProcessor")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1)); - gSavedSettings.getControl("VectorizeSkin")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1)); - gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("PTTCurrentlyEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("PushToTalkButton")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("PushToTalkToggle")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("VoiceEarLocation")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("VoiceInputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); -} - -template <> eControlType get_control_type<U32>(const U32& in, LLSD& out) -{ - out = (LLSD::Integer)in; - return TYPE_U32; -} - -template <> eControlType get_control_type<S32>(const S32& in, LLSD& out) -{ - out = in; - return TYPE_S32; -} - -template <> eControlType get_control_type<F32>(const F32& in, LLSD& out) -{ - out = in; - return TYPE_F32; -} - -template <> eControlType get_control_type<bool> (const bool& in, LLSD& out) -{ - out = in; - return TYPE_BOOLEAN; -} -/* -// Yay BOOL, its really an S32. -template <> eControlType get_control_type<BOOL> (const BOOL& in, LLSD& out) -{ - out = in; - return TYPE_BOOLEAN; -} -*/ -template <> eControlType get_control_type<std::string>(const std::string& in, LLSD& out) -{ - out = in; - return TYPE_STRING; -} - -template <> eControlType get_control_type<LLVector3>(const LLVector3& in, LLSD& out) -{ - out = in.getValue(); - return TYPE_VEC3; -} - -template <> eControlType get_control_type<LLVector3d>(const LLVector3d& in, LLSD& out) -{ - out = in.getValue(); - return TYPE_VEC3D; -} - -template <> eControlType get_control_type<LLRect>(const LLRect& in, LLSD& out) -{ - out = in.getValue(); - return TYPE_RECT; -} - -template <> eControlType get_control_type<LLColor4>(const LLColor4& in, LLSD& out) -{ - out = in.getValue(); - return TYPE_COL4; -} - -template <> eControlType get_control_type<LLColor3>(const LLColor3& in, LLSD& out) -{ - out = in.getValue(); - return TYPE_COL3; -} - -template <> eControlType get_control_type<LLColor4U>(const LLColor4U& in, LLSD& out) -{ - out = in.getValue(); - return TYPE_COL4U; -} - -template <> eControlType get_control_type<LLSD>(const LLSD& in, LLSD& out) -{ - out = in; - return TYPE_LLSD; + gSavedSettings.getControl("FirstPersonAvatarVisible")->getSignal()->connect(boost::bind(&handleRenderAvatarMouselookChanged, _2)); + gSavedSettings.getControl("RenderFarClip")->getSignal()->connect(boost::bind(&handleRenderFarClipChanged, _2)); + gSavedSettings.getControl("RenderTerrainDetail")->getSignal()->connect(boost::bind(&handleTerrainDetailChanged, _2)); + gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("EnableRippleWater")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("RenderGlowResolutionPow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderAvatarCloth")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("RenderAvatarMaxVisible")->getSignal()->connect(boost::bind(&handleAvatarMaxVisibleChanged, _2)); + gSavedSettings.getControl("RenderAvatarInvisible")->getSignal()->connect(boost::bind(&handleSetSelfInvisible, _2)); + gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _2)); + gSavedSettings.getControl("RenderAvatarLODFactor")->getSignal()->connect(boost::bind(&handleAvatarLODChanged, _2)); + gSavedSettings.getControl("RenderTerrainLODFactor")->getSignal()->connect(boost::bind(&handleTerrainLODChanged, _2)); + gSavedSettings.getControl("RenderTreeLODFactor")->getSignal()->connect(boost::bind(&handleTreeLODChanged, _2)); + gSavedSettings.getControl("RenderFlexTimeFactor")->getSignal()->connect(boost::bind(&handleFlexLODChanged, _2)); + gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&handleBandwidthChanged, _2)); + gSavedSettings.getControl("RenderGamma")->getSignal()->connect(boost::bind(&handleGammaChanged, _2)); + gSavedSettings.getControl("RenderFogRatio")->getSignal()->connect(boost::bind(&handleFogRatioChanged, _2)); + gSavedSettings.getControl("RenderMaxPartCount")->getSignal()->connect(boost::bind(&handleMaxPartCountChanged, _2)); + gSavedSettings.getControl("RenderDynamicLOD")->getSignal()->connect(boost::bind(&handleRenderDynamicLODChanged, _2)); + gSavedSettings.getControl("RenderDebugTextureBind")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderFastAlpha")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderUseFBO")->getSignal()->connect(boost::bind(&handleRenderUseFBOChanged, _2)); + gSavedSettings.getControl("RenderDeferredNoise")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderUseImpostors")->getSignal()->connect(boost::bind(&handleRenderUseImpostorsChanged, _2)); + gSavedSettings.getControl("RenderDebugGL")->getSignal()->connect(boost::bind(&handleRenderDebugGLChanged, _2)); + gSavedSettings.getControl("RenderDebugPipeline")->getSignal()->connect(boost::bind(&handleRenderDebugPipelineChanged, _2)); + gSavedSettings.getControl("RenderResolutionDivisor")->getSignal()->connect(boost::bind(&handleRenderResolutionDivisorChanged, _2)); + gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _2)); + gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&handleChatFontSizeChanged, _2)); + gSavedSettings.getControl("ChatPersistTime")->getSignal()->connect(boost::bind(&handleChatPersistTimeChanged, _2)); + gSavedSettings.getControl("ConsoleMaxLines")->getSignal()->connect(boost::bind(&handleConsoleMaxLinesChanged, _2)); + gSavedSettings.getControl("UploadBakedTexOld")->getSignal()->connect(boost::bind(&handleUploadBakedTexOldChanged, _2)); + gSavedSettings.getControl("UseOcclusion")->getSignal()->connect(boost::bind(&handleUseOcclusionChanged, _2)); + gSavedSettings.getControl("AudioLevelMaster")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("AudioLevelSFX")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("AudioLevelUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("AudioLevelAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("AudioLevelMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("AudioLevelMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("AudioLevelVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("AudioLevelDistance")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("AudioLevelDoppler")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("AudioLevelRolloff")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("AudioStreamingMusic")->getSignal()->connect(boost::bind(&handleAudioStreamMusicChanged, _2)); + gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("MuteMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("MuteMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("MuteVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("MuteAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("MuteUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2)); + gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleRenderUseVBOChanged, _2)); + gSavedSettings.getControl("WLSkyDetail")->getSignal()->connect(boost::bind(&handleWLSkyDetailChanged, _2)); + gSavedSettings.getControl("RenderLightingDetail")->getSignal()->connect(boost::bind(&handleRenderLightingDetailChanged, _2)); + gSavedSettings.getControl("NumpadControl")->getSignal()->connect(boost::bind(&handleNumpadControlChanged, _2)); + gSavedSettings.getControl("JoystickAxis0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("JoystickAxis1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("JoystickAxis2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("JoystickAxis3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("JoystickAxis4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("JoystickAxis5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("JoystickAxis6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisScale0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisScale1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisScale2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisScale3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisScale4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisScale5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisScale6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisDeadZone0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisDeadZone1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisDeadZone2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("FlycamAxisDeadZone6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("AvatarAxisScale0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("AvatarAxisScale1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("AvatarAxisScale2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("AvatarAxisScale3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("AvatarAxisScale4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("AvatarAxisScale5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("AvatarAxisDeadZone0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("AvatarAxisDeadZone1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("AvatarAxisDeadZone2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("AvatarAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("AvatarAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("AvatarAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("BuildAxisScale0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("BuildAxisScale1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("BuildAxisScale2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("BuildAxisScale3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("BuildAxisScale4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("BuildAxisScale5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("BuildAxisDeadZone0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("BuildAxisDeadZone1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("BuildAxisDeadZone2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("BuildAxisDeadZone3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("BuildAxisDeadZone4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("BuildAxisDeadZone5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); + gSavedSettings.getControl("DebugViews")->getSignal()->connect(boost::bind(&handleDebugViewsChanged, _2)); + gSavedSettings.getControl("UserLogFile")->getSignal()->connect(boost::bind(&handleLogFileChanged, _2)); + gSavedSettings.getControl("RenderHideGroupTitle")->getSignal()->connect(boost::bind(handleHideGroupTitleChanged, _2)); + gSavedSkinSettings.getControl("EffectColor")->getSignal()->connect(boost::bind(handleEffectColorChanged, _2)); + gSavedSettings.getControl("HighResSnapshot")->getSignal()->connect(boost::bind(handleHighResSnapshotChanged, _2)); + gSavedSettings.getControl("VectorizePerfTest")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2)); + gSavedSettings.getControl("VectorizeEnable")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2)); + gSavedSettings.getControl("VectorizeProcessor")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2)); + gSavedSettings.getControl("VectorizeSkin")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2)); + gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2)); + gSavedSettings.getControl("PTTCurrentlyEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2)); + gSavedSettings.getControl("PushToTalkButton")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2)); + gSavedSettings.getControl("PushToTalkToggle")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2)); + gSavedSettings.getControl("VoiceEarLocation")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2)); + gSavedSettings.getControl("VoiceInputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2)); + gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2)); + gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2)); + gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2)); + gSavedSettings.getControl("VelocityInterpolate")->getSignal()->connect(boost::bind(&handleVelocityInterpolate, _2)); } diff --git a/indra/newview/llviewercontrol.h b/indra/newview/llviewercontrol.h index c4003111d3a74352a82c0d02f978d6c6beea22f7..3271e5fe9b6999d0be1b2340e3a6c20083833754 100644 --- a/indra/newview/llviewercontrol.h +++ b/indra/newview/llviewercontrol.h @@ -47,17 +47,14 @@ extern BOOL gHackGodmode; //setting variables are declared in this function void settings_setup_listeners(); -extern std::map<std::string, LLControlGroup*> gSettings; - // for the graphics settings void create_graphics_group(LLControlGroup& group); // saved at end of session extern LLControlGroup gSavedSettings; +extern LLControlGroup gSavedSkinSettings; extern LLControlGroup gSavedPerAccountSettings; - -// Read-only -extern LLControlGroup gColors; +extern LLControlGroup gWarningSettings; // Saved at end of session extern LLControlGroup gCrashSettings; @@ -66,110 +63,5 @@ extern LLControlGroup gCrashSettings; extern std::string gLastRunVersion; extern std::string gCurrentVersion; -//! Helper function for LLCachedControl -template <class T> -eControlType get_control_type(const T& in, LLSD& out) -{ - llerrs << "Usupported control type: " << typeid(T).name() << "." << llendl; - return TYPE_COUNT; -} - -//! Publish/Subscribe object to interact with LLControlGroups. - -//! An LLCachedControl instance to connect to a LLControlVariable -//! without have to manually create and bind a listener to a local -//! object. -template <class T> -class LLCachedControl -{ - T mCachedValue; - LLPointer<LLControlVariable> mControl; - boost::signals2::scoped_connection mConnection; - -public: - LLCachedControl(const std::string& name, - const T& default_value, - const std::string& comment = "Declared In Code") - { - mControl = gSavedSettings.getControl(name); - if(mControl.isNull()) - { - declareTypedControl(gSavedSettings, name, default_value, comment); - mControl = gSavedSettings.getControl(name); - if(mControl.isNull()) - { - llerrs << "The control could not be created!!!" << llendl; - } - - mCachedValue = default_value; - } - else - { - mCachedValue = (const T&)mControl->getValue(); - } - - // Add a listener to the controls signal... - mConnection = mControl->getSignal()->connect( - boost::bind(&LLCachedControl<T>::handleValueChange, this, _1) - ); - } - - ~LLCachedControl() - { - } - - LLCachedControl& operator =(const T& newvalue) - { - setTypeValue(*mControl, newvalue); - } - - operator const T&() { return mCachedValue; } - -private: - void declareTypedControl(LLControlGroup& group, - const std::string& name, - const T& default_value, - const std::string& comment) - { - LLSD init_value; - eControlType type = get_control_type<T>(default_value, init_value); - if(type < TYPE_COUNT) - { - group.declareControl(name, type, init_value, comment, FALSE); - } - } - - bool handleValueChange(const LLSD& newvalue) - { - mCachedValue = (const T &)newvalue; - return true; - } - - void setTypeValue(LLControlVariable& c, const T& v) - { - // Implicit conversion from T to LLSD... - c.set(v); - } -}; - -template <> eControlType get_control_type<U32>(const U32& in, LLSD& out); -template <> eControlType get_control_type<S32>(const S32& in, LLSD& out); -template <> eControlType get_control_type<F32>(const F32& in, LLSD& out); -template <> eControlType get_control_type<bool> (const bool& in, LLSD& out); -// Yay BOOL, its really an S32. -//template <> eControlType get_control_type<BOOL> (const BOOL& in, LLSD& out) -template <> eControlType get_control_type<std::string>(const std::string& in, LLSD& out); -template <> eControlType get_control_type<LLVector3>(const LLVector3& in, LLSD& out); -template <> eControlType get_control_type<LLVector3d>(const LLVector3d& in, LLSD& out); -template <> eControlType get_control_type<LLRect>(const LLRect& in, LLSD& out); -template <> eControlType get_control_type<LLColor4>(const LLColor4& in, LLSD& out); -template <> eControlType get_control_type<LLColor3>(const LLColor3& in, LLSD& out); -template <> eControlType get_control_type<LLColor4U>(const LLColor4U& in, LLSD& out); -template <> eControlType get_control_type<LLSD>(const LLSD& in, LLSD& out); - -//#define TEST_CACHED_CONTROL 1 -#ifdef TEST_CACHED_CONTROL -void test_cached_control(); -#endif // TEST_CACHED_CONTROL #endif // LL_LLVIEWERCONTROL_H diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 977582ba247d32e52259e09d1a5140ee2bd12d4a..a340514e3b5c7b3a9db2cac6d614027798520097 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -46,10 +46,10 @@ #include "lldrawpoolalpha.h" #include "llfeaturemanager.h" #include "llfirstuse.h" -#include "llframestats.h" #include "llhudmanager.h" #include "llimagebmp.h" #include "llimagegl.h" +#include "llmemory.h" #include "llselectmgr.h" #include "llsky.h" #include "llstartup.h" @@ -58,12 +58,13 @@ #include "lltooldraganddrop.h" #include "lltoolpie.h" #include "lltracker.h" +#include "lltrans.h" #include "llui.h" #include "llviewercamera.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerwindow.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llvograss.h" #include "llworld.h" #include "pipeline.h" @@ -163,6 +164,7 @@ void display_startup() void display_update_camera() { + LLMemType mt_uc(LLMemType::MTYPE_DISPLAY_UPDATE_CAMERA); llpushcallstacks ; // TODO: cut draw distance down if customizing avatar? // TODO: cut draw distance on per-parcel basis? @@ -199,7 +201,7 @@ void display_stats() F32 mem_log_freq = gSavedSettings.getF32("MemoryLogFrequency"); if (mem_log_freq > 0.f && gRecentMemoryTime.getElapsedTimeF32() >= mem_log_freq) { - gMemoryAllocated = getCurrentRSS(); + gMemoryAllocated = LLMemory::getCurrentRSS(); U32 memory = (U32)(gMemoryAllocated / (1024*1024)); llinfos << llformat("MEMORY: %d MB", memory) << llendl; gRecentMemoryTime.reset(); @@ -209,6 +211,7 @@ void display_stats() // Paint the display! void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) { + LLMemType mt_render(LLMemType::MTYPE_RENDER); LLFastTimer t(LLFastTimer::FTM_RENDER); if (LLPipeline::sRenderFrameTest) @@ -226,8 +229,12 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLGLState::checkStates(); LLGLState::checkTextureChannels(); + stop_glerror(); + gPipeline.disableLights(); + stop_glerror(); + // Don't draw if the window is hidden or minimized. // In fact, must explicitly check the minimized state before drawing. // Attempting to draw into a minimized window causes a GL error. JC @@ -238,11 +245,14 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // Clean up memory the pools may have allocated if (rebuild) { - gFrameStats.start(LLFrameStats::REBUILD); + stop_glerror(); gPipeline.rebuildPools(); + stop_glerror(); } + stop_glerror(); gViewerWindow->returnEmptyPicks(); + stop_glerror(); return; } @@ -299,7 +309,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // LLAppViewer::instance()->pingMainloopTimeout("Display:TextureStats"); - gFrameStats.start(LLFrameStats::UPDATE_TEX_STATS); stop_glerror(); LLImageGL::updateStats(gFrameTimeSeconds); @@ -369,7 +378,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) case LLAgent::TELEPORT_START_ARRIVAL: // Transition to ARRIVING. Viewer has received avatar update, etc., from destination simulator gTeleportArrivalTimer.reset(); - gViewerWindow->setProgressCancelButtonVisible(FALSE, std::string("Cancel")); //TODO: Translate + gViewerWindow->setProgressCancelButtonVisible(FALSE, LLTrans::getString("Cancel")); gViewerWindow->setProgressPercent(75.f); gAgent.setTeleportState( LLAgent::TELEPORT_ARRIVING ); gAgent.setTeleportMessage( @@ -388,7 +397,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLFirstUse::useTeleport(); gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); } - gViewerWindow->setProgressCancelButtonVisible(FALSE, std::string("Cancel")); //TODO: Translate + gViewerWindow->setProgressCancelButtonVisible(FALSE, LLTrans::getString("Cancel")); gViewerWindow->setProgressPercent( arrival_fraction * 25.f + 75.f); gViewerWindow->setProgressString(message); } @@ -504,11 +513,12 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) } } - gViewerWindow->setupViewport(); + gViewerWindow->setup3DViewport(); gPipeline.resetFrameStats(); // Reset per-frame statistics. if (!gDisconnected) { + LLMemType mt_du(LLMemType::MTYPE_DISPLAY_UPDATE); LLAppViewer::instance()->pingMainloopTimeout("Display:Update"); if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD)) { //don't draw hud objects in this frame @@ -528,17 +538,21 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) stop_glerror(); // *TODO: merge these two methods - LLHUDManager::getInstance()->updateEffects(); - LLHUDObject::updateAll(); - stop_glerror(); - - gFrameStats.start(LLFrameStats::UPDATE_GEOM); - const F32 max_geom_update_time = 0.005f*10.f*gFrameIntervalSeconds; // 50 ms/second update time - gPipeline.createObjects(max_geom_update_time); - gPipeline.updateGeom(max_geom_update_time); - stop_glerror(); - - gFrameStats.start(LLFrameStats::UPDATE_CULL); + { + LLMemType mt_uh(LLMemType::MTYPE_DISPLAY_UPDATE_HUD); + LLHUDManager::getInstance()->updateEffects(); + LLHUDObject::updateAll(); + stop_glerror(); + } + + { + LLMemType mt_ug(LLMemType::MTYPE_DISPLAY_UPDATE_GEOM); + const F32 max_geom_update_time = 0.005f*10.f*gFrameIntervalSeconds; // 50 ms/second update time + gPipeline.createObjects(max_geom_update_time); + gPipeline.updateGeom(max_geom_update_time); + stop_glerror(); + } + S32 water_clip = 0; if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT) > 1) && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_WATER)) @@ -552,7 +566,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) water_clip = 1; } } - + LLAppViewer::instance()->pingMainloopTimeout("Display:Cull"); //Increment drawable frame counter @@ -601,6 +615,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLAppViewer::instance()->pingMainloopTimeout("Display:Swap"); { + LLMemType mt_ds(LLMemType::MTYPE_DISPLAY_SWAP); { LLFastTimer ftm(LLFastTimer::FTM_CLIENT_COPY); LLVertexBuffer::clientCopy(0.016); @@ -643,7 +658,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) glLoadMatrixf(proj.m); glMatrixMode(GL_MODELVIEW); glLoadMatrixf(mod.m); - gViewerWindow->setupViewport(); + gViewerWindow->setup3DViewport(); LLGLState::checkStates(); LLGLState::checkTextureChannels(); @@ -655,6 +670,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) if (!for_snapshot) { + LLMemType mt_gw(LLMemType::MTYPE_DISPLAY_GEN_REFLECTION); LLAppViewer::instance()->pingMainloopTimeout("Display:Imagery"); gPipeline.generateWaterReflection(*LLViewerCamera::getInstance()); } @@ -669,9 +685,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLAppViewer::instance()->pingMainloopTimeout("Display:UpdateImages"); LLError::LLCallStacks::clear() ; llpushcallstacks ; - gFrameStats.start(LLFrameStats::IMAGE_UPDATE); { + LLMemType mt_iu(LLMemType::MTYPE_DISPLAY_IMAGE_UPDATE); LLFastTimer t(LLFastTimer::FTM_IMAGE_UPDATE); LLViewerImage::updateClass(LLViewerCamera::getInstance()->getVelocityStat()->getMean(), @@ -694,7 +710,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // LLAppViewer::instance()->pingMainloopTimeout("Display:StateSort"); { - gFrameStats.start(LLFrameStats::STATE_SORT); + LLMemType mt_ss(LLMemType::MTYPE_DISPLAY_STATE_SORT); gPipeline.stateSort(*LLViewerCamera::getInstance(), result); stop_glerror(); @@ -705,7 +721,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // rebuildPools // // - gFrameStats.start(LLFrameStats::REBUILD); gPipeline.rebuildPools(); stop_glerror(); } @@ -714,6 +729,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLPipeline::sUseOcclusion = occlusion; { + LLMemType mt_ds(LLMemType::MTYPE_DISPLAY_SKY); LLAppViewer::instance()->pingMainloopTimeout("Display:Sky"); LLFastTimer t(LLFastTimer::FTM_UPDATE_SKY); gSky.updateSky(); @@ -741,7 +757,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE); // glLoadIdentity(); - // LLRect floater_rect = frontmost_floaterp->getScreenRect(); + // 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(), @@ -792,7 +808,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) if (!(LLAppViewer::instance()->logoutRequestSent() && LLAppViewer::instance()->hasSavedFinalSnapshot()) && !gRestoreGL) { - + LLMemType mt_rg(LLMemType::MTYPE_DISPLAY_RENDER_GEOM); gGL.setColorMask(true, false); if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) { @@ -818,6 +834,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) if (to_texture) { + LLMemType mt_rf(LLMemType::MTYPE_DISPLAY_RENDER_FLUSH); if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) { gPipeline.mDeferredScreen.flush(); @@ -844,16 +861,15 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLAppViewer::instance()->pingMainloopTimeout("Display:RenderUI"); if (!for_snapshot) { - gFrameStats.start(LLFrameStats::RENDER_UI); + LLFastTimer t(LLFastTimer::FTM_RENDER_UI); render_ui(); } LLSpatialGroup::sNoDelete = FALSE; } - + LLAppViewer::instance()->pingMainloopTimeout("Display:FrameStats"); - gFrameStats.start(LLFrameStats::MISC_END); stop_glerror(); if (LLPipeline::sRenderFrameTest) @@ -869,6 +885,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) void render_hud_attachments() { + LLMemType mt_ra(LLMemType::MTYPE_DISPLAY_RENDER_ATTACHMENTS); glMatrixMode(GL_PROJECTION); glPushMatrix(); glMatrixMode(GL_MODELVIEW); @@ -1027,6 +1044,7 @@ BOOL setup_hud_matrices(const LLRect& screen_region) void render_ui(F32 zoom_factor, int subfield) { + LLMemType mt_ru(LLMemType::MTYPE_DISPLAY_RENDER_UI); LLGLState::checkStates(); glPushMatrix(); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp new file mode 100644 index 0000000000000000000000000000000000000000..950d5ba20c891215cb742243efc9146be488d039 --- /dev/null +++ b/indra/newview/llviewerfloaterreg.cpp @@ -0,0 +1,112 @@ +/** + * @file llviewerfloaterreg.cpp + * @brief LLViewerFloaterReg class registers floaters used in the viewer + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterreg.h" + +#include "llviewerfloaterreg.h" + +#include "llcompilequeue.h" +#include "llfloaterabout.h" +#include "llfloateraddlandmark.h" +#include "llfloateravatarinfo.h" +#include "llfloaterchat.h" +#include "llfloaterchatterbox.h" +#include "llfloaterdirectory.h" +#include "llfloaterjoystick.h" +#include "llfloatervoicedevicesettings.h" +#include "llfloatermap.h" +#include "llfloatermemleak.h" +#include "llfloatermute.h" +#include "llfloaterpreference.h" +#include "llfloatersnapshot.h" +#include "llfloatertools.h" +#include "llfloateruipreview.h" +#include "llfloaterworldmap.h" +#include "llinventoryview.h" +#include "llnearbychathistory.h" + +#include "llpreviewanim.h" +#include "llpreviewgesture.h" +#include "llpreviewlandmark.h" +#include "llpreviewnotecard.h" +#include "llpreviewscript.h" +#include "llpreviewsound.h" +#include "llpreviewtexture.h" +#include "llfloaterminiinspector.h" + +void LLViewerFloaterReg::registerFloaters() +{ + LLFloaterReg::add("mini_inspector", "panel_mini_inspector.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMiniInspector>); + LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>); + LLFloaterReg::add("sl_about", "floater_about.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAbout>); + LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSnapshot>); + LLFloaterReg::add("search", "floater_directory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDirectory>); + LLFloaterReg::add("build", "floater_tools.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTools>); + LLFloaterReg::add("world_map", "floater_world_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWorldMap>); + LLFloaterReg::add("mini_map", "floater_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMap>); + LLFloaterReg::add("inventory", "floater_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLInventoryView>); + LLFloaterReg::add("add_landmark", "floater_add_landmark.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAddLandmark>); + LLFloaterReg::add("mute", "floater_mute.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMute>); + + LLFloaterReg::add("ui_preview", "floater_ui_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterUIPreview>); + LLFloaterReg::add("test_widgets", "floater_test_widgets.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>); + + LLFloaterReg::add("pref_joystick", "floater_joystick.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterJoystick>); + LLFloaterReg::add("pref_voicedevicesettings", "floater_device_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterVoiceDeviceSettings>); + + LLFloaterReg::add("communicate", "floater_chatterbox.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterChatterBox>); + LLFloaterReg::add("chat", "floater_chat_history.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterChat>); + LLFloaterReg::add("nearby_chat", "floater_nearby_chat.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNearbyChatHistory>); + LLFloaterReg::add("contacts", "floater_my_friends.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMyFriends>); + + LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCompileQueue>); + LLFloaterReg::add("reset_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterResetQueue>); + LLFloaterReg::add("start_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterRunQueue>); + LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>); + + LLFloaterReg::add("preview_avatar", "floater_profile.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAvatarInfo>); + LLFloaterReg::add("me_profile", "floater_me.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAvatarInfo>); + + LLFloaterReg::add("preview_anim", "floater_preview_animation.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewAnim>, "preview"); + LLFloaterReg::add("preview_gesture", "floater_preview_gesture.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewGesture>, "preview"); + LLFloaterReg::add("preview_landmark", "floater_preview_existing_landmark.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewLandmark>, "preview"); + LLFloaterReg::add("preview_notecard", "floater_preview_notecard.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewNotecard>, "preview"); + LLFloaterReg::add("preview_script", "floater_script_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewLSL>, "preview"); + LLFloaterReg::add("preview_scriptedit", "floater_live_lsleditor.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLLiveLSLEditor>, "preview"); + LLFloaterReg::add("preview_sound", "floater_preview_sound.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewSound>, "preview"); + LLFloaterReg::add("preview_texture", "floater_preview_texture.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewTexture>, "preview"); + + LLFloaterReg::add("stats", "floater_stats.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>); +} diff --git a/indra/newview/llviewerfloaterreg.h b/indra/newview/llviewerfloaterreg.h new file mode 100644 index 0000000000000000000000000000000000000000..08c9589ebbd138135ae3e46dcd038330280d7281 --- /dev/null +++ b/indra/newview/llviewerfloaterreg.h @@ -0,0 +1,43 @@ +/** + * @file llviewerfloaterreg.h + * @brief The LLViewerFloaterReg class declaration + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLVIEWERFLOATERREG_H +#define LL_LLVIEWERFLOATERREG_H + +class LLViewerFloaterReg +{ +public: + static void registerFloaters(); +}; + + +#endif // LL_LLVIEWERFLOATERREG_H diff --git a/indra/newview/llviewergesture.cpp b/indra/newview/llviewergesture.cpp index 168f9af1d125bbb62e174a29c83df1ebf56b0e14..2fb56fbcb82f8878a37859041258359d72851c81 100644 --- a/indra/newview/llviewergesture.cpp +++ b/indra/newview/llviewergesture.cpp @@ -47,6 +47,7 @@ #include "llviewermessage.h" // send_guid_sound_trigger #include "llviewernetwork.h" #include "llagent.h" +#include "llbottomtray.h" // Globals LLViewerGestureList gGestureList; @@ -136,7 +137,7 @@ void LLViewerGesture::doTrigger( BOOL send_chat ) { // Don't play nodding animation, since that might not blend // with the gesture animation. - gChatBar->sendChatFromViewer(mOutputString, CHAT_TYPE_NORMAL, FALSE); + LLBottomTray::getInstance()->sendChatFromViewer(mOutputString, CHAT_TYPE_NORMAL, FALSE); } } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index f47d0777b0e301ffbc1e38d3bc4e57b93abc555b..45d24ee7e83c29b819770b3d450a394c320d13d4 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -44,12 +44,14 @@ #include "llimview.h" #include "llgesturemgr.h" +#include "llinventorybridge.h" #include "llinventoryview.h" #include "llviewerregion.h" #include "llviewerobjectlist.h" #include "llpreviewgesture.h" #include "llviewerwindow.h" +#include "lltrans.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -307,8 +309,8 @@ bool LLViewerInventoryItem::exportFileLocal(LLFILE* fp) const fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str()); mPermissions.exportFile(fp); fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType)); - const char* inv_type_str = LLInventoryType::lookup(mInventoryType); - if(inv_type_str) fprintf(fp, "\t\tinv_type\t%s\n", inv_type_str); + const std::string inv_type_str = LLInventoryType::lookup(mInventoryType); + if(!inv_type_str.empty()) fprintf(fp, "\t\tinv_type\t%s\n", inv_type_str.c_str()); fprintf(fp, "\t\tname\t%s|\n", mName.c_str()); fprintf(fp, "\t\tcreation_date\t%d\n", (S32) mCreationDate); fprintf(fp,"\t}\n"); @@ -684,12 +686,9 @@ void CreateGestureCallback::fire(const LLUUID& inv_item) gInventory.updateItem(item); gInventory.notifyObservers(); - if(!LLPreview::show(inv_item,FALSE)) - { - LLPreviewGesture* preview = LLPreviewGesture::show(std::string("Gesture: ") + item->getName(), inv_item, LLUUID::null); - // Force to be entirely onscreen. - gFloaterView->adjustToFitScreen(preview, FALSE); - } + LLPreviewGesture* preview = LLPreviewGesture::show(inv_item, LLUUID::null); + // Force to be entirely onscreen. + gFloaterView->adjustToFitScreen(preview, FALSE); } LLInventoryCallbackManager gInventoryCallbacks; @@ -800,3 +799,187 @@ void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecar viewer_region->getCapAPI().post(request); } + +void create_new_item(const std::string& name, + const LLUUID& parent_id, + LLAssetType::EType asset_type, + LLInventoryType::EType inv_type, + U32 next_owner_perm) +{ + std::string desc; + LLAssetType::generateDescriptionFor(asset_type, desc); + next_owner_perm = (next_owner_perm) ? next_owner_perm : PERM_MOVE | PERM_TRANSFER; + + + if (inv_type == LLInventoryType::IT_GESTURE) + { + LLPointer<LLInventoryCallback> cb = new CreateGestureCallback(); + create_inventory_item(gAgent.getID(), gAgent.getSessionID(), + parent_id, LLTransactionID::tnull, name, desc, asset_type, inv_type, + NOT_WEARABLE, next_owner_perm, cb); + } + else + { + LLPointer<LLInventoryCallback> cb = NULL; + create_inventory_item(gAgent.getID(), gAgent.getSessionID(), + parent_id, LLTransactionID::tnull, name, desc, asset_type, inv_type, + NOT_WEARABLE, next_owner_perm, cb); + } + +} + +const std::string NEW_LSL_NAME = "New Script"; // *TODO:Translate? (probably not) +const std::string NEW_NOTECARD_NAME = "New Note"; // *TODO:Translate? (probably not) +const std::string NEW_GESTURE_NAME = "New Gesture"; // *TODO:Translate? (probably not) + +void menu_create_inventory_item(LLFolderView* folder, LLFolderBridge *bridge, const LLSD& userdata) +{ + std::string type = userdata.asString(); + + if ("category" == type) + { + LLUUID category; + if (bridge) + { + category = gInventory.createNewCategory(bridge->getUUID(), LLAssetType::AT_NONE, LLStringUtil::null); + } + else + { + category = gInventory.createNewCategory(gAgent.getInventoryRootID(), LLAssetType::AT_NONE, LLStringUtil::null); + } + gInventory.notifyObservers(); + folder->setSelectionByID(category, TRUE); + } + else if ("lsl" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_LSL_TEXT); + create_new_item(NEW_LSL_NAME, + parent_id, + LLAssetType::AT_LSL_TEXT, + LLInventoryType::IT_LSL, + PERM_MOVE | PERM_TRANSFER); + } + else if ("notecard" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_NOTECARD); + create_new_item(NEW_NOTECARD_NAME, + parent_id, + LLAssetType::AT_NOTECARD, + LLInventoryType::IT_NOTECARD, + PERM_ALL); + } + else if ("gesture" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_GESTURE); + create_new_item(NEW_GESTURE_NAME, + parent_id, + LLAssetType::AT_GESTURE, + LLInventoryType::IT_GESTURE, + PERM_ALL); + } + else if ("shirt" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING); + LLFolderBridge::createWearable(parent_id, WT_SHIRT); + } + else if ("pants" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING); + LLFolderBridge::createWearable(parent_id, WT_PANTS); + } + else if ("shoes" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING); + LLFolderBridge::createWearable(parent_id, WT_SHOES); + } + else if ("socks" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING); + LLFolderBridge::createWearable(parent_id, WT_SOCKS); + } + else if ("jacket" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING); + LLFolderBridge::createWearable(parent_id, WT_JACKET); + } + else if ("skirt" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING); + LLFolderBridge::createWearable(parent_id, WT_SKIRT); + } + else if ("gloves" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING); + LLFolderBridge::createWearable(parent_id, WT_GLOVES); + } + else if ("undershirt" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING); + LLFolderBridge::createWearable(parent_id, WT_UNDERSHIRT); + } + else if ("underpants" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING); + LLFolderBridge::createWearable(parent_id, WT_UNDERPANTS); + } + else if ("shape" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_BODYPART); + LLFolderBridge::createWearable(parent_id, WT_SHAPE); + } + else if ("skin" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_BODYPART); + LLFolderBridge::createWearable(parent_id, WT_SKIN); + } + else if ("hair" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_BODYPART); + LLFolderBridge::createWearable(parent_id, WT_HAIR); + } + else if ("eyes" == type) + { + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_BODYPART); + LLFolderBridge::createWearable(parent_id, WT_EYES); + } + + folder->setNeedsAutoRename(TRUE); +} + +LLAssetType::EType LLViewerInventoryItem::getType() const +{ + if (mType == LLAssetType::AT_LINK) + { + LLInventoryItem *linked_item = gInventory.getItem(mAssetUUID); + if (linked_item) + { + return linked_item->getType(); + } + } + return LLInventoryItem::getType(); +} + +const LLUUID& LLViewerInventoryItem::getAssetUUID() const +{ + if (mType == LLAssetType::AT_LINK) + { + LLInventoryItem *linked_item = gInventory.getItem(mAssetUUID); + if (linked_item) + { + return linked_item->getAssetUUID(); + } + } + + return LLInventoryItem::getAssetUUID(); +} + +const std::string& LLViewerInventoryItem::getName() const +{ + if (mType == LLAssetType::AT_LINK) + { + return LLInventoryItem::getName(); //+" link"; + } + + return LLInventoryItem::getName(); +} + diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 1ddf8a58f9cb933332bf0d22830d658b035c526b..8318931dde1bad52b5aa6a345bc3ce8a7ad38ad2 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -37,6 +37,9 @@ #include "llframetimer.h" #include "llwearable.h" +class LLFolderView; +class LLFolderBridge; + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLViewerInventoryItem // @@ -53,6 +56,10 @@ protected: ~LLViewerInventoryItem( void ); // ref counted public: + virtual LLAssetType::EType getType() const; + virtual const LLUUID& getAssetUUID() const; + virtual const std::string& getName() const; + // construct a complete viewer inventory item LLViewerInventoryItem(const LLUUID& uuid, const LLUUID& parent_uuid, const LLPermissions& permissions, @@ -286,4 +293,8 @@ void copy_inventory_from_notecard(const LLUUID& object_id, U32 callback_id = 0); +void menu_create_inventory_item(LLFolderView* folder, + LLFolderBridge* bridge, + const LLSD& userdata); + #endif // LL_LLVIEWERINVENTORY_H diff --git a/indra/newview/llviewerjointattachment.h b/indra/newview/llviewerjointattachment.h index 4847ac7a720d040c50c6a5cc7b8bdb7d9d20140c..c0035796844dd88672a15a9548de441b99ba59f0 100644 --- a/indra/newview/llviewerjointattachment.h +++ b/indra/newview/llviewerjointattachment.h @@ -71,20 +71,20 @@ public: void setPieSlice(S32 pie_slice) { mPieSlice = pie_slice; } void setVisibleInFirstPerson(BOOL visibility) { mVisibleInFirst = visibility; } - BOOL getVisibleInFirstPerson() { return mVisibleInFirst; } + BOOL getVisibleInFirstPerson() const { return mVisibleInFirst; } void setGroup(S32 group) { mGroup = group; } void setOriginalPosition(LLVector3 &position); void setAttachmentVisibility(BOOL visible); void setIsHUDAttachment(BOOL is_hud) { mIsHUDAttachment = is_hud; } - BOOL getIsHUDAttachment() { return mIsHUDAttachment; } + BOOL getIsHUDAttachment() const { return mIsHUDAttachment; } - BOOL isAnimatable() { return FALSE; } + BOOL isAnimatable() const { return FALSE; } - S32 getGroup() { return mGroup; } - S32 getPieSlice() { return mPieSlice; } - LLViewerObject *getObject() { return mAttachedObject; } - S32 getNumObjects() { return (mAttachedObject ? 1 : 0); } - const LLUUID& getItemID() { return mItemID; } + S32 getGroup() const { return mGroup; } + S32 getPieSlice() const { return mPieSlice; } + LLViewerObject *getObject() const { return mAttachedObject; } + S32 getNumObjects() const { return (mAttachedObject ? 1 : 0); } + const LLUUID& getItemID() const { return mItemID; } // // unique methods diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 15c814829c02c1d7ab20b6ec8567b1f1967cb002..ab5cdeba4438256edb91081898f7ff96c7668c5c 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -43,7 +43,7 @@ #include "llmoveview.h" #include "lltoolfocus.h" #include "llviewerwindow.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" // // Constants @@ -224,7 +224,7 @@ void agent_toggle_fly( EKeystate s ) // Only catch the edge if (KEYSTATE_DOWN == s ) { - gAgent.toggleFlying(); + LLAgent::toggleFlying(); } } @@ -500,7 +500,8 @@ void stop_moving( EKeystate s ) void start_chat( EKeystate s ) { // start chat - gChatBar->startChat(NULL); + LLChatBar::startChat(NULL); +// gChatBar->startChat(NULL); } void start_gesture( EKeystate s ) @@ -508,16 +509,18 @@ void start_gesture( EKeystate s ) if (KEYSTATE_UP == s && !(gFocusMgr.getKeyboardFocus() && gFocusMgr.getKeyboardFocus()->acceptsTextInput())) { - if (gChatBar->getCurrentChat().empty()) - { - // No existing chat in chat editor, insert '/' - gChatBar->startChat("/"); - } - else - { - // Don't overwrite existing text in chat editor - gChatBar->startChat(NULL); - } + //TODO* remove DUMMY chatbar + LLChatBar::startChat(NULL); +// if (gChatBar->getCurrentChat().empty()) +// { +// // No existing chat in chat editor, insert '/' +// gChatBar->startChat("/"); +// } +// else +// { +// // Don't overwrite existing text in chat editor +// gChatBar->startChat(NULL); +// } } } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 82f835973237fe692674f1b4a393ed3e08ef28f3..1b3fd5d49beb71560fd8b6d9b9c4a0a1423d9572 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -553,7 +553,7 @@ void LLViewerMedia::buildMediaManagerData( LLMediaManagerData* init_data ) // Users can change skins while client is running, so make sure // we pick up on changes. gSavedSettings.getControl("SkinCurrent")->getSignal()->connect( - boost::bind( LLViewerMediaImpl::handleSkinCurrentChanged, _1 ) ); + boost::bind( LLViewerMediaImpl::handleSkinCurrentChanged, _2 ) ); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ac36cf7bb68850389eb41d03e8ca47d740f9b969..bdc86a3a69a2cbe92f8cc1f482219473394d5fe9 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -41,9 +41,11 @@ // linden library includes #include "audioengine.h" +#include "llfloaterreg.h" #include "indra_constants.h" #include "llassetstorage.h" #include "llchat.h" +#include "llcombobox.h" #include "llfeaturemanager.h" #include "llfocusmgr.h" #include "llfontgl.h" @@ -64,7 +66,7 @@ // newview includes #include "llagent.h" - +#include "llagentwearables.h" #include "llagentpilot.h" #include "llbox.h" #include "llcallingcard.h" @@ -84,7 +86,6 @@ #include "llfloaterbuycurrency.h" #include "llfloateractivespeakers.h" #include "llfloateranimpreview.h" -#include "llfloateravatarinfo.h" #include "llfloateravatartextures.h" #include "llfloaterbeacons.h" #include "llfloaterbuildoptions.h" @@ -98,9 +99,7 @@ #include "llfloatercustomize.h" #include "llfloaterdaycycle.h" #include "llfloaterdirectory.h" -#include "llfloatereditui.h" #include "llfloaterchatterbox.h" -#include "llfloaterfriends.h" #include "llfloaterfonttest.h" #include "llfloatergesture.h" #include "llfloatergodtools.h" @@ -119,7 +118,6 @@ #include "llfloatermap.h" #include "llfloatermute.h" #include "llfloateropenobject.h" -#include "llfloaterpermissionsmgr.h" #include "llfloaterperms.h" #include "llfloaterpostprocess.h" #include "llfloaterpreference.h" @@ -128,16 +126,13 @@ #include "llfloaterscriptdebug.h" #include "llfloatersettingsdebug.h" #include "llfloaterenvsettings.h" -#include "llfloaterstats.h" -#include "llfloatertest.h" #include "llfloatertools.h" #include "llfloaterwater.h" #include "llfloaterwindlight.h" #include "llfloaterworldmap.h" #include "llfloatermemleak.h" -#include "llframestats.h" -#include "llframestatview.h" #include "llfasttimerview.h" +#include "llfriendactions.h" #include "llmemoryview.h" #include "llgivemoney.h" #include "llgroupmgr.h" @@ -148,6 +143,7 @@ #include "llimagebmp.h" #include "llimagej2c.h" #include "llimagetga.h" +#include "llinventorybridge.h" #include "llinventorymodel.h" #include "llinventoryview.h" #include "llkeyboard.h" @@ -162,6 +158,7 @@ #include "llparcel.h" #include "llprimitive.h" #include "llresmgr.h" +#include "llrootview.h" #include "llselectmgr.h" #include "llsky.h" #include "llstatusbar.h" @@ -177,13 +174,12 @@ #include "lltoolgrab.h" #include "lltoolmgr.h" #include "lltoolpie.h" -#include "lltoolplacer.h" #include "lltoolselectland.h" +#include "lltrans.h" #include "lluictrlfactory.h" #include "lluploaddialog.h" #include "lluserauth.h" #include "lluuid.h" -#include "llvelocitybar.h" #include "llviewercamera.h" #include "llviewergenericmessage.h" #include "llviewergesture.h" @@ -199,6 +195,7 @@ #include "llviewerstats.h" #include "llviewerwindow.h" #include "llvoavatar.h" +#include "llvoavatarself.h" #include "llvolume.h" #include "llweb.h" #include "llworld.h" @@ -216,17 +213,6 @@ #include "lltexlayer.h" using namespace LLVOAvatarDefines; -using namespace LLOldEvents; - -void init_client_menu(LLMenuGL* menu); -void init_server_menu(LLMenuGL* menu); - -void init_debug_world_menu(LLMenuGL* menu); -void init_debug_rendering_menu(LLMenuGL* menu); -void init_debug_ui_menu(LLMenuGL* menu); -void init_debug_xui_menu(LLMenuGL* menu); -void init_debug_avatar_menu(LLMenuGL* menu); -void init_debug_baked_texture_menu(LLMenuGL* menu); BOOL enable_land_build(void*); BOOL enable_object_build(void*); @@ -238,13 +224,14 @@ void handle_test_load_url(void*); // // Evil hackish imported globals -// -extern BOOL gRenderLightGlows; -extern BOOL gRenderAvatar; -extern BOOL gHideSelectedObjects; -extern BOOL gShowOverlayTitle; -extern BOOL gOcclusionCull; -extern BOOL gAllowSelectAvatar; + +//extern BOOL gHideSelectedObjects; +//extern BOOL gAllowSelectAvatar; +//extern BOOL gDebugAvatarRotation; +extern BOOL gDebugClicks; +extern BOOL gDebugWindowProc; +//extern BOOL gDebugTextEditorTips; +//extern BOOL gDebugSelectMgr; // // Globals @@ -256,15 +243,11 @@ LLMenuGL *gPopupMenuView = NULL; LLMenuBarGL *gLoginMenuBarView = NULL; // Pie menus -LLPieMenu *gPieSelf = NULL; -LLPieMenu *gPieAvatar = NULL; -LLPieMenu *gPieObject = NULL; -LLPieMenu *gPieAttachment = NULL; -LLPieMenu *gPieLand = NULL; - -// local constants -const std::string CLIENT_MENU_NAME("Advanced"); -const std::string SERVER_MENU_NAME("Admin"); +LLContextMenu *gPieSelf = NULL; +LLContextMenu *gPieAvatar = NULL; +LLContextMenu *gPieObject = NULL; +LLContextMenu *gPieAttachment = NULL; +LLContextMenu *gPieLand = NULL; const std::string SAVE_INTO_INVENTORY("Save Object Back to My Inventory"); const std::string SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents"); @@ -272,27 +255,24 @@ const std::string SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents" LLMenuGL* gAttachSubMenu = NULL; LLMenuGL* gDetachSubMenu = NULL; LLMenuGL* gTakeOffClothes = NULL; -LLPieMenu* gPieRate = NULL; -LLPieMenu* gAttachScreenPieMenu = NULL; -LLPieMenu* gAttachPieMenu = NULL; -LLPieMenu* gAttachBodyPartPieMenus[8]; -LLPieMenu* gDetachPieMenu = NULL; -LLPieMenu* gDetachScreenPieMenu = NULL; -LLPieMenu* gDetachBodyPartPieMenus[8]; +LLContextMenu* gPieRate = NULL; +LLContextMenu* gAttachScreenPieMenu = NULL; +LLContextMenu* gAttachPieMenu = NULL; +LLContextMenu* gAttachBodyPartPieMenus[8]; +LLContextMenu* gDetachPieMenu = NULL; +LLContextMenu* gDetachScreenPieMenu = NULL; +LLContextMenu* gDetachBodyPartPieMenus[8]; LLMenuItemCallGL* gAFKMenu = NULL; LLMenuItemCallGL* gBusyMenu = NULL; -typedef LLMemberListener<LLView> view_listener_t; - // // Local prototypes -// -void handle_leave_group(void *); // File Menu +const char* upload_pick(void* data); void handle_compress_image(void*); -BOOL enable_save_as(void *); + // Edit menu void handle_dump_group_info(void *); @@ -300,7 +280,6 @@ void handle_dump_capabilities_info(void *); void handle_dump_focus(void*); // Advanced->Consoles menu -void handle_show_notifications_console(void*); void handle_region_dump_settings(void*); void handle_region_dump_temp_asset_data(void*); void handle_region_clear_temp_asset_data(void*); @@ -309,7 +288,7 @@ void handle_region_clear_temp_asset_data(void*); BOOL sitting_on_selection(); void near_sit_object(); -void label_sit_or_stand(std::string& label, void*); +//void label_sit_or_stand(std::string& label, void*); // buy and take alias into the same UI positions, so these // declarations handle this mess. BOOL is_selection_buy_not_take(); @@ -321,51 +300,31 @@ BOOL enable_buy(void*); void handle_buy(void *); void handle_buy_object(LLSaleInfo sale_info); void handle_buy_contents(LLSaleInfo sale_info); -void label_touch(std::string& label, void*); // Land pie menu void near_sit_down_point(BOOL success, void *); // Avatar pie menu -void handle_follow(void *userdata); -void handle_talk_to(void *userdata); // Debug menu -void show_permissions_control(void*); -void toggle_build_options(void* user_data); -void reload_ui(void*); -void handle_agent_stop_moving(void*); -void print_packets_lost(void*); -void drop_packet(void*); -void velocity_interpolate( void* data ); -void toggle_wind_audio(void); -void toggle_water_audio(void); + + +void velocity_interpolate( void* ); + void handle_rebake_textures(void*); BOOL check_admin_override(void*); void handle_admin_override_toggle(void*); #ifdef TOGGLE_HACKED_GODLIKE_VIEWER void handle_toggle_hacked_godmode(void*); BOOL check_toggle_hacked_godmode(void*); +bool enable_toggle_hacked_godmode(void*); #endif -void toggle_glow(void *); -BOOL check_glow(void *); - -void toggle_vertex_shaders(void *); -BOOL check_vertex_shaders(void *); - -void toggle_cull_small(void *); - void toggle_show_xui_names(void *); BOOL check_show_xui_names(void *); -void run_vectorize_perf_test(void *) -{ - gSavedSettings.setBOOL("VectorizePerfTest", TRUE); -} - // Debug UI -void handle_web_search_demo(void*); + void handle_web_browser_test(void*); void handle_buy_currency_test(void*); void handle_save_to_xml(void*); @@ -376,16 +335,12 @@ void handle_god_mode(void*); // God menu void handle_leave_god_mode(void*); -BOOL is_inventory_visible( void* user_data ); + void handle_reset_view(); -void disabled_duplicate(void*); void handle_duplicate_in_place(void*); -void handle_repeat_duplicate(void*); -void handle_export(void*); -// void handle_deed_object_to_group(void*); -// BOOL enable_deed_object_to_group(void*); + void handle_object_owner_self(void*); void handle_object_owner_permissive(void*); void handle_object_lock(void*); @@ -400,11 +355,8 @@ void handle_force_parcel_owner_to_me(void*); void handle_force_parcel_to_content(void*); void handle_claim_public_land(void*); -void handle_god_request_havok(void *); void handle_god_request_avatar_geometry(void *); // Hack for easy testing of new avatar geometry -void reload_personal_settings_overrides(void *); void reload_vertex_shader(void *); -void slow_mo_animations(void *); void handle_disconnect_viewer(void *); void force_error_breakpoint(void *); @@ -414,25 +366,13 @@ void force_error_infinite_loop(void *); void force_error_software_exception(void *); void force_error_driver_crash(void *); -void handle_stopall(void*); -//void handle_hinge(void*); -//void handle_ptop(void*); -//void handle_lptop(void*); -//void handle_wheel(void*); -//void handle_dehinge(void*); -BOOL enable_dehinge(void*); void handle_force_delete(void*); void print_object_info(void*); void print_agent_nvpairs(void*); void toggle_debug_menus(void*); -void export_info_callback(LLAssetInfo *info, void **user_data, S32 result); -void export_data_callback(LLVFS *vfs, const LLUUID& uuid, LLAssetType::EType type, void **user_data, S32 result); void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status); -BOOL menu_check_build_tool( void* user_data ); -void handle_reload_settings(void*); -void focus_here(void*); void dump_select_mgr(void*); -void dump_volume_mgr(void*); + void dump_inventory(void*); void edit_ui(void*); void toggle_visibility(void*); @@ -442,52 +382,30 @@ BOOL get_visibility(void*); void request_friendship(const LLUUID& agent_id); // Tools menu -void handle_force_unlock(void*); void handle_selected_texture_info(void*); -void handle_dump_image_list(void*); -void handle_crash(void*); void handle_dump_followcam(void*); void handle_viewer_enable_message_log(void*); void handle_viewer_disable_message_log(void*); -void handle_send_postcard(void*); -void handle_gestures_old(void*); -void handle_focus(void *); + BOOL enable_buy_land(void*); -void handle_move(void*); -void handle_show_inventory(void*); -void handle_activate(void*); -BOOL enable_activate(void*); // Help menu -void handle_buy_currency(void*); void handle_test_male(void *); void handle_test_female(void *); void handle_toggle_pg(void*); void handle_dump_attachments(void *); -void handle_show_overlay_title(void*); void handle_dump_avatar_local_textures(void*); void handle_debug_avatar_textures(void*); void handle_grab_texture(void*); BOOL enable_grab_texture(void*); void handle_dump_region_object_cache(void*); -BOOL menu_ui_enabled(void *user_data); -BOOL menu_check_control( void* user_data); -void menu_toggle_variable( void* user_data ); -BOOL menu_check_variable( void* user_data); -BOOL enable_land_selected( void* ); -BOOL enable_more_than_one_selected(void* ); -BOOL enable_selection_you_own_all(void*); -BOOL enable_selection_you_own_one(void*); BOOL enable_save_into_inventory(void*); BOOL enable_save_into_task_inventory(void*); -BOOL enable_not_thirdperson(void*); -// BOOL enable_export_selected(void *); -BOOL enable_have_card(void*); -BOOL enable_detach(void*); -BOOL enable_region_owner(void*); + +BOOL enable_detach(const LLSD& = LLSD()); void menu_toggle_attached_lights(void* user_data); void menu_toggle_attached_particles(void* user_data); @@ -521,27 +439,6 @@ void LLMenuParcelObserver::changed() } -//----------------------------------------------------------------------------- -// Menu Construction -//----------------------------------------------------------------------------- - -// code required to calculate anything about the menus -void pre_init_menus() -{ - // static information - LLColor4 color; - color = gColors.getColor( "MenuDefaultBgColor" ); - LLMenuGL::setDefaultBackgroundColor( color ); - color = gColors.getColor( "MenuItemEnabledColor" ); - LLMenuItemGL::setEnabledColor( color ); - color = gColors.getColor( "MenuItemDisabledColor" ); - LLMenuItemGL::setDisabledColor( color ); - color = gColors.getColor( "MenuItemHighlightBgColor" ); - LLMenuItemGL::setHighlightBGColor( color ); - color = gColors.getColor( "MenuItemHighlightFgColor" ); - LLMenuItemGL::setHighlightFGColor( color ); -} - void initialize_menus(); //----------------------------------------------------------------------------- @@ -593,62 +490,63 @@ void init_menus() /// The popup menu is now populated by the show_context_menu() /// method. - gPopupMenuView = new LLMenuGL( "Popup" ); - gPopupMenuView->setVisible( FALSE ); + LLMenuGL::Params menu_params; + menu_params.name = "Popup"; + menu_params.visible = false; + gPopupMenuView = LLUICtrlFactory::create<LLMenuGL>(menu_params); gMenuHolder->addChild( gPopupMenuView ); /// /// Pie menus /// - gPieSelf = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_self.xml", gMenuHolder); + gPieSelf = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_self.xml", gMenuHolder); // TomY TODO: what shall we do about these? - gDetachScreenPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Detach HUD", true); - gDetachPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Detach", true); + gDetachScreenPieMenu = gMenuHolder->getChild<LLContextMenu>("Object Detach HUD", true); + gDetachPieMenu = gMenuHolder->getChild<LLContextMenu>("Object Detach", true); - gPieAvatar = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_avatar.xml", gMenuHolder); + gPieAvatar = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_avatar.xml", gMenuHolder); - gPieObject = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_object.xml", gMenuHolder); + gPieObject = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_object.xml", gMenuHolder); - gAttachScreenPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Attach HUD"); - gAttachPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Attach"); - gPieRate = gMenuHolder->getChild<LLPieMenu>("Rate Menu"); + gAttachScreenPieMenu = gMenuHolder->getChild<LLContextMenu>("Object Attach HUD"); + gAttachPieMenu = gMenuHolder->getChild<LLContextMenu>("Object Attach"); + gPieRate = gMenuHolder->getChild<LLContextMenu>("Rate Menu"); - gPieAttachment = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_attachment.xml", gMenuHolder); + gPieAttachment = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_attachment.xml", gMenuHolder); - gPieLand = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_land.xml", gMenuHolder); + gPieLand = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_pie_land.xml", gMenuHolder); /// /// set up the colors /// LLColor4 color; - LLColor4 pie_color = gColors.getColor("PieMenuBgColor"); - gPieSelf->setBackgroundColor( pie_color ); - gPieAvatar->setBackgroundColor( pie_color ); - gPieObject->setBackgroundColor( pie_color ); - gPieAttachment->setBackgroundColor( pie_color ); - gPieLand->setBackgroundColor( pie_color ); + LLColor4 context_menu_color = gSavedSkinSettings.getColor("MenuPopupBgColor"); + + gPieSelf->setBackgroundColor( context_menu_color ); + gPieAvatar->setBackgroundColor( context_menu_color ); + gPieObject->setBackgroundColor( context_menu_color ); + gPieAttachment->setBackgroundColor( context_menu_color ); + + gPieLand->setBackgroundColor( context_menu_color ); - color = gColors.getColor( "MenuPopupBgColor" ); + color = gSavedSkinSettings.getColor( "MenuPopupBgColor" ); gPopupMenuView->setBackgroundColor( color ); // If we are not in production, use a different color to make it apparent. if (LLViewerLogin::getInstance()->isInProductionGrid()) { - color = gColors.getColor( "MenuBarBgColor" ); + color = gSavedSkinSettings.getColor( "MenuBarBgColor" ); } else { - color = gColors.getColor( "MenuNonProductionBgColor" ); + color = gSavedSkinSettings.getColor( "MenuNonProductionBgColor" ); } - gMenuBarView = (LLMenuBarGL*)LLUICtrlFactory::getInstance()->buildMenu("menu_viewer.xml", gMenuHolder); + gMenuBarView = LLUICtrlFactory::getInstance()->createFromFile<LLMenuBarGL>("menu_viewer.xml", gMenuHolder); gMenuBarView->setRect(LLRect(0, top, 0, top - MENU_BAR_HEIGHT)); gMenuBarView->setBackgroundColor( color ); - // gMenuBarView->setItemVisible("Tools", FALSE); - gMenuBarView->arrange(); - gMenuHolder->addChild(gMenuBarView); // menu holder appears on top of menu bar so you can see the menu title @@ -659,6 +557,7 @@ void init_menus() LLViewerLogin::getInstance()->isInProductionGrid()); // Assume L$10 for now, the server will tell us the real cost at login + // *TODO:Also fix cost in llfolderview.cpp for Inventory menus const std::string upload_cost("10"); gMenuHolder->childSetLabelArg("Upload Image", "[COST]", upload_cost); gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", upload_cost); @@ -670,817 +569,1866 @@ void init_menus() gAttachSubMenu = gMenuBarView->getChildMenuByName("Attach Object", TRUE); gDetachSubMenu = gMenuBarView->getChildMenuByName("Detach Object", TRUE); - // TomY TODO convert these two - LLMenuGL*menu; - - menu = new LLMenuGL(CLIENT_MENU_NAME); - init_client_menu(menu); - gMenuBarView->appendMenu( menu ); - menu->updateParent(LLMenuGL::sMenuContainer); - - menu = new LLMenuGL(SERVER_MENU_NAME); - init_server_menu(menu); - gMenuBarView->appendMenu( menu ); - menu->updateParent(LLMenuGL::sMenuContainer); - gMenuBarView->createJumpKeys(); // Let land based option enable when parcel changes gMenuParcelObserver = new LLMenuParcelObserver(); - // - // Debug menu visiblity - // - show_debug_menus(); - - gLoginMenuBarView = (LLMenuBarGL*)LLUICtrlFactory::getInstance()->buildMenu("menu_login.xml", gMenuHolder); + gLoginMenuBarView = LLUICtrlFactory::getInstance()->createFromFile<LLMenuBarGL>("menu_login.xml", gMenuHolder); + gLoginMenuBarView->arrangeAndClear(); LLRect menuBarRect = gLoginMenuBarView->getRect(); gLoginMenuBarView->setRect(LLRect(menuBarRect.mLeft, menuBarRect.mTop, gViewerWindow->getRootView()->getRect().getWidth() - menuBarRect.mLeft, menuBarRect.mBottom)); - gLoginMenuBarView->setBackgroundColor( color ); - gMenuHolder->addChild(gLoginMenuBarView); } +/////////////////// +// SHOW CONSOLES // +/////////////////// -void init_client_menu(LLMenuGL* menu) +class LLAdvancedToggleConsole : public view_listener_t { - LLMenuGL* sub_menu = NULL; - - //menu->append(new LLMenuItemCallGL("Permissions Control", &show_permissions_control)); - // this is now in the view menu so we don't need it here! - + bool handleEvent(const LLSD& userdata) { - // *TODO: Translate - LLMenuGL* sub = new LLMenuGL("Consoles"); - menu->appendMenu(sub); - sub->append(new LLMenuItemCheckGL("Frame Console", - &toggle_visibility, - NULL, - &get_visibility, - (void*)gDebugView->mFrameStatView, - '2', MASK_CONTROL|MASK_SHIFT ) ); - sub->append(new LLMenuItemCheckGL("Texture Console", - &toggle_visibility, - NULL, - &get_visibility, - (void*)gTextureView, - '3', MASK_CONTROL|MASK_SHIFT ) ); - LLView* debugview = gDebugView->mDebugConsolep; - sub->append(new LLMenuItemCheckGL("Debug Console", - &toggle_visibility, - NULL, - &get_visibility, - debugview, - '4', MASK_CONTROL|MASK_SHIFT ) ); - - sub->append(new LLMenuItemCheckGL("Fast Timers", - &toggle_visibility, - NULL, - &get_visibility, - (void*)gDebugView->mFastTimerView, - '9', MASK_CONTROL|MASK_SHIFT ) ); + std::string console_type = userdata.asString(); + if ("texture" == console_type) + { + toggle_visibility( (void*)gTextureView ); + } + else if ("debug" == console_type) + { + toggle_visibility( (void*)((LLView*)gDebugView->mDebugConsolep) ); + } + else if ("fast timers" == console_type) + { + toggle_visibility( (void*)gDebugView->mFastTimerView ); + } #if MEM_TRACK_MEM - sub->append(new LLMenuItemCheckGL("Memory", - &toggle_visibility, - NULL, - &get_visibility, - (void*)gDebugView->mMemoryView, - '0', MASK_CONTROL|MASK_SHIFT ) ); + else if ("memory view" == console_type) + { + toggle_visibility( (void*)gDebugView->mMemoryView ); + } #endif - - sub->appendSeparator(); - - // Debugging view for unified notifications - sub->append(new LLMenuItemCallGL("Notifications Console...", - &handle_show_notifications_console, NULL, NULL, '5', MASK_CONTROL|MASK_SHIFT )); - - - sub->appendSeparator(); - - sub->append(new LLMenuItemCallGL("Region Info to Debug Console", - &handle_region_dump_settings, NULL)); - sub->append(new LLMenuItemCallGL("Group Info to Debug Console", - &handle_dump_group_info, NULL, NULL)); - sub->append(new LLMenuItemCallGL("Capabilities Info to Debug Console", - &handle_dump_capabilities_info, NULL, NULL)); - sub->createJumpKeys(); + else if ("notifications" == console_type) + { + LLFloaterNotificationConsole::showInstance(); + } + return true; } - - // neither of these works particularly well at the moment - /*menu->append(new LLMenuItemCallGL( "Reload UI XML", &reload_ui, - NULL, NULL) );*/ - /*menu->append(new LLMenuItemCallGL("Reload settings/colors", - &handle_reload_settings, NULL, NULL));*/ - menu->append(new LLMenuItemCallGL("Reload personal setting overrides", - &reload_personal_settings_overrides, NULL, NULL, KEY_F12, MASK_CONTROL|MASK_SHIFT)); - - sub_menu = new LLMenuGL("HUD Info"); - { - sub_menu->append(new LLMenuItemCheckGL("Velocity", - &toggle_visibility, - NULL, - &get_visibility, - (void*)gVelocityBar)); - - sub_menu->append(new LLMenuItemToggleGL("Camera", &gDisplayCameraPos ) ); - sub_menu->append(new LLMenuItemToggleGL("Wind", &gDisplayWindInfo) ); - sub_menu->append(new LLMenuItemToggleGL("FOV", &gDisplayFOV ) ); - sub_menu->createJumpKeys(); - } - menu->appendMenu(sub_menu); - - menu->appendSeparator(); - - menu->append(new LLMenuItemCheckGL( "High-res Snapshot", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"HighResSnapshot")); - - menu->append(new LLMenuItemCheckGL( "Quiet Snapshots to Disk", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"QuietSnapshotsToDisk")); - - menu->append(new LLMenuItemCheckGL("Show Mouselook Crosshairs", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"ShowCrosshairs")); - - menu->append(new LLMenuItemCheckGL("Debug Permissions", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"DebugPermissions")); - - - -#ifdef TOGGLE_HACKED_GODLIKE_VIEWER - if (!LLViewerLogin::getInstance()->isInProductionGrid()) +}; +class LLAdvancedCheckConsole : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) { - menu->append(new LLMenuItemCheckGL("Hacked Godmode", - &handle_toggle_hacked_godmode, - NULL, - &check_toggle_hacked_godmode, - (void*)"HackedGodmode")); - } + std::string console_type = userdata.asString(); + bool new_value = false; + if ("texture" == console_type) + { + new_value = get_visibility( (void*)gTextureView ); + } + else if ("debug" == console_type) + { + new_value = get_visibility( (void*)((LLView*)gDebugView->mDebugConsolep) ); + } + else if ("fast timers" == console_type) + { + new_value = get_visibility( (void*)gDebugView->mFastTimerView ); + } +#if MEM_TRACK_MEM + else if ("memory view" == console_type) + { + new_value = get_visibility( (void*)gDebugView->mMemoryView ); + } #endif - menu->append(new LLMenuItemCallGL("Clear Group Cache", - LLGroupMgr::debugClearAllGroups)); - menu->appendSeparator(); - - sub_menu = new LLMenuGL("Rendering"); - init_debug_rendering_menu(sub_menu); - menu->appendMenu(sub_menu); - - sub_menu = new LLMenuGL("World"); - init_debug_world_menu(sub_menu); - menu->appendMenu(sub_menu); + return new_value; + } +}; - sub_menu = new LLMenuGL("UI"); - init_debug_ui_menu(sub_menu); - menu->appendMenu(sub_menu); - sub_menu = new LLMenuGL("XUI"); - init_debug_xui_menu(sub_menu); - menu->appendMenu(sub_menu); +////////////////////////// +// DUMP INFO TO CONSOLE // +////////////////////////// - sub_menu = new LLMenuGL("Character"); - init_debug_avatar_menu(sub_menu); - menu->appendMenu(sub_menu); +class LLAdvancedDumpInfoToConsole : public view_listener_t { - LLMenuGL* sub = NULL; - sub = new LLMenuGL("Network"); - - sub->append(new LLMenuItemCallGL("Enable Message Log", - &handle_viewer_enable_message_log, NULL)); - sub->append(new LLMenuItemCallGL("Disable Message Log", - &handle_viewer_disable_message_log, NULL)); - - sub->appendSeparator(); + bool handleEvent(const LLSD& userdata) + { + std::string info_type = userdata.asString(); + if ("region" == info_type) + { + handle_region_dump_settings(NULL); + } + else if ("group" == info_type) + { + handle_dump_group_info(NULL); + } + else if ("capabilities" == info_type) + { + handle_dump_capabilities_info(NULL); + } + return true; + } +}; - sub->append(new LLMenuItemCheckGL("Velocity Interpolate Objects", - &velocity_interpolate, - NULL, - &menu_check_control, - (void*)"VelocityInterpolate")); - sub->append(new LLMenuItemCheckGL("Ping Interpolate Object Positions", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"PingInterpolate")); - sub->appendSeparator(); +////////////// +// HUD INFO // +////////////// - sub->append(new LLMenuItemCallGL("Drop a Packet", - &drop_packet, NULL, NULL, - 'L', MASK_ALT | MASK_CONTROL)); - menu->appendMenu( sub ); - sub->createJumpKeys(); - } +class LLAdvancedToggleHUDInfo : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) { - LLMenuGL* sub = NULL; - sub = new LLMenuGL("Recorder"); - - sub->append(new LLMenuItemCheckGL("Full Session Logging", &menu_toggle_control, NULL, &menu_check_control, (void*)"StatsSessionTrackFrameStats")); - - sub->append(new LLMenuItemCallGL("Start Logging", &LLFrameStats::startLogging, NULL)); - sub->append(new LLMenuItemCallGL("Stop Logging", &LLFrameStats::stopLogging, NULL)); - sub->append(new LLMenuItemCallGL("Log 10 Seconds", &LLFrameStats::timedLogging10, NULL)); - sub->append(new LLMenuItemCallGL("Log 30 Seconds", &LLFrameStats::timedLogging30, NULL)); - sub->append(new LLMenuItemCallGL("Log 60 Seconds", &LLFrameStats::timedLogging60, NULL)); - sub->appendSeparator(); - sub->append(new LLMenuItemCallGL("Start Playback", &LLAgentPilot::startPlayback, NULL)); - sub->append(new LLMenuItemCallGL("Stop Playback", &LLAgentPilot::stopPlayback, NULL)); - sub->append(new LLMenuItemToggleGL("Loop Playback", &LLAgentPilot::sLoop) ); - sub->append(new LLMenuItemCallGL("Start Record", &LLAgentPilot::startRecord, NULL)); - sub->append(new LLMenuItemCallGL("Stop Record", &LLAgentPilot::saveRecord, NULL)); + std::string info_type = userdata.asString(); - menu->appendMenu( sub ); - sub->createJumpKeys(); + if ("camera" == info_type) + { + gDisplayCameraPos = !(gDisplayCameraPos); + } + else if ("wind" == info_type) + { + gDisplayWindInfo = !(gDisplayWindInfo); + } + else if ("fov" == info_type) + { + gDisplayFOV = !(gDisplayFOV); + } + return true; } +}; - menu->appendSeparator(); - - menu->append(new LLMenuItemToggleGL("Show Updates", - &gShowObjectUpdates)); - - menu->appendSeparator(); - - menu->append(new LLMenuItemCallGL("Compress Images...", - &handle_compress_image, NULL, NULL)); - - menu->append(new LLMenuItemCheckGL("Limit Select Distance", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"LimitSelectDistance")); - - menu->append(new LLMenuItemCheckGL("Disable Camera Constraints", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"DisableCameraConstraints")); - - menu->append(new LLMenuItemCheckGL("Mouse Smoothing", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*) "MouseSmooth")); - menu->appendSeparator(); - - menu->append(new LLMenuItemCheckGL( "Console Window", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"ShowConsoleWindow")); - - if(gSavedSettings.getBOOL("QAMode")) - { - LLMenuGL* sub = NULL; - sub = new LLMenuGL("Debugging"); -#if LL_WINDOWS - sub->append(new LLMenuItemCallGL("Force Breakpoint", &force_error_breakpoint, NULL, NULL, 'B', MASK_CONTROL | MASK_ALT)); -#endif - sub->append(new LLMenuItemCallGL("Force LLError And Crash", &force_error_llerror)); - sub->append(new LLMenuItemCallGL("Force Bad Memory Access", &force_error_bad_memory_access)); - sub->append(new LLMenuItemCallGL("Force Infinite Loop", &force_error_infinite_loop)); - sub->append(new LLMenuItemCallGL("Force Driver Crash", &force_error_driver_crash)); - sub->append(new LLMenuItemCallGL("Force Disconnect Viewer", &handle_disconnect_viewer)); - // *NOTE:Mani this isn't handled yet... sub->append(new LLMenuItemCallGL("Force Software Exception", &force_error_unhandled_exception)); - sub->createJumpKeys(); - menu->appendMenu(sub); +class LLAdvancedCheckHUDInfo : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string info_type = userdata.asString(); + bool new_value = false; + if ("camera" == info_type) + { + new_value = gDisplayCameraPos; + } + else if ("wind" == info_type) + { + new_value = gDisplayWindInfo; + } + else if ("fov" == info_type) + { + new_value = gDisplayFOV; + } + return new_value; } +}; - menu->append(new LLMenuItemCheckGL( "Output Debug Minidump", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"SaveMinidump")); - - menu->append(new LLMenuItemCallGL("Debug Settings...", LLFloaterSettingsDebug::show, NULL, NULL)); - menu->append(new LLMenuItemCheckGL("View Admin Options", &handle_admin_override_toggle, NULL, &check_admin_override, NULL, 'V', MASK_CONTROL | MASK_ALT)); - - menu->append(new LLMenuItemCallGL("Request Admin Status", - &handle_god_mode, NULL, NULL, 'G', MASK_ALT | MASK_CONTROL)); +/////////////////////// +// CLEAR GROUP CACHE // +/////////////////////// - menu->append(new LLMenuItemCallGL("Leave Admin Status", - &handle_leave_god_mode, NULL, NULL, 'G', MASK_ALT | MASK_SHIFT | MASK_CONTROL)); +class LLAdvancedClearGroupCache : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLGroupMgr::debugClearAllGroups(NULL); + return true; + } +}; - menu->createJumpKeys(); -} -void init_debug_world_menu(LLMenuGL* menu) -{ -/* REMOVE mouse move sun from menu options - menu->append(new LLMenuItemCheckGL("Mouse Moves Sun", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"MouseSun", - 'M', MASK_CONTROL|MASK_ALT)); -*/ - menu->append(new LLMenuItemCheckGL("Sim Sun Override", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"SkyOverrideSimSunPosition")); - menu->append(new LLMenuItemCallGL("Dump Scripted Camera", - &handle_dump_followcam, NULL, NULL)); - menu->append(new LLMenuItemCheckGL("Fixed Weather", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"FixedWeather")); - menu->append(new LLMenuItemCallGL("Dump Region Object Cache", - &handle_dump_region_object_cache, NULL, NULL)); - menu->createJumpKeys(); -} -void handle_export_menus_to_xml(void*) +///////////////// +// RENDER TYPE // +///////////////// +U32 render_type_from_string(std::string render_type) { - - LLFilePicker& picker = LLFilePicker::instance(); - if(!picker.getSaveFile(LLFilePicker::FFSAVE_XML)) + if ("simple" == render_type) { - llwarns << "No file" << llendl; - return; + return LLPipeline::RENDER_TYPE_SIMPLE; + } + else if ("alpha" == render_type) + { + return LLPipeline::RENDER_TYPE_ALPHA; + } + else if ("tree" == render_type) + { + return LLPipeline::RENDER_TYPE_TREE; + } + else if ("character" == render_type) + { + return LLPipeline::RENDER_TYPE_AVATAR; + } + else if ("surfacePath" == render_type) + { + return LLPipeline::RENDER_TYPE_TERRAIN; + } + else if ("sky" == render_type) + { + return LLPipeline::RENDER_TYPE_SKY; + } + else if ("water" == render_type) + { + return LLPipeline::RENDER_TYPE_WATER; + } + else if ("ground" == render_type) + { + return LLPipeline::RENDER_TYPE_GROUND; + } + else if ("volume" == render_type) + { + return LLPipeline::RENDER_TYPE_VOLUME; + } + else if ("grass" == render_type) + { + return LLPipeline::RENDER_TYPE_GRASS; + } + else if ("clouds" == render_type) + { + return LLPipeline::RENDER_TYPE_CLOUDS; + } + else if ("particles" == render_type) + { + return LLPipeline::RENDER_TYPE_PARTICLES; + } + else if ("bump" == render_type) + { + return LLPipeline::RENDER_TYPE_BUMP; + } + else + { + return 0; } - std::string filename = picker.getFirstFile(); - - llofstream out(filename); - LLXMLNodePtr node = gMenuBarView->getXML(); - node->writeToOstream(out); - out.close(); } -extern BOOL gDebugClicks; -extern BOOL gDebugWindowProc; -extern BOOL gDebugTextEditorTips; -extern BOOL gDebugSelectMgr; - -void init_debug_ui_menu(LLMenuGL* menu) -{ - menu->append(new LLMenuItemCheckGL("Rotate Mini-Map", menu_toggle_control, NULL, menu_check_control, (void*)"MiniMapRotate")); - menu->append(new LLMenuItemCheckGL("Use default system color picker", menu_toggle_control, NULL, menu_check_control, (void*)"UseDefaultColorPicker")); - menu->append(new LLMenuItemCheckGL("Show search panel in overlay bar", menu_toggle_control, NULL, menu_check_control, (void*)"ShowSearchBar")); - menu->appendSeparator(); - - menu->append(new LLMenuItemCallGL("Web Browser Test", &handle_web_browser_test)); - // commented out until work is complete: DEV-32268 - // menu->append(new LLMenuItemCallGL("Buy Currency Test", &handle_buy_currency_test)); - menu->append(new LLMenuItemCallGL("Editable UI", &edit_ui)); - menu->append(new LLMenuItemCallGL( "Dump SelectMgr", &dump_select_mgr)); - menu->append(new LLMenuItemCallGL( "Dump Inventory", &dump_inventory)); - menu->append(new LLMenuItemCallGL( "Dump Focus Holder", &handle_dump_focus, NULL, NULL, 'F', MASK_ALT | MASK_CONTROL)); - menu->append(new LLMenuItemCallGL( "Print Selected Object Info", &print_object_info, NULL, NULL, 'P', MASK_CONTROL|MASK_SHIFT )); - menu->append(new LLMenuItemCallGL( "Print Agent Info", &print_agent_nvpairs, NULL, NULL, 'P', MASK_SHIFT )); - menu->append(new LLMenuItemCallGL( "Memory Stats", &output_statistics, NULL, NULL, 'M', MASK_SHIFT | MASK_ALT | MASK_CONTROL)); - menu->append(new LLMenuItemCheckGL("Double-Click Auto-Pilot", - menu_toggle_control, NULL, menu_check_control, - (void*)"DoubleClickAutoPilot")); - menu->appendSeparator(); -// menu->append(new LLMenuItemCallGL( "Print Packets Lost", &print_packets_lost, NULL, NULL, 'L', MASK_SHIFT )); - menu->append(new LLMenuItemToggleGL("Debug SelectMgr", &gDebugSelectMgr)); - menu->append(new LLMenuItemToggleGL("Debug Clicks", &gDebugClicks)); - menu->append(new LLMenuItemToggleGL("Debug Views", &LLView::sDebugRects)); - menu->append(new LLMenuItemCheckGL("Show Name Tooltips", toggle_show_xui_names, NULL, check_show_xui_names, NULL)); - menu->append(new LLMenuItemToggleGL("Debug Mouse Events", &LLView::sDebugMouseHandling)); - menu->append(new LLMenuItemToggleGL("Debug Keys", &LLView::sDebugKeys)); - menu->append(new LLMenuItemToggleGL("Debug WindowProc", &gDebugWindowProc)); - menu->append(new LLMenuItemToggleGL("Debug Text Editor Tips", &gDebugTextEditorTips)); - menu->appendSeparator(); - menu->append(new LLMenuItemCheckGL("Show Time", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowTime")); - menu->append(new LLMenuItemCheckGL("Show Render Info", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderInfo")); - menu->append(new LLMenuItemCheckGL("Show Matrices", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderMatrices")); - menu->append(new LLMenuItemCheckGL("Show Color Under Cursor", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowColor")); - - menu->createJumpKeys(); -} -void init_debug_xui_menu(LLMenuGL* menu) +class LLAdvancedToggleRenderType : public view_listener_t { - menu->append(new LLMenuItemCallGL("Floater Test...", LLFloaterTest::show)); - menu->append(new LLMenuItemCallGL("Font Test...", LLFloaterFontTest::show)); - menu->append(new LLMenuItemCallGL("Export Menus to XML...", handle_export_menus_to_xml)); - menu->append(new LLMenuItemCallGL("Edit UI...", LLFloaterEditUI::show)); - menu->append(new LLMenuItemCallGL("Load from XML...", handle_load_from_xml)); - menu->append(new LLMenuItemCallGL("Save to XML...", handle_save_to_xml)); - menu->append(new LLMenuItemCheckGL("Show XUI Names", toggle_show_xui_names, NULL, check_show_xui_names, NULL)); + bool handleEvent(const LLSD& userdata) + { + U32 render_type = render_type_from_string( userdata.asString() ); + if ( render_type != 0 ) + { + LLPipeline::toggleRenderTypeControl( (void*)render_type ); + } + return true; + } +}; - //menu->append(new LLMenuItemCallGL("Buy Currency...", handle_buy_currency)); - menu->createJumpKeys(); -} -void init_debug_rendering_menu(LLMenuGL* menu) +class LLAdvancedCheckRenderType : public view_listener_t { - LLMenuGL* sub_menu = NULL; - - /////////////////////////// - // - // Debug menu for types/pools - // - sub_menu = new LLMenuGL("Types"); - menu->appendMenu(sub_menu); - - sub_menu->append(new LLMenuItemCheckGL("Simple", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_SIMPLE, '1', MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Alpha", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_ALPHA, '2', MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Tree", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_TREE, '3', MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Character", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_AVATAR, '4', MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("SurfacePatch", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_TERRAIN, '5', MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Sky", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_SKY, '6', MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Water", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_WATER, '7', MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Ground", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_GROUND, '8', MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Volume", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_VOLUME, '9', MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Grass", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_GRASS, '0', MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Clouds", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_CLOUDS, '-', MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Particles", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_PARTICLES, '`', MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Bump", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_BUMP, '\\', MASK_ALT|MASK_SHIFT)); - - sub_menu->createJumpKeys(); - sub_menu = new LLMenuGL("Features"); - menu->appendMenu(sub_menu); - sub_menu->append(new LLMenuItemCheckGL("UI", - &LLPipeline::toggleRenderDebugFeature, NULL, - &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_UI, KEY_F1, MASK_CONTROL|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Selected", - &LLPipeline::toggleRenderDebugFeature, NULL, - &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_SELECTED, KEY_F2, MASK_CONTROL|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Highlighted", - &LLPipeline::toggleRenderDebugFeature, NULL, - &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_HIGHLIGHTED, KEY_F3, MASK_CONTROL|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Dynamic Textures", - &LLPipeline::toggleRenderDebugFeature, NULL, - &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES, KEY_F4, MASK_CONTROL|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL( "Foot Shadows", - &LLPipeline::toggleRenderDebugFeature, NULL, - &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS, KEY_F5, MASK_CONTROL|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Fog", - &LLPipeline::toggleRenderDebugFeature, NULL, - &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOG, KEY_F6, MASK_CONTROL|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Test FRInfo", - &LLPipeline::toggleRenderDebugFeature, NULL, - &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_FR_INFO, KEY_F8, MASK_CONTROL|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL( "Flexible Objects", - &LLPipeline::toggleRenderDebugFeature, NULL, - &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE, KEY_F9, MASK_CONTROL|MASK_SHIFT)); - sub_menu->createJumpKeys(); - - ///////////////////////////// - // - // Debug menu for info displays - // - sub_menu = new LLMenuGL("Info Displays"); - menu->appendMenu(sub_menu); - - sub_menu->append(new LLMenuItemCheckGL("Verify", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_VERIFY)); - sub_menu->append(new LLMenuItemCheckGL("BBoxes", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_BBOXES)); - sub_menu->append(new LLMenuItemCheckGL("Points", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_POINTS)); - sub_menu->append(new LLMenuItemCheckGL("Octree", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_OCTREE)); - sub_menu->append(new LLMenuItemCheckGL("Shadow Frusta", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)); - sub_menu->append(new LLMenuItemCheckGL("Occlusion", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_OCCLUSION)); - sub_menu->append(new LLMenuItemCheckGL("Render Batches", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_BATCH_SIZE)); - sub_menu->append(new LLMenuItemCheckGL("Animated Textures", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_TEXTURE_ANIM)); - sub_menu->append(new LLMenuItemCheckGL("Texture Priority", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY)); - sub_menu->append(new LLMenuItemCheckGL("Avatar Rendering Cost", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_SHAME)); - sub_menu->append(new LLMenuItemCheckGL("Texture Area (sqrt(A))",&LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_TEXTURE_AREA)); - sub_menu->append(new LLMenuItemCheckGL("Face Area (sqrt(A))",&LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_FACE_AREA)); - sub_menu->append(new LLMenuItemCheckGL("Lights", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_LIGHTS)); - sub_menu->append(new LLMenuItemCheckGL("Particles", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_PARTICLES)); - sub_menu->append(new LLMenuItemCheckGL("Composition", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_COMPOSITION)); - sub_menu->append(new LLMenuItemCheckGL("Glow",&LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_GLOW)); - sub_menu->append(new LLMenuItemCheckGL("Raycasting", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_RAYCAST)); - sub_menu->append(new LLMenuItemCheckGL("Sculpt", &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_SCULPTED)); - - sub_menu->append(new LLMenuItemCallGL("Vectorize Perf Test", &run_vectorize_perf_test)); - - sub_menu = new LLMenuGL("Render Tests"); - - sub_menu->append(new LLMenuItemCheckGL("Camera Offset", - &menu_toggle_control, - NULL, - &menu_check_control, - (void*)"CameraOffset")); - - sub_menu->append(new LLMenuItemToggleGL("Randomize Framerate", &gRandomizeFramerate)); - - sub_menu->append(new LLMenuItemToggleGL("Periodic Slow Frame", &gPeriodicSlowFrame)); - - sub_menu->append(new LLMenuItemToggleGL("Frame Test", &LLPipeline::sRenderFrameTest)); - - sub_menu->createJumpKeys(); - - menu->appendMenu( sub_menu ); + bool handleEvent(const LLSD& userdata) + { + U32 render_type = render_type_from_string( userdata.asString() ); + bool new_value = false; - menu->appendSeparator(); - menu->append(new LLMenuItemCheckGL("Axes", menu_toggle_control, NULL, menu_check_control, (void*)"ShowAxes")); -// menu->append(new LLMenuItemCheckGL("Cull Small Objects", toggle_cull_small, NULL, menu_check_control, (void*)"RenderCullBySize")); + if ( render_type != 0 ) + { + new_value = LLPipeline::hasRenderTypeControl( (void*)render_type ); + } - menu->appendSeparator(); - menu->append(new LLMenuItemToggleGL("Hide Selected", &gHideSelectedObjects)); - menu->appendSeparator(); - menu->append(new LLMenuItemCheckGL("Tangent Basis", menu_toggle_control, NULL, menu_check_control, (void*)"ShowTangentBasis")); - menu->append(new LLMenuItemCallGL("Selected Texture Info", handle_selected_texture_info, NULL, NULL, 'T', MASK_CONTROL|MASK_SHIFT|MASK_ALT)); - //menu->append(new LLMenuItemCallGL("Dump Image List", handle_dump_image_list, NULL, NULL, 'I', MASK_CONTROL|MASK_SHIFT)); - - menu->append(new LLMenuItemToggleGL("Wireframe", &gUseWireframe, - 'R', MASK_CONTROL|MASK_SHIFT)); + return new_value; + } +}; - LLMenuItemCheckGL* item; - item = new LLMenuItemCheckGL("Object-Object Occlusion", menu_toggle_control, NULL, menu_check_control, (void*)"UseOcclusion", 'O', MASK_CONTROL|MASK_SHIFT); - item->setEnabled(gGLManager.mHasOcclusionQuery && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion")); - menu->append(item); - item = new LLMenuItemCheckGL("Debug GL", menu_toggle_control, NULL, menu_check_control, (void*)"RenderDebugGL"); - menu->append(item); - - item = new LLMenuItemCheckGL("Debug Pipeline", menu_toggle_control, NULL, menu_check_control, (void*)"RenderDebugPipeline"); - menu->append(item); - - item = new LLMenuItemCheckGL("Fast Alpha", menu_toggle_control, NULL, menu_check_control, (void*)"RenderFastAlpha"); - menu->append(item); - - item = new LLMenuItemCheckGL("Animate Textures", menu_toggle_control, NULL, menu_check_control, (void*)"AnimateTextures"); - menu->append(item); - - item = new LLMenuItemCheckGL("Disable Textures", menu_toggle_variable, NULL, menu_check_variable, (void*)&LLViewerImage::sDontLoadVolumeTextures); - menu->append(item); - -#ifndef LL_RELEASE_FOR_DOWNLOAD - item = new LLMenuItemCheckGL("HTTP Get Textures", menu_toggle_control, NULL, menu_check_control, (void*)"ImagePipelineUseHTTP"); - menu->append(item); -#endif - - item = new LLMenuItemCheckGL("Run Multiple Threads", menu_toggle_control, NULL, menu_check_control, (void*)"RunMultipleThreads"); - menu->append(item); +///////////// +// FEATURE // +///////////// +U32 feature_from_string(std::string feature) +{ + if ("ui" == feature) + { + return LLPipeline::RENDER_DEBUG_FEATURE_UI; + } + else if ("selected" == feature) + { + return LLPipeline::RENDER_DEBUG_FEATURE_SELECTED; + } + else if ("highlighted" == feature) + { + return LLPipeline::RENDER_DEBUG_FEATURE_HIGHLIGHTED; + } + else if ("dynamic textures" == feature) + { + return LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES; + } + else if ("foot shadows" == feature) + { + return LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS; + } + else if ("fog" == feature) + { + return LLPipeline::RENDER_DEBUG_FEATURE_FOG; + } + else if ("fr info" == feature) + { + return LLPipeline::RENDER_DEBUG_FEATURE_FR_INFO; + } + else if ("flexible" == feature) + { + return LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE; + } + else + { + return 0; + } +}; - item = new LLMenuItemCheckGL("Cheesy Beacon", menu_toggle_control, NULL, menu_check_control, (void*)"CheesyBeacon"); - menu->append(item); - item = new LLMenuItemCheckGL("Attached Lights", menu_toggle_attached_lights, NULL, menu_check_control, (void*)"RenderAttachedLights"); - menu->append(item); +class LLAdvancedToggleFeature : public view_listener_t{ + bool handleEvent(const LLSD& userdata) + { + U32 feature = feature_from_string( userdata.asString() ); + if ( feature != 0 ) + { + LLPipeline::toggleRenderDebugFeature( (void*)feature ); + } + return true; + } +}; - item = new LLMenuItemCheckGL("Attached Particles", menu_toggle_attached_particles, NULL, menu_check_control, (void*)"RenderAttachedParticles"); - menu->append(item); +class LLAdvancedCheckFeature : public view_listener_t +{bool handleEvent(const LLSD& userdata) +{ + U32 feature = feature_from_string( userdata.asString() ); + bool new_value = false; -#ifndef LL_RELEASE_FOR_DOWNLOAD - menu->appendSeparator(); - menu->append(new LLMenuItemCallGL("Memory Leaking Simulation", LLFloaterMemLeak::show, NULL, NULL)); -#else - if(gSavedSettings.getBOOL("QAMode")) + if ( feature != 0 ) { - menu->appendSeparator(); - menu->append(new LLMenuItemCallGL("Memory Leaking Simulation", LLFloaterMemLeak::show, NULL, NULL)); + new_value = LLPipeline::toggleRenderDebugFeatureControl( (void*)feature ); } -#endif - - menu->createJumpKeys(); -} - -void init_debug_avatar_menu(LLMenuGL* menu) -{ - LLMenuGL* sub_menu = new LLMenuGL("Grab Baked Texture"); - init_debug_baked_texture_menu(sub_menu); - menu->appendMenu(sub_menu); - - sub_menu = new LLMenuGL("Character Tests"); - sub_menu->append(new LLMenuItemCheckGL("Go Away/AFK When Idle", - menu_toggle_control, - NULL, - menu_check_control, - (void*)"AllowIdleAFK")); - - sub_menu->append(new LLMenuItemCallGL("Appearance To XML", - &LLVOAvatar::dumpArchetypeXML)); - - // HACK for easy testing of avatar geometry - sub_menu->append(new LLMenuItemCallGL( "Toggle Character Geometry", - &handle_god_request_avatar_geometry, &enable_god_customer_service, NULL)); - - sub_menu->append(new LLMenuItemCallGL("Test Male", - handle_test_male)); - - sub_menu->append(new LLMenuItemCallGL("Test Female", - handle_test_female)); - - sub_menu->append(new LLMenuItemCallGL("Toggle PG", handle_toggle_pg)); - - sub_menu->append(new LLMenuItemToggleGL("Allow Select Avatar", &gAllowSelectAvatar)); - sub_menu->createJumpKeys(); - - menu->appendMenu(sub_menu); - - menu->append(new LLMenuItemCheckGL("Enable Lip Sync (Beta)", menu_toggle_control, NULL, menu_check_control, (void*)"LipSyncEnabled")); - menu->append(new LLMenuItemToggleGL("Tap-Tap-Hold To Run", &gAllowTapTapHoldRun)); - menu->append(new LLMenuItemCallGL("Force Params to Default", &LLAgent::clearVisualParams, NULL)); - menu->append(new LLMenuItemCallGL("Reload Vertex Shader", &reload_vertex_shader, NULL)); - menu->append(new LLMenuItemToggleGL("Animation Info", &LLVOAvatar::sShowAnimationDebug)); - menu->append(new LLMenuItemCallGL("Slow Motion Animations", &slow_mo_animations, NULL)); - menu->append(new LLMenuItemToggleGL("Show Look At", &LLHUDEffectLookAt::sDebugLookAt)); - menu->append(new LLMenuItemToggleGL("Show Point At", &LLHUDEffectPointAt::sDebugPointAt)); - menu->append(new LLMenuItemToggleGL("Debug Joint Updates", &LLVOAvatar::sJointDebug)); - menu->append(new LLMenuItemToggleGL("Disable LOD", &LLViewerJoint::sDisableLOD)); - menu->append(new LLMenuItemToggleGL("Debug Character Vis", &LLVOAvatar::sDebugInvisible)); - //menu->append(new LLMenuItemToggleGL("Show Attachment Points", &LLVOAvatar::sShowAttachmentPoints)); - //diabling collision plane due to DEV-14477 -brad - //menu->append(new LLMenuItemToggleGL("Show Collision Plane", &LLVOAvatar::sShowFootPlane)); - menu->append(new LLMenuItemCheckGL("Show Collision Skeleton", - &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_AVATAR_VOLUME)); - menu->append(new LLMenuItemCheckGL("Display Agent Target", - &LLPipeline::toggleRenderDebug, NULL, - &LLPipeline::toggleRenderDebugControl, - (void*)LLPipeline::RENDER_DEBUG_AGENT_TARGET)); - menu->append(new LLMenuItemToggleGL( "Debug Rotation", &LLVOAvatar::sDebugAvatarRotation)); - menu->append(new LLMenuItemCallGL("Dump Attachments", handle_dump_attachments)); - menu->append(new LLMenuItemCallGL("Rebake Textures", handle_rebake_textures, NULL, NULL, 'R', MASK_ALT | MASK_CONTROL )); -#ifndef LL_RELEASE_FOR_DOWNLOAD - menu->append(new LLMenuItemCallGL("Debug Avatar Textures", handle_debug_avatar_textures, NULL, NULL, 'A', MASK_SHIFT|MASK_CONTROL|MASK_ALT)); - menu->append(new LLMenuItemCallGL("Dump Local Textures", handle_dump_avatar_local_textures, NULL, NULL, 'M', MASK_SHIFT|MASK_ALT )); -#endif - menu->createJumpKeys(); -} -void init_debug_baked_texture_menu(LLMenuGL* menu) -{ - menu->append(new LLMenuItemCallGL("Iris", handle_grab_texture, enable_grab_texture, (void*) TEX_EYES_BAKED)); - menu->append(new LLMenuItemCallGL("Head", handle_grab_texture, enable_grab_texture, (void*) TEX_HEAD_BAKED)); - menu->append(new LLMenuItemCallGL("Upper Body", handle_grab_texture, enable_grab_texture, (void*) TEX_UPPER_BAKED)); - menu->append(new LLMenuItemCallGL("Lower Body", handle_grab_texture, enable_grab_texture, (void*) TEX_LOWER_BAKED)); - menu->append(new LLMenuItemCallGL("Skirt", handle_grab_texture, enable_grab_texture, (void*) TEX_SKIRT_BAKED)); - menu->append(new LLMenuItemCallGL("Hair", handle_grab_texture, enable_grab_texture, (void*) TEX_HAIR_BAKED)); - menu->createJumpKeys(); + return new_value; } +}; -void init_server_menu(LLMenuGL* menu) + +////////////////// +// INFO DISPLAY // +////////////////// +U32 info_display_from_string(std::string info_display) +{ + if ("verify" == info_display) + { + return LLPipeline::RENDER_DEBUG_VERIFY; + } + else if ("bboxes" == info_display) + { + return LLPipeline::RENDER_DEBUG_BBOXES; + } + else if ("points" == info_display) + { + return LLPipeline::RENDER_DEBUG_POINTS; + } + else if ("octree" == info_display) + { + return LLPipeline::RENDER_DEBUG_OCTREE; + } + else if ("shadow frusta" == info_display) + { + return LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA; + } + else if ("occlusion" == info_display) + { + return LLPipeline::RENDER_DEBUG_OCCLUSION; + } + else if ("render batches" == info_display) + { + return LLPipeline::RENDER_DEBUG_BATCH_SIZE; + } + else if ("texture anim" == info_display) + { + return LLPipeline::RENDER_DEBUG_TEXTURE_ANIM; + } + else if ("texture priority" == info_display) + { + return LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY; + } + else if ("shame" == info_display) + { + return LLPipeline::RENDER_DEBUG_SHAME; + } + else if ("texture area" == info_display) + { + return LLPipeline::RENDER_DEBUG_TEXTURE_AREA; + } + else if ("face area" == info_display) + { + return LLPipeline::RENDER_DEBUG_FACE_AREA; + } + else if ("lights" == info_display) + { + return LLPipeline::RENDER_DEBUG_LIGHTS; + } + else if ("particles" == info_display) + { + return LLPipeline::RENDER_DEBUG_PARTICLES; + } + else if ("composition" == info_display) + { + return LLPipeline::RENDER_DEBUG_COMPOSITION; + } + else if ("glow" == info_display) + { + return LLPipeline::RENDER_DEBUG_GLOW; + } + else if ("collision skeleton" == info_display) + { + return LLPipeline::RENDER_DEBUG_AVATAR_VOLUME; + } + else if ("agent target" == info_display) + { + return LLPipeline::RENDER_DEBUG_AGENT_TARGET; + } + else + { + return 0; + } +}; + +class LLAdvancedToggleInfoDisplay : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + U32 info_display = info_display_from_string( userdata.asString() ); + + if ( info_display != 0 ) + { + LLPipeline::toggleRenderDebug( (void*)info_display ); + } + + return true; + } +}; + + +class LLAdvancedCheckInfoDisplay : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + U32 info_display = info_display_from_string( userdata.asString() ); + bool new_value = false; + + if ( info_display != 0 ) + { + new_value = LLPipeline::toggleRenderDebugControl( (void*)info_display ); + } + + return new_value; + } +}; + + +/////////////////////////// +//// RANDOMIZE FRAMERATE // +/////////////////////////// + + +class LLAdvancedToggleRandomizeFramerate : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + gRandomizeFramerate = !(gRandomizeFramerate); + return true; + } +}; + +class LLAdvancedCheckRandomizeFramerate : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = gRandomizeFramerate; + return new_value; + } +}; + +void run_vectorize_perf_test(void *) +{ + gSavedSettings.setBOOL("VectorizePerfTest", TRUE); +} + + +//////////////////////////////// +// RUN Vectorized Perform Test// +//////////////////////////////// + + +class LLAdvancedVectorizePerfTest : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + run_vectorize_perf_test(NULL); + return true; + } +}; + +/////////////////////////// +//// PERIODIC SLOW FRAME // +/////////////////////////// + + +class LLAdvancedTogglePeriodicSlowFrame : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + gPeriodicSlowFrame = !(gPeriodicSlowFrame); + return true; + } +}; + +class LLAdvancedCheckPeriodicSlowFrame : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = gPeriodicSlowFrame; + return new_value; + } +}; + + + +//////////////// +// FRAME TEST // +//////////////// + + +class LLAdvancedToggleFrameTest : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLPipeline::sRenderFrameTest = !(LLPipeline::sRenderFrameTest); + return true; + } +}; + +class LLAdvancedCheckFrameTest : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = LLPipeline::sRenderFrameTest; + return new_value; + } +}; + + + // +///////////////////////////// +//// HIDE SELECTED OBJECTS // +///////////////////////////// +// +// +//class LLAdvancedToggleHideSelectedObjects : public view_listener_t +//{ +// bool handleEvent(const LLSD& userdata) +// { +// LLSelectMgr::sHideSelectedObjects = !(LLSelectMgr::sHideSelectedObjects); +// return true; +// } +//}; + // +//class LLAdvancedCheckHideSelectedObjects : public view_listener_t +//{ +// bool handleEvent(const LLSD& userdata) +// { +// bool new_value = gHideSelectedObjects; +// return new_value; +// } +//}; + +/////////////////////////// +// SELECTED TEXTURE INFO // +/////////////////////////// + + +class LLAdvancedSelectedTextureInfo : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_selected_texture_info(NULL); + return true; + } +}; + +////////////////////// +// TOGGLE WIREFRAME // +////////////////////// + +class LLAdvancedToggleWireframe : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + gUseWireframe = !(gUseWireframe); + return true; + } +}; + +class LLAdvancedCheckWireframe : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = gUseWireframe; + return new_value; + } +}; + +////////////////////// +// DISABLE TEXTURES // +////////////////////// + +class LLAdvancedToggleDisableTextures : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerImage::sDontLoadVolumeTextures = !LLViewerImage::sDontLoadVolumeTextures; + return true; + } +}; + +class LLAdvancedCheckDisableTextures : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = LLViewerImage::sDontLoadVolumeTextures; // <-- make this using LLCacheControl + return new_value; + } +}; + +////////////////////////// +// DUMP SCRIPTED CAMERA // +////////////////////////// + +class LLAdvancedDumpScriptedCamera : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_dump_followcam(NULL); + return true; +} +}; + + + +////////////////////////////// +// DUMP REGION OBJECT CACHE // +////////////////////////////// + + +class LLAdvancedDumpRegionObjectCache : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) +{ + handle_dump_region_object_cache(NULL); + return true; + } +}; + +class LLAdvancedWebBrowserTest : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_web_browser_test(NULL); + return true; + } +}; + +class LLAdvancedBuyCurrencyTest : public view_listener_t + { + bool handleEvent(const LLSD& userdata) + { + handle_buy_currency_test(NULL); + return true; + } +}; + + +//////////////////////// +// TOGGLE EDITABLE UI // +//////////////////////// + + +class LLAdvancedToggleEditableUI : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + edit_ui(NULL); + return true; + } +}; + + +///////////////////// +// DUMP SELECT MGR // +///////////////////// + + +class LLAdvancedDumpSelectMgr : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + dump_select_mgr(NULL); + return true; + } +}; + + + +//////////////////// +// DUMP INVENTORY // +//////////////////// + + +class LLAdvancedDumpInventory : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + dump_inventory(NULL); + return true; + } +}; + + + +/////////////////////// +// DUMP FOCUS HOLDER // +/////////////////////// + + +class LLAdvancedDumpFocusHolder : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_dump_focus(NULL); + return true; + } +}; + + + +//////////////////////////////// +// PRINT SELECTED OBJECT INFO // +//////////////////////////////// + + +class LLAdvancedPrintSelectedObjectInfo : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + print_object_info(NULL); + return true; + } +}; + + + +////////////////////// +// PRINT AGENT INFO // +////////////////////// + + +class LLAdvancedPrintAgentInfo : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + print_agent_nvpairs(NULL); + return true; + } +}; + + + +//////////////////////////////// +// PRINT TEXTURE MEMORY STATS // +//////////////////////////////// + + +class LLAdvancedPrintTextureMemoryStats : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + output_statistics(NULL); + return true; + } +}; + +////////////////// +// DEBUG CLICKS // +////////////////// + + +class LLAdvancedToggleDebugClicks : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + gDebugClicks = !(gDebugClicks); + return true; + } +}; + +class LLAdvancedCheckDebugClicks : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = gDebugClicks; + return new_value; + } +}; + + + +///////////////// +// DEBUG VIEWS // +///////////////// + + +class LLAdvancedToggleDebugViews : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLView::sDebugRects = !(LLView::sDebugRects); + return true; + } +}; + +class LLAdvancedCheckDebugViews : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = LLView::sDebugRects; + return new_value; + } +}; + + + +/////////////////////// +// XUI NAME TOOLTIPS // +/////////////////////// + + +class LLAdvancedToggleXUINameTooltips : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + toggle_show_xui_names(NULL); + return true; + } +}; + +class LLAdvancedCheckXUINameTooltips : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = check_show_xui_names(NULL); + return new_value; + } +}; + + + +//////////////////////// +// DEBUG MOUSE EVENTS // +//////////////////////// + + +class LLAdvancedToggleDebugMouseEvents : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLView::sDebugMouseHandling = !(LLView::sDebugMouseHandling); + return true; + } +}; + +class LLAdvancedCheckDebugMouseEvents : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = LLView::sDebugMouseHandling; + return new_value; + } +}; + + + +//////////////// +// DEBUG KEYS // +//////////////// + + +class LLAdvancedToggleDebugKeys : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLView::sDebugKeys = !(LLView::sDebugKeys); + return true; + } +}; + +class LLAdvancedCheckDebugKeys : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = LLView::sDebugKeys; + return new_value; + } +}; + + + +/////////////////////// +// DEBUG WINDOW PROC // +/////////////////////// + + +class LLAdvancedToggleDebugWindowProc : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + gDebugWindowProc = !(gDebugWindowProc); + return true; + } +}; + +class LLAdvancedCheckDebugWindowProc : public view_listener_t + { + bool handleEvent(const LLSD& userdata) + { + bool new_value = gDebugWindowProc; + return new_value; + } +}; + +// ------------------------------XUI MENU --------------------------- + + +class LLAdvancedShowFontTest : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloaterFontTest::show(NULL); + return true; + } +}; + +////////////////////// +// LOAD UI FROM XML // +////////////////////// + + +class LLAdvancedLoadUIFromXML : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_load_from_xml(NULL); + return true; +} +}; + + + +//////////////////// +// SAVE UI TO XML // +//////////////////// + + +class LLAdvancedSaveUIToXML : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_save_to_xml(NULL); + return true; +} +}; + + + +/////////////// +// XUI NAMES // +/////////////// + + +class LLAdvancedToggleXUINames : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + toggle_show_xui_names(NULL); + return true; + } +}; + +class LLAdvancedCheckXUINames : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = check_show_xui_names(NULL); + return new_value; + } +}; + + +//////////////////////// +// GRAB BAKED TEXTURE // +//////////////////////// + + +class LLAdvancedGrabBakedTexture : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string texture_type = userdata.asString(); + if ("iris" == texture_type) + { + handle_grab_texture( (void*)TEX_EYES_BAKED ); + } + else if ("head" == texture_type) + { + handle_grab_texture( (void*)TEX_HEAD_BAKED ); + } + else if ("upper" == texture_type) + { + handle_grab_texture( (void*)TEX_UPPER_BAKED ); + } + else if ("lower" == texture_type) + { + handle_grab_texture( (void*)TEX_SKIRT_BAKED ); + } + else if ("skirt" == texture_type) + { + handle_grab_texture( (void*)TEX_SKIRT_BAKED ); + } + else if ("hair" == texture_type) + { + handle_grab_texture( (void*)TEX_HAIR_BAKED ); +} + + return true; + } +}; + +class LLAdvancedEnableGrabBakedTexture : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) +{ + std::string texture_type = userdata.asString(); + bool new_value = false; + + if ("iris" == texture_type) + { + new_value = enable_grab_texture( (void*)TEX_EYES_BAKED ); + } + else if ("head" == texture_type) + { + new_value = enable_grab_texture( (void*)TEX_HEAD_BAKED ); + } + else if ("upper" == texture_type) + { + new_value = enable_grab_texture( (void*)TEX_UPPER_BAKED ); + } + else if ("lower" == texture_type) + { + new_value = enable_grab_texture( (void*)TEX_LOWER_BAKED ); + } + else if ("skirt" == texture_type) + { + new_value = enable_grab_texture( (void*)TEX_SKIRT_BAKED ); + } + + return new_value; +} +}; + +/////////////////////// +// APPEARANCE TO XML // +/////////////////////// + + +class LLAdvancedAppearanceToXML : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLVOAvatar::dumpArchetypeXML(NULL); + return true; + } +}; + + + +/////////////////////////////// +// TOGGLE CHARACTER GEOMETRY // +/////////////////////////////// + + +class LLAdvancedToggleCharacterGeometry : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_god_request_avatar_geometry(NULL); + return true; +} +}; + +class LLEnableGodCustomerService : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) +{ + bool new_value = enable_god_customer_service(NULL); + return new_value; + } +}; + + + + ///////////////////////////// +// TEST MALE / TEST FEMALE // +///////////////////////////// + +class LLAdvancedTestMale : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_test_male(NULL); + return true; + } +}; + + +class LLAdvancedTestFemale : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_test_female(NULL); + return true; + } +}; + + + +/////////////// +// TOGGLE PG // +/////////////// + + +class LLAdvancedTogglePG : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_toggle_pg(NULL); + return true; + } +}; + + + +//////////////////////////// +// ALLOW TAP-TAP-HOLD RUN // +//////////////////////////// + + +class LLAdvancedToggleAllowTapTapHoldRun : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + gAllowTapTapHoldRun = !(gAllowTapTapHoldRun); + return true; + } +}; + +class LLAdvancedCheckAllowTapTapHoldRun : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = gAllowTapTapHoldRun; + return new_value; + } +}; + + + + + +class LLAdvancedForceParamsToDefault : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLAgent::clearVisualParams(NULL); + return true; + } +}; + + + +////////////////////////// +// RELOAD VERTEX SHADER // +////////////////////////// + + +class LLAdvancedReloadVertexShader : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + reload_vertex_shader(NULL); + return true; + } +}; + + + +//////////////////// +// ANIMATION INFO // +//////////////////// + + +class LLAdvancedToggleAnimationInfo : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLVOAvatar::sShowAnimationDebug = !(LLVOAvatar::sShowAnimationDebug); + return true; + } +}; + +class LLAdvancedCheckAnimationInfo : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = LLVOAvatar::sShowAnimationDebug; + return new_value; + } +}; + + +////////////////// +// SHOW LOOK AT // +////////////////// + + +class LLAdvancedToggleShowLookAt : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLHUDEffectLookAt::sDebugLookAt = !(LLHUDEffectLookAt::sDebugLookAt); + return true; + } +}; + +class LLAdvancedCheckShowLookAt : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = LLHUDEffectLookAt::sDebugLookAt; + return new_value; + } +}; + + + +/////////////////// +// SHOW POINT AT // +/////////////////// + + +class LLAdvancedToggleShowPointAt : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLHUDEffectPointAt::sDebugPointAt = !(LLHUDEffectPointAt::sDebugPointAt); + return true; + } +}; + +class LLAdvancedCheckShowPointAt : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = LLHUDEffectPointAt::sDebugPointAt; + return new_value; + } +}; + + + +///////////////////////// +// DEBUG JOINT UPDATES // +///////////////////////// + + +class LLAdvancedToggleDebugJointUpdates : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLVOAvatar::sJointDebug = !(LLVOAvatar::sJointDebug); + return true; + } +}; + +class LLAdvancedCheckDebugJointUpdates : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = LLVOAvatar::sJointDebug; + return new_value; + } +}; + + + +///////////////// +// DISABLE LOD // +///////////////// + + +class LLAdvancedToggleDisableLOD : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerJoint::sDisableLOD = !(LLViewerJoint::sDisableLOD); + return true; + } +}; + +class LLAdvancedCheckDisableLOD : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = LLViewerJoint::sDisableLOD; + return new_value; + } +}; + + + +///////////////////////// +// DEBUG CHARACTER VIS // +///////////////////////// + + +class LLAdvancedToggleDebugCharacterVis : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLVOAvatar::sDebugInvisible = !(LLVOAvatar::sDebugInvisible); + return true; + } +}; + +class LLAdvancedCheckDebugCharacterVis : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = LLVOAvatar::sDebugInvisible; + return new_value; + } +}; + + +////////////////////// +// DUMP ATTACHMENTS // +////////////////////// + + +class LLAdvancedDumpAttachments : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_dump_attachments(NULL); + return true; + } +}; + + + +///////////////////// +// REBAKE TEXTURES // +///////////////////// + + +class LLAdvancedRebakeTextures : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_rebake_textures(NULL); + return true; + } +}; + + +#ifndef LL_RELEASE_FOR_DOWNLOAD +/////////////////////////// +// DEBUG AVATAR TEXTURES // +/////////////////////////// + + +class LLAdvancedDebugAvatarTextures : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_debug_avatar_textures(NULL); + return true; + } +}; + +//////////////////////////////// +// DUMP AVATAR LOCAL TEXTURES // +//////////////////////////////// + + +class LLAdvancedDumpAvatarLocalTextures : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_dump_avatar_local_textures(NULL); + return true; + } +}; + +//////////////////////////////// +// Memory Leaking Simulation // +//////////////////////////////// +class LLAdvancedMemoryLeakingSimulation : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloaterMemLeak::show(NULL); + return true; + } +}; + +#endif + +///////////////// +// MESSAGE LOG // +///////////////// + + +class LLAdvancedEnableMessageLog : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_viewer_enable_message_log(NULL); + return true; + } +}; + +class LLAdvancedDisableMessageLog : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_viewer_disable_message_log(NULL); + return true; + } +}; + +///////////////// +// DROP PACKET // +///////////////// + + +class LLAdvancedDropPacket : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + gMessageSystem->mPacketRing.dropPackets(1); + return true; + } +}; + + + +///////////////// +// AGENT PILOT // +///////////////// + + +class LLAdvancedAgentPilot : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string command = userdata.asString(); + if ("start playback" == command) + { + LLAgentPilot::startPlayback(NULL); + } + else if ("stop playback" == command) + { + LLAgentPilot::stopPlayback(NULL); + } + else if ("start record" == command) + { + LLAgentPilot::startRecord(NULL); + } + else if ("stop record" == command) + { + LLAgentPilot::saveRecord(NULL); + } + + return true; + } +}; + + + +////////////////////// +// AGENT PILOT LOOP // +////////////////////// + + +class LLAdvancedToggleAgentPilotLoop : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLAgentPilot::sLoop = !(LLAgentPilot::sLoop); + return true; + } +}; + +class LLAdvancedCheckAgentPilotLoop : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = LLAgentPilot::sLoop; + return new_value; + } +}; + + +///////////////////////// +// SHOW OBJECT UPDATES // +///////////////////////// + + +class LLAdvancedToggleShowObjectUpdates : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + gShowObjectUpdates = !(gShowObjectUpdates); + return true; + } +}; + +class LLAdvancedCheckShowObjectUpdates : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = gShowObjectUpdates; + return new_value; + } +}; + + + +//////////////////// +// COMPRESS IMAGE // +//////////////////// + + +class LLAdvancedCompressImage : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_compress_image(NULL); + return true; + } +}; + + + +///////////////////////// +// SHOW DEBUG SETTINGS // +///////////////////////// + + +class LLAdvancedShowDebugSettings : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloaterSettingsDebug::showInstance(userdata); + return true; + } +}; + + + +//////////////////////// +// VIEW ADMIN OPTIONS // +//////////////////////// + + +class LLAdvancedToggleViewAdminOptions : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_admin_override_toggle(NULL); + return true; + } +}; + +class LLAdvancedCheckViewAdminOptions : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = check_admin_override(NULL); + return new_value; + } +}; + +///////////////////////////////////// +// Enable Object Object Occlusion /// +///////////////////////////////////// +class LLAdvancedEnableObjectObjectOcclusion: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + + bool new_value = gGLManager.mHasOcclusionQuery && LLFeatureManager::getInstance()->isFeatureAvailable(userdata.asString()); + return new_value; +} +}; + + + +////////////////// +// ADMIN STATUS // +////////////////// + + +class LLAdvancedRequestAdminStatus : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_god_mode(NULL); + return true; + } +}; + +class LLAdvancedLeaveAdminStatus : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_leave_god_mode(NULL); + return true; + } +}; + +////////////////////////// +// Advanced > Debugging // +////////////////////////// + + +class LLAdvancedForceErrorBreakpoint : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + force_error_breakpoint(NULL); + return true; + } +}; + +class LLAdvancedForceErrorLlerror : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + force_error_llerror(NULL); + return true; + } +}; +class LLAdvancedForceErrorBadMemoryAccess : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + force_error_bad_memory_access(NULL); + return true; + } +}; + +class LLAdvancedForceErrorInfiniteLoop : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + force_error_infinite_loop(NULL); + return true; + } +}; + +class LLAdvancedForceErrorSoftwareException : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + force_error_software_exception(NULL); + return true; + } +}; + +class LLAdvancedForceErrorDriverCrash : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + force_error_driver_crash(NULL); + return true; + } +}; + +class LLAdvancedForceErrorDisconnectViewer : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_disconnect_viewer(NULL); + return true; +} +}; + + +#ifdef TOGGLE_HACKED_GODLIKE_VIEWER + +class LLAdvancedHandleToggleHackedGodmode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_toggle_hacked_godmode(NULL); + return true; + } +}; + +class LLAdvancedCheckToggleHackedGodmode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + check_toggle_hacked_godmode(NULL); + return true; + } +}; + +class LLAdvancedEnableToggleHackedGodmode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = enable_toggle_hacked_godmode(NULL); + return new_value; + } +}; +#endif + + +// +////------------------------------------------------------------------- +//// Advanced menu +////------------------------------------------------------------------- + +////////////////// +// ADMIN MENU // +////////////////// + +// Admin > Object +class LLAdminForceTakeCopy : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + force_take_copy(NULL); + return true; + } +}; + +class LLAdminHandleObjectOwnerSelf : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_object_owner_self(NULL); + return true; + } +}; +class LLAdminHandleObjectOwnerPermissive : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_object_owner_permissive(NULL); + return true; + } +}; + +class LLAdminHandleForceDelete : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_force_delete(NULL); + return true; + } +}; + +class LLAdminHandleObjectLock : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_object_lock(NULL); + return true; + } +}; + +class LLAdminHandleObjectAssetIDs: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_object_asset_ids(NULL); + return true; + } +}; + +//Admin >Parcel +class LLAdminHandleForceParcelOwnerToMe: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_force_parcel_owner_to_me(NULL); + return true; + } +}; +class LLAdminHandleForceParcelToContent: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_force_parcel_to_content(NULL); + return true; + } +}; +class LLAdminHandleClaimPublicLand: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_claim_public_land(NULL); + return true; + } +}; + +// Admin > Region +class LLAdminHandleRegionDumpTempAssetData: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_region_dump_temp_asset_data(NULL); + return true; + } +}; +//Admin (Top Level) +class LLAdminShowGodTools: public view_listener_t { + bool handleEvent(const LLSD& userdata) { - LLMenuGL* sub = new LLMenuGL("Object"); - menu->appendMenu(sub); - - sub->append(new LLMenuItemCallGL( "Take Copy", - &force_take_copy, &enable_god_customer_service, NULL, - 'O', MASK_SHIFT | MASK_ALT | MASK_CONTROL)); -#ifdef _CORY_TESTING - sub->append(new LLMenuItemCallGL( "Export Copy", - &force_export_copy, NULL, NULL)); - sub->append(new LLMenuItemCallGL( "Import Geometry", - &force_import_geometry, NULL, NULL)); -#endif - //sub->append(new LLMenuItemCallGL( "Force Public", - // &handle_object_owner_none, NULL, NULL)); - //sub->append(new LLMenuItemCallGL( "Force Ownership/Permissive", - // &handle_object_owner_self_and_permissive, NULL, NULL, 'K', MASK_SHIFT | MASK_ALT | MASK_CONTROL)); - sub->append(new LLMenuItemCallGL( "Force Owner To Me", - &handle_object_owner_self, &enable_god_customer_service)); - sub->append(new LLMenuItemCallGL( "Force Owner Permissive", - &handle_object_owner_permissive, &enable_god_customer_service)); - //sub->append(new LLMenuItemCallGL( "Force Totally Permissive", - // &handle_object_permissive)); - sub->append(new LLMenuItemCallGL( "Delete", - &handle_force_delete, &enable_god_customer_service, NULL, KEY_DELETE, MASK_SHIFT | MASK_ALT | MASK_CONTROL)); - sub->append(new LLMenuItemCallGL( "Lock", - &handle_object_lock, &enable_god_customer_service, NULL, 'L', MASK_SHIFT | MASK_ALT | MASK_CONTROL)); - sub->append(new LLMenuItemCallGL( "Get Asset IDs", - &handle_object_asset_ids, &enable_god_customer_service, NULL, 'I', MASK_SHIFT | MASK_ALT | MASK_CONTROL)); - sub->createJumpKeys(); - } - { - LLMenuGL* sub = new LLMenuGL("Parcel"); - menu->appendMenu(sub); - - sub->append(new LLMenuItemCallGL("Owner To Me", - &handle_force_parcel_owner_to_me, - &enable_god_customer_service, NULL)); - sub->append(new LLMenuItemCallGL("Set to Linden Content", - &handle_force_parcel_to_content, - &enable_god_customer_service, NULL, - 'C', MASK_SHIFT | MASK_ALT | MASK_CONTROL)); - sub->appendSeparator(); - sub->append(new LLMenuItemCallGL("Claim Public Land", - &handle_claim_public_land, &enable_god_customer_service)); - - sub->createJumpKeys(); - } - { - LLMenuGL* sub = new LLMenuGL("Region"); - menu->appendMenu(sub); - sub->append(new LLMenuItemCallGL("Dump Temp Asset Data", - &handle_region_dump_temp_asset_data, - &enable_god_customer_service, NULL)); - sub->createJumpKeys(); - } - menu->append(new LLMenuItemCallGL( "God Tools...", - &LLFloaterGodTools::show, &enable_god_basic, NULL)); - - menu->appendSeparator(); - - menu->append(new LLMenuItemCallGL("Save Region State", - &LLPanelRegionTools::onSaveState, &enable_god_customer_service, NULL)); + LLFloaterGodTools::showInstance(LLSD()); + return true; + } +}; -// menu->append(new LLMenuItemCallGL("Force Join Group", handle_force_join_group)); -// -// menu->appendSeparator(); -// -// menu->append(new LLMenuItemCallGL( "OverlayTitle", -// &handle_show_overlay_title, &enable_god_customer_service, NULL)); - menu->createJumpKeys(); +class LLAdminOnSaveState: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLPanelRegionTools::onSaveState(NULL); + return true; } +}; -static std::vector<LLPointer<view_listener_t> > sMenus; //----------------------------------------------------------------------------- // cleanup_menus() @@ -1513,8 +2461,6 @@ void cleanup_menus() delete gMenuHolder; gMenuHolder = NULL; - - sMenus.clear(); } //----------------------------------------------------------------------------- @@ -1523,7 +2469,7 @@ void cleanup_menus() class LLObjectReportAbuse : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (objectp) @@ -1537,17 +2483,16 @@ class LLObjectReportAbuse : public view_listener_t // Enabled it you clicked an object class LLObjectEnableReportAbuse : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLSelectMgr::getInstance()->getSelection()->getObjectCount() != 0; - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLObjectTouch : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (!object) return true; @@ -1598,44 +2543,41 @@ class LLObjectTouch : public view_listener_t // One object must have touch sensor class LLObjectEnableTouch : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); bool new_value = obj && obj->flagHandleTouch(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); // Update label based on the node touch name if available. - LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); - std::string touch_text; + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if (node && node->mValid && !node->mTouchName.empty()) { - touch_text = node->mTouchName; + touch_text = node->mTouchName; } else { - touch_text = userdata["data"].asString(); + touch_text = userdata.asString(); } - gMenuHolder->childSetText("Object Touch", touch_text); gMenuHolder->childSetText("Attachment Object Touch", touch_text); - return true; + return new_value; } }; -void label_touch(std::string& label, void*) -{ - LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); - if (node && node->mValid && !node->mTouchName.empty()) - { - label.assign(node->mTouchName); - } - else - { - label.assign("Touch"); - } -} +//void label_touch(std::string& label, void*) +//{ +// LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); +// if (node && node->mValid && !node->mTouchName.empty()) +// { +// label.assign(node->mTouchName); +// } +// else +// { +// label.assign("Touch"); +// } +//} bool handle_object_open() { @@ -1648,7 +2590,7 @@ bool handle_object_open() class LLObjectOpen : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { return handle_object_open(); } @@ -1656,7 +2598,7 @@ class LLObjectOpen : public view_listener_t class LLObjectEnableOpen : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { // Look for contents in root object, which is all the LLFloaterOpenObject // understands. @@ -1668,96 +2610,14 @@ class LLObjectEnableOpen : public view_listener_t if (!root) new_value = false; else new_value = root->allowOpen(); } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; - } -}; - - -class LLViewCheckBuildMode : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - bool new_value = LLToolMgr::getInstance()->inEdit(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; - } -}; - -bool toggle_build_mode() -{ - if (LLToolMgr::getInstance()->inBuildMode()) - { - if (gSavedSettings.getBOOL("EditCameraMovement")) - { - // just reset the view, will pull us out of edit mode - handle_reset_view(); - } - else - { - // manually disable edit mode, but do not affect the camera - gAgent.resetView(false); - gFloaterTools->close(); - gViewerWindow->showCursor(); - } - // avoid spurious avatar movements pulling out of edit mode - LLViewerJoystick::getInstance()->setNeedsReset(); - } - else - { - ECameraMode camMode = gAgent.getCameraMode(); - if (CAMERA_MODE_MOUSELOOK == camMode || CAMERA_MODE_CUSTOMIZE_AVATAR == camMode) - { - // pull the user out of mouselook or appearance mode when entering build mode - handle_reset_view(); - } - - if (gSavedSettings.getBOOL("EditCameraMovement")) - { - // camera should be set - if (LLViewerJoystick::getInstance()->getOverrideCamera()) - { - handle_toggle_flycam(); - } - - if (gAgent.getFocusOnAvatar()) - { - // zoom in if we're looking at the avatar - gAgent.setFocusOnAvatar(FALSE, ANIMATE); - gAgent.setFocusGlobal(gAgent.getPositionGlobal() + 2.0 * LLVector3d(gAgent.getAtAxis())); - gAgent.cameraZoomIn(0.666f); - gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); - } - } - - - LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); - LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); - - // Could be first use - LLFirstUse::useBuild(); - - gAgent.resetView(false); - - // avoid spurious avatar movements - LLViewerJoystick::getInstance()->setNeedsReset(); - - } - return true; -} - -class LLViewBuildMode : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - return toggle_build_mode(); + return new_value; } }; class LLViewJoystickFlycam : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { handle_toggle_flycam(); return true; @@ -1766,31 +2626,13 @@ class LLViewJoystickFlycam : public view_listener_t class LLViewCheckJoystickFlycam : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - bool new_val = LLViewerJoystick::getInstance()->getOverrideCamera(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_val); - return true; - } -}; - -class LLViewCommunicate : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - if (LLFloaterChatterBox::getInstance()->getFloaterCount() == 0) - { - LLFloaterMyFriends::toggleInstance(); - } - else + bool handleEvent(const LLSD& userdata) { - LLFloaterChatterBox::toggleInstance(); - } - return true; + bool new_value = LLViewerJoystick::getInstance()->getOverrideCamera(); + return new_value; } }; - void handle_toggle_flycam() { LLViewerJoystick::getInstance()->toggleFlycam(); @@ -1798,7 +2640,7 @@ void handle_toggle_flycam() class LLObjectBuild : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit() && gSavedSettings.getBOOL("EditCameraMovement") ) { @@ -1826,7 +2668,7 @@ class LLObjectBuild : public view_listener_t class LLObjectEdit : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLViewerParcelMgr::getInstance()->deselectLand(); @@ -1856,7 +2698,7 @@ class LLObjectEdit : public view_listener_t } } - gFloaterTools->open(); /* Flawfinder: ignore */ + LLFloaterReg::showInstance("build"); LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); gFloaterTools->setEditTool( LLToolCompTranslate::getInstance() ); @@ -1872,7 +2714,7 @@ class LLObjectEdit : public view_listener_t class LLObjectInspect : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLFloaterInspect::show(); return true; @@ -1885,7 +2727,7 @@ class LLObjectInspect : public view_listener_t //--------------------------------------------------------------------------- class LLLandBuild : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLViewerParcelMgr::getInstance()->deselectLand(); @@ -1917,7 +2759,7 @@ class LLLandBuild : public view_listener_t class LLLandBuyPass : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLPanelLandGeneral::onClickBuyPass((void *)FALSE); return true; @@ -1926,11 +2768,10 @@ class LLLandBuyPass : public view_listener_t class LLLandEnableBuyPass : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLPanelLandGeneral::enableBuyPass(NULL); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; @@ -1966,7 +2807,7 @@ BOOL enable_object_build(void*) class LLEnableEdit : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { // *HACK: The new "prelude" Help Islands have a build sandbox area, // so users need the Edit and Create pie menu options when they are @@ -1979,23 +2820,22 @@ class LLEnableEdit : public view_listener_t enable = LLViewerParcelMgr::getInstance()->agentCanBuild() || LLSelectMgr::getInstance()->getSelection()->isAttachment(); } - gMenuHolder->findControl(userdata["control"].asString())->setValue(enable); - return true; + return enable; } }; class LLSelfRemoveAllAttachments : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { - LLAgent::userRemoveAllAttachments(NULL); + LLAgentWearables::userRemoveAllAttachments(NULL); return true; } }; class LLSelfEnableRemoveAllAttachments : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = false; if (gAgent.getAvatarObject()) @@ -2013,8 +2853,7 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t } } } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; @@ -2027,19 +2866,19 @@ BOOL enable_has_attachments(void*) //--------------------------------------------------------------------------- // Avatar pie menu //--------------------------------------------------------------------------- -void handle_follow(void *userdata) -{ - // follow a given avatar by ID - LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); - if (objectp) - { - gAgent.startFollowPilot(objectp->getID()); - } -} +//void handle_follow(void *userdata) +//{ +// // follow a given avatar by ID +// LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); +// if (objectp) +// { +// gAgent.startFollowPilot(objectp->getID()); +// } +//} class LLObjectEnableMute : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); bool new_value = (object != NULL); @@ -2055,14 +2894,13 @@ class LLObjectEnableMute : public view_listener_t new_value = !is_linden && !is_self; } } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLObjectMute : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (!object) return true; @@ -2108,7 +2946,7 @@ class LLObjectMute : public view_listener_t else { LLMuteList::getInstance()->add(mute); - LLFloaterMute::showInstance(); + LLFloaterReg::showInstance("mute"); } return true; @@ -2148,12 +2986,26 @@ bool handle_go_to() class LLGoToObject : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { return handle_go_to(); } }; +class LLAvatarReportAbuse : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); + if(avatar) + { + LLFloaterReporter::showFromObject(avatar->getID()); + } + return true; + } +}; + + //--------------------------------------------------------------------------- // Parcel freeze, eject, etc. //--------------------------------------------------------------------------- @@ -2192,7 +3044,7 @@ bool callback_freeze(const LLSD& notification, const LLSD& response) class LLAvatarFreeze : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if( avatar ) @@ -2224,32 +3076,31 @@ class LLAvatarFreeze : public view_listener_t class LLAvatarVisibleDebug : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { - bool new_value = gAgent.isGodlike(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return gAgent.isGodlike(); } }; class LLAvatarEnableDebug : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { - bool new_value = gAgent.isGodlike(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return gAgent.isGodlike(); } }; class LLAvatarDebug : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if( avatar ) { - avatar->dumpLocalTextures(); + if (avatar->isSelf()) + { + ((LLVOAvatarSelf *)avatar)->dumpLocalTextures(); + } llinfos << "Dumping temporary asset data to simulator logs for avatar " << avatar->getID() << llendl; std::vector<std::string> strings; strings.push_back(avatar->getID().asString()); @@ -2317,7 +3168,7 @@ bool callback_eject(const LLSD& notification, const LLSD& response) class LLAvatarEject : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if( avatar ) @@ -2376,7 +3227,7 @@ class LLAvatarEject : public view_listener_t class LLAvatarEnableFreezeEject : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); bool new_value = (avatar != NULL); @@ -2399,14 +3250,13 @@ class LLAvatarEnableFreezeEject : public view_listener_t } } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLAvatarGiveCard : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { llinfos << "handle_give_card()" << llendl; LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); @@ -2461,7 +3311,7 @@ void login_done(S32 which, void *user) { llinfos << "Login done " << which << llendl; - LLPanelLogin::close(); + LLPanelLogin::closePanel(); } @@ -2477,22 +3327,12 @@ bool callback_leave_group(const LLSD& notification, const LLSD& response) msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_GroupData); - msg->addUUIDFast(_PREHASH_GroupID, gAgent.mGroupID ); + msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID() ); gAgent.sendReliableMessage(); } return false; } -void handle_leave_group(void *) -{ - if (gAgent.getGroupID() != LLUUID::null) - { - LLSD args; - args["GROUP"] = gAgent.mGroupName; - LLNotifications::instance().add("GroupLeaveConfirmMember", args, LLSD(), callback_leave_group); - } -} - void append_aggregate(std::string& string, const LLAggregatePermissions& ag_perm, PermissionBit bit, const char* txt) { LLAggregatePermissions::EValue val = ag_perm.getValue(bit); @@ -2538,11 +3378,10 @@ BOOL enable_buy(void*) class LLObjectEnableBuy : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = enable_buy(NULL); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; @@ -2624,18 +3463,9 @@ void handle_region_dump_settings(void*) } } -void handle_show_notifications_console(void *) -{ - LLFloaterNotificationConsole::showInstance(); -} - void handle_dump_group_info(void *) { - llinfos << "group " << gAgent.mGroupName << llendl; - llinfos << "ID " << gAgent.mGroupID << llendl; - llinfos << "powers " << gAgent.mGroupPowers << llendl; - llinfos << "title " << gAgent.mGroupTitle << llendl; - //llinfos << "insig " << gAgent.mGroupInsigniaID << llendl; + gAgent.dumpGroupInfo(); } void handle_dump_capabilities_info(void *) @@ -2665,7 +3495,7 @@ void handle_dump_focus(void *) class LLSelfStandUp : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); return true; @@ -2674,11 +3504,10 @@ class LLSelfStandUp : public view_listener_t class LLSelfEnableStandUp : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = gAgent.getAvatarObject() && gAgent.getAvatarObject()->mIsSitting; - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; @@ -2740,7 +3569,6 @@ void set_god_level(U8 god_level) LLNotifications::instance().add("LeavingGodMode", args); } - // changing god-level can affect which menus we see show_debug_menus(); } @@ -2756,6 +3584,11 @@ BOOL check_toggle_hacked_godmode(void*) { return gHackGodmode; } + +bool enable_toggle_hacked_godmode(void*) +{ + return !LLViewerLogin::getInstance()->isInProductionGrid(); +} #endif void process_grant_godlike_powers(LLMessageSystem* msg, void**) @@ -2824,35 +3657,15 @@ BOOL is_agent_mappable(const LLUUID& agent_id) ); } -// Enable a menu item when you have someone's card. -/* -BOOL enable_have_card(void *userdata) -{ - LLUUID* avatar_id = (LLUUID *)userdata; - if (gAgent.isGodlike()) - { - return TRUE; - } - else if(avatar_id) - { - return is_agent_friend(*avatar_id); - } - else - { - return FALSE; - } -} -*/ // Enable a menu item when you don't have someone's card. class LLAvatarEnableAddFriend : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); bool new_value = avatar && !is_agent_friend(avatar->getID()); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; @@ -2875,7 +3688,7 @@ void request_friendship(const LLUUID& dest_id) } if (!fullname.empty()) { - LLPanelFriends::requestFriendshipDialog(dest_id, fullname); + LLFriendActions::requestFriendshipDialog(dest_id, fullname); } else { @@ -2887,13 +3700,10 @@ void request_friendship(const LLUUID& dest_id) class LLEditEnableCustomizeAvatar : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { - bool new_value = (gAgent.getAvatarObject() && - gAgent.getAvatarObject()->isFullyLoaded() && - gAgent.areWearablesLoaded()); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + bool new_value = gAgentWearables.areWearablesLoaded(); + return new_value; } }; @@ -2917,6 +3727,7 @@ bool handle_sit_or_stand() if (object && object->getPCode() == LL_PCODE_VOLUME) { + gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); @@ -2932,7 +3743,7 @@ bool handle_sit_or_stand() class LLObjectSitOrStand : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { return handle_sit_or_stand(); } @@ -2952,7 +3763,7 @@ void near_sit_down_point(BOOL success, void *) class LLLandSit : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); LLViewerParcelMgr::getInstance()->deselectLand(); @@ -2973,137 +3784,6 @@ class LLLandSit : public view_listener_t } }; -void show_permissions_control(void*) -{ - LLFloaterPermissionsMgr* floaterp = LLFloaterPermissionsMgr::show(); - floaterp->mPermissions->addPermissionsData("foo1", LLUUID::null, 0); - floaterp->mPermissions->addPermissionsData("foo2", LLUUID::null, 0); - floaterp->mPermissions->addPermissionsData("foo3", LLUUID::null, 0); -} - - -class LLCreateLandmarkCallback : public LLInventoryCallback -{ -public: - /*virtual*/ void fire(const LLUUID& inv_item) - { - llinfos << "Created landmark with inventory id " << inv_item - << llendl; - } -}; - -void reload_ui(void *) -{ - LLUICtrlFactory::getInstance()->rebuild(); -} - -class LLWorldFly : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - gAgent.toggleFlying(); - return true; - } -}; - -class LLWorldEnableFly : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - BOOL sitting = FALSE; - if (gAgent.getAvatarObject()) - { - sitting = gAgent.getAvatarObject()->mIsSitting; - } - gMenuHolder->findControl(userdata["control"].asString())->setValue(!sitting); - return true; - } -}; - - -void handle_agent_stop_moving(void*) -{ - // stop agent - gAgent.setControlFlags(AGENT_CONTROL_STOP); - - // cancel autopilot - gAgent.stopAutoPilot(); -} - -void print_packets_lost(void*) -{ - LLWorld::getInstance()->printPacketsLost(); -} - - -void drop_packet(void*) -{ - gMessageSystem->mPacketRing.dropPackets(1); -} - - -void velocity_interpolate( void* data ) -{ - BOOL toggle = gSavedSettings.getBOOL("VelocityInterpolate"); - LLMessageSystem* msg = gMessageSystem; - if ( !toggle ) - { - msg->newMessageFast(_PREHASH_VelocityInterpolateOn); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gAgent.sendReliableMessage(); - llinfos << "Velocity Interpolation On" << llendl; - } - else - { - msg->newMessageFast(_PREHASH_VelocityInterpolateOff); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gAgent.sendReliableMessage(); - llinfos << "Velocity Interpolation Off" << llendl; - } - // BUG this is a hack because of the change in menu behavior. The - // old menu system would automatically change a control's value, - // but the new LLMenuGL system doesn't know what a control - // is. However, it's easy to distinguish between the two callers - // because LLMenuGL passes in the name of the user data (the - // control name) to the callback function, and the user data goes - // unused in the old menu code. Thus, if data is not null, then we - // need to swap the value of the control. - if( data ) - { - gSavedSettings.setBOOL( static_cast<char*>(data), !toggle ); - } -} - - -void toggle_wind_audio(void) -{ - if (gAudiop) - { - gAudiop->enableWind(!(gAudiop->isWindEnabled())); - } -} - - -// Callback for enablement -BOOL is_inventory_visible( void* user_data ) -{ - LLInventoryView* iv = reinterpret_cast<LLInventoryView*>(user_data); - if( iv ) - { - return iv->getVisible(); - } - return FALSE; -} - -void handle_show_newest_map(void*) -{ - LLFloaterWorldMap::show(NULL, FALSE); -} - //------------------------------------------------------------------- // Help menu functions //------------------------------------------------------------------- @@ -3111,24 +3791,24 @@ void handle_show_newest_map(void*) // // Major mode switching // -void reset_view_final( BOOL proceed, void* ); +void reset_view_final( BOOL proceed ); void handle_reset_view() { if( (CAMERA_MODE_CUSTOMIZE_AVATAR == gAgent.getCameraMode()) && gFloaterCustomize ) { // Show dialog box if needed. - gFloaterCustomize->askToSaveIfDirty( reset_view_final, NULL ); + gFloaterCustomize->askToSaveIfDirty( reset_view_final ); } else { - reset_view_final( TRUE, NULL ); + reset_view_final( TRUE ); } } class LLViewResetView : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { handle_reset_view(); return true; @@ -3136,7 +3816,7 @@ class LLViewResetView : public view_listener_t }; // Note: extra parameters allow this function to be called from dialog. -void reset_view_final( BOOL proceed, void* ) +void reset_view_final( BOOL proceed ) { if( !proceed ) { @@ -3148,7 +3828,7 @@ void reset_view_final( BOOL proceed, void* ) class LLViewLookAtLastChatter : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { gAgent.lookAtLastChat(); return true; @@ -3157,7 +3837,7 @@ class LLViewLookAtLastChatter : public view_listener_t class LLViewMouselook : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if (!gAgent.cameraMouselook()) { @@ -3173,7 +3853,7 @@ class LLViewMouselook : public view_listener_t class LLViewFullscreen : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { gViewerWindow->toggleFullscreen(TRUE); return true; @@ -3182,7 +3862,7 @@ class LLViewFullscreen : public view_listener_t class LLViewDefaultUISize : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { gSavedSettings.setF32("UIScaleFactor", 1.0f); gSavedSettings.setBOOL("UIAutoScale", FALSE); @@ -3193,7 +3873,7 @@ class LLViewDefaultUISize : public view_listener_t class LLEditDuplicate : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if(LLEditMenuHandler::gEditMenuHandler) { @@ -3205,23 +3885,13 @@ class LLEditDuplicate : public view_listener_t class LLEditEnableDuplicate : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDuplicate(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; - -void disabled_duplicate(void*) -{ - if (LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()) - { - LLNotifications::instance().add("CopyFailed"); - } -} - void handle_duplicate_in_place(void*) { llinfos << "handle_duplicate_in_place" << llendl; @@ -3230,11 +3900,6 @@ void handle_duplicate_in_place(void*) LLSelectMgr::getInstance()->selectDuplicate(offset, TRUE); } -void handle_repeat_duplicate(void*) -{ - LLSelectMgr::getInstance()->repeatDuplicate(); -} - /* dead code 30-apr-2008 void handle_deed_object_to_group(void*) { @@ -3381,42 +4046,11 @@ void handle_claim_public_land(void*) msg->nextBlock("ParamList"); msg->addString("Parameter", buffer); buffer = llformat( "%f", east_north.mV[VY]); - msg->nextBlock("ParamList"); - msg->addString("Parameter", buffer); - gAgent.sendReliableMessage(); -} - -void handle_god_request_havok(void *) -{ - if (gAgent.isGodlike()) - { - LLSelectMgr::getInstance()->sendGodlikeRequest("havok", "infoverbose"); - } + msg->nextBlock("ParamList"); + msg->addString("Parameter", buffer); + gAgent.sendReliableMessage(); } -//void handle_god_request_foo(void *) -//{ -// if (gAgent.isGodlike()) -// { -// LLSelectMgr::getInstance()->sendGodlikeRequest(GOD_WANTS_FOO); -// } -//} - -//void handle_god_request_terrain_save(void *) -//{ -// if (gAgent.isGodlike()) -// { -// LLSelectMgr::getInstance()->sendGodlikeRequest("terrain", "save"); -// } -//} - -//void handle_god_request_terrain_load(void *) -//{ -// if (gAgent.isGodlike()) -// { -// LLSelectMgr::getInstance()->sendGodlikeRequest("terrain", "load"); -// } -//} // HACK for easily testing new avatar geometry @@ -3429,12 +4063,6 @@ void handle_god_request_avatar_geometry(void *) } -void handle_show_overlay_title(void*) -{ - gShowOverlayTitle = !gShowOverlayTitle; - gSavedSettings.setBOOL("ShowOverlayTitle", gShowOverlayTitle); -} - void derez_objects(EDeRezDestination dest, const LLUUID& dest_id) { if(gAgent.cameraMouselook()) @@ -3590,7 +4218,7 @@ void derez_objects(EDeRezDestination dest, const LLUUID& dest_id) class LLToolsTakeCopy : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; @@ -3605,7 +4233,7 @@ class LLToolsTakeCopy : public view_listener_t // You can return an object to its owner if it is on your land. class LLObjectReturn : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; @@ -3638,7 +4266,7 @@ protected: // over land you own. class LLObjectEnableReturn : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { #ifdef HACKED_GODLIKE_VIEWER bool new_value = true; @@ -3675,8 +4303,7 @@ class LLObjectEnableReturn : public view_listener_t } } #endif - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; @@ -3767,8 +4394,8 @@ void handle_take() payload["folder_id"] = category_id; LLNotification::Params params("ConfirmObjectTakeLock"); - params.payload(payload) - .functor(confirm_take); + params.payload(payload); + params.functor.function(confirm_take); if(locked_but_takeable_object || !you_own_everything) @@ -3776,7 +4403,6 @@ void handle_take() if(locked_but_takeable_object && you_own_everything) { params.name("ConfirmObjectTakeLock"); - } else if(!locked_but_takeable_object && !you_own_everything) { @@ -3849,7 +4475,7 @@ BOOL enable_take() class LLToolsBuyOrTake : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) { @@ -3880,17 +4506,16 @@ class LLToolsBuyOrTake : public view_listener_t class LLToolsEnableBuyOrTake : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool is_buy = is_selection_buy_not_take(); bool new_value = is_buy ? enable_buy(NULL) : enable_take(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); // Update label std::string label; std::string buy_text; std::string take_text; - std::string param = userdata["data"].asString(); + std::string param = userdata.asString(); std::string::size_type offset = param.find(","); if (offset != param.npos) { @@ -3908,7 +4533,7 @@ class LLToolsEnableBuyOrTake : public view_listener_t gMenuHolder->childSetText("Pie Object Take", label); gMenuHolder->childSetText("Menu Object Take", label); - return true; + return new_value; } }; @@ -3963,42 +4588,36 @@ S32 selection_price() return total_price; } - +/* bool callback_show_buy_currency(const LLSD& notification, const LLSD& response) { S32 option = LLNotification::getSelectedOption(notification, response); if (0 == option) { - llinfos << "Loading page " << BUY_CURRENCY_URL << llendl; - LLWeb::loadURL(BUY_CURRENCY_URL); + llinfos << "Loading page " << LLNotifications::instance().getGlobalString("BUY_CURRENCY_URL") << llendl; + LLWeb::loadURL(LLNotifications::instance().getGlobalString("BUY_CURRENCY_URL")); } return false; } - +*/ void show_buy_currency(const char* extra) { // Don't show currency web page for branded clients. - +/* std::ostringstream mesg; if (extra != NULL) { mesg << extra << "\n \n"; } - mesg << "Go to " << BUY_CURRENCY_URL << "\nfor information on purchasing currency?"; - + mesg << "Go to " << LLNotifications::instance().getGlobalString("BUY_CURRENCY_URL")<< "\nfor information on purchasing currency?"; +*/ LLSD args; if (extra != NULL) { args["EXTRA"] = extra; } - args["URL"] = BUY_CURRENCY_URL; - LLNotifications::instance().add("PromptGoToCurrencyPage", args, LLSD(), callback_show_buy_currency); -} - -void handle_buy_currency(void*) -{ -// LLFloaterBuyCurrency::buyCurrency(); + LLNotifications::instance().add("PromptGoToCurrencyPage", args);//, LLSD(), callback_show_buy_currency); } void handle_buy(void*) @@ -4021,7 +4640,7 @@ void handle_buy(void*) class LLObjectBuy : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { handle_buy(NULL); return true; @@ -4057,9 +4676,21 @@ BOOL sitting_on_selection() return (avatar->mIsSitting && avatar->getRoot() == root_object); } +class LLToolsSaveToInventory : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + if(enable_save_into_inventory(NULL)) + { + derez_objects(DRD_SAVE_INTO_AGENT_INVENTORY, LLUUID::null); + } + return true; + } +}; + class LLToolsSaveToObjectInventory : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if(node && (node->mValid) && (!node->mFromTaskID.isNull())) @@ -4074,7 +4705,7 @@ class LLToolsSaveToObjectInventory : public view_listener_t // Round the position of all root objects to the grid class LLToolsSnapObjectXY : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { F64 snap_size = (F64)gSavedSettings.getF32("GridResolution"); @@ -4128,7 +4759,7 @@ class LLToolsSnapObjectXY : public view_listener_t // reasonable expectation for the link to work, but it will fail. class LLToolsEnableLink : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = false; // check if there are at least 2 objects selected, and that the @@ -4150,14 +4781,13 @@ class LLToolsEnableLink : public view_listener_t new_value = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); } } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLToolsLink : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if(!LLSelectMgr::getInstance()->selectGetAllRootsValid()) { @@ -4203,19 +4833,18 @@ class LLToolsLink : public view_listener_t class LLToolsEnableUnlink : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() && LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() && !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLToolsUnlink : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLSelectMgr::getInstance()->sendDelink(); return true; @@ -4225,7 +4854,7 @@ class LLToolsUnlink : public view_listener_t class LLToolsStopAllAnimations : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { gAgent.stopCurrentAnimations(); return true; @@ -4234,7 +4863,7 @@ class LLToolsStopAllAnimations : public view_listener_t class LLToolsReleaseKeys : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { gAgent.forceReleaseControls(); @@ -4244,58 +4873,25 @@ class LLToolsReleaseKeys : public view_listener_t class LLToolsEnableReleaseKeys : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { - gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); - return true; + return gAgent.anyControlGrabbed(); } }; -//void handle_hinge(void*) -//{ -// LLSelectMgr::getInstance()->sendHinge(1); -//} - -//void handle_ptop(void*) -//{ -// LLSelectMgr::getInstance()->sendHinge(2); -//} - -//void handle_lptop(void*) -//{ -// LLSelectMgr::getInstance()->sendHinge(3); -//} - -//void handle_wheel(void*) -//{ -// LLSelectMgr::getInstance()->sendHinge(4); -//} - -//void handle_dehinge(void*) -//{ -// LLSelectMgr::getInstance()->sendDehinge(); -//} - -//BOOL enable_dehinge(void*) -//{ -// LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject(); -// return obj && !obj->isAttachment(); -//} - class LLEditEnableCut : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canCut(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLEditCut : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if( LLEditMenuHandler::gEditMenuHandler ) { @@ -4307,17 +4903,16 @@ class LLEditCut : public view_listener_t class LLEditEnableCopy : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canCopy(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLEditCopy : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if( LLEditMenuHandler::gEditMenuHandler ) { @@ -4329,17 +4924,16 @@ class LLEditCopy : public view_listener_t class LLEditEnablePaste : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canPaste(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLEditPaste : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if( LLEditMenuHandler::gEditMenuHandler ) { @@ -4351,17 +4945,16 @@ class LLEditPaste : public view_listener_t class LLEditEnableDelete : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLEditDelete : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { // If a text field can do a deletion, it gets precedence over deleting // an object in the world. @@ -4375,14 +4968,14 @@ class LLEditDelete : public view_listener_t // When deleting an object we may not actually be done // Keep selection so we know what to delete when confirmation is needed about the delete - gPieObject->hide(TRUE); + gPieObject->hide(); return true; } }; class LLObjectEnableDelete : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = #ifdef HACKED_GODLIKE_VIEWER @@ -4394,23 +4987,13 @@ class LLObjectEnableDelete : public view_listener_t # endif LLSelectMgr::getInstance()->canDoDelete(); #endif - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; - } -}; - -class LLEditSearch : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - LLFloaterDirectory::toggleFind(NULL); - return true; + return new_value; } }; class LLObjectDelete : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if (LLSelectMgr::getInstance()) { @@ -4422,7 +5005,7 @@ class LLObjectDelete : public view_listener_t // When deleting an object we may not actually be done // Keep selection so we know what to delete when confirmation is needed about the delete - gPieObject->hide(TRUE); + gPieObject->hide(); return true; } }; @@ -4434,38 +5017,35 @@ void handle_force_delete(void*) class LLViewEnableJoystickFlycam : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = (gSavedSettings.getBOOL("JoystickEnabled") && gSavedSettings.getBOOL("JoystickFlycamEnabled")); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLViewEnableLastChatter : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { // *TODO: add check that last chatter is in range bool new_value = (gAgent.cameraThirdPerson() && gAgent.getLastChatter().notNull()); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLEditEnableDeselect : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDeselect(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLEditDeselect : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if( LLEditMenuHandler::gEditMenuHandler ) { @@ -4477,18 +5057,17 @@ class LLEditDeselect : public view_listener_t class LLEditEnableSelectAll : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canSelectAll(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLEditSelectAll : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if( LLEditMenuHandler::gEditMenuHandler ) { @@ -4501,17 +5080,16 @@ class LLEditSelectAll : public view_listener_t class LLEditEnableUndo : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canUndo(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLEditUndo : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canUndo() ) { @@ -4523,17 +5101,16 @@ class LLEditUndo : public view_listener_t class LLEditEnableRedo : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canRedo(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLEditRedo : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canRedo() ) { @@ -4575,31 +5152,37 @@ void show_debug_menus() if ( gMenuBarView ) { BOOL debug = gSavedSettings.getBOOL("UseDebugMenus"); + + gMenuBarView->setItemVisible("Advanced", debug); + gMenuBarView->setItemEnabled("Advanced", debug); - if(debug) - { - LLFirstUse::useDebugMenus(); - } + gMenuBarView->setItemVisible("Debug", debug); + gMenuBarView->setItemEnabled("Debug", debug); - gMenuBarView->setItemVisible(CLIENT_MENU_NAME, debug); - gMenuBarView->setItemEnabled(CLIENT_MENU_NAME, debug); + gMenuBarView->setItemVisible("Develop", debug); + gMenuBarView->setItemEnabled("Develop", debug); // Server ('Admin') menu hidden when not in godmode. const bool show_server_menu = debug && (gAgent.getGodLevel() > GOD_NOT); - gMenuBarView->setItemVisible(SERVER_MENU_NAME, show_server_menu); - gMenuBarView->setItemEnabled(SERVER_MENU_NAME, show_server_menu); - - //gMenuBarView->setItemVisible("DebugOptions", visible); - //gMenuBarView->setItemVisible(std::string(AVI_TOOLS), visible); - - gMenuBarView->arrange(); // clean-up positioning - }; + gMenuBarView->setItemVisible("Admin", show_server_menu); + gMenuBarView->setItemEnabled("Admin", show_server_menu); + } + if (gLoginMenuBarView) + { + BOOL debug = gSavedSettings.getBOOL("UseDebugMenus"); + gLoginMenuBarView->setItemVisible("Debug", debug); + gLoginMenuBarView->setItemEnabled("Debug", debug); + } } void toggle_debug_menus(void*) { BOOL visible = ! gSavedSettings.getBOOL("UseDebugMenus"); gSavedSettings.setBOOL("UseDebugMenus", visible); + if(visible) + { + LLFirstUse::useDebugMenus(); + } show_debug_menus(); } @@ -4641,27 +5224,12 @@ void toggle_debug_menus(void*) // gExportDialog = LLUploadDialog::modalUploadDialog("Exporting selected objects..."); // } +// -BOOL menu_check_build_tool( void* user_data ) -{ - S32 index = (intptr_t) user_data; - return LLToolMgr::getInstance()->getCurrentToolset()->isToolSelected( index ); -} - -void handle_reload_settings(void*) -{ - gSavedSettings.resetToDefaults(); - gSavedSettings.loadFromFile(gSavedSettings.getString("ClientSettingsFile")); - - llinfos << "Loading colors from colors.xml" << llendl; - std::string color_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"colors.xml"); - gColors.resetToDefaults(); - gColors.loadFromFileLegacy(color_file, FALSE, TYPE_COL4U); -} class LLWorldSetHomeLocation : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { // we just send the message and let the server check for failure cases // server will echo back a "Home position set." alert if it succeeds @@ -4673,7 +5241,7 @@ class LLWorldSetHomeLocation : public view_listener_t class LLWorldTeleportHome : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { gAgent.teleportHome(); return true; @@ -4682,7 +5250,7 @@ class LLWorldTeleportHome : public view_listener_t class LLWorldAlwaysRun : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { // as well as altering the default walk-vs-run state, // we also change the *current* walk-vs-run state. @@ -4706,17 +5274,16 @@ class LLWorldAlwaysRun : public view_listener_t class LLWorldCheckAlwaysRun : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = gAgent.getAlwaysRun(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLWorldSetAway : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if (gAgent.getAFK()) { @@ -4732,7 +5299,7 @@ class LLWorldSetAway : public view_listener_t class LLWorldSetBusy : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if (gAgent.getBusy()) { @@ -4750,14 +5317,14 @@ class LLWorldSetBusy : public view_listener_t bool can_create_landmark() { BOOL can = FALSE; - + LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (agent_parcel) - { +{ if (agent_parcel->getAllowLandmark() || LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK)) - { + { can = TRUE; } } @@ -4767,33 +5334,16 @@ bool can_create_landmark() class LLWorldCreateLandmark : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { - if (!can_create_landmark()) - { - LLNotifications::instance().add("CannotCreateLandmarkNotOwner"); - return true; - } - - LLUUID folder_id; - folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); - std::string pos_string; - gAgent.buildLocationString(pos_string); - - create_inventory_item(gAgent.getID(), gAgent.getSessionID(), - folder_id, LLTransactionID::tnull, - pos_string, pos_string, // name, desc - LLAssetType::AT_LANDMARK, - LLInventoryType::IT_LANDMARK, - NOT_WEARABLE, PERM_ALL, - new LLCreateLandmarkCallback); + LLFloaterReg::showInstance("add_landmark"); return true; } }; class LLToolsLookAtSelection : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { const F32 PADDING_FACTOR = 2.f; BOOL zoom = (userdata.asString() == "zoom"); @@ -4828,10 +5378,10 @@ class LLToolsLookAtSelection : public view_listener_t } }; -void callback_invite_to_group(LLUUID group_id, void *user_data) +void callback_invite_to_group(LLUUID group_id, LLUUID dest_id) { std::vector<LLUUID> agent_ids; - agent_ids.push_back(*(LLUUID *)user_data); + agent_ids.push_back(dest_id); LLFloaterGroupInvite::showForGroup(group_id, &agent_ids); } @@ -4847,14 +5397,14 @@ void invite_to_group(const LLUUID& dest_id) { widget->center(); widget->setPowersMask(GP_MEMBER_INVITE); - widget->setSelectCallback(callback_invite_to_group, (void *)&dest_id); + widget->setSelectGroupCallback(boost::bind(callback_invite_to_group, _1, dest_id)); } } } class LLAvatarInviteToGroup : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar) @@ -4867,7 +5417,7 @@ class LLAvatarInviteToGroup : public view_listener_t class LLAvatarAddFriend : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar && !is_agent_friend(avatar->getID())) @@ -4917,7 +5467,7 @@ bool complete_give_money(const LLSD& notification, const LLSD& response, LLObjec bool handle_give_money_dialog() { LLNotification::Params params("BusyModePay"); - params.functor(boost::bind(complete_give_money, _1, _2, LLSelectMgr::getInstance()->getSelection())); + params.functor.function(boost::bind(complete_give_money, _1, _2, LLSelectMgr::getInstance()->getSelection())); if (gAgent.getBusy()) { @@ -4933,7 +5483,7 @@ bool handle_give_money_dialog() class LLPayObject : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { return handle_give_money_dialog(); } @@ -4941,7 +5491,7 @@ class LLPayObject : public view_listener_t class LLEnablePayObject : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); bool new_value = (avatar != NULL); @@ -4957,14 +5507,13 @@ class LLEnablePayObject : public view_listener_t } } } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLObjectEnableSitOrStand : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = false; LLViewerObject* dest_object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); @@ -4976,13 +5525,11 @@ class LLObjectEnableSitOrStand : public view_listener_t new_value = true; } } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - // Update label std::string label; std::string sit_text; std::string stand_text; - std::string param = userdata["data"].asString(); + std::string param = userdata.asString(); std::string::size_type offset = param.find(","); if (offset != param.npos) { @@ -5007,7 +5554,7 @@ class LLObjectEnableSitOrStand : public view_listener_t } gMenuHolder->childSetText("Object Sit", label); - return true; + return new_value; } }; @@ -5026,29 +5573,6 @@ void dump_inventory(void*) gInventory.dumpInventory(); } -// forcibly unlock an object -void handle_force_unlock(void*) -{ - // First, make it public. - LLSelectMgr::getInstance()->sendOwner(LLUUID::null, LLUUID::null, TRUE); - - // Second, lie to the viewer and mark it editable and unowned - - struct f : public LLSelectedObjectFunctor - { - virtual bool apply(LLViewerObject* object) - { - object->mFlags |= FLAGS_OBJECT_MOVE; - object->mFlags |= FLAGS_OBJECT_MODIFY; - object->mFlags |= FLAGS_OBJECT_COPY; - - object->mFlags &= ~FLAGS_OBJECT_ANY_OWNER; - object->mFlags &= ~FLAGS_OBJECT_YOU_OWNER; - return true; - } - } func; - LLSelectMgr::getInstance()->getSelection()->applyToObjects(&func); -} void handle_dump_followcam(void*) { @@ -5065,10 +5589,9 @@ void handle_viewer_disable_message_log(void*) gMessageSystem->stopLogging(); } -// TomY TODO: Move! class LLShowFloater : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { std::string floater_name = userdata.asString(); if (floater_name == "gestures") @@ -5077,38 +5600,18 @@ class LLShowFloater : public view_listener_t } else if (floater_name == "appearance") { - if (gAgent.areWearablesLoaded()) + if (gAgentWearables.areWearablesLoaded()) { gAgent.changeCameraToCustomizeAvatar(); } } - else if (floater_name == "friends") - { - LLFloaterMyFriends::toggleInstance(0); - } - else if (floater_name == "preferences") - { - LLFloaterPreference::show(NULL); - } else if (floater_name == "toolbar") { LLToolBar::toggle(NULL); } - else if (floater_name == "chat history") - { - LLFloaterChat::toggleInstance(LLSD()); - } - else if (floater_name == "im") - { - LLFloaterChatterBox::toggleInstance(LLSD()); - } - else if (floater_name == "inventory") - { - LLInventoryView::toggleVisibility(NULL); - } else if (floater_name == "mute list") { - LLFloaterMute::toggleInstance(); + LLFloaterReg::toggleInstance("mute"); } else if (floater_name == "camera controls") { @@ -5118,18 +5621,6 @@ class LLShowFloater : public view_listener_t { LLFloaterMove::toggleInstance(); } - else if (floater_name == "world map") - { - LLFloaterWorldMap::toggle(NULL); - } - else if (floater_name == "mini map") - { - LLFloaterMap::toggleInstance(); - } - else if (floater_name == "stat bar") - { - LLFloaterStats::toggleInstance(); - } else if (floater_name == "my land") { LLFloaterLandHoldings::show(NULL); @@ -5143,6 +5634,10 @@ class LLShowFloater : public view_listener_t LLFloaterLand::showInstance(); } + else if (floater_name == "about region") + { + LLFloaterRegionInfo::showInstance(); + } else if (floater_name == "buy land") { if (LLViewerParcelMgr::getInstance()->selectionEmpty()) @@ -5152,13 +5647,9 @@ class LLShowFloater : public view_listener_t LLViewerParcelMgr::getInstance()->startBuyLand(); } - else if (floater_name == "about region") - { - LLFloaterRegionInfo::showInstance(); - } else if (floater_name == "grid options") { - LLFloaterBuildOptions::show(NULL); + LLFloaterBuildOptions::showInstance(); } else if (floater_name == "script errors") { @@ -5182,26 +5673,20 @@ class LLShowFloater : public view_listener_t { if (!gNoRender) { - LLFloaterBump::show(NULL); + LLFloaterBump::showInstance(); } } else if (floater_name == "lag meter") { LLFloaterLagMeter::showInstance(); } - else if (floater_name == "bug reporter") - { - // Prevent menu from appearing in screen shot. - gMenuHolder->hideMenus(); - LLFloaterReporter::showFromMenu(BUG_REPORT); - } else if (floater_name == "buy currency") { LLFloaterBuyCurrency::buyCurrency(); } else if (floater_name == "about") { - LLFloaterAbout::show(NULL); + LLFloaterReg::showInstance("sl_about"); } else if (floater_name == "active speakers") { @@ -5215,40 +5700,27 @@ class LLShowFloater : public view_listener_t { LLFloaterPerms::toggleInstance(LLSD()); } + else + { + LLFloaterReg::toggleInstance(floater_name); + } return true; } }; class LLFloaterVisible : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { - std::string control_name = userdata["control"].asString(); - std::string floater_name = userdata["data"].asString(); + std::string floater_name = userdata.asString(); bool new_value = false; - if (floater_name == "friends") - { - new_value = LLFloaterMyFriends::instanceVisible(0); - } - else if (floater_name == "communicate") - { - new_value = LLFloaterChatterBox::instanceVisible(); - } - else if (floater_name == "toolbar") + if (floater_name == "toolbar") { new_value = LLToolBar::visible(NULL); } - else if (floater_name == "chat history") - { - new_value = LLFloaterChat::instanceVisible(); - } - else if (floater_name == "im") - { - new_value = LLFloaterMyFriends::instanceVisible(0); - } else if (floater_name == "mute list") { - new_value = LLFloaterMute::instanceVisible(); + new_value = LLFloaterReg::instanceVisible("mute"); } else if (floater_name == "camera controls") { @@ -5260,7 +5732,7 @@ class LLFloaterVisible : public view_listener_t } else if (floater_name == "stat bar") { - new_value = LLFloaterStats::instanceVisible(); + new_value = gSavedSettings.getBOOL("ShowDebugStats"); } else if (floater_name == "active speakers") { @@ -5270,13 +5742,11 @@ class LLFloaterVisible : public view_listener_t { new_value = LLFloaterBeacons::instanceVisible(LLSD()); } - else if (floater_name == "inventory") + else { - LLInventoryView* iv = LLInventoryView::getActiveInventory(); - new_value = (NULL != iv && TRUE == iv->getVisible()); + new_value = LLFloaterReg::instanceVisible(floater_name); } - gMenuHolder->findControl(control_name)->setValue(new_value); - return true; + return new_value; } }; @@ -5292,7 +5762,7 @@ bool callback_show_url(const LLSD& notification, const LLSD& response) class LLPromptShowURL : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { std::string param = userdata.asString(); std::string::size_type offset = param.find(","); @@ -5332,7 +5802,7 @@ bool callback_show_file(const LLSD& notification, const LLSD& response) class LLPromptShowFile : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { std::string param = userdata.asString(); std::string::size_type offset = param.find(","); @@ -5355,7 +5825,7 @@ class LLPromptShowFile : public view_listener_t class LLShowAgentProfile : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLUUID agent_id; if (userdata.asString() == "agent") @@ -5378,50 +5848,15 @@ class LLShowAgentProfile : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(agent_id); if (avatar) { - LLFloaterAvatarInfo::show( avatar->getID() ); + LLFriendActions::showProfile(avatar->getID()); } return true; } }; -class LLShowAgentGroups : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - LLFloaterMyFriends::toggleInstance(1); - return true; - } -}; - -void handle_focus(void *) -{ - if (gDisconnected) - { - return; - } - - if (gAgent.getFocusOnAvatar()) - { - // zoom in if we're looking at the avatar - gAgent.setFocusOnAvatar(FALSE, ANIMATE); - gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); - gAgent.cameraZoomIn(0.666f); - } - else - { - gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); - } - - gViewerWindow->moveCursorToCenter(); - - // Switch to camera toolset -// LLToolMgr::getInstance()->setCurrentToolset(gCameraToolset); - LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCamera::getInstance() ); -} - class LLLandEdit : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) { @@ -5441,7 +5876,7 @@ class LLLandEdit : public view_listener_t LLViewerParcelMgr::getInstance()->selectParcelAt( LLToolPie::getInstance()->getPick().mPosGlobal ); - gFloaterView->bringToFront( gFloaterTools ); + LLFloaterReg::showInstance("build"); // Switch to land edit toolset LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolSelectLand::getInstance() ); @@ -5451,15 +5886,14 @@ class LLLandEdit : public view_listener_t class LLWorldEnableBuyLand : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLViewerParcelMgr::getInstance()->canAgentBuyParcel( LLViewerParcelMgr::getInstance()->selectionEmpty() ? LLViewerParcelMgr::getInstance()->getAgentParcel() : LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(), false); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; @@ -5470,26 +5904,6 @@ BOOL enable_buy_land(void*) } -void handle_move(void*) -{ - if (gAgent.getFocusOnAvatar()) - { - // zoom in if we're looking at the avatar - gAgent.setFocusOnAvatar(FALSE, ANIMATE); - gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); - - gAgent.cameraZoomIn(0.666f); - } - else - { - gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); - } - - gViewerWindow->moveCursorToCenter(); - - LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); - LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() ); -} class LLObjectAttachToAvatar : public view_listener_t { @@ -5497,7 +5911,7 @@ public: static void setObjectSelection(LLObjectSelectionHandle selection) { sObjectSelection = selection; } private: - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { setObjectSelection(LLSelectMgr::getInstance()->getSelection()); LLViewerObject* selectedObject = sObjectSelection->getFirstRootObject(); @@ -5580,7 +5994,7 @@ void confirm_replace_attachment(S32 option, void* user_data) class LLAttachmentDrop : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { // Called when the user clicked on an object attached to them // and selected "Drop". @@ -5624,11 +6038,13 @@ class LLAttachmentDrop : public view_listener_t }; // called from avatar pie menu -void handle_detach_from_avatar(void* user_data) +class LLAttachmentDetachFromPoint : public view_listener_t { - LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; + bool handleEvent(const LLSD& user_data) +{ + LLViewerJointAttachment *attachment = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, user_data.asInteger(), (LLViewerJointAttachment*)NULL); - LLViewerObject* attached_object = attachment->getObject(); + LLViewerObject* attached_object = attachment ? attachment->getObject() : NULL; if (attached_object) { @@ -5641,31 +6057,20 @@ void handle_detach_from_avatar(void* user_data) gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, attached_object->getLocalID()); gMessageSystem->sendReliable( gAgent.getRegionHost() ); } + return true; } +}; -void attach_label(std::string& label, void* user_data) +static bool onEnableAttachmentLabel(LLUICtrl* ctrl, const LLSD& data) { - LLViewerJointAttachment* attachmentp = (LLViewerJointAttachment*)user_data; - if (attachmentp) + std::string label; + LLMenuItemGL* menu = dynamic_cast<LLMenuItemGL*>(ctrl); + if (menu) { - label = attachmentp->getName(); - if (attachmentp->getObject()) - { - LLViewerInventoryItem* itemp = gInventory.getItem(attachmentp->getItemID()); - if (itemp) - { - label += std::string(" (") + itemp->getName() + std::string(")"); - } - } - } -} - -void detach_label(std::string& label, void* user_data) -{ - LLViewerJointAttachment* attachmentp = (LLViewerJointAttachment*)user_data; + LLViewerJointAttachment *attachmentp = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, data["index"].asInteger(), (LLViewerJointAttachment*)NULL); if (attachmentp) { - label = attachmentp->getName(); + label = data["label"].asString(); if (attachmentp->getObject()) { LLViewerInventoryItem* itemp = gInventory.getItem(attachmentp->getItemID()); @@ -5675,12 +6080,15 @@ void detach_label(std::string& label, void* user_data) } } } + menu->setLabel(label); +} + return true; } class LLAttachmentDetach : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { // Called when the user clicked on an object attached to them // and selected "Detach". @@ -5749,7 +6157,7 @@ protected: // You can only drop items on parcels where you can build. class LLAttachmentEnableDrop : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { BOOL can_build = gAgent.isGodlike() || (LLViewerParcelMgr::getInstance()->agentCanBuild()); @@ -5796,14 +6204,13 @@ class LLAttachmentEnableDrop : public view_listener_t } //now check to make sure that the item is actually in the inventory before we enable dropping it - bool new_value = enable_detach(NULL) && can_build && item; + bool new_value = enable_detach() && can_build && item; - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; -BOOL enable_detach(void*) +BOOL enable_detach(const LLSD&) { LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (!object) return FALSE; @@ -5827,18 +6234,16 @@ BOOL enable_detach(void*) class LLAttachmentEnableDetach : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { - bool new_value = enable_detach(NULL); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + bool new_value = enable_detach(); + return new_value; } }; // Used to tell if the selected object can be attached to your avatar. -BOOL object_selected_and_point_valid(void *user_data) +BOOL object_selected_and_point_valid(const LLSD&) { - //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); for (LLObjectSelection::root_iterator iter = selection->root_begin(); iter != selection->root_end(); iter++) @@ -5867,7 +6272,7 @@ BOOL object_selected_and_point_valid(void *user_data) BOOL object_is_wearable() { - if (!object_selected_and_point_valid(NULL)) + if (!object_selected_and_point_valid(LLSD())) { return FALSE; } @@ -5892,25 +6297,29 @@ BOOL object_is_wearable() // Also for seeing if object can be attached. See above. class LLObjectEnableWear : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { - bool is_wearable = object_selected_and_point_valid(NULL); - gMenuHolder->findControl(userdata["control"].asString())->setValue(is_wearable); - return TRUE; + return object_selected_and_point_valid(LLSD()); } }; - -BOOL object_attached(void *user_data) +class LLAttachmentPointFilled : public view_listener_t { - LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; - - return attachment->getObject() != NULL; + bool handleEvent(const LLSD& user_data) + { + bool enable = false; + LLVOAvatar::attachment_map_t::iterator found_it = gAgent.getAvatarObject()->mAttachmentPoints.find(user_data.asInteger()); + if (found_it != gAgent.getAvatarObject()->mAttachmentPoints.end()) +{ + enable = found_it->second->getObject() != NULL; + } + return enable; } +}; class LLAvatarSendIM : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar) @@ -5925,7 +6334,6 @@ class LLAvatarSendIM : public view_listener_t name.append( last->getString() ); } - gIMMgr->setFloaterOpen(TRUE); //EInstantMessage type = have_agent_callingcard(gLastHitObjectID) // ? IM_SESSION_ADD : IM_SESSION_CARDLESS_START; gIMMgr->addSession(name, @@ -5936,16 +6344,6 @@ class LLAvatarSendIM : public view_listener_t } }; - -void handle_activate(void*) -{ -} - -BOOL enable_activate(void*) -{ - return FALSE; -} - namespace { struct QueueObjects : public LLSelectedObjectFunctor @@ -5972,7 +6370,7 @@ namespace }; } -void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, const std::string& nomodmsg) +void queue_actions(LLFloaterScriptQueue* q, const std::string& msg) { QueueObjects func(q); LLSelectMgr *mgr = LLSelectMgr::getInstance(); @@ -5982,10 +6380,12 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, cons { if ( !func.scripted ) { + std::string noscriptmsg = std::string("Cannot") + msg + "SelectObjectsNoScripts"; LLNotifications::instance().add(noscriptmsg); } else if ( !func.modifiable ) { + std::string nomodmsg = std::string("Cannot") + msg + "SelectObjectsNoPermission"; LLNotifications::instance().add(nomodmsg); } else @@ -6002,62 +6402,51 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, cons } } -void handle_compile_queue(std::string to_lang) -{ - LLFloaterCompileQueue* queue; - if (to_lang == "mono") - { - queue = LLFloaterCompileQueue::create(TRUE); - } - else - { - queue = LLFloaterCompileQueue::create(FALSE); - } - queue_actions(queue, "CannotRecompileSelectObjectsNoScripts", "CannotRecompileSelectObjectsNoPermission"); -} - -void handle_reset_selection(void) -{ - LLFloaterResetQueue* queue = LLFloaterResetQueue::create(); - queue_actions(queue, "CannotResetSelectObjectsNoScripts", "CannotResetSelectObjectsNoPermission"); -} - -void handle_set_run_selection(void) -{ - LLFloaterRunQueue* queue = LLFloaterRunQueue::create(); - queue_actions(queue, "CannotSetRunningSelectObjectsNoScripts", "CannotSerRunningSelectObjectsNoPermission"); -} - -void handle_set_not_run_selection(void) -{ - LLFloaterNotRunQueue* queue = LLFloaterNotRunQueue::create(); - queue_actions(queue, "CannotSetRunningNotSelectObjectsNoScripts", "CannotSerRunningNotSelectObjectsNoPermission"); -} - class LLToolsSelectedScriptAction : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { std::string action = userdata.asString(); + bool mono = false; + std::string msg, name; if (action == "compile mono") { - handle_compile_queue("mono"); + name = "compile_queue"; + mono = true; + msg = "Recompile"; } if (action == "compile lsl") { - handle_compile_queue("lsl"); + name = "compile_queue"; + msg = "Recompile"; } else if (action == "reset") { - handle_reset_selection(); + name = "reset_queue"; + msg = "Reset"; } else if (action == "start") { - handle_set_run_selection(); + name = "start_queue"; + msg = "Running"; } else if (action == "stop") { - handle_set_not_run_selection(); + name = "stop_queue"; + msg = "RunningNot"; + } + LLUUID id; id.generate(); + LLFloater* floater = LLFloaterReg::getInstance(name, LLSD(id)); + LLFloaterScriptQueue* queue = dynamic_cast<LLFloaterScriptQueue*>(floater); + if (queue) + { + queue->setMono(mono); + queue_actions(queue, msg); + } + else + { + llwarns << "Failed to generate LLFloaterScriptQueue with action: " << action << llendl; + delete floater; } return true; } @@ -6112,11 +6501,6 @@ void handle_selected_texture_info(void*) } } -void handle_dump_image_list(void*) -{ - gImageList.dump(); -} - void handle_test_male(void*) { wear_outfit_by_name("Male Shape & Outfit"); @@ -6167,107 +6551,76 @@ void handle_dump_attachments(void*) } } -//--------------------------------------------------------------------- -// Callbacks for enabling/disabling items -//--------------------------------------------------------------------- - -BOOL menu_ui_enabled(void *user_data) -{ - BOOL high_res = gSavedSettings.getBOOL( "HighResSnapshot" ); - return !high_res; -} - -// TomY TODO DEPRECATE & REMOVE -void menu_toggle_control( void* user_data ) -{ - BOOL checked = gSavedSettings.getBOOL( static_cast<char*>(user_data) ); - if (std::string(static_cast<char*>(user_data)) == "HighResSnapshot" && !checked) - { - // High Res Snapshot active, must uncheck RenderUIInSnapshot - gSavedSettings.setBOOL( "RenderUIInSnapshot", FALSE ); - } - gSavedSettings.setBOOL( static_cast<char*>(user_data), !checked ); -} - // these are used in the gl menus to set control values. class LLToggleControl : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { std::string control_name = userdata.asString(); BOOL checked = gSavedSettings.getBOOL( control_name ); - if (control_name == "HighResSnapshot" && !checked) - { - // High Res Snapshot active, must uncheck RenderUIInSnapshot - gSavedSettings.setBOOL( "RenderUIInSnapshot", FALSE ); - } gSavedSettings.setBOOL( control_name, !checked ); return true; } }; -BOOL menu_check_control( void* user_data) +class LLCheckControl : public view_listener_t { - return gSavedSettings.getBOOL((char*)user_data); + bool handleEvent( const LLSD& userdata) + { + std::string callback_data = userdata.asString(); + bool new_value = gSavedSettings.getBOOL(callback_data); + return new_value; } -// -void menu_toggle_variable( void* user_data ) -{ - BOOL checked = *(BOOL*)user_data; - *(BOOL*)user_data = !checked; -} +}; -BOOL menu_check_variable( void* user_data) +void menu_toggle_attached_lights(void* user_data) { - return *(BOOL*)user_data; + LLPipeline::sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights"); } - -BOOL enable_land_selected( void* ) +void menu_toggle_attached_particles(void* user_data) { - return !(LLViewerParcelMgr::getInstance()->selectionEmpty()); + LLPipeline::sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles"); } -void menu_toggle_attached_lights(void* user_data) +class LLAdvancedHandleAttchedLightParticles: public view_listener_t { - menu_toggle_control(user_data); - LLPipeline::sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights"); + bool handleEvent(const LLSD& userdata) + { + std::string control_name = userdata.asString(); + if (control_name == "RenderAttachedLights") +{ + menu_toggle_attached_lights(NULL); } - -void menu_toggle_attached_particles(void* user_data) + else if (control_name == "RenderAttachedParticles") { - menu_toggle_control(user_data); - LLPipeline::sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles"); + menu_toggle_attached_particles(NULL); } + return true; +} +}; class LLSomethingSelected : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = !(LLSelectMgr::getInstance()->getSelection()->isEmpty()); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLSomethingSelectedNoHUD : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); bool new_value = !(selection->isEmpty()) && !(selection->getSelectType() == SELECT_TYPE_HUD); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; -BOOL enable_more_than_one_selected(void* ) -{ - return (LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1); -} - static bool is_editable_selected() { return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); @@ -6275,106 +6628,62 @@ static bool is_editable_selected() class LLEditableSelected : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { - gMenuHolder->findControl(userdata["control"].asString())->setValue(is_editable_selected()); - return true; + return is_editable_selected(); } }; class LLEditableSelectedMono : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { + bool new_value = false; LLViewerRegion* region = gAgent.getRegion(); - if(region && gMenuHolder && gMenuHolder->findControl(userdata["control"].asString())) + if(region && gMenuHolder) { bool have_cap = (! region->getCapability("UpdateScriptTask").empty()); - bool selected = is_editable_selected() && have_cap; - gMenuHolder->findControl(userdata["control"].asString())->setValue(selected); - return true; + new_value = is_editable_selected() && have_cap; } - return false; + return new_value; } }; class LLToolsEnableTakeCopy : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool all_valid = false; if (LLSelectMgr::getInstance()) { if (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) { - all_valid = true; + all_valid = true; #ifndef HACKED_GODLIKE_VIEWER # ifdef TOGGLE_HACKED_GODLIKE_VIEWER - if (LLViewerLogin::getInstance()->isInProductionGrid() - || !gAgent.isGodlike()) + if (LLViewerLogin::getInstance()->isInProductionGrid() + || !gAgent.isGodlike()) # endif + { + struct f : public LLSelectedObjectFunctor { - struct f : public LLSelectedObjectFunctor + virtual bool apply(LLViewerObject* obj) { - virtual bool apply(LLViewerObject* obj) - { - return (!obj->permCopy() || obj->isAttachment()); - } - } func; - const bool firstonly = true; - bool any_invalid = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); - all_valid = !any_invalid; - } -#endif // HACKED_GODLIKE_VIEWER + return (!obj->permCopy() || obj->isAttachment()); + } + } func; + const bool firstonly = true; + bool any_invalid = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); + all_valid = !any_invalid; } +#endif // HACKED_GODLIKE_VIEWER + } } - gMenuHolder->findControl(userdata["control"].asString())->setValue(all_valid); - return true; + return all_valid; } }; -BOOL enable_selection_you_own_all(void*) -{ - if (LLSelectMgr::getInstance()) - { - struct f : public LLSelectedObjectFunctor - { - virtual bool apply(LLViewerObject* obj) - { - return (!obj->permYouOwner()); - } - } func; - const bool firstonly = true; - bool no_perms = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); - if (no_perms) - { - return FALSE; - } - } - return TRUE; -} - -BOOL enable_selection_you_own_one(void*) -{ - if (LLSelectMgr::getInstance()) - { - struct f : public LLSelectedObjectFunctor - { - virtual bool apply(LLViewerObject* obj) - { - return (obj->permYouOwner()); - } - } func; - const bool firstonly = true; - bool any_perms = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); - if (!any_perms) - { - return FALSE; - } - } - return TRUE; -} class LLHasAsset : public LLInventoryCollectFunctor { @@ -6436,6 +6745,15 @@ BOOL enable_save_into_inventory(void*) return FALSE; } +class LLToolsEnableSaveToInventory : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = enable_save_into_inventory(NULL); + return new_value; + } +}; + BOOL enable_save_into_task_inventory(void*) { LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); @@ -6453,101 +6771,65 @@ BOOL enable_save_into_task_inventory(void*) class LLToolsEnableSaveToObjectInventory : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = enable_save_into_task_inventory(NULL); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; -BOOL enable_not_thirdperson(void*) -{ - return !gAgent.cameraThirdPerson(); -} - - -// BOOL enable_export_selected(void *) -// { -// if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) -// { -// return FALSE; -// } -// if (!gExporterRequestID.isNull()) -// { -// return FALSE; -// } -// if (!LLUploadDialog::modalUploadIsFinished()) -// { -// return FALSE; -// } -// return TRUE; -// } class LLViewEnableMouselook : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { // You can't go directly from customize avatar to mouselook. // TODO: write code with appropriate dialogs to handle this transition. bool new_value = (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() && !gSavedSettings.getBOOL("FreezeTime")); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLToolsEnableToolNotPie : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = ( LLToolMgr::getInstance()->getBaseTool() != LLToolPie::getInstance() ); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLWorldEnableCreateLandmark : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = can_create_landmark(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - - return true; + return new_value; } }; class LLWorldEnableSetHomeLocation : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = gAgent.isGodlike() || (gAgent.getRegion() && gAgent.getRegion()->getAllowSetHome()); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLWorldEnableTeleportHome : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLViewerRegion* regionp = gAgent.getRegion(); bool agent_on_prelude = (regionp && regionp->isPrelude()); bool enable_teleport_home = gAgent.isGodlike() || !agent_on_prelude; - gMenuHolder->findControl(userdata["control"].asString())->setValue(enable_teleport_home); - return true; + return enable_teleport_home; } }; -BOOL enable_region_owner(void*) -{ - if(gAgent.getRegion() && gAgent.getRegion()->getOwner() == gAgent.getID()) - return TRUE; - return enable_god_customer_service(NULL); -} - BOOL enable_god_full(void*) { return gAgent.getGodLevel() >= GOD_FULL; @@ -6568,18 +6850,6 @@ BOOL enable_god_basic(void*) return gAgent.getGodLevel() > GOD_NOT; } -#if 0 // 1.9.2 -void toggle_vertex_shaders(void *) -{ - BOOL use_shaders = gPipeline.getUseVertexShaders(); - gPipeline.setUseVertexShaders(use_shaders); -} - -BOOL check_vertex_shaders(void *) -{ - return gPipeline.getUseVertexShaders(); -} -#endif void toggle_show_xui_names(void *) { @@ -6594,18 +6864,9 @@ BOOL check_show_xui_names(void *) return gSavedSettings.getBOOL("ShowXUINames"); } - - -void toggle_cull_small(void *) -{ -// gPipeline.mCullBySize = !gPipeline.mCullBySize; -// -// gSavedSettings.setBOOL("RenderCullBySize", gPipeline.mCullBySize); -} - class LLToolsSelectOnlyMyObjects : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { BOOL cur_val = gSavedSettings.getBOOL("SelectOwnedOnly"); @@ -6617,7 +6878,7 @@ class LLToolsSelectOnlyMyObjects : public view_listener_t class LLToolsSelectOnlyMovableObjects : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { BOOL cur_val = gSavedSettings.getBOOL("SelectMovableOnly"); @@ -6629,7 +6890,7 @@ class LLToolsSelectOnlyMovableObjects : public view_listener_t class LLToolsSelectBySurrounding : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLSelectMgr::sRectSelectInclusive = !LLSelectMgr::sRectSelectInclusive; @@ -6640,7 +6901,7 @@ class LLToolsSelectBySurrounding : public view_listener_t class LLToolsShowHiddenSelection : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { // TomY TODO Merge these LLSelectMgr::sRenderHiddenSelections = !LLSelectMgr::sRenderHiddenSelections; @@ -6652,7 +6913,7 @@ class LLToolsShowHiddenSelection : public view_listener_t class LLToolsShowSelectionLightRadius : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { // TomY TODO merge these LLSelectMgr::sRenderLightRadius = !LLSelectMgr::sRenderLightRadius; @@ -6664,7 +6925,7 @@ class LLToolsShowSelectionLightRadius : public view_listener_t class LLToolsEditLinkedParts : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { BOOL select_individuals = gSavedSettings.getBOOL("EditLinkedParts"); if (select_individuals) @@ -6679,40 +6940,14 @@ class LLToolsEditLinkedParts : public view_listener_t } }; -void reload_personal_settings_overrides(void *) -{ - llinfos << "Loading overrides from " << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT,"overrides.xml") << llendl; - - gSavedSettings.loadFromFile(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT,"overrides.xml")); -} - void reload_vertex_shader(void *) { //THIS WOULD BE AN AWESOME PLACE TO RELOAD SHADERS... just a thought - DaveP } -void slow_mo_animations(void*) -{ - static BOOL slow_mo = FALSE; - if (slow_mo) - { - gAgent.getAvatarObject()->setAnimTimeFactor(1.f); - slow_mo = FALSE; - } - else - { - gAgent.getAvatarObject()->setAnimTimeFactor(0.2f); - slow_mo = TRUE; - } -} - void handle_dump_avatar_local_textures(void*) { - LLVOAvatar* avatar = gAgent.getAvatarObject(); - if( avatar ) - { - avatar->dumpLocalTextures(); - } + gAgent.getAvatarObject()->dumpLocalTextures(); } void handle_debug_avatar_textures(void*) @@ -6727,7 +6962,7 @@ void handle_debug_avatar_textures(void*) void handle_grab_texture(void* data) { ETextureIndex index = (ETextureIndex)((intptr_t)data); - LLVOAvatar* avatar = gAgent.getAvatarObject(); + const LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if ( avatar ) { const LLUUID& asset_id = avatar->grabLocalTexture(index); @@ -6737,32 +6972,14 @@ void handle_grab_texture(void* data) LLUUID folder_id(gInventory.findCategoryUUIDForType(asset_type)); if(folder_id.notNull()) { - std::string name = "Baked "; - switch (index) + std::string name = "Unknown"; + const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(index); + if (texture_dict->mIsBakedTexture) { - case TEX_EYES_BAKED: - name.append("Iris"); - break; - case TEX_HEAD_BAKED: - name.append("Head"); - break; - case TEX_UPPER_BAKED: - name.append("Upper Body"); - break; - case TEX_LOWER_BAKED: - name.append("Lower Body"); - break; - case TEX_SKIRT_BAKED: - name.append("Skirt"); - break; - case TEX_HAIR_BAKED: - name.append("Hair"); - break; - default: - name.append("Unknown"); - break; + EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; + name = "Baked " + LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index)->mNameCapitalized; } - name.append(" Texture"); + name += " Texture"; LLUUID item_id; item_id.generate(); @@ -6820,7 +7037,7 @@ void handle_grab_texture(void* data) BOOL enable_grab_texture(void* data) { ETextureIndex index = (ETextureIndex)((intptr_t)data); - LLVOAvatar* avatar = gAgent.getAvatarObject(); + const LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if ( avatar ) { return avatar->canGrabLocalTexture(index); @@ -6842,8 +7059,7 @@ LLVOAvatar* find_avatar_from_object( LLViewerObject* object ) } while( object && !object->isAvatar() ); } - else - if( !object->isAvatar() ) + else if( !object->isAvatar() ) { object = NULL; } @@ -6898,7 +7114,7 @@ void force_error_driver_crash(void *) class LLToolsUseSelectionForGrid : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLSelectMgr::getInstance()->clearGridObjects(); struct f : public LLSelectedObjectFunctor @@ -6931,10 +7147,6 @@ void handle_test_load_url(void*) // LLViewerMenuHolderGL // -LLViewerMenuHolderGL::LLViewerMenuHolderGL() : LLMenuHolderGL() -{ -} - BOOL LLViewerMenuHolderGL::hideMenus() { BOOL handled = LLMenuHolderGL::hideMenus(); @@ -6998,7 +7210,7 @@ void handle_load_from_xml(void*) if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) { std::string filename = picker.getFirstFile(); - LLFloater* floater = new LLFloater("sample_floater"); + LLFloater* floater = new LLFloater(); LLUICtrlFactory::getInstance()->buildFloater(floater, filename); } } @@ -7025,7 +7237,7 @@ void handle_buy_currency_test(void*) // *TODO: Replace with call to LLUI::getLanguage() after windows-setup // branch merges in. JC - std::string language = "en-us"; + std::string language = "en"; language = gSavedSettings.getString("Language"); if (language.empty() || language == "default") { @@ -7037,7 +7249,7 @@ void handle_buy_currency_test(void*) } if (language.empty() || language == "default") { - language = "en-us"; + language = "en"; } replace["[LANGUAGE]"] = language; @@ -7053,7 +7265,7 @@ void handle_buy_currency_test(void*) void handle_rebake_textures(void*) { - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if (!avatar) return; // Slam pending upload count to "unstick" things @@ -7076,7 +7288,7 @@ BOOL get_visibility(void* user_data) // TomY TODO: Get rid of these? class LLViewShowHoverTips : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLHoverView::sShowHoverTips = !LLHoverView::sShowHoverTips; return true; @@ -7085,18 +7297,17 @@ class LLViewShowHoverTips : public view_listener_t class LLViewCheckShowHoverTips : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLHoverView::sShowHoverTips; - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; // TomY TODO: Get rid of these? class LLViewHighlightTransparent : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; return true; @@ -7105,17 +7316,157 @@ class LLViewHighlightTransparent : public view_listener_t class LLViewCheckHighlightTransparent : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLDrawPoolAlpha::sShowDebugAlpha; - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); + return new_value; + } +}; + +class LLViewBeaconWidth : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string width = userdata.asString(); + if(width == "1") + { + gSavedSettings.setS32("DebugBeaconLineWidth", 1); + } + else if(width == "4") + { + gSavedSettings.setS32("DebugBeaconLineWidth", 4); + } + else if(width == "16") + { + gSavedSettings.setS32("DebugBeaconLineWidth", 16); + } + else if(width == "32") + { + gSavedSettings.setS32("DebugBeaconLineWidth", 32); + } + + return true; + } +}; + + +class LLViewToggleBeacon : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string beacon = userdata.asString(); + if (beacon == "scriptsbeacon") + { + LLPipeline::toggleRenderScriptedBeacons(NULL); + gSavedSettings.setBOOL( "scriptsbeacon", LLPipeline::getRenderScriptedBeacons(NULL) ); + // toggle the other one off if it's on + if (LLPipeline::getRenderScriptedBeacons(NULL) && LLPipeline::getRenderScriptedTouchBeacons(NULL)) + { + LLPipeline::toggleRenderScriptedTouchBeacons(NULL); + gSavedSettings.setBOOL( "scripttouchbeacon", LLPipeline::getRenderScriptedTouchBeacons(NULL) ); + } + } + else if (beacon == "physicalbeacon") + { + LLPipeline::toggleRenderPhysicalBeacons(NULL); + gSavedSettings.setBOOL( "physicalbeacon", LLPipeline::getRenderPhysicalBeacons(NULL) ); + } + else if (beacon == "soundsbeacon") + { + LLPipeline::toggleRenderSoundBeacons(NULL); + gSavedSettings.setBOOL( "soundsbeacon", LLPipeline::getRenderSoundBeacons(NULL) ); + } + else if (beacon == "particlesbeacon") + { + LLPipeline::toggleRenderParticleBeacons(NULL); + gSavedSettings.setBOOL( "particlesbeacon", LLPipeline::getRenderParticleBeacons(NULL) ); + } + else if (beacon == "scripttouchbeacon") + { + LLPipeline::toggleRenderScriptedTouchBeacons(NULL); + gSavedSettings.setBOOL( "scripttouchbeacon", LLPipeline::getRenderScriptedTouchBeacons(NULL) ); + // toggle the other one off if it's on + if (LLPipeline::getRenderScriptedBeacons(NULL) && LLPipeline::getRenderScriptedTouchBeacons(NULL)) + { + LLPipeline::toggleRenderScriptedBeacons(NULL); + gSavedSettings.setBOOL( "scriptsbeacon", LLPipeline::getRenderScriptedBeacons(NULL) ); + } + } + else if (beacon == "renderbeacons") + { + LLPipeline::toggleRenderBeacons(NULL); + gSavedSettings.setBOOL( "renderbeacons", LLPipeline::getRenderBeacons(NULL) ); + // toggle the other one on if it's not + if (!LLPipeline::getRenderBeacons(NULL) && !LLPipeline::getRenderHighlights(NULL)) + { + LLPipeline::toggleRenderHighlights(NULL); + gSavedSettings.setBOOL( "renderhighlights", LLPipeline::getRenderHighlights(NULL) ); + } + } + else if (beacon == "renderhighlights") + { + LLPipeline::toggleRenderHighlights(NULL); + gSavedSettings.setBOOL( "renderhighlights", LLPipeline::getRenderHighlights(NULL) ); + // toggle the other one on if it's not + if (!LLPipeline::getRenderBeacons(NULL) && !LLPipeline::getRenderHighlights(NULL)) + { + LLPipeline::toggleRenderBeacons(NULL); + gSavedSettings.setBOOL( "renderbeacons", LLPipeline::getRenderBeacons(NULL) ); + } + } + return true; } }; +class LLViewCheckBeaconEnabled : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string beacon = userdata.asString(); + bool new_value = false; + if (beacon == "scriptsbeacon") + { + new_value = gSavedSettings.getBOOL( "scriptsbeacon"); + LLPipeline::setRenderScriptedBeacons(new_value); + } + else if (beacon == "physicalbeacon") + { + new_value = gSavedSettings.getBOOL( "physicalbeacon"); + LLPipeline::setRenderPhysicalBeacons(new_value); + } + else if (beacon == "soundsbeacon") + { + new_value = gSavedSettings.getBOOL( "soundsbeacon"); + LLPipeline::setRenderSoundBeacons(new_value); + } + else if (beacon == "particlesbeacon") + { + new_value = gSavedSettings.getBOOL( "particlesbeacon"); + LLPipeline::setRenderParticleBeacons(new_value); + } + else if (beacon == "scripttouchbeacon") + { + new_value = gSavedSettings.getBOOL( "scripttouchbeacon"); + LLPipeline::setRenderScriptedTouchBeacons(new_value); + } + else if (beacon == "renderbeacons") + { + new_value = gSavedSettings.getBOOL( "renderbeacons"); + LLPipeline::setRenderBeacons(new_value); + } + else if (beacon == "renderhighlights") + { + new_value = gSavedSettings.getBOOL( "renderhighlights"); + LLPipeline::setRenderHighlights(new_value); + } + return new_value; + } +}; + class LLViewToggleRenderType : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { std::string type = userdata.asString(); if (type == "hideparticles") @@ -7128,22 +7479,21 @@ class LLViewToggleRenderType : public view_listener_t class LLViewCheckRenderType : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { - std::string type = userdata["data"].asString(); + std::string type = userdata.asString(); bool new_value = false; if (type == "hideparticles") { new_value = LLPipeline::toggleRenderTypeControlNegated((void *)LLPipeline::RENDER_TYPE_PARTICLES); } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLViewShowHUDAttachments : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments; return true; @@ -7152,123 +7502,127 @@ class LLViewShowHUDAttachments : public view_listener_t class LLViewCheckHUDAttachments : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = LLPipeline::sShowHUDAttachments; - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLEditEnableTakeOff : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { - std::string control_name = userdata["control"].asString(); - std::string clothing = userdata["data"].asString(); + std::string clothing = userdata.asString(); bool new_value = false; if (clothing == "shirt") { - new_value = LLAgent::selfHasWearable((void *)WT_SHIRT); + new_value = LLAgentWearables::selfHasWearable((void *)WT_SHIRT); } if (clothing == "pants") { - new_value = LLAgent::selfHasWearable((void *)WT_PANTS); + new_value = LLAgentWearables::selfHasWearable((void *)WT_PANTS); } if (clothing == "shoes") { - new_value = LLAgent::selfHasWearable((void *)WT_SHOES); + new_value = LLAgentWearables::selfHasWearable((void *)WT_SHOES); } if (clothing == "socks") { - new_value = LLAgent::selfHasWearable((void *)WT_SOCKS); + new_value = LLAgentWearables::selfHasWearable((void *)WT_SOCKS); } if (clothing == "jacket") { - new_value = LLAgent::selfHasWearable((void *)WT_JACKET); + new_value = LLAgentWearables::selfHasWearable((void *)WT_JACKET); } if (clothing == "gloves") { - new_value = LLAgent::selfHasWearable((void *)WT_GLOVES); + new_value = LLAgentWearables::selfHasWearable((void *)WT_GLOVES); } if (clothing == "undershirt") { - new_value = LLAgent::selfHasWearable((void *)WT_UNDERSHIRT); + new_value = LLAgentWearables::selfHasWearable((void *)WT_UNDERSHIRT); } if (clothing == "underpants") { - new_value = LLAgent::selfHasWearable((void *)WT_UNDERPANTS); + new_value = LLAgentWearables::selfHasWearable((void *)WT_UNDERPANTS); } if (clothing == "skirt") { - new_value = LLAgent::selfHasWearable((void *)WT_SKIRT); + new_value = LLAgentWearables::selfHasWearable((void *)WT_SKIRT); } - gMenuHolder->findControl(control_name)->setValue(new_value); - return true; + if (clothing == "alpha") + { + new_value = LLAgentWearables::selfHasWearable((void *)WT_ALPHA); + } + if (clothing == "tattoo") + { + new_value = LLAgentWearables::selfHasWearable((void *)WT_TATTOO); + } + return new_value; } }; class LLEditTakeOff : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { std::string clothing = userdata.asString(); if (clothing == "shirt") { - LLAgent::userRemoveWearable((void*)WT_SHIRT); + LLAgentWearables::userRemoveWearable((void*)WT_SHIRT); } else if (clothing == "pants") { - LLAgent::userRemoveWearable((void*)WT_PANTS); + LLAgentWearables::userRemoveWearable((void*)WT_PANTS); } else if (clothing == "shoes") { - LLAgent::userRemoveWearable((void*)WT_SHOES); + LLAgentWearables::userRemoveWearable((void*)WT_SHOES); } else if (clothing == "socks") { - LLAgent::userRemoveWearable((void*)WT_SOCKS); + LLAgentWearables::userRemoveWearable((void*)WT_SOCKS); } else if (clothing == "jacket") { - LLAgent::userRemoveWearable((void*)WT_JACKET); + LLAgentWearables::userRemoveWearable((void*)WT_JACKET); } else if (clothing == "gloves") { - LLAgent::userRemoveWearable((void*)WT_GLOVES); + LLAgentWearables::userRemoveWearable((void*)WT_GLOVES); } else if (clothing == "undershirt") { - LLAgent::userRemoveWearable((void*)WT_UNDERSHIRT); + LLAgentWearables::userRemoveWearable((void*)WT_UNDERSHIRT); } else if (clothing == "underpants") { - LLAgent::userRemoveWearable((void*)WT_UNDERPANTS); + LLAgentWearables::userRemoveWearable((void*)WT_UNDERPANTS); } else if (clothing == "skirt") { - LLAgent::userRemoveWearable((void*)WT_SKIRT); + LLAgentWearables::userRemoveWearable((void*)WT_SKIRT); + } + else if (clothing == "alpha") + { + LLAgentWearables::userRemoveWearable((void*)WT_ALPHA); + } + else if (clothing == "tattoo") + { + LLAgentWearables::userRemoveWearable((void*)WT_TATTOO); } else if (clothing == "all") { - LLAgent::userRemoveAllClothes(NULL); + LLAgentWearables::userRemoveAllClothes(NULL); } return true; } }; -class LLWorldChat : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - handle_chat(NULL); - return true; - } -}; - class LLToolsSelectTool : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { std::string tool_name = userdata.asString(); if (tool_name == "focus") @@ -7298,7 +7652,7 @@ class LLToolsSelectTool : public view_listener_t /// WINDLIGHT callbacks class LLWorldEnvSettings : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { std::string tod = userdata.asString(); LLVector3 sun_direction; @@ -7314,7 +7668,7 @@ class LLWorldEnvSettings : public view_listener_t } else { - LLFloaterEnvSettings::instance()->close(); + LLFloaterEnvSettings::instance()->closeFloater(); } return true; } @@ -7375,7 +7729,7 @@ class LLWorldEnvSettings : public view_listener_t /// Water Menu callbacks class LLWorldWaterSettings : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { // if not there or is hidden, show it if( !LLFloaterWater::isOpen() || @@ -7386,7 +7740,7 @@ class LLWorldWaterSettings : public view_listener_t } else { - LLFloaterWater::instance()->close(); + LLFloaterWater::instance()->closeFloater(); } return true; } @@ -7395,7 +7749,7 @@ class LLWorldWaterSettings : public view_listener_t /// Post-Process callbacks class LLWorldPostProcess : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLFloaterPostProcess::show(); return true; @@ -7405,7 +7759,7 @@ class LLWorldPostProcess : public view_listener_t /// Day Cycle callbacks class LLWorldDayCycle : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLFloaterDayCycle::show(); return true; @@ -7414,12 +7768,6 @@ class LLWorldDayCycle : public view_listener_t -static void addMenu(view_listener_t *menu, const std::string& name) -{ - sMenus.push_back(menu); - menu->registerListener(gMenuHolder, name); -} - void initialize_menus() { // A parameterized event handler used as ctrl-8/9/0 zoom controls below. @@ -7428,7 +7776,7 @@ void initialize_menus() public: // The "mult" parameter says whether "val" is a multiplier or used to set the value. LLZoomer(F32 val, bool mult=true) : mVal(val), mMult(mult) {} - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { F32 new_fov_rad = mMult ? LLViewerCamera::getInstance()->getDefaultFOV() * mVal : mVal; LLViewerCamera::getInstance()->setDefaultFOV(new_fov_rad); @@ -7440,217 +7788,375 @@ void initialize_menus() bool mMult; }; - class LLAvatarReportAbuse : public view_listener_t - { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); - if(avatar) - { - LLFloaterReporter::showFromObject(avatar->getID()); - } - return true; - } - }; + LLUICtrl::EnableCallbackRegistry::Registrar& enable = LLUICtrl::EnableCallbackRegistry::currentRegistrar(); + LLUICtrl::CommitCallbackRegistry::Registrar& commit = LLUICtrl::CommitCallbackRegistry::currentRegistrar(); + + // Enable God Mode + view_listener_t::addMenu(new LLEnableGodCustomerService(), "EnableGodCustomerService"); + + // Agent + commit.add("Agent.toggleFlying", boost::bind(&LLAgent::toggleFlying)); + enable.add("Agent.emableFlying", boost::bind(&LLAgent::enableFlying)); // File menu init_menu_file(); // Edit menu - addMenu(new LLEditUndo(), "Edit.Undo"); - addMenu(new LLEditRedo(), "Edit.Redo"); - addMenu(new LLEditCut(), "Edit.Cut"); - addMenu(new LLEditCopy(), "Edit.Copy"); - addMenu(new LLEditPaste(), "Edit.Paste"); - addMenu(new LLEditDelete(), "Edit.Delete"); - addMenu(new LLEditSearch(), "Edit.Search"); - addMenu(new LLEditSelectAll(), "Edit.SelectAll"); - addMenu(new LLEditDeselect(), "Edit.Deselect"); - addMenu(new LLEditDuplicate(), "Edit.Duplicate"); - addMenu(new LLEditTakeOff(), "Edit.TakeOff"); - - addMenu(new LLEditEnableUndo(), "Edit.EnableUndo"); - addMenu(new LLEditEnableRedo(), "Edit.EnableRedo"); - addMenu(new LLEditEnableCut(), "Edit.EnableCut"); - addMenu(new LLEditEnableCopy(), "Edit.EnableCopy"); - addMenu(new LLEditEnablePaste(), "Edit.EnablePaste"); - addMenu(new LLEditEnableDelete(), "Edit.EnableDelete"); - addMenu(new LLEditEnableSelectAll(), "Edit.EnableSelectAll"); - addMenu(new LLEditEnableDeselect(), "Edit.EnableDeselect"); - addMenu(new LLEditEnableDuplicate(), "Edit.EnableDuplicate"); - addMenu(new LLEditEnableTakeOff(), "Edit.EnableTakeOff"); - addMenu(new LLEditEnableCustomizeAvatar(), "Edit.EnableCustomizeAvatar"); + view_listener_t::addMenu(new LLEditUndo(), "Edit.Undo"); + view_listener_t::addMenu(new LLEditRedo(), "Edit.Redo"); + view_listener_t::addMenu(new LLEditCut(), "Edit.Cut"); + view_listener_t::addMenu(new LLEditCopy(), "Edit.Copy"); + view_listener_t::addMenu(new LLEditPaste(), "Edit.Paste"); + view_listener_t::addMenu(new LLEditDelete(), "Edit.Delete"); + view_listener_t::addMenu(new LLEditSelectAll(), "Edit.SelectAll"); + view_listener_t::addMenu(new LLEditDeselect(), "Edit.Deselect"); + view_listener_t::addMenu(new LLEditDuplicate(), "Edit.Duplicate"); + view_listener_t::addMenu(new LLEditTakeOff(), "Edit.TakeOff"); + + view_listener_t::addMenu(new LLEditEnableUndo(), "Edit.EnableUndo"); + view_listener_t::addMenu(new LLEditEnableRedo(), "Edit.EnableRedo"); + view_listener_t::addMenu(new LLEditEnableCut(), "Edit.EnableCut"); + view_listener_t::addMenu(new LLEditEnableCopy(), "Edit.EnableCopy"); + view_listener_t::addMenu(new LLEditEnablePaste(), "Edit.EnablePaste"); + view_listener_t::addMenu(new LLEditEnableDelete(), "Edit.EnableDelete"); + view_listener_t::addMenu(new LLEditEnableSelectAll(), "Edit.EnableSelectAll"); + view_listener_t::addMenu(new LLEditEnableDeselect(), "Edit.EnableDeselect"); + view_listener_t::addMenu(new LLEditEnableDuplicate(), "Edit.EnableDuplicate"); + view_listener_t::addMenu(new LLEditEnableTakeOff(), "Edit.EnableTakeOff"); + view_listener_t::addMenu(new LLEditEnableCustomizeAvatar(), "Edit.EnableCustomizeAvatar"); // View menu - addMenu(new LLViewMouselook(), "View.Mouselook"); - addMenu(new LLViewBuildMode(), "View.BuildMode"); - addMenu(new LLViewJoystickFlycam(), "View.JoystickFlycam"); - addMenu(new LLViewCommunicate(), "View.Communicate"); - addMenu(new LLViewResetView(), "View.ResetView"); - addMenu(new LLViewLookAtLastChatter(), "View.LookAtLastChatter"); - addMenu(new LLViewShowHoverTips(), "View.ShowHoverTips"); - addMenu(new LLViewHighlightTransparent(), "View.HighlightTransparent"); - addMenu(new LLViewToggleRenderType(), "View.ToggleRenderType"); - addMenu(new LLViewShowHUDAttachments(), "View.ShowHUDAttachments"); - addMenu(new LLZoomer(1.2f), "View.ZoomOut"); - addMenu(new LLZoomer(1/1.2f), "View.ZoomIn"); - addMenu(new LLZoomer(DEFAULT_FIELD_OF_VIEW, false), "View.ZoomDefault"); - addMenu(new LLViewFullscreen(), "View.Fullscreen"); - addMenu(new LLViewDefaultUISize(), "View.DefaultUISize"); - - addMenu(new LLViewEnableMouselook(), "View.EnableMouselook"); - addMenu(new LLViewEnableJoystickFlycam(), "View.EnableJoystickFlycam"); - addMenu(new LLViewEnableLastChatter(), "View.EnableLastChatter"); - - addMenu(new LLViewCheckBuildMode(), "View.CheckBuildMode"); - addMenu(new LLViewCheckJoystickFlycam(), "View.CheckJoystickFlycam"); - addMenu(new LLViewCheckShowHoverTips(), "View.CheckShowHoverTips"); - addMenu(new LLViewCheckHighlightTransparent(), "View.CheckHighlightTransparent"); - addMenu(new LLViewCheckRenderType(), "View.CheckRenderType"); - addMenu(new LLViewCheckHUDAttachments(), "View.CheckHUDAttachments"); + view_listener_t::addMenu(new LLViewMouselook(), "View.Mouselook"); + view_listener_t::addMenu(new LLViewJoystickFlycam(), "View.JoystickFlycam"); + view_listener_t::addMenu(new LLViewResetView(), "View.ResetView"); + view_listener_t::addMenu(new LLViewLookAtLastChatter(), "View.LookAtLastChatter"); + view_listener_t::addMenu(new LLViewShowHoverTips(), "View.ShowHoverTips"); + view_listener_t::addMenu(new LLViewHighlightTransparent(), "View.HighlightTransparent"); + view_listener_t::addMenu(new LLViewToggleRenderType(), "View.ToggleRenderType"); + view_listener_t::addMenu(new LLViewShowHUDAttachments(), "View.ShowHUDAttachments"); + view_listener_t::addMenu(new LLZoomer(1.2f), "View.ZoomOut"); + view_listener_t::addMenu(new LLZoomer(1/1.2f), "View.ZoomIn"); + view_listener_t::addMenu(new LLZoomer(DEFAULT_FIELD_OF_VIEW, false), "View.ZoomDefault"); + view_listener_t::addMenu(new LLViewFullscreen(), "View.Fullscreen"); + view_listener_t::addMenu(new LLViewDefaultUISize(), "View.DefaultUISize"); + + view_listener_t::addMenu(new LLViewEnableMouselook(), "View.EnableMouselook"); + view_listener_t::addMenu(new LLViewEnableJoystickFlycam(), "View.EnableJoystickFlycam"); + view_listener_t::addMenu(new LLViewEnableLastChatter(), "View.EnableLastChatter"); + + view_listener_t::addMenu(new LLViewCheckJoystickFlycam(), "View.CheckJoystickFlycam"); + view_listener_t::addMenu(new LLViewCheckShowHoverTips(), "View.CheckShowHoverTips"); + view_listener_t::addMenu(new LLViewCheckHighlightTransparent(), "View.CheckHighlightTransparent"); + view_listener_t::addMenu(new LLViewCheckRenderType(), "View.CheckRenderType"); + view_listener_t::addMenu(new LLViewCheckHUDAttachments(), "View.CheckHUDAttachments"); // World menu - addMenu(new LLWorldChat(), "World.Chat"); - addMenu(new LLWorldAlwaysRun(), "World.AlwaysRun"); - addMenu(new LLWorldFly(), "World.Fly"); - addMenu(new LLWorldEnableFly(), "World.EnableFly"); - addMenu(new LLWorldCreateLandmark(), "World.CreateLandmark"); - addMenu(new LLWorldSetHomeLocation(), "World.SetHomeLocation"); - addMenu(new LLWorldTeleportHome(), "World.TeleportHome"); - addMenu(new LLWorldSetAway(), "World.SetAway"); - addMenu(new LLWorldSetBusy(), "World.SetBusy"); - - addMenu(new LLWorldEnableCreateLandmark(), "World.EnableCreateLandmark"); - addMenu(new LLWorldEnableSetHomeLocation(), "World.EnableSetHomeLocation"); - addMenu(new LLWorldEnableTeleportHome(), "World.EnableTeleportHome"); - addMenu(new LLWorldEnableBuyLand(), "World.EnableBuyLand"); - - addMenu(new LLWorldCheckAlwaysRun(), "World.CheckAlwaysRun"); + commit.add("World.Chat", boost::bind(&handle_chat, (void*)NULL)); + view_listener_t::addMenu(new LLWorldAlwaysRun(), "World.AlwaysRun"); + view_listener_t::addMenu(new LLWorldCreateLandmark(), "World.CreateLandmark"); + view_listener_t::addMenu(new LLWorldSetHomeLocation(), "World.SetHomeLocation"); + view_listener_t::addMenu(new LLWorldTeleportHome(), "World.TeleportHome"); + view_listener_t::addMenu(new LLWorldSetAway(), "World.SetAway"); + view_listener_t::addMenu(new LLWorldSetBusy(), "World.SetBusy"); + + view_listener_t::addMenu(new LLWorldEnableCreateLandmark(), "World.EnableCreateLandmark"); + view_listener_t::addMenu(new LLWorldEnableSetHomeLocation(), "World.EnableSetHomeLocation"); + view_listener_t::addMenu(new LLWorldEnableTeleportHome(), "World.EnableTeleportHome"); + view_listener_t::addMenu(new LLWorldEnableBuyLand(), "World.EnableBuyLand"); + + view_listener_t::addMenu(new LLWorldCheckAlwaysRun(), "World.CheckAlwaysRun"); - (new LLWorldEnvSettings())->registerListener(gMenuHolder, "World.EnvSettings"); - (new LLWorldWaterSettings())->registerListener(gMenuHolder, "World.WaterSettings"); - (new LLWorldPostProcess())->registerListener(gMenuHolder, "World.PostProcess"); - (new LLWorldDayCycle())->registerListener(gMenuHolder, "World.DayCycle"); + view_listener_t::addMenu(new LLWorldEnvSettings(), "World.EnvSettings"); + view_listener_t::addMenu(new LLWorldWaterSettings(), "World.WaterSettings"); + view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); + view_listener_t::addMenu(new LLWorldDayCycle(), "World.DayCycle"); // Tools menu - addMenu(new LLToolsSelectTool(), "Tools.SelectTool"); - addMenu(new LLToolsSelectOnlyMyObjects(), "Tools.SelectOnlyMyObjects"); - addMenu(new LLToolsSelectOnlyMovableObjects(), "Tools.SelectOnlyMovableObjects"); - addMenu(new LLToolsSelectBySurrounding(), "Tools.SelectBySurrounding"); - addMenu(new LLToolsShowHiddenSelection(), "Tools.ShowHiddenSelection"); - addMenu(new LLToolsShowSelectionLightRadius(), "Tools.ShowSelectionLightRadius"); - addMenu(new LLToolsEditLinkedParts(), "Tools.EditLinkedParts"); - addMenu(new LLToolsSnapObjectXY(), "Tools.SnapObjectXY"); - addMenu(new LLToolsUseSelectionForGrid(), "Tools.UseSelectionForGrid"); - addMenu(new LLToolsLink(), "Tools.Link"); - addMenu(new LLToolsUnlink(), "Tools.Unlink"); - addMenu(new LLToolsStopAllAnimations(), "Tools.StopAllAnimations"); - addMenu(new LLToolsReleaseKeys(), "Tools.ReleaseKeys"); - addMenu(new LLToolsEnableReleaseKeys(), "Tools.EnableReleaseKeys"); - addMenu(new LLToolsLookAtSelection(), "Tools.LookAtSelection"); - addMenu(new LLToolsBuyOrTake(), "Tools.BuyOrTake"); - addMenu(new LLToolsTakeCopy(), "Tools.TakeCopy"); - addMenu(new LLToolsSaveToObjectInventory(), "Tools.SaveToObjectInventory"); - addMenu(new LLToolsSelectedScriptAction(), "Tools.SelectedScriptAction"); - - addMenu(new LLToolsEnableToolNotPie(), "Tools.EnableToolNotPie"); - addMenu(new LLToolsEnableLink(), "Tools.EnableLink"); - addMenu(new LLToolsEnableUnlink(), "Tools.EnableUnlink"); - addMenu(new LLToolsEnableBuyOrTake(), "Tools.EnableBuyOrTake"); - addMenu(new LLToolsEnableTakeCopy(), "Tools.EnableTakeCopy"); - addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory"); - - /*addMenu(new LLToolsVisibleBuyObject(), "Tools.VisibleBuyObject"); - addMenu(new LLToolsVisibleTakeObject(), "Tools.VisibleTakeObject");*/ + view_listener_t::addMenu(new LLToolsSelectTool(), "Tools.SelectTool"); + view_listener_t::addMenu(new LLToolsSelectOnlyMyObjects(), "Tools.SelectOnlyMyObjects"); + view_listener_t::addMenu(new LLToolsSelectOnlyMovableObjects(), "Tools.SelectOnlyMovableObjects"); + view_listener_t::addMenu(new LLToolsSelectBySurrounding(), "Tools.SelectBySurrounding"); + view_listener_t::addMenu(new LLToolsShowHiddenSelection(), "Tools.ShowHiddenSelection"); + view_listener_t::addMenu(new LLToolsShowSelectionLightRadius(), "Tools.ShowSelectionLightRadius"); + view_listener_t::addMenu(new LLToolsEditLinkedParts(), "Tools.EditLinkedParts"); + view_listener_t::addMenu(new LLToolsSnapObjectXY(), "Tools.SnapObjectXY"); + view_listener_t::addMenu(new LLToolsUseSelectionForGrid(), "Tools.UseSelectionForGrid"); + view_listener_t::addMenu(new LLToolsLink(), "Tools.Link"); + view_listener_t::addMenu(new LLToolsUnlink(), "Tools.Unlink"); + view_listener_t::addMenu(new LLToolsStopAllAnimations(), "Tools.StopAllAnimations"); + view_listener_t::addMenu(new LLToolsReleaseKeys(), "Tools.ReleaseKeys"); + view_listener_t::addMenu(new LLToolsEnableReleaseKeys(), "Tools.EnableReleaseKeys"); + view_listener_t::addMenu(new LLToolsLookAtSelection(), "Tools.LookAtSelection"); + view_listener_t::addMenu(new LLToolsBuyOrTake(), "Tools.BuyOrTake"); + view_listener_t::addMenu(new LLToolsTakeCopy(), "Tools.TakeCopy"); + view_listener_t::addMenu(new LLToolsSaveToInventory(), "Tools.SaveToInventory"); + view_listener_t::addMenu(new LLToolsSaveToObjectInventory(), "Tools.SaveToObjectInventory"); + view_listener_t::addMenu(new LLToolsSelectedScriptAction(), "Tools.SelectedScriptAction"); + + view_listener_t::addMenu(new LLToolsEnableToolNotPie(), "Tools.EnableToolNotPie"); + view_listener_t::addMenu(new LLToolsEnableLink(), "Tools.EnableLink"); + view_listener_t::addMenu(new LLToolsEnableUnlink(), "Tools.EnableUnlink"); + view_listener_t::addMenu(new LLToolsEnableBuyOrTake(), "Tools.EnableBuyOrTake"); + view_listener_t::addMenu(new LLToolsEnableTakeCopy(), "Tools.EnableTakeCopy"); + view_listener_t::addMenu(new LLToolsEnableSaveToInventory(), "Tools.EnableSaveToInventory"); + view_listener_t::addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory"); + + /*view_listener_t::addMenu(new LLToolsVisibleBuyObject(), "Tools.VisibleBuyObject"); + view_listener_t::addMenu(new LLToolsVisibleTakeObject(), "Tools.VisibleTakeObject");*/ // Help menu // most items use the ShowFloater method + // Advance menu + view_listener_t::addMenu(new LLAdvancedToggleConsole(), "Advanced.ToggleConsole"); + view_listener_t::addMenu(new LLAdvancedCheckConsole(), "Advanced.CheckConsole"); + view_listener_t::addMenu(new LLAdvancedDumpInfoToConsole(), "Advanced.DumpInfoToConsole"); + // Advanced > HUD Info + view_listener_t::addMenu(new LLAdvancedToggleHUDInfo(), "Advanced.ToggleHUDInfo"); + view_listener_t::addMenu(new LLAdvancedCheckHUDInfo(), "Advanced.CheckHUDInfo"); + + // Advanced Other Settings + view_listener_t::addMenu(new LLAdvancedClearGroupCache(), "Advanced.ClearGroupCache"); + + // Advanced > Render > Types + view_listener_t::addMenu(new LLAdvancedToggleRenderType(), "Advanced.ToggleRenderType"); + view_listener_t::addMenu(new LLAdvancedCheckRenderType(), "Advanced.CheckRenderType"); + + //// Advanced > Render > Features + view_listener_t::addMenu(new LLAdvancedToggleFeature(), "Advanced.ToggleFeature"); + view_listener_t::addMenu(new LLAdvancedCheckFeature(), "Advanced.CheckFeature"); + // Advanced > Render > Info Displays + view_listener_t::addMenu(new LLAdvancedToggleInfoDisplay(), "Advanced.ToggleInfoDisplay"); + view_listener_t::addMenu(new LLAdvancedCheckInfoDisplay(), "Advanced.CheckInfoDisplay"); + view_listener_t::addMenu(new LLAdvancedSelectedTextureInfo(), "Advanced.SelectedTextureInfo"); + view_listener_t::addMenu(new LLAdvancedToggleWireframe(), "Advanced.ToggleWireframe"); + view_listener_t::addMenu(new LLAdvancedCheckWireframe(), "Advanced.CheckWireframe"); + view_listener_t::addMenu(new LLAdvancedToggleDisableTextures(), "Advanced.ToggleDisableTextures"); + view_listener_t::addMenu(new LLAdvancedCheckDisableTextures(), "Advanced.CheckDisableTextures"); + view_listener_t::addMenu(new LLAdvancedEnableObjectObjectOcclusion(), "Advanced.EnableObjectObjectOcclusion"); + view_listener_t::addMenu(new LLAdvancedToggleRandomizeFramerate(), "Advanced.ToggleRandomizeFramerate"); + view_listener_t::addMenu(new LLAdvancedCheckRandomizeFramerate(), "Advanced.CheckRandomizeFramerate"); + view_listener_t::addMenu(new LLAdvancedTogglePeriodicSlowFrame(), "Advanced.TogglePeriodicSlowFrame"); + view_listener_t::addMenu(new LLAdvancedCheckPeriodicSlowFrame(), "Advanced.CheckPeriodicSlowFrame"); + view_listener_t::addMenu(new LLAdvancedVectorizePerfTest(), "Advanced.VectorizePerfTest"); + view_listener_t::addMenu(new LLAdvancedToggleFrameTest(), "Advanced.ToggleFrameTest"); + view_listener_t::addMenu(new LLAdvancedCheckFrameTest(), "Advanced.CheckFrameTest"); + view_listener_t::addMenu(new LLAdvancedHandleAttchedLightParticles(), "Advanced.HandleAttchedLightParticles"); + + + #ifdef TOGGLE_HACKED_GODLIKE_VIEWER + view_listener_t::addMenu(new LLAdvancedHandleToggleHackedGodmode(), "Advanced.HandleToggleHackedGodmode"); + view_listener_t::addMenu(new LLAdvancedCheckToggleHackedGodmode(), "Advanced.CheckToggleHackedGodmode"); + view_listener_t::addMenu(new LLAdvancedEnableToggleHackedGodmode(), "Advanced.EnableToggleHackedGodmode"); + #endif + + // Advanced > World + view_listener_t::addMenu(new LLAdvancedDumpScriptedCamera(), "Advanced.DumpScriptedCamera"); + view_listener_t::addMenu(new LLAdvancedDumpRegionObjectCache(), "Advanced.DumpRegionObjectCache"); + + // Advanced > UI + view_listener_t::addMenu(new LLAdvancedWebBrowserTest(), "Advanced.WebBrowserTest"); + view_listener_t::addMenu(new LLAdvancedBuyCurrencyTest(), "Advanced.BuyCurrencyTest"); + view_listener_t::addMenu(new LLAdvancedToggleEditableUI(), "Advanced.ToggleEditableUI"); + view_listener_t::addMenu(new LLAdvancedDumpSelectMgr(), "Advanced.DumpSelectMgr"); + view_listener_t::addMenu(new LLAdvancedDumpInventory(), "Advanced.DumpInventory"); + view_listener_t::addMenu(new LLAdvancedDumpFocusHolder(), "Advanced.DumpFocusHolder"); + view_listener_t::addMenu(new LLAdvancedPrintSelectedObjectInfo(), "Advanced.PrintSelectedObjectInfo"); + view_listener_t::addMenu(new LLAdvancedPrintAgentInfo(), "Advanced.PrintAgentInfo"); + view_listener_t::addMenu(new LLAdvancedPrintTextureMemoryStats(), "Advanced.PrintTextureMemoryStats"); + view_listener_t::addMenu(new LLAdvancedToggleDebugClicks(), "Advanced.ToggleDebugClicks"); + view_listener_t::addMenu(new LLAdvancedCheckDebugClicks(), "Advanced.CheckDebugClicks"); + view_listener_t::addMenu(new LLAdvancedCheckDebugViews(), "Advanced.CheckDebugViews"); + view_listener_t::addMenu(new LLAdvancedToggleDebugViews(), "Advanced.ToggleDebugViews"); + view_listener_t::addMenu(new LLAdvancedToggleXUINameTooltips(), "Advanced.ToggleXUINameTooltips"); + view_listener_t::addMenu(new LLAdvancedCheckXUINameTooltips(), "Advanced.CheckXUINameTooltips"); + view_listener_t::addMenu(new LLAdvancedToggleDebugMouseEvents(), "Advanced.ToggleDebugMouseEvents"); + view_listener_t::addMenu(new LLAdvancedCheckDebugMouseEvents(), "Advanced.CheckDebugMouseEvents"); + view_listener_t::addMenu(new LLAdvancedToggleDebugKeys(), "Advanced.ToggleDebugKeys"); + view_listener_t::addMenu(new LLAdvancedCheckDebugKeys(), "Advanced.CheckDebugKeys"); + view_listener_t::addMenu(new LLAdvancedToggleDebugWindowProc(), "Advanced.ToggleDebugWindowProc"); + view_listener_t::addMenu(new LLAdvancedCheckDebugWindowProc(), "Advanced.CheckDebugWindowProc"); + + + // Advanced > XUI + view_listener_t::addMenu(new LLAdvancedShowFontTest(), "Advanced.ShowFontTest"); + view_listener_t::addMenu(new LLAdvancedLoadUIFromXML(), "Advanced.LoadUIFromXML"); + view_listener_t::addMenu(new LLAdvancedSaveUIToXML(), "Advanced.SaveUIToXML"); + view_listener_t::addMenu(new LLAdvancedToggleXUINames(), "Advanced.ToggleXUINames"); + view_listener_t::addMenu(new LLAdvancedCheckXUINames(), "Advanced.CheckXUINames"); + + // Advanced > Character > Grab Baked Texture + view_listener_t::addMenu(new LLAdvancedGrabBakedTexture(), "Advanced.GrabBakedTexture"); + view_listener_t::addMenu(new LLAdvancedEnableGrabBakedTexture(), "Advanced.EnableGrabBakedTexture"); + + // Advanced > Character > Character Tests + view_listener_t::addMenu(new LLAdvancedAppearanceToXML(), "Advanced.AppearanceToXML"); + view_listener_t::addMenu(new LLAdvancedToggleCharacterGeometry(), "Advanced.ToggleCharacterGeometry"); + + view_listener_t::addMenu(new LLAdvancedTestMale(), "Advanced.TestMale"); + view_listener_t::addMenu(new LLAdvancedTestFemale(), "Advanced.TestFemale"); + view_listener_t::addMenu(new LLAdvancedTogglePG(), "Advanced.TogglePG"); + + // Advanced > Character (toplevel) + view_listener_t::addMenu(new LLAdvancedToggleAllowTapTapHoldRun(), "Advanced.ToggleAllowTapTapHoldRun"); + view_listener_t::addMenu(new LLAdvancedCheckAllowTapTapHoldRun(), "Advanced.CheckAllowTapTapHoldRun"); + view_listener_t::addMenu(new LLAdvancedForceParamsToDefault(), "Advanced.ForceParamsToDefault"); + view_listener_t::addMenu(new LLAdvancedReloadVertexShader(), "Advanced.ReloadVertexShader"); + view_listener_t::addMenu(new LLAdvancedToggleAnimationInfo(), "Advanced.ToggleAnimationInfo"); + view_listener_t::addMenu(new LLAdvancedCheckAnimationInfo(), "Advanced.CheckAnimationInfo"); + view_listener_t::addMenu(new LLAdvancedToggleShowLookAt(), "Advanced.ToggleShowLookAt"); + view_listener_t::addMenu(new LLAdvancedCheckShowLookAt(), "Advanced.CheckShowLookAt"); + view_listener_t::addMenu(new LLAdvancedToggleShowPointAt(), "Advanced.ToggleShowPointAt"); + view_listener_t::addMenu(new LLAdvancedCheckShowPointAt(), "Advanced.CheckShowPointAt"); + view_listener_t::addMenu(new LLAdvancedToggleDebugJointUpdates(), "Advanced.ToggleDebugJointUpdates"); + view_listener_t::addMenu(new LLAdvancedCheckDebugJointUpdates(), "Advanced.CheckDebugJointUpdates"); + view_listener_t::addMenu(new LLAdvancedToggleDisableLOD(), "Advanced.ToggleDisableLOD"); + view_listener_t::addMenu(new LLAdvancedCheckDisableLOD(), "Advanced.CheckDisableLOD"); + view_listener_t::addMenu(new LLAdvancedToggleDebugCharacterVis(), "Advanced.ToggleDebugCharacterVis"); + view_listener_t::addMenu(new LLAdvancedCheckDebugCharacterVis(), "Advanced.CheckDebugCharacterVis"); + view_listener_t::addMenu(new LLAdvancedDumpAttachments(), "Advanced.DumpAttachments"); + view_listener_t::addMenu(new LLAdvancedRebakeTextures(), "Advanced.RebakeTextures"); + #ifndef LL_RELEASE_FOR_DOWNLOAD + view_listener_t::addMenu(new LLAdvancedDebugAvatarTextures(), "Advanced.DebugAvatarTextures"); + view_listener_t::addMenu(new LLAdvancedDumpAvatarLocalTextures(), "Advanced.DumpAvatarLocalTextures"); + view_listener_t::addMenu(new LLAdvancedMemoryLeakingSimulation(), "Advanced.MemoryLeakingSimulation"); + #endif + // Advanced > Network + view_listener_t::addMenu(new LLAdvancedEnableMessageLog(), "Advanced.EnableMessageLog"); + view_listener_t::addMenu(new LLAdvancedDisableMessageLog(), "Advanced.DisableMessageLog"); + view_listener_t::addMenu(new LLAdvancedDropPacket(), "Advanced.DropPacket"); + + // Advanced > Recorder + view_listener_t::addMenu(new LLAdvancedAgentPilot(), "Advanced.AgentPilot"); + view_listener_t::addMenu(new LLAdvancedToggleAgentPilotLoop(), "Advanced.ToggleAgentPilotLoop"); + view_listener_t::addMenu(new LLAdvancedCheckAgentPilotLoop(), "Advanced.CheckAgentPilotLoop"); + + // Advanced > Debugging + view_listener_t::addMenu(new LLAdvancedForceErrorBreakpoint(), "Advanced.ForceErrorBreakpoint"); + view_listener_t::addMenu(new LLAdvancedForceErrorLlerror(), "Advanced.ForceErrorLlerror"); + view_listener_t::addMenu(new LLAdvancedForceErrorBadMemoryAccess(), "Advanced.ForceErrorBadMemoryAccess"); + view_listener_t::addMenu(new LLAdvancedForceErrorInfiniteLoop(), "Advanced.ForceErrorInfiniteLoop"); + view_listener_t::addMenu(new LLAdvancedForceErrorSoftwareException(), "Advanced.ForceErrorSoftwareException"); + view_listener_t::addMenu(new LLAdvancedForceErrorDriverCrash(), "Advanced.ForceErrorDriverCrash"); + view_listener_t::addMenu(new LLAdvancedForceErrorDriverCrash(), "Advanced.ForceErrorDisconnectViewer"); + + // Advanced (toplevel) + view_listener_t::addMenu(new LLAdvancedToggleShowObjectUpdates(), "Advanced.ToggleShowObjectUpdates"); + view_listener_t::addMenu(new LLAdvancedCheckShowObjectUpdates(), "Advanced.CheckShowObjectUpdates"); + view_listener_t::addMenu(new LLAdvancedCompressImage(), "Advanced.CompressImage"); + view_listener_t::addMenu(new LLAdvancedShowDebugSettings(), "Advanced.ShowDebugSettings"); + view_listener_t::addMenu(new LLAdvancedToggleViewAdminOptions(), "Advanced.ToggleViewAdminOptions"); + view_listener_t::addMenu(new LLAdvancedCheckViewAdminOptions(), "Advanced.CheckViewAdminOptions"); + view_listener_t::addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus"); + view_listener_t::addMenu(new LLAdvancedLeaveAdminStatus(), "Advanced.LeaveAdminStatus"); + + + // Admin >Object + view_listener_t::addMenu(new LLAdminForceTakeCopy(), "Admin.ForceTakeCopy"); + view_listener_t::addMenu(new LLAdminHandleObjectOwnerSelf(), "Admin.HandleObjectOwnerSelf"); + view_listener_t::addMenu(new LLAdminHandleObjectOwnerPermissive(), "Admin.HandleObjectOwnerPermissive"); + view_listener_t::addMenu(new LLAdminHandleForceDelete(), "Admin.HandleForceDelete"); + view_listener_t::addMenu(new LLAdminHandleObjectLock(), "Admin.HandleObjectLock"); + view_listener_t::addMenu(new LLAdminHandleObjectAssetIDs(), "Admin.HandleObjectAssetIDs"); + + // Admin >Parcel + view_listener_t::addMenu(new LLAdminHandleForceParcelOwnerToMe(), "Admin.HandleForceParcelOwnerToMe"); + view_listener_t::addMenu(new LLAdminHandleForceParcelToContent(), "Admin.HandleForceParcelToContent"); + view_listener_t::addMenu(new LLAdminHandleClaimPublicLand(), "Admin.HandleClaimPublicLand"); + + // Admin >Region + view_listener_t::addMenu(new LLAdminHandleRegionDumpTempAssetData(), "Admin.HandleRegionDumpTempAssetData"); + // Admin top level + view_listener_t::addMenu(new LLAdminShowGodTools(), "Admin.ShowGodTools"); + view_listener_t::addMenu(new LLAdminOnSaveState(), "Admin.OnSaveState"); + // Self pie menu - addMenu(new LLSelfStandUp(), "Self.StandUp"); - addMenu(new LLSelfRemoveAllAttachments(), "Self.RemoveAllAttachments"); + view_listener_t::addMenu(new LLSelfStandUp(), "Self.StandUp"); + view_listener_t::addMenu(new LLSelfRemoveAllAttachments(), "Self.RemoveAllAttachments"); - addMenu(new LLSelfEnableStandUp(), "Self.EnableStandUp"); - addMenu(new LLSelfEnableRemoveAllAttachments(), "Self.EnableRemoveAllAttachments"); + view_listener_t::addMenu(new LLSelfEnableStandUp(), "Self.EnableStandUp"); + view_listener_t::addMenu(new LLSelfEnableRemoveAllAttachments(), "Self.EnableRemoveAllAttachments"); // Avatar pie menu - addMenu(new LLObjectMute(), "Avatar.Mute"); - addMenu(new LLAvatarAddFriend(), "Avatar.AddFriend"); - addMenu(new LLAvatarFreeze(), "Avatar.Freeze"); - addMenu(new LLAvatarDebug(), "Avatar.Debug"); - addMenu(new LLAvatarVisibleDebug(), "Avatar.VisibleDebug"); - addMenu(new LLAvatarEnableDebug(), "Avatar.EnableDebug"); - addMenu(new LLAvatarInviteToGroup(), "Avatar.InviteToGroup"); - addMenu(new LLAvatarGiveCard(), "Avatar.GiveCard"); - addMenu(new LLAvatarEject(), "Avatar.Eject"); - addMenu(new LLAvatarSendIM(), "Avatar.SendIM"); - addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); + view_listener_t::addMenu(new LLObjectMute(), "Avatar.Mute"); + view_listener_t::addMenu(new LLAvatarAddFriend(), "Avatar.AddFriend"); + view_listener_t::addMenu(new LLAvatarFreeze(), "Avatar.Freeze"); + view_listener_t::addMenu(new LLAvatarDebug(), "Avatar.Debug"); + view_listener_t::addMenu(new LLAvatarVisibleDebug(), "Avatar.VisibleDebug"); + view_listener_t::addMenu(new LLAvatarEnableDebug(), "Avatar.EnableDebug"); + view_listener_t::addMenu(new LLAvatarInviteToGroup(), "Avatar.InviteToGroup"); + view_listener_t::addMenu(new LLAvatarGiveCard(), "Avatar.GiveCard"); + view_listener_t::addMenu(new LLAvatarEject(), "Avatar.Eject"); + view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM"); + view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); - addMenu(new LLObjectEnableMute(), "Avatar.EnableMute"); - addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend"); - addMenu(new LLAvatarEnableFreezeEject(), "Avatar.EnableFreezeEject"); + view_listener_t::addMenu(new LLObjectEnableMute(), "Avatar.EnableMute"); + view_listener_t::addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend"); + view_listener_t::addMenu(new LLAvatarEnableFreezeEject(), "Avatar.EnableFreezeEject"); // Object pie menu - addMenu(new LLObjectOpen(), "Object.Open"); - addMenu(new LLObjectBuild(), "Object.Build"); - addMenu(new LLObjectTouch(), "Object.Touch"); - addMenu(new LLObjectSitOrStand(), "Object.SitOrStand"); - addMenu(new LLObjectDelete(), "Object.Delete"); - addMenu(new LLObjectAttachToAvatar(), "Object.AttachToAvatar"); - addMenu(new LLObjectReturn(), "Object.Return"); - addMenu(new LLObjectReportAbuse(), "Object.ReportAbuse"); - addMenu(new LLObjectMute(), "Object.Mute"); - addMenu(new LLObjectBuy(), "Object.Buy"); - addMenu(new LLObjectEdit(), "Object.Edit"); - addMenu(new LLObjectInspect(), "Object.Inspect"); - - addMenu(new LLObjectEnableOpen(), "Object.EnableOpen"); - addMenu(new LLObjectEnableTouch(), "Object.EnableTouch"); - addMenu(new LLObjectEnableSitOrStand(), "Object.EnableSitOrStand"); - addMenu(new LLObjectEnableDelete(), "Object.EnableDelete"); - addMenu(new LLObjectEnableWear(), "Object.EnableWear"); - addMenu(new LLObjectEnableReturn(), "Object.EnableReturn"); - addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); - addMenu(new LLObjectEnableMute(), "Object.EnableMute"); - addMenu(new LLObjectEnableBuy(), "Object.EnableBuy"); - - /*addMenu(new LLObjectVisibleTouch(), "Object.VisibleTouch"); - addMenu(new LLObjectVisibleCustomTouch(), "Object.VisibleCustomTouch"); - addMenu(new LLObjectVisibleStandUp(), "Object.VisibleStandUp"); - addMenu(new LLObjectVisibleSitHere(), "Object.VisibleSitHere"); - addMenu(new LLObjectVisibleCustomSit(), "Object.VisibleCustomSit");*/ + view_listener_t::addMenu(new LLObjectOpen(), "Object.Open"); + view_listener_t::addMenu(new LLObjectBuild(), "Object.Build"); + view_listener_t::addMenu(new LLObjectTouch(), "Object.Touch"); + view_listener_t::addMenu(new LLObjectSitOrStand(), "Object.SitOrStand"); + view_listener_t::addMenu(new LLObjectDelete(), "Object.Delete"); + view_listener_t::addMenu(new LLObjectAttachToAvatar(), "Object.AttachToAvatar"); + view_listener_t::addMenu(new LLObjectReturn(), "Object.Return"); + view_listener_t::addMenu(new LLObjectReportAbuse(), "Object.ReportAbuse"); + view_listener_t::addMenu(new LLObjectMute(), "Object.Mute"); + view_listener_t::addMenu(new LLObjectBuy(), "Object.Buy"); + view_listener_t::addMenu(new LLObjectEdit(), "Object.Edit"); + view_listener_t::addMenu(new LLObjectInspect(), "Object.Inspect"); + + view_listener_t::addMenu(new LLObjectEnableOpen(), "Object.EnableOpen"); + view_listener_t::addMenu(new LLObjectEnableTouch(), "Object.EnableTouch"); + view_listener_t::addMenu(new LLObjectEnableSitOrStand(), "Object.EnableSitOrStand"); + view_listener_t::addMenu(new LLObjectEnableDelete(), "Object.EnableDelete"); + view_listener_t::addMenu(new LLObjectEnableWear(), "Object.EnableWear"); + view_listener_t::addMenu(new LLObjectEnableReturn(), "Object.EnableReturn"); + view_listener_t::addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); + view_listener_t::addMenu(new LLObjectEnableMute(), "Object.EnableMute"); + view_listener_t::addMenu(new LLObjectEnableBuy(), "Object.EnableBuy"); + + /*view_listener_t::addMenu(new LLObjectVisibleTouch(), "Object.VisibleTouch"); + view_listener_t::addMenu(new LLObjectVisibleCustomTouch(), "Object.VisibleCustomTouch"); + view_listener_t::addMenu(new LLObjectVisibleStandUp(), "Object.VisibleStandUp"); + view_listener_t::addMenu(new LLObjectVisibleSitHere(), "Object.VisibleSitHere"); + view_listener_t::addMenu(new LLObjectVisibleCustomSit(), "Object.VisibleCustomSit");*/ // Attachment pie menu - addMenu(new LLAttachmentDrop(), "Attachment.Drop"); - addMenu(new LLAttachmentDetach(), "Attachment.Detach"); - - addMenu(new LLAttachmentEnableDrop(), "Attachment.EnableDrop"); - addMenu(new LLAttachmentEnableDetach(), "Attachment.EnableDetach"); + enable.add("Attachment.Label", boost::bind(&onEnableAttachmentLabel, _1, _2)); + view_listener_t::addMenu(new LLAttachmentDrop(), "Attachment.Drop"); + view_listener_t::addMenu(new LLAttachmentDetachFromPoint(), "Attachment.DetachFromPoint"); + view_listener_t::addMenu(new LLAttachmentDetach(), "Attachment.Detach"); + view_listener_t::addMenu(new LLAttachmentPointFilled(), "Attachment.PointFilled"); + view_listener_t::addMenu(new LLAttachmentEnableDrop(), "Attachment.EnableDrop"); + view_listener_t::addMenu(new LLAttachmentEnableDetach(), "Attachment.EnableDetach"); // Land pie menu - addMenu(new LLLandBuild(), "Land.Build"); - addMenu(new LLLandSit(), "Land.Sit"); - addMenu(new LLLandBuyPass(), "Land.BuyPass"); - addMenu(new LLLandEdit(), "Land.Edit"); + view_listener_t::addMenu(new LLLandBuild(), "Land.Build"); + view_listener_t::addMenu(new LLLandSit(), "Land.Sit"); + view_listener_t::addMenu(new LLLandBuyPass(), "Land.BuyPass"); + view_listener_t::addMenu(new LLLandEdit(), "Land.Edit"); - addMenu(new LLLandEnableBuyPass(), "Land.EnableBuyPass"); + view_listener_t::addMenu(new LLLandEnableBuyPass(), "Land.EnableBuyPass"); // Generic actions - addMenu(new LLShowFloater(), "ShowFloater"); - addMenu(new LLPromptShowURL(), "PromptShowURL"); - addMenu(new LLShowAgentProfile(), "ShowAgentProfile"); - addMenu(new LLShowAgentGroups(), "ShowAgentGroups"); - addMenu(new LLToggleControl(), "ToggleControl"); - - addMenu(new LLGoToObject(), "GoToObject"); - addMenu(new LLPayObject(), "PayObject"); - - addMenu(new LLEnablePayObject(), "EnablePayObject"); - addMenu(new LLEnableEdit(), "EnableEdit"); - - addMenu(new LLFloaterVisible(), "FloaterVisible"); - addMenu(new LLSomethingSelected(), "SomethingSelected"); - addMenu(new LLSomethingSelectedNoHUD(), "SomethingSelectedNoHUD"); - addMenu(new LLEditableSelected(), "EditableSelected"); - addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); + view_listener_t::addMenu(new LLShowFloater(), "ShowFloater"); + view_listener_t::addMenu(new LLPromptShowURL(), "PromptShowURL"); + view_listener_t::addMenu(new LLShowAgentProfile(), "ShowAgentProfile"); + view_listener_t::addMenu(new LLToggleControl(), "ToggleControl"); + view_listener_t::addMenu(new LLCheckControl(), "CheckControl"); + view_listener_t::addMenu(new LLGoToObject(), "GoToObject"); + view_listener_t::addMenu(new LLPayObject(), "PayObject"); + + view_listener_t::addMenu(new LLEnablePayObject(), "EnablePayObject"); + view_listener_t::addMenu(new LLEnableEdit(), "EnableEdit"); + + view_listener_t::addMenu(new LLFloaterVisible(), "FloaterVisible"); + view_listener_t::addMenu(new LLSomethingSelected(), "SomethingSelected"); + view_listener_t::addMenu(new LLSomethingSelectedNoHUD(), "SomethingSelectedNoHUD"); + view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected"); + view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); + } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index e9fedf37d8d9eac104876394acff73b49e668c42..99994bdf5bbf9624f3baf1d2b1eb4dc3995f7f73 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -34,6 +34,7 @@ #define LL_LLVIEWERMENU_H #include "llmenugl.h" +#include "llsafehandle.h" //newview includes #include "llfilepicker.h" @@ -44,7 +45,6 @@ class LLParcelSelection; class LLObjectSelection; -void pre_init_menus(); void init_menus(); void cleanup_menus(); @@ -79,26 +79,22 @@ BOOL enable_redo(void*); BOOL is_agent_friend(const LLUUID& agent_id); BOOL is_agent_mappable(const LLUUID& agent_id); -void menu_toggle_control( void* user_data ); void confirm_replace_attachment(S32 option, void* user_data); -void handle_detach_from_avatar(void* user_data); -void attach_label(std::string& label, void* user_data); -void detach_label(std::string& label, void* user_data); -BOOL object_selected_and_point_valid(void* user_data); -BOOL object_attached(void* user_data); +void handle_detach_from_avatar(const LLSD& user_data); +void attach_label(std::string& label, const LLSD&); +void detach_label(std::string& label, const LLSD&); +BOOL object_selected_and_point_valid(const LLSD&); void handle_detach(void*); BOOL enable_god_full(void* user_data); BOOL enable_god_liaison(void* user_data); BOOL enable_god_customer_service(void* user_data); BOOL enable_god_basic(void* user_data); -void handle_show_newest_map(void*); void set_underclothes_menu_options(); void exchange_callingcard(const LLUUID& dest_id); void handle_gestures(void*); void handle_sit_down(void*); -bool toggle_build_mode(); void handle_object_build(void*); void handle_save_snapshot(void *); void handle_toggle_flycam(); @@ -119,8 +115,6 @@ class LLPermissions; class LLViewerMenuHolderGL : public LLMenuHolderGL { public: - LLViewerMenuHolderGL(); - virtual BOOL hideMenus(); void setParcelSelection(LLSafeHandle<LLParcelSelection> selection); @@ -142,30 +136,31 @@ extern LLViewerMenuHolderGL* gMenuHolder; extern LLMenuBarGL* gLoginMenuBarView; // Pie menus -extern LLPieMenu *gPieSelf; -extern LLPieMenu *gPieAvatar; -extern LLPieMenu *gPieObject; -extern LLPieMenu *gPieAttachment; -extern LLPieMenu *gPieLand; -extern LLPieMenu* gPieRate; +extern LLContextMenu *gPieSelf; +extern LLContextMenu *gPieAvatar; +extern LLContextMenu *gPieObject; +extern LLContextMenu *gPieAttachment; + +extern LLContextMenu *gPieLand; +extern LLContextMenu *gPieRate; // Pie menus -extern LLPieMenu *gPieSelfSimple; -extern LLPieMenu *gPieAvatarSimple; -extern LLPieMenu *gPieObjectSimple; -extern LLPieMenu *gPieAttachmentSimple; -extern LLPieMenu *gPieLandSimple; +extern LLContextMenu *gPieSelfSimple; +extern LLContextMenu *gPieAvatarSimple; +extern LLContextMenu *gPieObjectSimple; +extern LLContextMenu *gPieAttachmentSimple; +extern LLContextMenu *gPieLandSimple; // Needed to build menus when attachment site list available extern LLMenuGL* gAttachSubMenu; extern LLMenuGL* gDetachSubMenu; extern LLMenuGL* gTakeOffClothes; -extern LLPieMenu* gAttachScreenPieMenu; -extern LLPieMenu* gDetachScreenPieMenu; -extern LLPieMenu* gAttachPieMenu; -extern LLPieMenu* gDetachPieMenu; -extern LLPieMenu* gAttachBodyPartPieMenus[8]; -extern LLPieMenu* gDetachBodyPartPieMenus[8]; +extern LLContextMenu* gAttachScreenPieMenu; +extern LLContextMenu* gDetachScreenPieMenu; +extern LLContextMenu* gAttachPieMenu; +extern LLContextMenu* gDetachPieMenu; +extern LLContextMenu* gAttachBodyPartPieMenus[8]; +extern LLContextMenu* gDetachBodyPartPieMenus[8]; extern LLMenuItemCallGL* gAFKMenu; extern LLMenuItemCallGL* gBusyMenu; diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index d1f50212db79ef2f48b5f2bf013e47ff49606d88..6576ea81ede31a354fdd033e9e5f077b2bdeb99b 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -49,19 +49,20 @@ #include "llviewercontrol.h" // gSavedSettings #include "llviewerimagelist.h" #include "lluictrlfactory.h" +#include "llviewerinventory.h" #include "llviewermenu.h" // gMenuHolder #include "llviewerregion.h" #include "llviewerstats.h" #include "llviewerwindow.h" #include "llappviewer.h" #include "lluploaddialog.h" +#include "lltrans.h" // linden libraries #include "llassetuploadresponders.h" #include "lleconomy.h" #include "llhttpclient.h" -#include "llmemberlistener.h" #include "llsdserialize.h" #include "llstring.h" #include "lltransactiontypes.h" @@ -71,28 +72,21 @@ // system libraries #include <boost/tokenizer.hpp> -using namespace LLOldEvents; - -typedef LLMemberListener<LLView> view_listener_t; - - class LLFileEnableSaveAs : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = gFloaterView->getFrontmost() && gFloaterView->getFrontmost()->canSaveAs(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLFileEnableUpload : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = gStatusBar && LLGlobalEconomy::Singleton::getInstance() && (gStatusBar->getBalance() >= LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()); - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; @@ -255,7 +249,7 @@ const std::string upload_pick(void* data) class LLFileUploadImage : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { std::string filename = upload_pick((void *)LLFilePicker::FFLOAD_IMAGE); if (!filename.empty()) @@ -269,7 +263,7 @@ class LLFileUploadImage : public view_listener_t class LLFileUploadSound : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_WAV); if (!filename.empty()) @@ -284,7 +278,7 @@ class LLFileUploadSound : public view_listener_t class LLFileUploadAnim : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { const std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_ANIM); if (!filename.empty()) @@ -298,7 +292,7 @@ class LLFileUploadAnim : public view_listener_t class LLFileUploadBulk : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { if( gAgent.cameraMouselook() ) { @@ -360,19 +354,16 @@ void upload_error(const std::string& error_message, const std::string& label, co class LLFileEnableCloseWindow : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool new_value = NULL != LLFloater::getClosableFloaterFromFocus(); - - // horrendously opaque, this code - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; + return new_value; } }; class LLFileCloseWindow : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLFloater::closeFocusedFloater(); @@ -382,17 +373,16 @@ class LLFileCloseWindow : public view_listener_t class LLFileEnableCloseAllWindows : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool open_children = gFloaterView->allChildrenClosed(); - gMenuHolder->findControl(userdata["control"].asString())->setValue(!open_children); - return true; + return !open_children; } }; class LLFileCloseAllWindows : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { bool app_quitting = false; gFloaterView->closeAllChildren(app_quitting); @@ -403,7 +393,7 @@ class LLFileCloseAllWindows : public view_listener_t class LLFileSaveTexture : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLFloater* top = gFloaterView->getFrontmost(); if (top) @@ -414,18 +404,9 @@ class LLFileSaveTexture : public view_listener_t } }; -class LLFileTakeSnapshot : public view_listener_t -{ - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) - { - LLFloaterSnapshot::show(NULL); - return true; - } -}; - class LLFileTakeSnapshotToDisk : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLPointer<LLImageRaw> raw = new LLImageRaw; @@ -477,23 +458,13 @@ class LLFileTakeSnapshotToDisk : public view_listener_t class LLFileQuit : public view_listener_t { - bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + bool handleEvent(const LLSD& userdata) { LLAppViewer::instance()->userQuit(); return true; } }; -void handle_upload(void* data) -{ - const std::string filename = upload_pick(data); - if (!filename.empty()) - { - LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename); - LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_name_description.xml"); - floaterp->childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() )); - } -} void handle_compress_image(void*) { @@ -777,8 +748,7 @@ void upload_new_resource(const std::string& src_filename, std::string name, else { // Unknown extension - // *TODO: Translate? - error_message = llformat("Unknown file extension .%s\nExpected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh", exten.c_str()); + error_message = llformat(LLTrans::getString("UnknownFileExtension").c_str(), exten.c_str()); error = TRUE;; } @@ -858,9 +828,9 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt if(!(can_afford_transaction(expected_upload_cost))) { LLFloaterBuyCurrency::buyCurrency( - llformat("Uploading %s costs", - data->mAssetInfo.getName().c_str()), // *TODO: Translate - expected_upload_cost); + llformat(LLTrans::getString("UploadingCosts").c_str(), + data->mAssetInfo.getName().c_str()), + expected_upload_cost); is_balance_sufficient = FALSE; } else if(region) @@ -1075,22 +1045,20 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty } } - void init_menu_file() { - (new LLFileUploadImage())->registerListener(gMenuHolder, "File.UploadImage"); - (new LLFileUploadSound())->registerListener(gMenuHolder, "File.UploadSound"); - (new LLFileUploadAnim())->registerListener(gMenuHolder, "File.UploadAnim"); - (new LLFileUploadBulk())->registerListener(gMenuHolder, "File.UploadBulk"); - (new LLFileCloseWindow())->registerListener(gMenuHolder, "File.CloseWindow"); - (new LLFileCloseAllWindows())->registerListener(gMenuHolder, "File.CloseAllWindows"); - (new LLFileEnableCloseWindow())->registerListener(gMenuHolder, "File.EnableCloseWindow"); - (new LLFileEnableCloseAllWindows())->registerListener(gMenuHolder, "File.EnableCloseAllWindows"); - (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture"); - (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); - (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); - (new LLFileQuit())->registerListener(gMenuHolder, "File.Quit"); - - (new LLFileEnableUpload())->registerListener(gMenuHolder, "File.EnableUpload"); - (new LLFileEnableSaveAs())->registerListener(gMenuHolder, "File.EnableSaveAs"); + view_listener_t::addCommit(new LLFileUploadImage(), "File.UploadImage"); + view_listener_t::addCommit(new LLFileUploadSound(), "File.UploadSound"); + view_listener_t::addCommit(new LLFileUploadAnim(), "File.UploadAnim"); + view_listener_t::addCommit(new LLFileUploadBulk(), "File.UploadBulk"); + view_listener_t::addCommit(new LLFileCloseWindow(), "File.CloseWindow"); + view_listener_t::addCommit(new LLFileCloseAllWindows(), "File.CloseAllWindows"); + view_listener_t::addEnable(new LLFileEnableCloseWindow(), "File.EnableCloseWindow"); + view_listener_t::addEnable(new LLFileEnableCloseAllWindows(), "File.EnableCloseAllWindows"); + view_listener_t::addCommit(new LLFileSaveTexture(), "File.SaveTexture"); + view_listener_t::addCommit(new LLFileTakeSnapshotToDisk(), "File.TakeSnapshotToDisk"); + view_listener_t::addCommit(new LLFileQuit(), "File.Quit"); + + view_listener_t::addEnable(new LLFileEnableUpload(), "File.EnableUpload"); + view_listener_t::addEnable(new LLFileEnableSaveAs(), "File.EnableSaveAs"); } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index bbfd480e0bbf5ab51916ace4eaec5ba3b87409b7..a62e59bc109f9e029b5b4fa1a18ee357a685f04e 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -48,6 +48,7 @@ #include "lldbstrings.h" #include "lleconomy.h" #include "llfilepicker.h" +#include "llfloaterreg.h" #include "llfocusmgr.h" #include "llfollowcamparams.h" #include "llinstantmessage.h" @@ -125,7 +126,7 @@ #include "llviewerthrottle.h" #include "llviewerwindow.h" #include "llvlmanager.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llvotextbubble.h" #include "llweb.h" #include "llworld.h" @@ -136,6 +137,7 @@ #include "llkeythrottle.h" #include <boost/tokenizer.hpp> +#include <boost/algorithm/string/split.hpp> #if LL_WINDOWS // For Windows specific error handler #include "llwindebug.h" // For the invalid message handler @@ -160,7 +162,7 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name); bool check_offer_throttle(const std::string& from_name, bool check_only); void callbackCacheEstateOwnerName(const LLUUID& id, const std::string& first, const std::string& last, - BOOL is_group, void*); + BOOL is_group); //inventory offer throttle globals LLFrameTimer gThrottleTimer; @@ -867,13 +869,14 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name) LLInventoryItem* item; for(; it != end; ++it) { - item = gInventory.getItem(*it); + const LLUUID& id = *it; + item = gInventory.getItem(id); if(!item) { - LL_WARNS("Messaging") << "Unable to show inventory item: " << *it << LL_ENDL; + LL_WARNS("Messaging") << "Unable to show inventory item: " << id << LL_ENDL; continue; } - if(gInventory.isObjectDescendentOf(*it, trash_id)) + if(gInventory.isObjectDescendentOf(id, trash_id)) { continue; } @@ -882,40 +885,50 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name) //if we are throttled, don't display them if (check_offer_throttle(from_name, false)) { - // I'm not sure this is a good idea. - bool show_keep_discard = item->getPermissions().getCreator() != gAgent.getID(); - //bool show_keep_discard = true; + // If we opened this ourselves, focus it + BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO; switch(asset_type) { - case LLAssetType::AT_NOTECARD: - open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(), LLUUID::null, show_keep_discard, LLUUID::null, FALSE); + case LLAssetType::AT_NOTECARD: + LLFloaterReg::showInstance("preview_notecard", LLSD(id), take_focus); break; - case LLAssetType::AT_LANDMARK: - open_landmark((LLViewerInventoryItem*)item, std::string("Landmark: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE); + case LLAssetType::AT_LANDMARK: + { + // *TODO: Embed a link to the Places panel so that user can edit the landmark right away. + LLInventoryCategory* parent_folder = gInventory.getCategory(item->getParentUUID()); + LLSD args; + args["LANDMARK_NAME"] = item->getName(); + args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unnkown"); + LLNotifications::instance().add("LandmarkCreated", args); + } break; - case LLAssetType::AT_TEXTURE: - open_texture(*it, std::string("Texture: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE); + case LLAssetType::AT_TEXTURE: + LLFloaterReg::showInstance("preview_texture", LLSD(id), take_focus); break; - default: + default: break; } } //highlight item, if it's not in the trash or lost+found // Don't auto-open the inventory floater - LLInventoryView* view = LLInventoryView::getActiveInventory(); - if(!view) - { - return; - } - + LLInventoryView* view = NULL; if(gSavedSettings.getBOOL("ShowInInventory") && asset_type != LLAssetType::AT_CALLINGCARD && item->getInventoryType() != LLInventoryType::IT_ATTACHMENT && !from_name.empty()) { - LLInventoryView::showAgentInventory(TRUE); + view = LLInventoryView::showAgentInventory(); } + else + { + view = LLInventoryView::getActiveInventory(); + } + if(!view) + { + return; + } + //Trash Check LLUUID trash_id; trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH); @@ -941,17 +954,19 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name) LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL; //highlight item - LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); - view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO); - gFocusMgr.setKeyboardFocus(focus_ctrl); + if (view->getPanel()) + { + LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); + view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO); + gFocusMgr.setKeyboardFocus(focus_ctrl); + } } } void inventory_offer_mute_callback(const LLUUID& blocked_id, const std::string& first_name, const std::string& last_name, - BOOL is_group, - void* user_data) + BOOL is_group) { std::string from_name; LLMute::EType type; @@ -970,8 +985,8 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id, LLMute mute(blocked_id, from_name, type); if (LLMuteList::getInstance()->add(mute)) { - LLFloaterMute::showInstance(); - LLFloaterMute::getInstance()->selectMute(blocked_id); + LLFloaterReg::showInstance("mute"); + LLFloaterReg::getTypedInstance<LLFloaterMute>("mute")->selectMute(blocked_id); } // purge the message queue of any previously queued inventory offers from the same source. @@ -1040,7 +1055,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // * we can't build two messages at once. if (2 == button) { - gCacheName->get(mFromID, mFromGroup, inventory_offer_mute_callback, this); + gCacheName->get(mFromID, mFromGroup, &inventory_offer_mute_callback); } LLMessageSystem* msg = gMessageSystem; @@ -1070,7 +1085,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& itemp = (LLViewerInventoryItem*)gInventory.getItem(mObjectID); } - // *TODO:translate std::string from_string; // Used in the pop-up. std::string chatHistory_string; // Used in chat history. if (mFromObject == TRUE) @@ -1080,13 +1094,18 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& std::string group_name; if (gCacheName->getGroupName(mFromID, group_name)) { - from_string = std::string("An object named '") + mFromName + "' owned by the group '" + group_name + "'"; - chatHistory_string = mFromName + " owned by the group '" + group_name + "'"; + from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+"'" + + mFromName + LLTrans::getString("'") +" " + LLTrans::getString("InvOfferOwnedByGroup") + + " "+ "'" + group_name + "'"; + + chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByGroup") + + " " + group_name + "'"; } else { - from_string = std::string("An object named '") + mFromName + "' owned by an unknown group"; - chatHistory_string = mFromName + " owned by an unknown group"; + from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+"'" + + mFromName +"'"+ " " + LLTrans::getString("InvOfferOwnedByUnknownGroup"); + chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByUnknownGroup"); } } else @@ -1094,13 +1113,15 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& std::string first_name, last_name; if (gCacheName->getName(mFromID, first_name, last_name)) { - from_string = std::string("An object named '") + mFromName + "' owned by " + first_name + " " + last_name; - chatHistory_string = mFromName + " owned by " + first_name + " " + last_name; + from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+ LLTrans::getString("'") + mFromName + + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + first_name + " " + last_name; + chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + first_name + " " + last_name; } else { - from_string = std::string("An object named '") + mFromName + "' owned by an unknown user"; - chatHistory_string = mFromName + " owned by an unknown user"; + from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+LLTrans::getString("'") + + mFromName + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedByUnknownUser"); + chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByUnknownUser"); } } } @@ -1128,7 +1149,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& //don't spam them if they are getting flooded if (check_offer_throttle(mFromName, true)) { - log_message = chatHistory_string + " gave you " + mDesc + "."; + log_message = chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + mDesc + LLTrans::getString("."); chat.mText = log_message; LLFloaterChat::addChatHistory(chat); } @@ -1191,7 +1212,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // send the message msg->sendReliable(mHost); - log_message = "You decline " + mDesc + " from " + mFromName + "."; + log_message = LLTrans::getString("InvOfferYouDecline") + " " + mDesc + " " + LLTrans::getString("InvOfferFrom") + " " + mFromName +"."; chat.mText = log_message; if( LLMuteList::getInstance()->isMuted(mFromID ) && ! LLMuteList::getInstance()->isLinden(mFromName) ) // muting for SL-42269 { @@ -1232,10 +1253,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& gInventory.addObserver(opener); } - // Allow these to stack up, but once you deal with one, reset the - // position. - gFloaterView->resetStartingFloaterPosition(); - delete this; return false; } @@ -1329,7 +1346,7 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) args["NAME"] = info->mFromName; LLNotification::Params p("ObjectGiveItem"); - p.substitutions(args).payload(payload).functor(boost::bind(&LLOfferInfo::inventory_offer_callback, info, _1, _2)); + p.substitutions(args).payload(payload).functor.function(boost::bind(&LLOfferInfo::inventory_offer_callback, info, _1, _2)); if (from_task) { @@ -1415,7 +1432,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLChat chat; std::string buffer; - // *TODO:translate - need to fix the full name to first/last (maybe) + // *TODO: Translate - need to fix the full name to first/last (maybe) msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, from_id); msg->getBOOLFast(_PREHASH_MessageBlock, _PREHASH_FromGroup, from_group); msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ToAgentID, to_id); @@ -1466,7 +1483,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_CONSOLE_AND_CHAT_HISTORY: // These are used for system messages, hence don't need the name, // as it is always "Second Life". - // *TODO:translate + // *TODO: Translate args["MESSAGE"] = message; // Note: don't put the message in the IM history, even though was sent @@ -1611,7 +1628,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_MESSAGEBOX: { // This is a block, modeless dialog. - //*TODO:translate + //*TODO: Translate args["MESSAGE"] = message; LLNotifications::instance().add("SystemMessage", args); } @@ -1969,7 +1986,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) else { LLSD args; - // *TODO:translate -> [FIRST] [LAST] (maybe) + // *TODO: Translate -> [FIRST] [LAST] (maybe) args["NAME"] = name; args["MESSAGE"] = message; LLSD payload; @@ -2396,8 +2413,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // T * * * F Yes Yes chat.mMuted = is_muted && !is_linden; - - + if (!visible_in_chat_bubble && (is_linden || !is_busy || is_owned_by_me)) { @@ -2430,7 +2446,7 @@ void process_teleport_start(LLMessageSystem *msg, void**) } else { - gViewerWindow->setProgressCancelButtonVisible(TRUE, std::string("Cancel")); // *TODO: Translate + gViewerWindow->setProgressCancelButtonVisible(TRUE, LLTrans::getString("Cancel")); } // Freeze the UI and show progress bar @@ -2465,7 +2481,7 @@ void process_teleport_progress(LLMessageSystem* msg, void**) } else { - gViewerWindow->setProgressCancelButtonVisible(TRUE, std::string("Cancel")); //TODO: Translate + gViewerWindow->setProgressCancelButtonVisible(TRUE, LLTrans::getString("Cancel")); } std::string buffer; msg->getString("Info", "Message", buffer); @@ -2880,12 +2896,45 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) { LLSD payload; payload["message"] = version_channel; - LLNotifications::instance().add("ServerVersionChanged", LLSD(), payload); + LLNotifications::instance().add("ServerVersionChanged", LLSD(), payload, server_version_changed_callback); } gLastVersionChannel = version_channel; } +bool server_version_changed_callback(const LLSD& notification, const LLSD& response) +{ + if(notification["payload"]["message"].asString() =="") + return false; + std::string url ="http://wiki.secondlife.com/wiki/Release_Notes/"; + //parse the msg string + std::string server_version = notification["payload"]["message"].asString(); + std::vector<std::string> s_vect; + boost::algorithm::split(s_vect, server_version, isspace); + for(U32 i = 0; i < s_vect.size(); i++) + { + if (i != (s_vect.size() - 1)) + { + if(i != (s_vect.size() - 2)) + { + url += s_vect[i] + "_"; + } + else + { + url += s_vect[i] + "/"; + } + } + else + { + url += s_vect[i].substr(0,4); + } + } + + LLWeb::loadURL(url); + return false; +} + + void process_crossed_region(LLMessageSystem* msg, void**) { LLUUID agent_id; @@ -3782,7 +3831,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data) gAgent.setSitCamera(sitObjectID, camera_eye, camera_at); } - gAgent.mForceMouselook = force_mouselook; + gAgent.setForceMouselook(force_mouselook); LLViewerObject* object = gObjectList.findObject(sitObjectID); if (object) @@ -4094,7 +4143,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) { // Make the user confirm the transaction, since they might // have missed something during an event. - // *TODO:translate + // *TODO: Translate LLSD args; args["MESSAGE"] = desc; LLNotifications::instance().add("SystemMessage", args); @@ -4170,7 +4219,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) bool attempt_standard_notification(LLMessageSystem* msgsystem) { // if we have additional alert data - if (msgsystem->getNumberOfBlocksFast(_PREHASH_AlertInfo) > 0) + if (msgsystem->has(_PREHASH_AlertInfo) && msgsystem->getNumberOfBlocksFast(_PREHASH_AlertInfo) > 0) { // notification was specified using the new mechanism, so we can just handle it here std::string notificationID; @@ -4316,21 +4365,21 @@ void process_alert_core(const std::string& message, BOOL modal) } else { - // *TODO:translate + // *TODO: Translate args["MESSAGE"] = text; LLNotifications::instance().add("SystemMessage", args); } } else if (modal) { - // *TODO:translate + // *TODO: Translate LLSD args; args["ERROR_MESSAGE"] = message; LLNotifications::instance().add("ErrorMessage", args); } else { - // *TODO:translate + // *TODO: Translate LLSD args; args["MESSAGE"] = message; LLNotifications::instance().add("SystemMessageTip", args); @@ -4347,10 +4396,10 @@ void handle_show_mean_events(void *) return; } - LLFloaterBump::show(NULL); + LLFloaterBump::showInstance(); } -void mean_name_callback(const LLUUID &id, const std::string& first, const std::string& last, BOOL always_false, void* data) +void mean_name_callback(const LLUUID &id, const std::string& first, const std::string& last, BOOL always_false) { if (gNoRender) { @@ -4428,7 +4477,7 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use LLMeanCollisionData *mcd = new LLMeanCollisionData(gAgentID, perp, time, type, mag); gMeanCollisionList.push_front(mcd); const BOOL is_group = FALSE; - gCacheName->get(perp, is_group, mean_name_callback); + gCacheName->get(perp, is_group, &mean_name_callback); } } } @@ -4480,7 +4529,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp // located in [REGIONNAME] at [REGIONPOS], // has been <granted|denied> permission to: [PERMISSIONS]." - LLUIString notice(LLFloaterChat::getInstance()->getString(granted ? "ScriptQuestionCautionChatGranted" : "ScriptQuestionCautionChatDenied")); + LLUIString notice(LLTrans::getString(granted ? "ScriptQuestionCautionChatGranted" : "ScriptQuestionCautionChatDenied")); // always include the object name and owner name notice.setArg("[OBJECTNAME]", notification["payload"]["object_name"].asString()); @@ -4534,7 +4583,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp perms.append(", "); } - perms.append(LLFloaterChat::getInstance()->getString(SCRIPT_QUESTIONS[i])); + perms.append(LLTrans::getString(SCRIPT_QUESTIONS[i])); } } @@ -4628,7 +4677,7 @@ static LLNotificationFunctorRegistration script_question_cb_reg_2("ScriptQuestio void process_script_question(LLMessageSystem *msg, void **user_data) { - // *TODO:translate owner name -> [FIRST] [LAST] + // *TODO: Translate owner name -> [FIRST] [LAST] LLHost sender = msg->getSender(); @@ -4696,7 +4745,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) if (questions & LSCRIPTRunTimePermissionBits[i]) { count++; - script_question += " " + LLFloaterChat::getInstance()->getString(SCRIPT_QUESTIONS[i]) + "\n"; + script_question += " " + LLTrans::getString(SCRIPT_QUESTIONS[i]) + "\n"; // check whether permission question should cause special caution dialog caution |= (SCRIPT_QUESTION_IS_CAUTION[i]); @@ -4752,7 +4801,7 @@ void container_inventory_arrived(LLViewerObject* object, LLUUID cat_id; cat_id = gInventory.createNewCategory(gAgent.getInventoryRootID(), LLAssetType::AT_NONE, - std::string("Acquired Items")); //TODO: Translate + LLTrans::getString("AcquiredItems")); InventoryObjectList::const_iterator it = inventory->begin(); InventoryObjectList::const_iterator end = inventory->end(); @@ -4846,10 +4895,18 @@ void container_inventory_arrived(LLViewerObject* object, // method to format the time. std::string formatted_time(const time_t& the_time) { - char buffer[30]; /* Flawfinder: ignore */ - LLStringUtil::copy(buffer, ctime(&the_time), 30); - buffer[24] = '\0'; - return std::string(buffer); + std::string dateStr = "["+LLTrans::getString("LTimeWeek")+"] [" + +LLTrans::getString("LTimeMonth")+"] [" + +LLTrans::getString("LTimeDay")+"] [" + +LLTrans::getString("LTimeHour")+"]:[" + +LLTrans::getString("LTimeMin")+"]:[" + +LLTrans::getString("LTimeSec")+"] [" + +LLTrans::getString("LTimeYear")+"]"; + + LLSD substitution; + substitution["datetime"] = (S32) the_time; + LLStringUtil::format (dateStr, substitution); + return dateStr; } @@ -4860,7 +4917,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**) LLSD args; // if we have additional alert data - if (msg->getNumberOfBlocksFast(_PREHASH_AlertInfo) > 0) + if (msg->has(_PREHASH_AlertInfo) && msg->getSizeFast(_PREHASH_AlertInfo, _PREHASH_Message) > 0) { // Get the message ID msg->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, reason); @@ -4917,6 +4974,9 @@ void process_teleport_failed(LLMessageSystem *msg, void**) LLNotifications::instance().add("CouldNotTeleportReason", args); + // Let the interested parties know that teleport failed. + LLViewerParcelMgr::getInstance()->onTeleportFailed(); + if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) { gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); @@ -4946,6 +5006,9 @@ void process_teleport_local(LLMessageSystem *msg,void**) gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); } + // Let the interested parties know we've teleported. + LLViewerParcelMgr::getInstance()->onTeleportFinished(); + // Sim tells us whether the new position is off the ground if (teleport_flags & TELEPORT_FLAGS_IS_FLYING) { @@ -5073,13 +5136,13 @@ void handle_lure(const LLUUID& invitee) } // Prompt for a message to the invited user. -void handle_lure(LLDynamicArray<LLUUID>& ids) +void handle_lure(const std::vector<LLUUID>& ids) { LLSD edit_args; edit_args["REGION"] = gAgent.getRegion()->getName(); LLSD payload; - for (LLDynamicArray<LLUUID>::iterator it = ids.begin(); + for (LLDynamicArray<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it) { @@ -5298,7 +5361,7 @@ static LLNotificationFunctorRegistration callback_load_url_reg("LoadWebPage", ca // We've got the name of the person who owns the object hurling the url. // Display confirmation dialog. -void callback_load_url_name(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data) +void callback_load_url_name(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) { std::vector<LLSD>::iterator it; for (it = gLoadUrlList.begin(); it != gLoadUrlList.end(); ) @@ -5311,7 +5374,7 @@ void callback_load_url_name(const LLUUID& id, const std::string& first, const st std::string owner_name; if (is_group) { - owner_name = first + " (group)"; + owner_name = first + LLTrans::getString("Group"); } else { @@ -5375,7 +5438,7 @@ void process_load_url(LLMessageSystem* msg, void**) // Add to list of pending name lookups gLoadUrlList.push_back(payload); - gCacheName->get(owner_id, owner_is_group, callback_load_url_name); + gCacheName->get(owner_id, owner_is_group, &callback_load_url_name); } @@ -5431,12 +5494,13 @@ void process_script_teleport_request(LLMessageSystem* msg, void**) msg->getVector3("Data", "SimPosition", pos); msg->getVector3("Data", "LookAt", look_at); - gFloaterWorldMap->trackURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]); - LLFloaterWorldMap::show(NULL, TRUE); + LLFloaterWorldMap::getInstance()->trackURL( + sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]); + LLFloaterReg::showInstance("world_map", "center"); // remove above two lines and replace with below line // to re-enable parcel browser for llMapDestination() - // LLURLDispatcher::dispatch(LLURLDispatcher::buildSLURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]), FALSE); + // LLURLDispatcher::dispatch(LLSLURL::buildSLURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]), FALSE); } @@ -5458,18 +5522,28 @@ void process_covenant_reply(LLMessageSystem* msg, void**) std::string last_modified; if (covenant_timestamp == 0) { - last_modified = LLTrans::getString("covenant_never_modified"); + last_modified = LLTrans::getString("covenant_last_modified")+LLTrans::getString("never_text"); } else { - last_modified = LLTrans::getString("covenant_modified") + " " + formatted_time((time_t)covenant_timestamp); + last_modified = LLTrans::getString("covenant_last_modified")+"[" + +LLTrans::getString("LTimeWeek")+"] [" + +LLTrans::getString("LTimeMonth")+"] [" + +LLTrans::getString("LTimeDay")+"] [" + +LLTrans::getString("LTimeHour")+"]:[" + +LLTrans::getString("LTimeMin")+"]:[" + +LLTrans::getString("LTimeSec")+"] [" + +LLTrans::getString("LTimeYear")+"]"; + LLSD substitution; + substitution["datetime"] = (S32) covenant_timestamp; + LLStringUtil::format (last_modified, substitution); } LLPanelEstateCovenant::updateLastModified(last_modified); LLPanelLandCovenant::updateLastModified(last_modified); LLFloaterBuyLand::updateLastModified(last_modified); - gCacheName->getName(estate_owner_id, callbackCacheEstateOwnerName); + gCacheName->get(estate_owner_id, false, &callbackCacheEstateOwnerName); // load the actual covenant asset data const BOOL high_priority = TRUE; @@ -5491,11 +5565,11 @@ void process_covenant_reply(LLMessageSystem* msg, void**) if (estate_owner_id.isNull()) { // mainland - covenant_text = "There is no Covenant provided for this Estate."; + covenant_text = LLTrans::getString("RegionNoCovenant"); } else { - covenant_text = "There is no Covenant provided for this Estate. The land on this estate is being sold by the Estate owner, not Linden Lab. Please contact the Estate Owner for sales details."; + covenant_text = LLTrans::getString("RegionNoCovenantOtherOwner"); } LLPanelEstateCovenant::updateCovenantText(covenant_text, covenant_id); LLPanelLandCovenant::updateCovenantText(covenant_text); @@ -5505,13 +5579,13 @@ void process_covenant_reply(LLMessageSystem* msg, void**) void callbackCacheEstateOwnerName(const LLUUID& id, const std::string& first, const std::string& last, - BOOL is_group, void*) + BOOL is_group) { std::string name; if (id.isNull()) { - name = "(none)"; + name = LLTrans::getString("none_text"); } else { @@ -5542,10 +5616,10 @@ void onCovenantLoadComplete(LLVFS *vfs, if( (file_length > 19) && !strncmp( &buffer[0], "Linden text version", 19 ) ) { - LLViewerTextEditor* editor = - new LLViewerTextEditor(std::string("temp"), - LLRect(0,0,0,0), - file_length+1); + LLViewerTextEditor::Params params; + params.name("temp"); + params.max_text_length(file_length+1); + LLViewerTextEditor * editor = LLUICtrlFactory::create<LLViewerTextEditor> (params); if( !editor->importBuffer( &buffer[0], file_length+1 ) ) { LL_WARNS("Messaging") << "Problem importing estate covenant." << LL_ENDL; @@ -5620,6 +5694,6 @@ void invalid_message_callback(LLMessageSystem* msg, void LLOfferInfo::forceResponse(InventoryOfferResponse response) { LLNotification::Params params("UserGiveItem"); - params.functor(boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2)); + params.functor.function(boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2)); LLNotifications::instance().forceResponse(params, response); } diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index e7a4303a8eaace6b3f8e74cb2c05c593d5a37cf7..90a54e2b9cf3c830b80c5821fc3b19b8025d9f96 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -130,6 +130,7 @@ void container_inventory_arrived(LLViewerObject* object, // agent movement void send_complete_agent_movement(const LLHost& sim_host); void process_agent_movement_complete(LLMessageSystem* msg, void**); +bool server_version_changed_callback(const LLSD& notification, const LLSD& response); void process_crossed_region(LLMessageSystem* msg, void**); void process_teleport_start(LLMessageSystem* msg, void**); void process_teleport_progress(LLMessageSystem* msg, void**); @@ -151,7 +152,7 @@ void send_group_notice(const LLUUID& group_id, const LLInventoryItem* item); void handle_lure(const LLUUID& invitee); -void handle_lure(LLDynamicArray<LLUUID>& ids); +void handle_lure(const std::vector<LLUUID>& ids); // always from gAgent and // routes through the gAgent's current simulator diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 8719557cbc8126d8ed7c16cd399e332adc355c6e..918b15ef09dc5a211b4ecb64c42bc16ebe740e0e 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -218,7 +218,7 @@ void LLViewerLogin::setGridChoice(const std::string& grid_name) void LLViewerLogin::resetURIs() { // Clear URIs when picking a new server - gSavedSettings.setValue("CmdLineLoginURI", LLSD::emptyArray()); + gSavedSettings.setLLSD("CmdLineLoginURI", LLSD::emptyArray()); gSavedSettings.setString("CmdLineHelperURI", ""); } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index d4e594656be0b919d225b39050cc56b0103e1ef6..dc4f2b2990e917f033d30bd09390b9e82102d0b2 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -79,6 +79,7 @@ #include "llviewertextureanim.h" #include "llviewerwindow.h" // For getSpinAxis #include "llvoavatar.h" +#include "llvoavatarself.h" #include "llvoclouds.h" #include "llvograss.h" #include "llvoground.h" @@ -97,6 +98,7 @@ #include "llviewernetwork.h" #include "llvowlsky.h" #include "llmanip.h" +#include "lltrans.h" //#define DEBUG_UPDATE_TYPE @@ -123,7 +125,18 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco case LL_PCODE_VOLUME: res = new LLVOVolume(id, pcode, regionp); break; case LL_PCODE_LEGACY_AVATAR: - res = new LLVOAvatar(id, pcode, regionp); break; + { + if (id == gAgentID) + { + res = new LLVOAvatarSelf(id, pcode, regionp); + } + else + { + res = new LLVOAvatar(id, pcode, regionp); + } + static_cast<LLVOAvatar*>(res)->initInstance(); + break; + } case LL_PCODE_LEGACY_GRASS: res = new LLVOGrass(id, pcode, regionp); break; case LL_PCODE_LEGACY_PART_SYS: @@ -2461,7 +2474,7 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data) LLPointer<LLInventoryObject> obj; obj = new LLInventoryObject(object->mID, LLUUID::null, LLAssetType::AT_CATEGORY, - std::string("Contents")); + LLTrans::getString("ViewerObjectContents").c_str()); object->mInventory->push_front(obj); object->doInventoryCallback(); delete ft; @@ -2528,6 +2541,7 @@ void LLViewerObject::loadTaskInvFile(const std::string& filename) { LLPointer<LLInventoryObject> inv = new LLInventoryObject; inv->importLegacyStream(ifs); + inv->rename(LLTrans::getString("ViewerObjectContents").c_str()); mInventory->push_front(inv); } else @@ -2587,11 +2601,6 @@ void LLViewerObject::removeInventory(const LLUUID& item_id) msg->sendReliable(mRegionp->getHost()); deleteInventoryItem(item_id); ++mInventorySerialNum; - - // The viewer object should not refresh UI since this is a utility - // function. The UI functionality that called this method should - // refresh the views if necessary. - //gBuildView->refresh(); } void LLViewerObject::updateInventory( @@ -2748,7 +2757,7 @@ void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent) F32 mid_scale = getMidScale(); F32 min_scale = getMinScale(); - // IW: esitmate - when close to large objects, computing range based on distance from center is no good + // IW: estimate - when close to large objects, computing range based on distance from center is no good // to try to get a min distance from face, subtract min_scale/2 from the range. // This means we'll load too much detail sometimes, but that's better than not enough // I don't think there's a better way to do this without calculating distance per-poly @@ -3733,7 +3742,6 @@ S32 LLViewerObject::setTEColor(const U8 te, const LLColor4& color) else if (color != tep->getColor()) { retval = LLPrimitive::setTEColor(te, color); - //setChanged(TEXTURE); if (mDrawable.notNull() && retval) { // These should only happen on updates which are not the initial update. @@ -3780,6 +3788,22 @@ S32 LLViewerObject::setTETexGen(const U8 te, const U8 texgen) return retval; } +S32 LLViewerObject::setTEMediaTexGen(const U8 te, const U8 media) +{ + S32 retval = 0; + const LLTextureEntry *tep = getTE(te); + if (!tep) + { + llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl; + } + else if (media != tep->getMediaTexGen()) + { + retval = LLPrimitive::setTEMediaTexGen(te, media); + setChanged(TEXTURE); + } + return retval; +} + S32 LLViewerObject::setTEShiny(const U8 te, const U8 shiny) { S32 retval = 0; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 16a3b98d1296069e7937657f769ebf476f06f29e..21a99c58d9e58debd3f8a1e77b16fb6bc50622d5 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -40,7 +40,7 @@ #include "llhudtext.h" #include "llhudicon.h" #include "llinventory.h" -#include "llmemory.h" +#include "llrefcount.h" #include "llmemtype.h" #include "llprimitive.h" #include "lluuid.h" @@ -305,6 +305,7 @@ public: /*virtual*/ S32 setTERotation(const U8 te, const F32 r); /*virtual*/ S32 setTEBumpmap(const U8 te, const U8 bump ); /*virtual*/ S32 setTETexGen(const U8 te, const U8 texgen ); + /*virtual*/ S32 setTEMediaTexGen(const U8 te, const U8 media ); // *FIXME: this confusingly acts upon a superset of setTETexGen's flags without absorbing its semantics /*virtual*/ S32 setTEShiny(const U8 te, const U8 shiny ); /*virtual*/ S32 setTEFullbright(const U8 te, const U8 fullbright ); /*virtual*/ S32 setTEMediaFlags(const U8 te, const U8 media_flags ); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index e0741e72335cc597162f177611c56e9587a02236..8e9c798aca7bb5b989a60f5790cc9eda05fdce5c 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -38,6 +38,7 @@ #include "timing.h" #include "llfasttimer.h" #include "llrender.h" +#include "llwindow.h" // decBusyCount() #include "llviewercontrol.h" #include "llface.h" @@ -60,6 +61,7 @@ #include "llresmgr.h" #include "llviewerregion.h" #include "llviewerstats.h" +#include "llvoavatarself.h" #include "lltoolmgr.h" #include "lltoolpie.h" #include "llkeyboard.h" @@ -210,6 +212,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, LLDataPacker* dpp, BOOL just_created) { + LLMemType mt(LLMemType::MTYPE_OBJECT_PROCESS_UPDATE_CORE); LLMessageSystem* msg = gMessageSystem; // ignore returned flags @@ -251,7 +254,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, objectp->mCreateSelected = false; gViewerWindow->getWindow()->decBusyCount(); - gViewerWindow->getWindow()->setCursor( UI_CURSOR_ARROW ); + gViewerWindow->setCursor( UI_CURSOR_ARROW ); } } @@ -260,6 +263,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, const EObjectUpdateType update_type, bool cached, bool compressed) { + LLMemType mt(LLMemType::MTYPE_OBJECT_PROCESS_UPDATE); LLFastTimer t(LLFastTimer::FTM_PROCESS_OBJECTS); LLVector3d camera_global = gAgent.getCameraPositionGlobal(); @@ -768,10 +772,10 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) } */ - mNumObjectsStat.addValue(mObjects.count()); - mNumActiveObjectsStat.addValue(num_active_objects); - mNumSizeCulledStat.addValue(mNumSizeCulled); - mNumVisCulledStat.addValue(mNumVisCulled); + LLViewerStats::getInstance()->mNumObjectsStat.addValue(mObjects.count()); + LLViewerStats::getInstance()->mNumActiveObjectsStat.addValue(num_active_objects); + LLViewerStats::getInstance()->mNumSizeCulledStat.addValue(mNumSizeCulled); + LLViewerStats::getInstance()->mNumVisCulledStat.addValue(mNumVisCulled); } void LLViewerObjectList::clearDebugText() @@ -1016,16 +1020,16 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset) void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) { - LLColor4 above_water_color = gColors.getColor( "NetMapOtherOwnAboveWater" ); - LLColor4 below_water_color = gColors.getColor( "NetMapOtherOwnBelowWater" ); + LLColor4 above_water_color = gSavedSkinSettings.getColor( "NetMapOtherOwnAboveWater" ); + LLColor4 below_water_color = gSavedSkinSettings.getColor( "NetMapOtherOwnBelowWater" ); LLColor4 you_own_above_water_color = - gColors.getColor( "NetMapYouOwnAboveWater" ); + gSavedSkinSettings.getColor( "NetMapYouOwnAboveWater" ); LLColor4 you_own_below_water_color = - gColors.getColor( "NetMapYouOwnBelowWater" ); + gSavedSkinSettings.getColor( "NetMapYouOwnBelowWater" ); LLColor4 group_own_above_water_color = - gColors.getColor( "NetMapGroupOwnAboveWater" ); + gSavedSkinSettings.getColor( "NetMapGroupOwnAboveWater" ); LLColor4 group_own_below_water_color = - gColors.getColor( "NetMapGroupOwnBelowWater" ); + gSavedSkinSettings.getColor( "NetMapGroupOwnBelowWater" ); for (S32 i = 0; i < mMapObjects.count(); i++) diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index ba31f70c3d2ca926322b5944f01d5b69d08ac27c..0f906a4d7f9c125f494e42a7ada2aaf037c5cfbf 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -150,19 +150,8 @@ public: U32 mCurBin; // Current bin we're working on... - ////////////////////// - // - // Statistics data - // - // - LLStat mNumObjectsStat; - LLStat mNumActiveObjectsStat; - LLStat mNumNewObjectsStat; - LLStat mNumSizeCulledStat; - LLStat mNumVisCulledStat; - + // Statistics data (see also LLViewerStats) S32 mNumNewObjects; - S32 mNumSizeCulled; S32 mNumVisCulled; diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index b98f418d49124a53fff60e6127925ef4268ee25e..08e03c97f26498000bd48893578f5b5726faaa20 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -166,7 +166,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel) } // First use warning - if( gSavedSettings.getWarning("FirstStreamingVideo") ) + if( gWarningSettings.getBOOL("FirstStreamingVideo") ) { LLNotifications::instance().add("ParcelCanPlayMedia", LLSD(), LLSD(), boost::bind(callback_play_media, _1, _2, parcel)); @@ -189,9 +189,9 @@ void LLViewerParcelMedia::update(LLParcel* parcel) std::string mediaUrl = std::string ( parcel->getMediaURL () ); if (!mediaUrl.empty ()) { - if (gSavedSettings.getWarning("QuickTimeInstalled")) + if (gWarningSettings.getBOOL("QuickTimeInstalled")) { - gSavedSettings.setWarning("QuickTimeInstalled", FALSE); + gWarningSettings.setBOOL("QuickTimeInstalled", FALSE); LLNotifications::instance().add("NoQuickTime" ); }; @@ -395,7 +395,7 @@ bool callback_play_media(const LLSD& notification, const LLSD& response, LLParce { gSavedSettings.setBOOL("AudioStreamingVideo", FALSE); } - gSavedSettings.setWarning("FirstStreamingVideo", FALSE); + gWarningSettings.setBOOL("FirstStreamingVideo", FALSE); return false; } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 193dfaae96e7b3bdc21c2856089a7ecba5f3a801..8aa1663bc1149f6bbadea266fdd4c58ae3f8e8ac 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -155,6 +155,8 @@ LLViewerParcelMgr::LLViewerParcelMgr() { mAgentParcelOverlay[i] = 0; } + + mTeleportInProgress = TRUE; // the initial parcel update is treated like teleport } @@ -646,7 +648,7 @@ LLParcel *LLViewerParcelMgr::getAgentParcel() const } // Return whether the agent can build on the land they are on -BOOL LLViewerParcelMgr::agentCanBuild() const +bool LLViewerParcelMgr::agentCanBuild() const { if (mAgentParcel) { @@ -938,7 +940,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id) payload["parcel_local_id"] = mCurrentParcel->getLocalID(); payload["region_host"] = region->getHost().getIPandPort(); LLNotification::Params params("ForceOwnerAuctionWarning"); - params.payload(payload).functor(callback_god_force_owner); + params.payload(payload).functor.function(callback_god_force_owner); if(mCurrentParcel->getAuctionID()) { @@ -1513,6 +1515,17 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use LLViewerParcelMgr::getInstance()->writeAgentParcelFromBitmap(bitmap); delete[] bitmap; + + // Let interesting parties know about agent parcel change. + LLViewerParcelMgr* instance = LLViewerParcelMgr::getInstance(); + + instance->mAgentParcelChangedSignal(); + + if (instance->mTeleportInProgress) + { + instance->mTeleportInProgress = FALSE; + instance->mTeleportFinishedSignal(); + } } } @@ -2378,3 +2391,34 @@ LLViewerImage* LLViewerParcelMgr::getPassImage() const { return sPassImage; } + +boost::signals::connection LLViewerParcelMgr::setAgentParcelChangedCallback(parcel_changed_callback_t cb) +{ + return mAgentParcelChangedSignal.connect(cb); +} + +boost::signals::connection LLViewerParcelMgr::setTeleportFinishedCallback(parcel_changed_callback_t cb) +{ + return mTeleportFinishedSignal.connect(cb); +} + +boost::signals::connection LLViewerParcelMgr::setTeleportFailedCallback(parcel_changed_callback_t cb) +{ + return mTeleportFailedSignal.connect(cb); +} + +/* Ok, we're notified that teleport has been finished. + * We should now propagate the notification via mTeleportFinishedSignal + * to all interested parties. + * However the agent parcel data has not been updated yet. + * Let's wait for the update and then emit the signal. + */ +void LLViewerParcelMgr::onTeleportFinished() +{ + mTeleportInProgress = TRUE; +} + +void LLViewerParcelMgr::onTeleportFailed() +{ + mTeleportFailedSignal(); +} diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 9f762a186c8e1d39a8f7bc02052017f4f0a66287..4bed1c04862c9a6c593c1f3cbed4c67ce6cfa347 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -36,10 +36,14 @@ #include "v3dmath.h" #include "lldarray.h" #include "llframetimer.h" -#include "llmemory.h" +#include "llsingleton.h" #include "llparcelselection.h" #include "llui.h" +#include <boost/function.hpp> +#include <boost/signal.hpp> +#include <boost/signals/connection.hpp> + class LLUUID; class LLMessageSystem; class LLParcel; @@ -79,6 +83,9 @@ class LLViewerParcelMgr : public LLSingleton<LLViewerParcelMgr> { public: + typedef boost::function<void()> parcel_changed_callback_t; + typedef boost::signal <void()> parcel_changed_signal_t; + LLViewerParcelMgr(); ~LLViewerParcelMgr(); @@ -163,7 +170,7 @@ public: BOOL agentCanTakeDamage() const; BOOL agentCanFly() const; F32 agentDrawDistance() const; - BOOL agentCanBuild() const; + bool agentCanBuild() const; F32 getHoverParcelWidth() const { return F32(mHoverEastNorth.mdV[VX] - mHoverWestSouth.mdV[VX]); } @@ -256,6 +263,12 @@ public: // the agent is banned or not in the allowed group BOOL isCollisionBanned(); + boost::signals::connection setAgentParcelChangedCallback(parcel_changed_callback_t cb); + boost::signals::connection setTeleportFinishedCallback(parcel_changed_callback_t cb); + boost::signals::connection setTeleportFailedCallback(parcel_changed_callback_t cb); + void onTeleportFinished(); + void onTeleportFailed(); + static BOOL isParcelOwnedByAgent(const LLParcel* parcelp, U64 group_proxy_power); static BOOL isParcelModifiableByAgent(const LLParcel* parcelp, U64 group_proxy_power); @@ -303,6 +316,11 @@ private: LLDynamicArray<LLParcelObserver*> mObservers; + BOOL mTeleportInProgress; + parcel_changed_signal_t mTeleportFinishedSignal; + parcel_changed_signal_t mTeleportFailedSignal; + parcel_changed_signal_t mAgentParcelChangedSignal; + // Array of pieces of parcel edges to potentially draw // Has (parcels_per_edge + 1) * (parcels_per_edge + 1) elements so // we can represent edges of the grid. diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 866c2a91ebb5f76e757cd61d7acd976a8c4e674f..5b60ed5a2725bbe72937aa16613e3d1ca1feac0d 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -36,6 +36,7 @@ // indra includes #include "llparcel.h" +#include "llfloaterreg.h" #include "llgl.h" #include "llrender.h" #include "v4color.h" @@ -205,13 +206,12 @@ void LLViewerParcelOverlay::updateOverlayTexture() { return; } - // Can do this because gColors are actually stored as LLColor4U - const LLColor4U avail = gColors.getColor4U("PropertyColorAvail"); - const LLColor4U owned = gColors.getColor4U("PropertyColorOther"); - const LLColor4U group = gColors.getColor4U("PropertyColorGroup"); - const LLColor4U self = gColors.getColor4U("PropertyColorSelf"); - const LLColor4U for_sale = gColors.getColor4U("PropertyColorForSale"); - const LLColor4U auction = gColors.getColor4U("PropertyColorAuction"); + const LLColor4U avail = gSavedSkinSettings.getColor4("PropertyColorAvail"); + const LLColor4U owned = gSavedSkinSettings.getColor4("PropertyColorOther"); + const LLColor4U group = gSavedSkinSettings.getColor4("PropertyColorGroup"); + const LLColor4U self = gSavedSkinSettings.getColor4("PropertyColorSelf"); + const LLColor4U for_sale = gSavedSkinSettings.getColor4("PropertyColorForSale"); + const LLColor4U auction = gSavedSkinSettings.getColor4("PropertyColorAuction"); // Create the base texture. U8 *raw = mImageRaw->getData(); @@ -224,7 +224,7 @@ void LLViewerParcelOverlay::updateOverlayTexture() { U8 ownership = mOwnership[i]; - U8 r,g,b,a; + F32 r,g,b,a; // Color stored in low three bits switch( ownership & 0x7 ) @@ -273,10 +273,10 @@ void LLViewerParcelOverlay::updateOverlayTexture() break; } - raw[pixel_index + 0] = r; - raw[pixel_index + 1] = g; - raw[pixel_index + 2] = b; - raw[pixel_index + 3] = a; + raw[pixel_index + 0] = (U8)r; + raw[pixel_index + 1] = (U8)g; + raw[pixel_index + 2] = (U8)b; + raw[pixel_index + 3] = (U8)a; pixel_index += OVERLAY_IMG_COMPONENTS; } @@ -314,12 +314,11 @@ void LLViewerParcelOverlay::updatePropertyLines() S32 row, col; - // Can do this because gColors are actually stored as LLColor4U - const LLColor4U self_coloru = gColors.getColor4U("PropertyColorSelf"); - const LLColor4U other_coloru = gColors.getColor4U("PropertyColorOther"); - const LLColor4U group_coloru = gColors.getColor4U("PropertyColorGroup"); - const LLColor4U for_sale_coloru = gColors.getColor4U("PropertyColorForSale"); - const LLColor4U auction_coloru = gColors.getColor4U("PropertyColorAuction"); + const LLColor4U self_coloru = gSavedSkinSettings.getColor4("PropertyColorSelf"); + const LLColor4U other_coloru = gSavedSkinSettings.getColor4("PropertyColorOther"); + const LLColor4U group_coloru = gSavedSkinSettings.getColor4("PropertyColorGroup"); + const LLColor4U for_sale_coloru = gSavedSkinSettings.getColor4("PropertyColorForSale"); + const LLColor4U auction_coloru = gSavedSkinSettings.getColor4("PropertyColorAuction"); // Build into dynamic arrays, then copy into static arrays. LLDynamicArray<LLVector3, 256> new_vertex_array; @@ -713,6 +712,7 @@ void LLViewerParcelOverlay::setDirty() void LLViewerParcelOverlay::idleUpdate(bool force_update) { + LLMemType mt_iup(LLMemType::MTYPE_IDLE_UPDATE_PARCEL_OVERLAY); if (gGLManager.mIsDisabled) { return; @@ -841,8 +841,8 @@ S32 LLViewerParcelOverlay::renderPropertyLines () drawn += vertex_per_edge; gGL.end(); - - if (LLSelectMgr::sRenderHiddenSelections && gFloaterTools && gFloaterTools->getVisible()) + + if (LLSelectMgr::sRenderHiddenSelections && LLFloaterReg::instanceVisible("build")) { LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER); diff --git a/indra/newview/llviewerpartsim.h b/indra/newview/llviewerpartsim.h index 21bc37f891012b3a50d65832de4f592ec082a80e..208675e7bf1407b9ce205c04c28826f741978e80 100644 --- a/indra/newview/llviewerpartsim.h +++ b/indra/newview/llviewerpartsim.h @@ -35,7 +35,7 @@ #include "lldarrayptr.h" #include "llframetimer.h" -#include "llmemory.h" +#include "llpointer.h" #include "llpartdata.h" #include "llviewerpartsource.h" diff --git a/indra/newview/llviewerpartsource.h b/indra/newview/llviewerpartsource.h index 4258b9170f2cd269673794e227d69cab956c8cca..31e671af3af58452ea019440f59ec13be2ac5721 100644 --- a/indra/newview/llviewerpartsource.h +++ b/indra/newview/llviewerpartsource.h @@ -33,8 +33,9 @@ #ifndef LL_LLVIEWERPARTSOURCE_H #define LL_LLVIEWERPARTSOURCE_H -#include "llmemory.h" +#include "llrefcount.h" #include "llpartdata.h" +#include "llpointer.h" #include "llquaternion.h" #include "v3math.h" diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index 49319b13b1ed8f3d908e84685f0267e99756e234..02963273787fdd2e4fec7d2bfff4db7f39324c52 100644 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -69,18 +69,20 @@ // Library headers from llcommon project: #include "bitpack.h" +#include "lldeleteutils.h" #include "imageids.h" #include "indra_constants.h" //#include "linden_common.h" //#include "llpreprocessor.h" +#include "llallocator.h" #include "llapp.h" #include "llapr.h" #include "llcriticaldamp.h" -#include "lldarray.h" -#include "lldarrayptr.h" +//#include "lldarray.h" +//#include "lldarrayptr.h" #include "lldefs.h" #include "lldepthstack.h" -#include "lldqueueptr.h" +//#include "lldqueueptr.h" #include "llendianswizzle.h" #include "llerror.h" #include "llfasttimer.h" @@ -89,11 +91,16 @@ #include "llhash.h" #include "lllocalidhashmap.h" #include "llmap.h" -#include "llmemory.h" +//#include "llmemory.h" #include "llnametable.h" +#include "llpointer.h" #include "llpriqueuemap.h" #include "llprocessor.h" +#include "llrefcount.h" +#include "llsafehandle.h" //#include "llsecondlifeurls.h" +#include "llsd.h" +#include "llsingleton.h" #include "llstack.h" #include "llstat.h" #include "llstl.h" @@ -114,20 +121,13 @@ #include "u64.h" // Library includes from llimage -//#include "kdc_flow_control.h" -//#include "kde_flow_control.h" -//#include "kdu_image.h" -//#include "kdu_image_local.h" //#include "llblockdata.h" -//#include "llblockdecoder.h" -//#include "llblockencoder.h" #include "llimage.h" #include "llimagebmp.h" #include "llimagepng.h" #include "llimagej2c.h" #include "llimagejpeg.h" #include "llimagetga.h" -//#include "llkdumem.h" #include "llmapimagetype.h" // Library includes from llmath project @@ -220,9 +220,6 @@ #include "llvolumemgr.h" #include "material_codes.h" -// Library includes from llxml -#include "llxmlnode.h" - // Library includes from llvfs #include "llassettype.h" #include "lldir.h" @@ -232,4 +229,8 @@ #include "llvfile.h" #include "llvfs.h" +// Library includes from llui +// In skinning-7, llui.h dependencies are changing too often. +//#include "llui.h" + #endif diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index d4ee7a7e5049974818f3b9626e118c35d2de18a6..fd3dc1674518d4c3ad7cb6f9c3e8da15995c4183 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -35,6 +35,7 @@ #include "llviewerregion.h" #include "indra_constants.h" +#include "llfloaterreg.h" #include "llmath.h" #include "llhttpclient.h" #include "llregionflags.h" @@ -638,6 +639,7 @@ void LLViewerRegion::dirtyHeights() BOOL LLViewerRegion::idleUpdate(F32 max_update_time) { + LLMemType mt_ivr(LLMemType::MTYPE_IDLE_UPDATE_VIEWER_REGION); // did_update returns TRUE if we did at least one significant update BOOL did_update = mLandp->idleUpdate(max_update_time); @@ -779,11 +781,6 @@ void LLViewerRegion::calculateCameraDistance() mCameraDistanceSquared = (F32)(gAgent.getCameraPositionGlobal() - getCenterGlobal()).magVecSquared(); } -U32 LLViewerRegion::getNetDetailsForLCD() -{ - return mPingDelay; -} - std::ostream& operator<<(std::ostream &s, const LLViewerRegion ®ion) { s << "{ "; diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 4d345c811aa850a36d9627fed8421faa2c29bd5f..35f374a4c8f4d777948e76a52bbb7072b0b1e800 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -288,9 +288,6 @@ public: /// implements LLCapabilityProvider virtual std::string getDescription() const; - // used by LCD to get details for debug screen - U32 getNetDetailsForLCD(); - LLSpatialPartition* getSpatialPartition(U32 type); public: struct CompareDistance diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 648fbd4714a66e5a9f14baa6ef883e8016fd87bf..c79ded1dced0e7c8ec008973a9c2a18f16396732 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -36,6 +36,8 @@ #include "llviewerthrottle.h" #include "message.h" +#include "llfloaterreg.h" +#include "llmemory.h" #include "lltimer.h" #include "llappviewer.h" @@ -45,6 +47,7 @@ #include "llviewerobjectlist.h" #include "llviewerimagelist.h" #include "lltexlayer.h" +#include "lltexlayerparams.h" #include "llsurface.h" #include "llvlmanager.h" #include "llagent.h" @@ -55,14 +58,12 @@ #include "llfasttimerview.h" #include "llviewerregion.h" #include "llvoavatar.h" +#include "llvoavatarself.h" #include "llfloaterhtml.h" #include "llviewerwindow.h" // *TODO: remove, only used for width/height #include "llworld.h" #include "llfeaturemanager.h" #include "llviewernetwork.h" -#if LL_LCD_COMPILE -#include "lllcd.h" -#endif class StatAttributes @@ -199,16 +200,76 @@ const StatAttributes STAT_INFO[LLViewerStats::ST_COUNT] = // ST_TEX_BAKES StatAttributes("Texture Bakes", FALSE, FALSE), // ST_TEX_REBAKES - StatAttributes("Texture Rebakes", FALSE, FALSE), - - // ST_LOGITECH_KEYBOARD - StatAttributes("Logitech LCD", FALSE, FALSE) + StatAttributes("Texture Rebakes", FALSE, FALSE) }; -LLViewerStats::LLViewerStats() - : mPacketsLostPercentStat(64), - mLastTimeDiff(0.0) +LLViewerStats::LLViewerStats() : + mKBitStat("kbitstat"), + mLayersKBitStat("layerskbitstat"), + mObjectKBitStat("objectkbitstat"), + mAssetKBitStat("assetkbitstat"), + mTextureKBitStat("texturekbitstat"), + mVFSPendingOperations("vfspendingoperations"), + mObjectsDrawnStat("objectsdrawnstat"), + mObjectsCulledStat("objectsculledstat"), + mObjectsTestedStat("objectstestedstat"), + mObjectsComparedStat("objectscomparedstat"), + mObjectsOccludedStat("objectsoccludedstat"), + mFPSStat("fpsstat"), + mPacketsInStat("packetsinstat"), + mPacketsLostStat("packetsloststat"), + mPacketsOutStat("packetsoutstat"), + mPacketsLostPercentStat("packetslostpercentstat", 64), + mTexturePacketsStat("texturepacketsstat"), + mActualInKBitStat("actualinkbitstat"), + mActualOutKBitStat("actualoutkbitstat"), + mTrianglesDrawnStat("trianglesdrawnstat"), + mSimTimeDilation("simtimedilation"), + mSimFPS("simfps"), + mSimPhysicsFPS("simphysicsfps"), + mSimAgentUPS("simagentups"), + mSimScriptEPS("simscripteps"), + mSimFrameMsec("simframemsec"), + mSimNetMsec("simnetmsec"), + mSimSimOtherMsec("simsimothermsec"), + mSimSimPhysicsMsec("simsimphysicsmsec"), + mSimSimPhysicsStepMsec("simsimphysicsstepmsec"), + mSimSimPhysicsShapeUpdateMsec("simsimphysicsshapeupdatemsec"), + mSimSimPhysicsOtherMsec("simsimphysicsothermsec"), + mSimAgentMsec("simagentmsec"), + mSimImagesMsec("simimagesmsec"), + mSimScriptMsec("simscriptmsec"), + mSimSpareMsec("simsparemsec"), + mSimSleepMsec("simsleepmsec"), + mSimPumpIOMsec("simpumpiomsec"), + mSimMainAgents("simmainagents"), + mSimChildAgents("simchildagents"), + mSimObjects("simobjects"), + mSimActiveObjects("simactiveobjects"), + mSimActiveScripts("simactivescripts"), + mSimInPPS("siminpps"), + mSimOutPPS("simoutpps"), + mSimPendingDownloads("simpendingdownloads"), + mSimPendingUploads("simpendinguploads"), + mSimPendingLocalUploads("simpendinglocaluploads"), + mSimTotalUnackedBytes("simtotalunackedbytes"), + mPhysicsPinnedTasks("physicspinnedtasks"), + mPhysicsLODTasks("physicslodtasks"), + mPhysicsMemoryAllocated("physicsmemoryallocated"), + mSimPingStat("simpingstat"), + mNumImagesStat("numimagesstat", 32, TRUE), + mNumRawImagesStat("numrawimagesstat", 32, TRUE), + mGLTexMemStat("gltexmemstat", 32, TRUE), + mGLBoundMemStat("glboundmemstat", 32, TRUE), + mRawMemStat("rawmemstat", 32, TRUE), + mFormattedMemStat("formattedmemstat", 32, TRUE), + mNumObjectsStat("numobjectsstat"), + mNumActiveObjectsStat("numactiveobjectsstat"), + mNumNewObjectsStat("numnewobjectsstat"), + mNumSizeCulledStat("numsizeculledstat"), + mNumVisCulledStat("numvisculledstat"), + mLastTimeDiff(0.0) { for (S32 i = 0; i < ST_COUNT; i++) { @@ -353,7 +414,6 @@ void reset_statistics() { if (LLSurface::sTextureUpdateTime) { - LLSurface::sTexelsUpdatedPerSecStat.addValue(0.001f*(LLSurface::sTexelsUpdated / LLSurface::sTextureUpdateTime)); LLSurface::sTexelsUpdated = 0; LLSurface::sTextureUpdateTime = 0.f; } @@ -365,8 +425,8 @@ void output_statistics(void*) llinfos << "Number of orphans: " << gObjectList.getOrphanCount() << llendl; llinfos << "Number of dead objects: " << gObjectList.mNumDeadObjects << llendl; llinfos << "Num images: " << gImageList.getNumImages() << llendl; - llinfos << "Texture usage: " << LLImageGL::sGlobalTextureMemory << llendl; - llinfos << "Texture working set: " << LLImageGL::sBoundTextureMemory << llendl; + llinfos << "Texture usage: " << LLImageGL::sGlobalTextureMemoryInBytes << llendl; + llinfos << "Texture working set: " << LLImageGL::sBoundTextureMemoryInBytes << llendl; llinfos << "Raw usage: " << LLImageRaw::sGlobalRawMemory << llendl; llinfos << "Formatted usage: " << LLImageFormatted::sGlobalFormattedMemory << llendl; llinfos << "Zombie Viewer Objects: " << LLViewerObject::getNumZombieObjects() << llendl; @@ -449,10 +509,10 @@ void output_statistics(void*) llinfos << "--------------------------------" << llendl; llinfos << "Avatar Memory (partly overlaps with above stats):" << llendl; - gTexStaticImageList.dumpByteCount(); - LLVOAvatar::dumpScratchTextureByteCount(); + LLTexLayerStaticImageList::getInstance()->dumpByteCount(); + LLVOAvatarSelf::dumpScratchTextureByteCount(); LLTexLayerSetBuffer::dumpTotalByteCount(); - LLVOAvatar::dumpTotalLocalTextureByteCount(); + LLVOAvatarSelf::dumpTotalLocalTextureByteCount(); LLTexLayerParamAlpha::dumpCacheByteCount(); LLVOAvatar::dumpBakedStatus(); @@ -507,7 +567,7 @@ void update_statistics(U32 frame_count) { gTotalWorldBytes += gVLManager.getTotalBytes(); gTotalObjectBytes += gObjectBits / 8; - gTotalTextureBytes += LLViewerImageList::sTextureBits / 8; + gTotalTextureBytes += gImageList.mTextureBits / 8; // make sure we have a valid time delta for this frame if (gFrameIntervalSeconds > 0.f) @@ -520,7 +580,7 @@ void update_statistics(U32 frame_count) { LLViewerStats::getInstance()->incStat(LLViewerStats::ST_AVATAR_EDIT_SECONDS, gFrameIntervalSeconds); } - else if (gFloaterTools && gFloaterTools->getVisible()) + else if (LLFloaterReg::instanceVisible("build")) { LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds); } @@ -534,7 +594,7 @@ void update_statistics(U32 frame_count) LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_AVATAR, (F64)gSavedSettings.getBOOL("VertexShaderLevelAvatar")); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_ENVIRONMENT, (F64)gSavedSettings.getBOOL("VertexShaderLevelEnvironment")); #endif - LLViewerStats::getInstance()->setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_FRAME)); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::NamedTimer::getRootNamedTimer().getFrameState())); F64 idle_secs = gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_IDLE); F64 network_secs = gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_NETWORK); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_UPDATE_SECS, idle_secs - network_secs); @@ -559,7 +619,7 @@ void update_statistics(U32 frame_count) F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); LLViewerStats::getInstance()->mLayersKBitStat.addValue(layer_bits/1024.f); LLViewerStats::getInstance()->mObjectKBitStat.addValue(gObjectBits/1024.f); - LLViewerStats::getInstance()->mTextureKBitStat.addValue(LLViewerImageList::sTextureBits/1024.f); + LLViewerStats::getInstance()->mTextureKBitStat.addValue(gImageList.mTextureBits/1024.f); LLViewerStats::getInstance()->mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); LLViewerStats::getInstance()->mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); @@ -573,7 +633,7 @@ void update_statistics(U32 frame_count) gDebugTimers[0].unpause(); } - LLViewerStats::getInstance()->mTexturePacketsStat.addValue(LLViewerImageList::sTexturePackets); + LLViewerStats::getInstance()->mTexturePacketsStat.addValue(gImageList.mTexturePackets); { static F32 visible_avatar_frames = 0.f; @@ -594,15 +654,9 @@ void update_statistics(U32 frame_count) gObjectBits = 0; // gDecodedBits = 0; - LLViewerImageList::sTextureBits = 0; - LLViewerImageList::sTexturePackets = 0; + gImageList.mTextureBits = 0; + gImageList.mTexturePackets = 0; -#if LL_LCD_COMPILE - bool LCDenabled = gLcdScreen->Enabled(); - LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LOGITECH_LCD, LCDenabled); -#else - LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LOGITECH_LCD, false); -#endif } class ViewerStatsResponder : public LLHTTPClient::Responder @@ -692,7 +746,7 @@ void send_stats() agent["ping"] = gAvgSimPing; agent["meters_traveled"] = gAgent.getDistanceTraveled(); agent["regions_visited"] = gAgent.getRegionsVisited(); - agent["mem_use"] = getCurrentRSS() / 1024.0; + agent["mem_use"] = LLMemory::getCurrentRSS() / 1024.0; LLSD &system = body["system"]; diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index d3fd4f2466d574cd63b3aab43db21087376b459e..ba89fbf02a52ce104a76568cf8aa54192d3ab129 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -57,6 +57,7 @@ public: LLStat mTexturePacketsStat; LLStat mActualInKBitStat; // From the packet ring (when faking a bad connection) LLStat mActualOutKBitStat; // From the packet ring (when faking a bad connection) + LLStat mTrianglesDrawnStat; // Simulator stats LLStat mSimTimeDilation; @@ -98,15 +99,22 @@ public: LLStat mPhysicsPinnedTasks; LLStat mPhysicsLODTasks; LLStat mPhysicsMemoryAllocated; - /* - LLStat mSimCPUUsageStat; - LLStat mSimMemTotalStat; - LLStat mSimMemRSSStat; - */ - LLStat mSimPingStat; + LLStat mNumImagesStat; + LLStat mNumRawImagesStat; + LLStat mGLTexMemStat; + LLStat mGLBoundMemStat; + LLStat mRawMemStat; + LLStat mFormattedMemStat; + + LLStat mNumObjectsStat; + LLStat mNumActiveObjectsStat; + LLStat mNumNewObjectsStat; + LLStat mNumSizeCulledStat; + LLStat mNumVisCulledStat; + void resetStats(); public: // If you change this, please also add a corresponding text label @@ -171,9 +179,8 @@ public: ST_WINDOW_HEIGHT = 55, ST_TEX_BAKES = 56, ST_TEX_REBAKES = 57, - ST_LOGITECH_LCD = 58, - ST_COUNT = 59 + ST_COUNT = 58 }; diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index d64700b523addab0b6e7cadd44e0be6df2e288f4..f4989ec4fef6fc4fd56e472ccaf812029a9bec25 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -32,13 +32,14 @@ #include "llviewerprecompiledheaders.h" +#include "llfloaterreg.h" #include "llfocusmgr.h" #include "audioengine.h" #include "llagent.h" #include "llinventory.h" +#include "llinventorybridge.h" #include "llinventorymodel.h" #include "llinventoryview.h" -#include "llinventorybridge.h" // for landmark prefix string #include "llviewertexteditor.h" @@ -51,6 +52,7 @@ #include "llpreviewlandmark.h" #include "llscrollbar.h" #include "lltooldraganddrop.h" +#include "lltrans.h" #include "llviewercontrol.h" #include "llviewerimagelist.h" #include "llviewerwindow.h" @@ -62,7 +64,7 @@ #include "llappviewer.h" // for gPacificDaylightTime -static LLRegisterWidget<LLViewerTextEditor> r("text_editor"); +static LLDefaultWidgetRegistry::Register<LLViewerTextEditor> r("text_editor"); ///---------------------------------------------------------------------------- /// Class LLEmbeddedNotecardOpener @@ -96,31 +98,9 @@ public: } else { - // See if we can bring an existing preview to the front - if(!LLPreview::show(item->getUUID(), true)) + if(!gSavedSettings.getBOOL("ShowNewInventory")) { - if(!gSavedSettings.getBOOL("ShowNewInventory")) - { - // There isn't one, so make a new preview - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("NotecardEditorRect"); - rect.translate(left - rect.mLeft, top - rect.mTop); - LLPreviewNotecard* preview; - preview = new LLPreviewNotecard("preview notecard", - rect, - std::string("Embedded Note: ") + item->getName(), - item->getUUID(), - LLUUID::null, - item->getAssetUUID(), - true, - (LLViewerInventoryItem*)item); - preview->setSourceID(LLUUID::null); - preview->setFocus(TRUE); - - // Force to be entirely onscreen. - gFloaterView->adjustToFitScreen(preview, FALSE); - } + LLFloaterReg::showInstance("preview_notecard", LLSD(item->getUUID()), TAKE_FOCUS_YES); } } } @@ -430,6 +410,8 @@ void LLEmbeddedItems::bindEmbeddedChars( const LLFontGL* font ) const case LLAssetType::AT_BODYPART: img_name = "inv_item_skin.tga"; break; case LLAssetType::AT_ANIMATION: img_name = "inv_item_animation.tga";break; case LLAssetType::AT_GESTURE: img_name = "inv_item_gesture.tga"; break; + //TODO need img_name + case LLAssetType::AT_FAVORITE: img_name = "inv_item_landmark.tga"; break; default: llassert(0); continue; } @@ -561,33 +543,15 @@ struct LLNotecardCopyInfo // // Member functions // - -LLViewerTextEditor::LLViewerTextEditor(const std::string& name, - const LLRect& rect, - S32 max_length, - const std::string& default_text, - const LLFontGL* font, - BOOL allow_embedded_items) - : LLTextEditor(name, rect, max_length, default_text, font, allow_embedded_items), - mDragItemChar(0), - mDragItemSaved(FALSE), - mInventoryCallback(new LLEmbeddedNotecardOpener) +LLViewerTextEditor::LLViewerTextEditor(const LLViewerTextEditor::Params& p) +: LLTextEditor(p), + mDragItemChar(0), + mDragItemSaved(FALSE), + mInventoryCallback(new LLEmbeddedNotecardOpener) { + mParseHTML = p.allow_html; mEmbeddedItemList = new LLEmbeddedItems(this); mInventoryCallback->setEditor(this); - - // *TODO: Add right click menus for SLURLs - // Build the right click menu - // make the popup menu available - - //LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_slurl.xml", this); - //if (!menu) - //{ - // menu = new LLMenuGL(LLStringUtil::null); - //} - //menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor")); - //// menu->setVisible(FALSE); - //mPopupMenuHandle = menu->getHandle(); } LLViewerTextEditor::~LLViewerTextEditor() @@ -781,6 +745,7 @@ BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask) { + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); BOOL handled = FALSE; if (!mDragItem) @@ -825,7 +790,7 @@ BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask) LLAssetType::lookupDragAndDropType( mDragItem->getType() ), mDragItem->getUUID(), LLToolDragAndDrop::SOURCE_NOTECARD, - getSourceID(), mObjectID); + mPreviewID, mObjectID); return LLToolDragAndDrop::getInstance()->handleHover( x, y, mask ); } @@ -878,7 +843,7 @@ BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask) if( !handled ) { lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; - if (!mScrollbar->getVisible() || x < getRect().getWidth() - SCROLLBAR_SIZE) + if (!mScrollbar->getVisible() || x < getRect().getWidth() - scrollbar_size) { getWindow()->setCursor(UI_CURSOR_IBEAM); } @@ -1134,6 +1099,7 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, *accept = ACCEPT_NO; if (tooltip_msg.empty()) { + // *TODO: Translate tooltip_msg.assign("Only items with unrestricted\n" "'next owner' permissions \n" "can be attached to notecards."); @@ -1246,18 +1212,16 @@ std::string LLViewerTextEditor::appendTime(bool prepend_newline) { time_t utc_time; utc_time = time_corrected(); + std::string timeStr ="[["+ LLTrans::getString("TimeHour")+"]:[" + +LLTrans::getString("TimeMin")+"]] "; - // There's only one internal tm buffer. - struct tm* timep; - - // Convert to Pacific, based on server's opinion of whether - // it's daylight savings time there. - timep = utc_to_pacific_time(utc_time, gPacificDaylightTime); + LLSD substitution; - std::string text = llformat("[%d:%02d] ", timep->tm_hour, timep->tm_min); - appendColoredText(text, false, prepend_newline, LLColor4::grey); + substitution["datetime"] = (S32) utc_time; + LLStringUtil::format (timeStr, substitution); + appendColoredText(timeStr, false, prepend_newline, LLColor4::grey); - return text; + return timeStr; } //---------------------------------------------------------------------------- @@ -1370,29 +1334,16 @@ BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item, llwchar wc) void LLViewerTextEditor::openEmbeddedTexture( LLInventoryItem* item, llwchar wc ) { - // See if we can bring an existing preview to the front // *NOTE: Just for embedded Texture , we should use getAssetUUID(), // not getUUID(), because LLPreviewTexture pass in AssetUUID into // LLPreview constructor ItemUUID parameter. - - if( !LLPreview::show( item->getAssetUUID() ) ) + if (!item) + return; + LLPreviewTexture* preview = LLFloaterReg::showTypedInstance<LLPreviewTexture>("preview_texture", LLSD(item->getAssetUUID()), TAKE_FOCUS_YES); + if (preview) { - // There isn't one, so make a new preview - if(item) - { - S32 left, top; - gFloaterView->getNewFloaterPosition(&left, &top); - LLRect rect = gSavedSettings.getRect("PreviewTextureRect"); - rect.translate( left - rect.mLeft, top - rect.mTop ); - - LLPreviewTexture* preview = new LLPreviewTexture("preview texture", - rect, - item->getName(), - item->getAssetUUID(), - TRUE); - preview->setAuxItem( item ); - preview->setNotecardInfo(mNotecardInventoryID, mObjectID); - } + preview->setAuxItem( item ); + preview->setNotecardInfo(mNotecardInventoryID, mObjectID); } } @@ -1411,9 +1362,13 @@ void LLViewerTextEditor::openEmbeddedSound( LLInventoryItem* item, llwchar wc ) void LLViewerTextEditor::openEmbeddedLandmark( LLInventoryItem* item, llwchar wc ) { - std::string title = - std::string(" ") + LLLandmarkBridge::prefix() + item->getName(); - open_landmark((LLViewerInventoryItem*)item, title, FALSE, item->getUUID(), TRUE); + if (!item) + return; + LLPreviewLandmark* preview = LLFloaterReg::showTypedInstance<LLPreviewLandmark>("preview_landmark", LLSD(item->getUUID()), TAKE_FOCUS_YES); + if (preview) + { + preview->setItem( item ); + } } void LLViewerTextEditor::openEmbeddedNotecard( LLInventoryItem* item, llwchar wc ) @@ -1435,9 +1390,11 @@ bool LLViewerTextEditor::onNotecardDialog(const LLSD& notification, const LLSD& S32 option = LLNotification::getSelectedOption(notification, response); if( option == 0 ) { - // itemptr is deleted by LLPreview::save - LLPointer<LLInventoryItem>* itemptr = new LLPointer<LLInventoryItem>(gInventory.getItem(notification["payload"]["item_id"].asUUID())); - LLPreview::save( notification["payload"]["notecard_id"].asUUID() , itemptr); + LLPreviewNotecard* preview = LLFloaterReg::findTypedInstance<LLPreviewNotecard>("preview_notecard", notification["payload"]["notecard_id"]);; + if (preview) + { + preview->saveItem(); + } } return false; } @@ -1541,61 +1498,3 @@ BOOL LLViewerTextEditor::exportBuffer( std::string& buffer ) return TRUE; } -LLView* LLViewerTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - std::string name("text_editor"); - node->getAttributeString("name", name); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - U32 max_text_length = 255; - node->getAttributeU32("max_length", max_text_length); - - BOOL allow_embedded_items = FALSE; - node->getAttributeBOOL("embedded_items", allow_embedded_items); - - LLFontGL* font = LLView::selectFont(node); - - // std::string text = node->getValue(); - std::string text = node->getTextContents().substr(0, max_text_length - 1); - - if (text.size() > max_text_length) - { - // Erase everything from max_text_length on. - text.erase(max_text_length); - } - - LLViewerTextEditor* text_editor = new LLViewerTextEditor(name, - rect, - max_text_length, - LLStringUtil::null, - font, - allow_embedded_items); - - BOOL ignore_tabs = text_editor->tabsToNextField(); - node->getAttributeBOOL("ignore_tab", ignore_tabs); - text_editor->setTabsToNextField(ignore_tabs); - - text_editor->setTextEditorParameters(node); - - BOOL hide_scrollbar = FALSE; - node->getAttributeBOOL("hide_scrollbar",hide_scrollbar); - text_editor->setHideScrollbarForShortDocs(hide_scrollbar); - - BOOL hide_border = !text_editor->isBorderVisible(); - node->getAttributeBOOL("hide_border", hide_border); - text_editor->setBorderVisible(!hide_border); - - BOOL parse_html = text_editor->mParseHTML; - node->getAttributeBOOL("allow_html", parse_html); - text_editor->setParseHTML(parse_html); - text_editor->setParseHighlights(TRUE); - - text_editor->initFromXML(node, parent); - - // add text after all parameters have been set - text_editor->appendStyledText(text, FALSE, FALSE); - - return text_editor; -} diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index f29caee602e56afcc7ec48d1e1c108f2101771ad..bc373c858a965812a41f084c574a0d1b063c0b11 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -41,21 +41,27 @@ // class LLViewerTextEditor : public LLTextEditor { - public: - LLViewerTextEditor(const std::string& name, - const LLRect& rect, - S32 max_length, - const std::string& default_text = std::string(), - const LLFontGL* glfont = NULL, - BOOL allow_embedded_items = FALSE); + struct Params : public LLInitParam::Block<Params, LLTextEditor::Params> + { + Optional<bool> allow_html; + + Params() + : allow_html("allow_html", false) + { + name = "text_editor"; + } + }; +protected: + LLViewerTextEditor(const Params&); + friend class LLUICtrlFactory; + +public: virtual ~LLViewerTextEditor(); virtual void makePristine(); - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - // mousehandler overrides virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -74,10 +80,11 @@ public: virtual BOOL importBuffer(const char* buffer, S32 length); virtual bool importStream(std::istream& str); virtual BOOL exportBuffer(std::string& buffer); - void setNotecardInfo(const LLUUID& notecard_item_id, const LLUUID& object_id) + void setNotecardInfo(const LLUUID& notecard_item_id, const LLUUID& object_id, const LLUUID& preview_id) { mNotecardInventoryID = notecard_item_id; mObjectID = object_id; + mPreviewID = preview_id; } void setASCIIEmbeddedText(const std::string& instr); @@ -126,6 +133,7 @@ private: LLUUID mObjectID; LLUUID mNotecardInventoryID; + LLUUID mPreviewID; LLPointer<class LLEmbeddedNotecardOpener> mInventoryCallback; diff --git a/indra/newview/llviewervisualparam.cpp b/indra/newview/llviewervisualparam.cpp index 8c7700eb651759dfa45e939cc5aaf4a6a23c650e..7d717ed6dc5a76aa0d26c5264d35fb45ed1beb94 100644 --- a/indra/newview/llviewervisualparam.cpp +++ b/indra/newview/llviewervisualparam.cpp @@ -76,7 +76,7 @@ BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node) static LLStdStringHandle wearable_string = LLXmlTree::addAttributeString("wearable"); if( node->getFastAttributeString( wearable_string, wearable) ) { - mWearableType = LLWearable::typeNameToType( wearable ); + mWearableType = LLWearableDictionary::typeNameToType( wearable ); } static LLStdStringHandle edit_group_string = LLXmlTree::addAttributeString("edit_group"); @@ -119,12 +119,6 @@ LLViewerVisualParam::LLViewerVisualParam() { } -/* -//============================================================================= -// These virtual functions should always be overridden, -// but are included here for use as templates -//============================================================================= - //----------------------------------------------------------------------------- // setInfo() //----------------------------------------------------------------------------- @@ -140,6 +134,12 @@ BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info) return TRUE; } +/* +//============================================================================= +// These virtual functions should always be overridden, +// but are included here for use as templates +//============================================================================= + //----------------------------------------------------------------------------- // parseData() //----------------------------------------------------------------------------- diff --git a/indra/newview/llviewervisualparam.h b/indra/newview/llviewervisualparam.h index 48d28cebf34ec7bcd607fde5471041db2456aac3..77a95db5649ffe41696b035f2266cc74c6c6596d 100644 --- a/indra/newview/llviewervisualparam.h +++ b/indra/newview/llviewervisualparam.h @@ -90,7 +90,7 @@ public: virtual const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **mesh) = 0; // interface methods - F32 getDisplayOrder() { return getInfo()->mEditGroupDisplayOrder; } + F32 getDisplayOrder() const { return getInfo()->mEditGroupDisplayOrder; } S32 getWearableType() const { return getInfo()->mWearableType; } const std::string& getEditGroup() const { return getInfo()->mEditGroup; } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f2fcad88615eeb07db218b2385fca2ecfa8500f9..cb2a8771fa942a6e7cdd4aa8dc6080b695675c5a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -36,7 +36,9 @@ #include <stdio.h> #include <iostream> #include <fstream> +#include <algorithm> +#include "llfloaterreg.h" #include "llpanellogin.h" #include "llviewerkeyboard.h" #include "llviewerwindow.h" @@ -48,7 +50,6 @@ #include "llvoiceclient.h" // for push-to-talk button handling - // // TODO: Many of these includes are unnecessary. Remove them. // @@ -57,6 +58,7 @@ #include "audioengine.h" // mute on minimize #include "indra_constants.h" #include "llassetstorage.h" +#include "llerrorcontrol.h" #include "llfontgl.h" #include "llmousehandler.h" #include "llrect.h" @@ -98,16 +100,15 @@ #include "llfloaterchat.h" #include "llfloaterchatterbox.h" #include "llfloatercustomize.h" -#include "llfloatereditui.h" // HACK JAMESDEBUG for ui editor #include "llfloaterland.h" #include "llfloaterinspect.h" +#include "llfloatermap.h" #include "llfloaternamedesc.h" #include "llfloaterpreference.h" #include "llfloatersnapshot.h" #include "llfloatertools.h" #include "llfloaterworldmap.h" #include "llfocusmgr.h" -#include "llframestatview.h" #include "llgesturemgr.h" #include "llglheaders.h" #include "llhoverview.h" @@ -122,13 +123,15 @@ #include "llmodaldialog.h" #include "llmorphview.h" #include "llmoveview.h" +#include "llnavigationbar.h" #include "llnotify.h" #include "lloverlaybar.h" #include "llpreviewtexture.h" #include "llprogressview.h" #include "llresmgr.h" -#include "llrootview.h" +#include "llsidetray.h" #include "llselectmgr.h" +#include "llrootview.h" #include "llrendersphere.h" #include "llstartup.h" #include "llstatusbar.h" @@ -151,9 +154,8 @@ #include "lltoolmgr.h" #include "lltoolmorph.h" #include "lltoolpie.h" -#include "lltoolplacer.h" #include "lltoolselectland.h" -#include "lltoolview.h" +#include "lltrans.h" #include "lluictrlfactory.h" #include "lluploaddialog.h" #include "llurldispatcher.h" // SLURL from other app instance @@ -170,7 +172,7 @@ #include "llviewerregion.h" #include "llviewershadermgr.h" #include "llviewerstats.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llvovolume.h" #include "llworld.h" #include "llworldmapview.h" @@ -182,10 +184,12 @@ #include "llviewerjoystick.h" #include "llviewernetwork.h" #include "llpostprocess.h" +#include "llbottomtray.h" -#include "llfloatertest.h" // HACK! #include "llfloaternotificationsconsole.h" +#include "llnearbychathistory.h" + #if LL_WINDOWS #include <tchar.h> // For Unicode conversion methods #endif @@ -194,7 +198,6 @@ // Globals // void render_ui(F32 zoom_factor = 1.f, int subfield = 0); -LLBottomPanel* gBottomPanel = NULL; extern BOOL gDebugClicks; extern BOOL gDisplaySwapBuffers; @@ -203,7 +206,6 @@ extern BOOL gResizeScreenTexture; extern S32 gJamesInt; LLViewerWindow *gViewerWindow = NULL; -LLVelocityBar *gVelocityBar = NULL; BOOL gDebugSelect = FALSE; @@ -249,7 +251,27 @@ std::string LLViewerWindow::sMovieBaseName; extern void toggle_debug_menus(void*); +class RecordToChatConsole : public LLError::Recorder, public LLSingleton<RecordToChatConsole> +{ +public: + virtual void recordMessage(LLError::ELevel level, + const std::string& message) + { + // only log warnings to chat console + if (level == LLError::LEVEL_WARN) + { + LLFloaterChat* chat_floater = LLFloaterReg::getTypedInstance<LLFloaterChat>("chat"); + if (chat_floater && gSavedSettings.getBOOL("WarningsAsChat")) + { + LLChat chat; + chat.mText = message; + chat.mSourceType = CHAT_SOURCE_SYSTEM; + chat_floater->addChat(chat, FALSE, FALSE); + } + } + } +}; //////////////////////////////////////////////////////////////////////////// // @@ -557,7 +579,7 @@ public: const Line& line = *iter; LLFontGL::getFontMonospace()->renderUTF8(line.text, 0, (F32)line.x, (F32)line.y, mTextColor, LLFontGL::LEFT, LLFontGL::TOP, - LLFontGL::NORMAL, S32_MAX, S32_MAX, NULL, FALSE); + LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE); } mLineList.clear(); } @@ -1186,6 +1208,27 @@ void LLViewerWindow::handlePauseWatchdog(LLWindow *window) LLAppViewer::instance()->pauseMainloopTimeout(); } +//virtual +std::string LLViewerWindow::translateString(const char* tag) +{ + return LLTrans::getString( std::string(tag) ); +} + +//virtual +std::string LLViewerWindow::translateString(const char* tag, + const std::map<std::string, std::string>& args) +{ + // LLTrans uses a special subclass of std::string for format maps, + // but we must use std::map<> in these callbacks, otherwise we create + // a dependency between LLWindow and LLFormatMapString. So copy the data. + LLStringUtil::format_map_t args_copy; + std::map<std::string,std::string>::const_iterator it = args.begin(); + for ( ; it != args.end(); ++it) + { + args_copy[it->first] = it->second; + } + return LLTrans::getString( std::string(tag), args_copy); +} // // Classes @@ -1196,11 +1239,13 @@ LLViewerWindow::LLViewerWindow( S32 width, S32 height, BOOL fullscreen, BOOL ignore_pixel_depth) : + mWindow(NULL), mActive(TRUE), mWantFullscreen(fullscreen), mShowFullscreenProgress(FALSE), mWindowRect(0, height, width, 0), mVirtualWindowRect(0, height, width, 0), + mWorldViewRect(0, height, width, 0), mLeftMouseDown(FALSE), mMiddleMouseDown(FALSE), mRightMouseDown(FALSE), @@ -1231,7 +1276,7 @@ LLViewerWindow::LLViewerWindow( resetSnapshotLoc(); // create window - mWindow = LLWindowManager::createWindow( + mWindow = LLWindowManager::createWindow(this, title, name, x, y, width, height, 0, fullscreen, gNoRender, @@ -1306,26 +1351,31 @@ LLViewerWindow::LLViewerWindow( mInitAlert = "DisplaySettingsNoShaders"; LLFeatureManager::getInstance()->setGraphicsLevel(0, false); gSavedSettings.setU32("RenderQualityPerformance", 0); - } - // set callbacks - mWindow->setCallbacks(this); - // Init the image list. Must happen after GL is initialized and before the images that // LLViewerWindow needs are requested. gImageList.init(); LLViewerImage::initClass(); gBumpImageList.init(); - + + // Init font system, but don't actually load the fonts yet + // because our window isn't onscreen and they take several + // seconds to parse. + LLFontGL::initClass( gSavedSettings.getF32("FontScreenDPI"), + mDisplayScale.mV[VX], + mDisplayScale.mV[VY], + gDirUtilp->getAppRODataDir(), + LLUI::getXUIPaths()); + // Create container for all sub-views - mRootView = new LLRootView("root", mVirtualWindowRect, FALSE); - - if (!gNoRender) - { - // Init default fonts - initFonts(); - } + LLView::Params rvp; + rvp.name("root"); + rvp.rect(mVirtualWindowRect); + 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; @@ -1381,8 +1431,6 @@ void LLViewerWindow::initBase() LLRect full_window(0, height, width, 0); - adjustRectanglesForFirstUse(full_window); - //////////////////// // // Set the gamma @@ -1402,41 +1450,57 @@ void LLViewerWindow::initBase() // Constrain floaters to inside the menu and status bar regions. LLRect floater_view_rect = full_window; - // make space for menu bar if we have one + // make space for menu bar floater_view_rect.mTop -= MENU_BAR_HEIGHT; - // TODO: Eliminate magic constants - please used named constants if changing this - floater_view_rect.mBottom += STATUS_BAR_HEIGHT + 12 + 16 + 2; - - // Check for non-first startup - S32 floater_view_bottom = gSavedSettings.getS32("FloaterViewBottom"); - if (floater_view_bottom >= 0) - { - floater_view_rect.mBottom = floater_view_bottom; - } - gFloaterView = new LLFloaterView("Floater View", floater_view_rect ); - gFloaterView->setVisible(TRUE); - - gSnapshotFloaterView = new LLSnapshotFloaterView("Snapshot Floater View", full_window); + 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); + // Snapshot floater must start invisible otherwise it eats all // the tooltips. JC gSnapshotFloaterView->setVisible(FALSE); // Console llassert( !gConsole ); - gConsole = new LLConsole( - "console", - gSavedSettings.getS32("ConsoleBufferSize"), - getChatConsoleRect(), - gSavedSettings.getS32("ChatFontSize"), - gSavedSettings.getF32("ChatPersistTime") ); - gConsole->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM); + LLConsole::Params cp; + cp.name("console"); + cp.max_lines(gSavedSettings.getS32("ConsoleBufferSize")); + cp.rect(getChatConsoleRect()); + cp.persist_time(gSavedSettings.getF32("ChatPersistTime")); + cp.font_size_index(gSavedSettings.getS32("ChatFontSize")); + cp.follows.flags(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM); + gConsole = LLUICtrlFactory::create<LLConsole>(cp); mRootView->addChild(gConsole); + // optionally forward warnings to chat console/chat floater + // for qa runs and dev builds +#if !LL_RELEASE_FOR_DOWNLOAD + LLError::addRecorder(RecordToChatConsole::getInstance()); +#else + if(gSavedSettings.getBOOL("QAMode")) + { + LLError::addRecorder(RecordToChatConsole::getInstance()); + } +#endif + // Debug view over the console - gDebugView = new LLDebugView("gDebugView", full_window); - gDebugView->setFollowsAll(); - gDebugView->setVisible(TRUE); + 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); mRootView->addChild(gDebugView); // Add floater view at the end so it will be on top, and give it tab priority over others @@ -1444,278 +1508,154 @@ void LLViewerWindow::initBase() mRootView->addChild(gSnapshotFloaterView); // notify above floaters! - LLRect notify_rect = full_window; - //notify_rect.mTop -= 24; - notify_rect.mBottom += STATUS_BAR_HEIGHT; - gNotifyBoxView = new LLNotifyBoxView("notify_container", notify_rect, FALSE, FOLLOWS_ALL); + 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); mRootView->addChild(gNotifyBoxView, -2); // Tooltips go above floaters - mToolTip = new LLTextBox( std::string("tool tip"), LLRect(0, 1, 1, 0 ) ); - mToolTip->setHPad( 4 ); - mToolTip->setVPad( 2 ); - mToolTip->setColor( gColors.getColor( "ToolTipTextColor" ) ); - mToolTip->setBorderColor( gColors.getColor( "ToolTipBorderColor" ) ); - mToolTip->setBorderVisible( FALSE ); - mToolTip->setBackgroundColor( gColors.getColor( "ToolTipBgColor" ) ); - mToolTip->setBackgroundVisible( TRUE ); - mToolTip->setFontStyle(LLFontGL::NORMAL); - mToolTip->setBorderDropshadowVisible( TRUE ); - mToolTip->setVisible( FALSE ); + LLTextBox::Params params; + params.text("tool tip"); + params.name(params.text); + params.rect(LLRect (0, 1, 1, 0)); + params.h_pad(4); + params.v_pad(2); + params.text_color(gSavedSkinSettings.getColor( "ToolTipTextColor" )); + params.border_color(gSavedSkinSettings.getColor( "ToolTipBorderColor" )); + params.border_visible(false); + params.background_color(gSavedSkinSettings.getColor( "ToolTipBgColor" )); + params.bg_visible(true); + params.font.style("NORMAL"); + params.border_drop_shadow_visible(true); + params.visible(false); + mToolTip = LLUICtrlFactory::create<LLTextBox> (params); // Add the progress bar view (startup view), which overrides everything - mProgressView = new LLProgressView(std::string("ProgressView"), full_window); + mProgressView = new LLProgressView(full_window); mRootView->addChild(mProgressView); setShowProgress(FALSE); setProgressCancelButtonVisible(FALSE); } - -void adjust_rect_top_left(const std::string& control, const LLRect& window) -{ - LLRect r = gSavedSettings.getRect(control); - if (r.mLeft == 0 && r.mBottom == 0) - { - r.setLeftTopAndSize(0, window.getHeight(), r.getWidth(), r.getHeight()); - gSavedSettings.setRect(control, r); - } -} - -void adjust_rect_top_center(const std::string& control, const LLRect& window) +void LLViewerWindow::initWorldUI() { - LLRect r = gSavedSettings.getRect(control); - if (r.mLeft == 0 && r.mBottom == 0) - { - r.setLeftTopAndSize( window.getWidth()/2 - r.getWidth()/2, - window.getHeight(), - r.getWidth(), - r.getHeight() ); - gSavedSettings.setRect(control, r); - } -} + S32 height = mRootView->getRect().getHeight(); + S32 width = mRootView->getRect().getWidth(); + LLRect full_window(0, height, width, 0); -void adjust_rect_top_right(const std::string& control, const LLRect& window) -{ - LLRect r = gSavedSettings.getRect(control); - if (r.mLeft == 0 && r.mBottom == 0) - { - r.setLeftTopAndSize(window.getWidth() - r.getWidth(), - window.getHeight(), - r.getWidth(), - r.getHeight()); - gSavedSettings.setRect(control, r); - } -} + gIMMgr = LLIMMgr::getInstance(); -// *TODO: Adjust based on XUI XML -const S32 TOOLBAR_HEIGHT = 64; + // new bottom panel + LLRect rc = LLBottomTray::getInstance()->getRect(); + rc.mLeft = 0; + rc.mRight = mRootView->getRect().getWidth(); + mRootView->addChild(LLBottomTray::getInstance()); + LLBottomTray::getInstance()->reshape(rc.getWidth(),rc.getHeight(),FALSE); + LLBottomTray::getInstance()->setRect(rc); -void adjust_rect_bottom_left(const std::string& control, const LLRect& window) -{ - LLRect r = gSavedSettings.getRect(control); - if (r.mLeft == 0 && r.mBottom == 0) + // Updating of bottom boundary of gConsole to avoid overlapping + if (gConsole) { - r.setOriginAndSize(0, TOOLBAR_HEIGHT, r.getWidth(), r.getHeight()); - gSavedSettings.setRect(control, r); + LLRect cr = gConsole->getRect(); + cr.mBottom += LLBottomTray::getInstance()->getRect().getHeight(); + gConsole->setRect(cr); } -} -void adjust_rect_bottom_center(const std::string& control, const LLRect& window) -{ - LLRect r = gSavedSettings.getRect(control); - if (r.mLeft == 0 && r.mBottom == 0) - { - r.setOriginAndSize( - window.getWidth()/2 - r.getWidth()/2, - TOOLBAR_HEIGHT, - r.getWidth(), - r.getHeight()); - gSavedSettings.setRect(control, r); - } -} + // View for hover information + LLHoverView::Params hvp; + hvp.name("gHoverview"); + hvp.rect(full_window); + gHoverView = LLUICtrlFactory::create<LLHoverView>(hvp); + mRootView->addChild(gHoverView); -void adjust_rect_centered_partial_zoom(const std::string& control, - const LLRect& window) -{ - LLRect rect = gSavedSettings.getRect(control); - // Only adjust on first use - if (rect.mLeft == 0 && rect.mBottom == 0) + // Pre initialize instance communicate instance; + // currently needs to happen before initializing chat or IM + LLFloaterReg::getInstance("communicate"); + + if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) { - S32 width = window.getWidth(); - S32 height = window.getHeight(); - rect.set(0, height-STATUS_BAR_HEIGHT, width, TOOL_BAR_HEIGHT); - // Make floater fill 80% of window, leaving 20% padding on - // the sides. - const F32 ZOOM_FRACTION = 0.8f; - S32 dx = (S32)(width * (1.f - ZOOM_FRACTION)); - S32 dy = (S32)(height * (1.f - ZOOM_FRACTION)); - rect.stretch(-dx/2, -dy/2); - gSavedSettings.setRect(control, rect); + LLFloaterChat::loadHistory(); } -} - - -// Many rectangles can't be placed until we know the screen size. -// These rectangles have their bottom-left corner as 0,0 -void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window) -{ - LLRect r; - // *NOTE: The width and height of these floaters must be - // identical in settings.xml and their relevant floater.xml - // files, otherwise the window construction will get - // confused. JC - adjust_rect_bottom_center("FloaterMoveRect2", window); + LLRect morph_view_rect = full_window; + morph_view_rect.stretch( -STATUS_BAR_HEIGHT ); + morph_view_rect.mTop = full_window.mTop - 32; + LLMorphView::Params mvp; + mvp.name("MorphView"); + mvp.rect(morph_view_rect); + mvp.visible(false); + gMorphView = LLUICtrlFactory::create<LLMorphView>(mvp); + mRootView->addChild(gMorphView); - adjust_rect_top_center("FloaterCameraRect3", window); + // Make space for nav bar. + LLRect floater_view_rect = gFloaterView->getRect(); + LLRect notify_view_rect = gNotifyBoxView->getRect(); + floater_view_rect.mTop -= NAVIGATION_BAR_HEIGHT; + floater_view_rect.mBottom += LLBottomTray::getInstance()->getRect().getHeight(); + notify_view_rect.mTop -= NAVIGATION_BAR_HEIGHT; + notify_view_rect.mBottom += LLBottomTray::getInstance()->getRect().getHeight(); + gFloaterView->setRect(floater_view_rect); + gNotifyBoxView->setRect(notify_view_rect); - adjust_rect_top_left("FloaterCustomizeAppearanceRect", window); + // *Note: this is where gFloaterMute used to be initialized. - adjust_rect_top_left("FloaterLandRect5", window); - - adjust_rect_top_left("FloaterFindRect2", window); - - adjust_rect_top_left("FloaterGestureRect2", window); - - adjust_rect_top_right("FloaterMiniMapRect", window); + LLWorldMapView::initClass(); - adjust_rect_top_right("FloaterLagMeter", window); - - adjust_rect_top_left("FloaterBuildOptionsRect", window); - - adjust_rect_bottom_left("FloaterActiveSpeakersRect", window); - - adjust_rect_bottom_left("FloaterBumpRect", window); - - adjust_rect_bottom_left("FloaterRegionInfo", window); - - adjust_rect_bottom_left("FloaterEnvRect", window); - - adjust_rect_bottom_left("FloaterAdvancedSkyRect", window); - - adjust_rect_bottom_left("FloaterAdvancedWaterRect", window); - - adjust_rect_bottom_left("FloaterDayCycleRect", window); - - adjust_rect_top_right("FloaterStatisticsRect", window); - - - // bottom-right - r = gSavedSettings.getRect("FloaterInventoryRect"); - if (r.mLeft == 0 && r.mBottom == 0) - { - r.setOriginAndSize( - window.getWidth() - r.getWidth(), - 0, - r.getWidth(), - r.getHeight()); - gSavedSettings.setRect("FloaterInventoryRect", r); - } + // Force gFloaterWorldMap to initialize + LLFloaterReg::getInstance("world_map"); + LLFloaterReg::hideInstance("world_map"); + + // Force gFloaterTools to initialize + LLFloaterReg::getInstance("build"); + 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()); + // sync bg color with menu bar + gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor().get() ); + + // Navigation bar + + LLNavigationBar* navbar = LLNavigationBar::getInstance(); + 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()); -// adjust_rect_top_left("FloaterHUDRect2", window); - - // slightly off center to be left of the avatar. - r = gSavedSettings.getRect("FloaterHUDRect2"); - if (r.mLeft == 0 && r.mBottom == 0) - { - r.setOriginAndSize( - window.getWidth()/4 - r.getWidth()/2, - 2*window.getHeight()/3 - r.getHeight()/2, - r.getWidth(), - r.getHeight()); - gSavedSettings.setRect("FloaterHUDRect2", r); - } -} - -//Rectangles need to be adjusted after the window is constructed -//in order for proper centering to take place -void LLViewerWindow::adjustControlRectanglesForFirstUse(const LLRect& window) -{ - adjust_rect_bottom_center("FloaterMoveRect2", window); - adjust_rect_top_center("FloaterCameraRect3", window); -} - -void LLViewerWindow::initWorldUI() -{ - pre_init_menus(); - - S32 height = mRootView->getRect().getHeight(); - S32 width = mRootView->getRect().getWidth(); - LLRect full_window(0, height, width, 0); - - if ( gBottomPanel == NULL ) // Don't re-enter if objects are alreay created - { - // panel containing chatbar, toolbar, and overlay, over floaters - gBottomPanel = new LLBottomPanel(mRootView->getRect()); - mRootView->addChild(gBottomPanel); - - // View for hover information - gHoverView = new LLHoverView(std::string("gHoverView"), full_window); - gHoverView->setVisible(TRUE); - mRootView->addChild(gHoverView); - - gIMMgr = LLIMMgr::getInstance(); - - if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) - { - LLFloaterChat::getInstance(LLSD())->loadHistory(); - } - - LLRect morph_view_rect = full_window; - morph_view_rect.stretch( -STATUS_BAR_HEIGHT ); - morph_view_rect.mTop = full_window.mTop - 32; - gMorphView = new LLMorphView(std::string("gMorphView"), morph_view_rect ); - mRootView->addChild(gMorphView); - gMorphView->setVisible(FALSE); - - // *Note: this is where gFloaterMute used to be initialized. + getRootView()->addChild(gStatusBar); + getRootView()->addChild(navbar); - LLWorldMapView::initClass(); + // side tray + getRootView()->addChild(LLSideTray::getInstance()); - adjust_rect_centered_partial_zoom("FloaterWorldMapRect2", full_window); - - gFloaterWorldMap = new LLFloaterWorldMap(); - gFloaterWorldMap->setVisible(FALSE); - - // - // Tools for building - // - - // Toolbox floater - init_menus(); - - gFloaterTools = new LLFloaterTools(); - gFloaterTools->setVisible(FALSE); - - // 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(std::string("status"), 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()); - // sync bg color with menu bar - gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() ); - - LLFloaterChatterBox::createInstance(LLSD()); - - getRootView()->addChild(gStatusBar); - - // menu holder appears on top to get first pass at all mouse events - getRootView()->sendChildToFront(gMenuHolder); - } + //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); } // Destroy the UI void LLViewerWindow::shutdownViews() { + // clean up warning logger + LLError::removeRecorder(RecordToChatConsole::getInstance()); + delete mDebugText; mDebugText = NULL; - gSavedSettings.setS32("FloaterViewBottom", gFloaterView->getRect().mBottom); - // Cleanup global views if (gMorphView) { @@ -1727,7 +1667,6 @@ void LLViewerWindow::shutdownViews() mRootView = NULL; // Automatically deleted as children of mRootView. Fix the globals. - gFloaterTools = NULL; gStatusBar = NULL; gIMMgr = NULL; gHoverView = NULL; @@ -1829,8 +1768,8 @@ void LLViewerWindow::sendShapeToSim() msg->addU32Fast(_PREHASH_CircuitCode, gMessageSystem->mOurCircuitCode); msg->nextBlockFast(_PREHASH_HeightWidthBlock); msg->addU32Fast(_PREHASH_GenCounter, 0); - U16 height16 = (U16) mWindowRect.getHeight(); - U16 width16 = (U16) mWindowRect.getWidth(); + U16 height16 = (U16) mWorldViewRect.getHeight(); + U16 width16 = (U16) mWorldViewRect.getWidth(); msg->addU16Fast(_PREHASH_Height, height16); msg->addU16Fast(_PREHASH_Width, width16); gAgent.sendReliableMessage(); @@ -1851,25 +1790,18 @@ void LLViewerWindow::reshape(S32 width, S32 height) return; } - glViewport(0, 0, width, height ); + // update our window rectangle + mWindowRect.mRight = mWindowRect.mLeft + width; + mWindowRect.mTop = mWindowRect.mBottom + height; + + //glViewport(0, 0, width, height ); if (height > 0) { - LLViewerCamera::getInstance()->setViewHeightInPixels( height ); - if (mWindow->getFullscreen()) - { - // force to 4:3 aspect for odd resolutions - LLViewerCamera::getInstance()->setAspect( getDisplayAspectRatio() ); - } - else - { - LLViewerCamera::getInstance()->setAspect( width / (F32) height); - } + LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRect.getHeight() ); + LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() ); } - // update our window rectangle - mWindowRect.mRight = mWindowRect.mLeft + width; - mWindowRect.mTop = mWindowRect.mBottom + height; calcDisplayScale(); BOOL display_scale_changed = mDisplayScale != LLUI::sGLScaleFactor; @@ -1879,7 +1811,7 @@ void LLViewerWindow::reshape(S32 width, S32 height) mVirtualWindowRect.mRight = mVirtualWindowRect.mLeft + llround((F32)width / mDisplayScale.mV[VX]); mVirtualWindowRect.mTop = mVirtualWindowRect.mBottom + llround((F32)height / mDisplayScale.mV[VY]); - setupViewport(); + setup2DViewport(); // Inform lower views of the change // round up when converting coordinates to make sure there are no gaps at edge of window @@ -1897,7 +1829,7 @@ void LLViewerWindow::reshape(S32 width, S32 height) // store the mode the user wants (even if not there yet) - gSavedSettings.setBOOL("FullScreen", mWantFullscreen); + gSavedSettings.setBOOL("NotFullScreen", !mWantFullscreen); // store new settings for the mode we are in, regardless if (!mWindow->getFullscreen()) @@ -1917,7 +1849,6 @@ void LLViewerWindow::reshape(S32 width, S32 height) LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_HEIGHT, (F64)height); - gResizeScreenTexture = TRUE; } } @@ -1925,11 +1856,8 @@ void LLViewerWindow::reshape(S32 width, S32 height) // Hide normal UI when a logon fails void LLViewerWindow::setNormalControlsVisible( BOOL visible ) { - if ( gBottomPanel ) - { - gBottomPanel->setVisible( visible ); - gBottomPanel->setEnabled( visible ); - } + LLBottomTray::getInstance()->setVisible(visible); + LLBottomTray::getInstance()->setEnabled(visible); if ( gMenuBarView ) { @@ -1946,6 +1874,12 @@ void LLViewerWindow::setNormalControlsVisible( BOOL visible ) gStatusBar->setVisible( visible ); gStatusBar->setEnabled( visible ); } + + LLNavigationBar* navbarp = LLUI::getRootView()->findChild<LLNavigationBar>("navigation_bar"); + if (navbarp) + { + navbarp->setVisible( visible ); + } } void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid) @@ -1955,19 +1889,19 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid) if(god_mode && LLViewerLogin::getInstance()->isInProductionGrid()) { - new_bg_color = gColors.getColor( "MenuBarGodBgColor" ); + new_bg_color = gSavedSkinSettings.getColor( "MenuBarGodBgColor" ); } else if(god_mode && !LLViewerLogin::getInstance()->isInProductionGrid()) { - new_bg_color = gColors.getColor( "MenuNonProductionGodBgColor" ); + new_bg_color = gSavedSkinSettings.getColor( "MenuNonProductionGodBgColor" ); } else if(!god_mode && !LLViewerLogin::getInstance()->isInProductionGrid()) { - new_bg_color = gColors.getColor( "MenuNonProductionBgColor" ); + new_bg_color = gSavedSkinSettings.getColor( "MenuNonProductionBgColor" ); } else { - new_bg_color = gColors.getColor( "MenuBarBgColor" ); + new_bg_color = gSavedSkinSettings.getColor( "MenuBarBgColor" ); } if(gMenuBarView) @@ -1978,6 +1912,7 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid) if(gStatusBar) { gStatusBar->setBackgroundColor( new_bg_color ); + gStatusBar->getChild<LLTextBox>("HealthText")->setBackgroundColor(new_bg_color); } } @@ -2021,7 +1956,7 @@ void LLViewerWindow::draw() glLoadIdentity(); microsecondsToTimecodeString(gFrameTime,text); - const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); + const LLFontGL* font = LLFontGL::getFontSansSerif(); font->renderUTF8(text, 0, llround((getWindowWidth()/2)-100.f), llround((getWindowHeight()-60.f)), @@ -2126,6 +2061,9 @@ void LLViewerWindow::draw() #if LL_DEBUG LLView::sIsDrawing = FALSE; #endif + + // UI post-draw Updates + gNotifyBoxView->updateNotifyBoxView(); } // Takes a single keydown event, usually when UI is visible @@ -2144,14 +2082,14 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) } } - // HACK look for UI editing keys - if (LLView::sEditingUI) - { - if (LLFloaterEditUI::processKeystroke(key, mask)) - { - return TRUE; - } - } + //// HACK look for UI editing keys + //if (LLView::sEditingUI) + //{ + // if (LLFloaterEditUI::processKeystroke(key, mask)) + // { + // return TRUE; + // } + //} // Hide tooltips on keypress mToolTipBlocked = TRUE; // block until next time mouse is moved @@ -2434,8 +2372,8 @@ void LLViewerWindow::handleScrollWheel(S32 clicks) void LLViewerWindow::moveCursorToCenter() { - S32 x = mVirtualWindowRect.getWidth() / 2; - S32 y = mVirtualWindowRect.getHeight() / 2; + S32 x = mWorldViewRect.getWidth() / 2; + S32 y = mWorldViewRect.getHeight() / 2; //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); @@ -2452,103 +2390,131 @@ void LLViewerWindow::moveCursorToCenter() // Update UI based on stored mouse position from mouse-move // event processing. -BOOL LLViewerWindow::handlePerFrameHover() +void LLViewerWindow::updateUI() { static std::string last_handle_msg; + updateWorldViewRect(); + LLView::sMouseHandlerMessage.clear(); S32 x = mCurrentMousePoint.mX; S32 y = mCurrentMousePoint.mY; MASK mask = gKeyboard->currentMask(TRUE); - //RN: fix for asynchronous notification of mouse leaving window not working - LLCoordWindow mouse_pos; - mWindow->getCursorPosition(&mouse_pos); - if (mouse_pos.mX < 0 || - mouse_pos.mY < 0 || - mouse_pos.mX > mWindowRect.getWidth() || - mouse_pos.mY > mWindowRect.getHeight()) - { - mMouseInWindow = FALSE; - } - else + if (gNoRender) { - mMouseInWindow = TRUE; + return; } + updateMouseDelta(); + updateKeyboardFocus(); - S32 dx = lltrunc((F32) (mCurrentMousePoint.mX - mLastMousePoint.mX) * LLUI::sGLScaleFactor.mV[VX]); - S32 dy = lltrunc((F32) (mCurrentMousePoint.mY - mLastMousePoint.mY) * LLUI::sGLScaleFactor.mV[VY]); - - LLVector2 mouse_vel; + BOOL handled = FALSE; - if (gSavedSettings.getBOOL("MouseSmooth")) - { - static F32 fdx = 0.f; - static F32 fdy = 0.f; + BOOL handled_by_top_ctrl = FALSE; + LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); + LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); - F32 amount = 16.f; - fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds*amount,1.f); - fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds*amount,1.f); + //build set of views containing mouse cursor by traversing UI hierarchy and testing + //screen rect against mouse cursor + view_handle_set_t mouse_hover_set; - mCurrentMouseDelta.set(llround(fdx), llround(fdy)); - mouse_vel.setVec(fdx,fdy); - } - else + // start at current mouse captor (if is a view) or UI root + LLView* root_view = NULL; + root_view = dynamic_cast<LLView*>(mouse_captor); + if (!root_view) { - mCurrentMouseDelta.set(dx, dy); - mouse_vel.setVec((F32) dx, (F32) dy); + root_view = mRootView; } - - mMouseVelocityStat.addValue(mouse_vel.magVec()); - if (gNoRender) + // walk UI tree in depth-first order + LLView::tree_iterator_t end_it; + for (LLView::tree_iterator_t it = root_view->beginTree(); + it != end_it; + ++it) { - return TRUE; + LLView* viewp = *it; + // calculating the screen rect involves traversing the parent, so this is less than optimal + if (!viewp->getVisible() + || !viewp->calcScreenBoundingRect().pointInRect(x, y)) + { + // skip this view and all of its children + it.skipDescendants(); + continue; + } + + // if this view is mouse opaque, nothing behind it should be in mouse_hover_set + if (viewp->getMouseOpaque()) + { + // constrain further iteration to children of this widget + it = viewp->beginTree(); + } + + // we have a view that contains the mouse, add it to the set + mouse_hover_set.insert(viewp->getHandle()); } - // clean up current focus - LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); - if (cur_focus) + // now do the same aggregation for the "top" ctrl, whose parent does not necessarily contain the mouse + if (top_ctrl) { - if (!cur_focus->isInVisibleChain() || !cur_focus->isInEnabledChain()) + for (LLView::tree_iterator_t it = top_ctrl->beginTree(); + it != root_view->endTree(); + ++it) { - gFocusMgr.releaseFocusIfNeeded(cur_focus); - - LLUICtrl* parent = cur_focus->getParentUICtrl(); - const LLUICtrl* focus_root = cur_focus->findRootMostFocusRoot(); - while(parent) + LLView* viewp = *it; + if (!viewp->getVisible() + || !viewp->calcScreenBoundingRect().pointInRect(x, y)) { - if (parent->isCtrl() && - (parent->hasTabStop() || parent == focus_root) && - !parent->getIsChrome() && - parent->isInVisibleChain() && - parent->isInEnabledChain()) - { - if (!parent->focusFirstItem()) - { - parent->setFocus(TRUE); - } - break; - } - parent = parent->getParentUICtrl(); + // skip this view and all of its children + it.skipDescendants(); + continue; } + + // we have a view that contains the mouse, add it to the set + mouse_hover_set.insert(viewp->getHandle()); } - else if (cur_focus->isFocusRoot()) + } + + typedef std::vector<LLHandle<LLView> > view_handle_list_t; + + // call onMouseEnter() on all views which contain the mouse cursor but did not before + view_handle_list_t mouse_enter_views; + std::set_difference(mouse_hover_set.begin(), mouse_hover_set.end(), + mMouseHoverViews.begin(), mMouseHoverViews.end(), + std::back_inserter(mouse_enter_views)); + for (view_handle_list_t::iterator it = mouse_enter_views.begin(); + it != mouse_enter_views.end(); + ++it) + { + LLView* viewp = it->get(); + if (viewp) { - // focus roots keep trying to delegate focus to their first valid descendant - // this assumes that focus roots are not valid focus holders on their own - cur_focus->focusFirstItem(); + LLRect view_screen_rect = viewp->calcScreenRect(); + viewp->onMouseEnter(x - view_screen_rect.mLeft, y - view_screen_rect.mBottom, mask); } } - BOOL handled = FALSE; + // call onMouseLeave() on all views which no longer contain the mouse cursor + view_handle_list_t mouse_leave_views; + std::set_difference(mMouseHoverViews.begin(), mMouseHoverViews.end(), + mouse_hover_set.begin(), mouse_hover_set.end(), + std::back_inserter(mouse_leave_views)); + for (view_handle_list_t::iterator it = mouse_leave_views.begin(); + it != mouse_leave_views.end(); + ++it) + { + LLView* viewp = it->get(); + if (viewp) + { + LLRect view_screen_rect = viewp->calcScreenRect(); + viewp->onMouseLeave(x - view_screen_rect.mLeft, y - view_screen_rect.mBottom, mask); + } + } - BOOL handled_by_top_ctrl = FALSE; - LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); + // store resulting hover set for next frame + swap(mMouseHoverViews, mouse_hover_set); - LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); if( mouse_captor ) { // Pass hover events to object capturing mouse events. @@ -2691,114 +2657,194 @@ BOOL LLViewerWindow::handlePerFrameHover() } } - if (tool && tool != gToolNull && tool != LLToolCompInspect::getInstance() && tool != LLToolDragAndDrop::getInstance() && !gSavedSettings.getBOOL("FreezeTime")) - { - LLMouseHandler *captor = gFocusMgr.getMouseCapture(); - // With the null, inspect, or drag and drop tool, don't muck - // with visibility. + updateLayout(); - if (gFloaterTools->isMinimized() || - (tool != LLToolPie::getInstance() // not default tool - && tool != LLToolCompGun::getInstance() // not coming out of mouselook - && !mSuppressToolbox // not override in third person - && LLToolMgr::getInstance()->getCurrentToolset() != gFaceEditToolset // not special mode - && LLToolMgr::getInstance()->getCurrentToolset() != gMouselookToolset - && (!captor || captor->isView())) // not dragging - ) - { - // Force floater tools to be visible (unless minimized) - if (!gFloaterTools->getVisible()) - { - gFloaterTools->open(); /* Flawfinder: ignore */ - } - // Update the location of the blue box tool popup - LLCoordGL select_center_screen; - gFloaterTools->updatePopup( select_center_screen, mask ); - } - else - { - gFloaterTools->setVisible(FALSE); - } - // In the future we may wish to hide the tools menu unless you - // are building. JC - //gMenuBarView->setItemVisible("Tools", gFloaterTools->getVisible()); - //gMenuBarView->arrange(); + mLastMousePoint = mCurrentMousePoint; + + // cleanup unused selections when no modal dialogs are open + if (LLModalDialog::activeCount() == 0) + { + LLViewerParcelMgr::getInstance()->deselectUnused(); + } + + if (LLModalDialog::activeCount() == 0) + { + LLSelectMgr::getInstance()->deselectUnused(); } - if (gToolBar) + + updatePicking(x, y, mask); +} + +void LLViewerWindow::updatePicking(S32 x, S32 y, MASK mask) +{ + // per frame picking - for tooltips and changing cursor over interactive objects + static S32 previous_x = -1; + static S32 previous_y = -1; + static BOOL mouse_moved_since_pick = FALSE; + + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST)) + { + gDebugRaycastFaceHit = -1; + gDebugRaycastObject = cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE, + &gDebugRaycastFaceHit, + &gDebugRaycastIntersection, + &gDebugRaycastTexCoord, + &gDebugRaycastNormal, + &gDebugRaycastBinormal); + } + + + if ((previous_x != x) || (previous_y != y)) + mouse_moved_since_pick = TRUE; + + BOOL do_pick = FALSE; + + F32 picks_moving = gSavedSettings.getF32("PicksPerSecondMouseMoving"); + if ((mouse_moved_since_pick) && (picks_moving > 0.0) && (mPickTimer.getElapsedTimeF32() > 1.0f / picks_moving)) { - gToolBar->refresh(); + do_pick = TRUE; } - if (gChatBar) + F32 picks_stationary = gSavedSettings.getF32("PicksPerSecondMouseStationary"); + if ((!mouse_moved_since_pick) && (picks_stationary > 0.0) && (mPickTimer.getElapsedTimeF32() > 1.0f / picks_stationary)) { - gChatBar->refresh(); + do_pick = TRUE; } - if (gOverlayBar) + if (getCursorHidden()) { - gOverlayBar->refresh(); + do_pick = FALSE; } - // Update rectangles for the various toolbars - if (gOverlayBar && gNotifyBoxView && gConsole && gToolBar) + if (do_pick) { - LLRect bar_rect(-1, STATUS_BAR_HEIGHT, getWindowWidth()+1, -1); + mouse_moved_since_pick = FALSE; + mPickTimer.reset(); + pickAsync(getCurrentMouseX(), getCurrentMouseY(), mask, hoverPickCallback, TRUE); + } - LLRect notify_box_rect = gNotifyBoxView->getRect(); - notify_box_rect.mBottom = bar_rect.mBottom; - gNotifyBoxView->reshape(notify_box_rect.getWidth(), notify_box_rect.getHeight()); - gNotifyBoxView->setRect(notify_box_rect); + previous_x = x; + previous_y = y; +} - // make sure floaters snap to visible rect by adjusting floater view rect - LLRect floater_rect = gFloaterView->getRect(); - if (floater_rect.mBottom != bar_rect.mBottom+1) - { - floater_rect.mBottom = bar_rect.mBottom+1; - // Don't bounce the floaters up and down. - gFloaterView->reshapeFloater(floater_rect.getWidth(), floater_rect.getHeight(), - TRUE, ADJUST_VERTICAL_NO); - gFloaterView->setRect(floater_rect); - } +void LLViewerWindow::updateLayout() +{ + LLTool* tool = LLToolMgr::getInstance()->getCurrentTool(); + if (gFloaterTools != NULL + && tool != NULL + && tool != gToolNull + && tool != LLToolCompInspect::getInstance() + && tool != LLToolDragAndDrop::getInstance() + && !gSavedSettings.getBOOL("FreezeTime")) + { + LLMouseHandler *captor = gFocusMgr.getMouseCapture(); + // With the null, inspect, or drag and drop tool, don't muck + // with visibility. - // snap floaters to top of chat bar/button strip - LLView* chatbar_and_buttons = gOverlayBar->getChild<LLView>("chatbar_and_buttons", TRUE); - // find top of chatbar and state buttons, if either are visible - if (chatbar_and_buttons && !chatbar_and_buttons->getLocalBoundingRect().isNull()) + if (gFloaterTools->isMinimized() + || (tool != LLToolPie::getInstance() // not default tool + && tool != LLToolCompGun::getInstance() // not coming out of mouselook + && !mSuppressToolbox // not override in third person + && LLToolMgr::getInstance()->getCurrentToolset() != gFaceEditToolset // not special mode + && LLToolMgr::getInstance()->getCurrentToolset() != gMouselookToolset + && (!captor || captor->isView()))) // not dragging { - // convert top/left corner of chatbar/buttons container to gFloaterView-relative coordinates - S32 top, left; - chatbar_and_buttons->localPointToOtherView( - chatbar_and_buttons->getLocalBoundingRect().mLeft, - chatbar_and_buttons->getLocalBoundingRect().mTop, - &left, - &top, - gFloaterView); - gFloaterView->setSnapOffsetBottom(top); - } - else if (gToolBar->getVisible()) - { - S32 top, left; - gToolBar->localPointToOtherView( - gToolBar->getLocalBoundingRect().mLeft, - gToolBar->getLocalBoundingRect().mTop, - &left, - &top, - gFloaterView); - gFloaterView->setSnapOffsetBottom(top); + // Force floater tools to be visible (unless minimized) + if (!gFloaterTools->getVisible()) + { + gFloaterTools->openFloater(); + } + // Update the location of the blue box tool popup + LLCoordGL select_center_screen; + gFloaterTools->updatePopup( select_center_screen, gKeyboard->currentMask(TRUE) ); } else { - gFloaterView->setSnapOffsetBottom(0); + gFloaterTools->setVisible(FALSE); } + gMenuBarView->setItemVisible("BuildTools", gFloaterTools->getVisible()); + } +} - // Always update console - LLRect console_rect = getChatConsoleRect(); - console_rect.mBottom = gHUDView->getRect().mBottom + getChatConsoleBottomPad(); - gConsole->reshape(console_rect.getWidth(), console_rect.getHeight()); - gConsole->setRect(console_rect); +void LLViewerWindow::updateMouseDelta() +{ + S32 dx = lltrunc((F32) (mCurrentMousePoint.mX - mLastMousePoint.mX) * LLUI::sGLScaleFactor.mV[VX]); + S32 dy = lltrunc((F32) (mCurrentMousePoint.mY - mLastMousePoint.mY) * LLUI::sGLScaleFactor.mV[VY]); + + //RN: fix for asynchronous notification of mouse leaving window not working + LLCoordWindow mouse_pos; + mWindow->getCursorPosition(&mouse_pos); + if (mouse_pos.mX < 0 || + mouse_pos.mY < 0 || + mouse_pos.mX > mWindowRect.getWidth() || + mouse_pos.mY > mWindowRect.getHeight()) + { + mMouseInWindow = FALSE; + } + else + { + mMouseInWindow = TRUE; } - mLastMousePoint = mCurrentMousePoint; + LLVector2 mouse_vel; + + if (gSavedSettings.getBOOL("MouseSmooth")) + { + static F32 fdx = 0.f; + static F32 fdy = 0.f; + + F32 amount = 16.f; + fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds*amount,1.f); + fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds*amount,1.f); + + mCurrentMouseDelta.set(llround(fdx), llround(fdy)); + mouse_vel.setVec(fdx,fdy); + } + else + { + mCurrentMouseDelta.set(dx, dy); + mouse_vel.setVec((F32) dx, (F32) dy); + } + + mMouseVelocityStat.addValue(mouse_vel.magVec()); +} + +void LLViewerWindow::updateKeyboardFocus() +{ + // clean up current focus + LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); + if (cur_focus) + { + if (!cur_focus->isInVisibleChain() || !cur_focus->isInEnabledChain()) + { + gFocusMgr.releaseFocusIfNeeded(cur_focus); + + LLUICtrl* parent = cur_focus->getParentUICtrl(); + const LLUICtrl* focus_root = cur_focus->findRootMostFocusRoot(); + while(parent) + { + if (parent->isCtrl() && + (parent->hasTabStop() || parent == focus_root) && + !parent->getIsChrome() && + parent->isInVisibleChain() && + parent->isInEnabledChain()) + { + if (!parent->focusFirstItem()) + { + parent->setFocus(TRUE); + } + break; + } + parent = parent->getParentUICtrl(); + } + } + else if (cur_focus->isFocusRoot()) + { + // focus roots keep trying to delegate focus to their first valid descendant + // this assumes that focus roots are not valid focus holders on their own + cur_focus->focusFirstItem(); + } + } // last ditch force of edit menu to selection manager if (LLEditMenuHandler::gEditMenuHandler == NULL && LLSelectMgr::getInstance()->getSelection()->getObjectCount()) @@ -2832,6 +2878,10 @@ BOOL LLViewerWindow::handlePerFrameHover() gFloaterView->syncFloaterTabOrder(); } + if(LLSideTray::instanceCreated())//just getInstance will create sidetray. we don't want this + LLSideTray::getInstance()->highlightFocused(); + + if (gSavedSettings.getBOOL("ChatBarStealsFocus") && gChatBar && gFocusMgr.getKeyboardFocus() == NULL @@ -2840,70 +2890,28 @@ BOOL LLViewerWindow::handlePerFrameHover() gChatBar->startChat(NULL); } - // cleanup unused selections when no modal dialogs are open - if (LLModalDialog::activeCount() == 0) - { - LLViewerParcelMgr::getInstance()->deselectUnused(); - } - if (LLModalDialog::activeCount() == 0) - { - LLSelectMgr::getInstance()->deselectUnused(); - } - - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST)) - { - gDebugRaycastFaceHit = -1; - gDebugRaycastObject = cursorIntersect(-1, -1, 512.f, NULL, -1, FALSE, - &gDebugRaycastFaceHit, - &gDebugRaycastIntersection, - &gDebugRaycastTexCoord, - &gDebugRaycastNormal, - &gDebugRaycastBinormal); - } - - - // per frame picking - for tooltips and changing cursor over interactive objects - static S32 previous_x = -1; - static S32 previous_y = -1; - static BOOL mouse_moved_since_pick = FALSE; - - if ((previous_x != x) || (previous_y != y)) - mouse_moved_since_pick = TRUE; - - BOOL do_pick = FALSE; +} - F32 picks_moving = gSavedSettings.getF32("PicksPerSecondMouseMoving"); - if ((mouse_moved_since_pick) && (picks_moving > 0.0) && (mPickTimer.getElapsedTimeF32() > 1.0f / picks_moving)) - { - do_pick = TRUE; - } +void LLViewerWindow::updateWorldViewRect() +{ + if (!LLSideTray::instanceCreated()) return; - F32 picks_stationary = gSavedSettings.getF32("PicksPerSecondMouseStationary"); - if ((!mouse_moved_since_pick) && (picks_stationary > 0.0) && (mPickTimer.getElapsedTimeF32() > 1.0f / picks_stationary)) + LLRect new_world_rect = mWindowRect; + LLSideTray* sidetray = LLSideTray::getInstance(); + if (sidetray->getVisible()) { - do_pick = TRUE; + new_world_rect.mRight -= llround((F32)sidetray->getTrayWidth() * mDisplayScale.mV[VX]); } - - if (getCursorHidden()) + if (mWorldViewRect != new_world_rect) { - do_pick = FALSE; - } - - if (do_pick) - { - mouse_moved_since_pick = FALSE; - mPickTimer.reset(); - pickAsync(getCurrentMouseX(), getCurrentMouseY(), mask, hoverPickCallback, TRUE); + mWorldViewRect = new_world_rect; + gResizeScreenTexture = TRUE; + LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRect.getHeight() ); + LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() ); } - - previous_x = x; - previous_y = y; - - return handled; } - /* static */ void LLViewerWindow::hoverPickCallback(const LLPickInfo& pick_info) { @@ -3164,7 +3172,7 @@ void LLViewerWindow::pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback } // push back pick info object - BOOL in_build_mode = gFloaterTools && gFloaterTools->getVisible(); + BOOL in_build_mode = LLFloaterReg::instanceVisible("build"); if (in_build_mode || LLDrawPoolAlpha::sShowDebugAlpha) { // build mode allows interaction with all transparent objects @@ -3179,10 +3187,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 < 0) mPickScreenRegion.translate(-mPickScreenRegion.mLeft, 0); - if (mPickScreenRegion.mBottom < 0) mPickScreenRegion.translate(0, -mPickScreenRegion.mBottom); - if (mPickScreenRegion.mRight > mWindowRect.getWidth() ) mPickScreenRegion.translate(mWindowRect.getWidth() - mPickScreenRegion.mRight, 0); - if (mPickScreenRegion.mTop > mWindowRect.getHeight() ) mPickScreenRegion.translate(0, mWindowRect.getHeight() - mPickScreenRegion.mTop); + 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); } // set frame buffer region for picking results @@ -3210,77 +3218,6 @@ void LLViewerWindow::schedulePick(LLPickInfo& pick_info) llassert_always(pick_info.mScreenRegion.notNull()); mPicks.push_back(pick_info); - /*S32 scaled_x = llround((F32)pick_info.mMousePt.mX * mDisplayScale.mV[VX]); - S32 scaled_y = llround((F32)pick_info.mMousePt.mY * mDisplayScale.mV[VY]); - - // Default to not hitting anything - LLCamera pick_camera; - pick_camera.setOrigin(LLViewerCamera::getInstance()->getOrigin()); - pick_camera.setOriginAndLookAt(LLViewerCamera::getInstance()->getOrigin(), - LLViewerCamera::getInstance()->getUpAxis(), - LLViewerCamera::getInstance()->getOrigin() + mouseDirectionGlobal(pick_info.mMousePt.mX, pick_info.mMousePt.mY)); - pick_camera.setView(0.5f*DEG_TO_RAD); - pick_camera.setNear(LLViewerCamera::getInstance()->getNear()); - pick_camera.setFar(LLViewerCamera::getInstance()->getFar()); - pick_camera.setAspect(1.f); - - // save our drawing state - // *TODO: should we be saving using the new method here using - // glh_get_current_projection/glh_set_current_projection? -brad - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - - // clear work area - { - LLGLState scissor_state(GL_SCISSOR_TEST); - scissor_state.enable(); - glScissor(pick_info.mScreenRegion.mLeft, pick_info.mScreenRegion.mBottom, pick_info.mScreenRegion.getWidth(), pick_info.mScreenRegion.getHeight()); - glClearColor(0.f, 0.f, 0.f, 0.f); - glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - //glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - } - - // build perspective transform and picking viewport - // Perform pick on a PICK_DIAMETER x PICK_DIAMETER pixel region around cursor point. - // Don't limit the select distance for this pick. - LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION, scaled_x - PICK_HALF_WIDTH, scaled_y - PICK_HALF_WIDTH, PICK_DIAMETER, PICK_DIAMETER, FALSE); - - // render for object picking - - // make viewport big enough to handle antialiased frame buffers - gGLViewport[0] = pick_info.mScreenRegion.mLeft; - gGLViewport[1] = pick_info.mScreenRegion.mBottom; - gGLViewport[2] = pick_info.mScreenRegion.getWidth(); - gGLViewport[3] = pick_info.mScreenRegion.getHeight(); - - glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); - LLViewerCamera::updateFrustumPlanes(pick_camera); - stop_glerror(); - - // Draw the objects so the user can select them. - // The starting ID is 1, since land is zero. - LLRect pick_region; - pick_region.setOriginAndSize(pick_info.mMousePt.mX - PICK_HALF_WIDTH, - pick_info.mMousePt.mY - PICK_HALF_WIDTH, PICK_DIAMETER, PICK_DIAMETER); - gObjectList.renderObjectsForSelect(pick_camera, pick_region, FALSE, pick_info.mPickTransparent); - - stop_glerror(); - - // restore drawing state - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - - setup3DRender(); - setup2DRender(); - setupViewport();*/ - // delay further event processing until we receive results of pick mWindow->delayInputProcessing(); } @@ -3449,16 +3386,16 @@ LLVector3 LLViewerWindow::mouseDirectionGlobal(const S32 x, const S32 y) const // find vertical field of view F32 fov = LLViewerCamera::getInstance()->getView(); - // find screen resolution - S32 height = getWindowHeight(); - S32 width = getWindowWidth(); + // find world view center + F32 center_x = (F32)getWorldViewRect().getCenterX(); + F32 center_y = (F32)getWorldViewRect().getCenterY(); // calculate pixel distance to screen - F32 distance = (height / 2.f) / (tan(fov / 2.f)); + F32 distance = (getWorldViewHeight() / 2.f) / (tan(fov / 2.f)); // calculate click point relative to middle of screen - F32 click_x = x - width / 2.f; - F32 click_y = y - height / 2.f; + F32 click_x = x - center_x; + F32 click_y = y - center_y; // compute mouse vector LLVector3 mouse_vector = distance * LLViewerCamera::getInstance()->getAtAxis() @@ -3473,12 +3410,15 @@ 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 = getWindowHeight(); - S32 width = getWindowWidth(); + S32 height = getWorldViewHeight(); + + // find world view center + F32 center_x = (F32)getWorldViewRect().getCenterX(); + F32 center_y = (F32)getWorldViewRect().getCenterY(); // remap with uniform scale (1/height) so that top is -0.5, bottom is +0.5 - F32 hud_x = -((F32)x - (F32)width/2.f) / height; - F32 hud_y = ((F32)y - (F32)height/2.f) / height; + F32 hud_x = -((F32)x - center_x) / height; + F32 hud_y = ((F32)y - center_y) / height; return LLVector3(0.f, hud_x/gAgent.mHUDCurZoom, hud_y/gAgent.mHUDCurZoom); } @@ -3492,12 +3432,16 @@ LLVector3 LLViewerWindow::mouseDirectionCamera(const S32 x, const S32 y) const F32 fov_width = fov_height * LLViewerCamera::getInstance()->getAspect(); // find screen resolution - S32 height = getWindowHeight(); - S32 width = getWindowWidth(); + S32 height = getWorldViewHeight(); + S32 width = getWorldViewWidth(); + + // find world view center + F32 center_x = (F32)getWorldViewRect().getCenterX(); + F32 center_y = (F32)getWorldViewRect().getCenterY(); // calculate click point relative to middle of screen - F32 click_x = (((F32)x / (F32)width) - 0.5f) * fov_width * -1.f; - F32 click_y = (((F32)y / (F32)height) - 0.5f) * fov_height; + F32 click_x = (((F32)x - center_x) / (F32)width) * fov_width * -1.f; + F32 click_y = (((F32)y - center_y) / (F32)height) * fov_height; // compute mouse vector LLVector3 mouse_vector = LLVector3(0.f, 0.f, -1.f); @@ -3841,7 +3785,6 @@ BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 p glClearColor(0.f, 0.f, 0.f, 0.f); glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); setup3DRender(); - setupViewport(); LLFontGL::setFontDisplay(FALSE) ; LLHUDText::setDisplayText(FALSE) ; @@ -3902,7 +3845,6 @@ BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 p mDisplayScale.setVec(display_scale) ; mWindowRect = window_rect; setup3DRender(); - setupViewport(); gDisplaySwapBuffers = FALSE; gDepthDirty = TRUE; @@ -4070,7 +4012,6 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei LLViewerCamera::getInstance()->setZoomParameters(scale_factor, subimage_x+(subimage_y*llceil(scale_factor))); setup3DRender(); - setupViewport(); gObjectList.renderPickList(gViewerWindow->getVirtualWindowRect(), FALSE, FALSE); } else @@ -4215,14 +4156,14 @@ void LLViewerWindow::destroyWindow() void LLViewerWindow::drawMouselookInstructions() { // Draw instructions for mouselook ("Press ESC to leave Mouselook" in a box at the top of the screen.) - const std::string instructions = "Press ESC to leave Mouselook."; - const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); + const std::string instructions = LLTrans::getString("LeaveMouselook"); + const LLFontGL* font = LLFontGL::getFontSansSerif(); const S32 INSTRUCTIONS_PAD = 5; LLRect instructions_rect; instructions_rect.setLeftTopAndSize( - INSTRUCTIONS_PAD, - getWindowHeight() - INSTRUCTIONS_PAD, + mWorldViewRect.mLeft + INSTRUCTIONS_PAD, + mWorldViewRect.mTop - INSTRUCTIONS_PAD, font->getWidth( instructions ) + 2 * INSTRUCTIONS_PAD, llround(font->getLineHeight() + 2 * INSTRUCTIONS_PAD)); @@ -4251,6 +4192,46 @@ S32 LLViewerWindow::getWindowWidth() const return mVirtualWindowRect.getWidth(); } +void* LLViewerWindow::getPlatformWindow() const +{ + return mWindow->getPlatformWindow(); +} + +void* LLViewerWindow::getMediaWindow() const +{ + return mWindow->getMediaWindow(); +} + +void LLViewerWindow::focusClient() const +{ + return mWindow->focusClient(); +} + +LLRootView* LLViewerWindow::getRootView() const +{ + return mRootView; +} + +LLRect LLViewerWindow::getVirtualWorldViewRect() const +{ + LLRect world_view_rect = mWorldViewRect; + 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]); + world_view_rect.mTop = llround((F32)world_view_rect.mTop / mDisplayScale.mV[VY]); + return world_view_rect; +} + +S32 LLViewerWindow::getWorldViewHeight() const +{ + return mWorldViewRect.getHeight(); +} + +S32 LLViewerWindow::getWorldViewWidth() const +{ + return mWorldViewRect.getWidth(); +} + S32 LLViewerWindow::getWindowDisplayHeight() const { return mWindowRect.getHeight(); @@ -4261,27 +4242,48 @@ S32 LLViewerWindow::getWindowDisplayWidth() const return mWindowRect.getWidth(); } -void LLViewerWindow::setupViewport(S32 x_offset, S32 y_offset) +void LLViewerWindow::setup2DRender() +{ + // setup ortho camera + gl_state_for_2d(mWindowRect.getWidth(), mWindowRect.getHeight()); + setup2DViewport(); +} + +void LLViewerWindow::setup2DViewport(S32 x_offset, S32 y_offset) { - gGLViewport[0] = x_offset; - gGLViewport[1] = y_offset; + gGLViewport[0] = mWindowRect.mLeft + x_offset; + gGLViewport[1] = mWindowRect.mBottom + y_offset; gGLViewport[2] = mWindowRect.getWidth(); gGLViewport[3] = mWindowRect.getHeight(); glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); } + void LLViewerWindow::setup3DRender() { - LLViewerCamera::getInstance()->setPerspective(NOT_FOR_SELECTION, 0, 0, mWindowRect.getWidth(), mWindowRect.getHeight(), FALSE, LLViewerCamera::getInstance()->getNear(), MAX_FAR_CLIP*2.f); + // 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); + setup3DViewport(); } -void LLViewerWindow::setup2DRender() +void LLViewerWindow::setup3DViewport(S32 x_offset, S32 y_offset) { - gl_state_for_2d(mWindowRect.getWidth(), mWindowRect.getHeight()); + if (LLRenderTarget::getCurrentBoundTarget() != NULL) + { + // don't use translation component of mWorldViewRect, 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[2] = mWorldViewRect.getWidth(); + gGLViewport[3] = mWorldViewRect.getHeight(); + glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); } - - void LLViewerWindow::setShowProgress(const BOOL show) { if (mProgressView) @@ -4295,6 +4297,10 @@ BOOL LLViewerWindow::getShowProgress() const return (mProgressView && mProgressView->getVisible()); } +void LLViewerWindow::handleLoginComplete() +{ + LLNavigationBar::getInstance()->handleLoginComplete(); +} void LLViewerWindow::moveProgressViewToFront() { @@ -4405,7 +4411,7 @@ void LLViewerWindow::stopGL(BOOL save_state) gGLManager.mIsDisabled = TRUE; stop_glerror(); - llinfos << "Remaining allocated texture memory: " << LLImageGL::sGlobalTextureMemory << " bytes" << llendl; + llinfos << "Remaining allocated texture memory: " << LLImageGL::sGlobalTextureMemoryInBytes << " bytes" << llendl; } } @@ -4463,12 +4469,16 @@ void LLViewerWindow::restoreGL(const std::string& progress_message) void LLViewerWindow::initFonts(F32 zoom_factor) { LLFontGL::destroyAllGL(); - LLFontGL::initDefaultFonts( gSavedSettings.getF32("FontScreenDPI"), + // Initialize with possibly different zoom factor + LLFontGL::initClass( gSavedSettings.getF32("FontScreenDPI"), mDisplayScale.mV[VX] * zoom_factor, mDisplayScale.mV[VY] * zoom_factor, gDirUtilp->getAppRODataDir(), - LLUICtrlFactory::getXUIPaths()); + LLUI::getXUIPaths()); + // Force font reloads, which can be very slow + LLFontGL::loadDefaultFonts(); } + void LLViewerWindow::toggleFullscreen(BOOL show_progress) { if (mWindow) @@ -4501,6 +4511,11 @@ void LLViewerWindow::getTargetWindow(BOOL& fullscreen, S32& width, S32& height) } } +void LLViewerWindow::requestResolutionUpdate() +{ + mResDirty = true; +} + void LLViewerWindow::requestResolutionUpdate(bool fullscreen_checked) { mResDirty = true; @@ -4534,7 +4549,7 @@ BOOL LLViewerWindow::checkSettings() // force aspect ratio if (mIsFullscreenChecked) { - LLViewerCamera::getInstance()->setAspect( getDisplayAspectRatio() ); + LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() ); } mResDirty = false; @@ -4605,9 +4620,9 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, BOOL was_maximized = gSavedSettings.getBOOL("WindowMaximized"); mWantFullscreen = fullscreen; mShowFullscreenProgress = show_progress_bar; - gSavedSettings.setBOOL("FullScreen", mWantFullscreen); + gSavedSettings.setBOOL("NotFullScreen", !mWantFullscreen); - gResizeScreenTexture = TRUE; + //gResizeScreenTexture = TRUE; BOOL old_fullscreen = mWindow->getFullscreen(); if (!old_fullscreen && fullscreen && !LLStartUp::canGoFullscreen()) @@ -4635,7 +4650,7 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, } // Close floaters that don't handle settings change - LLFloaterSnapshot::hide(0); + LLFloaterReg::hideInstance("snapshot"); BOOL result_first_try = FALSE; BOOL result_second_try = FALSE; @@ -4753,6 +4768,21 @@ 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(); + if (mWindow->getFullscreen()) + { + return world_aspect * mWindow->getPixelAspectRatio(); + } + else + { + llinfos << "World aspect ratio: " << world_aspect << llendl; + return world_aspect; + } +} + void LLViewerWindow::drawPickBuffer() const { mHoverPick.drawPickBuffer(); @@ -4795,6 +4825,8 @@ void LLViewerWindow::calcDisplayScale() } } +S32 TOOL_BAR_HEIGHT = 20; // *TODO:Skinning Fix + S32 LLViewerWindow::getChatConsoleBottomPad() { S32 offset = 0; @@ -4857,63 +4889,6 @@ bool LLViewerWindow::onAlert(const LLSD& notify) } //////////////////////////////////////////////////////////////////////////// - -LLBottomPanel::LLBottomPanel(const LLRect &rect) : - LLPanel(LLStringUtil::null, rect, FALSE), - mIndicator(NULL) -{ - // bottom panel is focus root, so Tab moves through the toolbar and button bar, and overlay - setFocusRoot(TRUE); - // flag this panel as chrome so buttons don't grab keyboard focus - setIsChrome(TRUE); - - mFactoryMap["toolbar"] = LLCallbackMap(createToolBar, NULL); - mFactoryMap["overlay"] = LLCallbackMap(createOverlayBar, NULL); - mFactoryMap["hud"] = LLCallbackMap(createHUD, NULL); - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_bars.xml", &getFactoryMap()); - - setOrigin(rect.mLeft, rect.mBottom); - reshape(rect.getWidth(), rect.getHeight()); -} - -void LLBottomPanel::setFocusIndicator(LLView * indicator) -{ - mIndicator = indicator; -} - -void LLBottomPanel::draw() -{ - if(mIndicator) - { - BOOL hasFocus = gFocusMgr.childHasKeyboardFocus(this); - mIndicator->setVisible(hasFocus); - mIndicator->setEnabled(hasFocus); - } - LLPanel::draw(); -} - -void* LLBottomPanel::createHUD(void* data) -{ - delete gHUDView; - gHUDView = new LLHUDView(); - return gHUDView; -} - - -void* LLBottomPanel::createOverlayBar(void* data) -{ - delete gOverlayBar; - gOverlayBar = new LLOverlayBar(); - return gOverlayBar; -} - -void* LLBottomPanel::createToolBar(void* data) -{ - delete gToolBar; - gToolBar = new LLToolBar(); - return gToolBar; -} - // // LLPickInfo // @@ -4985,8 +4960,8 @@ void LLPickInfo::fetchResults() // find pick region that is fully onscreen LLCoordGL scaled_pick_point;; - scaled_pick_point.mX = llclamp(llround((F32)mMousePt.mX * gViewerWindow->getDisplayScale().mV[VX]), PICK_HALF_WIDTH, gViewerWindow->getWindowDisplayWidth() - PICK_HALF_WIDTH); - scaled_pick_point.mY = llclamp(llround((F32)mMousePt.mY * gViewerWindow->getDisplayScale().mV[VY]), PICK_HALF_WIDTH, gViewerWindow->getWindowDisplayHeight() - PICK_HALF_WIDTH); + scaled_pick_point.mX = llclamp(llround((F32)mMousePt.mX * gViewerWindow->getDisplayScale().mV[VX]), PICK_HALF_WIDTH, gViewerWindow->getWorldViewWidth() - PICK_HALF_WIDTH); + scaled_pick_point.mY = llclamp(llround((F32)mMousePt.mY * gViewerWindow->getDisplayScale().mV[VY]), PICK_HALF_WIDTH, gViewerWindow->getWorldViewHeight() - PICK_HALF_WIDTH); //S32 pixel_index = PICK_HALF_WIDTH * PICK_DIAMETER + PICK_HALF_WIDTH; //S32 pick_id = (U32)mPickBuffer[(pixel_index * 4) + 0] << 16 | (U32)mPickBuffer[(pixel_index * 4) + 1] << 8 | (U32)mPickBuffer[(pixel_index * 4) + 2]; //F32 depth = mPickDepthBuffer[pixel_index]; diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 509a7c4884f340482aa65a6e8157a241ba99cef1..eae1bf0343b4edac513e6009a3d0e2607e233911 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -44,12 +44,12 @@ #include "v3dmath.h" #include "v2math.h" -#include "llwindow.h" +#include "llwindowcallbacks.h" #include "lltimer.h" #include "llstat.h" -#include "llalertdialog.h" #include "llnotifications.h" #include "llmousehandler.h" +#include "llcursortypes.h" class LLView; class LLViewerObject; @@ -60,6 +60,8 @@ class LLVelocityBar; class LLTextBox; class LLImageRaw; class LLHUDIcon; +class LLWindow; +class LLRootView; #define PICK_HALF_WIDTH 5 #define PICK_DIAMETER (2 * PICK_HALF_WIDTH + 1) @@ -181,15 +183,22 @@ public: /*virtual*/ void handlePingWatchdog(LLWindow *window, const char * msg); /*virtual*/ void handlePauseWatchdog(LLWindow *window); /*virtual*/ void handleResumeWatchdog(LLWindow *window); - + /*virtual*/ std::string translateString(const char* tag); + /*virtual*/ std::string translateString(const char* tag, + const std::map<std::string, std::string>& args); // // ACCESSORS // - LLView* getRootView() const { return mRootView; } + LLRootView* getRootView() 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; @@ -200,9 +209,9 @@ public: S32 getWindowWidth() const; LLWindow* getWindow() const { return mWindow; } - void* getPlatformWindow() const { return mWindow->getPlatformWindow(); } - void* getMediaWindow() const { return mWindow->getMediaWindow(); } - void focusClient() const { return mWindow->focusClient(); }; + void* getPlatformWindow() const; + void* getMediaWindow() const; + void focusClient() const; LLCoordGL getLastMouse() const { return mLastMousePoint; } S32 getLastMouseX() const { return mLastMousePoint.mX; } @@ -221,7 +230,8 @@ public: const LLPickInfo& getLastPick() const { return mLastPick; } const LLPickInfo& getHoverPick() const { return mHoverPick; } - void setupViewport(S32 x_offset = 0, S32 y_offset = 0); + void setup2DViewport(S32 x_offset = 0, S32 y_offset = 0); + void setup3DViewport(S32 x_offset = 0, S32 y_offset = 0); void setup3DRender(); void setup2DRender(); @@ -258,10 +268,17 @@ public: void setProgressMessage(const std::string& msg); void setProgressCancelButtonVisible( BOOL b, const std::string& label = LLStringUtil::null ); LLProgressView *getProgressView() const; + void handleLoginComplete(); void updateObjectUnderCursor(); - BOOL handlePerFrameHover(); // Once per frame, update UI based on mouse position + void updateUI(); // Once per frame, update UI based on mouse position, calls following update* functions + void updateLayout(); + void updateMouseDelta(); + void updateKeyboardFocus(); + void updatePicking(S32 x, S32 y, MASK mask); + + void updateWorldViewRect(); BOOL handleKey(KEY key, MASK mask); void handleScrollWheel (S32 clicks); @@ -349,11 +366,13 @@ public: // handle shutting down GL and bringing it back up void requestResolutionUpdate(bool fullscreen_checked); + void requestResolutionUpdate(); // doesn't affect fullscreen BOOL checkSettings(); void restartDisplay(BOOL show_progress_bar); BOOL changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync, BOOL show_progress_bar); BOOL getIgnoreDestroyWindow() { return mIgnoreActivate; } F32 getDisplayAspectRatio() const; + F32 getWorldViewAspectRatio() const; const LLVector2& getDisplayScale() const { return mDisplayScale; } void calcDisplayScale(); @@ -382,7 +401,8 @@ protected: BOOL mShowFullscreenProgress; LLRect mWindowRect; LLRect mVirtualWindowRect; - LLView* mRootView; // a view of size mWindowRect, containing all child views + LLRect mWorldViewRect; // specifies area of screen where we render the 3D world + LLRootView* mRootView; // a view of size mWindowRect, containing all child views LLVector2 mDisplayScale; LLCoordGL mCurrentMousePoint; // last mouse position in GL coords @@ -401,6 +421,8 @@ protected: BOOL mMouseInWindow; // True if the mouse is over our window or if we have captured the mouse. BOOL mFocusCycleMode; + typedef std::set<LLHandle<LLView> > view_handle_set_t; + view_handle_set_t mMouseHoverViews; // Variables used for tool override switching based on modifier keys. JC MASK mLastMask; // used to detect changes in modifier mask @@ -435,36 +457,16 @@ protected: static std::string sMovieBaseName; }; -class LLBottomPanel : public LLPanel -{ -public: - LLBottomPanel(const LLRect& rect); - void setFocusIndicator(LLView * indicator); - LLView * getFocusIndicator() { return mIndicator; } - /*virtual*/ void draw(); - - static void* createHUD(void* data); - static void* createOverlayBar(void* data); - static void* createToolBar(void* data); - -protected: - LLView * mIndicator; -}; -extern LLBottomPanel * gBottomPanel; - void toggle_flying(void*); void toggle_first_person(); void toggle_build(void*); void reset_viewer_state_on_sim(void); void update_saved_window_size(const std::string& control,S32 delta_width, S32 delta_height); - - // // Globals // -extern LLVelocityBar* gVelocityBar; extern LLViewerWindow* gViewerWindow; extern LLFrameTimer gMouseIdleTimer; // how long has it been since the mouse last moved? diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 168b0056e5a2383764d79d775d13a2b6fc37415d..176f8fb37bae65f2c94d454ff5137c3c13b8a95d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1,5 +1,5 @@ /** - * @file llvoavatar.cpp + * @File llvoavatar.cpp * @brief Implementation of LLVOAvatar class which is a derivation fo LLViewerObject * * $LicenseInfo:firstyear=2001&license=viewergpl$ @@ -41,6 +41,8 @@ #include "noise.h" #include "llagent.h" // Get state values from here +#include "llagentwearables.h" +#include "llanimationstates.h" #include "llviewercontrol.h" #include "lldrawpoolavatar.h" #include "lldriverparam.h" @@ -63,8 +65,6 @@ #include "llsprite.h" #include "lltargetingmotion.h" #include "lltexlayer.h" -#include "lltoolgrab.h" // for needsRenderBeam -#include "lltoolmgr.h" // for needsRenderBeam #include "lltoolmorph.h" #include "llviewercamera.h" #include "llviewerimagelist.h" @@ -72,12 +72,15 @@ #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerstats.h" +#include "llvoavatarself.h" #include "llvovolume.h" #include "llworld.h" #include "pipeline.h" #include "llviewershadermgr.h" #include "llsky.h" #include "llanimstatelabels.h" +#include "lltrans.h" + #include "llgesturemgr.h" //needed to trigger the voice gesticulations #include "llvoiceclient.h" #include "llvoicevisualizer.h" // Ventrella @@ -136,8 +139,7 @@ const S32 MIN_REQUIRED_PIXEL_AREA_PELVIS_FIX = 40; const S32 TEX_IMAGE_SIZE_SELF = 512; const S32 TEX_IMAGE_AREA_SELF = TEX_IMAGE_SIZE_SELF * TEX_IMAGE_SIZE_SELF; -const S32 TEX_IMAGE_SIZE_OTHER = TEX_IMAGE_SIZE_SELF / 4; // The size of local textures for other (!mIsSelf) avatars -const S32 TEX_IMAGE_AREA_OTHER = TEX_IMAGE_SIZE_OTHER * TEX_IMAGE_SIZE_OTHER; +const S32 TEX_IMAGE_SIZE_OTHER = 512 / 4; // The size of local textures for other (!isSelf()) avatars const F32 HEAD_MOVEMENT_AVG_TIME = 0.9f; @@ -175,25 +177,20 @@ enum ERenderName //----------------------------------------------------------------------------- // Callback data //----------------------------------------------------------------------------- -struct LLAvatarTexData -{ - LLAvatarTexData( const LLUUID& id, ETextureIndex index ) - : mAvatarID(id), mIndex(index) {} - LLUUID mAvatarID; - ETextureIndex mIndex; -}; struct LLTextureMaskData { - LLTextureMaskData( const LLUUID& id ) - : mAvatarID(id), mLastDiscardLevel(S32_MAX) {} + LLTextureMaskData( const LLUUID& id ) : + mAvatarID(id), + mLastDiscardLevel(S32_MAX) + {} LLUUID mAvatarID; S32 mLastDiscardLevel; }; /********************************************************************************* ** ** - ** Begin LLVOAvatar Support classes + ** Begin private LLVOAvatar Support classes ** **/ @@ -249,85 +246,6 @@ private: bone_info_list_t mBoneInfoList; }; - -//------------------------------------------------------------------------ -// LLVOAvatarXmlInfo -// One instance (in LLVOAvatar) with common data parsed from the XML files -//------------------------------------------------------------------------ -class LLVOAvatarXmlInfo -{ - friend class LLVOAvatar; -public: - LLVOAvatarXmlInfo(); - ~LLVOAvatarXmlInfo(); - -private: - BOOL parseXmlSkeletonNode(LLXmlTreeNode* root); - BOOL parseXmlMeshNodes(LLXmlTreeNode* root); - BOOL parseXmlColorNodes(LLXmlTreeNode* root); - BOOL parseXmlLayerNodes(LLXmlTreeNode* root); - BOOL parseXmlDriverNodes(LLXmlTreeNode* root); - - struct LLVOAvatarMeshInfo - { - typedef std::pair<LLPolyMorphTargetInfo*,BOOL> morph_info_pair_t; - typedef std::vector<morph_info_pair_t> morph_info_list_t; - - LLVOAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {} - ~LLVOAvatarMeshInfo() - { - morph_info_list_t::iterator iter; - for (iter = mPolyMorphTargetInfoList.begin(); iter != mPolyMorphTargetInfoList.end(); iter++) - { - delete iter->first; - } - mPolyMorphTargetInfoList.clear(); - } - - std::string mType; - S32 mLOD; - std::string mMeshFileName; - std::string mReferenceMeshName; - F32 mMinPixelArea; - morph_info_list_t mPolyMorphTargetInfoList; - }; - typedef std::vector<LLVOAvatarMeshInfo*> mesh_info_list_t; - mesh_info_list_t mMeshInfoList; - - typedef std::vector<LLPolySkeletalDistortionInfo*> skeletal_distortion_info_list_t; - skeletal_distortion_info_list_t mSkeletalDistortionInfoList; - - struct LLVOAvatarAttachmentInfo - { - LLVOAvatarAttachmentInfo() - : mGroup(-1), mAttachmentID(-1), mPieMenuSlice(-1), mVisibleFirstPerson(FALSE), - mIsHUDAttachment(FALSE), mHasPosition(FALSE), mHasRotation(FALSE) {} - std::string mName; - std::string mJointName; - LLVector3 mPosition; - LLVector3 mRotationEuler; - S32 mGroup; - S32 mAttachmentID; - S32 mPieMenuSlice; - BOOL mVisibleFirstPerson; - BOOL mIsHUDAttachment; - BOOL mHasPosition; - BOOL mHasRotation; - }; - typedef std::vector<LLVOAvatarAttachmentInfo*> attachment_info_list_t; - attachment_info_list_t mAttachmentInfoList; - - LLTexGlobalColorInfo *mTexSkinColorInfo; - LLTexGlobalColorInfo *mTexHairColorInfo; - LLTexGlobalColorInfo *mTexEyeColorInfo; - - typedef std::vector<LLTexLayerSetInfo*> layer_info_list_t; - layer_info_list_t mLayerInfoList; - - typedef std::vector<LLDriverParamInfo*> driver_info_list_t; - driver_info_list_t mDriverInfoList; -}; - //----------------------------------------------------------------------------- // class LLBodyNoiseMotion //----------------------------------------------------------------------------- @@ -492,7 +410,7 @@ public: virtual LLMotionInitStatus onInitialize(LLCharacter *character) { mCharacter = character; - bool success = true; + BOOL success = true; if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) ) { success = false; } @@ -651,15 +569,11 @@ private: //----------------------------------------------------------------------------- LLXmlTree LLVOAvatar::sXMLTree; LLXmlTree LLVOAvatar::sSkeletonXMLTree; -BOOL LLVOAvatar::sDebugAvatarRotation = FALSE; LLVOAvatarSkeletonInfo* LLVOAvatar::sAvatarSkeletonInfo = NULL; -LLVOAvatarXmlInfo* LLVOAvatar::sAvatarXmlInfo = NULL; +LLVOAvatar::LLVOAvatarXmlInfo* LLVOAvatar::sAvatarXmlInfo = NULL; LLVOAvatarDictionary *LLVOAvatar::sAvatarDictionary = NULL; S32 LLVOAvatar::sFreezeCounter = 0; S32 LLVOAvatar::sMaxVisible = 50; -LLMap< LLGLenum, LLGLuint*> LLVOAvatar::sScratchTexNames; -LLMap< LLGLenum, F32*> LLVOAvatar::sScratchTexLastBindTime; -S32 LLVOAvatar::sScratchTexBytes = 0; F32 LLVOAvatar::sRenderDistance = 256.f; S32 LLVOAvatar::sNumVisibleAvatars = 0; S32 LLVOAvatar::sNumLODChangesThisFrame = 0; @@ -730,8 +644,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mNameMute(FALSE), mRenderGroupTitles(sRenderGroupTitles), mNameAppearance(FALSE), - mLastRegionHandle(0), - mRegionCrossingCount(0), mFirstTEMessageReceived( FALSE ), mFirstAppearanceMessageReceived( FALSE ), mCulled( FALSE ), @@ -742,36 +654,29 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mNeedsSkin(FALSE), mUpdatePeriod(1), mFullyLoadedInitialized(FALSE), - mHasBakedHair( FALSE ) + mSupportsAlphaLayers(FALSE) { LLMemType mt(LLMemType::MTYPE_AVATAR); //VTResume(); // VTune // mVoiceVisualizer is created by the hud effects manager and uses the HUD Effects pipeline - const bool needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job + const BOOL needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim ); lldebugs << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << llendl; mPelvisp = NULL; - for( S32 i=0; i<TEX_NUM_INDICES; i++ ) - { - if (isIndexLocalTexture((ETextureIndex)i)) - { - mLocalTextureData[(ETextureIndex)i] = LocalTextureData(); - } - } - - mBakedTextureData.resize(BAKED_NUM_INDICES); - for (U32 i = 0; i < mBakedTextureData.size(); i++ ) + mBakedTextureDatas.resize(BAKED_NUM_INDICES); + for (U32 i = 0; i < mBakedTextureDatas.size(); i++ ) { - mBakedTextureData[i].mLastTextureIndex = IMG_DEFAULT_AVATAR; - mBakedTextureData[i].mTexLayerSet = NULL; - mBakedTextureData[i].mIsLoaded = false; - mBakedTextureData[i].mIsUsed = false; - mBakedTextureData[i].mMaskTexName = 0; - mBakedTextureData[i].mTextureIndex = getTextureIndex((EBakedTextureIndex)i); + mBakedTextureDatas[i].mLastTextureIndex = IMG_DEFAULT_AVATAR; + mBakedTextureDatas[i].mTexLayerSet = NULL; + mBakedTextureDatas[i].mIsLoaded = false; + mBakedTextureDatas[i].mIsUsed = false; + mBakedTextureDatas[i].mMaskTexName = 0; + mBakedTextureDatas[i].mTextureIndex = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)i); + mBakedTextureDatas[i].mMorphMasksValid = FALSE; } mDirtyMesh = TRUE; // Dirty geometry, need to regenerate. @@ -783,7 +688,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mNumJoints = 0; mSkeleton = NULL; - mScreenp = NULL; mNumCollisionVolumes = 0; mCollisionVolumes = NULL; @@ -792,17 +696,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mSpeed = 0.f; setAnimationData("Speed", &mSpeed); - if (id == gAgentID) - { - mIsSelf = TRUE; - gAgent.setAvatarObject(this); - lldebugs << "Marking avatar as self " << id << llendl; - } - else - { - mIsSelf = FALSE; - } - mNeedsImpostorUpdate = TRUE; mNeedsAnimUpdate = TRUE; @@ -837,146 +730,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mOohMorph = NULL; mAahMorph = NULL; - //------------------------------------------------------------------------- - // initialize joint, mesh and shape members - //------------------------------------------------------------------------- - mRoot.setName( "mRoot" ); - - for (LLVOAvatarDictionary::mesh_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin(); - iter != LLVOAvatarDictionary::getInstance()->getMeshes().end(); - iter++) - { - const EMeshIndex mesh_index = iter->first; - const LLVOAvatarDictionary::MeshDictionaryEntry *mesh_dict = iter->second; - - LLViewerJoint* joint = new LLViewerJoint(); - joint->setName(mesh_dict->mName); - joint->setMeshID(mesh_index); - mMeshLOD.push_back(joint); - - /* mHairLOD.setName("mHairLOD"); - mHairMesh0.setName("mHairMesh0"); - mHairMesh0.setMeshID(MESH_ID_HAIR); - mHairMesh1.setName("mHairMesh1"); */ - for (U32 lod = 0; lod < mesh_dict->mLOD; lod++) - { - LLViewerJointMesh* mesh = new LLViewerJointMesh(); - std::string mesh_name = "m" + mesh_dict->mName + boost::lexical_cast<std::string>(lod); - // We pre-pended an m - need to capitalize first character for camelCase - mesh_name[1] = toupper(mesh_name[1]); - mesh->setName(mesh_name); - mesh->setMeshID(mesh_index); - mesh->setPickName(mesh_dict->mPickName); - switch((int)mesh_index) - { - case MESH_ID_HAIR: - mesh->setIsTransparent(TRUE); - break; - case MESH_ID_SKIRT: - mesh->setIsTransparent(TRUE); - break; - case MESH_ID_EYEBALL_LEFT: - case MESH_ID_EYEBALL_RIGHT: - mesh->setSpecular( LLColor4( 1.0f, 1.0f, 1.0f, 1.0f ), 1.f ); - break; - } - - joint->mMeshParts.push_back(mesh); - } - } - - //------------------------------------------------------------------------- - // associate baked textures with meshes - //------------------------------------------------------------------------- - for (LLVOAvatarDictionary::mesh_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin(); - iter != LLVOAvatarDictionary::getInstance()->getMeshes().end(); - iter++) - { - const EMeshIndex mesh_index = iter->first; - const LLVOAvatarDictionary::MeshDictionaryEntry *mesh_dict = iter->second; - const EBakedTextureIndex baked_texture_index = mesh_dict->mBakedID; - - // Skip it if there's no associated baked texture. - if (baked_texture_index == BAKED_NUM_INDICES) continue; - - for (std::vector<LLViewerJointMesh* >::iterator iter = mMeshLOD[mesh_index]->mMeshParts.begin(); - iter != mMeshLOD[mesh_index]->mMeshParts.end(); iter++) - { - LLViewerJointMesh* mesh = (LLViewerJointMesh*) *iter; - mBakedTextureData[(int)baked_texture_index].mMeshes.push_back(mesh); - } - } - - - //------------------------------------------------------------------------- - // register motions - //------------------------------------------------------------------------- - if (LLCharacter::sInstances.size() == 1) - { - LLKeyframeMotion::setVFS(gStaticVFS); - registerMotion( ANIM_AGENT_BUSY, LLNullMotion::create ); - registerMotion( ANIM_AGENT_CROUCH, LLKeyframeStandMotion::create ); - registerMotion( ANIM_AGENT_CROUCHWALK, LLKeyframeWalkMotion::create ); - registerMotion( ANIM_AGENT_EXPRESS_AFRAID, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_ANGER, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_BORED, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_CRY, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_DISDAIN, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_EMBARRASSED, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_FROWN, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_KISS, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_LAUGH, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_OPEN_MOUTH, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_REPULSED, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_SAD, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_SHRUG, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_SMILE, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_SURPRISE, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_TONGUE_OUT, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_TOOTHSMILE, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_WINK, LLEmote::create ); - registerMotion( ANIM_AGENT_EXPRESS_WORRY, LLEmote::create ); - registerMotion( ANIM_AGENT_RUN, LLKeyframeWalkMotion::create ); - registerMotion( ANIM_AGENT_STAND, LLKeyframeStandMotion::create ); - registerMotion( ANIM_AGENT_STAND_1, LLKeyframeStandMotion::create ); - registerMotion( ANIM_AGENT_STAND_2, LLKeyframeStandMotion::create ); - registerMotion( ANIM_AGENT_STAND_3, LLKeyframeStandMotion::create ); - registerMotion( ANIM_AGENT_STAND_4, LLKeyframeStandMotion::create ); - registerMotion( ANIM_AGENT_STANDUP, LLKeyframeFallMotion::create ); - registerMotion( ANIM_AGENT_TURNLEFT, LLKeyframeWalkMotion::create ); - registerMotion( ANIM_AGENT_TURNRIGHT, LLKeyframeWalkMotion::create ); - registerMotion( ANIM_AGENT_WALK, LLKeyframeWalkMotion::create ); - - // motions without a start/stop bit - registerMotion( ANIM_AGENT_BODY_NOISE, LLBodyNoiseMotion::create ); - registerMotion( ANIM_AGENT_BREATHE_ROT, LLBreatheMotionRot::create ); - registerMotion( ANIM_AGENT_EDITING, LLEditingMotion::create ); - registerMotion( ANIM_AGENT_EYE, LLEyeMotion::create ); - registerMotion( ANIM_AGENT_FEMALE_WALK, LLKeyframeWalkMotion::create ); - registerMotion( ANIM_AGENT_FLY_ADJUST, LLFlyAdjustMotion::create ); - registerMotion( ANIM_AGENT_HAND_MOTION, LLHandMotion::create ); - registerMotion( ANIM_AGENT_HEAD_ROT, LLHeadRotMotion::create ); - registerMotion( ANIM_AGENT_PELVIS_FIX, LLPelvisFixMotion::create ); - registerMotion( ANIM_AGENT_SIT_FEMALE, LLKeyframeMotion::create ); - registerMotion( ANIM_AGENT_TARGET, LLTargetingMotion::create ); - registerMotion( ANIM_AGENT_WALK_ADJUST, LLWalkAdjustMotion::create ); - - } - - if (gNoRender) - { - return; - } - buildCharacter(); - - // preload specific motions here - createMotion( ANIM_AGENT_CUSTOMIZE); - createMotion( ANIM_AGENT_CUSTOMIZE_DONE); - - //VTPause(); // VTune - - mVoiceVisualizer->setVoiceEnabled( gVoiceClient->getVoiceEnabled( mID ) ); mCurrentGesticulationLevel = 0; + } //------------------------------------------------------------------------ @@ -986,46 +741,43 @@ LLVOAvatar::~LLVOAvatar() { lldebugs << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << llendl; - if (mIsSelf) + if (isSelf()) { gAgent.setAvatarObject(NULL); } mRoot.removeAllChildren(); - delete [] mSkeleton; - mSkeleton = NULL; - - delete mScreenp; - mScreenp = NULL; - - delete [] mCollisionVolumes; - mCollisionVolumes = NULL; - + deleteAndClearArray(mSkeleton); + deleteAndClearArray(mCollisionVolumes); mNumJoints = 0; - for (U32 i = 0; i < mBakedTextureData.size(); i++) + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - delete mBakedTextureData[i].mTexLayerSet; - mBakedTextureData[i].mTexLayerSet = NULL; + deleteAndClear(mBakedTextureDatas[i].mTexLayerSet); + mBakedTextureDatas[i].mMeshes.clear(); + + for (morph_list_t::iterator iter2 = mBakedTextureDatas[i].mMaskedMorphs.begin(); + iter2 != mBakedTextureDatas[i].mMaskedMorphs.end(); iter2++) + { + LLMaskedMorph* masked_morph = (*iter2); + delete masked_morph; + } } std::for_each(mAttachmentPoints.begin(), mAttachmentPoints.end(), DeletePairedPointer()); mAttachmentPoints.clear(); - delete mTexSkinColor; - mTexSkinColor = NULL; - delete mTexHairColor; - mTexHairColor = NULL; - delete mTexEyeColor; - mTexEyeColor = NULL; + deleteAndClear(mTexSkinColor); + deleteAndClear(mTexHairColor); + deleteAndClear(mTexEyeColor); std::for_each(mMeshes.begin(), mMeshes.end(), DeletePairedPointer()); mMeshes.clear(); for (std::vector<LLViewerJoint*>::iterator jointIter = mMeshLOD.begin(); - jointIter != mMeshLOD.end(); jointIter++) + jointIter != mMeshLOD.end(); jointIter++) { LLViewerJoint* joint = (LLViewerJoint *) *jointIter; std::for_each(joint->mMeshParts.begin(), joint->mMeshParts.end(), DeletePointer()); @@ -1036,9 +788,6 @@ LLVOAvatar::~LLVOAvatar() mDead = TRUE; - // Clean up class data - LLVOAvatar::cullAvatarsByPixelArea(); - mAnimationSources.clear(); lldebugs << "LLVOAvatar Destructor end" << llendl; @@ -1052,10 +801,7 @@ void LLVOAvatar::markDead() mNameText = NULL; sNumVisibleChatBubbles--; } - mVoiceVisualizer->markDead(); - - mBeam = NULL; LLViewerObject::markDead(); } @@ -1065,9 +811,9 @@ BOOL LLVOAvatar::isFullyBaked() if (mIsDummy) return TRUE; if (getNumTEs() == 0) return FALSE; - for (U32 i = 0; i < mBakedTextureData.size(); i++) + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - if (!isTextureDefined(mBakedTextureData[i].mTextureIndex) + if (!isTextureDefined(mBakedTextureDatas[i].mTextureIndex) && ( (i != BAKED_SKIRT) || isWearingWearableType(WT_SKIRT) ) ) { return FALSE; @@ -1078,19 +824,21 @@ BOOL LLVOAvatar::isFullyBaked() void LLVOAvatar::deleteLayerSetCaches(bool clearAll) { - for (U32 i = 0; i < mBakedTextureData.size(); i++) + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - if (mBakedTextureData[i].mTexLayerSet) + if (mBakedTextureDatas[i].mTexLayerSet) { - if ((i != BAKED_HAIR || mIsSelf) && !clearAll) // Backwards compatibility - can be removed after hair baking is mandatory on the grid + // ! BACKWARDS COMPATIBILITY ! + // Can be removed after hair baking is mandatory on the grid + if ((i != BAKED_HAIR || isSelf()) && !clearAll) { - mBakedTextureData[i].mTexLayerSet->deleteCaches(); + mBakedTextureDatas[i].mTexLayerSet->deleteCaches(); } } - if (mBakedTextureData[i].mMaskTexName) + if (mBakedTextureDatas[i].mMaskTexName) { - glDeleteTextures(1, (GLuint*)&(mBakedTextureData[i].mMaskTexName)); - mBakedTextureData[i].mMaskTexName = 0 ; + glDeleteTextures(1, (GLuint*)&(mBakedTextureDatas[i].mMaskTexName)); + mBakedTextureDatas[i].mMaskTexName = 0 ; } } } @@ -1101,20 +849,14 @@ BOOL LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars) BOOL res = TRUE; grey_avatars = 0; for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) + iter != LLCharacter::sInstances.end(); ++iter) { LLVOAvatar* inst = (LLVOAvatar*) *iter; if( inst->isDead() ) { continue; } -// else -// if( inst->getPixelArea() < MIN_PIXEL_AREA_FOR_COMPOSITE ) -// { -// return res; // Assumes sInstances is sorted by pixel area. -// } - else - if( !inst->isFullyBaked() ) + else if( !inst->isFullyBaked() ) { res = FALSE; if (inst->mHasGrey) @@ -1126,19 +868,13 @@ BOOL LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars) return res; } -// static -void LLVOAvatar::dumpScratchTextureByteCount() -{ - llinfos << "Scratch Texture GL: " << (sScratchTexBytes/1024) << "KB" << llendl; -} - // static void LLVOAvatar::dumpBakedStatus() { LLVector3d camera_pos_global = gAgent.getCameraPositionGlobal(); for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) + iter != LLCharacter::sInstances.end(); ++iter) { LLVOAvatar* inst = (LLVOAvatar*) *iter; llinfos << "Avatar "; @@ -1190,18 +926,17 @@ void LLVOAvatar::dumpBakedStatus() { llcont << " Unbaked ("; - for (LLVOAvatarDictionary::baked_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); + for (LLVOAvatarDictionary::BakedTextures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); iter++) { - const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = iter->second; + const LLVOAvatarDictionary::BakedEntry *baked_dict = iter->second; const ETextureIndex index = baked_dict->mTextureIndex; if (!inst->isTextureDefined(index)) { llcont << " " << LLVOAvatarDictionary::getInstance()->getTexture(index)->mName; } } - llcont << " ) " << inst->getUnbakedPixelAreaRank(); if( inst->isCulled() ) { @@ -1215,17 +950,15 @@ void LLVOAvatar::dumpBakedStatus() //static void LLVOAvatar::restoreGL() { - for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) + LLVOAvatar* self = gAgent.getAvatarObject(); + if (!self) + return; + self->setCompositeUpdatesEnabled(TRUE); + for (U32 i = 0; i < self->mBakedTextureDatas.size(); i++) { - LLVOAvatar* inst = (LLVOAvatar*) *iter; - inst->setCompositeUpdatesEnabled( TRUE ); - for (U32 i = 0; i < inst->mBakedTextureData.size(); i++) - { - inst->invalidateComposite( inst->mBakedTextureData[i].mTexLayerSet, FALSE ); - } - inst->updateMeshTextures(); + self->invalidateComposite(self->mBakedTextureDatas[i].mTexLayerSet, FALSE); } + self->updateMeshTextures(); } //static @@ -1240,7 +973,7 @@ void LLVOAvatar::destroyGL() void LLVOAvatar::resetImpostors() { for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) + iter != LLCharacter::sInstances.end(); ++iter) { LLVOAvatar* avatar = (LLVOAvatar*) *iter; avatar->mImpostor.release(); @@ -1254,33 +987,15 @@ void LLVOAvatar::deleteCachedImages(bool clearAll) { lldebugs << "Deleting layer set caches" << llendl; for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) + iter != LLCharacter::sInstances.end(); ++iter) { LLVOAvatar* inst = (LLVOAvatar*) *iter; inst->deleteLayerSetCaches(clearAll); } LLTexLayerSet::sHasCaches = FALSE; } - - for( LLGLuint* namep = sScratchTexNames.getFirstData(); - namep; - namep = sScratchTexNames.getNextData() ) - { - LLImageGL::deleteTextures(1, (U32 *)namep ); - stop_glerror(); - } - - if( sScratchTexBytes ) - { - lldebugs << "Clearing Scratch Textures " << (sScratchTexBytes/1024) << "KB" << llendl; - - sScratchTexNames.deleteAllData(); - LLVOAvatar::sScratchTexLastBindTime.deleteAllData(); - LLImageGL::sGlobalTextureMemory -= sScratchTexBytes; - sScratchTexBytes = 0; - } - - gTexStaticImageList.deleteCachedImages(); + LLVOAvatarSelf::deleteScratchTextures(); + LLTexLayerStaticImageList::getInstance()->deleteCachedImages(); } @@ -1382,59 +1097,207 @@ void LLVOAvatar::initClass() { llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl; } - + if (!sAvatarXmlInfo->parseXmlMorphNodes(root)) + { + llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl; + } } void LLVOAvatar::cleanupClass() { - delete sAvatarXmlInfo; - sAvatarXmlInfo = NULL; - delete sAvatarSkeletonInfo; - sAvatarSkeletonInfo = NULL; + deleteAndClear(sAvatarXmlInfo); sSkeletonXMLTree.cleanup(); sXMLTree.cleanup(); } -const LLVector3 LLVOAvatar::getRenderPosition() const -{ - if (mDrawable.isNull() || mDrawable->getGeneration() < 0) - { - return getPositionAgent(); - } - else if (isRoot()) - { - return mDrawable->getPositionAgent(); - } - else - { - return getPosition() * mDrawable->getParent()->getRenderMatrix(); - } -} - -void LLVOAvatar::updateDrawable(BOOL force_damped) -{ - clearChanged(SHIFTED); -} - -void LLVOAvatar::onShift(const LLVector3& shift_vector) -{ - mLastAnimExtents[0] += shift_vector; - mLastAnimExtents[1] += shift_vector; - mNeedsImpostorUpdate = TRUE; - mNeedsAnimUpdate = TRUE; -} - -void LLVOAvatar::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax) +void LLVOAvatar::initInstance(void) { - if (isImpostor() && !needsImpostorUpdate()) + //------------------------------------------------------------------------- + // initialize joint, mesh and shape members + //------------------------------------------------------------------------- + mRoot.setName( "mRoot" ); + + for (LLVOAvatarDictionary::Meshes::const_iterator iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin(); + iter != LLVOAvatarDictionary::getInstance()->getMeshes().end(); + iter++) { - LLVector3 delta = getRenderPosition() - - ((LLVector3(mDrawable->getPositionGroup())-mImpostorOffset)); - - newMin = mLastAnimExtents[0] + delta; - newMax = mLastAnimExtents[1] + delta; - } + const EMeshIndex mesh_index = iter->first; + const LLVOAvatarDictionary::MeshEntry *mesh_dict = iter->second; + LLViewerJoint* joint = new LLViewerJoint(); + joint->setName(mesh_dict->mName); + joint->setMeshID(mesh_index); + mMeshLOD.push_back(joint); + + /* mHairLOD.setName("mHairLOD"); + mHairMesh0.setName("mHairMesh0"); + mHairMesh0.setMeshID(MESH_ID_HAIR); + mHairMesh1.setName("mHairMesh1"); */ + for (U32 lod = 0; lod < mesh_dict->mLOD; lod++) + { + LLViewerJointMesh* mesh = new LLViewerJointMesh(); + std::string mesh_name = "m" + mesh_dict->mName + boost::lexical_cast<std::string>(lod); + // We pre-pended an m - need to capitalize first character for camelCase + mesh_name[1] = toupper(mesh_name[1]); + mesh->setName(mesh_name); + mesh->setMeshID(mesh_index); + mesh->setPickName(mesh_dict->mPickName); + mesh->setIsTransparent(FALSE); + switch((int)mesh_index) + { + case MESH_ID_HAIR: + mesh->setIsTransparent(TRUE); + break; + case MESH_ID_SKIRT: + mesh->setIsTransparent(TRUE); + break; + case MESH_ID_EYEBALL_LEFT: + case MESH_ID_EYEBALL_RIGHT: + mesh->setSpecular( LLColor4( 1.0f, 1.0f, 1.0f, 1.0f ), 1.f ); + break; + } + + joint->mMeshParts.push_back(mesh); + } + } + + //------------------------------------------------------------------------- + // associate baked textures with meshes + //------------------------------------------------------------------------- + for (LLVOAvatarDictionary::Meshes::const_iterator iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin(); + iter != LLVOAvatarDictionary::getInstance()->getMeshes().end(); + iter++) + { + const EMeshIndex mesh_index = iter->first; + const LLVOAvatarDictionary::MeshEntry *mesh_dict = iter->second; + const EBakedTextureIndex baked_texture_index = mesh_dict->mBakedID; + // Skip it if there's no associated baked texture. + if (baked_texture_index == BAKED_NUM_INDICES) continue; + + for (std::vector<LLViewerJointMesh* >::iterator iter = mMeshLOD[mesh_index]->mMeshParts.begin(); + iter != mMeshLOD[mesh_index]->mMeshParts.end(); iter++) + { + LLViewerJointMesh* mesh = (LLViewerJointMesh*) *iter; + mBakedTextureDatas[(int)baked_texture_index].mMeshes.push_back(mesh); + } + } + + + //------------------------------------------------------------------------- + // register motions + //------------------------------------------------------------------------- + if (LLCharacter::sInstances.size() == 1) + { + LLKeyframeMotion::setVFS(gStaticVFS); + registerMotion( ANIM_AGENT_BUSY, LLNullMotion::create ); + registerMotion( ANIM_AGENT_CROUCH, LLKeyframeStandMotion::create ); + registerMotion( ANIM_AGENT_CROUCHWALK, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_EXPRESS_AFRAID, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_ANGER, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_BORED, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_CRY, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_DISDAIN, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_EMBARRASSED, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_FROWN, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_KISS, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_LAUGH, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_OPEN_MOUTH, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_REPULSED, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_SAD, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_SHRUG, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_SMILE, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_SURPRISE, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_TONGUE_OUT, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_TOOTHSMILE, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_WINK, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_WORRY, LLEmote::create ); + registerMotion( ANIM_AGENT_RUN, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_STAND, LLKeyframeStandMotion::create ); + registerMotion( ANIM_AGENT_STAND_1, LLKeyframeStandMotion::create ); + registerMotion( ANIM_AGENT_STAND_2, LLKeyframeStandMotion::create ); + registerMotion( ANIM_AGENT_STAND_3, LLKeyframeStandMotion::create ); + registerMotion( ANIM_AGENT_STAND_4, LLKeyframeStandMotion::create ); + registerMotion( ANIM_AGENT_STANDUP, LLKeyframeFallMotion::create ); + registerMotion( ANIM_AGENT_TURNLEFT, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_TURNRIGHT, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_WALK, LLKeyframeWalkMotion::create ); + + // motions without a start/stop bit + registerMotion( ANIM_AGENT_BODY_NOISE, LLBodyNoiseMotion::create ); + registerMotion( ANIM_AGENT_BREATHE_ROT, LLBreatheMotionRot::create ); + registerMotion( ANIM_AGENT_EDITING, LLEditingMotion::create ); + registerMotion( ANIM_AGENT_EYE, LLEyeMotion::create ); + registerMotion( ANIM_AGENT_FEMALE_WALK, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_FLY_ADJUST, LLFlyAdjustMotion::create ); + registerMotion( ANIM_AGENT_HAND_MOTION, LLHandMotion::create ); + registerMotion( ANIM_AGENT_HEAD_ROT, LLHeadRotMotion::create ); + registerMotion( ANIM_AGENT_PELVIS_FIX, LLPelvisFixMotion::create ); + registerMotion( ANIM_AGENT_SIT_FEMALE, LLKeyframeMotion::create ); + registerMotion( ANIM_AGENT_TARGET, LLTargetingMotion::create ); + registerMotion( ANIM_AGENT_WALK_ADJUST, LLWalkAdjustMotion::create ); + + } + + if (gNoRender) + { + return; + } + + buildCharacter(); + + if (gNoRender) + { + return; + } + + // preload specific motions here + createMotion( ANIM_AGENT_CUSTOMIZE); + createMotion( ANIM_AGENT_CUSTOMIZE_DONE); + + //VTPause(); // VTune + + mVoiceVisualizer->setVoiceEnabled( gVoiceClient->getVoiceEnabled( mID ) ); +} + +const LLVector3 LLVOAvatar::getRenderPosition() const +{ + if (mDrawable.isNull() || mDrawable->getGeneration() < 0) + { + return getPositionAgent(); + } + else if (isRoot()) + { + return mDrawable->getPositionAgent(); + } + else + { + return getPosition() * mDrawable->getParent()->getRenderMatrix(); + } +} + +void LLVOAvatar::updateDrawable(BOOL force_damped) +{ + clearChanged(SHIFTED); +} + +void LLVOAvatar::onShift(const LLVector3& shift_vector) +{ + mLastAnimExtents[0] += shift_vector; + mLastAnimExtents[1] += shift_vector; + mNeedsImpostorUpdate = TRUE; + mNeedsAnimUpdate = TRUE; +} + +void LLVOAvatar::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax) +{ + if (isImpostor() && !needsImpostorUpdate()) + { + LLVector3 delta = getRenderPosition() - + ((LLVector3(mDrawable->getPositionGroup())-mImpostorOffset)); + + newMin = mLastAnimExtents[0] + delta; + newMax = mLastAnimExtents[1] + delta; + } else { getSpatialExtents(newMin,newMax); @@ -1461,7 +1324,7 @@ void LLVOAvatar::getSpatialExtents(LLVector3& newMin, LLVector3& newMax) for (S32 joint_num = 0; joint_num < mesh->mJointRenderData.count(); joint_num++) { update_min_max(newMin, newMax, - mesh->mJointRenderData[joint_num]->mWorldMatrix->getTranslation()); + mesh->mJointRenderData[joint_num]->mWorldMatrix->getTranslation()); } } @@ -1469,8 +1332,8 @@ void LLVOAvatar::getSpatialExtents(LLVector3& newMin, LLVector3& newMax) //stretch bounding box by attachments for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); - ++iter) + iter != mAttachmentPoints.end(); + ++iter) { LLViewerJointAttachment* attachment = iter->second; @@ -1535,11 +1398,9 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector3& start, const LLVector3& e LLVector3* intersection, LLVector2* tex_coord, LLVector3* normal, - LLVector3* bi_normal - ) + LLVector3* bi_normal) { - - if (mIsSelf && !gAgent.needsRenderAvatar() || !LLPipeline::sPickAvatar) + if (isSelf() && !gAgent.needsRenderAvatar() || !LLPipeline::sPickAvatar) { return FALSE; } @@ -1668,7 +1529,6 @@ BOOL LLVOAvatar::setupBone(const LLVOAvatarBoneInfo* info, LLViewerJoint* parent return FALSE; } joint = (LLViewerJoint*)(&mCollisionVolumes[volume_num]); - joint->setName( info->mName ); } @@ -1679,10 +1539,8 @@ BOOL LLVOAvatar::setupBone(const LLVOAvatarBoneInfo* info, LLViewerJoint* parent } joint->setPosition(info->mPos); - joint->setRotation(mayaQ(info->mRot.mV[VX], info->mRot.mV[VY], info->mRot.mV[VZ], LLQuaternion::XYZ)); - joint->setScale(info->mScale); @@ -1751,18 +1609,6 @@ BOOL LLVOAvatar::buildSkeleton(const LLVOAvatarSkeletonInfo *info) } } - // add special-purpose "screen" joint - if (mIsSelf) - { - mScreenp = new LLViewerJoint("mScreen", NULL); - // for now, put screen at origin, as it is only used during special - // HUD rendering mode - F32 aspect = LLViewerCamera::getInstance()->getAspect(); - LLVector3 scale(1.f, aspect, 1.f); - mScreenp->setScale(scale); - mScreenp->setWorldPosition(LLVector3::zero); - } - return TRUE; } @@ -1811,11 +1657,11 @@ void LLVOAvatar::buildCharacter() // clear mesh data //------------------------------------------------------------------------- for (std::vector<LLViewerJoint*>::iterator jointIter = mMeshLOD.begin(); - jointIter != mMeshLOD.end(); jointIter++) + jointIter != mMeshLOD.end(); jointIter++) { LLViewerJoint* joint = (LLViewerJoint*) *jointIter; for (std::vector<LLViewerJointMesh*>::iterator meshIter = joint->mMeshParts.begin(); - meshIter != joint->mMeshParts.end(); meshIter++) + meshIter != joint->mMeshParts.end(); meshIter++) { LLViewerJointMesh * mesh = (LLViewerJointMesh *) *meshIter; mesh->setMesh(NULL); @@ -1839,9 +1685,9 @@ void LLVOAvatar::buildCharacter() // gPrintMessagesThisFrame = TRUE; lldebugs << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << llendl; - if ( ! status ) + if (!status) { - if ( mIsSelf ) + if (isSelf()) { llerrs << "Unable to load user's avatar" << llendl; } @@ -1878,23 +1724,23 @@ void LLVOAvatar::buildCharacter() // Make sure "well known" pointers exist //------------------------------------------------------------------------- if (!(mPelvisp && - mTorsop && - mChestp && - mNeckp && - mHeadp && - mSkullp && - mHipLeftp && - mHipRightp && - mKneeLeftp && - mKneeRightp && - mAnkleLeftp && - mAnkleRightp && - mFootLeftp && - mFootRightp && - mWristLeftp && - mWristRightp && - mEyeLeftp && - mEyeRightp)) + mTorsop && + mChestp && + mNeckp && + mHeadp && + mSkullp && + mHipLeftp && + mHipRightp && + mKneeLeftp && + mKneeRightp && + mAnkleLeftp && + mAnkleRightp && + mFootLeftp && + mFootRightp && + mWristLeftp && + mWristRightp && + mEyeLeftp && + mEyeRightp)) { llerrs << "Failed to create avatar." << llendl; return; @@ -1940,241 +1786,50 @@ void LLVOAvatar::buildCharacter() mIsBuilt = TRUE; stop_glerror(); - //------------------------------------------------------------------------- - // build the attach and detach menus - //------------------------------------------------------------------------- - if (mIsSelf) - { - // *TODO: Translate - gAttachBodyPartPieMenus[0] = NULL; - gAttachBodyPartPieMenus[1] = new LLPieMenu(std::string("Right Arm >")); - gAttachBodyPartPieMenus[2] = new LLPieMenu(std::string("Head >")); - gAttachBodyPartPieMenus[3] = new LLPieMenu(std::string("Left Arm >")); - gAttachBodyPartPieMenus[4] = NULL; - gAttachBodyPartPieMenus[5] = new LLPieMenu(std::string("Left Leg >")); - gAttachBodyPartPieMenus[6] = new LLPieMenu(std::string("Torso >")); - gAttachBodyPartPieMenus[7] = new LLPieMenu(std::string("Right Leg >")); - - gDetachBodyPartPieMenus[0] = NULL; - gDetachBodyPartPieMenus[1] = new LLPieMenu(std::string("Right Arm >")); - gDetachBodyPartPieMenus[2] = new LLPieMenu(std::string("Head >")); - gDetachBodyPartPieMenus[3] = new LLPieMenu(std::string("Left Arm >")); - gDetachBodyPartPieMenus[4] = NULL; - gDetachBodyPartPieMenus[5] = new LLPieMenu(std::string("Left Leg >")); - gDetachBodyPartPieMenus[6] = new LLPieMenu(std::string("Torso >")); - gDetachBodyPartPieMenus[7] = new LLPieMenu(std::string("Right Leg >")); - - for (S32 i = 0; i < 8; i++) - { - if (gAttachBodyPartPieMenus[i]) - { - gAttachPieMenu->appendPieMenu( gAttachBodyPartPieMenus[i] ); - } - else - { - BOOL attachment_found = FALSE; - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ) - { - attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - if (attachment->getGroup() == i) - { - LLMenuItemCallGL* item; - item = new LLMenuItemCallGL(attachment->getName(), - NULL, - object_selected_and_point_valid); - item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); - - gAttachPieMenu->append(item); - - attachment_found = TRUE; - break; - - } - } + mMeshValid = TRUE; +} - if (!attachment_found) - { - gAttachPieMenu->appendSeparator(); - } - } - if (gDetachBodyPartPieMenus[i]) - { - gDetachPieMenu->appendPieMenu( gDetachBodyPartPieMenus[i] ); - } - else - { - BOOL attachment_found = FALSE; - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ) - { - attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - if (attachment->getGroup() == i) - { - gDetachPieMenu->append(new LLMenuItemCallGL(attachment->getName(), - &handle_detach_from_avatar, object_attached, attachment)); +//----------------------------------------------------------------------------- +// releaseMeshData() +//----------------------------------------------------------------------------- +void LLVOAvatar::releaseMeshData() +{ + LLMemType mt(LLMemType::MTYPE_AVATAR); + + if (sInstances.size() < AVATAR_RELEASE_THRESHOLD || mIsDummy) + { + return; + } - attachment_found = TRUE; - break; - } - } + //llinfos << "Releasing" << llendl; - if (!attachment_found) - { - gDetachPieMenu->appendSeparator(); - } - } - } + // cleanup mesh data + for (std::vector<LLViewerJoint*>::iterator iter = mMeshLOD.begin(); + iter != mMeshLOD.end(); iter++) + { + LLViewerJoint* joint = (LLViewerJoint*) *iter; + joint->setValid(FALSE, TRUE); + } - // add screen attachments - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ) + //cleanup data + if (mDrawable.notNull()) + { + LLFace* facep = mDrawable->getFace(0); + facep->setSize(0, 0); + for(S32 i = mNumInitFaces ; i < mDrawable->getNumFaces(); i++) { - attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - if (attachment->getGroup() == 8) - { - LLMenuItemCallGL* item; - item = new LLMenuItemCallGL(attachment->getName(), - NULL, - object_selected_and_point_valid); - item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); - gAttachScreenPieMenu->append(item); - gDetachScreenPieMenu->append(new LLMenuItemCallGL(attachment->getName(), - &handle_detach_from_avatar, object_attached, attachment)); - } + facep = mDrawable->getFace(i); + facep->setSize(0, 0); } - - for (S32 pass = 0; pass < 2; pass++) - { - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ) - { - attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - if (attachment->getIsHUDAttachment() != (pass == 1)) - { - continue; - } - LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), - NULL, &object_selected_and_point_valid, - &attach_label, attachment); - item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); - gAttachSubMenu->append(item); - - gDetachSubMenu->append(new LLMenuItemCallGL(attachment->getName(), - &handle_detach_from_avatar, object_attached, &detach_label, attachment)); - - } - if (pass == 0) - { - // put separator between non-hud and hud attachments - gAttachSubMenu->appendSeparator(); - gDetachSubMenu->appendSeparator(); - } - } - - for (S32 group = 0; group < 8; group++) - { - // skip over groups that don't have sub menus - if (!gAttachBodyPartPieMenus[group] || !gDetachBodyPartPieMenus[group]) - { - continue; - } - - std::multimap<S32, S32> attachment_pie_menu_map; - - // gather up all attachment points assigned to this group, and throw into map sorted by pie slice number - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ) - { - attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - if(attachment->getGroup() == group) - { - // use multimap to provide a partial order off of the pie slice key - S32 pie_index = attachment->getPieSlice(); - attachment_pie_menu_map.insert(std::make_pair(pie_index, curiter->first)); - } - } - - // add in requested order to pie menu, inserting separators as necessary - S32 cur_pie_slice = 0; - for (std::multimap<S32, S32>::iterator attach_it = attachment_pie_menu_map.begin(); - attach_it != attachment_pie_menu_map.end(); ++attach_it) - { - S32 requested_pie_slice = attach_it->first; - S32 attach_index = attach_it->second; - while (cur_pie_slice < requested_pie_slice) - { - gAttachBodyPartPieMenus[group]->appendSeparator(); - gDetachBodyPartPieMenus[group]->appendSeparator(); - cur_pie_slice++; - } - - LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attach_index, (LLViewerJointAttachment*)NULL); - if (attachment) - { - LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), - NULL, object_selected_and_point_valid); - gAttachBodyPartPieMenus[group]->append(item); - item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", attach_index); - gDetachBodyPartPieMenus[group]->append(new LLMenuItemCallGL(attachment->getName(), - &handle_detach_from_avatar, - object_attached, attachment)); - cur_pie_slice++; - } - } - } - } - - mMeshValid = TRUE; -} - - -//----------------------------------------------------------------------------- -// releaseMeshData() -//----------------------------------------------------------------------------- -void LLVOAvatar::releaseMeshData() -{ - LLMemType mt(LLMemType::MTYPE_AVATAR); - - if (sInstances.size() < AVATAR_RELEASE_THRESHOLD || mIsDummy) - { - return; - } - - //llinfos << "Releasing" << llendl; - - // cleanup mesh data - for (std::vector<LLViewerJoint*>::iterator iter = mMeshLOD.begin(); - iter != mMeshLOD.end(); iter++) - { - LLViewerJoint* joint = (LLViewerJoint*) *iter; - joint->setValid(FALSE, TRUE); - } - - //cleanup data - if (mDrawable.notNull()) - { - LLFace* facep = mDrawable->getFace(0); - facep->setSize(0, 0); - for(S32 i = mNumInitFaces ; i < mDrawable->getNumFaces(); i++) - { - facep = mDrawable->getFace(i); - facep->setSize(0, 0); - } - } - - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ) - { - attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - if (!attachment->getIsHUDAttachment()) + } + + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ) + { + attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + if (!attachment->getIsHUDAttachment()) { attachment->setAttachmentVisibility(FALSE); } @@ -2185,29 +1840,24 @@ void LLVOAvatar::releaseMeshData() //----------------------------------------------------------------------------- // restoreMeshData() //----------------------------------------------------------------------------- +// virtual void LLVOAvatar::restoreMeshData() { + llassert(!isSelf()); LLMemType mt(LLMemType::MTYPE_AVATAR); //llinfos << "Restoring" << llendl; mMeshValid = TRUE; updateJointLODs(); - if (mIsSelf) - { - updateAttachmentVisibility(gAgent.getCameraMode()); - } - else + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ) { - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ) + attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + if (!attachment->getIsHUDAttachment()) { - attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - if (!attachment->getIsHUDAttachment()) - { - attachment->setAttachmentVisibility(TRUE); - } + attachment->setAttachmentVisibility(TRUE); } } @@ -2393,9 +2043,9 @@ void LLVOAvatar::computeBodySize() // LLVOAvatar::processUpdateMessage() //------------------------------------------------------------------------ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, - void **user_data, - U32 block_num, const EObjectUpdateType update_type, - LLDataPacker *dp) + void **user_data, + U32 block_num, const EObjectUpdateType update_type, + LLDataPacker *dp) { LLMemType mt(LLMemType::MTYPE_AVATAR); @@ -2434,9 +2084,6 @@ S32 LLVOAvatar::setTETexture(const U8 te, const LLUUID& uuid) } } - -// setTEImage - //------------------------------------------------------------------------ // idleUpdate() //------------------------------------------------------------------------ @@ -2491,7 +2138,7 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) // set alpha flag depending on state //-------------------------------------------------------------------- - if (mIsSelf) + if (isSelf()) { LLViewerObject::idleUpdate(agent, world, time); @@ -2515,8 +2162,8 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) // animate the character // store off last frame's root position to be consistent with camera position LLVector3 root_pos_last = mRoot.getWorldPosition(); - bool detailed_update = updateCharacter(agent); - bool voice_enabled = gVoiceClient->getVoiceEnabled( mID ) && gVoiceClient->inProximalChannel(); + BOOL detailed_update = updateCharacter(agent); + BOOL voice_enabled = gVoiceClient->getVoiceEnabled( mID ) && gVoiceClient->inProximalChannel(); if (gNoRender) { @@ -2539,13 +2186,13 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled) { // disable voice visualizer when in mouselook - mVoiceVisualizer->setVoiceEnabled( voice_enabled && !(mIsSelf && gAgent.cameraMouselook()) ); + mVoiceVisualizer->setVoiceEnabled( voice_enabled && !(isSelf() && gAgent.cameraMouselook()) ); if ( voice_enabled ) { //---------------------------------------------------------------- // Only do gesture triggering for your own avatar, and only when you're in a proximal channel. //---------------------------------------------------------------- - if( mIsSelf ) + if( isSelf() ) { //---------------------------------------------------------------------------------------- // The following takes the voice signal and uses that to trigger gesticulations. @@ -2571,7 +2218,7 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled) } } - } //if( mIsSelf ) + } //if( isSelf() ) //----------------------------------------------------------------------------------------------------------------- // If the avatar is speaking, then the voice amplitude signal is passed to the voice visualizer. @@ -2580,9 +2227,9 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled) // Notice the calls to "gAwayTimer.reset()". This resets the timer that determines how long the avatar has been // "away", so that the avatar doesn't lapse into away-mode (and slump over) while the user is still talking. //----------------------------------------------------------------------------------------------------------------- - if ( gVoiceClient->getIsSpeaking( mID ) ) + if (gVoiceClient->getIsSpeaking( mID )) { - if ( ! mVoiceVisualizer->getCurrentlySpeaking() ) + if (!mVoiceVisualizer->getCurrentlySpeaking()) { mVoiceVisualizer->setStartSpeaking(); @@ -2591,7 +2238,7 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled) mVoiceVisualizer->setSpeakingAmplitude( gVoiceClient->getCurrentPower( mID ) ); - if( mIsSelf ) + if( isSelf() ) { gAgent.clearAFK(); } @@ -2654,8 +2301,8 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) LLViewerObject *attached_object = attachment->getObject(); BOOL visibleAttachment = visible || (attached_object && - !(attached_object->mDrawable->getSpatialBridge() && - attached_object->mDrawable->getSpatialBridge()->getRadius() < 2.0)); + !(attached_object->mDrawable->getSpatialBridge() && + attached_object->mDrawable->getSpatialBridge()->getRadius() < 2.0)); if (visibleAttachment && attached_object && !attached_object->isDead() && attachment->getValid()) { @@ -2751,7 +2398,7 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() } } updateVisualParams(); - if (mIsSelf) + if (isSelf()) { gAgent.sendAgentSetAppearance(); } @@ -2947,16 +2594,16 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping); BOOL render_name = visible_chat || - (visible_avatar && - ((sRenderName == RENDER_NAME_ALWAYS) || - (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME))); + (visible_avatar && + ((sRenderName == RENDER_NAME_ALWAYS) || + (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME))); // If it's your own avatar, don't draw in mouselook, and don't // draw if we're specifically hiding our own name. - if (mIsSelf) + if (isSelf()) { render_name = render_name - && !gAgent.cameraMouselook() - && (visible_chat || !gSavedSettings.getBOOL("RenderNameHideSelf")); + && !gAgent.cameraMouselook() + && (visible_chat || !gSavedSettings.getBOOL("RenderNameHideSelf")); } if ( render_name ) @@ -3013,7 +2660,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) new_name = TRUE; } - LLColor4 avatar_name_color = gColors.getColor( "AvatarNameColor" ); + LLColor4 avatar_name_color = gSavedSkinSettings.getColor( "AvatarNameColor" ); avatar_name_color.setAlpha(alpha); mNameText->setColor(avatar_name_color); @@ -3056,7 +2703,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) BOOL is_busy = mSignaledAnimations.find(ANIM_AGENT_BUSY) != mSignaledAnimations.end(); BOOL is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end(); BOOL is_muted; - if (mIsSelf) + if (isSelf()) { is_muted = FALSE; } @@ -3101,7 +2748,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += " ("; if (is_away) { - line += "Away"; + line += LLTrans::getString("AvatarAway"); need_comma = TRUE; } if (is_busy) @@ -3110,7 +2757,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) { line += ", "; } - line += "Busy"; + line += LLTrans::getString("AvatarBusy"); need_comma = TRUE; } if (is_muted) @@ -3119,7 +2766,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) { line += ", "; } - line += "Muted"; + line += LLTrans::getString("AvatarMuted"); need_comma = TRUE; } line += ")"; @@ -3127,7 +2774,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) if (is_appearance) { line += "\n"; - line += "(Editing Appearance)"; + line += LLTrans::getString("AvatarEditingAppearance"); } mNameAway = is_away; mNameBusy = is_busy; @@ -3155,7 +2802,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) std::deque<LLChat>::iterator chat_iter = mChats.begin(); mNameText->clearString(); - LLColor4 new_chat = gColors.getColor( "AvatarNameColor" ); + LLColor4 new_chat = gSavedSkinSettings.getColor( "AvatarNameColor" ); LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f); LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f); if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES) @@ -3169,15 +2816,15 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) LLFontGL::StyleFlags style; switch(chat_iter->mChatType) { - case CHAT_TYPE_WHISPER: - style = LLFontGL::ITALIC; - break; - case CHAT_TYPE_SHOUT: - style = LLFontGL::BOLD; - break; - default: - style = LLFontGL::NORMAL; - break; + case CHAT_TYPE_WHISPER: + style = LLFontGL::ITALIC; + break; + case CHAT_TYPE_SHOUT: + style = LLFontGL::BOLD; + break; + default: + style = LLFontGL::NORMAL; + break; } if (chat_fade_amt < 1.f) { @@ -3202,15 +2849,15 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) S32 dot_count = (llfloor(mTypingTimer.getElapsedTimeF32() * 3.f) + 2) % 3 + 1; switch(dot_count) { - case 1: - mNameText->addLine(".", new_chat); - break; - case 2: - mNameText->addLine("..", new_chat); - break; - case 3: - mNameText->addLine("...", new_chat); - break; + case 1: + mNameText->addLine(".", new_chat); + break; + case 2: + mNameText->addLine("..", new_chat); + break; + case 3: + mNameText->addLine("...", new_chat); + break; } } @@ -3244,75 +2891,12 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } } +//-------------------------------------------------------------------- +// draw tractor beam when editing objects +//-------------------------------------------------------------------- +// virtual void LLVOAvatar::idleUpdateTractorBeam() { - //-------------------------------------------------------------------- - // draw tractor beam when editing objects - //-------------------------------------------------------------------- - if (!mIsSelf) - { - return; - } - - // This is only done for yourself (maybe it should be in the agent?) - if (!needsRenderBeam() || !mIsBuilt) - { - mBeam = NULL; - } - else if (!mBeam || mBeam->isDead()) - { - // VEFFECT: Tractor Beam - mBeam = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM); - mBeam->setColor(LLColor4U(gAgent.getEffectColor())); - mBeam->setSourceObject(this); - mBeamTimer.reset(); - } - - if (!mBeam.isNull()) - { - LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); - - if (gAgent.mPointAt.notNull()) - { - // get point from pointat effect - mBeam->setPositionGlobal(gAgent.mPointAt->getPointAtPosGlobal()); - mBeam->triggerLocal(); - } - else if (selection->getFirstRootObject() && - selection->getSelectType() != SELECT_TYPE_HUD) - { - LLViewerObject* objectp = selection->getFirstRootObject(); - mBeam->setTargetObject(objectp); - } - else - { - mBeam->setTargetObject(NULL); - LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - if (tool->isEditing()) - { - if (tool->getEditingObject()) - { - mBeam->setTargetObject(tool->getEditingObject()); - } - else - { - mBeam->setPositionGlobal(tool->getEditingPointGlobal()); - } - } - else - { - const LLPickInfo& pick = gViewerWindow->getLastPick(); - mBeam->setPositionGlobal(pick.mPosGlobal); - } - - } - if (mBeamTimer.getElapsedTimeF32() > 0.25f) - { - mBeam->setColor(LLColor4U(gAgent.getEffectColor())); - mBeam->setNeedsSendToSim(TRUE); - mBeamTimer.reset(); - } - } } void LLVOAvatar::idleUpdateBelowWater() @@ -3344,16 +2928,6 @@ void LLVOAvatar::slamPosition() BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { LLMemType mt(LLMemType::MTYPE_AVATAR); - // update screen joint size - - if (mScreenp) - { - F32 aspect = LLViewerCamera::getInstance()->getAspect(); - LLVector3 scale(1.f, aspect, 1.f); - mScreenp->setScale(scale); - mScreenp->updateWorldMatrixChildren(); - resetHUDAttachments(); - } // clear debug text mDebugText.clear(); @@ -3386,7 +2960,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) if (gNoRender) { // Hack if we're running drones... - if (mIsSelf) + if (isSelf()) { gAgent.setPositionAgent(getPositionAgent()); } @@ -3415,7 +2989,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // the rest should only be done occasionally for far away avatars //-------------------------------------------------------------------- - if (visible && !mIsSelf && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) + if (visible && !isSelf() && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) { F32 impostor_area = 256.f*512.f*(8.125f - LLVOAvatar::sLODFactor*8.f); if (LLMuteList::getInstance()->isMuted(getID())) @@ -3457,7 +3031,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) } // change animation time quanta based on avatar render load - if (!mIsSelf && !mIsDummy) + if (!isSelf() && !mIsDummy) { F32 time_quantum = clamp_rescale((F32)sInstances.size(), 10.f, 35.f, 0.f, 0.25f); F32 pixel_area_scale = clamp_rescale(mPixelArea, 100, 5000, 1.f, 0.f); @@ -3526,7 +3100,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) LLVector3d root_pos; LLVector3d ground_under_pelvis; - if (mIsSelf) + if (isSelf()) { gAgent.setPositionAgent(getRenderPosition()); } @@ -3535,8 +3109,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) resolveHeightGlobal(root_pos, ground_under_pelvis, normal); F32 foot_to_ground = (F32) (root_pos.mdV[VZ] - mPelvisToFoot - ground_under_pelvis.mdV[VZ]); - BOOL in_air = ( (!LLWorld::getInstance()->getRegionFromPosGlobal(ground_under_pelvis)) || - foot_to_ground > FOOT_GROUND_COLLISION_TOLERANCE); + BOOL in_air = ((!LLWorld::getInstance()->getRegionFromPosGlobal(ground_under_pelvis)) || + foot_to_ground > FOOT_GROUND_COLLISION_TOLERANCE); if (in_air && !mInAir) { @@ -3571,7 +3145,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // more than 90 from the view, if necessary, flip the velocity vector. LLVector3 primDir; - if (mIsSelf) + if (isSelf()) { primDir = agent.getAtAxis() - projected_vec(agent.getAtAxis(), agent.getReferenceUpVector()); primDir.normalize(); @@ -3591,7 +3165,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) } } LLVector3 fwdDir = lerp(primDir, velDir, clamp_rescale(speed, 0.5f, 2.0f, 0.0f, 1.0f)); - if (mIsSelf && gAgent.cameraMouselook()) + if (isSelf() && gAgent.cameraMouselook()) { // make sure fwdDir stays in same general direction as primdir if (gAgent.getFlying()) @@ -3619,18 +3193,10 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) F32 root_roll, root_pitch, root_yaw; root_rotation.getEulerAngles(&root_roll, &root_pitch, &root_yaw); - if (sDebugAvatarRotation) - { - llinfos << "root_roll " << RAD_TO_DEG * root_roll - << " root_pitch " << RAD_TO_DEG * root_pitch - << " root_yaw " << RAD_TO_DEG * root_yaw - << llendl; - } - // When moving very slow, the pelvis is allowed to deviate from the // forward direction to allow it to hold it's position while the torso // and head turn. Once in motion, it must conform however. - BOOL self_in_mouselook = mIsSelf && gAgent.cameraMouselook(); + BOOL self_in_mouselook = isSelf() && gAgent.cameraMouselook(); LLVector3 pelvisDir( mRoot.getWorldMatrix().getFwdRow4().mV ); F32 pelvis_rot_threshold = clamp_rescale(speed, 0.1f, 1.0f, PELVIS_ROT_THRESHOLD_SLOW, PELVIS_ROT_THRESHOLD_FAST); @@ -3647,7 +3213,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // from the forward direction, but if roll or pitch are off even // a little bit we need to correct the rotation. if(root_roll < 1.f * DEG_TO_RAD - && root_pitch < 5.f * DEG_TO_RAD) + && root_pitch < 5.f * DEG_TO_RAD) { // smaller correction vector means pelvis follows prim direction more closely if (!mTurning && angle > pelvis_rot_threshold*0.75f) @@ -3681,7 +3247,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) fwdDir = leftDir % upDir; LLQuaternion wQv( fwdDir, leftDir, upDir ); - if (mIsSelf && mTurning) + if (isSelf() && mTurning) { if ((fwdDir % pelvisDir) * upDir > 0.f) { @@ -3890,9 +3456,9 @@ void LLVOAvatar::updateVisibility() visible = FALSE; } - if( mIsSelf ) + if(isSelf()) { - if( !gAgent.areWearablesLoaded()) + if (!gAgentWearables.areWearablesLoaded()) { visible = FALSE; } @@ -3997,27 +3563,6 @@ void LLVOAvatar::updateVisibility() mVisible = visible; } -//------------------------------------------------------------------------ -// needsRenderBeam() -//------------------------------------------------------------------------ -BOOL LLVOAvatar::needsRenderBeam() -{ - if (gNoRender) - { - return FALSE; - } - LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - - BOOL is_touching_or_grabbing = (tool == LLToolGrab::getInstance() && LLToolGrab::getInstance()->isEditing()); - if (LLToolGrab::getInstance()->getEditingObject() && - LLToolGrab::getInstance()->getEditingObject()->isAttachment()) - { - // don't render selection beam on hud objects - is_touching_or_grabbing = FALSE; - } - return is_touching_or_grabbing || (mState & AGENT_STATE_EDITING && LLSelectMgr::getInstance()->shouldShowSelection()); -} - //----------------------------------------------------------------------------- // renderSkinned() //----------------------------------------------------------------------------- @@ -4051,7 +3596,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) mMeshLOD[MESH_ID_SKIRT]->updateJointGeometry(); } - if (!mIsSelf || gAgent.needsRenderHead() || LLPipeline::sShadowRender) + if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender) { mMeshLOD[MESH_ID_EYELASH]->updateJointGeometry(); mMeshLOD[MESH_ID_HEAD]->updateJointGeometry(); @@ -4101,7 +3646,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) return num_indices; } - if (mIsSelf && !gAgent.needsRenderAvatar()) + if (isSelf() && !gAgent.needsRenderAvatar()) { return num_indices; } @@ -4151,17 +3696,10 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) if (pass == AVATAR_RENDER_PASS_SINGLE) { - const bool should_alpha_mask = mHasBakedHair && isTextureDefined(TEX_HEAD_BAKED) && isTextureDefined(TEX_UPPER_BAKED) - && isTextureDefined(TEX_LOWER_BAKED) - && mBakedTextureData[BAKED_HEAD].mIsLoaded - && mBakedTextureData[BAKED_UPPER].mIsLoaded && mBakedTextureData[BAKED_LOWER].mIsLoaded - && mBakedTextureData[BAKED_HEAD].mIsUsed - && mBakedTextureData[BAKED_UPPER].mIsUsed && mBakedTextureData[BAKED_LOWER].mIsUsed - && !LLDrawPoolAlpha::sShowDebugAlpha // Don't alpha mask if "Highlight Transparent" checked - && !(isSelf() && gAgent.cameraCustomizeAvatar()); // don't alpha mask if in customize mode + const bool should_alpha_mask = mSupportsAlphaLayers && !LLDrawPoolAlpha::sShowDebugAlpha; // Don't alpha mask if "Highlight Transparent" checked LLGLState test(GL_ALPHA_TEST, should_alpha_mask); - + if (should_alpha_mask) { gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); @@ -4170,7 +3708,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) BOOL first_pass = TRUE; if (!LLDrawPoolAvatar::sSkipOpaque) { - if (!mIsSelf || gAgent.needsRenderHead() || LLPipeline::sShadowRender) + if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender) { if (isTextureVisible(TEX_HEAD_BAKED) || mIsDummy) { @@ -4221,7 +3759,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); } - if (!mIsSelf || gAgent.needsRenderHead() || LLPipeline::sShadowRender) + if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender) { if (LLPipeline::sImpostorRender) { @@ -4235,7 +3773,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) } // Can't test for baked hair being defined, since that won't always be the case (not all viewers send baked hair) // TODO: 1.25 will be able to switch this logic back to calling isTextureVisible(); - if (getTEImage(TEX_HAIR_BAKED)->getID() != IMG_INVISIBLE || LLDrawPoolAlpha::sShowDebugAlpha) + if (getImage(TEX_HAIR_BAKED)->getID() != IMG_INVISIBLE || LLDrawPoolAlpha::sShowDebugAlpha) { num_indices += mMeshLOD[MESH_ID_HAIR]->render(mAdjustedPixelArea, first_pass, mIsDummy); first_pass = FALSE; @@ -4261,7 +3799,7 @@ U32 LLVOAvatar::renderRigid() return 0; } - if (mIsSelf && (!gAgent.needsRenderAvatar() || !gAgent.needsRenderHead())) + if (isSelf() && (!gAgent.needsRenderAvatar() || !gAgent.needsRenderHead())) { return 0; } @@ -4274,10 +3812,7 @@ U32 LLVOAvatar::renderRigid() if (isTextureVisible(TEX_EYES_BAKED) || mIsDummy) { // If the meshes need to be drawn, enable alpha masking but not blending - bool should_alpha_mask = mHasBakedHair - && mBakedTextureData[BAKED_EYES].mIsLoaded - && mBakedTextureData[BAKED_EYES].mIsUsed - && !(isSelf() && gAgent.cameraCustomizeAvatar()); + bool should_alpha_mask = mSupportsAlphaLayers && !LLDrawPoolAlpha::sShowDebugAlpha; LLGLState test(GL_ALPHA_TEST, should_alpha_mask); @@ -4304,7 +3839,7 @@ U32 LLVOAvatar::renderFootShadows() return 0; } - if (mIsSelf && (!gAgent.needsRenderAvatar() || !gAgent.needsRenderHead())) + if (isSelf() && (!gAgent.needsRenderAvatar() || !gAgent.needsRenderHead())) { return 0; } @@ -4316,7 +3851,7 @@ U32 LLVOAvatar::renderFootShadows() // Don't render foot shadows if your lower body is completely invisible. // (non-humanoid avatars rule!) - if (! isTextureVisible(TEX_LOWER_BAKED)) + if (!isTextureVisible(TEX_LOWER_BAKED)) { return 0; } @@ -4391,7 +3926,7 @@ void LLVOAvatar::updateTextures(LLAgent &agent) return; } - if( mIsSelf ) + if( isSelf() ) { render_avatar = TRUE; } @@ -4400,66 +3935,32 @@ void LLVOAvatar::updateTextures(LLAgent &agent) render_avatar = isVisible() && !mCulled; } - std::vector<bool> layer_baked; - for (U32 i = 0; i < mBakedTextureData.size(); i++) + std::vector<BOOL> layer_baked; + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - layer_baked.push_back(isTextureDefined(mBakedTextureData[i].mTextureIndex)); + layer_baked.push_back(isTextureDefined(mBakedTextureDatas[i].mTextureIndex)); // bind the texture so that they'll be decoded slightly // inefficient, we can short-circuit this if we have to - if( render_avatar && !gGLManager.mIsDisabled ) - { - if (layer_baked[i] && !mBakedTextureData[i].mIsLoaded) - { - gGL.getTexUnit(0)->bind(getTEImage( mBakedTextureData[i].mTextureIndex )); - } - } - } - - /* - // JAMESDEBUG - if (mIsSelf) - { - S32 null_count = 0; - S32 default_count = 0; - for (U32 i = 0; i < getNumTEs(); i++) + if (render_avatar && !gGLManager.mIsDisabled) { - const LLTextureEntry* te = getTE(i); - if (te) + if (layer_baked[i] && !mBakedTextureDatas[i].mIsLoaded) { - if (te->getID() == LLUUID::null) - { - null_count++; - } - else if (te->getID() == IMG_DEFAULT_AVATAR) - { - default_count++; - } + gGL.getTexUnit(0)->bind(getImage(mBakedTextureDatas[i].mTextureIndex)); } } - llinfos << "JAMESDEBUG my avatar TE null " << null_count << " default " << default_count << llendl; } - */ mMaxPixelArea = 0.f; mMinPixelArea = 99999999.f; mHasGrey = FALSE; // debug for (U32 index = 0; index < getNumTEs(); index++) { - LLViewerImage *imagep = getTEImage(index); + LLViewerImage *imagep = getImage(index); if (imagep) { - // Debugging code - maybe non-self avatars are downloading textures? - //llinfos << "avatar self " << mIsSelf << " tex " << i - // << " decode " << imagep->getDecodePriority() - // << " boost " << boost_avatar - // << " size " << imagep->getWidth() << "x" << imagep->getHeight() - // << " discard " << imagep->getDiscardLevel() - // << " desired " << imagep->getDesiredDiscardLevel() - // << llendl; - const LLTextureEntry *te = getTE(index); - F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT); - S32 boost_level = mIsSelf ? LLViewerImage::BOOST_AVATAR_BAKED_SELF : LLViewerImage::BOOST_AVATAR_BAKED; + const F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT); + const S32 boost_level = getAvatarBakedBoostLevel(); // Spam if this is a baked texture, not set to default image, without valid host info if (isIndexBakedTexture((ETextureIndex)index) @@ -4467,15 +3968,15 @@ void LLVOAvatar::updateTextures(LLAgent &agent) && !imagep->getTargetHost().isOk()) { LL_WARNS_ONCE("Texture") << "LLVOAvatar::updateTextures No host for texture " - << imagep->getID() << " for avatar " - << (mIsSelf ? "<myself>" : getID().asString()) - << " on host " << getRegion()->getHost() << llendl; + << imagep->getID() << " for avatar " + << (isSelf() ? "<myself>" : getID().asString()) + << " on host " << getRegion()->getHost() << llendl; } /* switch(index) case TEX_HEAD_BODYPAINT: addLocalTextureStats( LOCTEX_HEAD_BODYPAINT, imagep, texel_area_ratio, render_avatar, head_baked ); */ - const LLVOAvatarDictionary::TextureDictionaryEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture((ETextureIndex)index); + const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture((ETextureIndex)index); if (texture_dict->mIsUsedByBakedTexture) { const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; @@ -4506,38 +4007,11 @@ void LLVOAvatar::updateTextures(LLAgent &agent) } -void LLVOAvatar::addLocalTextureStats( ETextureIndex idx, LLViewerImage* imagep, - F32 texel_area_ratio, BOOL render_avatar, BOOL covered_by_baked ) +void LLVOAvatar::addLocalTextureStats(ETextureIndex idx, LLViewerImage* imagep, + F32 texel_area_ratio, BOOL render_avatar, BOOL covered_by_baked, U32 index) { - if (!isIndexLocalTexture(idx)) return; - - if (!covered_by_baked && render_avatar) // render_avatar is always true if mIsSelf - { - if (getLocalTextureID(idx) != IMG_DEFAULT_AVATAR) - { - F32 desired_pixels; - if( mIsSelf ) - { - desired_pixels = llmin(mPixelArea, (F32)TEX_IMAGE_AREA_SELF ); - imagep->setBoostLevel(LLViewerImage::BOOST_AVATAR_SELF); - } - else - { - desired_pixels = llmin(mPixelArea, (F32)TEX_IMAGE_AREA_OTHER ); - imagep->setBoostLevel(LLViewerImage::BOOST_AVATAR); - } - imagep->addTextureStats( desired_pixels / texel_area_ratio ); - if (imagep->getDiscardLevel() < 0) - { - mHasGrey = TRUE; // for statistics gathering - } - } - else - { - // texture asset is missing - mHasGrey = TRUE; // for statistics gathering - } - } + // No local texture stats for non-self avatars + return; } @@ -4549,6 +4023,29 @@ void LLVOAvatar::addBakedTextureStats( LLViewerImage* imagep, F32 pixel_area, F3 imagep->setBoostLevel(boost_level); } +//virtual +void LLVOAvatar::setImage(const U8 te, LLViewerImage *imagep) +{ + setTEImage(te, imagep); +} + +//virtual +LLViewerImage* LLVOAvatar::getImage(const U8 te) const +{ + return getTEImage(te); +} +//virtual +const LLTextureEntry* LLVOAvatar::getTexEntry(const U8 te_num) const +{ + return getTE(te_num); +} + +//virtual +void LLVOAvatar::setTexEntry(const U8 index, const LLTextureEntry &te) +{ + setTE(index, te); +} + //----------------------------------------------------------------------------- // resolveHeight() //----------------------------------------------------------------------------- @@ -4690,7 +4187,7 @@ void LLVOAvatar::processAnimationStateChanges() } // clear source information for animations which have been stopped - if (mIsSelf) + if (isSelf()) { AnimSourceIterator source_it = mAnimationSources.begin(); @@ -4732,7 +4229,7 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL { // RN: uncomment this to play on typing sound at fixed volume once sound engine is fixed // to support both spatialized and non-spatialized instances of the same sound - //if (mIsSelf) + //if (isSelf()) //{ // gAudiop->triggerSound(LLUUID(gSavedSettings.getString("UISndTyping")), 1.0f, LLAudioEngine::AUDIO_TYPE_UI); //} @@ -4775,7 +4272,7 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL //----------------------------------------------------------------------------- // isAnyAnimationSignaled() //----------------------------------------------------------------------------- -BOOL LLVOAvatar::isAnyAnimationSignaled(const LLUUID *anim_array, const S32 num_anims) +BOOL LLVOAvatar::isAnyAnimationSignaled(const LLUUID *anim_array, const S32 num_anims) const { for (S32 i = 0; i < num_anims; i++) { @@ -4818,7 +4315,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) } } - if (mIsSelf && id == ANIM_AGENT_AWAY) + if (isSelf() && id == ANIM_AGENT_AWAY) { gAgent.setAFK(); } @@ -4831,7 +4328,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) //----------------------------------------------------------------------------- BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) { - if (mIsSelf) + if (isSelf()) { gAgent.onAnimStop(id); } @@ -4851,25 +4348,9 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) //----------------------------------------------------------------------------- // stopMotionFromSource() //----------------------------------------------------------------------------- +// virtual void LLVOAvatar::stopMotionFromSource(const LLUUID& source_id) { - if (!mIsSelf) - { - return; - } - AnimSourceIterator motion_it; - - for(motion_it = mAnimationSources.find(source_id); motion_it != mAnimationSources.end();) - { - gAgent.sendAnimationRequest( motion_it->second, ANIM_REQUEST_STOP ); - mAnimationSources.erase(motion_it++); - } - - LLViewerObject* object = gObjectList.findObject(source_id); - if (object) - { - object->mFlags &= ~FLAGS_ANIM_SOURCE; - } } //----------------------------------------------------------------------------- @@ -4917,7 +4398,7 @@ S32 LLVOAvatar::getCollisionVolumeID(std::string &name) //----------------------------------------------------------------------------- // addDebugText() //----------------------------------------------------------------------------- - void LLVOAvatar::addDebugText(const std::string& text) +void LLVOAvatar::addDebugText(const std::string& text) { mDebugText.append(1, '\n'); mDebugText.append(text); @@ -4937,15 +4418,7 @@ const LLUUID& LLVOAvatar::getID() // RN: avatar joints are multi-rooted to include screen-based attachments LLJoint *LLVOAvatar::getJoint( const std::string &name ) { - LLJoint* jointp = NULL; - if (mScreenp) - { - jointp = mScreenp->findJoint(name); - } - if (!jointp) - { - jointp = mRoot.findJoint(name); - } + LLJoint* jointp = mRoot.findJoint(name); return jointp; } @@ -5075,8 +4548,7 @@ LLVector3 LLVOAvatar::getPosAgentFromGlobal(const LLVector3d &position) //----------------------------------------------------------------------------- BOOL LLVOAvatar::allocateCharacterJoints( U32 num ) { - delete [] mSkeleton; - mSkeleton = NULL; + deleteAndClearArray(mSkeleton); mNumJoints = 0; mSkeleton = new LLViewerJoint[num]; @@ -5100,8 +4572,7 @@ BOOL LLVOAvatar::allocateCharacterJoints( U32 num ) //----------------------------------------------------------------------------- BOOL LLVOAvatar::allocateCollisionVolumes( U32 num ) { - delete [] mCollisionVolumes; - mCollisionVolumes = NULL; + deleteAndClearArray(mCollisionVolumes); mNumCollisionVolumes = 0; mCollisionVolumes = new LLViewerJointCollisionVolume[num]; @@ -5131,14 +4602,10 @@ LLJoint *LLVOAvatar::getCharacterJoint( U32 num ) //----------------------------------------------------------------------------- // requestStopMotion() //----------------------------------------------------------------------------- +// virtual void LLVOAvatar::requestStopMotion( LLMotion* motion ) { // Only agent avatars should handle the stop motion notifications. - if ( mIsSelf ) - { - // Notify agent that motion has stopped - gAgent.requestStopMotion( motion ); - } } //----------------------------------------------------------------------------- @@ -5217,62 +4684,55 @@ BOOL LLVOAvatar::loadAvatar() if (sAvatarXmlInfo->mLayerInfoList.empty()) { llwarns << "avatar file: missing <layer_set> node" << llendl; + return FALSE; } - else + + if (sAvatarXmlInfo->mMorphMaskInfoList.empty()) + { + llwarns << "avatar file: missing <morph_masks> node" << llendl; + return FALSE; + } + + // avatar_lad.xml : <morph_masks> + for (LLVOAvatarXmlInfo::morph_info_list_t::iterator iter = sAvatarXmlInfo->mMorphMaskInfoList.begin(); + iter != sAvatarXmlInfo->mMorphMaskInfoList.end(); + iter++) { - LLVOAvatarXmlInfo::layer_info_list_t::iterator iter; - for (iter = sAvatarXmlInfo->mLayerInfoList.begin(); - iter != sAvatarXmlInfo->mLayerInfoList.end(); iter++) + LLVOAvatarXmlInfo::LLVOAvatarMorphInfo *info = *iter; + + EBakedTextureIndex baked = LLVOAvatarDictionary::findBakedByRegionName(info->mRegion); + if (baked != BAKED_NUM_INDICES) { - LLTexLayerSetInfo *info = *iter; - LLTexLayerSet* layer_set = new LLTexLayerSet( this ); - if (!layer_set->setInfo(info)) - { - stop_glerror(); - delete layer_set; - llwarns << "avatar file: layer_set->parseData() failed" << llendl; - return FALSE; - } - bool found_baked_entry = false; - for (LLVOAvatarDictionary::baked_map_t::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); - baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); - baked_iter++) + LLPolyMorphTarget *morph_param; + const std::string *name = &info->mName; + morph_param = (LLPolyMorphTarget *)(getVisualParam(name->c_str())); + if (morph_param) { - const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = baked_iter->second; - if (layer_set->isBodyRegion(baked_dict->mName)) - { - mBakedTextureData[baked_iter->first].mTexLayerSet = layer_set; - found_baked_entry = true; - break; - } - } - if (!found_baked_entry) - { - llwarns << "<layer_set> has invalid body_region attribute" << llendl; - delete layer_set; - return FALSE; + BOOL invert = info->mInvert; + addMaskedMorph(baked, morph_param, invert, info->mLayer); } } + } + + loadLayersets(); // avatar_lad.xml : <driver_parameters> + for (LLVOAvatarXmlInfo::driver_info_list_t::iterator iter = sAvatarXmlInfo->mDriverInfoList.begin(); + iter != sAvatarXmlInfo->mDriverInfoList.end(); + iter++) { - LLVOAvatarXmlInfo::driver_info_list_t::iterator iter; - for (iter = sAvatarXmlInfo->mDriverInfoList.begin(); - iter != sAvatarXmlInfo->mDriverInfoList.end(); iter++) + LLDriverParamInfo *info = *iter; + LLDriverParam* driver_param = new LLDriverParam( this ); + if (driver_param->setInfo(info)) { - LLDriverParamInfo *info = *iter; - LLDriverParam* driver_param = new LLDriverParam( this ); - if (driver_param->setInfo(info)) - { - addVisualParam( driver_param ); - } - else - { - delete driver_param; - llwarns << "avatar file: driver_param->parseData() failed" << llendl; - return FALSE; - } + addVisualParam( driver_param ); + } + else + { + delete driver_param; + llwarns << "avatar file: driver_param->parseData() failed" << llendl; + return FALSE; } } @@ -5287,7 +4747,7 @@ BOOL LLVOAvatar::loadSkeletonNode () mRoot.addChild( &mSkeleton[0] ); for (std::vector<LLViewerJoint *>::iterator iter = mMeshLOD.begin(); - iter != mMeshLOD.end(); iter++) + iter != mMeshLOD.end(); iter++) { LLViewerJoint *joint = (LLViewerJoint *) *iter; joint->mUpdateXform = FALSE; @@ -5438,12 +4898,12 @@ BOOL LLVOAvatar::loadMeshNodes() switch(lod) case 0: mesh = &mHairMesh0; */ - for (LLVOAvatarDictionary::mesh_map_t::const_iterator mesh_iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin(); + for (LLVOAvatarDictionary::Meshes::const_iterator mesh_iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin(); mesh_iter != LLVOAvatarDictionary::getInstance()->getMeshes().end(); mesh_iter++) { const EMeshIndex mesh_index = mesh_iter->first; - const LLVOAvatarDictionary::MeshDictionaryEntry *mesh_dict = mesh_iter->second; + const LLVOAvatarDictionary::MeshEntry *mesh_dict = mesh_iter->second; if (type.compare(mesh_dict->mName) == 0) { mesh_id = mesh_index; @@ -5539,15 +4999,32 @@ BOOL LLVOAvatar::loadMeshNodes() } //----------------------------------------------------------------------------- -// updateVisualParams() +// loadLayerSets() //----------------------------------------------------------------------------- -void LLVOAvatar::updateVisualParams() +BOOL LLVOAvatar::loadLayersets() { - if (gNoRender) + BOOL success = TRUE; + for (LLVOAvatarXmlInfo::layer_info_list_t::const_iterator layerset_iter = sAvatarXmlInfo->mLayerInfoList.begin(); + layerset_iter != sAvatarXmlInfo->mLayerInfoList.end(); + layerset_iter++) { - return; + // Construct a layerset for each one specified in avatar_lad.xml and initialize it as such. + LLTexLayerSetInfo *layerset_info = *layerset_iter; + layerset_info->createVisualParams(this); } - + return success; +} + +//----------------------------------------------------------------------------- +// updateVisualParams() +//----------------------------------------------------------------------------- +void LLVOAvatar::updateVisualParams() +{ + if (gNoRender) + { + return; + } + setSex( (getVisualParamWeight( "male" ) > 0.5f) ? SEX_MALE : SEX_FEMALE ); LLCharacter::updateVisualParams(); @@ -5602,9 +5079,9 @@ void LLVOAvatar::setPixelAreaAndAngle(LLAgent &agent) } // We always want to look good to ourselves - if( mIsSelf ) + if( isSelf() ) { - mPixelArea = llmax( mPixelArea, F32(TEX_IMAGE_SIZE_SELF / 16) ); + mPixelArea = llmax( mPixelArea, F32(getTexImageSize() / 16) ); } } @@ -5620,7 +5097,7 @@ BOOL LLVOAvatar::updateJointLODs() F32 area_scale = 0.16f; { - if (mIsSelf) + if (isSelf()) { if(gAgent.cameraCustomizeAvatar() || gAgent.cameraMouselook()) { @@ -5749,7 +5226,7 @@ void LLVOAvatar::updateShadowFaces() // this only does a ray straight down from the foot, as our client-side ray-tracing is very limited now // but we make an explicit ray trace call in expectation of future improvements resolveRayCollisionAgent(gAgent.getPosGlobalFromAgent(joint_world_pos), - gAgent.getPosGlobalFromAgent(gSky.getSunDirection() + joint_world_pos), shadow_pos, normal); + gAgent.getPosGlobalFromAgent(gSky.getSunDirection() + joint_world_pos), shadow_pos, normal); shadow_pos_agent = gAgent.getPosAgentFromGlobal(shadow_pos); foot_height = joint_world_pos.mV[VZ] - shadow_pos_agent.mV[VZ]; @@ -5758,7 +5235,7 @@ void LLVOAvatar::updateShadowFaces() // Render sprite sprite.setNormal(normal); - if (mIsSelf && gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK) + if (isSelf() && gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK) { sprite.setColor(0.f, 0.f, 0.f, 0.f); } @@ -5782,7 +5259,7 @@ void LLVOAvatar::updateShadowFaces() // this only does a ray straight down from the foot, as our client-side ray-tracing is very limited now // but we make an explicit ray trace call in expectation of future improvements resolveRayCollisionAgent(gAgent.getPosGlobalFromAgent(joint_world_pos), - gAgent.getPosGlobalFromAgent(gSky.getSunDirection() + joint_world_pos), shadow_pos, normal); + gAgent.getPosGlobalFromAgent(gSky.getSunDirection() + joint_world_pos), shadow_pos, normal); shadow_pos_agent = gAgent.getPosAgentFromGlobal(shadow_pos); foot_height = joint_world_pos.mV[VZ] - shadow_pos_agent.mV[VZ]; @@ -5791,7 +5268,7 @@ void LLVOAvatar::updateShadowFaces() // Render sprite sprite.setNormal(normal); - if (mIsSelf && gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK) + if (isSelf() && gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK) { sprite.setColor(0.f, 0.f, 0.f, 0.f); } @@ -5816,9 +5293,9 @@ void LLVOAvatar::updateShadowFaces() //----------------------------------------------------------------------------- void LLVOAvatar::updateSexDependentLayerSets( BOOL set_by_user ) { - invalidateComposite( mBakedTextureData[BAKED_HEAD].mTexLayerSet, set_by_user ); - invalidateComposite( mBakedTextureData[BAKED_UPPER].mTexLayerSet, set_by_user ); - invalidateComposite( mBakedTextureData[BAKED_LOWER].mTexLayerSet, set_by_user ); + invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, set_by_user ); + invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet, set_by_user ); + invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet, set_by_user ); updateMeshTextures(); } @@ -5838,27 +5315,6 @@ void LLVOAvatar::hideSkirt() mMeshLOD[MESH_ID_SKIRT]->setVisible(FALSE, TRUE); } - -//----------------------------------------------------------------------------- -// requestLayerSetUpdate() -//----------------------------------------------------------------------------- -void LLVOAvatar::requestLayerSetUpdate(ETextureIndex index ) -{ - /* switch(index) - case LOCTEX_UPPER_BODYPAINT: - case LOCTEX_UPPER_SHIRT: - if( mUpperBodyLayerSet ) - mUpperBodyLayerSet->requestUpdate(); */ - const LLVOAvatarDictionary::TextureDictionaryEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(index); - if (!texture_dict->mIsLocalTexture || !texture_dict->mIsUsedByBakedTexture) - return; - const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; - if (mBakedTextureData[baked_index].mTexLayerSet) - { - mBakedTextureData[baked_index].mTexLayerSet->requestUpdate(); - } -} - void LLVOAvatar::setParent(LLViewerObject* parent) { if (parent == NULL) @@ -5913,13 +5369,13 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi //----------------------------------------------------------------------------- // attachObject() //----------------------------------------------------------------------------- -BOOL LLVOAvatar::attachObject(LLViewerObject *viewer_object) +LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_object) { LLViewerJointAttachment* attachment = getTargetAttachmentPoint(viewer_object); if (!attachment || !attachment->addObject(viewer_object)) { - return FALSE; + return 0; } if (viewer_object->isSelected()) @@ -5928,16 +5384,7 @@ BOOL LLVOAvatar::attachObject(LLViewerObject *viewer_object) LLSelectMgr::getInstance()->updatePointAt(); } - if (mIsSelf) - { - updateAttachmentVisibility(gAgent.getCameraMode()); - - // Then make sure the inventory is in sync with the avatar. - gInventory.addChangedMask( LLInventoryObserver::LABEL, attachment->getItemID() ); - gInventory.notifyObservers(); - } - - return TRUE; + return attachment; } //----------------------------------------------------------------------------- @@ -5995,7 +5442,7 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) { LLUUID item_id = attachment->getItemID(); attachment->removeObject(viewer_object); - if (mIsSelf) + if (isSelf()) { // the simulator should automatically handle // permission revocation @@ -6017,7 +5464,7 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) } lldebugs << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << llendl; - if (mIsSelf) + if (isSelf()) { // Then make sure the inventory is in sync with the avatar. gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); @@ -6027,7 +5474,6 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) } } - return FALSE; } @@ -6057,7 +5503,7 @@ void LLVOAvatar::sitOnObject(LLViewerObject *sit_object) stopMotion(ANIM_AGENT_BODY_NOISE); - if (mIsSelf) + if (isSelf()) { // Might be first sit LLFirstUse::useSit(); @@ -6069,7 +5515,10 @@ void LLVOAvatar::sitOnObject(LLViewerObject *sit_object) // make sure we are not trying to autopilot gAgent.stopAutoPilot(); gAgent.setupSitCamera(); - if (gAgent.mForceMouselook) gAgent.changeCameraToMouselook(); + if (gAgent.getForceMouselook()) + { + gAgent.changeCameraToMouselook(); + } } } @@ -6119,7 +5568,7 @@ void LLVOAvatar::getOffObject() startMotion(ANIM_AGENT_BODY_NOISE); - if (mIsSelf) + if (isSelf()) { LLQuaternion av_rot = gAgent.getFrameAgent().getQuaternion(); LLQuaternion obj_rot = sit_object ? sit_object->getRenderRotation() : LLQuaternion::DEFAULT; @@ -6160,146 +5609,24 @@ LLVOAvatar* LLVOAvatar::findAvatarFromAttachment( LLViewerObject* obj ) return NULL; } -//----------------------------------------------------------------------------- -// isWearingAttachment() -//----------------------------------------------------------------------------- -BOOL LLVOAvatar::isWearingAttachment( const LLUUID& inv_item_id ) -{ - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ) - { - attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - if( attachment->getItemID() == inv_item_id ) - { - return TRUE; - } - } - return FALSE; -} - -//----------------------------------------------------------------------------- -// getWornAttachment() -//----------------------------------------------------------------------------- -LLViewerObject* LLVOAvatar::getWornAttachment( const LLUUID& inv_item_id ) -{ - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ) - { - attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - if( attachment->getItemID() == inv_item_id ) - { - return attachment->getObject(); - } - } - return NULL; -} - -const std::string LLVOAvatar::getAttachedPointName(const LLUUID& inv_item_id) -{ - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ) - { - attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - if( attachment->getItemID() == inv_item_id ) - { - return attachment->getName(); - } - } - - return LLStringUtil::null; -} - - -//----------------------------------------------------------------------------- -// static -// onLocalTextureLoaded() -//----------------------------------------------------------------------------- - -void LLVOAvatar::onLocalTextureLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src_raw, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) -{ - //llinfos << "onLocalTextureLoaded: " << src_vi->getID() << llendl; - - const LLUUID& src_id = src_vi->getID(); - LLAvatarTexData *data = (LLAvatarTexData *)userdata; - if (success) - { - LLVOAvatar *self = (LLVOAvatar *)gObjectList.findObject(data->mAvatarID); - if (self) - { - ETextureIndex index = data->mIndex; - if (!self->isIndexLocalTexture(index)) return; - LocalTextureData &local_tex_data = self->mLocalTextureData[index]; - if(!local_tex_data.mIsBakedReady && - local_tex_data.mImage.notNull() && - (local_tex_data.mImage->getID() == src_id) && - discard_level < local_tex_data.mDiscard) - { - local_tex_data.mDiscard = discard_level; - if ( self->isSelf() && !gAgent.cameraCustomizeAvatar() ) - { - self->requestLayerSetUpdate( index ); - } - else if( self->isSelf() && gAgent.cameraCustomizeAvatar() ) - { - LLVisualParamHint::requestHintUpdates(); - } - self->updateMeshTextures(); - } - } - } - else if (final) - { - LLVOAvatar *self = (LLVOAvatar *)gObjectList.findObject(data->mAvatarID); - if (self) - { - ETextureIndex index = data->mIndex; - if (!self->isIndexLocalTexture(index)) return; - LocalTextureData &local_tex_data = self->mLocalTextureData[index]; - // Failed: asset is missing - if(!local_tex_data.mIsBakedReady && - local_tex_data.mImage.notNull() && - local_tex_data.mImage->getID() == src_id) - { - local_tex_data.mDiscard = 0; - self->requestLayerSetUpdate( index ); - self->updateMeshTextures(); - } - } - } - - if( final || !success ) - { - delete data; - } -} - -void LLVOAvatar::updateComposites() +// warning: order(N) not order(1) +S32 LLVOAvatar::getAttachmentCount() { - for (U32 i = 0; i < mBakedTextureData.size(); i++) - { - if ( mBakedTextureData[i].mTexLayerSet - && ((i != BAKED_SKIRT) || isWearingWearableType( WT_SKIRT )) ) - { - mBakedTextureData[i].mTexLayerSet->updateComposite(); - } - } + S32 count = mAttachmentPoints.size(); + return count; } -LLColor4 LLVOAvatar::getGlobalColor( const std::string& color_name ) +LLColor4 LLVOAvatar::getGlobalColor( const std::string& color_name ) const { - if( color_name=="skin_color" && mTexSkinColor ) + if (color_name=="skin_color" && mTexSkinColor) { return mTexSkinColor->getColor(); } - else - if( color_name=="hair_color" && mTexHairColor ) + else if(color_name=="hair_color" && mTexHairColor) { return mTexHairColor->getColor(); } - if( color_name=="eye_color" && mTexEyeColor ) + if(color_name=="eye_color" && mTexEyeColor) { return mTexEyeColor->getColor(); } @@ -6310,282 +5637,64 @@ LLColor4 LLVOAvatar::getGlobalColor( const std::string& color_name ) } } - +// virtual void LLVOAvatar::invalidateComposite( LLTexLayerSet* layerset, BOOL set_by_user ) { - if( !layerset || !layerset->getUpdatesEnabled() ) - { - return; - } - - /* Debug spam. JC - const char* layer_name = ""; - if (layerset == mHeadLayerSet) - { - layer_name = "head"; - } - else if (layerset == mUpperBodyLayerSet) - { - layer_name = "upperbody"; - } - else if (layerset == mLowerBodyLayerSet) - { - layer_name = "lowerbody"; - } - else if (layerset == mEyesLayerSet) - { - layer_name = "eyes"; - } - else if (layerset == mHairLayerSet) - { - layer_name = "hair"; - } - else if (layerset == mSkirtLayerSet) - { - layer_name = "skirt"; - } - else - { - layer_name = "unknown"; - } - llinfos << "LLVOAvatar::invalidComposite() " << layer_name << llendl; - */ - - layerset->requestUpdate(); - - if( set_by_user ) - { - llassert( mIsSelf ); - - ETextureIndex baked_te = getBakedTE( layerset ); - setTEImage( baked_te, gImageList.getImage(IMG_DEFAULT_AVATAR) ); - layerset->requestUpload(); - } } void LLVOAvatar::invalidateAll() { - for (U32 i = 0; i < mBakedTextureData.size(); i++) - { - invalidateComposite(mBakedTextureData[i].mTexLayerSet, TRUE); - } - updateMeshTextures(); } -void LLVOAvatar::onGlobalColorChanged( LLTexGlobalColor* global_color, BOOL set_by_user ) +// virtual +void LLVOAvatar::setCompositeUpdatesEnabled( BOOL b ) { - if( global_color == mTexSkinColor ) +} + +void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL set_by_user ) +{ + if (global_color == mTexSkinColor) { -// llinfos << "invalidateComposite cause: onGlobalColorChanged( skin color )" << llendl; - invalidateComposite( mBakedTextureData[BAKED_HEAD].mTexLayerSet, set_by_user ); - invalidateComposite( mBakedTextureData[BAKED_UPPER].mTexLayerSet, set_by_user ); - invalidateComposite( mBakedTextureData[BAKED_LOWER].mTexLayerSet, set_by_user ); + invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, set_by_user ); + invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet, set_by_user ); + invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet, set_by_user ); } - else - if( global_color == mTexHairColor ) + else if (global_color == mTexHairColor) { -// llinfos << "invalidateComposite cause: onGlobalColorChanged( hair color )" << llendl; - invalidateComposite( mBakedTextureData[BAKED_HEAD].mTexLayerSet, set_by_user ); - invalidateComposite( mBakedTextureData[BAKED_HAIR].mTexLayerSet, set_by_user ); + invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, set_by_user ); + invalidateComposite( mBakedTextureDatas[BAKED_HAIR].mTexLayerSet, set_by_user ); // ! BACKWARDS COMPATIBILITY ! // Fix for dealing with avatars from viewers that don't bake hair. - if (!isTextureDefined(mBakedTextureData[BAKED_HAIR].mTextureIndex)) + if (!isTextureDefined(mBakedTextureDatas[BAKED_HAIR].mTextureIndex)) { LLColor4 color = mTexHairColor->getColor(); - for (U32 i = 0; i < mBakedTextureData[BAKED_HAIR].mMeshes.size(); i++) + for (U32 i = 0; i < mBakedTextureDatas[BAKED_HAIR].mMeshes.size(); i++) { - mBakedTextureData[BAKED_HAIR].mMeshes[i]->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] ); + mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] ); } } - } - else - if( global_color == mTexEyeColor ) + } + else if (global_color == mTexEyeColor) { // llinfos << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << llendl; - invalidateComposite( mBakedTextureData[BAKED_EYES].mTexLayerSet, set_by_user ); + invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet, set_by_user ); } updateMeshTextures(); } -void LLVOAvatar::forceBakeAllTextures(bool slam_for_debug) -{ - llinfos << "TAT: forced full rebake. " << llendl; - - for (U32 i = 0; i < mBakedTextureData.size(); i++) - { - ETextureIndex baked_index = mBakedTextureData[i].mTextureIndex; - LLTexLayerSet* layer_set = getLayerSet(baked_index); - if (layer_set) - { - if (slam_for_debug) - { - layer_set->setUpdatesEnabled(TRUE); - layer_set->cancelUpload(); - } - - BOOL set_by_user = TRUE; - invalidateComposite(layer_set, set_by_user); - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); - } - else - { - llwarns << "TAT: NO LAYER SET FOR " << (S32)baked_index << llendl; - } - } - - // Don't know if this is needed - updateMeshTextures(); -} - - -// static -void LLVOAvatar::processRebakeAvatarTextures(LLMessageSystem* msg, void**) -{ - LLUUID texture_id; - msg->getUUID("TextureData", "TextureID", texture_id); - - LLVOAvatar* self = gAgent.getAvatarObject(); - if (!self) return; - - // If this is a texture corresponding to one of our baked entries, - // just rebake that layer set. - BOOL found = FALSE; - - /* ETextureIndex baked_texture_indices[BAKED_NUM_INDICES] = - TEX_HEAD_BAKED, - TEX_UPPER_BAKED, */ - for (LLVOAvatarDictionary::texture_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); - iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); - iter++) - { - const ETextureIndex index = iter->first; - const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = iter->second; - if (text_dict->mIsBakedTexture) - { - if (texture_id == self->getTEImage(index)->getID()) - { - LLTexLayerSet* layer_set = self->getLayerSet(index); - if (layer_set) - { - llinfos << "TAT: rebake - matched entry " << (S32)index << llendl; - // Apparently set_by_user == force upload - BOOL set_by_user = TRUE; - self->invalidateComposite(layer_set, set_by_user); - found = TRUE; - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); - } - } - } - } - - // If texture not found, rebake all entries. - if (!found) - { - self->forceBakeAllTextures(); - } - else - { - // Not sure if this is necessary, but forceBakeAllTextures() does it. - self->updateMeshTextures(); - } -} - - -BOOL LLVOAvatar::getLocalTextureRaw(ETextureIndex index, LLImageRaw* image_raw) -{ - if (!isIndexLocalTexture(index)) return FALSE; - - BOOL success = FALSE; - - if (getLocalTextureID(index) == IMG_DEFAULT_AVATAR) - { - success = TRUE; - } - else - { - LocalTextureData &local_tex_data = mLocalTextureData[index]; - if(local_tex_data.mImage->readBackRaw(-1, image_raw, false)) - { - success = TRUE; - } - else - { - // No data loaded yet - setLocalTexture( (ETextureIndex)index, getTEImage( index ), FALSE ); - } - } - return success; -} - -BOOL LLVOAvatar::getLocalTextureGL(ETextureIndex index, LLImageGL** image_gl_pp) -{ - if (!isIndexLocalTexture(index)) return FALSE; - - BOOL success = FALSE; - *image_gl_pp = NULL; - - if (getLocalTextureID(index) == IMG_DEFAULT_AVATAR) - { - success = TRUE; - } - else - { - LocalTextureData &local_tex_data = mLocalTextureData[index]; - *image_gl_pp = local_tex_data.mImage; - success = TRUE; - } - - if( !success ) - { -// llinfos << "getLocalTextureGL(" << index << ") had no data" << llendl; - } - return success; -} - -const LLUUID& LLVOAvatar::getLocalTextureID(ETextureIndex index) -{ - if (!isIndexLocalTexture(index)) return IMG_DEFAULT_AVATAR; - - if (mLocalTextureData[index].mImage.notNull()) - { - return mLocalTextureData[index].mImage->getID(); - } - else - { - return IMG_DEFAULT_AVATAR; - } -} - -// static -void LLVOAvatar::dumpTotalLocalTextureByteCount() -{ - S32 total_gl_bytes = 0; - for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) - { - LLVOAvatar* cur = (LLVOAvatar*) *iter; - S32 gl_bytes = 0; - cur->getLocalTextureByteCount(&gl_bytes ); - total_gl_bytes += gl_bytes; - } - llinfos << "Total Avatar LocTex GL:" << (total_gl_bytes/1024) << "KB" << llendl; -} - -BOOL LLVOAvatar::isVisible() +BOOL LLVOAvatar::isVisible() const { return mDrawable.notNull() && (mDrawable->isVisible() || mIsDummy); } - // call periodically to keep isFullyLoaded up to date. // returns true if the value has changed. BOOL LLVOAvatar::updateIsFullyLoaded() { // a "heuristic" to determine if we have enough avatar data to render // (to avoid rendering a "Ruth" - DEV-3168) - BOOL loading = FALSE; // do we have a shape? @@ -6594,48 +5703,18 @@ BOOL LLVOAvatar::updateIsFullyLoaded() loading = TRUE; } - // - if (mIsSelf) - { - if (!isTextureDefined(TEX_HAIR)) - { - loading = TRUE; - } - } - else if (!isTextureDefined(TEX_LOWER_BAKED) || !isTextureDefined(TEX_UPPER_BAKED) || !isTextureDefined(TEX_HEAD_BAKED)) + if (!isTextureDefined(TEX_LOWER_BAKED) || + !isTextureDefined(TEX_UPPER_BAKED) || + !isTextureDefined(TEX_HEAD_BAKED)) { loading = TRUE; } - // special case to keep nudity off orientation island - - // this is fragilely dependent on the compositing system, - // which gets available textures in the following order: - // - // 1) use the baked texture - // 2) use the layerset - // 3) use the previously baked texture - // - // on orientation island case (3) can show naked skin. - // so we test for that here: - // - // if we were previously unloaded, and we don't have enough - // texture info for our shirt/pants, stay unloaded: - if (!mPreviousFullyLoaded) - { - if ((!isLocalTextureDataAvailable(mBakedTextureData[BAKED_LOWER].mTexLayerSet)) && - (!isTextureDefined(TEX_LOWER_BAKED))) - { - loading = TRUE; - } - - if ((!isLocalTextureDataAvailable(mBakedTextureData[BAKED_UPPER].mTexLayerSet)) && - (!isTextureDefined(TEX_UPPER_BAKED))) - { - loading = TRUE; - } - } + return processFullyLoadedChange(loading); +} - +BOOL LLVOAvatar::processFullyLoadedChange(bool loading) +{ // we wait a little bit before giving the all clear, // to let textures settle down const F32 PAUSE = 1.f; @@ -6659,8 +5738,7 @@ BOOL LLVOAvatar::updateIsFullyLoaded() return changed; } - -BOOL LLVOAvatar::isFullyLoaded() +BOOL LLVOAvatar::isFullyLoaded() const { if (gSavedSettings.getBOOL("RenderUnloadedAvatar")) return TRUE; @@ -6672,177 +5750,11 @@ BOOL LLVOAvatar::isFullyLoaded() //----------------------------------------------------------------------------- // findMotion() //----------------------------------------------------------------------------- -LLMotion* LLVOAvatar::findMotion(const LLUUID& id) +LLMotion* LLVOAvatar::findMotion(const LLUUID& id) const { return mMotionController.findMotion(id); } -// Counts the memory footprint of local textures. -void LLVOAvatar::getLocalTextureByteCount( S32* gl_bytes ) -{ - *gl_bytes = 0; - for( S32 i = 0; i < TEX_NUM_INDICES; i++ ) - { - if (!isIndexLocalTexture((ETextureIndex)i)) continue; - LLViewerImage* image_gl = mLocalTextureData[(ETextureIndex)i].mImage; - if( image_gl ) - { - S32 bytes = (S32)image_gl->getWidth() * image_gl->getHeight() * image_gl->getComponents(); - - if( image_gl->getHasGLTexture() ) - { - *gl_bytes += bytes; - } - } - } -} - - -BOOL LLVOAvatar::bindScratchTexture( LLGLenum format ) -{ - U32 texture_bytes = 0; - GLuint gl_name = getScratchTexName( format, &texture_bytes ); - if( gl_name ) - { - gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, gl_name); - stop_glerror(); - - F32* last_bind_time = LLVOAvatar::sScratchTexLastBindTime.getIfThere( format ); - if( last_bind_time ) - { - if( *last_bind_time != LLImageGL::sLastFrameTime ) - { - *last_bind_time = LLImageGL::sLastFrameTime; - LLImageGL::updateBoundTexMem(texture_bytes); - } - } - else - { - LLImageGL::updateBoundTexMem(texture_bytes); - LLVOAvatar::sScratchTexLastBindTime.addData( format, new F32(LLImageGL::sLastFrameTime) ); - } - - - return TRUE; - } - else - { - return FALSE; - } -} - - -LLGLuint LLVOAvatar::getScratchTexName( LLGLenum format, U32* texture_bytes ) -{ - S32 components; - GLenum internal_format; - switch( format ) - { - case GL_LUMINANCE: components = 1; internal_format = GL_LUMINANCE8; break; - case GL_ALPHA: components = 1; internal_format = GL_ALPHA8; break; - case GL_COLOR_INDEX: components = 1; internal_format = GL_COLOR_INDEX8_EXT; break; - case GL_LUMINANCE_ALPHA: components = 2; internal_format = GL_LUMINANCE8_ALPHA8; break; - case GL_RGB: components = 3; internal_format = GL_RGB8; break; - case GL_RGBA: components = 4; internal_format = GL_RGBA8; break; - default: llassert(0); components = 4; internal_format = GL_RGBA8; break; - } - - *texture_bytes = components * SCRATCH_TEX_WIDTH * SCRATCH_TEX_HEIGHT; - - if( LLVOAvatar::sScratchTexNames.checkData( format ) ) - { - return *( LLVOAvatar::sScratchTexNames.getData( format ) ); - } - else - { - - LLGLSUIDefault gls_ui; - - U32 name = 0; - LLImageGL::generateTextures(1, &name ); - stop_glerror(); - - gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, name); - stop_glerror(); - - LLImageGL::setManualImage( - GL_TEXTURE_2D, 0, internal_format, - SCRATCH_TEX_WIDTH, SCRATCH_TEX_HEIGHT, - format, GL_UNSIGNED_BYTE, NULL ); - stop_glerror(); - - gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); - gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); - stop_glerror(); - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - stop_glerror(); - - LLVOAvatar::sScratchTexNames.addData( format, new LLGLuint( name ) ); - - LLVOAvatar::sScratchTexBytes += *texture_bytes; - LLImageGL::sGlobalTextureMemory += *texture_bytes; - return name; - } -} - - - -//----------------------------------------------------------------------------- -// setLocalTextureTE() -//----------------------------------------------------------------------------- -void LLVOAvatar::setLocTexTE( U8 te, LLViewerImage* image, BOOL set_by_user ) -{ - if( !mIsSelf ) - { - llassert( 0 ); - return; - } - - if( te >= TEX_NUM_INDICES ) - { - llassert(0); - return; - } - - if( getTEImage( te )->getID() == image->getID() ) - { - return; - } - - if (isIndexBakedTexture((ETextureIndex)te)) - { - llassert(0); - return; - } - - LLTexLayerSet* layer_set = getLayerSet((ETextureIndex)te); - if (layer_set) - { - invalidateComposite(layer_set, set_by_user); - } - - setTEImage( te, image ); - updateMeshTextures(); - - if( gAgent.cameraCustomizeAvatar() ) - { - LLVisualParamHint::requestHintUpdates(); - } -} - -void LLVOAvatar::setupComposites() -{ - for (U32 i = 0; i < mBakedTextureData.size(); i++) - { - bool layer_baked = isTextureDefined(mBakedTextureData[i].mTextureIndex); - if (mBakedTextureData[i].mTexLayerSet) - { - mBakedTextureData[i].mTexLayerSet->setUpdatesEnabled( !layer_baked ); - } - } -} - //----------------------------------------------------------------------------- // updateMeshTextures() // Uses the current TE values to set the meshes' and layersets' textures. @@ -6855,25 +5767,25 @@ void LLVOAvatar::updateMeshTextures() // if user has never specified a texture, assign the default for (U32 i=0; i < getNumTEs(); i++) { - const LLViewerImage* te_image = getTEImage(i); + const LLViewerImage* te_image = getImage(i); if(!te_image || te_image->getID().isNull() || (te_image->getID() == IMG_DEFAULT)) { - setTEImage(i, gImageList.getImage(i == TEX_HAIR ? IMG_DEFAULT : IMG_DEFAULT_AVATAR)); // IMG_DEFAULT_AVATAR = a special texture that's never rendered. + setImage(i, gImageList.getImage(i == TEX_HAIR ? IMG_DEFAULT : IMG_DEFAULT_AVATAR)); // IMG_DEFAULT_AVATAR = a special texture that's never rendered. } } - const BOOL self_customizing = mIsSelf && gAgent.cameraCustomizeAvatar(); // During face edit mode, we don't use baked textures - const BOOL other_culled = !mIsSelf && mCulled; + const BOOL self_customizing = isSelf() && gAgent.cameraCustomizeAvatar(); // During face edit mode, we don't use baked textures + const BOOL other_culled = !isSelf() && mCulled; - std::vector<bool> is_layer_baked; - is_layer_baked.resize(mBakedTextureData.size(), false); + std::vector<BOOL> is_layer_baked; + is_layer_baked.resize(mBakedTextureDatas.size(), false); - std::vector<bool> use_lkg_baked_layer; // lkg = "last known good" - use_lkg_baked_layer.resize(mBakedTextureData.size(), false); + std::vector<BOOL> use_lkg_baked_layer; // lkg = "last known good" + use_lkg_baked_layer.resize(mBakedTextureDatas.size(), false); - for (U32 i=0; i < mBakedTextureData.size(); i++) + for (U32 i=0; i < mBakedTextureDatas.size(); i++) { - is_layer_baked[i] = isTextureDefined(mBakedTextureData[i].mTextureIndex); + is_layer_baked[i] = isTextureDefined(mBakedTextureDatas[i].mTextureIndex); if (!other_culled) { @@ -6881,21 +5793,21 @@ void LLVOAvatar::updateMeshTextures() // use the last-known good baked texture until it finish the first // render of the new layerset. use_lkg_baked_layer[i] = (!is_layer_baked[i] - && (mBakedTextureData[i].mLastTextureIndex != IMG_DEFAULT_AVATAR) - && mBakedTextureData[i].mTexLayerSet - && !mBakedTextureData[i].mTexLayerSet->getComposite()->isInitialized()); + && (mBakedTextureDatas[i].mLastTextureIndex != IMG_DEFAULT_AVATAR) + && mBakedTextureDatas[i].mTexLayerSet + && !mBakedTextureDatas[i].mTexLayerSet->getComposite()->isInitialized()); if (use_lkg_baked_layer[i]) { - mBakedTextureData[i].mTexLayerSet->setUpdatesEnabled(TRUE); + mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled(TRUE); } } else { use_lkg_baked_layer[i] = (!is_layer_baked[i] - && mBakedTextureData[i].mLastTextureIndex != IMG_DEFAULT_AVATAR); - if (mBakedTextureData[i].mTexLayerSet) + && mBakedTextureDatas[i].mLastTextureIndex != IMG_DEFAULT_AVATAR); + if (mBakedTextureDatas[i].mTexLayerSet) { - mBakedTextureData[i].mTexLayerSet->destroyComposite(); + mBakedTextureDatas[i].mTexLayerSet->destroyComposite(); } } @@ -6908,28 +5820,28 @@ void LLVOAvatar::updateMeshTextures() llwarns << "updateMeshTextures: invalid host for object: " << getID() << llendl; } - for (U32 i=0; i < mBakedTextureData.size(); i++) + for (U32 i=0; i < mBakedTextureDatas.size(); i++) { if (use_lkg_baked_layer[i] && !self_customizing ) { - LLViewerImage* baked_img = gImageList.getImageFromHost( mBakedTextureData[i].mLastTextureIndex, target_host ); - mBakedTextureData[i].mIsUsed = TRUE; - for (U32 k=0; k < mBakedTextureData[i].mMeshes.size(); k++) + LLViewerImage* baked_img = gImageList.getImageFromHost( mBakedTextureDatas[i].mLastTextureIndex, target_host ); + mBakedTextureDatas[i].mIsUsed = TRUE; + for (U32 k=0; k < mBakedTextureDatas[i].mMeshes.size(); k++) { - mBakedTextureData[i].mMeshes[k]->setTexture( baked_img ); + mBakedTextureDatas[i].mMeshes[k]->setTexture( baked_img ); } } else if (!self_customizing && is_layer_baked[i]) { - LLViewerImage* baked_img = getTEImage( mBakedTextureData[i].mTextureIndex ); - if( baked_img->getID() == mBakedTextureData[i].mLastTextureIndex ) + LLViewerImage* baked_img = getImage( mBakedTextureDatas[i].mTextureIndex ); + if( baked_img->getID() == mBakedTextureDatas[i].mLastTextureIndex ) { // Even though the file may not be finished loading, we'll consider it loaded and use it (rather than doing compositing). useBakedTexture( baked_img->getID() ); } else { - mBakedTextureData[i].mIsLoaded = FALSE; + mBakedTextureDatas[i].mIsLoaded = FALSE; if ( (i == BAKED_HEAD) || (i == BAKED_UPPER) || (i == BAKED_LOWER) ) { baked_img->setLoadedCallback(onBakedTextureMasksLoaded, MORPH_MASK_REQUESTED_DISCARD, TRUE, TRUE, new LLTextureMaskData( mID )); @@ -6937,133 +5849,63 @@ void LLVOAvatar::updateMeshTextures() baked_img->setLoadedCallback(onBakedTextureLoaded, SWITCH_TO_BAKED_DISCARD, FALSE, FALSE, new LLUUID( mID ) ); } } - else if (mBakedTextureData[i].mTexLayerSet + else if (mBakedTextureDatas[i].mTexLayerSet && !other_culled - && (i != BAKED_HAIR || is_layer_baked[i] || mIsSelf)) // ! BACKWARDS COMPATIBILITY ! workaround for old viewers. + && (i != BAKED_HAIR || is_layer_baked[i] || isSelf())) // ! BACKWARDS COMPATIBILITY ! workaround for old viewers. { - mBakedTextureData[i].mTexLayerSet->createComposite(); - mBakedTextureData[i].mTexLayerSet->setUpdatesEnabled( TRUE ); - mBakedTextureData[i].mIsUsed = FALSE; - for (U32 k=0; k < mBakedTextureData[i].mMeshes.size(); k++) + mBakedTextureDatas[i].mTexLayerSet->createComposite(); + mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled( TRUE ); + mBakedTextureDatas[i].mIsUsed = FALSE; + for (U32 k=0; k < mBakedTextureDatas[i].mMeshes.size(); k++) { - mBakedTextureData[i].mMeshes[k]->setLayerSet( mBakedTextureData[i].mTexLayerSet ); + mBakedTextureDatas[i].mMeshes[k]->setLayerSet( mBakedTextureDatas[i].mTexLayerSet ); } } } // ! BACKWARDS COMPATIBILITY ! // Workaround for viewing avatars from old viewers that haven't baked hair textures. - // if (!isTextureDefined(mBakedTextureData[BAKED_HAIR].mTextureIndex)) if (!is_layer_baked[BAKED_HAIR] || self_customizing) { const LLColor4 color = mTexHairColor ? mTexHairColor->getColor() : LLColor4(1,1,1,1); - LLViewerImage* hair_img = getTEImage( TEX_HAIR ); - for (U32 i = 0; i < mBakedTextureData[BAKED_HAIR].mMeshes.size(); i++) + LLViewerImage* hair_img = getImage( TEX_HAIR ); + for (U32 i = 0; i < mBakedTextureDatas[BAKED_HAIR].mMeshes.size(); i++) { - mBakedTextureData[BAKED_HAIR].mMeshes[i]->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] ); - mBakedTextureData[BAKED_HAIR].mMeshes[i]->setTexture( hair_img ); + mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] ); + mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setTexture( hair_img ); } - mHasBakedHair = FALSE; } - else - { - mHasBakedHair = TRUE; - } - /* // Head - BOOL head_baked_ready = (is_layer_baked[BAKED_HEAD] && mBakedTextureData[BAKED_HEAD].mIsLoaded) || other_culled; - setLocalTexture( TEX_HEAD_BODYPAINT, getTEImage( TEX_HEAD_BODYPAINT ), head_baked_ready ); */ - for (LLVOAvatarDictionary::baked_map_t::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); + // Turn on alpha masking correctly for yourself and other avatars on 1.23+ + mSupportsAlphaLayers = isSelf() || is_layer_baked[BAKED_HAIR]; + + for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); baked_iter++) { const EBakedTextureIndex baked_index = baked_iter->first; - const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = baked_iter->second; + const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second; for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin(); local_tex_iter != baked_dict->mLocalTextures.end(); local_tex_iter++) { const ETextureIndex texture_index = *local_tex_iter; - const BOOL is_baked_ready = (is_layer_baked[baked_index] && mBakedTextureData[baked_index].mIsLoaded) || other_culled; - setLocalTexture(texture_index, getTEImage(texture_index), is_baked_ready ); + const BOOL is_baked_ready = (is_layer_baked[baked_index] && mBakedTextureDatas[baked_index].mIsLoaded) || other_culled; + setLocalTexture(texture_index, getImage(texture_index), is_baked_ready ); } } removeMissingBakedTextures(); } +// virtual //----------------------------------------------------------------------------- // setLocalTexture() //----------------------------------------------------------------------------- -void LLVOAvatar::setLocalTexture( ETextureIndex index, LLViewerImage* tex, BOOL baked_version_ready ) -{ - if (!isIndexLocalTexture(index)) return; - - S32 desired_discard = mIsSelf ? 0 : 2; - LocalTextureData &local_tex_data = mLocalTextureData[index]; - if (!baked_version_ready) - { - if (tex != local_tex_data.mImage || local_tex_data.mIsBakedReady) - { - local_tex_data.mDiscard = MAX_DISCARD_LEVEL+1; - } - if (tex->getID() != IMG_DEFAULT_AVATAR) - { - if (local_tex_data.mDiscard > desired_discard) - { - S32 tex_discard = tex->getDiscardLevel(); - if (tex_discard >= 0 && tex_discard <= desired_discard) - { - local_tex_data.mDiscard = tex_discard; - if( mIsSelf && !gAgent.cameraCustomizeAvatar() ) - { - requestLayerSetUpdate( index ); - } - else if( mIsSelf && gAgent.cameraCustomizeAvatar() ) - { - LLVisualParamHint::requestHintUpdates(); - } - } - else - { - tex->setLoadedCallback( onLocalTextureLoaded, desired_discard, TRUE, FALSE, new LLAvatarTexData(getID(), index) ); - } - } - tex->setMinDiscardLevel(desired_discard); - } - } - local_tex_data.mIsBakedReady = baked_version_ready; - local_tex_data.mImage = tex; -} - -//----------------------------------------------------------------------------- -// requestLayerSetUploads() -//----------------------------------------------------------------------------- -void LLVOAvatar::requestLayerSetUploads() +void LLVOAvatar::setLocalTexture(ETextureIndex type, LLViewerImage* tex, BOOL baked_version_exists, U32 index) { - for (U32 i = 0; i < mBakedTextureData.size(); i++) - { - bool layer_baked = isTextureDefined(mBakedTextureData[i].mTextureIndex); - if ( !layer_baked && mBakedTextureData[i].mTexLayerSet ) - { - mBakedTextureData[i].mTexLayerSet->requestUpload(); - } - } -} - - -//----------------------------------------------------------------------------- -// setCompositeUpdatesEnabled() -//----------------------------------------------------------------------------- -void LLVOAvatar::setCompositeUpdatesEnabled( BOOL b ) -{ - for (U32 i = 0; i < mBakedTextureData.size(); i++) - { - if (mBakedTextureData[i].mTexLayerSet ) - { - mBakedTextureData[i].mTexLayerSet->setUpdatesEnabled( b ); - } - } + // invalid for anyone but self + llassert(0); } void LLVOAvatar::addChat(const LLChat& chat) @@ -7095,184 +5937,85 @@ void LLVOAvatar::clearChat() mChats.clear(); } -S32 LLVOAvatar::getLocalDiscardLevel( ETextureIndex index ) +// adds a morph mask to the appropriate baked texture structure +void LLVOAvatar::addMaskedMorph(EBakedTextureIndex index, LLPolyMorphTarget* morph_target, BOOL invert, std::string layer) { - if (!isIndexLocalTexture(index)) return FALSE; - - LocalTextureData &local_tex_data = mLocalTextureData[index]; - if (index >= 0 - && getLocalTextureID(index) != IMG_DEFAULT_AVATAR - && !local_tex_data.mImage->isMissingAsset()) + if (index < BAKED_NUM_INDICES) { - return local_tex_data.mImage->getDiscardLevel(); - } - else - { - // We don't care about this (no image associated with the layer) treat as fully loaded. - return 0; + LLMaskedMorph *morph = new LLMaskedMorph(morph_target, invert, layer); + mBakedTextureDatas[index].mMaskedMorphs.push_front(morph); } } -//----------------------------------------------------------------------------- -// isLocalTextureDataFinal() -// Returns true if the highest quality discard level exists for every texture -// in the layerset. -//----------------------------------------------------------------------------- -BOOL LLVOAvatar::isLocalTextureDataFinal( LLTexLayerSet* layerset ) +// invalidates morph masks for a given layer. Don't pass a parameter to invalidate all morph masks. +void LLVOAvatar::invalidateMorphMasks(LLVOAvatarDefines::EBakedTextureIndex index) { - for (U32 i = 0; i < mBakedTextureData.size(); i++) - { - if (layerset == mBakedTextureData[i].mTexLayerSet) - { - const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i); - for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin(); - local_tex_iter != baked_dict->mLocalTextures.end(); - local_tex_iter++) - { - if (getLocalDiscardLevel(*local_tex_iter) != 0) - { - return FALSE; - } - } - return TRUE; - } - } - - llassert(0); - return FALSE; + setMorphMasksValid(FALSE, index); } -//----------------------------------------------------------------------------- -// isLocalTextureDataAvailable() -// Returns true if at least the lowest quality discard level exists for every texture -// in the layerset. -//----------------------------------------------------------------------------- -BOOL LLVOAvatar::isLocalTextureDataAvailable( LLTexLayerSet* layerset ) +// updates morph masks to be a value for a given layer. Don't pass an argument to set value for all morph masks +void LLVOAvatar::setMorphMasksValid(BOOL new_status, LLVOAvatarDefines::EBakedTextureIndex index) { - /* if( layerset == mBakedTextureData[BAKED_HEAD].mTexLayerSet ) - return getLocalDiscardLevel( TEX_HEAD_BODYPAINT ) >= 0; */ - for (LLVOAvatarDictionary::baked_map_t::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); - baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); - baked_iter++) + if (index == BAKED_NUM_INDICES) { - const EBakedTextureIndex baked_index = baked_iter->first; - if (layerset == mBakedTextureData[baked_index].mTexLayerSet) + for (U8 tex = 0; tex < (U8)BAKED_NUM_INDICES; tex++) { - bool ret = true; - const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = baked_iter->second; - for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin(); - local_tex_iter != baked_dict->mLocalTextures.end(); - local_tex_iter++) - { - ret &= (getLocalDiscardLevel(*local_tex_iter) >= 0); - } - return ret; + mBakedTextureDatas[tex].mMorphMasksValid = new_status; } - } - llassert(0); - return FALSE; -} - - -//----------------------------------------------------------------------------- -// getBakedTE() -// Used by the LayerSet. (Layer sets don't in general know what textures depend on them.) -//----------------------------------------------------------------------------- -ETextureIndex LLVOAvatar::getBakedTE( LLTexLayerSet* layerset ) -{ - for (U32 i = 0; i < mBakedTextureData.size(); i++) + } + else if (index < BAKED_NUM_INDICES) { - if (layerset == mBakedTextureData[i].mTexLayerSet ) - { - return mBakedTextureData[i].mTextureIndex; - } + mBakedTextureDatas[index].mMorphMasksValid = new_status; } - - llassert(0); - return TEX_HEAD_BAKED; } -//----------------------------------------------------------------------------- -// setNewBakedTexture() -// A new baked texture has been successfully uploaded and we can start using it now. -//----------------------------------------------------------------------------- -void LLVOAvatar::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) +// returns TRUE if morph masks are present and not valid for a given baked texture, FALSE otherwise +BOOL LLVOAvatar::morphMaskNeedsUpdate(LLVOAvatarDefines::EBakedTextureIndex index) { - // Baked textures live on other sims. - LLHost target_host = getObjectHost(); - setTEImage( te, gImageList.getImageFromHost( uuid, target_host ) ); - updateMeshTextures(); - dirtyMesh(); - - - LLVOAvatar::cullAvatarsByPixelArea(); - - /* switch(te) - case TEX_HEAD_BAKED: - llinfos << "New baked texture: HEAD" << llendl; */ - const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = LLVOAvatarDictionary::getInstance()->getTexture(te); - if (text_dict->mIsBakedTexture) - { - llinfos << "New baked texture: " << text_dict->mName << " UUID: " << uuid <<llendl; - mBakedTextureData[text_dict->mBakedTextureIndex].mTexLayerSet->requestUpdate(); - } - else + if (index >= BAKED_NUM_INDICES) { - llwarns << "New baked texture: unknown te " << te << llendl; + return FALSE; } - - // dumpAvatarTEs( "setNewBakedTexture() send" ); - // RN: throttle uploads - if (!hasPendingBakedUploads()) + + if (!mBakedTextureDatas[index].mMaskedMorphs.empty() && !mBakedTextureDatas[index].mMorphMasksValid) { - gAgent.sendAgentSetAppearance(); + return TRUE; } + + return FALSE; } -bool LLVOAvatar::hasPendingBakedUploads() +void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLVOAvatarDefines::EBakedTextureIndex index) { - for (U32 i = 0; i < mBakedTextureData.size(); i++) + if (index >= BAKED_NUM_INDICES) { - bool upload_pending = (mBakedTextureData[i].mTexLayerSet && mBakedTextureData[i].mTexLayerSet->getComposite()->uploadPending()); - if (upload_pending) - { - return true; - } + llwarns << "invalid baked texture index passed to applyMorphMask" << llendl; + return; } - return false; -} -//----------------------------------------------------------------------------- -// setCachedBakedTexture() -// A baked texture id was received from a cache query, make it active -//----------------------------------------------------------------------------- -void LLVOAvatar::setCachedBakedTexture( ETextureIndex te, const LLUUID& uuid ) -{ - setTETexture( te, uuid ); - - /* switch(te) - case TEX_HEAD_BAKED: - if( mHeadLayerSet ) - mHeadLayerSet->cancelUpload(); */ - for (U32 i = 0; i < mBakedTextureData.size(); i++) - { - if ( mBakedTextureData[i].mTextureIndex == te && mBakedTextureData[i].mTexLayerSet) - { - mBakedTextureData[i].mTexLayerSet->cancelUpload(); - } + for (morph_list_t::const_iterator iter = mBakedTextureDatas[index].mMaskedMorphs.begin(); + iter != mBakedTextureDatas[index].mMaskedMorphs.end(); iter++) + { + const LLMaskedMorph* maskedMorph = (*iter); + maskedMorph->mMorphTarget->applyMask(tex_data, width, height, num_components, maskedMorph->mInvert); } } + //----------------------------------------------------------------------------- -// releaseUnneccesaryTextures() +// releaseComponentTextures() // release any component texture UUIDs for which we have a baked texture +// ! BACKWARDS COMPATIBILITY ! +// This is only called for non-self avatars, it can be taken out once component +// textures aren't communicated by non-self avatars. //----------------------------------------------------------------------------- -void LLVOAvatar::releaseUnnecessaryTextures() +void LLVOAvatar::releaseComponentTextures() { - // Backwards Compat: detect if the baked hair texture actually wasn't sent, and if so set to default - if (isTextureDefined(TEX_HAIR_BAKED) && getTEImage(TEX_HAIR_BAKED)->getID() == getTEImage(TEX_SKIRT_BAKED)->getID()) + // ! BACKWARDS COMPATIBILITY ! + // Detect if the baked hair texture actually wasn't sent, and if so set to default + if (isTextureDefined(TEX_HAIR_BAKED) && getImage(TEX_HAIR_BAKED)->getID() == getImage(TEX_SKIRT_BAKED)->getID()) { - if (getTEImage(TEX_HAIR_BAKED)->getID() != IMG_INVISIBLE) + if (getImage(TEX_HAIR_BAKED)->getID() != IMG_INVISIBLE) { // Regression case of messaging system. Expected 21 textures, received 20. last texture is not valid so set to default setTETexture(TEX_HAIR_BAKED, IMG_DEFAULT_AVATAR); @@ -7281,7 +6024,7 @@ void LLVOAvatar::releaseUnnecessaryTextures() for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { - const LLVOAvatarDictionary::BakedDictionaryEntry * bakedDicEntry = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); + const LLVOAvatarDictionary::BakedEntry * bakedDicEntry = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); // skip if this is a skirt and av is not wearing one, or if we don't have a baked texture UUID if (!isTextureDefined(bakedDicEntry->mTextureIndex) && ( (baked_index != BAKED_SKIRT) || isWearingWearableType(WT_SKIRT) )) @@ -7297,111 +6040,68 @@ void LLVOAvatar::releaseUnnecessaryTextures() } } -//----------------------------------------------------------------------------- -// static -// onCustomizeStart() -//----------------------------------------------------------------------------- -void LLVOAvatar::onCustomizeStart() -{ - // We're no longer doing any baking or invalidating on entering - // appearance editing mode. Leaving function in place in case - // further changes require us to do something at this point - Nyx -} - -//----------------------------------------------------------------------------- -// static -// onCustomizeEnd() -//----------------------------------------------------------------------------- -void LLVOAvatar::onCustomizeEnd() -{ - LLVOAvatar *avatarp = gAgent.getAvatarObject(); - if (avatarp) - { - avatarp->invalidateAll(); - avatarp->requestLayerSetUploads(); - } -} - -void LLVOAvatar::onChangeSelfInvisible(BOOL newvalue) -{ - LLVOAvatar *avatarp = gAgent.getAvatarObject(); - if (avatarp) - { - if (newvalue) - { - // we have just requested to set the avatar's baked textures to invisible - avatarp->setInvisible(TRUE); - } - else - { - avatarp->setInvisible(FALSE); - } - } -} - - BOOL LLVOAvatar::teToColorParams( ETextureIndex te, const char* param_name[3] ) { switch( te ) { - case TEX_UPPER_SHIRT: - param_name[0] = "shirt_red"; - param_name[1] = "shirt_green"; - param_name[2] = "shirt_blue"; - break; - - case TEX_LOWER_PANTS: - param_name[0] = "pants_red"; - param_name[1] = "pants_green"; - param_name[2] = "pants_blue"; - break; - - case TEX_LOWER_SHOES: - param_name[0] = "shoes_red"; - param_name[1] = "shoes_green"; - param_name[2] = "shoes_blue"; - break; - - case TEX_LOWER_SOCKS: - param_name[0] = "socks_red"; - param_name[1] = "socks_green"; - param_name[2] = "socks_blue"; - break; - - case TEX_UPPER_JACKET: - case TEX_LOWER_JACKET: - param_name[0] = "jacket_red"; - param_name[1] = "jacket_green"; - param_name[2] = "jacket_blue"; - break; - - case TEX_UPPER_GLOVES: - param_name[0] = "gloves_red"; - param_name[1] = "gloves_green"; - param_name[2] = "gloves_blue"; - break; - - case TEX_UPPER_UNDERSHIRT: - param_name[0] = "undershirt_red"; - param_name[1] = "undershirt_green"; - param_name[2] = "undershirt_blue"; - break; + case TEX_UPPER_SHIRT: + param_name[0] = "shirt_red"; + param_name[1] = "shirt_green"; + param_name[2] = "shirt_blue"; + break; + + case TEX_LOWER_PANTS: + param_name[0] = "pants_red"; + param_name[1] = "pants_green"; + param_name[2] = "pants_blue"; + break; + + case TEX_LOWER_SHOES: + param_name[0] = "shoes_red"; + param_name[1] = "shoes_green"; + param_name[2] = "shoes_blue"; + break; + + case TEX_LOWER_SOCKS: + param_name[0] = "socks_red"; + param_name[1] = "socks_green"; + param_name[2] = "socks_blue"; + break; + + case TEX_UPPER_JACKET: + case TEX_LOWER_JACKET: + param_name[0] = "jacket_red"; + param_name[1] = "jacket_green"; + param_name[2] = "jacket_blue"; + break; + + case TEX_UPPER_GLOVES: + param_name[0] = "gloves_red"; + param_name[1] = "gloves_green"; + param_name[2] = "gloves_blue"; + break; + + case TEX_UPPER_UNDERSHIRT: + param_name[0] = "undershirt_red"; + param_name[1] = "undershirt_green"; + param_name[2] = "undershirt_blue"; + break; - case TEX_LOWER_UNDERPANTS: - param_name[0] = "underpants_red"; - param_name[1] = "underpants_green"; - param_name[2] = "underpants_blue"; - break; - - case TEX_SKIRT: - param_name[0] = "skirt_red"; - param_name[1] = "skirt_green"; - param_name[2] = "skirt_blue"; - break; - - default: - llassert(0); - return FALSE; + case TEX_LOWER_UNDERPANTS: + param_name[0] = "underpants_red"; + param_name[1] = "underpants_green"; + param_name[2] = "underpants_blue"; + break; + + case TEX_SKIRT: + param_name[0] = "skirt_red"; + param_name[1] = "skirt_green"; + param_name[2] = "skirt_blue"; + break; + + default: + llassert(0); + return FALSE; } return TRUE; @@ -7431,140 +6131,53 @@ LLColor4 LLVOAvatar::getClothesColor( ETextureIndex te ) return color; } - - +// static +LLColor4 LLVOAvatar::getDummyColor() +{ + return DUMMY_COLOR; +} void LLVOAvatar::dumpAvatarTEs( const std::string& context ) { /* const char* te_name[] = { "TEX_HEAD_BODYPAINT ", "TEX_UPPER_SHIRT ", */ - llinfos << (mIsSelf ? "Self: " : "Other: ") << context << llendl; - for (LLVOAvatarDictionary::texture_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); + llinfos << (isSelf() ? "Self: " : "Other: ") << context << llendl; + for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); iter++) { - const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = iter->second; - const LLViewerImage* te_image = getTEImage(iter->first); + const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second; + const LLViewerImage* te_image = getImage(iter->first); if( !te_image ) { - llinfos << " " << text_dict->mName << ": null ptr" << llendl; + llinfos << " " << texture_dict->mName << ": null ptr" << llendl; } else if( te_image->getID().isNull() ) { - llinfos << " " << text_dict->mName << ": null UUID" << llendl; + llinfos << " " << texture_dict->mName << ": null UUID" << llendl; } else if( te_image->getID() == IMG_DEFAULT ) { - llinfos << " " << text_dict->mName << ": IMG_DEFAULT" << llendl; + llinfos << " " << texture_dict->mName << ": IMG_DEFAULT" << llendl; } else if( te_image->getID() == IMG_DEFAULT_AVATAR ) { - llinfos << " " << text_dict->mName << ": IMG_DEFAULT_AVATAR" << llendl; - } - else - { - llinfos << " " << text_dict->mName << ": " << te_image->getID() << llendl; - } - } -} - -//----------------------------------------------------------------------------- -// updateAttachmentVisibility() -//----------------------------------------------------------------------------- -void LLVOAvatar::updateAttachmentVisibility(U32 camera_mode) -{ - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ) - { - attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachment = curiter->second; - if (attachment->getIsHUDAttachment()) - { - attachment->setAttachmentVisibility(TRUE); + llinfos << " " << texture_dict->mName << ": IMG_DEFAULT_AVATAR" << llendl; } else { - switch (camera_mode) - { - case CAMERA_MODE_MOUSELOOK: - if (LLVOAvatar::sVisibleInFirstPerson && attachment->getVisibleInFirstPerson()) - { - attachment->setAttachmentVisibility(TRUE); - } - else - { - attachment->setAttachmentVisibility(FALSE); - } - break; - default: - attachment->setAttachmentVisibility(TRUE); - break; - } - } - } -} - -// Given a texture entry, determine which wearable type owns it. -// static -LLUUID LLVOAvatar::getDefaultTEImageID(ETextureIndex index ) -{ - /* switch( index ) - case TEX_UPPER_SHIRT: return LLUUID( gSavedSettings.getString("UIImgDefaultShirtUUID") ); */ - const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = LLVOAvatarDictionary::getInstance()->getTexture(index); - const std::string &default_image_name = text_dict->mDefaultImageName; - if (default_image_name == "") - { - return IMG_DEFAULT_AVATAR; - } - else - { - return LLUUID(gSavedSettings.getString(default_image_name)); - } -} - - -void LLVOAvatar::setInvisible(BOOL newvalue) -{ - if (newvalue) - { - setCompositeUpdatesEnabled(FALSE); - for (U32 i = 0; i < mBakedTextureData.size(); i++ ) - { - setNewBakedTexture(mBakedTextureData[i].mTextureIndex, IMG_INVISIBLE); + llinfos << " " << texture_dict->mName << ": " << te_image->getID() << llendl; } - gAgent.sendAgentSetAppearance(); } - else - { - setCompositeUpdatesEnabled(TRUE); - invalidateAll(); - requestLayerSetUploads(); - gAgent.sendAgentSetAppearance(); - } -} - -LLColor4 LLVOAvatar::getDummyColor() -{ - return DUMMY_COLOR; -} - -// Given a texture entry, determine which wearable type owns it. -// static -EWearableType LLVOAvatar::getTEWearableType(ETextureIndex index ) -{ - /* switch(index) - case TEX_UPPER_SHIRT: - return WT_SHIRT; */ - return LLVOAvatarDictionary::getInstance()->getTexture(index)->mWearableType; } // Unlike most wearable functions, this works for both self and other. -BOOL LLVOAvatar::isWearingWearableType( EWearableType type ) +BOOL LLVOAvatar::isWearingWearableType(EWearableType type) const { if (mIsDummy) return TRUE; - switch( type ) + switch(type) { case WT_SHAPE: case WT_SKIN: @@ -7578,16 +6191,16 @@ BOOL LLVOAvatar::isWearingWearableType( EWearableType type ) /* switch(type) case WT_SHIRT: indicator_te = TEX_UPPER_SHIRT; */ - for (LLVOAvatarDictionary::texture_map_t::const_iterator tex_iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); + for (LLVOAvatarDictionary::Textures::const_iterator tex_iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); tex_iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); tex_iter++) { const LLVOAvatarDefines::ETextureIndex index = tex_iter->first; - const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = tex_iter->second; - if (text_dict->mWearableType == type) + const LLVOAvatarDictionary::TextureEntry *texture_dict = tex_iter->second; + if (texture_dict->mWearableType == type) { // If you're checking your own clothing, check the component texture - if (mIsSelf) + if (isSelf()) { if (isTextureDefined(index)) { @@ -7604,23 +6217,10 @@ BOOL LLVOAvatar::isWearingWearableType( EWearableType type ) // NOTE: this is a poor substitute if you actually want to know about individual pieces of clothing // this works for detecting a skirt (most important), but is ineffective at any piece of clothing that // gets baked into a texture that always exists (upper or lower). - const std::string name = text_dict->mName; - for (LLVOAvatarDictionary::baked_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); - iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); - iter++) + if (texture_dict->mIsUsedByBakedTexture) { - const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = iter->second; - if (baked_dict->mName == name) - { - if (isTextureDefined(baked_dict->mTextureIndex)) - { - return TRUE; - } - else - { - return FALSE; - } - } + const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; + return isTextureDefined(LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex); } return FALSE; } @@ -7628,41 +6228,6 @@ BOOL LLVOAvatar::isWearingWearableType( EWearableType type ) return FALSE; } -//----------------------------------------------------------------------------- -// updatedWearable( EWearableType type ) -// forces an update to any baked textures relevant to type. -// Should be called only on saving the wearable -//----------------------------------------------------------------------------- -void LLVOAvatar::wearableUpdated( EWearableType type ) -{ - for (LLVOAvatarDictionary::wearable_map_t::const_iterator wearable_iter = LLVOAvatarDictionary::getInstance()->getWearables().begin(); - wearable_iter != LLVOAvatarDictionary::getInstance()->getWearables().end(); - wearable_iter++) - { - const LLVOAvatarDictionary::WearableDictionaryEntry *wearable_dict = wearable_iter->second; - const LLVOAvatarDefines::EBakedTextureIndex index = wearable_iter->first; - if (wearable_dict) - { - for (LLVOAvatarDefines::wearables_vec_t::const_iterator type_iter = wearable_dict->mWearablesVec.begin(); - type_iter != wearable_dict->mWearablesVec.end(); - type_iter++) - { - const EWearableType comp_type = *type_iter; - if (comp_type == type) - { - if (mBakedTextureData[index].mTexLayerSet) - { - mBakedTextureData[index].mTexLayerSet->requestUpdate(); - mBakedTextureData[index].mTexLayerSet->requestUpload(); - } - break; - } - } - } - } -} - - //----------------------------------------------------------------------------- // clampAttachmentPositions() //----------------------------------------------------------------------------- @@ -7741,16 +6306,16 @@ void LLVOAvatar::onFirstTEMessageReceived() { mFirstTEMessageReceived = TRUE; - for (U32 i = 0; i < mBakedTextureData.size(); i++) + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - bool layer_baked = isTextureDefined(mBakedTextureData[i].mTextureIndex); + const BOOL layer_baked = isTextureDefined(mBakedTextureDatas[i].mTextureIndex); // Use any baked textures that we have even if they haven't downloaded yet. // (That is, don't do a transition from unbaked to baked.) if (layer_baked) { - LLViewerImage* image = getTEImage( mBakedTextureData[i].mTextureIndex ); - mBakedTextureData[i].mLastTextureIndex = image->getID(); + LLViewerImage* image = getImage( mBakedTextureDatas[i].mTextureIndex ); + mBakedTextureDatas[i].mLastTextureIndex = image->getID(); // If we have more than one texture for the other baked layers, we'll want to call this for them too. if ( (i == BAKED_HEAD) || (i == BAKED_UPPER) || (i == BAKED_LOWER) ) { @@ -7782,7 +6347,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) mFirstAppearanceMessageReceived = TRUE; - if( mIsSelf ) + if( isSelf() ) { llwarns << "Received AvatarAppearance for self" << llendl; if( mFirstTEMessageReceived ) @@ -7799,31 +6364,23 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) ESex old_sex = getSex(); -// llinfos << "ady LLVOAvatar::processAvatarAppearance()" << llendl; +// llinfos << "LLVOAvatar::processAvatarAppearance()" << llendl; // dumpAvatarTEs( "PRE processAvatarAppearance()" ); unpackTEMessage(mesgsys, _PREHASH_ObjectData); // dumpAvatarTEs( "POST processAvatarAppearance()" ); // prevent the overwriting of valid baked textures with invalid baked textures - for (U8 baked_index = 0; baked_index < mBakedTextureData.size(); baked_index++) + for (U8 baked_index = 0; baked_index < mBakedTextureDatas.size(); baked_index++) { - if (!isTextureDefined(mBakedTextureData[baked_index].mTextureIndex) - && mBakedTextureData[baked_index].mLastTextureIndex != IMG_DEFAULT + if (!isTextureDefined(mBakedTextureDatas[baked_index].mTextureIndex) + && mBakedTextureDatas[baked_index].mLastTextureIndex != IMG_DEFAULT && baked_index != BAKED_SKIRT) { - setTEImage(mBakedTextureData[baked_index].mTextureIndex, gImageList.getImage(mBakedTextureData[baked_index].mLastTextureIndex)); + setTEImage(mBakedTextureDatas[baked_index].mTextureIndex, gImageList.getImage(mBakedTextureDatas[baked_index].mLastTextureIndex)); } } - //llinfos << "Received AvatarAppearance: " << (mIsSelf ? "(self): " : "(other): ") << std::endl << - // (isTextureDefined(TEX_HEAD_BAKED) ? "HEAD " : "head " ) << (getTEImage(TEX_HEAD_BAKED)->getID()) << std::endl << - // (isTextureDefined(TEX_UPPER_BAKED) ? "UPPER " : "upper " ) << (getTEImage(TEX_UPPER_BAKED)->getID()) << std::endl << - // (isTextureDefined(TEX_LOWER_BAKED) ? "LOWER " : "lower " ) << (getTEImage(TEX_LOWER_BAKED)->getID()) << std::endl << - // (isTextureDefined(TEX_SKIRT_BAKED) ? "SKIRT " : "skirt " ) << (getTEImage(TEX_SKIRT_BAKED)->getID()) << std::endl << - // (isTextureDefined(TEX_HAIR_BAKED) ? "HAIR" : "hair " ) << (getTEImage(TEX_HAIR_BAKED)->getID()) << std::endl << - // (isTextureDefined(TEX_EYES_BAKED) ? "EYES" : "eyes" ) << (getTEImage(TEX_EYES_BAKED)->getID()) << llendl ; - if( !mFirstTEMessageReceived ) { onFirstTEMessageReceived(); @@ -7831,9 +6388,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) setCompositeUpdatesEnabled( FALSE ); - if (!mIsSelf) + // ! BACKWARDS COMPATIBILITY ! + // Non-self avatars will no longer have component textures + if (!isSelf()) { - releaseUnnecessaryTextures(); + releaseComponentTextures(); } updateMeshTextures(); // enables updates for laysets without baked textures. @@ -7993,39 +6552,32 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerImage *src_vi, gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); /* if( id == head_baked->getID() ) - if (self->mBakedTextureData[BAKED_HEAD].mTexLayerSet) + if (self->mBakedTextureDatas[BAKED_HEAD].mTexLayerSet) //llinfos << "onBakedTextureMasksLoaded for head " << id << " discard = " << discard_level << llendl; - self->mBakedTextureData[BAKED_HEAD].mTexLayerSet->applyMorphMask(aux_src->getData(), aux_src->getWidth(), aux_src->getHeight(), 1); + self->mBakedTextureDatas[BAKED_HEAD].mTexLayerSet->applyMorphMask(aux_src->getData(), aux_src->getWidth(), aux_src->getHeight(), 1); maskData->mLastDiscardLevel = discard_level; */ - bool found_texture_id = false; - for (LLVOAvatarDictionary::texture_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); + BOOL found_texture_id = false; + for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); iter++) { - const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = iter->second; - if (text_dict->mIsUsedByBakedTexture) + const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second; + if (texture_dict->mIsUsedByBakedTexture) { const ETextureIndex texture_index = iter->first; - const LLViewerImage *baked_img = self->getTEImage(texture_index); + const LLViewerImage *baked_img = self->getImage(texture_index); if (id == baked_img->getID()) { - const EBakedTextureIndex baked_index = text_dict->mBakedTextureIndex; - if (self->mBakedTextureData[baked_index].mTexLayerSet) + const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; + self->applyMorphMask(aux_src->getData(), aux_src->getWidth(), aux_src->getHeight(), 1, baked_index); + maskData->mLastDiscardLevel = discard_level; + if (self->mBakedTextureDatas[baked_index].mMaskTexName) { - //llinfos << "onBakedTextureMasksLoaded for " << text_dict->mName << " " << id << " discard = " << discard_level << llendl; - self->mBakedTextureData[baked_index].mTexLayerSet->applyMorphMask(aux_src->getData(), aux_src->getWidth(), aux_src->getHeight(), 1); - maskData->mLastDiscardLevel = discard_level; - if (self->mBakedTextureData[baked_index].mMaskTexName) - { - LLImageGL::deleteTextures(1, &(self->mBakedTextureData[baked_index].mMaskTexName)); - } - self->mBakedTextureData[baked_index].mMaskTexName = gl_name; - } - else - { - llwarns << "onBakedTextureMasksLoaded: no LayerSet for " << text_dict->mName << "." << llendl; + LLImageGL::deleteTextures(1, &(self->mBakedTextureDatas[baked_index].mMaskTexName)); } + + self->mBakedTextureDatas[baked_index].mMaskTexName = gl_name; found_texture_id = true; break; } @@ -8100,28 +6652,28 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) mLastHeadBakedID = id; mHeadMesh0.setTexture( head_baked ); mHeadMesh1.setTexture( head_baked ); */ - for (U32 i = 0; i < mBakedTextureData.size(); i++) + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - LLViewerImage* image_baked = getTEImage( mBakedTextureData[i].mTextureIndex ); + LLViewerImage* image_baked = getImage( mBakedTextureDatas[i].mTextureIndex ); if (id == image_baked->getID()) { - mBakedTextureData[i].mIsLoaded = true; - mBakedTextureData[i].mIsUsed = true; - mBakedTextureData[i].mLastTextureIndex = id; - for (U32 k = 0; k < mBakedTextureData[i].mMeshes.size(); k++) + mBakedTextureDatas[i].mIsLoaded = true; + mBakedTextureDatas[i].mLastTextureIndex = id; + mBakedTextureDatas[i].mIsUsed = true; + for (U32 k = 0; k < mBakedTextureDatas[i].mMeshes.size(); k++) { - mBakedTextureData[i].mMeshes[k]->setTexture( image_baked ); + mBakedTextureDatas[i].mMeshes[k]->setTexture( image_baked ); } - if (mBakedTextureData[i].mTexLayerSet) + if (mBakedTextureDatas[i].mTexLayerSet) { - mBakedTextureData[i].mTexLayerSet->destroyComposite(); + mBakedTextureDatas[i].mTexLayerSet->destroyComposite(); } - const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i); + const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i); for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin(); local_tex_iter != baked_dict->mLocalTextures.end(); local_tex_iter++) { - setLocalTexture(*local_tex_iter, getTEImage(*local_tex_iter), TRUE); + setLocalTexture(*local_tex_iter, getImage(*local_tex_iter), TRUE); } // ! BACKWARDS COMPATIBILITY ! @@ -8129,9 +6681,9 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) // This is paired with similar code in updateMeshTextures that sets hair mesh color. if (i == BAKED_HAIR) { - for (U32 i = 0; i < mBakedTextureData[BAKED_HAIR].mMeshes.size(); i++) + for (U32 i = 0; i < mBakedTextureDatas[BAKED_HAIR].mMeshes.size(); i++) { - mBakedTextureData[BAKED_HAIR].mMeshes[i]->setColor( 1.f, 1.f, 1.f, 1.f ); + mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( 1.f, 1.f, 1.f, 1.f ); } } } @@ -8147,7 +6699,7 @@ void LLVOAvatar::dumpArchetypeXML( void* ) LLAPRFile outfile ; outfile.open(gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"new archetype.xml"), LL_APR_WB ); apr_file_t* file = outfile.getFileHandle() ; - if( !file ) + if (!file) { return; } @@ -8157,27 +6709,27 @@ void LLVOAvatar::dumpArchetypeXML( void* ) apr_file_printf( file, "\n\t<archetype name=\"???\">\n" ); // only body parts, not clothing. - for( S32 type = WT_SHAPE; type <= WT_EYES; type++ ) + for (S32 type = WT_SHAPE; type <= WT_EYES; type++) { - const std::string& wearable_name = LLWearable::typeToTypeName( (EWearableType) type ); + const std::string& wearable_name = LLWearableDictionary::getTypeName((EWearableType)type); apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() ); - for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() ) + for (LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam()) { LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; if( (viewer_param->getWearableType() == type) && (viewer_param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) ) { - apr_file_printf( file, "\t\t<param id=\"%d\" name=\"%s\" value=\"%.3f\"/>\n", - viewer_param->getID(), viewer_param->getName().c_str(), viewer_param->getWeight() ); + apr_file_printf(file, "\t\t<param id=\"%d\" name=\"%s\" value=\"%.3f\"/>\n", + viewer_param->getID(), viewer_param->getName().c_str(), viewer_param->getWeight()); } } - for(U8 te = 0; te < TEX_NUM_INDICES; te++) + for (U8 te = 0; te < TEX_NUM_INDICES; te++) { - if( LLVOAvatar::getTEWearableType((ETextureIndex)te) == type ) + if (LLVOAvatarDictionary::getTEWearableType((ETextureIndex)te) == type) { - LLViewerImage* te_image = avatar->getTEImage((ETextureIndex)te); + LLViewerImage* te_image = avatar->getImage((ETextureIndex)te); if( te_image ) { std::string uuid_str; @@ -8192,18 +6744,13 @@ void LLVOAvatar::dumpArchetypeXML( void* ) } -U32 LLVOAvatar::getVisibilityRank() -{ - return mVisibilityRank; -} - void LLVOAvatar::setVisibilityRank(U32 rank) { if (mDrawable.isNull() || mDrawable->isDead()) - { //do nothing + { + // do nothing return; } - mVisibilityRank = rank; } @@ -8212,15 +6759,14 @@ S32 LLVOAvatar::getUnbakedPixelAreaRank() { S32 rank = 1; for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) + iter != LLCharacter::sInstances.end(); ++iter) { LLVOAvatar* inst = (LLVOAvatar*) *iter; - if( inst == this ) + if (inst == this) { return rank; } - else - if( !inst->isDead() && !inst->isFullyBaked() ) + else if (!inst->isDead() && !inst->isFullyBaked()) { rank++; } @@ -8232,7 +6778,7 @@ S32 LLVOAvatar::getUnbakedPixelAreaRank() struct CompareScreenAreaGreater { - bool operator()(const LLCharacter* const& lhs, const LLCharacter* const& rhs) + BOOL operator()(const LLCharacter* const& lhs, const LLCharacter* const& rhs) { return lhs->getPixelArea() > rhs->getPixelArea(); } @@ -8246,7 +6792,7 @@ void LLVOAvatar::cullAvatarsByPixelArea() // Update the avatars that have changed status U32 rank = 0; for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) + iter != LLCharacter::sInstances.end(); ++iter) { LLVOAvatar* inst = (LLVOAvatar*) *iter; BOOL culled; @@ -8277,7 +6823,7 @@ void LLVOAvatar::cullAvatarsByPixelArea() } S32 grey_avatars = 0; - if ( LLVOAvatar::areAllNearbyInstancesBaked(grey_avatars) ) + if (LLVOAvatar::areAllNearbyInstancesBaked(grey_avatars)) { LLVOAvatar::deleteCachedImages(false); } @@ -8299,144 +6845,6 @@ void LLVOAvatar::cullAvatarsByPixelArea() } } -const LLUUID& LLVOAvatar::grabLocalTexture(ETextureIndex index) -{ - if (canGrabLocalTexture(index)) - { - return getTEImage( index )->getID(); - } - return LLUUID::null; -} - -BOOL LLVOAvatar::canGrabLocalTexture(ETextureIndex index) -{ - // Check if the texture hasn't been baked yet. - if (!isTextureDefined(index)) - { - lldebugs << "getTEImage( " << (U32) index << " )->getID() == IMG_DEFAULT_AVATAR" << llendl; - return FALSE; - } - - if (gAgent.isGodlike()) - return TRUE; - - // Check permissions of textures that show up in the - // baked texture. We don't want people copying people's - // work via baked textures. - /* switch(index) - case TEX_EYES_BAKED: - textures.push_back(TEX_EYES_IRIS); */ - const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = LLVOAvatarDictionary::getInstance()->getTexture(index); - if (!text_dict->mIsUsedByBakedTexture) return FALSE; - - const EBakedTextureIndex baked_index = text_dict->mBakedTextureIndex; - const LLVOAvatarDictionary::BakedDictionaryEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index); - for (texture_vec_t::const_iterator iter = baked_dict->mLocalTextures.begin(); - iter != baked_dict->mLocalTextures.end(); - iter++) - { - const ETextureIndex t_index = (*iter); - lldebugs << "Checking index " << (U32) t_index << llendl; - const LLUUID& texture_id = getTEImage( t_index )->getID(); - if (texture_id != IMG_DEFAULT_AVATAR) - { - // Search inventory for this texture. - LLViewerInventoryCategory::cat_array_t cats; - LLViewerInventoryItem::item_array_t items; - LLAssetIDMatches asset_id_matches(texture_id); - gInventory.collectDescendentsIf(LLUUID::null, - cats, - items, - LLInventoryModel::INCLUDE_TRASH, - asset_id_matches); - - BOOL can_grab = FALSE; - lldebugs << "item count for asset " << texture_id << ": " << items.count() << llendl; - if (items.count()) - { - // search for full permissions version - for (S32 i = 0; i < items.count(); i++) - { - LLInventoryItem* itemp = items[i]; - LLPermissions item_permissions = itemp->getPermissions(); - if ( item_permissions.allowOperationBy( - PERM_MODIFY, gAgent.getID(), gAgent.getGroupID()) && - item_permissions.allowOperationBy( - PERM_COPY, gAgent.getID(), gAgent.getGroupID()) && - item_permissions.allowOperationBy( - PERM_TRANSFER, gAgent.getID(), gAgent.getGroupID()) ) - { - can_grab = TRUE; - break; - } - } - } - if (!can_grab) return FALSE; - } - } - - return TRUE; -} - -void LLVOAvatar::dumpLocalTextures() -{ - llinfos << "Local Textures:" << llendl; - - /* ETextureIndex baked_equiv[] = { - TEX_UPPER_BAKED, - if (isTextureDefined(baked_equiv[i])) */ - for (LLVOAvatarDictionary::texture_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); - iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); - iter++) - { - const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = iter->second; - if (!text_dict->mIsLocalTexture || !text_dict->mIsUsedByBakedTexture) - continue; - - const EBakedTextureIndex baked_index = text_dict->mBakedTextureIndex; - const ETextureIndex baked_equiv = LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex; - - const std::string &name = text_dict->mName; - const LocalTextureData &local_tex_data = mLocalTextureData[iter->first]; - if (isTextureDefined(baked_equiv)) - { -#if LL_RELEASE_FOR_DOWNLOAD - // End users don't get to trivially see avatar texture IDs, makes textures - // easier to steal. JC - llinfos << "LocTex " << name << ": Baked " << llendl; -#else - llinfos << "LocTex " << name << ": Baked " << getTEImage( baked_equiv )->getID() << llendl; -#endif - } - else if (local_tex_data.mImage.notNull()) - { - if( local_tex_data.mImage->getID() == IMG_DEFAULT_AVATAR ) - { - llinfos << "LocTex " << name << ": None" << llendl; - } - else - { - const LLViewerImage* image = local_tex_data.mImage; - - llinfos << "LocTex " << name << ": " - << "Discard " << image->getDiscardLevel() << ", " - << "(" << image->getWidth() << ", " << image->getHeight() << ") " -#if !LL_RELEASE_FOR_DOWNLOAD - // End users don't get to trivially see avatar texture IDs, - // makes textures easier to steal - << image->getID() << " " -#endif - << "Priority: " << image->getDecodePriority() - << llendl; - } - } - else - { - llinfos << "LocTex " << name << ": No LLViewerImage" << llendl; - } - } -} - void LLVOAvatar::startAppearanceAnimation(BOOL set_by_user, BOOL play_sound) { if(!mAppearanceAnimating) @@ -8448,53 +6856,31 @@ void LLVOAvatar::startAppearanceAnimation(BOOL set_by_user, BOOL play_sound) } } - +// virtual void LLVOAvatar::removeMissingBakedTextures() { - if (!mIsSelf) return; - - BOOL removed = FALSE; - for (U32 i = 0; i < mBakedTextureData.size(); i++) - { - const S32 te = mBakedTextureData[i].mTextureIndex; - if (getTEImage(te)->isMissingAsset()) - { - setTEImage(te, gImageList.getImage(IMG_DEFAULT_AVATAR)); - removed = TRUE; - } - } - - if (removed) - { - for(U32 i = 0; i < mBakedTextureData.size(); i++) - { - invalidateComposite(mBakedTextureData[i].mTexLayerSet, FALSE); - } - updateMeshTextures(); - requestLayerSetUploads(); - } } - //----------------------------------------------------------------------------- // LLVOAvatarXmlInfo //----------------------------------------------------------------------------- -LLVOAvatarXmlInfo::LLVOAvatarXmlInfo() +LLVOAvatar::LLVOAvatarXmlInfo::LLVOAvatarXmlInfo() : mTexSkinColorInfo(0), mTexHairColorInfo(0), mTexEyeColorInfo(0) { } -LLVOAvatarXmlInfo::~LLVOAvatarXmlInfo() +LLVOAvatar::LLVOAvatarXmlInfo::~LLVOAvatarXmlInfo() { std::for_each(mMeshInfoList.begin(), mMeshInfoList.end(), DeletePointer()); std::for_each(mSkeletalDistortionInfoList.begin(), mSkeletalDistortionInfoList.end(), DeletePointer()); std::for_each(mAttachmentInfoList.begin(), mAttachmentInfoList.end(), DeletePointer()); - delete mTexSkinColorInfo; - delete mTexHairColorInfo; - delete mTexEyeColorInfo; + deleteAndClear(mTexSkinColorInfo); + deleteAndClear(mTexHairColorInfo); + deleteAndClear(mTexEyeColorInfo); std::for_each(mLayerInfoList.begin(), mLayerInfoList.end(), DeletePointer()); - std::for_each(mDriverInfoList.begin(), mDriverInfoList.end(), DeletePointer()); + std::for_each(mDriverInfoList.begin(), mDriverInfoList.end(), DeletePointer()); + std::for_each(mMorphMaskInfoList.begin(), mMorphMaskInfoList.end(), DeletePointer()); } //----------------------------------------------------------------------------- @@ -8606,7 +6992,7 @@ BOOL LLVOAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node) //----------------------------------------------------------------------------- // parseXmlSkeletonNode(): parses <skeleton> nodes from XML tree //----------------------------------------------------------------------------- -BOOL LLVOAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* root) +BOOL LLVOAvatar::LLVOAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* root) { LLXmlTreeNode* node = root->getChildByName( "skeleton" ); if( !node ) @@ -8712,7 +7098,7 @@ BOOL LLVOAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* root) //----------------------------------------------------------------------------- // parseXmlMeshNodes(): parses <mesh> nodes from XML tree //----------------------------------------------------------------------------- -BOOL LLVOAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root) +BOOL LLVOAvatar::LLVOAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root) { for (LLXmlTreeNode* node = root->getChildByName( "mesh" ); node; @@ -8802,7 +7188,7 @@ BOOL LLVOAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root) //----------------------------------------------------------------------------- // parseXmlColorNodes(): parses <global_color> nodes from XML tree //----------------------------------------------------------------------------- -BOOL LLVOAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root) +BOOL LLVOAvatar::LLVOAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root) { for (LLXmlTreeNode* color_node = root->getChildByName( "global_color" ); color_node; @@ -8822,7 +7208,7 @@ BOOL LLVOAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root) mTexSkinColorInfo = new LLTexGlobalColorInfo; if( !mTexSkinColorInfo->parseXml( color_node ) ) { - delete mTexSkinColorInfo; mTexSkinColorInfo = 0; + deleteAndClear(mTexSkinColorInfo); llwarns << "avatar file: mTexSkinColor->parseXml() failed" << llendl; return FALSE; } @@ -8837,7 +7223,7 @@ BOOL LLVOAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root) mTexHairColorInfo = new LLTexGlobalColorInfo; if( !mTexHairColorInfo->parseXml( color_node ) ) { - delete mTexHairColorInfo; mTexHairColorInfo = 0; + deleteAndClear(mTexHairColorInfo); llwarns << "avatar file: mTexHairColor->parseXml() failed" << llendl; return FALSE; } @@ -8864,7 +7250,7 @@ BOOL LLVOAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root) //----------------------------------------------------------------------------- // parseXmlLayerNodes(): parses <layer_set> nodes from XML tree //----------------------------------------------------------------------------- -BOOL LLVOAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root) +BOOL LLVOAvatar::LLVOAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root) { for (LLXmlTreeNode* layer_node = root->getChildByName( "layer_set" ); layer_node; @@ -8888,7 +7274,7 @@ BOOL LLVOAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root) //----------------------------------------------------------------------------- // parseXmlDriverNodes(): parses <driver_parameters> nodes from XML tree //----------------------------------------------------------------------------- -BOOL LLVOAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* root) +BOOL LLVOAvatar::LLVOAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* root) { LLXmlTreeNode* driver = root->getChildByName( "driver_parameters" ); if( driver ) @@ -8916,36 +7302,60 @@ BOOL LLVOAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* root) return TRUE; } -// warning: order(N) not order(1) -S32 LLVOAvatar::getAttachmentCount() +//----------------------------------------------------------------------------- +// parseXmlDriverNodes(): parses <driver_parameters> nodes from XML tree +//----------------------------------------------------------------------------- +BOOL LLVOAvatar::LLVOAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root) { - S32 count = mAttachmentPoints.size(); - return count; -} + LLXmlTreeNode* masks = root->getChildByName( "morph_masks" ); + if( !masks ) + { + return FALSE; + } -//virtual -void LLVOAvatar::updateRegion(LLViewerRegion *regionp) -{ - if (mIsSelf) + for (LLXmlTreeNode* grand_child = masks->getChildByName( "mask" ); + grand_child; + grand_child = masks->getNextNamedChild()) { - if (regionp->getHandle() != mLastRegionHandle) + LLVOAvatarMorphInfo* info = new LLVOAvatarMorphInfo(); + + static LLStdStringHandle name_string = LLXmlTree::addAttributeString("morph_name"); + if (!grand_child->getFastAttributeString(name_string, info->mName)) { - if (mLastRegionHandle != 0) - { - ++mRegionCrossingCount; - F64 delta = (F64)mRegionCrossingTimer.getElapsedTimeF32(); - F64 avg = (mRegionCrossingCount == 1) ? 0 : LLViewerStats::getInstance()->getStat(LLViewerStats::ST_CROSSING_AVG); - F64 delta_avg = (delta + avg*(mRegionCrossingCount-1)) / mRegionCrossingCount; - LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CROSSING_AVG, delta_avg); + llwarns << "No name supplied for morph mask." << llendl; + delete info; + continue; + } - F64 max = (mRegionCrossingCount == 1) ? 0 : LLViewerStats::getInstance()->getStat(LLViewerStats::ST_CROSSING_MAX); - max = llmax(delta, max); - LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CROSSING_MAX, max); - } - mLastRegionHandle = regionp->getHandle(); + static LLStdStringHandle region_string = LLXmlTree::addAttributeString("body_region"); + if (!grand_child->getFastAttributeString(region_string, info->mRegion)) + { + llwarns << "No region supplied for morph mask." << llendl; + delete info; + continue; + } + + static LLStdStringHandle layer_string = LLXmlTree::addAttributeString("layer"); + if (!grand_child->getFastAttributeString(layer_string, info->mLayer)) + { + llwarns << "No layer supplied for morph mask." << llendl; + delete info; + continue; } - mRegionCrossingTimer.reset(); + + // optional parameter. don't throw a warning if not present. + static LLStdStringHandle invert_string = LLXmlTree::addAttributeString("invert"); + grand_child->getFastAttributeBOOL(invert_string, info->mInvert); + + mMorphMaskInfoList.push_back(info); } + + return TRUE; +} + +//virtual +void LLVOAvatar::updateRegion(LLViewerRegion *regionp) +{ } std::string LLVOAvatar::getFullname() const @@ -8964,21 +7374,6 @@ std::string LLVOAvatar::getFullname() const return name; } -LLTexLayerSet* LLVOAvatar::getLayerSet(ETextureIndex index) const -{ - /* switch(index) - case TEX_HEAD_BAKED: - case TEX_HEAD_BODYPAINT: - return mHeadLayerSet; */ - const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = LLVOAvatarDictionary::getInstance()->getTexture(index); - if (text_dict->mIsUsedByBakedTexture) - { - const EBakedTextureIndex baked_index = text_dict->mBakedTextureIndex; - return mBakedTextureData[baked_index].mTexLayerSet; - } - return NULL; -} - LLHost LLVOAvatar::getObjectHost() const { LLViewerRegion* region = getRegion(); @@ -9017,7 +7412,7 @@ BOOL LLVOAvatar::updateLOD() if (facep->mVertexBuffer.isNull() || LLVertexBuffer::sEnableVBOs && ((facep->mVertexBuffer->getUsage() == GL_STATIC_DRAW ? TRUE : FALSE) != - (facep->getPool()->getVertexShaderLevel() > 0 ? TRUE : FALSE))) + (facep->getPool()->getVertexShaderLevel() > 0 ? TRUE : FALSE))) { mDirtyMesh = TRUE; } @@ -9036,7 +7431,8 @@ BOOL LLVOAvatar::updateLOD() } U32 LLVOAvatar::getPartitionType() const -{ //avatars merely exist as drawables in the bridge partition +{ + // Avatars merely exist as drawables in the bridge partition return LLViewerRegion::PARTITION_BRIDGE; } @@ -9044,10 +7440,9 @@ U32 LLVOAvatar::getPartitionType() const void LLVOAvatar::updateImpostors() { for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) + iter != LLCharacter::sInstances.end(); ++iter) { LLVOAvatar* avatar = (LLVOAvatar*) *iter; - if (!avatar->isDead() && avatar->needsImpostorUpdate() && avatar->isVisible() && avatar->isImpostor()) { gPipeline.generateImpostor(avatar); @@ -9111,10 +7506,9 @@ void LLVOAvatar::idleUpdateRenderCost() std::set<LLUUID> textures; - attachment_map_t::const_iterator iter; - for (iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); - ++iter) + for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) { LLViewerJointAttachment* attachment = iter->second; LLViewerObject* object = attachment->getObject(); @@ -9159,15 +7553,15 @@ const std::string LLVOAvatar::getBakedStatusForPrintout() const { std::string line; - for (LLVOAvatarDictionary::texture_map_t::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); + for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); iter++) { const ETextureIndex index = iter->first; - const LLVOAvatarDictionary::TextureDictionaryEntry *text_dict = iter->second; - if (text_dict->mIsBakedTexture) + const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second; + if (texture_dict->mIsBakedTexture) { - line += text_dict->mName; + line += texture_dict->mName; if (isTextureDefined(index)) { line += "_baked"; @@ -9283,6 +7677,12 @@ U32 calc_shame(LLVOVolume* volume, std::set<LLUUID> &textures) return shame; } +//virtual +S32 LLVOAvatar::getTexImageSize() const +{ + return TEX_IMAGE_SIZE_OTHER; +} + //----------------------------------------------------------------------------- // Utility functions //----------------------------------------------------------------------------- @@ -9291,3 +7691,16 @@ F32 calc_bouncy_animation(F32 x) { return -(cosf(x * F_PI * 2.5f - F_PI_BY_TWO))*(0.4f + x * -0.1f) + x * 1.3f; } + +//virtual +BOOL LLVOAvatar::isTextureDefined(LLVOAvatarDefines::ETextureIndex te, U32 index ) const +{ + if (isIndexLocalTexture(te)) + { + return FALSE; + } + + return (getImage(te)->getID() != IMG_DEFAULT_AVATAR && + getImage(te)->getID() != IMG_DEFAULT); +} + diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index f8b2c068ffa3aac9687cbef833a85872af113c0e..301c032b25453cbe110e14fb19ccf786ed054140 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -46,8 +46,9 @@ #include "llviewerjointmesh.h" #include "llviewerjointattachment.h" #include "llrendertarget.h" -#include "llwearable.h" #include "llvoavatardefines.h" +#include "lltexglobalcolor.h" +#include "lldriverparam.h" extern const LLUUID ANIM_AGENT_BODY_NOISE; extern const LLUUID ANIM_AGENT_BREATHE_ROT; @@ -65,10 +66,8 @@ class LLVoiceVisualizer; class LLHUDText; class LLHUDEffectSpiral; class LLTexGlobalColor; - class LLVOAvatarBoneInfo; class LLVOAvatarSkeletonInfo; -class LLVOAvatarXmlInfo; //------------------------------------------------------------------------ // LLVOAvatar @@ -77,686 +76,938 @@ class LLVOAvatar : public LLViewerObject, public LLCharacter { +public: + friend class LLVOAvatarSelf; protected: - virtual ~LLVOAvatar(); + struct LLVOAvatarXmlInfo; + struct LLMaskedMorph; + +/******************************************************************************** + ** ** + ** INITIALIZATION + **/ public: LLVOAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - /*virtual*/ void markDead(); - void startDefaultMotions(); + virtual void markDead(); + static void initClass(); // Initialize data that's only init'd once per class. + static void cleanupClass(); // Cleanup data that's only init'd once per class. + void initInstance(); // Called after construction to initialize the class. +protected: + virtual ~LLVOAvatar(); + BOOL loadSkeletonNode(); + BOOL loadMeshNodes(); + virtual BOOL loadLayersets(); + +/** Initialization + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** INHERITED + **/ + + //-------------------------------------------------------------------- + // LLViewerObject interface and related + //-------------------------------------------------------------------- +public: + virtual U32 processUpdateMessage(LLMessageSystem *mesgsys, + void **user_data, + U32 block_num, + const EObjectUpdateType update_type, + LLDataPacker *dp); + virtual BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); + virtual BOOL updateLOD(); + BOOL updateJointLODs(); + virtual BOOL isActive() const; // Whether this object needs to do an idleUpdate. + virtual void updateTextures(LLAgent &agent); + virtual S32 setTETexture(const U8 te, const LLUUID& uuid); // If setting a baked texture, need to request it from a non-local sim. + virtual void onShift(const LLVector3& shift_vector); + virtual U32 getPartitionType() const; + virtual const LLVector3 getRenderPosition() const; + virtual void updateDrawable(BOOL force_damped); + virtual LLDrawable* createDrawable(LLPipeline *pipeline); + virtual BOOL updateGeometry(LLDrawable *drawable); + virtual void setPixelAreaAndAngle(LLAgent &agent); + virtual void updateRegion(LLViewerRegion *regionp); + virtual void updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax); + virtual void getSpatialExtents(LLVector3& newMin, LLVector3& newMax); + virtual BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, + S32 face = -1, // which face to check, -1 = ALL_SIDES + BOOL pick_transparent = FALSE, + S32* face_hit = NULL, // which face was hit + LLVector3* intersection = NULL, // return the intersection point + LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point + LLVector3* normal = NULL, // return the surface normal at the intersection point + LLVector3* bi_normal = NULL); // return the surface bi-normal at the intersection point + + //-------------------------------------------------------------------- + // LLCharacter interface and related + //-------------------------------------------------------------------- +public: + virtual LLVector3 getCharacterPosition(); + virtual LLQuaternion getCharacterRotation(); + virtual LLVector3 getCharacterVelocity(); + virtual LLVector3 getCharacterAngularVelocity(); + virtual LLJoint* getCharacterJoint(U32 num); + virtual BOOL allocateCharacterJoints(U32 num); + + virtual BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f); + virtual BOOL stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE); + virtual void stopMotionFromSource(const LLUUID& source_id); + virtual void requestStopMotion(LLMotion* motion); + LLMotion* findMotion(const LLUUID& id) const; + void startDefaultMotions(); + + virtual LLJoint* getJoint(const std::string &name); + virtual LLJoint* getRootJoint() { return &mRoot; } + + virtual const char* getAnimationPrefix() { return "avatar"; } + virtual const LLUUID& getID(); + virtual LLVector3 getVolumePos(S32 joint_index, LLVector3& volume_offset); + virtual LLJoint* findCollisionVolume(U32 volume_id); + virtual S32 getCollisionVolumeID(std::string &name); + virtual void addDebugText(const std::string& text); + virtual F32 getTimeDilation(); + virtual void getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm); + virtual F32 getPixelArea() const; + virtual LLPolyMesh* getHeadMesh(); + virtual LLPolyMesh* getUpperBodyMesh(); + virtual LLVector3d getPosGlobalFromAgent(const LLVector3 &position); + virtual LLVector3 getPosAgentFromGlobal(const LLVector3d &position); + virtual void updateVisualParams(); + + +/** Inherited + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** STATE + **/ + +public: + virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent +private: + BOOL mSupportsAlphaLayers; // For backwards compatibility, TRUE for 1.23+ clients - static void updateImpostors(); + //-------------------------------------------------------------------- + // Updates + //-------------------------------------------------------------------- +public: + virtual BOOL updateCharacter(LLAgent &agent); + void idleUpdateVoiceVisualizer(bool voice_enabled); + void idleUpdateMisc(bool detailed_update); + void idleUpdateAppearanceAnimation(); + void idleUpdateLipSync(bool voice_enabled); + void idleUpdateLoadingEffect(); + void idleUpdateWindEffect(); + void idleUpdateNameTag(const LLVector3& root_pos_last); + void idleUpdateRenderCost(); + void idleUpdateTractorBeam(); + void idleUpdateBelowWater(); //-------------------------------------------------------------------- - // LLViewerObject interface - //-------------------------------------------------------------------- -public: - static void initClass(); // Initialize data that's only init'd once per class. - static void cleanupClass(); // Cleanup data that's only init'd once per class. - static BOOL parseSkeletonFile(const std::string& filename); - virtual U32 processUpdateMessage(LLMessageSystem *mesgsys, - void **user_data, - U32 block_num, - const EObjectUpdateType update_type, - LLDataPacker *dp); - /*virtual*/ BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); - void idleUpdateVoiceVisualizer(bool voice_enabled); - void idleUpdateMisc(bool detailed_update); - void idleUpdateAppearanceAnimation(); - void idleUpdateLipSync(bool voice_enabled); - void idleUpdateLoadingEffect(); - void idleUpdateWindEffect(); - void idleUpdateNameTag(const LLVector3& root_pos_last); - void idleUpdateRenderCost(); - void idleUpdateTractorBeam(); - void idleUpdateBelowWater(); - -public: - virtual BOOL updateLOD(); - /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. - - // Graphical stuff for objects - maybe broken out into render class later? - U32 renderFootShadows(); - U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255)); - U32 renderRigid(); - U32 renderSkinned(EAvatarRenderPass pass); - U32 renderTransparent(BOOL first_pass); - void renderCollisionVolumes(); - - /*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, - S32 face = -1, // which face to check, -1 = ALL_SIDES - BOOL pick_transparent = FALSE, - S32* face_hit = NULL, // which face was hit - LLVector3* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector3* normal = NULL, // return the surface normal at the intersection point - LLVector3* bi_normal = NULL // return the surface bi-normal at the intersection point - ); - - /*virtual*/ void updateTextures(LLAgent &agent); - // If setting a baked texture, need to request it from a non-local sim. - /*virtual*/ S32 setTETexture(const U8 te, const LLUUID& uuid); - /*virtual*/ void onShift(const LLVector3& shift_vector); - virtual U32 getPartitionType() const; + // Static preferences (controlled by user settings/menus) + //-------------------------------------------------------------------- +public: + static S32 sRenderName; + static BOOL sRenderGroupTitles; + static S32 sMaxVisible; + static F32 sRenderDistance; //distance at which avatars will render (affected by control "RenderAvatarMaxVisible") + static BOOL sShowAnimationDebug; // show animation debug info + static BOOL sUseImpostors; //use impostors for far away avatars + static BOOL sShowFootPlane; // show foot collision plane reported by server + static BOOL sShowCollisionVolumes; // show skeletal collision volumes + static BOOL sVisibleInFirstPerson; + static S32 sNumLODChangesThisFrame; + static S32 sNumVisibleChatBubbles; + static BOOL sDebugInvisible; + static BOOL sShowAttachmentPoints; + static F32 sLODFactor; // user-settable LOD factor + static BOOL sJointDebug; // output total number of joints being touched for each avatar + static BOOL sDebugAvatarRotation; + + //-------------------------------------------------------------------- + // Region state + //-------------------------------------------------------------------- +public: + LLHost getObjectHost() const; + + //-------------------------------------------------------------------- + // Loading state + //-------------------------------------------------------------------- +public: + BOOL isFullyLoaded() const; + virtual BOOL updateIsFullyLoaded(); + BOOL processFullyLoadedChange(bool loading); +private: + BOOL mFullyLoaded; + BOOL mPreviousFullyLoaded; + BOOL mFullyLoadedInitialized; + S32 mFullyLoadedFrameCounter; + LLFrameTimer mFullyLoadedTimer; + +/** State + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** SKELETON + **/ + +public: + void updateHeadOffset(); + F32 getPelvisToFoot() const { return mPelvisToFoot; } + LLVector3 mHeadOffset; // current head position + LLViewerJoint mRoot; +protected: + static BOOL parseSkeletonFile(const std::string& filename); + void buildCharacter(); + BOOL loadAvatar(); + BOOL setupBone(const LLVOAvatarBoneInfo* info, LLViewerJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num); + BOOL buildSkeleton(const LLVOAvatarSkeletonInfo *info); +private: + BOOL mIsBuilt; // state of deferred character building + S32 mNumJoints; + LLViewerJoint* mSkeleton; - void updateVisibility(); - void updateAttachmentVisibility(U32 camera_mode); - void clampAttachmentPositions(); - S32 getAttachmentCount(); // Warning: order(N) not order(1) + //-------------------------------------------------------------------- + // Pelvis height adjustment members. + //-------------------------------------------------------------------- +public: + LLVector3 mBodySize; + S32 mLastSkeletonSerialNum; +private: + F32 mPelvisToFoot; - // HUD functions - BOOL hasHUDAttachment() const; - LLBBox getHUDBBox() const; - void rebuildHUD(); + //-------------------------------------------------------------------- + // Cached pointers to well known joints + //-------------------------------------------------------------------- +public: + LLViewerJoint* mPelvisp; + LLViewerJoint* mTorsop; + LLViewerJoint* mChestp; + LLViewerJoint* mNeckp; + LLViewerJoint* mHeadp; + LLViewerJoint* mSkullp; + LLViewerJoint* mEyeLeftp; + LLViewerJoint* mEyeRightp; + LLViewerJoint* mHipLeftp; + LLViewerJoint* mHipRightp; + LLViewerJoint* mKneeLeftp; + LLViewerJoint* mKneeRightp; + LLViewerJoint* mAnkleLeftp; + LLViewerJoint* mAnkleRightp; + LLViewerJoint* mFootLeftp; + LLViewerJoint* mFootRightp; + LLViewerJoint* mWristLeftp; + LLViewerJoint* mWristRightp; - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); + //-------------------------------------------------------------------- + // XML parse tree + //-------------------------------------------------------------------- +private: + static LLXmlTree sXMLTree; // avatar config file + static LLXmlTree sSkeletonXMLTree; // avatar skeleton file + +/** Skeleton + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** RENDERING + **/ + +public: + U32 renderFootShadows(); + U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255)); + U32 renderRigid(); + U32 renderSkinned(EAvatarRenderPass pass); + U32 renderTransparent(BOOL first_pass); + void renderCollisionVolumes(); + static void deleteCachedImages(bool clearAll=true); + static void destroyGL(); + static void restoreGL(); + BOOL mIsDummy; // for special views + S32 mSpecialRenderMode; // special lighting +private: + BOOL mNeedsSkin; // avatar has been animated and verts have not been updated + S32 mUpdatePeriod; + S32 mNumInitFaces; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer. - /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); - BOOL updateJointLODs(); + //-------------------------------------------------------------------- + // Morph masks + //-------------------------------------------------------------------- +public: + void invalidateMorphMasks(LLVOAvatarDefines::EBakedTextureIndex index = LLVOAvatarDefines::BAKED_NUM_INDICES); + BOOL morphMaskNeedsUpdate(LLVOAvatarDefines::EBakedTextureIndex index = LLVOAvatarDefines::BAKED_NUM_INDICES); + void addMaskedMorph(LLVOAvatarDefines::EBakedTextureIndex index, LLPolyMorphTarget* morph_target, BOOL invert, std::string layer); + void setMorphMasksValid(BOOL new_status, LLVOAvatarDefines::EBakedTextureIndex index = LLVOAvatarDefines::BAKED_NUM_INDICES); + void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLVOAvatarDefines::EBakedTextureIndex index = LLVOAvatarDefines::BAKED_NUM_INDICES); - virtual void updateRegion(LLViewerRegion *regionp); + //-------------------------------------------------------------------- + // Visibility + //-------------------------------------------------------------------- +protected: + void updateVisibility(); +private: + U32 mVisibilityRank; + BOOL mVisible; - virtual const LLVector3 getRenderPosition() const; - virtual void updateDrawable(BOOL force_damped); - void updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax); - void getSpatialExtents(LLVector3& newMin, LLVector3& newMax); - BOOL isImpostor() const; - BOOL needsImpostorUpdate() const; + //-------------------------------------------------------------------- + // Shadowing + //-------------------------------------------------------------------- +public: + void updateShadowFaces(); + LLDrawable* mShadow; +private: + LLFace* mShadow0Facep; + LLFace* mShadow1Facep; + LLPointer<LLViewerImage> mShadowImagep; + + //-------------------------------------------------------------------- + // Impostors + //-------------------------------------------------------------------- +public: + BOOL isImpostor() const; + BOOL needsImpostorUpdate() const; const LLVector3& getImpostorOffset() const; const LLVector2& getImpostorDim() const; - void getImpostorValues(LLVector3* extents, LLVector3& angle, F32& distance) const; - void cacheImpostorValues(); - void setImpostorDim(const LLVector2& dim); - - //-------------------------------------------------------------------- - // LLCharacter interface - //-------------------------------------------------------------------- -public: - virtual const char *getAnimationPrefix() { return "avatar"; } - virtual LLJoint *getRootJoint() { return &mRoot; } - virtual LLVector3 getCharacterPosition(); - virtual LLQuaternion getCharacterRotation(); - virtual LLVector3 getCharacterVelocity(); - virtual LLVector3 getCharacterAngularVelocity(); - virtual F32 getTimeDilation(); - virtual void getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm); - virtual BOOL allocateCharacterJoints( U32 num ); - virtual LLJoint *getCharacterJoint( U32 num ); - virtual void requestStopMotion( LLMotion* motion ); - virtual F32 getPixelArea() const; - virtual LLPolyMesh* getHeadMesh(); - virtual LLPolyMesh* getUpperBodyMesh(); - virtual LLVector3d getPosGlobalFromAgent(const LLVector3 &position); - virtual LLVector3 getPosAgentFromGlobal(const LLVector3d &position); - virtual void updateVisualParams(); - virtual BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f); - virtual BOOL stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE); - virtual void stopMotionFromSource(const LLUUID& source_id); - virtual LLVector3 getVolumePos(S32 joint_index, LLVector3& volume_offset); - virtual LLJoint* findCollisionVolume(U32 volume_id); - virtual S32 getCollisionVolumeID(std::string &name); - virtual void addDebugText(const std::string& text); - virtual const LLUUID& getID(); - virtual LLJoint *getJoint( const std::string &name ); - - //-------------------------------------------------------------------- - // Other public functions - //-------------------------------------------------------------------- -public: - static void onCustomizeStart(); - static void onCustomizeEnd(); - -public: - static void dumpTotalLocalTextureByteCount(); -protected: - void getLocalTextureByteCount( S32* gl_byte_count ); + void getImpostorValues(LLVector3* extents, LLVector3& angle, F32& distance) const; + void cacheImpostorValues(); + void setImpostorDim(const LLVector2& dim); + static void resetImpostors(); + static void updateImpostors(); + LLRenderTarget mImpostor; + BOOL mNeedsImpostorUpdate; +private: + LLVector3 mImpostorOffset; + LLVector2 mImpostorDim; + BOOL mNeedsAnimUpdate; + LLVector3 mImpostorExtents[2]; + LLVector3 mImpostorAngle; + F32 mImpostorDistance; + F32 mImpostorPixelArea; + LLVector3 mLastAnimExtents[2]; + //-------------------------------------------------------------------- + // Wind rippling in clothes + //-------------------------------------------------------------------- public: - LLMotion* findMotion(const LLUUID& id); - - BOOL isVisible(); - BOOL isSelf() const { return mIsSelf; } - BOOL isCulled() const { return mCulled; } + LLVector4 mWindVec; + F32 mRipplePhase; + BOOL mBelowWater; +private: + F32 mWindFreq; + LLFrameTimer mRippleTimer; + F32 mRippleTimeLast; + LLVector3 mRippleAccel; + LLVector3 mLastVel; + //-------------------------------------------------------------------- + // Culling + //-------------------------------------------------------------------- public: - static void cullAvatarsByPixelArea(); - void setVisibilityRank(U32 rank); - U32 getVisibilityRank(); // unused -protected: - S32 getUnbakedPixelAreaRank(); + static void cullAvatarsByPixelArea(); + BOOL isCulled() const { return mCulled; } +private: + BOOL mCulled; + //-------------------------------------------------------------------- + // Freeze counter + //-------------------------------------------------------------------- public: - void dumpLocalTextures(); - const LLUUID& grabLocalTexture(LLVOAvatarDefines::ETextureIndex index); - BOOL canGrabLocalTexture(LLVOAvatarDefines::ETextureIndex index); - BOOL isTextureDefined(U8 te) const; - BOOL isTextureVisible(U8 te) const; - void startAppearanceAnimation(BOOL set_by_user, BOOL play_sound); - - void setCompositeUpdatesEnabled(BOOL b); - - void addChat(const LLChat& chat); - void clearChat(); - void startTyping() { mTyping = TRUE; mTypingTimer.reset(); } - void stopTyping() { mTyping = FALSE; } + static void updateFreezeCounter(S32 counter = 0); +private: + static S32 sFreezeCounter; - // Returns "FirstName LastName" - std::string getFullname() const; + //-------------------------------------------------------------------- + // Constants + //-------------------------------------------------------------------- +public: + virtual LLViewerImage::EBoostLevel getAvatarBoostLevel() const { return LLViewerImage::BOOST_AVATAR; } + virtual LLViewerImage::EBoostLevel getAvatarBakedBoostLevel() const { return LLViewerImage::BOOST_AVATAR_BAKED; } + virtual S32 getTexImageSize() const; + virtual S32 getTexImageArea() const { return getTexImageSize()*getTexImageSize(); } - BOOL updateCharacter(LLAgent &agent); - void updateHeadOffset(); +/** Rendering + ** ** + *******************************************************************************/ - F32 getPelvisToFoot() const { return mPelvisToFoot; } +/******************************************************************************** + ** ** + ** TEXTURES + **/ + //-------------------------------------------------------------------- + // Loading status + //-------------------------------------------------------------------- public: - BOOL isAnyAnimationSignaled(const LLUUID *anim_array, const S32 num_anims); - void processAnimationStateChanges(); + virtual BOOL isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; + BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex index) const; protected: - BOOL processSingleAnimationStateChange(const LLUUID &anim_id, BOOL start); - void resetAnimations(); + BOOL isFullyBaked(); + static BOOL areAllNearbyInstancesBaked(S32& grey_avatars); + //-------------------------------------------------------------------- + // Baked textures + //-------------------------------------------------------------------- public: - void resolveHeightGlobal(const LLVector3d &inPos, LLVector3d &outPos, LLVector3 &outNorm); - void resolveHeightAgent(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm); - void resolveRayCollisionAgent(const LLVector3d start_pt, const LLVector3d end_pt, LLVector3d &out_pos, LLVector3 &out_norm); - - void slamPosition(); // Slam position to transmitted position (for teleport); + void releaseComponentTextures(); // ! BACKWARDS COMPATIBILITY ! +protected: + static void onBakedTextureMasksLoaded(BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); + static void onInitialBakedTextureLoaded(BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); + static void onBakedTextureLoaded(BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); + virtual void removeMissingBakedTextures(); + void useBakedTexture(const LLUUID& id); - // morph targets and such - void processAvatarAppearance( LLMessageSystem* mesgsys ); - void onFirstTEMessageReceived(); - void updateSexDependentLayerSets( BOOL set_by_user ); - void dirtyMesh(); // Dirty the avatar mesh - void hideSkirt(); + typedef std::deque<LLMaskedMorph *> morph_list_t; + struct BakedTextureData + { + LLUUID mLastTextureIndex; + LLTexLayerSet* mTexLayerSet; // Only exists for self + bool mIsLoaded; + bool mIsUsed; + LLVOAvatarDefines::ETextureIndex mTextureIndex; + U32 mMaskTexName; + // Stores pointers to the joint meshes that this baked texture deals with + std::vector< LLViewerJointMesh * > mMeshes; // std::vector<LLViewerJointMesh> mJoints[i]->mMeshParts + morph_list_t mMaskedMorphs; + BOOL mMorphMasksValid; + }; + typedef std::vector<BakedTextureData> bakedtexturedata_vec_t; + bakedtexturedata_vec_t mBakedTextureDatas; - virtual void setParent(LLViewerObject* parent); - virtual void addChild(LLViewerObject *childp); - virtual void removeChild(LLViewerObject *childp); + //-------------------------------------------------------------------- + // Local Textures + //-------------------------------------------------------------------- +protected: + virtual void setLocalTexture(LLVOAvatarDefines::ETextureIndex type, LLViewerImage* tex, BOOL baked_version_exits, U32 index = 0); + virtual void addLocalTextureStats(LLVOAvatarDefines::ETextureIndex type, LLViewerImage* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked, U32 index = 0); - LLViewerJointAttachment* getTargetAttachmentPoint(LLViewerObject* viewer_object); - BOOL attachObject(LLViewerObject *viewer_object); - BOOL detachObject(LLViewerObject *viewer_object); - void lazyAttach(); - - void sitOnObject(LLViewerObject *sit_object); - void getOffObject(); - - BOOL isWearingAttachment( const LLUUID& inv_item_id ); - LLViewerObject* getWornAttachment( const LLUUID& inv_item_id ); - const std::string getAttachedPointName(const LLUUID& inv_item_id); - - static LLVOAvatar* findAvatarFromAttachment( LLViewerObject* obj ); - - void updateMeshTextures(); - - //-------------------------------------------------------------------- - // texture compositing (used only by the LLTexLayer series of classes) - //-------------------------------------------------------------------- -public: - LLColor4 getGlobalColor( const std::string& color_name ); - BOOL isLocalTextureDataAvailable( LLTexLayerSet* layerset ); - BOOL isLocalTextureDataFinal( LLTexLayerSet* layerset ); - LLVOAvatarDefines::ETextureIndex getBakedTE( LLTexLayerSet* layerset ); - void updateComposites(); - void onGlobalColorChanged( LLTexGlobalColor* global_color, BOOL set_by_user ); - BOOL getLocalTextureRaw( LLVOAvatarDefines::ETextureIndex index, LLImageRaw* image_raw_pp ); - BOOL getLocalTextureGL( LLVOAvatarDefines::ETextureIndex index, LLImageGL** image_gl_pp ); - const LLUUID& getLocalTextureID( LLVOAvatarDefines::ETextureIndex index ); - LLGLuint getScratchTexName( LLGLenum format, U32* texture_bytes ); - BOOL bindScratchTexture( LLGLenum format ); - void invalidateComposite( LLTexLayerSet* layerset, BOOL set_by_user ); - void invalidateAll(); - void forceBakeAllTextures(bool slam_for_debug = false); - static void processRebakeAvatarTextures(LLMessageSystem* msg, void**); - void setNewBakedTexture( LLVOAvatarDefines::ETextureIndex i, const LLUUID& uuid ); - void setCachedBakedTexture( LLVOAvatarDefines::ETextureIndex i, const LLUUID& uuid ); - void releaseUnnecessaryTextures(); - void requestLayerSetUploads(); - bool hasPendingBakedUploads(); - static void onLocalTextureLoaded( BOOL succcess, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ); - static void dumpArchetypeXML( void* ); - static void dumpScratchTextureByteCount(); - static void dumpBakedStatus(); - static void deleteCachedImages(bool clearAll=true); - static void destroyGL(); - static void restoreGL(); - static void resetImpostors(); - static enum EWearableType getTEWearableType(LLVOAvatarDefines::ETextureIndex te ); - static LLUUID getDefaultTEImageID(LLVOAvatarDefines::ETextureIndex te ); - static void onChangeSelfInvisible(BOOL newvalue); - void setInvisible(BOOL newvalue); - static LLColor4 getDummyColor(); + //-------------------------------------------------------------------- + // Texture accessors + //-------------------------------------------------------------------- +private: + virtual void setImage(const U8 te, LLViewerImage *imagep); + virtual LLViewerImage* getImage(const U8 te) const; + virtual const LLTextureEntry* getTexEntry(const U8 te_num) const; + virtual void setTexEntry(const U8 index, const LLTextureEntry &te); //-------------------------------------------------------------------- - // Clothing colors (conventience functions to access visual parameters + // Layers //-------------------------------------------------------------------- -public: - void setClothesColor( LLVOAvatarDefines::ETextureIndex te, const LLColor4& new_color, BOOL set_by_user ); - LLColor4 getClothesColor( LLVOAvatarDefines::ETextureIndex te ); - BOOL teToColorParams( LLVOAvatarDefines::ETextureIndex te, const char* param_name[3] ); - - BOOL isWearingWearableType( EWearableType type ); - void wearableUpdated( EWearableType type ); +protected: + void deleteLayerSetCaches(bool clearAll = true); + void addBakedTextureStats(LLViewerImage* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level); //-------------------------------------------------------------------- - // texture compositing + // Composites //-------------------------------------------------------------------- public: - void setLocTexTE( U8 te, LLViewerImage* image, BOOL set_by_user ); - void setupComposites(); + virtual void invalidateComposite(LLTexLayerSet* layerset, BOOL set_by_user); + virtual void invalidateAll(); + virtual void setCompositeUpdatesEnabled(BOOL b); //-------------------------------------------------------------------- - // Handling partially loaded avatars (Ruth) + // Static texture/mesh/baked dictionary //-------------------------------------------------------------------- public: - BOOL isFullyLoaded(); - BOOL updateIsFullyLoaded(); + static BOOL isIndexLocalTexture(LLVOAvatarDefines::ETextureIndex i); + static BOOL isIndexBakedTexture(LLVOAvatarDefines::ETextureIndex i); private: - BOOL mFullyLoaded; - BOOL mPreviousFullyLoaded; - BOOL mFullyLoadedInitialized; - S32 mFullyLoadedFrameCounter; - LLFrameTimer mFullyLoadedTimer; + static const LLVOAvatarDefines::LLVOAvatarDictionary *getDictionary() { return sAvatarDictionary; } + static LLVOAvatarDefines::LLVOAvatarDictionary* sAvatarDictionary; + static LLVOAvatarSkeletonInfo* sAvatarSkeletonInfo; + static LLVOAvatarXmlInfo* sAvatarXmlInfo; //-------------------------------------------------------------------- - // Collision Volumes + // Messaging //-------------------------------------------------------------------- public: - S32 mNumCollisionVolumes; - LLViewerJointCollisionVolume* mCollisionVolumes; + void onFirstTEMessageReceived(); +private: + BOOL mFirstTEMessageReceived; + BOOL mFirstAppearanceMessageReceived; + +/** Textures + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** MESHES + **/ + +public: + void updateMeshTextures(); + void updateSexDependentLayerSets(BOOL set_by_user); + void dirtyMesh(); // Dirty the avatar mesh + void updateMeshData(); +protected: + void releaseMeshData(); + /*virtual*/ void restoreMeshData(); +private: + BOOL mDirtyMesh; + + typedef std::multimap<std::string, LLPolyMesh*> polymesh_map_t; + polymesh_map_t mMeshes; + std::vector<LLViewerJoint *> mMeshLOD; //-------------------------------------------------------------------- - // cached pointers to well known joints + // Destroy invisible mesh //-------------------------------------------------------------------- -public: - LLViewerJoint* mPelvisp; - LLViewerJoint* mTorsop; - LLViewerJoint* mChestp; - LLViewerJoint* mNeckp; - LLViewerJoint* mHeadp; - LLViewerJoint* mSkullp; - LLViewerJoint* mEyeLeftp; - LLViewerJoint* mEyeRightp; - LLViewerJoint* mHipLeftp; - LLViewerJoint* mHipRightp; - LLViewerJoint* mKneeLeftp; - LLViewerJoint* mKneeRightp; - LLViewerJoint* mAnkleLeftp; - LLViewerJoint* mAnkleRightp; - LLViewerJoint* mFootLeftp; - LLViewerJoint* mFootRightp; - LLViewerJoint* mWristLeftp; - LLViewerJoint* mWristRightp; +protected: + BOOL mMeshValid; + LLFrameTimer mMeshInvisibleTime; + +/** Meshes + ** ** + *******************************************************************************/ +/******************************************************************************** + ** ** + ** APPEARANCE + **/ + +public: + void processAvatarAppearance(LLMessageSystem* mesgsys); + void hideSkirt(); + void startAppearanceAnimation(BOOL set_by_user, BOOL play_sound); + //-------------------------------------------------------------------- - // impostor state + // Appearance morphing //-------------------------------------------------------------------- public: - LLRenderTarget mImpostor; - BOOL mNeedsImpostorUpdate; + BOOL mAppearanceAnimating; private: - LLVector3 mImpostorOffset; - LLVector2 mImpostorDim; - BOOL mNeedsAnimUpdate; - LLVector3 mImpostorExtents[2]; - LLVector3 mImpostorAngle; - F32 mImpostorDistance; - F32 mImpostorPixelArea; - LLVector3 mLastAnimExtents[2]; + LLFrameTimer mAppearanceMorphTimer; + BOOL mAppearanceAnimSetByUser; + F32 mLastAppearanceBlendTime; //-------------------------------------------------------------------- - // Misc Render State + // Clothing colors (convenience functions to access visual parameters) //-------------------------------------------------------------------- public: - BOOL mIsDummy; // For special views - S32 mSpecialRenderMode; // Special lighting + void setClothesColor(LLVOAvatarDefines::ETextureIndex te, const LLColor4& new_color, BOOL set_by_user); + LLColor4 getClothesColor(LLVOAvatarDefines::ETextureIndex te); + BOOL teToColorParams(LLVOAvatarDefines::ETextureIndex te, const char* param_name[3]); //-------------------------------------------------------------------- - // animation state data + // Global colors //-------------------------------------------------------------------- public: - typedef std::map<LLUUID, S32>::iterator AnimIterator; + LLColor4 getGlobalColor(const std::string& color_name ) const; + void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL set_by_user); +private: + LLTexGlobalColor* mTexSkinColor; + LLTexGlobalColor* mTexHairColor; + LLTexGlobalColor* mTexEyeColor; - std::map<LLUUID, S32> mSignaledAnimations; // requested state of Animation name/value - std::map<LLUUID, S32> mPlayingAnimations; // current state of Animation name/value + //-------------------------------------------------------------------- + // Visibility + //-------------------------------------------------------------------- +public: + BOOL isVisible() const; + void setVisibilityRank(U32 rank); + U32 getVisibilityRank() const { return mVisibilityRank; } // unused + static S32 sNumVisibleAvatars; // Number of instances of this class + static LLColor4 getDummyColor(); +/** Appearance + ** ** + *******************************************************************************/ - typedef std::multimap<LLUUID, LLUUID> AnimationSourceMap; - typedef AnimationSourceMap::iterator AnimSourceIterator; - AnimationSourceMap mAnimationSources; // object ids that triggered anim ids +/******************************************************************************** + ** ** + ** WEARABLES + **/ +public: + BOOL isWearingWearableType(EWearableType type ) const; + //-------------------------------------------------------------------- - // Shadowing + // Attachments //-------------------------------------------------------------------- public: - void updateShadowFaces(); - LLDrawable* mShadow; -private: - LLFace* mShadow0Facep; - LLFace* mShadow1Facep; - LLPointer<LLViewerImage> mShadowImagep; + void clampAttachmentPositions(); + virtual LLViewerJointAttachment* attachObject(LLViewerObject *viewer_object); + BOOL detachObject(LLViewerObject *viewer_object); + static LLVOAvatar* findAvatarFromAttachment(LLViewerObject* obj); +protected: + LLViewerJointAttachment* getTargetAttachmentPoint(LLViewerObject* viewer_object); + void lazyAttach(); //-------------------------------------------------------------------- - // Keeps track of foot step state for generating sounds + // Map of attachment points, by ID //-------------------------------------------------------------------- public: - void setFootPlane(const LLVector4 &plane) { mFootPlane = plane; } - LLVector4 mFootPlane; -private: - BOOL mWasOnGroundLeft; - BOOL mWasOnGroundRight; + S32 getAttachmentCount(); // Warning: order(N) not order(1) // currently used only by -self + typedef std::map<S32, LLViewerJointAttachment*> attachment_map_t; + attachment_map_t mAttachmentPoints; + std::vector<LLPointer<LLViewerObject> > mPendingAttachment; //-------------------------------------------------------------------- - // Pelvis height adjustment members. + // HUD functions //-------------------------------------------------------------------- public: - LLVector3 mBodySize; - S32 mLastSkeletonSerialNum; -private: - F32 mPelvisToFoot; + BOOL hasHUDAttachment() const; + LLBBox getHUDBBox() const; + void rebuildHUD(); + void resetHUDAttachments(); + +/** Wearables + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** ACTIONS + **/ //-------------------------------------------------------------------- - // Display the name, then optionally fade it out + // Animations //-------------------------------------------------------------------- public: - LLFrameTimer mChatTimer; - LLPointer<LLHUDText> mNameText; + BOOL isAnyAnimationSignaled(const LLUUID *anim_array, const S32 num_anims) const; + void processAnimationStateChanges(); +protected: + BOOL processSingleAnimationStateChange(const LLUUID &anim_id, BOOL start); + void resetAnimations(); private: - LLFrameTimer mTimeVisible; - std::deque<LLChat> mChats; - BOOL mTyping; - LLFrameTimer mTypingTimer; + LLTimer mAnimTimer; + F32 mTimeLast; //-------------------------------------------------------------------- - // wind rippling in clothes + // Animation state data //-------------------------------------------------------------------- public: - LLVector4 mWindVec; - F32 mRipplePhase; - BOOL mBelowWater; -private: - F32 mWindFreq; - LLFrameTimer mRippleTimer; - F32 mRippleTimeLast; - LLVector3 mRippleAccel; - LLVector3 mLastVel; + typedef std::map<LLUUID, S32>::iterator AnimIterator; + std::map<LLUUID, S32> mSignaledAnimations; // requested state of Animation name/value + std::map<LLUUID, S32> mPlayingAnimations; // current state of Animation name/value + + typedef std::multimap<LLUUID, LLUUID> AnimationSourceMap; + typedef AnimationSourceMap::iterator AnimSourceIterator; + AnimationSourceMap mAnimationSources; // object ids that triggered anim ids //-------------------------------------------------------------------- - // appearance morphing + // Chat //-------------------------------------------------------------------- public: - BOOL mAppearanceAnimating; + void addChat(const LLChat& chat); + void clearChat(); + void startTyping() { mTyping = TRUE; mTypingTimer.reset(); } + void stopTyping() { mTyping = FALSE; } private: - LLFrameTimer mAppearanceMorphTimer; - BOOL mAppearanceAnimSetByUser; - F32 mLastAppearanceBlendTime; + BOOL mVisibleChat; //-------------------------------------------------------------------- - // Attachments + // Lip synch morphs + //-------------------------------------------------------------------- +private: + bool mLipSyncActive; // we're morphing for lip sync + LLVisualParam* mOohMorph; // cached pointers morphs for lip sync + LLVisualParam* mAahMorph; // cached pointers morphs for lip sync + + //-------------------------------------------------------------------- + // Flight //-------------------------------------------------------------------- public: - // map of attachment points, by ID - typedef std::map<S32, LLViewerJointAttachment*> attachment_map_t; - attachment_map_t mAttachmentPoints; - std::vector<LLPointer<LLViewerObject> > mPendingAttachment; + BOOL mInAir; + LLFrameTimer mTimeInAir; + +/** Actions + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** PHYSICS + **/ + +private: + F32 mSpeedAccum; // measures speed (for diagnostics mostly). + BOOL mTurning; // controls hysteresis on avatar rotation + F32 mSpeed; // misc. animation repeated state //-------------------------------------------------------------------- - // static preferences that are controlled by user settings/menus + // Collision volumes //-------------------------------------------------------------------- public: - static S32 sRenderName; - static BOOL sRenderGroupTitles; - static S32 sMaxVisible; - static F32 sRenderDistance; //distance at which avatars will render (affected by control "RenderAvatarMaxVisible") - static BOOL sShowAnimationDebug; // show animation debug info - static BOOL sUseImpostors; //use impostors for far away avatars - static BOOL sShowFootPlane; // show foot collision plane reported by server - static BOOL sVisibleInFirstPerson; - static S32 sNumLODChangesThisFrame; - static S32 sNumVisibleChatBubbles; - static BOOL sDebugInvisible; - static BOOL sShowAttachmentPoints; - static F32 sLODFactor; // user-settable LOD factor - static BOOL sJointDebug; // output total number of joints being touched for each avatar - static BOOL sDebugAvatarRotation; + S32 mNumCollisionVolumes; + LLViewerJointCollisionVolume* mCollisionVolumes; +protected: + BOOL allocateCollisionVolumes(U32 num); - static S32 sNumVisibleAvatars; // Number of instances of this class - //-------------------------------------------------------------------- - // Miscellaneous public variables. + // Dimensions //-------------------------------------------------------------------- public: - BOOL mInAir; - LLFrameTimer mTimeInAir; - LLVector3 mHeadOffset; // current head position - LLViewerJoint mRoot; // avatar skeleton - BOOL mIsSitting; // sitting state + void resolveHeightGlobal(const LLVector3d &inPos, LLVector3d &outPos, LLVector3 &outNorm); + void resolveHeightAgent(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm); + void resolveRayCollisionAgent(const LLVector3d start_pt, const LLVector3d end_pt, LLVector3d &out_pos, LLVector3 &out_norm); + void slamPosition(); // Slam position to transmitted position (for teleport); +protected: + void computeBodySize(); //-------------------------------------------------------------------- - // Private member variables. + // Material being stepped on //-------------------------------------------------------------------- private: - BOOL mIsSelf; // True if this avatar is for this viewer's agent + BOOL mStepOnLand; + U8 mStepMaterial; + LLVector3 mStepObjectVelocity; - LLViewerJoint *mScreenp; // special purpose joint for HUD attachments - BOOL mIsBuilt; // state of deferred character building - F32 mSpeedAccum; // measures speed (for diagnostics mostly). - - - // LLFrameTimer mUpdateLODTimer; // controls frequency of LOD change calculations - BOOL mDirtyMesh; - BOOL mTurning; // controls hysteresis on avatar rotation - F32 mSpeed; // misc. animation repeated state +/** Physics + ** ** + *******************************************************************************/ - // Keep track of the material being stepped on - BOOL mStepOnLand; - U8 mStepMaterial; - LLVector3 mStepObjectVelocity; +/******************************************************************************** + ** ** + ** HIERARCHY + **/ - // Destroy mesh data after being invisible for a while - BOOL mMeshValid; - BOOL mVisible; - LLFrameTimer mMeshInvisibleTime; +public: + virtual void setParent(LLViewerObject* parent); + virtual void addChild(LLViewerObject *childp); + virtual void removeChild(LLViewerObject *childp); - // Lip synch morph stuff - bool mLipSyncActive; // we're morphing for lip sync - LLVisualParam* mOohMorph; // cached pointers morphs for lip sync - LLVisualParam* mAahMorph; // cached pointers morphs for lip sync + //-------------------------------------------------------------------- + // Sitting + //-------------------------------------------------------------------- +public: + void sitOnObject(LLViewerObject *sit_object); + void getOffObject(); + BOOL mIsSitting; - // Skeleton for skinned avatar - S32 mNumJoints; - LLViewerJoint* mSkeleton; +/** Hierarchy + ** ** + *******************************************************************************/ - // Scratch textures used for compositing - static LLMap< LLGLenum, LLGLuint*> sScratchTexNames; - static LLMap< LLGLenum, F32*> sScratchTexLastBindTime; - static S32 sScratchTexBytes; +/******************************************************************************** + ** ** + ** NAME + **/ - // Global table of sound ids per material, and the ground - const static LLUUID sStepSounds[LL_MCODE_END]; - const static LLUUID sStepSoundOnLand; - - // Xml parse tree of avatar config file - static LLXmlTree sXMLTree; - // Xml parse tree of avatar skeleton file - static LLXmlTree sSkeletonXMLTree; +public: + std::string getFullname() const; // Returns "FirstName LastName" +protected: + static void getAnimLabels(LLDynamicArray<std::string>* labels); + static void getAnimNames(LLDynamicArray<std::string>* names); +private: + LLWString mNameString; + std::string mTitle; + BOOL mNameAway; + BOOL mNameBusy; + BOOL mNameMute; + BOOL mNameAppearance; + BOOL mRenderGroupTitles; - // Voice Visualizer is responsible for detecting the user's voice signal, and when the - // user speaks, it puts a voice symbol over the avatar's head, and triggering gesticulations - LLVoiceVisualizer* mVoiceVisualizer; - int mCurrentGesticulationLevel; - - // Animation timer - LLTimer mAnimTimer; - F32 mTimeLast; - - LLPointer<LLHUDEffectSpiral> mBeam; - LLFrameTimer mBeamTimer; - - F32 mAdjustedPixelArea; - - LLWString mNameString; - std::string mTitle; - BOOL mNameAway; - BOOL mNameBusy; - BOOL mNameMute; - BOOL mNameAppearance; - BOOL mVisibleChat; - BOOL mRenderGroupTitles; - - std::string mDebugText; - U64 mLastRegionHandle; - LLFrameTimer mRegionCrossingTimer; - S32 mRegionCrossingCount; - //-------------------------------------------------------------------- - // local textures for compositing. + // Display the name (then optionally fade it out) //-------------------------------------------------------------------- +public: + LLFrameTimer mChatTimer; + LLPointer<LLHUDText> mNameText; private: - LLUUID mSavedTE[ LLVOAvatarDefines::TEX_NUM_INDICES ]; - BOOL mFirstTEMessageReceived; - BOOL mFirstAppearanceMessageReceived; - BOOL mHasBakedHair; - - BOOL mCulled; - U32 mVisibilityRank; - F32 mMinPixelArea; // debug - F32 mMaxPixelArea; // debug - BOOL mHasGrey; // debug - + LLFrameTimer mTimeVisible; + std::deque<LLChat> mChats; + BOOL mTyping; + LLFrameTimer mTypingTimer; + +/** Name + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** SOUNDS + **/ + //-------------------------------------------------------------------- - // Global Colors + // Voice visualizer //-------------------------------------------------------------------- -private: - LLTexGlobalColor* mTexSkinColor; - LLTexGlobalColor* mTexHairColor; - LLTexGlobalColor* mTexEyeColor; - - BOOL mNeedsSkin; //if TRUE, avatar has been animated and verts have not been updated - S32 mUpdatePeriod; +public: + // Responsible for detecting the user's voice signal (and when the + // user speaks, it puts a voice symbol over the avatar's head) and gesticulations + LLVoiceVisualizer* mVoiceVisualizer; + int mCurrentGesticulationLevel; //-------------------------------------------------------------------- - // Internal functions + // Step sound //-------------------------------------------------------------------- protected: - void buildCharacter(); - void releaseMeshData(); - void restoreMeshData(); - void updateMeshData(); - void computeBodySize(); - const LLUUID& getStepSound() const; - BOOL needsRenderBeam(); - - BOOL allocateCollisionVolumes( U32 num ); - void resetHUDAttachments(); - static void getAnimLabels( LLDynamicArray<std::string>* labels ); - static void getAnimNames( LLDynamicArray<std::string>* names ); + const LLUUID& getStepSound() const; +private: + // Global table of sound ids per material, and the ground + const static LLUUID sStepSounds[LL_MCODE_END]; + const static LLUUID sStepSoundOnLand; //-------------------------------------------------------------------- - // Textures and Layers + // Foot step state (for generating sounds) //-------------------------------------------------------------------- -protected: - BOOL loadSkeletonNode(); - BOOL loadMeshNodes(); - BOOL isFullyBaked(); - void deleteLayerSetCaches(bool clearAll = true); - static BOOL areAllNearbyInstancesBaked(S32& grey_avatars); - static void onBakedTextureMasksLoaded(BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); - void setLocalTexture(LLVOAvatarDefines::ETextureIndex i, LLViewerImage* tex, BOOL baked_version_exits); - void requestLayerSetUpdate(LLVOAvatarDefines::ETextureIndex i); - void addLocalTextureStats(LLVOAvatarDefines::ETextureIndex i, LLViewerImage* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked); - void addBakedTextureStats( LLViewerImage* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level); - static void onInitialBakedTextureLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ); - static void onBakedTextureLoaded(BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); - void useBakedTexture(const LLUUID& id); - void dumpAvatarTEs(const std::string& context); - void removeMissingBakedTextures(); - LLTexLayerSet* getLayerSet(LLVOAvatarDefines::ETextureIndex index) const; - LLHost getObjectHost() const; - S32 getLocalDiscardLevel(LLVOAvatarDefines::ETextureIndex index); public: - static void updateFreezeCounter(S32 counter = 0 ); + void setFootPlane(const LLVector4 &plane) { mFootPlane = plane; } + LLVector4 mFootPlane; private: - static S32 sFreezeCounter; + BOOL mWasOnGroundLeft; + BOOL mWasOnGroundRight; + +/** Sounds + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** DIAGNOSTICS + **/ - //----------------------------------------------------------------------------------------------- - // Avatar skeleton setup. - //----------------------------------------------------------------------------------------------- -private: - BOOL loadAvatar(); - BOOL setupBone(const LLVOAvatarBoneInfo* info, LLViewerJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num); - BOOL buildSkeleton(const LLVOAvatarSkeletonInfo *info); - - //----------------------------------------------------------------------------------------------- - // Per-avatar information about texture data. - // To-do: Move this to private implementation class - //----------------------------------------------------------------------------------------------- +public: + static void dumpArchetypeXML(void*); + static void dumpBakedStatus(); + const std::string getBakedStatusForPrintout() const; + void dumpAvatarTEs(const std::string& context); + + static F32 sUnbakedTime; // Total seconds with >=1 unbaked avatars + static F32 sUnbakedUpdateTime; // Last time stats were updated (to prevent multiple updates per frame) + static F32 sGreyTime; // Total seconds with >=1 grey avatars + static F32 sGreyUpdateTime; // Last time stats were updated (to prevent multiple updates per frame) +protected: + S32 getUnbakedPixelAreaRank(); + BOOL mHasGrey; private: - struct BakedTextureData + F32 mMinPixelArea; + F32 mMaxPixelArea; + F32 mAdjustedPixelArea; + std::string mDebugText; + +/** Diagnostics + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** SUPPORT CLASSES + **/ + +protected: // Shared with LLVOAvatarSelf + + struct LLVOAvatarXmlInfo { - LLUUID mLastTextureIndex; - LLTexLayerSet* mTexLayerSet; - bool mIsLoaded; - bool mIsUsed; - LLVOAvatarDefines::ETextureIndex mTextureIndex; - U32 mMaskTexName; - // Stores pointers to the joint meshes that this baked texture deals with - std::vector< LLViewerJointMesh * > mMeshes; // std::vector<LLViewerJointMesh> mJoints[i]->mMeshParts + LLVOAvatarXmlInfo(); + ~LLVOAvatarXmlInfo(); + + BOOL parseXmlSkeletonNode(LLXmlTreeNode* root); + BOOL parseXmlMeshNodes(LLXmlTreeNode* root); + BOOL parseXmlColorNodes(LLXmlTreeNode* root); + BOOL parseXmlLayerNodes(LLXmlTreeNode* root); + BOOL parseXmlDriverNodes(LLXmlTreeNode* root); + BOOL parseXmlMorphNodes(LLXmlTreeNode* root); + + struct LLVOAvatarMeshInfo + { + typedef std::pair<LLPolyMorphTargetInfo*,BOOL> morph_info_pair_t; + typedef std::vector<morph_info_pair_t> morph_info_list_t; + + LLVOAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {} + ~LLVOAvatarMeshInfo() + { + morph_info_list_t::iterator iter; + for (iter = mPolyMorphTargetInfoList.begin(); iter != mPolyMorphTargetInfoList.end(); iter++) + { + delete iter->first; + } + mPolyMorphTargetInfoList.clear(); + } + + std::string mType; + S32 mLOD; + std::string mMeshFileName; + std::string mReferenceMeshName; + F32 mMinPixelArea; + morph_info_list_t mPolyMorphTargetInfoList; + }; + typedef std::vector<LLVOAvatarMeshInfo*> mesh_info_list_t; + mesh_info_list_t mMeshInfoList; + + typedef std::vector<LLPolySkeletalDistortionInfo*> skeletal_distortion_info_list_t; + skeletal_distortion_info_list_t mSkeletalDistortionInfoList; + + struct LLVOAvatarAttachmentInfo + { + LLVOAvatarAttachmentInfo() + : mGroup(-1), mAttachmentID(-1), mPieMenuSlice(-1), mVisibleFirstPerson(FALSE), + mIsHUDAttachment(FALSE), mHasPosition(FALSE), mHasRotation(FALSE) {} + std::string mName; + std::string mJointName; + LLVector3 mPosition; + LLVector3 mRotationEuler; + S32 mGroup; + S32 mAttachmentID; + S32 mPieMenuSlice; + BOOL mVisibleFirstPerson; + BOOL mIsHUDAttachment; + BOOL mHasPosition; + BOOL mHasRotation; + }; + typedef std::vector<LLVOAvatarAttachmentInfo*> attachment_info_list_t; + attachment_info_list_t mAttachmentInfoList; + + LLTexGlobalColorInfo *mTexSkinColorInfo; + LLTexGlobalColorInfo *mTexHairColorInfo; + LLTexGlobalColorInfo *mTexEyeColorInfo; + + typedef std::vector<LLTexLayerSetInfo*> layer_info_list_t; + layer_info_list_t mLayerInfoList; + + typedef std::vector<LLDriverParamInfo*> driver_info_list_t; + driver_info_list_t mDriverInfoList; + + struct LLVOAvatarMorphInfo + { + LLVOAvatarMorphInfo() + : mInvert(FALSE) {} + std::string mName; + std::string mRegion; + std::string mLayer; + BOOL mInvert; + }; + + typedef std::vector<LLVOAvatarMorphInfo*> morph_info_list_t; + morph_info_list_t mMorphMaskInfoList; }; - typedef std::vector<BakedTextureData> bakedtexturedata_vec_t; - bakedtexturedata_vec_t mBakedTextureData; - struct LocalTextureData + struct LLMaskedMorph { - LocalTextureData() : mIsBakedReady(FALSE), mDiscard(MAX_DISCARD_LEVEL+1), mImage(NULL) - {} - LLPointer<LLViewerImage> mImage; - BOOL mIsBakedReady; - S32 mDiscard; + LLMaskedMorph(LLPolyMorphTarget *morph_target, BOOL invert, std::string layer) : + mMorphTarget(morph_target), + mInvert(invert), + mLayer(layer) + { + morph_target->addPendingMorphMask(); + } + + LLPolyMorphTarget *mMorphTarget; + BOOL mInvert; + std::string mLayer; }; - typedef std::map<LLVOAvatarDefines::ETextureIndex, LocalTextureData> localtexture_map_t; - localtexture_map_t mLocalTextureData; - - typedef std::multimap<std::string, LLPolyMesh*> polymesh_map_t; - polymesh_map_t mMeshes; - std::vector<LLViewerJoint *> mMeshLOD; - S32 mNumInitFaces ; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer. - - //----------------------------------------------------------------------------------------------- - // Static texture/mesh/baked dictionary for avatars - //----------------------------------------------------------------------------------------------- -public: - static BOOL isIndexLocalTexture(LLVOAvatarDefines::ETextureIndex i); - static BOOL isIndexBakedTexture(LLVOAvatarDefines::ETextureIndex i); -private: - static const LLVOAvatarDefines::LLVOAvatarDictionary *getDictionary() { return sAvatarDictionary; } - static LLVOAvatarDefines::LLVOAvatarDictionary *sAvatarDictionary; - static LLVOAvatarSkeletonInfo* sAvatarSkeletonInfo; - static LLVOAvatarXmlInfo* sAvatarXmlInfo; - //----------------------------------------------------------------------------------------------- - // Diagnostics - //----------------------------------------------------------------------------------------------- -public: - static F32 sUnbakedTime; // Total seconds with >=1 unbaked avatars - static F32 sUnbakedUpdateTime; // Last time stats were updated (to prevent multiple updates per frame) - static F32 sGreyTime; // Total seconds with >=1 grey avatars - static F32 sGreyUpdateTime; // Last time stats were updated (to prevent multiple updates per frame) +/** Support classes + ** ** + *******************************************************************************/ - const std::string getBakedStatusForPrintout() const; -}; +}; // LLVOAvatar -//----------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------ // Inlines -//----------------------------------------------------------------------------------------------- -inline BOOL LLVOAvatar::isTextureDefined(U8 te) const -{ - return (getTEImage(te)->getID() != IMG_DEFAULT_AVATAR && getTEImage(te)->getID() != IMG_DEFAULT); -} - -inline BOOL LLVOAvatar::isTextureVisible(U8 te) const +//------------------------------------------------------------------------ +inline BOOL LLVOAvatar::isTextureVisible(LLVOAvatarDefines::ETextureIndex te) const { return ((isTextureDefined(te) || isSelf()) && (getTEImage(te)->getID() != IMG_INVISIBLE diff --git a/indra/newview/llvoavatardefines.cpp b/indra/newview/llvoavatardefines.cpp index 19ad90a8e2117c28a62448e7c070562ed589aae9..978a61972f805d894a1e5228cbcd90692f36a524 100644 --- a/indra/newview/llvoavatardefines.cpp +++ b/indra/newview/llvoavatardefines.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2007, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -31,6 +32,7 @@ #include "llviewerprecompiledheaders.h" #include "llvoavatardefines.h" +#include "llviewercontrol.h" // gSavedSettings const S32 LLVOAvatarDefines::SCRATCH_TEX_WIDTH = 512; const S32 LLVOAvatarDefines::SCRATCH_TEX_HEIGHT = 512; @@ -41,56 +43,87 @@ using namespace LLVOAvatarDefines; /********************************************************************************* * Edit this function to add/remove/change textures and mesh definitions for avatars. */ -void LLVOAvatarDictionary::initData() + +LLVOAvatarDictionary::Textures::Textures() { - // Textures - mTextureMap[TEX_HEAD_BODYPAINT] = new TextureDictionaryEntry("head bodypaint", TRUE, BAKED_NUM_INDICES, "", WT_SKIN); - mTextureMap[TEX_UPPER_SHIRT] = new TextureDictionaryEntry("shirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultShirtUUID", WT_SHIRT); - mTextureMap[TEX_LOWER_PANTS] = new TextureDictionaryEntry("pants", TRUE, BAKED_NUM_INDICES, "UIImgDefaultPantsUUID", WT_PANTS); - mTextureMap[TEX_EYES_IRIS] = new TextureDictionaryEntry("iris", TRUE, BAKED_NUM_INDICES, "UIImgDefaultEyesUUID", WT_EYES); - mTextureMap[TEX_HAIR] = new TextureDictionaryEntry("hair", TRUE, BAKED_NUM_INDICES, "UIImgDefaultHairUUID", WT_HAIR); - mTextureMap[TEX_UPPER_BODYPAINT] = new TextureDictionaryEntry("upper bodypaint", TRUE, BAKED_NUM_INDICES, "", WT_SKIN); - mTextureMap[TEX_LOWER_BODYPAINT] = new TextureDictionaryEntry("lower bodypaint", TRUE, BAKED_NUM_INDICES, "", WT_SKIN); - mTextureMap[TEX_LOWER_SHOES] = new TextureDictionaryEntry("shoes", TRUE, BAKED_NUM_INDICES, "UIImgDefaultShoesUUID", WT_SHOES); - mTextureMap[TEX_LOWER_SOCKS] = new TextureDictionaryEntry("socks", TRUE, BAKED_NUM_INDICES, "UIImgDefaultSocksUUID", WT_SOCKS); - mTextureMap[TEX_UPPER_JACKET] = new TextureDictionaryEntry("upper jacket", TRUE, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", WT_JACKET); - mTextureMap[TEX_LOWER_JACKET] = new TextureDictionaryEntry("lower jacket", TRUE, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", WT_JACKET); - mTextureMap[TEX_UPPER_GLOVES] = new TextureDictionaryEntry("gloves", TRUE, BAKED_NUM_INDICES, "UIImgDefaultGlovesUUID", WT_GLOVES); - mTextureMap[TEX_UPPER_UNDERSHIRT] = new TextureDictionaryEntry("undershirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", WT_UNDERSHIRT); - mTextureMap[TEX_LOWER_UNDERPANTS] = new TextureDictionaryEntry("underpants", TRUE, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", WT_UNDERPANTS); - mTextureMap[TEX_SKIRT] = new TextureDictionaryEntry("skirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID", WT_SKIRT); - mTextureMap[TEX_HEAD_BAKED] = new TextureDictionaryEntry("head-baked", FALSE, BAKED_HEAD); - mTextureMap[TEX_UPPER_BAKED] = new TextureDictionaryEntry("upper-baked", FALSE, BAKED_UPPER); - mTextureMap[TEX_LOWER_BAKED] = new TextureDictionaryEntry("lower-baked", FALSE, BAKED_LOWER); - mTextureMap[TEX_EYES_BAKED] = new TextureDictionaryEntry("eyes-baked", FALSE, BAKED_EYES); - mTextureMap[TEX_HAIR_BAKED] = new TextureDictionaryEntry("hair-baked", FALSE, BAKED_HAIR); - mTextureMap[TEX_SKIRT_BAKED] = new TextureDictionaryEntry("skirt-baked", FALSE, BAKED_SKIRT); + addEntry(TEX_HEAD_BODYPAINT, new TextureEntry("head_bodypaint", TRUE, BAKED_NUM_INDICES, "", WT_SKIN)); + addEntry(TEX_UPPER_SHIRT, new TextureEntry("upper_shirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultShirtUUID", WT_SHIRT)); + addEntry(TEX_LOWER_PANTS, new TextureEntry("lower_pants", TRUE, BAKED_NUM_INDICES, "UIImgDefaultPantsUUID", WT_PANTS)); + addEntry(TEX_EYES_IRIS, new TextureEntry("eyes_iris", TRUE, BAKED_NUM_INDICES, "UIImgDefaultEyesUUID", WT_EYES)); + addEntry(TEX_HAIR, new TextureEntry("hair_grain", TRUE, BAKED_NUM_INDICES, "UIImgDefaultHairUUID", WT_HAIR)); + addEntry(TEX_UPPER_BODYPAINT, new TextureEntry("upper_bodypaint", TRUE, BAKED_NUM_INDICES, "", WT_SKIN)); + addEntry(TEX_LOWER_BODYPAINT, new TextureEntry("lower_bodypaint", TRUE, BAKED_NUM_INDICES, "", WT_SKIN)); + addEntry(TEX_LOWER_SHOES, new TextureEntry("lower_shoes", TRUE, BAKED_NUM_INDICES, "UIImgDefaultShoesUUID", WT_SHOES)); + addEntry(TEX_LOWER_SOCKS, new TextureEntry("lower_socks", TRUE, BAKED_NUM_INDICES, "UIImgDefaultSocksUUID", WT_SOCKS)); + addEntry(TEX_UPPER_JACKET, new TextureEntry("upper_jacket", TRUE, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", WT_JACKET)); + addEntry(TEX_LOWER_JACKET, new TextureEntry("lower_jacket", TRUE, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", WT_JACKET)); + addEntry(TEX_UPPER_GLOVES, new TextureEntry("upper_gloves", TRUE, BAKED_NUM_INDICES, "UIImgDefaultGlovesUUID", WT_GLOVES)); + addEntry(TEX_UPPER_UNDERSHIRT, new TextureEntry("upper_undershirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", WT_UNDERSHIRT)); + addEntry(TEX_LOWER_UNDERPANTS, new TextureEntry("lower_underpants", TRUE, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", WT_UNDERPANTS)); + addEntry(TEX_SKIRT, new TextureEntry("skirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID", WT_SKIRT)); + addEntry(TEX_LOWER_ALPHA, new TextureEntry("lower_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", WT_ALPHA)); + addEntry(TEX_UPPER_ALPHA, new TextureEntry("upper_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", WT_ALPHA)); + addEntry(TEX_HEAD_ALPHA, new TextureEntry("head_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", WT_ALPHA)); + addEntry(TEX_EYES_ALPHA, new TextureEntry("eyes_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", WT_ALPHA)); + addEntry(TEX_HAIR_ALPHA, new TextureEntry("hair_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", WT_ALPHA)); + addEntry(TEX_HEAD_TATTOO, new TextureEntry("head_tattoo", TRUE, BAKED_NUM_INDICES, "UIImgDefaultTattooUUID", WT_TATTOO)); + addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", TRUE, BAKED_NUM_INDICES, "UIImgDefaultTattooUUID", WT_TATTOO)); + addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", TRUE, BAKED_NUM_INDICES, "UIImgDefaultTattooUUID", WT_TATTOO)); + addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", FALSE, BAKED_HEAD)); + addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", FALSE, BAKED_UPPER)); + addEntry(TEX_LOWER_BAKED, new TextureEntry("lower-baked", FALSE, BAKED_LOWER)); + addEntry(TEX_EYES_BAKED, new TextureEntry("eyes-baked", FALSE, BAKED_EYES)); + addEntry(TEX_HAIR_BAKED, new TextureEntry("hair-baked", FALSE, BAKED_HAIR)); + addEntry(TEX_SKIRT_BAKED, new TextureEntry("skirt-baked", FALSE, BAKED_SKIRT)); +} +LLVOAvatarDictionary::BakedTextures::BakedTextures() +{ // Baked textures - mBakedTextureMap[BAKED_HEAD] = new BakedDictionaryEntry(TEX_HEAD_BAKED, "head", 1, TEX_HEAD_BODYPAINT); - mBakedTextureMap[BAKED_UPPER] = new BakedDictionaryEntry(TEX_UPPER_BAKED, "upper_body", 5, TEX_UPPER_SHIRT,TEX_UPPER_BODYPAINT,TEX_UPPER_JACKET,TEX_UPPER_GLOVES,TEX_UPPER_UNDERSHIRT); - mBakedTextureMap[BAKED_LOWER] = new BakedDictionaryEntry(TEX_LOWER_BAKED, "lower_body", 6, TEX_LOWER_PANTS,TEX_LOWER_BODYPAINT,TEX_LOWER_SHOES,TEX_LOWER_SOCKS,TEX_LOWER_JACKET,TEX_LOWER_UNDERPANTS); - mBakedTextureMap[BAKED_EYES] = new BakedDictionaryEntry(TEX_EYES_BAKED, "eyes", 1, TEX_EYES_IRIS); - mBakedTextureMap[BAKED_SKIRT] = new BakedDictionaryEntry(TEX_SKIRT_BAKED, "skirt", 1, TEX_SKIRT); - mBakedTextureMap[BAKED_HAIR] = new BakedDictionaryEntry(TEX_HAIR_BAKED, "hair", 1, TEX_HAIR); - + addEntry(BAKED_HEAD, new BakedEntry(TEX_HEAD_BAKED, + "head", "18ded8d6-bcfc-e415-8539-944c0f5ea7a6", + 3, TEX_HEAD_BODYPAINT, TEX_HEAD_TATTOO, TEX_HEAD_ALPHA, + 5, WT_SHAPE, WT_SKIN, WT_HAIR, WT_TATTOO, WT_ALPHA)); + + addEntry(BAKED_UPPER, new BakedEntry(TEX_UPPER_BAKED, + "upper_body", "338c29e3-3024-4dbb-998d-7c04cf4fa88f", + 7, TEX_UPPER_SHIRT,TEX_UPPER_BODYPAINT, TEX_UPPER_JACKET, + TEX_UPPER_GLOVES, TEX_UPPER_UNDERSHIRT, TEX_UPPER_TATTOO, TEX_UPPER_ALPHA, + 8, WT_SHAPE, WT_SKIN, WT_SHIRT, WT_JACKET, WT_GLOVES, WT_UNDERSHIRT, WT_TATTOO, WT_ALPHA)); + + addEntry(BAKED_LOWER, new BakedEntry(TEX_LOWER_BAKED, + "lower_body", "91b4a2c7-1b1a-ba16-9a16-1f8f8dcc1c3f", + 8, TEX_LOWER_PANTS,TEX_LOWER_BODYPAINT,TEX_LOWER_SHOES, TEX_LOWER_SOCKS, + TEX_LOWER_JACKET, TEX_LOWER_UNDERPANTS, TEX_LOWER_TATTOO, TEX_LOWER_ALPHA, + 9, WT_SHAPE, WT_SKIN, WT_PANTS, WT_SHOES, WT_SOCKS, WT_JACKET, WT_UNDERPANTS, WT_TATTOO, WT_ALPHA)); + + addEntry(BAKED_EYES, new BakedEntry(TEX_EYES_BAKED, + "eyes", "b2cf28af-b840-1071-3c6a-78085d8128b5", + 2, TEX_EYES_IRIS, TEX_EYES_ALPHA, + 2, WT_EYES, WT_ALPHA)); + + addEntry(BAKED_SKIRT, new BakedEntry(TEX_SKIRT_BAKED, + "skirt", "ea800387-ea1a-14e0-56cb-24f2022f969a", + 1, TEX_SKIRT, + 1, WT_SKIRT)); + + addEntry(BAKED_HAIR, new BakedEntry(TEX_HAIR_BAKED, + "hair", "0af1ef7c-ad24-11dd-8790-001f5bf833e8", + 2, TEX_HAIR, TEX_HAIR_ALPHA, + 2, WT_HAIR, WT_ALPHA)); +} + +LLVOAvatarDictionary::Meshes::Meshes() +{ // Meshes - mMeshMap[MESH_ID_HAIR] = new MeshDictionaryEntry(BAKED_HAIR, "hairMesh", 6, LLViewerJoint::PN_4); - mMeshMap[MESH_ID_HEAD] = new MeshDictionaryEntry(BAKED_HEAD, "headMesh", 5, LLViewerJoint::PN_5); - mMeshMap[MESH_ID_EYELASH] = new MeshDictionaryEntry(BAKED_HEAD, "eyelashMesh", 1, LLViewerJoint::PN_0); // no baked mesh associated currently - mMeshMap[MESH_ID_UPPER_BODY] = new MeshDictionaryEntry(BAKED_UPPER, "upperBodyMesh", 5, LLViewerJoint::PN_1); - mMeshMap[MESH_ID_LOWER_BODY] = new MeshDictionaryEntry(BAKED_LOWER, "lowerBodyMesh", 5, LLViewerJoint::PN_2); - mMeshMap[MESH_ID_EYEBALL_LEFT] = new MeshDictionaryEntry(BAKED_EYES, "eyeBallLeftMesh", 2, LLViewerJoint::PN_3); - mMeshMap[MESH_ID_EYEBALL_RIGHT] = new MeshDictionaryEntry(BAKED_EYES, "eyeBallRightMesh", 2, LLViewerJoint::PN_3); - mMeshMap[MESH_ID_SKIRT] = new MeshDictionaryEntry(BAKED_SKIRT, "skirtMesh", 5, LLViewerJoint::PN_5); - - // Wearables - mWearableMap[BAKED_HEAD] = new WearableDictionaryEntry("18ded8d6-bcfc-e415-8539-944c0f5ea7a6", 3, WT_SHAPE, WT_SKIN, WT_HAIR); - mWearableMap[BAKED_UPPER] = new WearableDictionaryEntry("338c29e3-3024-4dbb-998d-7c04cf4fa88f", 6, WT_SHAPE, WT_SKIN, WT_SHIRT, WT_JACKET, WT_GLOVES, WT_UNDERSHIRT); - mWearableMap[BAKED_LOWER] = new WearableDictionaryEntry("91b4a2c7-1b1a-ba16-9a16-1f8f8dcc1c3f", 7, WT_SHAPE, WT_SKIN, WT_PANTS, WT_SHOES, WT_SOCKS, WT_JACKET, WT_UNDERPANTS); - mWearableMap[BAKED_EYES] = new WearableDictionaryEntry("b2cf28af-b840-1071-3c6a-78085d8128b5", 1, WT_EYES); - mWearableMap[BAKED_SKIRT] = new WearableDictionaryEntry("ea800387-ea1a-14e0-56cb-24f2022f969a", 1, WT_SKIRT); - mWearableMap[BAKED_HAIR] = new WearableDictionaryEntry("0af1ef7c-ad24-11dd-8790-001f5bf833e8", 1, WT_HAIR); + addEntry(MESH_ID_HAIR, new MeshEntry(BAKED_HAIR, "hairMesh", 6, LLViewerJoint::PN_4)); + addEntry(MESH_ID_HEAD, new MeshEntry(BAKED_HEAD, "headMesh", 5, LLViewerJoint::PN_5)); + addEntry(MESH_ID_EYELASH, new MeshEntry(BAKED_HEAD, "eyelashMesh", 1, LLViewerJoint::PN_0)); // no baked mesh associated currently + addEntry(MESH_ID_UPPER_BODY, new MeshEntry(BAKED_UPPER, "upperBodyMesh", 5, LLViewerJoint::PN_1)); + addEntry(MESH_ID_LOWER_BODY, new MeshEntry(BAKED_LOWER, "lowerBodyMesh", 5, LLViewerJoint::PN_2)); + addEntry(MESH_ID_EYEBALL_LEFT, new MeshEntry(BAKED_EYES, "eyeBallLeftMesh", 2, LLViewerJoint::PN_3)); + addEntry(MESH_ID_EYEBALL_RIGHT, new MeshEntry(BAKED_EYES, "eyeBallRightMesh", 2, LLViewerJoint::PN_3)); + addEntry(MESH_ID_SKIRT, new MeshEntry(BAKED_SKIRT, "skirtMesh", 5, LLViewerJoint::PN_5)); } /* @@ -99,18 +132,22 @@ void LLVOAvatarDictionary::initData() LLVOAvatarDictionary::LLVOAvatarDictionary() { - initData(); createAssociations(); } +//virtual +LLVOAvatarDictionary::~LLVOAvatarDictionary() +{ +} + // Baked textures are composites of textures; for each such composited texture, // map it to the baked texture. void LLVOAvatarDictionary::createAssociations() { - for (baked_map_t::const_iterator iter = mBakedTextureMap.begin(); iter != mBakedTextureMap.end(); iter++) + for (BakedTextures::const_iterator iter = mBakedTextures.begin(); iter != mBakedTextures.end(); iter++) { const EBakedTextureIndex baked_index = (iter->first); - const BakedDictionaryEntry *dict = (iter->second); + const BakedEntry *dict = (iter->second); // For each texture that this baked texture index affects, associate those textures // with this baked texture index. @@ -119,19 +156,19 @@ void LLVOAvatarDictionary::createAssociations() local_texture_iter++) { const ETextureIndex local_texture_index = (ETextureIndex) *local_texture_iter; - mTextureMap[local_texture_index]->mIsUsedByBakedTexture = true; - mTextureMap[local_texture_index]->mBakedTextureIndex = baked_index; + mTextures[local_texture_index]->mIsUsedByBakedTexture = true; + mTextures[local_texture_index]->mBakedTextureIndex = baked_index; } } } -LLVOAvatarDictionary::TextureDictionaryEntry::TextureDictionaryEntry(const std::string &name, - bool is_local_texture, - EBakedTextureIndex baked_texture_index, - const std::string &default_image_name, - EWearableType wearable_type) : - mName(name), +LLVOAvatarDictionary::TextureEntry::TextureEntry(const std::string &name, + bool is_local_texture, + EBakedTextureIndex baked_texture_index, + const std::string &default_image_name, + EWearableType wearable_type) : + LLDictionaryEntry(name), mIsLocalTexture(is_local_texture), mIsBakedTexture(!is_local_texture), mIsUsedByBakedTexture(baked_texture_index != BAKED_NUM_INDICES), @@ -141,87 +178,93 @@ LLVOAvatarDictionary::TextureDictionaryEntry::TextureDictionaryEntry(const std:: { } -LLVOAvatarDictionary::MeshDictionaryEntry::MeshDictionaryEntry(EBakedTextureIndex baked_index, - const std::string &name, - U8 level, - LLViewerJoint::PickName pick) : +LLVOAvatarDictionary::MeshEntry::MeshEntry(EBakedTextureIndex baked_index, + const std::string &name, + U8 level, + LLViewerJoint::PickName pick) : + LLDictionaryEntry(name), mBakedID(baked_index), - mName(name), mLOD(level), mPickName(pick) { } -LLVOAvatarDictionary::BakedDictionaryEntry::BakedDictionaryEntry(ETextureIndex tex_index, - const std::string &name, - U32 num_local_textures, ... ) : - mName(name), +LLVOAvatarDictionary::BakedEntry::BakedEntry(ETextureIndex tex_index, + const std::string &name, + const std::string &hash_name, + U32 num_local_textures, + ... ) : + LLDictionaryEntry(name), + mWearablesHashID(LLUUID(hash_name)), mTextureIndex(tex_index) - { va_list argp; + va_start(argp, num_local_textures); + + // Read in local textures for (U8 i=0; i < num_local_textures; i++) { ETextureIndex t = (ETextureIndex)va_arg(argp,int); mLocalTextures.push_back(t); } -} -LLVOAvatarDictionary::WearableDictionaryEntry::WearableDictionaryEntry(const std::string &hash_name, - U32 num_wearables, ... ) : - mHashID(LLUUID(hash_name)) -{ - va_list argp; - va_start(argp, num_wearables); + // Read in number of wearables + const U32 num_wearables = (U32)va_arg(argp,int); + // Read in wearables for (U8 i=0; i < num_wearables; i++) { EWearableType t = (EWearableType)va_arg(argp,int); - mWearablesVec.push_back(t); + mWearables.push_back(t); } } -//virtual -LLVOAvatarDictionary::~LLVOAvatarDictionary() +// static +ETextureIndex LLVOAvatarDictionary::bakedToLocalTextureIndex(EBakedTextureIndex index) { - for (mesh_map_t::iterator iter = mMeshMap.begin(); iter != mMeshMap.end(); iter++) - delete (iter->second); - for (baked_map_t::iterator iter = mBakedTextureMap.begin(); iter != mBakedTextureMap.end(); iter++) - delete (iter->second); - for (texture_map_t::iterator iter = mTextureMap.begin(); iter != mTextureMap.end(); iter++) - delete (iter->second); -} - -const LLVOAvatarDictionary::MeshDictionaryEntry *LLVOAvatarDictionary::getMesh(EMeshIndex index) const -{ - mesh_map_t::const_iterator mesh_iter = mMeshMap.find(index); - if (mesh_iter == mMeshMap.end()) return NULL; - return mesh_iter->second; + return LLVOAvatarDictionary::getInstance()->getBakedTexture(index)->mTextureIndex; } -const LLVOAvatarDictionary::BakedDictionaryEntry *LLVOAvatarDictionary::getBakedTexture(EBakedTextureIndex index) const +//static +EBakedTextureIndex LLVOAvatarDictionary::findBakedByRegionName(std::string name) { - baked_map_t::const_iterator baked_iter = mBakedTextureMap.find(index); - if (baked_iter == mBakedTextureMap.end()) return NULL; - return baked_iter->second; + U8 index = 0; + while (index < BAKED_NUM_INDICES) + { + const BakedEntry *be = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex) index); + if (be && be->mName.compare(name) == 0) + { + // baked texture found + return (EBakedTextureIndex) index; + } + index++; + } + // baked texture could not be found + return BAKED_NUM_INDICES; } -const LLVOAvatarDictionary::TextureDictionaryEntry *LLVOAvatarDictionary::getTexture(ETextureIndex index) const +//static +const LLUUID LLVOAvatarDictionary::getDefaultTextureImageID(ETextureIndex index) { - texture_map_t::const_iterator texture_iter = mTextureMap.find(index); - if (texture_iter == mTextureMap.end()) return NULL; - return texture_iter->second; + /* switch( index ) + case TEX_UPPER_SHIRT: return LLUUID( gSavedSettings.getString("UIImgDefaultShirtUUID") ); */ + const TextureEntry *texture_dict = getInstance()->getTexture(index); + const std::string &default_image_name = texture_dict->mDefaultImageName; + if (default_image_name == "") + { + return IMG_DEFAULT_AVATAR; + } + else + { + return LLUUID(gSavedSettings.getString(default_image_name)); + } } -const LLVOAvatarDictionary::WearableDictionaryEntry *LLVOAvatarDictionary::getWearable(EBakedTextureIndex index) const +// static +EWearableType LLVOAvatarDictionary::getTEWearableType(ETextureIndex index ) { - wearable_map_t::const_iterator wearable_iter = mWearableMap.find(index); - if (wearable_iter == mWearableMap.end()) return NULL; - return wearable_iter->second; + /* switch(index) + case TEX_UPPER_SHIRT: + return WT_SHIRT; */ + return getInstance()->getTexture(index)->mWearableType; } - - -ETextureIndex LLVOAvatarDefines::getTextureIndex(EBakedTextureIndex index) -{ - return LLVOAvatarDictionary::getInstance()->getBakedTexture(index)->mTextureIndex; -} diff --git a/indra/newview/llvoavatardefines.h b/indra/newview/llvoavatardefines.h index bc1a1f1c1fd7e3c4dc3707504ea4bf807f5e42d7..cf3d3181597048f1237b3a9599e5a64ffc3fffec 100644 --- a/indra/newview/llvoavatardefines.h +++ b/indra/newview/llvoavatardefines.h @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2001&license=viewergpl$ * - * Copyright (c) 2001-2007, Linden Research, Inc. + * Copyright (c) 2001-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -13,12 +13,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -36,6 +37,7 @@ #include <vector> #include "llwearable.h" #include "llviewerjoint.h" +#include "lldictionary.h" namespace LLVOAvatarDefines { @@ -45,7 +47,7 @@ extern const S32 SCRATCH_TEX_HEIGHT; extern const S32 IMPOSTOR_PERIOD; //-------------------------------------------------------------------- -// texture entry assignment +// Enums //-------------------------------------------------------------------- enum ETextureIndex { @@ -57,9 +59,9 @@ enum ETextureIndex TEX_UPPER_BODYPAINT, TEX_LOWER_BODYPAINT, TEX_LOWER_SHOES, - TEX_HEAD_BAKED, // Pre-composited - TEX_UPPER_BAKED, // Pre-composited - TEX_LOWER_BAKED, // Pre-composited + TEX_HEAD_BAKED, // Pre-composited + TEX_UPPER_BAKED, // Pre-composited + TEX_LOWER_BAKED, // Pre-composited TEX_EYES_BAKED, // Pre-composited TEX_LOWER_SOCKS, TEX_UPPER_JACKET, @@ -68,14 +70,19 @@ enum ETextureIndex TEX_UPPER_UNDERSHIRT, TEX_LOWER_UNDERPANTS, TEX_SKIRT, - TEX_SKIRT_BAKED, // Pre-composited + TEX_SKIRT_BAKED, // Pre-composited TEX_HAIR_BAKED, // Pre-composited + TEX_LOWER_ALPHA, + TEX_UPPER_ALPHA, + TEX_HEAD_ALPHA, + TEX_EYES_ALPHA, + TEX_HAIR_ALPHA, + TEX_HEAD_TATTOO, + TEX_UPPER_TATTOO, + TEX_LOWER_TATTOO, TEX_NUM_INDICES -}; // "Note: if TEX_NUM_ENTRIES changes, update AGENT_TEXTURES in llagentinfo.h, mTextureIndexBaked, and BAKED_TEXTURE_COUNT" -// Seraph - Above comment about order is probably obsolete. +}; -typedef std::vector<ETextureIndex> texture_vec_t; - enum EBakedTextureIndex { BAKED_HEAD = 0, @@ -86,7 +93,6 @@ enum EBakedTextureIndex BAKED_HAIR, BAKED_NUM_INDICES }; -typedef std::vector<EBakedTextureIndex> bakedtexture_vec_t; // Reference IDs for each mesh. Used as indices for vector of joints enum EMeshIndex @@ -101,19 +107,15 @@ enum EMeshIndex MESH_ID_SKIRT, MESH_ID_NUM_INDICES }; -typedef std::vector<EMeshIndex> mesh_vec_t; +//-------------------------------------------------------------------- +// Vector Types +//-------------------------------------------------------------------- +typedef std::vector<ETextureIndex> texture_vec_t; +typedef std::vector<EBakedTextureIndex> bakedtexture_vec_t; +typedef std::vector<EMeshIndex> mesh_vec_t; typedef std::vector<EWearableType> wearables_vec_t; -//-------------------------------------------------------------------------------- -// Convenience Functions -//-------------------------------------------------------------------------------- - -// Convert from baked texture to associated texture; e.g. BAKED_HEAD -> TEX_HEAD_BAKED -ETextureIndex getTextureIndex(EBakedTextureIndex t); - - - //------------------------------------------------------------------------ // LLVOAvatarDictionary // @@ -124,86 +126,109 @@ ETextureIndex getTextureIndex(EBakedTextureIndex t); //------------------------------------------------------------------------ class LLVOAvatarDictionary : public LLSingleton<LLVOAvatarDictionary> { + //-------------------------------------------------------------------- + // Constructors and Destructors + //-------------------------------------------------------------------- public: LLVOAvatarDictionary(); virtual ~LLVOAvatarDictionary(); +private: + void createAssociations(); - struct TextureDictionaryEntry + //-------------------------------------------------------------------- + // Local and baked textures + //-------------------------------------------------------------------- +public: + struct TextureEntry : public LLDictionaryEntry { - TextureDictionaryEntry(const std::string &name, - bool is_local_texture, - EBakedTextureIndex baked_texture_index = BAKED_NUM_INDICES, - const std::string &default_image_name = "", - EWearableType wearable_type = WT_INVALID); - const std::string mName; - const std::string mDefaultImageName; + TextureEntry(const std::string &name, // this must match the xml name used by LLTexLayerInfo::parseXml + bool is_local_texture, + EBakedTextureIndex baked_texture_index = BAKED_NUM_INDICES, + const std::string& default_image_name = "", + EWearableType wearable_type = WT_INVALID); + const std::string mDefaultImageName; const EWearableType mWearableType; // It's either a local texture xor baked - BOOL mIsLocalTexture; - BOOL mIsBakedTexture; + BOOL mIsLocalTexture; + BOOL mIsBakedTexture; // If it's a local texture, it may be used by a baked texture - BOOL mIsUsedByBakedTexture; - EBakedTextureIndex mBakedTextureIndex; + BOOL mIsUsedByBakedTexture; + EBakedTextureIndex mBakedTextureIndex; }; + + struct Textures : public LLDictionary<ETextureIndex, TextureEntry> + { + Textures(); + } mTextures; + const TextureEntry* getTexture(ETextureIndex index) const { return mTextures.lookup(index); } + const Textures& getTextures() const { return mTextures; } - struct MeshDictionaryEntry + //-------------------------------------------------------------------- + // Meshes + //-------------------------------------------------------------------- +public: + struct MeshEntry : public LLDictionaryEntry { - MeshDictionaryEntry(EBakedTextureIndex baked_index, - const std::string &name, - U8 level, - LLViewerJoint::PickName pick); - const std::string mName; // names of mesh types as they are used in avatar_lad.xml + MeshEntry(EBakedTextureIndex baked_index, + const std::string &name, // names of mesh types as they are used in avatar_lad.xml + U8 level, + LLViewerJoint::PickName pick); // Levels of Detail for each mesh. Must match levels of detail present in avatar_lad.xml // Otherwise meshes will be unable to be found, or levels of detail will be ignored - const U8 mLOD; - const EBakedTextureIndex mBakedID; - const LLViewerJoint::PickName mPickName; + const U8 mLOD; + const EBakedTextureIndex mBakedID; + const LLViewerJoint::PickName mPickName; }; - struct BakedDictionaryEntry + struct Meshes : public LLDictionary<EMeshIndex, MeshEntry> { - BakedDictionaryEntry(ETextureIndex tex_index, - const std::string &name, - U32 num_local_textures, ... ); - const ETextureIndex mTextureIndex; - const std::string mName; - texture_vec_t mLocalTextures; - }; - - struct WearableDictionaryEntry + Meshes(); + } mMeshes; + const MeshEntry* getMesh(EMeshIndex index) const { return mMeshes.lookup(index); } + const Meshes& getMeshes() const { return mMeshes; } + + //-------------------------------------------------------------------- + // Baked Textures + //-------------------------------------------------------------------- +public: + struct BakedEntry : public LLDictionaryEntry { - WearableDictionaryEntry(const std::string &hash_name, - U32 num_wearables, ... ); - const LLUUID mHashID; - wearables_vec_t mWearablesVec; + BakedEntry(ETextureIndex tex_index, + const std::string &name, // unused, but necessary for templating. + const std::string &hash_name, + U32 num_local_textures, ... ); // # local textures, local texture list, # wearables, wearable list + // Local Textures + const ETextureIndex mTextureIndex; + texture_vec_t mLocalTextures; + // Wearables + const LLUUID mWearablesHashID; + wearables_vec_t mWearables; }; - typedef std::map<EBakedTextureIndex, BakedDictionaryEntry*> baked_map_t; - typedef std::map<ETextureIndex, TextureDictionaryEntry*> texture_map_t; - typedef std::map<EMeshIndex, MeshDictionaryEntry*> mesh_map_t; - typedef std::map<EBakedTextureIndex, WearableDictionaryEntry*> wearable_map_t; + struct BakedTextures: public LLDictionary<EBakedTextureIndex, BakedEntry> + { + BakedTextures(); + } mBakedTextures; + const BakedEntry* getBakedTexture(EBakedTextureIndex index) const { return mBakedTextures.lookup(index); } + const BakedTextures& getBakedTextures() const { return mBakedTextures; } + + //-------------------------------------------------------------------- + // Convenience Functions + //-------------------------------------------------------------------- +public: + // Convert from baked texture to associated texture; e.g. BAKED_HEAD -> TEX_HEAD_BAKED + static ETextureIndex bakedToLocalTextureIndex(EBakedTextureIndex t); - const MeshDictionaryEntry *getMesh(EMeshIndex index) const; - const BakedDictionaryEntry *getBakedTexture(EBakedTextureIndex index) const; - const TextureDictionaryEntry *getTexture(ETextureIndex index) const; - const WearableDictionaryEntry *getWearable(EBakedTextureIndex index) const; + // find a baked texture index based on its name + static EBakedTextureIndex findBakedByRegionName(std::string name); - const texture_map_t &getTextures() const { return mTextureMap; } - const baked_map_t &getBakedTextures() const { return mBakedTextureMap; } - const mesh_map_t &getMeshes() const { return mMeshMap; } - const wearable_map_t &getWearables() const { return mWearableMap; } - -private: - void initData(); - void createAssociations(); + static const LLUUID getDefaultTextureImageID(ETextureIndex index); - texture_map_t mTextureMap; - baked_map_t mBakedTextureMap; - mesh_map_t mMeshMap; - wearable_map_t mWearableMap; + // Given a texture entry, determine which wearable type owns it. + static EWearableType getTEWearableType(ETextureIndex index); }; // End LLVOAvatarDictionary } // End namespace LLVOAvatarDefines -#endif +#endif //LL_VO_AVATARDEFINES_H diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d629767bbe9497f53bd8ca24ef319d35bf304c03 --- /dev/null +++ b/indra/newview/llvoavatarself.cpp @@ -0,0 +1,2016 @@ +/** + * @file llvoavatar.cpp + * @brief Implementation of LLVOAvatar class which is a derivation fo LLViewerObject + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llvoavatarself.h" +#include "llvoavatar.h" + +#include <stdio.h> +#include <ctype.h> + +#include "audioengine.h" +#include "noise.h" + +// TODO: Seraph - Remove unnecessary headers. These are copied from llvoavatar.h. +#include "llagent.h" // Get state values from here +#include "llagentwearables.h" +#include "llviewercontrol.h" +#include "lldrawpoolavatar.h" +#include "lldriverparam.h" +#include "lleditingmotion.h" +#include "llemote.h" +#include "llface.h" +#include "llfirstuse.h" +#include "llheadrotmotion.h" +#include "llhudeffecttrail.h" +#include "llhudmanager.h" +#include "llinventoryview.h" +#include "llkeyframefallmotion.h" +#include "llkeyframestandmotion.h" +#include "llkeyframewalkmotion.h" +#include "llmutelist.h" +#include "llselectmgr.h" +#include "llsprite.h" +#include "lltargetingmotion.h" +#include "lltexlayer.h" +#include "lltexglobalcolor.h" +#include "lltoolgrab.h" // for needsRenderBeam +#include "lltoolmgr.h" // for needsRenderBeam +#include "lltoolmorph.h" +#include "lltrans.h" +#include "llviewercamera.h" +#include "llviewerimagelist.h" +#include "llviewermenu.h" +#include "llviewerobjectlist.h" +#include "llviewerparcelmgr.h" +#include "llviewerstats.h" +#include "llvovolume.h" +#include "llworld.h" +#include "pipeline.h" +#include "llviewershadermgr.h" +#include "llsky.h" +#include "llanimstatelabels.h" +#include "llgesturemgr.h" //needed to trigger the voice gesticulations +#include "llvoiceclient.h" +#include "llvoicevisualizer.h" // Ventrella + +#include "boost/lexical_cast.hpp" + +using namespace LLVOAvatarDefines; + +/********************************************************************************* + ** ** + ** Begin private LLVOAvatarSelf Support classes + ** + **/ + +struct LocalTextureData +{ + LocalTextureData() : + mIsBakedReady(FALSE), + mDiscard(MAX_DISCARD_LEVEL+1), + mImage(NULL), + mWearableID(IMG_DEFAULT_AVATAR), + mTexEntry(NULL) + {} + LLPointer<LLViewerImage> mImage; + BOOL mIsBakedReady; + S32 mDiscard; + LLUUID mWearableID; // UUID of the wearable that this texture belongs to, not of the image itself + LLTextureEntry *mTexEntry; +}; + +//----------------------------------------------------------------------------- +// Callback data +//----------------------------------------------------------------------------- +struct LLAvatarTexData +{ + LLAvatarTexData(const LLUUID& id, ETextureIndex index) : + mAvatarID(id), + mIndex(index) + {} + LLUUID mAvatarID; + ETextureIndex mIndex; +}; + +/** + ** + ** End LLVOAvatarSelf Support classes + ** ** + *********************************************************************************/ + + +//----------------------------------------------------------------------------- +// Static Data +//----------------------------------------------------------------------------- +S32 LLVOAvatarSelf::sScratchTexBytes = 0; +LLMap< LLGLenum, LLGLuint*> LLVOAvatarSelf::sScratchTexNames; +LLMap< LLGLenum, F32*> LLVOAvatarSelf::sScratchTexLastBindTime; + + +/********************************************************************************* + ** ** + ** Begin LLVOAvatarSelf Constructor routines + ** + **/ + +LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, + const LLPCode pcode, + LLViewerRegion* regionp) : + LLVOAvatar(id, pcode, regionp), + mScreenp(NULL), + mLastRegionHandle(0), + mRegionCrossingCount(0) +{ + gAgent.setAvatarObject(this); + gAgentWearables.setAvatarObject(this); + + lldebugs << "Marking avatar as self " << id << llendl; + + for (U32 i = 0; i < TEX_NUM_INDICES; i++) + { + mLocalTextureDatas[(ETextureIndex)i].push_back(new LocalTextureData); + } + + BOOL status = TRUE; + status &= loadAvatarSelf(); + status &= buildMenus(); + if (!status) + { + llerrs << "Unable to load user's avatar" << llendl; + return; + } +} + +// virtual +void LLVOAvatarSelf::markDead() +{ + mBeam = NULL; + LLVOAvatar::markDead(); +} + +BOOL LLVOAvatarSelf::loadAvatarSelf() +{ + BOOL success = TRUE; + // avatar_skeleton.xml + if (!buildSkeletonSelf(sAvatarSkeletonInfo)) + { + llwarns << "avatar file: buildSkeleton() failed" << llendl; + return FALSE; + } + // TODO: make loadLayersets() called only by self. + //success &= loadLayersets(); + + return success; +} + +BOOL LLVOAvatarSelf::buildSkeletonSelf(const LLVOAvatarSkeletonInfo *info) +{ + LLMemType mt(LLMemType::MTYPE_AVATAR); + + // add special-purpose "screen" joint + mScreenp = new LLViewerJoint("mScreen", NULL); + // for now, put screen at origin, as it is only used during special + // HUD rendering mode + F32 aspect = LLViewerCamera::getInstance()->getAspect(); + LLVector3 scale(1.f, aspect, 1.f); + mScreenp->setScale(scale); + mScreenp->setWorldPosition(LLVector3::zero); + return TRUE; +} + +BOOL LLVOAvatarSelf::buildMenus() +{ + //------------------------------------------------------------------------- + // build the attach and detach menus + //------------------------------------------------------------------------- + gAttachBodyPartPieMenus[0] = NULL; + + LLContextMenu::Params params; + params.label(LLTrans::getString("BodyPartsRightArm") + " >"); + params.name(params.label); + params.visible(false); + gAttachBodyPartPieMenus[1] = LLUICtrlFactory::create<LLContextMenu> (params); + + params.label(LLTrans::getString("BodyPartsHead") + " >"); + params.name(params.label); + gAttachBodyPartPieMenus[2] = LLUICtrlFactory::create<LLContextMenu> (params); + + params.label(LLTrans::getString("BodyPartsLeftArm") + " >"); + params.name(params.label); + gAttachBodyPartPieMenus[3] = LLUICtrlFactory::create<LLContextMenu> (params); + + gAttachBodyPartPieMenus[4] = NULL; + + params.label(LLTrans::getString("BodyPartsLeftLeg") + " >"); + params.name(params.label); + gAttachBodyPartPieMenus[5] = LLUICtrlFactory::create<LLContextMenu> (params); + + params.label(LLTrans::getString("BodyPartsTorso") + " >"); + params.name(params.label); + gAttachBodyPartPieMenus[6] = LLUICtrlFactory::create<LLContextMenu> (params); + + params.label(LLTrans::getString("BodyPartsRightLeg") + " >"); + params.name(params.label); + gAttachBodyPartPieMenus[7] = LLUICtrlFactory::create<LLContextMenu> (params); + + gDetachBodyPartPieMenus[0] = NULL; + + params.label(LLTrans::getString("BodyPartsRightArm") + " >"); + params.name(params.label); + gDetachBodyPartPieMenus[1] = LLUICtrlFactory::create<LLContextMenu> (params); + + params.label(LLTrans::getString("BodyPartsHead") + " >"); + params.name(params.label); + gDetachBodyPartPieMenus[2] = LLUICtrlFactory::create<LLContextMenu> (params); + + params.label(LLTrans::getString("BodyPartsLeftArm") + " >"); + params.name(params.label); + gDetachBodyPartPieMenus[3] = LLUICtrlFactory::create<LLContextMenu> (params); + + gDetachBodyPartPieMenus[4] = NULL; + + params.label(LLTrans::getString("BodyPartsLeftLeg") + " >"); + params.name(params.label); + gDetachBodyPartPieMenus[5] = LLUICtrlFactory::create<LLContextMenu> (params); + + params.label(LLTrans::getString("BodyPartsTorso") + " >"); + params.name(params.label); + gDetachBodyPartPieMenus[6] = LLUICtrlFactory::create<LLContextMenu> (params); + + params.label(LLTrans::getString("BodyPartsRightLeg") + " >"); + params.name(params.label); + gDetachBodyPartPieMenus[7] = LLUICtrlFactory::create<LLContextMenu> (params); + + for (S32 i = 0; i < 8; i++) + { + if (gAttachBodyPartPieMenus[i]) + { + gAttachPieMenu->appendContextSubMenu( gAttachBodyPartPieMenus[i] ); + } + else + { + BOOL attachment_found = FALSE; + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ) + { + attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + if (attachment->getGroup() == i) + { + LLMenuItemCallGL::Params item_params; + + std::string sub_piemenu_name = attachment->getName(); + if (LLTrans::getString(sub_piemenu_name) != "") + { + item_params.label = LLTrans::getString(sub_piemenu_name); + } + else + { + item_params.label = sub_piemenu_name; + } + item_params.name =(item_params.label ); + item_params.on_click.function_name = "Object.AttachToAvatar"; + item_params.on_click.parameter = curiter->first; + item_params.on_enable.function_name = "Object.EnableWear"; + item_params.on_enable.parameter = curiter->first; + LLMenuItemCallGL* item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); + + gAttachPieMenu->addChild(item); + + attachment_found = TRUE; + break; + + } + } + + if (!attachment_found) + { + gAttachPieMenu->addSeparator(); + } + } + + if (gDetachBodyPartPieMenus[i]) + { + gDetachPieMenu->appendContextSubMenu( gDetachBodyPartPieMenus[i] ); + } + else + { + BOOL attachment_found = FALSE; + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ) + { + attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + if (attachment->getGroup() == i) + { + LLMenuItemCallGL::Params item_params; + std::string sub_piemenu_name = attachment->getName(); + if (LLTrans::getString(sub_piemenu_name) != "") + { + item_params.label = LLTrans::getString(sub_piemenu_name); + } + else + { + item_params.label = sub_piemenu_name; + } + item_params.name =(item_params.label ); + item_params.on_click.function_name = "Attachment.Detach"; + item_params.on_click.parameter = curiter->first; + item_params.on_enable.function_name = "Attachment.EnableDetach"; + item_params.on_enable.parameter = curiter->first; + LLMenuItemCallGL* item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); + + gDetachPieMenu->addChild(item); + + attachment_found = TRUE; + break; + } + } + + if (!attachment_found) + { + gDetachPieMenu->addSeparator(); + } + } + } + + // add screen attachments + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ) + { + attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + if (attachment->getGroup() == 8) + { + LLMenuItemCallGL::Params item_params; + std::string sub_piemenu_name = attachment->getName(); + if (LLTrans::getString(sub_piemenu_name) != "") + { + item_params.label = LLTrans::getString(sub_piemenu_name); + } + else + { + item_params.label = sub_piemenu_name; + } + item_params.name =(item_params.label ); + item_params.on_click.function_name = "Object.AttachToAvatar"; + item_params.on_click.parameter = curiter->first; + item_params.on_enable.function_name = "Object.EnableWear"; + item_params.on_enable.parameter = curiter->first; + LLMenuItemCallGL* item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); + gAttachScreenPieMenu->addChild(item); + + item_params.on_click.function_name = "Attachment.DetachFromPoint"; + item_params.on_click.parameter = curiter->first; + item_params.on_enable.function_name = "Attachment.PointFilled"; + item_params.on_enable.parameter = curiter->first; + item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); + gDetachScreenPieMenu->addChild(item); + } + } + + for (S32 pass = 0; pass < 2; pass++) + { + // *TODO: Skinning - gAttachSubMenu is an awful, awful hack + if (!gAttachSubMenu) + { + break; + } + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ) + { + attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + if (attachment->getIsHUDAttachment() != (pass == 1)) + { + continue; + } + LLMenuItemCallGL::Params item_params; + std::string sub_piemenu_name = attachment->getName(); + if (LLTrans::getString(sub_piemenu_name) != "") + { + item_params.label = LLTrans::getString(sub_piemenu_name); + } + else + { + item_params.label = sub_piemenu_name; + } + item_params.name =(item_params.label ); + item_params.on_click.function_name = "Object.AttachToAvatar"; + item_params.on_click.parameter = curiter->first; + item_params.on_enable.function_name = "Object.EnableWear"; + item_params.on_enable.parameter = curiter->first; + //* TODO: Skinning: + //LLSD params; + //params["index"] = curiter->first; + //params["label"] = attachment->getName(); + //item->addEventHandler("on_enable", LLMenuItemCallGL::MenuCallback().function_name("Attachment.Label").parameter(params)); + + LLMenuItemCallGL* item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); + gAttachSubMenu->addChild(item); + + item_params.on_click.function_name = "Attachment.DetachFromPoint"; + item_params.on_click.parameter = curiter->first; + item_params.on_enable.function_name = "Attachment.PointFilled"; + item_params.on_enable.parameter = curiter->first; + //* TODO: Skinning: item->addEventHandler("on_enable", LLMenuItemCallGL::MenuCallback().function_name("Attachment.Label").parameter(params)); + + item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); + gDetachSubMenu->addChild(item); + } + if (pass == 0) + { + // put separator between non-hud and hud attachments + gAttachSubMenu->addSeparator(); + gDetachSubMenu->addSeparator(); + } + } + + for (S32 group = 0; group < 8; group++) + { + // skip over groups that don't have sub menus + if (!gAttachBodyPartPieMenus[group] || !gDetachBodyPartPieMenus[group]) + { + continue; + } + + std::multimap<S32, S32> attachment_pie_menu_map; + + // gather up all attachment points assigned to this group, and throw into map sorted by pie slice number + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ) + { + attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + if(attachment->getGroup() == group) + { + // use multimap to provide a partial order off of the pie slice key + S32 pie_index = attachment->getPieSlice(); + attachment_pie_menu_map.insert(std::make_pair(pie_index, curiter->first)); + } + } + + // add in requested order to pie menu, inserting separators as necessary + S32 cur_pie_slice = 0; + for (std::multimap<S32, S32>::iterator attach_it = attachment_pie_menu_map.begin(); + attach_it != attachment_pie_menu_map.end(); ++attach_it) + { + S32 requested_pie_slice = attach_it->first; + S32 attach_index = attach_it->second; + while (cur_pie_slice < requested_pie_slice) + { + gAttachBodyPartPieMenus[group]->addSeparator(); + gDetachBodyPartPieMenus[group]->addSeparator(); + cur_pie_slice++; + } + + LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attach_index, (LLViewerJointAttachment*)NULL); + if (attachment) + { + LLMenuItemCallGL::Params item_params; + item_params.name = attachment->getName(); + item_params.label = attachment->getName(); + item_params.on_click.function_name = "Object.AttachToAvatar"; + item_params.on_click.parameter = attach_index; + item_params.on_enable.function_name = "Object.EnableWear"; + item_params.on_enable.parameter = attach_index; + + LLMenuItemCallGL* item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); + gAttachBodyPartPieMenus[group]->addChild(item); + + item_params.on_click.function_name = "Attachment.DetachFromPoint"; + item_params.on_click.parameter = attach_index; + item_params.on_enable.function_name = "Attachment.PointFilled"; + item_params.on_enable.parameter = attach_index; + item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params); + gDetachBodyPartPieMenus[group]->addChild(item); + cur_pie_slice++; + } + } + } + return TRUE; +} + +LLVOAvatarSelf::~LLVOAvatarSelf() +{ + gAgent.setAvatarObject(NULL); + gAgentWearables.setAvatarObject(NULL); + delete mScreenp; + mScreenp = NULL; + + for (localtexture_map_t::iterator iter = mLocalTextureDatas.begin(); + iter != mLocalTextureDatas.end(); + iter++) + { + localtexture_vec_t &local_textures = iter->second; + for (U32 i = 0; i < local_textures.size(); i++) + { + LocalTextureData* loc_tex_data = local_textures[i]; + delete loc_tex_data; + local_textures[i] = NULL; + } + } +} + +/** + ** + ** End LLVOAvatarSelf Constructor routines + ** ** + *********************************************************************************/ + +//virtual +BOOL LLVOAvatarSelf::loadLayersets() +{ + BOOL success = TRUE; + for (LLVOAvatarXmlInfo::layer_info_list_t::const_iterator iter = sAvatarXmlInfo->mLayerInfoList.begin(); + iter != sAvatarXmlInfo->mLayerInfoList.end(); + iter++) + { + // Construct a layerset for each one specified in avatar_lad.xml and initialize it as such. + const LLTexLayerSetInfo *info = *iter; + LLTexLayerSet* layer_set = new LLTexLayerSet( this ); + + if (!layer_set->setInfo(info)) + { + stop_glerror(); + delete layer_set; + llwarns << "avatar file: layer_set->parseData() failed" << llendl; + return FALSE; + } + + // scan baked textures and associate the layerset with the appropriate one + EBakedTextureIndex baked_index = BAKED_NUM_INDICES; + for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); + baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); + baked_iter++) + { + const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second; + if (layer_set->isBodyRegion(baked_dict->mName)) + { + baked_index = baked_iter->first; + // ensure both structures are aware of each other + mBakedTextureDatas[baked_index].mTexLayerSet = layer_set; + layer_set->setBakedTexIndex(baked_index); + break; + } + } + // if no baked texture was found, warn and cleanup + if (baked_index == BAKED_NUM_INDICES) + { + llwarns << "<layer_set> has invalid body_region attribute" << llendl; + delete layer_set; + return FALSE; + } + + // scan morph masks and let any affected layers know they have an associated morph + for (LLVOAvatar::morph_list_t::const_iterator morph_iter = mBakedTextureDatas[baked_index].mMaskedMorphs.begin(); + morph_iter != mBakedTextureDatas[baked_index].mMaskedMorphs.end(); + morph_iter++) + { + LLMaskedMorph *morph = *morph_iter; + LLTexLayer * layer = layer_set->findLayerByName(morph->mLayer); + if (layer) + { + layer->setHasMorph(TRUE); + } + else + { + llwarns << "Could not find layer named " << morph->mLayer << " to set morph flag" << llendl; + success = FALSE; + } + } + } + return success; +} +// virtual +BOOL LLVOAvatarSelf::updateCharacter(LLAgent &agent) +{ + LLMemType mt(LLMemType::MTYPE_AVATAR); + + // update screen joint size + if (mScreenp) + { + F32 aspect = LLViewerCamera::getInstance()->getAspect(); + LLVector3 scale(1.f, aspect, 1.f); + mScreenp->setScale(scale); + mScreenp->updateWorldMatrixChildren(); + resetHUDAttachments(); + } + return LLVOAvatar::updateCharacter(agent); +} + +// virtual +LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) +{ + if (mScreenp) + { + LLJoint* jointp = mScreenp->findJoint(name); + if (jointp) return jointp; + } + return LLVOAvatar::getJoint(name); +} + +// virtual +void LLVOAvatarSelf::requestStopMotion(LLMotion* motion) +{ + // Only agent avatars should handle the stop motion notifications. + + // Notify agent that motion has stopped + gAgent.requestStopMotion(motion); +} + +// virtual +void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id) +{ + for (AnimSourceIterator motion_it = mAnimationSources.find(source_id); motion_it != mAnimationSources.end(); ) + { + gAgent.sendAnimationRequest(motion_it->second, ANIM_REQUEST_STOP); + mAnimationSources.erase(motion_it++); + } + + LLViewerObject* object = gObjectList.findObject(source_id); + if (object) + { + object->mFlags &= ~FLAGS_ANIM_SOURCE; + } +} + +// virtual +void LLVOAvatarSelf::setLocalTextureTE(U8 te, LLViewerImage* image, BOOL set_by_user, U32 index) +{ + if (te >= TEX_NUM_INDICES) + { + llassert(0); + return; + } + + if (getTEImage(te)->getID() == image->getID()) + { + return; + } + + if (isIndexBakedTexture((ETextureIndex)te)) + { + llassert(0); + return; + } + + LLTexLayerSet* layer_set = getLayerSet((ETextureIndex)te); + if (layer_set) + { + invalidateComposite(layer_set, set_by_user); + } + + setTEImage(te, image); + updateMeshTextures(); + + if (gAgent.cameraCustomizeAvatar()) + { + LLVisualParamHint::requestHintUpdates(); + } +} + +//virtual +void LLVOAvatarSelf::removeMissingBakedTextures() +{ + BOOL removed = FALSE; + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + const S32 te = mBakedTextureDatas[i].mTextureIndex; + if (getTEImage(te)->isMissingAsset()) + { + setTEImage(te, gImageList.getImage(IMG_DEFAULT_AVATAR)); + removed = TRUE; + } + } + + if (removed) + { + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + invalidateComposite(mBakedTextureDatas[i].mTexLayerSet, FALSE); + } + updateMeshTextures(); + requestLayerSetUploads(); + } +} + +//virtual +void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) +{ + if (regionp->getHandle() != mLastRegionHandle) + { + if (mLastRegionHandle != 0) + { + ++mRegionCrossingCount; + F64 delta = (F64)mRegionCrossingTimer.getElapsedTimeF32(); + F64 avg = (mRegionCrossingCount == 1) ? 0 : LLViewerStats::getInstance()->getStat(LLViewerStats::ST_CROSSING_AVG); + F64 delta_avg = (delta + avg*(mRegionCrossingCount-1)) / mRegionCrossingCount; + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CROSSING_AVG, delta_avg); + + F64 max = (mRegionCrossingCount == 1) ? 0 : LLViewerStats::getInstance()->getStat(LLViewerStats::ST_CROSSING_MAX); + max = llmax(delta, max); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CROSSING_MAX, max); + } + mLastRegionHandle = regionp->getHandle(); + } + mRegionCrossingTimer.reset(); +} + +//-------------------------------------------------------------------- +// draw tractor beam when editing objects +//-------------------------------------------------------------------- +//virtual +void LLVOAvatarSelf::idleUpdateTractorBeam() +{ + // This is only done for yourself (maybe it should be in the agent?) + if (!needsRenderBeam() || !mIsBuilt) + { + mBeam = NULL; + } + else if (!mBeam || mBeam->isDead()) + { + // VEFFECT: Tractor Beam + mBeam = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM); + mBeam->setColor(LLColor4U(gAgent.getEffectColor())); + mBeam->setSourceObject(this); + mBeamTimer.reset(); + } + + if (!mBeam.isNull()) + { + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); + + if (gAgent.mPointAt.notNull()) + { + // get point from pointat effect + mBeam->setPositionGlobal(gAgent.mPointAt->getPointAtPosGlobal()); + mBeam->triggerLocal(); + } + else if (selection->getFirstRootObject() && + selection->getSelectType() != SELECT_TYPE_HUD) + { + LLViewerObject* objectp = selection->getFirstRootObject(); + mBeam->setTargetObject(objectp); + } + else + { + mBeam->setTargetObject(NULL); + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); + if (tool->isEditing()) + { + if (tool->getEditingObject()) + { + mBeam->setTargetObject(tool->getEditingObject()); + } + else + { + mBeam->setPositionGlobal(tool->getEditingPointGlobal()); + } + } + else + { + const LLPickInfo& pick = gViewerWindow->getLastPick(); + mBeam->setPositionGlobal(pick.mPosGlobal); + } + + } + if (mBeamTimer.getElapsedTimeF32() > 0.25f) + { + mBeam->setColor(LLColor4U(gAgent.getEffectColor())); + mBeam->setNeedsSendToSim(TRUE); + mBeamTimer.reset(); + } + } +} + +//----------------------------------------------------------------------------- +// restoreMeshData() +//----------------------------------------------------------------------------- +// virtual +void LLVOAvatarSelf::restoreMeshData() +{ + LLMemType mt(LLMemType::MTYPE_AVATAR); + + //llinfos << "Restoring" << llendl; + mMeshValid = TRUE; + updateJointLODs(); + updateAttachmentVisibility(gAgent.getCameraMode()); + + // force mesh update as LOD might not have changed to trigger this + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE); +} + + + +//----------------------------------------------------------------------------- +// updateAttachmentVisibility() +//----------------------------------------------------------------------------- +void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode) +{ + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ) + { + attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + if (attachment->getIsHUDAttachment()) + { + attachment->setAttachmentVisibility(TRUE); + } + else + { + switch (camera_mode) + { + case CAMERA_MODE_MOUSELOOK: + if (LLVOAvatar::sVisibleInFirstPerson && attachment->getVisibleInFirstPerson()) + { + attachment->setAttachmentVisibility(TRUE); + } + else + { + attachment->setAttachmentVisibility(FALSE); + } + break; + default: + attachment->setAttachmentVisibility(TRUE); + break; + } + } + } +} + +//----------------------------------------------------------------------------- +// updatedWearable( EWearableType type ) +// forces an update to any baked textures relevant to type. +// Should be called only on saving the wearable +//----------------------------------------------------------------------------- +void LLVOAvatarSelf::wearableUpdated( EWearableType type ) +{ + for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); + baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); + baked_iter++) + { + const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second; + const LLVOAvatarDefines::EBakedTextureIndex index = baked_iter->first; + if (baked_dict) + { + for (LLVOAvatarDefines::wearables_vec_t::const_iterator type_iter = baked_dict->mWearables.begin(); + type_iter != baked_dict->mWearables.end(); + type_iter++) + { + const EWearableType comp_type = *type_iter; + if (comp_type == type) + { + if (mBakedTextureDatas[index].mTexLayerSet) + { + mBakedTextureDatas[index].mTexLayerSet->requestUpdate(); + mBakedTextureDatas[index].mTexLayerSet->requestUpload(); + } + break; + } + } + } + } +} + +//----------------------------------------------------------------------------- +// isWearingAttachment() +//----------------------------------------------------------------------------- +BOOL LLVOAvatarSelf::isWearingAttachment( const LLUUID& inv_item_id ) +{ + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ) + { + attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + if( attachment->getItemID() == inv_item_id ) + { + return TRUE; + } + } + return FALSE; +} + +//----------------------------------------------------------------------------- +// getWornAttachment() +//----------------------------------------------------------------------------- +LLViewerObject* LLVOAvatarSelf::getWornAttachment( const LLUUID& inv_item_id ) const +{ + for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ) + { + attachment_map_t::const_iterator curiter = iter++; + const LLViewerJointAttachment* attachment = curiter->second; + if( attachment->getItemID() == inv_item_id ) + { + return attachment->getObject(); + } + } + return NULL; +} + +const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id) const +{ + for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ) + { + attachment_map_t::const_iterator curiter = iter++; + const LLViewerJointAttachment* attachment = curiter->second; + if( attachment->getItemID() == inv_item_id ) + { + return attachment->getName(); + } + } + + return LLStringUtil::null; +} + +//virtual +LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *viewer_object) +{ + LLViewerJointAttachment *attachment = LLVOAvatar::attachObject(viewer_object); + if (!attachment) + { + return 0; + } + + updateAttachmentVisibility(gAgent.getCameraMode()); + + // Then make sure the inventory is in sync with the avatar. + gInventory.addChangedMask(LLInventoryObserver::LABEL, attachment->getItemID()); + gInventory.notifyObservers(); + + return attachment; +} + +// virtual +void LLVOAvatarSelf::localTextureLoaded(BOOL success, LLViewerImage *src_vi, LLImageRaw* src_raw, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) +{ + //llinfos << "onLocalTextureLoaded: " << src_vi->getID() << llendl; + + const LLUUID& src_id = src_vi->getID(); + LLAvatarTexData *data = (LLAvatarTexData *)userdata; + if (success) + { + ETextureIndex index = data->mIndex; + if (!isIndexLocalTexture(index)) return; + LocalTextureData *local_tex_data = getLocalTextureData(index,0); + if (!local_tex_data->mIsBakedReady && + local_tex_data->mImage.notNull() && + (local_tex_data->mImage->getID() == src_id) && + discard_level < local_tex_data->mDiscard) + { + local_tex_data->mDiscard = discard_level; + if (!gAgent.cameraCustomizeAvatar()) + { + requestLayerSetUpdate(index); + } + else if (gAgent.cameraCustomizeAvatar()) + { + LLVisualParamHint::requestHintUpdates(); + } + updateMeshTextures(); + } + } + else if (final) + { + ETextureIndex index = data->mIndex; + if (!isIndexLocalTexture(index)) return; + LocalTextureData *local_tex_data = getLocalTextureData(index,0); + // Failed: asset is missing + if (!local_tex_data->mIsBakedReady && + local_tex_data->mImage.notNull() && + local_tex_data->mImage->getID() == src_id) + { + local_tex_data->mDiscard = 0; + requestLayerSetUpdate(index); + updateMeshTextures(); + } + } +} + +// virtual +/* //unused +BOOL LLVOAvatarSelf::getLocalTextureRaw(ETextureIndex index, LLImageRaw* image_raw) const +{ + if (!isIndexLocalTexture(index)) return FALSE; + if (getLocalTextureID(index) == IMG_DEFAULT_AVATAR) return TRUE; + + const LocalTextureData *local_tex_data = getLocalTextureData(index)[0]; + if (local_tex_data->mImage->readBackRaw(-1, image_raw, false)) + { + + return TRUE; + } + + // No data loaded yet + setLocalTexture((ETextureIndex)index, getTEImage(index), FALSE); // <-- non-const, move this elsewhere + return FALSE; +} +*/ + +// virtual +BOOL LLVOAvatarSelf::getLocalTextureGL(ETextureIndex type, LLImageGL** image_gl_pp, U32 index) const +{ + *image_gl_pp = NULL; + + if (!isIndexLocalTexture(type)) return FALSE; + if (getLocalTextureID(type, index) == IMG_DEFAULT_AVATAR) return TRUE; + + const LocalTextureData *local_tex_data = getLocalTextureData(type, index); + if (!local_tex_data) + { + return FALSE; + } + *image_gl_pp = local_tex_data->mImage; + return TRUE; +} + +const LLUUID& LLVOAvatarSelf::getLocalTextureID(ETextureIndex type, U32 index) const +{ + if (!isIndexLocalTexture(type)) return IMG_DEFAULT_AVATAR; + + const LocalTextureData *local_tex_data = getLocalTextureData(type,index); + if (local_tex_data && local_tex_data->mImage.notNull()) + { + return local_tex_data->mImage->getID(); + } + return IMG_DEFAULT_AVATAR; +} + +//----------------------------------------------------------------------------- +// isLocalTextureDataAvailable() +// Returns true if at least the lowest quality discard level exists for every texture +// in the layerset. +//----------------------------------------------------------------------------- +BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLTexLayerSet* layerset) const +{ + /* if (layerset == mBakedTextureDatas[BAKED_HEAD].mTexLayerSet) + return getLocalDiscardLevel(TEX_HEAD_BODYPAINT) >= 0; */ + for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); + baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); + baked_iter++) + { + const EBakedTextureIndex baked_index = baked_iter->first; + if (layerset == mBakedTextureDatas[baked_index].mTexLayerSet) + { + BOOL ret = true; + const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second; + for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin(); + local_tex_iter != baked_dict->mLocalTextures.end(); + local_tex_iter++) + { + const ETextureIndex tex_index = *local_tex_iter; + ret &= (getLocalDiscardLevel(tex_index) >= 0); + } + return ret; + } + } + llassert(0); + return FALSE; +} + +//----------------------------------------------------------------------------- +// virtual +// isLocalTextureDataFinal() +// Returns true if the highest quality discard level exists for every texture +// in the layerset. +//----------------------------------------------------------------------------- +BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLTexLayerSet* layerset) const +{ + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + if (layerset == mBakedTextureDatas[i].mTexLayerSet) + { + const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i); + for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin(); + local_tex_iter != baked_dict->mLocalTextures.end(); + local_tex_iter++) + { + if (getLocalDiscardLevel(*local_tex_iter) != 0) + { + return FALSE; + } + } + return TRUE; + } + } + llassert(0); + return FALSE; +} + +BOOL LLVOAvatarSelf::isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 index) const +{ + LLUUID id; + if (isIndexLocalTexture(type)) + { + id = getLocalTextureID(type, index); + } + else + { + id = getTEImage(type)->getID(); + } + + return (id != IMG_DEFAULT_AVATAR && + id != IMG_DEFAULT); +} + +//----------------------------------------------------------------------------- +// virtual +// requestLayerSetUploads() +//----------------------------------------------------------------------------- +void LLVOAvatarSelf::requestLayerSetUploads() +{ + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + BOOL layer_baked = isTextureDefined(mBakedTextureDatas[i].mTextureIndex); + if (!layer_baked && mBakedTextureDatas[i].mTexLayerSet) + { + mBakedTextureDatas[i].mTexLayerSet->requestUpload(); + } + } +} + +bool LLVOAvatarSelf::areTexturesCurrent() const +{ + return !hasPendingBakedUploads() && gAgentWearables.areWearablesLoaded(); +} + +// virtual +bool LLVOAvatarSelf::hasPendingBakedUploads() const +{ + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + BOOL upload_pending = (mBakedTextureDatas[i].mTexLayerSet && mBakedTextureDatas[i].mTexLayerSet->getComposite()->uploadPending()); + if (upload_pending) + { + return true; + } + } + return false; +} + +void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL set_by_user ) +{ + if( !layerset || !layerset->getUpdatesEnabled() ) + { + return; + } + // llinfos << "LLVOAvatar::invalidComposite() " << layerset->getBodyRegion() << llendl; + + invalidateMorphMasks(layerset->getBakedTexIndex()); + layerset->requestUpdate(); + + if( set_by_user ) + { + llassert(isSelf()); + + ETextureIndex baked_te = getBakedTE( layerset ); + setTEImage( baked_te, gImageList.getImage(IMG_DEFAULT_AVATAR) ); + layerset->requestUpload(); + } +} + +void LLVOAvatarSelf::invalidateAll() +{ + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + invalidateComposite(mBakedTextureDatas[i].mTexLayerSet, TRUE); + } + updateMeshTextures(); +} + +//----------------------------------------------------------------------------- +// setCompositeUpdatesEnabled() +//----------------------------------------------------------------------------- +void LLVOAvatarSelf::setCompositeUpdatesEnabled( BOOL b ) +{ + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + if (mBakedTextureDatas[i].mTexLayerSet ) + { + mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled( b ); + } + } +} + +void LLVOAvatarSelf::setupComposites() +{ + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + BOOL layer_baked = isTextureDefined(mBakedTextureDatas[i].mTextureIndex); + if (mBakedTextureDatas[i].mTexLayerSet) + { + mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled(!layer_baked); + } + } +} + +void LLVOAvatarSelf::updateComposites() +{ + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + if (mBakedTextureDatas[i].mTexLayerSet + && ((i != BAKED_SKIRT) || isWearingWearableType(WT_SKIRT))) + { + mBakedTextureDatas[i].mTexLayerSet->updateComposite(); + } + } +} + +// virtual +S32 LLVOAvatarSelf::getLocalDiscardLevel(ETextureIndex type, U32 index) const +{ + if (!isIndexLocalTexture(type)) return FALSE; + + const LocalTextureData *local_tex_data = getLocalTextureData(type,index); + if (local_tex_data) + { + if (type >= 0 + && getLocalTextureID(type,index) != IMG_DEFAULT_AVATAR + && !local_tex_data->mImage->isMissingAsset()) + { + return local_tex_data->mImage->getDiscardLevel(); + } + else + { + // We don't care about this (no image associated with the layer) treat as fully loaded. + return 0; + } + } + return 0; +} + +// virtual +// Counts the memory footprint of local textures. +void LLVOAvatarSelf::getLocalTextureByteCount(S32* gl_bytes) const +{ + *gl_bytes = 0; + for (S32 type = 0; type < TEX_NUM_INDICES; type++) + { + if (!isIndexLocalTexture((ETextureIndex)type)) continue; + const localtexture_vec_t & local_tex_vec = getLocalTextureData((ETextureIndex)type); + for (U32 num = 0; num < local_tex_vec.size(); num++) + { + const LocalTextureData *local_tex_data = local_tex_vec[num]; + if (local_tex_data) + { + const LLViewerImage* image_gl = local_tex_data->mImage; + if (image_gl) + { + S32 bytes = (S32)image_gl->getWidth() * image_gl->getHeight() * image_gl->getComponents(); + + if (image_gl->getHasGLTexture()) + { + *gl_bytes += bytes; + } + } + } + } + } +} + +// virtual +void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerImage* tex, BOOL baked_version_ready, U32 index) +{ + if (!isIndexLocalTexture(type)) return; + + S32 desired_discard = isSelf() ? 0 : 2; + LocalTextureData *local_tex_data = getLocalTextureData(type,index); + if (!baked_version_ready) + { + if (tex != local_tex_data->mImage || local_tex_data->mIsBakedReady) + { + local_tex_data->mDiscard = MAX_DISCARD_LEVEL+1; + } + if (tex->getID() != IMG_DEFAULT_AVATAR) + { + if (local_tex_data->mDiscard > desired_discard) + { + S32 tex_discard = tex->getDiscardLevel(); + if (tex_discard >= 0 && tex_discard <= desired_discard) + { + local_tex_data->mDiscard = tex_discard; + if (isSelf() && !gAgent.cameraCustomizeAvatar()) + { + requestLayerSetUpdate(type); + } + else if (isSelf() && gAgent.cameraCustomizeAvatar()) + { + LLVisualParamHint::requestHintUpdates(); + } + } + else + { + tex->setLoadedCallback(onLocalTextureLoaded, desired_discard, TRUE, FALSE, new LLAvatarTexData(getID(), type)); + } + } + tex->setMinDiscardLevel(desired_discard); + } + } + local_tex_data->mIsBakedReady = baked_version_ready; + local_tex_data->mImage = tex; +} + +// virtual +void LLVOAvatarSelf::dumpLocalTextures() const +{ + llinfos << "Local Textures:" << llendl; + + /* ETextureIndex baked_equiv[] = { + TEX_UPPER_BAKED, + if (isTextureDefined(baked_equiv[i])) */ + for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); + iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); + iter++) + { + const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second; + if (!texture_dict->mIsLocalTexture || !texture_dict->mIsUsedByBakedTexture) + continue; + + const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; + const ETextureIndex baked_equiv = LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex; + + const std::string &name = texture_dict->mName; + const LocalTextureData *local_tex_data = getLocalTextureData(iter->first,0); + if (isTextureDefined(baked_equiv)) + { +#if LL_RELEASE_FOR_DOWNLOAD + // End users don't get to trivially see avatar texture IDs, makes textures + // easier to steal. JC + llinfos << "LocTex " << name << ": Baked " << llendl; +#else + llinfos << "LocTex " << name << ": Baked " << getTEImage(baked_equiv)->getID() << llendl; +#endif + } + else if (local_tex_data->mImage.notNull()) + { + if (local_tex_data->mImage->getID() == IMG_DEFAULT_AVATAR) + { + llinfos << "LocTex " << name << ": None" << llendl; + } + else + { + const LLViewerImage* image = local_tex_data->mImage; + + llinfos << "LocTex " << name << ": " + << "Discard " << image->getDiscardLevel() << ", " + << "(" << image->getWidth() << ", " << image->getHeight() << ") " +#if !LL_RELEASE_FOR_DOWNLOAD + // End users don't get to trivially see avatar texture IDs, + // makes textures easier to steal + << image->getID() << " " +#endif + << "Priority: " << image->getDecodePriority() + << llendl; + } + } + else + { + llinfos << "LocTex " << name << ": No LLViewerImage" << llendl; + } + } +} + +//----------------------------------------------------------------------------- +// static +// onLocalTextureLoaded() +//----------------------------------------------------------------------------- + +void LLVOAvatarSelf::onLocalTextureLoaded(BOOL success, LLViewerImage *src_vi, LLImageRaw* src_raw, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) +{ + LLAvatarTexData *data = (LLAvatarTexData *)userdata; + LLVOAvatarSelf *self = (LLVOAvatarSelf *)gObjectList.findObject(data->mAvatarID); + if (self) + { + // We should only be handling local textures for ourself + self->localTextureLoaded(success, src_vi, src_raw, aux_src, discard_level, final, userdata); + } + // ensure data is cleaned up + if (final || !success) + { + delete data; + } +} + + +const LLVOAvatarSelf::localtexture_vec_t &LLVOAvatarSelf::getLocalTextureData(LLVOAvatarDefines::ETextureIndex type) const +{ + localtexture_map_t::const_iterator found_localtexture = mLocalTextureDatas.find(type); + if (found_localtexture != mLocalTextureDatas.end()) + { + const localtexture_vec_t &local_tex_data = found_localtexture->second; + return local_tex_data; + } + llassert(0); + static localtexture_vec_t ret; + return ret; +} + +const LocalTextureData* LLVOAvatarSelf::getLocalTextureData(LLVOAvatarDefines::ETextureIndex type, U32 index ) const +{ + const localtexture_vec_t &local_tex_array = getLocalTextureData(type); + + if (index >= local_tex_array.size()) + { + return NULL; + } + + return local_tex_array[index]; +} + +LLVOAvatarSelf::localtexture_vec_t &LLVOAvatarSelf::getLocalTextureData(LLVOAvatarDefines::ETextureIndex type) +{ + localtexture_map_t::iterator found_localtexture = mLocalTextureDatas.find(type); + if (found_localtexture != mLocalTextureDatas.end()) + { + localtexture_vec_t &local_tex_data = found_localtexture->second; + return local_tex_data; + } + llassert(0); + static localtexture_vec_t ret; + return ret; +} + +LocalTextureData* LLVOAvatarSelf::getLocalTextureData(LLVOAvatarDefines::ETextureIndex type, U32 index ) +{ + localtexture_vec_t &local_tex_array = getLocalTextureData(type); + + if (index >= local_tex_array.size()) + { + return NULL; + } + + return local_tex_array[index]; +} + +// static +void LLVOAvatarSelf::dumpTotalLocalTextureByteCount() +{ + S32 gl_bytes = 0; + gAgent.getAvatarObject()->getLocalTextureByteCount(&gl_bytes); + llinfos << "Total Avatar LocTex GL:" << (gl_bytes/1024) << "KB" << llendl; +} + +BOOL LLVOAvatarSelf::updateIsFullyLoaded() +{ + BOOL loading = FALSE; + + // do we have a shape? + if (visualParamWeightsAreDefault()) + { + loading = TRUE; + } + + if (!isTextureDefined(TEX_HAIR)) + { + loading = TRUE; + } + + if (!mPreviousFullyLoaded) + { + if (!isLocalTextureDataAvailable(mBakedTextureDatas[BAKED_LOWER].mTexLayerSet) && + (!isTextureDefined(TEX_LOWER_BAKED))) + { + loading = TRUE; + } + + if (!isLocalTextureDataAvailable(mBakedTextureDatas[BAKED_UPPER].mTexLayerSet) && + (!isTextureDefined(TEX_UPPER_BAKED))) + { + loading = TRUE; + } + + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + if (i == BAKED_SKIRT && !isWearingWearableType(WT_SKIRT)) + continue; + + BakedTextureData& texture_data = mBakedTextureDatas[i]; + if (!isTextureDefined(texture_data.mTextureIndex)) + continue; + + // Check for the case that texture is defined but not sufficiently loaded to display anything. + LLViewerImage* baked_img = getImage( texture_data.mTextureIndex ); + if (!baked_img || !baked_img->getHasGLTexture()) + { + loading = TRUE; + } + + } + + } + return processFullyLoadedChange(loading); +} + +const LLUUID& LLVOAvatarSelf::grabLocalTexture(ETextureIndex type, U32 index) const +{ + if (canGrabLocalTexture(type, index)) + { + return getTEImage( type )->getID(); + } + return LLUUID::null; +} + +BOOL LLVOAvatarSelf::canGrabLocalTexture(ETextureIndex type, U32 index) const +{ + // Check if the texture hasn't been baked yet. + if (!isTextureDefined(type)) + { + lldebugs << "getTEImage( " << (U32) type << " )->getID() == IMG_DEFAULT_AVATAR" << llendl; + return FALSE; + } + + if (gAgent.isGodlike()) + return TRUE; + + // Check permissions of textures that show up in the + // baked texture. We don't want people copying people's + // work via baked textures. + /* switch(type) + case TEX_EYES_BAKED: + textures.push_back(TEX_EYES_IRIS); */ + const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(type); + if (!texture_dict->mIsUsedByBakedTexture) return FALSE; + + const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; + const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index); + for (texture_vec_t::const_iterator iter = baked_dict->mLocalTextures.begin(); + iter != baked_dict->mLocalTextures.end(); + iter++) + { + const ETextureIndex t_index = (*iter); + lldebugs << "Checking index " << (U32) t_index << llendl; + const LLUUID& texture_id = getTEImage( t_index )->getID(); + if (texture_id != IMG_DEFAULT_AVATAR) + { + // Search inventory for this texture. + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + LLAssetIDMatches asset_id_matches(texture_id); + gInventory.collectDescendentsIf(LLUUID::null, + cats, + items, + LLInventoryModel::INCLUDE_TRASH, + asset_id_matches); + + BOOL can_grab = FALSE; + lldebugs << "item count for asset " << texture_id << ": " << items.count() << llendl; + if (items.count()) + { + // search for full permissions version + for (S32 i = 0; i < items.count(); i++) + { + LLInventoryItem* itemp = items[i]; + LLPermissions item_permissions = itemp->getPermissions(); + if ( item_permissions.allowOperationBy( + PERM_MODIFY, gAgent.getID(), gAgent.getGroupID()) && + item_permissions.allowOperationBy( + PERM_COPY, gAgent.getID(), gAgent.getGroupID()) && + item_permissions.allowOperationBy( + PERM_TRANSFER, gAgent.getID(), gAgent.getGroupID()) ) + { + can_grab = TRUE; + break; + } + } + } + if (!can_grab) return FALSE; + } + } + + return TRUE; +} + +void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerImage* imagep, + F32 texel_area_ratio, BOOL render_avatar, BOOL covered_by_baked, U32 index ) +{ + if (!isIndexLocalTexture(type)) return; + + if (!covered_by_baked) + { + if (getLocalTextureID(type, index) != IMG_DEFAULT_AVATAR) + { + F32 desired_pixels; + desired_pixels = llmin(mPixelArea, (F32)getTexImageArea()); + imagep->setBoostLevel(getAvatarBoostLevel()); + imagep->addTextureStats( desired_pixels / texel_area_ratio ); + if (imagep->getDiscardLevel() < 0) + { + mHasGrey = TRUE; // for statistics gathering + } + } + else + { + // texture asset is missing + mHasGrey = TRUE; // for statistics gathering + } + } +} + +//----------------------------------------------------------------------------- +// getBakedTE() +// Used by the LayerSet. (Layer sets don't in general know what textures depend on them.) +//----------------------------------------------------------------------------- +ETextureIndex LLVOAvatarSelf::getBakedTE( const LLTexLayerSet* layerset ) const +{ + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + if (layerset == mBakedTextureDatas[i].mTexLayerSet ) + { + return mBakedTextureDatas[i].mTextureIndex; + } + } + llassert(0); + return TEX_HEAD_BAKED; +} + + +//----------------------------------------------------------------------------- +// setNewBakedTexture() +// A new baked texture has been successfully uploaded and we can start using it now. +//----------------------------------------------------------------------------- +void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) +{ + // Baked textures live on other sims. + LLHost target_host = getObjectHost(); + setTEImage( te, gImageList.getImageFromHost( uuid, target_host ) ); + updateMeshTextures(); + dirtyMesh(); + + LLVOAvatar::cullAvatarsByPixelArea(); + + /* switch(te) + case TEX_HEAD_BAKED: + llinfos << "New baked texture: HEAD" << llendl; */ + const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(te); + if (texture_dict->mIsBakedTexture) + { + llinfos << "New baked texture: " << texture_dict->mName << " UUID: " << uuid <<llendl; + } + else + { + llwarns << "New baked texture: unknown te " << te << llendl; + } + + // dumpAvatarTEs( "setNewBakedTexture() send" ); + // RN: throttle uploads + if (!hasPendingBakedUploads()) + { + gAgent.sendAgentSetAppearance(); + } +} + +//----------------------------------------------------------------------------- +// setCachedBakedTexture() +// A baked texture id was received from a cache query, make it active +//----------------------------------------------------------------------------- +void LLVOAvatarSelf::setCachedBakedTexture( ETextureIndex te, const LLUUID& uuid ) +{ + setTETexture( te, uuid ); + + /* switch(te) + case TEX_HEAD_BAKED: + if( mHeadLayerSet ) + mHeadLayerSet->cancelUpload(); */ + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + if ( mBakedTextureDatas[i].mTextureIndex == te && mBakedTextureDatas[i].mTexLayerSet) + { + mBakedTextureDatas[i].mTexLayerSet->cancelUpload(); + } + } +} + +// static +void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**) +{ + LLUUID texture_id; + msg->getUUID("TextureData", "TextureID", texture_id); + + LLVOAvatarSelf* self = gAgent.getAvatarObject(); + if (!self) return; + + // If this is a texture corresponding to one of our baked entries, + // just rebake that layer set. + BOOL found = FALSE; + + /* ETextureIndex baked_texture_indices[BAKED_NUM_INDICES] = + TEX_HEAD_BAKED, + TEX_UPPER_BAKED, */ + for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); + iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); + iter++) + { + const ETextureIndex index = iter->first; + const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second; + if (texture_dict->mIsBakedTexture) + { + if (texture_id == self->getTEImage(index)->getID()) + { + LLTexLayerSet* layer_set = self->getLayerSet(index); + if (layer_set) + { + llinfos << "TAT: rebake - matched entry " << (S32)index << llendl; + // Apparently set_by_user == force upload + BOOL set_by_user = TRUE; + self->invalidateComposite(layer_set, set_by_user); + found = TRUE; + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); + } + } + } + } + + // If texture not found, rebake all entries. + if (!found) + { + self->forceBakeAllTextures(); + } + else + { + // Not sure if this is necessary, but forceBakeAllTextures() does it. + self->updateMeshTextures(); + } +} + +void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) +{ + llinfos << "TAT: forced full rebake. " << llendl; + + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) + { + ETextureIndex baked_index = mBakedTextureDatas[i].mTextureIndex; + LLTexLayerSet* layer_set = getLayerSet(baked_index); + if (layer_set) + { + if (slam_for_debug) + { + layer_set->setUpdatesEnabled(TRUE); + layer_set->cancelUpload(); + } + + BOOL set_by_user = TRUE; + invalidateComposite(layer_set, set_by_user); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); + } + else + { + llwarns << "TAT: NO LAYER SET FOR " << (S32)baked_index << llendl; + } + } + + // Don't know if this is needed + updateMeshTextures(); +} + +//----------------------------------------------------------------------------- +// requestLayerSetUpdate() +//----------------------------------------------------------------------------- +void LLVOAvatarSelf::requestLayerSetUpdate(ETextureIndex index ) +{ + /* switch(index) + case LOCTEX_UPPER_BODYPAINT: + case LOCTEX_UPPER_SHIRT: + if( mUpperBodyLayerSet ) + mUpperBodyLayerSet->requestUpdate(); */ + const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(index); + if (!texture_dict->mIsLocalTexture || !texture_dict->mIsUsedByBakedTexture) + return; + const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; + if (mBakedTextureDatas[baked_index].mTexLayerSet) + { + mBakedTextureDatas[baked_index].mTexLayerSet->requestUpdate(); + } +} + +LLTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const +{ + /* switch(index) + case TEX_HEAD_BAKED: + case TEX_HEAD_BODYPAINT: + return mHeadLayerSet; */ + const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(index); + if (texture_dict->mIsUsedByBakedTexture) + { + const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; + return mBakedTextureDatas[baked_index].mTexLayerSet; + } + return NULL; +} + +// static +void LLVOAvatarSelf::onCustomizeStart() +{ + // We're no longer doing any baking or invalidating on entering + // appearance editing mode. Leaving function in place in case + // further changes require us to do something at this point - Nyx +} + +// static +void LLVOAvatarSelf::onCustomizeEnd() +{ + LLVOAvatarSelf *avatarp = gAgent.getAvatarObject(); + if (avatarp) + { + avatarp->invalidateAll(); + avatarp->requestLayerSetUploads(); + } +} + +// static +void LLVOAvatarSelf::onChangeSelfInvisible(BOOL newvalue) +{ + LLVOAvatarSelf *avatarp = gAgent.getAvatarObject(); + if (avatarp) + { + if (newvalue) + { + // we have just requested to set the avatar's baked textures to invisible + avatarp->setInvisible(TRUE); + } + else + { + avatarp->setInvisible(FALSE); + } + } +} + +void LLVOAvatarSelf::setInvisible(BOOL newvalue) +{ + if (newvalue) + { + setCompositeUpdatesEnabled(FALSE); + for (U32 i = 0; i < mBakedTextureDatas.size(); i++ ) + { + setNewBakedTexture(mBakedTextureDatas[i].mTextureIndex, IMG_INVISIBLE); + } + gAgent.sendAgentSetAppearance(); + } + else + { + setCompositeUpdatesEnabled(TRUE); + invalidateAll(); + requestLayerSetUploads(); + gAgent.sendAgentSetAppearance(); + } +} + +//------------------------------------------------------------------------ +// needsRenderBeam() +//------------------------------------------------------------------------ +BOOL LLVOAvatarSelf::needsRenderBeam() +{ + if (gNoRender) + { + return FALSE; + } + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); + + BOOL is_touching_or_grabbing = (tool == LLToolGrab::getInstance() && LLToolGrab::getInstance()->isEditing()); + if (LLToolGrab::getInstance()->getEditingObject() && + LLToolGrab::getInstance()->getEditingObject()->isAttachment()) + { + // don't render selection beam on hud objects + is_touching_or_grabbing = FALSE; + } + return is_touching_or_grabbing || (mState & AGENT_STATE_EDITING && LLSelectMgr::getInstance()->shouldShowSelection()); +} + +// static +void LLVOAvatarSelf::deleteScratchTextures() +{ + for( LLGLuint* namep = sScratchTexNames.getFirstData(); + namep; + namep = sScratchTexNames.getNextData() ) + { + LLImageGL::deleteTextures(1, (U32 *)namep ); + stop_glerror(); + } + + if( sScratchTexBytes ) + { + lldebugs << "Clearing Scratch Textures " << (sScratchTexBytes/1024) << "KB" << llendl; + + sScratchTexNames.deleteAllData(); + sScratchTexLastBindTime.deleteAllData(); + LLImageGL::sGlobalTextureMemoryInBytes -= sScratchTexBytes; + sScratchTexBytes = 0; + } +} + +BOOL LLVOAvatarSelf::bindScratchTexture( LLGLenum format ) +{ + U32 texture_bytes = 0; + GLuint gl_name = getScratchTexName( format, &texture_bytes ); + if( gl_name ) + { + gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, gl_name); + stop_glerror(); + + F32* last_bind_time = sScratchTexLastBindTime.getIfThere( format ); + if( last_bind_time ) + { + if( *last_bind_time != LLImageGL::sLastFrameTime ) + { + *last_bind_time = LLImageGL::sLastFrameTime; + LLImageGL::updateBoundTexMem(texture_bytes); + } + } + else + { + LLImageGL::updateBoundTexMem(texture_bytes); + sScratchTexLastBindTime.addData( format, new F32(LLImageGL::sLastFrameTime) ); + } + return TRUE; + } + return FALSE; +} + +LLGLuint LLVOAvatarSelf::getScratchTexName( LLGLenum format, U32* texture_bytes ) +{ + S32 components; + GLenum internal_format; + switch( format ) + { + case GL_LUMINANCE: components = 1; internal_format = GL_LUMINANCE8; break; + case GL_ALPHA: components = 1; internal_format = GL_ALPHA8; break; + case GL_COLOR_INDEX: components = 1; internal_format = GL_COLOR_INDEX8_EXT; break; + case GL_LUMINANCE_ALPHA: components = 2; internal_format = GL_LUMINANCE8_ALPHA8; break; + case GL_RGB: components = 3; internal_format = GL_RGB8; break; + case GL_RGBA: components = 4; internal_format = GL_RGBA8; break; + default: llassert(0); components = 4; internal_format = GL_RGBA8; break; + } + + *texture_bytes = components * SCRATCH_TEX_WIDTH * SCRATCH_TEX_HEIGHT; + + if( sScratchTexNames.checkData( format ) ) + { + return *( sScratchTexNames.getData( format ) ); + } + + LLGLSUIDefault gls_ui; + + U32 name = 0; + LLImageGL::generateTextures(1, &name ); + stop_glerror(); + + gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, name); + stop_glerror(); + + LLImageGL::setManualImage( + GL_TEXTURE_2D, 0, internal_format, + SCRATCH_TEX_WIDTH, SCRATCH_TEX_HEIGHT, + format, GL_UNSIGNED_BYTE, NULL ); + stop_glerror(); + + gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); + gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); + stop_glerror(); + + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + stop_glerror(); + + sScratchTexNames.addData( format, new LLGLuint( name ) ); + + sScratchTexBytes += *texture_bytes; + LLImageGL::sGlobalTextureMemoryInBytes += *texture_bytes; + return name; +} + +// static +void LLVOAvatarSelf::dumpScratchTextureByteCount() +{ + llinfos << "Scratch Texture GL: " << (sScratchTexBytes/1024) << "KB" << llendl; +} diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h new file mode 100644 index 0000000000000000000000000000000000000000..431c814382b8ec8d3f299fb478992218e5dd07b9 --- /dev/null +++ b/indra/newview/llvoavatarself.h @@ -0,0 +1,321 @@ +/** + * @file llvoavatarself.h + * @brief Declaration of LLVOAvatar class which is a derivation fo + * LLViewerObject + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLVOAVATARSELF_H +#define LL_LLVOAVATARSELF_H + +#include "llvoavatar.h" + +struct LocalTextureData; + +//------------------------------------------------------------------------ +// LLVOAvatarSelf +//------------------------------------------------------------------------ +class LLVOAvatarSelf : + public LLVOAvatar +{ + +/******************************************************************************** + ** ** + ** INITIALIZATION + **/ + +public: + LLVOAvatarSelf(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); + virtual ~LLVOAvatarSelf(); + virtual void markDead(); +protected: + BOOL loadAvatarSelf(); + BOOL buildSkeletonSelf(const LLVOAvatarSkeletonInfo *info); + BOOL buildMenus(); + /*virtual*/ BOOL loadLayersets(); + +/** Initialization + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** INHERITED + **/ + + //-------------------------------------------------------------------- + // LLViewerObject interface and related + //-------------------------------------------------------------------- +public: + /*virtual*/ void updateRegion(LLViewerRegion *regionp); + + //-------------------------------------------------------------------- + // LLCharacter interface and related + //-------------------------------------------------------------------- +public: + /*virtual*/ void stopMotionFromSource(const LLUUID& source_id); + /*virtual*/ void requestStopMotion(LLMotion* motion); + /*virtual*/ LLJoint* getJoint(const std::string &name); + +/** Initialization + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** STATE + **/ + +public: + /*virtual*/ bool isSelf() const { return true; } + + //-------------------------------------------------------------------- + // Updates + //-------------------------------------------------------------------- +public: + /*virtual*/ BOOL updateCharacter(LLAgent &agent); + /*virtual*/ void idleUpdateTractorBeam(); + + //-------------------------------------------------------------------- + // Loading state + //-------------------------------------------------------------------- +public: + /*virtual*/ BOOL updateIsFullyLoaded(); +private: + BOOL mIsBaked; // are the stored baked textures up to date? + + //-------------------------------------------------------------------- + // Region state + //-------------------------------------------------------------------- +private: + U64 mLastRegionHandle; + LLFrameTimer mRegionCrossingTimer; + S32 mRegionCrossingCount; + +/** State + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** RENDERING + **/ + + //-------------------------------------------------------------------- + // Render beam + //-------------------------------------------------------------------- +protected: + BOOL needsRenderBeam(); +private: + LLPointer<LLHUDEffectSpiral> mBeam; + LLFrameTimer mBeamTimer; + + //-------------------------------------------------------------------- + // LLVOAvatar Constants + //-------------------------------------------------------------------- +public: + /*virtual*/ LLViewerImage::EBoostLevel getAvatarBoostLevel() const { return LLViewerImage::BOOST_AVATAR_SELF; } + /*virtual*/ LLViewerImage::EBoostLevel getAvatarBakedBoostLevel() const { return LLViewerImage::BOOST_AVATAR_BAKED_SELF; } + /*virtual*/ S32 getTexImageSize() const { return LLVOAvatar::getTexImageSize()*4; } + +/** Rendering + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** TEXTURES + **/ + + //-------------------------------------------------------------------- + // Loading status + //-------------------------------------------------------------------- +public: + /*virtual*/ bool hasPendingBakedUploads() const; + S32 getLocalDiscardLevel(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; + bool areTexturesCurrent() const; + BOOL isLocalTextureDataAvailable(const LLTexLayerSet* layerset) const; + BOOL isLocalTextureDataFinal(const LLTexLayerSet* layerset) const; + /*virtual*/ BOOL isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; + + //-------------------------------------------------------------------- + // Local Textures + //-------------------------------------------------------------------- +public: + BOOL getLocalTextureGL(LLVOAvatarDefines::ETextureIndex type, LLImageGL** image_gl_pp, U32 index = 0) const; + const LLUUID& getLocalTextureID(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; + void setLocalTextureTE(U8 te, LLViewerImage* image, BOOL set_by_user, U32 index = 0); + const LLUUID& grabLocalTexture(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; + BOOL canGrabLocalTexture(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; +protected: + /*virtual*/ void setLocalTexture(LLVOAvatarDefines::ETextureIndex type, LLViewerImage* tex, BOOL baked_version_exits, U32 index = 0); + void localTextureLoaded(BOOL succcess, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); + void getLocalTextureByteCount(S32* gl_byte_count) const; + /*virtual*/ void addLocalTextureStats(LLVOAvatarDefines::ETextureIndex i, LLViewerImage* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked, U32 index = 0); +private: + static void onLocalTextureLoaded(BOOL succcess, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); + + //-------------------------------------------------------------------- + // Baked textures + //-------------------------------------------------------------------- +public: + LLVOAvatarDefines::ETextureIndex getBakedTE(const LLTexLayerSet* layerset ) const; + void setNewBakedTexture(LLVOAvatarDefines::ETextureIndex i, const LLUUID& uuid); + void setCachedBakedTexture(LLVOAvatarDefines::ETextureIndex i, const LLUUID& uuid); + void forceBakeAllTextures(bool slam_for_debug = false); + static void processRebakeAvatarTextures(LLMessageSystem* msg, void**); +protected: + /*virtual*/ void removeMissingBakedTextures(); + + //-------------------------------------------------------------------- + // Layers + //-------------------------------------------------------------------- +public: + void requestLayerSetUploads(); + void requestLayerSetUpdate(LLVOAvatarDefines::ETextureIndex i); +protected: + LLTexLayerSet* getLayerSet(LLVOAvatarDefines::ETextureIndex index) const; + + //-------------------------------------------------------------------- + // Composites + //-------------------------------------------------------------------- +public: + /* virtual */ void invalidateComposite(LLTexLayerSet* layerset, BOOL set_by_user); + /* virtual */ void invalidateAll(); + /* virtual */ void setCompositeUpdatesEnabled(BOOL b); // only works for self + void setupComposites(); + void updateComposites(); + + //-------------------------------------------------------------------- + // Scratch textures (used for compositing) + //-------------------------------------------------------------------- +public: + BOOL bindScratchTexture(LLGLenum format); + static void deleteScratchTextures(); +protected: + LLGLuint getScratchTexName(LLGLenum format, U32* texture_bytes); +private: + static S32 sScratchTexBytes; + static LLMap< LLGLenum, LLGLuint*> sScratchTexNames; + static LLMap< LLGLenum, F32*> sScratchTexLastBindTime; + + //-------------------------------------------------------------------- + // Texture Data + //-------------------------------------------------------------------- +private: + typedef std::vector<LocalTextureData*> localtexture_vec_t; // all textures of a certain TE + typedef std::map<LLVOAvatarDefines::ETextureIndex, localtexture_vec_t> localtexture_map_t; // texture TE vectors arranged by texture type + localtexture_map_t mLocalTextureDatas; + + const localtexture_vec_t& getLocalTextureData(LLVOAvatarDefines::ETextureIndex index) const; // const accessor into mLocalTextureDatas + const LocalTextureData* getLocalTextureData(LLVOAvatarDefines::ETextureIndex type, U32 index) const; // const accessor to individual LocalTextureData + + localtexture_vec_t& getLocalTextureData(LLVOAvatarDefines::ETextureIndex index); // accessor into mLocalTextureDatas + LocalTextureData* getLocalTextureData(LLVOAvatarDefines::ETextureIndex type, U32 index); // accessor to individual LocalTextureData + +/** Textures + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** MESHES + **/ +protected: + /*virtual*/ void restoreMeshData(); + +/** Meshes + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** WEARABLES + **/ + +public: + void wearableUpdated(EWearableType type); + + //-------------------------------------------------------------------- + // Attachments + //-------------------------------------------------------------------- +public: + void updateAttachmentVisibility(U32 camera_mode); + BOOL isWearingAttachment(const LLUUID& inv_item_id); + LLViewerObject* getWornAttachment(const LLUUID& inv_item_id ) const; + const std::string getAttachedPointName(const LLUUID& inv_item_id) const; + /*virtual*/ LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object); + + //-------------------------------------------------------------------- + // HUDs + //-------------------------------------------------------------------- +private: + LLViewerJoint* mScreenp; // special purpose joint for HUD attachments + +/** Attachments + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** APPEARANCE + **/ + +public: + static void onCustomizeStart(); + static void onCustomizeEnd(); + + //-------------------------------------------------------------------- + // Visibility + //-------------------------------------------------------------------- +public: + static void onChangeSelfInvisible(BOOL newvalue); + void setInvisible(BOOL newvalue); + +/** Appearance + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** DIAGNOSTICS + **/ + +public: + static void dumpTotalLocalTextureByteCount(); + void dumpLocalTextures() const; + static void dumpScratchTextureByteCount(); + +/** Diagnostics + ** ** + *******************************************************************************/ + +}; + +#endif // LL_VO_AVATARSELF_H diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index fe4a2fdc768ef77a05b1a587ccc5d1665f224b09..a956ec8ab34d98b55f6851a8dfbed80e5c1cc09e 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -165,16 +165,6 @@ void LLVOGrass::initClass() grass_def->getFastAttributeUUID(texture_id_string, id); newGrass->mTextureID = id; - if (newGrass->mTextureID.isNull()) - { - std::string textureName; - - static LLStdStringHandle texture_name_string = LLXmlTree::addAttributeString("texture_name"); - success &= grass_def->getFastAttributeString(texture_name_string, textureName); - LLViewerImage* grass_image = gImageList.getImageFromFile(textureName); - newGrass->mTextureID = grass_image->getID(); - } - static LLStdStringHandle blade_sizex_string = LLXmlTree::addAttributeString("blade_size_x"); success &= grass_def->getFastAttributeF32(blade_sizex_string, F32_val); newGrass->mBladeSizeX = F32_val; diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 94407ed08ceb23c905efb54cbb2f9c8ccdfa11ed..082dcb50a2f3bf7003e429963ab1b745f9d02996 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -62,6 +62,7 @@ #include "llfirstuse.h" #include "llviewerwindow.h" #include "llviewercamera.h" +#include "llvoavatarself.h" #include "llfloaterfriends.h" //VIVOX, inorder to refresh communicate panel #include "llfloaterchat.h" // for LLFloaterChat::addChat() @@ -1103,58 +1104,61 @@ static void killGateway() /////////////////////////////////////////////////////////////////////////////////////////////// -LLVoiceClient::LLVoiceClient() -{ - gVoiceClient = this; - mWriteInProgress = false; - mAreaVoiceDisabled = false; - mPTT = true; - mUserPTTState = false; - mMuteMic = false; - mSessionTerminateRequested = false; - mRelogRequested = false; - mCommandCookie = 0; - mCurrentParcelLocalID = 0; - mLoginRetryCount = 0; - - mSpeakerVolume = 0; - mMicVolume = 0; - - mAudioSession = NULL; - mAudioSessionChanged = false; - - // Initial dirty state - mSpatialCoordsDirty = false; - mPTTDirty = true; - mFriendsListDirty = true; - mSpeakerVolumeDirty = true; - mMicVolumeDirty = true; - mBuddyListMapPopulated = false; - mBlockRulesListReceived = false; - mAutoAcceptRulesListReceived = false; - mCaptureDeviceDirty = false; - mRenderDeviceDirty = false; - - // Use default values for everything then call updateSettings() after preferences are loaded - mVoiceEnabled = false; - mUsePTT = true; - mPTTIsToggle = false; - mEarLocation = 0; - mLipSyncEnabled = false; +LLVoiceClient::LLVoiceClient() : + mState(stateDisabled), + mSessionTerminateRequested(false), + mRelogRequested(false), + mConnected(false), + mPump(NULL), + + mTuningMode(false), + mTuningEnergy(0.0f), + mTuningMicVolume(0), + mTuningMicVolumeDirty(true), + mTuningSpeakerVolume(0), + mTuningSpeakerVolumeDirty(true), + mTuningExitState(stateDisabled), + + mAreaVoiceDisabled(false), + mAudioSession(NULL), + mAudioSessionChanged(false), + mNextAudioSession(NULL), + + mCurrentParcelLocalID(0), + mNumberOfAliases(0), + mCommandCookie(0), + mLoginRetryCount(0), + + mBuddyListMapPopulated(false), + mBlockRulesListReceived(false), + mAutoAcceptRulesListReceived(false), + mCaptureDeviceDirty(false), + mRenderDeviceDirty(false), + mSpatialCoordsDirty(false), + + mPTTDirty(true), + mPTT(true), + mUsePTT(true), + mPTTIsMiddleMouse(false), + mPTTKey(0), + mPTTIsToggle(false), + mUserPTTState(false), + mMuteMic(false), + mFriendsListDirty(true), + + mEarLocation(0), + mSpeakerVolumeDirty(true), + mSpeakerMuteDirty(true), + mSpeakerVolume(0), + mMicVolume(0), + mMicVolumeDirty(true), - mTuningMode = false; - mTuningEnergy = 0.0f; - mTuningMicVolume = 0; - mTuningMicVolumeDirty = true; - mTuningSpeakerVolume = 0; - mTuningSpeakerVolumeDirty = true; - - // gMuteListp isn't set up at this point, so we defer this until later. -// gMuteListp->addObserver(&mutelist_listener); + mVoiceEnabled(false), + mWriteInProgress(false), - // stash the pump for later use - // This now happens when init() is called instead. - mPump = NULL; + mLipSyncEnabled(false) +{ + gVoiceClient = this; #if LL_DARWIN || LL_LINUX || LL_SOLARIS // HACK: THIS DOES NOT BELONG HERE @@ -5773,6 +5777,11 @@ void LLVoiceClient::setMuteMic(bool muted) mMuteMic = muted; } +bool LLVoiceClient::getMuteMic() const +{ + return mMuteMic; +} + void LLVoiceClient::setUserPTTState(bool ptt) { mUserPTTState = ptt; @@ -6901,11 +6910,11 @@ void LLVoiceClient::notifyFriendObservers() void LLVoiceClient::lookupName(const LLUUID &id) { - gCacheName->getName(id, onAvatarNameLookup); + gCacheName->get(id, FALSE, &LLVoiceClient::onAvatarNameLookup); } //static -void LLVoiceClient::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* user_data) +void LLVoiceClient::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) { if(gVoiceClient) { diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index cfc336b27db9ed5dd013dae7b09b1ffbbcbe774d..1066ac73f13992f3e4c797a2589e81675d934443 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -178,6 +178,7 @@ static void updatePosition(void); void setMuteMic(bool muted); // Use this to mute the local mic (for when the client is minimized, etc), ignoring user PTT state. + bool getMuteMic() const; void setUserPTTState(bool ptt); bool getUserPTTState(); void toggleUserPTTState(void); @@ -461,7 +462,7 @@ static void updatePosition(void); void removeObserver(LLFriendObserver* observer); void lookupName(const LLUUID &id); - static void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* user_data); + static void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); void avatarNameResolved(const LLUUID &id, const std::string &name); typedef std::vector<std::string> deviceList; @@ -727,7 +728,6 @@ static std::string nameFromsipURI(const std::string &uri); bool mVoiceEnabled; bool mWriteInProgress; std::string mWriteString; - size_t mWriteOffset; LLTimer mUpdateTimer; diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp index 5606398aaf346077ac81b34f3a52db9320d258a8..a361a1160c48a2a4962dcbece85196b69689a36a 100644 --- a/indra/newview/llvoicevisualizer.cpp +++ b/indra/newview/llvoicevisualizer.cpp @@ -131,13 +131,13 @@ LLVoiceVisualizer::LLVoiceVisualizer( const U8 type ) const char* sound_level_img[] = { - "041ee5a0-cb6a-9ac5-6e49-41e9320507d5.j2c", - "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", - "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", - "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", - "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", - "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", - "29de489d-0491-fb00-7dab-f9e686d31e83.j2c" + "voice_meter_dot.j2c", + "voice_meter_rings.j2c", + "voice_meter_rings.j2c", + "voice_meter_rings.j2c", + "voice_meter_rings.j2c", + "voice_meter_rings.j2c", + "voice_meter_rings.j2c" }; for (int i=0; i<NUM_VOICE_SYMBOL_WAVES; i++) @@ -157,12 +157,12 @@ LLVoiceVisualizer::LLVoiceVisualizer( const U8 type ) setPreferences(); // Set up our listener to get updates on all prefs values we care about. - gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _1)); - gSavedSettings.getControl("LipSyncOohAahRate")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _1)); - gSavedSettings.getControl("LipSyncOoh")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _1)); - gSavedSettings.getControl("LipSyncAah")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _1)); - gSavedSettings.getControl("LipSyncOohPowerTransfer")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _1)); - gSavedSettings.getControl("LipSyncAahPowerTransfer")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _1)); + gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2)); + gSavedSettings.getControl("LipSyncOohAahRate")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2)); + gSavedSettings.getControl("LipSyncOoh")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2)); + gSavedSettings.getControl("LipSyncAah")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2)); + gSavedSettings.getControl("LipSyncOohPowerTransfer")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2)); + gSavedSettings.getControl("LipSyncAahPowerTransfer")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2)); sPrefsInitialized = true; } diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index c3366cad90fe5c8cfe919921a692474d0352178a..d99758edf81496340626200ca8aa99766878b4b0 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -368,7 +368,7 @@ LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) initSunDirection(mSunDefaultPosition, LLVector3(0, 0, 0)); } mAmbientScale = gSavedSettings.getF32("SkyAmbientScale"); - mNightColorShift = gSavedSettings.getColor3("SkyNightColorShift"); + mNightColorShift = gSavedSkinSettings.getColor3("SkyNightColorShift"); mFogColor.mV[VRED] = mFogColor.mV[VGREEN] = mFogColor.mV[VBLUE] = 0.5f; mFogColor.mV[VALPHA] = 0.0f; mFogRatio = 1.2f; @@ -1197,8 +1197,6 @@ LLDrawable *LLVOSky::createDrawable(LLPipeline *pipeline) LLDrawPoolSky *poolp = (LLDrawPoolSky*) gPipeline.getPool(LLDrawPool::POOL_SKY); poolp->setSkyTex(mSkyTex); - poolp->setSun(&mSun); - poolp->setMoon(&mMoon); mDrawable->setRenderType(LLPipeline::RENDER_TYPE_SKY); for (S32 i = 0; i < 6; ++i) @@ -1215,7 +1213,7 @@ LLDrawable *LLVOSky::createDrawable(LLPipeline *pipeline) //by bao //fake vertex buffer updating -//to guaranttee at least updating one VBO buffer every frame +//to guarantee at least updating one VBO buffer every frame //to walk around the bug caused by ATI card --> DEV-3855 // void LLVOSky::createDummyVertexBuffer() diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 3fd5054fd1143a46b17403b29bb5039c74579bff..b602b930256443dab9611ecd801e86e7f5c8e513 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -55,7 +55,7 @@ #include "noise.h" #include "pipeline.h" #include "llspatialpartition.h" -#include "llviewerwindow.h" +#include "llnotifications.h" extern LLPipeline gPipeline; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8f11661b3072d57ba4c14d17e353ab55b3c75a5a..aff8fe8f1d77e5d3ebf32eabd305cc4d10f98a60 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -72,7 +72,7 @@ const F32 FORCE_CULL_AREA = 8.f; const S32 MAX_SCULPT_REZ = 128; BOOL gAnimateTextures = TRUE; -extern BOOL gHideSelectedObjects; +//extern BOOL gHideSelectedObjects; F32 LLVOVolume::sLODFactor = 1.f; F32 LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop @@ -512,6 +512,7 @@ void LLVOVolume::updateTextures() mSculptTexture->addTextureStats(2.f * tex_size * tex_size); mSculptTexture->setBoostLevel(llmax((S32)mSculptTexture->getBoostLevel(), (S32)LLViewerImage::BOOST_SCULPTED)); + mSculptTexture->setForSculpt() ; } S32 texture_discard = mSculptTexture->getDiscardLevel(); //try to match the texture @@ -653,7 +654,8 @@ LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline) } updateRadius(); - mDrawable->updateDistance(*LLViewerCamera::getInstance()); + bool force_update = true; // avoid non-alpha mDistance update being optimized away + mDrawable->updateDistance(*LLViewerCamera::getInstance(), force_update); return mDrawable; } @@ -780,6 +782,11 @@ void LLVOVolume::sculpt() sculpt_width = 0; sculpt_height = 0; sculpt_data = NULL ; + + if(LLViewerImage::sTesterp) + { + LLViewerImage::sTesterp->updateGrayTextureBinding(); + } } else { @@ -788,6 +795,11 @@ void LLVOVolume::sculpt() << " < " << sculpt_height << " x " << sculpt_width << " x " <<sculpt_components << llendl; sculpt_data = raw_image->getData(); + + if(LLViewerImage::sTesterp) + { + mSculptTexture->updateBindStats() ; + } } getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level); } @@ -1271,15 +1283,28 @@ S32 LLVOVolume::setTEColor(const U8 te, const LLColor3& color) S32 LLVOVolume::setTEColor(const U8 te, const LLColor4& color) { - S32 res = LLViewerObject::setTEColor(te, color); - if (res && mDrawable.notNull()) + S32 retval = 0; + const LLTextureEntry *tep = getTE(te); + if (!tep) { - //gPipeline.markTextured(mDrawable); - mDrawable->setState(LLDrawable::REBUILD_COLOR); - dirtyMesh(); - //mFaceMappingChanged = TRUE; + llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl; } - return res; + else if (color != tep->getColor()) + { + if (color.mV[3] != tep->getColor().mV[3]) + { + gPipeline.markTextured(mDrawable); + } + retval = LLPrimitive::setTEColor(te, color); + if (mDrawable.notNull() && retval) + { + // These should only happen on updates which are not the initial update. + mDrawable->setState(LLDrawable::REBUILD_COLOR); + dirtyMesh(); + } + } + + return retval; } S32 LLVOVolume::setTEBumpmap(const U8 te, const U8 bumpmap) @@ -1304,6 +1329,17 @@ S32 LLVOVolume::setTETexGen(const U8 te, const U8 texgen) return res; } +S32 LLVOVolume::setTEMediaTexGen(const U8 te, const U8 media) +{ + S32 res = LLViewerObject::setTEMediaTexGen(te, media); + if (res) + { + gPipeline.markTextured(mDrawable); + mFaceMappingChanged = TRUE; + } + return res; +} + S32 LLVOVolume::setTEShiny(const U8 te, const U8 shiny) { S32 res = LLViewerObject::setTEShiny(te, shiny); @@ -1326,6 +1362,17 @@ S32 LLVOVolume::setTEFullbright(const U8 te, const U8 fullbright) return res; } +S32 LLVOVolume::setTEBumpShinyFullbright(const U8 te, const U8 bump) +{ + S32 res = LLViewerObject::setTEBumpShinyFullbright(te, bump); + if (res) + { + gPipeline.markTextured(mDrawable); + mFaceMappingChanged = TRUE; + } + return res; +} + S32 LLVOVolume::setTEMediaFlags(const U8 te, const U8 media_flags) { S32 res = LLViewerObject::setTEMediaFlags(te, media_flags); @@ -1941,10 +1988,9 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& e LLVector3* intersection,LLVector2* tex_coord, LLVector3* normal, LLVector3* bi_normal) { - if (!mbCanSelect || - (gHideSelectedObjects && isSelected()) || - mDrawable->isDead() || - !gPipeline.hasRenderType(mDrawable->getRenderType())) + if (!mbCanSelect + || mDrawable->isDead() + || !gPipeline.hasRenderType(mDrawable->getRenderType())) { return FALSE; } @@ -2084,7 +2130,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, { LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - if (facep->getViewerObject()->isSelected() && gHideSelectedObjects) + if (facep->getViewerObject()->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) { return; } @@ -2812,7 +2858,7 @@ LLHUDPartition::LLHUDPartition() mPartitionType = LLViewerRegion::PARTITION_HUD; mDrawableType = LLPipeline::RENDER_TYPE_HUD; mSlopRatio = 0.f; - mLODPeriod = 16; + mLODPeriod = 1; } void LLHUDPartition::shift(const LLVector3 &offset) diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index f705531723d55fc698eb6ff1f9e91d860dfa81bc..1e35a31cb6c57b10965b48307149073a6b82dde2 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -32,92 +32,27 @@ #include "llviewerprecompiledheaders.h" -#include "imageids.h" -#include "llassetstorage.h" -#include "lldbstrings.h" -#include "lldir.h" -#include "llquantize.h" - #include "llagent.h" -#include "llassetuploadresponders.h" -#include "llviewerwindow.h" +#include "llagentwearables.h" #include "llfloatercustomize.h" -#include "llinventorymodel.h" #include "llviewerimagelist.h" -#include "llviewerinventory.h" +#include "llinventorymodel.h" #include "llviewerregion.h" #include "llvoavatar.h" +#include "llvoavatarself.h" +#include "llvoavatardefines.h" #include "llwearable.h" +#include "lldictionary.h" +#include "lltrans.h" using namespace LLVOAvatarDefines; // static S32 LLWearable::sCurrentDefinitionVersion = 1; -// static -const std::string LLWearable::sTypeName[ WT_COUNT+1 ] = -{ - "shape", - "skin", - "hair", - "eyes", - "shirt", - "pants", - "shoes", - "socks", - "jacket", - "gloves", - "undershirt", - "underpants", - "skirt", - "invalid" -}; - -// static -const std::string LLWearable::sTypeLabel[ WT_COUNT+1 ] = -{ - "Shape", - "Skin", - "Hair", - "Eyes", - "Shirt", - "Pants", - "Shoes", - "Socks", - "Jacket", - "Gloves", - "Undershirt", - "Underpants", - "Skirt", - "invalid" -}; - - -// static -LLAssetType::EType LLWearable::typeToAssetType(EWearableType wearable_type) -{ - switch( wearable_type ) - { - case WT_SHAPE: - case WT_SKIN: - case WT_HAIR: - case WT_EYES: - return LLAssetType::AT_BODYPART; - case WT_SHIRT: - case WT_PANTS: - case WT_SHOES: - case WT_SOCKS: - case WT_JACKET: - case WT_GLOVES: - case WT_UNDERSHIRT: - case WT_UNDERPANTS: - case WT_SKIRT: - return LLAssetType::AT_CLOTHING; - default: - return LLAssetType::AT_NONE; - } -} - +// Private local functions +static std::string terse_F32_to_string(F32 f); +static std::string asset_id_to_filename(const LLUUID &asset_id); LLWearable::LLWearable(const LLTransactionID& transaction_id) : mDefinitionVersion(LLWearable::sCurrentDefinitionVersion), @@ -139,56 +74,22 @@ LLWearable::~LLWearable() { } - -// static -EWearableType LLWearable::typeNameToType( const std::string& type_name ) +const std::string& LLWearable::getTypeLabel() const { - for( S32 i = 0; i < WT_COUNT; i++ ) - { - if( type_name == LLWearable::sTypeName[ i ] ) - { - return (EWearableType)i; - } - } - return WT_INVALID; + return LLWearableDictionary::getTypeLabel(mType); } - -std::string terse_F32_to_string( F32 f ) +const std::string& LLWearable::getTypeName() const { - std::string r = llformat( "%.2f", f ); - - // "1.20" -> "1.2" - // "24.00" -> "24." - S32 len = r.length(); - while( len > 0 && '0' == r[len - 1] ) - { - r.erase(len-1, 1); - len--; - } - - if( '.' == r[len - 1] ) - { - // "24." -> "24" - r.erase(len-1, 1); - } - else - if( ('-' == r[0]) && ('0' == r[1]) ) - { - // "-0.59" -> "-.59" - r.erase(1, 1); - } - else - if( '0' == r[0] ) - { - // "0.59" -> ".59" - r.erase(0, 1); - } + return LLWearableDictionary::getTypeName(mType); +} - return r; +LLAssetType::EType LLWearable::getAssetType() const +{ + return LLWearableDictionary::getAssetType(mType); } -BOOL LLWearable::exportFile( LLFILE* file ) +BOOL LLWearable::exportFile(LLFILE* file) const { // header and version if( fprintf( file, "LLWearable version %d\n", mDefinitionVersion ) < 0 ) @@ -234,7 +135,7 @@ BOOL LLWearable::exportFile( LLFILE* file ) return FALSE; } - for (param_map_t::iterator iter = mVisualParamMap.begin(); + for (param_map_t::const_iterator iter = mVisualParamMap.begin(); iter != mVisualParamMap.end(); ++iter) { S32 param_id = iter->first; @@ -252,22 +153,18 @@ BOOL LLWearable::exportFile( LLFILE* file ) return FALSE; } - for (te_map_t::iterator iter = mTEMap.begin(); - iter != mTEMap.end(); ++iter) + for (te_map_t::const_iterator iter = mTEMap.begin(); iter != mTEMap.end(); ++iter) { S32 te = iter->first; - LLUUID& image_id = iter->second; + const LLUUID& image_id = iter->second; if( fprintf( file, "%d %s\n", te, image_id.asString().c_str()) < 0 ) { return FALSE; } } - return TRUE; } - - BOOL LLWearable::importFile( LLFILE* file ) { // *NOTE: changing the type or size of this buffer will require @@ -463,7 +360,7 @@ BOOL LLWearable::importFile( LLFILE* file ) // Avatar parameter and texture definitions can change over time. // This function returns true if parameters or textures have been added or removed // since this wearable was created. -BOOL LLWearable::isOldVersion() +BOOL LLWearable::isOldVersion() const { LLVOAvatar* avatar = gAgent.getAvatarObject(); llassert( avatar ); @@ -506,7 +403,7 @@ BOOL LLWearable::isOldVersion() S32 te_count = 0; for( S32 te = 0; te < TEX_NUM_INDICES; te++ ) { - if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType ) + if (LLVOAvatarDictionary::getTEWearableType((ETextureIndex) te) == mType) { te_count++; if( !is_in_map(mTEMap, te ) ) @@ -530,7 +427,7 @@ BOOL LLWearable::isOldVersion() // * If parameters or textures have been ADDED since the wearable was created, // they are taken to have default values, so we consider the wearable clean // only if those values are the same as the defaults. -BOOL LLWearable::isDirty() +BOOL LLWearable::isDirty() const { LLVOAvatar* avatar = gAgent.getAvatarObject(); llassert( avatar ); @@ -560,7 +457,7 @@ BOOL LLWearable::isDirty() for( S32 te = 0; te < TEX_NUM_INDICES; te++ ) { - if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType ) + if (LLVOAvatarDictionary::getTEWearableType((ETextureIndex) te) == mType) { LLViewerImage* avatar_image = avatar->getTEImage( te ); if( !avatar_image ) @@ -568,7 +465,7 @@ BOOL LLWearable::isDirty() llassert( 0 ); continue; } - const LLUUID& image_id = get_if_there(mTEMap, te, LLVOAvatar::getDefaultTEImageID((ETextureIndex) te ) ); + const LLUUID& image_id = get_if_there(mTEMap, te, LLVOAvatarDictionary::getDefaultTextureImageID((ETextureIndex) te)); if( avatar_image->getID() != image_id ) { return TRUE; @@ -612,9 +509,9 @@ void LLWearable::setTexturesToDefaults() mTEMap.clear(); for( S32 te = 0; te < TEX_NUM_INDICES; te++ ) { - if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType ) + if (LLVOAvatarDictionary::getTEWearableType((ETextureIndex) te) == mType) { - mTEMap[te] = LLVOAvatar::getDefaultTEImageID((ETextureIndex) te ); + mTEMap[te] = LLVOAvatarDictionary::getDefaultTextureImageID((ETextureIndex) te); } } } @@ -622,7 +519,7 @@ void LLWearable::setTexturesToDefaults() // Updates the user's avatar's appearance void LLWearable::writeToAvatar( BOOL set_by_user ) { - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); llassert( avatar ); if( !avatar ) { @@ -659,11 +556,11 @@ void LLWearable::writeToAvatar( BOOL set_by_user ) // Pull texture entries for( S32 te = 0; te < TEX_NUM_INDICES; te++ ) { - if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType ) + if (LLVOAvatarDictionary::getTEWearableType((ETextureIndex) te) == mType) { - const LLUUID& image_id = get_if_there(mTEMap, te, LLVOAvatar::getDefaultTEImageID((ETextureIndex) te ) ); + const LLUUID& image_id = get_if_there(mTEMap, te, LLVOAvatarDictionary::getDefaultTextureImageID((ETextureIndex) te)); LLViewerImage* image = gImageList.getImage( image_id ); - avatar->setLocTexTE( te, image, set_by_user ); + avatar->setLocalTextureTE(te, image, set_by_user); } } @@ -672,7 +569,8 @@ void LLWearable::writeToAvatar( BOOL set_by_user ) if( gFloaterCustomize ) { LLViewerInventoryItem* item; - item = (LLViewerInventoryItem*)gInventory.getItem(gAgent.getWearableItem(mType)); + // MULTI_WEARABLE: + item = (LLViewerInventoryItem*)gInventory.getItem(gAgentWearables.getWearableItem(mType,0)); U32 perm_mask = PERM_NONE; BOOL is_complete = FALSE; if(item) @@ -685,7 +583,7 @@ void LLWearable::writeToAvatar( BOOL set_by_user ) } } gFloaterCustomize->setWearable(mType, this, perm_mask, is_complete); - LLFloaterCustomize::setCurrentWearableType( mType ); + gFloaterCustomize->setCurrentWearableType( mType ); } ESex new_sex = avatar->getSex(); @@ -706,7 +604,7 @@ void LLWearable::writeToAvatar( BOOL set_by_user ) // static void LLWearable::removeFromAvatar( EWearableType type, BOOL set_by_user ) { - LLVOAvatar* avatar = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); llassert( avatar ); if( !avatar ) { @@ -736,9 +634,9 @@ void LLWearable::removeFromAvatar( EWearableType type, BOOL set_by_user ) LLViewerImage* image = gImageList.getImage( IMG_DEFAULT_AVATAR ); for( S32 te = 0; te < TEX_NUM_INDICES; te++ ) { - if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == type ) + if (LLVOAvatarDictionary::getTEWearableType((ETextureIndex) te) == type) { - avatar->setLocTexTE( te, image, set_by_user ); + avatar->setLocalTextureTE(te, image, set_by_user); } } @@ -782,7 +680,7 @@ void LLWearable::readFromAvatar() mTEMap.clear(); for( S32 te = 0; te < TEX_NUM_INDICES; te++ ) { - if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType ) + if (LLVOAvatarDictionary::getTEWearableType((ETextureIndex) te) == mType) { LLViewerImage* image = avatar->getTEImage( te ); if( image ) @@ -800,7 +698,7 @@ void LLWearable::readFromAvatar() // Does not copy mAssetID. // Definition version is current: removes obsolete enties and creates default values for new ones. -void LLWearable::copyDataFrom( LLWearable* src ) +void LLWearable::copyDataFrom(const LLWearable* src) { LLVOAvatar* avatar = gAgent.getAvatarObject(); llassert( avatar ); @@ -833,9 +731,9 @@ void LLWearable::copyDataFrom( LLWearable* src ) // Deep copy of mTEMap (copies only those tes that are current, filling in defaults where needed) for( S32 te = 0; te < TEX_NUM_INDICES; te++ ) { - if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType ) + if (LLVOAvatarDictionary::getTEWearableType((ETextureIndex) te) == mType) { - const LLUUID& image_id = get_if_there(src->mTEMap, te, LLVOAvatar::getDefaultTEImageID((ETextureIndex) te ) ); + const LLUUID& image_id = get_if_there(src->mTEMap, te, LLVOAvatarDictionary::getDefaultTextureImageID((ETextureIndex) te)); mTEMap[te] = image_id; } } @@ -846,15 +744,12 @@ struct LLWearableSaveData EWearableType mType; }; -void LLWearable::saveNewAsset() +void LLWearable::saveNewAsset() const { // llinfos << "LLWearable::saveNewAsset() type: " << getTypeName() << llendl; //llinfos << *this << llendl; - std::string new_asset_id_string; - mAssetID.toString(new_asset_id_string); - std::string filename; - filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,new_asset_id_string) + ".wbl"; + const std::string filename = asset_id_to_filename(mAssetID); LLFILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */ BOOL successful_save = FALSE; if(fp && exportFile(fp)) @@ -909,7 +804,7 @@ void LLWearable::saveNewAsset() void LLWearable::onSaveNewAssetComplete(const LLUUID& new_asset_id, void* userdata, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed) { LLWearableSaveData* data = (LLWearableSaveData*)userdata; - const std::string& type_name = LLWearable::typeToTypeName(data->mType); + const std::string& type_name = LLWearableDictionary::getTypeName(data->mType); if(0 == status) { // Success @@ -925,28 +820,16 @@ void LLWearable::onSaveNewAssetComplete(const LLUUID& new_asset_id, void* userda } // Delete temp file - std::string new_asset_id_string; - new_asset_id.toString(new_asset_id_string); - std::string src_filename; - src_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,new_asset_id_string) + ".wbl"; + const std::string src_filename = asset_id_to_filename(new_asset_id); LLFile::remove(src_filename); // delete the context data delete data; } -BOOL LLWearable::isMatchedToInventoryItem( LLViewerInventoryItem* item ) -{ - return - ( mName == item->getName() ) && - ( mDescription == item->getDescription() ) && - ( mPermissions == item->getPermissions() ) && - ( mSaleInfo == item->getSaleInfo() ); -} - std::ostream& operator<<(std::ostream &s, const LLWearable &w) { - s << "wearable " << LLWearable::typeToTypeName( w.mType ) << "\n"; + s << "wearable " << LLWearableDictionary::getTypeName(w.mType) << "\n"; s << " Name: " << w.mName << "\n"; s << " Desc: " << w.mDescription << "\n"; //w.mPermissions @@ -973,3 +856,40 @@ std::ostream& operator<<(std::ostream &s, const LLWearable &w) } +std::string terse_F32_to_string(F32 f) +{ + std::string r = llformat("%.2f", f); + S32 len = r.length(); + + // "1.20" -> "1.2" + // "24.00" -> "24." + while (len > 0 && ('0' == r[len - 1])) + { + r.erase(len-1, 1); + len--; + } + if ('.' == r[len - 1]) + { + // "24." -> "24" + r.erase(len-1, 1); + } + else if (('-' == r[0]) && ('0' == r[1])) + { + // "-0.59" -> "-.59" + r.erase(1, 1); + } + else if ('0' == r[0]) + { + // "0.59" -> ".59" + r.erase(0, 1); + } + return r; +} + +std::string asset_id_to_filename(const LLUUID &asset_id) +{ + std::string asset_id_string; + asset_id.toString(asset_id_string); + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,asset_id_string) + ".wbl"; + return filename; +} diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h index 683a8fa928aceb872ab640017593031c26c1b330..7ebdd788ce1f5cc5b5c963ff50d7b557dd6ec07d 100644 --- a/indra/newview/llwearable.h +++ b/indra/newview/llwearable.h @@ -19,7 +19,7 @@ * in the file doc/FLOSS-exception.txt in this software distribution, or * online at * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * + * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, * and agree to abide by those obligations. @@ -38,92 +38,69 @@ #include "llpermissions.h" #include "llsaleinfo.h" #include "llassetstorage.h" +#include "llwearabledictionary.h" class LLViewerInventoryItem; -enum EWearableType // If you change this, update LLWearable::getTypeName(), getTypeLabel(), and LLVOAvatar::getTEWearableType() -{ - WT_SHAPE = 0, - WT_SKIN = 1, - WT_HAIR = 2, - WT_EYES = 3, - WT_SHIRT = 4, - WT_PANTS = 5, - WT_SHOES = 6, - WT_SOCKS = 7, - WT_JACKET = 8, - WT_GLOVES = 9, - WT_UNDERSHIRT = 10, - WT_UNDERPANTS = 11, - WT_SKIRT = 12, - WT_COUNT = 13, - WT_INVALID = 255 -}; - class LLWearable { friend class LLWearableList; + + //-------------------------------------------------------------------- + // Constructors and destructors + //-------------------------------------------------------------------- +private: + // Private constructors used by LLWearableList + LLWearable(const LLTransactionID& transactionID); + LLWearable(const LLAssetID& assetID); public: - ~LLWearable(); + virtual ~LLWearable(); + //-------------------------------------------------------------------- + // Accessors + //-------------------------------------------------------------------- +public: const LLAssetID& getID() const { return mAssetID; } const LLTransactionID& getTransactionID() const { return mTransactionID; } + EWearableType getType() const { return mType; } + void setType(EWearableType type) { mType = type; } + const std::string& getName() const { return mName; } + void setName(const std::string& name) { mName = name; } + const std::string& getDescription() const { return mDescription; } + void setDescription(const std::string& desc) { mDescription = desc; } + const LLPermissions& getPermissions() const { return mPermissions; } + void setPermissions(const LLPermissions& p) { mPermissions = p; } + const LLSaleInfo& getSaleInfo() const { return mSaleInfo; } + void setSaleInfo(const LLSaleInfo& info) { mSaleInfo = info; } + const std::string& getTypeLabel() const; + const std::string& getTypeName() const; + LLAssetType::EType getAssetType() const; - BOOL isDirty(); - BOOL isOldVersion(); +public: + BOOL isDirty() const; + BOOL isOldVersion() const; void writeToAvatar( BOOL set_by_user ); void readFromAvatar(); void removeFromAvatar( BOOL set_by_user ) { LLWearable::removeFromAvatar( mType, set_by_user ); } static void removeFromAvatar( EWearableType type, BOOL set_by_user ); - BOOL exportFile(LLFILE* file); + BOOL exportFile(LLFILE* file) const; BOOL importFile(LLFILE* file); - - EWearableType getType() const { return mType; } - void setType( EWearableType type ) { mType = type; } - - void setName( const std::string& name ) { mName = name; } - const std::string& getName() const { return mName; } - - void setDescription( const std::string& desc ) { mDescription = desc; } - const std::string& getDescription() const { return mDescription; } - - void setPermissions( const LLPermissions& p ) { mPermissions = p; } - const LLPermissions& getPermissions() const { return mPermissions; } - - void setSaleInfo( const LLSaleInfo& info ) { mSaleInfo = info; } - const LLSaleInfo& getSaleInfo() const { return mSaleInfo; } - - const std::string& getTypeLabel() const { return LLWearable::sTypeLabel[ mType ]; } - const std::string& getTypeName() const { return LLWearable::sTypeName[ mType ]; } - + void setParamsToDefaults(); void setTexturesToDefaults(); - LLAssetType::EType getAssetType() const { return LLWearable::typeToAssetType( mType ); } - - static EWearableType typeNameToType( const std::string& type_name ); - static const std::string& typeToTypeName( EWearableType type ) { return LLWearable::sTypeName[llmin(type,WT_COUNT)]; } - static const std::string& typeToTypeLabel( EWearableType type ) { return LLWearable::sTypeLabel[llmin(type,WT_COUNT)]; } - static LLAssetType::EType typeToAssetType( EWearableType wearable_type ); - - void saveNewAsset(); + void saveNewAsset() const; static void onSaveNewAssetComplete( const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status ); - BOOL isMatchedToInventoryItem( LLViewerInventoryItem* item ); - - void copyDataFrom( LLWearable* src ); + void copyDataFrom(const LLWearable* src); static void setCurrentDefinitionVersion( S32 version ) { LLWearable::sCurrentDefinitionVersion = version; } friend std::ostream& operator<<(std::ostream &s, const LLWearable &w); private: - // Private constructor used by LLWearableList - LLWearable(const LLTransactionID& transactionID); - LLWearable(const LLAssetID& assetID); - static S32 sCurrentDefinitionVersion; // Depends on the current state of the avatar_lad.xml. S32 mDefinitionVersion; // Depends on the state of the avatar_lad.xml when this asset was created. std::string mName; @@ -138,9 +115,6 @@ private: param_map_t mVisualParamMap; // maps visual param id to weight typedef std::map<S32, LLUUID> te_map_t; te_map_t mTEMap; // maps TE to Image ID - - static const std::string sTypeName[ WT_COUNT+1 ]; - static const std::string sTypeLabel[ WT_COUNT+1 ]; }; #endif // LL_LLWEARABLE_H diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 512c03fa4dd2c09ad6f2a80f8d09ecffa6eb5785..92de94636bf659b957c5cc1e43f4477c0f589fb9 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -39,22 +39,18 @@ #include "llagent.h" #include "llvoavatar.h" #include "llviewerinventory.h" -//#include "llfloaterchat.h" #include "llviewerstats.h" #include "llnotify.h" +#include "llinventorymodel.h" +#include "lltrans.h" -// Globals -LLWearableList gWearableList; // Globally constructed; be careful that there's no dependency with gAgent. - - +// Callback struct struct LLWearableArrivedData { - LLWearableArrivedData( - LLAssetType::EType asset_type, + LLWearableArrivedData(LLAssetType::EType asset_type, const std::string& wearable_name, void(*asset_arrived_callback)(LLWearable*, void* userdata), - void* userdata ) - : + void* userdata) : mAssetType( asset_type ), mCallback( asset_arrived_callback ), mUserdata( userdata ), @@ -69,8 +65,6 @@ struct LLWearableArrivedData S32 mRetries; }; - - //////////////////////////////////////////////////////////////////////////// // LLWearableList @@ -80,8 +74,18 @@ LLWearableList::~LLWearableList() mList.clear(); } -void LLWearableList::getAsset( const LLAssetID& assetID, const std::string& wearable_name, LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLWearable*, void* userdata), void* userdata ) +void LLWearableList::getAsset(const LLAssetID& _assetID, const std::string& wearable_name, LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLWearable*, void* userdata), void* userdata) { + LLAssetID assetID = _assetID; + if (asset_type == LLAssetType::AT_LINK) + { + LLInventoryItem *linked_item = gInventory.getItem(_assetID); + if (linked_item) + { + assetID = linked_item->getAssetUUID(); + asset_type = linked_item->getType(); + } + } llassert( (asset_type == LLAssetType::AT_CLOTHING) || (asset_type == LLAssetType::AT_BODYPART) ); LLWearable* instance = get_if_there(mList, assetID, (LLWearable*)NULL ); if( instance ) @@ -90,8 +94,7 @@ void LLWearableList::getAsset( const LLAssetID& assetID, const std::string& wear } else { - gAssetStorage->getAssetData( - assetID, + gAssetStorage->getAssetData(assetID, asset_type, LLWearableList::processGetAssetReply, (void*)new LLWearableArrivedData( asset_type, wearable_name, asset_arrived_callback, userdata ), @@ -110,8 +113,7 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID { LL_WARNS("Wearable") << "Bad Wearable Asset: missing file." << LL_ENDL; } - else - if( status >= 0 ) + else if (status >= 0) { // read the file LLFILE* fp = LLFile::fopen(std::string(filename), "rb"); /*Flawfinder: ignore*/ @@ -180,15 +182,14 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID if (wearable) // success { - gWearableList.mList[ uuid ] = wearable; + LLWearableList::instance().mList[ uuid ] = wearable; LL_DEBUGS("Wearable") << "processGetAssetReply()" << LL_ENDL; LL_DEBUGS("Wearable") << wearable << LL_ENDL; } else { LLSD args; - // *TODO:translate - args["TYPE"] = LLAssetType::lookupHumanReadable(data->mAssetType); + args["TYPE"] =LLTrans::getString(LLAssetType::lookupHumanReadable(data->mAssetType)); if (isNewWearable) { LLNotifications::instance().add("InvalidWearable"); @@ -214,42 +215,13 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID } -// Creates a new wearable just like the old_wearable but with data copied over from item -LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* old_wearable, LLViewerInventoryItem* item ) -{ - lldebugs << "LLWearableList::createWearableMatchedToInventoryItem()" << llendl; - - LLTransactionID tid; - LLAssetID new_asset_id; - new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); - - LLWearable* wearable = new LLWearable( tid ); - wearable->copyDataFrom( old_wearable ); - - wearable->setName( item->getName() ); - wearable->setDescription( item->getDescription() ); - wearable->setPermissions( item->getPermissions() ); - wearable->setSaleInfo( item->getSaleInfo() ); - - mList[ new_asset_id ] = wearable; - - // Send to the dataserver - wearable->saveNewAsset(); - - return wearable; -} - -LLWearable* LLWearableList::createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name ) +LLWearable* LLWearableList::createCopyFromAvatar(const LLWearable* old_wearable, const std::string& new_name) { lldebugs << "LLWearableList::createCopyFromAvatar()" << llendl; - LLTransactionID tid; - LLAssetID new_asset_id; - tid.generate(); - new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); - - LLWearable* wearable = new LLWearable( tid ); + LLWearable *wearable = generateNewWearable(); wearable->copyDataFrom( old_wearable ); + LLPermissions perm(old_wearable->getPermissions()); perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true); wearable->setPermissions(perm); @@ -257,8 +229,6 @@ LLWearable* LLWearableList::createCopyFromAvatar( LLWearable* old_wearable, cons if (!new_name.empty()) wearable->setName(new_name); - mList[ new_asset_id ] = wearable; - // Send to the dataserver wearable->saveNewAsset(); @@ -266,21 +236,16 @@ LLWearable* LLWearableList::createCopyFromAvatar( LLWearable* old_wearable, cons } -LLWearable* LLWearableList::createCopy( LLWearable* old_wearable ) +LLWearable* LLWearableList::createCopy(const LLWearable* old_wearable) { lldebugs << "LLWearableList::createCopy()" << llendl; - LLTransactionID tid; - LLAssetID new_asset_id; - tid.generate(); - new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); + LLWearable *wearable = generateNewWearable(); + wearable->copyDataFrom(old_wearable); - LLWearable* wearable = new LLWearable( tid ); - wearable->copyDataFrom( old_wearable ); LLPermissions perm(old_wearable->getPermissions()); perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true); wearable->setPermissions(perm); - mList[ new_asset_id ] = wearable; // Send to the dataserver wearable->saveNewAsset(); @@ -292,12 +257,7 @@ LLWearable* LLWearableList::createNewWearable( EWearableType type ) { lldebugs << "LLWearableList::createNewWearable()" << llendl; - LLTransactionID tid; - LLAssetID new_asset_id; - tid.generate(); - new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); - - LLWearable* wearable = new LLWearable( tid ); + LLWearable *wearable = generateNewWearable(); wearable->setType( type ); std::string name = "New "; @@ -314,10 +274,19 @@ LLWearable* LLWearableList::createNewWearable( EWearableType type ) wearable->setParamsToDefaults(); wearable->setTexturesToDefaults(); - mList[ new_asset_id ] = wearable; - // Send to the dataserver wearable->saveNewAsset(); return wearable; } + +LLWearable *LLWearableList::generateNewWearable() +{ + LLTransactionID tid; + tid.generate(); + LLAssetID new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); + + LLWearable* wearable = new LLWearable(tid); + mList[new_asset_id] = wearable; + return wearable; +} diff --git a/indra/newview/llwearablelist.h b/indra/newview/llwearablelist.h index cda0cb11f9e2799641a197577d9f6b9b1af067b6..f844c0f44390a2448fed7e06e424d3d789787674 100644 --- a/indra/newview/llwearablelist.h +++ b/indra/newview/llwearablelist.h @@ -33,37 +33,37 @@ #ifndef LL_LLWEARABLELIST_H #define LL_LLWEARABLELIST_H +#include "llmemory.h" #include "llwearable.h" #include "lluuid.h" #include "llassetstorage.h" -class LLWearableList +// Globally constructed; be careful that there's no dependency with gAgent. +class LLWearableList : public LLSingleton<LLWearableList> { public: LLWearableList() {} ~LLWearableList(); - S32 getLength() { return mList.size(); } + S32 getLength() const { return mList.size(); } - void getAsset( - const LLAssetID& assetID, - const std::string& wearable_name, - LLAssetType::EType asset_type, - void(*asset_arrived_callback)(LLWearable*, void* userdata), - void* userdata ); + void getAsset(const LLAssetID& assetID, + const std::string& wearable_name, + LLAssetType::EType asset_type, + void(*asset_arrived_callback)(LLWearable*, void* userdata), + void* userdata); - LLWearable* createWearableMatchedToInventoryItem( LLWearable* old_wearable, LLViewerInventoryItem* item ); - LLWearable* createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name = std::string() ); - LLWearable* createCopy( LLWearable* old_wearable ); - LLWearable* createNewWearable( EWearableType type ); + LLWearable* createCopyFromAvatar(const LLWearable* old_wearable, const std::string& new_name = std::string()); + LLWearable* createCopy(const LLWearable* old_wearable); + LLWearable* createNewWearable(EWearableType type); // Callback static void processGetAssetReply(const char* filename, const LLAssetID& assetID, void* user_data, S32 status, LLExtStat ext_status); protected: - std::map< LLUUID, LLWearable* > mList; + LLWearable* generateNewWearable(); // used for the create... functions +private: + std::map<LLUUID, LLWearable*> mList; }; -extern LLWearableList gWearableList; - #endif // LL_LLWEARABLELIST_H diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index a5691d8a1c3beb30674126b3bbac37b8743b84d6..781f8298f7467e6737cfe9d67b24d2cfa3f1d833 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -35,10 +35,30 @@ #include "llweb.h" -#include "llviewerwindow.h" +// Library includes +#include "llwindow.h" // spawnWebBrowser() +#include "llviewerwindow.h" #include "llviewercontrol.h" #include "llfloaterhtmlhelp.h" +#include "llalertdialog.h" + +class URLLoader : public LLAlertDialog::URLLoader +{ + virtual void load(const std::string& url , bool force_open_externally) + { + if (force_open_externally) + { + LLWeb::loadURLExternal(url); + } + else + { + LLWeb::loadURL(url); + } + } +}; +static URLLoader sAlertURLLoader; + // static void LLWeb::initClass() @@ -93,12 +113,3 @@ std::string LLWeb::escapeURL(const std::string& url) } return escaped_url; } - -// virtual -void LLWeb::URLLoader::load(const std::string& url) -{ - loadURL(url); -} - -// static -LLWeb::URLLoader LLWeb::sAlertURLLoader; diff --git a/indra/newview/llweb.h b/indra/newview/llweb.h index 278821bac55adbc51b957ebbd29cf85a39c2f4e5..71cc236621a9225d163ebeaad1ad55544a068878 100644 --- a/indra/newview/llweb.h +++ b/indra/newview/llweb.h @@ -35,7 +35,6 @@ #define LL_LLWEB_H #include <string> -#include "llalertdialog.h" class LLWeb { @@ -54,12 +53,6 @@ public: // Returns escaped (eg, " " to "%20") url static std::string escapeURL(const std::string& url); - class URLLoader : public LLAlertDialog::URLLoader - { - virtual void load(const std::string& url); - }; - - static URLLoader sAlertURLLoader; }; #endif diff --git a/indra/newview/llwldaycycle.cpp b/indra/newview/llwldaycycle.cpp index 1d17c6047f8b22e00f9d068cb0a3a4cfea592a02..10a9703d1a5ceb00c8afc14ed556d18da7500d43 100644 --- a/indra/newview/llwldaycycle.cpp +++ b/indra/newview/llwldaycycle.cpp @@ -35,8 +35,7 @@ #include "llwldaycycle.h" #include "llsdserialize.h" #include "llwlparammanager.h" - -#include "llviewerwindow.h" +#include "llnotifications.h" #include <map> diff --git a/indra/newview/llwldaycycle.h b/indra/newview/llwldaycycle.h index f045a6d1b0960c8eb9dd9cc29f3116580d638569..eed6a78c1884f0b7f7cd06defdb9f3a26203e815 100644 --- a/indra/newview/llwldaycycle.h +++ b/indra/newview/llwldaycycle.h @@ -35,8 +35,6 @@ class LLWLDayCycle; -#include "llfloater.h" - #include <vector> #include <map> #include <string> diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 3fdef295400d510a1c7f2cae9f9ffc3000ac0e40..692efd2b7a5732c9bbdb7951bd1d7ef77a46ab61 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -632,6 +632,7 @@ void LLWorld::updateVisibilities() void LLWorld::updateRegions(F32 max_update_time) { + LLMemType mt_ur(LLMemType::MTYPE_IDLE_UPDATE_REGIONS); LLTimer update_timer; BOOL did_one = FALSE; diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index ce83cbd97c60f15fed549bd262aa6ee203d9e45f..b5380a6f6cca421281abc1846b3570909e4169e5 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -42,7 +42,7 @@ #include "llmath.h" #include "v3math.h" -#include "llmemory.h" +#include "llsingleton.h" #include "llstring.h" #include "llviewerpartsim.h" #include "llviewerimage.h" diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 572f31f56646814b5aed4203c6f87e3afa73d19a..827f12d19e42ba7916fcad85415e363b0c2d075b 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -46,6 +46,7 @@ #include "llviewerimagelist.h" #include "llviewerregion.h" #include "llregionflags.h" +#include "lltrans.h" const F32 REQUEST_ITEMS_TIMER = 10.f * 60.f; // 10 minutes @@ -757,18 +758,13 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**) case MAP_ITEM_MATURE_EVENT: case MAP_ITEM_ADULT_EVENT: { - struct tm* timep; - // Convert to Pacific, based on server's opinion of whether - // it's daylight savings time there. - timep = utc_to_pacific_time(extra, gPacificDaylightTime); - - S32 display_hour = timep->tm_hour % 12; - if (display_hour == 0) display_hour = 12; - - new_item.mToolTip = llformat( "%d:%02d %s", - display_hour, - timep->tm_min, - (timep->tm_hour < 12 ? "AM" : "PM") ); + std::string timeStr = "["+ LLTrans::getString ("TimeHour")+"]:[" + +LLTrans::getString ("TimeMin")+"] [" + +LLTrans::getString ("TimeAMPM")+"]"; + LLSD substitution; + substitution["datetime"] = (S32) extra; + LLStringUtil::format (timeStr, substitution); + new_item.mToolTip = timeStr; // HACK: store Z in extra2 new_item.mPosGlobal.mdV[VZ] = (F64)extra2; diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index bb3c97cfd9d43fd0266ab98e314de894d6a0dac5..1db081c74ad4a79be9a921856f3f7df5bb820fcf 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -36,13 +36,15 @@ #include <map> #include <string> #include <vector> +#include <boost/function.hpp> #include "v3math.h" #include "v3dmath.h" #include "llframetimer.h" #include "llmapimagetype.h" #include "lluuid.h" -#include "llmemory.h" +#include "llpointer.h" +#include "llsingleton.h" #include "llviewerimage.h" #include "lleventinfo.h" #include "v3color.h" @@ -114,7 +116,8 @@ struct LLWorldMapLayer class LLWorldMap : public LLSingleton<LLWorldMap> { public: - typedef void(*url_callback_t)(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport); + typedef boost::function<void(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport)> + url_callback_t; LLWorldMap(); ~LLWorldMap(); diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 2e18b710a72ea0accaaa4f1894c58d2a682b462a..9ac758433c57982fe453db8b9c3143a370ab7e7f 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -39,11 +39,11 @@ #include "llmath.h" // clampf() #include "llregionhandle.h" #include "lleventflags.h" +#include "llfloaterreg.h" #include "llrender.h" #include "llagent.h" #include "llcallingcard.h" -#include "llcolorscheme.h" #include "llviewercontrol.h" #include "llcylinder.h" #include "llfloaterdirectory.h" @@ -164,8 +164,8 @@ void LLWorldMapView::cleanupClass() sForSaleAdultImage = NULL; } -LLWorldMapView::LLWorldMapView(const std::string& name, const LLRect& rect ) -: LLPanel(name, rect, BORDER_NO), +LLWorldMapView::LLWorldMapView() +: LLPanel(), mBackgroundColor( LLColor4( 4.f/255.f, 4.f/255.f, 75.f/255.f, 1.f ) ), mItemPicked(FALSE), mPanning( FALSE ), @@ -177,47 +177,38 @@ LLWorldMapView::LLWorldMapView(const std::string& name, const LLRect& rect ) { sPixelsPerMeter = gMapScale / REGION_WIDTH_METERS; clearLastClick(); +} - const S32 DIR_WIDTH = 10; - const S32 DIR_HEIGHT = 10; - LLRect major_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH, 0 ); - LLColor4 minor_color( 1.f, 1.f, 1.f, .7f ); - - mTextBoxNorth = new LLTextBox( std::string("N"), major_dir_rect ); - mTextBoxNorth->setColor( minor_color ); - addChild( mTextBoxNorth ); - - mTextBoxEast = new LLTextBox( std::string("E"), major_dir_rect ); - mTextBoxEast->setColor( minor_color ); - addChild( mTextBoxEast ); - - major_dir_rect.mRight += 1 ; - mTextBoxWest = new LLTextBox( std::string("W"), major_dir_rect ); - mTextBoxWest->setColor( minor_color ); - addChild( mTextBoxWest ); - major_dir_rect.mRight -= 1 ; - - mTextBoxSouth = new LLTextBox( std::string("S"), major_dir_rect ); - mTextBoxSouth->setColor( minor_color ); - addChild( mTextBoxSouth ); - - LLRect minor_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH * 2, 0 ); - - mTextBoxSouthEast = new LLTextBox( std::string("SE"), minor_dir_rect ); - mTextBoxSouthEast->setColor( minor_color ); - addChild( mTextBoxSouthEast ); +BOOL LLWorldMapView::postBuild() +{ + mTextBoxNorth = getChild<LLTextBox> ("floater_map_north"); + mTextBoxEast = getChild<LLTextBox> ("floater_map_east"); + mTextBoxWest = getChild<LLTextBox> ("floater_map_west"); + mTextBoxSouth = getChild<LLTextBox> ("floater_map_south"); + mTextBoxSouthEast = getChild<LLTextBox> ("floater_map_southeast"); + mTextBoxNorthEast = getChild<LLTextBox> ("floater_map_northeast"); + mTextBoxSouthWest = getChild<LLTextBox> ("floater_map_southwest"); + mTextBoxNorthWest = getChild<LLTextBox> ("floater_map_northwest"); - mTextBoxNorthEast = new LLTextBox( std::string("NE"), minor_dir_rect ); - mTextBoxNorthEast->setColor( minor_color ); - addChild( mTextBoxNorthEast ); + mTextBoxNorth->setText(getString("world_map_north")); + mTextBoxEast->setText(getString ("world_map_east")); + mTextBoxWest->setText(getString("world_map_west")); + mTextBoxSouth->setText(getString ("world_map_south")); + mTextBoxSouthEast ->setText(getString ("world_map_southeast")); + mTextBoxNorthEast ->setText(getString ("world_map_northeast")); + mTextBoxSouthWest->setText(getString ("world_map_southwest")); + mTextBoxNorthWest ->setText(getString("world_map_northwest")); - mTextBoxSouthWest = new LLTextBox( std::string("SW"), minor_dir_rect ); - mTextBoxSouthWest->setColor( minor_color ); - addChild( mTextBoxSouthWest ); + mTextBoxNorth->reshapeToFitText(); + mTextBoxEast->reshapeToFitText(); + mTextBoxWest->reshapeToFitText(); + mTextBoxSouth->reshapeToFitText(); + mTextBoxSouthEast ->reshapeToFitText(); + mTextBoxNorthEast ->reshapeToFitText(); + mTextBoxSouthWest->reshapeToFitText(); + mTextBoxNorthWest ->reshapeToFitText(); - mTextBoxNorthWest = new LLTextBox( std::string("NW"), minor_dir_rect ); - mTextBoxNorthWest->setColor( minor_color ); - addChild( mTextBoxNorthWest ); + return true; } @@ -293,6 +284,8 @@ BOOL is_agent_in_region(LLViewerRegion* region, LLSimInfo* info) void LLWorldMapView::draw() { + static LLCachedControl<LLColor4> map_track_color(gSavedSkinSettings, "MapTrackColor", LLColor4::white); + LLTextureView::clearDebugImages(); F64 current_time = LLTimer::getElapsedSeconds(); @@ -698,6 +691,7 @@ void LLWorldMapView::draw() LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, + LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); // If map texture is still loading, @@ -713,6 +707,7 @@ void LLWorldMapView::draw() LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, + LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); } } @@ -801,7 +796,7 @@ void LLWorldMapView::draw() LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); if ( LLTracker::TRACKING_AVATAR == tracking_status ) { - drawTracking( LLAvatarTracker::instance().getGlobalPos(), gTrackColor, TRUE, LLTracker::getLabel(), "" ); + drawTracking( LLAvatarTracker::instance().getGlobalPos(), map_track_color, TRUE, LLTracker::getLabel(), "" ); } else if ( LLTracker::TRACKING_LANDMARK == tracking_status || LLTracker::TRACKING_LOCATION == tracking_status ) @@ -811,7 +806,7 @@ void LLWorldMapView::draw() LLVector3d pos_global = LLTracker::getTrackedPositionGlobal(); if (!pos_global.isExactlyZero()) { - drawTracking( pos_global, gTrackColor, TRUE, LLTracker::getLabel(), LLTracker::getToolTip() ); + drawTracking( pos_global, map_track_color, TRUE, LLTracker::getLabel(), LLTracker::getToolTip() ); } } else if (LLWorldMap::getInstance()->mIsTrackingUnknownLocation) @@ -820,14 +815,14 @@ void LLWorldMapView::draw() { // We know this location to be invalid LLColor4 loading_color(0.0, 0.5, 1.0, 1.0); - drawTracking( LLWorldMap::getInstance()->mUnknownLocation, loading_color, TRUE, "Invalid Location", ""); + drawTracking( LLWorldMap::getInstance()->mUnknownLocation, loading_color, TRUE, getString("InvalidLocation"), ""); } else { double value = fmod(current_time, 2); value = 0.5 + 0.5*cos(value * 3.14159f); LLColor4 loading_color(0.0, F32(value/2), F32(value), 1.0); - drawTracking( LLWorldMap::getInstance()->mUnknownLocation, loading_color, TRUE, "Loading...", ""); + drawTracking( LLWorldMap::getInstance()->mUnknownLocation, loading_color, TRUE, getString("Loading"), ""); } } // #endif used to be here @@ -913,10 +908,10 @@ void LLWorldMapView::drawImageStack(const LLVector3d& global_pos, LLUIImagePtr i void LLWorldMapView::drawAgents() { - F32 agents_scale = (gMapScale * 0.9f) / 256.f; + static LLCachedControl<LLColor4> map_avatar_color(gSavedSkinSettings, "MapAvatarColor", LLColor4::white); + static LLCachedControl<LLColor4> map_avatar_friend_color(gSavedSkinSettings, "MapAvatarFriendColor", LLColor4::white); - LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); - // LLColor4 friend_color = gColors.getColor( "MapFriend" ); + F32 agents_scale = (gMapScale * 0.9f) / 256.f; for (handle_list_t::iterator iter = mVisibleRegions.begin(); iter != mVisibleRegions.end(); ++iter) { @@ -939,8 +934,8 @@ void LLWorldMapView::drawAgents() S32 agent_count = info.mExtra; sim_agent_count += info.mExtra; // Here's how we'd choose the color if info.mID were available but it's not being sent: - //LLColor4 color = (agent_count == 1 && is_agent_friend(info.mID)) ? friend_color : avatar_color; - drawImageStack(info.mPosGlobal, sAvatarSmallImage, agent_count, 3.f, avatar_color); + //LLColor4 color = (agent_count == 1 && is_agent_friend(info.mID)) ? map_avatar_friend_color : map_avatar_color; + drawImageStack(info.mPosGlobal, sAvatarSmallImage, agent_count, 3.f, map_avatar_color); } LLWorldMap::getInstance()->mNumAgents[handle] = sim_agent_count; // override mNumAgents for this sim } @@ -955,7 +950,7 @@ void LLWorldMapView::drawAgents() region_center[VY] += REGION_WIDTH_METERS / 2; // Reduce the stack size as you zoom out - always display at lease one agent where there is one or more S32 agent_count = (S32)(((num_agents-1) * agents_scale + (num_agents-1) * 0.1f)+.1f) + 1; - drawImageStack(region_center, sAvatarSmallImage, agent_count, 3.f, avatar_color); + drawImageStack(region_center, sAvatarSmallImage, agent_count, 3.f, map_avatar_color); } } } @@ -1142,7 +1137,7 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4& text_x, text_y, LLColor4::white, LLFontGL::HCENTER, - LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); + LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); if (tooltip != "") { @@ -1153,7 +1148,7 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4& text_x, text_y, LLColor4::white, LLFontGL::HCENTER, - LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); + LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); } } } @@ -1338,6 +1333,7 @@ void LLWorldMapView::drawIconName(F32 x_pixels, color, LLFontGL::HCENTER, LLFontGL::TOP, + LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); text_y -= llround(LLFontGL::getFontSansSerif()->getLineHeight()); @@ -1349,6 +1345,7 @@ void LLWorldMapView::drawIconName(F32 x_pixels, color, LLFontGL::HCENTER, LLFontGL::TOP, + LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); } @@ -1886,27 +1883,27 @@ BOOL LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask ) case MAP_ITEM_MATURE_EVENT: case MAP_ITEM_ADULT_EVENT: { - gFloaterWorldMap->close(); + LLFloaterReg::hideInstance("world_map"); // This is an ungainly hack std::string uuid_str; S32 event_id; id.toString(uuid_str); uuid_str = uuid_str.substr(28); sscanf(uuid_str.c_str(), "%X", &event_id); - LLFloaterDirectory::showEvents(event_id); + LLFloaterReg::showInstance("search", LLSD().insert("panel", "event").insert("id", event_id)); break; } case MAP_ITEM_LAND_FOR_SALE: case MAP_ITEM_LAND_FOR_SALE_ADULT: { - gFloaterWorldMap->close(); - LLFloaterDirectory::showLandForSale(id); + LLFloaterReg::hideInstance("world_map"); + LLFloaterReg::showInstance("search", LLSD().insert("panel", "land").insert("id", id)); break; } case MAP_ITEM_CLASSIFIED: { - gFloaterWorldMap->close(); - LLFloaterDirectory::showClassified(id); + LLFloaterReg::hideInstance("world_map"); + LLFloaterReg::showInstance("search", LLSD().insert("panel", "classified").insert("id", id)); break; } default: diff --git a/indra/newview/llworldmapview.h b/indra/newview/llworldmapview.h index 1717b76beb25d31953736655cfc2d046a35fb5fa..dd64da1371f65833eb426674bb0dd47ef5858add 100644 --- a/indra/newview/llworldmapview.h +++ b/indra/newview/llworldmapview.h @@ -60,9 +60,11 @@ public: static void initClass(); static void cleanupClass(); - LLWorldMapView(const std::string& name, const LLRect& rect ); + LLWorldMapView(); virtual ~LLWorldMapView(); - + + virtual BOOL postBuild(); + virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE ); virtual void setVisible(BOOL visible); diff --git a/indra/newview/macview_Prefix.h b/indra/newview/macview_Prefix.h index 8cbabb510357ae91722e751755ca9201226175b9..33cf7d8cb03e697564ebf307522a8e5d6e622136 100644 --- a/indra/newview/macview_Prefix.h +++ b/indra/newview/macview_Prefix.h @@ -69,7 +69,6 @@ #include "llfloatercustomize.h" #include "llfloaterdirectory.h" #include "llfloatergroups.h" -#include "llfloatermap.h" #include "llfloaterworldmap.h" #include "llfloatermute.h" #include "llconversation.h" @@ -92,7 +91,6 @@ #include "lltoolgrab.h" #include "lltoolmgr.h" #include "lltoolpie.h" -#include "lltoolview.h" #include "llui.h" // for make_ui_sound #include "llviewercamera.h" #include "llviewermenu.h" diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 8dec9b9ba86bb1ece8f6107769b89ceb2a40702f..25ed853146fe9d024e2a8047d3306d6746ce2093 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -41,9 +41,9 @@ #include "llviewercontrol.h" #include "llfasttimer.h" #include "llfontgl.h" -#include "llmemory.h" #include "llmemtype.h" #include "llnamevalue.h" +#include "llpointer.h" #include "llprimitive.h" #include "llvolume.h" #include "material_codes.h" @@ -52,6 +52,7 @@ #include "llui.h" #include "llglheaders.h" #include "llrender.h" +#include "llwindow.h" // swapBuffers() // newview includes #include "llagent.h" @@ -65,7 +66,6 @@ #include "llface.h" #include "llfeaturemanager.h" #include "llfloatertelehub.h" -#include "llframestats.h" #include "llgldbg.h" #include "llhudmanager.h" #include "lllightconstants.h" @@ -82,7 +82,7 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" // for audio debugging. #include "llviewerwindow.h" // For getSpinAxis -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llvoground.h" #include "llvosky.h" #include "llvotree.h" @@ -93,8 +93,8 @@ #include "llvopartgroup.h" #include "llworld.h" #include "llcubemap.h" -#include "lldebugmessagebox.h" #include "llviewershadermgr.h" +#include "llviewerstats.h" #include "llviewerjoystick.h" #include "llviewerdisplay.h" #include "llwlparammanager.h" @@ -121,8 +121,7 @@ const U32 REFLECTION_MAP_RES = 128; const S32 MAX_OCCLUDER_COUNT = 2; extern S32 gBoxFrame; -extern BOOL gRenderLightGlows; -extern BOOL gHideSelectedObjects; +//extern BOOL gHideSelectedObjects; extern BOOL gDisplaySwapBuffers; extern BOOL gDebugGL; @@ -317,7 +316,7 @@ LLPipeline::LLPipeline() : void LLPipeline::init() { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_INIT); sDynamicLOD = gSavedSettings.getBOOL("RenderDynamicLOD"); sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); @@ -337,7 +336,7 @@ void LLPipeline::init() getPool(LLDrawPool::POOL_BUMP); getPool(LLDrawPool::POOL_GLOW); - mTrianglesDrawnStat.reset(); + LLViewerStats::getInstance()->mTrianglesDrawnStat.reset(); resetFrameStats(); mRenderTypeMask = 0xffffffff; // All render types start on @@ -466,8 +465,8 @@ void LLPipeline::resizeScreenTexture() { if (gPipeline.canUseVertexShaders() && assertInitialized()) { - GLuint resX = gViewerWindow->getWindowDisplayWidth(); - GLuint resY = gViewerWindow->getWindowDisplayHeight(); + GLuint resX = gViewerWindow->getWorldViewWidth(); + GLuint resY = gViewerWindow->getWorldViewHeight(); U32 res_mod = gSavedSettings.getU32("RenderResolutionDivisor"); if (res_mod > 1 && res_mod < resX && res_mod < resY) @@ -577,6 +576,7 @@ void LLPipeline::releaseGLBuffers() void LLPipeline::createGLBuffers() { + LLMemType mt_cb(LLMemType::MTYPE_PIPELINE_CREATE_BUFFERS); assertInitialized(); updateRenderDeferred(); @@ -592,6 +592,9 @@ void LLPipeline::createGLBuffers() stop_glerror(); + GLuint resX = gViewerWindow->getWorldViewWidth(); + GLuint resY = gViewerWindow->getWorldViewHeight(); + if (LLPipeline::sRenderGlow) { //screen space glow buffers const U32 glow_res = llmax(1, @@ -601,13 +604,10 @@ void LLPipeline::createGLBuffers() { mGlow[i].allocate(512,glow_res,GL_RGBA,FALSE,FALSE); } - } - GLuint resX = gViewerWindow->getWindowDisplayWidth(); - GLuint resY = gViewerWindow->getWindowDisplayHeight(); + allocateScreenBuffer(resX,resY); + } - allocateScreenBuffer(resX,resY); - if (sRenderDeferred) { mSunShadow[0].allocate(1024,1024, 0, TRUE, FALSE); @@ -639,6 +639,7 @@ void LLPipeline::createGLBuffers() void LLPipeline::restoreGL() { + LLMemType mt_cb(LLMemType::MTYPE_PIPELINE_RESTORE_GL); assertInitialized(); if (mVertexShadersEnabled) @@ -693,6 +694,7 @@ BOOL LLPipeline::canUseWindLightShadersOnObjects() const void LLPipeline::unloadShaders() { + LLMemType mt_us(LLMemType::MTYPE_PIPELINE_UNLOAD_SHADERS); LLViewerShaderMgr::instance()->unloadShaders(); mVertexShadersLoaded = 0; @@ -724,6 +726,7 @@ S32 LLPipeline::getMaxLightingDetail() const S32 LLPipeline::setLightingDetail(S32 level) { + LLMemType mt_ld(LLMemType::MTYPE_PIPELINE_LIGHTING_DETAIL); assertInitialized(); if (level < 0) @@ -911,7 +914,7 @@ LLDrawPool* LLPipeline::getPoolFromTE(const LLTextureEntry* te, LLViewerImage* i //static U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerImage* imagep) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt_gpt(LLMemType::MTYPE_PIPELINE_GET_POOL_TYPE); if (!te || !imagep) { @@ -941,7 +944,7 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerImage* image void LLPipeline::addPool(LLDrawPool *new_poolp) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt_a(LLMemType::MTYPE_PIPELINE_ADD_POOL); assertInitialized(); mPools.insert(new_poolp); addToQuickLookup( new_poolp ); @@ -949,7 +952,7 @@ void LLPipeline::addPool(LLDrawPool *new_poolp) void LLPipeline::allocDrawable(LLViewerObject *vobj) { - LLMemType mt(LLMemType::MTYPE_DRAWABLE); + LLMemType mt_ad(LLMemType::MTYPE_PIPELINE_ALLOCATE_DRAWABLE); LLDrawable *drawable = new LLDrawable(); vobj->mDrawable = drawable; @@ -1010,6 +1013,7 @@ void LLPipeline::unlinkDrawable(LLDrawable *drawable) U32 LLPipeline::addObject(LLViewerObject *vobj) { + LLMemType mt_ao(LLMemType::MTYPE_PIPELINE_ADD_OBJECT); if (gNoRender) { return 0; @@ -1030,7 +1034,7 @@ U32 LLPipeline::addObject(LLViewerObject *vobj) void LLPipeline::createObjects(F32 max_dtime) { LLFastTimer ftm(LLFastTimer::FTM_GEO_UPDATE); - LLMemType mt(LLMemType::MTYPE_DRAWABLE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_CREATE_OBJECTS); LLTimer update_timer; @@ -1093,7 +1097,7 @@ void LLPipeline::resetFrameStats() { assertInitialized(); - mTrianglesDrawnStat.addValue(mTrianglesDrawn/1000.f); + LLViewerStats::getInstance()->mTrianglesDrawnStat.addValue(mTrianglesDrawn/1000.f); if (mBatchCount > 0) { @@ -1198,7 +1202,7 @@ void LLPipeline::updateMovedList(LLDrawable::drawable_vector_t& moved_list) void LLPipeline::updateMove() { LLFastTimer t(LLFastTimer::FTM_UPDATE_MOVE); - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt_um(LLMemType::MTYPE_PIPELINE_UPDATE_MOVE); if (gSavedSettings.getBOOL("FreezeTime")) { @@ -1352,7 +1356,7 @@ BOOL LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3& void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip) { LLFastTimer t(LLFastTimer::FTM_CULL); - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt_uc(LLMemType::MTYPE_PIPELINE_UPDATE_CULL); grabReferences(result); @@ -1563,7 +1567,7 @@ BOOL LLPipeline::updateDrawableGeom(LLDrawable* drawablep, BOOL priority) void LLPipeline::updateGeom(F32 max_dtime) { LLTimer update_timer; - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_UPDATE_GEOM); LLPointer<LLDrawable> drawablep; LLFastTimer t(LLFastTimer::FTM_GEO_UPDATE); @@ -1666,7 +1670,7 @@ void LLPipeline::updateGeom(F32 max_dtime) void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_MARK_VISIBLE); if(!drawablep || drawablep->isDead()) { return; @@ -1686,7 +1690,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) void LLPipeline::markMoved(LLDrawable *drawablep, BOOL damped_motion) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt_mm(LLMemType::MTYPE_PIPELINE_MARK_MOVED); if (!drawablep) { @@ -1732,7 +1736,7 @@ void LLPipeline::markMoved(LLDrawable *drawablep, BOOL damped_motion) void LLPipeline::markShift(LLDrawable *drawablep) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_MARK_SHIFT); if (!drawablep || drawablep->isDead()) { @@ -1755,7 +1759,7 @@ void LLPipeline::markShift(LLDrawable *drawablep) void LLPipeline::shiftObjects(const LLVector3 &offset) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_SHIFT_OBJECTS); assertInitialized(); @@ -1795,7 +1799,7 @@ void LLPipeline::shiftObjects(const LLVector3 &offset) void LLPipeline::markTextured(LLDrawable *drawablep) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_MARK_TEXTURED); if (drawablep && !drawablep->isDead() && assertInitialized()) { @@ -1805,7 +1809,7 @@ void LLPipeline::markTextured(LLDrawable *drawablep) void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag, BOOL priority) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_MARK_REBUILD); if (drawablep && !drawablep->isDead() && assertInitialized()) { @@ -1851,7 +1855,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) } LLFastTimer ftm(LLFastTimer::FTM_STATESORT); - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_STATE_SORT); //LLVertexBuffer::unbind(); @@ -1928,7 +1932,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) void LLPipeline::stateSort(LLSpatialGroup* group, LLCamera& camera) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_STATE_SORT); if (!sSkipUpdate && group->changeLOD()) { for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i) @@ -1942,16 +1946,17 @@ void LLPipeline::stateSort(LLSpatialGroup* group, LLCamera& camera) void LLPipeline::stateSort(LLSpatialBridge* bridge, LLCamera& camera) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_STATE_SORT); if (!sSkipUpdate && bridge->getSpatialGroup()->changeLOD()) { - bridge->updateDistance(camera); + bool force_update = false; + bridge->updateDistance(camera, force_update); } } void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_STATE_SORT); if (!drawablep || drawablep->isDead() @@ -1960,7 +1965,7 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) return; } - if (gHideSelectedObjects) + if (LLSelectMgr::getInstance()->mHideSelectedObjects) { if (drawablep->getVObj().notNull() && drawablep->getVObj()->isSelected()) @@ -2006,11 +2011,13 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) { if (!drawablep->isActive()) { - drawablep->updateDistance(camera); + bool force_update = false; + drawablep->updateDistance(camera, force_update); } else if (drawablep->isAvatar()) { - drawablep->updateDistance(camera); // calls vobj->updateLOD() which calls LLVOAvatar::updateVisibility() + bool force_update = false; + drawablep->updateDistance(camera, force_update); // calls vobj->updateLOD() which calls LLVOAvatar::updateVisibility() } } } @@ -2178,7 +2185,7 @@ void renderSoundHighlights(LLDrawable* drawablep) void LLPipeline::postSort(LLCamera& camera) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_POST_SORT); LLFastTimer ftm(LLFastTimer::FTM_STATESORT_POSTSORT); assertInitialized(); @@ -2372,6 +2379,7 @@ void LLPipeline::postSort(LLCamera& camera) void render_hud_elements() { + LLMemType mt_rhe(LLMemType::MTYPE_PIPELINE_RENDER_HUD_ELS); LLFastTimer t(LLFastTimer::FTM_RENDER_UI); gPipeline.disableLights(); @@ -2416,7 +2424,7 @@ void render_hud_elements() void LLPipeline::renderHighlights() { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_RENDER_HL); assertInitialized(); @@ -2484,7 +2492,7 @@ void LLPipeline::renderHighlights() void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_RENDER_GEOM); LLFastTimer t(LLFastTimer::FTM_RENDER_GEOMETRY); assertInitialized(); @@ -2509,7 +2517,6 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) // stop_glerror(); - gFrameStats.start(LLFrameStats::RENDER_SYNC); LLVertexBuffer::unbind(); @@ -2535,7 +2542,6 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) if(forceVBOUpdate) gSky.mVOSkyp->updateDummyVertexBuffer() ; - gFrameStats.start(LLFrameStats::RENDER_GEOM); // Initialize lots of GL state to "safe" values glMatrixMode(GL_TEXTURE); @@ -2570,9 +2576,6 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) stop_glerror(); LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderDrawPools"); - - LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderForSelect"); - LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderDeferred"); for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter) { LLDrawPool *poolp = *iter; @@ -2584,6 +2587,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()); } else @@ -2647,6 +2651,10 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &depth); if (depth > 3) { + if (gDebugSession) + { + ll_fail("GL matrix stack corrupted."); + } llerrs << "GL matrix stack corrupted!" << llendl; } std::string msg = llformat("%s pass %d", gPoolNames[cur_type].c_str(), i); @@ -2747,6 +2755,9 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) void LLPipeline::renderGeomDeferred(LLCamera& camera) { + LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderGeomDeferred"); + + LLMemType mt_rgd(LLMemType::MTYPE_PIPELINE_RENDER_GEOM_DEFFERRED); LLFastTimer t(LLFastTimer::FTM_RENDER_GEOMETRY); LLFastTimer t2(LLFastTimer::FTM_POOLS); @@ -2848,6 +2859,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) void LLPipeline::renderGeomPostDeferred(LLCamera& camera) { + LLMemType mt_rgpd(LLMemType::MTYPE_PIPELINE_RENDER_GEOM_POST_DEF); LLFastTimer t(LLFastTimer::FTM_POOLS); U32 cur_type = 0; @@ -2959,6 +2971,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) void LLPipeline::renderGeomShadow(LLCamera& camera) { + LLMemType mt_rgs(LLMemType::MTYPE_PIPELINE_RENDER_GEOM_SHADOW); U32 cur_type = 0; LLGLEnable cull(GL_CULL_FACE); @@ -3220,7 +3233,7 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects, BOOL render stateSort((*iter)->mDrawable, *LLViewerCamera::getInstance()); } - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_RENDER_SELECT); @@ -3295,7 +3308,7 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects, BOOL render LLDrawable* drawable = vobj->mDrawable; if (vobj->isDead() || vobj->isHUDAttachment() || - (gHideSelectedObjects && vobj->isSelected()) || + (LLSelectMgr::getInstance()->mHideSelectedObjects && vobj->isSelected()) || drawable->isDead() || !hasRenderType(drawable->getRenderType())) { @@ -3385,7 +3398,7 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects, BOOL render void LLPipeline::rebuildPools() { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_REBUILD_POOLS); assertInitialized(); @@ -3425,7 +3438,7 @@ void LLPipeline::rebuildPools() void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp ) { - LLMemType mt(LLMemType::MTYPE_PIPELINE); + LLMemType mt(LLMemType::MTYPE_PIPELINE_QUICK_LOOKUP); assertInitialized(); @@ -4096,18 +4109,21 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) void LLPipeline::enableLights(U32 mask) { assertInitialized(); + if (mLightingDetail == 0) { mask &= 0xf003; // sun and backlight only (and fullbright bit) } if (mLightMask != mask) { + stop_glerror(); if (!mLightMask) { glEnable(GL_LIGHTING); } if (mask) { + stop_glerror(); for (S32 i=0; i<8; i++) { if (mask & (1<<i)) @@ -4121,14 +4137,17 @@ void LLPipeline::enableLights(U32 mask) glLightfv(GL_LIGHT0 + i, GL_DIFFUSE, LLColor4::black.mV); } } + stop_glerror(); } else { glDisable(GL_LIGHTING); } + stop_glerror(); mLightMask = mask; LLColor4 ambient = gSky.getTotalAmbientColor(); glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient.mV); + stop_glerror(); } } @@ -4871,6 +4890,7 @@ void LLPipeline::resetVertexBuffers() void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture) { + LLMemType mt_ro(LLMemType::MTYPE_PIPELINE_RENDER_OBJECTS); assertInitialized(); glLoadMatrixd(gGLModelView); gGLLastMatrix = NULL; @@ -4959,6 +4979,7 @@ void LLPipeline::bindScreenToTexture() void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) { + LLMemType mt_ru(LLMemType::MTYPE_PIPELINE_RENDER_BLOOM); if (!(gPipeline.canUseVertexShaders() && sRenderGlow)) { @@ -4979,8 +5000,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->getWindowDisplayWidth()*2, - (F32) gViewerWindow->getWindowDisplayHeight()*2); + LLVector2 tc2((F32) gViewerWindow->getWorldViewWidth()*2, + (F32) gViewerWindow->getWorldViewHeight()*2); if (res_mod > 1) { @@ -5073,8 +5094,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) F32 minLum = llmax(gSavedSettings.getF32("RenderGlowMinLuminance"), 0.0f); F32 maxAlpha = gSavedSettings.getF32("RenderGlowMaxExtractAlpha"); F32 warmthAmount = gSavedSettings.getF32("RenderGlowWarmthAmount"); - LLVector3 lumWeights = gSavedSettings.getVector3("RenderGlowLumWeights"); - LLVector3 warmthWeights = gSavedSettings.getVector3("RenderGlowWarmthWeights"); + LLVector3 lumWeights = gSavedSkinSettings.getVector3("RenderGlowLumWeights"); + LLVector3 warmthWeights = gSavedSkinSettings.getVector3("RenderGlowWarmthWeights"); gGlowExtractProgram.uniform1f("minLuminance", minLum); gGlowExtractProgram.uniform1f("maxExtractAlpha", maxAlpha); gGlowExtractProgram.uniform3f("lumWeights", lumWeights.mV[0], lumWeights.mV[1], lumWeights.mV[2]); @@ -5182,7 +5203,11 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); } - gViewerWindow->setupViewport(); + gGLViewport[0] = gViewerWindow->getWorldViewRect().mLeft; + gGLViewport[1] = gViewerWindow->getWorldViewRect().mBottom; + gGLViewport[2] = gViewerWindow->getWorldViewRect().getWidth(); + gGLViewport[3] = gViewerWindow->getWorldViewRect().getHeight(); + glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); gGL.flush(); @@ -5191,8 +5216,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) - tc2.setVec((F32) gViewerWindow->getWindowDisplayWidth(), - (F32) gViewerWindow->getWindowDisplayHeight()); + tc2.setVec((F32) gViewerWindow->getWorldViewWidth(), + (F32) gViewerWindow->getWorldViewHeight()); if (res_mod > 1) { @@ -5785,15 +5810,15 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) { if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate) { - LLVOAvatar* agent = gAgent.getAvatarObject(); + LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); if (gAgent.getCameraAnimating() || gAgent.getCameraMode() != CAMERA_MODE_MOUSELOOK) { - agent = NULL; + avatar = NULL; } - if (agent) + if (avatar) { - agent->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON); + avatar->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON); } LLVertexBuffer::unbind(); @@ -5983,7 +6008,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) } glClearColor(0.f, 0.f, 0.f, 0.f); - gViewerWindow->setupViewport(); + gViewerWindow->setup3DViewport(); mRenderTypeMask = type_mask; LLDrawPoolWater::sNeedsReflectionUpdate = FALSE; LLDrawPoolWater::sNeedsDistortionUpdate = FALSE; @@ -5994,9 +6019,9 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLGLState::checkTextureChannels(); LLGLState::checkClientArrays(); - if (agent) + if (avatar) { - agent->updateAttachmentVisibility(gAgent.getCameraMode()); + avatar->updateAttachmentVisibility(gAgent.getCameraMode()); } } } @@ -6428,6 +6453,7 @@ void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL textu void LLPipeline::generateImpostor(LLVOAvatar* avatar) { + LLMemType mt_gi(LLMemType::MTYPE_PIPELINE_GENERATE_IMPOSTOR); LLGLState::checkStates(); LLGLState::checkTextureChannels(); LLGLState::checkClientArrays(); @@ -6668,3 +6694,4 @@ LLCullResult::sg_list_t::iterator LLPipeline::endAlphaGroups() return sCull->endAlphaGroups(); } + diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 1a32b30831cfe026100be5dce0157196ba73aab6..c017e9b64f9fcfee289e74bc1709d0f54d4dc683 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -36,11 +36,10 @@ #include "llerror.h" #include "lldarrayptr.h" #include "lldqueueptr.h" -#include "llstat.h" #include "lldrawpool.h" #include "llspatialpartition.h" #include "m4math.h" -#include "llmemory.h" +#include "llpointer.h" #include "lldrawpool.h" #include "llgl.h" #include "lldrawable.h" @@ -383,7 +382,6 @@ public: S32 mMeanBatchSize; S32 mTrianglesDrawn; S32 mNumVisibleNodes; - LLStat mTrianglesDrawnStat; S32 mVerticesRelit; S32 mLightingChanges; diff --git a/indra/newview/res/bitmap2.bmp b/indra/newview/res/bitmap2.bmp new file mode 100644 index 0000000000000000000000000000000000000000..770b07558cf2e4c7ce98f08e1a0a7ce3099b84f6 Binary files /dev/null and b/indra/newview/res/bitmap2.bmp differ diff --git a/indra/newview/res/install_icon.BMP b/indra/newview/res/install_icon.BMP new file mode 100644 index 0000000000000000000000000000000000000000..09df573870e6aac8b5ea331fd143fd0ae4cd095e Binary files /dev/null and b/indra/newview/res/install_icon.BMP differ diff --git a/indra/newview/res/loginbackground.bmp b/indra/newview/res/loginbackground.bmp new file mode 100644 index 0000000000000000000000000000000000000000..288a0b03987b51f440e19130bd603a698f25d5ed Binary files /dev/null and b/indra/newview/res/loginbackground.bmp differ diff --git a/indra/newview/res/uninstall_icon.BMP b/indra/newview/res/uninstall_icon.BMP new file mode 100644 index 0000000000000000000000000000000000000000..562b56676a9a87037f773cdd4ce2f2f1ba66b9d3 Binary files /dev/null and b/indra/newview/res/uninstall_icon.BMP differ diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index cf9466fad37e146d29d16f6475fe1d863a1da2cf..49ea0bc8aa79e5b5d1b0c90c0a7402a66df425a5 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -1,3 +1,3157 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<settings version = "101"> -</settings> +<?xml version="1.0"?> +<llsd> + <map> + <key>AgentChatColor</key> + <map> + <key>Comment</key> + <string>Color of chat messages from other residents</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>AlertBoxColor</key> + <map> + <key>Comment</key> + <string>Alert Box Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.24</real> + <real>0.24</real> + <real>1</real> + </array> + </map> + <key>AlertCautionBoxColor</key> + <map> + <key>Comment</key> + <string>Alert Caution Box Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>0.82</real> + <real>0.46</real> + <real>1</real> + </array> + </map> + <key>AlertCautionTextColor</key> + <map> + <key>Comment</key> + <string>Alert Caution Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>AlertTextColor</key> + <map> + <key>Comment</key> + <string>Alert Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.58</real> + <real>0.66</real> + <real>0.84</real> + <real>1</real> + </array> + </map> + <key>AvatarNameColor</key> + <map> + <key>Comment</key> + <string>Avatar Name Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.98</real> + <real>0.69</real> + <real>0.36</real> + <real>1</real> + </array> + </map> + <key>BackgroundChatColor</key> + <map> + <key>Comment</key> + <string>Color of chat bubble background</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>0.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>ButtonBorderColor</key> + <map> + <key>Comment</key> + <string>Button Border Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.94</real> + <real>0.61</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>ButtonCautionImageColor</key> + <map> + <key>Comment</key> + <string>Button Caution Image Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>ButtonColor</key> + <map> + <key>Comment</key> + <string>Button Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>ButtonFlashBgColor</key> + <map> + <key>Comment</key> + <string>Button Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>0.75</real> + <real>0.24</real> + <real>0.5</real> + </array> + </map> + <key>ButtonImageColor</key> + <map> + <key>Comment</key> + <string>Button Image Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>ButtonLabelColor</key> + <map> + <key>Comment</key> + <string>Button Label Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.86</real> + <real>0.86</real> + <real>0.86</real> + <real>1</real> + </array> + </map> + <key>ButtonLabelDisabledColor</key> + <map> + <key>Comment</key> + <string>Button Label Disabled Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.58</real> + <real>0.66</real> + <real>0.84</real> + <real>0.78</real> + </array> + </map> + <key>ButtonLabelSelectedColor</key> + <map> + <key>Comment</key> + <string>Button Label Selected Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.86</real> + <real>0.86</real> + <real>0.86</real> + <real>1</real> + </array> + </map> + <key>ButtonLabelSelectedDisabledColor</key> + <map> + <key>Comment</key> + <string>Button Label Selected Disabled Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.64</real> + <real>0.75</real> + <real>0.93</real> + <real>0.78</real> + </array> + </map> + <key>ButtonSelectedBgColor</key> + <map> + <key>Comment</key> + <string>Button Selected Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.24</real> + <real>0.24</real> + <real>1</real> + </array> + </map> + <key>ButtonSelectedColor</key> + <map> + <key>Comment</key> + <string>Button Selected Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>ButtonUnselectedBgColor</key> + <map> + <key>Comment</key> + <string>Button Unselected Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.24</real> + <real>0.24</real> + <real>1</real> + </array> + </map> + <key>ButtonUnselectedFgColor</key> + <map> + <key>Comment</key> + <string>Button Unselected Fg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>ChatHistoryBgColor</key> + <map> + <key>Comment</key> + <string>Chat History Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0</real> + </array> + </map> + <key>ChatHistoryTextColor</key> + <map> + <key>Comment</key> + <string>Chat History Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>ColorDropShadow</key> + <map> + <key>Comment</key> + <string>Color Drop Shadow</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0.78</real> + </array> + </map> + <key>ColorPaletteEntry01</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>0.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry02</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.5</real> + <real>0.5</real> + <real>0.5</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry03</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.5</real> + <real>0.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry04</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.5</real> + <real>0.5</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry05</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>0.5</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry06</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>0.5</real> + <real>0.5</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry07</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>0.0</real> + <real>0.5</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry08</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.5</real> + <real>0.0</real> + <real>0.5</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry09</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.5</real> + <real>0.5</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry10</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>0.25</real> + <real>0.25</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry11</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>0.5</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry12</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>0.25</real> + <real>0.5</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry13</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.5</real> + <real>0.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry14</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.5</real> + <real>0.25</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry15</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry16</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry17</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry18</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.75</real> + <real>0.75</real> + <real>0.75</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry19</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>0.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry20</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry21</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>1.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry22</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry23</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>0.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry24</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>0.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry25</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>0.5</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry26</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>1.0</real> + <real>0.5</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry27</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.5</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry28</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.5</real> + <real>0.5</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry29</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>0.0</real> + <real>0.5</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry30</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>0.5</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry31</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>ColorPaletteEntry32</key> + <map> + <key>Comment</key> + <string>Color picker palette entry</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>ConsoleBackground</key> + <map> + <key>Comment</key> + <string>Console Background</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>ContextSilhouetteColor</key> + <map> + <key>Comment</key> + <string>Context Silhouette Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.94</real> + <real>0.61</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>DefaultHighlightDark</key> + <map> + <key>Comment</key> + <string>Default Highlight Dark</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.1</real> + <real>0.1</real> + <real>0.1</real> + <real>1</real> + </array> + </map> + <key>DefaultHighlightLight</key> + <map> + <key>Comment</key> + <string>Default Highlight Light</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.45</real> + <real>0.52</real> + <real>0.61</real> + <real>1</real> + </array> + </map> + <key>DefaultShadowDark</key> + <map> + <key>Comment</key> + <string>Default Shadow Dark</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.1</real> + <real>0.1</real> + <real>0.1</real> + <real>1</real> + </array> + </map> + <key>DefaultShadowLight</key> + <map> + <key>Comment</key> + <string>Default Shadow Light</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>EffectColor</key> + <map> + <key>Comment</key> + <string>Particle effects color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>FilterBackgroundColor</key> + <map> + <key>Comment</key> + <string>Filter Background Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0.08</real> + <real>1</real> + </array> + </map> + <key>FilterTextColor</key> + <map> + <key>Comment</key> + <string>Filter Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>0.78</real> + <real>0.27</real> + <real>1</real> + </array> + </map> + <key>FloaterButtonImageColor</key> + <map> + <key>Comment</key> + <string>Floater Button Image Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.94</real> + <real>0.61</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>FloaterDefaultBackgroundColor</key> + <map> + <key>Comment</key> + <string>Default Background Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.24</real> + <real>0.24</real> + <real>0.55</real> + </array> + </map> + <key>FloaterFocusBackgroundColor</key> + <map> + <key>Comment</key> + <string>Focus Background Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.24</real> + <real>0.24</real> + <real>1</real> + </array> + </map> + <key>FloaterFocusBorderColor</key> + <map> + <key>Comment</key> + <string>Floater Focus Border Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0.31</real> + </array> + </map> + <key>FloaterUnfocusBorderColor</key> + <map> + <key>Comment</key> + <string>Floater Unfocus Border Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0.31</real> + </array> + </map> + <key>FocusColor</key> + <map> + <key>Comment</key> + <string>Focus Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.94</real> + <real>0.61</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>FolderViewLoadingMessageTextColor</key> + <map> + <key>Comment</key> + <string>Folder View Loading Message Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.94</real> + <real>0.65</real> + <real>0.35</real> + <real>1</real> + </array> + </map> + <key>GridFocusPointColor</key> + <map> + <key>Comment</key> + <string>Grid Focus Point Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>0.5</real> + </array> + </map> + <key>GridlineBGColor</key> + <map> + <key>Comment</key> + <string>Gridline BGColor</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.92</real> + <real>0.92</real> + <real>1</real> + <real>0.78</real> + </array> + </map> + <key>GridlineColor</key> + <map> + <key>Comment</key> + <string>Gridline Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>GridlineShadowColor</key> + <map> + <key>Comment</key> + <string>Gridline Shadow Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0.31</real> + </array> + </map> + <key>GroupNotifyBoxColor</key> + <map> + <key>Comment</key> + <string>Group Notify Box Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.27</real> + <real>0.67</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>GroupNotifyTextColor</key> + <map> + <key>Comment</key> + <string>Group Notify Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0.12</real> + <real>0.24</real> + <real>1</real> + </array> + </map> + <key>GroupOverTierColor</key> + <map> + <key>Comment</key> + <string>Group Over Tier Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.43</real> + <real>0.06</real> + <real>0.06</real> + <real>1</real> + </array> + </map> + <key>HTMLLinkColor</key> + <map> + <key>Comment</key> + <string>Color of hyperlinks</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.60</real> + <real>0.60</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>HealthTextColor</key> + <map> + <key>Comment</key> + <string>Health Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>HelpBgColor</key> + <map> + <key>Comment</key> + <string>Help Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.78</real> + <real>0.82</real> + <real>0.8</real> + <real>1</real> + </array> + </map> + <key>HelpFgColor</key> + <map> + <key>Comment</key> + <string>Help Fg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>HelpScrollHighlightColor</key> + <map> + <key>Comment</key> + <string>Help Scroll Highlight Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.45</real> + <real>0.52</real> + <real>0.61</real> + <real>1</real> + </array> + </map> + <key>HelpScrollShadowColor</key> + <map> + <key>Comment</key> + <string>Help Scroll Shadow Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>HelpScrollThumbColor</key> + <map> + <key>Comment</key> + <string>Help Scroll Thumb Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.31</real> + <real>0.38</real> + <real>0.49</real> + <real>1</real> + </array> + </map> + <key>HelpScrollTrackColor</key> + <map> + <key>Comment</key> + <string>Help Scroll Track Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.72</real> + <real>0.72</real> + <real>0.74</real> + <real>1</real> + </array> + </map> + <key>HighlightChildColor</key> + <map> + <key>Comment</key> + <string>Highlight Child Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.67</real> + <real>0.83</real> + <real>0.96</real> + <real>1</real> + </array> + </map> + <key>HighlightInspectColor</key> + <map> + <key>Comment</key> + <string>Highlight Inspect Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>0</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>HighlightParentColor</key> + <map> + <key>Comment</key> + <string>Highlight Parent Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.67</real> + <real>0.83</real> + <real>0.96</real> + <real>1</real> + </array> + </map> + <key>IMChatColor</key> + <map> + <key>Comment</key> + <string>Color of instant messages from other residents</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>IMHistoryBgColor</key> + <map> + <key>Comment</key> + <string>IMHistory Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0.12</real> + <real>0.31</real> + <real>0.78</real> + </array> + </map> + <key>IMHistoryTextColor</key> + <map> + <key>Comment</key> + <string>IMHistory Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>IconDisabledColor</key> + <map> + <key>Comment</key> + <string>Icon Disabled Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.58</real> + <real>0.66</real> + <real>0.84</real> + <real>0.78</real> + </array> + </map> + <key>IconEnabledColor</key> + <map> + <key>Comment</key> + <string>Icon Enabled Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>InventoryBackgroundColor</key> + <map> + <key>Comment</key> + <string>Inventory Background Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.24</real> + <real>0.24</real> + <real>0.31</real> + </array> + </map> + <key>InventoryItemSuffixColor</key> + <map> + <key>Comment</key> + <string>Inventory Item Suffix Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.75</real> + <real>0.85</real> + <real>0.85</real> + <real>1</real> + </array> + </map> + <key>InventorySearchStatusColor</key> + <map> + <key>Comment</key> + <string>Inventory Search Status Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>LabelDisabledColor</key> + <map> + <key>Comment</key> + <string>Label Disabled Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.58</real> + <real>0.66</real> + <real>0.84</real> + <real>0.3</real> + </array> + </map> + <key>LabelSelectedColor</key> + <map> + <key>Comment</key> + <string>Label Selected Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>LabelSelectedDisabledColor</key> + <map> + <key>Comment</key> + <string>Label Selected Disabled Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.64</real> + <real>0.75</real> + <real>0.93</real> + <real>0.5</real> + </array> + </map> + <key>LabelTextColor</key> + <map> + <key>Comment</key> + <string>Label Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.58</real> + <real>0.66</real> + <real>0.84</real> + <real>1</real> + </array> + </map> + <key>LoginProgressBarBgColor</key> + <map> + <key>Comment</key> + <string>Login Progress Bar Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>LoginProgressBarFgColor</key> + <map> + <key>Comment</key> + <string>Login Progress Bar Fg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>LoginProgressBoxBorderColor</key> + <map> + <key>Comment</key> + <string>Login Progress Box Border Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0.12</real> + <real>0.24</real> + <real>0</real> + </array> + </map> + <key>LoginProgressBoxCenterColor</key> + <map> + <key>Comment</key> + <string>Login Progress Box Center Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0.78</real> + </array> + </map> + <key>LoginProgressBoxShadowColor</key> + <map> + <key>Comment</key> + <string>Login Progress Box Shadow Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0.78</real> + </array> + </map> + <key>LoginProgressBoxTextColor</key> + <map> + <key>Comment</key> + <string>Login Progress Box Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + + <key>MapAvatarColor</key> + <map> + <key>Comment</key> + <string>Color of chat messages from other residents</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>1.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>MapAvatarFriendColor</key> + <map> + <key>Comment</key> + <string>Color of chat messages from other residents</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>MapAvatarSelfColor</key> + <map> + <key>Comment</key> + <string>Color of chat messages from other residents</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>MapFrustumColor</key> + <map> + <key>Comment</key> + <string>Color of chat messages from other residents</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>0.1</real> + </array> + </map> + <key>MapFrustumRotatingColor</key> + <map> + <key>Comment</key> + <string>Color of chat messages from other residents</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>0.2</real> + </array> + </map> + <key>MapTrackColor</key> + <map> + <key>Comment</key> + <string>Color of chat messages from other residents</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>0.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>MapTrackDisabledColor</key> + <map> + <key>Comment</key> + <string>Color of chat messages from other residents</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.5</real> + <real>0.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + + + <key>MenuBarBgColor</key> + <map> + <key>Comment</key> + <string>Menu Bar Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.24</real> + <real>0.24</real> + <real>1</real> + </array> + </map> + <key>MenuBarGodBgColor</key> + <map> + <key>Comment</key> + <string>Menu Bar God Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.5</real> + <real>0.24</real> + <real>1</real> + </array> + </map> + <key>MenuDefaultBgColor</key> + <map> + <key>Comment</key> + <string>Menu Default Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>MenuItemDisabledColor</key> + <map> + <key>Comment</key> + <string>Menu Item Disabled Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.52</real> + <real>0.52</real> + <real>0.64</real> + <real>0.5</real> + </array> + </map> + <key>MenuItemEnabledColor</key> + <map> + <key>Comment</key> + <string>Menu Item Enabled Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>MenuItemHighlightBgColor</key> + <map> + <key>Comment</key> + <string>Menu Item Highlight Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.72</real> + <real>0.72</real> + <real>0.74</real> + <real>0.39</real> + </array> + </map> + <key>MenuItemHighlightFgColor</key> + <map> + <key>Comment</key> + <string>Menu Item Highlight Fg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>MenuNonProductionBgColor</key> + <map> + <key>Comment</key> + <string>Menu Non Production Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.5</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>MenuNonProductionGodBgColor</key> + <map> + <key>Comment</key> + <string>Menu Non Production God Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0.5</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>MenuPopupBgColor</key> + <map> + <key>Comment</key> + <string>Menu Popup Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>MultiSliderDisabledThumbColor</key> + <map> + <key>Comment</key> + <string>Multi Slider Disabled Thumb Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>MultiSliderThumbCenterColor</key> + <map> + <key>Comment</key> + <string>Multi Slider Thumb Center Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.72</real> + <real>0.72</real> + <real>0.74</real> + <real>1</real> + </array> + </map> + <key>MultiSliderThumbCenterSelectedColor</key> + <map> + <key>Comment</key> + <string>Multi Slider Thumb Center Selected Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>0.2</real> + <real>0.2</real> + <real>1</real> + </array> + </map> + <key>MultiSliderThumbOutlineColor</key> + <map> + <key>Comment</key> + <string>Multi Slider Thumb Outline Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>MultiSliderTrackColor</key> + <map> + <key>Comment</key> + <string>Multi Slider Track Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.12</real> + <real>0.12</real> + <real>0.12</real> + <real>1</real> + </array> + </map> + <key>MultiSliderTriangleColor</key> + <map> + <key>Comment</key> + <string>Multi Slider Triangle Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>0.2</real> + <real>1</real> + </array> + </map> + <key>NetMapBackgroundColor</key> + <map> + <key>Comment</key> + <string>Net Map Background Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0.3</real> + </array> + </map> + <key>NetMapGroupOwnAboveWater</key> + <map> + <key>Comment</key> + <string>Net Map Group Own Above Water</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>0</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>NetMapGroupOwnBelowWater</key> + <map> + <key>Comment</key> + <string>Net Map Group Own Below Water</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.78</real> + <real>0</real> + <real>0.78</real> + <real>1</real> + </array> + </map> + <key>NetMapOtherOwnAboveWater</key> + <map> + <key>Comment</key> + <string>Net Map Other Own Above Water</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.24</real> + <real>0.24</real> + <real>1</real> + </array> + </map> + <key>NetMapOtherOwnBelowWater</key> + <map> + <key>Comment</key> + <string>Net Map Other Own Below Water</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.12</real> + <real>0.12</real> + <real>0.12</real> + <real>1</real> + </array> + </map> + <key>NetMapYouOwnAboveWater</key> + <map> + <key>Comment</key> + <string>Net Map You Own Above Water</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>NetMapYouOwnBelowWater</key> + <map> + <key>Comment</key> + <string>Net Map You Own Below Water</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0.78</real> + <real>0.78</real> + <real>1</real> + </array> + </map> + <key>NotifyBoxColor</key> + <map> + <key>Comment</key> + <string>Notify Box Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.27</real> + <real>0.67</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>NotifyCautionBoxColor</key> + <map> + <key>Comment</key> + <string>Notify Caution Box Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>0.82</real> + <real>0.46</real> + <real>1</real> + </array> + </map> + <key>NotifyCautionWarnColor</key> + <map> + <key>Comment</key> + <string>Notify Caution Warn Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>NotifyTextColor</key> + <map> + <key>Comment</key> + <string>Notify Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>ObjectChatColor</key> + <map> + <key>Comment</key> + <string>Color of chat messages from objects</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.7</real> + <real>0.9</real> + <real>0.7</real> + <real>1.0</real> + </array> + </map> + <key>OverdrivenColor</key> + <map> + <key>Comment</key> + <string>Color of various indicators when resident is speaking too loud.</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>0.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>PanelDefaultBackgroundColor</key> + <map> + <key>Comment</key> + <string>Default Background Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.24</real> + <real>0.24</real> + <real>0.55</real> + </array> + </map> + <key>PanelDefaultHighlightLight</key> + <map> + <key>Comment</key> + <string>Default Highlight Light</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.45</real> + <real>0.52</real> + <real>0.61</real> + <real>1</real> + </array> + </map> + <key>PanelFocusBackgroundColor</key> + <map> + <key>Comment</key> + <string>Focus Background Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.24</real> + <real>0.24</real> + <real>1</real> + </array> + </map> + <key>ParcelHoverColor</key> + <map> + <key>Comment</key> + <string>Parcel Hover Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>PieMenuBgColor</key> + <map> + <key>Comment</key> + <string>Pie Menu Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.24</real> + <real>0.24</real> + <real>0.59</real> + </array> + </map> + <key>PieMenuLineColor</key> + <map> + <key>Comment</key> + <string>Pie Menu Line Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0.5</real> + </array> + </map> + <key>PieMenuSelectedColor</key> + <map> + <key>Comment</key> + <string>Pie Menu Selected Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.72</real> + <real>0.72</real> + <real>0.74</real> + <real>0.3</real> + </array> + </map> + <key>PropertyColorAuction</key> + <map> + <key>Comment</key> + <string>Property Color Auction</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.50</real> + <real>0</real> + <real>1</real> + <real>0.4</real> + </array> + </map> + <key>PropertyColorAvail</key> + <map> + <key>Comment</key> + <string>Property Color Avail</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0</real> + </array> + </map> + <key>PropertyColorForSale</key> + <map> + <key>Comment</key> + <string>Property Color For Sale</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>0.50</real> + <real>0</real> + <real>0.4</real> + </array> + </map> + <key>PropertyColorGroup</key> + <map> + <key>Comment</key> + <string>Property Color Group</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0.72</real> + <real>0.72</real> + <real>0.4</real> + </array> + </map> + <key>PropertyColorOther</key> + <map> + <key>Comment</key> + <string>Property Color Other</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>0</real> + <real>0</real> + <real>0.4</real> + </array> + </map> + <key>PropertyColorSelf</key> + <map> + <key>Comment</key> + <string>Property Color Self</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>1</real> + <real>0</real> + <real>0.4</real> + </array> + </map> + <key>RenderGlowLumWeights</key> + <map> + <key>Comment</key> + <string>Weights for each color channel to be used in calculating luminance (should add up to 1.0)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>0.299</real> + <real>0.587</real> + <real>0.114</real> + </array> + </map> + <key>RenderGlowWarmthWeights</key> + <map> + <key>Comment</key> + <string>Weight of each color channel used before finding the max warmth</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>0.5</real> + <real>0.7</real> + </array> + </map> + <key>ScriptBgReadOnlyColor</key> + <map> + <key>Comment</key> + <string>Script Bg Read Only Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.39</real> + <real>0.39</real> + <real>0.39</real> + <real>1</real> + </array> + </map> + <key>ScriptErrorColor</key> + <map> + <key>Comment</key> + <string>Color of script error messages</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.82</real> + <real>0.27</real> + <real>0.27</real> + <real>1.0</real> + </array> + </map> + <key>ScrollBGStripeColor</key> + <map> + <key>Comment</key> + <string>Scroll BGStripe Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.39</real> + <real>0.39</real> + <real>0.39</real> + <real>0.16</real> + </array> + </map> + <key>ScrollBgReadOnlyColor</key> + <map> + <key>Comment</key> + <string>Scroll Bg Read Only Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.78</real> + <real>0.82</real> + <real>0.8</real> + <real>1</real> + </array> + </map> + <key>ScrollBgWriteableColor</key> + <map> + <key>Comment</key> + <string>Scroll Bg Writeable Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.78</real> + <real>0.82</real> + <real>0.8</real> + <real>1</real> + </array> + </map> + <key>ScrollDisabledColor</key> + <map> + <key>Comment</key> + <string>Scroll Disabled Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.5</real> + <real>0.5</real> + <real>0.5</real> + <real>0.8</real> + </array> + </map> + <key>ScrollHighlightedColor</key> + <map> + <key>Comment</key> + <string>Scroll Highlighted Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.72</real> + <real>0.72</real> + <real>0.74</real> + <real>0.5</real> + </array> + </map> + <key>ScrollHoveredColor</key> + <map> + <key>Comment</key> + <string>Scroll Hovered Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.72</real> + <real>0.72</real> + <real>0.74</real> + <real>0.5</real> + </array> + </map> + <key>ScrollSelectedBGColor</key> + <map> + <key>Comment</key> + <string>Scroll Selected BGColor</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.39</real> + <real>0.39</real> + <real>0.74</real> + <real>0.59</real> + </array> + </map> + <key>ScrollSelectedFGColor</key> + <map> + <key>Comment</key> + <string>Scroll Selected FGColor</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0.8</real> + </array> + </map> + <key>ScrollUnselectedColor</key> + <map> + <key>Comment</key> + <string>Scroll Unselected Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0.8</real> + </array> + </map> + <key>ScrollbarThumbColor</key> + <map> + <key>Comment</key> + <string>Scrollbar Thumb Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.3</real> + <real>0.49</real> + <real>1</real> + </array> + </map> + <key>ScrollbarTrackColor</key> + <map> + <key>Comment</key> + <string>Scrollbar Track Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.6</real> + <real>0.6</real> + <real>0.62</real> + <real>1</real> + </array> + </map> + <key>SilhouetteChildColor</key> + <map> + <key>Comment</key> + <string>Silhouette Child Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.13</real> + <real>0.42</real> + <real>0.77</real> + <real>1</real> + </array> + </map> + <key>SilhouetteParentColor</key> + <map> + <key>Comment</key> + <string>Silhouette Parent Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>SkyNightColorShift</key> + <map> + <key>Comment</key> + <string>Controls moonlight color (base color applied to moon as light source)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color3</string> + <key>Value</key> + <array> + <real>0.67</real> + <real>0.67</real> + <real>1.0</real> + </array> + </map> + <key>SliderDisabledThumbColor</key> + <map> + <key>Comment</key> + <string>Slider Disabled Thumb Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>SliderThumbCenterColor</key> + <map> + <key>Comment</key> + <string>Slider Thumb Center Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.78</real> + <real>0.78</real> + <real>0.78</real> + <real>1</real> + </array> + </map> + <key>SliderThumbOutlineColor</key> + <map> + <key>Comment</key> + <string>Slider Thumb Outline Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>SliderTrackColor</key> + <map> + <key>Comment</key> + <string>Slider Track Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>SpeakingColor</key> + <map> + <key>Comment</key> + <string>Color of various indicators when resident is speaking on a voice channel.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.0</real> + <real>1.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> + <key>SystemChatColor</key> + <map> + <key>Comment</key> + <string>Color of chat messages from SL System</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.800000011921</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>TextBgFocusColor</key> + <map> + <key>Comment</key> + <string>Text Bg Focus Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.78</real> + <real>0.82</real> + <real>0.8</real> + <real>1</real> + </array> + </map> + <key>TextBgReadOnlyColor</key> + <map> + <key>Comment</key> + <string>Text Bg Read Only Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.24</real> + <real>0.24</real> + <real>0.24</real> + <real>0.63</real> + </array> + </map> + <key>TextBgWriteableColor</key> + <map> + <key>Comment</key> + <string>Text Bg Writeable Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.78</real> + <real>0.82</real> + <real>0.8</real> + <real>0.9</real> + </array> + </map> + <key>TextCursorColor</key> + <map> + <key>Comment</key> + <string>Text Cursor Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>TextDefaultColor</key> + <map> + <key>Comment</key> + <string>Text Default Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0.08</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>TextEmbeddedItemColor</key> + <map> + <key>Comment</key> + <string>Text Embedded Item Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0.5</real> + <real>1</real> + </array> + </map> + <key>TextEmbeddedItemReadOnlyColor</key> + <map> + <key>Comment</key> + <string>Text Embedded Item Read Only Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.23</real> + <real>0.58</real> + <real>0.95</real> + <real>1</real> + </array> + </map> + <key>TextFgColor</key> + <map> + <key>Comment</key> + <string>Text Fg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>TextFgReadOnlyColor</key> + <map> + <key>Comment</key> + <string>Text Fg Read Only Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>0.78</real> + </array> + </map> + <key>TextFgTentativeColor</key> + <map> + <key>Comment</key> + <string>Text Fg Tentative Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>0.5</real> + </array> + </map> + <key>TimeTextColor</key> + <map> + <key>Comment</key> + <string>Time Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> + <key>TitleBarFocusColor</key> + <map> + <key>Comment</key> + <string>Title Bar Focus Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>0.12</real> + </array> + </map> + <key>ToolTipBgColor</key> + <map> + <key>Comment</key> + <string>Tool Tip Bg Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.72</real> + <real>0.72</real> + <real>0.74</real> + <real>0.78</real> + </array> + </map> + <key>ToolTipBorderColor</key> + <map> + <key>Comment</key> + <string>Tool Tip Border Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.67</real> + <real>0.83</real> + <real>0.96</real> + <real>1</real> + </array> + </map> + <key>ToolTipTextColor</key> + <map> + <key>Comment</key> + <string>Tool Tip Text Color</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + </map> + <key>UserChatColor</key> + <map> + <key>Comment</key> + <string>Color of your chat messages</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + <real>1.0</real> + </array> + </map> + <key>llOwnerSayChatColor</key> + <map> + <key>Comment</key> + <string>Color of chat messages from objects only visible to the owner</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>0.99</real> + <real>0.99</real> + <real>0.67</real> + <real>1.0</real> + </array> + </map> + </map> +</llsd> diff --git a/indra/newview/skins/default/textures/jump_left_in.tga b/indra/newview/skins/default/textures/jump_left_in.tga new file mode 100644 index 0000000000000000000000000000000000000000..e0656c901dfccea9fbdeadb68d058ca6bf1bcc19 Binary files /dev/null and b/indra/newview/skins/default/textures/jump_left_in.tga differ diff --git a/indra/newview/skins/default/textures/jump_left_out.tga b/indra/newview/skins/default/textures/jump_left_out.tga new file mode 100644 index 0000000000000000000000000000000000000000..fb6dac0c3d2f654dcd2fa686706e432ad21f99df Binary files /dev/null and b/indra/newview/skins/default/textures/jump_left_out.tga differ diff --git a/indra/newview/skins/default/textures/jump_right_in.tga b/indra/newview/skins/default/textures/jump_right_in.tga new file mode 100644 index 0000000000000000000000000000000000000000..010c748c2a127bd8f2d2bac4ffcf4ffcc78e8b9e Binary files /dev/null and b/indra/newview/skins/default/textures/jump_right_in.tga differ diff --git a/indra/newview/skins/default/textures/jump_right_out.tga b/indra/newview/skins/default/textures/jump_right_out.tga new file mode 100644 index 0000000000000000000000000000000000000000..33355262d41e333dc0700867d2a40bf2ad114d77 Binary files /dev/null and b/indra/newview/skins/default/textures/jump_right_out.tga differ diff --git a/indra/newview/skins/default/textures/menu_separator.png b/indra/newview/skins/default/textures/menu_separator.png new file mode 100644 index 0000000000000000000000000000000000000000..89dcdcdff5f3169619732dca5ca11fa0268c3504 Binary files /dev/null and b/indra/newview/skins/default/textures/menu_separator.png differ diff --git a/indra/newview/skins/default/textures/show_btn.tga b/indra/newview/skins/default/textures/show_btn.tga new file mode 100644 index 0000000000000000000000000000000000000000..5f05f377e31714b3c1b80d673c32cda4f4a28824 Binary files /dev/null and b/indra/newview/skins/default/textures/show_btn.tga differ diff --git a/indra/newview/skins/default/textures/show_btn_selected.tga b/indra/newview/skins/default/textures/show_btn_selected.tga new file mode 100644 index 0000000000000000000000000000000000000000..00a2f34a37ea70acb34c6d5a7cf8b7c169f8a82d Binary files /dev/null and b/indra/newview/skins/default/textures/show_btn_selected.tga differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 34c9dea7e64fc878fef538bdcc372e562bcdac21..84dd3ffd7a849ea01823173ed1ce431a57581424 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -1,21 +1,21 @@ <textures version="101"> - <texture name="icn_scrollbar_thumb.tga" preload="true" scale_top="7" scale_left="4" scale_bottom="8" scale_right="4" /> - <texture name="icn_scrollbar_bg.tga" preload="true" scale_top="7" scale_left="4" scale_bottom="8" scale_right="4" /> - <texture name="sm_rounded_corners_simple.tga" scale_left="4" scale_top="4" scale_bottom="4" scale_right="4"/> - <texture name="icn_textfield_enabled.tga" scale_left="5" scale_top="5" scale_bottom="5" scale_right="5"/> + <texture name="icn_scrollbar_thumb.tga" preload="true" scale.top="7" scale.left="4" scale.bottom="8" scale.right="4" /> + <texture name="icn_scrollbar_bg.tga" preload="true" scale.top="7" scale.left="4" scale.bottom="8" scale.right="4" /> + <texture name="sm_rounded_corners_simple.tga" scale.left="4" scale.top="4" scale.bottom="4" scale.right="4"/> + <texture name="icn_textfield_enabled.tga" scale.left="5" scale.top="5" scale.bottom="5" scale.right="5"/> - <texture name="button_disabled_32x128.tga" preload="true" scale_left="16" scale_top="16" scale_right="112" scale_bottom="16" /> + <texture name="button_disabled_32x128.tga" preload="true" scale.left="16" scale.top="16" scale.right="112" scale.bottom="16" /> - <texture name="button_enabled_32x128.tga" preload="true" scale_left="16" scale_top="16" scale_right="112" scale_bottom="16" /> + <texture name="button_enabled_32x128.tga" preload="true" scale.left="16" scale.top="16" scale.right="112" scale.bottom="16" /> - <texture name="toolbar_btn_enabled.tga" scale_left="7" scale_top="32" scale_right="121" scale_bottom="0" /> + <texture name="toolbar_btn_enabled.tga" scale.left="7" scale.top="32" scale.right="121" scale.bottom="0" /> - <texture name="toolbar_btn_disabled.tga" scale_left="7" scale_top="32" scale_right="121" scale_bottom="0" /> + <texture name="toolbar_btn_disabled.tga" scale.left="7" scale.top="32" scale.right="121" scale.bottom="0" /> - <texture name="toolbar_btn_selected.tga" scale_left="7" scale_top="32" scale_right="121" scale_bottom="0" /> + <texture name="toolbar_btn_selected.tga" scale.left="7" scale.top="32" scale.right="121" scale.bottom="0" /> - <texture name="button_enabled_selected_32x128.tga" preload="true" scale_left="16" scale_top="16" scale_right="112" scale_bottom="16" /> + <texture name="button_enabled_selected_32x128.tga" preload="true" scale.left="16" scale.top="16" scale.right="112" scale.bottom="16" /> <texture name="checkbox_disabled_false.tga" preload="true"/> <texture name="checkbox_disabled_true.tga" preload="true"/> @@ -23,7 +23,8 @@ <texture name="checkbox_enabled_true.tga" preload="true"/> <texture name="close_in_blue.tga" preload="true"/> - + + <texture name="minimize_inactive.tga" preload="true"/> <texture name="minimize.tga" preload="true"/> <texture name="minimize_pressed.tga" preload="true"/> @@ -36,15 +37,15 @@ <texture name="resize_handle_bottom_right_blue.tga" preload="true"/> - <texture name="rounded_square.tga" file_name="rounded_square.j2c" preload="true" scale_left="16" scale_top="16" scale_right="112" scale_bottom="16"/> + <texture name="rounded_square.tga" file_name="rounded_square.j2c" preload="true" scale.left="16" scale.top="16" scale.right="112" scale.bottom="16"/> - <texture name="rounded_square_soft.tga" file_name="rounded_square_soft.j2c" preload="true" scale_left="16" scale_top="16" scale_right="112" scale_bottom="16"/> + <texture name="rounded_square_soft.tga" file_name="rounded_square_soft.j2c" preload="true" scale.left="16" scale.top="16" scale.right="112" scale.bottom="16"/> - <texture name="toolbar_tab.tga" preload="true" scale_left="6" scale_top="42" scale_right="104" scale_bottom="8"/> - <texture name="toolbar_bg.tga" preload="true" scale_left="6" scale_top="42" scale_right="96" scale_bottom="16"/> + <texture name="toolbar_tab.tga" preload="true" scale.left="6" scale.top="42" scale.right="104" scale.bottom="8"/> + <texture name="toolbar_bg.tga" preload="true" scale.left="6" scale.top="42" scale.right="96" scale.bottom="16"/> - <texture name="progressbar_fill.tga" preload="true" scale_left="10" scale_top="7" scale_right="65" scale_bottom="7"/> - <texture name="progressbar_track.tga" preload="true" scale_left="10" scale_top="7" scale_right="80" scale_bottom="7"/> + <texture name="progressbar_fill.tga" preload="true" scale.left="10" scale.top="7" scale.right="65" scale.bottom="7"/> + <texture name="progressbar_track.tga" preload="true" scale.left="10" scale.top="7" scale.right="80" scale.bottom="7"/> <texture name="scrollbutton_down_in_blue.tga" preload="true"/> <texture name="scrollbutton_down_out_blue.tga" preload="true"/> @@ -59,15 +60,15 @@ <texture name="spin_up_in_blue.tga" preload="true"/> <texture name="spin_up_out_blue.tga" preload="true"/> - <texture name="square_btn_32x128.tga" preload="true" scale_left="8" scale_top="10" scale_right="120" scale_bottom="10"/> - <texture name="square_btn_selected_32x128.tga" preload="true" scale_left="2" scale_top="10" scale_right="126" scale_bottom="10"/> + <texture name="square_btn_32x128.tga" preload="true" scale.left="8" scale.top="10" scale.right="120" scale.bottom="10"/> + <texture name="square_btn_selected_32x128.tga" preload="true" scale.left="2" scale.top="10" scale.right="126" scale.bottom="10"/> - <texture name="tab_bottom_blue.tga" preload="true" scale_left="8" scale_top="8" scale_right="120" scale_bottom="9"/> - <texture name="tab_bottom_selected_blue.tga" preload="true" scale_left="8" scale_top="8" scale_right="96" scale_bottom="9"/> - <texture name="tab_left.tga" preload="true" scale_left="8" scale_top="8" scale_right="120" scale_bottom="9"/> - <texture name="tab_left_selected.tga" preload="true" scale_left="8" scale_top="8" scale_right="96" scale_bottom="9"/> - <texture name="tab_top_blue.tga" preload="true" scale_left="8" scale_top="8" scale_right="120" scale_bottom="9"/> - <texture name="tab_top_selected_blue.tga" preload="true" scale_left="8" scale_top="8" scale_right="96" scale_bottom="9"/> + <texture name="tab_bottom_blue.tga" preload="true" scale.left="8" scale.top="8" scale.right="120" scale.bottom="9"/> + <texture name="tab_bottom_selected_blue.tga" preload="true" scale.left="8" scale.top="8" scale.right="96" scale.bottom="9"/> + <texture name="tab_left.tga" preload="true" scale.left="8" scale.top="8" scale.right="120" scale.bottom="9"/> + <texture name="tab_left_selected.tga" preload="true" scale.left="8" scale.top="8" scale.right="96" scale.bottom="9"/> + <texture name="tab_top_blue.tga" preload="true" scale.left="8" scale.top="8" scale.right="120" scale.bottom="9"/> + <texture name="tab_top_selected_blue.tga" preload="true" scale.left="8" scale.top="8" scale.right="96" scale.bottom="9"/> <texture name="startup_logo.j2c" preload="true"/> <texture name="color_swatch_alpha.tga" preload="true"/> @@ -236,9 +237,9 @@ <texture name="mute_icon.tga"/> - <texture name="icn_slide-groove_dark.tga" scale_left="2" scale_top="5" scale_right="29" scale_bottom="4"/> - <texture name="icn_slide-highlight.tga" scale_left="2" scale_top="5" scale_right="29" scale_bottom="4"/> - <texture name="icn_slide-thumb_dark.tga" scale_left="2" scale_top="5" scale_right="29" scale_bottom="4"/> + <texture name="icn_slide-groove_dark.tga" scale.left="2" scale.top="5" scale.right="29" scale.bottom="4"/> + <texture name="icn_slide-highlight.tga" scale.left="2" scale.top="5" scale.right="29" scale.bottom="4"/> + <texture name="icn_slide-thumb_dark.tga" scale.left="2" scale.top="5" scale.right="29" scale.bottom="4"/> <texture name="icn_speaker-muted_dark.tga"/> <texture name="icn_speaker_dark.tga"/> @@ -255,39 +256,32 @@ <texture name="icn_media_movie.tga" preload="true"/> <texture name="icn_chatbar.tga"/> - <texture name="btn_chatbar.tga" scale_left="20" scale_top="24" scale_right="44" scale_bottom="0"/> - <texture name="btn_chatbar_selected.tga" scale_left="20" scale_top="24" scale_right="44" scale_bottom="0"/> + <texture name="btn_chatbar.tga" scale.left="20" scale.top="24" scale.right="44" scale.bottom="0"/> + <texture name="btn_chatbar_selected.tga" scale.left="20" scale.top="24" scale.right="44" scale.bottom="0"/> - <texture name="icn_rounded-text-field.tga"/> + <texture name="icn_rounded-text-field.tga" scale.left="14" scale.bottom="16" scale.top="16" scale.right="114"/> - <texture name="flyout_btn_right_selected.tga" scale_left="0" scale_top="30" scale_right="32" scale_bottom="0"/> - - <texture name="flyout_btn_right.tga" scale_left="0" scale_top="30" scale_right="32" scale_bottom="0"/> - - <texture name="flyout_btn_right_disabled.tga" scale_left="0" scale_top="30" scale_right="32" scale_bottom="0"/> - - <texture name="flyout_btn_left_selected.tga" scale_left="16" scale_top="15" scale_right="112" scale_bottom="15"/> - - <texture name="flyout_btn_left.tga" scale_left="16" scale_top="15" scale_right="112" scale_bottom="15"/> - - <texture name="flyout_btn_left_disabled.tga" scale_left="16" scale_top="15" scale_right="112" scale_bottom="15"/> - - <texture name="UIImgResizeBottomRightUUID" file_name="resize_handle_bottom_right_blue.tga"/> + <texture name="flyout_btn_right_selected.tga" scale.left="0" scale.top="30" scale.right="32" scale.bottom="0"/> + <texture name="flyout_btn_right.tga" scale.left="0" scale.top="30" scale.right="32" scale.bottom="0"/> + <texture name="flyout_btn_right_disabled.tga" scale.left="0" scale.top="30" scale.right="32" scale.bottom="0"/> + <texture name="flyout_btn_left_selected.tga" scale.left="16" scale.top="15" scale.right="112" scale.bottom="15"/> + <texture name="flyout_btn_left.tga" scale.left="16" scale.top="15" scale.right="112" scale.bottom="15"/> + <texture name="flyout_btn_left_disabled.tga" scale.left="16" scale.top="15" scale.right="112" scale.bottom="15"/> - <texture name="UIImgBtnForwardOutUUID" file_name="move_forward_out.tga" preload="true"/> - <texture name="UIImgBtnForwardInUUID" file_name="move_forward_in.tga" preload="true"/> - <texture name="UIImgBtnSlideLeftOutUUID" file_name="move_left_out.tga" preload="true"/> - <texture name="UIImgBtnSlideLeftInUUID" file_name="move_left_in.tga" preload="true"/> - <texture name="UIImgBtnLeftOutUUID" file_name="move_turn_left_out.tga" preload="true"/> - <texture name="UIImgBtnLeftInUUID" file_name="move_turn_left_in.tga" preload="true"/> - <texture name="UIImgBtnRightOutUUID" file_name="move_turn_right_out.tga" preload="true"/> - <texture name="UIImgBtnRightInUUID" file_name="move_turn_right_in.tga" preload="true"/> - <texture name="UIImgBtnSlideRightOutUUID" file_name="move_right_out.tga" preload="true"/> - <texture name="UIImgBtnSlideRightInUUID" file_name="move_right_in.tga" preload="true"/> - <texture name="UIImgBtnMoveUpInUUID" file_name="move_up_in.tga" preload="true"/> - <texture name="UIImgBtnMoveUpOutUUID" file_name="move_up_out.tga" preload="true"/> - <texture name="UIImgBtnMoveDownInUUID" file_name="move_down_in.tga" preload="true"/> - <texture name="UIImgBtnMoveDownOutUUID" file_name="move_down_out.tga" preload="true"/> + <texture name="move_forward_out.tga" preload="true"/> + <texture name="move_forward_in.tga" preload="true"/> + <texture name="move_left_out.tga" preload="true"/> + <texture name="move_left_in.tga" preload="true"/> + <texture name="move_turn_left_out.tga" preload="true"/> + <texture name="move_turn_left_in.tga" preload="true"/> + <texture name="move_turn_right_out.tga" preload="true"/> + <texture name="move_turn_right_in.tga" preload="true"/> + <texture name="move_right_out.tga" preload="true"/> + <texture name="move_right_in.tga" preload="true"/> + <texture name="move_up_in.tga" preload="true"/> + <texture name="move_up_out.tga" preload="true"/> + <texture name="move_down_in.tga" preload="true"/> + <texture name="move_down_out.tga" preload="true"/> <texture name="cam_rotate_out.tga" preload="true"/> <texture name="cam_rotate_in.tga" preload="true"/> @@ -295,82 +289,49 @@ <texture name="cam_zoom_plus_in.tga" preload="true"/> <texture name="cam_zoom_minus_in.tga" preload="true"/> - <texture name="UIImgBtnScrollUpOutUUID" file_name="scrollbutton_up_out_blue.tga"/> - <texture name="UIImgBtnScrollUpInUUID" file_name="scrollbutton_up_in_blue.tga"/> - <texture name="UIImgBtnScrollDownOutUUID" file_name="scrollbutton_down_out_blue.tga"/> - <texture name="UIImgBtnScrollDownInUUID" file_name="scrollbutton_down_in_blue.tga"/> - <texture name="UIImgBtnScrollLeftOutUUID" file_name="scrollbutton_left_out_blue.tga"/> - <texture name="UIImgBtnScrollLeftInUUID" file_name="scrollbutton_left_in_blue.tga"/> - <texture name="UIImgBtnScrollRightOutUUID" file_name="scrollbutton_right_out_blue.tga"/> - <texture name="UIImgBtnScrollRightInUUID" file_name="scrollbutton_right_in_blue.tga"/> - - <texture name="UIImgBtnJumpLeftOutUUID" file_name="3c18c87e-5f50-14e2-e744-f44734aa365f.tga"/> - <texture name="UIImgBtnJumpLeftInUUID" file_name="9cad3e6d-2d6d-107d-f8ab-5ba272b5bfe1.tga"/> - <texture name="UIImgBtnJumpRightOutUUID" file_name="ff9a71eb-7414-4cf8-866e-a701deb7c3cf.tga"/> - <texture name="UIImgBtnJumpRightInUUID" file_name="7dabc040-ec13-2309-ddf7-4f161f6de2f4.tga"/> - - <texture name="UIImgBtnSpinUpOutUUID" file_name="spin_up_out_blue.tga"/> - <texture name="UIImgBtnSpinUpInUUID" file_name="spin_up_in_blue.tga"/> - <texture name="UIImgBtnSpinDownOutUUID" file_name="spin_down_out_blue.tga"/> - <texture name="UIImgBtnSpinDownInUUID" file_name="spin_down_in_blue.tga"/> + <texture name="jump_left_out.tga"/> + <texture name="jump_left_in.tga"/> + <texture name="jump_right_out.tga"/> + <texture name="jump_right_in.tga"/> - <texture name="UIImgRadioActiveUUID" file_name="radio_active_false.tga"/> - <texture name="UIImgRadioActiveSelectedUUID" file_name="radio_active_true.tga"/> - <texture name="UIImgRadioInactiveUUID" file_name="radio_inactive_false.tga"/> - <texture name="UIImgRadioInactiveSelectedUUID" file_name="radio_inactive_true.tga"/> + <texture name="tool_grab.tga"/> + <texture name="tool_grab_active.tga"/> - <texture name="UIImgCheckboxActiveUUID" file_name="checkbox_enabled_false.tga"/> - <texture name="UIImgCheckboxActiveSelectedUUID" file_name="checkbox_enabled_true.tga"/> - <texture name="UIImgCheckboxInactiveUUID" file_name="checkbox_disabled_false.tga"/> - <texture name="UIImgCheckboxInactiveSelectedUUID" file_name="checkbox_disabled_true.tga"/> + <texture name="tool_face.tga"/> + <texture name="tool_face_active.tga"/> - <texture name="UIImgBtnTabTopOutUUID" file_name="tab_top_blue.tga"/> - <texture name="UIImgBtnTabTopInUUID" file_name="tab_top_selected_blue.tga"/> - <texture name="UIImgBtnTabBottomOutUUID" file_name="tab_bottom_blue.tga"/> - <texture name="UIImgBtnTabBottomInUUID" file_name="tab_bottom_selected_blue.tga"/> + <texture name="tool_create.tga"/> + <texture name="tool_create_active.tga"/> - <texture name="UIImgGrabUUID" file_name="c63f124c-6340-4fbf-b59e-0869a44adb64.tga"/> - <texture name="UIImgGrabSelectedUUID" file_name="c1e21504-f136-451d-b8e9-929037812f1d.tga"/> - - <!--<texture name="UIImgScaleUUID" file_name="88a90fef-b448-4883-9344-ecf378a60433.tga"/>--> - - <texture name="UIImgFaceUUID" file_name="ce15fd63-b0b6-463c-a37d-ea6393208b3e.tga"/> - <texture name="UIImgFaceSelectedUUID" file_name="b4870163-6208-42a9-9801-93133bf9a6cd.tga"/> - - <texture name="UIImgCreateUUID" file_name="7a0b1bdb-b5d9-4df5-bac2-ba230da93b5b.tga"/> - <texture name="UIImgCreateSelectedUUID" file_name="0098b015-3daf-4cfe-a72f-915369ea97c2.tga"/> - - <texture name="UIImgBtnCloseInactiveUUID" file_name="close_inactive_blue.tga"/> - <texture name="UIImgBtnCloseActiveUUID" file_name="closebox.tga"/> - <texture name="UIImgBtnClosePressedUUID" file_name="close_in_blue.tga"/> + <texture name="close_inactive_blue.tga"/> + <texture name="closebox.tga"/> <texture name="icn_clear_lineeditor.tga" /> <texture name="up_arrow.tga" file_name="up_arrow.png"/> <texture name="down_arrow.tga" file_name="down_arrow.png"/> + <texture name="restore_inactive.tga"/> + <texture name="restore.tga"/> + <texture name="restore_pressed.tga"/> - <texture name="UIImgBtnMinimizeInactiveUUID" file_name="minimize_inactive.tga"/> - <texture name="UIImgBtnMinimizeActiveUUID" file_name="minimize.tga"/> - <texture name="UIImgBtnMinimizePressedUUID" file_name="minimize_pressed.tga"/> + <texture name="tearoffbox.tga"/> + <texture name="tearoff_pressed.tga"/> - <texture name="UIImgBtnRestoreInactiveUUID" file_name="restore_inactive.tga"/> - <texture name="UIImgBtnRestoreActiveUUID" file_name="restore.tga"/> - <texture name="UIImgBtnRestorePressedUUID" file_name="restore_pressed.tga"/> - - <texture name="UIImgBtnTearOffInactiveUUID" file_name="tearoffbox.tga"/> - <texture name="UIImgBtnTearOffActiveUUID" file_name="tearoffbox.tga"/> - <texture name="UIImgBtnTearOffPressedUUID" file_name="tearoff_pressed.tga"/> - - <texture name="UIImgCrosshairsUUID" file_name="crosshairs.tga"/> <texture name="icn_label_music.tga"/> <texture name="icn_label_media.tga"/> <texture name="arrow_down.tga"/> <texture name="cloud-particle.j2c" use_mips="true"/> <texture name="skin_thumbnail_default.png" preload="true" /> - <texture name="skin_thumbnail_silver.png" preload="true" /> <texture name="default_land_picture.j2c"/> <texture name="default_profile_picture.j2c"/> <texture name="locked_image.j2c"/> + <texture name="menu_separator" file_name="menu_separator.png"/> + + <texture name="sidebar_tab_left.tga" preload="true" scale.left="16" scale.top="8" scale.right="112" scale.bottom="9"/> + <texture name="sidebar_tab_left_selected.tga" preload="true" scale.left="16" scale.top="8" scale.right="112" scale.bottom="9"/> + + <texture name="teleport_history_backward.tga" preload="true"/> + <texture name="teleport_history_forward.tga" preload="true"/> </textures> diff --git a/indra/newview/skins/default/textures/transparent.j2c b/indra/newview/skins/default/textures/transparent.j2c new file mode 100644 index 0000000000000000000000000000000000000000..1068e940b9237289d148851aa5394c97afff506b Binary files /dev/null and b/indra/newview/skins/default/textures/transparent.j2c differ diff --git a/indra/newview/skins/default/textures/voice_meter_dot.j2c b/indra/newview/skins/default/textures/voice_meter_dot.j2c new file mode 100644 index 0000000000000000000000000000000000000000..e536c3338afbb9a958be9dbaf7afed960abce4bd Binary files /dev/null and b/indra/newview/skins/default/textures/voice_meter_dot.j2c differ diff --git a/indra/newview/skins/default/textures/voice_meter_rings.j2c b/indra/newview/skins/default/textures/voice_meter_rings.j2c new file mode 100644 index 0000000000000000000000000000000000000000..17e7c6c6a1ca686cdebd34e7bb2da4c3d1502d83 Binary files /dev/null and b/indra/newview/skins/default/textures/voice_meter_rings.j2c differ diff --git a/indra/newview/skins/default/xui/da/floater_about_land.xml b/indra/newview/skins/default/xui/da/floater_about_land.xml index 8c1ed736a38264ea497f88b2e429484767e07ae6..15ebffa302ffe95140338621c9b6a6a329f5b439 100644 --- a/indra/newview/skins/default/xui/da/floater_about_land.xml +++ b/indra/newview/skins/default/xui/da/floater_about_land.xml @@ -1,80 +1,83 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="floaterland" title="Om land"> <tab_container name="landtab"> <panel label="Generelt" name="land_general_panel"> - <text type="string" length="1" name="Name:"> + <text length="1" name="Name:" type="string"> Navn: </text> - <text type="string" length="1" name="Description:"> + <text length="1" name="Description:" type="string"> Beskrivelse: </text> - <text type="string" length="1" name="Owner:"> + <text name="LandType"> + Type: + </text> + <text name="LandTypeText"> + Mainland / Homestead + </text> + <text name="ContentRating"> + Rating: + </text> + <text name="ContentRatingText"> + Adult + </text> + <text length="1" name="Owner:" type="string"> Ejer: </text> - <text type="string" length="1" name="OwnerText"> + <text length="1" name="OwnerText" type="string"> Leyla Linden </text> - <button label="Profil..." label_selected="Profil..." name="Profile..." /> - <text type="string" length="1" name="Group:"> + <button label="Profil..." label_selected="Profil..." name="Profile..."/> + <text length="1" name="Group:" type="string"> Gruppe: </text> - <button label="Vælg..." label_selected="Vælg..." name="Set..." /> - <check_box label="Tillad dedikering til gruppe" name="check deed" - tool_tip="En gruppe administrator kan dedikere denne jord til gruppen, sÃ¥ det vil blive støttet af gruppen's jord tildeling." /> - <button label="Dedikér..." label_selected="Dedikér..." name="Deed..." - tool_tip="Du kan kun dedikere jord, hvis du er en administrator i den valgte gruppe." /> - <check_box label="Ejer bidrager ved dedikering" name="check contrib" - tool_tip="NÃ¥r land dedikeres til gruppe, kan den tidligere bidrage med nok land til at dække krav." /> - <text type="string" length="1" name="For Sale:"> + <button label="Vælg..." label_selected="Vælg..." name="Set..."/> + <check_box label="Tillad dedikering til gruppe" name="check deed" tool_tip="En gruppe administrator kan dedikere denne jord til gruppen, sÃ¥ det vil blive støttet af gruppen's jord tildeling."/> + <button label="Dedikér..." label_selected="Dedikér..." name="Deed..." tool_tip="Du kan kun dedikere jord, hvis du er en administrator i den valgte gruppe."/> + <check_box label="Ejer bidrager ved dedikering" name="check contrib" tool_tip="NÃ¥r land dedikeres til gruppe, kan den tidligere bidrage med nok land til at dække krav."/> + <text length="1" name="For Sale:" type="string"> Til salg: </text> - <text type="string" length="1" name="Not for sale."> + <text length="1" name="Not for sale." type="string"> Ikke til salg. </text> - <text type="string" length="1" name="For Sale: Price L$[PRICE]."> - Pris: L$[PRICE]. + <text length="1" name="For Sale: Price L$[PRICE]." type="string"> + Pris: L$[PRICE] (L$[PRICE_PER_SQM]/m²). </text> - <button label="Sælg land..." label_selected="Sælg land..." name="Sell Land..." /> - <text type="string" length="1" name="For sale to"> + <button label="Sælg land..." label_selected="Sælg land..." name="Sell Land..."/> + <text length="1" name="For sale to" type="string"> Til salg til: [BUYER] </text> - <text type="string" length="1" name="Sell with landowners objects in parcel."> + <text length="1" name="Sell with landowners objects in parcel." type="string"> Objekter er inkluderet i salg. </text> - <text type="string" length="1" name="Selling with no objects in parcel."> + <text length="1" name="Selling with no objects in parcel." type="string"> Objekter er ikke inkluderet i salg. </text> - <button label="Annullér salg af land" label_selected="Annullér salg af land" - name="Cancel Land Sale" /> - <text type="string" length="1" name="Claimed:"> + <button label="Annullér salg af land" label_selected="Annullér salg af land" name="Cancel Land Sale"/> + <text length="1" name="Claimed:" type="string"> Købt: </text> - <text type="string" length="1" name="DateClaimText"> + <text length="1" name="DateClaimText" type="string"> Tue Aug 15 13:47:25 2006 </text> - <text type="string" length="1" name="PriceLabel"> + <text length="1" name="PriceLabel" type="string"> OmrÃ¥de: </text> - <text type="string" length="1" name="PriceText"> + <text length="1" name="PriceText" type="string"> 4048 m² </text> - <text type="string" length="1" name="Traffic:"> + <text length="1" name="Traffic:" type="string"> Trafik: </text> - <text type="string" length="1" name="DwellText"> + <text length="1" name="DwellText" type="string"> 0 </text> - <button label="Køb land..." label_selected="Køb land..." name="Buy Land..." /> - <button label="Køb til gruppe..." label_selected="Køb til gruppe..." - name="Buy For Group..." /> - <button label="Køb adgang..." label_selected="Køb adgang..." name="Buy Pass..." - tool_tip="Giver adgang til midlertidig adgang til dette omrÃ¥de." /> - <button label="Efterlad land..." label_selected="Efterlad land..." - name="Abandon Land..." /> - <button label="Kræv tilbage..." label_selected="Kræv tilbage..." - name="Reclaim Land..." /> - <button label="Linden lalg..." label_selected="Linden lalg..." name="Linden salg..." - tool_tip="Land skal være ejet og ikke allerede pÃ¥ auktion" /> + <button label="Køb land..." label_selected="Køb land..." name="Buy Land..."/> + <button label="Køb til gruppe..." label_selected="Køb til gruppe..." name="Buy For Group..."/> + <button label="Køb adgang..." label_selected="Køb adgang..." name="Buy Pass..." tool_tip="Giver adgang til midlertidig adgang til dette omrÃ¥de."/> + <button label="Efterlad land..." label_selected="Efterlad land..." name="Abandon Land..."/> + <button label="Kræv tilbage..." label_selected="Kræv tilbage..." name="Reclaim Land..."/> + <button label="Linden salg..." label_selected="Linden salg..." name="Linden Sale..." tool_tip="Land skal være ejet, indholdsrating sat og ikke allerede pÃ¥ auktion."/> <string name="new users only"> Kun nye brugere </string> @@ -117,36 +120,60 @@ GÃ¥ til 'Verden' > 'Om land' eller vælg en anden parcel </string> </panel> <panel label="Regler" name="land_covenant_panel"> - <text type="string" length="1" name="covenant_timestamp_text"> + <text name="estate_section_lbl"> + Estate: + </text> + <text length="1" name="estate_name_lbl" type="string"> + Navn: + </text> + <text length="1" name="estate_name_text" type="string"> + Hovedland + </text> + <text length="1" name="estate_owner_lbl" type="string"> + Ejer: + </text> + <text length="1" name="estate_owner_text" type="string"> + (ingen) + </text> + <text_editor length="1" name="covenant_editor" type="string"> + Der er ikke angivet specielle regler for denne Estate + </text_editor> + <text length="1" name="covenant_timestamp_text" type="string"> Sidst rettet Wed Dec 31 16:00:00 1969 </text> - <text type="string" length="1" name="region_name_lbl"> + <text name="region_section_lbl"> Region: </text> - <text type="string" length="1" name="region_name_text"> + <text length="1" name="region_name_lbl" type="string"> + Navn: + </text> + <text length="1" name="region_name_text" type="string"> leyla </text> - <text type="string" length="1" name="estate_name_lbl"> - Estate: + <text name="region_landtype_lbl"> + Type: </text> - <text type="string" length="1" name="estate_name_text"> - Hovedland + <text name="region_landtype_text"> + Mainland / Homestead </text> - <text type="string" length="1" name="estate_owner_lbl"> - Estate ejer: + <text name="region_maturity_lbl"> + Rating: </text> - <text type="string" length="1" name="estate_owner_text"> - (ingen) + <text name="region_maturity_text"> + Adult </text> - <text type="string" length="1" name="resellable_clause"> - Købt jord i denne region mÃ¥ ikke videresælges. + <text name="resellable_lbl"> + Videresalg: </text> - <text type="string" length="1" name="changeable_clause"> - Købt jord i denne region mÃ¥ gerne samles eller opdeles. + <text length="1" name="resellable_clause" type="string"> + Land i denne region mÃ¥ ikke sælges videre. + </text> + <text name="changeable_lbl"> + Opdel: + </text> + <text length="1" name="changeable_clause" type="string"> + Land i denne region mÃ¥ ikke samles/opdeles. </text> - <text_editor type="string" length="1" name="covenant_editor"> - Der er ikke angivet specielle regler for denne Estate - </text_editor> <string name="can_resell"> Købt land i denne region mÃ¥ sælges videre </string> @@ -161,13 +188,13 @@ GÃ¥ til 'Verden' > 'Om land' eller vælg en anden parcel </string> </panel> <panel label="Objekter" name="land_objects_panel"> - <text type="string" length="1" name="parcel_object_bonus"> + <text length="1" name="parcel_object_bonus" type="string"> Region objekt bonus faktor: [BONUS] </text> - <text type="string" length="1" name="Simulator primitive usage:"> + <text length="1" name="Simulator primitive usage:" type="string"> Prims brugt i denne Sim: </text> - <text type="string" length="1" name="objects_available"> + <text length="1" name="objects_available" type="string"> [COUNT] ud af [MAX] ([AVAILABLE] ledige) </text> <string name="objects_available_text"> @@ -176,109 +203,111 @@ GÃ¥ til 'Verden' > 'Om land' eller vælg en anden parcel <string name="objects_deleted_text"> [COUNT] ud af [MAX] ([DELETED] bliver slettet) </string> - <text type="string" length="1" name="Primitives parcel supports:"> + <text length="1" name="Primitives parcel supports:" type="string"> Prims til rÃ¥dighed: </text> - <text type="string" length="1" name="object_contrib_text"> + <text length="1" name="object_contrib_text" type="string"> [COUNT] </text> - <text type="string" length="1" name="Primitives on parcel:"> + <text length="1" name="Primitives on parcel:" type="string"> Prims brugt pÃ¥ parcel: </text> - <text type="string" length="1" name="total_objects_text"> + <text length="1" name="total_objects_text" type="string"> [COUNT] </text> - <text type="string" length="1" name="Owned by parcel owner:"> + <text length="1" name="Owned by parcel owner:" type="string"> Ejet af Parcel ejer: </text> - <text type="string" length="1" name="owner_objects_text"> + <text length="1" name="owner_objects_text" type="string"> [COUNT] </text> - <button label="Vis" label_selected="Vis" name="ShowOwner" /> - <button label="Returnér..." label_selected="Returnér..." name="ReturnOwner..." - tool_tip="Returnér objekter til deres ejere." /> - <text type="string" length="1" name="Set to group:"> + <button label="Vis" label_selected="Vis" name="ShowOwner"/> + <button label="Returnér..." label_selected="Returnér..." name="ReturnOwner..." tool_tip="Returnér objekter til deres ejere."/> + <text length="1" name="Set to group:" type="string"> Sat til gruppe: </text> - <text type="string" length="1" name="group_objects_text"> + <text length="1" name="group_objects_text" type="string"> [COUNT] </text> - <button label="Vis" label_selected="Vis" name="ShowGroup" /> - <button label="Returnér..." label_selected="Returnér..." name="ReturnGroup..." - tool_tip="Returnér objekter til deres ejere." /> - <text type="string" length="1" name="Owned by others:"> + <button label="Vis" label_selected="Vis" name="ShowGroup"/> + <button label="Returnér..." label_selected="Returnér..." name="ReturnGroup..." tool_tip="Returnér objekter til deres ejere."/> + <text length="1" name="Owned by others:" type="string"> Ejet af andre: </text> - <text type="string" length="1" name="other_objects_text"> + <text length="1" name="other_objects_text" type="string"> [COUNT] </text> - <button label="Vis" label_selected="Vis" name="ShowOther" /> - <button label="Returnér..." label_selected="Returnér..." name="ReturnOther..." - tool_tip="Returnér objekter til deres ejere." /> - <text type="string" length="1" name="Selected / sat upon:"> + <button label="Vis" label_selected="Vis" name="ShowOther"/> + <button label="Returnér..." label_selected="Returnér..." name="ReturnOther..." tool_tip="Returnér objekter til deres ejere."/> + <text length="1" name="Selected / sat upon:" type="string"> Valgt/siddet pÃ¥: </text> - <text type="string" length="1" name="selected_objects_text"> + <text length="1" name="selected_objects_text" type="string"> [COUNT] </text> - <text type="string" length="1" name="Autoreturn"> + <text length="1" name="Autoreturn" type="string"> Autoreturnér andres objekter efter (minutter, 0 = aldrig): </text> - <text type="string" length="1" name="Object Owners:"> + <text length="1" name="Object Owners:" type="string"> Objekt ejere: </text> - <button label="Gentegn liste" label_selected="Gentegn liste" name="Refresh List" /> - <button label="Returnér objekter..." label_selected="Returnér objekter..." - name="Return objects..." /> + <button label="Gentegn liste" label_selected="Gentegn liste" name="Refresh List"/> + <button label="Returnér objekter..." label_selected="Returnér objekter..." name="Return objects..."/> <name_list name="owner list"> - <column label="Type" name="type" /> - <column label="Navn" name="name" /> - <column label="Antal" name="count" /> - <column label="Nyeste" name="mostrecent" /> + <column label="Type" name="type"/> + <column label="Navn" name="name"/> + <column label="Antal" name="count"/> + <column label="Nyeste" name="mostrecent"/> </name_list> </panel> <panel label="Indstillinger" name="land_options_panel"> - <text type="string" length="1" name="allow_label"> + <text length="1" name="allow_label" type="string"> Tillad andre beboere at: </text> - <check_box label="Redigere terræn" name="edit land check" - tool_tip="Hvis dette er valg, kan enhver redigere dit land. Det er bedst ikke at vælge her, da det altid er muligt for dig som ejer at ændre terræn pÃ¥ dit eget land." /> - <check_box label="Lave landemærker" name="check landmark" /> - <check_box label="Flyve" name="check fly" - tool_tip="Hvis valgt, kan beboere flyve pÃ¥ dit land. Hvis ikke valgt kan beboere kun flyve ind pÃ¥ dit land og over dit land." /> - <text type="string" length="1" name="allow_label2"> + <check_box label="Redigere terræn" name="edit land check" tool_tip="Hvis dette er valg, kan enhver redigere dit land. Det er bedst ikke at vælge her, da det altid er muligt for dig som ejer at ændre terræn pÃ¥ dit eget land."/> + <check_box label="Lave landemærker" name="check landmark"/> + <check_box label="Flyve" name="check fly" tool_tip="Hvis valgt, kan beboere flyve pÃ¥ dit land. Hvis ikke valgt kan beboere kun flyve ind pÃ¥ dit land og over dit land."/> + <text length="1" name="allow_label2" type="string" left="194"> Lave objekter: </text> - <check_box label="Alle beboere" name="edit objects check" /> - <check_box label="Gruppe" name="edit group objects check" /> - <text type="string" length="1" name="allow_label3"> + <check_box label="Alle beboere" name="edit objects check"/> + <check_box label="Gruppe" name="edit group objects check"/> + <text length="1" name="allow_label3" type="string" left="170"> Anbringe objekter: </text> - <check_box label="Alle beboere" name="all object entry check" /> - <check_box label="Gruppe" name="group object entry check" /> - <text type="string" length="1" name="allow_label4"> + <check_box label="Alle beboere" name="all object entry check"/> + <check_box label="Gruppe" name="group object entry check"/> + <text length="1" name="allow_label4" type="string" left="200"> Køre scripts: </text> - <check_box label="Alle beboere" name="check other scripts" /> - <check_box label="Gruppe" name="check group scripts" /> - <text type="string" length="1" name="land_options_label"> + <check_box label="Alle beboere" name="check other scripts"/> + <check_box label="Gruppe" name="check group scripts"/> + <text length="1" name="land_options_label" type="string"> Land instillinger: </text> - <check_box label="Sikker (ingen skade)" name="check safe" - tool_tip="Hvis valgt, er det ikke muligt at forÃ¥rsage skade pÃ¥ andre beboere. Hvis fravalgt er det muligt at fÃ¥ skader (f.eks. ved kamp)." /> - <check_box label="Skub forbudt" name="PushRestrictCheck" - tool_tip="Forhindrer scripts i at skubbe. Valg af denne mulighed, kan være nyttigt for at forhindre forstyrrende adfærd pÃ¥ dit land." /> - <check_box label="Vis sted i søgning (L$30/uge) i kategorien:" name="ShowDirectoryCheck" - tool_tip="Lad dit parcel blive vist i søge resultaterne" /> - <combo_box name="land category"> + <check_box label="Sikker (ingen skade)" name="check safe" tool_tip="Hvis valgt, er det ikke muligt at forÃ¥rsage skade pÃ¥ andre beboere. Hvis fravalgt er det muligt at fÃ¥ skader (f.eks. ved kamp)."/> + <check_box label="Skub forbudt" name="PushRestrictCheck" tool_tip="Forhindrer scripts i at skubbe. Valg af denne mulighed, kan være nyttigt for at forhindre forstyrrende adfærd pÃ¥ dit land."/> + <check_box label="Vis sted i søgning (L$30/uge) i kategorien:" name="ShowDirectoryCheck" tool_tip="Lad dit parcel blive vist i søge resultaterne"/> + <string name="search_enabled_tooltip"> + Lad beboere se denne parcel i søgeresultater + </string> + <string name="search_disabled_small_tooltip"> + Denne mulighed er ikke til stede da parcellens omrÃ¥de er 128 m² eller mindre. +Kun større parceller kan vises i søgning. + </string> + <string name="search_disabled_permissions_tooltip"> + Dette valg er lukket da du ikke kan ændre pÃ¥ denne parcels opsætning. + </string> + <combo_box name="land category with adult"> <combo_item name="AnyCategory"> - Alle kategorier + Enhver kategori </combo_item> <combo_item name="LindenLocation"> - Linden Location + Linden sted + </combo_item> + <combo_item name="Adult"> + Adult </combo_item> - - <combo_item name="Arts&Culture"> Kunst & kultur </combo_item> @@ -292,7 +321,7 @@ GÃ¥ til 'Verden' > 'Om land' eller vælg en anden parcel Spil </combo_item> <combo_item name="Hangout"> - Afslapning + Opholdssteder </combo_item> <combo_item name="NewcomerFriendly"> Nybegynder venligt @@ -304,42 +333,59 @@ GÃ¥ til 'Verden' > 'Om land' eller vælg en anden parcel Beboelse </combo_item> <combo_item name="Shopping"> - Indkøb + Shopping </combo_item> <combo_item name="Other"> Andet </combo_item> </combo_box> - <button label="?" label_selected="?" name="?" /> - <check_box name="MatureCheck" /> - <text type="string" length="1" name="Snapshot:"> + <combo_box name="land category"> + <combo_box.item name="AnyCategory" label="Alle kategorier" /> + <combo_box.item name="LindenLocation" label="Linden Location" /> + <combo_box.item name="Arts&Culture" label="Kunst & kultur" /> + <combo_box.item name="Business" label="Business" /> + <combo_box.item name="Educational" label="Uddannelse" /> + <combo_box.item name="Gaming" label="Spil" /> + <combo_box.item name="Hangout" label="Afslapning" /> + <combo_box.item name="NewcomerFriendly" label="Nybegynder venligt" /> + <combo_box.item name="Parks&Nature" label="Parker & natur" /> + <combo_box.item name="Residential" label="Beboelse" /> + <combo_box.item name="Shopping" label="Indkøb" /> + <combo_box.item name="Other" label="Andet" /> + </combo_box> + <button label="?" label_selected="?" name="?"/> + <check_box label="Mature indhold" name="MatureCheck" tool_tip=""/> + <string name="mature_check_mature"> + Mature indhold + </string> + <string name="mature_check_adult"> + Adult indhold + </string> + <string name="mature_check_mature_tooltip"> + Din parcel information eller indhold anses for at være 'adult'. + </string> + <string name="mature_check_adult_tooltip"> + Din parcel information eller indhold anses for at være 'adult'. + </string> + <text length="1" name="Snapshot:" type="string"> Foto: </text> - <texture_picker label="" name="snapshot_ctrl" tool_tip="Klik for at vælge et billede" /> - <text type="string" length="1" name="landing_point"> + <texture_picker label="" name="snapshot_ctrl" tool_tip="Klik for at vælge et billede"/> + <text length="1" name="landing_point" type="string"> Landingspunkt: [LANDING] </text> <string name="landing_point_none"> (ingen) </string> - <button label="Vælg" label_selected="Vælg" name="Set" - tool_tip="Indstiller landingspunkt, hvor de besøgende ankommer. Sættes til din avatars aktuelle placering i denne parcel." /> - <button label="Fjern" label_selected="Fjern" name="Clear" - tool_tip="Fjerner oplysning om landingspunkt." /> - <text type="string" length="1" name="Teleport Routing: "> + <button label="Vælg" label_selected="Vælg" name="Set" tool_tip="Indstiller landingspunkt, hvor de besøgende ankommer. Sættes til din avatars aktuelle placering i denne parcel."/> + <button label="Fjern" label_selected="Fjern" name="Clear" tool_tip="Fjerner oplysning om landingspunkt."/> + <text length="1" name="Teleport Routing: " type="string"> Teleport valg: </text> - <combo_box name="landing type" - tool_tip="Vælg hvordan du vil hÃ¥ndtere teleporteringer til dit land."> - <combo_item type="string" length="1" name="Blocked"> - Blokeret - </combo_item> - <combo_item type="string" length="1" name="LandingPoint"> - Landingspunkt - </combo_item> - <combo_item type="string" length="1" name="Anywhere"> - Hvor som helst - </combo_item> + <combo_box name="landing type" tool_tip="Vælg hvordan du vil hÃ¥ndtere teleporteringer til dit land."> + <combo_box.item length="1" name="Blocked" type="string" label="Blokeret" /> + <combo_box.item length="1" name="LandingPoint" type="string" label="Landingspunkt" /> + <combo_box.item length="1" name="Anywhere" type="string" label="Hvor som helst" /> </combo_box> <string name="push_restrict_text"> Skub forbudt @@ -349,113 +395,91 @@ GÃ¥ til 'Verden' > 'Om land' eller vælg en anden parcel </string> </panel> <panel label="Medier" name="land_media_panel"> - <text type="string" length="1" name="with media:"> + <text length="1" name="with media:" type="string" left="4"> Medie type: </text> - <combo_box name="media type" - tool_tip="Specificer om URL-adressen er til en film, hjemmeside eller et andet medie." /> - <text type="string" length="1" name="at URL:"> + <combo_box name="media type" tool_tip="Specificer om URL-adressen er til en film, hjemmeside eller et andet medie."/> + <text length="1" name="at URL:" type="string" left="4"> Medie URL: </text> - <button label="Vælg..." label_selected="Vælg..." name="set_media_url" /> - <text type="string" length="1" name="Description:"> + <button label="Vælg..." label_selected="Vælg..." name="set_media_url"/> + <text length="1" name="Description:" type="string" left="4"> Beskrivelse: </text> - <line_editor name="url_description" tool_tip="Tekst vist ved siden af Afspil/Hent knappen" /> - <text type="string" length="1" name="Media texture:"> + <line_editor name="url_description" tool_tip="Tekst vist ved siden af Afspil/Hent knappen"/> + <text length="1" name="Media texture:" type="string" left="4"> Erstat tekstur: </text> - <texture_picker label="" name="media texture" tool_tip="Klik for at vælge billede" /> - <text type="string" length="1" name="replace_texture_help"> + <texture_picker label="" name="media texture" tool_tip="Klik for at vælge billede"/> + <text length="1" name="replace_texture_help" type="string"> (Objekter der har denne tekstur vil vise filmen eller web-siden, efter du klikker pÃ¥ play knappen.) </text> - <text type="string" length="1" name="Options:"> + <text length="1" name="Options:" type="string"> Medie valg: </text> - <check_box label="Auto skalér" name="media_auto_scale" - tool_tip="Vælg denne mulighed for at skalere indholdet for dette parcel automatisk. Det kan være lidt langsommere og have lavere kvalitet, men ingen anden tekstur skalering eller tilpasning vil være nødvendigt." /> - <check_box label="Gentag afspil" name="media_loop" - tool_tip="Gentager automatisk medie, nÃ¥r det er færdigt med at spille starter det automatisk forfra." /> - <check_box label="Skjul medie URL" name="hide_media_url" - tool_tip="Klik her for at skjule medie adressen sÃ¥ det kun er dig og evt. parcel gruppens ejer/administratorer der kan se den." /> - <check_box label="Skjul musik URL" name="hide_music_url" - tool_tip="Klik her for at skjule musik adressen sÃ¥ det kun er dig og evt. parcel gruppens ejer/administratorer der kan se den." /> - <text type="string" length="1" name="media_size" - tool_tip="Størrelse for rendering af Web medie, benyt 0 for standard." width="105"> + <check_box label="Auto skalér" name="media_auto_scale" tool_tip="Vælg denne mulighed for at skalere indholdet for dette parcel automatisk. Det kan være lidt langsommere og have lavere kvalitet, men ingen anden tekstur skalering eller tilpasning vil være nødvendigt."/> + <check_box label="Gentag afspil" name="media_loop" tool_tip="Gentager automatisk medie, nÃ¥r det er færdigt med at spille starter det automatisk forfra."/> + <check_box label="Skjul medie URL" name="hide_media_url" tool_tip="Klik her for at skjule medie adressen sÃ¥ det kun er dig og evt. parcel gruppens ejer/administratorer der kan se den."/> + <check_box label="Skjul musik URL" name="hide_music_url" tool_tip="Klik her for at skjule musik adressen sÃ¥ det kun er dig og evt. parcel gruppens ejer/administratorer der kan se den."/> + <text length="1" name="media_size" tool_tip="Størrelse for rendering af Web medie, benyt 0 for standard." type="string" width="105"> Medie Størrelse: </text> - <spinner name="media_size_width" left_delta="89" - tool_tip="Størrelse for rendering af Web medie, benyt 0 for standard." /> - <spinner name="media_size_height" - tool_tip="Størrelse for rendering af Web medie, benyt 0 for standard." /> - <text type="string" length="1" name="pixels"> + <spinner left_delta="89" name="media_size_width" tool_tip="Størrelse for rendering af Web medie, benyt 0 for standard."/> + <spinner name="media_size_height" tool_tip="Størrelse for rendering af Web medie, benyt 0 for standard."/> + <text length="1" name="pixels" type="string"> pixels </text> - <text type="string" length="1" name="MusicURL:"> + <text length="1" name="MusicURL:" type="string"> Musik URL: </text> - <text type="string" length="1" name="Sound:"> + <text length="1" name="Sound:" type="string"> Lyd: </text> - <check_box label="Isolér lyde til denne parcel" name="check sound local" /> - <text type="string" length="1" name="Voice settings:"> + <check_box label="Begræns lyde fra bevægelser og objekter til denne parcel" name="check sound local"/> + <button label="?" label_selected="?" name="?" left="400"/> + <text length="1" name="Voice settings:" type="string"> Stemme: </text> <radio_group name="parcel_voice_channel"> - <radio_item type="string" length="1" name="Estate"> - Brug Estate kanalen - </radio_item> - <radio_item type="string" length="1" name="Private"> - Brug en privat kanal - </radio_item> - <radio_item type="string" length="1" name="Disabled"> - SlÃ¥ stemme chat fra pÃ¥ denne parcel - </radio_item> + <radio_item type="string" length="1" name="Estate" label="Brug Estate kanalen" /> + <radio_item type="string" length="1" name="Private" label="Brug en privat kanal" /> + <radio_item type="string" length="1" name="Disabled" label="SlÃ¥ stemme chat fra pÃ¥ denne parcel" /> </radio_group> </panel> <panel label="Adgang" name="land_access_panel"> - <text type="string" length="1" name="Limit access to this parcel to:"> + <text length="1" name="Limit access to this parcel to:" type="string"> Adgang til denne parcel </text> - <check_box label="Tillad offentlig adgang" name="public_access" /> - <text type="string" length="1" name="Only Allow"> + <check_box label="Tillad offentlig adgang" name="public_access"/> + <text length="1" name="Only Allow" type="string"> Blokér adgang for: </text> - <check_box label="Beboere der ikke har givet betalings oplysninger til Linden Lab" - name="limit_payment" - tool_tip="Blokér beboere der ikke har afgivet identifikationsoplysninger." /> - <check_box label="Beboere der ikke er godkendt som voksne" name="limit_age_verified" - tool_tip="Blokér beboere der ikke har verificeret deres alder. Se support.secondlife.com for mere information." /> + <check_box label="Beboere der ikke har givet betalings oplysninger til Linden Lab" name="limit_payment" tool_tip="Blokér beboere der ikke har afgivet identifikationsoplysninger."/> + <check_box label="Beboere der ikke er godkendt som voksne" name="limit_age_verified" tool_tip="Blokér beboere der ikke har verificeret deres alder. Se support.secondlife.com for mere information."/> <string name="estate_override"> En eller flere af disse valg er indstillet pÃ¥ estate niveau </string> - <check_box label="Tillad adgang til gruppen: [GROUP]" name="GroupCheck" - tool_tip="Vælg gruppe under fanen 'generelt'." /> - <check_box label="Sælg adgang til:" name="PassCheck" - tool_tip="Tillader midlertidig adgang til denne parcel" /> + <check_box label="Tillad adgang til gruppen: [GROUP]" name="GroupCheck" tool_tip="Vælg gruppe under fanen 'generelt'."/> + <check_box label="Sælg adgang til:" name="PassCheck" tool_tip="Tillader midlertidig adgang til denne parcel"/> <combo_box name="pass_combo"> - <combo_item name="Anyone"> - Alle - </combo_item> - <combo_item name="Group"> - Gruppe - </combo_item> + <combo_box.item name="Anyone" label="Alle" /> + <combo_box.item name="Group" label="Gruppe" /> </combo_box> - <spinner label="Pris i L$:" name="PriceSpin" /> - <spinner label="Timers adgang:" name="HoursSpin" /> + <spinner label="Pris i L$:" name="PriceSpin"/> + <spinner label="Timers adgang:" name="HoursSpin"/> <text label="Tillad altid" name="AllowedText"> Altid godkendte beboere </text> - <name_list name="AccessList" tool_tip="([LISTED] vist, [MAX] max)" /> - <button label="Tilføj..." label_selected="Tilføj..." name="add_allowed" /> - <button label="Fjern" label_selected="Fjern" name="remove_allowed" /> + <name_list name="AccessList" tool_tip="([LISTED] vist, [MAX] max)"/> + <button label="Tilføj..." label_selected="Tilføj..." name="add_allowed"/> + <button label="Fjern" label_selected="Fjern" name="remove_allowed"/> <text label="Blokér" name="BanCheck"> Blokerede beboere </text> - <name_list name="BannedList" tool_tip="([LISTED] vist, [MAX] max)" /> - <button label="Tilføj..." label_selected="Tilføj..." name="add_banned" /> - <button label="Fjern" label_selected="Fjern" name="remove_banned" /> + <name_list name="BannedList" tool_tip="([LISTED] vist, [MAX] max)"/> + <button label="Tilføj..." label_selected="Tilføj..." name="add_banned"/> + <button label="Fjern" label_selected="Fjern" name="remove_banned"/> </panel> </tab_container> </floater> diff --git a/indra/newview/skins/default/xui/da/floater_animation_preview.xml b/indra/newview/skins/default/xui/da/floater_animation_preview.xml index 4ea77534575d66bef4861371c1d3d000d61a3607..8cb0eee601e44facbcf53044f988376f59fe9850 100644 --- a/indra/newview/skins/default/xui/da/floater_animation_preview.xml +++ b/indra/newview/skins/default/xui/da/floater_animation_preview.xml @@ -9,138 +9,63 @@ <spinner label="Prioritet" name="priority" tool_tip="Vælg hvilke andre animationer der har lavere prioritet end denne." /> <check_box label="Gentag" name="loop_check" tool_tip="Gentager animationen konstant." /> - <spinner label="Ind(%)" name="loop_in_point" - tool_tip="Sætter punktet hvor gentagelsen genstarter fra." /> + <spinner left="76" label_width="40" width="105" label="Ind(%)" name="loop_in_point" tool_tip="Sætter punktet hvor gentagelsen genstarter fra."/> <spinner label="Ud (%)" name="loop_out_point" tool_tip="Sætter punktet i animationen der afslutter gentagelsen." /> <text name="hand_label"> HÃ¥nd posering </text> <combo_box label="" name="hand_pose_combo" - tool_tip="Kontrollerer hvad hænderne gÃ¥r i løbet af animationen."> - <combo_item name="Spread"> - Spredt - </combo_item> - <combo_item name="Relaxed"> - Afslappet - </combo_item> - <combo_item name="PointBoth"> - Peg begge - </combo_item> - <combo_item name="Fist"> - Knytnæver - </combo_item> - <combo_item name="RelaxedLeft"> - Afslappet venstre - </combo_item> - <combo_item name="PointLeft"> - Peg venstre - </combo_item> - <combo_item name="FistLeft"> - Knytnæve venstre - </combo_item> - <combo_item name="RelaxedRight"> - Afslappet højre - </combo_item> - <combo_item name="PointRight"> - Peg højre - </combo_item> - <combo_item name="FistRight"> - Knytnæve højre - </combo_item> - <combo_item name="SaluteRight"> - Honnør højre - </combo_item> - <combo_item name="Typing"> - Skriver - </combo_item> - <combo_item name="PeaceRight"> - Fredstegn højre - </combo_item> + tool_tip="Kontrollerer hvad hænderne gÃ¥r i løbet af animationen." width="140"> + <combo_box.item name="Spread" label="Spredt" /> + <combo_box.item name="Relaxed" label="Afslappet" /> + <combo_box.item name="PointBoth" label="Peg begge" /> + <combo_box.item name="Fist" label="Knytnæver" /> + <combo_box.item name="RelaxedLeft" label="Afslappet venstre" /> + <combo_box.item name="PointLeft" label="Peg venstre" /> + <combo_box.item name="FistLeft" label="Knytnæve venstre" /> + <combo_box.item name="RelaxedRight" label="Afslappet højre" /> + <combo_box.item name="PointRight" label="Peg højre" /> + <combo_box.item name="FistRight" label="Knytnæve højre" /> + <combo_box.item name="SaluteRight" label="Honnør højre" /> + <combo_box.item name="Typing" label="Skriver" /> + <combo_box.item name="PeaceRight" label="Fredstegn højre" /> </combo_box> <text name="emote_label"> Ansigtsudtryk </text> <combo_box label="" name="emote_combo" - tool_tip="Angiver hvad ansigtet gør under animationen"> - <combo_item name="[None]"> - [Intet] - </combo_item> - <combo_item name="Aaaaah"> - Aaaaah - </combo_item> - <combo_item name="Afraid"> - Bange - </combo_item> - <combo_item name="Angry"> - Vred - </combo_item> - <combo_item name="BigSmile"> - Stort smil - </combo_item> - <combo_item name="Bored"> - Keder sig - </combo_item> - <combo_item name="Cry"> - Græder - </combo_item> - <combo_item name="Disdain"> - Forarget - </combo_item> - <combo_item name="Embarrassed"> - Flov - </combo_item> - <combo_item name="Frown"> - Skuler - </combo_item> - <combo_item name="Kiss"> - Kysser - </combo_item> - <combo_item name="Laugh"> - Griner - </combo_item> - <combo_item name="Plllppt"> - Plllppt - </combo_item> - <combo_item name="Repulsed"> - Frastødt - </combo_item> - <combo_item name="Sad"> - Ked af det - </combo_item> - <combo_item name="Shrug"> - Skuldertræk - </combo_item> - <combo_item name="Smile"> - Smiler - </combo_item> - <combo_item name="Surprise"> - Overrasket - </combo_item> - <combo_item name="Wink"> - Blinker - </combo_item> - <combo_item name="Worry"> - Bekymret - </combo_item> + tool_tip="Angiver hvad ansigtet gør under animationen" width="140"> + <combo_box.item name="[None]" label="Intet]" /> + <combo_box.item name="Aaaaah" label="Aaaaah" /> + <combo_box.item name="Afraid" label="Bange" /> + <combo_box.item name="Angry" label="Vred" /> + <combo_box.item name="BigSmile" label="Stort smil" /> + <combo_box.item name="Bored" label="Keder sig" /> + <combo_box.item name="Cry" label="Græder" /> + <combo_box.item name="Disdain" label="Forarget" /> + <combo_box.item name="Embarrassed" label="Flov" /> + <combo_box.item name="Frown" label="Skuler" /> + <combo_box.item name="Kiss" label="Kysser" /> + <combo_box.item name="Laugh" label="Griner" /> + <combo_box.item name="Plllppt" label="Plllppt" /> + <combo_box.item name="Repulsed" label="Frastødt" /> + <combo_box.item name="Sad" label="Ked af det" /> + <combo_box.item name="Shrug" label="Skuldertræk" /> + <combo_box.item name="Smile" label="Smiler" /> + <combo_box.item name="Surprise" label="Overrasket" /> + <combo_box.item name="Wink" label="Blinker" /> + <combo_box.item name="Worry" label="Bekymret" /> </combo_box> <text name="preview_label"> Vis mens </text> <combo_box label="" name="preview_base_anim" - tool_tip="Se hvordan animation ser ud i forskellige typiske avatar-situationer."> - <combo_item name="Standing"> - StÃ¥r - </combo_item> - <combo_item name="Walking"> - GÃ¥r - </combo_item> - <combo_item name="Sitting"> - Sidder - </combo_item> - <combo_item name="Flying"> - Flyver - </combo_item> + tool_tip="Se hvordan animation ser ud i forskellige typiske avatar-situationer." width="140"> + <combo_box.item name="Standing" label="StÃ¥r" /> + <combo_box.item name="Walking" label="GÃ¥r" /> + <combo_box.item name="Sitting" label="Sidder" /> + <combo_box.item name="Flying" label="Flyver" /> </combo_box> <spinner label="start (sec)" name="ease_in_time" tool_tip="Tid i sekunder animationen bruger pÃ¥ at komme i gang." /> @@ -151,8 +76,8 @@ <slider label="" name="playback_slider" /> <text name="bad_animation_text"> Kan ikke læse animations fil. - - Vi anbefaler BVH filer der er exporteret fra Poser 4. + +Vi anbefaler BVH filer der er exporteret fra Poser 4. </text> <button label="Annullér" name="cancel_btn" /> <button label="Hent (L$[AMOUNT])" name="ok_btn" /> diff --git a/indra/newview/skins/default/xui/da/floater_buy_land.xml b/indra/newview/skins/default/xui/da/floater_buy_land.xml index 9ca0c16bd34b6d5a139b9930fec5423d3034c1dd..1d42ffb45a856bbdac9819fef141671816d9cd7d 100644 --- a/indra/newview/skins/default/xui/da/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/da/floater_buy_land.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="buy land" title="Køb land"> <text name="region_name_label"> Region: @@ -6,6 +6,12 @@ <text name="region_name_text"> (ukendt) </text> + <text name="region_type_label"> + Type: + </text> + <text name="region_type_text"> + (ukendt) + </text> <text name="estate_name_label"> Estate: </text> @@ -22,35 +28,38 @@ Købt land i denne region: </text> <text name="resellable_clause"> - Købt land i denne region kan eller kan ikke videresælges. + Kan eller kan ikke videresælges. </text> <text name="changeable_clause"> - kan eller kan ikke samles eller opdeles. + MÃ¥ eller mÃ¥ ikke samles eller opdeles. </text> <text name="covenant_text"> Du skal acceptere Estate reglerne: </text> + <text left="470" name="covenant_timestamp_text"/> <text_editor name="covenant_editor"> Indlæser... </text_editor> - <check_box label="Jeg acceptere betingelserne der er beskrevet." name="agree_covenant" /> + <check_box label="Jeg acceptere betingelserne der er beskrevet." name="agree_covenant"/> <text name="info_parcel_label"> Parcel: </text> - <text name="info_parcel" left_delta="62"> + <text left_delta="62" name="info_parcel"> Scotopteryx 138,204 </text> <text name="info_size_label" width="60"> Størrelse: </text> - <text name="info_size" left_delta="62"> + <text left_delta="62" name="info_size"> 1024 m² </text> <text name="info_price_label"> Pris: </text> - <text name="info_price" left_delta="62"> - L$ 1500, objekter inkluderet + <text left_delta="62" name="info_price"> + L$ 1500 +(L$ 1.1/m²) +sælges med objekter </text> <text name="info_action"> Køb af dette land vil: @@ -58,7 +67,7 @@ <text name="error_message"> Noget er ikke rigtigt. </text> - <button label="Go to website" name="error_web" /> + <button label="Go to website" name="error_web"/> <text name="account_action"> Opgrader dig til premium medlemsskab. </text> @@ -66,22 +75,16 @@ Kun premium medlemmer kan eje land. </text> <combo_box name="account_level"> - <combo_item name="US$9.95/month,billedmonthly"> - US$9.95/md, mÃ¥nedlig afregning - </combo_item> - <combo_item name="US$7.50/month,billedquarterly"> - US$7.50/md, kvartalsvis afregning - </combo_item> - <combo_item name="US$6.00/month,billedannually"> - US$6.00/md, Ã¥rlig afregning - </combo_item> + <combo_box.item name="US$9.95/month,billedmonthly" label="US$9.95/md, mÃ¥nedlig afregning" /> + <combo_box.item name="US$7.50/month,billedquarterly" label="US$7.50/md, kvartalsvis afregning" /> + <combo_box.item name="US$6.00/month,billedannually" label="US$6.00/md, Ã¥rlig afregning" /> </combo_box> <text name="land_use_action"> Forøg dine mÃ¥nedlige arealanvendelse gebyrer til US $ 40/mÃ¥ned. </text> <text name="land_use_reason"> - Du har 1.309 kvadratmeter jord. -Dette parcel er pÃ¥ 512 kvadratmeter jord. + You hold 1309 m² of land. +This parcel is 512 m² of land. </text> <text name="purchase_action"> Betal Joe Resident L$ 4000 dette areal @@ -101,10 +104,9 @@ Dette parcel er pÃ¥ 512 kvadratmeter jord. <text name="currency_balance"> Du har L$2,100. </text> - <check_box label="Fjern [AMOUNT] kvadratmeter af bidrag fra gruppe." - name="remove_contribution" /> - <button label="Køb" name="buy_btn" /> - <button label="Annullér" name="cancel_btn" /> + <check_box label="Fjern [AMOUNT] kvadratmeter af bidrag fra gruppe." name="remove_contribution"/> + <button label="Køb" name="buy_btn"/> + <button label="Annullér" name="cancel_btn"/> <string name="can_resell"> Kan videresælges. </string> @@ -161,7 +163,7 @@ Prøv at vælge et mindre omrÃ¥de. Køb af dette areal vil: </string> <string name="buying_for_group"> - Køb jord til gruppe: + Køb af dette areal vil: </string> <string name="cannot_buy_now"> Kan ikke købe nu: @@ -179,30 +181,38 @@ Prøv at vælge et mindre omrÃ¥de. Din konto kan eje jord. </string> <string name="land_holdings"> - Du har [BUYER] kvadratmeter jord. + Du har [BUYER] m² jord. </string> <string name="pay_to_for_land"> Betal L$ [AMOUNT] til [SELLER] for dette stykke jord </string> <string name="buy_for_US"> - Køb L$ [AMOUNT] for omkring US$ [AMOUNT2] , + Køb L$ [AMOUNT] for ca. US$ [AMOUNT2], </string> <string name="parcel_meters"> - Dette parcel er [AMOUNT] kvadratmeter. + Denne parcel er [AMOUNT] m². </string> <string name="premium_land"> - Dette stykke jord er premium, og vil tælle som [AMOUNT] kvadratmeter. + Dette stykke jord er premium, og vil tælle som [AMOUNT] m². </string> <string name="discounted_land"> - Dette stykke jord er pÃ¥ tilbud, og vil tælle som [AMOUNT] kvadratmeter. + Dette stykke jord er pÃ¥ tilbud, og vil tælle som [AMOUNT] m². </string> <string name="meters_supports_object"> [AMOUNT] m² -indeholder [AMOUNT2] objekter +kan indeholder [AMOUNT2] objekter </string> <string name="sold_with_objects"> solgt med objekter </string> + <string name="sold_without_objects"> + objekter ikke inkluderet + </string> + <string name="info_price_string"> + L$ [PRICE] +(L$ [PRICE_PER_SQM]/m²) +[SOLD_WITH_OBJECTS] + </string> <string name="insufficient_land_credits"> Gruppen [GROUP] skal bruge nok tildelt jord brugs kredit for at dække dette parcel før købet vil blive diff --git a/indra/newview/skins/default/xui/da/floater_customize.xml b/indra/newview/skins/default/xui/da/floater_customize.xml index 0f6a59eb4a05b7a4a017a8d145d3e83430c33c12..aa6b8cb0436e706bcf891458a3946632ab501381 100644 --- a/indra/newview/skins/default/xui/da/floater_customize.xml +++ b/indra/newview/skins/default/xui/da/floater_customize.xml @@ -1,447 +1,479 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater name="floater customize" title="Appearance"> - <tab_container name="customize tab container"> - <panel label="Krops Dele" name="body_parts_placeholder" /> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="floater customize" title="Appearance" width="509"> + <tab_container name="customize tab container" width="507"> + <panel label="Krops Dele" name="body_parts_placeholder"/> <panel label="Kropsbygning" name="Shape"> - <button label="Annullér" label_selected="Annullér" name="Revert" /> - <button label="Krop" label_selected="Krop" name="Body" /> - <button label="Hoved" label_selected="Hoved" name="Head" /> - <button label="Øjne" label_selected="Øjne" name="Eyes" /> - <button label="Ører" label_selected="Ører" name="Ears" /> - <button label="Næse" label_selected="Næse" name="Nose" /> - <button label="Mund" label_selected="Mund" name="Mouth" /> - <button label="Kinder" label_selected="Kinder" name="Chin" /> - <button label="Overkrop" label_selected="Overkrop" name="Torso" /> - <button label="Ben" label_selected="Ben" name="Legs" /> + <button label="Annullér" label_selected="Annullér" name="Revert"/> + <button label="Krop" label_selected="Krop" name="Body"/> + <button label="Hoved" label_selected="Hoved" name="Head"/> + <button label="Øjne" label_selected="Øjne" name="Eyes"/> + <button label="Ører" label_selected="Ører" name="Ears"/> + <button label="Næse" label_selected="Næse" name="Nose"/> + <button label="Mund" label_selected="Mund" name="Mouth"/> + <button label="Kinder" label_selected="Kinder" name="Chin"/> + <button label="Overkrop" label_selected="Overkrop" name="Torso"/> + <button label="Ben" label_selected="Ben" name="Legs"/> <radio_group name="sex radio"> - <radio_item type="string" length="1" name="radio"> - Kvinde - </radio_item> - <radio_item type="string" length="1" name="radio2"> - Mand - </radio_item> + <radio_item type="string" length="1" name="radio" label="Kvinde" /> + <radio_item type="string" length="1" name="radio2" label="Mand" /> </radio_group> - <button label="Tilfældig" label_selected="Tilfældig" name="Randomize" /> - <text type="string" length="1" name="title"> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: Kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> + <text length="1" name="not worn instructions" type="string"> Vælg en ny krop ved at trække en sÃ¥dan fra din beholdning -over pÃ¥ din avatar. Du kan ogsÃ¥ oprette en fra bunden og bagefter 'tage den pÃ¥'. +over pÃ¥ din avatar. Du kan ogsÃ¥ oprette en fra bunden +og bagefter 'tage den pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> - <button label="Lav ny krop" label_selected="Lav ny krop" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> + <text name="Item Action Label"> + Figur: + </text> + <button label="Lav ny krop" label_selected="Lav ny krop" name="Create New"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> </panel> <panel label="Hud" name="Skin"> - <button label="Hudfarve" label_selected="Hudfarve" name="Skin Color" /> - <button label="Detaljer" label_selected="Detaljer" name="Face Detail" /> - <button label="Sminke" label_selected="Sminke" name="Makeup" /> - <button label="Kropsdetaljer" label_selected="Kropsdetaljer" name="Body Detail" /> - <text type="string" length="1" name="title"> + <button label="Hudfarve" label_selected="Hudfarve" name="Skin Color"/> + <button label="Detaljer" label_selected="Detaljer" name="Face Detail"/> + <button label="Sminke" label_selected="Sminke" name="Makeup"/> + <button label="Kropsdetaljer" label_selected="Kropsdetaljer" name="Body Detail"/> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: Kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> + <text length="1" name="not worn instructions" type="string"> Tag en ny hud pÃ¥ ved at trække en sÃ¥dan fra din beholdning -over pÃ¥ din avatar. Du kan ogsÃ¥ oprette en hud fra bunden og bagefter 'tage den pÃ¥'. +over pÃ¥ din avatar. Du kan ogsÃ¥ oprette en hud fra bunden +og bagefter 'tage den pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> - <texture_picker label="Tatoveringer hoved" name="Head Tattoos" /> - <texture_picker label="Tatoveringer overkrop" name="Upper Tattoos" /> - <texture_picker label="Tatoveringer underkrop" name="Lower Tattoos" /> - <button label="Tilfældig" label_selected="Tilfældig" name="Randomize" /> - <button label="Lav ny hud" label_selected="Lav nyt hud" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> - <button label="Annullér" label_selected="Annullér" name="Revert" /> + <text name="Item Action Label"> + Hud: + </text> + <texture_picker width="98" label="Tatoveringer hoved" name="Head Tattoos" tool_tip="Klik for at vælge et billede"/> + <texture_picker width="98" label="Tatover. overkrop" name="Upper Tattoos" tool_tip="Klik for at vælge et billede"/> + <texture_picker width="98" label="Tatover. underkrop" name="Lower Tattoos" tool_tip="Klik for at vælge et billede"/> + <button label="Lav ny hud" label_selected="Lav nyt hud" name="Create New"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> + <button label="Annullér" label_selected="Annullér" name="Revert"/> </panel> <panel label="HÃ¥r" name="Hair"> - <button label="Farve" label_selected="Farve" name="Color" /> - <button label="Stil" label_selected="Stil" name="Style" /> - <button label="Øjenbryn" label_selected="Øjenbryn" name="Eyebrows" /> - <button label="Skæg" label_selected="Skæg" name="Facial" /> - <text type="string" length="1" name="title"> + <button label="Farve" label_selected="Farve" name="Color"/> + <button label="Stil" label_selected="Stil" name="Style"/> + <button label="Øjenbryn" label_selected="Øjenbryn" name="Eyebrows"/> + <button label="Skæg" label_selected="Skæg" name="Facial"/> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> + <text length="1" name="not worn instructions" type="string"> Tag et ny hÃ¥r pÃ¥ ved at trække et fra din beholdning -over pÃ¥ din avatar. Du kan ogsÃ¥ oprette et nyt hÃ¥r fra bunden og bagefter 'tage det pÃ¥'. +over pÃ¥ din avatar. Du kan ogsÃ¥ oprette et nyt hÃ¥r fra bunden +og bagefter 'tage det pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> - <texture_picker label="Tekstur" name="Texture" /> - <button label="Tilfældig" label_selected="Tilfældig" name="Randomize" /> - <button label="Lav nyt hÃ¥r" label_selected="Lav nyt hÃ¥r" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> - <button label="Annullér" label_selected="Annullér" name="Revert" /> + <text name="Item Action Label"> + HÃ¥r: + </text> + <texture_picker label="Tekstur" name="Texture" tool_tip="Klik for at vælge et billede"/> + <button label="Lav nyt hÃ¥r" label_selected="Lav nyt hÃ¥r" name="Create New"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> + <button label="Annullér" label_selected="Annullér" name="Revert"/> </panel> <panel label="Øjne" name="Eyes"> - <text type="string" length="1" name="title"> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: Kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> + <text length="1" name="not worn instructions" type="string"> Tag et ny sæt øjne pÃ¥ ved at trække et sæt fra din beholdning -over pÃ¥ din avatar. Du kan ogsÃ¥ oprette et nyt sæt øjne fra bunden og bagefter 'tage dem pÃ¥'. +over pÃ¥ din avatar. Du kan ogsÃ¥ oprette et nyt sæt øjne fra bunden +og bagefter 'tage dem pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> - <texture_picker label="Iris" name="Iris" /> - <button label="Tilfældig" label_selected="Tilfældig" name="Randomize" /> - <button label="Lav nye øjne" label_selected="Lav nye øjne" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> - <button label="Annullér" label_selected="Annullér" name="Revert" /> + <text name="Item Action Label"> + Øjne: + </text> + <texture_picker label="Iris" name="Iris" tool_tip="Klik for at vælge et billede"/> + <button label="Lav nye øjne" label_selected="Lav nye øjne" name="Create New"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> + <button label="Annullér" label_selected="Annullér" name="Revert"/> </panel> - <panel label="Tøje" name="clothes_placeholder" /> + <panel label="Tøje" name="clothes_placeholder"/> <panel label="Trøje" name="Shirt"> - <texture_picker label="Stof" name="Fabric" /> - <color_swatch label="Farve" name="Color/Tint" /> - <button label="Lav ny trøje" label_selected="Lav ny trøje" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> - <button label="Annullér" label_selected="Annullér" name="Revert" /> - <text type="string" length="1" name="title"> + <texture_picker label="Stof" name="Fabric" tool_tip="Klik for at vælge et billede"/> + <color_swatch label="Farve" name="Color/Tint" tool_tip="Klik for at Ã¥bne farvevælger"/> + <button label="Lav ny trøje" label_selected="Lav ny trøje" name="Create New"/> + <button label="Tag af" label_selected="Tag af" name="Take Off"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> + <button label="Annullér" label_selected="Annullér" name="Revert"/> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: Kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> - Tag en ny Tøje pÃ¥ ved at trække en fra din beholdning -over pÃ¥ din avatar. + <text length="1" name="not worn instructions" type="string"> + Tag en ny Tøje pÃ¥ ved at trække en fra din beholdning over pÃ¥ din avatar. Du kan ogsÃ¥ oprette en ny Tøje fra bunden og bagefter 'tage den pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> + <text name="Item Action Label"> + Trøje: + </text> </panel> <panel label="Bukser" name="Pants"> - <texture_picker label="Stof" name="Fabric" /> - <color_swatch label="Farve" name="Color/Tint" /> - <button label="Lav nye bukser" label_selected="Lav nye bukser" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> - <button label="Annullér" label_selected="Annullér" name="Revert" /> - <text type="string" length="1" name="title"> + <texture_picker label="Stof" name="Fabric" tool_tip="Klik for at vælge et billede"/> + <color_swatch label="Farve" name="Color/Tint" tool_tip="Klik for at Ã¥bne farvevælger"/> + <button label="Lav nye bukser" label_selected="Lav nye bukser" name="Create New"/> + <button label="Tag af" label_selected="Tag af" name="Take Off"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> + <button label="Annullér" label_selected="Annullér" name="Revert"/> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: Kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> - Tag nyr bukser pÃ¥ ved at trække dem fra din beholdning -over pÃ¥ din avatar. -Du kan ogsÃ¥ oprette ny bukser fra bunden og bagefter 'tage dem pÃ¥'. + <text length="1" name="not worn instructions" type="string"> + Tag nyr bukser pÃ¥ ved at trække dem fra din beholdning over pÃ¥ +din avatar. Du kan ogsÃ¥ oprette ny bukser fra bunden og bagefter +'tage dem pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> + <text name="Item Action Label"> + Bukser: + </text> </panel> <panel label="Sko" name="Shoes"> - <text type="string" length="1" name="title"> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: Kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> + <text length="1" name="not worn instructions" type="string"> Tag et ny par sko pÃ¥ ved at trække dem fra din beholdning -over pÃ¥ din avatar. Du kan ogsÃ¥ oprette et nyt par sko fra bunden og bagefter 'tage dem pÃ¥'. +over pÃ¥ din avatar. Du kan ogsÃ¥ oprette et nyt par sko fra bunden +og bagefter 'tage dem pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> - <texture_picker label="Stof" name="Fabric" /> - <color_swatch label="Farve" name="Color/Tint" /> - <button label="Lav nye sko" label_selected="Lav nye sko" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> - <button label="Annullér" label_selected="Annullér" name="Revert" /> + <text name="Item Action Label"> + Sko: + </text> + <texture_picker label="Stof" name="Fabric" tool_tip="Klik for at vælge et billede"/> + <color_swatch label="Farve" name="Color/Tint" tool_tip="Klik for at Ã¥bne farvevælger"/> + <button label="Lav nye sko" label_selected="Lav nye sko" name="Create New"/> + <button label="Tag af" label_selected="Tag af" name="Take Off"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> + <button label="Annullér" label_selected="Annullér" name="Revert"/> </panel> <panel label="Strømper" name="Socks"> - <text type="string" length="1" name="title"> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: Kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> + <text length="1" name="not worn instructions" type="string"> Tag et ny par Strømper pÃ¥ ved at trække dem fra din beholdning -over pÃ¥ din avatar. Du kan ogsÃ¥ oprette et nyt par Strømper fra bunden og bagefter 'tage dem pÃ¥'. +over pÃ¥ din avatar. Du kan ogsÃ¥ oprette et nyt par Strømper fra bunden +og bagefter 'tage dem pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> - <texture_picker label="Stof" name="Fabric" /> - <color_swatch label="Farve" name="Color/Tint" /> - <button label="Lav nye strømper" label_selected="Lav nye strømper" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> - <button label="Annullér" label_selected="Annullér" name="Revert" /> + <text name="Item Action Label"> + Strømper: + </text> + <texture_picker label="Stof" name="Fabric" tool_tip="Klik for at vælge et billede"/> + <color_swatch label="Farve" name="Color/Tint" tool_tip="Klik for at Ã¥bne farvevælger"/> + <button label="Lav nye strømper" label_selected="Lav nye strømper" name="Create New"/> + <button label="Tag af" label_selected="Tag af" name="Take Off"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> + <button label="Annullér" label_selected="Annullér" name="Revert"/> </panel> <panel label="Jakke" name="Jacket"> - <text type="string" length="1" name="title"> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: Kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> - Tag en ny jakke pÃ¥ ved at trække en fra din beholdning -over pÃ¥ din avatar. + <text length="1" name="not worn instructions" type="string"> + Tag en ny jakke pÃ¥ ved at trække en fra din beholdning over pÃ¥ din avatar. Du kan ogsÃ¥ oprette en ny jakke fra bunden og bagefter 'tage den pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> - <texture_picker label="Stof øverst" name="Upper Fabric" /> - <texture_picker label="Stof nederst" name="Lower Fabric" /> - <color_swatch label="Farve" name="Color/Tint" /> - <button label="Lav ny jakke" label_selected="Lav ny jakke" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> - <button label="Annullér" label_selected="Annullér" name="Revert" /> + <text name="Item Action Label"> + Jakke: + </text> + <texture_picker label="Stof øverst" name="Upper Fabric" tool_tip="Klik for at vælge et billede"/> + <texture_picker label="Stof nederst" name="Lower Fabric" tool_tip="Klik for at vælge et billede"/> + <color_swatch label="Farve" name="Color/Tint" tool_tip="Klik for at Ã¥bne farvevælger"/> + <button label="Lav ny jakke" label_selected="Lav ny jakke" name="Create New"/> + <button label="Tag af" label_selected="Tag af" name="Take Off"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> + <button label="Annullér" label_selected="Annullér" name="Revert"/> </panel> <panel label="Handsker" name="Gloves"> - <text type="string" length="1" name="title"> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: Kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> - Tag nye handsker pÃ¥ ved at trække et par fra din beholdning -over pÃ¥ din avatar. -Du kan ogsÃ¥ oprette nye handsker fra bunden og bagefter 'tage dem pÃ¥'. + <text length="1" name="not worn instructions" type="string"> + Tag nye handsker pÃ¥ ved at trække et par fra din beholdning over pÃ¥ +din avatar. Du kan ogsÃ¥ oprette nye handsker fra bunden +og bagefter 'tage dem pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> - <texture_picker label="Stof" name="Fabric" /> - <color_swatch label="Farve" name="Color/Tint" /> - <button label="Lav nye handsker" label_selected="Lav nye handsker" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> - <button label="Annullér" label_selected="Annullér" name="Revert" /> + <text name="Item Action Label"> + Handsker: + </text> + <texture_picker label="Stof" name="Fabric" tool_tip="Klik for at vælge et billede"/> + <color_swatch label="Farve" name="Color/Tint" tool_tip="Klik for at Ã¥bne farvevælger"/> + <button label="Lav nye handsker" label_selected="Lav nye handsker" name="Create New"/> + <button label="Tag af" label_selected="Tag af" name="Take Off"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> + <button label="Annullér" label_selected="Annullér" name="Revert"/> </panel> <panel label="Undertrøje" name="Undershirt"> - <text type="string" length="1" name="title"> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: Kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> - Tag en ny undertrøje pÃ¥ ved at trække en fra din beholdning -over pÃ¥ din avatar. -Du kan ogsÃ¥ oprette en ny undertrøje fra bunden og bagefter 'tage den pÃ¥'. + <text length="1" name="not worn instructions" type="string"> + Tag en ny undertrøje pÃ¥ ved at trække en fra din beholdning over pÃ¥ +din avatar. Du kan ogsÃ¥ oprette en ny undertrøje fra bunden +og bagefter 'tage den pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> - <texture_picker label="Stof" name="Fabric" /> - <color_swatch label="Farve" name="Color/Tint" /> - <button label="Lav ny undertrøje" label_selected="Lav ny undertrøje" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> - <button label="Annullér" label_selected="Annullér" name="Revert" /> + <text name="Item Action Label"> + Undertrøje: + </text> + <texture_picker label="Stof" name="Fabric" tool_tip="Klik for at vælge et billede"/> + <color_swatch label="Farve" name="Color/Tint" tool_tip="Klik for at Ã¥bne farvevælger"/> + <button label="Lav ny undertrøje" label_selected="Lav ny undertrøje" name="Create New"/> + <button label="Tag af" label_selected="Tag af" name="Take Off"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> + <button label="Annullér" label_selected="Annullér" name="Revert"/> </panel> <panel label="Underbukser" name="Underpants"> - <text type="string" length="1" name="title"> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: Kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> - Tag nye underbukser pÃ¥ ved at trække dem fra din beholdning -over pÃ¥ din avatar. -Du kan ogsÃ¥ oprette en par nye underbukser fra bunden og bagefter 'tage dem pÃ¥'. + <text length="1" name="not worn instructions" type="string"> + Tag nye underbukser pÃ¥ ved at trække dem fra din beholdning over pÃ¥ +din avatar. Du kan ogsÃ¥ oprette en par nye underbukser fra bunden +og bagefter 'tage dem pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> - <texture_picker label="Stof" name="Fabric" /> - <color_swatch label="Farve" name="Color/Tint" /> - <button label="Lav nye underbukser" label_selected="Lav nye underbukser" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> - <button label="Annullér" label_selected="Annullér" name="Revert" /> + <text name="Item Action Label"> + Underbukser: + </text> + <texture_picker label="Stof" name="Fabric" tool_tip="Klik for at vælge et billede"/> + <color_swatch label="Farve" name="Color/Tint" tool_tip="Klik for at Ã¥bne farvevælger"/> + <button label="Lav nye underbukser" label_selected="Lav nye underbukser" name="Create New"/> + <button label="Tag af" label_selected="Tag af" name="Take Off"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> + <button label="Annullér" label_selected="Annullér" name="Revert"/> </panel> <panel label="Nederdel" name="Skirt"> - <text type="string" length="1" name="title"> + <text length="1" name="title" type="string"> [DESC] </text> - <text type="string" length="1" name="title_no_modify"> + <text length="1" name="title_no_modify" type="string"> [DESC]: Kan ikke redigeres </text> - <text type="string" length="1" name="title_loading"> + <text length="1" name="title_loading" type="string"> [DESC]: indlæser... </text> - <text type="string" length="1" name="title_not_worn"> + <text length="1" name="title_not_worn" type="string"> [DESC]: ikke bÃ¥ret </text> - <text type="string" length="1" name="path"> + <text length="1" name="path" type="string"> Fundet i [PATH] </text> - <text type="string" length="1" name="not worn instructions"> - Tag en ny nederdel pÃ¥ ved at trække en fra din beholdning -over pÃ¥ din avatar. -Du kan ogsÃ¥ oprette en ny nederdel fra bunden og bagefter 'tage den pÃ¥'. + <text length="1" name="not worn instructions" type="string"> + Tag en ny nederdel pÃ¥ ved at trække en fra din beholdning over pÃ¥ +din avatar. Du kan ogsÃ¥ oprette en ny nederdel fra bunden +og bagefter 'tage den pÃ¥'. </text> - <text type="string" length="1" name="no modify instructions"> + <text length="1" name="no modify instructions" type="string"> Du har ikke rettigheder til at redigere denne del. </text> - <texture_picker label="Stof" name="Fabric" /> - <color_swatch label="Farve" name="Color/Tint" /> - <button label="Lav ny nederdel" label_selected="Lav ny nederdel" name="Create New" /> - <button label="Tag af" label_selected="Tag af" name="Take Off" /> - <button label="Gem" label_selected="Gem" name="Save" /> - <button label="Gem som" label_selected="Gem som" name="Save As" /> - <button label="Annullér" label_selected="Annullér" name="Revert" /> + <text name="Item Action Label"> + Nederdel: + </text> + <texture_picker label="Stof" name="Fabric" tool_tip="Klik for at vælge et billede"/> + <color_swatch label="Farve" name="Color/Tint" tool_tip="Klik for at Ã¥bne farvevælger"/> + <button label="Lav ny nederdel" label_selected="Lav ny nederdel" name="Create New"/> + <button label="Tag af" label_selected="Tag af" name="Take Off"/> + <button label="Gem" label_selected="Gem" name="Save"/> + <button label="Gem som..." label_selected="Gem som..." name="Save As"/> + <button label="Annullér" label_selected="Annullér" name="Revert"/> </panel> </tab_container> - <button label="Luk" label_selected="Luk" name="Close" /> - <button label="Gem alt" label_selected="Gem alt" name="Save All" /> - <button label="Opret sæt" label_selected="Opret sæt" name="Make Outfit" /> + <scroll_container left="212" name="panel_container"/> + <button label="Annullér" label_selected="Annullér" name="Cancel"/> + <button label="OK" label_selected="OK" name="Ok"/> + <button label="Opret sæt..." label_selected="Opret sæt..." name="Make Outfit"/> </floater> diff --git a/indra/newview/skins/default/xui/da/floater_hardware_settings.xml b/indra/newview/skins/default/xui/da/floater_hardware_settings.xml index f2552503898e07b194284d0a43062f9198f43149..488660853f82e26b946600139a6cecdbead548cc 100644 --- a/indra/newview/skins/default/xui/da/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/da/floater_hardware_settings.xml @@ -7,22 +7,12 @@ <text type="string" length="1" name="Antialiasing:"> Antialiasing: </text> - <combo_box label="Antialiasing" name="fsaa"> - <combo_item name="FSAADisabled"> - SlÃ¥et fra - </combo_item> - <combo_item name="2x"> - 2x - </combo_item> - <combo_item name="4x"> - 4x - </combo_item> - <combo_item name="8x"> - 8x - </combo_item> - <combo_item name="16x"> - 16x - </combo_item> + <combo_box label="Antialiasing" name="fsaa" width="100"> + <combo_box.item name="FSAADisabled" label="SlÃ¥et fra"/> + <combo_box.item name="2x" label="2x"/> + <combo_box.item name="4x" label="4x"/> + <combo_box.item name="8x" label="8x"/> + <combo_box.item name="16x" label="16x"/> </combo_box> <spinner label="Gamma:" name="gamma" /> <text type="string" length="1" name="(brightness, lower is brighter)"> diff --git a/indra/newview/skins/default/xui/da/floater_image_preview.xml b/indra/newview/skins/default/xui/da/floater_image_preview.xml index c7ce3d00b60d16071ae855887e693e488baae095..345c9aa6d1409bb165a27aca6c517d948b3a5417 100644 --- a/indra/newview/skins/default/xui/da/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/da/floater_image_preview.xml @@ -10,36 +10,16 @@ Se billede som: </text> <combo_box label="Tøj type" name="clothing_type_combo"> - <combo_item name="Image"> - Billede - </combo_item> - <combo_item name="Hair"> - HÃ¥r - </combo_item> - <combo_item name="FemaleHead"> - Kvinde - hoved - </combo_item> - <combo_item name="FemaleUpperBody"> - Kvinde - overkrop - </combo_item> - <combo_item name="FemaleLowerBody"> - Kvinde - underkrop - </combo_item> - <combo_item name="MaleHead"> - Mand - hoved - </combo_item> - <combo_item name="MaleUpperBody"> - Mand - overkrop - </combo_item> - <combo_item name="MaleLowerBody"> - Mand - underkrop - </combo_item> - <combo_item name="Skirt"> - Nederdel - </combo_item> - <combo_item name="SculptedPrim"> - Sculpted prim - </combo_item> + <combo_box.item name="Image" label="Billede"/> + <combo_box.item name="Hair" label="HÃ¥r"/> + <combo_box.item name="FemaleHead" label="Kvinde - hoved"/> + <combo_box.item name="FemaleUpperBody" label="Kvinde - overkrop"/> + <combo_box.item name="FemaleLowerBody" label="Kvinde - underkrop"/> + <combo_box.item name="MaleHead" label="Mand - hoved"/> + <combo_box.item name="MaleUpperBody" label="Mand - overkrop"/> + <combo_box.item name="MaleLowerBody" label="Mand - underkrop"/> + <combo_box.item name="Skirt" label="Nederdel"/> + <combo_box.item name="SculptedPrim" label="Sculpted prim"/> </combo_box> <text name="bad_image_text"> Kunne ikke læse billede. diff --git a/indra/newview/skins/default/xui/da/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/da/floater_inventory_item_properties.xml index 96039c844424d8173debd8ec1e476672dba4f339..9f28440fb0c162b9961d88e4595ab278a74ff627 100644 --- a/indra/newview/skins/default/xui/da/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/da/floater_inventory_item_properties.xml @@ -60,12 +60,8 @@ </text> <check_box label="Til salg" name="CheckPurchase" /> <radio_group name="RadioSaleType"> - <radio_item name="radio"> - Original - </radio_item> - <radio_item name="radio2"> - Kopi - </radio_item> + <radio_item name="radio" label="Original" /> + <radio_item name="radio2" label="Kopi" /> </radio_group> <text name="TextPrice"> Pris: L$ diff --git a/indra/newview/skins/default/xui/da/floater_preview_gesture.xml b/indra/newview/skins/default/xui/da/floater_preview_gesture.xml index cf3445e1a6e4369762efad8e04577b62843952a4..0053cb852f7c3fb71d3ad79a3e9f506ddc16505f 100644 --- a/indra/newview/skins/default/xui/da/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/da/floater_preview_gesture.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="gesture_preview"> <string name="stop_txt"> Stop @@ -15,42 +15,42 @@ <text name="trigger_label"> Udløser: </text> - <text name="replace_text" - tool_tip="Replace the trigger word(s) with these words. For example, trigger 'hello' replace with 'howdy' will turn the chat 'I wanted to say hello' into 'I wanted to say howdy' as well as playing the gesture!"> + <text name="replace_text" tool_tip="Replace the trigger word(s) with these words. For example, trigger 'hello' replace with 'howdy' will turn the chat 'I wanted to say hello' into 'I wanted to say howdy' as well as playing the gesture!"> Erstat med: </text> - <line_editor name="replace_editor" - tool_tip="Replace the trigger word(s) with these words. For example, trigger 'hello' replace with 'howdy' will turn the chat 'I wanted to say hello' into 'I wanted to say howdy' as well as playing the gesture" /> + <line_editor name="replace_editor" tool_tip="Replace the trigger word(s) with these words. For example, trigger 'hello' replace with 'howdy' will turn the chat 'I wanted to say hello' into 'I wanted to say howdy' as well as playing the gesture"/> <text name="key_label"> Genvejstast: </text> - <combo_box label="Ingen" name="modifier_combo" /> - <combo_box label="Ingen" name="key_combo" /> + <combo_box label="Ingen" name="modifier_combo" width="60"/> + <combo_box label="Ingen" name="key_combo" left_delta="70" width="60"/> <text name="library_label"> Type: </text> <text name="steps_label"> Trin: </text> - <button label="Tilføj >>" name="add_btn" /> - <button label="Flyt op" name="up_btn" /> - <button label="Flyt ned" name="down_btn" /> - <button label="Fjern" name="delete_btn" /> + <scroll_list name="library_list"> + Animation +Lyd +Chat +Vent + </scroll_list> + <button label="Tilføj >>" name="add_btn"/> + <button label="Flyt op" name="up_btn"/> + <button label="Flyt ned" name="down_btn"/> + <button label="Fjern" name="delete_btn"/> <text name="help_label"> Alle trin vil ske samtidigt, medmindre du tilføjer vente trin. </text> <radio_group name="animation_trigger_type"> - <radio_item name="start"> - Start - </radio_item> - <radio_item name="stop"> - Stop - </radio_item> + <radio_item name="start" label="Start" /> + <radio_item name="stop" label="Stop" /> </radio_group> - <check_box label="Indtil animation er færdig" name="wait_anim_check" /> - <check_box label="tid i sekunder" name="wait_time_check" /> - <check_box label="Aktiv" name="active_check" /> - <button label="Vis" name="preview_btn" /> - <button label="Gem" name="save_btn" /> + <check_box label="Indtil animation er færdig" name="wait_anim_check"/> + <check_box label="tid i sekunder" name="wait_time_check"/> + <check_box label="Aktiv" name="active_check" tool_tip="Aktive bevægelser kan blive aktiveret ved at skrive deress udløser tekst eller ved at trykke pÃ¥ genvejstaste. Bevægelser vil normalt være inaktive hvis der allerede findes en tilsvarende genvejstaste."/> + <button label="Vis" name="preview_btn"/> + <button label="Gem" name="save_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/da/floater_report_abuse.xml b/indra/newview/skins/default/xui/da/floater_report_abuse.xml index 64e39da8feaa95d8f8d1e803955b6279f0657fcf..804051e62c8c53433b5b1359f72e46df0630816b 100644 --- a/indra/newview/skins/default/xui/da/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/da/floater_report_abuse.xml @@ -1,7 +1,7 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="floater_report_abuse" title="Rapportér misbrug"> - <texture_picker label="" name="screenshot" /> - <check_box label="Inkludér billede" name="screen_check" /> + <texture_picker label="" name="screenshot"/> + <check_box label="Inkludér billede" name="screen_check"/> <text name="reporter_title"> Anmelder: </text> @@ -23,147 +23,71 @@ <text name="select_object_label"> Klik pÃ¥ knappen derefter objektet: </text> - <button label="" label_selected="" name="pick_btn" - tool_tip="Objekt vælger - Identificér et objekt denne rapport omhandler" /> + <button label="" label_selected="" name="pick_btn" tool_tip="Objekt vælger - Identificér et objekt denne rapport omhandler"/> <text name="object_name_label"> Navn: </text> - <text name="object_name"> + <text name="object_name" left_delta="64" width="140"> Consetetur Sadipscing </text> <text name="owner_name_label"> Ejer: </text> - <text name="owner_name"> + <text name="owner_name" left_delta="64"> Hendrerit Vulputate </text> - <combo_box name="category_combo" - tool_tip="Kategori -- Vælg en kategori der passer bedst pÃ¥ denne rapport"> - <combo_item name="Select_category"> - Vælg kategori - </combo_item> - <combo_item name="Age__Age_play"> - Alder > Falsk alder - </combo_item> - <combo_item name="Age__Adult_resident_on_Teen_Second_Life"> - Alder > Voksen beboer pÃ¥ Teen Second Life - </combo_item> - - - - <combo_item name="Assault__Combat_sandbox___unsafe_area"> - Overfald > Kamp sandkasse / Usikkert omrÃ¥de - </combo_item> - <combo_item name="Assault__Safe_area"> - Overfald > Sikkert omrÃ¥de - </combo_item> - <combo_item name="Assault__Weapons_testing_sandbox"> - Overfald > Sandkasse til vÃ¥bentest - </combo_item> - <combo_item name="Commerce__Failure_to_deliver_product_or_service"> - Handel > Vare eller ydelse ikke leveret - </combo_item> - <combo_item name="Disclosure__Real_world_information"> - Offentliggørelse > Om oplysninger i den virkelige verden - </combo_item> - <combo_item name="Disclosure__Remotely_monitoring chat"> - Offentliggørelse > Fjernaflytning af chat - </combo_item> - <combo_item name="Disclosure__Second_Life_information_chat_IMs"> - Offentliggørelse > Information/chat/IM fra Second Life - </combo_item> - <combo_item name="Disturbing_the_peace__Unfair_use_of_region_resources"> - Forstyrrelse af fred > Unfair brug af region ressourcer - </combo_item> - <combo_item name="Disturbing_the_peace__Excessive_scripted_objects"> - Forstyrrelse af fred > Overdreven brug af objekter med script - </combo_item> - <combo_item name="Disturbing_the_peace__Object_littering"> - Forstyrrelse af fred > Object affald - </combo_item> - <combo_item name="Disturbing_the_peace__Repetitive_spam"> - Forstyrring af fred > Gentagen spam - </combo_item> - <combo_item name="Disturbing_the_peace__Unwanted_advert_spam"> - Forstyrrelse af fred > Uønsket reklame spam - </combo_item> - <combo_item name="Fraud__L$"> - Bedrageri > L$ - </combo_item> - <combo_item name="Fraud__Land"> - Bedrageri > Land - </combo_item> - <combo_item name="Fraud__Pyramid_scheme_or_chain_letter"> - Bedrageri > Pyramide spil eller kædebreve - </combo_item> - <combo_item name="Fraud__US$"> - Bedrageri > US$ - </combo_item> - <combo_item name="Harassment__Advert_farms___visual_spam"> - Chikane > reklame farm / billedeligt spam - </combo_item> - <combo_item name="Harassment__Defaming_individuals_or_groups"> - Chikane > Injurier/bagvask enkeltpersoner eller grupper - </combo_item> - <combo_item name="Harassment__Impeding_movement"> - Chikane > Hindre bevægelse - </combo_item> - <combo_item name="Harassment__Sexual_harassment"> - Chikane > Sex chikane - </combo_item> - <combo_item name="Harassment__Solicting_inciting_others_to_violate_ToS"> - Chikane > Opfordrer/kræver at andre overtræder licensbetingelser - </combo_item> - <combo_item name="Harassment__Verbal_abuse"> - Chikane > Verbalt chikane - </combo_item> - <combo_item name="Indecency__Broadly_offensive_content_or_conduct"> - Uanstændighed > Meget stødende indhold eller adfærd - </combo_item> - - - - <combo_item name="Indecency__Inappropriate_avatar_name"> - Uanstændighed > Upassende avatar navn - </combo_item> - - - - <combo_item name="Intellectual_property_infringement_Content_Removal"> - Krænkelse af intellektuelle ejendomsrettigheder > Indholds fjernelse - </combo_item> - <combo_item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"> - Krænkelse af intellektuelle ejendomsrettigheder > CopyBot eller omgÃ¥else af rettighedsbeskyttelse - </combo_item> - <combo_item name="Intolerance"> - Intolerance - </combo_item> - <combo_item name="Land__Abuse_of_sandbox_resources"> - Land > Misbrug af sandkasse resourcer - </combo_item> - <combo_item name="Land__Encroachment__Objects_textures"> - Land > Overgreb > Objekter/teksturer - </combo_item> - <combo_item name="Land__Encroachment__Particles"> - Land > Overgreb > Partikler - </combo_item> - <combo_item name="Land__Encroachment__Trees_plants"> - Land > Overgreb > Træer/planter - </combo_item> - <combo_item name="Wagering_gambling"> - VæddemÃ¥l/gambling - </combo_item> - <combo_item name="Other"> - Andet - </combo_item> + <combo_box name="category_combo" tool_tip="Kategori -- Vælg en kategori der passer bedst pÃ¥ denne rapport"> + <combo_box.item name="Select_category" label="Vælg kategori"/> + <combo_box.item name="Age__Age_play" label="Alder > Falsk alder"/> + <combo_box.item name="Age__Adult_resident_on_Teen_Second_Life" label="Alder > Voksen beboer pÃ¥ Teen Second Life"/> + <combo_item name="Age__Underage_resident_outside_of_Teen_Second_Life"> + Alder > MindreÃ¥rig beboer udenfor Teen Second Life + </combo_item> + <combo_box.item name="Assault__Combat_sandbox___unsafe_area" label="Overfald > Kamp sandkasse / Usikkert omrÃ¥de"/> + <combo_box.item name="Assault__Safe_area" label="Overfald > Sikkert omrÃ¥de"/> + <combo_box.item name="Assault__Weapons_testing_sandbox" label="Overfald > Sandkasse til vÃ¥bentest"/> + <combo_box.item name="Commerce__Failure_to_deliver_product_or_service" label="Handel > Vare eller ydelse ikke leveret"/> + <combo_box.item name="Disclosure__Real_world_information" label="Offentliggørelse > Om oplysninger i den virkelige verden"/> + <combo_box.item name="Disclosure__Remotely_monitoring chat" label="Offentliggørelse > Fjernaflytning af chat"/> + <combo_box.item name="Disclosure__Second_Life_information_chat_IMs" label="Offentliggørelse > Information/chat/IM fra Second Life"/> + <combo_box.item name="Disturbing_the_peace__Unfair_use_of_region_resources" label="Forstyrrelse af fred > Unfair brug af region ressourcer"/> + <combo_box.item name="Disturbing_the_peace__Excessive_scripted_objects" label="Forstyrrelse af fred > Overdreven brug af objekter med script"/> + <combo_box.item name="Disturbing_the_peace__Object_littering" label="Forstyrrelse af fred > Object affald"/> + <combo_box.item name="Disturbing_the_peace__Repetitive_spam" label="Forstyrring af fred > Gentagen spam"/> + <combo_box.item name="Disturbing_the_peace__Unwanted_advert_spam" label="Forstyrrelse af fred > Uønsket reklame spam"/> + <combo_box.item name="Fraud__L$" label="Bedrageri > L$"/> + <combo_box.item name="Fraud__Land" label="Bedrageri > Land"/> + <combo_box.item name="Fraud__Pyramid_scheme_or_chain_letter" label="Bedrageri > Pyramide spil eller kædebreve"/> + <combo_box.item name="Fraud__US$" label="Bedrageri > US$"/> + <combo_box.item name="Harassment__Advert_farms___visual_spam" label="Chikane > reklame farm / billedeligt spam"/> + <combo_box.item name="Harassment__Defaming_individuals_or_groups" label="Chikane > Injurier/bagvask enkeltpersoner eller grupper"/> + <combo_box.item name="Harassment__Impeding_movement" label="Chikane > Hindre bevægelse"/> + <combo_box.item name="Harassment__Sexual_harassment" label="Chikane > Sex chikane"/> + <combo_box.item name="Harassment__Solicting_inciting_others_to_violate_ToS" label="Chikane > Opfordrer/kræver at andre overtræder licensbetingelser"/> + <combo_box.item name="Harassment__Verbal_abuse" label="Chikane > Verbalt chikane"/> + <combo_box.item name="Indecency__Broadly_offensive_content_or_conduct" label="Uanstændighed > Meget stødende indhold eller adfærd"/> + <combo_box.item name="Indecency__Inappropriate_avatar_name" label="Uanstændighed > Upassende avatar navn"/> + <combo_item name="Indecency__Mature_content_in_PG_region"> + Usømmelighed > Upassende inhold eller opførsel i en 'PG' region + </combo_item> + <combo_item name="Indecency__Inappropriate_content_in_Mature_region"> + Usømmelighed > Upassende inhold eller opførsel i en 'Mature' region + </combo_item> + <combo_box.item name="Intellectual_property_infringement_Content_Removal" label="Krænkelse af intellektuelle ejendomsrettigheder > Indholds fjernelse"/> + <combo_box.item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit" label="Krænkelse af intellektuelle ejendomsrettigheder > CopyBot eller omgÃ¥else af rettighedsbeskyttelse"/> + <combo_box.item name="Intolerance" label="Intolerance"/> + <combo_box.item name="Land__Abuse_of_sandbox_resources" label="Land > Misbrug af sandkasse resourcer"/> + <combo_box.item name="Land__Encroachment__Objects_textures" label="Land > Overgreb > Objekter/teksturer"/> + <combo_box.item name="Land__Encroachment__Particles" label="Land > Overgreb > Partikler"/> + <combo_box.item name="Land__Encroachment__Trees_plants" label="Land > Overgreb > Træer/planter"/> + <combo_box.item name="Wagering_gambling" label="VæddemÃ¥l/gambling"/> + <combo_box.item name="Other" label="Andet"/> </combo_box> <text name="abuser_name_title"> Udøvers navn: </text> - <button label="Vælg beboer" label_selected="" name="select_abuser" - tool_tip="Vælg navnet pÃ¥ udøveren fra denne liste" /> - <check_box label="Kender ikke udøvers navn" name="omit_abuser_name" - tool_tip="Afkryds her, hvis du ikke kender navn pÃ¥ udøvers" /> + <button label="Vælg beboer" label_selected="" name="select_abuser" tool_tip="Vælg navnet pÃ¥ udøveren fra denne liste"/> + <check_box label="Kender ikke udøvers navn" name="omit_abuser_name" tool_tip="Afkryds her, hvis du ikke kender navn pÃ¥ udøvers"/> <text name="abuser_name_title2"> Sted for misbrug/overgreb: </text> @@ -174,11 +98,12 @@ Detaljer: </text> <text name="bug_aviso"> - Vær venligst præcis omkring dato, sted, overgrebets natur, relevant chat/IM og vælg objekt hvis muligt. + Vær venligst præcis omkring dato, sted, overgrebets +natur, relevant chat/IM og vælg objekt hvis muligt. </text> <text name="incomplete_title"> Note: Ufuldstændige rapporter vil ikke blive undersøgt. </text> - <button label="Annullér" label_selected="Annullér" name="cancel_btn" /> - <button label="Rapporter misbrug" label_selected="Rapporter misbrug" name="send_btn" /> + <button label="Annullér" label_selected="Annullér" name="cancel_btn"/> + <button label="Rapporter misbrug" label_selected="Rapporter misbrug" name="send_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/da/floater_sell_land.xml b/indra/newview/skins/default/xui/da/floater_sell_land.xml index dbf9433872c4778988c5a506f55e4e4ac636421f..fc88b3d49a32d6b6bd9eac4ec23ddb521c0271fc 100644 --- a/indra/newview/skins/default/xui/da/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/da/floater_sell_land.xml @@ -34,15 +34,9 @@ Vælg om du vil sælge til hvem som helst eller en specifik køber. </text> <combo_box name="sell_to"> - <combo_item name="--selectone--"> - -- Vælg -- - </combo_item> - <combo_item name="Anyone"> - Alle - </combo_item> - <combo_item name="Specificuser:"> - Specifik bruger: - </combo_item> + <combo_box.item name="--selectone--" label="Vælg --" /> + <combo_box.item name="Anyone" label="Alle" /> + <combo_box.item name="Specificuser:" label="Specifik bruger:" /> </combo_box> <button label="Vælg..." name="sell_to_select_agent" /> <text name="sell_objects_label"> @@ -52,12 +46,8 @@ Dine objekter der kan videregives sælges med jorden. </text> <radio_group name="sell_objects"> - <radio_item name="no"> - Nej, behold ejerskab til objekterne - </radio_item> - <radio_item name="yes"> - Ja, sælg objekter med jorden - </radio_item> + <radio_item name="no" label="Nej, behold ejerskab til objekterne" /> + <radio_item name="yes" label="Ja, sælg objekter med jorden" /> </radio_group> <button label="Vis objekter" name="show_objects" /> <text name="nag_message_label"> diff --git a/indra/newview/skins/default/xui/da/floater_settings_debug.xml b/indra/newview/skins/default/xui/da/floater_settings_debug.xml index f9cb4d018699044a074dd9ef076cbbbb487bd7b1..60f99deae2e3aa170a017d8f76917bf96b6fd9aa 100644 --- a/indra/newview/skins/default/xui/da/floater_settings_debug.xml +++ b/indra/newview/skins/default/xui/da/floater_settings_debug.xml @@ -1,12 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater name="settings_debug" title="Tekniske indstillinger"> <combo_box name="boolean_combo"> - <combo_item name="TRUE"> - TRUE (Valgt) - </combo_item> - <combo_item name="FALSE"> - FALSE (Fravalgt) - </combo_item> + <combo_box.item name="TRUE" label="TRUE (Valgt)" /> + <combo_box.item name="FALSE" label="FALSE (Fravalgt)" /> </combo_box> <color_swatch label="Farve" name="color_swatch" /> <spinner label="x" name="val_spinner_1" /> diff --git a/indra/newview/skins/default/xui/da/floater_snapshot.xml b/indra/newview/skins/default/xui/da/floater_snapshot.xml index 8fc98220db62ae383b661290102ea2b98f6475e7..ed715bdb3929715aa69acdf8dc84b1b05eef6659 100644 --- a/indra/newview/skins/default/xui/da/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/da/floater_snapshot.xml @@ -1,29 +1,30 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="Snapshot" title="Se foto"> <text name="type_label"> Hvor skal foto hen? </text> <radio_group label="Snapshot type" name="snapshot_type_radio"> - <radio_item name="postcard"> - Send via e-mail - </radio_item> - <radio_item name="texture"> - Gem i din beholdning (L$[AMOUNT]) - </radio_item> - <radio_item name="local"> - Gem pÃ¥ din computer - </radio_item> + <radio_item name="postcard" label="Send via e-mail" /> + <radio_item name="texture" label="Gem i din beholdning (L$[AMOUNT])" /> + <radio_item name="local" label="Gem pÃ¥ din computer" /> </radio_group> <text name="file_size_label"> Fil størrelse: [SIZE] KB </text> - <button label="Tag nyt foto" name="new_snapshot_btn" /> - <button label="Send" name="send_btn" /> - <button label="Gem (L$[AMOUNT])" name="upload_btn" /> - <flyout_button label="Gem" name="save_btn" /> - <button label="Annullér" name="discard_btn" /> - <button label="Mere >>" name="more_btn" /> - <button label="<< Mindre" name="less_btn" /> + <button label="Tag nyt foto" name="new_snapshot_btn"/> + <button label="Send" name="send_btn"/> + <button label="Gem (L$[AMOUNT])" name="upload_btn"/> + <flyout_button label="Gem" name="save_btn" tool_tip="Gem billede i pÃ¥ din computer"> + <flyout_button_item name="save_item"> + Gem + </flyout_button_item> + <flyout_button_item name="saveas_item"> + Gem som... + </flyout_button_item> + </flyout_button> + <button label="Annullér" name="discard_btn"/> + <button label="Mere >>" name="more_btn" tool_tip="Avancerede valg"/> + <button label="<< Mindre" name="less_btn" tool_tip="Avancerede valg"/> <text name="type_label2"> Størrelse </text> @@ -31,97 +32,52 @@ Format </text> <combo_box label="Opløsning" name="postcard_size_combo"> - <combo_item name="CurrentWindow"> - Aktuelle vindue - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="Custom"> - Manuel - </combo_item> + <combo_box.item name="CurrentWindow" label="Aktuelle vindue"/> + <combo_box.item name="640x480" label="640x480"/> + <combo_box.item name="800x600" label="800x600"/> + <combo_box.item name="1024x768" label="1024x768"/> + <combo_box.item name="Custom" label="Manuel"/> </combo_box> <combo_box label="Opløsning" name="texture_size_combo"> - <combo_item name="CurrentWindow"> - Aktuelle vindue - </combo_item> - <combo_item name="Small(128x128)"> - Lille (128x128) - </combo_item> - <combo_item name="Medium(256x256)"> - Medium (256x256) - </combo_item> - <combo_item name="Large(512x512)"> - Stor (512x512) - </combo_item> - <combo_item name="Custom"> - Manuel - </combo_item> + <combo_box.item name="CurrentWindow" label="Aktuelle vindue"/> + <combo_box.item name="Small(128x128)" label="Lille (128x128)"/> + <combo_box.item name="Medium(256x256)" label="Medium (256x256)"/> + <combo_box.item name="Large(512x512)" label="Stor (512x512)"/> + <combo_box.item name="Custom" label="Manuel"/> </combo_box> <combo_box label="Opløsning" name="local_size_combo"> - <combo_item name="CurrentWindow"> - Aktuelle vindue - </combo_item> - <combo_item name="320x240"> - 320x240 - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="1280x1024"> - 1280x1024 - </combo_item> - <combo_item name="1600x1200"> - 1600x1200 - </combo_item> - <combo_item name="Custom"> - Manuelt - </combo_item> + <combo_box.item name="CurrentWindow" label="Aktuelle vindue"/> + <combo_box.item name="320x240" label="320x240"/> + <combo_box.item name="640x480" label="640x480"/> + <combo_box.item name="800x600" label="800x600"/> + <combo_box.item name="1024x768" label="1024x768"/> + <combo_box.item name="1280x1024" label="1280x1024"/> + <combo_box.item name="1600x1200" label="1600x1200"/> + <combo_box.item name="Custom" label="Manuelt"/> </combo_box> - <combo_box label="Fil-format" name="local_format_combo"> - <combo_item name="PNG"> - PNG - </combo_item> - <combo_item name="JPEG"> - JPEG - </combo_item> - <combo_item name="BMP"> - BMP - </combo_item> + <combo_box label="Fil-format" name="local_format_combo" width="76"> + <combo_box.item name="PNG" label="PNG"/> + <combo_box.item name="JPEG" label="JPEG"/> + <combo_box.item name="BMP" label="BMP"/> </combo_box> - <spinner label="Bredde" name="snapshot_width" /> - <spinner label="Højde" name="snapshot_height" /> - <check_box label="Fasthold proportioner" name="keep_aspect_check" /> - <slider label="Billed-kvalitet" name="image_quality_slider" /> + <spinner label="Bredde" name="snapshot_width" label_width="41" width="101"/> + <spinner label="Højde" name="snapshot_height" label_width="32" width="92" left="117"/> + <check_box label="Fasthold proportioner" name="keep_aspect_check"/> + <slider label="Billed-kvalitet" name="image_quality_slider"/> <text name="layer_type_label"> Benyt: </text> <combo_box label="Billedlag" name="layer_types"> - <combo_item name="Colors"> - Farver - </combo_item> - <combo_item name="Depth"> - Dybde - </combo_item> - <combo_item name="ObjectMattes"> - Materinger - </combo_item> + <combo_box.item name="Colors" label="Farver"/> + <combo_box.item name="Depth" label="Dybde"/> + <combo_box.item name="ObjectMattes" label="Materinger"/> </combo_box> - <check_box label="Vis brugerflade pÃ¥ foto" name="ui_check" /> - <check_box label="Vis HUD objekter pÃ¥ foto" name="hud_check" /> - <check_box label="Luk ikke vindue ved gemning" name="keep_open_check" /> - <check_box label="Frys billede og vis" name="freeze_frame_check" /> - <check_box label="Auto-opdater" name="auto_snapshot_check" /> + <check_box label="Vis brugerflade pÃ¥ foto" name="ui_check"/> + <check_box label="Vis HUD objekter pÃ¥ foto" name="hud_check"/> + <check_box label="Luk ikke vindue ved gemning" name="keep_open_check"/> + <check_box label="Frys billede og vis" name="freeze_frame_check"/> + <check_box label="Auto-opdater" name="auto_snapshot_check"/> + <string name="unknown"> + ukendt + </string> </floater> diff --git a/indra/newview/skins/default/xui/da/floater_tools.xml b/indra/newview/skins/default/xui/da/floater_tools.xml index bc15db0e253c447052c9a88d5abd332d6196bc1f..ccb8c67b687166ddd9552249ae77beec324d7ba4 100644 --- a/indra/newview/skins/default/xui/da/floater_tools.xml +++ b/indra/newview/skins/default/xui/da/floater_tools.xml @@ -1,39 +1,33 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater name="toolbox floater" title=""> - <button label="" label_selected="" name="button focus" tool_tip="Fokus" /> - <button label="" label_selected="" name="button move" tool_tip="Flyt" /> - <button label="" label_selected="" name="button edit" tool_tip="Redigér" /> - <button label="" label_selected="" name="button create" tool_tip="Opret" /> - <button label="" label_selected="" name="button land" tool_tip="Land" /> - <check_box label="Zoom" name="radio zoom" /> - <check_box label="Kredsløb (Ctrl)" name="radio orbit" /> - <check_box label="Panorér (Ctrl-Shift)" name="radio pan" /> - <check_box label="Flyt" name="radio move" /> - <check_box label="Løft (Ctrl)" name="radio lift" /> - <check_box label="Spin (Ctrl-Shift)" name="radio spin" /> - <check_box label="Position" name="radio position" /> - <check_box label="Rotér (Ctrl)" name="radio rotate" /> - <check_box label="Stræk (Ctrl-Shift)" name="radio stretch" /> - <check_box label="Vælg tekstur" name="radio select face" /> - <check_box label="Redigér sammenlænkede dele" name="checkbox edit linked parts" /> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="toolbox floater" title="" short_title="Byg"> + <button label="" label_selected="" name="button focus" tool_tip="Fokus"/> + <button label="" label_selected="" name="button move" tool_tip="Flyt"/> + <button label="" label_selected="" name="button edit" tool_tip="Redigér"/> + <button label="" label_selected="" name="button create" tool_tip="Opret"/> + <button label="" label_selected="" name="button land" tool_tip="Land"/> + <check_box label="Zoom" name="radio zoom"/> + <check_box label="Kredsløb (Ctrl)" name="radio orbit"/> + <check_box label="Panorér (Ctrl-Shift)" name="radio pan"/> + <check_box label="Flyt" name="radio move"/> + <check_box label="Løft (Ctrl)" name="radio lift"/> + <check_box label="Spin (Ctrl-Shift)" name="radio spin"/> + <check_box label="Position" name="radio position"/> + <check_box label="Rotér (Ctrl)" name="radio rotate"/> + <check_box label="Stræk (Ctrl-Shift)" name="radio stretch"/> + <check_box label="Vælg tekstur" name="radio select face"/> + <check_box label="Redigér sammenlænkede dele" name="checkbox edit linked parts"/> <text name="text ruler mode"> Lineal: </text> <combo_box name="combobox grid mode"> - <combo_item name="World"> - Verden - </combo_item> - <combo_item name="Local"> - Lokal - </combo_item> - <combo_item name="Reference"> - Reference - </combo_item> + <combo_box.item name="World" label="Verden"/> + <combo_box.item name="Local" label="Lokal"/> + <combo_box.item name="Reference" label="Reference"/> </combo_box> - <check_box label="Stræk begge sider" name="checkbox uniform" /> - <check_box label="Stræk teksturer" name="checkbox stretch textures" /> - <check_box label="Benyt gitter" name="checkbox snap to grid" /> - <button label="Valg..." label_selected="Valg..." name="Options..." /> + <check_box label="Stræk begge sider" name="checkbox uniform"/> + <check_box label="Stræk teksturer" name="checkbox stretch textures"/> + <check_box label="Benyt gitter" name="checkbox snap to grid"/> + <button label="Valg..." label_selected="Valg..." name="Options..." height="18" bottom_delta="-15"/> <text name="text status"> Træk for at flytte, shift+træk for at kopiere </text> @@ -54,34 +48,35 @@ <button label="" label_selected="" name="ToolGrass" tool_tip="Græs" /> <check_box label="Hold værktøjet valgt" name="checkbox sticky" /> <check_box label="Kopiér valgte" name="checkbox copy selection" /> - <check_box label="Centréret kopi" name="checkbox copy centers" /> - <check_box label="Rotér kopi" name="checkbox copy rotates" /> - <check_box label="Vælg land" name="radio select land" /> - <check_box label="Udflad land" name="radio flatten" /> - <check_box label="Hæv land" name="radio raise" /> - <check_box label="Sænk land" name="radio lower" /> - <check_box label="Udjævn land" name="radio smooth" /> - <check_box label="Gør land ujævnt" name="radio noise" /> + <check_box label="Centreret kopi" name="checkbox copy centers" /> + <check_box label="Rotér" name="checkbox copy rotates" /> + <check_box label="Vælg" name="radio select land" /> + <check_box label="Udflad" name="radio flatten" /> + <check_box label="Hæv" name="radio raise" /> + <check_box label="Sænk" name="radio lower" /> + <check_box label="Udjævn" name="radio smooth" /> + <check_box label="Gør ujævnt" name="radio noise" /> <check_box label="Tilbagefør" name="radio revert" /> <combo_box name="combobox brush size"> - <combo_item name="Small"> - Lille - </combo_item> - <combo_item name="Medium"> - Mellem - </combo_item> - <combo_item name="Large"> - Stor - </combo_item> + <combo_box.item name="Small" label="Lille"/> + <combo_box.item name ="Medium" label="Mellem"/> + <combo_box.item name="Large" label="Stor"/> </combo_box> <text type="string" length="1" name="Strength:"> Styrke: </text> - <button label="Anvend pÃ¥ valgte" label_selected="Anvend pÃ¥ valgte" - name="button apply to selection" tool_tip="Redigér valgt land" /> - <check_box label="Vis ejere" name="checkbox show owners" /> - <button label="Mere >>" name="button more" tool_tip="Adancerede valgmuligheder" /> - <button label="<< Mindre" name="button less" tool_tip="Adancerede valgmuligheder" /> + <text name="Dozer Size:"> + Størrelse + </text> + <text length="1" name="Strength:" type="string"> + Styrke + </text> + <text name="obj_count"> + Valgte objekter: [COUNT] + </text> + <text name="prim_count"> + prims: [COUNT] + </text> <tab_container name="Object Info Tabs"> <panel label="Generelt" name="General"> <text name="Name:"> @@ -96,90 +91,64 @@ <text name="Creator Name"> Thrax Linden </text> - <button label="Profil..." label_selected="Profil..." name="button creator profile" /> + <button label="Profil..." label_selected="Profil..." name="button creator profile"/> <text name="Owner:"> Ejer: </text> <text name="Owner Name"> Thrax Linden </text> - <button label="Profil..." label_selected="Profil..." name="button owner profile" /> + <button label="Profil..." label_selected="Profil..." name="button owner profile"/> <text name="Group:"> Gruppe: </text> <text name="Group Name Proxy"> The Lindens </text> - <button label="Sæt..." label_selected="Sæt..." name="button set group" /> - <text name="prim info"> - 1 Objekt, 1 Prim - </text> + <button label="Sæt..." label_selected="Sæt..." name="button set group"/> <text name="Permissions:"> Tilladelser: </text> <text name="perm_modify"> Du kan redigére dette objekt. </text> - <check_box label="Del med gruppe" name="checkbox share with group" - tool_tip="Tillad gruppemedlemmer at flytte, ændre, kopiere og slette." /> + <check_box label="Del med gruppe" name="checkbox share with group" tool_tip="Tillad gruppemedlemmer at flytte, ændre, kopiere og slette."/> <string name="text deed continued"> Deed... </string> <string name="text deed"> Deed </string> - <button label="Dedikér..." label_selected="Dedikér..." name="button deed" - tool_tip="Gruppedelte genstande kan dedikeres af en gruppeadministrator." /> - <check_box label="Tillad enhver at flytte" name="checkbox allow everyone move" /> - <check_box label="Tillad enhver at kopiére" name="checkbox allow everyone copy" /> - <check_box label="Vis i søgning" name="search_check" - tool_tip="Lad folk se dette objekt i søgeresultater" /> - <check_box label="Til salg" name="checkbox for sale" /> + <button label="Dedikér..." label_selected="Dedikér..." name="button deed" tool_tip="Gruppedelte genstande kan dedikeres af en gruppeadministrator."/> + <check_box label="Tillad enhver at flytte" name="checkbox allow everyone move"/> + <check_box label="Tillad enhver at kopiére" name="checkbox allow everyone copy"/> + <check_box label="Vis i søgning" name="search_check" tool_tip="Lad folk se dette objekt i søgeresultater"/> + <check_box label="Til salg" name="checkbox for sale"/> <text name="Cost"> Pris: L$ </text> <radio_group name="sale type"> - <radio_item name="Original"> - Original - </radio_item> - <radio_item name="Copy"> - Kopi - </radio_item> - <radio_item name="Contents"> - Indhold - </radio_item> + <radio_item name="Original" label="Original" /> + <radio_item name="Copy" label="Kopi" /> + <radio_item name="Contents" label="Indhold" /> </radio_group> <text name="Next owner can:"> Næste ejer kan: </text> - <check_box label="Redigére" name="checkbox next owner can modify" /> - <check_box label="Kopiére" name="checkbox next owner can copy" /> - <check_box label="Sælge/Give væk" name="checkbox next owner can transfer" /> + <check_box label="Redigére" name="checkbox next owner can modify"/> + <check_box label="Kopiére" name="checkbox next owner can copy" left_delta="80"/> + <check_box label="Sælge/Give væk" name="checkbox next owner can transfer" left_delta="67"/> <text name="label click action"> NÃ¥r der venstreklikkes: </text> <combo_box name="clickaction"> - <combo_item name="Touch/grab(default)"> - Rør/tag (standard) - </combo_item> - <combo_item name="Sitonobject"> - Sid pÃ¥ objekt - </combo_item> - <combo_item name="Buyobject"> - Køb objekt - </combo_item> - <combo_item name="Payobject"> - Betal objekt - </combo_item> - <combo_item name="Open"> - Ã…ben - </combo_item> - <combo_item name="Play"> - Afspil medie pÃ¥ parcel - </combo_item> - <combo_item name="Opemmedia"> - Ã…ben media pÃ¥ parcel - </combo_item> + <combo_box.item name="Touch/grab(default)" label="Rør/tag (standard)"/> + <combo_box.item name="Sitonobject" label="Sid pÃ¥ objekt"/> + <combo_box.item name="Buyobject" label="Køb objekt"/> + <combo_box.item name="Payobject" label="Betal objekt"/> + <combo_box.item name="Open" label="Ã…ben"/> + <combo_box.item name="Play" label="Afspil medie pÃ¥ parcel"/> + <combo_box.item name="Opemmedia" label="Ã…ben media pÃ¥ parcel"/> </combo_box> <text name="B:"> B: @@ -199,6 +168,36 @@ <text name="F:"> F: </text> + <string name="text modify info 1"> + Du kan redigere dette objekt + </string> + <string name="text modify info 2"> + Du kan redigere disse objekter + </string> + <string name="text modify info 3"> + Du kan ikke redigere dette objekt. + </string> + <string name="text modify info 4"> + Du kan ikke redigere disse objekter. + </string> + <string name="text modify warning"> + Du skal vælge hele objektet for at sætte rettigheder. + </string> + <string name="Cost Default"> + Pris: L$ + </string> + <string name="Cost Total"> + Total pris: L$ + </string> + <string name="Cost Per Unit"> + Pris Pr: L$ + </string> + <string name="Cost Mixed"> + Blandet pris + </string> + <string name="Sale Mixed"> + Blandet salg + </string> </panel> <panel label="Objekt" name="Object"> <text name="select_single"> @@ -207,92 +206,58 @@ <text name="edit_object"> Ret objektets indstillinger: </text> - <check_box label="LÃ¥st" name="checkbox locked" - tool_tip="Forhindrer objektet i at blive flyttet eller slettet. Ofte brugbar under byggeri for at forhindre utilsigtet ændring." /> - <check_box label="Fysisk" name="Physical Checkbox Ctrl" - tool_tip="Tillader objekter at blive skubbet og at være pÃ¥virkelig af tyngdekraften" /> - <check_box label="Temporær" name="Temporary Checkbox Ctrl" - tool_tip="MedfÃ¥rer at objekter bliver slettet 1 minut efter de er skabt." /> - <check_box label="Uden masse" name="Phantom Checkbox Ctrl" - tool_tip="FÃ¥r objektet til ikke at kollidere med andre objekter eller personer" /> + <check_box label="LÃ¥st" name="checkbox locked" tool_tip="Forhindrer objektet i at blive flyttet eller slettet. Ofte brugbar under byggeri for at forhindre utilsigtet ændring."/> + <check_box label="Fysisk" name="Physical Checkbox Ctrl" tool_tip="Tillader objekter at blive skubbet og at være pÃ¥virkelig af tyngdekraften"/> + <check_box label="Temporær" name="Temporary Checkbox Ctrl" tool_tip="MedfÃ¥rer at objekter bliver slettet 1 minut efter de er skabt."/> + <check_box label="Uden masse" name="Phantom Checkbox Ctrl" tool_tip="FÃ¥r objektet til ikke at kollidere med andre objekter eller personer"/> <text name="label position"> Position (meter) </text> - <spinner label="X" name="Pos X" /> - <spinner label="Y" name="Pos Y" /> - <spinner label="Z" name="Pos Z" /> + <spinner label="X" name="Pos X"/> + <spinner label="Y" name="Pos Y"/> + <spinner label="Z" name="Pos Z"/> <text name="label size"> Størrelse (meter) </text> - <spinner label="X" name="Scale X" /> - <spinner label="Y" name="Scale Y" /> - <spinner label="Z" name="Scale Z" /> + <spinner label="X" name="Scale X"/> + <spinner label="Y" name="Scale Y"/> + <spinner label="Z" name="Scale Z"/> <text name="label rotation"> Rotation (grader) </text> - <spinner label="X" name="Rot X" /> - <spinner label="Y" name="Rot Y" /> - <spinner label="Z" name="Rot Z" /> + <spinner label="X" name="Rot X"/> + <spinner label="Y" name="Rot Y"/> + <spinner label="Z" name="Rot Z"/> <text name="label material"> Materiale </text> <combo_box name="material"> - <combo_item name="Stone"> - Sten - </combo_item> - <combo_item name="Metal"> - Metal - </combo_item> - <combo_item name="Glass"> - Glas - </combo_item> - <combo_item name="Wood"> - Træ - </combo_item> - <combo_item name="Flesh"> - Kød - </combo_item> - <combo_item name="Plastic"> - Plastik - </combo_item> - <combo_item name="Rubber"> - Gummi - </combo_item> + <combo_box.item name="Stone" label="Sten"/> + <combo_box.item name="Metal" label="Metal"/> + <combo_box.item name="Glass" label="Glas"/> + <combo_box.item name="Wood" label="Træ"/> + <combo_box.item name="Flesh" label="Kød"/> + <combo_box.item name="Plastic" label="Plastik"/> + <combo_box.item name="Rubber" label="Gummi"/> </combo_box> <text name="label basetype"> Byggegeometrisk figur </text> <combo_box name="comboBaseType"> - <combo_item name="Box"> - Terning - </combo_item> - <combo_item name="Cylinder"> - Cylinder - </combo_item> - <combo_item name="Prism"> - Prisme - </combo_item> - <combo_item name="Sphere"> - Spfære - </combo_item> - <combo_item name="Torus"> - Kuglering - </combo_item> - <combo_item name="Tube"> - Rør - </combo_item> - <combo_item name="Ring"> - Ring - </combo_item> - <combo_item name="Sculpted"> - Sculpted - </combo_item> + <combo_box.item name="Box" label="Terning"/> + <combo_box.item name="Cylinder" label="Cylinder"/> + <combo_box.item name="Prism" label="Prisme"/> + <combo_box.item name="Sphere" label="Spfære"/> + <combo_box.item name="Torus" label="Kuglering"/> + <combo_box.item name="Tube" label="Rør"/> + <combo_box.item name="Ring" label="Ring"/> + <combo_box.item name="Sculpted" label="Sculpted"/> </combo_box> <text name="text cut"> Snit begynd og slut </text> - <spinner label="B" name="cut begin" /> - <spinner label="E" name="cut end" /> + <spinner label="B" name="cut begin"/> + <spinner label="S" name="cut end"/> <text name="text hollow"> Hul </text> @@ -303,81 +268,63 @@ Form pÃ¥ hul </text> <combo_box name="hole"> - <combo_item name="Default"> - Standard - </combo_item> - <combo_item name="Circle"> - Cirkel - </combo_item> - <combo_item name="Square"> - Firkant - </combo_item> - <combo_item name="Triangle"> - Trekant - </combo_item> + <combo_box.item name="Default" label="Standard"/> + <combo_box.item name="Circle" label="Cirkel"/> + <combo_box.item name="Square" label="Firkant"/> + <combo_box.item name="Triangle" label="Trekant"/> </combo_box> <text name="text twist"> - Vrid - start og slut + Vrid begynd og slut </text> - <spinner label="B" name="Twist Begin" /> - <spinner label="E" name="Twist End" /> + <spinner label="B" name="Twist Begin"/> + <spinner label="S" name="Twist End"/> <text name="scale_taper"> Konus </text> <text name="scale_hole"> Hulstørrelse </text> - <spinner label="X" name="Taper Scale X" /> - <spinner label="Y" name="Taper Scale Y" /> + <spinner label="X" name="Taper Scale X"/> + <spinner label="Y" name="Taper Scale Y"/> <text name="text topshear"> Topforskydning </text> - <spinner label="X" name="Shear X" /> - <spinner label="Y" name="Shear Y" /> + <spinner label="X" name="Shear X"/> + <spinner label="Y" name="Shear Y"/> <text name="advanced_cut"> - Profilsnit - begynd og slut + Profilsnit begynd og slut </text> <text name="advanced_dimple"> - Fordybning - begynd og slut + Fordybning begynd og slut </text> - <spinner label="B" name="Path Limit Begin" /> - <spinner label="E" name="Path Limit End" /> + <text name="advanced_slice"> + Snit begynd og slut + </text> + <spinner label="B" name="Path Limit Begin"/> + <spinner label="S" name="Path Limit End"/> <text name="text taper2"> Konus </text> - <spinner label="X" name="Taper X" /> - <spinner label="Y" name="Taper Y" /> + <spinner label="X" name="Taper X"/> + <spinner label="Y" name="Taper Y"/> <text name="text radius delta"> Radius </text> <text name="text revolutions"> Omdrejninger </text> - <texture_picker label="Sculpt tekstur" name="sculpt texture control" - tool_tip="Klik her for at vælge billede" /> - <check_box label="Spejlet" name="sculpt mirror control" - tool_tip="Spejler sculpted prim omkring X aksen." /> - <check_box label="Vrangen ud" name="sculpt invert control" - tool_tip="Vender 'vrangen' ud pÃ¥ sculpted prim." /> + <texture_picker label="Sculpt tekstur" name="sculpt texture control" tool_tip="Klik her for at vælge billede"/> + <check_box label="Spejlet" name="sculpt mirror control" tool_tip="Spejler sculpted prim omkring X aksen."/> + <check_box label="Vrangen ud" name="sculpt invert control" tool_tip="Vender 'vrangen' ud pÃ¥ sculpted prim."/> <text name="label sculpt type"> Sting type </text> <combo_box name="sculpt type control"> - <combo_item name="None"> - (ingen) - </combo_item> - <combo_item name="Sphere"> - Sfære - </combo_item> - <combo_item name="Torus"> - Kuglering - </combo_item> - <combo_item name="Plane"> - Plan - </combo_item> - <combo_item name="Cylinder"> - Cylinder - </combo_item> + <combo_box.item name="None" label="ingen)"/> + <combo_box.item name="Sphere" label="Sfære"/> + <combo_box.item name="Torus" label="Kuglering"/> + <combo_box.item name="Plane" label="Plan"/> + <combo_box.item name="Cylinder" label="Cylinder"/> </combo_box> </panel> <panel label="Features" name="Features"> @@ -387,130 +334,82 @@ <text name="edit_object"> Redigér objektets egenskaber: </text> - <check_box label="Fleksibel/blød" name="Flexible1D Checkbox Ctrl" - tool_tip="Tillader objektet at ændre form omkring Z-aksen. (Kun pÃ¥ klient-siden)" /> - <spinner label="Blødhed" name="FlexNumSections" /> - <spinner label="Tyngdekraft" name="FlexGravity" /> - <spinner label="Træk" name="FlexFriction" /> - <spinner label="Vind" name="FlexWind" /> - <spinner label="Spændstighed" name="FlexTension" /> - <spinner label="Kraft X" name="FlexForceX" /> - <spinner label="Kraft Y" name="FlexForceY" /> - <spinner label="Kraft Z" name="FlexForceZ" /> - <check_box label="Lys" name="Light Checkbox Ctrl" - tool_tip="MedfÃ¥rer at objektet afgiver lys" /> + <check_box label="Fleksibel/blød" name="Flexible1D Checkbox Ctrl" tool_tip="Tillader objektet at ændre form omkring Z-aksen. (Kun pÃ¥ klient-siden)"/> + <spinner label_width="78" width="141" label="Blødhed" name="FlexNumSections"/> + <spinner label_width="78" width="141" label="Tyngdekraft" name="FlexGravity"/> + <spinner label_width="78" width="141" label="Træk" name="FlexFriction"/> + <spinner label_width="78" width="141" label="Vind" name="FlexWind"/> + <spinner label_width="78" width="141" label="Spændstighed" name="FlexTension"/> + <spinner label_width="78" width="141" label="Kraft X" name="FlexForceX"/> + <spinner label_width="78" width="141" label="Kraft Y" name="FlexForceY"/> + <spinner label_width="78" width="141" label="Kraft Z" name="FlexForceZ"/> + <check_box label="Lys" name="Light Checkbox Ctrl" tool_tip="MedfÃ¥rer at objektet afgiver lys"/> <text name="label color"> Farve </text> - <color_swatch label="" name="colorswatch" tool_tip="Klik for at Ã¥bne farvevælger" /> - <spinner label="Intensitet" name="Light Intensity" /> - <spinner label="Radius" name="Light Radius" /> - <spinner label="Udfasning" name="Light Falloff" /> + <color_swatch label="" name="colorswatch" tool_tip="Klik for at Ã¥bne farvevælger"/> + <spinner label="Intensitet" name="Light Intensity"/> + <spinner label="Radius" name="Light Radius"/> + <spinner label="Udfasning" name="Light Falloff"/> </panel> <panel label="Tekstur" name="Texture"> - <texture_picker label="Tekstur" name="texture control" tool_tip="Klik for at vælge billede" /> - <color_swatch label="Farve" name="colorswatch" tool_tip="Klik for at Ã¥bne farvevælger" /> - <text name="color trans"> - Gennemsigtighed % + <texture_picker label="Tekstur" name="texture control" tool_tip="Klik for at vælge billede"/> + <color_swatch label="Farve" name="colorswatch" tool_tip="Klik for at Ã¥bne farvevælger"/> + <text name="color trans" left="170" width="105"> + Gennemsigtighed% </text> - <text name="glow label"> + <spinner left="171" name="ColorTrans"/> + <text name="glow label" left="170"> Glød </text> - <check_box label="Selvlysende" name="checkbox fullbright" /> + <spinner left="170" name="glow"/> + <check_box label="Selvlysende" name="checkbox fullbright" left="170"/> <text name="tex gen"> Afbildning </text> <combo_box name="combobox texgen"> - <combo_item name="Default"> - Standard - </combo_item> - <combo_item name="Planar"> - Plan - </combo_item> + <combo_box.item name="Default" label="Standard"/> + <combo_box.item name="Planar" label="Plan"/> </combo_box> <text name="label shininess"> Blankhed </text> <combo_box name="combobox shininess"> - <combo_item name="None"> - Ingen - </combo_item> - <combo_item name="Low"> - Lav - </combo_item> - <combo_item name="Medium"> - Mellem - </combo_item> - <combo_item name="High"> - Høj - </combo_item> + <combo_box.item name="None" label="Ingen"/> + <combo_box.item name="Low" label="Lav"/> + <combo_box.item name="Medium" label="Mellem"/> + <combo_box.item name="High" label="Høj"/> </combo_box> <text name="label bumpiness"> Struktur </text> <combo_box name="combobox bumpiness"> - <combo_item name="None"> - Ingen - </combo_item> - <combo_item name="Brightness"> - Lysintensitet - </combo_item> - <combo_item name="Darkness"> - Mørke - </combo_item> - <combo_item name="woodgrain"> - træårer - </combo_item> - <combo_item name="bark"> - bark - </combo_item> - <combo_item name="bricks"> - mursten - </combo_item> - <combo_item name="checker"> - tern - </combo_item> - <combo_item name="concrete"> - beton - </combo_item> - <combo_item name="crustytile"> - rustik flise - </combo_item> - <combo_item name="cutstone"> - SkÃ¥ret sten - </combo_item> - <combo_item name="discs"> - plader - </combo_item> - <combo_item name="gravel"> - grus - </combo_item> - <combo_item name="petridish"> - petriskÃ¥l - </combo_item> - <combo_item name="siding"> - udvendig beklædning - </combo_item> - <combo_item name="stonetile"> - stenflise - </combo_item> - <combo_item name="stucco"> - puds - </combo_item> - <combo_item name="suction"> - rør - </combo_item> - <combo_item name="weave"> - væv - </combo_item> + <combo_box.item name="None" label="Ingen"/> + <combo_box.item name="Brightness" label="Lysintensitet"/> + <combo_box.item name="Darkness" label="Mørke"/> + <combo_box.item name="woodgrain" label="træårer"/> + <combo_box.item name="bark" label="bark"/> + <combo_box.item name="bricks" label="mursten"/> + <combo_box.item name="checker" label="tern"/> + <combo_box.item name="concrete" label="beton"/> + <combo_box.item name="crustytile" label="rustik flise"/> + <combo_box.item name="cutstone" label="SkÃ¥ret sten"/> + <combo_box.item name="discs" label="plader"/> + <combo_box.item name="gravel" label="grus"/> + <combo_box.item name="petridish" label="petriskÃ¥l"/> + <combo_box.item name="siding" label="udvendig beklædning"/> + <combo_box.item name="stonetile" label="stenflise"/> + <combo_box.item name="stucco" label="puds"/> + <combo_box.item name="suction" label="rør"/> + <combo_box.item name="weave" label="væv"/> </combo_box> <text name="tex scale"> Gentagelser pr. overflade </text> - <spinner label="Vandret (U)" name="TexScaleU" /> - <check_box label="Vend" name="checkbox flip s" /> - <spinner label="Lodret (V)" name="TexScaleV" /> - <check_box label="Vend" name="checkbox flip t" /> + <spinner label="Vandret (U)" name="TexScaleU"/> + <check_box label="Vend" name="checkbox flip s"/> + <spinner label="Lodret (V)" name="TexScaleV"/> + <check_box label="Vend" name="checkbox flip t"/> <text name="tex rotate"> Rotation (grader) </text> @@ -523,34 +422,86 @@ <text name="rpt"> Gentagelser pr. meter </text> - <button label="Gem" label_selected="Gem" name="button apply" /> + <spinner left="125" name="TexRot" width="55" /> + <spinner left="125" name="rptctrl" width="55" /> + <button label="Gem" label_selected="Gem" name="button apply" left_delta="62"/> <text name="tex offset"> Offset </text> - <spinner label="Vandret (U)" name="TexOffsetU" /> - <spinner label="Lodret (V)" name="TexOffsetV" /> + <spinner label="Vandret (U)" name="TexOffsetU"/> + <spinner label="Lodret (V)" name="TexOffsetV"/> <text name="textbox autofix"> Rette medie tekstur ind (skal indlæses først) </text> - <button label="Ret ind" label_selected="Ret ind" name="button align" /> + <button label="Ret ind" label_selected="Ret ind" name="button align" left="160"/> </panel> <panel label="Indhold" name="Contents"> - <button label="Nyt script..." label_selected="Nyt script..." name="button new script" /> + <button label="Nyt script" label_selected="Nyt script..." name="button new script"/> + <button label="Rettigheder..." name="button permissions"/> </panel> </tab_container> <panel name="land info panel"> + <text name="label_parcel_info"> + Parcel information + </text> <text name="label_area_price"> Pris: L$[PRICE] for [AREA] m². </text> <text name="label_area"> OmrÃ¥de: [AREA] m². </text> - <button label="Køb land..." label_selected="Køb land..." name="button buy land" /> - <button label="Flyt fra land..." label_selected="Flyt fra land..." - name="button abandon land" /> - <button label="Opdel..." label_selected="Opdel..." name="button subdivide land" /> - <button label="Saml..." label_selected="Saml..." name="button join land" /> - <button label="Om land..." label_selected="Om land..." name="button about land" /> + <button label="Om land..." label_selected="Om land..." name="button about land"/> + <check_box label="Vis ejere" name="checkbox show owners" tool_tip="Farver grunde afhængigt af ejerskab"/> + <button label="?" label_selected="?" name="button show owners help"/> + <text name="label_parcel_modify"> + Redigere grund + </text> + <button label="Opdel..." label_selected="Opdel..." name="button subdivide land"/> + <button label="Saml..." label_selected="Saml..." name="button join land"/> + <text name="label_parcel_trans"> + Transaktioner for land + </text> + <button label="Køb land..." label_selected="Køb land..." name="button buy land"/> + <button label="Flyt fra land..." label_selected="Flyt fra land..." name="button abandon land"/> </panel> + <string name="status_rotate"> + Træk i de farvede bÃ¥nd for at rotere objekt + </string> + <string name="status_scale"> + Klik og træk for at strække valgte side + </string> + <string name="status_move"> + Træk for at flytte, hold shift nede for at kopiere + </string> + <string name="status_modifyland"> + Klik og hold for at redigere land + </string> + <string name="status_camera"> + Klik og træk for at ændre synsvinkel + </string> + <string name="status_grab"> + Træk for at flytte objekter, Ctrl for at løfte, Ctrl-Shift for at rotere + </string> + <string name="status_place"> + Klik et sted i verden for at bygge + </string> + <string name="status_selectland"> + Klik og træk for at vælge land + </string> + <string name="grid_screen_text"> + Skærm + </string> + <string name="grid_local_text"> + Lokalt + </string> + <string name="grid_world_text"> + Verden + </string> + <string name="grid_reference_text"> + Reference + </string> + <string name="grid_attachment_text"> + Vedhæng + </string> </floater> diff --git a/indra/newview/skins/default/xui/da/floater_world_map.xml b/indra/newview/skins/default/xui/da/floater_world_map.xml index 20dfe554060c3ece47a04fbed7fcfc2ec1c8d5aa..f058cf046810be592306e3e49d27003100b2cf38 100644 --- a/indra/newview/skins/default/xui/da/floater_world_map.xml +++ b/indra/newview/skins/default/xui/da/floater_world_map.xml @@ -1,81 +1,57 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="worldmap" title="Verdenskort"> <tab_container name="maptab"> - <panel label="Objekter" name="objects_mapview" /> - <panel label="Terræn" name="terrain_mapview" /> + <panel label="Objekter" name="objects_mapview"/> + <panel label="Terræn" name="terrain_mapview"/> </tab_container> - <text name="land_for_sale_label"> - Land til salg - </text> - <text name="auction_label"> - Auktion - </text> <text name="you_label"> Dig </text> <text name="home_label"> Hjem </text> - <button label="Tag hjem" label_selected="Tag hjem" name="Go Home" - tool_tip="Teleporter til dit hjem" /> - <text name="person_label"> - Person - </text> - <check_box label=" " name="people_chk" /> - <text name="infohub_label"> - Infohub - </text> - <check_box label="" name="infohub_chk" /> - <text name="telehub_label"> - Telehub + <text name="auction_label"> + Auktion </text> - <check_box label="" name="telehubchk" /> - <text name="land_for_sale_label2"> + <text name="land_for_sale_label"> Land til salg </text> - <check_box label="" name="land_for_sale_chk" /> + <button label="Tag hjem" label_selected="Tag hjem" name="Go Home" tool_tip="Teleporter til dit hjem"/> + <check_box label="Beboer" name="people_chk"/> + <check_box label="Infohub" name="infohub_chk"/> + <check_box label="Telehub" name="telehubchk"/> + <check_box label="Land til salg" name="land_for_sale_chk"/> <text name="events_label"> - Events + Events: </text> - <check_box label="" name="event_chk" /> - <text name="events_mature_label" /> - <check_box label="" name="event_mature_chk" /> - <combo_box label="Venner online" name="friend combo" - tool_tip="Ven der skal vises pÃ¥ kortet"> - <combo_item name="none_selected"> - Venner online - </combo_item> + <check_box label="PG" name="event_chk"/> + <check_box label="Mature" name="event_mature_chk"/> + <check_box label="Adult" name="event_adult_chk"/> + <combo_box label="Venner online" name="friend combo" tool_tip="Ven der skal vises pÃ¥ kortet"> + <combo_box.item name="none_selected" label="Venner online" /> </combo_box> - <combo_box label="Landemærker" name="landmark combo" - tool_tip="Landemærke der skal vises pÃ¥ kortet"> - <combo_item name="none_selected"> - Landemærker - </combo_item> + <combo_box label="Landemærker" name="landmark combo" tool_tip="Landemærke der skal vises pÃ¥ kortet"> + <combo_box.item name="none_selected" label="Landemærker" /> </combo_box> - <line_editor label="Søg pÃ¥ region navn" name="location" - tool_tip="Skriv navnet pÃ¥ en region" /> - <button label="Søg" name="DoSearch" tool_tip="Søg efter en region" /> + <line_editor label="Søg pÃ¥ region navn" name="location" tool_tip="Skriv navnet pÃ¥ en region"/> + <button label="Søg" name="DoSearch" tool_tip="Søg efter en region"/> <text name="search_label"> Søgeresultater: </text> <scroll_list name="search_results"> - <column label="" name="icon" /> - <column label="" name="sim_name" /> + <column label="" name="icon"/> + <column label="" name="sim_name"/> </scroll_list> <text name="location_label"> Lokation: </text> - <spinner name="spin x" tool_tip="X koordinat for lokation der skal vises pÃ¥ kortet" /> - <spinner name="spin y" tool_tip="Y koordinat for lokation der skal vises pÃ¥ kortet" /> - <spinner name="spin z" tool_tip="Z koordinat for lokation der skal vises pÃ¥ kortet" /> - <button label="Teleport" label_selected="Teleport" name="Teleport" - tool_tip="Teleportér til den valgte lokation" /> - <button label="Vis destination" label_selected="Vis destination" - name="Show Destination" tool_tip="Centrér kortet pÃ¥ valgte lokation" /> - <button label="Slet" label_selected="Slet" name="Clear" tool_tip="Stop søg" /> - <button label="Vis min position" label_selected="Vis min position" - name="Show My Location" tool_tip="Centrer kortet pÃ¥ din avatars lokation" /> - <button label="Kopiér SLURL til udklipsholder" name="copy_slurl" - tool_tip="Kopierer den nuværende lokation som et SLURL, sÃ¥ det kan bruges pÃ¥ nettet." /> - <slider label="Zoom" name="zoom slider" /> + <spinner name="spin x" tool_tip="X koordinat for lokation der skal vises pÃ¥ kortet"/> + <spinner name="spin y" tool_tip="Y koordinat for lokation der skal vises pÃ¥ kortet"/> + <spinner name="spin z" tool_tip="Z koordinat for lokation der skal vises pÃ¥ kortet"/> + <button label="Teleport" label_selected="Teleport" name="Teleport" tool_tip="Teleportér til den valgte lokation"/> + <button label="Vis destination" label_selected="Vis destination" name="Show Destination" tool_tip="Centrér kortet pÃ¥ valgte lokation"/> + <button label="Slet" label_selected="Slet" name="Clear" tool_tip="Stop søg"/> + <button label="Vis min position" label_selected="Vis min position" name="Show My Location" tool_tip="Centrer kortet pÃ¥ din avatars lokation"/> + <button label="Kopiér SLURL til udklipsholder" name="copy_slurl" tool_tip="Kopierer den nuværende lokation som et SLURL, sÃ¥ det kan bruges pÃ¥ nettet."/> + <slider label="Zoom" name="zoom slider"/> </floater> diff --git a/indra/newview/skins/default/xui/da/panel_login.xml b/indra/newview/skins/default/xui/da/panel_login.xml index 48d58ae8f7b3a0aea91f9397c66302a7151bc12b..6f027782641a632a2d294eb2ff8e563385d2ccc9 100644 --- a/indra/newview/skins/default/xui/da/panel_login.xml +++ b/indra/newview/skins/default/xui/da/panel_login.xml @@ -19,15 +19,9 @@ Start lokation: </text> <combo_box name="start_location_combo"> - <combo_item name="MyHome"> - Hjem - </combo_item> - <combo_item name="MyLastLocation"> - Min sidste lokation - </combo_item> - <combo_item name="Typeregionname"> - <Skriv navn pÃ¥ region> - </combo_item> + <combo_box.item name="MyHome" label="Hjem" /> + <combo_box.item name="MyLastLocation" label="Min sidste lokation" /> + <combo_box.item name="Typeregionname" label="lt;Skriv navn pÃ¥ region>" /> </combo_box> <check_box label="Husk password" name="remember_check" /> <button label="Log ind" label_selected="Log ind" name="connect_btn" /> diff --git a/indra/newview/skins/default/xui/da/panel_preferences_chat.xml b/indra/newview/skins/default/xui/da/panel_preferences_chat.xml index 254cd6ddb9ed2613f90e840c31c4a022baee8931..e57b1515115deb825671353ab377a53475e35cd5 100644 --- a/indra/newview/skins/default/xui/da/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/da/panel_preferences_chat.xml @@ -4,15 +4,9 @@ Chat skriftstørrelse: </text> <radio_group name="chat_font_size"> - <radio_item type="string" length="1" name="radio"> - Lille - </radio_item> - <radio_item type="string" length="1" name="radio2"> - Mellem - </radio_item> - <radio_item type="string" length="1" name="radio3"> - Stor - </radio_item> + <radio_item type="string" length="1" name="radio" label="Lille" /> + <radio_item type="string" length="1" name="radio2" label="Mellem" /> + <radio_item type="string" length="1" name="radio3" label="Stor" /> </radio_group> <text type="string" length="1" name="text_box2"> Chat farve: diff --git a/indra/newview/skins/default/xui/da/panel_preferences_general.xml b/indra/newview/skins/default/xui/da/panel_preferences_general.xml index 74a1ab1d7a424f9fd7584f31c2271c8451aa5115..df27d05643182c8f9683ffc9842ef372b78092dc 100644 --- a/indra/newview/skins/default/xui/da/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/da/panel_preferences_general.xml @@ -1,118 +1,91 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Generelt" name="general_panel"> <radio_group name="default_start_location"> - <radio_item name="MyHome" tool_tip="Log ind til min hjemme lokation som standard."> - Mit hjem - </radio_item> - <radio_item name="MyLastLocation" tool_tip="Log ind til min sidste lokation som standard."> - Min sidste lokation - </radio_item> + <radio_item name="MyHome" tool_tip="Log ind til min hjemme lokation som standard." label="Mit hjem" /> + <radio_item name="MyLastLocation" tool_tip="Log ind til min sidste lokation som standard." label="Min sidste lokation" /> </radio_group> - <check_box label="Vis start lokation pÃ¥ login billedet" name="show_location_checkbox" /> + <check_box label="Vis start lokation pÃ¥ login billedet" name="show_location_checkbox"/> <combo_box name="fade_out_combobox"> - <combo_item name="Never"> - Aldrig - </combo_item> - <combo_item name="Show Temporarily"> - Vis midlertidigt - </combo_item> - <combo_item name="Always"> - Altid - </combo_item> + <combo_box.item name="Never" label="Aldrig"/> + <combo_box.item name="Show Temporarily" label="Vis midlertidigt"/> + <combo_box.item name="Always" label="Altid"/> </combo_box> - <check_box label="SmÃ¥ avatar navne" name="small_avatar_names_checkbox" /> - <check_box label="Skjul mit navn pÃ¥ min skærm" name="show_my_name_checkbox" /> - <text type="string" length="1" name="group_titles_textbox"> + <check_box label="SmÃ¥ avatar navne" name="small_avatar_names_checkbox"/> + <check_box label="Skjul mit navn pÃ¥ min skærm" name="show_my_name_checkbox"/> + <text length="1" name="group_titles_textbox" type="string"> Gruppe titler: </text> - <check_box label="Skjul alle gruppe titler" name="show_all_title_checkbox" /> - <check_box label="Gem min gruppe titel" name="show_my_title_checkbox" /> - <color_swatch label="" name="effect_color_swatch" tool_tip="Klik for at Ã¥bne farvevælger" /> - <text type="string" length="1" name="UI Size:"> + <check_box label="Skjul alle gruppe titler" name="show_all_title_checkbox"/> + <check_box label="Gem min gruppe titel" name="show_my_title_checkbox"/> + <color_swatch label="" name="effect_color_swatch" tool_tip="Klik for at Ã¥bne farvevælger"/> + <text length="1" name="UI Size:" type="string"> UI Størrelse: </text> - <check_box label="Brug opløsnings uafhængig skalering" name="ui_auto_scale" /> - <spinner label="Tid før inaktiv:" name="afk_timeout_spinner" /> - <check_box label="Rotér mini-kort" name="rotate_mini_map_checkbox" /> - <check_box label="Giv besked nÃ¥r Linden dollars (L$) bliver brugt eller modtaget" - name="notify_money_change_checkbox" /> - <check_box label="Brug standard farve vælger" name="use_system_color_picker_checkbox" - tool_tip="Brug dit systems standard farve vælger i stedet for den der er indbygget i Second Life." /> - <check_box label="Vis Søg i øverste højre hjørne" name="show_search_panel" - tool_tip="Vis indbygget søgepanel." /> - <text type="string" length="1" name="start_location_textbox"> + <check_box label="Brug opløsnings uafhængig skalering" name="ui_auto_scale"/> + <spinner label="Tid før inaktiv:" name="afk_timeout_spinner"/> + <check_box label="Giv besked nÃ¥r Linden dollars (L$) bliver brugt eller modtaget" name="notify_money_change_checkbox"/> + <text name="maturity_desired_label"> + Rating: + </text> + <text name="maturity_desired_prompt"> + Jeg ønsker adgang til inhold med rating: + </text> + <combo_box name="maturity_desired_combobox" left="360" width="135"> + <combo_item name="Desired_Adult"> + PG, Mature og Adult + </combo_item> + <combo_item name="Desired_Mature"> + PG and Mature + </combo_item> + <combo_item name="Desired_PG"> + PG only + </combo_item> + </combo_box> + <text name="maturity_desired_textbox" left="360"> + PG only + </text> + <text length="1" name="start_location_textbox" type="string"> Start lokation: </text> - <text type="string" length="1" name="show_names_textbox"> + <text length="1" name="show_names_textbox" type="string"> Vis navne: </text> - <text type="string" length="1" name="effects_color_textbox"> + <text length="1" name="effects_color_textbox" type="string"> Farve til mine effekter: </text> - <text type="string" length="1" name="seconds_textbox"> + <text length="1" name="seconds_textbox" type="string"> sekunder </text> - <text type="string" length="1" name="crash_report_textbox"> + <text length="1" name="crash_report_textbox" type="string"> Nedbrudsrapporter: </text> - <text type="string" length="1" name="language_textbox"> + <text length="1" name="language_textbox" type="string"> Sprog: </text> - <text type="string" length="1" name="language_textbox2"> + <text length="1" name="language_textbox2" type="string"> (Kræver genstart for at virke optimalt) </text> <string name="region_name_prompt"> <Skriv regions navn> </string> <combo_box name="crash_behavior_combobox"> - <combo_item type="string" length="1" name="Askbeforesending"> - Bed om bekræftigelse - </combo_item> - <combo_item type="string" length="1" name="Alwayssend"> - Send altid - </combo_item> - <combo_item type="string" length="1" name="Neversend"> - Send aldrig - </combo_item> + <combo_box.item type="string" length="1" name="Askbeforesending" label="Bed om bekræftigelse"/> + <combo_box.item type="string" length="1" name="Alwayssend" label="Send altid"/> + <combo_box.item type="string" length="1" name="Neversend" label="Send aldrig"/> </combo_box> <combo_box name="language_combobox"> - <combo_item type="string" length="1" name="System Default Language"> - System standard - </combo_item> - <combo_item type="string" length="1" name="English"> - English (Engelsk) - </combo_item> - <combo_item type="string" length="1" name="Danish"> - Dansk - Beta - </combo_item> - <combo_item type="string" length="1" name="Deutsch(German)"> - Deutsch (Tysk) - Beta - </combo_item> - <combo_item type="string" length="1" name="Spanish"> - Español (Spansk) - Beta - </combo_item> - <combo_item type="string" length="1" name="French"> - Français (Fransk) - Beta - </combo_item> - <combo_item type="string" length="1" name="Hungarian"> - Magyar (Ungarsk) - Beta - </combo_item> - <combo_item type="string" length="1" name="Polish"> - Polski (Polsk) - Beta - </combo_item> - <combo_item type="string" length="1" name="Portugese"> - Portugués (Portugisisk) - Beta - </combo_item> - <combo_item type="string" length="1" name="Chinese"> - ä¸æ–‡ (简体) (Kinesisk) - Beta - </combo_item> - <combo_item type="string" length="1" name="(Japanese)"> - 日本語 (Japansk) - Beta - </combo_item> - <combo_item type="string" length="1" name="(Korean)"> - í•œêµì–´ (Koreansk) - Beta - </combo_item> + <combo_box.item type="string" length="1" name="System Default Language" label="System standard"/> + <combo_box.item type="string" length="1" name="English" label="English (Engelsk)"/> + <combo_box.item type="string" length="1" name="Danish" label="Dansk - Beta"/> + <combo_box.item type="string" length="1" name="Deutsch(German)" label="Deutsch (Tysk) - Beta"/> + <combo_box.item type="string" length="1" name="Spanish" label="Español (Spansk) - Beta"/> + <combo_box.item type="string" length="1" name="French" label="Français (Fransk) - Beta"/> + <combo_box.item type="string" length="1" name="Hungarian" label="Magyar (Ungarsk) - Beta"/> + <combo_box.item type="string" length="1" name="Polish" label="Polski (Polsk) - Beta"/> + <combo_box.item type="string" length="1" name="Portugese" label="Portugués (Portugisisk) - Beta"/> + <combo_box.item type="string" length="1" name="Chinese" label="ä¸æ–‡ (简体) (Kinesisk) - Beta"/> + <combo_box.item type="string" length="1" name="(Japanese)" label="日本語 (Japansk) - Beta"/> + <combo_box.item type="string" length="1" name="(Korean)" label="í•œêµì–´ (Koreansk) - Beta"/> </combo_box> - <check_box label="Del sprog med objekter" name="language_is_public" - tool_tip="Dette lader objekter i verden vide hvad dit foretrukne sprog er." /> + <check_box label="Del sprog med objekter" name="language_is_public" tool_tip="Dette lader objekter i verden vide hvad dit foretrukne sprog er."/> </panel> diff --git a/indra/newview/skins/default/xui/da/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/da/panel_preferences_graphics1.xml index 5ebab1778fca99a040c4b9f28d51d1f70195e9ea..86c506a0fd1cb7c6989deed70d2a8eb4d56102ac 100644 --- a/indra/newview/skins/default/xui/da/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/da/panel_preferences_graphics1.xml @@ -9,21 +9,11 @@ Opløsning: </text> <combo_box name="windowsize combo"> - <combo_item type="string" length="1" name="640x480"> - 640x480 - </combo_item> - <combo_item type="string" length="1" name="800x600"> - 800x600 - </combo_item> - <combo_item type="string" length="1" name="720x480"> - 720x480 (NTSC) - </combo_item> - <combo_item type="string" length="1" name="768x576"> - 768x576 (PAL) - </combo_item> - <combo_item type="string" length="1" name="1024x768"> - 1024x768 - </combo_item> + <combo_box.item type="string" length="1" name="640x480" label="640x480" /> + <combo_box.item type="string" length="1" name="800x600" label="800x600" /> + <combo_box.item type="string" length="1" name="720x480" label="720x480 (NTSC)" /> + <combo_box.item type="string" length="1" name="768x576" label="768x576 (PAL)" /> + <combo_box.item type="string" length="1" name="1024x768" label="1024x768" /> </combo_box> <text type="string" length="1" name="DisplayResLabel"> Skærm opløsning: @@ -32,18 +22,10 @@ Format: </text> <combo_box name="aspect_ratio" tool_tip="bredde/ højde"> - <combo_item type="string" length="1" name="4:3(StandardCRT)"> - 4:3 (Standard CRT) - </combo_item> - <combo_item type="string" length="1" name="5:4(1280x1024LCD)"> - 5:4 (1280x1024 LCD) - </combo_item> - <combo_item type="string" length="1" name="8:5(Widescreen)"> - 8:5 (Widescreen) - </combo_item> - <combo_item type="string" length="1" name="16:9(Widescreen)"> - 16:9 (Widescreen) - </combo_item> + <combo_box.item type="string" length="1" name="4:3(StandardCRT)" label="4:3 (Standard CRT)" /> + <combo_box.item type="string" length="1" name="5:4(1280x1024LCD)" label="5:4 (1280x1024 LCD)" /> + <combo_box.item type="string" length="1" name="8:5(Widescreen)" label="8:5 (Widescreen)" /> + <combo_box.item type="string" length="1" name="16:9(Widescreen)" label="16:9 (Widescreen)" /> </combo_box> <check_box label="Auto-detect format" name="aspect_auto_detect" /> <text type="string" length="1" name="HigherText"> @@ -87,18 +69,10 @@ Spejlnings detaljer: </text> <radio_group name="ReflectionDetailRadio"> - <radio_item type="string" length="1" name="0"> - Terræn og træer - </radio_item> - <radio_item type="string" length="1" name="1"> - Alle statiske objekter - </radio_item> - <radio_item type="string" length="1" name="2"> - Alle avatarer og objekter - </radio_item> - <radio_item type="string" length="1" name="3"> - Alt - </radio_item> + <radio_item type="string" length="1" name="0" label="Terræn og træer" /> + <radio_item type="string" length="1" name="1" label="Alle statiske objekter" /> + <radio_item type="string" length="1" name="2" label="Alle avatarer og objekter" /> + <radio_item type="string" length="1" name="3" label="Alt" /> </radio_group> <text type="string" length="1" name="AvatarRenderingText"> Avatar gengivelse @@ -149,23 +123,15 @@ Lys detaljer: </text> <radio_group name="LightingDetailRadio"> - <radio_item type="string" length="1" name="SunMoon"> - Kun sol og mÃ¥ne - </radio_item> - <radio_item type="string" length="1" name="LocalLights"> - Lys i nærheden - </radio_item> + <radio_item type="string" length="1" name="SunMoon" label="Kun sol og mÃ¥ne" /> + <radio_item type="string" length="1" name="LocalLights" label="Lys i nærheden" /> </radio_group> <text type="string" length="1" name="TerrainDetailText"> Terræn detaljer: </text> <radio_group name="TerrainDetailRadio"> - <radio_item type="string" length="1" name="0"> - Lav - </radio_item> - <radio_item type="string" length="1" name="2"> - Høj - </radio_item> + <radio_item type="string" length="1" name="0" label="Lav" /> + <radio_item type="string" length="1" name="2" label="Høj" /> </radio_group> <button label="Anbefalede indstillinger" name="Defaults" /> <button label="Hardware valg" label_selected="Hardware Options" diff --git a/indra/newview/skins/default/xui/de/floater_animation_preview.xml b/indra/newview/skins/default/xui/de/floater_animation_preview.xml index 299b6a7f7ebea00063439f3dde45c564d6c2387e..fbd03ab3d734edb9a65192b169947359cedd9aef 100644 --- a/indra/newview/skins/default/xui/de/floater_animation_preview.xml +++ b/indra/newview/skins/default/xui/de/floater_animation_preview.xml @@ -15,127 +15,53 @@ Handhaltung </text> <combo_box label="" name="hand_pose_combo" tool_tip="Steuert während der Animation die Bewegung der Hände."> - <combo_item name="Spread"> - Dehnen - </combo_item> - <combo_item name="Relaxed"> - Entspannt - </combo_item> - <combo_item name="PointBoth"> - Beide zeigen - </combo_item> - <combo_item name="Fist"> - Faust - </combo_item> - <combo_item name="RelaxedLeft"> - Links entspannt - </combo_item> - <combo_item name="PointLeft"> - Nach links zeigen - </combo_item> - <combo_item name="FistLeft"> - Linke Faust - </combo_item> - <combo_item name="RelaxedRight"> - Rechts entspannt - </combo_item> - <combo_item name="PointRight"> - Nach rechts zeigen - </combo_item> - <combo_item name="FistRight"> - Rechte Faust - </combo_item> - <combo_item name="SaluteRight"> - Rechts salutieren - </combo_item> - <combo_item name="Typing"> - Tippt - </combo_item> - <combo_item name="PeaceRight"> - Friedensrecht - </combo_item> + <combo_box.item name="Spread" label="Dehnen" /> + <combo_box.item name="Relaxed" label="Entspannt" /> + <combo_box.item name="PointBoth" label="Beide zeigen" /> + <combo_box.item name="Fist" label="Faust" /> + <combo_box.item name="RelaxedLeft" label="Links entspannt" /> + <combo_box.item name="PointLeft" label="Nach links zeigen" /> + <combo_box.item name="FistLeft" label="Linke Faust" /> + <combo_box.item name="RelaxedRight" label="Rechts entspannt" /> + <combo_box.item name="PointRight" label="Nach rechts zeigen" /> + <combo_box.item name="FistRight" label="Rechte Faust" /> + <combo_box.item name="SaluteRight" label="Rechts salutieren" /> + <combo_box.item name="Typing" label="Tippt" /> + <combo_box.item name="PeaceRight" label="Friedensrecht" /> </combo_box> <text name="emote_label"> Ausdruck </text> <combo_box label="" name="emote_combo" tool_tip="Steuert Gesichtsregungen während der Animation."> - <combo_item name="[None]"> - [Keine] - </combo_item> - <combo_item name="Aaaaah"> - Aaaaah - </combo_item> - <combo_item name="Afraid"> - Ängstlich - </combo_item> - <combo_item name="Angry"> - Verärgert - </combo_item> - <combo_item name="BigSmile"> - Grinst - </combo_item> - <combo_item name="Bored"> - Gelangweilt - </combo_item> - <combo_item name="Cry"> - Weinen - </combo_item> - <combo_item name="Disdain"> - Verachten - </combo_item> - <combo_item name="Embarrassed"> - Verlegen - </combo_item> - <combo_item name="Frown"> - Stirnrunzeln - </combo_item> - <combo_item name="Kiss"> - Küssen - </combo_item> - <combo_item name="Laugh"> - Lachen - </combo_item> - <combo_item name="Plllppt"> - Bäääh - </combo_item> - <combo_item name="Repulsed"> - Zurückgestoßen - </combo_item> - <combo_item name="Sad"> - Traurig - </combo_item> - <combo_item name="Shrug"> - Schulterzucken - </combo_item> - <combo_item name="Smile"> - Lächeln - </combo_item> - <combo_item name="Surprise"> - Ãœberraschung - </combo_item> - <combo_item name="Wink"> - Zwinkern - </combo_item> - <combo_item name="Worry"> - Sorgenvoll - </combo_item> + <combo_box.item name="[None]" label="Keine]" /> + <combo_box.item name="Aaaaah" label="Aaaaah" /> + <combo_box.item name="Afraid" label="Ängstlich" /> + <combo_box.item name="Angry" label="Verärgert" /> + <combo_box.item name="BigSmile" label="Grinst" /> + <combo_box.item name="Bored" label="Gelangweilt" /> + <combo_box.item name="Cry" label="Weinen" /> + <combo_box.item name="Disdain" label="Verachten" /> + <combo_box.item name="Embarrassed" label="Verlegen" /> + <combo_box.item name="Frown" label="Stirnrunzeln" /> + <combo_box.item name="Kiss" label="Küssen" /> + <combo_box.item name="Laugh" label="Lachen" /> + <combo_box.item name="Plllppt" label="Bäääh" /> + <combo_box.item name="Repulsed" label="Zurückgestoßen" /> + <combo_box.item name="Sad" label="Traurig" /> + <combo_box.item name="Shrug" label="Schulterzucken" /> + <combo_box.item name="Smile" label="Lächeln" /> + <combo_box.item name="Surprise" label="Ãœberraschung" /> + <combo_box.item name="Wink" label="Zwinkern" /> + <combo_box.item name="Worry" label="Sorgenvoll" /> </combo_box> <text name="preview_label" width="97"> Vorschau während: </text> <combo_box label="" left_delta="107" name="preview_base_anim" tool_tip="Hiermit können Sie das Verhalten Ihres Avatars testen, während Ihr Avatar normale Bewegungen ausführt."> - <combo_item name="Standing"> - Stehend - </combo_item> - <combo_item name="Walking"> - Geht - </combo_item> - <combo_item name="Sitting"> - Sitzt - </combo_item> - <combo_item name="Flying"> - Fliegend - </combo_item> + <combo_box.item name="Standing" label="Stehend" /> + <combo_box.item name="Walking" label="Geht" /> + <combo_box.item name="Sitting" label="Sitzt" /> + <combo_box.item name="Flying" label="Fliegend" /> </combo_box> <spinner label="Eingang glätten (s)" label_width="105" name="ease_in_time" tool_tip="Einblendungsgeschwindigkeit von Animationen (in Sekunden)." width="175"/> <spinner bottom_delta="-20" label="Ausgang glätten (s)" label_width="105" left="10" name="ease_out_time" tool_tip="Ausblendungsgeschwindigkeit von Animationen (in Sekunden)." width="175"/> diff --git a/indra/newview/skins/default/xui/de/floater_buy_land.xml b/indra/newview/skins/default/xui/de/floater_buy_land.xml index 1dbc0669140f002de4cd610750408e47c1850c0e..e0abf8fae9789acead658e3ab9b840dd3091745f 100644 --- a/indra/newview/skins/default/xui/de/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/de/floater_buy_land.xml @@ -36,6 +36,7 @@ <text name="covenant_text"> Sie müssen dem Grundstücksvertrag zustimmen: </text> + <text left="470" name="covenant_timestamp_text"/> <text_editor name="covenant_editor"> Wird geladen... </text_editor> @@ -74,15 +75,9 @@ Objekte im Verkauf eingeschlossen Landbesitz ist Premium-Mitgliedern vorbehalten. </text> <combo_box name="account_level"> - <combo_item name="US$9.95/month,billedmonthly"> - 9,95 US$/Monat, monatliche Abrechnung - </combo_item> - <combo_item name="US$7.50/month,billedquarterly"> - 7,50 US$/Monat, vierteljährliche Abrechnung - </combo_item> - <combo_item name="US$6.00/month,billedannually"> - 6,00 US$/Monat, jährliche Abrechnung - </combo_item> + <combo_box.item name="US$9.95/month,billedmonthly" label="9,95 US$/Monat, monatliche Abrechnung" /> + <combo_box.item name="US$7.50/month,billedquarterly" label="7,50 US$/Monat, vierteljährliche Abrechnung" /> + <combo_box.item name="US$6.00/month,billedannually" label="6,00 US$/Monat, jährliche Abrechnung" /> </combo_box> <text name="land_use_action"> Erhöhen Sie Ihre monatlichen Landnutzungsgebühren auf 40 US$/month. diff --git a/indra/newview/skins/default/xui/de/floater_god_tools.xml b/indra/newview/skins/default/xui/de/floater_god_tools.xml index dcb6982588edaaca01a2a1cb21b5f0d7604293db..39c064b2654fb0f259224d5784812dc2c9f126d3 100644 --- a/indra/newview/skins/default/xui/de/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/de/floater_god_tools.xml @@ -115,29 +115,17 @@ Ziel: </text> <combo_box name="destination"> - <combo_item name="Selection"> - Auswahl - </combo_item> - <combo_item name="AgentRegion"> - Avatar-Region - </combo_item> + <combo_box.item name="Selection" label="Auswahl" /> + <combo_box.item name="AgentRegion" label="Avatar-Region" /> </combo_box> <text name="Request:"> Anfrage: </text> <combo_box name="request"> - <combo_item name="colliders<steps>"> - Kollisionsobjekte <Schritte> - </combo_item> - <combo_item name="scripts<count>,<optionalpattern>"> - Skripts <Zähler>,<Optionales Muster> - </combo_item> - <combo_item name="objects<pattern>"> - Objekte <Muster> - </combo_item> - <combo_item name="rez<asset_id>"> - <asset_id> erstellen - </combo_item> + <combo_box.item name="colliders<steps>" label="Kollisionsobjekte <Schritte>" /> + <combo_box.item name="scripts<count>,<optionalpattern>" label="Skripts <Zähler>,<Optionales Muster>" /> + <combo_box.item name="objects<pattern>" label="Objekte <Muster>" /> + <combo_box.item name="rez<asset_id>" label="lt;asset_id> erstellen" /> </combo_box> <text name="Parameter:"> Parameter: diff --git a/indra/newview/skins/default/xui/de/floater_hardware_settings.xml b/indra/newview/skins/default/xui/de/floater_hardware_settings.xml index a90e7263923fcc03a4704b1db8b09d9bc81545fc..4051776b0d685d226cde4398694bcef4519f1f38 100644 --- a/indra/newview/skins/default/xui/de/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/de/floater_hardware_settings.xml @@ -8,21 +8,11 @@ Antialiasing: </text> <combo_box label="Antialiasing" name="fsaa"> - <combo_item name="FSAADisabled"> - Deaktiviert - </combo_item> - <combo_item name="2x"> - 2x - </combo_item> - <combo_item name="4x"> - 4x - </combo_item> - <combo_item name="8x"> - 8x - </combo_item> - <combo_item name="16x"> - 16x - </combo_item> + <combo_box.item name="FSAADisabled" label="Deaktiviert" /> + <combo_box.item name="2x" label="2x" /> + <combo_box.item name="4x" label="4x" /> + <combo_box.item name="8x" label="8x" /> + <combo_box.item name="16x" label="16x" /> </combo_box> <spinner label="Gamma:" name="gamma" /> <text name="(brightness, lower is brighter)"> diff --git a/indra/newview/skins/default/xui/de/floater_image_preview.xml b/indra/newview/skins/default/xui/de/floater_image_preview.xml index 145e0bbc33cbd78960b350d2ee1c3847f07feada..724da834954e3a7957928d02ac05622b3561cf24 100644 --- a/indra/newview/skins/default/xui/de/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/de/floater_image_preview.xml @@ -10,36 +10,16 @@ Bildvorschau als: </text> <combo_box label="Kleidungstyp" name="clothing_type_combo"> - <combo_item name="Image"> - Bild - </combo_item> - <combo_item name="Hair"> - Haar - </combo_item> - <combo_item name="FemaleHead"> - Kopf (Frau) - </combo_item> - <combo_item name="FemaleUpperBody"> - Oberkörper (Frau) - </combo_item> - <combo_item name="FemaleLowerBody"> - Unterkörper (Frau) - </combo_item> - <combo_item name="MaleHead"> - Kopf (Mann) - </combo_item> - <combo_item name="MaleUpperBody"> - Oberkörper (Mann) - </combo_item> - <combo_item name="MaleLowerBody"> - Unterkörper (Mann) - </combo_item> - <combo_item name="Skirt"> - Rock - </combo_item> - <combo_item name="SculptedPrim"> - Geformtes Primitiv - </combo_item> + <combo_box.item name="Image" label="Bild" /> + <combo_box.item name="Hair" label="Haar" /> + <combo_box.item name="FemaleHead" label="Kopf (Frau)" /> + <combo_box.item name="FemaleUpperBody" label="Oberkörper (Frau)" /> + <combo_box.item name="FemaleLowerBody" label="Unterkörper (Frau)" /> + <combo_box.item name="MaleHead" label="Kopf (Mann)" /> + <combo_box.item name="MaleUpperBody" label="Oberkörper (Mann)" /> + <combo_box.item name="MaleLowerBody" label="Unterkörper (Mann)" /> + <combo_box.item name="Skirt" label="Rock" /> + <combo_box.item name="SculptedPrim" label="Geformtes Primitiv" /> </combo_box> <text name="bad_image_text"> Bild kann nicht gelesen werden. diff --git a/indra/newview/skins/default/xui/de/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/de/floater_inventory_item_properties.xml index 0028f1da13313b818328c6da2a6df4ea2e207881..3e79a31abd0e7e6c3c0a699f4b34291d62ff58bf 100644 --- a/indra/newview/skins/default/xui/de/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/de/floater_inventory_item_properties.xml @@ -60,12 +60,8 @@ </text> <check_box label="Zum Verkauf" name="CheckPurchase" /> <radio_group name="RadioSaleType" left_delta="85" width="245" > - <radio_item name="radio"> - Original - </radio_item> - <radio_item name="radio2"> - Kopieren - </radio_item> + <radio_item name="radio" label="Original" /> + <radio_item name="radio2" label="Kopieren" /> </radio_group> <text name="TextPrice"> Preis: L$ diff --git a/indra/newview/skins/default/xui/de/floater_preview_gesture.xml b/indra/newview/skins/default/xui/de/floater_preview_gesture.xml index 327d0b70f1342056645de4859032fc8d5bf7db85..d72dceec90bf2c8c07a91cd8886da319c9518102 100644 --- a/indra/newview/skins/default/xui/de/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/de/floater_preview_gesture.xml @@ -46,12 +46,8 @@ Zeit, außer Sie fügen Warteschritte ein. </text> <radio_group name="animation_trigger_type"> - <radio_item name="start"> - Start - </radio_item> - <radio_item name="stop"> - Stopp - </radio_item> + <radio_item name="start" label="Start" /> + <radio_item name="stop" label="Stopp" /> </radio_group> <check_box label="bis alle Animationen beendet sind" name="wait_anim_check"/> <check_box label="Zeit in Sekunden" name="wait_time_check"/> diff --git a/indra/newview/skins/default/xui/de/floater_report_abuse.xml b/indra/newview/skins/default/xui/de/floater_report_abuse.xml index 6a7246d1e6b4b4a81b3712260618268ce0e843a7..af7145003a55030bbc9b566f26cf34629e48c448 100644 --- a/indra/newview/skins/default/xui/de/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/de/floater_report_abuse.xml @@ -38,123 +38,51 @@ dann auf das Objekt: Hendrerit Vulputate </text> <combo_box name="category_combo" tool_tip="Kategorie -- wählen Sie die Kategorie aus, die am besten auf diesen Bericht zutrifft"> - <combo_item name="Select_category"> - Kategorie auswählen - </combo_item> - <combo_item name="Age__Age_play"> - Alter> Age-Play - </combo_item> - <combo_item name="Age__Adult_resident_on_Teen_Second_Life"> - Alter> Erwachsener Einwohner in Teen Second Life - </combo_item> + <combo_box.item name="Select_category" label="Kategorie auswählen"/> + <combo_box.item name="Age__Age_play" label="Alter> Age-Play"/> + <combo_box.item name="Age__Adult_resident_on_Teen_Second_Life" label="Alter> Erwachsener Einwohner in Teen Second Life"/> <combo_item name="Age__Underage_resident_outside_of_Teen_Second_Life"> Alter > Minderjähriger Einwohner außerhalb Teen Second Life </combo_item> - <combo_item name="Assault__Combat_sandbox___unsafe_area"> - Angriff> Kampf-Sandbox / unsichere Region - </combo_item> - <combo_item name="Assault__Safe_area"> - Angriff> Sichere Region - </combo_item> - <combo_item name="Assault__Weapons_testing_sandbox"> - Angriff > Sandbox für Waffentest - </combo_item> - <combo_item name="Commerce__Failure_to_deliver_product_or_service"> - Handel > Produkt nicht geliefert oder Dienstleistung nicht erbracht - </combo_item> - <combo_item name="Disclosure__Real_world_information"> - Offenlegung > Informationen aus realer Welt - </combo_item> - <combo_item name="Disclosure__Remotely_monitoring chat"> - Offenlegung > Abhören eines Chats aus der Ferne - </combo_item> - <combo_item name="Disclosure__Second_Life_information_chat_IMs"> - Offenlegung > Second Life-Informationen/Chat/IMs - </combo_item> - <combo_item name="Disturbing_the_peace__Unfair_use_of_region_resources"> - Ruhestörung > Unfaire Nutzung von Regionsressourcen - </combo_item> - <combo_item name="Disturbing_the_peace__Excessive_scripted_objects"> - Ruhestörung > Exzessive Nutzung geskripteter Objekte - </combo_item> - <combo_item name="Disturbing_the_peace__Object_littering"> - Ruhestörung > Wildes Erzeugen von Objekten - </combo_item> - <combo_item name="Disturbing_the_peace__Repetitive_spam"> - Ruhestörung > Ständige Spam-Wiederholung - </combo_item> - <combo_item name="Disturbing_the_peace__Unwanted_advert_spam"> - Ruhestörung > Unerwünschte Spam-Werbung - </combo_item> - <combo_item name="Fraud__L$"> - Betrug > L$ - </combo_item> - <combo_item name="Fraud__Land"> - Betrug> Land - </combo_item> - <combo_item name="Fraud__Pyramid_scheme_or_chain_letter"> - Betrug > Schneeballsystem oder Kettenbrief - </combo_item> - <combo_item name="Fraud__US$"> - Betrug > US$ - </combo_item> - <combo_item name="Harassment__Advert_farms___visual_spam"> - Belästigung > Werbefarmen / visueller Spam - </combo_item> - <combo_item name="Harassment__Defaming_individuals_or_groups"> - Belästigung > Diffamieren von Einzelpersonen/Gruppen - </combo_item> - <combo_item name="Harassment__Impeding_movement"> - Belästigung > Bewegungseinschränkung - </combo_item> - <combo_item name="Harassment__Sexual_harassment"> - Belästigung > Sexuelle Belästigung - </combo_item> - <combo_item name="Harassment__Solicting_inciting_others_to_violate_ToS"> - Belästigung > Anstiften Dritter zur Missachtung der Nutzungsbedingungen - </combo_item> - <combo_item name="Harassment__Verbal_abuse"> - Belästigung > Beschimpfung - </combo_item> - <combo_item name="Indecency__Broadly_offensive_content_or_conduct"> - Unanständigkeit > Anstößige Inhalte oder Handlungen in der Öffentlichkeit - </combo_item> - <combo_item name="Indecency__Inappropriate_avatar_name"> - Unanständigkeit > Anstößiger Avatarname - </combo_item> + <combo_box.item name="Assault__Combat_sandbox___unsafe_area" label="Angriff> Kampf-Sandbox / unsichere Region"/> + <combo_box.item name="Assault__Safe_area" label="Angriff> Sichere Region"/> + <combo_box.item name="Assault__Weapons_testing_sandbox" label="Angriff > Sandbox für Waffentest"/> + <combo_box.item name="Commerce__Failure_to_deliver_product_or_service" label="Handel > Produkt nicht geliefert oder Dienstleistung nicht erbracht"/> + <combo_box.item name="Disclosure__Real_world_information" label="Offenlegung > Informationen aus realer Welt"/> + <combo_box.item name="Disclosure__Remotely_monitoring chat" label="Offenlegung > Abhören eines Chats aus der Ferne"/> + <combo_box.item name="Disclosure__Second_Life_information_chat_IMs" label="Offenlegung > Second Life-Informationen/Chat/IMs"/> + <combo_box.item name="Disturbing_the_peace__Unfair_use_of_region_resources" label="Ruhestörung > Unfaire Nutzung von Regionsressourcen"/> + <combo_box.item name="Disturbing_the_peace__Excessive_scripted_objects" label="Ruhestörung > Exzessive Nutzung geskripteter Objekte"/> + <combo_box.item name="Disturbing_the_peace__Object_littering" label="Ruhestörung > Wildes Erzeugen von Objekten"/> + <combo_box.item name="Disturbing_the_peace__Repetitive_spam" label="Ruhestörung > Ständige Spam-Wiederholung"/> + <combo_box.item name="Disturbing_the_peace__Unwanted_advert_spam" label="Ruhestörung > Unerwünschte Spam-Werbung"/> + <combo_box.item name="Fraud__L$" label="Betrug > L$"/> + <combo_box.item name="Fraud__Land" label="Betrug> Land"/> + <combo_box.item name="Fraud__Pyramid_scheme_or_chain_letter" label="Betrug > Schneeballsystem oder Kettenbrief"/> + <combo_box.item name="Fraud__US$" label="Betrug > US$"/> + <combo_box.item name="Harassment__Advert_farms___visual_spam" label="Belästigung > Werbefarmen / visueller Spam"/> + <combo_box.item name="Harassment__Defaming_individuals_or_groups" label="Belästigung > Diffamieren von Einzelpersonen/Gruppen"/> + <combo_box.item name="Harassment__Impeding_movement" label="Belästigung > Bewegungseinschränkung"/> + <combo_box.item name="Harassment__Sexual_harassment" label="Belästigung > Sexuelle Belästigung"/> + <combo_box.item name="Harassment__Solicting_inciting_others_to_violate_ToS" label="Belästigung > Anstiften Dritter zur Missachtung der Nutzungsbedingungen"/> + <combo_box.item name="Harassment__Verbal_abuse" label="Belästigung > Beschimpfung"/> + <combo_box.item name="Indecency__Broadly_offensive_content_or_conduct" label="Unanständigkeit > Anstößige Inhalte oder Handlungen in der Öffentlichkeit"/> + <combo_box.item name="Indecency__Inappropriate_avatar_name" label="Unanständigkeit > Anstößiger Avatarname"/> <combo_item name="Indecency__Mature_content_in_PG_region"> Unanständigkeit > Unangemessener Inhalt oder unangemessenes Verhalten in PG-Region </combo_item> <combo_item name="Indecency__Inappropriate_content_in_Mature_region"> Unanständigkeit > Unangemessener Inhalt oder unangemessenes Verhalten in Mature-Region </combo_item> - <combo_item name="Intellectual_property_infringement_Content_Removal"> - Urheberrechtsverletzung > Entfernen von Inhalten - </combo_item> - <combo_item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"> - Urheberrechtsverletzung > CopyBot oder Berechtigungs-Exploit - </combo_item> - <combo_item name="Intolerance"> - Intoleranz - </combo_item> - <combo_item name="Land__Abuse_of_sandbox_resources"> - Land > Missbrauch der Sandbox-Ressourcen - </combo_item> - <combo_item name="Land__Encroachment__Objects_textures"> - Land > Unbefugte Nutzung > Objekte/Texturen - </combo_item> - <combo_item name="Land__Encroachment__Particles"> - Land > Unbefugte Nutzung > Partikel - </combo_item> - <combo_item name="Land__Encroachment__Trees_plants"> - Land > Unbefugte Nutzung > Bäume/Pflanzen - </combo_item> - <combo_item name="Wagering_gambling"> - Wetten/Glücksspiel - </combo_item> - <combo_item name="Other"> - Sonstige - </combo_item> + <combo_box.item name="Intellectual_property_infringement_Content_Removal" label="Urheberrechtsverletzung > Entfernen von Inhalten"/> + <combo_box.item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit" label="Urheberrechtsverletzung > CopyBot oder Berechtigungs-Exploit"/> + <combo_box.item name="Intolerance" label="Intoleranz"/> + <combo_box.item name="Land__Abuse_of_sandbox_resources" label="Land > Missbrauch der Sandbox-Ressourcen"/> + <combo_box.item name="Land__Encroachment__Objects_textures" label="Land > Unbefugte Nutzung > Objekte/Texturen"/> + <combo_box.item name="Land__Encroachment__Particles" label="Land > Unbefugte Nutzung > Partikel"/> + <combo_box.item name="Land__Encroachment__Trees_plants" label="Land > Unbefugte Nutzung > Bäume/Pflanzen"/> + <combo_box.item name="Wagering_gambling" label="Wetten/Glücksspiel"/> + <combo_box.item name="Other" label="Sonstige"/> </combo_box> <text name="abuser_name_title"> Name des Beschuldigten: diff --git a/indra/newview/skins/default/xui/de/floater_sell_land.xml b/indra/newview/skins/default/xui/de/floater_sell_land.xml index d4ec0fa729e0a6ebaa0518ad84eb62e567c6c408..c34252d8a7da7598af04270010427623e9bd046b 100644 --- a/indra/newview/skins/default/xui/de/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/de/floater_sell_land.xml @@ -38,15 +38,9 @@ dieser Parzelle: beschränkt ist. </text> <combo_box height="16" left="72" name="sell_to" bottom_delta="-32" width="140"> - <combo_item name="--selectone--"> - -- select one -- - </combo_item> - <combo_item name="Anyone"> - Jeder - </combo_item> - <combo_item name="Specificuser:"> - Bestimmter Benutzer: - </combo_item> + <combo_box.item name="--selectone--" label="select one --" /> + <combo_box.item name="Anyone" label="Jeder" /> + <combo_box.item name="Specificuser:" label="Bestimmter Benutzer:" /> </combo_box> <button label="Auswählen..." name="sell_to_select_agent" /> <text name="sell_objects_label"> @@ -57,12 +51,8 @@ beschränkt ist. wechseln den Eigentümer. </text> <radio_group bottom_delta="-58" name="sell_objects"> - <radio_item name="no"> - Nein, Objekte behalten - </radio_item> - <radio_item name="yes"> - Ja, Objekte mit Land verkaufen - </radio_item> + <radio_item name="no" label="Nein, Objekte behalten" /> + <radio_item name="yes" label="Ja, Objekte mit Land verkaufen" /> </radio_group> <button label="Objekte anzeigen" name="show_objects" width="116"/> <text name="nag_message_label"> diff --git a/indra/newview/skins/default/xui/de/floater_settings_debug.xml b/indra/newview/skins/default/xui/de/floater_settings_debug.xml index d64b9dccf9605fbd22e500cc54ef1b9b86e495d9..034cfca017fa56c86f8804df201de0e42ff4ea0d 100644 --- a/indra/newview/skins/default/xui/de/floater_settings_debug.xml +++ b/indra/newview/skins/default/xui/de/floater_settings_debug.xml @@ -1,12 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater name="settings_debug" title="Debug-Einstellungen"> <combo_box name="boolean_combo"> - <combo_item name="TRUE"> - WAHR - </combo_item> - <combo_item name="FALSE"> - FALSCH - </combo_item> + <combo_box.item name="TRUE" label="WAHR" /> + <combo_box.item name="FALSE" label="FALSCH" /> </combo_box> <color_swatch label="Farbe" name="color_swatch" /> <spinner label="x" name="val_spinner_1" /> diff --git a/indra/newview/skins/default/xui/de/floater_sound_preview.xml b/indra/newview/skins/default/xui/de/floater_sound_preview.xml index 552b4b0f27c93a1d48d379d3d14e44ea503694a6..1e5ac179b5bf5fa186cf6b8cc02991188d8a3913 100644 --- a/indra/newview/skins/default/xui/de/floater_sound_preview.xml +++ b/indra/newview/skins/default/xui/de/floater_sound_preview.xml @@ -12,17 +12,9 @@ Bitrate (kbit/s): </text> <radio_group name="bitrate"> - <radio_item name="32"> - 32 - </radio_item> - <radio_item name="64"> - 64 - </radio_item> - <radio_item name="96"> - 96 - </radio_item> - <radio_item name="128"> - 128 - </radio_item> + <radio_item name="32" label="32" /> + <radio_item name="64" label="64" /> + <radio_item name="96" label="96" /> + <radio_item name="128" label="128" /> </radio_group> </floater> diff --git a/indra/newview/skins/default/xui/de/floater_tos.xml b/indra/newview/skins/default/xui/de/floater_tos.xml index 42f48fad4d7516dc3a8de248dd23608546683827..780dc29edc709d65269bd973fa41be564c3ed2f6 100644 --- a/indra/newview/skins/default/xui/de/floater_tos.xml +++ b/indra/newview/skins/default/xui/de/floater_tos.xml @@ -3,12 +3,8 @@ <button label="Weiter" label_selected="Weiter" name="Continue" /> <button label="Abbrechen" label_selected="Abbrechen" name="Cancel" /> <radio_group name="tos_agreement"> - <radio_item name="radio_disagree"> - Ich stimme den Nutzungsbedingungen nicht zu - </radio_item> - <radio_item name="radio_agree"> - Ich stimme den Nutzungsbedingungen zu - </radio_item> + <radio_item name="radio_disagree" label="Ich stimme den Nutzungsbedingungen nicht zu" /> + <radio_item name="radio_agree" label="Ich stimme den Nutzungsbedingungen zu" /> </radio_group> <text name="tos_title"> Nutzungsvereinbarung diff --git a/indra/newview/skins/default/xui/de/floater_world_map.xml b/indra/newview/skins/default/xui/de/floater_world_map.xml index d28b55e8a84d48af618bc32173959a6d2bb749d7..555b78b8373f5d9b3625110e7f91199e611f36f4 100644 --- a/indra/newview/skins/default/xui/de/floater_world_map.xml +++ b/indra/newview/skins/default/xui/de/floater_world_map.xml @@ -28,14 +28,10 @@ <check_box label="Mature" name="event_mature_chk"/> <check_box label="Adult" name="event_adult_chk"/> <combo_box label="Online-Freunde" name="friend combo" tool_tip="Freund, der auf Karte angezeigt werden soll"> - <combo_item name="none_selected"> - Online-Freunde - </combo_item> + <combo_box.item name="none_selected" label="Online-Freunde" /> </combo_box> <combo_box label="Landmarken" name="landmark combo" tool_tip="Landmarke, die auf Karte angezeigt werden soll"> - <combo_item name="none_selected"> - Landmarken - </combo_item> + <combo_box.item name="none_selected" label="Landmarken" /> </combo_box> <line_editor label="Nach Regionsname suchen" name="location" tool_tip="Geben Sie den Namen einer Region ein"/> <button label="Suchen" name="DoSearch" tool_tip="Nach einer Region suchen"/> diff --git a/indra/newview/skins/default/xui/de/panel_login.xml b/indra/newview/skins/default/xui/de/panel_login.xml index 6846b1536c83b14659ffb8a95ba5b14e36e59c94..3f459050b1238a90bd831e2b5e8b1fcf2e0ab041 100644 --- a/indra/newview/skins/default/xui/de/panel_login.xml +++ b/indra/newview/skins/default/xui/de/panel_login.xml @@ -13,15 +13,9 @@ Startposition: </text> <combo_box name="start_location_combo"> - <combo_item name="MyHome"> - Mein Heimatort - </combo_item> - <combo_item name="MyLastLocation"> - Mein letzter Standort - </combo_item> - <combo_item name="Typeregionname"> - <Region eingeben> - </combo_item> + <combo_box.item name="MyHome" label="Mein Heimatort" /> + <combo_box.item name="MyLastLocation" label="Mein letzter Standort" /> + <combo_box.item name="Typeregionname" label="lt;Region eingeben>" /> </combo_box> <check_box label="Kennwort merken" name="remember_check"/> <text name="full_screen_text"> diff --git a/indra/newview/skins/default/xui/de/panel_preferences_chat.xml b/indra/newview/skins/default/xui/de/panel_preferences_chat.xml index feeb5287212a9c87dca0b129b26e4b092dc7205b..9de8922954a2882176e44a7582ec25aa4d5356c4 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_chat.xml @@ -4,15 +4,9 @@ Chat-Schriftgröße: </text> <radio_group name="chat_font_size"> - <radio_item length="1" name="radio" type="string"> - Klein - </radio_item> - <radio_item length="1" name="radio2" type="string"> - Mittel - </radio_item> - <radio_item length="1" name="radio3" type="string"> - Groß - </radio_item> + <radio_item length="1" name="radio" type="string" label="Klein" /> + <radio_item length="1" name="radio2" type="string" label="Mittel" /> + <radio_item length="1" name="radio3" type="string" label="Groß" /> </radio_group> <text length="1" name="text_box2" type="string"> Chat-Farbe: diff --git a/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml index bc40ec0da16cc45366a722210cfb8541413a3161..dd77d57f87e1cca7126977a2546cb4fc00182bc5 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml @@ -21,21 +21,11 @@ Fenstergröße: </text> <combo_box left="115" name="windowsize combo"> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="720x480"> - 720x480 (NTSC) - </combo_item> - <combo_item name="768x576"> - 768x576 (PAL) - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> + <combo_box.item name="640x480" label="640x480" /> + <combo_box.item name="800x600" label="800x600" /> + <combo_box.item name="720x480" label="720x480 (NTSC)" /> + <combo_box.item name="768x576" label="768x576 (PAL)" /> + <combo_box.item name="1024x768" label="1024x768" /> </combo_box> <text name="DisplayResLabel" width="100"> Anzeigeauflösung: @@ -45,18 +35,10 @@ Aspektverhältnis: </text> <combo_box left="115" name="aspect_ratio" tool_tip="Breite/Höhe"> - <combo_item type="string" length="1" name="4:3(StandardCRT)"> - 4:3 (Standard-CRT) - </combo_item> - <combo_item type="string" length="1" name="5:4(1280x1024LCD)"> - 5:4 (1280x1024 LCD) - </combo_item> - <combo_item name="8:5(Widescreen)"> - 8:5 (Widescreen) - </combo_item> - <combo_item type="string" length="1" name="16:9(Widescreen)"> - 16:9 (Widescreen) - </combo_item> + <combo_box.item type="string" length="1" name="4:3(StandardCRT)" label="4:3 (Standard-CRT)" /> + <combo_box.item type="string" length="1" name="5:4(1280x1024LCD)" label="5:4 (1280x1024 LCD)" /> + <combo_box.item name="8:5(Widescreen)" label="8:5 (Widescreen)" /> + <combo_box.item type="string" length="1" name="16:9(Widescreen)" label="16:9 (Widescreen)" /> </combo_box> <check_box label="Verhältnis automatisch erkennen" left="275" name="aspect_auto_detect" /> <text type="string" length="1" name="UI Size:"> @@ -111,18 +93,10 @@ Spiegelung: </text> <radio_group name="ReflectionDetailRadio"> - <radio_item name="0"> - Terrain und Bäume - </radio_item> - <radio_item name="1"> - Alle statischen Objekte - </radio_item> - <radio_item name="2"> - Alle Avatare und Objekte - </radio_item> - <radio_item name="3"> - Alles - </radio_item> + <radio_item name="0" label="Terrain und Bäume" /> + <radio_item name="1" label="Alle statischen Objekte" /> + <radio_item name="2" label="Alle Avatare und Objekte" /> + <radio_item name="3" label="Alles" /> </radio_group> <text name="AvatarRenderingText"> Avatar-Darstellung: @@ -173,23 +147,15 @@ Beleuchtungsdetails: </text> <radio_group name="LightingDetailRadio"> - <radio_item name="SunMoon"> - Nur Sonne und Mond - </radio_item> - <radio_item name="LocalLights"> - Lokale Lichtquellen - </radio_item> + <radio_item name="SunMoon" label="Nur Sonne und Mond" /> + <radio_item name="LocalLights" label="Lokale Lichtquellen" /> </radio_group> <text name="TerrainDetailText"> Terraindetails: </text> <radio_group name="TerrainDetailRadio"> - <radio_item name="0"> - Niedrig - </radio_item> - <radio_item name="2"> - Hoch - </radio_item> + <radio_item name="0" label="Niedrig" /> + <radio_item name="2" label="Hoch" /> </radio_group> <button label="Empfohlene Einstellungen" name="Defaults" /> <button label="Hardware-Optionen" label_selected="Hardware-Optionen" diff --git a/indra/newview/skins/default/xui/en/accordion_parent.xml b/indra/newview/skins/default/xui/en/accordion_parent.xml new file mode 100644 index 0000000000000000000000000000000000000000..632752b1c43f6072f4b73082d8ee8d058264754b --- /dev/null +++ b/indra/newview/skins/default/xui/en/accordion_parent.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> + <panel border_thickness="2" name="splitter_parent" + can_resize="true" background_visible="true" + label="splitter_parent" + title="" + > + </panel> diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml new file mode 100644 index 0000000000000000000000000000000000000000..f52c5d617553fc178ce3fc8e36f73412d9cb62a0 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="440" + layout="topleft" + name="floater_about" + save_rect="true" + title="About [SECOND_LIFE_VIEWER]" + width="470"> + <floater.string + name="you_are_at"> + You are at [POSITION] + </floater.string> + <floater.string + name="in_region"> + in [REGION] located at + </floater.string> + <floater.string + name="CPU"> + CPU: + </floater.string> + <floater.string + name="Memory"> + Memory: [MEM] MB + </floater.string> + <floater.string + name="OSVersion"> + OS Version: + </floater.string> + <floater.string + name="GraphicsCardVendor"> + Graphics Card Vendor: + </floater.string> + <floater.string + name="GraphicsCard"> + Graphics Card: + </floater.string> + <floater.string + name="OpenGLVersion"> + OpenGL Version: + </floater.string> + <floater.string + name="LibCurlVersion"> + libcurl Version: + </floater.string> + <floater.string + name="J2CDecoderVersion"> + J2C Decoder Version: + </floater.string> + <floater.string + name="AudioDriverVersion"> + Audio Driver Version: + </floater.string> + <floater.string + name="none"> + (none) + </floater.string> + <floater.string + name="LLMozLibVersion"> + LLMozLib Version: + </floater.string> + <floater.string + name="PacketsLost"> + Packets Lost: [LOST]/[IN] ([PCT]%) + </floater.string> + <text_editor + type="string" + length="1" + follows="left|top|right|bottom" + height="168" + layout="topleft" + left="6" + max_length="65536" + name="credits_editor" + top="266" + width="458" + word_wrap="true"> + Second Life is brought to you by Philip, Tessa, Andrew, Cory, James, Ben, Char, Charlie, Colin, Dan, Daniel, Doug, Eric, Hamlet, Haney, Eve, Hunter, Ian, Jeff, Jennifer, Jim, John, Lee, Mark, Peter, Phoenix, Richard, Robin, Xenon, Steve, Tanya, Eddie, Avi, Frank, Bruce, Aaron, Alice, Bob, Debra, Eileen, Helen, Janet, Louie, Leviathania, Stefan, Ray, Kevin, Tom, Mikeb, MikeT, Burgess, Elena, Tracy, Bill, Todd, Ryan, Zach, Sarah, Nova, Tim, Stephanie, Michael, Evan, Nicolas, Catherine, Rachelle, Dave, Holly, Bub, Kelly, Magellan, Ramzi, Don, Sabin, Jill, Rheya, Jeska, Torley, Kona, Callum, Charity, Ventrella, Jack, Vektor, Iris, Chris, Nicole, Mick, Reuben, Blue, Babbage, Yedwab, Deana, Lauren, Brent, Pathfinder, Chadrick, Altruima, Jesse, Teeny, Monroe, Icculus, David, Tess, Lizzie, Patsy, Isaac, Lawrence, Cyn, Bo, Gia, Annette, Marius, Tbone, Jonathan, Karen, Ginsu, Satoko, Yuko, Makiko, Thomas, Harry, Seth, Alexei, Brian, Guy, Runitai, Ethan, Data, Cornelius, Kenny, Swiss, Zero, Natria, Wendy, Stephen, Teeple, Thumper, Lucy, Dee, Mia, Liana, Warren, Branka, Aura, beez, Milo, Hermia, Red, Thrax, Joe, Sally, Magenta, Mogura, Paul, Jose, Rejean, Henrik, Lexie, Amber, Logan, Xan, Nora, Morpheus, Donovan, Leyla, MichaelFrancis, Beast, Cube, Bucky, Joshua, Stryfe, Harmony, Teresa, Claudia, Walker, Glenn, Fritz, Fordak, June, Cleopetra, Jean, Ivy, Betsy, Roosevelt, Spike, Ken, Which, Tofu, Chiyo, Rob, Zee, dustin, George, Del, Matthew, Cat, Jacqui, Lightfoot, Adrian, Viola, Alfred, Noel, Irfan, Sunil, Yool, Rika, Jane, Xtreme, Frontier, a2, Neo, Siobhan, Yoz, Justin, Elle, Qarl, Benjamin, Isabel, Gulliver, Everett, Christopher, Izzy, Stephany, Garry, Sejong, Sean, Tobin, Iridium, Meta, Anthony, Jeremy, JP, Jake, Maurice, Madhavi, Leopard, Kyle, Joon, Kari, Bert, Belinda, Jon, Kristi, Bridie, Pramod, KJ, Socrates, Maria, Ivan, Aric, Yamasaki, Adreanne, Jay, MitchK, Ceren, Coco, Durl, Jenny, Periapse, Kartic, Storrs, Lotte, Sandy, Rohn, Colossus, Zen, BigPapi, Brad, Pastrami, Kurz, Mani, Neuro, Jaime, MJ, Rowan, Sgt, Elvis, Gecko, Samuel, Sardonyx, Leo, Bryan, Niko, Soft, Poppy, Rachel, Aki, Angelo, Banzai, Alexa, Sue, CeeLo, Bender, CG, Gillian, Pelle, Nick, Echo, Zara, Christine, Shamiran, Emma, Blake, Keiko, Plexus, Joppa, Sidewinder, Erica, Ashlei, Twilight, Kristen, Brett, Q, Enus, Simon, Bevis, Kraft, Kip, Chandler, Ron, LauraP, Ram, KyleJM, Scouse, Prospero, Melissa, Marty, Nat, Hamilton, Kend, Lordan, Jimmy, Kosmo, Seraph, Green, Ekim, Wiggo, JT, Rome, Doris, Miz, Benoc, Whump, Trinity, Patch, Kate, TJ, Bao, Joohwan, Christy, Sofia, Matias, Cogsworth, Johan, Oreh, Cheah, Angela, Brandy, Mango, Lan, Aleks, Gloria, Heidy, Mitchell, Space, Colton, Bambers, Einstein, Maggie, Malbers, Rose, Winnie, Stella, Milton, Rothman, Niall, Marin, Allison, Katie, Dawn, Katt, Dusty, Kalpana, Judy, Andrea, Ambroff, Infinity, Gail, Rico, Raymond, Yi, William, Christa, M, Teagan, Scout, Molly, Dante, Corr, Dynamike, Usi, Kaylee, Vidtuts, Lil, Danica, Sascha, Kelv, Jacob, Nya, Rodney, Brandon, Elsie, Blondin, Grant, Katrin, Nyx, Gabriel, Locklainn, Claire, Devin, Minerva, Monty, Austin, Bradford, Si, Keira, H, Caitlin, Dita, Makai, Jenn, Ann, Meredith, Clare, Joy, Praveen, Cody, Edmund, Ruthe, Sirena, Gayathri, Spider, FJ, Davidoff, Tian, Jennie, Louise, Oskar, Landon, Noelle, Jarv, Ingrid, Al, Sommer, Doc, Aria, Huin, Gray, Lili, Vir, DJ, Yang, T, Simone, Maestro, Scott, Charlene, Quixote, Amanda, Susan, Zed, Anne, Enkidu, Esbee, Joroan, Katelin, Roxie, Tay, Scarlet, Kevin, Johnny, Wolfgang, Andren, Bob, Howard, Merov, Rand, Ray, Michon, Newell, Galen, Dessie, Les and many others. + + Thank you to the following residents for helping to ensure that this is the best version yet: (in progress) + + 3Dconnexion SDK Copyright (C) 1992-2007 3Dconnexion + APR Copyright (C) 2000-2004 The Apache Software Foundation + cURL Copyright (C) 1996-2002, Daniel Stenberg, (daniel@haxx.se) + DBus/dbus-glib Copyright (C) 2002, 2003 CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc. + expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd. + FreeType Copyright (C) 1996-2002, The FreeType Project (www.freetype.org). + GL Copyright (C) 1999-2004 Brian Paul. + Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited. + jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW) + jpeglib Copyright (C) 1991-1998, Thomas G. Lane. + ogg/vorbis Copyright (C) 2001, Xiphophorus + OpenSSL Copyright (C) 1998-2002 The OpenSSL Project. + SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga + SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + xmlrpc-epi Copyright (C) 2000 Epinions, Inc. + zlib Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler. + google-perftools Copyright (c) 2005, Google Inc. + + All rights reserved. See licenses.txt for details. + + Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C) + + + To be a success in business, be daring, be first, be different. --Henry Marchant + </text_editor> + <text_editor + follows="left|top|right|bottom" + font="SansSerif" + height="238" + layout="topleft" + left_delta="0" + max_length="65536" + name="support_editor" + top_delta="-244" + width="458" + word_wrap="true" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml new file mode 100644 index 0000000000000000000000000000000000000000..3563780f8b41c1870085f9a9f46326da15919182 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -0,0 +1,2139 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_tear_off="false" + height="420" + layout="topleft" + name="floaterland" + save_rect="true" + title="About Land" + width="460"> + <floater.string + name="Minutes"> + [MINUTES] minutes + </floater.string> + <floater.string + name="Minute"> + minute + </floater.string> + <floater.string + name="Seconds"> + [SECONDS] seconds + </floater.string> + <floater.string + name="Remaining"> + remaining + </floater.string> + <tab_container + follows="left|top|right|bottom" + height="400" + layout="topleft" + left="1" + name="landtab" + tab_position="top" + top="20" + width="459"> + <panel + border="true" + follows="left|top|right|bottom" + height="380" + label="General" + layout="topleft" + left="1" + name="land_general_panel" + top="-31" + width="458"> + <panel.string + name="new users only"> + New users only + </panel.string> + <panel.string + name="anyone"> + Anyone + </panel.string> + <panel.string + name="area_text"> + Area + </panel.string> + <panel.string + name="area_size_text"> + [AREA] sq.m. + </panel.string> + <panel.string + name="auction_id_text"> + Auction ID: [ID] + </panel.string> + <panel.string + name="need_tier_to_modify"> + You must approve your purchase to modify this land. + </panel.string> + <panel.string + name="group_owned_text"> + (Group Owned) + </panel.string> + <panel.string + name="profile_text"> + Profile... + </panel.string> + <panel.string + name="info_text"> + Info... + </panel.string> + <panel.string + name="public_text"> + (public) + </panel.string> + <panel.string + name="none_text"> + (none) + </panel.string> + <panel.string + name="sale_pending_text"> + (Sale Pending) + </panel.string> + <panel.string + name="no_selection_text"> + No parcel selected. +Go to World menu > About Land or select another parcel to show its details. + </panel.string> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="Name:" + top="4" + width="92"> + Name: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="2" + max_length="63" + name="Name" + top_delta="0" + width="350" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="Description:" + top="24" + width="100"> + Description: + </text> + <text_editor + bevel_style="in" + border_style="line" + border_thickness="1" + follows="left|top|right" + height="52" + layout="topleft" + left_delta="92" + name="Description" + top_delta="0" + width="350" + word_wrap="true" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="LandType" + top="84" + width="92"> + Type: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="92" + name="LandTypeText" + top_delta="0" + width="250"> + Mainland / Homestead + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="ContentRating" + top="104" + width="92"> + Rating: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="92" + name="ContentRatingText" + top_delta="0" + width="250"> + Adult + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="Owner:" + top="124" + width="92"> + Owner: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="92" + name="OwnerText" + top_delta="0" + width="250"> + Leyla Linden + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Profile..." + label_selected="Profile..." + layout="topleft" + left_pad="4" + name="Profile..." + top_delta="0" + width="90" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="Group:" + top="144" + width="92"> + Group: + </text> + <text + enabled="false" + follows="left|top" + height="16" + layout="topleft" + left_delta="92" + name="GroupText" + top_delta="2" + width="250" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Set..." + label_selected="Set..." + layout="topleft" + left_pad="4" + name="Set..." + top_delta="-2" + width="90" /> + <check_box + enabled="false" + height="16" + label="Allow Deed to Group" + layout="topleft" + left="96" + name="check deed" + tool_tip="A group officer can deed this land to the group, so it will be supported by the group&apos;s land allocation." + top="164" + width="116" /> + <button + enabled="false" + follows="left|top" + font="SansSerifSmall" + height="16" + label="Deed..." + label_selected="Deed..." + layout="topleft" + left_pad="138" + name="Deed..." + tool_tip="You may only deed land if you are an officer in the selected group." + top_delta="0" + width="90" /> + <check_box + enabled="false" + height="16" + label="Owner Makes Contribution With Deed" + layout="topleft" + left="96" + name="check contrib" + tool_tip="When the land is deeded to the group, the former owner contributes enough land allocation to support it." + top="184" + width="199" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="For Sale:" + top="204" + width="92"> + For Sale: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="92" + name="Not for sale." + top_delta="0" + width="186"> + Not for sale. + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="For Sale: Price L$[PRICE]." + top_delta="0" + width="226"> + Price: L$[PRICE] (L$[PRICE_PER_SQM]/sq.m.). + </text> + <text + enabled="false" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="SalePending" + top_pad="4" + width="344" /> + <button + follows="left|top" + height="20" + label="Sell Land..." + label_selected="Sell Land..." + layout="topleft" + left_delta="199" + name="Sell Land..." + top_delta="0" + width="145" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="-199" + name="For sale to" + top_delta="0" + width="186"> + For sale to: [BUYER] + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="Sell with landowners objects in parcel." + top_pad="4" + width="186"> + Objects included in sale. + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="Selling with no objects in parcel." + top_delta="0" + width="186"> + Objects not included in sale. + </text> + <button + follows="left|top" + height="20" + label="Cancel Land Sale" + label_selected="Cancel Land Sale" + layout="topleft" + left="295" + name="Cancel Land Sale" + top="228" + width="145" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="Claimed:" + top="268" + width="92"> + Claimed: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="92" + name="DateClaimText" + top_delta="0" + width="186"> + Tue Aug 15 13:47:25 2006 + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="PriceLabel" + top="288" + width="92"> + Area: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="92" + name="PriceText" + top_delta="0" + width="186"> + 4048 sq.m. + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="Traffic:" + top="308" + width="92"> + Traffic: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="92" + name="DwellText" + top_delta="0" + width="186"> + 0 + </text> + <button + enabled="false" + follows="left|top" + height="20" + label="Buy Land..." + label_selected="Buy Land..." + layout="topleft" + left="155" + name="Buy Land..." + top="328" + width="100" /> + <button + enabled="false" + follows="left|top" + height="20" + label="Buy For Group..." + label_selected="Buy For Group..." + layout="topleft" + left="260" + name="Buy For Group..." + top="352" + width="180" /> + <button + enabled="false" + follows="left|top" + height="20" + label="Buy Pass..." + label_selected="Buy Pass..." + layout="topleft" + left_delta="-105" + name="Buy Pass..." + tool_tip="A pass gives you temporary access to this land." + top_delta="0" + width="100" /> + <button + follows="left|top" + height="20" + label="Abandon Land..." + label_selected="Abandon Land..." + layout="topleft" + left="260" + name="Abandon Land..." + top="328" + width="180" /> + <button + follows="left|top" + height="20" + label="Reclaim Land..." + label_selected="Reclaim Land..." + layout="topleft" + left_delta="0" + name="Reclaim Land..." + top_delta="-48" + width="180" /> + <button + enabled="false" + follows="left|top" + height="20" + label="Linden Sale..." + label_selected="Linden Sale..." + layout="topleft" + left_delta="0" + name="Linden Sale..." + tool_tip="Land must be owned, set content, and not already for auction." + top_pad="4" + width="180" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="380" + label="Covenant" + layout="topleft" + left_delta="-1" + name="land_covenant_panel" + top_delta="-47" + width="458"> + <panel.string + name="can_resell"> + Purchased land in this region may be resold. + </panel.string> + <panel.string + name="can_not_resell"> + Purchased land in this region may not be resold. + </panel.string> + <panel.string + name="can_change"> + Purchased land in this region may be joined or subdivided. + </panel.string> + <panel.string + name="can_not_change"> + Purchased land in this region may not be joined or subdivided. + </panel.string> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="5" + mouse_opaque="false" + name="estate_section_lbl" + top="0" + width="100"> + Estate: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="estate_name_lbl" + top="20" + width="100"> + Name: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="estate_name_text" + top_delta="0" + width="150"> + mainland + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="estate_owner_lbl" + top="40" + width="100"> + Owner: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="estate_owner_text" + top_delta="0" + width="150"> + (none) + </text> + <text_editor + type="string" + length="1" + enabled="false" + follows="left|top|right|bottom" + height="115" + layout="topleft" + left_delta="0" + max_length="65535" + name="covenant_editor" + top_delta="20" + width="330" + word_wrap="true"> + There is no Covenant provided for this Estate. + </text_editor> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="covenant_timestamp_text" + top_pad="55" + width="250"> + Last Modified Wed Dec 31 16:00:00 1969 + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="5" + mouse_opaque="false" + name="region_section_lbl" + top="250" + width="100"> + Region: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="region_name_lbl" + top="270" + width="100"> + Name: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="region_name_text" + top_delta="0" + width="150"> + leyla + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="region_landtype_lbl" + top="290" + width="100"> + Type: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="region_landtype_text" + top_delta="0" + width="150"> + Mainland / Homestead + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="region_maturity_lbl" + top="310" + width="100"> + Rating: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="region_maturity_text" + top_delta="0" + width="150"> + Adult + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="resellable_lbl" + top="330" + width="100"> + Resale: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="resellable_clause" + top_delta="0" + width="330"> + Land in this region may not be resold. + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="changeable_lbl" + top="350" + width="100"> + Subdivide: + </text> + <text + type="string" + length="1" + follows="left|top" + height="30" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="changeable_clause" + top_delta="0" + width="330"> + Land in this region may not be joined/subdivided. + </text> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="380" + label="Objects" + layout="topleft" + left_delta="0" + name="land_objects_panel" + top_delta="-47" + width="458"> + <panel.string + name="objects_available_text"> + [COUNT] out of [MAX] ([AVAILABLE] available) + </panel.string> + <panel.string + name="objects_deleted_text"> + [COUNT] out of [MAX] ([DELETED] will be deleted) + </panel.string> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="parcel_object_bonus" + top="4" + visible="false" + width="364"> + Region Object Bonus Factor: [BONUS] + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="Simulator primitive usage:" + top_pad="4" + width="364"> + Simulator primitive usage: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="152" + name="objects_available" + top_delta="0" + width="212"> + [COUNT] out of [MAX] ([AVAILABLE] available) + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="Primitives parcel supports:" + top="44" + width="152"> + Primitives parcel supports: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="152" + name="object_contrib_text" + top_delta="0" + width="212"> + [COUNT] + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="Primitives on parcel:" + top="64" + width="152"> + Primitives on parcel: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="152" + name="total_objects_text" + top_delta="0" + width="48"> + [COUNT] + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="28" + name="Owned by parcel owner:" + top="84" + width="128"> + Owned by parcel owner: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="128" + name="owner_objects_text" + top_delta="0" + width="48"> + [COUNT] + </text> + <button + bottom="100" + enabled="false" + follows="left|top" + font="SansSerifSmall" + height="16" + label="Show" + label_selected="Show" + layout="topleft" + name="ShowOwner" + right="-190" + width="60" /> + <button + bottom="100" + enabled="false" + follows="left|top" + font="SansSerifSmall" + height="16" + label="Return..." + label_selected="Return..." + layout="topleft" + name="ReturnOwner..." + right="-60" + tool_tip="Return objects to their owners." + width="119" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="28" + name="Set to group:" + top="104" + width="128"> + Set to group: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="128" + name="group_objects_text" + top_delta="0" + width="48"> + [COUNT] + </text> + <button + bottom="120" + enabled="false" + follows="left|top" + font="SansSerifSmall" + height="16" + label="Show" + label_selected="Show" + layout="topleft" + name="ShowGroup" + right="-190" + width="60" /> + <button + bottom="120" + enabled="false" + follows="left|top" + font="SansSerifSmall" + height="16" + label="Return..." + label_selected="Return..." + layout="topleft" + name="ReturnGroup..." + right="-60" + tool_tip="Return objects to their owners." + width="119" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="28" + name="Owned by others:" + top="124" + width="128"> + Owned by others: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="128" + name="other_objects_text" + top_delta="0" + width="48"> + [COUNT] + </text> + <button + bottom="140" + enabled="false" + follows="left|top" + font="SansSerifSmall" + height="16" + label="Show" + label_selected="Show" + layout="topleft" + name="ShowOther" + right="-190" + width="60" /> + <button + bottom="140" + enabled="false" + follows="left|top" + font="SansSerifSmall" + height="16" + label="Return..." + label_selected="Return..." + layout="topleft" + name="ReturnOther..." + right="-60" + tool_tip="Return objects to their owners." + width="119" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="28" + name="Selected / sat upon:" + top="144" + width="128"> + Selected / sat upon: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="128" + name="selected_objects_text" + top_delta="0" + width="48"> + [COUNT] + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="Autoreturn" + top="164" + width="294"> + Autoreturn other residents' objects (minutes, 0 for off): + </text> + <line_editor + border_style="line" + border_thickness="1" + bottom="180" + follows="left|top" + height="16" + layout="topleft" + max_length="6" + name="clean other time" + right="-100" + width="56" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="Object Owners:" + top="184" + width="104"> + Object Owners: + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Refresh List" + label_selected="Refresh List" + layout="topleft" + left_delta="104" + name="Refresh List" + top_delta="0" + width="106" /> + <button + enabled="false" + follows="left|top" + font="SansSerifSmall" + height="16" + label="Return objects..." + label_selected="Return objects..." + layout="topleft" + left_pad="6" + name="Return objects..." + top_delta="0" + width="164" /> + <name_list + column_padding="0" + draw_heading="true" + follows="left|top|right|bottom" + height="165" + layout="topleft" + left="4" + name="owner list" + name_column="name" + top="210" + width="450"> + <name_list.columns + label="Type" + name="type" + sort_column="online_status" + width="24" /> + <name_list.columns + name="online_status" + width="-1" /> + <name_list.columns + dynamicwidth="true" + label="Name" + name="name" /> + <name_list.columns + label="Count" + name="count" + width="70" /> + <name_list.columns + label="Most Recent" + name="mostrecent" + width="160" /> + </name_list> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="333" + label="Options" + layout="topleft" + left_delta="0" + name="land_options_panel" + top_delta="31" + width="458"> + <panel.string + name="search_enabled_tooltip"> + Let people see this parcel in search results + </panel.string> + <panel.string + name="search_disabled_small_tooltip"> + This option is disabled because this parcel's area is 128 sq.m. or smaller. +Only large parcels can be listed in search. + </panel.string> + <panel.string + name="search_disabled_permissions_tooltip"> + This option is disabled because you cannot modify this parcel's options. + </panel.string> + <panel.string + name="mature_check_mature"> + Mature Content + </panel.string> + <panel.string + name="mature_check_adult"> + Adult Content + </panel.string> + <panel.string + name="mature_check_mature_tooltip"> + Your parcel information or content is considered mature. + </panel.string> + <panel.string + name="mature_check_adult_tooltip"> + Your parcel information or content is considered adult. + </panel.string> + <panel.string + name="landing_point_none"> + (none) + </panel.string> + <panel.string + name="push_restrict_text"> + No Pushing + </panel.string> + <panel.string + name="push_restrict_region_text"> + No Pushing (Region Override) + </panel.string> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="allow_label" + top="4" + width="278"> + Allow other residents to: + </text> + <check_box + height="16" + label="Edit Terrain" + layout="topleft" + left="14" + name="edit land check" + tool_tip="If checked, anyone can terraform your land. It is best to leave this unchecked, as you can always edit your own land." + top="24" + width="268" /> + <check_box + height="16" + label="Create Landmarks" + layout="topleft" + left_delta="0" + name="check landmark" + top_pad="4" + width="268" /> + <check_box + height="16" + label="Fly" + layout="topleft" + left_delta="0" + name="check fly" + tool_tip="If checked, Residents can fly on your land. If unchecked, they can only fly into and over your land." + top_pad="4" + width="268" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="178" + name="allow_label2" + top="24" + width="104"> + Create Objects: + </text> + <check_box + height="16" + label="All Residents" + layout="topleft" + left_delta="92" + name="edit objects check" + top_delta="0" + width="104" /> + <check_box + height="16" + label="Group" + layout="topleft" + left_delta="100" + name="edit group objects check" + top_delta="0" + width="70" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="178" + name="allow_label3" + top="44" + width="124"> + Object Entry: + </text> + <check_box + height="16" + label="All Residents" + layout="topleft" + left_delta="92" + name="all object entry check" + top_delta="0" + width="120" /> + <check_box + height="16" + label="Group" + layout="topleft" + left_delta="100" + name="group object entry check" + top_delta="0" + width="70" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="178" + name="allow_label4" + top="64" + width="124"> + Run Scripts: + </text> + <check_box + height="16" + label="All Residents" + layout="topleft" + left_delta="92" + name="check other scripts" + top_delta="0" + width="120" /> + <check_box + height="16" + label="Group" + layout="topleft" + left_delta="100" + name="check group scripts" + top_delta="0" + width="70" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="land_options_label" + top="84" + width="278"> + Land Options: + </text> + <check_box + height="16" + label="Safe (no damage)" + layout="topleft" + left="14" + name="check safe" + tool_tip="If checked, sets the land to Safe, disabling damage combat. If cleared, damage combat is enabled." + top="104" + width="268" /> + <check_box + height="16" + label="No Pushing" + layout="topleft" + left_delta="164" + name="PushRestrictCheck" + tool_tip="Prevents scripts from pushing. Checking this option may be useful for preventing disruptive behavior on your land." + top_delta="0" + width="119" /> + <check_box + height="16" + label="Show Place in Search (L$30/week) under" + layout="topleft" + left="14" + name="ShowDirectoryCheck" + tool_tip="Let people see this parcel in search results" + top="124" + width="268" /> + <combo_box + enabled="false" + height="18" + layout="topleft" + left_delta="241" + name="land category with adult" + top_delta="-2" + visible="false" + width="130"> + <combo_box.item + label="Any Category" + value="any" /> + <combo_box.item + label="Linden Location" + value="linden" /> + <combo_box.item + label="Adult" + value="adult" /> + <combo_box.item + label="Arts & Culture" + value="arts" /> + <combo_box.item + label="Business" + value="store" /> + <combo_box.item + label="Educational" + value="educational" /> + <combo_box.item + label="Gaming" + value="game" /> + <combo_box.item + label="Hangout" + value="gather" /> + <combo_box.item + label="Newcomer Friendly" + value="newcomer" /> + <combo_box.item + label="Parks & Nature" + value="park" /> + <combo_box.item + label="Residential" + value="home" /> + <combo_box.item + label="Shopping" + value="shopping" /> + <combo_box.item + label="Other" + value="other" /> + </combo_box> + <combo_box + enabled="false" + height="18" + layout="topleft" + left_delta="0" + name="land category" + top_delta="0" + visible="false" + width="130"> + <combo_box.item + label="Any Category" + value="any" /> + <combo_box.item + label="Linden Location" + value="linden" /> + <combo_box.item + label="Arts & Culture" + value="arts" /> + <combo_box.item + label="Business" + value="store" /> + <combo_box.item + label="Educational" + value="educational" /> + <combo_box.item + label="Gaming" + value="game" /> + <combo_box.item + label="Hangout" + value="gather" /> + <combo_box.item + label="Newcomer Friendly" + value="newcomer" /> + <combo_box.item + label="Parks & Nature" + value="park" /> + <combo_box.item + label="Residential" + value="home" /> + <combo_box.item + label="Shopping" + value="shopping" /> + <combo_box.item + label="Other" + value="other" /> + </combo_box> + <button + follows="left|top" + height="18" + label="?" + label_selected="?" + layout="topleft" + left_pad="15" + name="?" + top_delta="0" + width="18" /> + <check_box + height="16" + label="Mature Content" + layout="topleft" + left="14" + name="MatureCheck" + tool_tip=" " + top="144" + width="107" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="Snapshot:" + top="164" + width="278"> + Snapshot: + </text> + <texture_picker + follows="left|top" + height="135" + layout="topleft" + left_delta="72" + name="snapshot_ctrl" + tool_tip="Click to choose a picture" + top_delta="0" + width="180" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="landing_point" + top="287" + width="278"> + Landing Point: [LANDING] + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Set" + label_selected="Set" + layout="topleft" + left_delta="232" + name="Set" + tool_tip="Sets the landing point where visitors arrive. Sets to your avatar's location inside this parcel." + top_delta="0" + width="50" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Clear" + label_selected="Clear" + layout="topleft" + left_pad="5" + name="Clear" + tool_tip="Clear the landing point." + top_delta="0" + width="50" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="Teleport Routing: " + top="307" + width="278"> + Teleport Routing: + </text> + <combo_box + height="18" + layout="topleft" + left_delta="116" + name="landing type" + tool_tip="Teleport Routing -- select how to handle teleports onto your land." + top_delta="0" + width="120"> + <combo_box.item + enabled="true" + label="Blocked" + value="Blocked" /> + <combo_box.item + enabled="true" + label="Landing Point" + value="Landing Point" /> + <combo_box.item + enabled="true" + label="Anywhere" + value="Anywhere" /> + </combo_box> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="363" + label="Media" + layout="topleft" + left_delta="0" + name="land_media_panel" + top_delta="1" + width="458"> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="with media:" + top="9" + width="65"> + Media Type: + </text> + <combo_box + height="18" + layout="topleft" + left_pad="5" + name="media type" + tool_tip="Specify if the URL is a movie, web page, or other media" + top_delta="-2" + width="120" /> + <text + follows="left|top" + height="16" + layout="topleft" + left_pad="10" + name="mime_type" + top_delta="2" + width="200" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="at URL:" + top="29" + width="65"> + Media URL: + </text> + <line_editor + bottom_delta="0" + follows="left|top" + height="16" + layout="topleft" + left="80" + max_length="255" + name="media_url" + right="-80" + select_on_focus="true" + text_readonly_color="0.576471 0.662745 0.835294 1" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Set..." + label_selected="Set..." + layout="topleft" + left_pad="8" + name="set_media_url" + top_delta="0" + width="60" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="Description:" + top="49" + width="364"> + Description: + </text> + <line_editor + border_style="line" + border_thickness="1" + bottom_delta="0" + follows="left|top" + height="16" + layout="topleft" + left="80" + max_length="255" + name="url_description" + right="-80" + select_on_focus="true" + tool_tip="Text displayed next to play/load button" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="Media texture:" + top="69" + width="364"> + Replace +Texture: + </text> + <texture_picker + allow_no_texture="true" + default_image_name="Default" + follows="left|top" + height="80" + layout="topleft" + left_delta="70" + name="media texture" + tool_tip="Click to choose a picture" + top_delta="0" + width="64" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="75" + name="replace_texture_help" + top="85" + width="270"> + (Objects using this texture will show the movie or +web page after you click the play arrow.) + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="Options:" + top="140" + width="292"> + Media +Options: + </text> + <check_box + height="16" + label="Auto scale" + layout="topleft" + left_delta="70" + name="media_auto_scale" + tool_tip="Checking this option will scale the content for this parcel automatically. It may be slightly slower and lower quality visually but no other texture scaling or alignment will be required." + top_delta="0" + width="200" /> + <check_box + height="16" + label="Loop Media" + layout="topleft" + left_delta="170" + name="media_loop" + tool_tip="Play media in a loop. When the media has finished playing, it will restart from the beginning." + top_delta="0" + width="200" /> + <check_box + height="16" + label="Hide Media URL" + layout="topleft" + left="80" + name="hide_media_url" + tool_tip="Checking this option will hide the media url to any non-authorized viewers of this parcel information. Note this is not available for HTML types." + top="160" + width="200" /> + <check_box + height="16" + label="Hide Music URL" + layout="topleft" + left_delta="170" + name="hide_music_url" + tool_tip="Checking this option will hide the music url to any non-authorized viewers of this parcel information" + top_delta="0" + width="200" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="85" + name="media_size" + tool_tip="Size to render Web media, leave 0 for default." + top="185" + width="85"> + Media size: + </text> + <spinner + decimal_digits="0" + enabled="false" + follows="left|top" + halign="right" + height="16" + increment="1" + initial_value="0" + layout="topleft" + left_delta="65" + max_val="1024" + name="media_size_width" + tool_tip="Size to render Web media, leave 0 for default." + top_delta="0" + width="64" /> + <spinner + decimal_digits="0" + enabled="false" + follows="left|top" + halign="right" + height="16" + increment="1" + initial_value="0" + layout="topleft" + left_pad="16" + max_val="1024" + name="media_size_height" + tool_tip="Size to render Web media, leave 0 for default." + top_delta="0" + width="64" /> + <text + type="string" + length="1" + bottom_delta="0" + follows="left|top" + height="16" + layout="topleft" + left_delta="70" + name="pixels" + right="-10"> + pixels + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="MusicURL:" + top="225" + width="364"> + Music URL: + </text> + <line_editor + border_style="line" + border_thickness="1" + bottom_delta="0" + follows="left|top" + height="16" + layout="topleft" + left="80" + max_length="255" + name="music_url" + right="-15" + select_on_focus="true" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="Sound:" + top="265" + width="364"> + Sound: + </text> + <check_box + height="16" + label="Restrict gesture and object sounds to this parcel" + layout="topleft" + left_delta="70" + name="check sound local" + top_delta="0" + width="292" /> + <button + follows="left|top" + height="18" + label="?" + label_selected="?" + layout="topleft" + left_delta="292" + name="?" + top_delta="-2" + width="18" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + mouse_opaque="false" + name="Voice settings:" + top="305" + width="364"> + Voice: + </text> + <check_box + height="54" + label="Enable Voice" + layout="topleft" + left="80" + name="parcel_enable_voice_channel" + top="267" + width="463" /> + <check_box + enabled="false" + height="54" + label="Enable Voice (established by the Estate)" + layout="topleft" + left_delta="0" + name="parcel_enable_voice_channel_is_estate_disabled" + top_delta="0" + width="463" /> + <check_box + height="54" + label="Restrict Voice to this parcel" + layout="topleft" + left="100" + name="parcel_enable_voice_channel_parcel" + top="287" + width="443" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="333" + label="Access" + layout="topleft" + left_delta="0" + name="land_access_panel" + top_delta="31" + width="458"> + <panel.string + name="estate_override"> + One or more of these options is set at the estate level + </panel.string> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="8" + name="Limit access to this parcel to:" + top="4" + width="278"> + Access To This Parcel + </text> + <check_box + follows="top|left" + height="16" + label="Allow Public Access" + layout="topleft" + left_delta="0" + name="public_access" + top_pad="5" + width="278" /> + <text + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left_delta="20" + name="Only Allow" + top="49" + width="278"> + Block Access By: + </text> + <check_box + follows="top|left" + height="16" + label="Residents who have not given payment info to Linden Lab" + layout="topleft" + left_delta="0" + name="limit_payment" + tool_tip="Ban unidentified residents." + top_pad="4" + width="278" /> + <check_box + follows="top|left" + height="16" + label="Residents who are not age verified adults" + layout="topleft" + left_delta="0" + name="limit_age_verified" + tool_tip="Ban residents who have not verified their age. See support.secondlife.com for more information." + top_pad="4" + width="278" /> + <check_box + height="16" + label="Allow Group Access: [GROUP]" + layout="topleft" + left="8" + name="GroupCheck" + tool_tip="Set group in the General tab." + top="109" + width="278" /> + <check_box + enabled="false" + height="16" + label="Sell passes to:" + layout="topleft" + left_delta="0" + name="PassCheck" + tool_tip="Allows temporary access to this parcel" + top_pad="4" + width="120" /> + <combo_box + height="16" + layout="topleft" + left_pad="22" + name="pass_combo" + top_delta="0" + width="100"> + <combo_box.item + label="Anyone" + value="anyone" /> + <combo_box.item + label="Group" + value="group" /> + </combo_box> + <spinner + enabled="false" + follows="left|top" + height="16" + increment="1" + initial_value="10" + label="Price in L$:" + label_width="120" + layout="topleft" + left="28" + max_val="500" + min_val="1" + name="PriceSpin" + top="149" + width="180" /> + <spinner + enabled="false" + follows="left|top" + height="16" + increment="0.25" + initial_value="1" + label="Hours of access:" + label_width="120" + layout="topleft" + left_delta="0" + max_val="24" + min_val="0.01" + name="HoursSpin" + top_pad="4" + width="180" /> + <text + type="string" + length="1" + follows="left|right|top" + height="16" + label="Always Allow" + layout="topleft" + left="20" + name="AllowedText" + top="204" + width="195"> + Allowed Residents + </text> + <name_list + column_padding="0" + follows="top|bottom" + heading_height="14" + height="80" + layout="topleft" + left_delta="0" + multi_select="true" + name="AccessList" + tool_tip="([LISTED] listed, [MAX] max)" + top_pad="4" + width="195" /> + <button + follows="bottom" + font="SansSerifSmall" + height="16" + label="Add..." + label_selected="Add..." + layout="topleft" + left_delta="5" + name="add_allowed" + top="308" + width="80" /> + <button + follows="bottom" + font="SansSerifSmall" + height="16" + label="Remove" + label_selected="Remove" + layout="topleft" + left_pad="20" + name="remove_allowed" + top_delta="0" + width="80" /> + <text + type="string" + length="1" + follows="left|right|top" + height="16" + label="Ban" + layout="topleft" + left="240" + name="BanCheck" + top="204" + width="195"> + Banned Residents + </text> + <name_list + column_padding="0" + follows="top|bottom" + heading_height="14" + height="80" + layout="topleft" + left_delta="0" + multi_select="true" + name="BannedList" + tool_tip="([LISTED] listed, [MAX] max)" + top_pad="4" + width="195" /> + <button + follows="bottom" + font="SansSerifSmall" + height="16" + label="Add..." + label_selected="Add..." + layout="topleft" + left_delta="5" + name="add_banned" + top="308" + width="80" /> + <button + enabled="false" + follows="bottom" + font="SansSerifSmall" + height="16" + label="Remove" + label_selected="Remove" + layout="topleft" + left_pad="20" + name="remove_banned" + top_delta="0" + width="80" /> + </panel> + </tab_container> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_animation_preview.xml b/indra/newview/skins/default/xui/en/floater_animation_preview.xml new file mode 100644 index 0000000000000000000000000000000000000000..59d0d45425cb31f4b93fc52e55d23ed307c19ea1 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_animation_preview.xml @@ -0,0 +1,475 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + height="556" + layout="topleft" + name="Animation Preview" + width="300"> + <floater.string + name="failed_to_initialize"> + Failed to initialize motion + </floater.string> + <floater.string + name="anim_too_long"> + Animation file is [LENGTH] seconds in length. + +Maximum animation length is [MAX_LENGTH] seconds. + </floater.string> + <floater.string + name="failed_file_read"> + Unable to read animation file. + +[STATUS] + </floater.string> + <floater.string + name="E_ST_OK"> + Ok + </floater.string> + <floater.string + name="E_ST_EOF"> + Premature end of file. + </floater.string> + <floater.string + name="E_ST_NO_CONSTRAINT"> + Cannot read constraint definition. + </floater.string> + <floater.string + name="E_ST_NO_FILE"> + Cannot open BVH file. + </floater.string> + <floater.string + name="E_ST_NO_HIER"> + Invalid HIERARCHY header. + </floater.string> + <floater.string + name="E_ST_NO_JOINT"> + Cannot find ROOT or JOINT. + </floater.string> + <floater.string + name="E_ST_NO_NAME"> + Cannot get JOINT name. + </floater.string> + <floater.string + name="E_ST_NO_OFFSET"> + Cannot find OFFSET. + </floater.string> + <floater.string + name="E_ST_NO_CHANNELS"> + Cannot find CHANNELS. + </floater.string> + <floater.string + name="E_ST_NO_ROTATION"> + Cannot get rotation order. + </floater.string> + <floater.string + name="E_ST_NO_AXIS"> + Cannot get rotation axis. + </floater.string> + <floater.string + name="E_ST_NO_MOTION"> + Cannot find MOTION. + </floater.string> + <floater.string + name="E_ST_NO_FRAMES"> + Cannot get number of frames. + </floater.string> + <floater.string + name="E_ST_NO_FRAME_TIME"> + Cannot get frame time. + </floater.string> + <floater.string + name="E_ST_NO_POS"> + Cannot get position values. + </floater.string> + <floater.string + name="E_ST_NO_ROT"> + Cannot get rotation values. + </floater.string> + <floater.string + name="E_ST_NO_XLT_FILE"> + Cannot open translation file. + </floater.string> + <floater.string + name="E_ST_NO_XLT_HEADER"> + Cannot read translation header. + </floater.string> + <floater.string + name="E_ST_NO_XLT_NAME"> + Cannot read translation names. + </floater.string> + <floater.string + name="E_ST_NO_XLT_IGNORE"> + Cannot read translation ignore value. + </floater.string> + <floater.string + name="E_ST_NO_XLT_RELATIVE"> + Cannot read translation relative value. + </floater.string> + <floater.string + name="E_ST_NO_XLT_OUTNAME"> + Cannot read translation outname value. + </floater.string> + <floater.string + name="E_ST_NO_XLT_MATRIX"> + Cannot read translation matrix. + </floater.string> + <floater.string + name="E_ST_NO_XLT_MERGECHILD"> + Cannot get mergechild name. + </floater.string> + <floater.string + name="E_ST_NO_XLT_MERGEPARENT"> + Cannot get mergeparent name. + </floater.string> + <floater.string + name="E_ST_NO_XLT_PRIORITY"> + Cannot get priority value. + </floater.string> + <floater.string + name="E_ST_NO_XLT_LOOP"> + Cannot get loop value. + </floater.string> + <floater.string + name="E_ST_NO_XLT_EASEIN"> + Cannot get easeIn values. + </floater.string> + <floater.string + name="E_ST_NO_XLT_EASEOUT"> + Cannot get easeOut values. + </floater.string> + <floater.string + name="E_ST_NO_XLT_HAND"> + Cannot get hand morph value. + </floater.string> + <floater.string + name="E_ST_NO_XLT_EMOTE"> + Cannot read emote name. + </floater.string> + <text + type="string" + length="1" + bottom="42" + follows="top|left" + height="15" + layout="topleft" + left="10" + name="name_label"> + Name: + </text> + <line_editor + bottom_delta="2" + follows="top|left|right" + height="19" + layout="topleft" + left="85" + name="name_form" + right="-10" /> + <text + type="string" + length="1" + bottom_delta="22" + follows="top|left" + height="15" + layout="topleft" + left="10" + name="description_label"> + Description: + </text> + <line_editor + bottom_delta="2" + follows="top|left|right" + height="19" + layout="topleft" + left="85" + name="description_form" + right="-10" /> + <spinner + decimal_digits="0" + follows="left|top" + height="18" + increment="1" + initial_value="0" + label="Priority" + label_width="50" + layout="topleft" + left="10" + max_val="4" + name="priority" + tool_tip="Controls which other animations can be overridden by this animation." + width="90" /> + <check_box + bottom_delta="23" + height="18" + label="Loop" + layout="topleft" + left="10" + name="loop_check" + tool_tip="Makes this animation loop." /> + <spinner + follows="left|top" + height="18" + increment="1" + initial_value="0" + label="In(%)" + label_width="30" + layout="topleft" + left_delta="70" + max_val="100" + name="loop_in_point" + tool_tip="Sets point in animation that looping returns to." + top_delta="2" + width="90" /> + <spinner + bottom_delta="0" + follows="left|top" + height="18" + increment="1" + initial_value="0" + label="Out(%)" + layout="topleft" + left="185" + max_val="100" + name="loop_out_point" + tool_tip="Sets point in animation that ends a loop." /> + <text + type="string" + length="1" + bottom_delta="20" + follows="top|left" + height="15" + layout="topleft" + left="10" + name="hand_label"> + Hand Pose + </text> + <combo_box + height="18" + layout="topleft" + left_delta="76" + name="hand_pose_combo" + tool_tip="Controls what hands do during animation." + top_delta="-1" + width="104"> + <combo_box.item + label="Spread" + value="" /> + <combo_box.item + label="Relaxed" + value="Hands_Relaxed" /> + <combo_box.item + label="Point Both" + value="Hands_Point" /> + <combo_box.item + label="Fist" + value="Hands_Fist" /> + <combo_box.item + label="Relaxed Left" + value="Hands_Relaxed_L" /> + <combo_box.item + label="Point Left" + value="Hands_Point_L" /> + <combo_box.item + label="Fist Left" + value="Hands_Fist_L" /> + <combo_box.item + label="Relaxed Right" + value="Hands_Relaxed_R" /> + <combo_box.item + label="Point Right" + value="Hands_Point_R" /> + <combo_box.item + label="Fist Right" + value="Hands_Fist_R" /> + <combo_box.item + label="Salute Right" + value="Hands_Salute_R" /> + <combo_box.item + label="Typing" + value="Hands_Typing" /> + <combo_box.item + label="Peace Right" + value="Hands_Peace_R" /> + </combo_box> + <text + type="string" + length="1" + bottom_delta="22" + follows="top|left" + height="15" + layout="topleft" + left="10" + name="emote_label"> + Expression + </text> + <combo_box + height="18" + layout="topleft" + left_delta="76" + name="emote_combo" + tool_tip="Controls what face does during animation." + top_delta="-1" + width="104"> + <combo_box.item + label="None]" /> + <combo_box.item + label="Aaaaah" /> + <combo_box.item + label="Afraid" /> + <combo_box.item + label="Angry" /> + <combo_box.item + label="Big Smile" /> + <combo_box.item + label="Bored" /> + <combo_box.item + label="Cry" /> + <combo_box.item + label="Disdain" /> + <combo_box.item + label="Embarrassed" /> + <combo_box.item + label="Frown" /> + <combo_box.item + label="Kiss" /> + <combo_box.item + label="Laugh" /> + <combo_box.item + label="Plllppt" /> + <combo_box.item + label="Repulsed" /> + <combo_box.item + label="Sad" /> + <combo_box.item + label="Shrug" /> + <combo_box.item + label="Smile" /> + <combo_box.item + label="Surprise" /> + <combo_box.item + label="Wink" /> + <combo_box.item + label="Worry" /> + </combo_box> + <text + type="string" + length="1" + follows="top|left" + height="15" + layout="topleft" + left="10" + name="preview_label" + top="167" + width="70"> + Preview while + </text> + <combo_box + height="18" + layout="topleft" + left_pad="6" + name="preview_base_anim" + tool_tip="Use this to test your animation behavior while your avatar performs common actions." + top_delta="-1" + width="104"> + <combo_box.item + label="Standing" /> + <combo_box.item + label="Walking" /> + <combo_box.item + label="Sitting" /> + <combo_box.item + label="Flying" /> + </combo_box> + <spinner + follows="left|top" + height="18" + increment="0.01" + initial_value="0" + label="Ease In (sec)" + label_width="65" + layout="topleft" + left="10" + max_val="10" + name="ease_in_time" + tool_tip="Amount of time (in seconds) over which animations blends in." + top="191" + width="125" /> + <spinner + follows="left|top" + height="18" + increment="0.01" + initial_value="0" + label="Ease Out (sec)" + label_width="75" + layout="topleft" + left_pad="15" + max_val="10" + name="ease_out_time" + tool_tip="Amount of time (in seconds) over which animations blends out." + top_delta="0" + width="135" /> + <button + follows="top|right" + height="28" + image_selected="button_anim_play_selected.tga" + image_unselected="button_anim_play.tga" + layout="topleft" + left="10" + name="play_btn" + picture_style="true" + tool_tip="Play/pause your animation." + top="223" + width="28" /> + <button + follows="top|right" + height="28" + image_selected="button_anim_stop_selected.tga" + image_unselected="button_anim_stop.tga" + layout="topleft" + left_pad="4" + name="stop_btn" + picture_style="true" + tool_tip="Stop animation playback" + top_delta="0" + width="28" /> + <slider + bottom_delta="0" + follows="top|right" + height="20" + increment="0.0001" + initial_value="0" + layout="topleft" + left="80" + name="playback_slider" + right="290" + show_text="false" /> + <text + type="string" + length="1" + bottom="306" + follows="top|left" + layout="topleft" + left="10" + name="bad_animation_text"> + Unable to read animation file. + +We recommend BVH files exported from Poser 4. + </text> + <button + bottom="546" + follows="bottom|right" + height="20" + label="Cancel" + layout="topleft" + name="cancel_btn" + right="290" + width="123" /> + <button + follows="bottom|left" + height="20" + label="Upload (L$[AMOUNT])" + layout="topleft" + left_delta="-129" + name="ok_btn" + top_delta="0" + width="123" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_auction.xml b/indra/newview/skins/default/xui/en/floater_auction.xml new file mode 100644 index 0000000000000000000000000000000000000000..21d060fdda6eb88472d4872d30ab32e8a597f932 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_auction.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="368" + layout="topleft" + min_height="368" + min_width="420" + name="floater_auction" + title="Start Linden Land Sale" + width="420"> + <floater.string + name="already for sale"> + You cannot auction parcels which are already for sale. + </floater.string> + <icon + bottom="280" + follows="left|right|top|bottom" + layout="topleft" + left="4" + name="snapshot_icon" + right="-4" + top="24" /> + <text + follows="left|right|bottom" + height="16" + layout="topleft" + left_delta="0" + name="parcel_text" + top_pad="12" + width="400" /> + <check_box + follows="left|bottom" + height="16" + initial_value="true" + label="Include yellow selection fence" + layout="topleft" + left_delta="0" + name="fence_check" + top_pad="12" + width="199" /> + <button + follows="left|bottom" + height="20" + label="Snapshot" + label_selected="Snapshot" + layout="topleft" + left_delta="0" + name="snapshot_btn" + top_pad="4" + width="96" /> + <button + follows="left|bottom" + height="20" + label="OK" + label_selected="OK" + layout="topleft" + left_pad="4" + name="ok_btn" + top_delta="0" + width="48" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml new file mode 100644 index 0000000000000000000000000000000000000000..0e2904650022ef6fcc9aa10da44da782cea8f2bc --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml @@ -0,0 +1,208 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="350" + layout="topleft" + min_height="200" + min_width="265" + name="avatarpicker" + title="Choose Resident" + width="265"> + <floater.string + name="not_found"> + '[TEXT]' not found + </floater.string> + <floater.string + name="no_one_near"> + No-one near + </floater.string> + <floater.string + name="no_results"> + No results + </floater.string> + <floater.string + name="searching"> + Searching... + </floater.string> + <tab_container + follows="left|right|top|bottom" + height="300" + layout="topleft" + left="4" + name="ResidentChooserTabs" + tab_position="top" + tab_width="65" + top="20" + width="255"> + <panel + border="true" + height="150" + label="Search" + layout="topleft" + left="6" + name="SearchPanel" + top="150" + width="134"> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="InstructSearchResidentName" + top="8" + width="220"> + Type part of the resident's name: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + height="16" + layout="topleft" + left_delta="0" + name="Edit" + top_pad="4" + width="132" /> + <button + follows="top|right" + height="20" + label="Find" + label_selected="Find" + layout="topleft" + left_pad="30" + name="Find" + top_delta="-1" + width="95" /> + <scroll_list + follows="left|top|right|bottom" + height="90" + layout="topleft" + left="10" + name="SearchResults" + top="52" + width="115" /> + </panel> + <panel + border="true" + height="150" + label="Calling Cards" + layout="topleft" + left_delta="-1" + name="CallingCardsPanel" + top_delta="134" + width="135"> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="InstructSelectCallingCard" + top="8" + width="220"> + Select a calling card: + </text> + <inventory_panel + allow_multi_select="false" + border="true" + follows="left|top|right|bottom" + height="110" + layout="topleft" + left_delta="0" + name="InventoryPanel" + top_pad="7" + width="115" /> + </panel> + <panel + border="true" + height="240" + label="Near Me" + layout="topleft" + left="6" + name="NearMePanel" + top="60" + width="135"> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="InstructSelectResident" + top="8" + width="220"> + Select nearby resident: + </text> + <button + follows="top|right" + height="20" + label="Refresh List" + label_selected="Refresh List" + layout="topleft" + left_delta="25" + name="Refresh" + top_delta="-1" + width="90" /> + <slider + control_name="NearMeRange" + decimal_digits="0" + follows="left|top" + height="15" + increment="1" + initial_value="20" + label="Range" + layout="topleft" + left="10" + max_val="40" + min_val="5" + name="near_me_range" + top="32" + width="175" /> + <text + type="string" + length="1" + follows="left|top" + height="15" + layout="topleft" + left_delta="175" + name="meters" + top_delta="0" + width="40"> + Meters + </text> + <scroll_list + follows="left|top|right|bottom" + height="175" + layout="topleft" + left="10" + name="NearMe" + sort_column="0" + top="57" + width="115" /> + </panel> + </tab_container> + <button + follows="left|bottom" + height="20" + label="Select" + label_selected="Select" + layout="topleft" + left="10" + name="Select" + top="324" + width="95" /> + <button + follows="left|bottom" + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_pad="70" + name="Cancel" + top_delta="0" + width="95" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_avatar_textures.xml b/indra/newview/skins/default/xui/en/floater_avatar_textures.xml new file mode 100644 index 0000000000000000000000000000000000000000..9e2c8a44d1693ee340900e5a54cf769db8469544 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_avatar_textures.xml @@ -0,0 +1,211 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="950" + layout="topleft" + name="avatar_texture_debug" + title="Avatar Textures" + width="960"> + <floater.string + name="InvalidAvatar"> + INVALID AVATAR + </floater.string> + <text + type="string" + length="1" + height="16" + layout="topleft" + left="10" + name="label" + top="24" + width="80"> + Baked Textures + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_pad="60" + name="composite_label" + top_delta="0" + width="120"> + Composite Textures + </text> + <button + height="20" + label="Dump IDs to Console" + label_selected="Dump" + layout="topleft" + left_pad="530" + name="Dump" + top_delta="1" + width="150" /> + <texture_picker + height="143" + label="Hair" + layout="topleft" + left="10" + name="hair-baked" + top="47" + width="128" /> + <texture_picker + height="143" + label="Hair" + layout="topleft" + left_pad="7" + name="hair" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Head" + layout="topleft" + left="10" + name="head-baked" + top="197" + width="128" /> + <texture_picker + height="143" + label="Makeup" + layout="topleft" + left_pad="7" + name="head bodypaint" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Eyes" + layout="topleft" + left="10" + name="eyes-baked" + top="347" + width="128" /> + <texture_picker + height="143" + label="Eye" + layout="topleft" + left_pad="7" + name="iris" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Upper Body" + layout="topleft" + left="10" + name="upper-baked" + top="497" + width="128" /> + <texture_picker + height="143" + label="Upper Body Tattoo" + layout="topleft" + left_pad="7" + name="upper bodypaint" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Undershirt" + layout="topleft" + left_pad="7" + name="undershirt" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Gloves" + layout="topleft" + left_pad="7" + name="gloves" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Shirt" + layout="topleft" + left_pad="7" + name="shirt" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Upper Jacket" + layout="topleft" + left_pad="7" + name="upper jacket" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Lower Body" + layout="topleft" + left="10" + name="lower-baked" + top="647" + width="128" /> + <texture_picker + height="143" + label="Lower Body Tattoo" + layout="topleft" + left_pad="7" + name="lower bodypaint" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Underpants" + layout="topleft" + left_pad="7" + name="underpants" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Socks" + layout="topleft" + left_pad="7" + name="socks" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Shoes" + layout="topleft" + left_pad="7" + name="shoes" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Pants" + layout="topleft" + left_pad="7" + name="pants" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Jacket" + layout="topleft" + left_pad="7" + name="lower jacket" + top_delta="0" + width="128" /> + <texture_picker + height="143" + label="Skirt" + layout="topleft" + left="10" + name="skirt-baked" + top="797" + width="128" /> + <texture_picker + height="143" + label="Skirt" + layout="topleft" + left_pad="7" + name="skirt" + top_delta="0" + width="128" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_beacons.xml b/indra/newview/skins/default/xui/en/floater_beacons.xml new file mode 100644 index 0000000000000000000000000000000000000000..41ddec639578e7f31379cf3bd4792d3a93056790 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_beacons.xml @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + control_name="BeaconAlwaysOn" + height="225" + layout="topleft" + name="beacons" + save_rect="true" + title="Beacons" + width="250"> + <panel + follows="left|top|right|bottom" + height="200" + layout="topleft" + left="10" + name="beacons_panel" + top="15" + width="230"> + <check_box + bottom_delta="33" + control_name="scripttouchbeacon" + label="Scripted Objects with Touch Only" + layout="topleft" + name="touch_only" /> + <check_box + bottom_delta="20" + control_name="scriptsbeacon" + label="Scripted Objects" + layout="topleft" + name="scripted" /> + <check_box + bottom_delta="20" + control_name="physicalbeacon" + label="Physical Objects" + layout="topleft" + name="physical" /> + <check_box + bottom_delta="20" + control_name="soundsbeacon" + label="Sound Sources" + layout="topleft" + name="sounds" /> + <check_box + bottom_delta="20" + control_name="particlesbeacon" + label="Particle Sources" + layout="topleft" + name="particles" /> + <check_box + bottom_delta="20" + control_name="renderhighlights" + label="Render Highlights" + layout="topleft" + name="highlights" /> + <check_box + bottom_delta="20" + control_name="renderbeacons" + label="Render Beacons" + layout="topleft" + name="beacons" /> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="5" + name="beacon_width_label" + top="171" + width="128"> + Beacon Width: + </text> + <slider + control_name="DebugBeaconLineWidth" + decimal_digits="0" + height="16" + increment="1" + initial_value="1" + layout="topleft" + left="30" + max_val="16" + min_val="1" + name="beacon_width" + top="187" + width="185" /> + </panel> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_build_options.xml b/indra/newview/skins/default/xui/en/floater_build_options.xml new file mode 100644 index 0000000000000000000000000000000000000000..af5c006779d3c71b6f7c70efe57d0c280bc9c708 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_build_options.xml @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + follows="right" + height="151" + layout="topleft" + name="build options floater" + save_rect="true" + title="Grid Options" + width="272"> + <spinner + control_name="GridResolution" + follows="left|top" + height="16" + initial_value="1" + label="Grid Unit (meters)" + label_width="110" + layout="topleft" + left="14" + max_val="5" + min_val="0.01" + name="GridResolution" + top="37" + width="170" /> + <spinner + control_name="GridDrawSize" + decimal_digits="1" + follows="left|top" + height="16" + increment="0.5" + initial_value="5" + label="Grid Extents (meters)" + label_width="110" + layout="topleft" + left_delta="0" + max_val="50" + min_val="1" + name="GridDrawSize" + top_pad="5" + width="170" /> + <check_box + control_name="GridSubUnit" + height="16" + label="Enable Sub-Unit Snapping" + layout="topleft" + left_delta="0" + name="GridSubUnit" + top_pad="5" + width="200" /> + <check_box + control_name="GridCrossSections" + height="16" + label="Show Cross Sections" + layout="topleft" + left_delta="0" + name="GridCrossSection" + top_pad="5" + width="200" /> + <slider + control_name="GridOpacity" + follows="left" + height="16" + increment="0.05" + initial_value="0.7" + label="Grid Opacity" + layout="topleft" + left_delta="0" + name="GridOpacity" + show_text="false" + top_pad="5" + width="200" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_bulk_perms.xml b/indra/newview/skins/default/xui/en/floater_bulk_perms.xml new file mode 100644 index 0000000000000000000000000000000000000000..cf75da078ea4c505ff05ca7c762136c61b8f5a42 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_bulk_perms.xml @@ -0,0 +1,337 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_tear_off="false" + height="340" + layout="topleft" + name="floaterbulkperms" + title="Bulk change content permissions" + width="480"> + <floater.string + name="nothing_to_modify_text"> + Selection contains no editable contents. + </floater.string> + <floater.string + name="status_text"> + Setting permissions on [NAME] + </floater.string> + <floater.string + name="start_text"> + Starting permission change requests... + </floater.string> + <floater.string + name="done_text"> + Finished permission change requests. + </floater.string> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="10" + layout="topleft" + left="10" + name="applyto" + top="30" + width="206"> + Content Types + </text> + <icon + height="16" + image_name="inv_item_animation.tga" + layout="topleft" + left_delta="2" + mouse_opaque="true" + name="icon_animation" + top_pad="14" + width="16" /> + <check_box + control_name="BulkChangeIncludeAnimations" + height="16" + label="Animation" + layout="topleft" + left_pad="2" + name="check_animation" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_folder_bodypart.tga" + layout="topleft" + left="12" + mouse_opaque="true" + name="icon_bodypart" + top="74" + width="16" /> + <check_box + control_name="BulkChangeIncludeBodyParts" + height="16" + label="Body Parts" + layout="topleft" + left_pad="2" + name="check_bodypart" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_shirt.tga" + layout="topleft" + left="12" + mouse_opaque="true" + name="icon_clothing" + top="94" + width="16" /> + <check_box + control_name="BulkChangeIncludeClothing" + height="16" + label="Clothing" + layout="topleft" + left_pad="2" + name="check_clothing" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_gesture.tga" + layout="topleft" + left="12" + mouse_opaque="true" + name="icon_gesture" + top="114" + width="16" /> + <check_box + control_name="BulkChangeIncludeGestures" + height="16" + label="Gestures" + layout="topleft" + left_pad="2" + name="check_gesture" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_landmark_visited.tga" + layout="topleft" + left="12" + mouse_opaque="true" + name="icon_landmark" + top="134" + width="16" /> + <check_box + control_name="BulkChangeIncludeLandmarks" + height="16" + label="Landmarks" + layout="topleft" + left_pad="2" + name="check_landmark" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_notecard.tga" + layout="topleft" + left="12" + mouse_opaque="true" + name="icon_notecard" + top="154" + width="16" /> + <check_box + control_name="BulkChangeIncludeNotecards" + height="16" + label="Notecards" + layout="topleft" + left_pad="2" + name="check_notecard" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_object.tga" + layout="topleft" + left="12" + mouse_opaque="true" + name="icon_object" + top="174" + width="16" /> + <check_box + control_name="BulkChangeIncludeObjects" + height="16" + label="Objects" + layout="topleft" + left_pad="2" + name="check_object" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_script.tga" + layout="topleft" + left="12" + mouse_opaque="true" + name="icon_script" + top="194" + width="16" /> + <check_box + control_name="BulkChangeIncludeScripts" + height="16" + label="Scripts" + layout="topleft" + left_pad="2" + name="check_script" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_sound.tga" + layout="topleft" + left="12" + mouse_opaque="true" + name="icon_sound" + top="214" + width="16" /> + <check_box + control_name="BulkChangeIncludeSounds" + height="16" + label="Sounds" + layout="topleft" + left_pad="2" + name="check_sound" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_texture.tga" + layout="topleft" + left="12" + mouse_opaque="true" + name="icon_texture" + top="234" + width="16" /> + <check_box + control_name="BulkChangeIncludeTextures" + height="16" + label="Textures" + layout="topleft" + left_pad="2" + name="check_texture" + top_delta="0" + width="126" /> + <button + follows="left|top" + height="20" + label="Check All" + label_selected="All" + layout="topleft" + left="8" + name="check_all" + top="257" + width="100" /> + <button + follows="left|top" + height="20" + label="Uncheck All" + label_selected="None" + layout="topleft" + left_delta="0" + name="check_none" + top_pad="4" + width="100" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="10" + layout="topleft" + left="165" + name="newperms" + top="30" + width="206"> + New Permissions + </text> + <check_box + control_name="BulkChangeShareWithGroup" + height="16" + label="Share with group" + layout="topleft" + left="170" + name="share_with_group" + top="54" + width="106" /> + <check_box + control_name="BulkChangeEveryoneCopy" + height="16" + label="Allow anyone to copy" + layout="topleft" + left_delta="0" + name="everyone_copy" + top_pad="16" + width="130" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="NextOwnerLabel" + top_pad="16" + width="88"> + Next owner can: + </text> + <check_box + control_name="BulkChangeNextOwnerModify" + height="16" + label="Modify" + layout="topleft" + left_delta="0" + name="next_owner_modify" + top_pad="14" + width="78" /> + <check_box + control_name="BulkChangeNextOwnerCopy" + height="16" + label="Copy" + layout="topleft" + left_delta="78" + name="next_owner_copy" + top_delta="0" + width="88" /> + <check_box + control_name="BulkChangeNextOwnerTransfer" + enabled="false" + height="16" + initial_value="true" + label="Resell/Give away" + layout="topleft" + left_delta="88" + name="next_owner_transfer" + top_delta="0" + width="106" /> + <scroll_list + enabled="false" + follows="left|top|right|bottom" + height="130" + layout="topleft" + left="130" + name="queue output" + top="170" + width="335" /> + <button + follows="left|top" + height="20" + label="Apply" + layout="topleft" + left="265" + name="apply" + top="310" + width="100" /> + <button + follows="left|top" + height="20" + label="Close" + layout="topleft" + left_pad="5" + name="close" + top_delta="0" + width="100" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_bumps.xml b/indra/newview/skins/default/xui/en/floater_bumps.xml new file mode 100644 index 0000000000000000000000000000000000000000..4fb2fe24cc9f4cf2a12ad5cd1a30255ab3b08812 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_bumps.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="180" + layout="topleft" + name="floater_bumps" + save_rect="true" + title="Bumps, Pushes & Hits" + width="400"> + <floater.string + name="none_detected"> + None detected + </floater.string> + <floater.string + name="bump"> + [TIME] [FIRST] [LAST] bumped you + </floater.string> + <floater.string + name="llpushobject"> + [TIME] [FIRST] [LAST] pushed you with a script + </floater.string> + <floater.string + name="selected_object_collide"> + [TIME] [FIRST] [LAST] hit you with an object + </floater.string> + <floater.string + name="scripted_object_collide"> + [TIME] [FIRST] [LAST] hit you with a scripted object + </floater.string> + <floater.string + name="physical_object_collide"> + [TIME] [FIRST] [LAST] hit you with a physical object + </floater.string> + <floater.string + name="timeStr"> + [[hour,datetime,slt]:[min,datetime,slt]] + </floater.string> + <scroll_list + draw_border="false" + follows="left|top|right|bottom" + height="152" + layout="topleft" + left="6" + multi_select="true" + name="bump_list" + top="20" + width="388" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_buy_contents.xml b/indra/newview/skins/default/xui/en/floater_buy_contents.xml new file mode 100644 index 0000000000000000000000000000000000000000..174337480a04323991390aa88886987f18babecf --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_buy_contents.xml @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="250" + layout="topleft" + min_height="150" + min_width="200" + name="floater_buy_contents" + save_rect="true" + title="Buy Contents" + width="300"> + <floater.string + name="no_copy_text"> + (no copy) + </floater.string> + <floater.string + name="no_modify_text"> + (no modify) + </floater.string> + <floater.string + name="no_transfer_text"> + (no transfer) + </floater.string> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="15" + name="contains_text" + top="24" + width="281"> + [NAME] contains: + </text> + <scroll_list + follows="left|top|right|bottom" + height="148" + layout="topleft" + left_delta="0" + name="item_list" + top_pad="4" + width="281"> + <scroll_list.columns + name="icon" + width="16" /> + <scroll_list.columns + name="text" + relative_width="1" /> + </scroll_list> + <text + type="string" + length="1" + follows="left|right|bottom" + font="SansSerif" + height="24" + layout="topleft" + left_delta="0" + name="buy_text" + top_pad="4" + width="281"> + Buy for L$[AMOUNT] from [NAME]? + </text> + <button + follows="right|bottom" + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left="216" + name="cancel_btn" + top="224" + width="60" /> + <button + follows="right|bottom" + height="20" + label="Buy" + label_selected="Buy" + layout="topleft" + left_delta="-64" + name="buy_btn" + top_delta="0" + width="60" /> + <check_box + follows="left|bottom" + height="20" + label="Wear clothing now" + layout="topleft" + left_delta="-139" + name="wear_check" + top_delta="0" + width="135" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml new file mode 100644 index 0000000000000000000000000000000000000000..245d84fff401f84928c6495e240cff012f7e3e56 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml @@ -0,0 +1,294 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + height="270" + layout="topleft" + name="buy currency" + title="Buy Currency" + width="350"> + <floater.string + name="buy_currency"> + Buy L$ [LINDENS] for approx. US$ [USD] + </floater.string> + <text + type="string" + length="1" + bottom_delta="48" + follows="top|left" + font="SansSerifHuge" + height="24" + layout="topleft" + left="16" + name="info_buying" + right="-20"> + Buying Currency: + </text> + <text + type="string" + length="1" + bottom_delta="0" + follows="top|left" + font="SansSerifHuge" + height="24" + layout="topleft" + left="16" + name="info_cannot_buy" + right="-20"> + Cannot buy now: + </text> + <text + type="string" + length="1" + bottom_delta="0" + follows="top|left" + font="SansSerifHuge" + height="24" + layout="topleft" + left="16" + name="info_need_more" + right="-20"> + You need more currency: + </text> + <icon + follows="top|left" + height="64" + image_name="badge_note.j2c" + layout="topleft" + left="0" + name="step_error" + top="48" + width="64" /> + <text + type="string" + length="1" + bottom_delta="96" + follows="top|left" + height="140" + layout="topleft" + left="72" + name="error_message" + right="-20"> + Something ain't right. + </text> + <button + follows="bottom|left" + height="20" + label="Go to website" + layout="topleft" + left_delta="0" + name="error_web" + top_delta="124" + width="120" /> + <icon + follows="top|left" + height="64" + image_name="badge_note.j2c" + layout="topleft" + left="0" + name="step_1" + top="48" + width="64" /> + <text + type="string" + length="1" + bottom_delta="-38" + follows="top|left" + height="16" + layout="topleft" + left="72" + name="contacting" + right="-20"> + Contacting LindeX... + </text> + <text + type="string" + length="1" + bottom_delta="0" + follows="top|left" + height="16" + layout="topleft" + left="72" + name="buy_action_unknown" + right="-20"> + Buy L$ on the LindeX currency exchange + </text> + <text + type="string" + length="1" + bottom_delta="0" + follows="top|left" + height="16" + layout="topleft" + left="72" + name="buy_action" + right="-20"> + [NAME] L$ [PRICE] + </text> + <text + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left_delta="0" + name="currency_action" + top_pad="4" + width="40"> + Buy L$ + </text> + <line_editor + type="string" + length="1" + follows="top|right" + height="16" + layout="topleft" + left_pad="5" + name="currency_amt" + top_delta="0" + width="80"> + 1234 + </line_editor> + <text + type="string" + length="1" + follows="top|right" + height="16" + layout="topleft" + left_pad="5" + name="currency_est" + top_delta="0" + width="180"> + for approx. US$ [USD,number,2] + </text> + <text + type="string" + length="1" + follows="top|right" + height="16" + layout="topleft" + left_delta="5" + name="getting_data" + top_delta="0" + width="180"> + Getting data... + </text> + <text + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left="80" + name="balance_label" + top="110" + width="240"> + You currently have + </text> + <text + type="string" + length="1" + follows="top|left" + halign="right" + height="16" + layout="topleft" + left_delta="0" + name="balance_amount" + top_delta="0" + width="240"> + L$ [AMT] + </text> + <text + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left_delta="0" + name="buying_label" + top_pad="4" + width="240"> + You are buying + </text> + <text + type="string" + length="1" + follows="top|left" + halign="right" + height="16" + layout="topleft" + left_delta="0" + name="buying_amount" + top_delta="0" + width="240"> + L$ [AMT] + </text> + <text + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left_delta="0" + name="total_label" + top_pad="4" + width="240"> + Your balance will be + </text> + <text + type="string" + length="1" + follows="top|left" + halign="right" + height="16" + layout="topleft" + left_delta="0" + name="total_amount" + top_delta="0" + width="240"> + L$ [AMT] + </text> + <text + type="string" + length="1" + bottom_delta="48" + follows="top|left" + height="32" + layout="topleft" + left="72" + name="purchase_warning_repurchase" + right="-20"> + Confirming this purchase only buys the currency. +You'll need to try the operation again. + </text> + <text + type="string" + length="1" + bottom_delta="0" + follows="top|left" + height="32" + layout="topleft" + left="72" + name="purchase_warning_notenough" + right="-20"> + You aren't buying enough currency +Increase the amount to buy. + </text> + <button + follows="bottom|right" + height="20" + label="Cancel" + layout="topleft" + left="237" + name="cancel_btn" + top="234" + width="90" /> + <button + follows="bottom|left" + height="20" + label="Purchase" + layout="topleft" + left_delta="-96" + name="buy_btn" + top_delta="0" + width="90" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_buy_land.xml b/indra/newview/skins/default/xui/en/floater_buy_land.xml new file mode 100644 index 0000000000000000000000000000000000000000..e11534cc132c4eaeb87a6b66107362e4a05dfd8a --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_buy_land.xml @@ -0,0 +1,696 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + height="484" + layout="topleft" + name="buy land" + title="Buy Land" + width="740"> + <floater.string + name="can_resell"> + May be resold. + </floater.string> + <floater.string + name="can_not_resell"> + May not be resold. + </floater.string> + <floater.string + name="can_change"> + May be joined or subdivided. + </floater.string> + <floater.string + name="can_not_change"> + May not be joined or subdivided. + </floater.string> + <floater.string + name="cant_buy_for_group"> + You do not have permission to buy land for your active group. + </floater.string> + <floater.string + name="no_land_selected"> + No land selected. + </floater.string> + <floater.string + name="multiple_parcels_selected"> + Multiple different parcels selected. +Try selecting a smaller area. + </floater.string> + <floater.string + name="no_permission"> + You do not have permission to buy land for your active group. + </floater.string> + <floater.string + name="parcel_not_for_sale"> + The selected parcel is not for sale. + </floater.string> + <floater.string + name="group_already_owns"> + The group already owns the parcel. + </floater.string> + <floater.string + name="you_already_own"> + You already own the parcel. + </floater.string> + <floater.string + name="set_to_sell_to_other"> + The selected parcel is set to sell to another party. + </floater.string> + <floater.string + name="no_public_land"> + The selected area has no public land. + </floater.string> + <floater.string + name="not_owned_by_you"> + Land owned by another user is selected. +Try selecting a smaller area. + </floater.string> + <floater.string + name="processing"> + Processing your purchase... + +(This may take a minute or two.) + </floater.string> + <floater.string + name="fetching_error"> + There has been an error while fetching land buying information. + </floater.string> + <floater.string + name="buying_will"> + Buying this land will: + </floater.string> + <floater.string + name="buying_for_group"> + Buying land for group will: + </floater.string> + <floater.string + name="cannot_buy_now"> + Cannot buy now: + </floater.string> + <floater.string + name="not_for_sale"> + Not for sale: + </floater.string> + <floater.string + name="none_needed"> + none needed + </floater.string> + <floater.string + name="must_upgrade"> + Your account must be upgraded to own land. + </floater.string> + <floater.string + name="cant_own_land"> + Your account can own land. + </floater.string> + <floater.string + name="land_holdings"> + You hold [BUYER] sq.m. of land. + </floater.string> + <floater.string + name="pay_to_for_land"> + Pay L$ [AMOUNT] to [SELLER] for this land + </floater.string> + <floater.string + name="buy_for_US"> + Buy L$ [AMOUNT] for approx. US$ [AMOUNT2], + </floater.string> + <floater.string + name="parcel_meters"> + This parcel is [AMOUNT] sq.m. + </floater.string> + <floater.string + name="premium_land"> + This land is premium, and will charge as [AMOUNT] sq.m. + </floater.string> + <floater.string + name="discounted_land"> + This land is discounted, and will charge as [AMOUNT] sq.m. + </floater.string> + <floater.string + name="meters_supports_object"> + [AMOUNT] sq.m. +supports [AMOUNT2] objects + </floater.string> + <floater.string + name="sold_with_objects"> + sold with objects + </floater.string> + <floater.string + name="sold_without_objects"> + objects not included + </floater.string> + <floater.string + name="info_price_string"> + L$ [PRICE] +(L$ [PRICE_PER_SQM]/sq.m.) +[SOLD_WITH_OBJECTS] + </floater.string> + <floater.string + name="insufficient_land_credits"> + The group [GROUP] will need sufficient contributed land use credits to cover this parcel before the purchase will complete. + </floater.string> + <floater.string + name="have_enough_lindens"> + You have L$ [AMOUNT], which is enough to buy this land. + </floater.string> + <floater.string + name="not_enough_lindens"> + You have only L$ [AMOUNT], and need L$ [AMOUNT2] more. + </floater.string> + <floater.string + name="balance_left"> + After the purchase, you will have L$ [AMOUNT] left. + </floater.string> + <floater.string + name="balance_needed"> + You need to buy at least L$ [AMOUNT] to afford this land. + </floater.string> + <floater.string + name="no_parcel_selected"> + (no parcel selected) + </floater.string> + <floater.string + name="buy_currency"> + Buy L$ [LINDENS] for approx. US$ [USD] + </floater.string> + <text + type="string" + length="1" + follows="left|top" + height="14" + layout="topleft" + left="440" + name="region_name_label" + right="550" + top="21" + width="60" + word_wrap="true"> + Region: + </text> + <text + type="string" + length="1" + follows="left|top" + height="14" + layout="topleft" + left_delta="110" + name="region_name_text" + top_delta="0" + width="175"> + (unknown) + </text> + <text + type="string" + length="1" + follows="left|top" + height="14" + layout="topleft" + left="440" + name="region_type_label" + right="550" + width="60" + word_wrap="true"> + Type: + </text> + <text + type="string" + length="1" + follows="left|top" + height="14" + layout="topleft" + left_delta="110" + name="region_type_text" + top_delta="0" + width="175"> + (unknown) + </text> + <text + type="string" + length="1" + follows="left|top" + height="14" + layout="topleft" + left="440" + name="estate_name_label" + right="550" + width="60" + word_wrap="true"> + Estate: + </text> + <text + type="string" + length="1" + follows="left|top" + height="14" + layout="topleft" + left_delta="110" + name="estate_name_text" + top_delta="0" + width="175"> + (unknown) + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="440" + name="estate_owner_label" + right="550" + width="100" + word_wrap="true"> + Estate Owner: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_delta="110" + name="estate_owner_text" + top_delta="0" + width="175"> + (unknown) + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left="440" + name="resellable_changeable_label" + right="725" + width="260" + word_wrap="true"> + Purchased land in this region: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="470" + name="resellable_clause" + right="725" + width="260" + word_wrap="true"> + May or may not be resold. + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="470" + name="changeable_clause" + right="725" + width="260" + word_wrap="true"> + May or may not be joined or subdivided. + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left="440" + name="covenant_text" + right="725" + width="260"> + You must agree to the Estate Covenant: + </text> + <text + follows="left|top" + height="12" + layout="topleft" + left="500" + name="covenant_timestamp_text" + right="725" + top="175" + width="275" + word_wrap="true" /> + <text_editor + type="string" + length="1" + enabled="false" + follows="top|right" + height="237" + layout="topleft" + left="444" + max_length="65535" + name="covenant_editor" + right="725" + top="192" + width="271" + word_wrap="true"> + Loading... + </text_editor> + <check_box + height="20" + label="I Agree to the Covenant Defined Above." + layout="topleft" + left="440" + name="agree_covenant" + right="725" + width="275" /> + <texture_picker + enabled="false" + follows="top|left" + height="135" + layout="topleft" + left="16" + name="info_image" + top="28" + width="180" /> + <text + type="string" + length="1" + bottom_delta="-119" + follows="top|left" + layout="topleft" + left="204" + name="info_parcel_label" + width="48"> + Parcel: + </text> + <text + type="string" + length="1" + follows="top|left" + font="SansSerif" + height="16" + layout="topleft" + left_delta="16" + name="info_parcel" + top_delta="-1" + width="180"> + Scotopteryx 138,204 + </text> + <text + type="string" + length="1" + follows="top|left" + layout="topleft" + left="204" + name="info_size_label" + width="48"> + Size: + </text> + <text + type="string" + length="1" + follows="top|left" + font="SansSerif" + height="32" + layout="topleft" + left_delta="16" + name="info_size" + top_delta="-1" + width="180"> + 1024 sq.m. + </text> + <text + type="string" + length="1" + follows="top|left" + layout="topleft" + left="204" + name="info_price_label" + width="48"> + Price: + </text> + <text + type="string" + length="1" + follows="top|left" + font="SansSerif" + height="16" + layout="topleft" + left_delta="16" + name="info_price" + top_delta="-1" + width="180"> + L$ 1500 +(L$ 1.1/sq.m.) +sold with objects + </text> + <text + type="string" + length="1" + follows="top|left" + font="SansSerifHuge" + height="24" + layout="topleft" + left="16" + name="info_action" + top="156" + width="350"> + Buying this land will: + </text> + <locate + height="6" + layout="topleft" /> + <icon + follows="top|left" + height="64" + image_name="badge_note.j2c" + layout="topleft" + left="0" + name="step_error" + width="64" /> + <text + type="string" + length="1" + follows="top|left" + height="160" + layout="topleft" + left="72" + name="error_message" + right="435" + top="208" + width="215"> + Something ain't right. + </text> + <button + follows="bottom|left" + height="20" + label="Go to website" + layout="topleft" + left_delta="0" + name="error_web" + top_delta="144" + width="120" /> + <locate + height="-200" + layout="topleft" /> + <icon + follows="top|left" + height="64" + image_name="badge_ok.j2c" + layout="topleft" + left="0" + name="step_1" + width="64" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerifBig" + height="16" + layout="topleft" + left="72" + name="account_action" + right="438" + top="190" + width="218"> + Upgrade you to premium membership. + </text> + <text + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left="72" + name="account_reason" + right="400" + width="180"> + Only premimum members may own land. + </text> + <combo_box + follows="top|left" + height="16" + layout="topleft" + left="80" + name="account_level" + width="336"> + <combo_box.item + label="US$9.95/month, billed monthly" /> + <combo_box.item + label="US$7.50/month, billed quarterly" /> + <combo_box.item + label="US$6.00/month, billed annually" /> + </combo_box> + <locate + height="10" + layout="topleft" /> + <icon + follows="top|left" + height="64" + image_name="badge_note.j2c" + layout="topleft" + left="0" + name="step_2" + width="64" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerifBig" + height="16" + layout="topleft" + left="72" + name="land_use_action" + right="438" + top="274" + width="218"> + Increase your monthly land use fees to US$ 40/month. + </text> + <text + type="string" + length="1" + follows="top|left" + height="32" + layout="topleft" + left="72" + name="land_use_reason" + right="435" + width="215"> + You hold 1309 sq.m. of land. + This parcel is 512 sq.m. of land. + </text> + <locate + height="10" + layout="topleft" /> + <icon + follows="top|left" + height="64" + image_name="badge_note.j2c" + layout="topleft" + left="0" + name="step_3" + width="64" /> + <text + type="string" + length="1" + bottom_delta="-38" + follows="top|left" + font="SansSerifBig" + height="16" + layout="topleft" + left="72" + name="purchase_action" + right="438"> + Pay Joe Resident L$ 4000 for the land + </text> + <text + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left="72" + name="currency_reason" + right="400"> + You have L$ 2,100. + </text> + <text + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left_delta="0" + name="currency_action" + top_pad="9" + width="90"> + Buy additional L$ + </text> + <locate + height="0" + layout="topleft" + width="8" /> + <line_editor + type="string" + length="1" + follows="top|right" + height="16" + layout="topleft" + left="170" + name="currency_amt" + top="398" + width="80"> + 1000 + </line_editor> + <locate + height="0" + layout="topleft" + width="8" /> + <text + type="string" + length="1" + follows="top|right" + height="16" + layout="topleft" + left="260" + name="currency_est" + top="399" + width="178"> + for approx. US$ [AMOUNT2] + </text> + <text + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left="72" + name="currency_balance" + right="400"> + You have L$ 2,100. + </text> + <check_box + follows="bottom|left" + height="20" + label="Remove [AMOUNT] square meters of contribution from group." + layout="topleft" + left_delta="3" + name="remove_contribution" + top_delta="14" + visible="false" + width="275" /> + <button + follows="bottom|left" + height="20" + label="Purchase" + layout="topleft" + left="70" + name="buy_btn" + top="448" + width="100" /> + <button + follows="bottom|right" + height="20" + label="Cancel" + layout="topleft" + left="-90" + name="cancel_btn" + top="454" + width="80" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_buy_object.xml b/indra/newview/skins/default/xui/en/floater_buy_object.xml new file mode 100644 index 0000000000000000000000000000000000000000..44ef32ee3608638e3724b823ab349375bc3c5298 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_buy_object.xml @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="250" + layout="topleft" + min_height="175" + min_width="154" + name="contents" + save_rect="true" + title="Buy Copy of Object" + width="300"> + <floater.string + name="title_buy_text"> + Buy + </floater.string> + <floater.string + name="title_buy_copy_text"> + Buy a copy of + </floater.string> + <floater.string + name="no_copy_text"> + (no copy) + </floater.string> + <floater.string + name="no_modify_text"> + (no modify) + </floater.string> + <floater.string + name="no_transfer_text"> + (no transfer) + </floater.string> + <scroll_list + follows="left|top|right" + height="36" + layout="topleft" + left="15" + name="object_list" + top="24" + width="281"> + <scroll_list.columns + name="icon" + width="16" /> + <scroll_list.columns + name="text" + width="300" /> + </scroll_list> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="contents_text" + top_pad="4" + width="281"> + and its contents: + </text> + <scroll_list + follows="left|top|right|bottom" + height="108" + layout="topleft" + left_delta="0" + name="item_list" + top_pad="4" + width="281"> + <scroll_list.columns + name="icon" + width="16" /> + <scroll_list.columns + name="text" + width="300" /> + </scroll_list> + <text + type="string" + length="1" + follows="left|right|bottom" + font="SansSerif" + height="24" + layout="topleft" + left_delta="0" + name="buy_text" + top_pad="4" + width="281"> + Buy for L$[AMOUNT] from [NAME]? + </text> + <button + follows="right|bottom" + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left="216" + name="cancel_btn" + top="224" + width="60" /> + <button + follows="right|bottom" + height="20" + label="Buy" + label_selected="Buy" + layout="topleft" + left_delta="-64" + name="buy_btn" + top_delta="0" + width="60" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml new file mode 100644 index 0000000000000000000000000000000000000000..7f24b11d14ac0976aab08b78b03e1bff812c8d62 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + center_horiz="true" + follows="top" + height="64" + layout="topleft" + name="camera_floater" + save_rect="true" + width="176"> + <floater.string + name="rotate_tooltip"> + Rotate Camera Around Focus + </floater.string> + <floater.string + name="zoom_tooltip"> + Zoom Camera Towards Focus + </floater.string> + <floater.string + name="move_tooltip"> + Move Camera Up and Down, Left and Right + </floater.string> + <joystick_rotate + follows="top|left" + height="64" + image_selected="cam_rotate_in.tga" + image_unselected="cam_rotate_out.tga" + layout="topleft" + left="16" + name="cam_rotate_stick" + picture_style="true" + quadrant="left" + scale_image="false" + sound_flags="3" + tool_tip="rotate_tooltip" + top="0" + width="64" /> + <joystick_zoom + follows="top|left" + height="64" + image_unselected="cam_zoom_out.tga" + layout="topleft" + left_delta="64" + minus_image="cam_zoom_minus_in.tga" + name="zoom" + picture_style="true" + plus_image="cam_zoom_plus_in.tga" + quadrant="left" + scale_image="false" + sound_flags="3" + tool_tip="zoom_tooltip" + top_delta="0" + width="16" /> + <joystick_track + follows="top|left" + height="64" + image_selected="cam_tracking_in.tga" + image_unselected="cam_tracking_out.tga" + layout="topleft" + left_delta="16" + name="cam_track_stick" + picture_style="true" + quadrant="left" + scale_image="false" + sound_flags="3" + tool_tip="move_tooltip" + top_delta="0" + width="64" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_choose_group.xml b/indra/newview/skins/default/xui/en/floater_choose_group.xml new file mode 100644 index 0000000000000000000000000000000000000000..428afcff52d25ec439d9c4f276fd864bbd7cb766 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_choose_group.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="258" + layout="topleft" + name="groups" + title="Groups" + width="280"> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="12" + name="groupdesc" + top="24" + width="248"> + Choose a group: + </text> + <scroll_list + height="160" + layout="topleft" + left_delta="0" + name="group list" + top_pad="8" + width="248"> + <scroll_list.columns + name="name" + width="248" /> + </scroll_list> + <button + height="20" + label="OK" + label_selected="OK" + layout="topleft" + left_delta="0" + name="OK" + top_pad="8" + width="80" /> + <button + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_pad="8" + name="Cancel" + top_delta="0" + width="80" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_color_picker.xml b/indra/newview/skins/default/xui/en/floater_color_picker.xml new file mode 100644 index 0000000000000000000000000000000000000000..08e47f7ef69c7199684d6057db3826c8f6c0f85b --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_color_picker.xml @@ -0,0 +1,228 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + follows="left|top" + height="380" + layout="topleft" + name="ColorPicker" + title="Color Picker" + width="440"> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="10" + layout="topleft" + left="12" + mouse_opaque="false" + name="r_val_text" + top="35" + width="413"> + Red: + </text> + <spinner + decimal_digits="0" + follows="left" + height="16" + increment="1" + initial_value="128" + layout="topleft" + left_delta="63" + max_val="255" + name="rspin" + top_delta="0" + width="50" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="10" + layout="topleft" + left="12" + mouse_opaque="false" + name="g_val_text" + top="56" + width="413"> + Green: + </text> + <spinner + decimal_digits="0" + follows="left" + height="16" + increment="1" + initial_value="128" + layout="topleft" + left_delta="63" + max_val="255" + name="gspin" + top_delta="0" + width="50" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="10" + layout="topleft" + left="12" + mouse_opaque="false" + name="b_val_text" + top="77" + width="413"> + Blue: + </text> + <spinner + decimal_digits="0" + follows="left" + height="16" + increment="1" + initial_value="128" + layout="topleft" + left_delta="63" + max_val="255" + name="bspin" + top_delta="0" + width="50" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="10" + layout="topleft" + left="12" + mouse_opaque="false" + name="h_val_text" + top="108" + width="413"> + Hue: + </text> + <spinner + decimal_digits="0" + follows="left" + height="16" + increment="1" + initial_value="180" + layout="topleft" + left_delta="63" + max_val="360" + name="hspin" + top_delta="0" + width="50" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="10" + layout="topleft" + left="12" + mouse_opaque="false" + name="s_val_text" + top="129" + width="413"> + Sat: + </text> + <spinner + decimal_digits="0" + follows="left" + height="16" + increment="1" + initial_value="50" + layout="topleft" + left_delta="63" + max_val="100" + name="sspin" + top_delta="0" + width="50" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="10" + layout="topleft" + left="12" + mouse_opaque="false" + name="l_val_text" + top="150" + width="413"> + Lum: + </text> + <spinner + decimal_digits="0" + follows="left" + height="16" + increment="1" + initial_value="50" + layout="topleft" + left_delta="63" + max_val="100" + name="lspin" + top_delta="0" + width="50" /> + <check_box + follows="left|bottom" + height="20" + label="Apply Immediately" + layout="topleft" + left="12" + name="apply_immediate" + top="353" + width="100" /> + <button + follows="left|top" + height="32" + layout="topleft" + left_delta="130" + name="color_pipette" + picture_style="true" + top="341" + width="32" /> + <button + follows="right|bottom" + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_delta="75" + name="cancel_btn" + top="353" + width="100" /> + <button + follows="right|bottom" + height="20" + label="Select" + label_selected="Select" + layout="topleft" + left_pad="4" + name="select_btn" + top_delta="0" + width="100" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="12" + name="Current color:" + top="172" + width="110"> + Current color: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="(Drag below to save.)" + top_pad="66" + width="110"> + (Drag below to save.) + </text> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_critical.xml b/indra/newview/skins/default/xui/en/floater_critical.xml new file mode 100644 index 0000000000000000000000000000000000000000..5475a1cf6a56d712b9c235e24496a1da873a2ed1 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_critical.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_close="false" + can_minimize="false" + height="500" + layout="topleft" + name="modal container" + width="600"> + <button + height="20" + label="Continue" + label_selected="Continue" + layout="topleft" + left="484" + name="Continue" + top="465" + width="100" /> + <button + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_delta="-468" + name="Cancel" + top_delta="0" + width="100" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left_delta="4" + name="tos_heading" + top_delta="-450" + width="552"> + Please read the following message carefully. + </text> + <text_editor + type="string" + length="1" + bg_readonly_color="1 1 1 1" + bottom="455" + follows="left|top" + font="SansSerif" + layout="topleft" + left="20" + max_length="65536" + name="tos_text" + right="-20" + text_readonly_color="0 0 0 1" + top="45" + word_wrap="true"> + TOS_TEXT + </text_editor> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_customize.xml b/indra/newview/skins/default/xui/en/floater_customize.xml new file mode 100644 index 0000000000000000000000000000000000000000..41bd417c12d37ce08741683198f22260605796fb --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_customize.xml @@ -0,0 +1,3574 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + follows="left|top" + height="540" + layout="topleft" + left_delta="-3" + name="floater customize" + save_rect="true" + title="Appearance" + top_delta="-185" + width="494"> + <tab_container + height="483" + layout="topleft" + left="0" + name="customize tab container" + tab_min_width="96" + tab_position="left" + top="24" + width="492"> + <placeholder + label="Body Parts" + layout="topleft" + name="body_parts_placeholder" /> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Shape" + layout="topleft" + left_delta="0" + name="Shape" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left="299" + name="Revert" + top="458" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Body" + label_selected="Body" + layout="topleft" + left="8" + name="Body" + top="65" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Head" + label_selected="Head" + layout="topleft" + left_delta="0" + name="Head" + top_pad="16" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Eyes" + label_selected="Eyes" + layout="topleft" + left_delta="0" + name="Eyes" + top_pad="16" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Ears" + label_selected="Ears" + layout="topleft" + left_delta="0" + name="Ears" + top_pad="16" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Nose" + label_selected="Nose" + layout="topleft" + left_delta="0" + name="Nose" + top_pad="16" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Mouth" + label_selected="Mouth" + layout="topleft" + left_delta="0" + name="Mouth" + top_pad="16" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Chin" + label_selected="Chin" + layout="topleft" + left_delta="0" + name="Chin" + top_pad="16" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Torso" + label_selected="Torso" + layout="topleft" + left_delta="0" + name="Torso" + top_pad="16" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Legs" + label_selected="Legs" + layout="topleft" + left_delta="0" + name="Legs" + top_pad="16" + width="82" /> + <radio_group + control_name="AvatarSex" + height="34" + layout="topleft" + left_delta="0" + name="sex radio" + top_pad="16" + width="82"> + <radio_item + height="16" + label="Female" + layout="topleft" + left="1" + name="radio" + top="1" + width="82" /> + <radio_item + height="16" + label="Male" + layout="topleft" + left_delta="0" + name="radio2" + top_delta="16" + width="82" /> + </radio_group> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="26" + name="title" + top="8" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new shape by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Shape: + </text> + <button + follows="left|top" + height="24" + label="Create New Shape" + label_selected="Create New Shape" + layout="topleft" + left="8" + name="Create New" + top="104" + width="120" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Skin" + layout="topleft" + left_delta="0" + name="Skin" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Skin Color" + label_selected="Skin Color" + layout="topleft" + left_delta="0" + name="Skin Color" + top_pad="41" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Face Detail" + label_selected="Face Detail" + layout="topleft" + left_delta="0" + name="Face Detail" + top_pad="16" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Makeup" + label_selected="Makeup" + layout="topleft" + left_delta="0" + name="Makeup" + top_pad="16" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Body Detail" + label_selected="Body Detail" + layout="topleft" + left_delta="0" + name="Body Detail" + top_pad="16" + width="82" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="26" + name="title" + top="8" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new skin by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Skin: + </text> + <texture_picker + allow_no_texture="true" + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Head Tattoos" + layout="topleft" + left="8" + name="Head Tattoos" + tool_tip="Click to choose a picture" + top="193" + width="74" /> + <texture_picker + allow_no_texture="true" + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Upper Tattoos" + layout="topleft" + left_delta="0" + name="Upper Tattoos" + tool_tip="Click to choose a picture" + top_delta="80" + width="74" /> + <texture_picker + allow_no_texture="true" + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Lower Tattoos" + layout="topleft" + left_delta="0" + name="Lower Tattoos" + tool_tip="Click to choose a picture" + top_delta="80" + width="74" /> + <button + follows="left|top" + height="24" + label="Create New Skin" + label_selected="Create New Skin" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="-249" + width="120" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Hair" + layout="topleft" + left_delta="0" + name="Hair" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Color" + label_selected="Color" + layout="topleft" + left_delta="0" + name="Color" + top_pad="41" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Style" + label_selected="Style" + layout="topleft" + left_delta="0" + name="Style" + top_pad="16" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Eyebrows" + label_selected="Eyebrows" + layout="topleft" + left_delta="0" + name="Eyebrows" + top_pad="16" + width="82" /> + <button + follows="left|top" + font="SansSerifSmall" + height="16" + label="Facial" + label_selected="Facial" + layout="topleft" + left_delta="0" + name="Facial" + top_pad="16" + width="82" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="26" + name="title" + top="8" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new hair by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Hair: + </text> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Texture" + layout="topleft" + left="8" + name="Texture" + tool_tip="Click to choose a picture" + top="193" + width="64" /> + <button + follows="left|top" + height="24" + label="Create New Hair" + label_selected="Create New Hair" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="-89" + width="120" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Eyes" + layout="topleft" + left_delta="0" + name="Eyes" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_pad="2" + name="title" + top_delta="0" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new eyes by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Eyes: + </text> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Iris" + layout="topleft" + left="8" + name="Iris" + tool_tip="Click to choose a picture" + top="65" + width="64" /> + <button + follows="left|top" + height="24" + label="Create New Eyes" + label_selected="Create New Eyes" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="39" + width="120" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + </panel> + <placeholder + label="Clothes" + layout="topleft" + name="clothes_placeholder" /> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Shirt" + layout="topleft" + left_delta="0" + name="Shirt" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Fabric" + layout="topleft" + left_delta="0" + name="Fabric" + tool_tip="Click to choose a picture" + top_pad="41" + width="64" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + follows="left|top" + height="80" + label="Color/Tint" + layout="topleft" + left_delta="0" + name="Color/Tint" + tool_tip="Click to open Color Picker" + top_delta="80" + width="64" /> + <button + follows="left|top" + height="24" + label="Create New Shirt" + label_selected="Create New Shirt" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="-41" + width="120" /> + <button + follows="left|top" + height="20" + label="Take Off" + label_selected="Take Off" + layout="topleft" + left_delta="0" + name="Take Off" + top_pad="102" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="26" + name="title" + top="8" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <spinner + decimal_digits="0" + follows="left|top|right" + height="16" + increment="1" + initial_value="0" + label="Item" + label_width="30" + layout="topleft" + left_delta="2" + max_val="5" + name="index" + text_enabled_color="110, 15, 15, 255" + top_pad="6" + width="87" /> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new shirt by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Shirt: + </text> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Pants" + layout="topleft" + left_delta="0" + name="Pants" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Fabric" + layout="topleft" + left_delta="0" + name="Fabric" + tool_tip="Click to choose a picture" + top_pad="41" + width="64" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + follows="left|top" + height="80" + label="Color/Tint" + layout="topleft" + left_delta="0" + name="Color/Tint" + tool_tip="Click to open Color Picker" + top_delta="80" + width="64" /> + <button + follows="left|top" + height="24" + label="Create New Pants" + label_selected="Create New Pants" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="-41" + width="120" /> + <button + follows="left|top" + height="20" + label="Take Off" + label_selected="Take Off" + layout="topleft" + left_delta="0" + name="Take Off" + top_pad="102" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="26" + name="title" + top="8" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <spinner + decimal_digits="0" + follows="left|top|right" + height="16" + increment="1" + initial_value="0" + label="Item" + label_width="30" + layout="topleft" + left_delta="2" + max_val="5" + name="index" + text_enabled_color="110, 15, 15, 255" + top_pad="6" + width="87" /> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new pants by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Pants: + </text> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Shoes" + layout="topleft" + left_delta="0" + name="Shoes" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_pad="2" + name="title" + top_delta="0" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <spinner + decimal_digits="0" + follows="left|top|right" + height="16" + increment="1" + initial_value="0" + label="Item" + label_width="30" + layout="topleft" + left_delta="2" + max_val="5" + name="index" + text_enabled_color="110, 15, 15, 255" + top_pad="6" + width="87" /> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new shoes by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Shoes: + </text> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Fabric" + layout="topleft" + left="8" + name="Fabric" + tool_tip="Click to choose a picture" + top="65" + width="64" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + follows="left|top" + height="80" + label="Color/Tint" + layout="topleft" + left_delta="0" + name="Color/Tint" + tool_tip="Click to open Color Picker" + top_delta="80" + width="64" /> + <button + follows="left|top" + height="24" + label="Create New Shoes" + label_selected="Create New Shoes" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="-41" + width="120" /> + <button + follows="left|top" + height="20" + label="Take Off" + label_selected="Take Off" + layout="topleft" + left_delta="0" + name="Take Off" + top_pad="102" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Socks" + layout="topleft" + left_delta="0" + name="Socks" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_pad="2" + name="title" + top_delta="0" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <spinner + decimal_digits="0" + follows="left|top|right" + height="16" + increment="1" + initial_value="0" + label="Item" + label_width="30" + layout="topleft" + left_delta="2" + max_val="5" + name="index" + text_enabled_color="110, 15, 15, 255" + top_pad="6" + width="87" /> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new socks by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Socks: + </text> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Fabric" + layout="topleft" + left="8" + name="Fabric" + tool_tip="Click to choose a picture" + top="65" + width="64" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + follows="left|top" + height="80" + label="Color/Tint" + layout="topleft" + left_delta="0" + name="Color/Tint" + tool_tip="Click to open Color Picker" + top_delta="80" + width="64" /> + <button + follows="left|top" + height="24" + label="Create New Socks" + label_selected="Create New Socks" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="-41" + width="120" /> + <button + follows="left|top" + height="20" + label="Take Off" + label_selected="Take Off" + layout="topleft" + left_delta="0" + name="Take Off" + top_pad="102" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Jacket" + layout="topleft" + left_delta="0" + name="Jacket" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_pad="2" + name="title" + top_delta="0" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <spinner + decimal_digits="0" + follows="left|top|right" + height="16" + increment="1" + initial_value="0" + label="Item" + label_width="30" + layout="topleft" + left_delta="2" + max_val="5" + name="index" + text_enabled_color="110, 15, 15, 255" + top_pad="6" + width="87" /> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new jacket by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Jacket: + </text> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Upper Fabric" + layout="topleft" + left="8" + name="Upper Fabric" + tool_tip="Click to choose a picture" + top="65" + width="64" /> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Lower Fabric" + layout="topleft" + left_delta="0" + name="Lower Fabric" + tool_tip="Click to choose a picture" + top_delta="80" + width="64" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + follows="left|top" + height="80" + label="Color/Tint" + layout="topleft" + left_delta="0" + name="Color/Tint" + tool_tip="Click to open Color Picker" + top_delta="80" + width="64" /> + <button + follows="left|top" + height="24" + label="Create New Jacket" + label_selected="Create New Jacket" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="-121" + width="140" /> + <button + follows="left|top" + height="20" + label="Take Off" + label_selected="Take Off" + layout="topleft" + left_delta="0" + name="Take Off" + top_pad="182" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Gloves" + layout="topleft" + left_delta="0" + name="Gloves" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_pad="2" + name="title" + top_delta="0" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <spinner + decimal_digits="0" + follows="left|top|right" + height="16" + increment="1" + initial_value="0" + label="Item" + label_width="30" + layout="topleft" + left_delta="2" + max_val="5" + name="index" + text_enabled_color="110, 15, 15, 255" + top_pad="6" + width="87" /> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new gloves by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Gloves: + </text> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Fabric" + layout="topleft" + left="8" + name="Fabric" + tool_tip="Click to choose a picture" + top="65" + width="64" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + follows="left|top" + height="80" + label="Color/Tint" + layout="topleft" + left_delta="0" + name="Color/Tint" + tool_tip="Click to open Color Picker" + top_delta="80" + width="64" /> + <button + follows="left|top" + height="24" + label="Create New Gloves" + label_selected="Create New Gloves" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="-41" + width="130" /> + <button + follows="left|top" + height="20" + label="Take Off" + label_selected="Take Off" + layout="topleft" + left_delta="0" + name="Take Off" + top_pad="102" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Undershirt" + layout="topleft" + left_delta="0" + name="Undershirt" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_pad="2" + name="title" + top_delta="0" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <spinner + decimal_digits="0" + follows="left|top|right" + height="16" + increment="1" + initial_value="0" + label="Item" + label_width="30" + layout="topleft" + left_delta="2" + max_val="5" + name="index" + text_enabled_color="110, 15, 15, 255" + top_pad="6" + width="87" /> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new undershirt by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Undershirt: + </text> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Fabric" + layout="topleft" + left="8" + name="Fabric" + tool_tip="Click to choose a picture" + top="65" + width="64" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + follows="left|top" + height="80" + label="Color/Tint" + layout="topleft" + left_delta="0" + name="Color/Tint" + tool_tip="Click to open Color Picker" + top_delta="80" + width="64" /> + <button + follows="left|top" + height="24" + label="Create New Undershirt" + label_selected="Create New Undershirt" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="-41" + width="160" /> + <button + follows="left|top" + height="20" + label="Take Off" + label_selected="Take Off" + layout="topleft" + left_delta="0" + name="Take Off" + top_pad="102" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Underpants" + layout="topleft" + left_delta="0" + name="Underpants" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_pad="2" + name="title" + top_delta="0" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <spinner + decimal_digits="0" + follows="left|top|right" + height="16" + increment="1" + initial_value="0" + label="Item" + label_width="30" + layout="topleft" + left_delta="2" + max_val="5" + name="index" + text_enabled_color="110, 15, 15, 255" + top_pad="6" + width="87" /> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new underpants by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Underpants: + </text> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Fabric" + layout="topleft" + left="8" + name="Fabric" + tool_tip="Click to choose a picture" + top="65" + width="64" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + follows="left|top" + height="80" + label="Color/Tint" + layout="topleft" + left_delta="0" + name="Color/Tint" + tool_tip="Click to open Color Picker" + top_delta="80" + width="64" /> + <button + follows="left|top" + height="24" + label="Create New Underpants" + label_selected="Create New Underpants" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="-41" + width="160" /> + <button + follows="left|top" + height="20" + label="Take Off" + label_selected="Take Off" + layout="topleft" + left_delta="0" + name="Take Off" + top_pad="102" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Skirt" + layout="topleft" + left_delta="0" + name="Skirt" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_pad="2" + name="title" + top_delta="0" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <spinner + decimal_digits="0" + follows="left|top|right" + height="16" + increment="1" + initial_value="0" + label="Item" + label_width="30" + layout="topleft" + left_delta="2" + max_val="5" + name="index" + text_enabled_color="110, 15, 15, 255" + top_pad="6" + width="87" /> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="not worn instructions" + top_pad="8" + width="373"> + Put on a new skirt by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="117" + width="100"> + Skirt: + </text> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Fabric" + layout="topleft" + left="8" + name="Fabric" + tool_tip="Click to choose a picture" + top="65" + width="64" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + follows="left|top" + height="80" + label="Color/Tint" + layout="topleft" + left_delta="0" + name="Color/Tint" + tool_tip="Click to open Color Picker" + top_delta="80" + width="64" /> + <button + follows="left|top" + height="24" + label="Create New Skirt" + label_selected="Create New Skirt" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="-41" + width="120" /> + <button + follows="left|top" + height="20" + label="Take Off" + label_selected="Take Off" + layout="topleft" + left_delta="0" + name="Take Off" + top_pad="102" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="123" + name="Save" + top="458" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Alpha" + layout="topleft" + left_delta="0" + name="Alpha" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_pad="2" + name="title" + top_delta="0" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <spinner + decimal_digits="0" + follows="left|top|right" + height="16" + increment="1" + initial_value="0" + label="Item" + label_width="30" + layout="topleft" + left_delta="2" + max_val="5" + name="index" + text_enabled_color="110, 15, 15, 255" + top_pad="6" + width="87" /> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="-2" + name="not worn instructions" + top_delta="2" + width="373"> + Put on a new alpha mask by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="119" + width="100"> + Alpha: + </text> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Lower Alpha" + layout="topleft" + left="8" + name="Lower Alpha" + tool_tip="Click to choose a picture" + top="65" + width="64" /> + <check_box + control_name="LowerAlphaTextureInvisible" + follows="left" + height="16" + layout="topleft" + left_pad="6" + name="lower alpha texture invisible" + top_delta="4" + width="16" /> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Upper Alpha" + layout="topleft" + left="8" + name="Upper Alpha" + tool_tip="Click to choose a picture" + top="145" + width="64" /> + <check_box + control_name="UpperAlphaTextureInvisible" + follows="left" + height="16" + layout="topleft" + left_pad="6" + name="upper alpha texture invisible" + top_delta="4" + width="16" /> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Head Alpha" + layout="topleft" + left="8" + name="Head Alpha" + tool_tip="Click to choose a picture" + top="225" + width="64" /> + <check_box + control_name="HeadAlphaTextureInvisible" + follows="left" + height="16" + layout="topleft" + left_pad="6" + name="head alpha texture invisible" + top_delta="4" + width="16" /> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Eye Alpha" + layout="topleft" + left="8" + name="Eye Alpha" + tool_tip="Click to choose a picture" + top="305" + width="64" /> + <check_box + control_name="Eye AlphaTextureInvisible" + follows="left" + height="16" + layout="topleft" + left_pad="6" + name="eye alpha texture invisible" + top_delta="4" + width="16" /> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Hair Alpha" + layout="topleft" + left="8" + name="Hair Alpha" + tool_tip="Click to choose a picture" + top="385" + width="64" /> + <check_box + control_name="HairAlphaTextureInvisible" + follows="left" + height="16" + layout="topleft" + left_pad="6" + name="hair alpha texture invisible" + top_delta="4" + width="16" /> + <button + follows="left|top" + height="24" + label="Create New Alpha" + label_selected="Create New Alpha" + layout="topleft" + left="8" + name="Create New" + top="104" + width="120" /> + <button + follows="left|top" + height="20" + label="Take Off" + label_selected="Take Off" + layout="topleft" + left_delta="-4" + name="Take Off" + top_pad="332" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left_pad="37" + name="Save" + top_delta="-2" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="481" + label="Tattoo" + layout="topleft" + left_delta="0" + name="Tattoo" + top_delta="0" + width="389"> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="333" + mouse_opaque="true" + name="square" + top="5" + width="16" /> + <icon + height="16" + layout="topleft" + left_delta="-325" + mouse_opaque="true" + top_delta="3" + width="16" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_pad="2" + name="title" + top_delta="0" + width="355"> + [DESC] + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_no_modify" + top_delta="0" + width="355"> + [DESC]: cannot modify + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_loading" + top_delta="0" + width="355"> + [DESC]: loading... + </text> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="title_not_worn" + top_delta="0" + width="355"> + [DESC]: not worn + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left="8" + name="path" + top="24" + width="373"> + Located in [PATH] + </text> + <spinner + decimal_digits="0" + follows="left|top|right" + height="16" + increment="1" + initial_value="0" + label="Item" + label_width="30" + layout="topleft" + left_delta="2" + max_val="5" + name="index" + text_enabled_color="110, 15, 15, 255" + top_pad="6" + width="87" /> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="-2" + name="not worn instructions" + top_delta="2" + width="373"> + Put on a new tattoo by dragging one from your inventory +to your avatar. Alternately, you create a new one from +scratch and wear it. + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="28" + layout="topleft" + left_delta="0" + name="no modify instructions" + top_delta="0" + width="373"> + You do not have permission to modify this wearable. + </text> + <text + type="string" + length="1" + bottom="486" + follows="left|top|right" + font="SansSerif" + halign="right" + height="28" + layout="topleft" + name="Item Action Label" + right="119" + width="100"> + Tattoo: + </text> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Head Tattoo" + layout="topleft" + left="8" + name="Head Tattoo" + tool_tip="Click to choose a picture" + top="65" + width="64" /> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Upper Tattoo" + layout="topleft" + left_delta="0" + name="Upper Tattoo" + tool_tip="Click to choose a picture" + top_delta="80" + width="64" /> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Lower Tattoo" + layout="topleft" + left_delta="0" + name="Lower Tattoo" + tool_tip="Click to choose a picture" + top_delta="80" + width="64" /> + <button + follows="left|top" + height="24" + label="Create New Tattoo" + label_selected="Create New Tattoo" + layout="topleft" + left_delta="0" + name="Create New" + top_delta="-121" + width="120" /> + <button + follows="left|top" + height="20" + label="Take Off" + label_selected="Take Off" + layout="topleft" + left_delta="-4" + name="Take Off" + top_pad="332" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left_pad="37" + name="Save" + top_delta="-2" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Save As..." + label_selected="Save As..." + layout="topleft" + left_pad="6" + name="Save As" + top_delta="0" + width="82" /> + <button + follows="right|bottom" + height="20" + label="Revert" + label_selected="Revert" + layout="topleft" + left_pad="6" + name="Revert" + top_delta="0" + width="82" /> + </panel> + </tab_container> + <scroll_container + follows="left|top|right|bottom" + height="382" + layout="topleft" + left="197" + mouse_opaque="false" + name="panel_container" + top="94" + width="292"> + <scrolling_panel_list + follows="left|bottom" + layout="topleft" + name="panel_list" /> + </scroll_container> + <button + bottom="536" + follows="right|bottom" + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + name="Cancel" + right="-10" + width="100" /> + <button + bottom="536" + follows="right|bottom" + height="20" + label="OK" + label_selected="OK" + layout="topleft" + name="Ok" + right="-116" + width="100" /> + <button + follows="left|bottom" + height="20" + label="Make Outfit..." + label_selected="Make Outfit..." + layout="topleft" + left_delta="-178" + name="Make Outfit" + top_delta="0" + width="100" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml new file mode 100644 index 0000000000000000000000000000000000000000..9ca7172f81f0b0eab6e60c3bb41c20593be60c7e --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml @@ -0,0 +1,613 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="275" + layout="topleft" + name="Day Cycle Floater" + save_rect="true" + title="Day Cycle Editor" + width="646"> + <tab_container + follows="left|top" + height="255" + layout="topleft" + left="0" + name="Day Cycle Tabs" + tab_position="top" + top="20" + width="644"> + <panel + border="true" + follows="left|top|right|bottom" + height="255" + label="Day Cycle" + layout="topleft" + left="1" + mouse_opaque="false" + name="Day Cycle" + top="0" + width="642"> + <button + follows="left|top" + font="SansSerifSmall" + height="15" + label="?" + layout="topleft" + left="612" + name="WLDayCycleHelp" + top="3" + width="18" /> + <multi_slider + can_edit_text="true" + control_name="WLTimeSlider" + decimal_digits="0" + draw_track="false" + follows="bottom" + height="10" + increment="0.0833333" + initial_value="0" + layout="topleft" + left="20" + max_sliders="20" + max_val="24" + name="WLTimeSlider" + show_text="false" + top="25" + use_triangle="true" + width="525" /> + <multi_slider + can_edit_text="true" + control_name="WLDayCycleKeys" + decimal_digits="0" + follows="bottom" + height="10" + increment="0.0833333" + initial_value="0" + layout="topleft" + left_delta="0" + max_sliders="20" + max_val="24" + name="WLDayCycleKeys" + show_text="false" + top_pad="15" + width="525" /> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL12am" + follows="left|top|right" + height="6" + layout="topleft" + left="8" + name="WL12am" + top="74" + width="55"> + 12am + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL3am" + follows="left|top|right" + height="6" + layout="topleft" + left_pad="10" + name="WL3am" + top_delta="0" + width="55"> + 3am + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL6am" + follows="left|top|right" + height="6" + layout="topleft" + left_pad="10" + name="WL6am" + top_delta="0" + width="55"> + 6am + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL9am" + follows="left|top|right" + height="6" + layout="topleft" + left_pad="10" + name="WL9amHash" + top_delta="0" + width="55"> + 9am + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL12pm" + follows="left|top|right" + height="6" + layout="topleft" + left_pad="10" + name="WL12pmHash" + top_delta="0" + width="55"> + 12pm + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL3pm" + follows="left|top|right" + height="6" + layout="topleft" + left_pad="10" + name="WL3pm" + top_delta="0" + width="55"> + 3pm + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL6pm" + follows="left|top|right" + height="6" + layout="topleft" + left_pad="10" + name="WL6pm" + top_delta="0" + width="55"> + 6pm + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL9pm" + follows="left|top|right" + height="6" + layout="topleft" + left_pad="10" + name="WL9pm" + top_delta="0" + width="55"> + 9pm + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL12am2" + follows="left|top|right" + height="6" + layout="topleft" + left_pad="10" + name="WL12am2" + top_delta="0" + width="55"> + 12am + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL12amHash" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left="20" + name="WL12amHash" + top="54" + width="4"> + | + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL3amHash" + follows="left|top|right" + font="SansSerif" + height="11" + layout="topleft" + left_pad="61" + name="WL3amHash" + top_delta="3" + width="4"> + I + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL6amHash" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="61" + name="WL6amHash" + top_delta="-3" + width="4"> + | + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL9amHash" + follows="left|top|right" + font="SansSerif" + height="11" + layout="topleft" + left_pad="61" + name="WL9amHash2" + top_delta="3" + width="4"> + I + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL12pmHash" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="61" + name="WL12pmHash2" + top_delta="-3" + width="4"> + | + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL3pmHash" + follows="left|top|right" + font="SansSerif" + height="11" + layout="topleft" + left_pad="61" + name="WL3pmHash" + top_delta="3" + width="4"> + I + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL6pmHash" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="61" + name="WL6pmHash" + top_delta="-3" + width="4"> + | + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL9pmHash" + follows="left|top|right" + font="SansSerif" + height="11" + layout="topleft" + left_pad="61" + name="WL9pmHash" + top_delta="3" + width="4"> + I + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WL12amHash2" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="61" + name="WL12amHash2" + top_delta="-3" + width="4"> + | + </text> + <button + height="20" + label="Add Key" + label_selected="Add Key" + layout="topleft" + left="550" + name="WLAddKey" + top="20" + width="80" /> + <button + height="20" + label="Delete Key" + label_selected="Delete Key" + layout="topleft" + left_delta="0" + name="WLDeleteKey" + top_pad="5" + width="80" /> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="DayCycleText" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="20" + name="WLCurKeyFrameText" + top="104" + width="150"> + Key Frame Settings: + </text> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="DayCycleText" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="30" + name="WLCurKeyTimeText" + top="124" + width="100"> + Key Time: + </text> + <spinner + control_name="WLCurKeyHour" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="0" + label="Hour" + label_width="30" + layout="topleft" + left_delta="0" + max_val="100" + name="WLCurKeyHour" + top_pad="4" + width="70" /> + <spinner + control_name="WLCurKeyMin" + decimal_digits="0" + follows="left|top" + height="16" + increment="5" + initial_value="0" + label="Min" + label_width="20" + layout="topleft" + left_pad="5" + max_val="55" + name="WLCurKeyMin" + top_delta="0" + width="60" /> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="WLCurKeyTimeText" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="30" + name="WLCurKeyTimeText2" + top="169" + width="120"> + Key Preset: + </text> + <combo_box + height="18" + label="Preset" + layout="topleft" + left_delta="0" + name="WLKeyPresets" + top_pad="7" + width="155" /> + <view_border + bevel_style="none" + follows="top|left" + height="115" + layout="topleft" + left="12" + top="101" + width="190" /> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="DayCycleText" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="220" + name="DayCycleText" + top="114" + width="120"> + Snap: + </text> + <combo_box + enabled="false" + height="18" + label="5 min" + layout="topleft" + left_delta="0" + name="WLSnapOptions" + top_pad="7" + width="70" /> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="DayCycleText" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="DayCycleText2" + top_pad="9" + width="120"> + Length of Cycle: + </text> + <spinner + control_name="WLLengthOfDayHour" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="0" + label="Hour" + label_width="30" + layout="topleft" + left_delta="0" + max_val="100" + name="WLLengthOfDayHour" + top_pad="4" + width="70" /> + <spinner + control_name="WLLengthOfDayMin" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="0" + label="Min" + label_width="20" + layout="topleft" + left_pad="5" + max_val="59" + name="WLLengthOfDayMin" + top_delta="0" + width="60" /> + <spinner + control_name="WLLengthOfDaySec" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="24" + label="Sec" + label_width="20" + layout="topleft" + left_pad="5" + max_val="59" + name="WLLengthOfDaySec" + top_delta="0" + width="60" /> + <text + type="string" + length="1" + bg_visible="true" + border_visible="true" + control_name="DayCycleText" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="310" + name="DayCycleText3" + top="114" + width="120"> + Preview: + </text> + <button + height="20" + label="Play" + label_selected="Play" + layout="topleft" + left_delta="0" + name="WLAnimSky" + top_pad="5" + width="50" /> + <button + height="20" + label="Stop!" + label_selected="Stop" + layout="topleft" + left_pad="5" + name="WLStopAnimSky" + top_delta="0" + width="50" /> + <button + height="20" + label="Use Estate Time" + label_selected="Go to Estate Time" + layout="topleft" + left_pad="5" + name="WLUseLindenTime" + top_delta="0" + width="140" /> + <button + height="20" + label="Save Test Day" + label_selected="Save Test Day" + layout="topleft" + left="480" + name="WLSaveDayCycle" + top="175" + width="150" /> + <button + height="20" + label="Load Test Day" + label_selected="Load Test Day" + layout="topleft" + left_delta="0" + name="WLLoadDayCycle" + top_pad="5" + width="150" /> + </panel> + </tab_container> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_device_settings.xml b/indra/newview/skins/default/xui/en/floater_device_settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..fa0cce3795a9bfc55c40a8ab8902cab7d61a1567 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_device_settings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="260" + layout="topleft" + name="floater_device_settings" + title="Voice Chat Device Settings" + width="405"> + <panel + bottom="260" + filename="panel_audio_device.xml" + layout="topleft" + left="2" + name="device_settings" + right="-5" + top="20" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_env_settings.xml b/indra/newview/skins/default/xui/en/floater_env_settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..8bb67d0d4bb6950f95465e1a4e0bbc4708debd68 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_env_settings.xml @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="150" + layout="topleft" + name="Environment Editor Floater" + save_rect="true" + title="Environment Editor" + width="600"> + <floater.string + name="timeStr"> + [hour12,datetime,utc]:[min,datetime,utc] [ampm,datetime,utc] + </floater.string> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="10" + name="EnvTimeText" + top="32" + width="140"> + Time of Day + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="16" + layout="topleft" + left="15" + name="EnvTimeText2" + top="62" + width="140"> + 12:00 PM + </text> + <icon + height="25" + image_name="icon_diurnal.tga" + layout="topleft" + left="85" + name="EnvDayCycle" + top="30" + width="200" /> + <slider + control_name="EnvTimeSlider" + decimal_digits="2" + follows="left" + height="10" + increment="0.0069444" + initial_value="0.7" + layout="topleft" + left_delta="0" + max_val="0.99" + name="EnvTimeSlider" + show_text="false" + top_pad="10" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="10" + name="EnvCloudText" + top="86" + width="140"> + Cloud Cover + </text> + <slider + control_name="EnvCloudSlider" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="75" + name="EnvCloudSlider" + top_delta="4" + width="210" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="310" + name="EnvWaterColorText" + top="39" + width="140"> + Water Color + </text> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + color="0.5 0.5 0.5 1" + follows="left|top" + height="50" + layout="topleft" + left="390" + name="EnvWaterColor" + tool_tip="Click to open Color Picker" + top="30" + width="40" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="310" + name="EnvWaterFogText" + top="86" + width="140"> + Water Fog + </text> + <slider + control_name="EnvWaterFogSlider" + decimal_digits="2" + follows="left" + height="10" + initial_value="0" + layout="topleft" + left_delta="75" + max_val="10" + name="EnvWaterFogSlider" + top_delta="4" + width="210" /> + <button + follows="left|top" + font="SansSerifSmall" + height="20" + label="Use Estate Time" + layout="topleft" + left="8" + name="EnvUseEstateTimeButton" + top="120" + width="137" /> + <button + follows="left|top" + font="SansSerifSmall" + height="20" + label="Advanced Sky" + layout="topleft" + left_pad="9" + name="EnvAdvancedSkyButton" + top_delta="0" + width="137" /> + <button + follows="left|top" + font="SansSerifSmall" + height="20" + label="Advanced Water" + layout="topleft" + left_pad="9" + name="EnvAdvancedWaterButton" + top_delta="0" + width="137" /> + <button + follows="left|top" + height="18" + label="?" + layout="topleft" + left="570" + name="EnvSettingsHelpButton" + top="22" + width="18" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_font_test.xml b/indra/newview/skins/default/xui/en/floater_font_test.xml new file mode 100644 index 0000000000000000000000000000000000000000..8babbaa2733cef97e51c8dd46d7ab94c50eaa549 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_font_test.xml @@ -0,0 +1,336 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="800" + layout="topleft" + min_height="175" + min_width="154" + name="contents" + title="Font Test" + width="500"> + <text + type="string" + length="1" + bottom_delta="40" + follows="left|top|right" + height="16" + layout="topleft" + left="16"> + SansSerifSmall + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="SansSerifMedium" + height="16" + layout="topleft" + left="16"> + SansSerifMedium + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="16"> + SansSerif, no size or style (should be same as medium) + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="SansSerifLarge" + height="16" + layout="topleft" + left="16"> + SansSerifLarge + </text> + <text + type="string" + length="1" + bottom_delta="36" + follows="left|top|right" + font="SansSerifHuge" + height="32" + layout="topleft" + left="16"> + SansSerifHuge + </text> + <text + type="string" + length="1" + bottom_delta="40" + follows="left|top|right" + font="Monospace" + height="16" + layout="topleft" + left="16"> + Monospace + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="Monospace" + font.size="Large" + height="16" + layout="topleft" + left="16"> + Monospace size=Large + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="SansSerifLarge" + font.style="BOLD" + height="16" + layout="topleft" + left="16"> + SansSerifLarge style=BOLD + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="SansSerifBold" + height="16" + layout="topleft" + left="16"> + SansSerifBold + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="SansSerif" + font.style="BOLD" + height="16" + layout="topleft" + left="16"> + SansSerif style=BOLD (should be same as SansSerifBold) + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="SansSerif" + font.style="ITALIC" + height="16" + layout="topleft" + left="16"> + SansSerif style=ITALIC + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="SansSerif" + font.style="BOLD|ITALIC" + height="16" + layout="topleft" + left="16"> + SansSerif style=BOLD|ITALIC + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="SansSerif" + font.style="BOLD|ITALIC" + height="16" + layout="topleft" + left="16"> + SansSerif style=BOLD|ITALIC shadow=soft + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="SansSerif" + font.style="UNDERLINE" + height="16" + layout="topleft" + left="16"> + SansSerif style=UNDERLINE + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="SansSerif" + font_shadow="hard" + height="16" + layout="topleft" + left="16"> + SansSerif style=hard + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="16"> + SansSerif shadow=soft + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="DejaVu" + height="16" + layout="topleft" + left="16"> + DejaVu + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="DejaVu" + font.style="BOLD" + height="16" + layout="topleft" + left="16"> + DejaVu style=BOLD + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="DejaVu" + font.style="ITALIC" + height="16" + layout="topleft" + left="16"> + DejaVu style=ITALIC + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="DejaVu" + font.style="BOLD|ITALIC" + height="16" + layout="topleft" + left="16"> + DejaVu style=BOLD|ITALIC + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="DejaVu" + font.size="Large" + font.style="BOLD|ITALIC" + height="16" + layout="topleft" + left="16"> + DejaVu size=Large style=BOLD|ITALIC + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="Helvetica" + height="16" + layout="topleft" + left="16"> + Helvetica + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="Helvetica" + font.style="BOLD" + height="16" + layout="topleft" + left="16"> + Helvetica style=BOLD + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="Helvetica" + font.style="ITALIC" + height="16" + layout="topleft" + left="16"> + Helvetica style=ITALIC + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="Helvetica" + font.style="BOLD|ITALIC" + height="16" + layout="topleft" + left="16"> + Helvetica style=BOLD|ITALIC + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="Helvetica" + font.size="Large" + font.style="BOLD|ITALIC" + height="16" + layout="topleft" + left="16"> + Helvetica size=Large style=BOLD|ITALIC + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + font="OverrideTest" + height="16" + layout="topleft" + left="16" + name="linea"> + OverrideTest, should be times, from default/xui/en + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="left|top|right" + height="16" + layout="topleft" + left="16"> + BogusFontName + </text> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_gesture.xml b/indra/newview/skins/default/xui/en/floater_gesture.xml new file mode 100644 index 0000000000000000000000000000000000000000..c4d024ae8b91bd005908d99e234caa83f5011ad7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_gesture.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="465" + layout="topleft" + min_height="200" + min_width="350" + name="gestures" + title="Active Gestures" + width="350"> + <floater.string + name="loading"> + Loading... + </floater.string> + <floater.string + name="playing"> + (Playing) + </floater.string> + <text + type="string" + length="1" + bottom="30" + follows="top|left" + layout="topleft" + left="15" + name="help_label"> + Double-click a gesture to play animations and sounds. + </text> + <scroll_list + bottom_delta="390" + draw_heading="true" + follows="top|left|bottom|right" + height="380" + layout="topleft" + left="15" + name="gesture_list" + right="-15"> + <scroll_list.columns + label="Trigger" + name="trigger" + width="70" /> + <scroll_list.columns + label="Key" + name="shortcut" + width="70" /> + <scroll_list.columns + label="" + name="key" + width="-1" /> + <scroll_list.columns + label="Name" + name="name" + width="160" /> + </scroll_list> + <button + follows="bottom|right" + height="20" + label="New" + layout="topleft" + left_delta="0" + name="new_gesture_btn" + top_pad="10" + width="83" /> + <button + follows="bottom|right" + height="20" + label="Edit" + layout="topleft" + left_pad="6" + name="edit_btn" + top_delta="0" + width="83" /> + <button + follows="bottom|right" + height="20" + label="Play" + layout="topleft" + left_pad="6" + name="play_btn" + top_delta="0" + width="83" /> + <button + follows="bottom|right" + height="20" + label="Stop" + layout="topleft" + left_delta="0" + name="stop_btn" + top_delta="0" + width="83" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_god_tools.xml b/indra/newview/skins/default/xui/en/floater_god_tools.xml new file mode 100644 index 0000000000000000000000000000000000000000..e35ab3ea49b37e025b33d1bdd0e09837cbcb4272 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_god_tools.xml @@ -0,0 +1,685 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="384" + layout="topleft" + name="godtools floater" + title="God Tools" + width="400"> + <tab_container + follows="left|top" + height="364" + layout="topleft" + left="0" + name="GodTools Tabs" + tab_position="top" + top="20" + width="400"> + <panel + border="true" + follows="left|top|right|bottom" + height="347" + label="Grid" + layout="topleft" + left="1" + mouse_opaque="false" + name="grid" + top="16" + width="398"> + <button + follows="left|top" + height="20" + label="Kick all users" + label_selected="Kick all users" + layout="topleft" + left="10" + name="Kick all users" + top="8" + width="100" /> + <button + follows="left|top" + height="20" + label="Flush This Region's Map Visibility Caches" + label_selected="Flush This Region's Map Visibility Caches" + layout="topleft" + left_delta="0" + name="Flush This Region's Map Visibility Caches" + top_pad="8" + width="250" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="347" + label="Region" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="region" + top_delta="0" + width="398"> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="Sim Name:" + top="10" + width="50"> + Sim Name: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="10" + max_length="63" + name="region name" + top_delta="0" + width="208" /> + <check_box + height="16" + label="Prelude" + layout="topleft" + left="10" + name="check prelude" + tool_tip="Set this to make the region a prelude." + top="30" + width="180" /> + <check_box + height="16" + label="Fixed Sun" + layout="topleft" + left_delta="0" + name="check fixed sun" + tool_tip="Fix the sun position (like in Region/Estate > Terrain." + top_pad="4" + width="180" /> + <check_box + height="16" + label="Reset Home On Teleport" + layout="topleft" + left_delta="0" + name="check reset home" + tool_tip="When resident teleports out, reset their home to the destination position." + top_pad="4" + width="180" /> + <check_box + height="16" + label="Visible" + layout="topleft" + left_delta="0" + name="check visible" + tool_tip="Set this to make the region visible to non-gods." + top_pad="4" + width="180" /> + <check_box + height="16" + label="Damage" + layout="topleft" + left_delta="0" + name="check damage" + tool_tip="Set this to enable damage in this region." + top_pad="4" + width="180" /> + <check_box + height="16" + label="Block Traffic Tracking" + layout="topleft" + left_delta="0" + name="block dwell" + tool_tip="Set this to make the region not compute traffic." + top_pad="4" + width="180" /> + <check_box + height="16" + label="Block Terraform" + layout="topleft" + left_delta="0" + name="block terraform" + tool_tip="Set this to disallow people terraforming their land" + top_pad="4" + width="180" /> + <check_box + height="16" + label="Sandbox" + layout="topleft" + left_delta="0" + name="is sandbox" + tool_tip="Toggle whether this is a sandbox region." + top_pad="4" + width="180" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Bake Terrain" + label_selected="Bake Terrain" + layout="topleft" + left_delta="-2" + name="Bake Terrain" + tool_tip="Save the current terrain as default." + top_pad="32" + width="110" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Revert Terrain" + label_selected="Revert Terrain" + layout="topleft" + left_delta="0" + name="Revert Terrain" + tool_tip="Replace the current terrain with default." + top_pad="4" + width="110" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Swap Terrain" + label_selected="Swap Terrain" + layout="topleft" + left_delta="0" + name="Swap Terrain" + tool_tip="Swap current terrain with default." + top_pad="4" + width="110" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left="200" + name="estate id" + top="30" + width="190"> + Estate ID: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="top|right" + height="16" + layout="topleft" + left_delta="108" + max_length="10" + name="estate" + top_delta="0" + width="50" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left="200" + name="parent id" + top="50" + width="190"> + Parent ID: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="top|right" + height="16" + layout="topleft" + left_delta="108" + max_length="10" + name="parentestate" + tool_tip="This is the parent estate for this region" + top_delta="0" + width="50" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="200" + name="Grid Pos: " + top="70" + width="190"> + Grid Pos: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="top|right" + height="16" + layout="topleft" + left_delta="88" + max_length="10" + name="gridposx" + tool_tip="This is the grid x position for this region" + top_delta="0" + width="50" /> + <line_editor + border_style="line" + border_thickness="1" + follows="top|right" + height="16" + layout="topleft" + left_pad="10" + max_length="10" + name="gridposy" + tool_tip="This is the grid y position for this region" + top_delta="0" + width="40" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="200" + name="Redirect to Grid: " + top="90" + width="190"> + Redirect to Grid: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="top|right" + height="16" + layout="topleft" + left_delta="88" + max_length="10" + name="redirectx" + top_delta="0" + width="50" /> + <line_editor + border_style="line" + border_thickness="1" + follows="top|right" + height="16" + layout="topleft" + left_pad="10" + max_length="10" + name="redirecty" + top_delta="0" + width="40" /> + <spinner + follows="top|right" + height="16" + initial_value="1" + layout="topleft" + left="308" + max_val="4" + name="billable factor" + top="110" + width="80" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-108" + name="billable factor text" + top_delta="0" + width="110"> + Billable Factor: + </text> + <spinner + follows="top|right" + height="16" + increment="1" + initial_value="1" + layout="topleft" + left="308" + max_val="100" + name="land cost" + top="130" + width="80" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-108" + name="land cost text" + top_delta="0" + width="110"> + L$ per sq. meter: + </text> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Refresh" + label_selected="Refresh" + layout="topleft" + left="278" + name="Refresh" + tool_tip="Click here to refresh the above information." + top="150" + width="110" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Apply" + label_selected="Apply" + layout="topleft" + left_delta="0" + name="Apply" + tool_tip="Click here to apply any changes from above." + top_pad="36" + width="110" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Select Region" + label_selected="Select Region" + layout="topleft" + left="128" + name="Select Region" + tool_tip="Select the whole region with the land tool." + top="238" + width="110" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Autosave now" + label_selected="Autosave now" + layout="topleft" + left_delta="0" + name="Autosave now" + tool_tip="Save gzipped state to autosave directory." + top_pad="4" + width="110" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="347" + label="Objects" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="objects" + top_delta="0" + width="398"> + <panel.string + name="no_target"> + (no target) + </panel.string> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="Sim Name:" + top="10" + width="50"> + Sim Name: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_pad="10" + name="region name" + top_delta="0" + width="320"> + Welsh + </text> + <check_box + height="16" + label="Disable Scripts" + layout="topleft" + left="10" + name="disable scripts" + tool_tip="Set this to disable all scripts in this region" + top="30" + width="110" /> + <check_box + height="16" + label="Disable Collisions" + layout="topleft" + left_pad="10" + name="disable collisions" + tool_tip="Set this to disable non-agent collisions in this region" + top_delta="0" + width="121" /> + <check_box + height="16" + label="Disable Physics" + layout="topleft" + left_delta="120" + name="disable physics" + tool_tip="Set this to disable all physics in this region" + top_delta="0" + width="130" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Apply" + label_selected="Apply" + layout="topleft" + left="278" + name="Apply" + tool_tip="Click here to apply any changes from above." + top="54" + width="110" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Set Target" + label_selected="Set Target" + layout="topleft" + left="8" + name="Set Target" + tool_tip="Set the target avatar for object deletion." + top="78" + width="110" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_pad="12" + name="target_avatar_name" + top_delta="0" + width="260"> + (no target) + </text> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Delete Target's Scripted Objects On Others Land" + label_selected="Delete Target's Scripted Objects On Others Land" + layout="topleft" + left="8" + name="Delete Target's Scripted Objects On Others Land" + tool_tip="Delete all scripted objects owned by the target on land not owned by the target. (no copy) objects will be returned." + top="126" + width="380" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Delete Target's Scripted Objects On *Any* Land" + label_selected="Delete Target's Scripted Objects On *Any* Land" + layout="topleft" + left_delta="0" + name="Delete Target's Scripted Objects On *Any* Land" + tool_tip="Delete all scripted objects owned by the target in this region. (no copy) objects will be returned." + top_pad="28" + width="380" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Delete *ALL* Of Target's Objects" + label_selected="Delete *ALL* Of Target's Objects" + layout="topleft" + left_delta="0" + name="Delete *ALL* Of Target's Objects" + tool_tip="Delete all objects owned by the target in this region. (no copy) objects will be returned." + top_pad="28" + width="380" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Get Top Colliders" + label_selected="Get Top Colliders" + layout="topleft" + left_delta="0" + name="Get Top Colliders" + tool_tip="Gets list of objects experiencing the most narrowphase callbacks." + top_pad="28" + width="110" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Get Top Scripts" + label_selected="Get Top Scripts" + layout="topleft" + left_delta="0" + name="Get Top Scripts" + tool_tip="Gets list of objects spending the most time running scripts." + top_pad="4" + width="110" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Scripts digest" + label_selected="Scripts digest" + layout="topleft" + left_delta="0" + name="Scripts digest" + tool_tip="Gets a list of all scripts and number of occurences of each." + top_pad="4" + width="110" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="347" + label="Request" + layout="topleft" + left_delta="0" + name="request" + top_delta="0" + width="398"> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="Destination:" + top="4" + width="80"> + Destination: + </text> + <combo_box + height="16" + layout="topleft" + left_pad="10" + name="destination" + top_delta="0" + width="290"> + <combo_box.item + label="Selection" + value="Selection" /> + <combo_box.item + label="Agent Region" + value="Agent Region" /> + </combo_box> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="Request:" + top="28" + width="80"> + Request: + </text> + <combo_box + allow_text_entry="true" + height="16" + layout="topleft" + left_pad="10" + name="request" + top_delta="0" + width="290"> + <combo_box.item + label="colliders <steps>" + value="colliders <steps>" /> + <combo_box.item + label="scripts <count>,<optional pattern>" + value="scripts <count>,<optional pattern>" /> + <combo_box.item + label="objects <pattern>" + value="objects <pattern>" /> + <combo_box.item + label="rez <asset_id>" + value="rez <asset_id>" /> + </combo_box> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="Parameter:" + top="52" + width="80"> + Parameter: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="10" + max_length="63" + name="parameter" + top_delta="0" + width="290" /> + <button + follows="left|top" + height="20" + label="Make Request" + label_selected="Make Request" + layout="topleft" + left="10" + name="Make Request" + top="96" + width="100" /> + </panel> + </tab_container> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..f0e2911fd82e95032eca51f85a07bc231dad2bae --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -0,0 +1,158 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="224" + layout="topleft" + name="Hardware Settings Floater" + title="Hardware Settings" + width="500"> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="10" + name="Filtering:" + top="30" + width="128"> + Filtering: + </text> + <check_box + control_name="RenderAnisotropic" + height="16" + label="Anisotropic Filtering (slower when enabled)" + layout="topleft" + left_pad="10" + name="ani" + top_delta="0" + width="256" /> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="10" + name="Antialiasing:" + top="49" + width="128"> + Antialiasing: + </text> + <combo_box + control_name="RenderFSAASamples" + height="16" + initial_value="false" + label="Antialiasing" + layout="topleft" + left_pad="10" + name="fsaa" + top_delta="0" + width="64"> + <combo_box.item + label="Disabled" + value="0" /> + <combo_box.item + label="2x" + value="2" /> + <combo_box.item + label="4x" + value="4" /> + <combo_box.item + label="8x" + value="8" /> + <combo_box.item + label="16x" + value="16" /> + </combo_box> + <spinner + control_name="RenderGamma" + decimal_digits="2" + follows="left|top" + height="16" + increment="0.01" + initial_value="1" + label="Gamma:" + label_width="138" + layout="topleft" + left="10" + max_val="2" + name="gamma" + top="70" + width="202" /> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_pad="10" + name="(brightness, lower is brighter)" + top_delta="2" + width="315"> + (brightness, lower is brighter, 0=use default) + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="10" + name="Enable VBO:" + top="92" + width="128"> + Enable VBO: + </text> + <check_box + control_name="RenderVBOEnable" + height="16" + initial_value="true" + label="Enable OpenGL Vertex Buffer Objects" + layout="topleft" + left_pad="10" + name="vbo" + tool_tip="Enabling this on modern hardware gives a performance gain. However, older hardware often has poor implementations of VBOs and you may get crashes when this is enabled." + top_delta="1" + width="315" /> + <slider + control_name="TextureMemory" + decimal_digits="0" + follows="left|top" + height="16" + increment="16" + initial_value="32" + label="Texture Memory (MB):" + label_width="135" + layout="topleft" + left="10" + max_val="4096" + name="GrapicsCardTextureMemory" + tool_tip="Amount of memory to allocate for textures. Defaults to Video Card Memory. Reducing this may improve performance but may also make textures blurry." + top="114" + width="300" /> + <spinner + control_name="RenderFogRatio" + decimal_digits="1" + follows="left|top" + height="16" + initial_value="4" + label="Fog Distance Ratio:" + label_width="138" + layout="topleft" + left_delta="0" + max_val="10" + min_val="0.5" + name="fog" + top_pad="8" + width="202" /> + <button + follows="right|bottom" + height="20" + label="OK" + label_selected="OK" + layout="topleft" + left="-110" + name="OK" + top="194" + width="90" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_hud.xml b/indra/newview/skins/default/xui/en/floater_hud.xml new file mode 100644 index 0000000000000000000000000000000000000000..f62b7eece0b25ec797ef73c9c5691453108dc989 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_hud.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + height="292" + layout="topleft" + name="floater_hud" + title="Tutorial" + width="362"> + <web_browser + border_visible="false" + caret_color="1 1 1 1" + follows="top|left|bottom|right" + height="265" + layout="topleft" + left="1" + name="floater_hud_browser" + start_url="data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody bgcolor=%22#000000%22 text=%22ffffff%22%3E%3Ch1%3E%3Ctt%3E%0D%0A%0D%0ALoading...%3C/tt%3E%3C/h1%3E%3C/body%3E%3C/html%3E" + top="26" + width="360" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_im.xml b/indra/newview/skins/default/xui/en/floater_im.xml new file mode 100644 index 0000000000000000000000000000000000000000..7493a9a90d7ef86dfaab3a470e99396f595efb23 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_im.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<multi_floater + can_resize="true" + follows="left|bottom" + height="422" + layout="topleft" + min_height="130" + min_width="350" + name="im_floater" + save_rect="true" + title="Instant Message" + width="419"> + <multi_floater.string + name="only_user_message"> + You are the only user in this session. + </multi_floater.string> + <multi_floater.string + name="offline_message"> + [FIRST] [LAST] is offline. + </multi_floater.string> + <multi_floater.string + name="invite_message"> + Click the [BUTTON NAME] button to accept/connect to this voice chat. + </multi_floater.string> + <multi_floater.string + name="muted_message"> + You have muted this resident. Sending a message will automatically unmute them. + </multi_floater.string> + <multi_floater.string + name="generic_request_error"> + Error making request, please try again later. + </multi_floater.string> + <multi_floater.string + name="insufficient_perms_error"> + You do not have sufficient permissions. + </multi_floater.string> + <multi_floater.string + name="session_does_not_exist_error"> + The session no longer exists + </multi_floater.string> + <multi_floater.string + name="no_ability_error"> + You do not have that ability. + </multi_floater.string> + <multi_floater.string + name="not_a_mod_error"> + You are not a session moderator. + </multi_floater.string> + <multi_floater.string + name="muted_error"> + A group moderator disabled your text chat. + </multi_floater.string> + <multi_floater.string + name="add_session_event"> + Unable to add users to chat session with [RECIPIENT]. + </multi_floater.string> + <multi_floater.string + name="message_session_event"> + Unable to send your message to the chat session with [RECIPIENT]. + </multi_floater.string> + <multi_floater.string + name="removed_from_group"> + You have been removed from the group. + </multi_floater.string> + <multi_floater.string + name="close_on_no_ability"> + You no longer have the ability to be in the chat session. + </multi_floater.string> + <tab_container + follows="left|top|right|bottom" + height="406" + layout="topleft" + left="1" + name="Preview Tabs" + tab_position="bottom" + top="16" + width="417" /> +</multi_floater> diff --git a/indra/newview/skins/default/xui/en/floater_image_preview.xml b/indra/newview/skins/default/xui/en/floater_image_preview.xml new file mode 100644 index 0000000000000000000000000000000000000000..907376b1e92f42bdbeb7f9aeeb53ddbcad7e407c --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_image_preview.xml @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + height="440" + layout="topleft" + name="Image Preview" + width="300"> + <text + type="string" + length="1" + bottom_delta="40" + follows="top|left" + height="15" + layout="topleft" + left="10" + name="name_label"> + Name: + </text> + <line_editor + follows="top|left|right" + height="19" + layout="topleft" + left_delta="0" + name="name_form" + top_pad="5" + width="280" /> + <text + type="string" + length="1" + bottom_delta="20" + follows="top|left" + height="15" + layout="topleft" + name="description_label"> + Description: + </text> + <line_editor + follows="top|left|right" + height="19" + layout="topleft" + left_delta="0" + name="description_form" + top_pad="5" + width="280" /> + <text + type="string" + length="1" + bottom_delta="20" + follows="top|left" + height="15" + layout="topleft" + name="preview_label"> + Preview image as: + </text> + <combo_box + height="18" + label="Clothing Type" + layout="topleft" + left_delta="110" + name="clothing_type_combo" + top_delta="3" + width="160"> + <combo_box.item + label="Image" /> + <combo_box.item + label="Hair" /> + <combo_box.item + label="Female Head" /> + <combo_box.item + label="Female Upper Body" /> + <combo_box.item + label="Female Lower Body" /> + <combo_box.item + label="Male Head" /> + <combo_box.item + label="Male Upper Body" /> + <combo_box.item + label="Male Lower Body" /> + <combo_box.item + label="Skirt" /> + <combo_box.item + label="Sculpted Prim" /> + </combo_box> + <text + type="string" + length="1" + bottom="190" + follows="top|left" + layout="topleft" + left="10" + name="bad_image_text"> + Unable to read image. + +Try saving image as 24 bit Targa (.tga). + </text> + <check_box + control_name="LosslessJ2CUpload" + enabled="false" + follows="bottom|left" + height="16" + label="Use lossless compression" + layout="topleft" + left_delta="2" + name="lossless_check" + top_pad="197" + width="280" /> + <button + follows="bottom|right" + height="20" + label="Cancel" + layout="topleft" + left="165" + name="cancel_btn" + top="410" + width="125" /> + <button + follows="bottom|left" + height="20" + label="Upload (L$[AMOUNT])" + layout="topleft" + left_delta="-150" + name="ok_btn" + top_delta="0" + width="125" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_incoming_call.xml b/indra/newview/skins/default/xui/en/floater_incoming_call.xml new file mode 100644 index 0000000000000000000000000000000000000000..5c4649276a15291b73ee6610963d32b5458a80ed --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_close="false" + can_minimize="false" + can_tear_off="false" + height="200" + layout="topleft" + name="incoming call" + title="Unknown Person is calling" + width="240"> + <floater.string + name="VoiceInviteP2P"> + is calling. + </floater.string> + <floater.string + name="VoiceInviteAdHoc"> + has joined a Voice Chat call with a conference chat. + </floater.string> + <avatar_icon + enabled="false" + follows="left|top" + height="36" + image_name="icon_avatar_online.tga" + layout="topleft" + left_delta="19" + top="35" + width="36" /> + <text_editor + font="SansSerif" + height="64" + hide_border="true" + hide_scrollbar="true" + layout="topleft" + left="77" + max_length="2147483647" + name="caller name" + read_only="true" + top="21" + width="163" + word_wrap="true" /> + <button + height="24" + label="Accept" + label_selected="Accept" + layout="topleft" + left="70" + name="Accept" + top="92" + width="100" /> + <button + height="24" + label="Reject" + label_selected="Reject" + layout="topleft" + left_delta="0" + name="Reject" + top_pad="12" + width="100" /> + <button + height="24" + label="Start IM" + layout="topleft" + left_delta="0" + name="Start IM" + top_pad="12" + width="100" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_inspect.xml b/indra/newview/skins/default/xui/en/floater_inspect.xml new file mode 100644 index 0000000000000000000000000000000000000000..ed3b4f00f22808dc3f1deb9e12e723dad49e5ac8 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_inspect.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="300" + layout="topleft" + min_height="300" + min_width="400" + name="inspect" + save_rect="true" + title="Inspect Objects" + width="400"> + <floater.string + name="timeStamp"> + [wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local] + </floater.string> + <scroll_list + bottom="270" + column_padding="0" + draw_heading="true" + follows="top|right|left|bottom" + layout="topleft" + left="10" + name="object_list" + right="-10" + tool_tip="Select an object from this list to highlight it in-world" + top="20"> + <scroll_list.columns + dynamicwidth="true" + label="Object Name" + name="object_name" /> + <scroll_list.columns + dynamicwidth="true" + label="Owner Name" + name="owner_name" /> + <scroll_list.columns + dynamicwidth="true" + label="Creator Name" + name="creator_name" /> + <scroll_list.columns + label="Creation Date" + name="creation_date" + width="150" /> + </scroll_list> + <button + follows="left|bottom" + height="20" + label="See Owner Profile..." + layout="topleft" + left_delta="0" + name="button owner" + tool_tip="See profile of the highlighted object's owner" + top_pad="5" + width="150" /> + <button + follows="left|bottom" + height="20" + label="See Creator Profile..." + layout="topleft" + left_pad="10" + name="button creator" + tool_tip="See profile of the highlighted object's original creator" + top_delta="0" + width="150" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_inventory.xml b/indra/newview/skins/default/xui/en/floater_inventory.xml new file mode 100644 index 0000000000000000000000000000000000000000..eb05fe18834ae7729834f0ec082e29df4e01a9b6 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_inventory.xml @@ -0,0 +1,423 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + auto_tile="true" + can_resize="true" + height="563" + layout="topleft" + min_height="150" + min_width="240" + name="Inventory" + save_rect="true" + save_visibility="true" + title="Inventory" + width="467"> + <floater.string + name="Title"> + Inventory + </floater.string> + <floater.string + name="Items"> + Items... + </floater.string> + <floater.string + name="Fetched"> + Fetched + </floater.string> + <search_editor + follows="left|top|right" + height="16" + label="Type here to search" + layout="topleft" + left="6" + name="inventory search editor" + top="34" + width="455" /> + <tab_container + follows="left|top|right|bottom" + height="508" + layout="topleft" + left_delta="-4" + name="inventory filter tabs" + tab_position="top" + top_pad="4" + width="463"> + <inventory_panel + follows="left|top|right|bottom" + height="491" + label="All Items" + layout="topleft" + left="1" + name="All Items" + top="16" + width="461" /> + <inventory_panel + follows="left|top|right|bottom" + height="491" + label="Recent Items" + layout="topleft" + left_delta="0" + name="Recent Items" + top_delta="0" + width="461" /> + </tab_container> + <menu_bar + bg_visible="false" + follows="left|top|right" + height="18" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="Inventory Menu" + top_delta="-38" + width="461"> + <menu + height="101" + label="File" + layout="topleft" + left="0" + mouse_opaque="false" + name="File" + tear_off="true" + top="-117" + width="128"> + <menu_item_call + label="Open" + layout="topleft" + name="Open"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="open" /> + </menu_item_call> + <menu + create_jump_keys="true" + label="Upload" + layout="topleft" + name="upload" + tear_off="true"> + <menu_item_call + label="Image (L$[COST])..." + layout="topleft" + name="Upload Image" + shortcut="control|U"> + <menu_item_call.on_click + function="File.UploadImage" + parameter="" /> + <menu_item_call.on_enable + function="File.EnableUpload" /> + </menu_item_call> + <menu_item_call + label="Sound (L$[COST])..." + layout="topleft" + name="Upload Sound"> + <menu_item_call.on_click + function="File.UploadSound" + parameter="" /> + <menu_item_call.on_enable + function="File.EnableUpload" /> + </menu_item_call> + <menu_item_call + label="Animation (L$[COST])..." + layout="topleft" + name="Upload Animation"> + <menu_item_call.on_click + function="File.UploadAnim" + parameter="" /> + <menu_item_call.on_enable + function="File.EnableUpload" /> + </menu_item_call> + <menu_item_call + label="Bulk (L$[COST] per file)..." + layout="topleft" + name="Bulk Upload"> + <menu_item_call.on_click + function="File.UploadBulk" + parameter="" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + </menu> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="New Window" + layout="topleft" + name="New Window"> + <menu_item_call.on_click + function="Inventory.NewWindow" /> + </menu_item_call> + <menu_item_separator + layout="topleft" + name="separator2" /> + <menu_item_call + label="Show Filters" + layout="topleft" + name="Show Filters"> + <menu_item_call.on_click + function="Inventory.ShowFilters" /> + </menu_item_call> + <menu_item_call + label="Reset Filters" + layout="topleft" + name="Reset Current"> + <menu_item_call.on_click + function="Inventory.ResetFilter" /> + </menu_item_call> + <menu_item_call + label="Close All Folders" + layout="topleft" + name="Close All Folders"> + <menu_item_call.on_click + function="Inventory.CloseAllFolders" /> + </menu_item_call> + <menu_item_separator + layout="topleft" + name="separator3" /> + <menu_item_call + label="Empty Trash" + layout="topleft" + name="Empty Trash"> + <menu_item_call.on_click + function="Inventory.EmptyTrash" /> + </menu_item_call> + <menu_item_call + label="Empty Lost And Found" + layout="topleft" + name="Empty Lost And Found"> + <menu_item_call.on_click + function="Inventory.EmptyLostAndFound" /> + </menu_item_call> + </menu> + <menu + height="121" + label="Create" + layout="topleft" + left="0" + mouse_opaque="false" + name="Create" + tear_off="true" + top="-201" + width="121"> + <menu_item_call + label="New Folder" + layout="topleft" + name="New Folder"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="category" /> + </menu_item_call> + <menu_item_call + label="New Script" + layout="topleft" + name="New Script"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="lsl" /> + </menu_item_call> + <menu_item_call + label="New Note" + layout="topleft" + name="New Note"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="notecard" /> + </menu_item_call> + <menu_item_call + label="New Gesture" + layout="topleft" + name="New Gesture"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="gesture" /> + </menu_item_call> + <menu + height="175" + label="New Clothes" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="New Clothes" + top_pad="514" + width="125"> + <menu_item_call + label="New Shirt" + layout="topleft" + name="New Shirt"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="shirt" /> + </menu_item_call> + <menu_item_call + label="New Pants" + layout="topleft" + name="New Pants"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="pants" /> + </menu_item_call> + <menu_item_call + label="New Shoes" + layout="topleft" + name="New Shoes"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="shoes" /> + </menu_item_call> + <menu_item_call + label="New Socks" + layout="topleft" + name="New Socks"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="socks" /> + </menu_item_call> + <menu_item_call + label="New Jacket" + layout="topleft" + name="New Jacket"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="jacket" /> + </menu_item_call> + <menu_item_call + label="New Skirt" + layout="topleft" + name="New Skirt"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="skirt" /> + </menu_item_call> + <menu_item_call + label="New Gloves" + layout="topleft" + name="New Gloves"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="gloves" /> + </menu_item_call> + <menu_item_call + label="New Undershirt" + layout="topleft" + name="New Undershirt"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="undershirt" /> + </menu_item_call> + <menu_item_call + label="New Underpants" + layout="topleft" + name="New Underpants"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="underpants" /> + </menu_item_call> + <menu_item_call + label="New Alpha" + layout="topleft" + name="New Alpha"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="alpha" /> + </menu_item_call> + <menu_item_call + label="New Tattoo" + layout="topleft" + name="New Tattoo"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="tattoo" /> + </menu_item_call> + </menu> + <menu + height="85" + label="New Body Parts" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="New Body Parts" + top_pad="514" + width="118"> + <menu_item_call + label="New Shape" + layout="topleft" + name="New Shape"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="shape" /> + </menu_item_call> + <menu_item_call + label="New Skin" + layout="topleft" + name="New Skin"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="skin" /> + </menu_item_call> + <menu_item_call + label="New Hair" + layout="topleft" + name="New Hair"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="hair" /> + </menu_item_call> + <menu_item_call + label="New Eyes" + layout="topleft" + name="New Eyes"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="eyes" /> + </menu_item_call> + </menu> + </menu> + <menu + height="49" + label="Sort" + layout="topleft" + left="0" + mouse_opaque="false" + name="Sort" + tear_off="true" + top="-113" + width="118"> + <menu_item_check + control_name="Inventory.SortByName" + label="By Name" + layout="topleft" + name="By Name"> + <menu_item_check.on_click + function="Inventory.SetSortBy" + parameter="name" /> + </menu_item_check> + <menu_item_check + control_name="Inventory.SortByDate" + label="By Date" + layout="topleft" + name="By Date"> + <menu_item_check.on_click + function="Inventory.SetSortBy" + parameter="date" /> + </menu_item_check> + <menu_item_separator + layout="topleft" /> + <menu_item_check + control_name="Inventory.FoldersAlwaysByName" + label="Folders Always By Name" + layout="topleft" + name="Folders Always By Name"> + <menu_item_check.on_click + function="Inventory.SetSortBy" + parameter="foldersalwaysbyname" /> + </menu_item_check> + <menu_item_check + control_name="Inventory.SystemFoldersToTop" + label="System Folders To Top" + layout="topleft" + name="System Folders To Top"> + <menu_item_check.on_click + function="Inventory.SetSortBy" + parameter="systemfolderstotop" /> + </menu_item_check> + </menu> + </menu_bar> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml new file mode 100644 index 0000000000000000000000000000000000000000..6cb044cda18080b70c8f4d7d48b53071a12ba4ff --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml @@ -0,0 +1,395 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + auto_tile="true" + height="320" + layout="topleft" + name="item properties" + save_rect="true" + title="Inventory Item Properties" + width="350"> + <floater.string + name="unknown"> + (unknown) + </floater.string> + <floater.string + name="public"> + (public) + </floater.string> + <floater.string + name="you_can"> + You can: + </floater.string> + <floater.string + name="owner_can"> + Owner can: + </floater.string> + <floater.string + name="acquiredDate"> + [wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local] + </floater.string> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="294" + mouse_opaque="true" + name="IconLocked" + top="5" + width="16" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="LabelItemNameTitle" + top="25" + width="78"> + Name: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + height="16" + layout="topleft" + left_delta="78" + max_length="63" + name="LabelItemName" + top_delta="0" + width="252" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="LabelItemDescTitle" + top="45" + width="78"> + Description: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + height="16" + layout="topleft" + left_delta="78" + max_length="127" + name="LabelItemDesc" + top_delta="0" + width="252" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="LabelCreatorTitle" + top="65" + width="78"> + Creator: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="78" + name="LabelCreatorName" + top_delta="0" + width="200"> + Nicole Linden + </text> + <button + follows="top|right" + font="SansSerifSmall" + height="16" + label="Profile..." + layout="topleft" + left_delta="174" + name="BtnCreator" + top_delta="0" + width="78" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="LabelOwnerTitle" + top="85" + width="78"> + Owner: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="78" + name="LabelOwnerName" + top_delta="0" + width="200"> + Thrax Linden + </text> + <button + follows="top|right" + font="SansSerifSmall" + height="16" + label="Profile..." + layout="topleft" + left_delta="174" + name="BtnOwner" + top_delta="0" + width="78" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="LabelAcquiredTitle" + top="105" + width="78"> + Acquired: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="78" + name="LabelAcquiredDate" + top_delta="0" + width="252"> + Wed May 24 12:50:46 2006 + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="OwnerLabel" + top="125" + width="78"> + You can: + </text> + <check_box + height="16" + label="Modify" + layout="topleft" + left_delta="0" + name="CheckOwnerModify" + top_pad="4" + width="78" /> + <check_box + height="16" + label="Copy" + layout="topleft" + left_delta="78" + name="CheckOwnerCopy" + top_delta="0" + width="88" /> + <check_box + height="16" + label="Resell/Give away" + layout="topleft" + left_delta="88" + name="CheckOwnerTransfer" + top_delta="0" + width="106" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="BaseMaskDebug" + top="155" + width="330"> + B: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="60" + name="OwnerMaskDebug" + top_delta="0" + width="270"> + O: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="60" + name="GroupMaskDebug" + top_delta="0" + width="210"> + G: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="60" + name="EveryoneMaskDebug" + top_delta="0" + width="150"> + E: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="60" + name="NextMaskDebug" + top_delta="0" + width="90"> + N: + </text> + <check_box + height="16" + label="Share with group" + layout="topleft" + left="10" + name="CheckShareWithGroup" + top="171" + width="106" /> + <check_box + height="16" + label="Allow anyone to copy" + layout="topleft" + left_delta="0" + name="CheckEveryoneCopy" + top_pad="16" + width="130" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="NextOwnerLabel" + top_pad="16" + width="88"> + Next owner can: + </text> + <check_box + height="16" + label="Modify" + layout="topleft" + left_delta="0" + name="CheckNextOwnerModify" + top_pad="4" + width="78" /> + <check_box + height="16" + label="Copy" + layout="topleft" + left_delta="78" + name="CheckNextOwnerCopy" + top_delta="0" + width="88" /> + <check_box + height="16" + label="Resell/Give away" + layout="topleft" + left_delta="88" + name="CheckNextOwnerTransfer" + top_delta="0" + width="106" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="SaleLabel" + top="265" + width="330"> + Mark Item: + </text> + <check_box + height="16" + label="For Sale" + layout="topleft" + left_delta="0" + name="CheckPurchase" + top_pad="4" + width="78" /> + <radio_group + draw_border="false" + follows="left|top|right" + height="16" + layout="topleft" + left_delta="78" + name="RadioSaleType" + top_delta="0" + width="252"> + <radio_item + height="16" + label="Original" + layout="topleft" + left="0" + name="radio" + top="0" + width="70" /> + <radio_item + height="16" + label="Copy" + layout="topleft" + left_delta="60" + name="radio2" + top_delta="0" + width="70" /> + </radio_group> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="42" + name="TextPrice" + top="299" + width="56"> + Price: L$ + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + height="16" + layout="topleft" + left_delta="56" + max_length="25" + name="EditPrice" + top_delta="0" + width="242" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml new file mode 100644 index 0000000000000000000000000000000000000000..8bff916f9d7114004a1904d8c2d08fdd3a19fb16 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml @@ -0,0 +1,281 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + height="408" + layout="topleft" + name="Inventory Finder" + title="inventory_recent_items" + width="160"> + <icon + height="16" + image_name="inv_item_animation.tga" + layout="topleft" + left="8" + mouse_opaque="true" + name="icon_animation" + top="22" + width="16" /> + <check_box + height="16" + label="Animation" + layout="topleft" + left_pad="2" + name="check_animation" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_callingcard_online.tga" + layout="topleft" + left="8" + mouse_opaque="true" + name="icon_calling_card" + top="42" + width="16" /> + <check_box + height="16" + label="Calling Cards" + layout="topleft" + left_pad="2" + name="check_calling_card" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_shirt.tga" + layout="topleft" + left="8" + mouse_opaque="true" + name="icon_clothing" + top="62" + width="16" /> + <check_box + height="16" + label="Clothing" + layout="topleft" + left_pad="2" + name="check_clothing" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_gesture.tga" + layout="topleft" + left="8" + mouse_opaque="true" + name="icon_gesture" + top="82" + width="16" /> + <check_box + height="16" + label="Gestures" + layout="topleft" + left_pad="2" + name="check_gesture" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_landmark_visited.tga" + layout="topleft" + left="8" + mouse_opaque="true" + name="icon_landmark" + top="102" + width="16" /> + <check_box + height="16" + label="Landmarks" + layout="topleft" + left_pad="2" + name="check_landmark" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_notecard.tga" + layout="topleft" + left="8" + mouse_opaque="true" + name="icon_notecard" + top="122" + width="16" /> + <check_box + height="16" + label="Notecards" + layout="topleft" + left_pad="2" + name="check_notecard" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_object.tga" + layout="topleft" + left="8" + mouse_opaque="true" + name="icon_object" + top="142" + width="16" /> + <check_box + height="16" + label="Objects" + layout="topleft" + left_pad="2" + name="check_object" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_script.tga" + layout="topleft" + left="8" + mouse_opaque="true" + name="icon_script" + top="162" + width="16" /> + <check_box + height="16" + label="Scripts" + layout="topleft" + left_pad="2" + name="check_script" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_sound.tga" + layout="topleft" + left="8" + mouse_opaque="true" + name="icon_sound" + top="182" + width="16" /> + <check_box + height="16" + label="Sounds" + layout="topleft" + left_pad="2" + name="check_sound" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_texture.tga" + layout="topleft" + left="8" + mouse_opaque="true" + name="icon_texture" + top="202" + width="16" /> + <check_box + height="16" + label="Textures" + layout="topleft" + left_pad="2" + name="check_texture" + top_delta="0" + width="126" /> + <icon + height="16" + image_name="inv_item_snapshot.tga" + layout="topleft" + left="8" + mouse_opaque="true" + name="icon_snapshot" + top="222" + width="16" /> + <check_box + height="16" + label="Snapshots" + layout="topleft" + left_pad="2" + name="check_snapshot" + top_delta="0" + width="126" /> + <button + follows="left|top" + height="20" + label="All" + label_selected="All" + layout="topleft" + left="8" + name="All" + top="242" + width="100" /> + <button + follows="left|top" + height="20" + label="None" + label_selected="None" + layout="topleft" + left_delta="0" + name="None" + top_pad="4" + width="100" /> + <check_box + height="16" + label="Always show folders" + layout="topleft" + left_delta="0" + name="check_show_empty" + top_pad="4" + width="144" /> + <check_box + height="16" + label="Since Logoff" + layout="topleft" + left_delta="0" + name="check_since_logoff" + top_pad="4" + width="144" /> + <text + type="string" + length="1" + follows="left|top" + halign="center" + height="12" + layout="topleft" + left_delta="0" + name="- OR -" + top_delta="16" + width="144"> + - OR - + </text> + <spinner + follows="left|top" + height="16" + increment="1" + initial_value="0" + label="Hours Ago" + label_width="64" + layout="topleft" + left_delta="0" + max_val="240000" + name="spin_hours_ago" + top_pad="4" + width="144" /> + <spinner + follows="left|top" + height="16" + increment="1" + initial_value="0" + label="Days Ago" + label_width="64" + layout="topleft" + left_delta="0" + max_val="10000" + name="spin_days_ago" + top_pad="4" + width="144" /> + <button + follows="top|right" + height="20" + label="Close" + label_selected="Close" + layout="topleft" + name="Close" + right="-6" + top="382" + width="76" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_joystick.xml b/indra/newview/skins/default/xui/en/floater_joystick.xml new file mode 100644 index 0000000000000000000000000000000000000000..032ff21b58f12399efbf5e8928a37778f449461c --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_joystick.xml @@ -0,0 +1,859 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="500" + layout="topleft" + name="Joystick" + title="Joystick Configuration" + width="550"> + <floater.string + name="NoDevice"> + no device detected + </floater.string> + <check_box + bottom="38" + control_name="JoystickEnabled" + halign="left" + label="Enable Joystick:" + layout="topleft" + left="14" + name="enable_joystick" + width="60" /> + <text + bottom="32" + layout="topleft" + left="120" + name="joystick_type" + width="380" /> + <spinner + bottom="48" + control_name="JoystickAxis1" + decimal_digits="0" + increment="1" + label="X Axis Mapping" + label_width="100" + layout="topleft" + left="20" + max_val="5" + min_val="-1" + name="JoystickAxis1" + width="140" /> + <spinner + bottom="48" + control_name="JoystickAxis2" + decimal_digits="0" + increment="1" + label="Y Axis Mapping" + label_width="100" + layout="topleft" + left="190" + max_val="5" + min_val="-1" + name="JoystickAxis2" + width="140" /> + <spinner + bottom="48" + control_name="JoystickAxis0" + decimal_digits="0" + increment="1" + label="Z Axis Mapping" + label_width="100" + layout="topleft" + left="360" + max_val="5" + min_val="-1" + name="JoystickAxis0" + width="140" /> + <spinner + bottom="68" + control_name="JoystickAxis4" + decimal_digits="0" + increment="1" + label="Pitch Mapping" + label_width="100" + layout="topleft" + left="20" + max_val="5" + min_val="-1" + name="JoystickAxis4" + width="140" /> + <spinner + bottom="68" + control_name="JoystickAxis5" + decimal_digits="0" + increment="1" + label="Yaw Mapping" + label_width="100" + layout="topleft" + left="190" + max_val="5" + min_val="-1" + name="JoystickAxis5" + width="140" /> + <spinner + bottom="68" + control_name="JoystickAxis3" + decimal_digits="0" + increment="1" + label="Roll Mapping" + label_width="100" + layout="topleft" + left="360" + max_val="5" + min_val="-1" + name="JoystickAxis3" + width="140" /> + <spinner + bottom="88" + control_name="JoystickAxis6" + decimal_digits="0" + increment="1" + label="Zoom Mapping" + label_width="100" + layout="topleft" + left="20" + max_val="5" + min_val="-1" + name="JoystickAxis6" + width="140" /> + <check_box + bottom_delta="18" + control_name="ZoomDirect" + label="Direct Zoom" + layout="topleft" + left="185" + name="ZoomDirect" /> + <check_box + bottom_delta="0" + control_name="Cursor3D" + label="3D Cursor" + layout="topleft" + left="310" + name="Cursor3D" /> + <check_box + bottom_delta="0" + control_name="AutoLeveling" + label="Auto Level" + layout="topleft" + left="420" + name="AutoLeveling" /> + <text + type="string" + length="1" + follows="left|top" + halign="right" + height="10" + layout="topleft" + left="12" + mouse_opaque="false" + name="Control Modes:" + top="110" + width="102"> + Control Modes: + </text> + <check_box + bottom="127" + control_name="JoystickAvatarEnabled" + halign="center" + label="Avatar" + layout="topleft" + left="125" + name="JoystickAvatarEnabled" + width="60" /> + <check_box + bottom="127" + control_name="JoystickBuildEnabled" + halign="center" + label="Build" + layout="topleft" + left="194" + name="JoystickBuildEnabled" + width="60" /> + <check_box + bottom="127" + control_name="JoystickFlycamEnabled" + halign="center" + label="Flycam" + layout="topleft" + left="262" + name="JoystickFlycamEnabled" + width="60" /> + <stat_view + height="250" + label="Joystick Monitor" + layout="topleft" + left="340" + name="axis_view" + show_label="true" + top="142" + width="200"> + <stat_bar + bar_max="2" + bar_min="-2" + height="0" + label="Axis 0" + label_spacing="1" + layout="topleft" + left="0" + name="axis0" + tick_spacing="0.5" + top="20" + width="0" /> + <stat_bar + bar_max="2" + bar_min="-2" + label="Axis 1" + label_spacing="1" + layout="topleft" + name="axis1" + tick_spacing="0.5" /> + <stat_bar + bar_max="2" + bar_min="-2" + label="Axis 2" + label_spacing="1" + layout="topleft" + name="axis2" + tick_spacing="0.5" /> + <stat_bar + bar_max="2" + bar_min="-2" + label="Axis 3" + label_spacing="1" + layout="topleft" + name="axis3" + tick_spacing="0.5" /> + <stat_bar + bar_max="2" + bar_min="-2" + label="Axis 4" + label_spacing="1" + layout="topleft" + name="axis4" + tick_spacing="0.5" /> + <stat_bar + bar_max="2" + bar_min="-2" + label="Axis 5" + label_spacing="1" + layout="topleft" + name="axis5" + tick_spacing="0.5" /> + </stat_view> + <text + type="string" + length="1" + bottom="144" + halign="right" + layout="topleft" + left="20" + name="XScale" + width="94"> + X Scale + </text> + <spinner + bottom="144" + control_name="AvatarAxisScale1" + decimal_digits="2" + label_width="0" + layout="topleft" + left="125" + max_val="50" + min_val="-50" + name="AvatarAxisScale1" + width="56" /> + <spinner + bottom="144" + control_name="BuildAxisScale1" + decimal_digits="2" + label_width="0" + layout="topleft" + left="195" + max_val="1024" + min_val="-1024" + name="BuildAxisScale1" + width="56" /> + <spinner + bottom="144" + control_name="FlycamAxisScale1" + decimal_digits="2" + label_width="0" + layout="topleft" + left="265" + max_val="1024" + min_val="-1024" + name="FlycamAxisScale1" + width="56" /> + <text + type="string" + length="1" + bottom="164" + halign="right" + layout="topleft" + left="20" + name="YScale" + width="94"> + Y Scale + </text> + <spinner + bottom="164" + control_name="AvatarAxisScale2" + decimal_digits="2" + label_width="0" + layout="topleft" + left="125" + max_val="50" + min_val="-50" + name="AvatarAxisScale2" + width="56" /> + <spinner + bottom="164" + control_name="BuildAxisScale2" + decimal_digits="2" + label_width="0" + layout="topleft" + left="195" + max_val="1024" + min_val="-1024" + name="BuildAxisScale2" + width="56" /> + <spinner + bottom="164" + control_name="FlycamAxisScale2" + decimal_digits="2" + label_width="0" + layout="topleft" + left="265" + max_val="1024" + min_val="-1024" + name="FlycamAxisScale2" + width="56" /> + <text + type="string" + length="1" + bottom="184" + halign="right" + layout="topleft" + left="20" + name="ZScale" + width="94"> + Z Scale + </text> + <spinner + bottom="184" + control_name="AvatarAxisScale0" + decimal_digits="2" + label_width="0" + layout="topleft" + left="125" + max_val="50" + min_val="-50" + name="AvatarAxisScale0" + width="56" /> + <spinner + bottom="184" + control_name="BuildAxisScale0" + decimal_digits="2" + label_width="0" + layout="topleft" + left="195" + max_val="1024" + min_val="-1024" + name="BuildAxisScale0" + width="56" /> + <spinner + bottom="184" + control_name="FlycamAxisScale0" + decimal_digits="2" + label_width="0" + layout="topleft" + left="265" + max_val="1024" + min_val="-1024" + name="FlycamAxisScale0" + width="56" /> + <text + type="string" + length="1" + bottom="204" + halign="right" + layout="topleft" + left="20" + name="PitchScale" + width="94"> + Pitch Scale + </text> + <spinner + bottom="204" + control_name="AvatarAxisScale4" + decimal_digits="2" + label_width="0" + layout="topleft" + left="125" + max_val="1024" + min_val="-1024" + name="AvatarAxisScale4" + width="56" /> + <spinner + bottom="204" + control_name="BuildAxisScale4" + decimal_digits="2" + label_width="0" + layout="topleft" + left="195" + max_val="1024" + min_val="-1024" + name="BuildAxisScale4" + width="56" /> + <spinner + bottom="204" + control_name="FlycamAxisScale4" + decimal_digits="2" + label_width="0" + layout="topleft" + left="265" + max_val="1024" + min_val="-1024" + name="FlycamAxisScale4" + width="56" /> + <text + type="string" + length="1" + bottom="224" + halign="right" + layout="topleft" + left="20" + name="YawScale" + width="94"> + Yaw Scale + </text> + <spinner + bottom="224" + control_name="AvatarAxisScale5" + decimal_digits="2" + label_width="0" + layout="topleft" + left="125" + max_val="1024" + min_val="-1024" + name="AvatarAxisScale5" + width="56" /> + <spinner + bottom="224" + control_name="BuildAxisScale5" + decimal_digits="2" + label_width="0" + layout="topleft" + left="195" + max_val="1024" + min_val="-1024" + name="BuildAxisScale5" + width="56" /> + <spinner + bottom="224" + control_name="FlycamAxisScale5" + decimal_digits="2" + label_width="0" + layout="topleft" + left="265" + max_val="1024" + min_val="-1024" + name="FlycamAxisScale5" + width="56" /> + <text + type="string" + length="1" + bottom="244" + halign="right" + layout="topleft" + left="20" + name="RollScale" + width="94"> + Roll Scale + </text> + <spinner + bottom="244" + control_name="BuildAxisScale3" + decimal_digits="2" + label_width="0" + layout="topleft" + left="195" + max_val="1024" + min_val="-1024" + name="BuildAxisScale3" + width="56" /> + <spinner + bottom="244" + control_name="FlycamAxisScale3" + decimal_digits="2" + label_width="0" + layout="topleft" + left="265" + max_val="1024" + min_val="-1024" + name="FlycamAxisScale3" + width="56" /> + <text + type="string" + length="1" + bottom="274" + halign="right" + layout="topleft" + left="20" + name="XDeadZone" + width="94"> + X Dead Zone + </text> + <spinner + bottom="274" + control_name="AvatarAxisDeadZone1" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="125" + name="AvatarAxisDeadZone1" + width="56" /> + <spinner + bottom="274" + control_name="BuildAxisDeadZone1" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="195" + name="BuildAxisDeadZone1" + width="56" /> + <spinner + bottom="274" + control_name="FlycamAxisDeadZone1" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="265" + name="FlycamAxisDeadZone1" + width="56" /> + <text + type="string" + length="1" + bottom="294" + halign="right" + layout="topleft" + left="20" + name="YDeadZone" + width="94"> + Y Dead Zone + </text> + <spinner + bottom="294" + control_name="AvatarAxisDeadZone2" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="125" + name="AvatarAxisDeadZone2" + width="56" /> + <spinner + bottom="294" + control_name="BuildAxisDeadZone2" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="195" + name="BuildAxisDeadZone2" + width="56" /> + <spinner + bottom="294" + control_name="FlycamAxisDeadZone2" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="265" + name="FlycamAxisDeadZone2" + width="56" /> + <text + type="string" + length="1" + bottom="314" + halign="right" + layout="topleft" + left="20" + name="ZDeadZone" + width="94"> + Z Dead Zone + </text> + <spinner + bottom="314" + control_name="AvatarAxisDeadZone0" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="125" + name="AvatarAxisDeadZone0" + width="56" /> + <spinner + bottom="314" + control_name="BuildAxisDeadZone0" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="195" + name="BuildAxisDeadZone0" + width="56" /> + <spinner + bottom="314" + control_name="FlycamAxisDeadZone0" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="265" + name="FlycamAxisDeadZone0" + width="56" /> + <text + type="string" + length="1" + bottom="334" + halign="right" + layout="topleft" + left="20" + name="PitchDeadZone" + width="94"> + Pitch Dead Zone + </text> + <spinner + bottom="334" + control_name="AvatarAxisDeadZone4" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="125" + name="AvatarAxisDeadZone4" + width="56" /> + <spinner + bottom="334" + control_name="BuildAxisDeadZone4" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="195" + name="BuildAxisDeadZone4" + width="56" /> + <spinner + bottom="334" + control_name="FlycamAxisDeadZone4" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="265" + name="FlycamAxisDeadZone4" + width="56" /> + <text + type="string" + length="1" + bottom="354" + halign="right" + layout="topleft" + left="20" + name="YawDeadZone" + width="94"> + Yaw Dead Zone + </text> + <spinner + bottom="354" + control_name="AvatarAxisDeadZone5" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="125" + name="AvatarAxisDeadZone5" + width="56" /> + <spinner + bottom="354" + control_name="BuildAxisDeadZone5" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="195" + name="BuildAxisDeadZone5" + width="56" /> + <spinner + bottom="354" + control_name="FlycamAxisDeadZone5" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="265" + name="FlycamAxisDeadZone5" + width="56" /> + <text + type="string" + length="1" + bottom="374" + halign="right" + layout="topleft" + left="20" + name="RollDeadZone" + width="94"> + Roll Dead Zone + </text> + <spinner + bottom="374" + control_name="BuildAxisDeadZone3" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="195" + name="BuildAxisDeadZone3" + width="56" /> + <spinner + bottom="374" + control_name="FlycamAxisDeadZone3" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="265" + name="FlycamAxisDeadZone3" + width="56" /> + <text + type="string" + length="1" + bottom="402" + halign="right" + layout="topleft" + left="20" + name="Feathering" + width="94"> + Feathering + </text> + <slider + control_name="AvatarFeathering" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="0.7" + layout="topleft" + left="116" + max_val="32" + min_val="1" + name="AvatarFeathering" + show_text="false" + top="402" + width="73" /> + <slider + control_name="BuildFeathering" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="0.7" + layout="topleft" + left_delta="70" + max_val="32" + min_val="1" + name="BuildFeathering" + show_text="false" + top_delta="0" + width="73" /> + <slider + control_name="FlycamFeathering" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="0.7" + layout="topleft" + left_delta="70" + max_val="32" + min_val="1" + name="FlycamFeathering" + show_text="false" + top_delta="0" + width="73" /> + <text + type="string" + length="1" + bottom="430" + halign="right" + layout="topleft" + left="20" + name="ZoomScale2" + width="94"> + Zoom Scale + </text> + <spinner + bottom="430" + control_name="FlycamAxisScale6" + decimal_digits="2" + label_width="0" + layout="topleft" + left="265" + max_val="1024" + min_val="-1024" + name="FlycamAxisScale6" + width="56" /> + <text + type="string" + length="1" + bottom="450" + halign="right" + layout="topleft" + left="20" + name="ZoomDeadZone" + width="94"> + Zoom Dead Zone + </text> + <spinner + bottom="450" + control_name="FlycamAxisDeadZone6" + decimal_digits="2" + increment="0.01" + label_width="0" + layout="topleft" + left="265" + name="FlycamAxisDeadZone6" + width="56" /> + <button + follows="left|top" + height="22" + label="SpaceNavigator Defaults" + layout="topleft" + left="340" + name="SpaceNavigatorDefaults" + top="429" + width="184" /> + <button + follows="right|bottom" + height="20" + label="OK" + label_selected="OK" + layout="topleft" + left_delta="0" + name="ok_btn" + top_pad="9" + width="90" /> + <button + follows="right|bottom" + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_pad="4" + name="cancel_btn" + top_delta="0" + width="90" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_lagmeter.xml b/indra/newview/skins/default/xui/en/floater_lagmeter.xml new file mode 100644 index 0000000000000000000000000000000000000000..ebe8df9f5ecf7e4f7d204ceefa9e7204eb606ad7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_lagmeter.xml @@ -0,0 +1,337 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="150" + layout="topleft" + name="floater_lagmeter" + save_rect="true" + title="Lag Meter" + width="350"> + <floater.string + name="max_title_msg"> + Lag Meter + </floater.string> + <floater.string + name="max_width_px"> + 360 + </floater.string> + <floater.string + name="min_title_msg"> + Lag + </floater.string> + <floater.string + name="min_width_px"> + 90 + </floater.string> + <floater.string + name="client_text_msg"> + Client + </floater.string> + <floater.string + name="client_frame_rate_critical_fps"> + 10 + </floater.string> + <floater.string + name="client_frame_rate_warning_fps"> + 15 + </floater.string> + <floater.string + name="client_frame_time_window_bg_msg"> + Normal, window in background + </floater.string> + <floater.string + name="client_frame_time_critical_msg"> + Client frame rate below [CLIENT_FRAME_RATE_CRITICAL] + </floater.string> + <floater.string + name="client_frame_time_warning_msg"> + Client frame rate between [CLIENT_FRAME_RATE_CRITICAL] and [CLIENT_FRAME_RATE_WARNING] + </floater.string> + <floater.string + name="client_frame_time_normal_msg"> + Normal + </floater.string> + <floater.string + name="client_draw_distance_cause_msg"> + Possible cause: Draw distance set too high + </floater.string> + <floater.string + name="client_texture_loading_cause_msg"> + Possible cause: Images loading + </floater.string> + <floater.string + name="client_texture_memory_cause_msg"> + Possible cause: Too many images in memory + </floater.string> + <floater.string + name="client_complex_objects_cause_msg"> + Possible cause: Too many complex objects in scene + </floater.string> + <floater.string + name="network_text_msg"> + Network + </floater.string> + <floater.string + name="network_packet_loss_critical_pct"> + 10 + </floater.string> + <floater.string + name="network_packet_loss_warning_pct"> + 5 + </floater.string> + <floater.string + name="network_packet_loss_critical_msg"> + Connection is dropping over [NETWORK_PACKET_LOSS_CRITICAL]% of packets + </floater.string> + <floater.string + name="network_packet_loss_warning_msg"> + Connection is dropping [NETWORK_PACKET_LOSS_WARNING]%-[NETWORK_PACKET_LOSS_CRITICAL]% of packets + </floater.string> + <floater.string + name="network_performance_normal_msg"> + Normal + </floater.string> + <floater.string + name="network_ping_critical_ms"> + 600 + </floater.string> + <floater.string + name="network_ping_warning_ms"> + 300 + </floater.string> + <floater.string + name="network_ping_critical_msg"> + Connection ping time is over [NETWORK_PING_CRITICAL] ms + </floater.string> + <floater.string + name="network_ping_warning_msg"> + Connection ping time is [NETWORK_PING_WARNING]-[NETWORK_PING_CRITICAL] ms + </floater.string> + <floater.string + name="network_packet_loss_cause_msg"> + Possible bad connection or 'Bandwidth' pref too high. + </floater.string> + <floater.string + name="network_ping_cause_msg"> + Possible bad connection or file-sharing app. + </floater.string> + <floater.string + name="server_text_msg"> + Server + </floater.string> + <floater.string + name="server_frame_rate_critical_fps"> + 20 + </floater.string> + <floater.string + name="server_frame_rate_warning_fps"> + 30 + </floater.string> + <floater.string + name="server_single_process_max_time_ms"> + 20 + </floater.string> + <floater.string + name="server_frame_time_critical_msg"> + Simulator framerate below [SERVER_FRAME_RATE_CRITICAL] + </floater.string> + <floater.string + name="server_frame_time_warning_msg"> + Simulator framerate between [SERVER_FRAME_RATE_CRITICAL] and [SERVER_FRAME_RATE_WARNING] + </floater.string> + <floater.string + name="server_frame_time_normal_msg"> + Normal + </floater.string> + <floater.string + name="server_physics_cause_msg"> + Possible Cause: Too many physical objects + </floater.string> + <floater.string + name="server_scripts_cause_msg"> + Possible Cause: Too many scripted objects + </floater.string> + <floater.string + name="server_net_cause_msg"> + Possible Cause: Too much network traffic + </floater.string> + <floater.string + name="server_agent_cause_msg"> + Possible Cause: Too many moving people in region + </floater.string> + <floater.string + name="server_images_cause_msg"> + Possible Cause: Too many image calculations + </floater.string> + <floater.string + name="server_generic_cause_msg"> + Possible Cause: Simulator load too heavy + </floater.string> + <floater.string + name="smaller_label"> + >> + </floater.string> + <floater.string + name="bigger_label"> + << + </floater.string> + <button + follows="top|left" + height="16" + image_selected="lag_status_good.tga" + image_unselected="lag_status_good.tga" + layout="topleft" + left="8" + name="client_lagmeter" + picture_style="true" + tab_stop="false" + tool_tip="Client lag status" + top="24" + width="16" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_pad="3" + name="client" + top_delta="0" + width="128"> + Client: + </text> + <text + type="string" + length="1" + bottom="40" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left="110" + name="client_text" + right="-10"> + Normal + </text> + <text + bottom="56" + follows="left|top" + height="16" + layout="topleft" + left="40" + name="client_lag_cause" + right="-32" /> + <button + follows="top|left" + height="16" + image_selected="lag_status_good.tga" + image_unselected="lag_status_good.tga" + layout="topleft" + left="8" + name="network_lagmeter" + picture_style="true" + tab_stop="false" + tool_tip="Network lag status" + top="64" + width="16" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_pad="3" + name="network" + top_delta="0" + width="128"> + Network: + </text> + <text + type="string" + length="1" + bottom="80" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left="110" + name="network_text" + right="-10"> + Normal + </text> + <text + bottom="96" + follows="left|top" + height="16" + layout="topleft" + left="40" + name="network_lag_cause" + right="-32" /> + <button + follows="top|left" + height="16" + image_selected="lag_status_good.tga" + image_unselected="lag_status_good.tga" + layout="topleft" + left="8" + name="server_lagmeter" + picture_style="true" + tab_stop="false" + tool_tip="Server lag status" + top="104" + width="16" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_pad="3" + name="server" + top_delta="0" + width="60"> + Server: + </text> + <text + type="string" + length="1" + bottom="120" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left="85" + name="server_text" + right="-10"> + Normal + </text> + <text + bottom="136" + follows="left|top" + height="16" + layout="topleft" + left="40" + name="server_lag_cause" + right="-32" /> + <button + bottom="145" + follows="left|top" + height="18" + help_url="https://support.secondlife.com/ics/support/default.asp?deptID=4417&task=knowledge&questionID=4851" + label="?" + layout="topleft" + name="server_help" + right="-10" + width="18" /> + <button + follows="left|top" + height="20" + label=">>" + layout="topleft" + left_delta="-317" + name="minimize" + top_delta="-2" + width="25" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_land_holdings.xml b/indra/newview/skins/default/xui/en/floater_land_holdings.xml new file mode 100644 index 0000000000000000000000000000000000000000..0ed4bb4e0755d9537422cface3d2fd9282560c28 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_land_holdings.xml @@ -0,0 +1,164 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="383" + layout="topleft" + name="land holdings floater" + title="My Land" + width="600"> + <floater.string + name="area_string"> + [AREA] sq. meters + </floater.string> + <scroll_list + draw_heading="true" + height="170" + layout="topleft" + left="8" + name="parcel list" + top="24" + width="584"> + <scroll_list.columns + label="Parcel Name" + name="name" + width="163" /> + <scroll_list.columns + label="Region" + name="location" + width="175" /> + <scroll_list.columns + label="Type" + name="type" + width="140" /> + <scroll_list.columns + label="Area" + name="area" + width="87" /> + <scroll_list.columns + label="" + name="hidden" + width="-1" /> + </scroll_list> + <button + height="20" + label="Teleport" + label_selected="Teleport" + layout="topleft" + left_delta="4" + name="Teleport" + tool_tip="Teleport to the center of this land." + top_pad="4" + width="100" /> + <button + height="20" + label="Show on Map" + label_selected="Show on Map" + layout="topleft" + left_pad="4" + name="Show on Map" + tool_tip="Show this land on the world map." + top_delta="0" + width="100" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="12" + name="contrib_label" + top="222" + width="480"> + Contributions to your groups: + </text> + <scroll_list + draw_heading="true" + height="75" + layout="topleft" + left_delta="-4" + name="grant list" + top_pad="4" + width="584"> + <scroll_list.columns + label="Group" + name="group" + width="330" /> + <scroll_list.columns + label="Area" + name="area" + width="220" /> + </scroll_list> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="4" + name="allowed_label" + top_pad="4" + width="348"> + Allowed land holdings at current payment plan: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="340" + name="allowed_text" + top_delta="0" + width="132"> + [AREA] sq. meters + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="12" + name="current_label" + top="341" + width="348"> + Current land holdings: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="340" + name="current_text" + top_delta="0" + width="132"> + [AREA] sq. meters + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerifBold" + height="16" + layout="topleft" + left="12" + name="available_label" + top="361" + width="348"> + Available for land purchases: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerifBold" + height="16" + layout="topleft" + left_delta="340" + name="available_text" + top_delta="0" + width="140"> + [AREA] sq. meters + </text> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml new file mode 100644 index 0000000000000000000000000000000000000000..0735ac160aca809ccf72f2b0cad288f0de36438b --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + bevel_style="none" + border_style="line" + can_resize="true" + follows="left|top" + height="550" + layout="topleft" + min_height="271" + min_width="290" + name="script ed float" + save_rect="true" + title="Script: New Script" + width="500"> + <floater.string + name="not_allowed"> + You are not allowed to view this script. + </floater.string> + <floater.string + name="script_running"> + Running + </floater.string> + <floater.string + name="Title"> + Script: [NAME] + </floater.string> + <button + follows="right|bottom" + height="20" + label="Reset" + label_selected="Reset" + layout="topleft" + left="362" + name="Reset" + top="525" + width="128" /> + <check_box + enabled="false" + follows="left|bottom" + font="SansSerif" + height="18" + initial_value="true" + label="Running" + layout="topleft" + left_delta="-350" + name="running" + top_delta="2" + width="100" /> + <check_box + enabled="false" + follows="left|bottom" + font="SansSerif" + height="18" + initial_value="true" + label="Mono" + layout="topleft" + left_delta="70" + name="mono" + top_delta="0" + width="100" /> + <panel + bevel_style="none" + border_style="line" + follows="left|top|right|bottom" + height="506" + layout="topleft" + left="1" + name="script ed panel" + top="18" + width="497" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_lsl_guide.xml b/indra/newview/skins/default/xui/en/floater_lsl_guide.xml new file mode 100644 index 0000000000000000000000000000000000000000..ce6b0efd03e107d0e0577bb19c3e2932fc54e61b --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_lsl_guide.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + follows="left|top" + height="400" + layout="topleft" + min_height="271" + min_width="350" + name="script ed float" + save_rect="true" + title="LSL Wiki" + width="370"> + <check_box + follows="top|left" + font="SansSerif" + halign="center" + height="20" + label="Follow cursor" + layout="topleft" + left="10" + name="lock_check" + top="25" + width="60" /> + <combo_box + allow_text_entry="true" + follows="top|left|right" + font="SansSerif" + halign="center" + height="20" + label="Lock" + layout="topleft" + left_pad="40" + name="history_combo" + top_delta="0" + width="90" /> + <button + follows="top|right" + height="20" + label="Back" + layout="topleft" + left_pad="5" + name="back_btn" + top_delta="0" + width="70" /> + <button + follows="top|right" + height="20" + label="Forward" + layout="topleft" + left_pad="5" + name="fwd_btn" + top_delta="0" + width="70" /> + <web_browser + bottom="390" + follows="left|right|top|bottom" + layout="topleft" + left="10" + name="lsl_guide_html" + right="-10" + top="50" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_map.xml b/indra/newview/skins/default/xui/en/floater_map.xml new file mode 100644 index 0000000000000000000000000000000000000000..ed3b00250b1567c53758ccbe41ef9798fa09a308 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_map.xml @@ -0,0 +1,172 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + follows="top|right" + height="225" + layout="topleft" + min_height="60" + min_width="174" + name="Map" + save_rect="true" + save_visibility="true" + single_instance="true" + width="200"> + <floater.string + name="mini_map_north"> + N + </floater.string> + <floater.string + name="mini_map_east"> + E + </floater.string> + <floater.string + name="mini_map_west"> + W + </floater.string> + <floater.string + name="mini_map_south"> + S + </floater.string> + <floater.string + name="mini_map_southeast"> + SE + </floater.string> + <floater.string + name="mini_map_northeast"> + NE + </floater.string> + <floater.string + name="mini_map_southwest"> + SW + </floater.string> + <floater.string + name="mini_map_northwest"> + NW + </floater.string> + <floater.string + name="ToolTipMsg"> + [AGENT][REGION](Double-click to open Map) + </floater.string> + <net_map + bg_color="NetMapBackgroundColor" + bottom="225" + follows="top|left|bottom|right" + layout="topleft" + left="0" + mouse_opaque="false" + name="Net Map" + right="198" + top="2" /> + <text + type="string" + length="1" + bottom="225" + label="N" + layout="topleft" + left="0" + name="floater_map_north" + right="10" + text="N" + text_color="1 1 1 0.7" + top="215"> + N + </text> + <text + type="string" + length="1" + bottom="225" + label="E" + layout="topleft" + left="0" + name="floater_map_east" + right="10" + text="E" + text_color="1 1 1 0.7" + top="215"> + E + </text> + <text + type="string" + length="1" + bottom="225" + label="W" + layout="topleft" + left="0" + name="floater_map_west" + right="11" + text="W" + text_color="1 1 1 0.7" + top="215"> + W + </text> + <text + type="string" + length="1" + bottom="225" + label="S" + layout="topleft" + left="0" + name="floater_map_south" + right="10" + text="S" + text_color="1 1 1 0.7" + top="215"> + S + </text> + <text + type="string" + length="1" + bottom="225" + label="SE" + layout="topleft" + left="0" + name="floater_map_southeast" + right="20" + text="SE" + text_color="1 1 1 0.7" + top="215"> + SE + </text> + <text + type="string" + length="1" + bottom="225" + label="NE" + layout="topleft" + left="0" + name="floater_map_northeast" + right="20" + text="NE" + text_color="1 1 1 0.7" + top="215"> + NE + </text> + <text + type="string" + length="1" + bottom="225" + label="SW" + layout="topleft" + left="0" + name="floater_map_southwest" + right="20" + text="SW" + text_color="1 1 1 0.7" + top="215"> + SW + </text> + <text + type="string" + length="1" + bottom="225" + label="NW" + layout="topleft" + left="0" + name="floater_map_northwest" + right="20" + text="NW" + text_color="1 1 1 0.7" + top="215"> + NW + </text> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_media_browser.xml b/indra/newview/skins/default/xui/en/floater_media_browser.xml new file mode 100644 index 0000000000000000000000000000000000000000..a073c3443aa4e3795c62d4f543ee9878ba754b70 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_media_browser.xml @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="440" + layout="topleft" + min_height="140" + min_width="467" + name="floater_about" + save_rect="true" + title="Media Browser" + width="820"> + <layout_stack + bottom="440" + follows="left|right|top|bottom" + layout="topleft" + left="10" + name="stack1" + top="20" + width="800"> + <layout_panel + auto_resize="false" + height="20" + layout="topleft" + left="0" + name="nav_controls" + top="400" + user_resize="false" + width="800"> + <button + follows="left|top" + height="20" + label="Back" + layout="topleft" + left="0" + name="back" + top="0" + width="55" /> + <button + follows="left|top" + height="20" + label="Forward" + layout="topleft" + left_pad="3" + name="forward" + top_delta="0" + width="68" /> + <button + enabled="false" + follows="left|top" + height="20" + label="Reload" + layout="topleft" + left_pad="2" + name="reload" + top_delta="0" + width="70" /> + <combo_box + allow_text_entry="true" + follows="left|top|right" + height="20" + layout="topleft" + left_pad="5" + max_chars="255" + name="address" + top_delta="0" + width="540" /> + <button + enabled="false" + follows="right|top" + height="20" + label="Go" + layout="topleft" + left_pad="5" + name="go" + top_delta="0" + width="55" /> + </layout_panel> + <layout_panel + auto_resize="false" + height="20" + layout="topleft" + left_delta="0" + name="parcel_owner_controls" + top_delta="0" + user_resize="false" + width="540"> + <button + enabled="false" + follows="left|top" + height="20" + label="Send Current URL to Parcel" + layout="topleft" + left="0" + name="assign" + top="0" + width="200" /> + </layout_panel> + <layout_panel + height="20" + layout="topleft" + left_delta="0" + name="external_controls" + top_delta="0" + user_resize="false" + width="540"> + <web_browser + bottom="-10" + follows="left|right|top|bottom" + layout="topleft" + left="0" + name="browser" + top="0" + width="540" /> + <button + follows="bottom|left" + height="20" + label="Open in My Web Browser" + layout="topleft" + left_delta="0" + name="open_browser" + top_pad="5" + width="185" /> + <check_box + control_name="UseExternalBrowser" + follows="bottom|left" + height="20" + label="Always open in my web browser" + layout="topleft" + left_pad="5" + name="open_always" + top_delta="0" + width="200" /> + <button + follows="bottom|right" + height="20" + label="Close" + layout="topleft" + left_pad="80" + name="close" + top_delta="0" + width="70" /> + </layout_panel> + </layout_stack> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_mem_leaking.xml b/indra/newview/skins/default/xui/en/floater_mem_leaking.xml new file mode 100644 index 0000000000000000000000000000000000000000..e2a99e66141dbe61edca9091233928e3e0099f78 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_mem_leaking.xml @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + follows="left|top" + height="175" + layout="topleft" + name="MemLeak" + title="Memory Leaking Simulation" + width="350"> + <spinner + decimal_digits="0" + follows="left|top" + height="20" + increment="256" + initial_value="512" + label="Leaking Speed (bytes per frame):" + label_width="220" + layout="topleft" + left="10" + max_val="4.29497e+009" + name="leak_speed" + top="30" + width="330" /> + <spinner + decimal_digits="0" + follows="left|top" + height="20" + increment="4" + initial_value="512" + label="Max Leaked Memory (MB):" + label_width="220" + layout="topleft" + left_delta="0" + max_val="4096" + name="max_leak" + top_pad="5" + width="330" /> + <text + type="string" + length="1" + follows="left|top" + height="25" + layout="topleft" + left_delta="0" + name="total_leaked_label" + top_delta="20" + width="300"> + Current leaked memory: [SIZE] KB + </text> + <text + type="string" + length="1" + follows="left|top" + height="25" + layout="topleft" + left_delta="0" + name="note_label_1" + top_delta="25" + width="330"> + [NOTE1] + </text> + <text + type="string" + length="1" + follows="left|top" + height="25" + layout="topleft" + left_delta="0" + name="note_label_2" + top_delta="25" + width="330"> + [NOTE2] + </text> + <button + follows="left|top" + height="20" + label="Start" + layout="topleft" + left_delta="0" + name="start_btn" + top_delta="20" + width="70" /> + <button + follows="left|top" + height="20" + label="Stop" + layout="topleft" + left_pad="7" + name="stop_btn" + top_delta="0" + width="70" /> + <button + follows="left|top" + height="20" + label="Release" + layout="topleft" + left_pad="7" + name="release_btn" + top_delta="0" + width="70" /> + <button + follows="left|top" + height="20" + label="Close" + layout="topleft" + left_pad="36" + name="close_btn" + top_delta="0" + width="70" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml new file mode 100644 index 0000000000000000000000000000000000000000..47342ffc5b511c1e2839453917e0e274c4591941 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_moveview.xml @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + center_horiz="true" + follows="bottom" + height="58" + layout="topleft" + name="move_floater" + save_rect="true" + width="135"> + <button + follows="left|bottom" + height="25" + image_disabled="move_turn_left_out.tga" + image_disabled_selected="move_turn_left_in.tga" + image_selected="move_turn_left_in.tga" + image_unselected="move_turn_left_out.tga" + layout="topleft" + left="20" + name="turn left btn" + picture_style="true" + scale_image="false" + tool_tip="Turn Left" + top="29" + width="25" /> + <button + follows="left|bottom" + height="25" + image_disabled="move_turn_right_out.tga" + image_disabled_selected="move_turn_right_in.tga" + image_selected="move_turn_right_in.tga" + image_unselected="move_turn_right_out.tga" + layout="topleft" + left_pad="21" + name="turn right btn" + picture_style="true" + scale_image="false" + tool_tip="Turn Right" + top_delta="0" + width="25" /> + <button + follows="left|bottom" + height="25" + image_disabled="move_up_out.tga" + image_disabled_selected="move_up_in.tga" + image_selected="move_up_in.tga" + image_unselected="move_up_out.tga" + layout="topleft" + left="91" + name="move up btn" + picture_style="true" + scale_image="false" + tool_tip="Jump or Fly Up" + top="4" + width="25" /> + <button + follows="left|bottom" + height="25" + image_disabled="move_down_out.tga" + image_disabled_selected="move_down_in.tga" + image_selected="move_down_in.tga" + image_unselected="move_down_out.tga" + layout="topleft" + left_delta="0" + name="move down btn" + picture_style="true" + scale_image="false" + tool_tip="Crouch or Fly Down" + top_delta="25" + width="25" /> + <joystick_slide + follows="left|bottom" + height="25" + image_selected="move_left_in.tga" + image_unselected="move_left_out.tga" + layout="topleft" + left="20" + name="slide left btn" + picture_style="true" + quadrant="left" + scale_image="false" + tool_tip="Move Left" + top="4" + width="25" /> + <joystick_slide + follows="left|bottom" + height="25" + image_selected="move_right_in.tga" + image_unselected="move_right_out.tga" + layout="topleft" + left_pad="21" + name="slide right btn" + picture_style="true" + quadrant="right" + scale_image="false" + tool_tip="Move Right" + top_delta="0" + width="25" /> + <joystick_turn + follows="left|bottom" + height="25" + image_selected="move_forward_in.tga" + image_unselected="move_forward_out.tga" + layout="topleft" + left_delta="-21" + name="forward btn" + picture_style="true" + quadrant="up" + scale_image="false" + tool_tip="Move Forward" + top_delta="0" + width="21" /> + <joystick_turn + follows="left|bottom" + height="25" + image_selected="move_backward_in.tga" + image_unselected="move_backward_out.tga" + layout="topleft" + left_delta="0" + name="backward btn" + picture_style="true" + quadrant="down" + scale_image="false" + tool_tip="Move Backward" + top_delta="25" + width="21" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_mute_object.xml b/indra/newview/skins/default/xui/en/floater_mute_object.xml new file mode 100644 index 0000000000000000000000000000000000000000..7a0ec8282c456b397afa33ffc379db0cafce120c --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_mute_object.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + height="140" + layout="topleft" + name="mute by name" + title="Mute object by name" + width="375"> + <text + type="string" + length="1" + bottom_delta="50" + follows="top|left" + font="SansSerif" + height="16" + layout="topleft" + left="20" + left_delta="25" + name="message" + right="380"> + Mute by name only affects object chat and IM, not sounds. +You must type the object's name exactly. + </text> + <line_editor + type="string" + length="1" + follows="top|right" + font="SansSerif" + height="18" + layout="topleft" + left_delta="0" + name="object_name" + top_pad="22" + width="320"> + Object name + </line_editor> + <button + follows="bottom|left" + height="20" + label="Ok" + layout="topleft" + left="108" + name="OK" + top="100" + width="75" /> + <button + follows="bottom|right" + height="20" + label="Cancel" + layout="topleft" + left_pad="7" + name="Cancel" + top_delta="0" + width="75" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_my_friends.xml b/indra/newview/skins/default/xui/en/floater_my_friends.xml new file mode 100644 index 0000000000000000000000000000000000000000..65665c7036d1fc4d0210570c55bc54e13f4c0437 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_my_friends.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_close="false" + can_resize="true" + height="390" + layout="topleft" + min_height="240" + min_width="365" + name="floater_my_friends" + save_rect="true" + single_instance="true" + title="Contacts" + width="395"> + <tab_container + follows="all" + height="364" + layout="topleft" + left="4" + name="friends_and_groups" + tab_position="top" + tab_width="80" + top="20" + width="383"> + <panel + bottom="364" + filename="panel_friends.xml" + label="Friends" + layout="topleft" + left="0" + name="friends_panel" + width="370" /> + <panel + bottom="364" + filename="panel_groups.xml" + label="Groups" + layout="topleft" + left="0" + name="groups_panel" + width="370" /> + </tab_container> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml new file mode 100644 index 0000000000000000000000000000000000000000..f4fd6b01b4fa12341a2f8c52f7ca518b8744f471 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater + background_opaque="false" + background_visible="true" + bevel_style="in" + bg_alpha_color="0.3 0.3 0.3 1.0" + height="300" + layout="topleft" + name="nearby_chat" + save_rect="true" + title="Nearby Chat" + width="320"> + <panel top="20" width="320" height="30" background_visible="true" background_opaque="false" bg_alpha_color="0.0 0.0 0.0 1.0" name="chat_caption"> + <text + width="140" left="25" height="20" follows="left|right|top" + font="SansSerifBigBold" text_color="white" word_wrap="true" + mouse_opaque="true" name="sender_name" >NEARBY CHAT </text> + <icon top="5" left="250" + width="20" height="20" follows="top|right" + color="1 1 1 1" enabled="true" image_name="icn_voice-groupfocus.tga" + mouse_opaque="true" name="nearby_speakers_btn"/> + <icon top="5" left="275" + width="20" height="20" follows="top|right" + color="1 1 1 1" enabled="true" image_name="inv_item_landmark_visited.tga" + mouse_opaque="true" name="tearoff_btn"/> + <icon top="5" left="300" + width="15" height="15" follows="top|right" + color="1 1 1 1" enabled="true" image_name="closebox.tga" + name="close_btn"/> + </panel> + <chat_history_view bottom="0" width="250" height="320" follows="left|right|top|bottom" name="chat_scroll" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_notification.xml b/indra/newview/skins/default/xui/en/floater_notification.xml new file mode 100644 index 0000000000000000000000000000000000000000..cd88ec2f3f13b884a6428206030b4e2685a0298e --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_notification.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="200" + layout="topleft" + min_height="50" + name="notification" + title="Notifications Console" + width="200"> + <text_editor + type="string" + length="1" + enabled="false" + follows="left|top|right|bottom" + font="SansSerif" + height="140" + ignore_tab="false" + layout="topleft" + left="4" + max_length="65536" + name="payload" + top="25" + width="192" + word_wrap="true"> + Loading... + </text_editor> + <combo_box + follows="left|bottom" + height="20" + label="Response" + layout="topleft" + left="10" + name="response" + top="171" + width="100" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_notifications_console.xml b/indra/newview/skins/default/xui/en/floater_notifications_console.xml new file mode 100644 index 0000000000000000000000000000000000000000..92ecb5908e289b32ae5ec093142975debc1152b6 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_notifications_console.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="500" + layout="topleft" + min_height="50" + name="notifications_console" + title="Notifications Console" + width="500"> + <combo_box + follows="left|right|top" + height="18" + label="Select notification type" + layout="topleft" + left="2" + name="notification_types" + top="22" + width="440" /> + <button + follows="right|top" + height="18" + label="Add" + layout="topleft" + left_pad="3" + name="add_notification" + top_delta="0" + width="50" /> + <layout_stack + bottom="495" + follows="left|right|top|bottom" + layout="topleft" + left="5" + name="notification_channels" + right="-5" + top="42" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_openobject.xml b/indra/newview/skins/default/xui/en/floater_openobject.xml new file mode 100644 index 0000000000000000000000000000000000000000..742934b57b0ce7d8759dcc212f31ef320d92ff27 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_openobject.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + default_tab_group="1" + height="350" + layout="topleft" + min_height="160" + min_width="270" + name="objectcontents" + save_rect="true" + title="Object Contents" + width="300"> + <panel_inventory + follows="left|top|right|bottom" + height="276" + layout="topleft" + left="8" + name="object_contents" + top="44" + width="284" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="object_name" + top_delta="-20" + width="284"> + [DESC]: + </text> + <button + follows="bottom|left" + font="SansSerifSmall" + height="20" + label="Copy To Inventory" + label_selected="Copy To Inventory" + layout="topleft" + left_delta="2" + name="copy_to_inventory_button" + tab_group="1" + top_pad="285" + width="120" /> + <button + follows="bottom|left" + font="SansSerifSmall" + height="20" + label="Copy And Wear" + label_selected="Copy And Wear" + layout="topleft" + left_pad="10" + name="copy_and_wear_button" + top_delta="0" + width="120" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_pay.xml b/indra/newview/skins/default/xui/en/floater_pay.xml new file mode 100644 index 0000000000000000000000000000000000000000..96195c9ba1ebc2df9132c5ef10aac30f9926f334 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_pay.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + height="140" + layout="topleft" + name="Give Money" + save_rect="true" + width="300"> + <button + height="20" + label="L$1" + label_selected="L$1" + layout="topleft" + left="108" + name="fastpay 1" + top="54" + width="80" /> + <button + height="20" + label="L$5" + label_selected="L$5" + layout="topleft" + left_pad="15" + name="fastpay 5" + top_delta="0" + width="80" /> + <button + height="20" + label="L$10" + label_selected="L$10" + layout="topleft" + left="108" + name="fastpay 10" + top="78" + width="80" /> + <button + height="20" + label="L$20" + label_selected="L$20" + layout="topleft" + left_pad="15" + name="fastpay 20" + top_delta="0" + width="80" /> + <button + enabled="false" + height="20" + label="Pay" + label_selected="Pay" + layout="topleft" + left="120" + name="pay btn" + top="112" + width="80" /> + <button + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_pad="3" + name="cancel btn" + top_delta="0" + width="80" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="18" + layout="topleft" + left="12" + name="payee_label" + top="7" + width="75"> + Pay resident: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="18" + layout="topleft" + left_delta="73" + name="payee_name" + top_delta="0" + width="210"> + [FIRST] [LAST] + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + halign="right" + height="18" + layout="topleft" + left="5" + name="fastpay text" + top="54" + width="95"> + Fast Pay: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="18" + layout="topleft" + left="12" + name="amount text" + top="112" + width="75"> + Amount: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + font="SansSerif" + height="18" + layout="topleft" + left_delta="46" + max_length="9" + name="amount" + top_delta="0" + width="57" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_pay_object.xml b/indra/newview/skins/default/xui/en/floater_pay_object.xml new file mode 100644 index 0000000000000000000000000000000000000000..bb91f709a34220805eb5a2d746b026dc1725d2cd --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_pay_object.xml @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + height="140" + layout="topleft" + name="Give Money" + save_rect="true" + width="300"> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + halign="right" + height="18" + layout="topleft" + left="5" + name="payee_group" + top="7" + width="75"> + Pay group: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + halign="right" + height="18" + layout="topleft" + left_delta="0" + name="payee_resident" + top_delta="0" + width="75"> + Pay resident: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="18" + layout="topleft" + left_pad="5" + name="payee_name" + top_delta="0" + width="210"> + [FIRST] [LAST] + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + halign="right" + height="18" + layout="topleft" + left="5" + name="object_name_label" + top="32" + width="75"> + Via object: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="18" + layout="topleft" + left_pad="5" + name="object_name_text" + top_delta="0" + width="210"> + ... + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + halign="right" + height="18" + layout="topleft" + left="5" + name="fastpay text" + top="54" + width="75"> + Fast Pay: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + halign="right" + height="18" + layout="topleft" + left_delta="0" + name="amount text" + top_pad="40" + width="75"> + Amount: + </text> + <button + height="20" + label="L$1" + label_selected="L$1" + layout="topleft" + left="85" + name="fastpay 1" + top="54" + width="80" /> + <button + height="20" + label="L$5" + label_selected="L$5" + layout="topleft" + left_pad="5" + name="fastpay 5" + top_delta="0" + width="80" /> + <button + height="20" + label="L$10" + label_selected="L$10" + layout="topleft" + left="85" + name="fastpay 10" + top="78" + width="80" /> + <button + height="20" + label="L$20" + label_selected="L$20" + layout="topleft" + left_pad="5" + name="fastpay 20" + top_delta="0" + width="80" /> + <button + enabled="false" + follows="right|bottom" + height="20" + label="Pay" + label_selected="Pay" + layout="topleft" + left="140" + name="pay btn" + top="112" + width="70" /> + <button + follows="right|bottom" + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_pad="5" + name="cancel btn" + top_delta="0" + width="70" /> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + font="SansSerif" + height="18" + layout="topleft" + left_delta="-130" + max_length="9" + name="amount" + top_delta="0" + width="50" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_perm_prefs.xml b/indra/newview/skins/default/xui/en/floater_perm_prefs.xml new file mode 100644 index 0000000000000000000000000000000000000000..430cb940e5b5fcf3e1d3a087dc238d83079673c1 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_perm_prefs.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="180" + layout="topleft" + name="perm prefs" + save_rect="true" + title="Default Upload Permissions" + width="315"> + <panel + follows="left|top|right|bottom" + height="120" + label="Permissions" + layout="topleft" + left="10" + name="permissions" + top="20" + width="315"> + <button + follows="left" + height="18" + label="?" + label_selected="?" + layout="topleft" + left="260" + name="help" + top="7" + width="22" /> + <check_box + control_name="ShareWithGroup" + height="16" + label="Share with group" + layout="topleft" + left_delta="-250" + name="share_with_group" + top_delta="2" + width="106" /> + <check_box + control_name="EveryoneCopy" + height="16" + label="Allow anyone to copy" + layout="topleft" + left_delta="0" + name="everyone_copy" + top_pad="16" + width="130" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="NextOwnerLabel" + top_pad="16" + width="88"> + Next owner can: + </text> + <check_box + control_name="NextOwnerModify" + height="16" + label="Modify" + layout="topleft" + left_delta="0" + name="next_owner_modify" + top_pad="14" + width="78" /> + <check_box + control_name="NextOwnerCopy" + height="16" + label="Copy" + layout="topleft" + left_delta="78" + name="next_owner_copy" + top_delta="0" + width="88" /> + <check_box + control_name="NextOwnerTransfer" + enabled="false" + height="16" + initial_value="true" + label="Resell/Give away" + layout="topleft" + left_delta="88" + name="next_owner_transfer" + top_delta="0" + width="106" /> + </panel> + <button + height="20" + label="OK" + label_selected="OK" + layout="topleft" + left="90" + name="ok" + top="150" + width="100" /> + <button + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_pad="5" + name="cancel" + top_delta="0" + width="100" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_post_process.xml b/indra/newview/skins/default/xui/en/floater_post_process.xml new file mode 100644 index 0000000000000000000000000000000000000000..5a36ed5fd6c0b4b7378b057978728f7bd5126f99 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_post_process.xml @@ -0,0 +1,420 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="400" + layout="topleft" + name="Post-Process Floater" + title="Post-Process Settings" + width="400"> + <tab_container + follows="left|top" + height="400" + layout="topleft" + left="0" + name="Post-Process Tabs" + tab_position="top" + top="0" + width="400"> + <panel + border="true" + follows="left|top|right|bottom" + height="400" + label="Color Filter" + layout="topleft" + left="1" + mouse_opaque="false" + name="wmiColorFilterPanel" + top="0" + width="398"> + <check_box + control_name="wmiColorFilterToggle" + height="16" + label="Enable" + layout="topleft" + left="14" + name="wmiColorFilterToggle" + top="4" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-4" + name="wmiColorFilterBrightnessText" + top_pad="4" + width="355"> + Brightness + </text> + <slider + control_name="wmiColorFilterBrightness" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="1.0" + layout="topleft" + left_delta="4" + max_val="4" + name="wmiColorFilterBrightness" + top_pad="20" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-4" + name="wmiColorFilterSaturationText" + top_pad="4" + width="355"> + Saturation + </text> + <slider + control_name="wmiColorFilterSaturation" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="1.0" + layout="topleft" + left_delta="4" + max_val="2" + min_val="-1" + name="wmiColorFilterSaturation" + top_pad="20" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-4" + name="wmiColorFilterContrastText" + top_pad="4" + width="355"> + Contrast + </text> + <slider + control_name="wmiColorFilterContrast" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="1.0" + layout="topleft" + left_delta="4" + max_val="4" + name="wmiColorFilterContrast" + top_pad="20" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-4" + name="wmiColorFilterBaseText" + top_pad="4" + width="355"> + Contrast Base Color + </text> + <slider + control_name="wmiColorFilterBaseR" + follows="left" + height="10" + increment="0.01" + initial_value="1.0" + label="R" + layout="topleft" + left_delta="4" + name="wmiColorFilterBaseR" + top_pad="20" + width="200" /> + <slider + control_name="wmiColorFilterBaseG" + follows="left" + height="10" + increment="0.01" + initial_value="1.0" + label="G" + layout="topleft" + left_delta="0" + name="wmiColorFilterBaseG" + top_pad="10" + width="200" /> + <slider + control_name="wmiColorFilterBaseB" + follows="left" + height="10" + increment="0.01" + initial_value="1.0" + label="B" + layout="topleft" + left_delta="0" + name="wmiColorFilterBaseB" + top_pad="10" + width="200" /> + <slider + control_name="wmiColorFilterBaseI" + follows="left" + height="10" + increment="0.01" + initial_value="0.5" + label="I" + layout="topleft" + left_delta="0" + name="wmiColorFilterBaseI" + top_pad="10" + width="200" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="400" + label="Night Vision" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="wmiNightVisionPanel" + top_delta="-236" + width="398"> + <check_box + control_name="wmiNightVisionToggle" + height="16" + label="Enable" + layout="topleft" + left="14" + name="wmiNightVisionToggle" + top="4" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-4" + name="wmiNightVisionBrightMultText" + top_pad="5" + width="355"> + Light Amplification Multiple + </text> + <slider + control_name="wmiNightVisionBrightMult" + follows="left" + height="10" + increment="0.01" + initial_value="3.0" + layout="topleft" + left_delta="4" + max_val="10" + min_val="1" + name="wmiNightVisionBrightMult" + top_pad="20" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-4" + name="wmiNightVisionNoiseSizeText" + top_pad="4" + width="355"> + Noise Size + </text> + <slider + control_name="wmiNightVisionNoiseSize" + follows="left" + height="10" + initial_value="1" + layout="topleft" + left_delta="4" + max_val="100" + min_val="1" + name="wmiNightVisionNoiseSize" + top_pad="20" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-4" + name="wmiNightVisionNoiseStrengthText" + top_pad="4" + width="355"> + Noise Strength + </text> + <slider + control_name="wmiNightVisionNoiseStrength" + follows="left" + height="10" + increment="0.01" + initial_value="0.3" + layout="topleft" + left_delta="4" + name="wmiNightVisionNoiseStrength" + top_pad="20" + width="200" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="400" + label="Bloom" + layout="topleft" + left_delta="0" + name="wmiBloomPanel" + top_delta="-236" + width="398"> + <check_box + control_name="wmiBloomToggle" + height="16" + label="Enable" + layout="topleft" + left="14" + name="wmiBloomToggle" + top="4" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-4" + name="wmiBloomExtractText" + top_pad="5" + width="355"> + Luminosity Extraction + </text> + <slider + control_name="wmiBloomExtract" + follows="left" + height="10" + increment="0.01" + initial_value="0.9" + layout="topleft" + left_delta="4" + name="wmiBloomExtract" + top_pad="20" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-4" + name="wmiBloomSizeText" + top_pad="4" + width="355"> + Bloom Size + </text> + <slider + control_name="wmiBloomSize" + follows="left" + height="10" + increment="0.01" + initial_value="3.0" + layout="topleft" + left_delta="4" + max_val="20" + name="wmiBloomSize" + top_pad="20" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-4" + name="wmiBloomStrengthText" + top_pad="4" + width="355"> + Bloom Strength + </text> + <slider + control_name="wmiBloomStrength" + follows="left" + height="10" + increment="0.01" + initial_value="1.2" + layout="topleft" + left_delta="4" + max_val="10" + name="wmiBloomStrength" + top_pad="20" + width="200" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="400" + label="Extras" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="Extras" + top_delta="-236" + width="398"> + <button + height="20" + label="LoadEffect" + label_selected="LoadEffect" + layout="topleft" + left="15" + name="PPLoadEffect" + top="13" + width="100" /> + <button + height="20" + label="SaveEffect" + label_selected="SaveEffect" + layout="topleft" + left_delta="0" + name="PPSaveEffect" + top_pad="7" + width="100" /> + <combo_box + height="18" + layout="topleft" + left_delta="120" + name="PPEffectsCombo" + top="15" + width="150" /> + <line_editor + border_style="line" + border_thickness="1" + follows="left|right|bottom" + font="SansSerif" + height="20" + label="Effect Name" + layout="topleft" + left_delta="0" + max_length="40" + name="PPEffectNameEditor" + tab_group="1" + top_pad="22" + width="150" /> + </panel> + </tab_container> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_postcard.xml b/indra/newview/skins/default/xui/en/floater_postcard.xml new file mode 100644 index 0000000000000000000000000000000000000000..91c2a418916eabaa3f53a952fad10e7cc1611e5a --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_postcard.xml @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + auto_tile="true" + can_minimize="false" + can_resize="true" + height="380" + layout="topleft" + min_height="380" + min_width="450" + name="Postcard" + title="Email Snapshot" + width="450"> + <floater.string + name="default_subject"> + Postcard from Second Life. + </floater.string> + <floater.string + name="default_message"> + Check this out! + </floater.string> + <floater.string + name="upload_message"> + Sending... + </floater.string> + <text + type="string" + length="1" + bottom="35" + follows="top|left" + font="SansSerif" + layout="topleft" + left="12" + name="to_label"> + Recipient's Email: + </text> + <line_editor + follows="left|top" + height="20" + layout="topleft" + left_delta="108" + name="to_form" + top_delta="-4" + width="150" /> + <text + type="string" + length="1" + bottom_delta="23" + follows="top|left" + font="SansSerif" + layout="topleft" + left="12" + name="from_label"> + Your Email: + </text> + <line_editor + follows="left|top" + height="20" + layout="topleft" + left_delta="108" + name="from_form" + top_delta="-4" + width="150" /> + <text + type="string" + length="1" + bottom_delta="23" + follows="top|left" + font="SansSerif" + layout="topleft" + left="12" + name="name_label"> + Your Name: + </text> + <line_editor + follows="left|top" + height="20" + layout="topleft" + left_delta="108" + max_length="100" + name="name_form" + top_delta="-4" + width="150" /> + <text + type="string" + length="1" + bottom_delta="23" + follows="top|left" + font="SansSerif" + layout="topleft" + left="12" + name="subject_label"> + Subject: + </text> + <line_editor + follows="left|top" + height="20" + label="Type your subject here." + layout="topleft" + left_delta="108" + max_length="100" + name="subject_form" + top_delta="-4" + width="150" /> + <text + type="string" + length="1" + bottom_delta="23" + follows="top|left" + font="SansSerif" + layout="topleft" + left="12" + name="msg_label"> + Message: + </text> + <text_editor + type="string" + length="1" + follows="left|top|right|bottom" + height="140" + layout="topleft" + left_delta="0" + max_length="700" + name="msg_form" + top_pad="10" + width="420"> + Type your message here. + </text_editor> + <text + type="string" + length="1" + bottom_delta="37" + follows="left|bottom" + layout="topleft" + left="12" + name="fine_print"> + If your recipient joins SL, you'll get a referral bonus. + </text> + <button + follows="right|bottom" + height="20" + label="Cancel" + layout="topleft" + name="cancel_btn" + right="-10" + top="350" + width="100" /> + <button + follows="right|bottom" + height="20" + label="Send" + layout="topleft" + left_delta="-106" + name="send_btn" + top_delta="0" + width="100" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml new file mode 100644 index 0000000000000000000000000000000000000000..ba28016d8eca08044990352a080c057e53ea342f --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_preferences.xml @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + center_horiz="true" + center_vert="true" + default_tab_group="1" + height="460" + layout="topleft" + name="Preferences" + single_instance="true" + title="Preferences" + width="620"> + <button + follows="right|bottom" + height="20" + label="OK" + label_selected="OK" + layout="topleft" + left="335" + name="OK" + top="435" + width="90"> + <button.commit_callback + function="Pref.OK" /> + </button> + <button + follows="right|bottom" + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_pad="3" + name="Cancel" + top_delta="0" + width="90" > + <button.commit_callback + function="Pref.Cancel" /> + </button> + <button + follows="right|bottom" + height="20" + label="Apply" + label_selected="Apply" + layout="topleft" + left_pad="3" + name="Apply" + top_delta="0" + width="90"> + <button.commit_callback + function="Pref.Apply" /> + </button> + <button + follows="left|bottom" + height="20" + label="About" + label_selected="About" + layout="topleft" + left_delta="-512" + name="About..." + top_delta="0" + width="90"> + <button.commit_callback + function="Floater.Show" + parameter="sl_about" /> + </button> + <button + follows="left|bottom" + height="20" + help_url="https://support.secondlife.com/ics/support/default.asp?deptID=4417" + label="Help" + label_selected="Help" + layout="topleft" + left_pad="3" + name="Help" + top_delta="0" + width="90" /> + <tab_container + follows="left|top|right|bottom" + height="410" + layout="topleft" + left="0" + name="pref core" + tab_group="1" + tab_position="left" + tab_width="120" + top="21" + width="620"> + <panel + class="panel_preference" + filename="panel_preferences_general.xml" + label="General" + layout="topleft" + name="general" /> + <panel + class="panel_preference" + filename="panel_preferences_input.xml" + label="Input & Camera" + layout="topleft" + name="input" /> + <panel + class="panel_preference" + filename="panel_preferences_network.xml" + label="Network" + layout="topleft" + name="network" /> + <panel + class="panel_preference" + filename="panel_preferences_web.xml" + label="Web" + layout="topleft" + name="web" /> + <panel + filename="panel_preferences_graphics1.xml" + label="Graphics" + layout="topleft" + name="display" /> + <panel + class="panel_preference" + filename="panel_preferences_audio.xml" + label="Audio & Video" + layout="topleft" + name="audio" /> + <panel + class="panel_preference" + filename="panel_preferences_chat.xml" + label="Text Chat" + layout="topleft" + name="chat" /> + <panel + class="panel_preference" + filename="panel_preferences_voice.xml" + label="Voice Chat" + layout="topleft" + name="voice" /> + <panel + class="panel_preference" + filename="panel_preferences_im.xml" + label="Communication" + layout="topleft" + name="im" /> + <panel + class="panel_preference" + filename="panel_preferences_popups.xml" + label="Popups" + layout="topleft" + name="msgs" /> + <panel + class="panel_preference" + filename="panel_preferences_skins.xml" + label="Skins" + layout="topleft" + name="skins" /> + </tab_container> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_preview_animation.xml b/indra/newview/skins/default/xui/en/floater_preview_animation.xml new file mode 100644 index 0000000000000000000000000000000000000000..50aabfc89596674f2940487298d0cac4611209ba --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_preview_animation.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + auto_tile="true" + height="85" + layout="topleft" + name="preview_anim" + width="300"> + <floater.string + name="Title"> + Animation: [NAME] + </floater.string> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + font="SansSerif" + height="19" + layout="topleft" + left="93" + max_length="127" + name="desc" + top="19" + width="194" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="19" + layout="topleft" + left_delta="-80" + name="desc txt" + top_delta="0" + width="80"> + Description: + </text> + <button + height="19" + label="Play in World" + label_selected="Stop" + layout="topleft" + left="27" + name="Anim play btn" + tool_tip="Play this animation so that others can see it." + top="47" + width="96" /> + <button + height="19" + label="Play Locally" + label_selected="Stop" + layout="topleft" + left_pad="54" + name="Anim audition btn" + tool_tip="Play this animation so that only you can see it." + top_delta="0" + width="96" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_preview_classified.xml b/indra/newview/skins/default/xui/en/floater_preview_classified.xml new file mode 100644 index 0000000000000000000000000000000000000000..6fac2823e844abfc59d9a89e066d23db4d29f6f5 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_preview_classified.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + auto_tile="true" + height="510" + layout="topleft" + name="classified_preview" + save_rect="true" + title="Classified Information" + width="440"> + <floater.string + name="Title"> + Classified: [NAME] + </floater.string> + <panel + follows="bottom|left" + height="470" + layout="topleft" + left="0" + name="classified_details_panel" + top="20" + width="440" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_preview_event.xml b/indra/newview/skins/default/xui/en/floater_preview_event.xml new file mode 100644 index 0000000000000000000000000000000000000000..58dd43075d324ae334c680ad77b6cb35afa801fd --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_preview_event.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + auto_tile="true" + height="510" + layout="topleft" + name="event_preview" + save_rect="true" + title="Event Information" + width="440"> + <floater.string + name="Title"> + Event: [NAME] + </floater.string> + <panel + follows="bottom|left" + height="470" + layout="topleft" + left="0" + name="event_details_panel" + top="20" + width="440" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml new file mode 100644 index 0000000000000000000000000000000000000000..9d183d8103d8e63aec90d5d8beef991910625850 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml @@ -0,0 +1,351 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + auto_tile="true" + height="350" + layout="topleft" + name="gesture_preview" + width="450"> + <floater.string + name="step_anim"> + Animation to play: + </floater.string> + <floater.string + name="step_sound"> + Sound to play: + </floater.string> + <floater.string + name="step_chat"> + Chat to say: + </floater.string> + <floater.string + name="step_wait"> + Wait: + </floater.string> + <floater.string + name="stop_txt"> + Stop + </floater.string> + <floater.string + name="preview_txt"> + Preview + </floater.string> + <floater.string + name="none_text"> + -- None -- + </floater.string> + <floater.string + name="Title"> + Gesture: [NAME] + </floater.string> + <text + type="string" + length="1" + follows="top|left" + font="SansSerif" + height="10" + layout="topleft" + left="16" + name="desc_label" + top="25" + width="100"> + Description: + </text> + <line_editor + follows="left|top" + height="20" + layout="topleft" + left_delta="84" + name="desc" + top_delta="-4" + width="330" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerif" + height="10" + layout="topleft" + left="16" + name="trigger_label" + top="54" + width="100"> + Trigger: + </text> + <line_editor + follows="left|top" + height="20" + layout="topleft" + left_delta="84" + max_length="31" + name="trigger_editor" + top_delta="-4" + width="105" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerif" + height="10" + layout="topleft" + left_pad="15" + name="replace_text" + tool_tip="Replace the trigger word(s) with these words. For example, trigger 'hello' replace with 'howdy' will turn the chat 'I wanted to say hello' into 'I wanted to say howdy' as well as playing the gesture!" + top_delta="4" + width="200"> + Replace with: + </text> + <line_editor + follows="left|top" + height="20" + layout="topleft" + left_delta="80" + max_length="31" + name="replace_editor" + tool_tip="Replace the trigger word(s) with these words. For example, trigger 'hello' replace with 'howdy' will turn the chat 'I wanted to say hello' into 'I wanted to say howdy' as well as playing the gesture" + top_delta="-4" + width="130" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerif" + height="10" + layout="topleft" + left="16" + name="key_label" + top="83" + width="100"> + Shortcut Key: + </text> + <combo_box + height="20" + label="None" + layout="topleft" + left_delta="84" + name="modifier_combo" + top_delta="-4" + width="50" /> + <combo_box + height="20" + label="None" + layout="topleft" + left_pad="10" + name="key_combo" + top_delta="0" + width="45" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerif" + height="10" + layout="topleft" + left="16" + name="library_label" + top="112" + width="100"> + Library: + </text> + <text + type="string" + length="1" + follows="top|left" + font="SansSerif" + height="10" + layout="topleft" + left_pad="104" + name="steps_label" + top_delta="0" + width="100"> + Steps: + </text> + <scroll_list + follows="top|left" + height="110" + layout="topleft" + left="16" + name="library_list" + top="132" + width="100"> + <scroll_list.rows + value="Animation" /> + <scroll_list.rows + value="Sound" /> + <scroll_list.rows + value="Chat" /> + <scroll_list.rows + value="Wait" /> + </scroll_list> + <button + follows="top|left" + height="20" + label="Add >>" + layout="topleft" + left_pad="14" + name="add_btn" + top_delta="0" + width="80" /> + <button + follows="top|left" + height="20" + label="Move Up" + layout="topleft" + left_delta="0" + name="up_btn" + top_pad="10" + width="80" /> + <button + follows="top|left" + height="20" + label="Move Down" + layout="topleft" + left_delta="0" + name="down_btn" + top_pad="10" + width="80" /> + <button + follows="top|left" + height="20" + label="Remove" + layout="topleft" + left_delta="0" + name="delete_btn" + top_pad="10" + width="80" /> + <scroll_list + follows="top|left" + height="110" + layout="topleft" + left="220" + name="step_list" + top="132" + width="210" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerif" + height="60" + layout="topleft" + left="16" + name="help_label" + top="252" + width="200"> + All steps happen simultaneously, +unless you add wait steps. + </text> + <text + follows="top|left" + height="60" + layout="topleft" + left_pad="6" + name="options_text" + top_delta="0" + width="205" /> + <combo_box + follows="top|left" + height="20" + layout="topleft" + left_delta="10" + name="animation_list" + top="272" + width="100" /> + <combo_box + follows="top|left" + height="20" + layout="topleft" + left_delta="0" + name="sound_list" + top_delta="0" + width="100" /> + <line_editor + follows="top|left" + height="20" + layout="topleft" + left_delta="0" + max_length="127" + name="chat_editor" + top_delta="0" + width="100" /> + <radio_group + draw_border="false" + follows="top|left" + height="40" + layout="topleft" + left_pad="8" + name="animation_trigger_type" + top_delta="0" + width="80"> + <radio_item + height="16" + label="Start" + layout="topleft" + left="3" + name="start" + top="-11" + width="80" /> + <radio_item + height="16" + label="Stop" + layout="topleft" + left_delta="0" + name="stop" + top_pad="10" + width="80" /> + </radio_group> + <check_box + follows="top|left" + height="20" + label="until animations are done" + layout="topleft" + left="232" + name="wait_anim_check" + top="267" + width="100" /> + <check_box + follows="top|left" + height="20" + label="time in seconds" + layout="topleft" + left_delta="0" + name="wait_time_check" + top_delta="20" + width="100" /> + <line_editor + follows="top|left" + height="20" + layout="topleft" + left_pad="5" + max_length="15" + name="wait_time_editor" + top_delta="0" + width="50" /> + <check_box + follows="top|left" + height="20" + label="Active" + layout="topleft" + left="140" + name="active_check" + tool_tip="Active gestures can be triggered by chatting their trigger phrases or pressing their hot keys. Gestures usually become inactive when there is a key binding conflict." + top="323" + width="100" /> + <button + follows="top|left" + height="20" + label="Preview" + layout="topleft" + left_delta="75" + name="preview_btn" + top_delta="2" + width="80" /> + <button + follows="top|left" + height="20" + label="Save" + layout="topleft" + left_pad="10" + name="save_btn" + top_delta="0" + width="80" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml new file mode 100644 index 0000000000000000000000000000000000000000..3327dc8c8b537e01990efa7eb40db8451e1e64cb --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + auto_tile="true" + can_resize="true" + default_tab_group="1" + follows="left|top" + height="361" + layout="topleft" + min_height="243" + min_width="234" + name="preview notecard" + title="Note:" + width="400"> + <floater.string + name="no_object"> + Unable to find object containing this note. + </floater.string> + <floater.string + name="not_allowed"> + You are not allowed to view this note. + </floater.string> + <floater.string + name="Title"> + Notecard: [NAME] + </floater.string> + <floater.string + name="Save"> + Save + </floater.string> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="344" + mouse_opaque="true" + name="lock" + top="3" + width="16" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="19" + layout="topleft" + left="13" + name="desc txt" + top="19" + width="80"> + Description: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + font="SansSerif" + height="19" + layout="topleft" + left_delta="80" + max_length="127" + name="desc" + top_delta="0" + width="294" /> + <text_editor + type="string" + length="1" + embedded_items="true" + follows="left|top|right|bottom" + font="SansSerif" + height="281" + ignore_tab="false" + layout="topleft" + left="4" + max_length="65536" + name="Notecard Editor" + tab_group="1" + top="46" + width="392" + word_wrap="true"> + Loading... + </text_editor> + <button + follows="left|bottom" + height="20" + label="Discard" + label_selected="Discard" + layout="topleft" + left="9" + name="Discard" + top="332" + width="100" /> + <button + enabled="false" + follows="left|bottom" + height="20" + label="Keep" + label_selected="Keep" + layout="topleft" + left_pad="5" + mouse_opaque="false" + name="Keep" + top_delta="0" + width="100" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_preview_sound.xml b/indra/newview/skins/default/xui/en/floater_preview_sound.xml new file mode 100644 index 0000000000000000000000000000000000000000..07a50ac5896b5e94f1e8a09f7f427c9f4a384555 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_preview_sound.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + auto_tile="true" + height="85" + layout="topleft" + name="preview_sound" + width="300"> + <floater.string + name="Title"> + Sound: [NAME] + </floater.string> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + font="SansSerif" + height="19" + layout="topleft" + left="95" + max_length="127" + name="desc" + top="19" + width="192" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="19" + layout="topleft" + left_delta="-82" + name="desc txt" + top_delta="0" + width="80"> + Description: + </text> + <button + follows="left|top" + height="19" + label="Play Locally" + label_selected="Play Locally" + layout="topleft" + left="168" + name="Sound audition btn" + sound_flags="0" + tool_tip="Play this sound so that only you can hear it." + top="51" + width="120" /> + <button + follows="left|top" + height="19" + label="Play in World" + label_selected="Play in World" + layout="topleft" + left_delta="-126" + name="Sound play btn" + sound_flags="0" + tool_tip="Play this sound so that others can hear it." + top_delta="0" + width="120" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_preview_texture.xml b/indra/newview/skins/default/xui/en/floater_preview_texture.xml new file mode 100644 index 0000000000000000000000000000000000000000..661dc63b3d5d8fdd5074ce5a5ac4de4e522cdfe3 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_preview_texture.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + auto_tile="true" + can_resize="true" + follows="left|bottom" + height="331" + layout="topleft" + min_height="120" + min_width="300" + name="preview_texture" + width="300"> + <floater.string + name="Title"> + Texture: [NAME] + </floater.string> + <floater.string + name="Copy"> + Copy To Inventory + </floater.string> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="19" + layout="topleft" + left="13" + name="desc txt" + top="21" + width="80"> + Description: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + font="SansSerif" + height="19" + layout="topleft" + left_delta="80" + max_length="127" + name="desc" + top_delta="-2" + width="194" /> + <button + follows="left|bottom" + height="20" + label="Discard" + label_selected="Discard" + layout="topleft" + left="9" + name="Discard" + top="302" + width="100" /> + <button + follows="left|bottom" + height="20" + label="Keep" + label_selected="Keep" + layout="topleft" + left_pad="5" + name="Keep" + top_delta="0" + width="100" /> + <text + type="string" + length="1" + follows="left|bottom" + height="14" + layout="topleft" + left="13" + name="dimensions" + top="287" + width="163"> + Dimensions: [WIDTH] x [HEIGHT] + </text> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_region_info.xml b/indra/newview/skins/default/xui/en/floater_region_info.xml new file mode 100644 index 0000000000000000000000000000000000000000..48694e5fb6462306e991085ef5ad5c17d32f4acc --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_region_info.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="512" + layout="topleft" + name="regioninfo" + save_rect="true" + title="Region/Estate" + width="480"> + <tab_container + bottom="512" + follows="left|right|top|bottom" + layout="topleft" + left="1" + name="region_panels" + right="-1" + tab_position="top" + top="20" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_report_abuse.xml b/indra/newview/skins/default/xui/en/floater_report_abuse.xml new file mode 100644 index 0000000000000000000000000000000000000000..4c036f98e5cc8408f921953d32145f03f1831e1f --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_report_abuse.xml @@ -0,0 +1,454 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="590" + layout="topleft" + name="floater_report_abuse" + title="Report Abuse" + width="390"> + <floater.string + name="Screenshot"> + Screenshot + </floater.string> + <texture_picker + allow_no_texture="true" + default_image_name="None" + follows="left|top" + height="114" + layout="topleft" + left="238" + name="screenshot" + top="36" + width="134" /> + <check_box + height="16" + label="Include screenshot" + layout="topleft" + left="13" + name="screen_check" + top="134" + width="116" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="3" + name="reporter_title" + top_delta="-102" + width="50"> + Reporter: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="12" + name="reporter_field" + top_delta="0" + width="150"> + Loremipsum Dolorsitamut + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="16" + name="sim_title" + top="48" + width="60"> + Region: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="2" + name="sim_field" + top_delta="0" + width="120"> + Region Name + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="16" + name="pos_title" + top="64" + width="50"> + Position: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="12" + name="pos_field" + top_delta="0" + width="120"> + {128.1, 128.1, 15.4} + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="16" + name="select_object_label" + top="82" + width="220"> + Click the button then the object: + </text> + <button + height="32" + layout="topleft" + left_delta="0" + name="pick_btn" + picture_style="true" + tool_tip="Object Picker - Identify an object as the subject of this report" + top_delta="14" + width="32" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="5" + name="object_name_label" + top_delta="0" + width="60"> + Name: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="6" + name="object_name" + top_delta="0" + width="109"> + Consetetur Sadipscing + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="53" + name="owner_name_label" + top="112" + width="60"> + Owner: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="6" + name="owner_name" + top_delta="0" + width="109"> + Hendrerit Vulputate + </text> + <combo_box + height="20" + layout="topleft" + left="16" + name="category_combo" + tool_tip="Category -- select the category that best describes this report" + top="156" + width="356"> + <combo_box.item + label="Select category" + value="0" /> + <combo_box.item + label="Age > Age play" + value="31" /> + <combo_box.item + label="Age > Adult resident on Teen Second Life" + value="32" /> + <combo_box.item + label="Age > Underage resident outside of Teen Second Life" + value="33" /> + <combo_box.item + label="Assault > Combat sandbox / unsafe area" + value="34" /> + <combo_box.item + label="Assault > Safe area" + value="35" /> + <combo_box.item + label="Assault > Weapons testing sandbox" + value="36" /> + <combo_box.item + label="Commerce > Failure to deliver product or service" + value="38" /> + <combo_box.item + label="Disclosure > Real world information" + value="39" /> + <combo_box.item + label="Disclosure > Remotely monitoring chat" + value="40" /> + <combo_box.item + label="Disclosure > Second Life information/chat/IMs" + value="41" /> + <combo_box.item + label="Disturbing the peace > Unfair use of region resources" + value="42" /> + <combo_box.item + label="Disturbing the peace > Excessive scripted objects" + value="43" /> + <combo_box.item + label="Disturbing the peace > Object littering" + value="44" /> + <combo_box.item + label="Disturbing the peace > Repetitive spam" + value="45" /> + <combo_box.item + label="Disturbing the peace > Unwanted advert spam" + value="46" /> + <combo_box.item + label="Fraud > L$" + value="47" /> + <combo_box.item + label="Fraud > Land" + value="48" /> + <combo_box.item + label="Fraud > Pyramid scheme or chain letter" + value="49" /> + <combo_box.item + label="Fraud > US$" + value="50" /> + <combo_box.item + label="Harassment > Advert farms / visual spam" + value="51" /> + <combo_box.item + label="Harassment > Defaming individuals or groups" + value="52" /> + <combo_box.item + label="Harassment > Impeding movement" + value="53" /> + <combo_box.item + label="Harassment > Sexual harassment" + value="54" /> + <combo_box.item + label="Harassment > Solicting/inciting others to violate ToS" + value="55" /> + <combo_box.item + label="Harassment > Verbal abuse" + value="56" /> + <combo_box.item + label="Indecency > Broadly offensive content or conduct" + value="57" /> + <combo_box.item + label="Indecency > Inappropriate avatar name" + value="59" /> + <combo_box.item + label="Indecency > Inappropriate content or conduct in a PG region" + value="60" /> + <combo_box.item + label="Indecency > Inappropriate content or conduct in a Mature region" + value="69" /> + <combo_box.item + label="Intellectual property infringement > Content Removal" + value="66" /> + <combo_box.item + label="Intellectual property infringement > CopyBot or Permissions Exploit" + value="37" /> + <combo_box.item + label="Intolerance" + value="61" /> + <combo_box.item + label="Land > Abuse of sandbox resources" + value="62" /> + <combo_box.item + label="Land > Encroachment > Objects/textures" + value="63" /> + <combo_box.item + label="Land > Encroachment > Particles" + value="64" /> + <combo_box.item + label="Land > Encroachment > Trees/plants" + value="65" /> + <combo_box.item + label="Wagering/gambling" + value="67" /> + <combo_box.item + label="Other" + value="68" /> + </combo_box> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="abuser_name_title" + top_pad="10" + width="180"> + Abuser name: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + max_length="32" + name="abuser_name_edit" + top_pad="2" + width="180" /> + <button + height="20" + label="Choose Resident" + layout="topleft" + left_pad="10" + name="select_abuser" + tool_tip="Select the name of the abuser from a list" + top_delta="-2" + width="160" /> + <check_box + height="16" + label="Don't know abuser's name" + layout="topleft" + left="13" + name="omit_abuser_name" + tool_tip="Check this if you are unable to provide the abuser's name" + top="224" + visible="false" + width="116" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="3" + name="abuser_name_title2" + top_pad="8" + width="180"> + Location of Abuse: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + max_length="256" + name="abuse_location_edit" + top_pad="2" + width="356" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="sum_title" + top_pad="8" + width="180"> + Summary: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + max_length="64" + name="summary_edit" + top_pad="2" + width="356" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="dscr_title" + top_pad="8" + width="180"> + Details: + </text> + <text + type="string" + length="1" + follows="left|top" + height="48" + layout="topleft" + left_delta="54" + name="bug_aviso" + top_delta="0" + width="308"> + Please be specific about the date, location, nature of +abuse, relevant chat/IM text, and select the object +if possible. + </text> + <text_editor + follows="left|top" + height="146" + layout="topleft" + left="16" + max_length="800" + mouse_opaque="false" + name="details_edit" + top="386" + width="356" + word_wrap="true" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="incomplete_title" + top_pad="8" + width="342"> + Note: Incomplete reports will not be investigated. + </text> + <button + bottom="580" + follows="right|bottom" + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + name="cancel_btn" + right="373" + width="150" /> + <button + bottom="580" + follows="right|bottom" + height="20" + label="Report Abuse" + label_selected="Report Abuse" + layout="topleft" + name="send_btn" + right="217" + width="150" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_script_debug.xml b/indra/newview/skins/default/xui/en/floater_script_debug.xml new file mode 100644 index 0000000000000000000000000000000000000000..2ae0afa1681bde6063e6a168e4ade9317d3b5a93 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_script_debug.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<multi_floater + can_resize="true" + height="233" + layout="topleft" + name="script debug floater" + save_rect="true" + title="Script Warning/Error" + width="450"> + <tab_container + follows="left|top|right|bottom" + height="217" + layout="topleft" + left="1" + name="Preview Tabs" + tab_position="bottom" + top="16" + width="448" /> +</multi_floater> diff --git a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml new file mode 100644 index 0000000000000000000000000000000000000000..2dd7a1e777c7ee1a5618bfeaf292eb9d81f36de8 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + follows="left|top|right|bottom" + height="200" + layout="topleft" + name="script" + short_title="[All scripts]" + title="[All scripts]" + width="440"> + <text_editor + bottom="197" + follows="left|top|right|bottom" + height="176" + layout="topleft" + max_length="10000" + name="Chat History Editor" + width="420" + word_wrap="true" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_script_preview.xml b/indra/newview/skins/default/xui/en/floater_script_preview.xml new file mode 100644 index 0000000000000000000000000000000000000000..cb3ff9236340d3eec7413befa516af4661a13f67 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_script_preview.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + auto_tile="true" + can_resize="true" + height="550" + layout="topleft" + left_delta="343" + min_height="271" + min_width="290" + name="preview lsl text" + save_rect="true" + title="Script: Rotation Script" + top_delta="0" + width="500"> + <floater.string + name="Title"> + Script: [NAME] + </floater.string> + <panel + follows="left|top|right|bottom" + height="508" + layout="topleft" + left="0" + name="script panel" + top="42" + width="497" /> + <icon + follows="top|right" + height="16" + image_name="icon_lock.tga" + layout="topleft" + left="444" + mouse_opaque="true" + name="lock" + top="3" + width="16" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="19" + layout="topleft" + left="13" + name="desc txt" + top="19" + width="80"> + Description: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + font="SansSerif" + height="19" + layout="topleft" + left_delta="80" + max_length="127" + name="desc" + top_delta="0" + width="394" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_script_queue.xml b/indra/newview/skins/default/xui/en/floater_script_queue.xml new file mode 100644 index 0000000000000000000000000000000000000000..ad91e8156b89ea4815a297c8bd36655f487704b9 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_script_queue.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + auto_tile="true" + can_resize="true" + height="400" + layout="topleft" + name="queue" + save_rect="true" + title="Reset Progress" + width="300"> + <floater.string + name="Starting"> + Starting [START] of [COUNT] items. + </floater.string> + <floater.string + name="Done"> + Done. + </floater.string> + <floater.string + name="Resetting"> + Resetting + </floater.string> + <floater.string + name="Running"> + Running + </floater.string> + <floater.string + name="NotRunning"> + Not running + </floater.string> + <button + follows="right|bottom" + height="24" + label="Close" + label_selected="Close" + layout="topleft" + left="220" + name="close" + top="368" + width="64" /> + <scroll_list + follows="left|top|right|bottom" + height="344" + layout="topleft" + left="4" + name="queue output" + top="20" + width="292" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_script_search.xml b/indra/newview/skins/default/xui/en/floater_script_search.xml new file mode 100644 index 0000000000000000000000000000000000000000..bb0c60e75b93325e6c95d8c25658ef1a3e157d63 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_script_search.xml @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + default_tab_group="1" + height="120" + layout="topleft" + name="script search" + title="Script Search" + width="300"> + <check_box + control_name="LSLFindCaseInsensitivity" + height="16" + label="Case Insensitive" + layout="topleft" + left="55" + name="case_text" + top="61" + width="240" /> + <button + height="24" + label="Search" + label_selected="Search" + layout="topleft" + left="10" + name="search_btn" + top="84" + width="90" /> + <button + height="24" + label="Replace" + label_selected="Replace" + layout="topleft" + left_pad="5" + name="replace_btn" + top_delta="0" + width="90" /> + <button + height="24" + label="Replace All" + label_selected="Replace All" + layout="topleft" + left_pad="5" + name="replace_all_btn" + top_delta="0" + width="90" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="5" + name="txt" + top="21" + width="45"> + Search + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="txt2" + top_pad="5" + width="45"> + Replace + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left="55" + name="search_text" + tab_group="1" + top="21" + width="240" /> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="replace_text" + top_pad="5" + width="240" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_select_key.xml b/indra/newview/skins/default/xui/en/floater_select_key.xml new file mode 100644 index 0000000000000000000000000000000000000000..b89af0ef3e68bc0a0f50e90b73b2d28dcef92f5e --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_select_key.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + border="true" + can_close="false" + can_minimize="false" + height="100" + layout="topleft" + name="modal container" + width="240"> + <button + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left="138" + name="Cancel" + top="70" + width="82" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left="20" + name="Save item as:" + top="10" + width="200"> + Press a key to select + </text> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_sell_land.xml b/indra/newview/skins/default/xui/en/floater_sell_land.xml new file mode 100644 index 0000000000000000000000000000000000000000..26c805c0f7d472059f5d7abc905a4bc4887034a5 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_sell_land.xml @@ -0,0 +1,315 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + height="485" + layout="topleft" + name="sell land" + title="Sell Land" + width="450"> + <texture_picker + enabled="false" + follows="top|left" + height="135" + layout="topleft" + left="244" + name="info_image" + right="424" + top="40" + width="180" /> + <text + type="string" + length="1" + bottom_delta="-144" + follows="top|left" + layout="topleft" + left="16" + name="info_parcel_label" + width="48"> + Parcel: + </text> + <text + type="string" + length="1" + bottom_delta="5" + follows="top|left" + font="SansSerif" + height="16" + layout="topleft" + left="56" + name="info_parcel" + right="-20"> + PARCEL NAME + </text> + <text + type="string" + length="1" + follows="top|left" + layout="topleft" + left="16" + name="info_size_label" + width="48"> + Size: + </text> + <text + type="string" + length="1" + bottom_delta="21" + follows="top|left" + font="SansSerif" + height="32" + layout="topleft" + left="56" + name="info_size" + right="-20"> + [AREA] sq. m. + </text> + <text + type="string" + length="1" + follows="top|left" + font="SansSerifHuge" + height="24" + layout="topleft" + left="16" + name="info_action" + text_color="white" + top="141" + width="200"> + To sell this parcel: + </text> + <icon + follows="top|left" + height="64" + image_name="badge_note.j2c" + layout="topleft" + left="0" + name="step_price" + top="167" + width="64" /> + <text + type="string" + length="1" + bottom_delta="-38" + follows="top|left" + font="SansSerifBig" + height="16" + layout="topleft" + left="72" + name="price_label" + right="-20"> + Set a price: + </text> + <text + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left="72" + name="price_text" + right="-20"> + Choose an appropriate price for this land. + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left="72" + name="price_ld" + width="20"> + L$ + </text> + <line_editor + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left_delta="20" + name="price" + top_delta="0" + width="100"> + 0 + </line_editor> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_pad="10" + name="price_per_m" + top_delta="0" + width="200"> + (L$[PER_METER] per square meter) + </text> + <icon + follows="top|left" + height="64" + image_name="badge_note.j2c" + layout="topleft" + left="0" + name="step_sell_to" + width="64" /> + <text + type="string" + length="1" + bottom_delta="-38" + follows="top|left" + font="SansSerifBig" + height="16" + layout="topleft" + left="72" + name="sell_to_label" + right="-20"> + Sell the land to: + </text> + <text + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left="72" + name="sell_to_text" + right="-20"> + Choose whether to sell to anyone or a particular buyer. + </text> + <combo_box + follows="top|right" + height="16" + layout="topleft" + left_delta="0" + name="sell_to" + top_delta="16" + width="140"> + <combo_box.item + enabled="false" + label="select one --" + value="select" /> + <combo_box.item + label="Anyone" + value="anyone" /> + <combo_box.item + label="Specific user:" + value="user" /> + </combo_box> + <line_editor + enabled="false" + follows="top|right" + height="16" + layout="topleft" + left_delta="0" + name="sell_to_agent" + top_pad="4" + width="150" /> + <button + height="16" + label="Select..." + layout="topleft" + left_pad="5" + name="sell_to_select_agent" + top_delta="0" + width="60" /> + <icon + follows="top|left" + height="64" + image_name="badge_note.j2c" + layout="topleft" + left="0" + name="step_sell_objects" + width="64" /> + <text + type="string" + length="1" + bottom_delta="-38" + follows="top|left" + font="SansSerifBig" + height="16" + layout="topleft" + left="72" + name="sell_objects_label" + right="-20"> + Sell the objects with the land? + </text> + <text + type="string" + length="1" + bottom_delta="20" + follows="top|left" + height="16" + layout="topleft" + left="72" + name="sell_objects_text"> + Land owner's transferable objects on parcel will change ownership. + </text> + <radio_group + bottom_delta="44" + follows="top|right" + height="40" + layout="topleft" + left="72" + name="sell_objects" + right="420"> + <radio_item + bottom="40" + height="0" + layout="topleft" + left="10" + name="none" + visible="false" /> + <radio_item + bottom="20" + height="16" + label="No, keep ownership of objects" + layout="topleft" + left="10" + name="no" /> + <radio_item + bottom="40" + height="16" + label="Yes, sell objects with land" + layout="topleft" + left="10" + name="yes" /> + </radio_group> + <button + height="16" + label="Show Objects" + layout="topleft" + name="show_objects" + right="414" + top="393" + width="110" /> + <text + type="string" + length="1" + bottom_delta="35" + follows="top|left" + font="SansSerifBig" + height="16" + layout="topleft" + left="72" + name="nag_message_label" + right="-20"> + REMEMBER: All sales are final. + </text> + <button + follows="bottom|left" + height="20" + label="Set Land For Sale" + layout="topleft" + left_delta="0" + name="sell_btn" + top_pad="15" + width="130" /> + <button + follows="bottom|right" + height="20" + label="Cancel" + layout="topleft" + left_pad="152" + name="cancel_btn" + top_delta="0" + width="90" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_settings_debug.xml b/indra/newview/skins/default/xui/en/floater_settings_debug.xml new file mode 100644 index 0000000000000000000000000000000000000000..108d0b97e8f6a06bf196f66162e05356d9c8d004 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_settings_debug.xml @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + height="215" + layout="topleft" + name="settings_debug" + title="Debug Settings" + width="350"> + <combo_box + allow_text_entry="true" + follows="top|left" + height="20" + layout="topleft" + left="15" + max_chars="255" + name="settings_combo" + top="30" + width="200" /> + <text_editor + enabled="false" + height="60" + hide_scrollbar="true" + layout="topleft" + left_delta="0" + name="comment_text" + top_pad="15" + width="320" + word_wrap="true" /> + <combo_box + follows="top|left" + height="20" + layout="topleft" + left_delta="0" + name="boolean_combo" + top_pad="10" + visible="false" + width="100"> + <combo_box.item + label="TRUE" + value="true" /> + <combo_box.item + label="FALSE" + value="" /> + </combo_box> + <line_editor + height="20" + layout="topleft" + left_delta="0" + name="val_text" + top_delta="0" + visible="false" + width="300" /> + <color_swatch + bottom="185" + can_apply_immediately="true" + height="55" + label="Color" + layout="topleft" + width="37" /> + <spinner + height="20" + label="x" + layout="topleft" + left_delta="0" + max_val="1e+007" + name="val_spinner_1" + top_delta="10" + visible="false" + width="120" /> + <spinner + height="20" + label="x" + layout="topleft" + left_pad="15" + max_val="1e+007" + name="val_spinner_2" + top_delta="0" + visible="false" + width="120" /> + <spinner + height="20" + label="x" + layout="topleft" + left="15" + max_val="1e+007" + name="val_spinner_3" + top="160" + visible="false" + width="120" /> + <spinner + height="20" + label="x" + layout="topleft" + left_pad="15" + max_val="1e+007" + name="val_spinner_4" + top_delta="0" + visible="false" + width="120" /> + <button + height="20" + label="Reset to default" + layout="topleft" + left="15" + name="default_btn" + top="190" + width="150" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml new file mode 100644 index 0000000000000000000000000000000000000000..f3d8938ea29f38639797f4a8b4fd006d382602fa --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -0,0 +1,370 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + follows="left|top" + height="526" + layout="topleft" + name="Snapshot" + save_rect="true" + title="Snapshot Preview" + width="215"> + <floater.string + name="unknown"> + unknown + </floater.string> + <text + type="string" + length="1" + follows="top|left" + height="15" + layout="topleft" + left="10" + name="type_label" + top="25" + width="195"> + Snapshot destination + </text> + <radio_group + height="60" + label="Snapshot type" + layout="topleft" + left_delta="0" + name="snapshot_type_radio" + top_pad="5" + width="195"> + <radio_item + bottom="19" + height="16" + label="Send via email" + layout="topleft" + name="postcard" /> + <radio_item + bottom="38" + height="16" + label="Save to your inventory (L$[AMOUNT])" + layout="topleft" + name="texture" /> + <radio_item + bottom="57" + height="16" + label="Save to your hard drive" + layout="topleft" + name="local" /> + </radio_group> + <text + type="string" + length="1" + follows="left|top" + height="25" + layout="topleft" + left_delta="0" + name="file_size_label" + top_pad="106" + width="195"> + File size: [SIZE] KB + </text> + <button + follows="left|top" + height="20" + label="Refresh Snapshot" + layout="topleft" + left_delta="0" + name="new_snapshot_btn" + top_delta="15" + width="195" /> + <button + follows="left|top" + height="20" + label="Send" + layout="topleft" + left_delta="0" + name="send_btn" + top_pad="2" + width="105" /> + <button + follows="left|top" + height="20" + label="Save (L$[AMOUNT])" + layout="topleft" + left_delta="0" + name="upload_btn" + top_delta="0" + width="105" /> + <flyout_button + follows="left|top" + height="20" + label="Save" + layout="topleft" + left_delta="0" + name="save_btn" + tool_tip="Save image to a file" + top_delta="0" + width="105"> + <flyout_button.item + label="Save" + value="save" /> + <flyout_button.item + label="Save As..." + value="save as" /> + </flyout_button> + <button + follows="left|top" + height="20" + label="Cancel" + layout="topleft" + left_pad="5" + name="discard_btn" + top_delta="0" + width="85" /> + <button + follows="left|top" + font="SansSerifSmall" + height="20" + label="More >>" + layout="topleft" + left="10" + name="more_btn" + tool_tip="Advanced Options" + top="270" + width="80" /> + <button + follows="left|top" + font="SansSerifSmall" + height="20" + label="<< Less" + layout="topleft" + left_delta="0" + name="less_btn" + tool_tip="Advanced Options" + top_delta="0" + width="80" /> + <text + type="string" + length="1" + follows="top|left" + height="15" + layout="topleft" + left_delta="0" + name="type_label2" + top_pad="5" + width="115"> + Size + </text> + <text + type="string" + length="1" + follows="top|left" + height="15" + layout="topleft" + left_pad="5" + name="format_label" + top_delta="0" + width="70"> + Format + </text> + <combo_box + height="20" + label="Resolution" + layout="topleft" + left="10" + name="postcard_size_combo" + top="312" + width="115"> + <combo_box.item + label="Current Window" + value="[i0,i0]" /> + <combo_box.item + label="640x480" + value="[i640,i480]" /> + <combo_box.item + label="800x600" + value="[i800,i600]" /> + <combo_box.item + label="1024x768" + value="[i1024,i768]" /> + <combo_box.item + label="Custom" + value="[i-1,i-1]" /> + </combo_box> + <combo_box + height="20" + label="Resolution" + layout="topleft" + left_delta="0" + name="texture_size_combo" + top_delta="0" + width="115"> + <combo_box.item + label="Current Window" + value="[i0,i0]" /> + <combo_box.item + label="Small (128x128)" + value="[i128,i128]" /> + <combo_box.item + label="Medium (256x256)" + value="[i256,i256]" /> + <combo_box.item + label="Large (512x512)" + value="[i512,i512]" /> + <combo_box.item + label="Custom" + value="[i-1,i-1]" /> + </combo_box> + <combo_box + height="20" + label="Resolution" + layout="topleft" + left_delta="0" + name="local_size_combo" + top_delta="0" + width="115"> + <combo_box.item + label="Current Window" + value="[i0,i0]" /> + <combo_box.item + label="320x240" + value="[i320,i240]" /> + <combo_box.item + label="640x480" + value="[i640,i480]" /> + <combo_box.item + label="800x600" + value="[i800,i600]" /> + <combo_box.item + label="1024x768" + value="[i1024,i768]" /> + <combo_box.item + label="1280x1024" + value="[i1280,i1024]" /> + <combo_box.item + label="1600x1200" + value="[i1600,i1200]" /> + <combo_box.item + label="Custom" + value="[i-1,i-1]" /> + </combo_box> + <combo_box + height="20" + label="Format" + layout="topleft" + left_pad="5" + name="local_format_combo" + top_delta="0" + width="70"> + <combo_box.item + label="PNG" /> + <combo_box.item + label="JPEG" /> + <combo_box.item + label="BMP" /> + </combo_box> + <spinner + allow_text_entry="false" + decimal_digits="0" + follows="left|top" + height="20" + increment="32" + label="Width" + label_width="30" + layout="topleft" + left="10" + max_val="6016" + min_val="32" + name="snapshot_width" + top="337" + width="95" /> + <spinner + allow_text_entry="false" + decimal_digits="0" + follows="left|top" + height="20" + increment="32" + label="Height" + label_width="35" + layout="topleft" + left_pad="5" + max_val="6016" + min_val="32" + name="snapshot_height" + top_delta="0" + width="95" /> + <check_box + bottom_delta="20" + label="Constrain Proportions" + layout="topleft" + left="10" + name="keep_aspect_check" /> + <slider + decimal_digits="0" + follows="left|top" + height="15" + increment="1" + initial_value="75" + label="Image Quality" + layout="topleft" + left_delta="0" + max_val="100" + name="image_quality_slider" + top_pad="5" + width="210" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_delta="0" + name="layer_type_label" + top_pad="8" + width="50"> + Capture: + </text> + <combo_box + height="20" + label="Image Layers" + layout="topleft" + left_delta="50" + name="layer_types" + top_delta="-3" + width="145"> + <combo_box.item + label="Colors" + value="colors" /> + <combo_box.item + label="Depth" + value="depth" /> + <combo_box.item + label="Object Mattes" + value="objects" /> + </combo_box> + <check_box + bottom_delta="20" + label="Show interface in snapshot" + layout="topleft" + left="10" + name="ui_check" /> + <check_box + bottom_delta="20" + label="Show HUD objects in snapshot" + layout="topleft" + left="10" + name="hud_check" /> + <check_box + bottom_delta="20" + label="Keep open after saving" + layout="topleft" + left="10" + name="keep_open_check" /> + <check_box + bottom_delta="20" + label="Freeze frame (fullscreen preview)" + layout="topleft" + left="10" + name="freeze_frame_check" /> + <check_box + bottom_delta="20" + label="Auto-refresh" + layout="topleft" + left="10" + name="auto_snapshot_check" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_sound_preview.xml b/indra/newview/skins/default/xui/en/floater_sound_preview.xml new file mode 100644 index 0000000000000000000000000000000000000000..8aff16b465309b9d87e5b5a1f8d2e0cf9c599041 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_sound_preview.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="190" + layout="topleft" + name="Sound Preview" + title="sound.wav" + width="300"> + <text + type="string" + length="1" + follows="left|top" + height="15" + layout="topleft" + left="10" + mouse_opaque="false" + name="name_label" + top="20" + width="275"> + Name: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + height="19" + layout="topleft" + left_delta="0" + max_length="63" + name="name_form" + top_pad="4" + width="280" /> + <text + type="string" + length="1" + follows="left|top" + height="15" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="description_label" + top_pad="4" + width="270"> + Description: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + height="19" + layout="topleft" + left_delta="0" + max_length="127" + name="description_form" + top_pad="4" + width="280" /> + <button + follows="right|bottom" + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left="200" + name="cancel_btn" + top="160" + width="90" /> + <button + follows="left|bottom" + height="20" + label="Upload (L$[AMOUNT])" + layout="topleft" + left_delta="-135" + name="ok_btn" + top_delta="0" + width="130" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_statistics.xml b/indra/newview/skins/default/xui/en/floater_statistics.xml new file mode 100644 index 0000000000000000000000000000000000000000..1661fbffb0ffa1d333f996f48a276ef615c8402c --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_statistics.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + follows="right|top" + height="392" + layout="topleft" + mouse_opaque="false" + name="stats floater" + title="Statistics" + width="250" /> diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml new file mode 100644 index 0000000000000000000000000000000000000000..08d91843f21d17547cd69c4f453224cbaedc2f23 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + follows="top|right" + height="400" + layout="topleft" + name="Statistics" + save_rect="true" + save_visibility="true" + title="Statistics" + width="250"> + <scroll_container + follows="top|left|bottom|right" + height="380" + layout="topleft" + left="0" + name="statistics_scroll" + reserve_scroll_corner="true" + top="20" + width="250"> + <container_view + follows="top|left|bottom|right" + height="378" + layout="topleft" + left="2" + name="statistics_view" + top="20" + width="230" /> + </scroll_container> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_telehub.xml b/indra/newview/skins/default/xui/en/floater_telehub.xml new file mode 100644 index 0000000000000000000000000000000000000000..bcec046456619d2c7fcded55e6b3fdfdf88db8a8 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_telehub.xml @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="250" + layout="topleft" + name="telehub" + title="Telehub" + width="272"> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="status_text_connected" + top="24" + width="200"> + Telehub connected to object [OBJECT] + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="status_text_not_connected" + top_delta="0" + width="200"> + No telehub connected. + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_delta="0" + name="help_text_connected" + top_delta="16" + width="260"> + To remove, click Disconnect. + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_delta="0" + name="help_text_not_connected" + top_delta="0" + width="260"> + Select object and click Connect Telehub. + </text> + <button + follows="top|left" + font="SansSerifSmall" + height="20" + label="Connect Telehub" + layout="topleft" + left_delta="0" + name="connect_btn" + top_delta="20" + width="110" /> + <button + follows="top|left" + font="SansSerifSmall" + height="20" + label="Disconnect" + layout="topleft" + left_pad="10" + name="disconnect_btn" + top_delta="0" + width="110" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="spawn_points_text" + top="84" + width="200"> + Spawn Points (positions, not objects): + </text> + <scroll_list + follows="left|top" + font="SansSerifSmall" + height="60" + layout="topleft" + left_delta="0" + name="spawn_points_list" + top_delta="16" + width="230" /> + <button + follows="top|left" + font="SansSerifSmall" + height="20" + label="Add Spawn" + layout="topleft" + left_delta="0" + name="add_spawn_point_btn" + top_pad="5" + width="110" /> + <button + follows="top|left" + font="SansSerifSmall" + height="20" + label="Remove Spawn" + layout="topleft" + left_pad="10" + name="remove_spawn_point_btn" + top_delta="0" + width="110" /> + <text + type="string" + length="1" + follows="top|left" + height="80" + layout="topleft" + left="10" + name="spawn_point_help" + top="190" + width="260"> + Select object and click Add to specify position. +You may then move or delete the object. +Positions are relative to the telehub center. +Select item in list to show position in world. + </text> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_button.xml b/indra/newview/skins/default/xui/en/floater_test_button.xml new file mode 100644 index 0000000000000000000000000000000000000000..0681eedbabba253d8c1ee0aee9169b78b867f463 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_test_button.xml @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="500" + layout="topleft" + name="floater_test_button" + width="500"> + <button + height="20" + label="Generic Button" + layout="topleft" + left="10" + name="generic_button" + top="20" + width="150" /> + <button + bottom_delta="30" + height="20" + label="Bottom delta" + layout="topleft" + name="bottom_delta_button" /> + <button + bottom_delta="30" + font="SansSerifSmall" + height="20" + label="SansSerifSmall" + layout="topleft" + name="sans_serif_small_button" /> + <button + auto_resize="true" + bottom_delta="30" + height="20" + label="Auto Resize" + layout="topleft" + name="auto_resize_button" /> + <button + bottom_delta="30" + height="20" + is_toggle="true" + label="Click Change Label" + label_selected="New Label" + layout="topleft" + name="label_selected_button" /> + <button + bottom_delta="30" + height="20" + label="No Label Shadow" + label_shadow="false" + layout="topleft" + name="label_shadow_button" /> + <button + bottom_delta="30" + height="20" + label="Red Label" + label_color="red" + layout="topleft" + name="label_color_button" /> + <button + bottom_delta="30" + height="20" + is_toggle="true" + label="Red Label Selected" + label_color_selected="red" + label_selected="Red Label Selected" + layout="topleft" + name="label_color_selected_button" /> + <button + bottom_delta="30" + enabled="false" + height="20" + label="Red Label Disabled" + label_color_disabled="red" + label_selected="Red Label Selected" + layout="topleft" + name="label_color_disabled_button" /> + <button + bottom_delta="30" + height="20" + highlight_color="red" + label="Red Highlight" + layout="topleft" + name="highlight_color_button" /> + <button + bottom_delta="30" + height="20" + hover_glow_amount="0" + label="No Hover Glow" + layout="topleft" + name="hover_glow_amount_button" /> + <button + height="30" + image_selected="object_cube_active.tga" + image_unselected="object_cube.tga" + layout="topleft" + left="200" + name="image_button" + picture_style="true" + top="20" + width="30" /> + <button + height="30" + image_color="red" + image_selected="object_cube_active.tga" + image_unselected="object_cube.tga" + layout="topleft" + left_delta="0" + name="image_color_button" + picture_style="true" + top_pad="10" + width="30" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_checkbox.xml b/indra/newview/skins/default/xui/en/floater_test_checkbox.xml new file mode 100644 index 0000000000000000000000000000000000000000..5a17ffefac9af39f895e218b969f94f945c326e9 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_test_checkbox.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="400" + layout="topleft" + name="floater_test_checkbox" + width="400"> + <check_box + control_name="ShowStartLocation" + height="16" + initial_value="true" + label="Show Start Location on Login Screen" + layout="topleft" + left="10" + name="show_location_checkbox" + top="28" + width="256" /> + <check_box + height="16" + label="Minimal Checkbox" + layout="topleft" + left_delta="0" + name="minimal_checkbox" + top_pad="14" + width="150" /> + <check_box + enabled="false" + height="16" + label="Disabled Checkbox" + layout="topleft" + left_delta="0" + name="disabled_checkbox" + top_pad="14" + width="150" /> + <check_box + height="16" + label="Text Enabled Red" + layout="topleft" + left_delta="0" + name="text_enabled_color_checkbox" + text_enabled_color="red" + top_pad="14" + width="150" /> + <check_box + enabled="false" + height="16" + label="Text Disabled Red" + layout="topleft" + left_delta="0" + name="text_disabled_color_checkbox" + text_disabled_color="red" + top_pad="14" + width="150" /> + <check_box + height="16" + initial_value="true" + label="Initial Value Checked" + layout="topleft" + left_delta="0" + name="initial_value_checkbox" + top_pad="14" + width="150" /> + <check_box + font="Monospace" + height="16" + label="Font Monospace" + layout="topleft" + left_delta="0" + name="font_checkbox" + top_pad="14" + width="150" /> + <check_box + height="16" + label="Custom Button" + layout="topleft" + left_delta="0" + name="check_button_checkbox" + top_pad="14" + width="150"> + <check_box.check_button + image_unselected="close_in_blue.tga" /> + </check_box> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_combobox.xml b/indra/newview/skins/default/xui/en/floater_test_combobox.xml new file mode 100644 index 0000000000000000000000000000000000000000..9e1253ec565503886364f1fbf77d9b63315892da --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_test_combobox.xml @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="400" + layout="topleft" + name="floater_test_combobox" + width="400"> + <text + type="string" + length="1" + height="16" + layout="topleft" + left="10" + top="24" + width="200"> + Real world usage (login location): + </text> + <combo_box + allow_text_entry="true" + control_name="LoginLocation" + follows="left|bottom" + height="18" + layout="topleft" + left_delta="0" + max_chars="128" + name="start_location_combo" + top_pad="2" + width="155"> + <combo_box.item + label="My Last Location" + value="last" /> + <combo_box.item + label="My Home" + value="home" /> + <combo_box.item + label="<Type region name>" + value="" /> + </combo_box> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + top_pad="24" + width="200"> + Minimal combobox: + </text> + <combo_box + height="18" + layout="topleft" + left_delta="0" + name="minimal_combo" + top_pad="2" + width="150"> + <combo_box.item + label="First Item" + value="first" /> + <combo_box.item + label="Second Item" + value="second" /> + </combo_box> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + top_pad="24" + width="200"> + Allow text input: + </text> + <combo_box + allow_text_entry="true" + height="18" + layout="topleft" + left_delta="0" + name="text_entry_combo" + top_pad="2" + width="150"> + <combo_box.item + label="First Item" + value="first" /> + <combo_box.item + label="Second Item" + value="second" /> + </combo_box> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + top_pad="24" + width="200"> + Allow text input, default to second item: + </text> + <combo_box + allow_text_entry="true" + height="18" + initial_value="second" + layout="topleft" + left_delta="0" + name="text_entry_combo" + top_pad="2" + width="150"> + <combo_box.item + label="First Item" + value="first" /> + <combo_box.item + label="Second Item" + value="second" /> + </combo_box> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + top_pad="24" + width="200"> + Two character max input: + </text> + <combo_box + allow_text_entry="true" + height="16" + layout="topleft" + left_delta="0" + max_chars="2" + name="state_combo" + top_pad="4" + width="150"> + <combo_box.item + label="CA" + value="ca" /> + <combo_box.item + label="NY" + value="ny" /> + <combo_box.item + label="TX" + value="tx" /> + </combo_box> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_layout.xml b/indra/newview/skins/default/xui/en/floater_test_layout.xml new file mode 100644 index 0000000000000000000000000000000000000000..344ad8447e7dbc9eaa745337c27971232dda0953 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_test_layout.xml @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="500" + layout="topleft" + name="floater_test_layout" + width="500"> + <text + type="string" + length="1" + height="16" + layout="topleft" + left="10" + top="84" + width="200"> + bottom 400 left 10 + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + top_pad="4" + width="200"> + Bottom delta -20 + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + top_pad="64" + width="200"> + bottom 300 left 10, should delta_bottom + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_pad="40" + top_delta="0" + width="200"> + bottom 300 left 250, should delta_left + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left="10" + top="204" + width="200"> + bottom 280 left 10, should absolute position + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_pad="40" + top_delta="-2" + width="200"> + bottom 282 left 250, should delta_left and delta_bottom + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left="10" + top="234" + width="200"> + bottom 250 left 10, should absolute position + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left="250" + top="244" + width="200"> + bottom 240 left 250, should absolute position + </text> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_radiogroup.xml b/indra/newview/skins/default/xui/en/floater_test_radiogroup.xml new file mode 100644 index 0000000000000000000000000000000000000000..ef3e1f598dac15ac193d5cb825bf026912be1140 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_test_radiogroup.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="400" + layout="topleft" + name="floater_test_radiogroup" + width="400"> + <radio_group + height="54" + layout="topleft" + left="10" + name="parcel_voice_channel" + top="46" + width="219"> + <radio_item + height="16" + label="Use the Estate spatial channel" + layout="topleft" + left="3" + name="Estate" + top="3" + width="463" /> + <radio_item + height="16" + label="Use a private spatial channel" + layout="topleft" + left_delta="0" + name="Private" + top_delta="16" + width="463" /> + <radio_item + height="16" + label="Disable spatial audio on this parcel" + layout="topleft" + left_delta="0" + name="Disabled" + top_delta="16" + width="463" /> + </radio_group> + <radio_group + height="50" + layout="topleft" + left_delta="0" + name="simple_radio_group" + top_pad="50" + width="150"> + <radio_item + bottom="20" + height="16" + label="Label in label attribute" + layout="topleft" + name="label_radio_item" /> + <radio_item + bottom_delta="20" + height="16" + label="Label in text contents" + layout="topleft" + name="contents_radio_item" /> + </radio_group> + <radio_group + draw_border="false" + height="50" + layout="topleft" + left_delta="0" + name="no_border_radio_group" + top_pad="50" + width="150"> + <radio_item + bottom="20" + height="16" + label="No Border Foo" + layout="topleft" + name="foo_radio_item" /> + <radio_item + bottom_delta="20" + height="16" + label="No Border Bar" + layout="topleft" + name="bar_item" /> + </radio_group> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_slider.xml b/indra/newview/skins/default/xui/en/floater_test_slider.xml new file mode 100644 index 0000000000000000000000000000000000000000..b1d468e2659301874855c508285fc17c3f6d8fb3 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_test_slider.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="400" + layout="topleft" + name="floater_test_slider" + width="450"> + <slider + height="20" + label="Generic Slider" + layout="topleft" + left="10" + name="generic_slider" + top="40" + width="250" /> + <slider + height="20" + label="Callback Slider" + layout="topleft" + left_delta="0" + name="callback_slider" + top_pad="20" + width="400"> + <slider.mouse_up_callback + function="Test.TestCallback" + parameter="test" /> + </slider> + <slider + height="20" + increment="1" + initial_value="2.0" + label="Value Slider" + layout="topleft" + left_delta="0" + max_val="5" + min_val="1" + name="value_slider" + top_pad="20" + width="250" /> + <slider + height="20" + label="Mini Slider 1" + layout="topleft" + left_delta="0" + name="mini_slider_1" + top_pad="20" + width="200" /> + <slider + height="20" + label="Mini Slider 2" + layout="topleft" + left_pad="20" + name="mini_slider_2" + top_delta="0" + width="200" /> + <slider_bar + bottom="320" + height="20" + increment="1" + initial_value="2.0" + label="Slider Bar" + layout="topleft" + max_val="5" + min_val="1" + name="slider_bar" + width="300" /> + <slider + bottom="360" + decimal_digits="1" + height="20" + label="Red Slider" + label_width="100" + layout="topleft" + name="red_slider" + text_color="red" + text_width="40" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_spinner.xml b/indra/newview/skins/default/xui/en/floater_test_spinner.xml new file mode 100644 index 0000000000000000000000000000000000000000..da88d825e400e3d6e16e897c29c4599bbdc6685b --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_test_spinner.xml @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="400" + layout="topleft" + name="floater_test_spinner" + width="450"> + <spinner + height="20" + label="Generic Spinner" + layout="topleft" + left="10" + name="generic_spinner" + top="40" + width="350" /> + <spinner + height="20" + label="Callback Spinner" + label_width="80" + layout="topleft" + left_delta="0" + name="callback_spinner" + top_pad="20" + width="400" /> + <spinner + height="20" + label="Colorful Spinner" + layout="topleft" + left_delta="0" + name="colorful_spinner" + top_pad="20" + width="250" /> + <spinner + height="20" + increment="1" + initial_value="2.0" + label="Value Spinner" + layout="topleft" + left_delta="0" + max_val="5" + min_val="1" + name="value_spinner" + top_pad="20" + width="250" /> + <spinner + height="20" + label="Mini Spinner 1" + layout="topleft" + left_delta="0" + name="mini_spinner_1" + top_pad="20" + width="200" /> + <spinner + height="20" + label="Mini Spinner 2" + layout="topleft" + left_pad="20" + name="mini_spinner_2" + top_delta="0" + width="200" /> + <spinner + control_name="RenderFogRatio" + decimal_digits="1" + height="20" + label="Control Spinner" + layout="topleft" + left="10" + max_val="20" + min_val="10" + name="control_spinner" + top="260" + width="250" /> + <spinner + follows="left" + height="20" + label="Follows Left" + label_width="85" + layout="topleft" + left_delta="0" + name="follows_left" + top_pad="20" + width="250" /> + <spinner + follows="right" + height="20" + label="Follows Right" + label_width="85" + layout="topleft" + left_delta="0" + name="follows_right" + top_pad="20" + width="250" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_textbox.xml b/indra/newview/skins/default/xui/en/floater_test_textbox.xml new file mode 100644 index 0000000000000000000000000000000000000000..b4f3fc1e784c4e940a0ba821589e72efbed857eb --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_test_textbox.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="400" + layout="topleft" + name="floater_test_textbox" + width="400"> + <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" + 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 + </text> + <text + type="string" + length="1" + font="SansSerif" + height="10" + layout="topleft" + left_delta="0" + top_pad="30" + width="300"> + font SansSerif + </text> + <text + type="string" + length="1" + follows="bottom|right" + height="10" + layout="topleft" + left_delta="0" + top_pad="10" + width="300"> + follows bottom right + </text> + <text + type="string" + length="1" + font="SansSerifSmall" + font.style="BOLD" + height="10" + layout="topleft" + left_delta="0" + top_pad="10" + width="300"> + font style BOLD + </text> + <text + type="string" + length="1" + font="SansSerifSmall" + font.style="BOLD|UNDERLINE" + height="10" + layout="topleft" + left_delta="0" + top_pad="10" + width="300"> + font style BOLD UNDERLINE + </text> + <text + type="string" + length="1" + height="10" + layout="topleft" + left_delta="0" + top_pad="10" + width="300"> + font style 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" + label="N" + layout="topleft" + left="10" + name="floater_map_north" + right="30" + text="N" + text_color="1 1 1 0.7" + top="370"> + N + </text> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_widgets.xml b/indra/newview/skins/default/xui/en/floater_test_widgets.xml new file mode 100644 index 0000000000000000000000000000000000000000..9a2602db75fbf6d9732ca8ef2509b667403089bb --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_test_widgets.xml @@ -0,0 +1,342 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- Sample "floater" window with examples of common widgets. + + Notes: + XML UI (XUI) files use spaces for indentation, not tabs. + All position values are in pixels. + For now, each widget must contain attribute layout="topleft". + 0,0 is the top-left corner of the floater. + Each widget must have a unique name attribute. + If a widget is aligned with the one before it, use relative positioning: + top_pad + top_delta + left_pad + left_delta + Otherwise specify location with left and top attributes. +--> +<floater + can_resize="true" + title="Test Floater" + height="500" + layout="topleft" + name="floater_test_widgets" + width="850"> + + <!-- Strings are used by C++ code for localization. They are not visible + unless the C++ code uses them to fill in another widget. --> + <floater.string + name="sample_string" + value="Sample String" /> + <floater.string + name="other_string" + value="Other String" /> + + <!-- Floaters can contain drop-down menus. + The menu_bar widget contains the inividual menus. + The width is automatically computed to fit the labels. --> + <menu_bar + height="18" + layout="topleft" + tool_tip="menu" + left="2" + name="test_menu_bar" + top="16"> + <menu + height="16" + label="Menu" + layout="topleft" + tear_off="true" + left="0" + name="Menu" + top="-32" + width="128"> + <!-- menu_item_call will trigger a function call in the C++ code --> + <menu_item_call + label="Menu Item 1" + layout="topleft" + name="test_menu_item_1" /> + <!-- menu_item_separator is a horizontal line used to separate sections + of a menu. In general, menus should be divided into chunks of + no more than 7 items separated by menu_item_separators. --> + <menu_item_separator/> + <menu_item_call + label="Menu Item 2" + layout="topleft" + name="test_menu_item_2" /> + </menu> + </menu_bar> + + <!-- "text" is one or more read-only lines of text. + It can be made clickable but this requires C++ code + support. URLs are not automatically underlined. --> + <text + bottom="55" + layout="topleft" + left="10"> + For widget list see https://wiki.lindenlab.com/wiki/Viewer:UI/Widgets + </text> + + <!-- First column --> + + <button + height="20" + label="Button" + layout="topleft" + left_delta="0" + name="test_button" + tool_tip="button" + top="80" + width="100" /> + <!-- "flyout_button" is a button that can spawn a menu --> + <flyout_button + follows="right|bottom" + height="20" + label="Flyout" + layout="topleft" + left_delta="0" + name="fly_btn" + top_pad="15" + tool_tip="flyout button" + width="100"> + <flyout_button.item + label="Item 1" + value="shout" /> + <flyout_button.item + label="Item 2" + value="say" /> + <flyout_button.item + label="Item 3" + value="whisper" /> + </flyout_button> + <check_box + bottom_delta="35" + label="Checkbox" + layout="topleft" + tool_tip="checkbox" + name="test_checkbox" /> + <!-- "combo_box" is a pop-menu of items. Optionally the box itself can + contain a general purpose line input editor, allowing the user to + provide input that is not a list item. --> + <combo_box + bottom_delta="35" + height="16" + width="150" + label="Combobox" + layout="topleft" + tool_tip="combo box" + name="test_combo_box"> + <combo_box.item + label="Combobox Item 1" /> + <combo_box.item + label="Combobox Item 2" /> + </combo_box> + <!-- "icon" is a read-only image. The image_name must match an entry + in textures.xml. We support TGA and PNG for UI images. --> + <icon + height="16" + image_name="icon_avatar_online.tga" + layout="topleft" + left_delta="0" + tool_tip="icon" + name="test_icon" + top_pad="40" + width="16" /> + <!-- "line_editor" allows a single line of editable text input. + The contents of this XML node are used as the initial value for + the text. --> + <line_editor + height="20" + layout="topleft" + left_delta="0" + name="test_line_editor" + top_pad="20" + tool_tip="line editor" + width="200"> + Line Editor Sample Text + </line_editor> + <!-- "search_editor" is a specialized line_editor that shows read-only + help text until the user clicks in the widget. --> + <search_editor + follows="left|top|right" + height="20" + label="Type here to search" + layout="topleft" + left_delta="0" + name="search editor" + tool_tip="search editor" + top_pad="30" + width="200" /> + <!-- "progress_bar" percent completed gets set in C++ code --> + <progress_bar + height="16" + layout="topleft" + left_delta="0" + name="test_progress_bar" + top_pad="30" + tool_tip="progress bar" + width="200" /> + <!-- "stat_view" is a container for statistics graphs. It is only used + for debugging/diagnostic displays. --> + <stat_view + height="250" + label="Statistics View" + layout="topleft" + left_delta="0" + name="axis_view" + show_label="true" + top_pad="30" + tool_tip="stat view" + width="200"> + <stat_bar + width="100" + bar_max="100" + bottom_delta="30" + label="Test Stat" + layout="topleft" + stat="stat" + bar_min="20" + name="test_stat_bar" /> + </stat_view> + + <!-- New column --> + + <!-- "radio_group" is a set of mutually exclusive choices, like the buttons + on a car radio that allow a single radio station to be chosen. --> + <radio_group + height="40" + layout="topleft" + left_pad="90" + name="size_radio_group" + tool_tip="radio group" + top="80" + width="200"> + <radio_item + bottom="20" + label="Radio 1" + layout="topleft" + name="small_radio_item" /> + <radio_item + label="Radio 2" + layout="topleft" + name="large_radio_item" /> + </radio_group> + <!-- "scroll_list" is a scrolling list of columnar data. --> + <scroll_list + bottom_delta="100" + height="80" + draw_heading="true" + tool_tip="scroll list" + layout="topleft"> + <scroll_list.columns + dynamicwidth="true" + name="first_column" + label="Column A"/> + <scroll_list.columns + dynamicwidth="true" + name="second_column" + label="Column B"/> + </scroll_list> + <!-- "slider" is a horizontal input widget for numerical data. --> + <slider + bottom_delta="45" + layout="topleft" + min_val="0" + max_val="100" + initial_value="20" + label="Slider" + name="test_slider" + tool_tip="slider" + width="200" /> + <!-- "spinner" is a numerical input widget with an up and down arrow to + change the value. --> + <spinner + bottom_delta="35" + label="Spinner" + layout="topleft" + name="test_spinner" + tool_tip="spinner"/> + <text + bottom_delta="50" + font.style = "UNDERLINE" + layout="topleft" + name="test_text" + tool_tip="text"> + Text (underlined) + </text> + <!-- "text_editor" is a multi-line text input widget, similar to + textarea in HTML. --> + <text_editor + height="80" + layout="topleft" + left_delta="0" + name="test_text_editor" + tool_tip="text editor" + top_pad="25" + width="200"> + Text Editor + </text_editor> + + <!-- And a third column --> + + <!-- "tab_container" is a holder for multiple panels of UI widgets. + Tabs can appear at the top, bottom, or left of the container. --> + <tab_container + follows="all" + height="400" + layout="topleft" + left="575" + name="group_tab_container" + tab_position="top" + tool_tip="tab container" + top="80" + width="250"> + <!-- "panel" is a container for widgets. It is automatically resized to + fit the parent tab_container. --> + <panel + border="true" + label="Tab 1 - Color" + layout="topleft" + name="panel2"> + <!-- "color_swatch" displays a color and spawns a color picker when + clicked. --> + <color_swatch + border_color="1 0 0 1" + can_apply_immediately="true" + color="0.3 0.6 0.9 1" + follows="left|top" + height="90" + border="true" + layout="topleft" + left="10" + label="Color Swatch 1" + name="swatch1" + tool_tip="Color Swatch: Click to open Color Picker" + top="10" + width="80" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + color="1 0 1 1" + follows="left|top" + height="90" + label="Color Swatch 2" + layout="topleft" + left_pad="10" + name="swatch2" + tool_tip="Color Swatch: Click to open Color Picker" + top_delta="0" + width="80" /> + </panel> + <!-- panels can also refer to other floaters or panels --> + <panel + border="true" + filename="floater_test_checkbox.xml" + height="225" + label="Tab 2 - Checkbox" + layout="topleft" + left_delta="0" + name="tab2" + top_delta="159" + width="250" /> + </tab_container> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml new file mode 100644 index 0000000000000000000000000000000000000000..8d855196103bc8c224044b9abdd2f293c787b530 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + can_resize="true" + height="290" + layout="topleft" + min_height="290" + min_width="410" + name="texture picker" + title="Pick: Texture" + width="410"> + <floater.string + name="choose_picture"> + Click to choose a picture + </floater.string> + <floater.string + name="pick title"> + Pick: + </floater.string> + <text + type="string" + length="1" + follows="left|top" + halign="center" + height="14" + layout="topleft" + left="4" + name="Multiple" + top="96" + width="163"> + Multiple + </text> + <text + type="string" + length="1" + follows="left|top" + height="14" + layout="topleft" + left_delta="0" + name="unknown" + top_pad="80" + width="163"> + Dimensions: [DIMENSIONS] + </text> + <button + enabled="false" + follows="left|bottom" + font="SansSerifSmall" + height="20" + label="Default" + label_selected="Default" + layout="topleft" + left_delta="0" + name="Default" + top_pad="4" + width="64" /> + <button + enabled="false" + follows="left|bottom" + font="SansSerifSmall" + height="20" + label="None" + label_selected="None" + layout="topleft" + left_pad="4" + name="None" + top_delta="0" + width="64" /> + <button + follows="left|bottom" + font="SansSerifSmall" + height="20" + label="Blank" + label_selected="Blank" + layout="topleft" + left="4" + name="Blank" + top="232" + width="64" /> + <check_box + height="24" + initial_value="true" + label="Show Folders" + layout="topleft" + left="175" + name="show_folders_check" + top="20" + width="201" /> + <search_editor + follows="left|top|right" + height="16" + label="Type here to search" + layout="topleft" + left_delta="0" + name="inventory search editor" + top_delta="0" + width="231" /> + <inventory_panel + allow_multi_select="false" + border="true" + follows="left|top|right|bottom" + height="216" + layout="topleft" + left_delta="0" + name="inventory panel" + top_pad="4" + width="231" /> + <check_box + follows="left|bottom" + height="20" + initial_value="true" + label="Apply Immediately" + layout="topleft" + left="4" + name="apply_immediate_check" + top="262" + width="150" /> + <button + follows="left|bottom" + height="32" + image_selected="eye_button_active.tga" + image_unselected="eye_button_inactive.tga" + layout="topleft" + left="139" + name="Pipette" + picture_style="true" + top="250" + width="32" /> + <button + follows="right|bottom" + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left="186" + name="Cancel" + top="262" + width="100" /> + <button + follows="right|bottom" + height="20" + label="Select" + label_selected="Select" + layout="topleft" + left_pad="4" + name="Select" + top_delta="0" + width="100" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml new file mode 100644 index 0000000000000000000000000000000000000000..17b73b47ab5126a37cfe1357a4c7846078177468 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -0,0 +1,2866 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + follows="left|top" + height="550" + layout="topleft" + name="toolbox floater" + save_rect="true" + short_title="Build" + single_instance="true" + sound_flags="0" + width="272"> + <floater.string + name="status_rotate"> + Drag colored bands to rotate object + </floater.string> + <floater.string + name="status_scale"> + Click and drag to stretch selected side + </floater.string> + <floater.string + name="status_move"> + Drag to move, shift-drag to copy + </floater.string> + <floater.string + name="status_modifyland"> + Click and hold to modify land + </floater.string> + <floater.string + name="status_camera"> + Click and drag to change view + </floater.string> + <floater.string + name="status_grab"> + Drag to move, Ctrl to lift, Ctrl-Shift to rotate + </floater.string> + <floater.string + name="status_place"> + Click inworld to build + </floater.string> + <floater.string + name="status_selectland"> + Click and drag to select land + </floater.string> + <floater.string + name="grid_screen_text"> + Screen + </floater.string> + <floater.string + name="grid_local_text"> + Local + </floater.string> + <floater.string + name="grid_world_text"> + World + </floater.string> + <floater.string + name="grid_reference_text"> + Reference + </floater.string> + <floater.string + name="grid_attachment_text"> + Attachment + </floater.string> + <button + follows="left|top" + height="32" + image_disabled="tool_zoom.tga" + image_disabled_selected="tool_zoom_active.tga" + image_selected="tool_zoom_active.tga" + image_unselected="tool_zoom.tga" + layout="topleft" + left="4" + name="button focus" + picture_style="true" + tool_tip="Focus" + top="2" + width="32" /> + <button + follows="left|top" + height="32" + image_disabled="tool_grab.tga" + image_disabled_selected="tool_grab_active.tga" + image_selected="tool_grab_active.tga" + image_unselected="tool_grab.tga" + layout="topleft" + left_pad="4" + name="button move" + picture_style="true" + tool_tip="Move" + top_delta="0" + width="32" /> + <button + follows="left|top" + height="32" + image_disabled="tool_face.tga" + image_disabled_selected="tool_face_active.tga" + image_selected="tool_face_active.tga" + image_unselected="tool_face.tga" + layout="topleft" + left_pad="4" + name="button edit" + picture_style="true" + tool_tip="Edit" + top_delta="0" + width="32" /> + <button + follows="left|top" + height="32" + image_disabled="tool_create.tga" + image_disabled_selected="tool_create_active.tga" + image_selected="tool_create_active.tga" + image_unselected="tool_create.tga" + layout="topleft" + left_pad="4" + name="button create" + picture_style="true" + tool_tip="Create" + top_delta="0" + width="32" /> + <button + follows="left|top" + height="32" + image_disabled="tool_dozer.tga" + image_disabled_selected="tool_dozer_active.tga" + image_selected="tool_dozer_active.tga" + image_unselected="tool_dozer.tga" + layout="topleft" + left_pad="4" + name="button land" + picture_style="true" + tool_tip="Land" + top_delta="0" + width="32" /> + <slider_bar + follows="left|top" + height="14" + increment="0.01" + initial_value="0.125" + layout="topleft" + left="114" + max_val="0.5" + name="slider zoom" + top="55" + width="134" /> + <radio_group + draw_border="false" + height="45" + layout="topleft" + left_delta="-110" + name="focus_radio_group" + top_delta="0" + width="114"> + <radio_item + height="16" + label="Zoom" + layout="topleft" + left="0" + name="radio zoom" + top="-1" + width="114" /> + <radio_item + height="16" + label="Orbit (Ctrl)" + layout="topleft" + left_delta="0" + name="radio orbit" + top_delta="15" + width="114" /> + <radio_item + height="16" + label="Pan (Ctrl-Shift)" + layout="topleft" + left_delta="0" + name="radio pan" + top_delta="15" + width="114" /> + </radio_group> + <radio_group + draw_border="false" + height="45" + layout="topleft" + left_delta="0" + name="move_radio_group" + top_delta="0" + width="114"> + <radio_item + height="16" + label="Move" + layout="topleft" + left="0" + name="radio move" + top="-1" + width="114" /> + <radio_item + height="16" + label="Lift (Ctrl)" + layout="topleft" + left_delta="0" + name="radio lift" + top_delta="15" + width="114" /> + <radio_item + height="16" + label="Spin (Ctrl-Shift)" + layout="topleft" + left_delta="0" + name="radio spin" + top_delta="15" + width="114" /> + </radio_group> + <radio_group + draw_border="false" + height="60" + layout="topleft" + left_delta="0" + name="edit_radio_group" + top_delta="0" + width="114"> + <radio_item + height="16" + label="Position" + layout="topleft" + left="0" + name="radio position" + top="-1" + width="114" /> + <radio_item + height="16" + label="Rotate (Ctrl)" + layout="topleft" + left_delta="0" + name="radio rotate" + top_delta="15" + width="114" /> + <radio_item + height="16" + label="Stretch (Ctrl-Shift)" + layout="topleft" + left_delta="0" + name="radio stretch" + top_delta="15" + width="123" /> + <radio_item + height="16" + label="Select Texture" + layout="topleft" + left_delta="0" + name="radio select face" + top_delta="15" + width="114" /> + </radio_group> + <check_box + control_name="EditLinkedParts" + height="16" + label="Edit linked parts" + layout="topleft" + left_delta="0" + name="checkbox edit linked parts" + top_pad="3" + width="114" /> + <text + type="string" + length="1" + follows="left|top" + height="14" + layout="topleft" + left_delta="2" + name="text ruler mode" + top_pad="6" + width="68"> + Ruler: + </text> + <combo_box + height="20" + layout="topleft" + left_delta="40" + name="combobox grid mode" + top_delta="-2" + width="86"> + <combo_box.item + label="World" + value="World" /> + <combo_box.item + label="Local" + value="Local" /> + <combo_box.item + label="Reference" + value="Reference" /> + </combo_box> + <check_box + control_name="ScaleUniform" + height="16" + label="Stretch Both Sides" + layout="topleft" + left="143" + name="checkbox uniform" + top="54" + width="134" /> + <check_box + control_name="ScaleStretchTextures" + height="16" + initial_value="true" + label="Stretch Textures" + layout="topleft" + left_delta="0" + name="checkbox stretch textures" + top_pad="1" + width="134" /> + <check_box + control_name="SnapEnabled" + height="16" + initial_value="true" + label="Use Grid" + layout="topleft" + left_delta="0" + name="checkbox snap to grid" + top_pad="1" + width="134" /> + <button + follows="left|top" + font="SansSerifSmall" + height="20" + label="Options..." + label_selected="Options..." + layout="topleft" + left_delta="20" + name="Options..." + top="103" + valign="center" + width="80" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + name="text status" + top="36" + width="264"> + Drag to move, shift-drag to copy + </text> + <button + follows="left|top" + height="24" + image_disabled="object_cube.tga" + image_disabled_selected="object_cube_active.tga" + image_selected="object_cube_active.tga" + image_unselected="object_cube.tga" + layout="topleft" + left_delta="0" + name="ToolCube" + picture_style="true" + tool_tip="Cube" + top_delta="15" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_prism.tga" + image_disabled_selected="object_prism_active.tga" + image_selected="object_prism_active.tga" + image_unselected="object_prism.tga" + layout="topleft" + left_delta="23" + name="ToolPrism" + picture_style="true" + tool_tip="Prism" + top_delta="0" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_pyramid.tga" + image_disabled_selected="object_pyramid_active.tga" + image_selected="object_pyramid_active.tga" + image_unselected="object_pyramid.tga" + layout="topleft" + left_delta="23" + name="ToolPyramid" + picture_style="true" + tool_tip="Pyramid" + top_delta="0" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_tetrahedron.tga" + image_disabled_selected="object_tetrahedron_active.tga" + image_selected="object_tetrahedron_active.tga" + image_unselected="object_tetrahedron.tga" + layout="topleft" + left_delta="23" + name="ToolTetrahedron" + picture_style="true" + tool_tip="Tetrahedron" + top_delta="0" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_cylinder.tga" + image_disabled_selected="object_cylinder_active.tga" + image_selected="object_cylinder_active.tga" + image_unselected="object_cylinder.tga" + layout="topleft" + left_delta="23" + name="ToolCylinder" + picture_style="true" + tool_tip="Cylinder" + top_delta="0" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_hemi_cylinder.tga" + image_disabled_selected="object_hemi_cylinder_active.tga" + image_selected="object_hemi_cylinder_active.tga" + image_unselected="object_hemi_cylinder.tga" + layout="topleft" + left_delta="23" + name="ToolHemiCylinder" + picture_style="true" + tool_tip="Hemicylinder" + top_delta="0" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_cone.tga" + image_disabled_selected="object_cone_active.tga" + image_selected="object_cone_active.tga" + image_unselected="object_cone.tga" + layout="topleft" + left_delta="23" + name="ToolCone" + picture_style="true" + tool_tip="Cone" + top_delta="0" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_hemi_cone.tga" + image_disabled_selected="object_hemi_cone_active.tga" + image_selected="object_hemi_cone_active.tga" + image_unselected="object_hemi_cone.tga" + layout="topleft" + left_delta="23" + name="ToolHemiCone" + picture_style="true" + tool_tip="Hemicone" + top_delta="0" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_sphere.tga" + image_disabled_selected="object_sphere_active.tga" + image_selected="object_sphere_active.tga" + image_unselected="object_sphere.tga" + layout="topleft" + left_delta="23" + name="ToolSphere" + picture_style="true" + tool_tip="Sphere" + top_delta="0" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_hemi_sphere.tga" + image_disabled_selected="object_hemi_sphere_active.tga" + image_selected="object_hemi_sphere_active.tga" + image_unselected="object_hemi_sphere.tga" + layout="topleft" + left_delta="23" + name="ToolHemiSphere" + picture_style="true" + tool_tip="Hemisphere" + top_delta="0" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_torus.tga" + image_disabled_selected="object_torus_active.tga" + image_selected="object_torus_active.tga" + image_unselected="object_torus.tga" + layout="topleft" + left="4" + name="ToolTorus" + picture_style="true" + tool_tip="Torus" + top="74" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_tube.tga" + image_disabled_selected="object_tube_active.tga" + image_selected="object_tube_active.tga" + image_unselected="object_tube.tga" + layout="topleft" + left_delta="23" + name="ToolTube" + picture_style="true" + tool_tip="Tube" + top_delta="0" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_ring.tga" + image_disabled_selected="object_ring_active.tga" + image_selected="object_ring_active.tga" + image_unselected="object_ring.tga" + layout="topleft" + left_delta="23" + name="ToolRing" + picture_style="true" + tool_tip="Ring" + top_delta="0" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_tree.tga" + image_disabled_selected="object_tree_active.tga" + image_selected="object_tree_active.tga" + image_unselected="object_tree.tga" + layout="topleft" + left_delta="23" + name="ToolTree" + picture_style="true" + tool_tip="Tree" + top_delta="0" + width="24" /> + <button + follows="left|top" + height="24" + image_disabled="object_grass.tga" + image_disabled_selected="object_grass_active.tga" + image_selected="object_grass_active.tga" + image_unselected="object_grass.tga" + layout="topleft" + left_delta="23" + name="ToolGrass" + picture_style="true" + tool_tip="Grass" + top_delta="0" + width="24" /> + <check_box + control_name="CreateToolKeepSelected" + height="16" + label="Keep selected" + layout="topleft" + left="4" + name="checkbox sticky" + top="101" + width="128" /> + <check_box + control_name="CreateToolCopySelection" + height="16" + label="Copy selected" + layout="topleft" + left_delta="0" + name="checkbox copy selection" + top_delta="15" + width="134" /> + <check_box + control_name="CreateToolCopyCenters" + height="16" + initial_value="true" + label="Center" + layout="topleft" + left_delta="18" + name="checkbox copy centers" + top="132" + width="134" /> + <check_box + control_name="CreateToolCopyRotates" + height="16" + label="Rotate" + layout="topleft" + left_delta="0" + name="checkbox copy rotates" + top_delta="16" + width="134" /> + <radio_group + draw_border="false" + height="105" + layout="topleft" + left="4" + name="land_radio_group" + top="54" + width="114"> + <radio_item + height="16" + label="Select Land" + layout="topleft" + left="0" + name="radio select land" + top="-1" + width="114" /> + <radio_item + height="16" + label="Flatten" + layout="topleft" + left_delta="0" + name="radio flatten" + top_delta="15" + width="114" /> + <radio_item + height="16" + label="Raise" + layout="topleft" + left_delta="0" + name="radio raise" + top_delta="15" + width="114" /> + <radio_item + height="16" + label="Lower" + layout="topleft" + left_delta="0" + name="radio lower" + top_delta="15" + width="114" /> + <radio_item + height="16" + label="Smooth" + layout="topleft" + left_delta="0" + name="radio smooth" + top_delta="15" + width="114" /> + <radio_item + height="16" + label="Roughen" + layout="topleft" + left_delta="0" + name="radio noise" + top_delta="15" + width="114" /> + <radio_item + height="16" + label="Revert" + layout="topleft" + left_delta="0" + name="radio revert" + top_delta="15" + width="114" /> + </radio_group> + <button + follows="left|top" + font="SansSerifSmall" + height="20" + label="Apply" + label_selected="Apply" + layout="topleft" + left_delta="112" + name="button apply to selection" + tool_tip="Modify Selected Land" + top_delta="-2" + width="78" /> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="2" + name="Bulldozer:" + top_pad="4" + width="100"> + Bulldozer: + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="132" + name="Dozer Size:" + top="94" + width="100"> + Size + </text> + <slider_bar + follows="left|top" + height="16" + initial_value="2.0" + layout="topleft" + left_delta="46" + max_val="11" + min_val="1" + name="slider brush size" + top_delta="0" + width="80" /> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="132" + name="Strength:" + top="116" + width="100"> + Strength + </text> + <slider_bar + follows="left|top" + height="16" + initial_value="0.00" + layout="topleft" + left_delta="46" + max_val="2" + min_val="-1" + name="slider force" + top_delta="0" + width="80" /> + <text + type="string" + length="1" + follows="left|top" + halign="right" + height="16" + layout="topleft" + left="118" + name="obj_count" + top="135" + width="143"> + Selected objects: [COUNT] + </text> + <text + type="string" + length="1" + follows="left|top" + halign="right" + height="16" + layout="topleft" + left_delta="0" + name="prim_count" + top_delta="12" + width="143"> + primitives: [COUNT] + </text> + <tab_container + follows="left|top" + height="384" + layout="topleft" + left="0" + name="Object Info Tabs" + tab_max_width="52" + tab_min_width="40" + tab_position="top" + top="166" + width="272"> + <panel + border="true" + follows="left|top|right|bottom" + height="367" + label="General" + layout="topleft" + left="1" + mouse_opaque="false" + name="General" + top="16" + width="270"> + <panel.string + name="text deed continued"> + Deed... + </panel.string> + <panel.string + name="text deed"> + Deed + </panel.string> + <panel.string + name="text modify info 1"> + You can modify this object. + </panel.string> + <panel.string + name="text modify info 2"> + You can modify these objects. + </panel.string> + <panel.string + name="text modify info 3"> + You cannot modify this object. + </panel.string> + <panel.string + name="text modify info 4"> + You cannot modify these objects. + </panel.string> + <panel.string + name="text modify warning"> + Must select entire object to set permissions. + </panel.string> + <panel.string + name="Cost Default"> + Price: L$ + </panel.string> + <panel.string + name="Cost Total"> + Total Price: L$ + </panel.string> + <panel.string + name="Cost Per Unit"> + Price Per: L$ + </panel.string> + <panel.string + name="Cost Mixed"> + Mixed Price + </panel.string> + <panel.string + name="Sale Mixed"> + Mixed Sale + </panel.string> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="Name:" + top="10" + width="78"> + Name: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + height="16" + layout="topleft" + left_delta="78" + max_length="63" + name="Object Name" + select_on_focus="true" + top_delta="0" + width="172" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="Description:" + top="30" + width="78"> + Description: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + height="16" + layout="topleft" + left_delta="78" + max_length="127" + name="Object Description" + select_on_focus="true" + top_delta="0" + width="172" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="Creator:" + top="50" + width="78"> + Creator: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="78" + name="Creator Name" + top_delta="0" + width="88"> + Thrax Linden + </text> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Profile..." + label_selected="Profile..." + layout="topleft" + left_pad="6" + name="button creator profile" + top_delta="-4" + width="78" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="Owner:" + top="70" + width="78"> + Owner: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="78" + name="Owner Name" + top_delta="0" + width="88"> + Thrax Linden + </text> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Profile..." + label_selected="Profile..." + layout="topleft" + left_pad="6" + name="button owner profile" + top_delta="-4" + width="78" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="Group:" + top="90" + width="78"> + Group: + </text> + <name_box + follows="left|top" + height="16" + initial_value="(retrieving)" + layout="topleft" + left_delta="78" + name="Group Name Proxy" + top_delta="0" + width="88" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Set..." + label_selected="Set..." + layout="topleft" + left_pad="6" + name="button set group" + top_delta="-4" + width="78" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="Permissions:" + top="110" + width="85"> + Permissions: + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="16" + layout="topleft" + left_delta="0" + name="perm_modify" + top_pad="4" + width="250"> + You can modify this object. + </text> + <check_box + height="16" + label="Share with group" + layout="topleft" + left_delta="0" + name="checkbox share with group" + tool_tip="Allow all members of the set group to share and use your permissions for this object. You must Deed to enable role restrictions." + top_pad="4" + width="166" /> + <button + follows="top|right" + font="SansSerifSmall" + height="20" + label="Deed..." + label_selected="Deed..." + layout="topleft" + left_delta="172" + name="button deed" + tool_tip="Group shared objects can be deeded by a group officer." + top="166" + width="78" /> + <check_box + height="16" + label="Allow anyone to move" + layout="topleft" + left="10" + name="checkbox allow everyone move" + top="190" + width="142" /> + <check_box + height="16" + label="Allow anyone to copy" + layout="topleft" + left_delta="0" + name="checkbox allow everyone copy" + top_pad="4" + width="141" /> + <check_box + height="16" + label="Show in search" + layout="topleft" + left_delta="0" + name="search_check" + tool_tip="Let people see this object in search results" + top_pad="4" + width="78" /> + <check_box + height="16" + label="For Sale" + layout="topleft" + left_delta="0" + name="checkbox for sale" + top_pad="4" + width="78" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="12" + name="Cost" + top_delta="0" + width="78"> + Price: L$ + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="2" + max_length="25" + name="Edit Cost" + top_delta="0" + width="75" /> + <radio_group + draw_border="false" + follows="left|top|right" + height="16" + layout="topleft" + left="42" + name="sale type" + top="270" + width="218"> + <radio_item + height="16" + label="Original" + layout="topleft" + left="0" + name="Original" + top="0" + width="70" /> + <radio_item + height="16" + label="Copy" + layout="topleft" + left_delta="70" + name="Copy" + top_delta="0" + width="70" /> + <radio_item + height="16" + label="Contents" + layout="topleft" + left_delta="70" + name="Contents" + top_delta="0" + width="76" /> + </radio_group> + <text + type="string" + length="1" + follows="left|top|right" + height="10" + layout="topleft" + left="10" + name="Next owner can:" + top="288" + width="250"> + Next owner can: + </text> + <check_box + follows="left|top|right" + height="16" + label="Modify" + layout="topleft" + left_delta="0" + name="checkbox next owner can modify" + top_pad="6" + width="250" /> + <check_box + follows="left|top|right" + height="16" + label="Copy" + layout="topleft" + left_delta="60" + name="checkbox next owner can copy" + top_delta="0" + width="190" /> + <check_box + follows="left|top|right" + height="16" + label="Resell/Give away" + layout="topleft" + left_delta="60" + name="checkbox next owner can transfer" + top_delta="0" + width="130" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="label click action" + top="322" + width="150"> + When Left-Clicked: + </text> + <combo_box + height="18" + layout="topleft" + left_delta="0" + name="clickaction" + top_pad="7" + width="150"> + <combo_box.item + label="Touch/grab (default)" + value="Touch/grab (default)" /> + <combo_box.item + label="Sit on object" + value="Sit on object" /> + <combo_box.item + label="Buy object" + value="Buy object" /> + <combo_box.item + label="Pay object" + value="Pay object" /> + <combo_box.item + label="Open" + value="Open" /> + <combo_box.item + label="Play parcel media" + value="Play" /> + <combo_box.item + label="Open parcel media" + value="Open Media" /> + </combo_box> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="88" + name="B:" + top="105" + width="174"> + B: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="50" + name="O:" + top_delta="0" + width="124"> + O; + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="50" + name="G:" + top_delta="0" + width="74"> + G: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="88" + name="E:" + top="117" + width="174"> + E: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="50" + name="N:" + top_delta="0" + width="124"> + N: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="50" + name="F:" + top_delta="0" + width="74"> + F: + </text> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="367" + label="Object" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="Object" + top_delta="0" + width="270"> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="select_single" + top="10" + width="252"> + Select only one primitive to edit parameters. + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="edit_object" + top_delta="0" + width="252"> + Edit object parameters: + </text> + <check_box + height="16" + label="Locked" + layout="topleft" + left_delta="-2" + name="checkbox locked" + tool_tip="Prevents object from being moved or deleted. Frequently useful during building to avoid unintended edits." + top_pad="10" + width="123" /> + <check_box + height="16" + label="Physical" + layout="topleft" + left_delta="0" + name="Physical Checkbox Ctrl" + tool_tip="Allows object to be pushed and affected by gravity" + top_pad="2" + width="123" /> + <check_box + height="16" + label="Temporary" + layout="topleft" + left_delta="0" + name="Temporary Checkbox Ctrl" + tool_tip="Causes object to be deleted 1 minute after creation." + top_pad="2" + width="123" /> + <check_box + height="16" + label="Phantom" + layout="topleft" + left_delta="0" + name="Phantom Checkbox Ctrl" + tool_tip="Causes object to not collide with other objects or avatars" + top_pad="2" + width="123" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="2" + name="label position" + top_pad="4" + width="121"> + Position (meters) + </text> + <spinner + follows="left|top" + height="16" + increment="0.01" + initial_value="0" + label="X" + label_width="10" + layout="topleft" + left_delta="0" + max_val="512" + min_val="-256" + name="Pos X" + text_enabled_color="0.43 0.06 0.06 1" + top_pad="4" + width="87" /> + <spinner + follows="left|top" + height="16" + increment="0.01" + initial_value="0" + label="Y" + label_width="10" + layout="topleft" + left_delta="0" + max_val="512" + min_val="-256" + name="Pos Y" + text_enabled_color="0 0.39 0.15 1" + top_pad="2" + width="87" /> + <spinner + follows="left|top" + height="16" + increment="0.01" + initial_value="0" + label="Z" + label_width="10" + layout="topleft" + left_delta="0" + max_val="4096" + name="Pos Z" + text_enabled_color="0 0.26 0.51 1" + top_pad="2" + width="87" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="label size" + top_pad="6" + width="121"> + Size (meters) + </text> + <spinner + follows="left|top" + height="16" + increment="0.01" + initial_value="0" + label="X" + label_width="10" + layout="topleft" + left_delta="0" + max_val="10" + min_val="0.01" + name="Scale X" + text_enabled_color="1 1 1 1" + top_pad="4" + width="87" /> + <spinner + follows="left|top" + height="16" + increment="0.01" + initial_value="0" + label="Y" + label_width="10" + layout="topleft" + left_delta="0" + max_val="10" + min_val="0.01" + name="Scale Y" + text_enabled_color="1 1 1 1" + top_pad="2" + width="87" /> + <spinner + follows="left|top" + height="16" + increment="0.01" + initial_value="0" + label="Z" + label_width="10" + layout="topleft" + left_delta="0" + max_val="10" + min_val="0.01" + name="Scale Z" + text_enabled_color="1 1 1 1" + top_pad="2" + width="87" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="label rotation" + top_pad="6" + width="121"> + Rotation (degrees) + </text> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + increment="1" + initial_value="0" + label="X" + label_width="10" + layout="topleft" + left_delta="0" + max_val="9999" + min_val="-9999" + name="Rot X" + text_enabled_color="1 1 1 1" + top_pad="6" + width="87" /> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + increment="1" + initial_value="0" + label="Y" + label_width="10" + layout="topleft" + left_delta="0" + max_val="9999" + min_val="-9999" + name="Rot Y" + text_enabled_color="1 1 1 1" + top_pad="2" + width="87" /> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + increment="1" + initial_value="0" + label="Z" + label_width="10" + layout="topleft" + left_delta="0" + max_val="9999" + min_val="-9999" + name="Rot Z" + text_enabled_color="1 1 1 1" + top_pad="2" + width="87" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="label material" + top_pad="6" + width="121"> + Material + </text> + <combo_box + height="18" + layout="topleft" + left_delta="0" + name="material" + top_pad="4" + width="87"> + <combo_box.item + label="Stone" + value="Stone" /> + <combo_box.item + label="Metal" + value="Metal" /> + <combo_box.item + label="Glass" + value="Glass" /> + <combo_box.item + label="Wood" + value="Wood" /> + <combo_box.item + label="Flesh" + value="Flesh" /> + <combo_box.item + label="Plastic" + value="Plastic" /> + <combo_box.item + label="Rubber" + value="Rubber" /> + </combo_box> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="121" + name="label basetype" + top="26" + width="141"> + Building Block Type + </text> + <combo_box + height="18" + layout="topleft" + left_delta="0" + name="comboBaseType" + top_pad="6" + width="141"> + <combo_box.item + label="Box" + value="Box" /> + <combo_box.item + label="Cylinder" + value="Cylinder" /> + <combo_box.item + label="Prism" + value="Prism" /> + <combo_box.item + label="Sphere" + value="Sphere" /> + <combo_box.item + label="Torus" + value="Torus" /> + <combo_box.item + label="Tube" + value="Tube" /> + <combo_box.item + label="Ring" + value="Ring" /> + <combo_box.item + label="Sculpted" + value="Sculpted" /> + </combo_box> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="text cut" + top_pad="2" + width="141"> + Path Cut Begin and End + </text> + <spinner + follows="left|top" + height="16" + increment="0.025" + initial_value="0" + label="B" + label_width="10" + layout="topleft" + left_delta="0" + max_val="0.98" + name="cut begin" + top_pad="6" + width="68" /> + <spinner + follows="left|top" + height="16" + increment="0.025" + initial_value="1" + label="E" + label_width="10" + layout="topleft" + left_pad="5" + min_val="0.02" + name="cut end" + top_delta="0" + width="68" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="121" + name="text hollow" + top="98" + width="68"> + Hollow + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_pad="10" + name="text skew" + top_delta="0" + width="63"> + Skew + </text> + <spinner + decimal_digits="1" + follows="left|top" + height="16" + increment="5" + initial_value="0" + layout="topleft" + left="121" + max_val="95" + name="Scale 1" + top="112" + width="68" /> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + increment="0.05" + initial_value="0" + layout="topleft" + left_pad="5" + max_val="0.95" + min_val="-0.95" + name="Skew" + top_delta="0" + width="68" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="121" + name="Hollow Shape" + top="133" + width="141"> + Hollow Shape + </text> + <combo_box + height="18" + layout="topleft" + left_delta="0" + name="hole" + top_pad="6" + width="141"> + <combo_box.item + label="Default" + value="Default" /> + <combo_box.item + label="Circle" + value="Circle" /> + <combo_box.item + label="Square" + value="Square" /> + <combo_box.item + label="Triangle" + value="Triangle" /> + </combo_box> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="text twist" + top_pad="2" + width="141"> + Twist Begin and End + </text> + <spinner + decimal_digits="0" + follows="left|top" + height="16" + increment="9" + initial_value="0" + label="B" + label_width="10" + layout="topleft" + left_delta="0" + max_val="180" + min_val="-180" + name="Twist Begin" + top_pad="6" + width="68" /> + <spinner + decimal_digits="0" + follows="left|top" + height="16" + increment="9" + initial_value="0" + label="E" + label_width="10" + layout="topleft" + left_pad="5" + max_val="180" + min_val="-180" + name="Twist End" + top_delta="0" + width="68" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="121" + name="scale_taper" + top="205" + width="141"> + Taper + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="scale_hole" + top_delta="0" + width="141"> + Hole Size + </text> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + increment="0.05" + initial_value="0" + label="X" + label_width="10" + layout="topleft" + left_delta="0" + min_val="-1" + name="Taper Scale X" + top_pad="4" + width="68" /> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + increment="0.05" + initial_value="0" + label="Y" + label_width="10" + layout="topleft" + left_pad="5" + min_val="-1" + name="Taper Scale Y" + top_delta="0" + width="68" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="121" + name="text topshear" + top="239" + width="141"> + Top Shear + </text> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + increment="0.05" + initial_value="0" + label="X" + label_width="10" + layout="topleft" + left_delta="0" + max_val="0.5" + min_val="-0.5" + name="Shear X" + top_pad="4" + width="68" /> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + increment="0.05" + initial_value="0" + label="Y" + label_width="10" + layout="topleft" + left_pad="5" + max_val="0.5" + min_val="-0.5" + name="Shear Y" + top_delta="0" + width="68" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="121" + name="advanced_cut" + top="273" + width="141"> + Profile Cut Begin and End + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="advanced_dimple" + top_delta="0" + width="141"> + Dimple Begin and End + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="advanced_slice" + top_delta="0" + width="141"> + Slice Begin and End + </text> + <spinner + follows="left|top" + height="16" + increment="0.025" + initial_value="0" + label="B" + label_width="10" + layout="topleft" + left_delta="0" + max_val="0.95" + name="Path Limit Begin" + top_pad="3" + width="68" /> + <spinner + follows="left|top" + height="16" + increment="0.025" + initial_value="1" + label="E" + label_width="10" + layout="topleft" + left_pad="5" + min_val="0.05" + name="Path Limit End" + top_delta="0" + width="68" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="121" + name="text taper2" + top="306" + width="141"> + Taper + </text> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + increment="0.05" + initial_value="0" + label="X" + label_width="10" + layout="topleft" + left_delta="0" + min_val="-1" + name="Taper X" + top_pad="3" + width="68" /> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + increment="0.05" + initial_value="0" + label="Y" + label_width="10" + layout="topleft" + left_pad="5" + min_val="-1" + name="Taper Y" + top_delta="0" + width="68" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="121" + name="text radius delta" + top="337" + width="78"> + Radius + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="73" + name="text revolutions" + top_delta="0" + width="68"> + Revolutions + </text> + <spinner + follows="left|top" + height="16" + increment="0.05" + initial_value="0" + layout="topleft" + left="121" + min_val="-1" + name="Radius Offset" + top="350" + width="68" /> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + initial_value="1" + layout="topleft" + left_pad="5" + max_val="4" + min_val="1" + name="Revolutions" + top_delta="0" + width="68" /> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="141" + label="Sculpt Texture" + layout="topleft" + left="121" + name="sculpt texture control" + tool_tip="Click to choose a picture" + top="70" + visible="false" + width="141" /> + <check_box + height="16" + label="Mirror" + layout="topleft" + left_delta="0" + name="sculpt mirror control" + tool_tip="Flips sculpted prim along the X axis." + top_pad="8" + visible="false" + width="121" /> + <check_box + height="16" + label="Inside-out" + layout="topleft" + left_delta="0" + name="sculpt invert control" + tool_tip="Inverts the sculpted prims normals, making it appear inside-out." + top_pad="4" + visible="false" + width="121" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="label sculpt type" + top_pad="10" + visible="false" + width="121"> + Stitching type + </text> + <combo_box + height="18" + layout="topleft" + left_delta="0" + name="sculpt type control" + top_pad="6" + visible="false" + width="141"> + <combo_box.item + label="none)" + value="None" /> + <combo_box.item + label="Sphere" + value="Sphere" /> + <combo_box.item + label="Torus" + value="Torus" /> + <combo_box.item + label="Plane" + value="Plane" /> + <combo_box.item + label="Cylinder" + value="Cylinder" /> + </combo_box> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="367" + label="Features" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="Features" + top_delta="0" + width="270"> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="select_single" + top="10" + width="252"> + Select only one primitive to edit features. + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="edit_object" + top_delta="0" + width="252"> + Edit object features: + </text> + <check_box + height="16" + label="Flexible Path" + layout="topleft" + left_delta="0" + name="Flexible1D Checkbox Ctrl" + tool_tip="Allows object to flex about the Z axis. (Client-side only)" + top_pad="10" + width="121" /> + <spinner + follows="left|top" + height="16" + increment="1" + initial_value="2" + label="Softness" + label_width="65" + layout="topleft" + left_delta="0" + max_val="3" + name="FlexNumSections" + top_pad="4" + width="128" /> + <spinner + follows="left|top" + height="16" + increment="0.5" + initial_value="0.3" + label="Gravity" + label_width="65" + layout="topleft" + left_delta="0" + max_val="10" + min_val="-10" + name="FlexGravity" + top_pad="4" + width="128" /> + <spinner + follows="left|top" + height="16" + increment="0.5" + initial_value="2" + label="Drag" + label_width="65" + layout="topleft" + left_delta="0" + max_val="10" + name="FlexFriction" + top_pad="4" + width="128" /> + <spinner + follows="left|top" + height="16" + increment="0.5" + initial_value="0" + label="Wind" + label_width="65" + layout="topleft" + left_delta="0" + max_val="10" + name="FlexWind" + top_pad="4" + width="128" /> + <spinner + follows="left|top" + height="16" + increment="0.5" + initial_value="1" + label="Tension" + label_width="65" + layout="topleft" + left_delta="0" + max_val="10" + name="FlexTension" + top_pad="4" + width="128" /> + <spinner + follows="left|top" + height="16" + increment="0.01" + initial_value="0" + label="Force X" + label_width="65" + layout="topleft" + left_delta="0" + max_val="10" + min_val="-10" + name="FlexForceX" + top_pad="4" + width="128" /> + <spinner + follows="left|top" + height="16" + increment="0.01" + initial_value="0" + label="Force Y" + label_width="65" + layout="topleft" + left_delta="0" + max_val="10" + min_val="-10" + name="FlexForceY" + top_pad="4" + width="128" /> + <spinner + follows="left|top" + height="16" + increment="0.01" + initial_value="0" + label="Force Z" + label_width="65" + layout="topleft" + left_delta="0" + max_val="10" + min_val="-10" + name="FlexForceZ" + top_pad="4" + width="128" /> + <check_box + height="16" + label="Light" + layout="topleft" + left_delta="0" + name="Light Checkbox Ctrl" + tool_tip="Causes object to emit light" + top_pad="14" + width="121" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="label color" + top_pad="11" + width="58"> + Color + </text> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + color="0.5 0.5 0.5 1" + follows="left|top" + height="48" + layout="topleft" + left_delta="67" + name="colorswatch" + tool_tip="Click to open Color Picker" + top="237" + width="32" /> + <spinner + follows="left|top" + height="16" + initial_value="0.5" + label="Intensity" + label_width="65" + layout="topleft" + left="10" + name="Light Intensity" + top="273" + width="128" /> + <spinner + follows="left|top" + height="16" + initial_value="5" + label="Radius" + label_width="65" + layout="topleft" + left_delta="0" + max_val="20" + name="Light Radius" + top_pad="4" + width="128" /> + <spinner + follows="left|top" + height="16" + increment="0.25" + initial_value="1" + label="Falloff" + label_width="65" + layout="topleft" + left_delta="0" + max_val="2" + name="Light Falloff" + top_pad="4" + width="128" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="367" + label="Texture" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="Texture" + top_delta="0" + width="270"> + <panel.string + name="string repeats per meter"> + Repeats Per Meter + </panel.string> + <panel.string + name="string repeats per face"> + Repeats Per Face + </panel.string> + <texture_picker + can_apply_immediately="true" + default_image_name="Default" + follows="left|top" + height="80" + label="Texture" + layout="topleft" + left="10" + name="texture control" + tool_tip="Click to choose a picture" + top="10" + width="64" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + follows="left|top" + height="80" + label="Color" + layout="topleft" + left_pad="26" + name="colorswatch" + tool_tip="Click to open Color Picker" + top_delta="0" + width="64" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="180" + name="color trans" + top="1" + width="80"> + Transparency % + </text> + <spinner + decimal_digits="0" + follows="left|top" + height="16" + increment="2" + initial_value="0" + layout="topleft" + left_delta="0" + max_val="90" + name="ColorTrans" + top_pad="4" + width="80" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="glow label" + top_pad="2" + width="80"> + Glow + </text> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + initial_value="0" + layout="topleft" + left_delta="0" + name="glow" + top_pad="4" + width="80" /> + <check_box + height="16" + label="Full Bright" + layout="topleft" + left_delta="0" + name="checkbox fullbright" + top_pad="7" + width="81" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="tex gen" + top="94" + width="90"> + Mapping + </text> + <combo_box + height="18" + layout="topleft" + left_delta="0" + name="combobox texgen" + top_pad="4" + width="80"> + <combo_box.item + label="Default" + value="Default" /> + <combo_box.item + label="Planar" + value="Planar" /> + </combo_box> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="100" + name="label shininess" + top="94" + width="70"> + Shininess + </text> + <combo_box + height="18" + layout="topleft" + left_delta="0" + name="combobox shininess" + top_pad="4" + width="70"> + <combo_box.item + label="None" + value="None" /> + <combo_box.item + label="Low" + value="Low" /> + <combo_box.item + label="Medium" + value="Medium" /> + <combo_box.item + label="High" + value="High" /> + </combo_box> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="180" + name="label bumpiness" + top="94" + width="80"> + Bumpiness + </text> + <combo_box + height="18" + layout="topleft" + left_delta="0" + name="combobox bumpiness" + top_pad="4" + width="80"> + <combo_box.item + label="None" + value="None" /> + <combo_box.item + label="Brightness" + value="Brightness" /> + <combo_box.item + label="Darkness" + value="Darkness" /> + <combo_box.item + label="woodgrain" + value="woodgrain" /> + <combo_box.item + label="bark" + value="bark" /> + <combo_box.item + label="bricks" + value="bricks" /> + <combo_box.item + label="checker" + value="checker" /> + <combo_box.item + label="concrete" + value="concrete" /> + <combo_box.item + label="crustytile" + value="crustytile" /> + <combo_box.item + label="cutstone" + value="cutstone" /> + <combo_box.item + label="discs" + value="discs" /> + <combo_box.item + label="gravel" + value="gravel" /> + <combo_box.item + label="petridish" + value="petridish" /> + <combo_box.item + label="siding" + value="siding" /> + <combo_box.item + label="stonetile" + value="stonetile" /> + <combo_box.item + label="stucco" + value="stucco" /> + <combo_box.item + label="suction" + value="suction" /> + <combo_box.item + label="weave" + value="weave" /> + </combo_box> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="tex scale" + top="148" + width="160"> + Repeats per Face + </text> + <spinner + follows="left|top" + height="16" + initial_value="0" + label="Horizontal (U)" + label_width="90" + layout="topleft" + left="20" + max_val="100" + name="TexScaleU" + top="162" + width="160" /> + <check_box + height="16" + label="Flip" + layout="topleft" + left_pad="10" + name="checkbox flip s" + top_delta="1" + width="70" /> + <spinner + follows="left|top" + height="16" + initial_value="0" + label="Vertical (V)" + label_width="90" + layout="topleft" + left="20" + max_val="100" + name="TexScaleV" + top="180" + width="160" /> + <check_box + height="16" + label="Flip" + layout="topleft" + left_pad="10" + name="checkbox flip t" + top_delta="1" + width="70" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="tex rotate" + top="218" + width="102"> + Rotation (degrees) + </text> + <spinner + decimal_digits="2" + follows="left|top" + height="16" + increment="1" + initial_value="0" + layout="topleft" + left_delta="102" + max_val="9999" + min_val="-9999" + name="TexRot" + top_delta="0" + width="68" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="rpt" + top="240" + width="160"> + Repeats Per Meter + </text> + <spinner + decimal_digits="1" + follows="left|top" + height="16" + initial_value="1" + layout="topleft" + left_delta="102" + max_val="10" + min_val="0.1" + name="rptctrl" + top_delta="0" + width="68" /> + <button + follows="left|top" + font="SansSerifSmall" + height="20" + label="Apply" + label_selected="Apply" + layout="topleft" + left_pad="10" + name="button apply" + top_delta="-4" + width="75" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="tex offset" + top="278" + width="160"> + Offset + </text> + <spinner + follows="left|top" + height="16" + initial_value="0" + label="Horizontal (U)" + label_width="90" + layout="topleft" + left="20" + min_val="-1" + name="TexOffsetU" + top="292" + width="160" /> + <spinner + follows="left|top" + height="16" + initial_value="0" + label="Vertical (V)" + label_width="90" + layout="topleft" + left_delta="0" + min_val="-1" + name="TexOffsetV" + top_pad="2" + width="160" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + name="textbox autofix" + top="332" + width="160"> + Align media texture +(must load first) + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="20" + label="Align" + label_selected="Align" + layout="topleft" + left="112" + name="button align" + top="340" + width="68" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="367" + label="Content" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="Contents" + top_delta="0" + width="270"> + <button + follows="left|top" + height="20" + label="New Script" + label_selected="New Script..." + layout="topleft" + left="10" + name="button new script" + top="10" + width="100" /> + <button + follows="left|top" + height="20" + label="Permissions..." + layout="topleft" + left_pad="10" + name="button permissions" + top_delta="0" + width="100" /> + <panel_inventory + follows="left|top" + height="325" + layout="topleft" + left="10" + name="contents_inventory" + top="35" + width="252" /> + </panel> + </tab_container> + <panel + follows="left|top" + height="384" + layout="topleft" + left_delta="0" + name="land info panel" + top_delta="0" + width="272"> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="40" + name="label_parcel_info" + top="24" + width="150"> + Parcel Information + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="48" + name="label_area_price" + top="48" + width="150"> + Price: L$[PRICE] for [AREA] sq. m. + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="label_area" + top_delta="0" + width="150"> + Area: [AREA] sq. m. + </text> + <button + follows="left|top" + height="20" + label="About Land..." + label_selected="About Land..." + layout="topleft" + left_delta="0" + name="button about land" + top_pad="4" + width="112" /> + <check_box + control_name="ShowParcelOwners" + height="16" + label="Show owners" + layout="topleft" + left_delta="0" + name="checkbox show owners" + tool_tip="Colour parcels according to their ownership" + top_pad="8" + width="100" /> + <button + follows="left|top" + height="18" + label="?" + label_selected="?" + layout="topleft" + left_delta="94" + name="button show owners help" + top_delta="-2" + width="18" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="40" + name="label_parcel_modify" + top="152" + width="150"> + Modify Parcel + </text> + <button + follows="left|top" + height="20" + label="Subdivide..." + label_selected="Subdivide..." + layout="topleft" + left="48" + name="button subdivide land" + top="172" + width="112" /> + <button + follows="left|top" + height="20" + label="Join..." + label_selected="Join..." + layout="topleft" + left_delta="0" + name="button join land" + top_pad="4" + width="112" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="40" + name="label_parcel_trans" + top="256" + width="150"> + Land Transactions + </text> + <button + follows="left|top" + height="20" + label="Buy Land..." + label_selected="Buy Land..." + layout="topleft" + left="48" + name="button buy land" + top="276" + width="112" /> + <button + follows="left|top" + height="20" + label="Abandon Land..." + label_selected="Abandon Land..." + layout="topleft" + left_delta="0" + name="button abandon land" + top_pad="4" + width="112" /> + </panel> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_top_objects.xml b/indra/newview/skins/default/xui/en/floater_top_objects.xml new file mode 100644 index 0000000000000000000000000000000000000000..20e39beb6fa6681e5d7bf5287abb4254b354db96 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_top_objects.xml @@ -0,0 +1,224 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="350" + layout="topleft" + min_height="300" + min_width="450" + name="top_objects" + title="loading..." + width="550"> + <floater.string + name="top_scripts_title"> + Top Scripts + </floater.string> + <floater.string + name="top_scripts_text"> + [COUNT] scripts taking a total of [TIME] ms + </floater.string> + <floater.string + name="scripts_score_label"> + Time + </floater.string> + <floater.string + name="scripts_mono_time_label"> + Mono Time + </floater.string> + <floater.string + name="top_colliders_title"> + Top Colliders + </floater.string> + <floater.string + name="top_colliders_text"> + Top [COUNT] objects experiencing many potential collisions + </floater.string> + <floater.string + name="colliders_score_label"> + Score + </floater.string> + <floater.string + name="none_descriptor"> + None found. + </floater.string> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="10" + name="title_text" + top="30" + width="400"> + Loading... + </text> + <scroll_list + draw_heading="true" + follows="left|top|bottom|right" + height="150" + layout="topleft" + left_delta="0" + multi_select="true" + name="objects_list" + top_delta="20" + width="530"> + <scroll_list.columns + label="Score" + name="score" + width="55" /> + <scroll_list.columns + label="Name" + name="name" + width="140" /> + <scroll_list.columns + label="Owner" + name="owner" + width="105" /> + <scroll_list.columns + label="Location" + name="location" + width="130" /> + <scroll_list.columns + label="Time" + name="time" + width="100" /> + <scroll_list.columns + label="Mono Time" + name="mono_time" + width="55" /> + </scroll_list> + <text + type="string" + length="1" + follows="left|bottom" + height="20" + layout="topleft" + left_delta="0" + name="id_text" + top_pad="10" + width="100"> + Object ID: + </text> + <line_editor + enabled="false" + follows="left|bottom|right" + height="20" + layout="topleft" + left_delta="70" + name="id_editor" + top_delta="-3" + width="350" /> + <button + follows="bottom|right" + height="20" + label="Show Beacon" + layout="topleft" + left_pad="10" + name="show_beacon_btn" + top_delta="0" + width="100" /> + <text + type="string" + length="1" + follows="left|bottom" + height="20" + layout="topleft" + left="10" + name="obj_name_text" + top="237" + width="100"> + Object Name: + </text> + <line_editor + follows="left|bottom|right" + height="20" + layout="topleft" + left_delta="70" + name="object_name_editor" + top_delta="-3" + width="350" /> + <button + follows="bottom|right" + height="20" + label="Filter" + layout="topleft" + left_pad="10" + name="filter_object_btn" + top_delta="0" + width="100" /> + <text + type="string" + length="1" + follows="left|bottom" + height="20" + layout="topleft" + left="10" + name="owner_name_text" + top="264" + width="100"> + Owner Name: + </text> + <line_editor + follows="left|bottom|right" + height="20" + layout="topleft" + left_delta="70" + name="owner_name_editor" + top_delta="-3" + width="350" /> + <button + follows="bottom|right" + height="20" + label="Filter" + layout="topleft" + left_pad="10" + name="filter_owner_btn" + top_delta="0" + width="100" /> + <button + follows="bottom|left" + height="20" + label="Return Selected" + layout="topleft" + left="10" + name="return_selected_btn" + top="295" + width="130" /> + <button + follows="bottom|left" + height="20" + label="Return All" + layout="topleft" + left_pad="10" + name="return_all_btn" + top_delta="0" + width="130" /> + <button + follows="bottom|left" + height="20" + label="Disable Selected" + layout="topleft" + left="10" + name="disable_selected_btn" + top="320" + width="130" /> + <button + follows="bottom|left" + height="20" + label="Disable All" + layout="topleft" + left_pad="10" + name="disable_all_btn" + top_delta="0" + width="130" /> + <button + bottom="315" + follows="bottom|right" + height="20" + label="Refresh" + layout="topleft" + name="refresh_btn" + right="-10" + width="100" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_tos.xml b/indra/newview/skins/default/xui/en/floater_tos.xml new file mode 100644 index 0000000000000000000000000000000000000000..6585667c8b63b2428481ed86d9bd15bf02e59b33 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_tos.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_close="false" + can_minimize="false" + height="500" + layout="topleft" + name="modal container" + width="600"> + <floater.string + name="real_url"> + http://secondlife.com/app/tos/ + </floater.string> + <button + enabled="false" + height="20" + label="Continue" + label_selected="Continue" + layout="topleft" + left="484" + name="Continue" + top="464" + width="100" /> + <button + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_delta="-468" + name="Cancel" + top_delta="0" + width="100" /> + <check_box + follows="top|right" + height="16" + label="I Agree to the Terms of Service" + layout="topleft" + left_delta="0" + name="agree_chk" + top_delta="-45" + width="55" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="30" + layout="topleft" + left_delta="0" + name="tos_heading" + top_delta="-399" + width="552"> + Please read the following Terms of Service carefully. To continue logging in to Second Life, +you must accept the agreement. + </text> + <text_editor + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="283" + layout="topleft" + left_delta="0" + max_length="65536" + name="tos_text" + top_pad="43" + width="568" + word_wrap="true"> + TOS_TEXT + </text_editor> + <web_browser + follows="left|top" + height="340" + layout="topleft" + left_delta="0" + name="tos_html" + start_url="data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody text=%22000000%22%3E%3Ch2%3E Loading %3Ca%20target%3D%22_external%22%20href%3D%22http%3A//secondlife.com/app/tos/%22%3ETerms%20of%20Service%3C/a%3E...%3C/h2%3E %3C/body%3E %3C/html%3E" + top_delta="-27" + width="568" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_ui_preview.xml b/indra/newview/skins/default/xui/en/floater_ui_preview.xml new file mode 100644 index 0000000000000000000000000000000000000000..10968364f3a9548e70e1c534e6fcaa9c30efe44a --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_ui_preview.xml @@ -0,0 +1,381 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + height="640" + layout="topleft" + min_height="230" + min_width="650" + name="gui_preview_tool" + single_instance="true" + title="XUI Preview Tool" + width="750"> + <panel + bottom="640" + follows="left|top|right|bottom" + layout="topleft" + left="0" + mouse_opaque="false" + name="main_panel" + right="650" + top="0"> + <text + type="string" + length="1" + follows="top|left" + font="SansSerif" + height="30" + layout="topleft" + left="10" + name="select_language_label" + top="25" + width="130"> + Primary Language: + </text> + <combo_box + follows="top|left" + height="20" + layout="topleft" + left_pad="5" + name="language_select_combo" + top_delta="0" + width="55"> + <combo_box.item + label="en" + value="en" /> + </combo_box> + <button + follows="left|top" + height="25" + label="Display Floater" + label_selected="Display Floater" + layout="topleft" + left_pad="10" + name="display_floater" + tool_tip="Display the XUI floater defined by the selected XML file" + top_delta="-2" + width="95" /> + <button + enabled="false" + follows="left|top" + height="25" + label="Close Floater" + label_selected="Close Floater" + layout="topleft" + left_pad="10" + name="close_displayed_floater" + tool_tip="Closes the currently-displayed floater, if one exists" + top_delta="0" + width="85" /> + <button + follows="left|top" + height="25" + label="Edit Floater..." + label_selected="Edit Floater..." + layout="topleft" + left_pad="10" + name="edit_floater" + tool_tip="Edit the XUI floater defined by the selected XML file (opens external editor). Opens en version if no localized version exists." + top_delta="0" + width="95" /> + <button + follows="left|top" + height="25" + label="Save" + label_selected="Save" + layout="topleft" + left_pad="5" + name="save_floater" + tool_tip="Save the XUI floater defined by the selected XML file" + top_delta="0" + width="85" /> + <button + follows="left|top" + height="25" + label="Save All" + label_selected="Save All" + layout="topleft" + left_pad="10" + name="save_all_floaters" + tool_tip="Save all XUI floaters defined by the selected language" + top_delta="0" + width="85" /> + <button + enabled="false" + follows="right|top" + height="25" + is_toggle="true" + label="> >" + label_selected="< <" + layout="topleft" + left_pad="15" + name="toggle_overlap_panel" + tool_tip="Toggle highlighting and display panel for overlapping elements; right click an element to select it for this feature. The selected element is marked by a red rectangle." + top_delta="0" + width="30" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerif" + height="30" + layout="topleft" + left="10" + name="select_language_label_2" + right="-50" + top="53" + width="105"> + Secondary Language: + </text> + <combo_box + follows="top|left" + height="20" + layout="topleft" + left_delta="135" + name="language_select_combo_2" + top_delta="0" + width="55"> + <combo_box.item + label="en" + value="en" /> + </combo_box> + <button + follows="left|top" + height="25" + label="Display Floater" + label_selected="Display Floater" + layout="topleft" + left_pad="10" + name="display_floater_2" + tool_tip="Display the XUI floater defined by the selected XML file" + top_delta="-2" + width="95" /> + <button + enabled="false" + follows="left|top" + height="25" + label="Close Floater" + label_selected="Close Floater" + layout="topleft" + left_pad="10" + name="close_displayed_floater_2" + tool_tip="Closes the currently-displayed floater, if one exists" + top_delta="0" + width="85" /> + <scroll_list + bottom="525" + column_padding="0" + draw_heading="true" + draw_stripes="false" + follows="left|top|bottom|right" + label="Name" + layout="topleft" + left="10" + name="name_list" + right="-10" + search_column="1" + top="80"> + <scroll_list.columns + label="Title" + name="title_column" + width="150" /> + <scroll_list.columns + label="File" + name="file_column" + width="150" /> + <scroll_list.columns + dynamicwidth="true" + label="Top-Level Node" + name="top_level_node_column" /> + </scroll_list> + <panel + bevel_style="in" + bg_alpha_color="0 0 0 0" + bg_opaque_color="0 0 0 0.3" + border="true" + bottom_delta="65" + follows="left|right|bottom" + height="60" + layout="topleft" + left="10" + name="editor_panel" + right="-10"> + <text + type="string" + length="1" + follows="left|bottom" + font="SansSerif" + height="30" + layout="topleft" + left="10" + left_delta="10" + name="editor_path_label" + top="10" + width="100"> + Editor Path: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|bottom" + font="SansSerif" + handle_edit_keys_directly="true" + height="20" + layout="topleft" + left_delta="100" + max_length="300" + name="executable_path_field" + select_on_focus="true" + tool_tip="The full path to an editor (executable) to edit floater XML files (quotes not necessary)" + top_delta="-2" + width="315" /> + <button + follows="left|bottom" + height="25" + label="Browse..." + label_selected="Browse..." + layout="topleft" + left_pad="5" + name="browse_for_executable" + tool_tip="Browse for an editor (executable) to edit floater XML files" + top_delta="-2" + width="75" /> + <text + type="string" + length="1" + follows="left|bottom" + font="SansSerif" + height="30" + layout="topleft" + left="10" + left_delta="-420" + name="executable_args_label" + top="36" + width="100"> + Editor Arguments: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|bottom" + font="SansSerif" + handle_edit_keys_directly="true" + height="20" + layout="topleft" + left_delta="100" + max_length="300" + name="executable_args_field" + select_on_focus="true" + tool_tip="Command-line arguments to the editor; use '%FILE%' to refer to the target file; 'YourProgram.exe FileName.xml' will be run if this field is empty" + top_delta="-2" + width="315" /> + </panel> + <panel + bevel_style="in" + bg_alpha_color="0 0 0 0" + bg_opaque_color="0 0 0 0.3" + border="true" + bottom_delta="40" + follows="left|right|bottom" + height="35" + layout="topleft" + left="10" + name="vlt_panel" + right="-10"> + <text + type="string" + length="1" + follows="left|bottom" + font="SansSerif" + height="30" + layout="topleft" + left="10" + left_delta="10" + name="diff_file_label" + top="10" + width="200"> + Delta File: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|bottom" + font="SansSerif" + handle_edit_keys_directly="true" + height="20" + layout="topleft" + left_delta="65" + max_length="300" + name="vlt_diff_path_field" + select_on_focus="true" + tool_tip="The full path to an XML D0 or D1 localization difference file generated by the Viewer Localization Toolkit" + top_delta="-2" + width="235" /> + <button + follows="left|bottom" + height="25" + label="Browse..." + label_selected="Browse..." + layout="topleft" + left_pad="5" + name="browse_for_vlt_diffs" + tool_tip="Browse for a VLT-generated D0 or D1 difference file to highlight changed files and elements" + top_delta="-2" + width="75" /> + <button + follows="left|bottom" + height="25" + is_toggle="true" + label="Highlight Diffs" + label_selected="Unhighlight Diffs" + layout="topleft" + left_pad="5" + name="toggle_vlt_diff_highlight" + tool_tip="Toggle highlighting of files and elements containing changed localization data" + top_delta="0" + width="110" /> + </panel> + </panel> + <scroll_container + follows="top|right|bottom" + height="637" + layout="topleft" + left_delta="550" + name="overlap_scroll" + reserve_scroll_corner="true" + top_delta="2" + width="300"> + <panel + background_opaque="true" + background_visible="true" + bevel_style="in" + bg_alpha_color="0 0 0 1" + bg_opaque_color="1 1 1 1" + border="true" + follows="top|right|bottom" + height="637" + label="Overlap Panel" + layout="topleft" + left_delta="0" + min_width="300" + name="overlap_panel" + tool_tip="This panel displays the currently-selected element and all of the elements that overlap it, separated by horizontal lines" + top="-607" + visible="false" + width="300" /> + <text + type="string" + length="1" + follows="top|right" + font="SansSerif" + height="30" + layout="topleft" + left="10" + left_delta="10" + name="overlap_panel_label" + right="-50" + top="0" + width="150"> + Overlapping Elements: + </text> + </scroll_container> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_url_entry.xml b/indra/newview/skins/default/xui/en/floater_url_entry.xml new file mode 100644 index 0000000000000000000000000000000000000000..82a9750cda38215121da4aff2d2b3f347ecb4c7c --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_url_entry.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_minimize="false" + height="87" + layout="topleft" + name="url_entry" + width="500"> + <text + type="string" + length="1" + bottom="20" + follows="top|left" + height="15" + layout="topleft" + left="20" + name="media_label" + top="20"> + Media URL: + </text> + <combo_box + allow_text_entry="true" + follows="left|top|right" + height="19" + layout="topleft" + left_delta="70" + max_chars="255" + name="media_entry" + top_delta="-4" + width="370" /> + <button + follows="top|left" + height="20" + label="OK" + layout="topleft" + left="20" + name="ok_btn" + top="50" + width="64" /> + <button + follows="top|left" + height="20" + label="Cancel" + layout="topleft" + left_pad="28" + name="cancel_btn" + top_delta="0" + width="64" /> + <button + follows="top|right" + height="20" + label="Clear" + layout="topleft" + left_pad="220" + name="clear_btn" + top_delta="0" + width="64" /> + <text + type="string" + length="1" + bottom_delta="-2" + follows="bottom|left" + height="15" + layout="topleft" + left="220" + name="loading_label" + visible="false"> + Loading... + </text> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_water.xml b/indra/newview/skins/default/xui/en/floater_water.xml new file mode 100644 index 0000000000000000000000000000000000000000..07ebf734ea2feb5c0a644e80947c237d2e8afd1c --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_water.xml @@ -0,0 +1,656 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="240" + layout="topleft" + name="Water Floater" + save_rect="true" + title="Advanced Water Editor" + width="700"> + <floater.string + name="WLDefaultWaterNames"> + Default:Glassy:Pond:Murky:Second Plague:SNAKE!!!:Valdez + </floater.string> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="10" + name="KeyFramePresetsText" + top="34" + width="110"> + Water Presets: + </text> + <combo_box + height="18" + layout="topleft" + left_delta="110" + name="WaterPresetsCombo" + top_delta="-2" + width="150" /> + <button + height="20" + label="New" + label_selected="New" + layout="topleft" + left_pad="20" + name="WaterNewPreset" + top_delta="1" + width="70" /> + <button + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left_pad="10" + name="WaterSavePreset" + top_delta="0" + width="70" /> + <button + height="20" + label="Delete" + label_selected="Delete" + layout="topleft" + left_pad="10" + name="WaterDeletePreset" + top_delta="0" + width="70" /> + <tab_container + follows="left|top" + height="180" + layout="topleft" + left="0" + name="Water Tabs" + tab_position="top" + top="60" + width="700"> + <panel + border="true" + follows="left|top|right|bottom" + height="180" + label="Settings" + layout="topleft" + left="1" + mouse_opaque="false" + name="Settings" + top="60" + width="698"> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="10" + name="BHText" + top="4" + width="355"> + Water Fog Color + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WaterFogColorHelp" + top_delta="-2" + width="18" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + color="0.5 0.5 0.5 1" + follows="left|top" + height="50" + layout="topleft" + left="40" + name="WaterFogColor" + tool_tip="Click to open Color Picker" + top="30" + width="40" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="10" + name="WaterFogDensText" + top="74" + width="355"> + Fog Density Exponent + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WaterFogDensityHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WaterFogDensity" + decimal_digits="1" + follows="left" + height="10" + initial_value="16" + layout="topleft" + left="24" + max_val="10" + name="WaterFogDensity" + top="110" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="WaterUnderWaterFogModText" + top_delta="4" + width="355"> + Underwater Fog Modifier + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WaterUnderWaterFogModHelp" + top_delta="-2" + width="18" /> + <slider + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="16" + layout="topleft" + left="24" + max_val="2" + name="WaterUnderWaterFogMod" + top="150" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="245" + name="BDensText" + top="4" + width="355"> + Reflection Wavelet Scale + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WaterNormalScaleHelp" + top_delta="-2" + width="18" /> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left="245" + name="BHText2" + top="21" + width="10"> + 1 + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText3" + top_delta="11" + width="10"> + 2 + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText4" + top_delta="11" + width="10"> + 3 + </text> + <slider + control_name="WaterNormalScaleX" + decimal_digits="1" + follows="left" + height="10" + initial_value="0.7" + layout="topleft" + left_pad="4" + max_val="10" + name="WaterNormalScaleX" + top_delta="-3" + width="200" /> + <slider + control_name="WaterNormalScaleY" + decimal_digits="1" + follows="left" + height="10" + initial_value="0.7" + layout="topleft" + left_delta="0" + max_val="10" + name="WaterNormalScaleY" + top_pad="1" + width="200" /> + <slider + control_name="WaterNormalScaleZ" + decimal_digits="1" + follows="left" + height="10" + initial_value="0.7" + layout="topleft" + left_delta="0" + max_val="10" + name="WaterNormalScaleZ" + top_pad="1" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="HDText" + top_delta="2" + width="355"> + Fresnel Scale + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WaterFresnelScaleHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WaterFresnelScale" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left="259" + name="WaterFresnelScale" + top="100" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="FresnelOffsetText" + top_delta="-1" + width="355"> + Fresnel Offset + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WaterFresnelOffsetHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WaterFresnelOffset" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left="259" + name="WaterFresnelOffset" + top="135" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="480" + name="DensMultText" + top="4" + width="355"> + Refract Scale Above + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WaterScaleAboveHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WaterScaleAbove" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.1" + layout="topleft" + left="494" + name="WaterScaleAbove" + top="40" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="WaterScaleBelowText" + top_delta="-3" + width="355"> + Refract Scale Below + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WaterScaleBelowHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WaterScaleBelow" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0" + layout="topleft" + left="494" + name="WaterScaleBelow" + top="73" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="MaxAltText" + top_delta="-2" + width="355"> + Blur Multiplier + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WaterBlurMultiplierHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WaterBlurMult" + follows="left" + height="10" + increment="0.001" + initial_value="0" + layout="topleft" + left="494" + max_val="0.16" + name="WaterBlurMult" + top="107" + width="200" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="180" + label="Image" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="Waves" + top_delta="44" + width="698"> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="10" + name="BHText" + top="4" + width="355"> + Big Wave Direction + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="145" + name="WaterWave1Help" + top_delta="-2" + width="18" /> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left="10" + name="WaterWave1DirXText" + top="21" + width="10"> + X + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="WaterWave1DirYText" + top_delta="11" + width="10"> + Y + </text> + <slider + control_name="WaterWave1DirX" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left="24" + max_val="4" + min_val="-4" + name="WaterWave1DirX" + top="40" + width="200" /> + <slider + control_name="WaterWave1DirY" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + max_val="4" + min_val="-4" + name="WaterWave1DirY" + top_pad="1" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="BHText2" + top_delta="3" + width="355"> + Little Wave Direction + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="145" + name="WaterWave2Help" + top_delta="-2" + width="18" /> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left="10" + name="WaterWave2DirXText" + top="71" + width="10"> + X + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="WaterWave2DirYText" + top_delta="11" + width="10"> + Y + </text> + <slider + control_name="WaterWave2DirX" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left="24" + max_val="4" + min_val="-4" + name="WaterWave2DirX" + top="90" + width="200" /> + <slider + control_name="WaterWave2DirY" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + max_val="4" + min_val="-4" + name="WaterWave2DirY" + top_pad="1" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="240" + name="BHText3" + top="4" + width="355"> + Normal Map + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="125" + name="WaterNormalMapHelp" + top_delta="-2" + width="18" /> + <texture_picker + height="143" + layout="topleft" + left="250" + name="WaterNormalMap" + top="22" + width="128" /> + </panel> + </tab_container> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_wearable_save_as.xml b/indra/newview/skins/default/xui/en/floater_wearable_save_as.xml new file mode 100644 index 0000000000000000000000000000000000000000..ee67989d332d3d3eac34373aaa2142ceb5876d76 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_wearable_save_as.xml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + border="true" + can_close="false" + can_minimize="false" + height="100" + layout="topleft" + name="modal container" + width="240"> + <button + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="20" + name="Save" + top="70" + width="82" /> + <button + height="20" + label="Cancel" + label_selected="Cancel" + layout="topleft" + left_pad="36" + name="Cancel" + top_delta="0" + width="82" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left="20" + name="Save item as:" + top="10" + width="200"> + Save item as: + </text> + <line_editor + type="string" + length="1" + border_style="line" + border_thickness="1" + follows="left|top" + font="SansSerif" + handle_edit_keys_directly="true" + height="20" + layout="topleft" + left_delta="0" + max_length="63" + name="name ed" + top_pad="4" + width="200"> + New [DESC] + </line_editor> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_windlight_options.xml b/indra/newview/skins/default/xui/en/floater_windlight_options.xml new file mode 100644 index 0000000000000000000000000000000000000000..5257cc687e0987348084814f7dab363611ccf522 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_windlight_options.xml @@ -0,0 +1,1487 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + height="220" + layout="topleft" + name="WindLight floater" + save_rect="true" + title="Advanced Sky Editor" + width="700"> + <floater.string + name="WLDefaultSkyNames"> + A-12AM:A-12PM:A-3AM:A-3PM:A-4.30PM:A-6AM:A-6PM:A-9AM:A-9PM:Barcelona:Blizzard:Blue Midday:Coastal Afternoon:Coastal Sunset:Default:Desert Sunset:Fine Day:Fluffy Big Clouds:Foggy:Funky Funky:Funky Funky Funky:Gelatto:Ghost:Incongruent Truths:Midday 1:Midday 2:Midday 3:Midday 4:Night:Pirate:Purple:Sailor's Delight:Sheer Sensuality + </floater.string> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="10" + name="KeyFramePresetsText" + top="34" + width="110"> + Sky Presets: + </text> + <combo_box + height="18" + layout="topleft" + left_delta="110" + name="WLPresetsCombo" + top_delta="-2" + width="150" /> + <button + height="20" + label="New" + label_selected="New" + layout="topleft" + left_pad="20" + name="WLNewPreset" + top_delta="1" + width="70" /> + <button + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left_pad="10" + name="WLSavePreset" + top_delta="0" + width="70" /> + <button + height="20" + label="Delete" + label_selected="Delete" + layout="topleft" + left_pad="10" + name="WLDeletePreset" + top_delta="0" + width="70" /> + <button + height="20" + label="Day Cycle Editor" + label_selected="Day Cycle Editor" + layout="topleft" + left_pad="50" + name="WLDayCycleMenuButton" + top_delta="0" + width="120" /> + <tab_container + follows="left|top" + height="160" + layout="topleft" + left="0" + name="WindLight Tabs" + tab_position="top" + top="60" + width="700"> + <panel + border="true" + follows="left|top|right|bottom" + height="160" + label="Atmosphere" + layout="topleft" + left="1" + mouse_opaque="false" + name="Atmosphere" + top="60" + width="698"> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="10" + name="BHText" + top="4" + width="355"> + Blue Horizon + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLBlueHorizonHelp" + top_delta="-2" + width="18" /> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left="10" + name="BHText2" + top="21" + width="10"> + R + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText3" + top_delta="11" + width="10"> + G + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText4" + top_delta="11" + width="10"> + B + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText5" + top_delta="11" + width="10"> + I + </text> + <slider + control_name="WLBlueHorizonR" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left="24" + name="WLBlueHorizonR" + top="40" + width="200" /> + <slider + control_name="WLBlueHorizonG" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + name="WLBlueHorizonG" + top_pad="1" + width="200" /> + <slider + control_name="WLBlueHorizonB" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + name="WLBlueHorizonB" + top_pad="1" + width="200" /> + <slider + control_name="WLBlueHorizonI" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="1.0" + layout="topleft" + left_delta="0" + name="WLBlueHorizonI" + top_pad="1" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="BDensText" + top_delta="-2" + width="355"> + Haze Horizon + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLHazeHorizonHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WLHazeHorizon" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.25" + layout="topleft" + left="24" + name="WLHazeHorizon" + top="107" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="245" + name="BDensText2" + top="4" + width="355"> + Blue Density + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLBlueDensityHelp" + top_delta="-2" + width="18" /> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left="245" + name="BHText6" + top="21" + width="10"> + R + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText7" + top_delta="11" + width="10"> + G + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText8" + top_delta="11" + width="10"> + B + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText9" + top_delta="11" + width="10"> + I + </text> + <slider + control_name="WLBlueDensityR" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left="259" + name="WLBlueDensityR" + top="40" + width="200" /> + <slider + control_name="WLBlueDensityG" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + name="WLBlueDensityG" + top_pad="1" + width="200" /> + <slider + control_name="WLBlueDensityB" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + name="WLBlueDensityB" + top_pad="1" + width="200" /> + <slider + control_name="WLBlueDensityI" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="1" + layout="topleft" + left_delta="0" + name="WLBlueDensityI" + top_pad="1" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="HDText" + top_delta="-2" + width="355"> + Haze Density + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLHazeDensityHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WLHazeDensity" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left="259" + max_val="4" + name="WLHazeDensity" + top="107" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="480" + name="DensMultText" + top="4" + width="355"> + Density Multiplier + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLDensityMultHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WLDensityMult" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.1" + layout="topleft" + left="494" + max_val="0.9" + name="WLDensityMult" + top="40" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="WLDistanceMultText" + top_delta="-3" + width="355"> + Distance Multiplier + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLDistanceMultHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WLDistancMult" + decimal_digits="1" + follows="left" + height="10" + initial_value="1.0" + layout="topleft" + left="494" + max_val="100" + name="WLDistanceMult" + top="73" + width="207" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="MaxAltText" + top_delta="-2" + width="355"> + Max Altitude + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLMaxAltitudeHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WLMaxAltitude" + decimal_digits="0" + follows="left" + height="10" + increment="1" + initial_value="500" + layout="topleft" + left="494" + max_val="4000" + name="WLMaxAltitude" + top="107" + width="205" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="160" + label="Lighting" + layout="topleft" + left_delta="0" + name="Lighting" + top_delta="4" + width="698"> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="10" + name="SLCText" + top="4" + width="355"> + Sun/Moon Color + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLSunlightColorHelp" + top_delta="-2" + width="18" /> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left="10" + name="BHText" + top="21" + width="10"> + R + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText2" + top_delta="11" + width="10"> + G + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText3" + top_delta="11" + width="10"> + B + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText4" + top_delta="11" + width="10"> + I + </text> + <slider + control_name="WLSunlightR" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left="24" + name="WLSunlightR" + top="40" + width="200" /> + <slider + control_name="WLSunlightG" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + name="WLSunlightG" + top_pad="1" + width="200" /> + <slider + control_name="WLSunlightB" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + name="WLSunlightB" + top_pad="1" + width="200" /> + <slider + control_name="WLSunlightI" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="1.0" + layout="topleft" + left_delta="0" + name="WLSunlightI" + top_pad="1" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="TODText" + top_delta="-2" + width="355"> + Sun/Moon Position + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLTimeOfDayHelp" + top_delta="-2" + width="18" /> + <icon + height="20" + image_name="icon_diurnal.tga" + layout="topleft" + left="30" + name="SkyDayCycle" + top="97" + width="148" /> + <slider + control_name="WLSunAngle" + follows="left" + height="10" + increment="0.001" + initial_value="0.7" + layout="topleft" + left="24" + name="WLSunAngle" + top="137" + width="204" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="245" + name="WLAmbientText" + top="4" + width="355"> + Ambient + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLAmbientHelp" + top_delta="-2" + width="18" /> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left="245" + name="BHText5" + top="21" + width="10"> + R + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText6" + top_delta="11" + width="10"> + G + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText7" + top_delta="11" + width="10"> + B + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText8" + top_delta="11" + width="10"> + I + </text> + <slider + control_name="WLAmbientR" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left="259" + name="WLAmbientR" + top="40" + width="200" /> + <slider + control_name="WLAmbientG" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + name="WLAmbientG" + top_pad="1" + width="200" /> + <slider + control_name="WLAmbientB" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + name="WLAmbientB" + top_pad="1" + width="200" /> + <slider + control_name="WLAmbientI" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="1" + layout="topleft" + left_delta="0" + name="WLAmbientI" + top_pad="1" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="WLEastAngleText" + top_delta="-2" + width="355"> + East Angle + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLEastAngleHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WLEastAngle" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.0" + layout="topleft" + left="259" + name="WLEastAngle" + top="107" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="480" + name="SunGlowText" + top="4" + width="355"> + Sun Glow + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLSunGlowHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WLGlowB" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.1" + label="Focus " + layout="topleft" + left="494" + max_val="0.5" + name="WLGlowB" + top="40" + width="200" /> + <slider + control_name="WLGlowR" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.25" + label="Size " + layout="topleft" + left_delta="0" + max_val="1.99" + min_val="1" + name="WLGlowR" + top_pad="1" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="SceneGammaText" + top_delta="0" + width="200"> + Scene Gamma + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLSceneGammaHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WLGamma" + decimal_digits="2" + follows="bottom" + height="10" + increment="0.01" + initial_value="2.0" + layout="topleft" + left="494" + max_val="10" + name="WLGamma" + top="87" + width="207" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="WLStarText" + top_delta="-1" + width="355"> + Star Brightness + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLStarBrightnessHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WLStarAlpha" + decimal_digits="2" + follows="bottom" + height="10" + increment="0.01" + initial_value="0" + layout="topleft" + left="494" + max_val="2" + name="WLStarAlpha" + top="122" + width="200" /> + </panel> + <panel + border="true" + follows="left|top|right|bottom" + height="160" + label="Clouds" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="Clouds" + top_delta="4" + width="698"> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="10" + name="WLCloudColorText" + top="4" + width="355"> + Cloud Color + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLCloudColorHelp" + top_delta="-2" + width="18" /> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left="10" + name="BHText" + top="21" + width="10"> + R + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText2" + top_delta="11" + width="10"> + G + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText3" + top_delta="11" + width="10"> + B + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText4" + top_delta="11" + width="10"> + I + </text> + <slider + control_name="WLCloudColorR" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left="24" + name="WLCloudColorR" + top="40" + width="200" /> + <slider + control_name="WLCloudColorG" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + name="WLCloudColorG" + top_pad="1" + width="200" /> + <slider + control_name="WLCloudColorB" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + name="WLCloudColorB" + top_pad="1" + width="200" /> + <slider + control_name="WLCloudColorI" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="1.0" + layout="topleft" + left_delta="0" + name="WLCloudColorI" + top_pad="1" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="WLCloudColorText2" + top_delta="-2" + width="355"> + Cloud XY/Density + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLCloudDensityHelp" + top_delta="-2" + width="18" /> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left="10" + name="BHText5" + top="87" + width="10"> + X + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText6" + top_delta="11" + width="10"> + Y + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText7" + top_delta="11" + width="10"> + D + </text> + <slider + control_name="WLCloudX" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.5" + layout="topleft" + left_pad="4" + name="WLCloudX" + top_delta="-2" + width="200" /> + <slider + control_name="WLCloudY" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.5" + layout="topleft" + left_delta="0" + name="WLCloudY" + top_pad="1" + width="200" /> + <slider + control_name="WLCloudDensity" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="1.0" + layout="topleft" + left_delta="0" + name="WLCloudDensity" + top_pad="1" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="245" + name="WLCloudCoverageText" + top="4" + width="355"> + Cloud Coverage + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLCloudCoverageHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WLCloudCoverage" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.5" + layout="topleft" + left="259" + name="WLCloudCoverage" + top="40" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="WLCloudScaleText" + top_delta="-1" + width="355"> + Cloud Scale + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLCloudScaleHelp" + top_delta="-2" + width="18" /> + <slider + control_name="WLCloudScale" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="1.0" + layout="topleft" + left="259" + min_val="0.01" + name="WLCloudScale" + top="75" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="WLCloudDetailText" + top_delta="-4" + width="355"> + Cloud Detail (XY/Density) + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="150" + name="WLCloudDetailHelp" + top_delta="-2" + width="18" /> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left="245" + name="BHText8" + top="87" + width="10"> + X + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText9" + top_delta="11" + width="10"> + Y + </text> + <text + type="string" + length="1" + follows="left|top|right" + halign="center" + height="16" + layout="topleft" + left_delta="0" + name="BHText10" + top_delta="11" + width="10"> + D + </text> + <slider + control_name="WLCloudDetailX" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.5" + layout="topleft" + left_pad="4" + name="WLCloudDetailX" + top_delta="-2" + width="200" /> + <slider + control_name="WLCloudDetailY" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.5" + layout="topleft" + left_delta="0" + name="WLCloudDetailY" + top_pad="1" + width="200" /> + <slider + control_name="WLCloudDetailDensity" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="1.0" + layout="topleft" + left_delta="0" + name="WLCloudDetailDensity" + top_pad="1" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left="480" + name="WLCloudScrollXText" + top="4" + width="355"> + Cloud Scroll X + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="125" + name="WLCloudScrollXHelp" + top_delta="-2" + width="18" /> + <check_box + control_name="WLCloudLockX" + follows="left" + height="16" + label="Lock" + layout="topleft" + left="625" + name="WLCloudLockX" + width="200" /> + <slider + control_name="WLCloudScrollX" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.5" + layout="topleft" + left="494" + max_val="10" + min_val="-10" + name="WLCloudScrollX" + top="45" + width="200" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-14" + name="WLCloudScrollYText" + top_delta="-1" + width="355"> + Cloud Scroll Y + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="125" + name="WLCloudScrollYHelp" + top_delta="-2" + width="18" /> + <check_box + control_name="WLCloudLockY" + follows="left" + height="16" + label="Lock" + layout="topleft" + left="625" + name="WLCloudLockY" + width="200" /> + <slider + control_name="WLCloudScrollY" + decimal_digits="2" + follows="left" + height="10" + increment="0.01" + initial_value="0.5" + layout="topleft" + left="494" + max_val="10" + min_val="-10" + name="WLCloudScrollY" + top="85" + width="200" /> + <check_box + control_name="DrawClassicClouds" + follows="left" + height="16" + label="Draw Classic Clouds" + layout="topleft" + left="480" + name="DrawClassicClouds" + top="104" + width="200" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left="608" + name="WLClassicCloudsHelp" + top="84" + width="18" /> + </panel> + </tab_container> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml new file mode 100644 index 0000000000000000000000000000000000000000..43f209546adb813db1477bb1958255a38ec40e7e --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -0,0 +1,540 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + can_resize="true" + center_horiz="true" + center_vert="true" + height="600" + layout="topleft" + min_height="520" + min_width="520" + name="worldmap" + save_rect="true" + save_visibility="true" + single_instance="true" + title="World Map" + width="800"> + <tab_container + follows="left|top|right|bottom" + height="565" + layout="topleft" + left="15" + name="maptab" + tab_position="top" + top="25" + width="542"> + <panel + filename="panel_world_map.xml" + follows="left|top|right|bottom" + height="550" + label="Objects" + layout="topleft" + left="1" + name="objects_mapview" + top="19" + width="540" /> + <panel + filename="panel_world_map.xml" + follows="left|top|right|bottom" + height="550" + label="Terrain" + layout="topleft" + left_delta="0" + name="terrain_mapview" + top_delta="3" + width="540" /> + </tab_container> + <icon + follows="top|right" + height="16" + image_name="map_avatar_16.tga" + layout="topleft" + left="-230" + mouse_opaque="true" + name="self" + top="34" + width="16" /> + <text + type="string" + length="1" + follows="top|right" + height="16" + layout="topleft" + left_pad="4" + name="you_label" + top_delta="0" + width="145"> + You + </text> + <icon + follows="top|right" + height="16" + image_name="map_home.tga" + layout="topleft" + left_delta="50" + mouse_opaque="true" + name="home" + top_delta="0" + width="16" /> + <text + type="string" + length="1" + follows="top|right" + height="16" + layout="topleft" + left_pad="4" + name="home_label" + top_delta="0" + width="145"> + Home + </text> + <icon + color="0.5 0.25 1 1" + follows="top|right" + height="16" + image_name="legend.tga" + layout="topleft" + left="-230" + mouse_opaque="true" + name="square2" + top="54" + width="16" /> + <text + type="string" + length="1" + follows="top|right" + height="16" + layout="topleft" + left_pad="4" + name="auction_label" + top_delta="0" + width="145"> + Auction + </text> + <icon + color="1 1 0.25 1" + follows="top|right" + height="16" + image_name="legend.tga" + layout="topleft" + left_delta="50" + mouse_opaque="true" + name="square" + top_delta="0" + width="16" /> + <text + type="string" + length="1" + follows="top|right" + height="16" + layout="topleft" + left_pad="4" + name="land_for_sale_label" + top_delta="0" + width="145"> + Land For Sale + </text> + <button + follows="top|right" + font="SansSerifSmall" + height="16" + label="Go Home" + label_selected="Go Home" + layout="topleft" + left="-90" + name="Go Home" + tool_tip="Teleport to your home" + top="34" + width="88" /> + <icon + color="0 1 0 1" + follows="top|right" + height="8" + image_name="map_avatar_8.tga" + layout="topleft" + left="-226" + mouse_opaque="true" + name="person" + top="84" + width="8" /> + <check_box + control_name="MapShowPeople" + follows="top|right" + height="16" + label="Resident" + layout="topleft" + left_pad="8" + name="people_chk" + top_delta="-4" + width="110" /> + <icon + follows="top|right" + height="16" + image_name="map_infohub.tga" + layout="topleft" + left="-230" + mouse_opaque="true" + name="infohub" + top="100" + width="16" /> + <check_box + control_name="MapShowInfohubs" + follows="top|right" + height="16" + label="Infohub" + layout="topleft" + left_pad="4" + name="infohub_chk" + top_delta="0" + width="110" /> + <icon + follows="top|right" + height="16" + image_name="map_telehub.tga" + layout="topleft" + left="-230" + mouse_opaque="true" + name="telehub" + top="120" + width="16" /> + <check_box + control_name="MapShowTelehubs" + follows="top|right" + height="16" + label="Telehub" + layout="topleft" + left_pad="4" + name="telehubchk" + top_delta="0" + width="110" /> + <icon + follows="top|right" + height="16" + image_name="icon_for_sale.tga" + layout="topleft" + left="-230" + mouse_opaque="true" + name="landforsale" + top="140" + width="16" /> + <check_box + control_name="MapShowLandForSale" + follows="top|right" + height="16" + label="Land for Sale" + layout="topleft" + left_pad="4" + name="land_for_sale_chk" + top_delta="0" + width="110" /> + <text + type="string" + length="1" + follows="top|right" + height="16" + layout="topleft" + left="-104" + name="events_label" + top="80" + width="145"> + Events: + </text> + <icon + follows="top|right" + height="16" + image_name="map_event.tga" + layout="topleft" + left="-92" + mouse_opaque="true" + name="event" + top="100" + width="16" /> + <check_box + control_name="MapShowEvents" + follows="top|right" + height="16" + label="PG" + layout="topleft" + left_pad="4" + name="event_chk" + top_delta="0" + width="55" /> + <icon + follows="top|right" + height="16" + image_name="map_event_mature.tga" + layout="topleft" + left="-92" + mouse_opaque="true" + name="events_mature_icon" + top="120" + width="16" /> + <check_box + control_name="ShowMatureEvents" + follows="top|right" + height="16" + initial_value="true" + label="Mature" + layout="topleft" + left_pad="4" + name="event_mature_chk" + top_delta="0" + width="55" /> + <icon + follows="top|right" + height="16" + image_name="map_event_adult.tga" + layout="topleft" + left="-92" + mouse_opaque="true" + name="events_adult_icon" + top="140" + width="16" /> + <check_box + control_name="ShowAdultEvents" + follows="top|right" + height="16" + label="Adult" + layout="topleft" + left_pad="4" + name="event_adult_chk" + top_delta="0" + width="55" /> + <icon + color="0.5 0 0 1" + follows="top|right" + height="16" + image_name="map_track_16.tga" + layout="topleft" + left="-230" + mouse_opaque="true" + name="avatar_icon" + top="164" + width="16" /> + <combo_box + allow_text_entry="true" + follows="top|right" + height="20" + label="Online Friends" + layout="topleft" + left_pad="4" + max_chars="60" + name="friend combo" + tool_tip="Friend to Show on Map" + top_delta="-4" + width="202"> + <combo_box.item + label="Online Friends" + value="None" /> + </combo_box> + <icon + color="0.5 0 0 1" + follows="top|right" + height="16" + image_name="map_track_16.tga" + layout="topleft" + left="-230" + mouse_opaque="true" + name="landmark_icon" + top="189" + width="16" /> + <combo_box + allow_text_entry="true" + follows="top|right" + height="20" + label="Landmarks" + layout="topleft" + left_pad="4" + max_chars="64" + name="landmark combo" + tool_tip="Landmark to Show on Map" + top_delta="-4" + width="202"> + <combo_box.item + label="Landmarks" + value="None" /> + </combo_box> + <icon + color="0.5 0 0 1" + follows="top|right" + height="16" + image_name="map_track_16.tga" + layout="topleft" + left="-230" + mouse_opaque="true" + name="location_icon" + top="214" + width="16" /> + <line_editor + follows="top|right" + height="20" + label="Search by Region Name" + layout="topleft" + left_pad="4" + name="location" + select_on_focus="true" + tool_tip="Type the name of a region" + top_delta="-4" + width="140" /> + <button + follows="top|right" + height="20" + label="Search" + layout="topleft" + left_pad="5" + name="DoSearch" + tool_tip="Search for region" + top_delta="0" + width="60" /> + <text + type="string" + length="1" + follows="top|right" + font="SansSerif" + height="16" + layout="topleft" + left="-230" + name="search_label" + top="234" + width="222"> + Search Results: + </text> + <scroll_list + draw_stripes="false" + follows="top|right|bottom" + height="200" + layout="topleft" + left_delta="0" + name="search_results" + top_pad="10" + width="222"> + <scroll_list.columns + label="" + name="icon" + width="16" /> + <scroll_list.columns + label="" + name="sim_name" + width="206" /> + </scroll_list> + <text + type="string" + length="1" + follows="bottom|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="location_label" + top_pad="4" + width="98"> + Location: + </text> + <spinner + decimal_digits="0" + follows="bottom|right" + height="16" + increment="1" + initial_value="128" + layout="topleft" + left_delta="70" + max_val="255" + name="spin x" + tool_tip="X coordinate of location to show on map" + top_delta="0" + width="48" /> + <spinner + decimal_digits="0" + follows="bottom|right" + height="16" + increment="1" + initial_value="128" + layout="topleft" + left_pad="2" + max_val="255" + name="spin y" + tool_tip="Y coordinate of location to show on map" + top_delta="0" + width="48" /> + <spinner + decimal_digits="0" + follows="bottom|right" + height="16" + increment="1" + initial_value="0" + layout="topleft" + left_pad="2" + max_val="4096" + name="spin z" + tool_tip="Z coordinate of location to show on map" + top_delta="0" + width="48" /> + <button + follows="right|bottom" + height="20" + label="Teleport" + label_selected="Teleport" + layout="topleft" + left="-230" + name="Teleport" + tool_tip="Teleport to selected location" + top="494" + width="90" /> + <button + follows="right|bottom" + height="20" + label="Show Destination" + label_selected="Show Destination" + layout="topleft" + left_pad="10" + name="Show Destination" + tool_tip="Center map on selected location" + top_delta="0" + width="125" /> + <button + follows="right|bottom" + height="20" + label="Clear" + label_selected="Clear" + layout="topleft" + left="-230" + name="Clear" + tool_tip="Stop tracking" + top="518" + width="90" /> + <button + follows="right|bottom" + height="20" + label="Show My Location" + label_selected="Show My Location" + layout="topleft" + left_pad="10" + name="Show My Location" + tool_tip="Center map on your avatar's location" + top_delta="0" + width="125" /> + <button + enabled="false" + follows="bottom|right" + height="20" + label="Copy SLURL to clipboard" + layout="topleft" + left="-230" + name="copy_slurl" + tool_tip="Copies current location as SLURL to be used on the web." + top="542" + width="222" /> + <slider + follows="right|bottom" + height="16" + increment="0.2" + initial_value="48.5029" + label="Zoom" + layout="topleft" + left_delta="0" + max_val="0" + min_val="-8" + name="zoom slider" + show_text="false" + top_pad="8" + width="222" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/fonts.xml b/indra/newview/skins/default/xui/en/fonts.xml new file mode 100644 index 0000000000000000000000000000000000000000..483291044d68a41c3c55acbb0be2bed2bf124d19 --- /dev/null +++ b/indra/newview/skins/default/xui/en/fonts.xml @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<fonts> + + <font name="default" comment="default font files (global fallbacks)"> + <file>DejaVuSansCondensed.ttf</file> + <os name="Windows"> + <file>MSGOTHIC.TTC</file> + <file>gulim.ttc</file> + <file>simhei.ttf</file> + <file>ArialUni.ttf</file> + </os> + <os name="Mac"> + <file>ヒラã‚゙ノ角ゴ Pro W3.otf</file> + <file>ヒラã‚゙ノ角ゴ ProN W3.otf</file> + <file>AppleGothic.dfont</file> + <file>AppleGothic.ttf</file> + <file>åŽæ–‡ç»†é»‘.ttf</file> + </os> + </font> + + <font name="SansSerif" comment="Name of san-serif font (Truetype file name)"> + <file>"MtBkLfRg.ttf"</file> + </font> + + <font name="SansSerifBold" + comment="Name of bold sans-serif font" + font_style="Bold"> + <file>MtBdLfRg.ttf</file> + </font> + + <font name="Monospace" + comment="Name of monospace font"> + <file>DejaVuSansMono.ttf</file> + </font> + + <font name="DejaVu" + comment="Name of DejaVu font"> + <file>DejaVuSans.ttf</file> + </font> + + <font name="DejaVu" + comment="Name of DejaVu font (bold)" + font_style="BOLD"> + <file>DejaVuSansBold.ttf</file> + </font> + + <font name="DejaVu" + comment="Name of DejaVu font (italic)" + font_style="ITALIC"> + <file>DejaVuSansOblique.ttf</file> + </font> + + <font name="DejaVu" + comment="Name of DejaVu font (bold italic)" + font_style="BOLD|ITALIC"> + <file>DejaVuSansBoldOblique.ttf</file> + </font> + + <font name="Helvetica" + comment="Name of Helvetica font"> + <file>arial.ttf</file> + </font> + + <font name="Helvetica" + comment="Name of Helvetica font (bold)" + font_style="BOLD"> + <file>arialbd.ttf</file> + </font> + + <font name="Helvetica" + comment="Name of Helvetica font (italic)" + font_style="ITALIC"> + <file>ariali.ttf</file> + </font> + + <font name="Helvetica" + comment="Name of Helvetica font (bold italic)" + font_style="BOLD|ITALIC"> + <file>arialbi.ttf</file> + </font> + + <font name="OverrideTest" + comment="Name of font to test overriding"> + <file>times.ttf</file> + </font> + + <font_size name="Monospace" + comment="Size for monospaced font (points, or 1/72 of an inch)" + size="9.0" + /> + <font_size name="Huge" + comment="Size of huge font (points, or 1/72 of an inch)" + size="16.0" + /> + <font_size name="Large" + comment="Size of large font (points, or 1/72 of an inch)" + size="12.0" + /> + <font_size name="Medium" + comment="Size of medium font (points, or 1/72 of an inch)" + size="10.0" + /> + <font_size name="Small" + comment="Size of small font (points, or 1/72 of an inch)" + size="9" + /> +</fonts> + diff --git a/indra/newview/skins/default/xui/en/menu_avatar_icon.xml b/indra/newview/skins/default/xui/en/menu_avatar_icon.xml new file mode 100644 index 0000000000000000000000000000000000000000..df510d68eb7dbde61e95d1ee487bb2600211e488 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_avatar_icon.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu + height="101" + layout="topleft" + left="100" + mouse_opaque="false" + name="Avatar Icon Menu" + top="724" + visible="false" + width="128"> + <menu_item_call + label="Show Profile..." + layout="topleft" + name="Show Profile"> + <menu_item_call.on_click + function="AvatarIcon.Action" + parameter="profile" /> + </menu_item_call> + <menu_item_call + label="Send IM..." + layout="topleft" + name="Send IM"> + <menu_item_call.on_click + function="AvatarIcon.Action" + parameter="im" /> + </menu_item_call> + <menu_item_call + label="Add Friend..." + layout="topleft" + name="Add Friend"> + <menu_item_call.on_click + function="AvatarIcon.Action" + parameter="add" /> + </menu_item_call> + <menu_item_call + label="Remove Friend..." + layout="topleft" + name="Remove Friend"> + <menu_item_call.on_click + function="AvatarIcon.Action" + parameter="remove" /> + </menu_item_call> +</menu> diff --git a/indra/newview/skins/default/xui/en/menu_favorites.xml b/indra/newview/skins/default/xui/en/menu_favorites.xml new file mode 100644 index 0000000000000000000000000000000000000000..7e4bbe3c9d0c47345b54ffaa6d8e8586288b22ca --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_favorites.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu + bottom="825" + layout="topleft" + name="Popup" + visible="false"> + <menu_item_call + label="Teleport" + layout="topleft" + name="Landmark Open"> + <menu_item_call.on_click + function="Favorites.DoToSelected" + parameter="open" /> + </menu_item_call> + <menu_item_call + label="About Landmark" + layout="topleft" + name="Teleport To Landmark"> + <menu_item_call.on_click + function="Favorites.DoToSelected" + parameter="about" /> + </menu_item_call> +<!-- <menu_item_call --> +<!-- label="Rename" --> +<!-- layout="topleft" --> +<!-- name="Rename"> --> +<!-- <menu_item_call.on_click --> +<!-- function="Favorites.DoToSelected" --> +<!-- parameter="rename" /> --> +<!-- </menu_item_call> --> + <menu_item_call + label="Delete" + layout="topleft" + name="Delete"> + <menu_item_call.on_click + function="Favorites.DoToSelected" + parameter="delete" /> + </menu_item_call> +</menu> diff --git a/indra/newview/skins/default/xui/en/menu_group_plus.xml b/indra/newview/skins/default/xui/en/menu_group_plus.xml new file mode 100644 index 0000000000000000000000000000000000000000..2029b19c1c82998958720bcefe284f209bde8e33 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_group_plus.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu name="menu_group_plus" + left="0" bottom="0" visible="false" + mouse_opaque="false" opaque="true" color="MenuDefaultBgColor" drop_shadow="true"> + <menu_item_call name="item_join" label="Join Group..."> + <menu_item_call.on_click function="People.Group.Plus.Action" userdata="join_group" /> + </menu_item_call> + <menu_item_call name="item_new" label="New Group..."> + <menu_item_call.on_click function="People.Group.Plus.Action" userdata="new_group" /> + </menu_item_call> +</menu> diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml new file mode 100644 index 0000000000000000000000000000000000000000..808618ba9685fc55c0faa80f1cfda64651697ca1 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -0,0 +1,518 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu + bottom="825" + layout="topleft" + name="Popup" + visible="false"> + <menu_item_call + label="Buy" + layout="topleft" + name="Task Buy"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="task_buy" /> + </menu_item_call> + <menu_item_call + label="Open" + layout="topleft" + name="Task Open"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="task_open" /> + </menu_item_call> + <menu_item_call + label="Play" + layout="topleft" + name="Task Play"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="task_play" /> + </menu_item_call> + <menu_item_call + label="Properties" + layout="topleft" + name="Task Properties"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="task_properties" /> + </menu_item_call> + <menu_item_call + label="Rename" + layout="topleft" + name="Task Rename"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="rename" /> + </menu_item_call> + <menu_item_call + label="Delete" + layout="topleft" + name="Task Remove"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="delete" /> + </menu_item_call> + <menu_item_call + label="Empty Trash" + layout="topleft" + name="Empty Trash"> + <menu_item_call.on_click + function="Inventory.EmptyTrash" + parameter="rename" /> + </menu_item_call> + <menu_item_call + label="Empty Lost And Found" + layout="topleft" + name="Empty Lost And Found"> + <menu_item_call.on_click + function="Inventory.EmptyLostAndFound" + parameter="rename" /> + </menu_item_call> + <menu_item_call + label="New Folder" + layout="topleft" + name="New Folder"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="category" /> + </menu_item_call> + <menu_item_call + label="New Script" + layout="topleft" + name="New Script"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="lsl" /> + </menu_item_call> + <menu_item_call + label="New Note" + layout="topleft" + name="New Note"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="notecard" /> + </menu_item_call> + <menu_item_call + label="New Gesture" + layout="topleft" + name="New Gesture"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="gesture" /> + </menu_item_call> + <menu + label="New Clothes" + layout="topleft" + name="New Clothes"> + <menu_item_call + label="New Shirt" + layout="topleft" + name="New Shirt"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="shirt" /> + </menu_item_call> + <menu_item_call + label="New Pants" + layout="topleft" + name="New Pants"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="pants" /> + </menu_item_call> + <menu_item_call + label="New Shoes" + layout="topleft" + name="New Shoes"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="shoes" /> + </menu_item_call> + <menu_item_call + label="New Socks" + layout="topleft" + name="New Socks"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="socks" /> + </menu_item_call> + <menu_item_call + label="New Jacket" + layout="topleft" + name="New Jacket"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="jacket" /> + </menu_item_call> + <menu_item_call + label="New Skirt" + layout="topleft" + name="New Skirt"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="skirt" /> + </menu_item_call> + <menu_item_call + label="New Gloves" + layout="topleft" + name="New Gloves"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="gloves" /> + </menu_item_call> + <menu_item_call + label="New Undershirt" + layout="topleft" + name="New Undershirt"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="undershirt" /> + </menu_item_call> + <menu_item_call + label="New Underpants" + layout="topleft" + name="New Underpants"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="underpants" /> + </menu_item_call> + <menu_item_call + label="New Alpha Mask" + layout="topleft" + name="New Alpha Mask"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="alpha" /> + </menu_item_call> + <menu_item_call + label="New Tattoo" + layout="topleft" + name="New Tattoo"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="tattoo" /> + </menu_item_call> + </menu> + <menu + label="New Body Parts" + layout="topleft" + name="New Body Parts"> + <menu_item_call + label="New Shape" + layout="topleft" + name="New Shape"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="shape" /> + </menu_item_call> + <menu_item_call + label="New Skin" + layout="topleft" + name="New Skin"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="skin" /> + </menu_item_call> + <menu_item_call + label="New Hair" + layout="topleft" + name="New Hair"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="hair" /> + </menu_item_call> + <menu_item_call + label="New Eyes" + layout="topleft" + name="New Eyes"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="eyes" /> + </menu_item_call> + </menu> + <menu_item_call + label="Teleport" + layout="topleft" + name="Landmark Open"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="open" /> + </menu_item_call> + <menu_item_call + label="Open" + layout="topleft" + name="Animation Open"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="open" /> + </menu_item_call> + <menu_item_call + label="Open" + layout="topleft" + name="Sound Open"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="open" /> + </menu_item_call> + <menu_item_call + label="Purge Item" + layout="topleft" + name="Purge Item"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="purge" /> + </menu_item_call> + <menu_item_call + label="Restore Item" + layout="topleft" + name="Restore Item"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="restore" /> + </menu_item_call> + <menu_item_call + label="Open" + layout="topleft" + name="Open"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="open" /> + </menu_item_call> + <menu_item_call + label="Properties" + layout="topleft" + name="Properties"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="properties" /> + </menu_item_call> + <menu_item_call + label="Rename" + layout="topleft" + name="Rename"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="rename" /> + </menu_item_call> + <menu_item_call + label="Copy Asset UUID" + layout="topleft" + name="Copy Asset UUID"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="copy_uuid" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Copy" + layout="topleft" + name="Copy"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="copy" /> + </menu_item_call> + <menu_item_call + label="Paste" + layout="topleft" + name="Paste"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="paste" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Delete" + layout="topleft" + name="Delete"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="delete" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Take Off Items" + layout="topleft" + name="Take Off Items"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="removefromoutfit" /> + </menu_item_call> + <menu_item_call + label="Add To Outfit" + layout="topleft" + name="Add To Outfit"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="addtooutfit" /> + </menu_item_call> + <menu_item_call + label="Replace Outfit" + layout="topleft" + name="Replace Outfit"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="replaceoutfit" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Start Conference Chat" + layout="topleft" + name="Conference Chat Folder"> + <menu_item_call.on_click + function="Inventory.BeginIMSession" + parameter="everyone" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Play" + layout="topleft" + name="Sound Play"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="open" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="About Landmark" + layout="topleft" + name="Teleport To Landmark"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="about" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Play in World" + layout="topleft" + name="Animation Play"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="playworld" /> + </menu_item_call> + <menu_item_call + label="Play Locally" + layout="topleft" + name="Animation Audition"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="playlocal" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Send Instant Message" + layout="topleft" + name="Send Instant Message"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="begin_im" /> + </menu_item_call> + <menu_item_call + label="Offer Teleport..." + layout="topleft" + name="Offer Teleport..."> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="lure" /> + </menu_item_call> + <menu_item_call + label="Start Conference Chat" + layout="topleft" + name="Conference Chat"> + <menu_item_call.on_click + function="Inventory.BeginIMSession" + parameter="selected" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Activate" + layout="topleft" + name="Activate"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="activate" /> + </menu_item_call> + <menu_item_call + label="Deactivate" + layout="topleft" + name="Deactivate"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="deactivate" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Detach From Yourself" + layout="topleft" + name="Detach From Yourself"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="detach" /> + </menu_item_call> + <!-- COMMENTED OUT for DEV-32347 --> + <!-- + <menu_item_call + label="Restore to Last Position" + layout="topleft" + name="Restore to Last Position"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="restoreToWorld" /> + </menu_item_call> + --> + <menu_item_call + label="Wear" + layout="topleft" + name="Object Wear"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="attach" /> + </menu_item_call> + <menu + label="Attach To" + layout="topleft" + name="Attach To" /> + <menu + label="Attach To HUD" + layout="topleft" + name="Attach To HUD" /> + <menu_item_call + label="Edit" + layout="topleft" + name="Wearable Edit"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="edit" /> + </menu_item_call> + <menu_item_call + label="Wear" + layout="topleft" + name="Wearable Wear"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="wear" /> + </menu_item_call> + <menu_item_call + label="Take Off" + layout="topleft" + name="Take Off"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="take_off" /> + </menu_item_call> + <menu_item_call + label="--no options--" + layout="topleft" + name="--no options--" /> + <menu_item_separator + layout="topleft" /> +</menu> diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml new file mode 100644 index 0000000000000000000000000000000000000000..eb3dcc225e5b8e9e1ea711d9d88336f71849243c --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_login.xml @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu_bar + follows="left|top|right" + height="18" + layout="topleft" + left_delta="0" + name="Login Menu" + top_delta="0" + width="802"> + <menu + create_jump_keys="true" + label="File" + layout="topleft" + name="File"> + <menu_item_call + label="Quit" + layout="topleft" + name="Quit" + shortcut="control|Q"> + <menu_item_call.on_click + function="File.Quit" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Edit" + layout="topleft" + name="Edit" + width="153"> + <menu_item_call + label="Preferences..." + layout="topleft" + name="Preferences..." + shortcut="control|P"> + <menu_item_call.on_click + function="ShowFloater" + parameter="preferences" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Help" + layout="topleft" + name="Help"> + <menu_item_call + label="Second Life Help" + layout="topleft" + name="Second Life Help" + shortcut="F1"> + <menu_item_call.on_click + function="ShowFloater" + parameter="help f1" /> + </menu_item_call> + <menu_item_call + label="About Second Life..." + layout="topleft" + name="About Second Life..."> + <menu_item_call.on_click + function="ShowFloater" + parameter="about" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Debug" + layout="topleft" + name="Debug"> + <menu_item_call + label="Debug Settings" + layout="topleft" + name="Debug Settings"> + <menu_item_call.on_click + function="Advanced.ShowDebugSettings" + parameter="all" /> + </menu_item_call> + <menu_item_call + label="UI/Color Settings" + layout="topleft" + name="UI/Color Settings"> + <menu_item_call.on_click + function="Advanced.ShowDebugSettings" + parameter="skin" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="UI Preview Tool" + layout="topleft" + name="UI Preview Tool" + shortcut="control|T"> + <menu_item_call.on_click + function="ShowFloater" + parameter="ui_preview" /> + </menu_item_call> + <menu_item_call + label="Widget Test" + layout="topleft" + name="Widget Test" + shortcut="control|shift|T"> + <menu_item_call.on_click + function="ShowFloater" + parameter="test_widgets" /> + </menu_item_call> + </menu> +</menu_bar> diff --git a/indra/newview/skins/default/xui/en/menu_mini_map.xml b/indra/newview/skins/default/xui/en/menu_mini_map.xml new file mode 100644 index 0000000000000000000000000000000000000000..a5e1f35142a00eb2e060d13ade4869bd7c927d37 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_mini_map.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu + height="101" + layout="topleft" + left="100" + mouse_opaque="false" + name="popup" + top="724" + width="128"> + <menu_item_call + label="Zoom Close" + layout="topleft" + name="Zoom Close"> + <menu_item_call.on_click + function="MiniMap.ZoomLevel" + parameter="2" /> + </menu_item_call> + <menu_item_call + label="Zoom Medium" + layout="topleft" + name="Zoom Medium"> + <menu_item_call.on_click + function="MiniMap.ZoomLevel" + parameter="1" /> + </menu_item_call> + <menu_item_call + label="Zoom Far" + layout="topleft" + name="Zoom Far"> + <menu_item_call.on_click + function="MiniMap.ZoomLevel" + parameter="0" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + enabled="false" + label="Stop Tracking" + layout="topleft" + name="Stop Tracking"> + <menu_item_call.on_click + function="MiniMap.StopTracking" /> + <menu_item_call.on_enable + function="MiniMap.EnableTracking" /> + </menu_item_call> + <menu_item_call + enabled="false" + label="Profile..." + layout="topleft" + name="Profile"> + <menu_item_call.on_click + function="MiniMap.ShowProfile" /> + <menu_item_call.on_enable + function="MiniMap.EnableProfile" /> + </menu_item_call> +</menu> diff --git a/indra/newview/skins/default/xui/en/menu_navbar.xml b/indra/newview/skins/default/xui/en/menu_navbar.xml new file mode 100644 index 0000000000000000000000000000000000000000..725321648b59e1f564b3401d3cc91380589a8026 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_navbar.xml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu + height="201" + layout="topleft" + left="100" + mouse_opaque="false" + name="Navbar Menu" + top="624" + visible="false" + width="128"> + <menu_item_call + label="Copy SLURL to Clipboard" + layout="topleft" + name="Copy SLURL"> + <menu_item_call.on_click + function="Navbar.Action" + parameter="copy_url" /> + </menu_item_call> + <menu_item_call + label="Add Landmark..." + layout="topleft" + name="Add Landmark"> + <menu_item_call.on_click + function="Navbar.Action" + parameter="landmark" /> + </menu_item_call> + <menu_item_separator + layout="topleft" + name="Separator" /> + <menu_item_call + label="Cut" + layout="topleft" + name="Cut"> + <menu_item_call.on_click + function="Navbar.Action" + parameter="cut" /> + <menu_item_call.on_enable + function="Navbar.EnableMenuItem" + parameter="can_cut" /> + </menu_item_call> + <menu_item_call + label="Copy" + layout="topleft" + name="Copy"> + <menu_item_call.on_click + function="Navbar.Action" + parameter="copy" /> + <menu_item_call.on_enable + function="Navbar.EnableMenuItem" + parameter="can_copy" /> + </menu_item_call> + <menu_item_call + label="Paste" + layout="topleft" + name="Paste"> + <menu_item_call.on_click + function="Navbar.Action" + parameter="paste" /> + <menu_item_call.on_enable + function="Navbar.EnableMenuItem" + parameter="can_paste" /> + </menu_item_call> + <menu_item_call + label="Delete" + layout="topleft" + name="Delete"> + <menu_item_call.on_click + function="Navbar.Action" + parameter="delete" /> + <menu_item_call.on_enable + function="Navbar.EnableMenuItem" + parameter="can_delete" /> + </menu_item_call> + <menu_item_call + label="Select All" + layout="topleft" + name="Select All"> + <menu_item_call.on_click + function="Navbar.Action" + parameter="select_all" /> + <menu_item_call.on_enable + function="Navbar.EnableMenuItem" + parameter="can_select_all" /> + </menu_item_call> +</menu> diff --git a/indra/newview/skins/default/xui/en/menu_nearby_chat.xml b/indra/newview/skins/default/xui/en/menu_nearby_chat.xml new file mode 100644 index 0000000000000000000000000000000000000000..5eb4b10af9ecdcfe75c8f908d5aa1c39ae9c9c98 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_nearby_chat.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu bottom="100" color="MenuDefaultBgColor" drop_shadow="true" height="101" left="100" + mouse_opaque="false" name="NearBy Chat Menu" opaque="true" width="128" visible="false"> + <menu_item_call bottom_delta="-18" height="18" label="Keep Visible" left="0" mouse_opaque="true" + name="keep_visible" width="128"> + <menu_item_call.on_click function="NearbyChat.Action" userdata="keep_visible" /> + </menu_item_call> + <menu_item_call bottom_delta="-18" height="18" label="Show Nearby People..." left="0" mouse_opaque="true" + name="nearby_people" width="128"> + <menu_item_call.on_click function="NearbyChat.Action" userdata="nearby_people" /> + </menu_item_call> + + <menu_item_separator /> + <menu_item_check bottom_delta="-18" height="18" label="Show Muted Text" left="0" mouse_opaque="true" + name="muted_text" width="128"> + <menu_item_check.on_click function="NearbyChat.Action" userdata="muted_text" /> + <menu_item_check.on_check function="NearbyChat.Check" userdata="muted_text"/> + </menu_item_check> + + <menu_item_separator /> + + <menu_item_check bottom_delta="-18" height="18" label="Show Buddy Icons" left="0" mouse_opaque="true" + name="show_buddy_icons" width="128"> + <menu_item_check.on_click function="NearbyChat.Action" userdata="show_buddy_icons" /> + <menu_item_check.on_check function="NearbyChat.Check" userdata="show_buddy_icons"/> + </menu_item_check> + <menu_item_check bottom_delta="-18" height="18" label="Show Names" left="0" mouse_opaque="true" + name="show_names" width="128"> + <menu_item_check.on_click function="NearbyChat.Action" userdata="show_names" /> + <menu_item_check.on_check function="NearbyChat.Check" userdata="show_names"/> + </menu_item_check> + <menu_item_check bottom_delta="-18" height="18" label="Show Icons and Names" left="0" mouse_opaque="true" + name="show_icons_and_names" width="128"> + <menu_item_check.on_click function="NearbyChat.Action" userdata="show_icons_and_names" /> + <menu_item_check.on_check function="NearbyChat.Check" userdata="show_icons_and_names"/> + </menu_item_check> + + <menu_item_separator /> + <menu_item_call bottom_delta="-18" height="18" label="Font Size" left="0" mouse_opaque="true" + name="font_size" width="128"> + <menu_item_call.on_click function="NearbyChat.Action" userdata="font_size" /> + </menu_item_call> +</menu> diff --git a/indra/newview/skins/default/xui/en/menu_slurl.xml b/indra/newview/skins/default/xui/en/menu_slurl.xml new file mode 100644 index 0000000000000000000000000000000000000000..d5d9d3c43da5a1b51527f02ae618d2018e715ef4 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_slurl.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu + height="101" + layout="topleft" + left="100" + mouse_opaque="false" + name="Popup" + top="724" + width="128"> + <menu_item_separator + layout="topleft" + name="Landmark Separator" /> + <menu_item_call + label="About URL" + layout="topleft" + name="about_url"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="about" /> + </menu_item_call> + <menu_item_call + label="Teleport to URL" + layout="topleft" + name="teleport_to_url"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="about" /> + </menu_item_call> + <menu_item_call + label="Show on Map" + layout="topleft" + name="show_on_map"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="about" /> + </menu_item_call> +</menu> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml new file mode 100644 index 0000000000000000000000000000000000000000..926b51d4c1f28739d2c2fe83fabac86652f0e848 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -0,0 +1,3545 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu_bar + bg_visible="false" + follows="left|top|right" + layout="topleft" + name="Main Menu"> + <menu + label="Me" + layout="topleft" + name="Me" + tear_off="true"> + <menu_item_call + label="Preferences" + layout="topleft" + name="Preferences" + shortcut="control|P"> + <menu_item_call.on_click + function="ShowFloater" + parameter="preferences" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu + label="My Account" + layout="topleft" + name="My Account" + tear_off="true"> + <menu_item_call + label="Account History" + layout="topleft" + name="Account History"> + <menu_item_call.on_click + function="PromptShowURL" + parameter="WebLaunchAccountHistory,http://secondlife.com/account/transactions.php" /> + </menu_item_call> + <menu_item_call + label="Manage My Account" + layout="topleft" + name="Manage My Account"> + <menu_item_call.on_click + function="PromptShowURL" + parameter="WebLaunchJoinNow,http://secondlife.com/account/" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="My Land" + layout="topleft" + name="My Land"> + <menu_item_call.on_click + function="ShowFloater" + parameter="my land" /> + </menu_item_call> + <menu_item_call + label="Buy Land" + layout="topleft" + name="Buy Land"> + <menu_item_call.on_click + function="ShowFloater" + parameter="buy land" /> + <menu_item_call.on_enable + function="World.EnableBuyLand" /> + </menu_item_call> + </menu> + <menu_item_call + label="Buy L$" + layout="topleft" + name="Buy and Sell L$"> + <menu_item_call.on_click + function="ShowFloater" + parameter="buy currency" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="My Profile" + layout="topleft" + name="Profile"> + <menu_item_call.on_click + function="ShowAgentProfile" + parameter="agent" /> + </menu_item_call> + <menu_item_call + label="My Appearance" + layout="topleft" + name="Appearance"> + <menu_item_call.on_click + function="ShowFloater" + parameter="appearance" /> + <menu_item_call.on_enable + function="Edit.EnableCustomizeAvatar" /> + </menu_item_call> + <menu_item_check + label="My Inventory" + layout="topleft" + name="Inventory" + shortcut="control|I"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="inventory" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="inventory" /> + </menu_item_check> + <menu_item_call + label="My Gestures" + layout="topleft" + name="Gestures" + shortcut="control|G"> + <menu_item_call.on_click + function="ShowFloater" + parameter="gestures" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu + label="Status" + layout="topleft" + name="Status" + tear_off="true"> + <menu_item_call + label="Set Away" + layout="topleft" + name="Set Away"> + <menu_item_call.on_click + function="World.SetAway" /> + </menu_item_call> + <menu_item_call + label="Set Busy" + layout="topleft" + name="Set Busy"> + <menu_item_call.on_click + function="World.SetBusy" /> + </menu_item_call> + </menu> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Exit Second Life" + layout="topleft" + name="Quit" + shortcut="control|Q"> + <menu_item_call.on_click + function="File.Quit" /> + </menu_item_call> + </menu> + <menu + label="Communicate" + layout="topleft" + name="Communicate" + tear_off="true"> + <menu_item_check + label="My Friends" + layout="topleft" + name="My Friends" + shortcut="control|shift|F"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="contacts.friends" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="contacts.friends" /> + </menu_item_check> + <menu_item_call + label="My Groups" + layout="topleft" + name="My Groups"> + <menu_item_call.on_click + function="Floater.Show" + parameter="contacts.groups" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Chat" + layout="topleft" + name="Chat"> + <menu_item_call.on_click + function="World.Chat" /> + </menu_item_call> + <menu_item_check + label="Local Chat" + layout="topleft" + name="Chat History" + shortcut="control|H"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="chat" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="chat" /> + </menu_item_check> + <menu_item_check + label="Nearby Chat" + layout="topleft" + name="Nearby Chat" + shortcut="control|N"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="nearby_chat" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="nearby_chat" /> + </menu_item_check> + <menu_item_check + label="Communicate" + layout="topleft" + name="Instant Message" + shortcut="control|T"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="communicate" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="communicate" /> + </menu_item_check> + <menu_item_separator + layout="topleft" /> + <menu_item_check + label="Active Speakers" + layout="topleft" + name="Active Speakers"> + <menu_item_check.on_check + function="FloaterVisible" + parameter="active speakers" /> + <menu_item_check.on_click + function="ShowFloater" + parameter="active speakers" /> + </menu_item_check> + <menu_item_check + label="Mute List" + layout="topleft" + name="Mute List"> + <menu_item_check.on_check + function="FloaterVisible" + parameter="mute list" /> + <menu_item_check.on_click + function="ShowFloater" + parameter="mute list" /> + </menu_item_check> + </menu> + <menu + label="World" + layout="topleft" + name="World" + tear_off="true"> + <menu_item_check + label="Camera Controls" + layout="topleft" + name="Camera Controls"> + <menu_item_check.on_check + function="FloaterVisible" + parameter="camera controls" /> + <menu_item_check.on_click + function="ShowFloater" + parameter="camera controls" /> + </menu_item_check> + <menu_item_check + label="Movement Controls" + layout="topleft" + name="Movement Controls"> + <menu_item_check.on_check + function="FloaterVisible" + parameter="movement controls" /> + <menu_item_check.on_click + function="ShowFloater" + parameter="movement controls" /> + </menu_item_check> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="About Land" + layout="topleft" + name="About Land"> + <menu_item_call.on_click + function="ShowFloater" + parameter="about land" /> + </menu_item_call> + <menu_item_call + label="Region/Estate" + layout="topleft" + name="Region/Estate"> + <menu_item_call.on_click + function="ShowFloater" + parameter="about region" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu + label="Landmarks" + layout="topleft" + name="Landmarks" + tear_off="true"> + <menu_item_call + label="Create Landmark Here" + layout="topleft" + name="Create Landmark Here"> + <menu_item_call.on_click + function="World.CreateLandmark" /> + <menu_item_call.on_enable + function="World.EnableCreateLandmark" /> + </menu_item_call> + <menu_item_call + label="Set Home to Here" + layout="topleft" + name="Set Home to Here"> + <menu_item_call.on_click + function="World.SetHomeLocation" /> + <menu_item_call.on_enable + function="World.EnableSetHomeLocation" /> + </menu_item_call> + <menu_item_call + label="Teleport Home" + layout="topleft" + name="Teleport Home" + shortcut="control|shift|H"> + <menu_item_call.on_click + function="World.TeleportHome" /> + <menu_item_call.on_enable + function="World.EnableTeleportHome" /> + </menu_item_call> + </menu> + <menu_item_check + label="Search" + layout="topleft" + name="Search" + shortcut="control|F"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="search" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="search" /> + </menu_item_check> + <menu_item_check + label="World Map" + layout="topleft" + name="World Map" + shortcut="control|M"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="world_map" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="world_map" /> + </menu_item_check> + <menu_item_check + label="Mini-Map" + layout="topleft" + name="Mini-Map" + shortcut="control|shift|M"> + <menu_item_check.on_check + function="FloaterVisible" /> + <menu_item_check.on_click + function="ShowFloater" + parameter="mini_map" /> + </menu_item_check> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Take Snapshot" + layout="topleft" + name="Take Snapshot" + shortcut="control|shift|S"> + <menu_item_call.on_click + function="Floater.Show" + parameter="snapshot" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_check + label="Build" + layout="topleft" + name="Build" + shortcut="B"> + <menu_item_check.on_check + function="Build.Active" /> + <menu_item_check.on_click + function="Build.Toggle" /> + <menu_item_check.on_enable + function="Build.Enabled" /> + </menu_item_check> + </menu> + <menu + label="Help" + layout="topleft" + name="Help" + tear_off="true"> + <menu_item_call + label="Second Life Help" + layout="topleft" + name="Second Life Help" + shortcut="F1"> + <menu_item_call.on_click + function="ShowFloater" + parameter="help f1" /> + </menu_item_call> + <menu_item_call + label="Tutorial" + layout="topleft" + name="Tutorial"> + <menu_item_call.on_click + function="ShowFloater" + parameter="help tutorial" /> + </menu_item_call> + <menu + label="Report" + layout="topleft" + name="Report" + tear_off="true"> + <menu_item_call + label="Report Abuse" + layout="topleft" + name="Report Abuse"> + <menu_item_call.on_click + function="ShowFloater" + parameter="complaint reporter" /> + </menu_item_call> + <menu_item_call + label="Report Bug" + layout="topleft" + name="Report Bug"> + <menu_item_call.on_click + function="PromptShowURL" + parameter="WebLaunchPublicIssue,http://jira.secondlife.com" /> + </menu_item_call> + <menu_item_call + label="Bumps, Pushes & Hits." + layout="topleft" + name="Bumps, Pushes &amp; Hits"> + <menu_item_call.on_click + function="ShowFloater" + parameter="mean events" /> + </menu_item_call> + <menu_item_call + label="About Second Life" + layout="topleft" + name="About Second Life"> + <menu_item_call.on_click + function="ShowFloater" + parameter="about" /> + </menu_item_call> + </menu> + </menu> + <menu + create_jump_keys="true" + label="Tools" + layout="topleft" + name="BuildTools" + tear_off="true" + visible="false"> + <menu + create_jump_keys="true" + label="Edit" + layout="topleft" + name="Edit" + tear_off="true"> + <menu_item_call + label="Undo" + layout="topleft" + name="Undo" + shortcut="control|Z"> + <menu_item_call.on_click + function="Edit.Undo" /> + <menu_item_call.on_enable + function="Edit.EnableUndo" /> + </menu_item_call> + <menu_item_call + label="Redo" + layout="topleft" + name="Redo" + shortcut="control|Y"> + <menu_item_call.on_click + function="Edit.Redo" /> + <menu_item_call.on_enable + function="Edit.EnableRedo" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Cut" + layout="topleft" + name="Cut" + shortcut="control|X"> + <menu_item_call.on_click + function="Edit.Cut" /> + <menu_item_call.on_enable + function="Edit.EnableCut" /> + </menu_item_call> + <menu_item_call + label="Copy" + layout="topleft" + name="Copy" + shortcut="control|C"> + <menu_item_call.on_click + function="Edit.Copy" /> + <menu_item_call.on_enable + function="Edit.EnableCopy" /> + </menu_item_call> + <menu_item_call + label="Paste" + layout="topleft" + name="Paste" + shortcut="control|V"> + <menu_item_call.on_click + function="Edit.Paste" /> + <menu_item_call.on_enable + function="Edit.EnablePaste" /> + </menu_item_call> + <menu_item_call + label="Delete" + layout="topleft" + name="Delete" + shortcut="Del"> + <menu_item_call.on_click + function="Edit.Delete" /> + <menu_item_call.on_enable + function="Edit.EnableDelete" /> + </menu_item_call> + <menu_item_call + label="Duplicate" + layout="topleft" + name="Duplicate" + shortcut="control|D"> + <menu_item_call.on_click + function="Edit.Duplicate" /> + <menu_item_call.on_enable + function="Edit.EnableDuplicate" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Select All" + layout="topleft" + name="Select All" + shortcut="control|A"> + <menu_item_call.on_click + function="Edit.SelectAll" /> + <menu_item_call.on_enable + function="Edit.EnableSelectAll" /> + </menu_item_call> + <menu_item_call + label="Deselect" + layout="topleft" + name="Deselect" + shortcut="control|E"> + <menu_item_call.on_click + function="Edit.Deselect" /> + <menu_item_call.on_enable + function="Edit.EnableDeselect" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Options" + layout="topleft" + name="Options" + tear_off="true"> + <menu_item_check + label="Edit Linked Parts" + layout="topleft" + name="Edit Linked Parts"> + <menu_item_check.on_check + control="EditLinkedParts" /> + <menu_item_check.on_click + function="Tools.EditLinkedParts" + parameter="EditLinkedParts" /> + <menu_item_check.on_enable + function="Tools.EnableToolNotPie" /> + </menu_item_check> + <menu_item_call + label="Set Default Permissions" + layout="topleft" + name="perm prefs"> + <menu_item_call.on_click + function="ShowFloater" + parameter="perm prefs" /> + </menu_item_call> + <menu_item_call + label="Show Script Warning/Error Window" + layout="topleft" + name="Show Script Warning/Error Window"> + <menu_item_call.on_click + function="ShowFloater" + parameter="script errors" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu + create_jump_keys="true" + label="Selection" + layout="topleft" + name="Selection" + tear_off="true"> + <menu_item_check + label="Select Only My Objects" + layout="topleft" + name="Select Only My Objects"> + <menu_item_check.on_check + control="SelectOwnedOnly" /> + <menu_item_check.on_click + function="Tools.SelectOnlyMyObjects" + parameter="agents" /> + </menu_item_check> + <menu_item_check + label="Select Only Movable Objects" + layout="topleft" + name="Select Only Movable Objects"> + <menu_item_check.on_check + control="SelectMovableOnly" /> + <menu_item_check.on_click + function="Tools.SelectOnlyMovableObjects" + parameter="movable" /> + </menu_item_check> + <menu_item_check + label="Select By Surrounding" + layout="topleft" + name="Select By Surrounding"> + <menu_item_check.on_check + control="RectangleSelectInclusive" /> + <menu_item_check.on_click + function="Tools.SelectBySurrounding" /> + </menu_item_check> + </menu> + <menu + create_jump_keys="true" + label="Show" + layout="topleft" + name="Show" + tear_off="true"> + <menu_item_check + label="Show Hidden Selection" + layout="topleft" + name="Show Hidden Selection"> + <menu_item_check.on_check + control="RenderHiddenSelections" /> + <menu_item_check.on_click + function="Tools.ShowHiddenSelection" /> + </menu_item_check> + <menu_item_check + label="Show Light Radius for Selection" + layout="topleft" + name="Show Light Radius for Selection"> + <menu_item_check.on_check + control="RenderLightRadius" /> + <menu_item_check.on_click + function="Tools.ShowSelectionLightRadius" /> + </menu_item_check> + <menu_item_check + label="Show Selection Beam" + layout="topleft" + name="Show Selection Beam"> + <menu_item_check.on_check + control="ShowSelectionBeam" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="ShowSelectionBeam" /> + </menu_item_check> + </menu> + <menu + create_jump_keys="true" + label="Grid" + layout="topleft" + name="Grid" + tear_off="true"> + <menu_item_check + label="Snap to Grid" + layout="topleft" + name="Snap to Grid" + shortcut="G"> + <menu_item_check.on_check + control="SnapEnabled" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="SnapEnabled" /> + <menu_item_check.on_enable + function="Tools.EnableToolNotPie" /> + </menu_item_check> + <menu_item_call + label="Snap Object XY to Grid" + layout="topleft" + name="Snap Object XY to Grid" + shortcut="shift|X"> + <menu_item_call.on_click + function="Tools.SnapObjectXY" /> + <menu_item_call.on_enable + function="Tools.EnableToolNotPie" /> + </menu_item_call> + <menu_item_call + label="Use Selection for Grid" + layout="topleft" + name="Use Selection for Grid" + shortcut="shift|G"> + <menu_item_call.on_click + function="Tools.UseSelectionForGrid" /> + <menu_item_call.on_enable + function="SomethingSelected" /> + </menu_item_call> + <menu_item_call + label="Grid Options" + layout="topleft" + name="Grid Options" + shortcut="control|shift|B"> + <menu_item_call.on_click + function="ShowFloater" + parameter="grid options" /> + <menu_item_call.on_enable + function="Tools.EnableToolNotPie" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Beacons" + layout="topleft" + name="Beacons" + tear_off="true"> + <menu_item_check + label="Beacons" + layout="topleft" + name="beacons" + shortcut="control|alt|shift|N"> + <menu_item_check.on_check + function="FloaterVisible" + parameter="beacons" /> + <menu_item_check.on_click + function="ShowFloater" + parameter="beacons" /> + </menu_item_check> + <menu_item_check + label="Cheesy Beacon" + layout="topleft" + name="Cheesy Beacon"> + <menu_item_check.on_check + function="CheckControl" + parameter="CheesyBeacon" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="CheesyBeacon" /> + </menu_item_check> + </menu> + <menu + create_jump_keys="true" + label="Land" + layout="topleft" + name="Land" + tear_off="true"> + <menu_item_check + label="Property Lines" + layout="topleft" + name="Property Lines" + shortcut="control|alt|shift|P"> + <menu_item_check.on_check + control="ShowPropertyLines" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="ShowPropertyLines" /> + </menu_item_check> + <menu_item_check + label="Land Owners" + layout="topleft" + name="Land Owners"> + <menu_item_check.on_check + control="ShowParcelOwners" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="ShowParcelOwners" /> + </menu_item_check> + <menu_item_check + label="Ban Lines" + layout="topleft" + name="Ban Lines"> + <menu_item_check.on_check + control="ShowBanLines" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="ShowBanLines" /> + </menu_item_check> + </menu> + </menu> + <menu + create_jump_keys="true" + label="Actions" + layout="topleft" + name="Actions" + tear_off="true"> + <menu_item_call + label="Link" + layout="topleft" + name="Link" + shortcut="control|L"> + <menu_item_call.on_click + function="Tools.Link" /> + <menu_item_call.on_enable + function="Tools.EnableLink" /> + </menu_item_call> + <menu_item_call + label="Unlink" + layout="topleft" + name="Unlink" + shortcut="control|shift|L"> + <menu_item_call.on_click + function="Tools.Unlink" /> + <menu_item_call.on_enable + function="Tools.EnableUnlink" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Focus on Selection" + layout="topleft" + name="Focus on Selection" + shortcut="H"> + <menu_item_call.on_click + function="Tools.LookAtSelection" + parameter="focus" /> + <menu_item_call.on_enable + function="Tools.SomethingSelectedNoHUD" /> + </menu_item_call> + <menu_item_call + label="Zoom to Selection" + layout="topleft" + name="Zoom to Selection" + shortcut="shift|H"> + <menu_item_call.on_click + function="Tools.LookAtSelection" + parameter="zoom" /> + <menu_item_call.on_enable + function="Tools.SomethingSelectedNoHUD" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Buy Object" + layout="topleft" + name="Menu Object Take" + visible="false"> + <menu_item_call.on_click + function="Tools.BuyOrTake" /> + <menu_item_call.on_enable + function="Tools.EnableBuyOrTake" + parameter="Buy,Take" /> + </menu_item_call> + <menu_item_call + label="Take Copy" + layout="topleft" + name="Take Copy"> + <menu_item_call.on_click + function="Tools.TakeCopy" /> + <menu_item_call.on_enable + function="Tools.EnableTakeCopy" /> + </menu_item_call> + <menu_item_call + label="Save Object Back to My Inventory" + layout="topleft" + name="Save Object Back to My Inventory"> + <menu_item_call.on_click + function="Tools.SaveToInventory" /> + <menu_item_call.on_enable + function="Tools.EnableSaveToInventory" /> + </menu_item_call> + <menu_item_call + label="Save Object Back to Object Contents" + layout="topleft" + name="Save Object Back to Object Contents"> + <menu_item_call.on_click + function="Tools.SaveToObjectInventory" /> + <menu_item_call.on_enable + function="Tools.EnableSaveToObjectInventory" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu + create_jump_keys="true" + label="Recompile Scripts in Selection" + layout="topleft" + name="Recompile Scripts in Selection" + tear_off="true"> + <menu_item_call + label="Mono" + layout="topleft" + name="Mono"> + <menu_item_call.on_click + function="Tools.SelectedScriptAction" + parameter="compile mono" /> + <menu_item_call.on_enable + function="EditableSelectedMono" /> + </menu_item_call> + <menu_item_call + label="LSL" + layout="topleft" + name="LSL"> + <menu_item_call.on_click + function="Tools.SelectedScriptAction" + parameter="compile lsl" /> + <menu_item_call.on_enable + function="EditableSelected" /> + </menu_item_call> + </menu> + <menu_item_call + label="Reset Scripts in Selection" + layout="topleft" + name="Reset Scripts in Selection"> + <menu_item_call.on_click + function="Tools.SelectedScriptAction" + parameter="reset" /> + <menu_item_call.on_enable + function="EditableSelected" /> + </menu_item_call> + <menu_item_call + label="Set Scripts to Running in Selection" + layout="topleft" + name="Set Scripts to Running in Selection"> + <menu_item_call.on_click + function="Tools.SelectedScriptAction" + parameter="start" /> + <menu_item_call.on_enable + function="EditableSelected" /> + </menu_item_call> + <menu_item_call + label="Set Scripts to Not Running in Selection" + layout="topleft" + name="Set Scripts to Not Running in Selection"> + <menu_item_call.on_click + function="Tools.SelectedScriptAction" + parameter="stop" /> + <menu_item_call.on_enable + function="EditableSelected" /> + </menu_item_call> + </menu> + </menu> + <menu + label="Geek" + layout="topleft" + name="Advanced" + tear_off="true" + visible="false"> + <menu + label="Shortcuts" + layout="topleft" + name="Shortcuts" + tear_off="true" + visible="false"> + <menu_item_call + enabled="false" + label="Release Keys" + layout="topleft" + name="Release Keys"> + <menu_item_call.on_click + function="Tools.ReleaseKeys" + parameter="" /> + <menu_item_call.on_enable + function="Tools.EnableReleaseKeys" + parameter="" /> + </menu_item_call> + <menu_item_call + label="Set UI Size to Default" + layout="topleft" + name="Set UI Size to Default"> + <menu_item_call.on_click + function="View.DefaultUISize" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_check + label="Always Run" + layout="topleft" + name="Always Run" + shortcut="control|R"> + <menu_item_check.on_check + function="World.CheckAlwaysRun" /> + <menu_item_check.on_click + function="World.AlwaysRun" /> + </menu_item_check> + <menu_item_check + control_name="FlyBtnState" + label="Fly" + layout="topleft" + name="Fly" + shortcut="Home"> + <menu_item_check.on_click + function="Agent.toggleFlying" /> + <menu_item_check.on_enable + function="Agent.enableFlying" /> + </menu_item_check> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Close Window" + layout="topleft" + name="Close Window" + shortcut="control|W"> + <menu_item_call.on_click + function="File.CloseWindow" /> + <menu_item_call.on_enable + function="File.EnableCloseWindow" /> + </menu_item_call> + <menu_item_call + label="Close All Windows" + layout="topleft" + name="Close All Windows" + shortcut="control|shift|W"> + <menu_item_call.on_click + function="File.CloseAllWindows" /> + <menu_item_call.on_enable + function="File.EnableCloseAllWindows" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Snapshot to Disk" + layout="topleft" + name="Snapshot to Disk" + shortcut="control|`" + use_mac_ctrl="true"> + <menu_item_call.on_click + function="File.TakeSnapshotToDisk" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Mouselook" + layout="topleft" + name="Mouselook" + shortcut="M"> + <menu_item_call.on_click + function="View.Mouselook" /> + <menu_item_call.on_enable + function="View.EnableMouselook" /> + </menu_item_call> + <menu_item_check + label="Joystick Flycam" + layout="topleft" + name="Joystick Flycam" + shortcut="alt|shift|F"> + <menu_item_check.on_check + function="View.CheckJoystickFlycam" /> + <menu_item_check.on_click + function="View.JoystickFlycam" /> + <menu_item_check.on_enable + function="View.EnableJoystickFlycam" /> + </menu_item_check> + <menu_item_call + label="Reset View" + layout="topleft" + name="Reset View" + shortcut="Esc"> + <menu_item_call.on_click + function="View.ResetView" /> + </menu_item_call> + <menu_item_call + label="Look at Last Chatter" + layout="topleft" + name="Look at Last Chatter" + shortcut="control|\"> + <menu_item_call.on_click + function="View.LookAtLastChatter" /> + <menu_item_call.on_enable + function="View.EnableLastChatter" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu + create_jump_keys="true" + label="Select Tool" + layout="topleft" + name="Select Tool" + tear_off="true"> + <menu_item_call + label="Focus" + layout="topleft" + name="Focus" + shortcut="control|1"> + <menu_item_call.on_click + function="Tools.SelectTool" + parameter="focus" /> + </menu_item_call> + <menu_item_call + label="Move" + layout="topleft" + name="Move" + shortcut="control|2"> + <menu_item_call.on_click + function="Tools.SelectTool" + parameter="move" /> + </menu_item_call> + <menu_item_call + label="Edit" + layout="topleft" + name="Edit" + shortcut="control|3"> + <menu_item_call.on_click + function="Tools.SelectTool" + parameter="edit" /> + </menu_item_call> + <menu_item_call + label="Create" + layout="topleft" + name="Create" + shortcut="control|4"> + <menu_item_call.on_click + function="Tools.SelectTool" + parameter="create" /> + </menu_item_call> + <menu_item_call + label="Land" + layout="topleft" + name="Land" + shortcut="control|5"> + <menu_item_call.on_click + function="Tools.SelectTool" + parameter="land" /> + </menu_item_call> + </menu> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Zoom In" + layout="topleft" + name="Zoom In" + shortcut="control|0"> + <menu_item_call.on_click + function="View.ZoomIn" /> + </menu_item_call> + <menu_item_call + label="Zoom Default" + layout="topleft" + name="Zoom Default" + shortcut="control|9"> + <menu_item_call.on_click + function="View.ZoomDefault" /> + </menu_item_call> + <menu_item_call + label="Zoom Out" + layout="topleft" + name="Zoom Out" + shortcut="control|8"> + <menu_item_call.on_click + function="View.ZoomOut" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Toggle Fullscreen" + layout="topleft" + name="Toggle Fullscreen" + shortcut="alt|Enter"> + <menu_item_call.on_click + function="View.Fullscreen" /> + </menu_item_call> + </menu> + <menu_item_check + label="Go Away/AFK When Idle" + layout="topleft" + name="Go Away/AFK When Idle"> + <menu_item_check.on_check + function="CheckControl" + parameter="AllowIdleAFK" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="AllowIdleAFK" /> + </menu_item_check> + <menu_item_call + label="Stop Animating My Avatar" + layout="topleft" + name="Stop Animating My Avatar"> + <menu_item_call.on_click + function="Tools.StopAllAnimations" /> + </menu_item_call> + <menu_item_call + label="Rebake Texture" + layout="topleft" + name="Rebake Texture" + shortcut="control|alt|R"> + <menu_item_call.on_click + function="Advanced.RebakeTextures" /> + </menu_item_call> + <menu_item_check + label="Limit Select Distance" + layout="topleft" + name="Limit Select Distance"> + <menu_item_check.on_check + function="CheckControl" + parameter="LimitSelectDistance" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="LimitSelectDistance" /> + </menu_item_check> + <menu_item_check + label="Disable Camera Constraints" + layout="topleft" + name="Disable Camera Distance"> + <menu_item_check.on_check + function="CheckControl" + parameter="DisableCameraConstraints" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="DisableCameraConstraints" /> + </menu_item_check> + <menu_item_separator + layout="topleft" /> + <menu_item_check + label="High-res Snapshot" + layout="topleft" + name="HighResSnapshot"> + <menu_item_check.on_check + function="CheckControl" + parameter="HighResSnapshot" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="HighResSnapshot" /> + </menu_item_check> + <menu_item_check + label="Quiet Snapshots to Disk" + layout="topleft" + name="QuietSnapshotsToDisk"> + <menu_item_check.on_check + function="CheckControl" + parameter="QuietSnapshotsToDisk" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="QuietSnapshotsToDisk" /> + </menu_item_check> + <menu_item_check + label="Compress Snapshots to Disk" + layout="topleft" + name="CompressSnapshotsToDisk"> + <menu_item_check.on_check + function="CheckControl" + parameter="CompressSnapshotsToDisk" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="CompressSnapshotsToDisk" /> + </menu_item_check> + <menu_item_call + label="Save Texture As..." + layout="topleft" + name="Save Texture As"> + <menu_item_call.on_click + function="File.SaveTexture" /> + <menu_item_call.on_enable + function="File.EnableSaveAs" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu + create_jump_keys="true" + label="Environment Settings" + layout="topleft" + name="Environment Settings" + tear_off="true"> + <menu_item_call + label="Sunrise" + layout="topleft" + name="Sunrise"> + <menu_item_call.on_click + function="World.EnvSettings" + parameter="sunrise" /> + </menu_item_call> + <menu_item_call + label="Midday" + layout="topleft" + name="Noon" + shortcut="control|shift|Y"> + <menu_item_call.on_click + function="World.EnvSettings" + parameter="noon" /> + </menu_item_call> + <menu_item_call + label="Sunset" + layout="topleft" + name="Sunset" + shortcut="control|shift|N"> + <menu_item_call.on_click + function="World.EnvSettings" + parameter="sunset" /> + </menu_item_call> + <menu_item_call + label="Midnight" + layout="topleft" + name="Midnight"> + <menu_item_call.on_click + function="World.EnvSettings" + parameter="midnight" /> + </menu_item_call> + <menu_item_call + label="Revert to Region Default" + layout="topleft" + name="Revert to Region Default"> + <menu_item_call.on_click + function="World.EnvSettings" + parameter="default" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Environment Editor" + layout="topleft" + name="Environment Editor"> + <menu_item_call.on_click + function="World.EnvSettings" + parameter="editor" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Performance Tools" + layout="topleft" + name="Performance Tools" + tear_off="true"> + <menu_item_call + label="Lag Meter" + layout="topleft" + name="Lag Meter"> + <menu_item_call.on_click + function="ShowFloater" + parameter="lag meter" /> + </menu_item_call> + <menu_item_check + label="Statistics Bar" + layout="topleft" + name="Statistics Bar" + shortcut="control|shift|1"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="stats" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="stats" /> + </menu_item_check> + </menu> + <menu + create_jump_keys="true" + label="Highlighting and Visibility" + layout="topleft" + name="Highlighting and Visibility" + tear_off="true"> + <menu_item_check + label="Highlight Transparent" + layout="topleft" + name="Highlight Transparent" + shortcut="control|alt|T"> + <menu_item_check.on_check + function="View.CheckHighlightTransparent" /> + <menu_item_check.on_click + function="View.HighlightTransparent" /> + </menu_item_check> + <menu_item_check + label="Hide Particles" + layout="topleft" + name="Hide Particles" + shortcut="control|alt|shift|="> + <menu_item_check.on_check + function="View.CheckRenderType" + parameter="hideparticles" /> + <menu_item_check.on_click + function="View.ToggleRenderType" + parameter="hideparticles" /> + </menu_item_check> + <menu_item_check + label="Show HUD Attachments" + layout="topleft" + name="Show HUD Attachments" + shortcut="alt|shift|H"> + <menu_item_check.on_check + function="View.CheckHUDAttachments" /> + <menu_item_check.on_click + function="View.ShowHUDAttachments" /> + </menu_item_check> + <menu_item_check + label="Hide Selected" + layout="topleft" + name="Hide Selected"> + <menu_item_check.on_check + function="CheckControl" + parameter="HideSelectedObjects" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="HideSelectedObjects" /> + </menu_item_check> + <menu_item_check + label="Show Mouselook Crosshairs" + layout="topleft" + name="ShowCrosshairs"> + <menu_item_check.on_check + function="CheckControl" + parameter="ShowCrosshairs" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="ShowCrosshairs" /> + </menu_item_check> + </menu> + <menu + create_jump_keys="true" + label="Hover Tips" + layout="topleft" + name="Hover Tips" + tear_off="true"> + <menu_item_check + label="Show Tips" + layout="topleft" + name="Show Tips" + shortcut="control|shift|T"> + <menu_item_check.on_check + function="View.CheckShowHoverTips" /> + <menu_item_check.on_click + function="View.ShowHoverTips" /> + </menu_item_check> + <menu_item_separator + layout="topleft" /> + <menu_item_check + label="Land Tips" + layout="topleft" + name="Land Tips"> + <menu_item_check.on_check + control="ShowLandHoverTip" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="ShowLandHoverTip" /> + <menu_item_check.on_enable + function="View.CheckShowHoverTips" /> + </menu_item_check> + <menu_item_check + label="Tips On All Objects" + layout="topleft" + name="Tips On All Objects"> + <menu_item_check.on_check + control="ShowAllObjectHoverTip" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="ShowAllObjectHoverTip" /> + <menu_item_check.on_enable + function="View.CheckShowHoverTips" /> + </menu_item_check> + </menu> + <menu_item_separator + layout="topleft" /> + <menu_item_check + label="Run Multiple Threads" + layout="topleft" + name="Run Multiple Threads"> + <menu_item_check.on_check + function="CheckControl" + parameter="RunMultipleThreads" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="RunMultipleThreads" /> + </menu_item_check> + <menu_item_separator + layout="topleft" /> + <menu + create_jump_keys="true" + label="Rendering Types" + layout="topleft" + name="Rendering Types" + tear_off="true"> + <menu_item_check + label="Simple" + layout="topleft" + name="Simple" + shortcut="control|alt|shift|1"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="simple" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="simple" /> + </menu_item_check> + <menu_item_check + label="Alpha" + layout="topleft" + name="Alpha" + shortcut="control|alt|shift|2"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="alpha" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="alpha" /> + </menu_item_check> + <menu_item_check + label="Tree" + layout="topleft" + name="Tree" + shortcut="control|alt|shift|3"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="tree" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="tree" /> + </menu_item_check> + <menu_item_check + label="Character" + layout="topleft" + name="Character" + shortcut="control|alt|shift|4"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="character" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="character" /> + </menu_item_check> + <menu_item_check + label="SurfacePath" + layout="topleft" + name="SurfacePath" + shortcut="control|alt|shift|5"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="surfacePath" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="surfacePath" /> + </menu_item_check> + <menu_item_check + label="Sky" + layout="topleft" + name="Sky" + shortcut="control|alt|shift|6"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="sky" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="sky" /> + </menu_item_check> + <menu_item_check + label="Water" + layout="topleft" + name="Water" + shortcut="control|alt|shift|7"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="water" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="water" /> + </menu_item_check> + <menu_item_check + label="Ground" + layout="topleft" + name="Ground" + shortcut="control|alt|shift|8"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="ground" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="ground" /> + </menu_item_check> + <menu_item_check + label="Volume" + layout="topleft" + name="Volume" + shortcut="control|alt|shift|9"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="volume" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="volume" /> + </menu_item_check> + <menu_item_check + label="Grass" + layout="topleft" + name="Grass" + shortcut="control|alt|shift|0"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="grass" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="grass" /> + </menu_item_check> + <menu_item_check + label="Clouds" + layout="topleft" + name="Clouds" + shortcut="control|alt|shift|-"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="clouds" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="clouds" /> + </menu_item_check> + <menu_item_check + label="Particles" + layout="topleft" + name="Particles" + shortcut="control|alt|shift|="> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="particles" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="particles" /> + </menu_item_check> + <menu_item_check + label="Bump" + layout="topleft" + name="Bump" + shortcut="control|alt|shift|\"> + <menu_item_check.on_check + function="Advanced.CheckRenderType" + parameter="bump" /> + <menu_item_check.on_click + function="Advanced.ToggleRenderType" + parameter="bump" /> + </menu_item_check> + </menu> + <menu + create_jump_keys="true" + label="Rendering Features" + layout="topleft" + name="Rendering Features" + tear_off="true"> + <menu_item_check + label="UI" + layout="topleft" + name="UI" + shortcut="control|alt|F1"> + <menu_item_check.on_check + function="Advanced.CheckFeature" + parameter="ui" /> + <menu_item_check.on_click + function="Advanced.ToggleFeature" + parameter="ui" /> + </menu_item_check> + <menu_item_check + label="Selected" + layout="topleft" + name="Selected" + shortcut="control|alt|F2"> + <menu_item_check.on_check + function="Advanced.CheckFeature" + parameter="selected" /> + <menu_item_check.on_click + function="Advanced.ToggleFeature" + parameter="selected" /> + </menu_item_check> + <menu_item_check + label="Highlighted" + layout="topleft" + name="Highlighted" + shortcut="control|alt|F3"> + <menu_item_check.on_check + function="Advanced.CheckFeature" + parameter="highlighted" /> + <menu_item_check.on_click + function="Advanced.ToggleFeature" + parameter="highlighted" /> + </menu_item_check> + <menu_item_check + label="Dynamic Textures" + layout="topleft" + name="Dynamic Textures" + shortcut="control|alt|F4"> + <menu_item_check.on_check + function="Advanced.CheckFeature" + parameter="dynamic textures" /> + <menu_item_check.on_click + function="Advanced.ToggleFeature" + parameter="dynamic textures" /> + </menu_item_check> + <menu_item_check + label="Foot Shadows" + layout="topleft" + name="Foot Shadows" + shortcut="control|alt|F5"> + <menu_item_check.on_check + function="Advanced.CheckFeature" + parameter="foot shadows" /> + <menu_item_check.on_click + function="Advanced.ToggleFeature" + parameter="foot shadows" /> + </menu_item_check> + <menu_item_check + label="Fog" + layout="topleft" + name="Fog" + shortcut="control|alt|F6"> + <menu_item_check.on_check + function="Advanced.CheckFeature" + parameter="fog" /> + <menu_item_check.on_click + function="Advanced.ToggleFeature" + parameter="fog" /> + </menu_item_check> + <menu_item_check + label="Test FRInfo" + layout="topleft" + name="Test FRInfo" + shortcut="control|alt|F8"> + <menu_item_check.on_check + function="Advanced.CheckFeature" + parameter="fr info" /> + <menu_item_check.on_click + function="Advanced.ToggleFeature" + parameter="fr info" /> + </menu_item_check> + <menu_item_check + label="Flexible Objects" + layout="topleft" + name="Flexible Objects" + shortcut="control|alt|F9"> + <menu_item_check.on_check + function="Advanced.CheckFeature" + parameter="flexible" /> + <menu_item_check.on_click + function="Advanced.ToggleFeature" + parameter="flexible" /> + </menu_item_check> + </menu> + <menu_item_separator + layout="topleft" /> + <menu + create_jump_keys="true" + label="Recorder" + layout="topleft" + name="Recorder" + tear_off="true"> + <menu_item_call + label="Start Playback" + layout="topleft" + name="Start Playback"> + <menu_item_call.on_click + function="Advanced.AgentPilot" + parameter="start playback" /> + </menu_item_call> + <menu_item_call + label="Stop Playback" + layout="topleft" + name="Stop Playback"> + <menu_item_call.on_click + function="Advanced.AgentPilot" + parameter="stop playback" /> + </menu_item_call> + <menu_item_check + label="Loop Playback" + layout="topleft" + name="Loop Playback"> + <menu_item_check.on_check + function="Advanced.CheckAgentPilotLoop" + parameter="loopPlayback" /> + <menu_item_check.on_click + function="Advanced.ToggleAgentPilotLoop" /> + </menu_item_check> + <menu_item_call + label="Start Record" + layout="topleft" + name="Start Record"> + <menu_item_call.on_click + function="Advanced.AgentPilot" + parameter="start record" /> + </menu_item_call> + <menu_item_call + label="Stop Record" + layout="topleft" + name="Stop Record"> + <menu_item_call.on_click + function="Advanced.AgentPilot" + parameter="stop record" /> + </menu_item_call> + </menu> + <menu_item_call + label="Dump Scripted Camera" + layout="topleft" + name="Dump Scripted Camera"> + <menu_item_call.on_click + function="Advanced.DumpScriptedCamera" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Clear Group Cache" + layout="topleft" + name="ClearGroupCache"> + <menu_item_call.on_click + function="Advanced.ClearGroupCache" + parameter="ClearGroupCache" /> + </menu_item_call> + <menu_item_check + label="Enable Lip Sync(Beta)" + layout="topleft" + name="Enable Lip Sync(Beta)"> + <menu_item_check.on_check + function="CheckControl" + parameter="LipSyncEnabled" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="LipSyncEnabled" /> + </menu_item_check> + <menu_item_check + label="Tap-Tap-Hold to Run" + layout="topleft" + name="Tap-Tap-Hold to Run"> + <menu_item_check.on_check + function="Advanced.CheckAllowTapTapHoldRun" + parameter="TapTapHoldRun" /> + <menu_item_check.on_click + function="Advanced.ToggleAllowTapTapHoldRun" /> + </menu_item_check> + <menu_item_check + label="Mouse Smoothing" + layout="topleft" + name="Mouse Smoothing"> + <menu_item_check.on_check + function="CheckControl" + parameter="MouseSmooth" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="MouseSmooth" /> + </menu_item_check> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Debug Settings" + layout="topleft" + name="Debug Settings"> + <menu_item_call.on_click + function="Advanced.ShowDebugSettings" + parameter="all" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Debug" + layout="topleft" + name="Debug" + tear_off="true" + visible="false"> + <menu + create_jump_keys="true" + label="Consoles" + layout="topleft" + name="Consoles" + tear_off="true"> + <menu_item_check + label="Texture Console" + layout="topleft" + name="Texture Console" + shortcut="control|shift|3"> + <menu_item_check.on_check + function="Advanced.CheckConsole" + parameter="texture" /> + <menu_item_check.on_click + function="Advanced.ToggleConsole" + parameter="texture" /> + </menu_item_check> + <menu_item_check + label="Debug Console" + layout="topleft" + name="Debug Console" + shortcut="control|shift|4"> + <menu_item_check.on_check + function="Advanced.CheckConsole" + parameter="debug" /> + <menu_item_check.on_click + function="Advanced.ToggleConsole" + parameter="debug" /> + </menu_item_check> + <menu_item_check + label="Fast Timers" + layout="topleft" + name="Fast Timers" + shortcut="control|shift|9"> + <menu_item_check.on_check + function="Advanced.CheckConsole" + parameter="fast timers" /> + <menu_item_check.on_click + function="Advanced.ToggleConsole" + parameter="fast timers" /> + </menu_item_check> + <menu_item_check + label="Memory" + layout="topleft" + name="Memory" + shortcut="control|shift|0"> + <menu_item_check.on_check + function="Advanced.CheckConsole" + parameter="memory view" /> + <menu_item_check.on_click + function="Advanced.ToggleConsole" + parameter="memory view" /> + </menu_item_check> + <menu_item_check + label="Notifications Console" + layout="topleft" + name="Notifications" + shortcut="control|shift|5"> + <menu_item_check.on_check + function="Advanced.CheckConsole" + parameter="notifications" /> + <menu_item_check.on_click + function="Advanced.ToggleConsole" + parameter="notifications" /> + </menu_item_check> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Region Info to Debug Console" + layout="topleft" + name="Region Info to Debug Console"> + <menu_item_call.on_click + function="Advanced.DumpInfoToConsole" + parameter="region" /> + </menu_item_call> + <menu_item_call + label="Group Info to Debug Console" + layout="topleft" + name="Group Info to Debug Console"> + <menu_item_call.on_click + function="Advanced.DumpInfoToConsole" + parameter="group" /> + </menu_item_call> + <menu_item_call + label="Capabilities Info to Debug Console" + layout="topleft" + name="Capabilities Info to Debug Console"> + <menu_item_call.on_click + function="Advanced.DumpInfoToConsole" + parameter="capabilities" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Debugging" + layout="topleft" + name="Force Errors" + tear_off="true"> + <menu_item_call + label="Force Breakpoint" + layout="topleft" + name="Force Breakpoint" + shortcut="control|alt|shift|B"> + <menu_item_call.on_click + function="Advanced.ForceErrorBreakpoint" /> + </menu_item_call> + <menu_item_call + label="Force LLError And Crash" + layout="topleft" + name="Force LLError And Crash"> + <menu_item_call.on_click + function="Advanced.ForceErrorLlerror" /> + </menu_item_call> + <menu_item_call + label="Force Bad Memory Access" + layout="topleft" + name="Force Bad Memory Access"> + <menu_item_call.on_click + function="Advanced.ForceErrorBadMemoryAccess" /> + </menu_item_call> + <menu_item_call + label="Force Infinite Loop" + layout="topleft" + name="Force Infinite Loop"> + <menu_item_call.on_click + function="Advanced.ForceErrorInfiniteLoop" /> + </menu_item_call> + <menu_item_call + label="Force Driver Crash" + layout="topleft" + name="Force Driver Carsh"> + <menu_item_call.on_click + function="Advanced.ForceErrorDriverCrash" /> + </menu_item_call> + <menu_item_call + label="Force Software Exception" + layout="topleft" + name="Force Software Exception"> + <menu_item_call.on_click + function="Advanced.ForceErrorSoftwareException" /> + </menu_item_call> + <menu_item_call + label="Force Disconnect Viewer" + layout="topleft" + name="Force Disconnect Viewer"> + <menu_item_call.on_click + function="Advanced.ForceErrorDisconnectViewer" /> + </menu_item_call> + </menu> + <menu_item_separator + layout="topleft" /> + <menu_item_check + label="Output Debug Minidump" + layout="topleft" + name="Output Debug Minidump"> + <menu_item_check.on_check + function="CheckControl" + parameter="SaveMinidump" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="SaveMinidump" /> + </menu_item_check> + <menu_item_call + label="Memory Leaking Simulation" + layout="topleft" + name="Memory Leaking Simulation"> + <menu_item_call.on_click + function="Advanced.MemoryLeakingSimulation" + parameter="" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu + create_jump_keys="true" + label="Render Tests" + layout="topleft" + name="Render Tests" + tear_off="true"> + <menu_item_check + label="Camera Offset" + layout="topleft" + name="Camera Offset"> + <menu_item_check.on_check + function="CheckControl" + parameter="CameraOffset" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="CameraOffset" /> + </menu_item_check> + <menu_item_check + label="Randomize Framerate" + layout="topleft" + name="Randomize Framerate"> + <menu_item_check.on_check + function="Advanced.CheckRandomizeFramerate" + parameter="Randomize Framerate" /> + <menu_item_check.on_click + function="Advanced.ToggleRandomizeFramerate" /> + </menu_item_check> + <menu_item_check + label="Periodic Slow Frame" + layout="topleft" + name="Periodic Slow Frame"> + <menu_item_check.on_check + function="Advanced.CheckPeriodicSlowFrame" + parameter="points" /> + <menu_item_check.on_click + function="Advanced.TogglePeriodicSlowFrame" + parameter="points" /> + </menu_item_check> + <menu_item_check + label="Frame Test" + layout="topleft" + name="Frame Test"> + <menu_item_check.on_check + function="Advanced.CheckFrameTest" + parameter="Frame Test" /> + <menu_item_check.on_click + function="Advanced.ToggleFrameTest" /> + </menu_item_check> + </menu> + <menu_item_separator + layout="topleft" /> + <menu + create_jump_keys="true" + label="Display Info" + layout="topleft" + name="Display Info" + tear_off="true"> + <menu_item_check + label="Show Time" + layout="topleft" + name="Show Time"> + <menu_item_check.on_check + function="CheckControl" + parameter="DebugShowTime" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="DebugShowTime" /> + </menu_item_check> + <menu_item_check + label="Show Render Info" + layout="topleft" + name="Show Render Info"> + <menu_item_check.on_check + function="CheckControl" + parameter="DebugShowRenderInfo" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="DebugShowRenderInfo" /> + </menu_item_check> + <menu_item_check + label="Show Matrices" + layout="topleft" + name="Show Matrices"> + <menu_item_check.on_check + function="CheckControl" + parameter="DebugShowRenderMatrices" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="DebugShowRenderMatrices" /> + </menu_item_check> + <menu_item_check + label="Show Color Under Cursor" + layout="topleft" + name="Show Color Under Cursor"> + <menu_item_check.on_check + function="CheckControl" + parameter="DebugShowColor" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="DebugShowColor" /> + </menu_item_check> + </menu> + <menu_item_separator + layout="topleft" /> + <menu + create_jump_keys="true" + label="Network" + layout="topleft" + name="Network" + tear_off="true"> + <menu_item_call + label="Enable Message Log" + layout="topleft" + name="Enable Message Log"> + <menu_item_call.on_click + function="Advanced.EnableMessageLog" /> + </menu_item_call> + <menu_item_call + label="Disable Message Log" + layout="topleft" + name="Disable Message Log"> + <menu_item_call.on_click + function="Advanced.DisableMessageLog" /> + </menu_item_call> + <menu_item_check + label="Velocity Interpolate Objects" + layout="topleft" + name="Velocity Interpolate Objects"> + <menu_item_check.on_check + function="CheckControl" + parameter="VelocityInterpolate" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="VelocityInterpolate" /> + </menu_item_check> + <menu_item_check + label="Ping Interpolate Object Positions" + layout="topleft" + name="Ping Interpolate Object Positions"> + <menu_item_check.on_check + function="CheckControl" + parameter="PingInterpolate" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="PingInterpolate" /> + </menu_item_check> + <menu_item_call + label="Drop a Packet" + layout="topleft" + name="Drop a Packet" + shortcut="control|alt|L"> + <menu_item_call.on_click + function="Advanced.DropPacket" /> + </menu_item_call> + <menu_item_check + label="Show Updates" + layout="topleft" + name="Show Updates" + shortcut="control|alt|shift|U"> + <menu_item_check.on_check + function="Advanced.CheckShowObjectUpdates" + parameter="ObjectUpdates" /> + <menu_item_check.on_click + function="Advanced.ToggleShowObjectUpdates" /> + </menu_item_check> + </menu> + <menu_item_separator + layout="topleft" /> + <menu_item_check + label="View Admin Options" + layout="topleft" + name="View Admin Options" + shortcut="control|alt|V"> + <menu_item_check.on_check + function="Advanced.CheckViewAdminOptions" + parameter="ViewAdminOptions" /> + <menu_item_check.on_click + function="Advanced.ToggleViewAdminOptions" /> + </menu_item_check> + <menu_item_call + label="Request Admin Status" + layout="topleft" + name="Request Admin Options" + shortcut="control|alt|G"> + <menu_item_call.on_click + function="Advanced.RequestAdminStatus" /> + </menu_item_call> + <menu_item_call + label="Leave Admin Status" + layout="topleft" + name="Leave Admin Options" + shortcut="control|alt|shift|G"> + <menu_item_call.on_click + function="Advanced.LeaveAdminStatus" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Develop" + layout="topleft" + name="Develop" + tear_off="true" + visible="false"> + <menu + create_jump_keys="true" + label="HUD Info" + layout="topleft" + name="HUD Info" + tear_off="true"> + <menu_item_check + label="Camera" + layout="topleft" + name="Camera"> + <menu_item_check.on_check + function="Advanced.CheckHUDInfo" + parameter="camera" /> + <menu_item_check.on_click + function="Advanced.ToggleHUDInfo" + parameter="camera" /> + </menu_item_check> + <menu_item_check + label="Wind" + layout="topleft" + name="Wind"> + <menu_item_check.on_check + function="Advanced.CheckHUDInfo" + parameter="wind" /> + <menu_item_check.on_click + function="Advanced.ToggleHUDInfo" + parameter="wind" /> + </menu_item_check> + <menu_item_check + label="FOV" + layout="topleft" + name="FOV"> + <menu_item_check.on_check + function="Advanced.CheckHUDInfo" + parameter="fov" /> + <menu_item_check.on_click + function="Advanced.ToggleHUDInfo" + parameter="fov" /> + </menu_item_check> + </menu> + <menu + create_jump_keys="true" + label="Rendering" + layout="topleft" + name="Rendering" + tear_off="true"> + <menu + create_jump_keys="true" + label="Info Displays" + layout="topleft" + name="Info Displays" + tear_off="true"> + <menu_item_check + label="Verify" + layout="topleft" + name="Verify"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="verify" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="verify" /> + </menu_item_check> + <menu_item_check + label="BBoxes" + layout="topleft" + name="BBoxes"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="bboxes" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="bboxes" /> + </menu_item_check> + <menu_item_check + label="Points" + layout="topleft" + name="Points"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="points" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="points" /> + </menu_item_check> + <menu_item_check + label="Octree" + layout="topleft" + name="Octree"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="octree" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="octree" /> + </menu_item_check> + <menu_item_check + label="Shadow Frusta" + layout="topleft" + name="Shadow Frusta"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="shadow frusta" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="shadow frusta" /> + </menu_item_check> + <menu_item_check + label="Occlusion" + layout="topleft" + name="Occlusion"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="occlusion" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="occlusion" /> + </menu_item_check> + <menu_item_check + label="Render Batches" + layout="topleft" + name="Render Batches"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="render batches" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="render batches" /> + </menu_item_check> + <menu_item_check + label="Animated Textures" + layout="topleft" + name="Animated Textures"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="texture anim" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="texture anim" /> + </menu_item_check> + <menu_item_check + label="Texture Priority" + layout="topleft" + name="Texture Priority"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="texture priority" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="texture priority" /> + </menu_item_check> + <menu_item_check + label="Avatar Rendering Cost" + layout="topleft" + name="Avatar Rendering Cost"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="shame" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="shame" /> + </menu_item_check> + <menu_item_check + label="Texture Area (sqrt(A))" + layout="topleft" + name="Texture Area (sqrt(A))"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="texture area" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="texture area" /> + </menu_item_check> + <menu_item_check + label="Face Area (sqrt(A))" + layout="topleft" + name="Face Area (sqrt(A))"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="face area" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="face area" /> + </menu_item_check> + <menu_item_check + label="Lights" + layout="topleft" + name="Lights"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="lights" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="lights" /> + </menu_item_check> + <menu_item_check + label="Particles" + layout="topleft" + name="Particles"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="particles" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="particles" /> + </menu_item_check> + <menu_item_check + label="Composition" + layout="topleft" + name="Composition"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="composition" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="composition" /> + </menu_item_check> + <menu_item_check + label="Glow" + layout="topleft" + name="Glow"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="glow" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="glow" /> + </menu_item_check> + <menu_item_check + label="Show Depth Buffer" + layout="topleft" + name="Show Depth Buffer"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="ShowDepthBuffer" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="ShowDepthBuffer" /> + </menu_item_check> + <menu_item_check + label="Pick Render" + layout="topleft" + name="Pick Render"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="picking" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="picking" /> + </menu_item_check> + <menu_item_call + label="Vectorize Perf Test" + layout="topleft" + name="Vectorize Perf Test"> + <menu_item_call.on_click + function="Advanced.VectorizePerfTest" + parameter="" /> + </menu_item_call> + </menu> + <menu_item_check + label="Axes" + layout="topleft" + name="Axes"> + <menu_item_check.on_check + function="CheckControl" + parameter="ShowAxes" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="ShowAxes" /> + </menu_item_check> + <menu_item_check + label="Tangent Basis" + layout="topleft" + name="Tangent Basis"> + <menu_item_check.on_check + function="CheckControl" + parameter="ShowTangentBasis" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="ShowTangentBasis" /> + </menu_item_check> + <menu_item_call + label="Selected Texture Info Basis" + layout="topleft" + name="Selected Texture Info Basis" + shortcut="control|alt|shift|T"> + <menu_item_call.on_click + function="Advanced.SelectedTextureInfo" /> + </menu_item_call> + <menu_item_check + label="Wireframe" + layout="topleft" + name="Wireframe" + shortcut="control|shift|R"> + <menu_item_check.on_check + function="Advanced.CheckWireframe" + parameter="Wireframe" /> + <menu_item_check.on_click + function="Advanced.ToggleWireframe" /> + </menu_item_check> + <menu_item_check + label="Object-Object Occlusion" + layout="topleft" + name="Object-Object Occlusion" + shortcut="control|shift|O"> + <menu_item_check.on_check + function="CheckControl" + parameter="UseOcclusion" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="UseOcclusion" /> + <menu_item_check.on_enable + function="Advanced.EnableObjectObjectOcclusion" /> + </menu_item_check> + <menu_item_check + label="Debug GL" + layout="topleft" + name="Debug GL"> + <menu_item_check.on_check + function="CheckControl" + parameter="RenderDebugGL" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="RenderDebugGL" /> + </menu_item_check> + <menu_item_check + label="Debug Pipeline" + layout="topleft" + name="Debug Pipeline"> + <menu_item_check.on_check + function="CheckControl" + parameter="RenderDebugGL" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="RenderDebugGL" /> + </menu_item_check> + <menu_item_check + label="Fast Alpha" + layout="topleft" + name="Fast Alpha"> + <menu_item_check.on_check + function="CheckControl" + parameter="RenderDebugGL" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="RenderDebugGL" /> + </menu_item_check> + <menu_item_check + label="Animation Textures" + layout="topleft" + name="Animation Textures"> + <menu_item_check.on_check + function="CheckControl" + parameter="RenderDebugGL" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="RenderDebugGL" /> + </menu_item_check> + <menu_item_check + label="Disable Textures" + layout="topleft" + name="Disable Textures"> + <menu_item_check.on_check + function="Advanced.CheckDisableTextures" + parameter="DisableTextures" /> + <menu_item_check.on_click + function="Advanced.ToggleDisableTextures" /> + </menu_item_check> + <menu_item_check + label="Render Attached Lights" + layout="topleft" + name="Render Attached Lights"> + <menu_item_check.on_check + function="CheckControl" + parameter="RenderAttachedLights" /> + <menu_item_check.on_click + function="Advanced.HandleAttchedLightParticles" + parameter="RenderAttachedLights" /> + </menu_item_check> + <menu_item_check + label="Render Attached Particles" + layout="topleft" + name="Render Attached Particles"> + <menu_item_check.on_check + function="CheckControl" + parameter="RenderAttachedParticles" /> + <menu_item_check.on_click + function="Advanced.HandleAttchedLightParticles" + parameter="RenderAttachedParticles" /> + </menu_item_check> + </menu> + <menu + create_jump_keys="true" + label="World" + layout="topleft" + name="World" + tear_off="true"> + <menu_item_check + label="Sim Sun Override" + layout="topleft" + name="Sim Sun Override"> + <menu_item_check.on_check + function="CheckControl" + parameter="SkyOverrideSimSunPosition" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="SkyOverrideSimSunPosition" /> + </menu_item_check> + <menu_item_check + label="Cheesy Beacon" + layout="topleft" + name="Cheesy Beacon"> + <menu_item_check.on_check + function="CheckControl" + parameter="CheesyBeacon" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="CheesyBeacon" /> + </menu_item_check> + <menu_item_check + label="Fixed Weather" + layout="topleft" + name="Fixed Weather"> + <menu_item_check.on_check + function="CheckControl" + parameter="FixedWeather" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="FixedWeather" /> + </menu_item_check> + <menu_item_call + label="Dump Region Object Cache" + layout="topleft" + name="Dump Region Object Cache"> + <menu_item_call.on_click + function="Advanced.DumpRegionObjectCache" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="UI" + layout="topleft" + name="UI" + tear_off="true"> + <menu_item_check + label="New Bottom Bar" + layout="topleft" + name="New Bottom Bar"> + <menu_item_check.on_check + function="CheckControl" + parameter="BottomPanelNew" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="BottomPanelNew" /> + </menu_item_check> + <menu_item_call + label="Web Browser Test" + layout="topleft" + name="Web Browser Test"> + <menu_item_call.on_click + function="Advanced.WebBrowserTest" /> + </menu_item_call> + <menu_item_call + label="Buy Currency Test" + layout="topleft" + name="Buy Currency Test"> + <menu_item_call.on_click + function="Advanced.BuyCurrencyTest" /> + </menu_item_call> + <menu_item_call + label="UI/Color Settings" + layout="topleft" + name="UI/Color Settings"> + <menu_item_call.on_click + function="Advanced.ShowDebugSettings" + parameter="skin" /> + </menu_item_call> + <menu_item_check + label="Editable UI" + layout="topleft" + name="Editable UI"> + <menu_item_check.on_check + function="Advanced.CheckEditableUI" /> + <menu_item_check.on_click + function="Advanced.ToggleEditableUI" /> + </menu_item_check> + <menu_item_call + label="Dump SelectMgr" + layout="topleft" + name="Dump SelectMgr"> + <menu_item_call.on_click + function="Advanced.DumpSelectMgr" /> + </menu_item_call> + <menu_item_call + label="Dump Inventory" + layout="topleft" + name="Dump Inventory"> + <menu_item_call.on_click + function="Advanced.DumpInventory" /> + </menu_item_call> + <menu_item_call + label="Dump Focus Holder" + layout="topleft" + name="Dump Focus Holder" + shortcut="control|alt|F"> + <menu_item_call.on_click + function="Advanced.DumpFocusHolder" /> + </menu_item_call> + <menu_item_call + label="Print Selected Object Info" + layout="topleft" + name="Print Selected Object Info" + shortcut="control|shift|P"> + <menu_item_call.on_click + function="Advanced.PrintSelectedObjectInfo" /> + </menu_item_call> + <menu_item_call + label="Print Agent Info" + layout="topleft" + name="Print Agent Info" + shortcut="shift|P"> + <menu_item_call.on_click + function="Advanced.PrintAgentInfo" /> + </menu_item_call> + <menu_item_call + label="Memory Stats" + layout="topleft" + name="Memory Stats" + shortcut="control|alt|shift|M"> + <menu_item_call.on_click + function="Advanced.PrintTextureMemoryStats" /> + </menu_item_call> + <menu_item_check + label="Double-ClickAuto-Pilot" + layout="topleft" + name="Double-ClickAuto-Pilot"> + <menu_item_check.on_check + function="CheckControl" + parameter="DoubleClickAutoPilot" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="DoubleClickAutoPilot" /> + </menu_item_check> + <menu_item_separator + layout="topleft" /> + <menu_item_check + label="Debug SelectMgr" + layout="topleft" + name="Debug SelectMgr"> + <menu_item_check.on_check + function="CheckControl" + parameter="DebugSelectMgr" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="DebugSelectMgr" /> + </menu_item_check> + <menu_item_check + label="Debug Clicks" + layout="topleft" + name="Debug Clicks"> + <menu_item_check.on_check + function="Advanced.CheckDebugClicks" + parameter="DebugClicks" /> + <menu_item_check.on_click + function="Advanced.ToggleDebugClicks" + parameter="DebugClicks" /> + </menu_item_check> + <menu_item_check + label="Debug Views" + layout="topleft" + name="Debug Views"> + <menu_item_check.on_check + function="Advanced.CheckDebugViews" /> + <menu_item_check.on_click + function="Advanced.ToggleDebugViews" /> + </menu_item_check> + <menu_item_check + label="Debug Name Tooltips" + layout="topleft" + name="Debug Name Tooltips"> + <menu_item_check.on_check + function="Advanced.CheckXUINameTooltips" + parameter="XUINameTooltips" /> + <menu_item_check.on_click + function="Advanced.ToggleXUINameTooltips" /> + </menu_item_check> + <menu_item_check + label="Debug Mouse Events" + layout="topleft" + name="Debug Mouse Events"> + <menu_item_check.on_check + function="Advanced.CheckDebugMouseEvents" + parameter="MouseEvents" /> + <menu_item_check.on_click + function="Advanced.ToggleDebugMouseEvents" /> + </menu_item_check> + <menu_item_check + label="Debug Keys" + layout="topleft" + name="Debug Keys"> + <menu_item_check.on_check + function="Advanced.CheckDebugKeys" + parameter="DebugKeys" /> + <menu_item_check.on_click + function="Advanced.ToggleDebugKeys" /> + </menu_item_check> + <menu_item_check + label="Debug WindowProc" + layout="topleft" + name="Debug WindowProc"> + <menu_item_check.on_check + function="Advanced.CheckDebugWindowProc" + parameter="DebugWindowProc" /> + <menu_item_check.on_click + function="Advanced.ToggleDebugWindowProc" + parameter="DebugWindowProc" /> + </menu_item_check> + </menu> + <menu + create_jump_keys="true" + label="XUI" + layout="topleft" + name="XUI" + tear_off="true"> + <menu_item_call + label="Show Font Test" + layout="topleft" + name="Show Font Test"> + <menu_item_call.on_click + function="Advanced.ShowFontTest" /> + </menu_item_call> + <menu_item_call + label="Load from XML..." + layout="topleft" + name="Load from XML"> + <menu_item_call.on_click + function="Advanced.LoadUIFromXML" /> + </menu_item_call> + <menu_item_call + label="Save to XML..." + layout="topleft" + name="Save to XML"> + <menu_item_call.on_click + function="Advanced.SaveUIToXML" /> + </menu_item_call> + <menu_item_check + label="Show XUI Names" + layout="topleft" + name="Show XUI Names"> + <menu_item_check.on_check + function="Advanced.CheckXUINames" + parameter="showUIname" /> + <menu_item_check.on_click + function="Advanced.ToggleXUINames" /> + </menu_item_check> + </menu> + <menu + create_jump_keys="true" + label="Character" + layout="topleft" + name="Character" + tear_off="true"> + <menu + create_jump_keys="true" + label="Grab Baked Texture" + layout="topleft" + name="Grab Baked Texture" + tear_off="true"> + <menu_item_call + label="Iris" + layout="topleft" + name="Iris"> + <menu_item_call.on_click + function="Advanced.GrabBakedTexture" + parameter="iris" /> + <menu_item_call.on_enable + function="Advanced.EnableGrabBakedTexture" /> + </menu_item_call> + <menu_item_call + label="Head" + layout="topleft" + name="Head"> + <menu_item_call.on_click + function="Advanced.GrabBakedTexture" + parameter="head" /> + <menu_item_call.on_enable + function="Advanced.EnableGrabBakedTexture" /> + </menu_item_call> + <menu_item_call + label="Upper Body" + layout="topleft" + name="Upper Body"> + <menu_item_call.on_click + function="Advanced.GrabBakedTexture" + parameter="upper" /> + <menu_item_call.on_enable + function="Advanced.EnableGrabBakedTexture" /> + </menu_item_call> + <menu_item_call + label="Lower Body" + layout="topleft" + name="Lower Body"> + <menu_item_call.on_click + function="Advanced.GrabBakedTexture" + parameter="lower" /> + <menu_item_call.on_enable + function="Advanced.EnableGrabBakedTexture" /> + </menu_item_call> + <menu_item_call + label="Skirt" + layout="topleft" + name="Skirt"> + <menu_item_call.on_click + function="Advanced.GrabBakedTexture" + parameter="skirt" /> + <menu_item_call.on_enable + function="Advanced.EnableGrabBakedTexture" /> + </menu_item_call> + <menu_item_call + label="Skirt" + layout="topleft" + name="Hair"> + <menu_item_call.on_click + function="Advanced.GrabBakedTexture" + parameter="hair" /> + <menu_item_call.on_enable + function="Advanced.EnableGrabBakedTexture" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Character Tests" + layout="topleft" + name="Character Tests" + tear_off="true"> + <menu_item_call + label="Appearance To XML" + layout="topleft" + name="Appearance To XML"> + <menu_item_call.on_click + function="Advanced.AppearanceToXML" /> + </menu_item_call> + <menu_item_call + label="Toggle Character Geometry" + layout="topleft" + name="Toggle Character Geometry"> + <menu_item_call.on_click + function="Advanced.ToggleCharacterGeometry" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + <menu_item_call + label="Test Male" + layout="topleft" + name="Test Male"> + <menu_item_call.on_click + function="Advanced.TestMale" /> + </menu_item_call> + <menu_item_call + label="Test Female" + layout="topleft" + name="Test Female"> + <menu_item_call.on_click + function="Advanced.TestFemale" /> + </menu_item_call> + <menu_item_call + label="Toggle PG" + layout="topleft" + name="Toggle PG"> + <menu_item_call.on_click + function="Advanced.TogglePG" /> + </menu_item_call> + <menu_item_check + label="Allow Select Avatar" + layout="topleft" + name="Allow Select Avatar"> + <menu_item_check.on_check + function="CheckControl" + parameter="AllowSelectAvatar" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="AllowSelectAvatar" /> + </menu_item_check> + </menu> + <menu_item_call + label="Force Params to Default" + layout="topleft" + name="Force Params to Default"> + <menu_item_call.on_click + function="Advanced.ForceParamsToDefault" /> + </menu_item_call> + <menu_item_check + label="Animation Info" + layout="topleft" + name="Animation Info"> + <menu_item_check.on_check + function="Advanced.CheckAnimationInfo" + parameter="AnimationInfo" /> + <menu_item_check.on_click + function="Advanced.ToggleAnimationInfo" + parameter="" /> + </menu_item_check> + <menu_item_check + label="Slow Motion Animations" + layout="topleft" + name="Slow Motion Animations"> + <menu_item_check.on_check + function="CheckControl" + parameter="SlowMotionAnimation" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="SlowMotionAnimation" /> + </menu_item_check> + <menu_item_check + label="Show Look At" + layout="topleft" + name="Show Look At"> + <menu_item_check.on_check + function="Advanced.CheckShowLookAt" + parameter="ShowLookAt" /> + <menu_item_check.on_click + function="Advanced.ToggleShowLookAt" /> + </menu_item_check> + <menu_item_check + label="Show Point At" + layout="topleft" + name="Show Point At"> + <menu_item_check.on_check + function="Advanced.CheckShowPointAt" + parameter="ShowPointAt" /> + <menu_item_check.on_click + function="Advanced.ToggleShowPointAt" /> + </menu_item_check> + <menu_item_check + label="Debug Joint Updates" + layout="topleft" + name="Debug Joint Updates"> + <menu_item_check.on_check + function="Advanced.CheckDebugJointUpdates" + parameter="DebugJointUpdates" /> + <menu_item_check.on_click + function="Advanced.ToggleDebugJointUpdates" /> + </menu_item_check> + <menu_item_check + label="Disable LOD" + layout="topleft" + name="Disable LOD"> + <menu_item_check.on_check + function="Advanced.CheckDisableLOD" + parameter="DisableLOD" /> + <menu_item_check.on_click + function="Advanced.ToggleDisableLOD" /> + </menu_item_check> + <menu_item_check + label="Debug Character Vis" + layout="topleft" + name="Debug Character Vis"> + <menu_item_check.on_check + function="Advanced.CheckDebugCharacterVis" + parameter="DebugCharacterVis" /> + <menu_item_check.on_click + function="Advanced.ToggleDebugCharacterVis" /> + </menu_item_check> + <menu_item_check + label="Show Collision Skeleton" + layout="topleft" + name="Show Collision Skeleton"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="collision skeleton" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="collision skeleton" /> + </menu_item_check> + <menu_item_check + label="Display Agent Target" + layout="topleft" + name="Display Agent Target"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="agent target" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="agent target" /> + </menu_item_check> + <!-- <menu_item_check + label="Debug Rotation" + layout="topleft" + name="Debug Rotation"> + <menu_item_check.on_check + function="CheckControl" + parameter="DebugAvatarRotation" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="DebugAvatarRotation" /> + </menu_item_check> --> + <menu_item_call + label="Dump Attachments" + layout="topleft" + name="Dump Attachments"> + <menu_item_call.on_click + function="Advanced.DumpAttachments" /> + </menu_item_call> + <menu_item_call + label="Debug Avatar Textures" + layout="topleft" + name="Debug Avatar Textures" + shortcut="control|alt|shift|A"> + <menu_item_call.on_click + function="Advanced.DebugAvatarTextures" /> + </menu_item_call> + <menu_item_call + label="Dump Local Textures" + layout="topleft" + name="Dump Local Textures" + shortcut="alt|shift|M"> + <menu_item_call.on_click + function="Advanced.DumpAvatarLocalTextures" /> + </menu_item_call> + </menu> + <menu_item_separator + layout="topleft" /> + <menu_item_check + label="Debug 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="Compress Images" + layout="topleft" + name="Compress Images"> + <menu_item_call.on_click + function="Advanced.CompressImage" /> + </menu_item_call> + <menu_item_check + label="Console Window" + layout="topleft" + name="Console Window"> + <menu_item_check.on_check + function="CheckControl" + parameter="ShowConsoleWindow" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="ShowConsoleWindow" /> + </menu_item_check> + </menu> + <menu + create_jump_keys="true" + label="Admin" + layout="topleft" + name="Admin" + tear_off="true" + visible="false"> + <menu + create_jump_keys="true" + label="Object" + layout="topleft" + tear_off="true"> + <menu_item_call + label="Take Copy" + layout="topleft" + name="Take Copy" + shortcut="control|alt|shift|O"> + <menu_item_call.on_click + function="Admin.ForceTakeCopy" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + <menu_item_call + label="Force Owner To Me" + layout="topleft" + name="Force Owner To Me"> + <menu_item_call.on_click + function="Admin.HandleObjectOwnerSelf" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + <menu_item_call + label="Force Owner Permissive" + layout="topleft" + name="Force Owner Permissive"> + <menu_item_call.on_click + function="Admin.HandleObjectOwnerPermissive" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + <menu_item_call + label="Delete" + layout="topleft" + name="Delete" + shortcut="control|alt|shift|Del"> + <menu_item_call.on_click + function="Admin.HandleForceDelete" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + <menu_item_call + label="Lock" + layout="topleft" + name="Lock" + shortcut="control|alt|shift|L"> + <menu_item_call.on_click + function="Admin.HandleObjectLock" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + <menu_item_call + label="Get Assets IDs" + layout="topleft" + name="Get Assets IDs" + shortcut="control|alt|shift|I"> + <menu_item_call.on_click + function="Admin.HandleObjectAssetIDs" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Parcel" + layout="topleft" + name="Parcel" + tear_off="true"> + <menu_item_call + label="Owner To Me" + layout="topleft" + name="Owner To Me"> + <menu_item_call.on_click + function="Admin.HandleForceParcelOwnerToMe" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + <menu_item_call + label="Set to Linden Content" + layout="topleft" + name="Set to Linden Content" + shortcut="control|alt|shift|C"> + <menu_item_call.on_click + function="Admin.HandleForceParcelToContent" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + <menu_item_call + label="Claim Public Land" + layout="topleft" + name="Claim Public Land"> + <menu_item_call.on_click + function="Admin.HandleClaimPublicLand" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Region" + layout="topleft" + name="Region" + tear_off="true"> + <menu_item_call + label="Dump Temp Asset Data" + layout="topleft" + name="Dump Temp Asset Data"> + <menu_item_call.on_click + function="Admin.HandleRegionDumpTempAssetData" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + <menu_item_call + label="Save Region State" + layout="topleft" + name="Save Region State"> + <menu_item_call.on_click + function="Admin.OnSaveState" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + </menu> + <menu_item_call + label="God Tools" + layout="topleft" + name="God Tools"> + <menu_item_call.on_click + function="Admin.ShowGodTools" /> + <menu_item_call.on_enable + function="EnableGodCustomerService" /> + </menu_item_call> + </menu> + <menu + create_jump_keys="true" + label="Admin" + layout="topleft" + name="Deprecated" + tear_off="true" + visible="false"> + <menu + create_jump_keys="true" + label="Attach Object" + layout="topleft" + mouse_opaque="false" + name="Attach Object" + tear_off="true" /> + <menu + create_jump_keys="true" + label="Detach Object" + layout="topleft" + mouse_opaque="false" + name="Detach Object" + tear_off="true" /> + <menu + create_jump_keys="true" + label="Take Off Clothing" + layout="topleft" + mouse_opaque="false" + name="Take Off Clothing" + tear_off="true"> + <menu_item_call + label="Shirt" + layout="topleft" + name="Shirt"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="shirt" /> + <menu_item_call.on_enable + function="Edit.EnableTakeOff" + parameter="shirt" /> + </menu_item_call> + <menu_item_call + label="Pants" + layout="topleft" + name="Pants"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="pants" /> + <menu_item_call.on_enable + function="Edit.EnableTakeOff" + parameter="pants" /> + </menu_item_call> + <menu_item_call + label="Shoes" + layout="topleft" + name="Shoes"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="shoes" /> + <menu_item_call.on_enable + function="Edit.EnableTakeOff" + parameter="shoes" /> + </menu_item_call> + <menu_item_call + label="Socks" + layout="topleft" + name="Socks"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="socks" /> + <menu_item_call.on_enable + function="Edit.EnableTakeOff" + parameter="socks" /> + </menu_item_call> + <menu_item_call + label="Jacket" + layout="topleft" + name="Jacket"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="jacket" /> + <menu_item_call.on_enable + function="Edit.EnableTakeOff" + parameter="jacket" /> + </menu_item_call> + <menu_item_call + label="Gloves" + layout="topleft" + name="Gloves"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="gloves" /> + <menu_item_call.on_enable + function="Edit.EnableTakeOff" + parameter="gloves" /> + </menu_item_call> + <menu_item_call + label="Undershirt" + layout="topleft" + name="Menu Undershirt"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="undershirt" /> + <menu_item_call.on_enable + function="Edit.EnableTakeOff" + parameter="undershirt" /> + </menu_item_call> + <menu_item_call + label="Underpants" + layout="topleft" + name="Menu Underpants"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="underpants" /> + <menu_item_call.on_enable + function="Edit.EnableTakeOff" + parameter="underpants" /> + </menu_item_call> + <menu_item_call + label="Skirt" + layout="topleft" + name="Skirt"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="skirt" /> + <menu_item_call.on_enable + function="Edit.EnableTakeOff" + parameter="skirt" /> + </menu_item_call> + <menu_item_call + label="Alpha" + layout="topleft" + name="Alpha"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="alpha" /> + <menu_item_call.on_enable + function="Edit.EnableTakeOff" + parameter="alpha" /> + </menu_item_call> + <menu_item_call + label="Tattoo" + layout="topleft" + name="Tattoo"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="tattoo" /> + <menu_item_call.on_enable + function="Edit.EnableTakeOff" + parameter="tattoo" /> + </menu_item_call> + <menu_item_call + label="All Clothes" + layout="topleft" + name="All Clothes"> + <menu_item_call.on_click + function="Edit.TakeOff" + parameter="all" /> + </menu_item_call> + </menu> + <menu_item_check + label="Show Toolbar" + layout="topleft" + name="Show Toolbar"> + <menu_item_check.on_check + function="FloaterVisible" + parameter="toolbar" /> + <menu_item_check.on_click + function="ShowFloater" + parameter="toolbar" /> + </menu_item_check> + <menu + create_jump_keys="true" + label="Help" + layout="topleft" + name="Help" + tear_off="true"> + <menu_item_call + label="Official Linden Blog" + layout="topleft" + name="Official Linden Blog"> + <menu_item_call.on_click + function="PromptShowURL" + parameter="WebLaunchSupportWiki,http://blog.secondlife.com/" /> + </menu_item_call> + <menu_item_call + label="Scripting Portal" + layout="topleft" + name="Scripting Portal"> + <menu_item_call.on_click + function="PromptShowURL" + parameter="WebLaunchLSLWiki,http://wiki.secondlife.com/wiki/LSL_Portal" /> + </menu_item_call> + <menu + create_jump_keys="true" + label="Bug Reporting" + layout="topleft" + name="Bug Reporting" + tear_off="true"> + <menu_item_call + label="Public Issue Tracker" + layout="topleft" + name="Public Issue Tracker"> + <menu_item_call.on_click + function="PromptShowURL" + parameter="WebLaunchPublicIssue,http://jira.secondlife.com" /> + </menu_item_call> + <menu_item_call + label="Public Issue Tracker Help" + layout="topleft" + name="Publc Issue Tracker Help"> + <menu_item_call.on_click + function="PromptShowURL" + parameter="WebLaunchPublicIssueHelp,http://wiki.secondlife.com/wiki/Issue_tracker" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Bug Reporting 101" + layout="topleft" + name="Bug Reporing 101"> + <menu_item_call.on_click + function="PromptShowURL" + parameter="WebLaunchBugReport101,http://wiki.secondlife.com/wiki/Bug_Reporting_101" /> + </menu_item_call> + <menu_item_call + label="Security Issues" + layout="topleft" + name="Security Issues"> + <menu_item_call.on_click + function="PromptShowURL" + parameter="WebLaunchSecurityIssues,http://wiki.secondlife.com/wiki/Security_issues" /> + </menu_item_call> + <menu_item_call + label="QA Wiki" + layout="topleft" + name="QA Wiki"> + <menu_item_call.on_click + function="PromptShowURL" + parameter="WebLaunchQAWiki,http://wiki.secondlife.com/wiki/QA_Portal" /> + </menu_item_call> + </menu> + </menu> + </menu> +</menu_bar> diff --git a/indra/newview/skins/default/xui/en/mime_types.xml b/indra/newview/skins/default/xui/en/mime_types.xml new file mode 100644 index 0000000000000000000000000000000000000000..e3d102148a68e7324c4da29e745d3574278acb01 --- /dev/null +++ b/indra/newview/skins/default/xui/en/mime_types.xml @@ -0,0 +1,456 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<mimetypes name="default"> + <defaultlabel> + (Unknown) + </defaultlabel> + <defaultwidget> + none + </defaultwidget> + <defaultimpl> + LLMediaImplLLMozLib + </defaultimpl> + <widgetset name="web"> + <label name="web_label"> + Web Content + </label> + <icon> + icn_media_web.tga + </icon> + <default_type> + text/html + </default_type> + <tooltip name="web_tooltip"> + This location has Web content + </tooltip> + <playtip name="web_playtip"> + Show Web content + </playtip> + <allow_resize> + true + </allow_resize> + <allow_looping> + false + </allow_looping> + </widgetset> + <widgetset name="movie"> + <label name="movie_label"> + Movie + </label> + <default_type> + video/* + </default_type> + <icon> + icn_media_movie.tga + </icon> + <tooltip name="movie_tooltip"> + There is a movie to play here + </tooltip> + <playtip name="movie_playtip"> + Play movie + </playtip> + <allow_resize> + false + </allow_resize> + <allow_looping> + true + </allow_looping> + </widgetset> + <widgetset name="none"> + <label name="none_label"> + No Content + </label> + <default_type> + none/none + </default_type> + <icon> + icn_media_web.tga + </icon> + <tooltip name="none_tooltip"> + No media here + </tooltip> + <playtip name="none_playtip" /> + <allow_resize> + false + </allow_resize> + <allow_looping> + false + </allow_looping> + </widgetset> + <widgetset name="image"> + <label name="image_label"> + Image + </label> + <icon> + icn_media_web.tga + </icon> + <default_type> + image/* + </default_type> + <tooltip name="image_tooltip"> + There is an image at this location + </tooltip> + <playtip name="image_playtip"> + View this location's image + </playtip> + <allow_resize> + false + </allow_resize> + <allow_looping> + false + </allow_looping> + </widgetset> + <widgetset name="audio"> + <label name="audio_label"> + Audio + </label> + <icon> + icn_media_web.tga + </icon> + <default_type> + audio/* + </default_type> + <tooltip name="audio_tooltip"> + There is audio at this location + </tooltip> + <playtip name="audio_playtip"> + Play this location's audio + </playtip> + <allow_resize> + false + </allow_resize> + <allow_looping> + true + </allow_looping> + </widgetset> + <scheme name="rtsp"> + <label name="rtsp_label"> + Real Time Streaming + </label> + <widgettype> + movie + </widgettype> + </scheme> + <mimetype name="blank"> + <label name="blank_label"> + - None - + </label> + <widgettype> + none + </widgettype> + <impl> + LLMediaImplQuickTime + </impl> + </mimetype> + <mimetype name="none/none"> + <label name="none/none_label"> + - None - + </label> + <widgettype> + none + </widgettype> + </mimetype> + <mimetype name="audio/*"> + <label name="audio2_label"> + Audio + </label> + <widgettype> + audio + </widgettype> + </mimetype> + <mimetype name="video/*"> + <label name="video2_label"> + Video + </label> + <widgettype> + movie + </widgettype> + </mimetype> + <mimetype name="image/*"> + <label name="image2_label"> + Image + </label> + <widgettype> + image + </widgettype> + </mimetype> + <mimetype menu="1" name="video/vnd.secondlife.qt.legacy"> + <label name="vnd.secondlife.qt.legacy_label"> + Movie (QuickTime) + </label> + <widgettype> + movie + </widgettype> + <impl> + LLMediaImplQuickTime + </impl> + </mimetype> + <mimetype name="application/javascript"> + <label name="application/javascript_label"> + Javascript + </label> + <widgettype> + web + </widgettype> + </mimetype> + <mimetype name="application/ogg"> + <label name="application/ogg_label"> + Ogg Audio/Video + </label> + <widgettype> + audio + </widgettype> + </mimetype> + <mimetype name="application/pdf"> + <label name="application/pdf_label"> + PDF Document + </label> + <widgettype> + image + </widgettype> + </mimetype> + <mimetype name="application/postscript"> + <label name="application/postscript_label"> + Postscript Document + </label> + <widgettype> + image + </widgettype> + </mimetype> + <mimetype name="application/rtf"> + <label name="application/rtf_label"> + Rich Text (RTF) + </label> + <widgettype> + image + </widgettype> + </mimetype> + <mimetype name="application/smil"> + <label name="application/smil_label"> + Synchronized Multimedia Integration Language (SMIL) + </label> + <widgettype> + movie + </widgettype> + </mimetype> + <mimetype name="application/xhtml+xml"> + <label name="application/xhtml+xml_label"> + Web Page (XHTML) + </label> + <widgettype> + web + </widgettype> + </mimetype> + <mimetype name="application/x-director"> + <label name="application/x-director_label"> + Macromedia Director + </label> + <widgettype> + image + </widgettype> + </mimetype> + <mimetype name="application/x-shockwave-flash"> + <label name="application/x-shockwave-flash_label"> + Flash + </label> + <widgettype> + image + </widgettype> + </mimetype> + <mimetype name="audio/mid"> + <label name="audio/mid_label"> + Audio (MIDI) + </label> + <widgettype> + audio + </widgettype> + </mimetype> + <mimetype name="audio/mpeg"> + <label name="audio/mpeg_label"> + Audio (MP3) + </label> + <widgettype> + audio + </widgettype> + </mimetype> + <mimetype name="audio/x-aiff"> + <label name="audio/x-aiff_label"> + Audio (AIFF) + </label> + <widgettype> + audio + </widgettype> + </mimetype> + <mimetype name="audio/x-wav"> + <label name="audio/x-wav_label"> + Audio (WAV) + </label> + <widgettype> + audio + </widgettype> + </mimetype> + <mimetype menu="1" name="image/bmp"> + <label name="image/bmp_label"> + Image (BMP) + </label> + <widgettype> + image + </widgettype> + <impl> + LLMediaImplLLMozLib + </impl> + </mimetype> + <mimetype menu="1" name="image/gif"> + <label name="image/gif_label"> + Image (GIF) + </label> + <widgettype> + image + </widgettype> + <impl> + LLMediaImplLLMozLib + </impl> + </mimetype> + <mimetype menu="1" name="image/jpeg"> + <label name="image/jpeg_label"> + Image (JPEG) + </label> + <widgettype> + image + </widgettype> + <impl> + LLMediaImplLLMozLib + </impl> + </mimetype> + <mimetype menu="1" name="image/png"> + <label name="image/png_label"> + Image (PNG) + </label> + <widgettype> + image + </widgettype> + <impl> + LLMediaImplLLMozLib + </impl> + </mimetype> + <mimetype name="image/svg+xml"> + <label name="image/svg+xml_label"> + Image (SVG) + </label> + <widgettype> + image + </widgettype> + <impl> + LLMediaImplLLMozLib + </impl> + </mimetype> + <mimetype menu="1" name="image/tiff"> + <label name="image/tiff_label"> + Image (TIFF) + </label> + <widgettype> + image + </widgettype> + <impl> + LLMediaImplLLMozLib + </impl> + </mimetype> + <mimetype menu="1" name="text/html"> + <label name="text/html_label"> + Web Page + </label> + <widgettype> + web + </widgettype> + <impl> + LLMediaImplLLMozLib + </impl> + </mimetype> + <mimetype menu="1" name="text/plain"> + <label name="text/plain_label"> + Text + </label> + <widgettype> + text + </widgettype> + <impl> + LLMediaImplLLMozLib + </impl> + </mimetype> + <mimetype name="text/xml"> + <label name="text/xml_label"> + XML + </label> + <widgettype> + text + </widgettype> + <impl> + LLMediaImplLLMozLib + </impl> + </mimetype> + <mimetype menu="1" name="video/mpeg"> + <label name="video/mpeg_label"> + Movie (MPEG) + </label> + <widgettype> + movie + </widgettype> + <impl> + LLMediaImplQuickTime + </impl> + </mimetype> + <mimetype name="video/mp4"> + <label name="video/mp4_label"> + Movie (MP4) + </label> + <widgettype> + movie + </widgettype> + <impl> + LLMediaImplQuickTime + </impl> + </mimetype> + <mimetype menu="1" name="video/quicktime"> + <label name="video/quicktime_label"> + Movie (QuickTime) + </label> + <widgettype> + movie + </widgettype> + <impl> + LLMediaImplQuickTime + </impl> + </mimetype> + <mimetype name="video/x-ms-asf"> + <label name="video/x-ms-asf_label"> + Movie (Windows Media ASF) + </label> + <widgettype> + movie + </widgettype> + <impl> + LLMediaImplQuickTime + </impl> + </mimetype> + <mimetype name="video/x-ms-wmv"> + <label name="video/x-ms-wmv_label"> + Movie (Windows Media WMV) + </label> + <widgettype> + movie + </widgettype> + <impl> + LLMediaImplQuickTime + </impl> + </mimetype> + <mimetype menu="1" name="video/x-msvideo"> + <label name="video/x-msvideo_label"> + Movie (AVI) + </label> + <widgettype> + movie + </widgettype> + <impl> + LLMediaImplQuickTime + </impl> + </mimetype> +</mimetypes> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml new file mode 100644 index 0000000000000000000000000000000000000000..47b21dc64db16bfa44fe376b4172ffdd2c622323 --- /dev/null +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -0,0 +1,6470 @@ +<?xml version="1.0" ?><notifications> + + <global name="skipnexttime"> + + Don't show me this again + </global> + + <global name="alwayschoose"> + + Always choose this option + </global> + + <global name="implicitclosebutton"> + Close + </global> + + <template name="okbutton"> + <form> + <button + default="true" + index="0" + name="OK" + text="$yestext"/> + </form> + </template> + + <template name="okignore"> + <form> + <button + default="true" + index="0" + name="OK" + text="$yestext"/> + <ignore text="$ignoretext"/> + </form> + </template> + + <template name="okcancelbuttons"> + <form> + <button + default="true" + index="0" + name="OK" + text="$yestext"/> + <button + index="1" + name="Cancel" + text="$notext"/> + </form> + </template> + + <template name="okcancelignore"> + <form> + <button + default="true" + index="0" + name="OK" + text="$yestext"/> + <button + index="1" + name="Cancel" + text="$notext"/> + <ignore text="$ignoretext"/> + </form> + </template> + + <template name="okhelpbuttons"> + <form> + <button + default="true" + index="0" + name="OK" + text="$yestext"/> + <button + index="1" + name="Help" + text="$helptext"/> + </form> + </template> + + <template name="yesnocancelbuttons"> + <form> + <button + default="true" + index="0" + name="Yes" + text="$yestext"/> + <button + index="1" + name="No" + text="$notext"/> + <button + index="2" + name="Cancel" + text="$canceltext"/> + </form> + </template> + + <notification + functor="GenericAcknowledge" + icon="alertmodal.tga" + name="MissingAlert" + label="Unknown Alert Message" + type="alertmodal"> +Your version of Second Life does not know how to display the alert message it just received. + +Error details: The alert called '[_NAME]' was not found in notifications.xml. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="FloaterNotFound" + type="alertmodal"> +Floater error: Could not find the following controls: + +[CONTROLS] + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="TutorialNotFound" + type="alertmodal"> +No tutorial is currently available. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="GenericAlert" + type="alertmodal"> +[MESSAGE] + </notification> + + <notification + icon="alertmodal.tga" + name="GenericAlertYesCancel" + type="alertmodal"> +[MESSAGE] + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="BadInstallation" + type="alertmodal"> +An error occurred while updating Second Life. Please download the latest version from secondlife.com. + <usetemplate + name="okbutton" + yestext="Ok"/> + </notification> + + <notification + icon="alertmodal.tga" + name="LoginFailedNoNetwork" + type="alertmodal"> +Network Error: Could not establish a connection. +'[DIAGNOSTIC]' +Please check your network connection. + <usetemplate + name="okbutton" + yestext="Ok"/> + </notification> + + <notification + icon="alertmodal.tga" + name="MessageTemplateNotFound" + type="alertmodal"> +Message Template [PATH] not found. + <usetemplate + name="okbutton" + yestext="Ok"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WearableSave" + type="alertmodal"> +Save changes to current clothing/body part? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="Don't Save" + yestext="Save"/> + </notification> + + <notification + icon="alertmodal.tga" + name="CompileQueueSaveText" + type="alertmodal"> +There was a problem uploading the text for a script due to the following reason: [REASON]. Please try again later. + </notification> + + <notification + icon="alertmodal.tga" + name="CompileQueueSaveBytecode" + type="alertmodal"> +There was a problem uploading the compiled script due to the following reason: [REASON]. Please try again later. + </notification> + + <notification + icon="alertmodal.tga" + name="WriteAnimationFail" + type="alertmodal"> +There was a problem writing animation data. Please try again later. + </notification> + + <notification + icon="alertmodal.tga" + name="UploadAuctionSnapshotFail" + type="alertmodal"> +There was a problem uploading the auction snapshot due to the following reason: [REASON] + </notification> + + <notification + icon="alertmodal.tga" + name="UnableToViewContentsMoreThanOne" + type="alertmodal"> +Unable to view the contents of more than one item at a time. +Please select only one object and try again. + </notification> + + <notification + icon="alertmodal.tga" + name="SaveClothingBodyChanges" + type="alertmodal"> +Save all changes to clothing/body parts? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="Don't Save" + yestext="Save All"/> + </notification> + + <notification + icon="alertmodal.tga" + name="GrantModifyRights" + type="alertmodal"> +Granting modify rights to another resident allows them to change, delete or take ANY objects you may have in-world. Be VERY careful when handing out this permission. +Do you want to grant modify rights for [FIRST_NAME] [LAST_NAME]? + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="GrantModifyRightsMultiple" + type="alertmodal"> +Granting modify rights to another resident allows them to change ANY objects you may have in-world. Be VERY careful when handing out this permission. +Do you want to grant modify rights for the selected Residents? + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="RevokeModifyRights" + type="alertmodal"> +Do you want to revoke modify rights for [FIRST_NAME] [LAST_NAME]? + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="RevokeModifyRightsMultiple" + type="alertmodal"> +Do you want to revoke modify rights for the selected Residents? + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="UnableToCreateGroup" + type="alertmodal"> +Unable to create group. +[MESSAGE] + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="PanelGroupApply" + type="alertmodal"> +[NEEDS_APPLY_MESSAGE] +[WANT_APPLY_MESSAGE] + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="Ignore Changes" + yestext="Apply Changes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="MustSpecifyGroupNoticeSubject" + type="alertmodal"> +You must specify a subject to send a group notice. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="AddGroupOwnerWarning" + type="alertmodal"> +You are about to add group members to the role of [ROLE_NAME]. +Members cannot be removed from that role. +The members must resign from the role themselves. +Are you sure you want to continue? + <usetemplate + ignoretext="When adding group members to the owner role" + name="okcancelignore" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="AssignDangerousActionWarning" + type="alertmodal"> +You are about to add the Ability '[ACTION_NAME]' to the Role '[ROLE_NAME]'. + + *WARNING* + Any Member in a Role with this Ability can assign themselves -- and any other member -- to Roles that have more powers than they currently have, potentially elevating themselves to near-Owner power. Be sure you know what you're doing before assigning this Ability. + +Add this Ability to '[ROLE_NAME]'? + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="AssignDangerousAbilityWarning" + type="alertmodal"> +You are about to add the Ability '[ACTION_NAME]' to the Role '[ROLE_NAME]'. + + *WARNING* + Any Member in a Role with this Ability can assign themselves -- and any other member -- all Abilities, elevating themselves to near-Owner power. + +Add this Ability to '[ROLE_NAME]'? + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ClickPublishHelpLand" + type="alertmodal"> +Selecting the "Publish in Search" +Checking this box will show: +- this parcel in search results +- this parcel's public objects +- this parcel in web search + </notification> + + <notification + icon="alertmodal.tga" + name="ClickSoundHelpLand" + type="alertmodal">Media and Music can only be experienced within the parcel. Sound and Voice options can be restricted to the parcel or will be heard by residents outside the parcel depending on their maturity Rating. Go to Knowledge Base to learn more about how to set these options? + <url option="0" name="url"> + https://support.secondlife.com/ics/support/default.asp?deptID=4417&task=knowledge&questionID=5046 + </url> + <usetemplate + name="okcancelbuttons" + yestext="Go to Knowledge Base" + notext="Close" /> + </notification> + + <notification + icon="alertmodal.tga" + name="ClickSearchHelpAll" + type="alertmodal"> +Search results are organized based on the tab you are in, your maturity Rating, the category chosen, and other factors. For more details, please see the Knowledge Base. + <url option="0" name="url"> + https://support.secondlife.com/ics/support/default.asp?deptID=4417&task=knowledge&questionID=4722 + </url> + <usetemplate + name="okcancelbuttons" + yestext="Go to Knowledge Base" + notext="Close" /> + </notification> + + <notification + icon="alertmodal.tga" + name="ClickPublishHelpLandDisabled" + type="alertmodal"> +You can't make this parcel show in search because it is located in a region that forbids this. + </notification> + + <notification + icon="alertmodal.tga" + name="ClickPublishHelpAvatar" + type="alertmodal"> +Selecting "Show in Search" will show: +- my profile in search results +- a link to my profile in public group pages + </notification> + + <notification + icon="alertmodal.tga" + name="ClickPartnerHelpAvatar" + type="alertmodal"> +You can propose to another Resident or dissolve an existing partnership through the [SECOND_LIFE] website. + +Go to the Second Life web site for more information on partnering? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Go to Page"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ClickUploadHelpPermissions" + type="alertmodal"> +Your default permissions may not work in older regions. + </notification> + + <notification + icon="alertmodal.tga" + name="ClickWebProfileHelpAvatar" + type="alertmodal"> +If this Resident has set a web profile URL then you can: + * Click 'Load' to see the page in this Web tab. + * Click Load > 'In external browser' to view the page in your default web browser. + * Click Load > 'Home URL' to return to this Resident's web profile if you've navigated away. + +When viewing your own profile, you can enter any URL as your web profile and click OK to set it. +Other residents can visit the URL you set when they look at your profile. + </notification> + + <notification + icon="alertmodal.tga" + name="JoinGroupCanAfford" + type="alertmodal"> +Joining this group costs L$[COST]. +Do you wish to proceed? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Join"/> + </notification> + + <notification + icon="alertmodal.tga" + name="JoinGroupCannotAfford" + type="alertmodal"> +Joining this group costs L$[COST]. +You do not have enough L$ to join this group. + </notification> + + <notification + icon="alertmodal.tga" + name="LandBuyPass" + type="alertmodal"> +For L$[COST] you can enter this land ('[PARCEL_NAME]') for [TIME] hours. Buy a pass? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="SalePriceRestriction" + type="alertmodal"> +Sale price must be set to more than L$0 if selling to anyone. +Please select an individual to sell to if selling for L$0. + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmLandSaleChange" + priority="high" + type="alertmodal"> +The selected [LAND_SIZE] m² land is being set for sale. +Your selling price will be L$[SALE_PRICE] and will be authorized for sale to [NAME]. + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmLandSaleToAnyoneChange" + type="alertmodal"> +ATTENTION: Clicking 'sell to anyone' makes your land available to the entire Second Life community, even those not in this region. + +The selected [LAND_SIZE] m² land is being set for sale. +Your selling price will be L$[SALE_PRICE] and will be authorized for sale to [NAME]. + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ReturnObjectsDeededToGroup" + type="alertmodal"> +Are you sure you want to return all objects shared with the group '[NAME]' on this parcel of land back to their previous owner's inventory? + +*WARNING* This will delete the non-transferable objects deeded to the group! + +Objects: [N] + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ReturnObjectsOwnedByUser" + type="alertmodal"> +Are you sure you want to return all objects owned by the Resident '[NAME]' on this parcel of land back to their inventory? + +Objects: [N] + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ReturnObjectsOwnedBySelf" + type="alertmodal"> +Are you sure you want to return all objects owned by you on this parcel of land back to your inventory? + +Objects: [N] + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ReturnObjectsNotOwnedBySelf" + type="alertmodal"> +Are you sure you want to return all objects NOT owned by you on this parcel of land back to their owner's inventory? +Transferable objects deeded to a group will be returned to their previous owners. + +*WARNING* This will delete the non-transferable objects deeded to the group! + +Objects: [N] + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ReturnObjectsNotOwnedByUser" + type="alertmodal"> +Are you sure you want to return all objects NOT owned by [NAME] on this parcel of land back to their owner's inventory? +Transferable objects deeded to a group will be returned to their previous owners. + +*WARNING* This will delete the non-transferable objects deeded to the group! + +Objects: [N] + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ReturnAllTopObjects" + type="alertmodal"> +Are you sure you want to return all listed objects back to their owner's inventory? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="DisableAllTopObjects" + type="alertmodal"> +Are you sure you want to disable all objects in this region? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ReturnObjectsNotOwnedByGroup" + type="alertmodal"> +Return the objects on this parcel of land that are NOT shared with the group [NAME] back to their owners? + +Objects: [N] + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="UnableToDisableOutsideScripts" + type="alertmodal"> +Can not disable scripts. +This entire region is damage enabled. +Scripts must be allowed to run for weapons to work. + </notification> + + <notification + icon="alertmodal.tga" + name="MustBeInParcel" + type="alertmodal"> +You must be standing inside the land parcel to set its Landing Point. + </notification> + + <notification + icon="alertmodal.tga" + name="PromptRecipientEmail" + type="alertmodal"> +Please enter a valid email address for the recipient(s). + </notification> + + <notification + icon="alertmodal.tga" + name="PromptSelfEmail" + type="alertmodal"> +Please enter your email address. + </notification> + + <notification + icon="alertmodal.tga" + name="PromptMissingSubjMsg" + type="alertmodal"> +Email snapshot with the default subject or message? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ErrorProcessingSnapshot" + type="alertmodal"> +Error processing snapshot data + </notification> + + <notification + icon="alertmodal.tga" + name="ErrorEncodingSnapshot" + type="alertmodal"> +Error encoding snapshot. + </notification> + + <notification + icon="alertmodal.tga" + name="ErrorUploadingPostcard" + type="alertmodal"> +There was a problem sending a snapshot due to the following reason: [REASON] + </notification> + + <notification + icon="alertmodal.tga" + name="ErrorUploadingReportScreenshot" + type="alertmodal"> +There was a problem uploading a report screenshot due to the following reason: [REASON] + </notification> + + <notification + icon="alertmodal.tga" + name="MustAgreeToLogIn" + type="alertmodal"> +You must agree to the Terms of Service to continue logging into [SECOND_LIFE]. + </notification> + + <notification + icon="alertmodal.tga" + name="CouldNotPutOnOutfit" + type="alertmodal"> +Could not put on outfit. +The outfit folder contains no clothing, body parts, or attachments. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotWearTrash" + type="alertmodal"> +You can not wear clothes or body parts that are in the trash + </notification> + + <notification + icon="alertmodal.tga" + name="CannotWearInfoNotComplete" + type="alertmodal"> +You can not wear that item because it has not yet loaded. Please try again in a minute. + </notification> + + <notification + icon="alertmodal.tga" + name="MustHaveAccountToLogIn" + type="alertmodal"> +Oops! Something was left blank. +You need to enter both the First and Last name of your avatar. + +You need an account to enter [SECOND_LIFE]. Would you like to create one now? + <url + option="0" + openexternally = "1"> + + http://secondlife.com/registration/ + </url> + <usetemplate + name="okcancelbuttons" + notext="Try again" + yestext="Create a new account"/> + </notification> + + <notification + icon="alertmodal.tga" + name="AddClassified" + type="alertmodal"> +Classified ads appear in the 'Classified' section of the Search directory and on www.secondlife.com for one week. +Fill out your ad, then click 'Publish...' to add it to the directory. +You'll be asked for a price to pay when clicking Publish. +Paying more makes your ad appear higher in the list, and also appear higher when people search for keywords. + <usetemplate + ignoretext="When adding a new Classified" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="DeleteClassified" + type="alertmodal"> +Delete classified '[NAME]'? +There is no reimbursement for fees paid. + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ClassifiedSave" + type="alertmodal"> +Save changes to classified [NAME]? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="Don't Save" + yestext="Save"/> + </notification> + + <notification + icon="alertmodal.tga" + name="DeleteAvatarPick" + type="alertmodal"> +Delete pick [PICK]? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="PromptGoToEventsPage" + type="alertmodal"> +Go to the [SECOND_LIFE] events web page? + <url option="0"> + + http://secondlife.com/events/ + </url> + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="SelectProposalToView" + type="alertmodal"> +Please select a proposal to view. + </notification> + + <notification + icon="alertmodal.tga" + name="SelectHistoryItemToView" + type="alertmodal"> +Please select a history item to view. + </notification> + + <notification + icon="alertmodal.tga" + name="ResetShowNextTimeDialogs" + type="alertmodal"> +Would you like to re-enable all these popups, which you previously indicated 'Don't show me again'? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="SkipShowNextTimeDialogs" + type="alertmodal"> +Would you like to disable all popups which can be skipped? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="CacheWillClear" + type="alertmodal"> +Cache will be cleared after you restart [SECOND_LIFE]. + </notification> + + <notification + icon="alertmodal.tga" + name="CacheWillBeMoved" + type="alertmodal"> +Cache will be moved after you restart [SECOND_LIFE]. +Note: This will clear the cache. + </notification> + + <notification + icon="alertmodal.tga" + name="ChangeConnectionPort" + type="alertmodal"> +Port settings take effect after you restart [SECOND_LIFE]. + </notification> + + <notification + icon="alertmodal.tga" + name="ChangeSkin" + type="alertmodal"> +The new skin will appear after you restart [SECOND_LIFE]. + </notification> + + <notification + icon="alertmodal.tga" + name="GoToAuctionPage" + type="alertmodal"> +Go to the [SECOND_LIFE] web page to see auction details or make a bid? + <url option="0"> + + http://secondlife.com/auctions/auction-detail.php?id=[AUCTION_ID] + </url> + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="SaveChanges" + type="alertmodal"> +Save Changes? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="Don't Save" + yestext="Save"/> + </notification> + + <notification + icon="alertmodal.tga" + name="GestureSaveFailedTooManySteps" + type="alertmodal"> +Gesture save failed. +This gesture has too many steps. +Try removing some steps, then save again. + </notification> + + <notification + icon="alertmodal.tga" + name="GestureSaveFailedTryAgain" + type="alertmodal"> +Gesture save failed. Please try again in a minute. + </notification> + + <notification + icon="alertmodal.tga" + name="GestureSaveFailedObjectNotFound" + type="alertmodal"> +Could not save gesture because the object or the associated object inventory could not be found. +The object may be out of range or may have been deleted. + </notification> + + <notification + icon="alertmodal.tga" + name="GestureSaveFailedReason" + type="alertmodal"> +There was a problem saving a gesture due to the following reason: [REASON]. Please try resaving the gesture later. + </notification> + + <notification + icon="alertmodal.tga" + name="SaveNotecardFailObjectNotFound" + type="alertmodal"> +Could not save notecard because the object or the associated object inventory could not be found. +The object may be out of range or may have been deleted. + </notification> + + <notification + icon="alertmodal.tga" + name="SaveNotecardFailReason" + type="alertmodal"> +There was a problem saving a notecard due to the following reason: [REASON]. Please try re-saving the notecard later. + </notification> + + <notification + icon="alertmodal.tga" + name="ScriptCannotUndo" + type="alertmodal"> +Could not undo all changes in your version of the script. +Would you like to load the server's last saved version? +(**Warning** This operation cannot be undone.) + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="SaveScriptFailReason" + type="alertmodal"> +There was a problem saving a script due to the following reason: [REASON]. Please try re-saving the script later. + </notification> + + <notification + icon="alertmodal.tga" + name="SaveScriptFailObjectNotFound" + type="alertmodal"> +Could not save the script because the object it is in could not be found. +The object may be out of range or may have been deleted. + </notification> + + <notification + icon="alertmodal.tga" + name="SaveBytecodeFailReason" + type="alertmodal"> +There was a problem saving a compiled script due to the following reason: [REASON]. Please try re-saving the script later. + </notification> + + <notification + icon="alertmodal.tga" + name="CouldNotStartStopScript" + type="alertmodal"> +Could not start or stop the script because the object it is on could not be found. +The object may be out of range or may have been deleted. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotDownloadFile" + type="alertmodal"> +Unable to download file + </notification> + + <notification + icon="alertmodal.tga" + name="CannotWriteFile" + type="alertmodal"> +Unable to write file [[FILE]] + </notification> + + <notification + icon="alertmodal.tga" + name="UnsupportedHardware" + type="alertmodal"> +Warning: Your system does not meet Second Life's minimum system requirements. If you continue using Second Life, you may experience poor performance. Unfortunately, we cannot provide technical support for unsupported system configurations. + +MINSPECS +Do you wish to visit [_URL] for more information? + <url option="0" name="url"> + + http://www.secondlife.com/corporate/sysreqs.php + </url> + <usetemplate + ignoretext="When detecting unsupported hardware" + name="okcancelignore" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="UnknownGPU" + type="alertmodal"> +Your system contains a graphics card that is unknown to us at this time. +This is often the case with new hardware we haven't had a chance to test. Second Life will most likely run properly, but you may need to adjust your graphics settings to something more appropriate. +(Edit menu > Preferences > Graphics). + <form name="form"> + <ignore name="ignore" + text="When detecting an unknown graphics card"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="DisplaySettingsNoShaders" + type="alertmodal"> +[SECOND_LIFE] crashed while initializing graphics drivers. +Graphics Quality will be set to low to avoid some common driver errors. +This will disable some graphics features. +We recommend updating your graphics card drivers. +Graphics Quality can be raised in Preferences > Graphics. + </notification> + + <notification + icon="alertmodal.tga" + name="RegionNoTerraforming" + type="alertmodal"> +The region [REGION] does not allow terraforming. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotCopyWarning" + type="alertmodal"> +You do not have permission to copy this item and will lose it from your inventory if you give it away. Do you really want to offer this item? + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="CannotGiveItem" + type="alertmodal"> +Unable to give inventory item. + </notification> + + <notification + icon="alertmodal.tga" + name="TransactionCancelled" + type="alertmodal"> +Transaction cancelled. + </notification> + + <notification + icon="alertmodal.tga" + name="TooManyItems" + type="alertmodal"> +Cannot give more than 42 items in a single inventory transfer. + </notification> + + <notification + icon="alertmodal.tga" + name="NoItems" + type="alertmodal"> +You do not have permission to transfer the selected items. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotCopyCountItems" + type="alertmodal"> +You do not have permission to copy [COUNT] of the selected items. You will lose these items from your inventory. +Do you really want to give these items? + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="CannotGiveCategory" + type="alertmodal"> +You do not have permission to transfer the selected folder. + </notification> + + <notification + icon="alertmodal.tga" + name="FreezeAvatar" + type="alertmodal"> +Freeze this avatar? +He or she will temporarily be unable to move, chat, or interact with the world. + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="Unfreeze" + yestext="Freeze"/> + </notification> + + <notification + icon="alertmodal.tga" + name="FreezeAvatarFullname" + type="alertmodal"> +Freeze [AVATAR_NAME]? +He or she will temporarily be unable to move, chat, or interact with the world. + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="Unfreeze" + yestext="Freeze"/> + </notification> + + <notification + icon="alertmodal.tga" + name="EjectAvatarFullname" + type="alertmodal"> +Eject [AVATAR_NAME] from your land? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="Eject and Ban" + yestext="Eject"/> + </notification> + + <notification + icon="alertmodal.tga" + name="EjectAvatarNoBan" + type="alertmodal"> +Eject this avatar from your land? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Eject"/> + </notification> + + <notification + icon="alertmodal.tga" + name="EjectAvatarFullnameNoBan" + type="alertmodal"> +Eject [AVATAR_NAME] from your land? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Eject"/> + </notification> + + <notification + icon="alertmodal.tga" + name="AcquireErrorTooManyObjects" + type="alertmodal"> +ACQUIRE ERROR: Too many objects selected. + </notification> + + <notification + icon="alertmodal.tga" + name="AcquireErrorObjectSpan" + type="alertmodal"> +ACQUIRE ERROR: Objects span more than one region. +Please move all objects to be acquired onto the same region. + </notification> + + <notification + icon="alertmodal.tga" + name="PromptGoToCurrencyPage" + type="alertmodal"> +[EXTRA] + +Go to [_URL] for information on purchasing currency? + <url option="0"> + + http://secondlife.com/app/currency/ + </url> + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="UnableToLinkObjects" + type="alertmodal"> +Unable to link these [COUNT] objects. +You can link a maximum of [MAX] objects. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotLinkIncompleteSet" + type="alertmodal"> +You can only link complete sets of objects, and must select more than one object. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotLinkModify" + type="alertmodal"> +Unable to link because you don't have modify permission on all the objects. + +Please make sure none are locked, and that you own all of them. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotLinkDifferentOwners" + type="alertmodal"> +Unable to link because not all of the objects have the same owner. + +Please make sure you own all of the selected objects. + </notification> + + <notification + icon="alertmodal.tga" + name="NoFileExtension" + type="alertmodal"> +No file extension for the file: '[FILE]' + +Please make sure the file has a correct file extension. + </notification> + + <notification + icon="alertmodal.tga" + name="InvalidFileExtension" + type="alertmodal"> +Invalid file extension [EXTENSION] +Expected [VALIDS] + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="CannotUploadSoundFile" + type="alertmodal"> +Couldn't open uploaded sound file for reading: +[FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="SoundFileNotRIFF" + type="alertmodal"> +File does not appear to be a RIFF WAVE file: +[FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="SoundFileNotPCM" + type="alertmodal"> +File does not appear to be a PCM WAVE audio file: +[FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="SoundFileInvalidChannelCount" + type="alertmodal"> +File has invalid number of channels (must be mono or stereo): +[FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="SoundFileInvalidSampleRate" + type="alertmodal"> +File does not appear to be a supported sample rate (must be 44.1k): +[FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="SoundFileInvalidWordSize" + type="alertmodal"> +File does not appear to be a supported word size (must be 8 or 16 bit): +[FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="SoundFileInvalidHeader" + type="alertmodal"> +Could not find 'data' chunk in WAV header: +[FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="SoundFileInvalidTooLong" + type="alertmodal"> +Audio file is too long (10 second maximum): +[FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="ProblemWithFile" + type="alertmodal"> +Problem with file [FILE]: + +[ERROR] + </notification> + + <notification + icon="alertmodal.tga" + name="CannotOpenTemporarySoundFile" + type="alertmodal"> +Couldn't open temporary compressed sound file for writing: [FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="UnknownVorbisEncodeFailure" + type="alertmodal"> +Unknown Vorbis encode failure on: [FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="CannotEncodeFile" + type="alertmodal"> +Unable to encode file: [FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="CorruptResourceFile" + type="alertmodal"> +Corrupt resource file: [FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="UnknownResourceFileVersion" + type="alertmodal"> +Unknown Linden resource file version in file: [FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="UnableToCreateOutputFile" + type="alertmodal"> +Unable to create output file: [FILE] + </notification> + + <notification + icon="alertmodal.tga" + name="DoNotSupportBulkAnimationUpload" + type="alertmodal"> +We do not currently support bulk upload of animation files. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotUploadReason" + type="alertmodal"> +Unable to upload [FILE] due to the following reason: [REASON] +Please try again later. + </notification> + + <notification + icon="notifytip.tga" + name="LandmarkCreated" + type="notifytip"> +You have added "[LANDMARK_NAME]" to your [FOLDER_NAME] folder. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotCreateLandmarkNotOwner" + type="alertmodal"> +You cannot create a landmark here because the owner of the land doesn't allow it. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotRecompileSelectObjectsNoScripts" + type="alertmodal"> +Not able to perform 'recompilation'. +Select an object with a script. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotRecompileSelectObjectsNoPermission" + type="alertmodal"> +Not able to perform 'recompilation'. + +Select objects with scripts that you have permission to modify. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotResetSelectObjectsNoScripts" + type="alertmodal"> +Not able to perform 'reset'. + +Select objects with scripts. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotResetSelectObjectsNoPermission" + type="alertmodal"> +Not able to perform 'reset'. + +Select objects with scripts that you have permission to modify. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotSetRunningSelectObjectsNoScripts" + type="alertmodal"> +Not able to set any scripts to 'running'. + +Select objects with scripts. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotSetRunningNotSelectObjectsNoScripts" + type="alertmodal"> +Unable to set any scripts to 'not running'. + +Select objects with scripts. + </notification> + + <notification + icon="alertmodal.tga" + name="NoFrontmostFloater" + type="alertmodal"> +No frontmost floater to save. + </notification> + + <notification + icon="alertmodal.tga" + name="SeachFilteredOnShortWords" + type="alertmodal"> +Your search query was modified and the words that were too short were removed. + +Searched for: [FINALQUERY] + </notification> + + <notification + icon="alertmodal.tga" + name="SeachFilteredOnShortWordsEmpty" + type="alertmodal"> +Your search terms were too short so no search was performed. + </notification> + + <!-- Generic Teleport failure modes - strings will be inserted from + teleport_strings.xml if available. --> + <notification + icon="alertmodal.tga" + name="CouldNotTeleportReason" + type="alertmodal"> +Could not teleport. +[REASON] + </notification> + + <!-- Teleport failure modes not delivered via the generic mechanism + above (for example, delivered as an AlertMessage on + region-crossing :( ) - these paths should really be merged + in the future. --> + <notification + icon="alertmodal.tga" + name="invalid_tport" + type="alertmodal"> +Problem encountered processing your teleport request. You may need to log back in before you can teleport. If you continue to get this message, please check the Tech Support FAQ at: +www.secondlife.com/support + </notification> + <notification + icon="alertmodal.tga" + name="invalid_region_handoff" + type="alertmodal"> +Problem encountered processing your region crossing. You may need to log back in before you can cross regions. If you continue to get this message, please check the Tech Support FAQ at: +www.secondlife.com/support + </notification> + <notification + icon="alertmodal.tga" + name="blocked_tport" + type="alertmodal"> +Sorry, teleport is currently blocked. Try again in a moment. If you still cannot teleport, please log out and log back in to resolve the problem. + </notification> + <notification + icon="alertmodal.tga" + name="nolandmark_tport" + type="alertmodal"> +Sorry, but system was unable to locate landmark destination. + </notification> + <notification + icon="alertmodal.tga" + name="timeout_tport" + type="alertmodal"> +Sorry, but system was unable to complete the teleport connection. Try again in a moment. + </notification> + <notification + icon="alertmodal.tga" + name="noaccess_tport" + type="alertmodal"> +Sorry, you do not have access to that teleport destination. + </notification> + <notification + icon="alertmodal.tga" + name="missing_attach_tport" + type="alertmodal"> +Your attachments have not arrived yet. Try waiting for a few more seconds or log out and back in again before attempting to teleport. + </notification> + <notification + icon="alertmodal.tga" + name="too_many_uploads_tport" + type="alertmodal"> +The asset queue in this region is currently clogged so your teleport request will not be able to succeed in a timely manner. Please try again in a few minutes or go to a less busy area. + </notification> + <notification + icon="alertmodal.tga" + name="expired_tport" + type="alertmodal"> +Sorry, but the system was unable to complete your teleport request in a timely fashion. Please try again in a few minutes. + </notification> + <notification + icon="alertmodal.tga" + name="expired_region_handoff" + type="alertmodal"> +Sorry, but the system was unable to complete your region crossing in a timely fashion. Please try again in a few minutes. + </notification> + <notification + icon="alertmodal.tga" + name="no_host" + type="alertmodal"> +Unable to find teleport destination. The destination may be temporarily unavailable or no longer exists. Please try again in a few minutes. + </notification> + <notification + icon="alertmodal.tga" + name="no_inventory_host" + type="alertmodal"> +The inventory system is currently unavailable. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotSetLandOwnerNothingSelected" + type="alertmodal"> +Unable to set land owner: +No parcel selected. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotSetLandOwnerMultipleRegions" + type="alertmodal"> +Unable to force land ownership because selection spans multiple regions. Please select a smaller area and try again. + </notification> + + <notification + icon="alertmodal.tga" + name="ForceOwnerAuctionWarning" + type="alertmodal"> +This parcel is up for auction. Forcing ownership will cancel the auction and potentially make some residents unhappy if bidding has begun. Force ownership? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="CannotContentifyNothingSelected" + type="alertmodal"> +Unable to contentify: +No parcel selected. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotContentifyNoRegion" + type="alertmodal"> +Unable to contentify: +No region selected. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotReleaseLandNothingSelected" + type="alertmodal"> +Unable to abandon land: +No parcel selected. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotReleaseLandNoRegion" + type="alertmodal"> +Unable to abandon land: +Cannot find region. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotBuyLandNothingSelected" + type="alertmodal"> +Unable to buy land: +No parcel selected. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotBuyLandNoRegion" + type="alertmodal"> +Unable to buy land: +Cannot find the region this land is in. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotCloseFloaterBuyLand" + type="alertmodal"> +You cannot close the Buy Land window until Second Life estimates the price of this transaction. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotDeedLandNothingSelected" + type="alertmodal"> +Unable to deed land: +No parcel selected. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotDeedLandNoGroup" + type="alertmodal"> +Unable to deed land: +No Group selected. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotDeedLandNoRegion" + type="alertmodal"> +Unable to deed land: +Cannot find the region this land is in. +Please use Tools -> Report Bug to report this. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotDeedLandMultipleSelected" + type="alertmodal"> +Unable to deed land: +Multiple parcels selected. + +Try selecting a single parcel. + </notification> + + <notification + icon="alertmodal.tga" + name="ParcelCanPlayMedia" + type="alertmodal"> +This location can play streaming media. +Streaming media requires a fast Internet connection. + +Play streaming media when available? +(You can change this option later under Preferences > Audio & Video.) + <usetemplate + name="okcancelbuttons" + notext="Disable" + yestext="Play Media"/> + </notification> + + <notification + icon="alertmodal.tga" + name="CannotDeedLandWaitingForServer" + type="alertmodal"> +Unable to deed land: +Waiting for server to report ownership. + +Please try again. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotDeedLandNoTransfer" + type="alertmodal"> +Unable to deed land: +The region [REGION] does not allow transfer of land. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotReleaseLandWatingForServer" + type="alertmodal"> +Unable to abandon land: +Waiting for server to update parcel information. + +Try again in a few seconds. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotReleaseLandSelected" + type="alertmodal"> +Unable to abandon land: +You do not own all the parcels selected. + +Please select a single parcel. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotReleaseLandDontOwn" + type="alertmodal"> +Unable to abandon land: +You don't have permission to release this parcel. +Parcels you own appear in green. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotReleaseLandRegionNotFound" + type="alertmodal"> +Unable to abandon land: +Cannot find the region this land is in. + +Please use Tools -> Report Bug to report this. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotReleaseLandNoTransfer" + type="alertmodal"> +Unable to abandon land: +The region [REGION] does not allow transfer of land. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotReleaseLandPartialSelection" + type="alertmodal"> +Unable to abandon land: +You must select an entire parcel to release it. + +Select an entire parcel, or divide your parcel first. + </notification> + + <notification + icon="alertmodal.tga" + name="ReleaseLandWarning" + type="alertmodal"> +You are about to release [AREA] m² of land. +Releasing this parcel will remove it from your land holdings, but will not grant any L$. + +Release this land? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="CannotDivideLandNothingSelected" + type="alertmodal"> +Unable to divide land: + +No parcels selected. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotDivideLandPartialSelection" + type="alertmodal"> +Unable to divide land: + +You have an entire parcel selected. +Try selecting a part of the parcel. + </notification> + + <notification + icon="alertmodal.tga" + name="LandDivideWarning" + type="alertmodal"> +Dividing this land will split this parcel into two and each parcel can have its own settings. Some settings will be reset to defaults after the operation. + +Divide land? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="CannotDivideLandNoRegion" + type="alertmodal"> +Unable to divide land: +Cannot find the region this land is in. + +Please use Tools -> Report Bug to report this. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotJoinLandNoRegion" + type="alertmodal"> +Unable to join land: +Cannot find the region this land is in. + +Please use Tools -> Report Bug to report this. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotJoinLandNothingSelected" + type="alertmodal"> +Unable to join land: +No parcels selected. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotJoinLandEntireParcelSelected" + type="alertmodal"> +Unable to join land: +You only have one parcel selected. + +Select land across both parcels. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotJoinLandSelection" + type="alertmodal"> +Unable to join land: +You must select more than one parcel. + +Select land across both parcels. + </notification> + + <notification + icon="alertmodal.tga" + name="JoinLandWarning" + type="alertmodal"> +Joining this land will create one large parcel out of all parcels intersecting the selected rectangle. +You will need to reset the name and options of the new parcel. + +Join land? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ShowOwnersHelp" + type="alertmodal"> +Show owners: +Color parcels to show the owner type. + +Green = Your land +Aqua = Your Group's land +Red = Owned by others +Yellow = For sale +Purple = For auction +Grey = Public + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmNotecardSave" + type="alertmodal"> +This notecard needs to be saved before the item can be copied or viewed. Save notecard? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmItemCopy" + type="alertmodal"> +Copy this item to your inventory? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Copy"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ResolutionSwitchFail" + type="alertmodal"> +Failed to switch resolution to [RESX] by [RESY] + </notification> + + <notification + icon="alertmodal.tga" + name="ErrorUndefinedGrasses" + type="alertmodal"> +Error: Undefined grasses: [SPECIES] + </notification> + + <notification + icon="alertmodal.tga" + name="ErrorUndefinedTrees" + type="alertmodal"> +Error: Undefined trees: [SPECIES] + </notification> + + <notification + icon="alertmodal.tga" + name="CannotSaveWearableOutOfSpace" + type="alertmodal"> +Unable to save '[NAME]' to wearable file. You will need to free up some space on your computer and save the wearable again. + </notification> + + <notification + icon="alertmodal.tga" + name="CannotSaveToAssetStore" + type="alertmodal"> +Unable to save [NAME] to central asset store. +This is usually a temporary failure. Please customize and save the wearable again in a few minutes. + +If this problem persists, please click on the 'Tools > Report Bug' pull down menu +and provide details about your network setup. + </notification> + + <notification + icon="alertmodal.tga" + name="YouHaveBeenLoggedOut" + type="alertmodal"> +You have been logged out of [SECOND_LIFE]: + [MESSAGE] +You can still look at existing IM and chat by clicking 'View IM & Chat'. Otherwise, click 'Quit' to exit [SECOND_LIFE] immediately. + <usetemplate + name="okcancelbuttons" + notext="Quit" + yestext="View IM & Chat"/> + </notification> + + <notification + icon="alertmodal.tga" + name="OnlyOfficerCanBuyLand" + type="alertmodal"> +Unable to buy land for the group: +You do not have permission to buy land for your active group. + </notification> + + <notification + icon="alertmodal.tga" + label="Add Friend" + name="AddFriend" + type="alertmodal"> +Friends can give permissions to track each other on the map and receive online status updates. + +Offer friendship to [NAME]? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + label="Add Friend" + name="AddFriendWithMessage" + type="alertmodal"> +Friends can give permissions to track each other on the map and receive online status updates. + +Offer friendship to [NAME]? + <form name="form"> + <input name="message" type="text"> +Would you be my friend? + </input> + <button + default="true" + index="0" + name="Offer" + text="OK"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="RemoveFromFriends" + type="alertmodal"> +Do you want to remove [FIRST_NAME] [LAST_NAME] from your Friends List? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="RemoveMultipleFromFriends" + type="alertmodal"> +Do you want to remove multiple friends from your Friends list? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="GodDeleteAllScriptedPublicObjectsByUser" + type="alertmodal"> +Are you sure you want to delete all scripted objects owned by +** [AVATAR_NAME] ** +on all others land in this sim? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="GodDeleteAllScriptedObjectsByUser" + type="alertmodal"> +Are you sure you want to DELETE ALL scripted objects owned by +** [AVATAR_NAME] ** +on ALL LAND in this sim? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="GodDeleteAllObjectsByUser" + type="alertmodal"> +Are you sure you want to DELETE ALL objects (scripted or not) owned by +** [AVATAR_NAME] ** +on ALL LAND in this sim? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="BlankClassifiedName" + type="alertmodal"> +You must specify a name for your classified. + </notification> + + <notification + icon="alertmodal.tga" + name="MinClassifiedPrice" + type="alertmodal"> +Price to pay for listing must be at least L$[MIN_PRICE]. + +Please enter a higher price. + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmObjectDeleteLock" + type="alertmodal"> +At least one of the items you have selected is locked. + +Are you sure you want to delete these items? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmObjectDeleteNoCopy" + type="alertmodal"> +At least one of the items you have selected is not copyable. + +Are you sure you want to delete these items? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmObjectDeleteNoOwn" + type="alertmodal"> +You do not own least one of the items you have selected. + +Are you sure you want to delete these items? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmObjectDeleteLockNoCopy" + type="alertmodal"> +At least one object is locked. +At least one object is not copyable. + +Are you sure you want to delete these items? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmObjectDeleteLockNoOwn" + type="alertmodal"> +At least one object is locked. +You do not own least one object. + +Are you sure you want to delete these items? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmObjectDeleteNoCopyNoOwn" + type="alertmodal"> +At least one object is not copyable. +You do not own least one object. + +Are you sure you want to delete these items? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmObjectDeleteLockNoCopyNoOwn" + type="alertmodal"> +At least one object is locked. +At least one object is not copyable. +You do not own least one object. + +Are you sure you want to delete these items? + <usetemplate + name="okcancelbuttons" + notext="cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmObjectTakeLock" + type="alertmodal"> +At least one object is locked. + +Are you sure you want to take these items? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmObjectTakeNoOwn" + type="alertmodal"> +You do not own all of the objects you are taking. +If you continue, next owner permissions will be applied and possibly restrict your ability to modify or copy them. + +Are you sure you want to take these items? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmObjectTakeLockNoOwn" + type="alertmodal"> +At least one object is locked. +You do not own all of the objects you are taking. +If you continue, next owner permissions will be applied and possibly restrict your ability to modify or copy them. +However, you can take the current selection. + +Are you sure you want to take these items? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="CantBuyLandAcrossMultipleRegions" + type="alertmodal"> +Unable to buy land because selection spans multiple regions. + +Please select a smaller area and try again. + </notification> + + <notification + icon="alertmodal.tga" + name="DeedLandToGroup" + type="alertmodal"> +By deeding this parcel, the group will be required to have and maintain sufficient land use credits. +The purchase price of the land is not refunded to the owner. If a deeded parcel is sold, the sale price will be divided evenly among group members. + +Deed this [AREA] m² of land to the group '[GROUP_NAME]'? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="DeedLandToGroupWithContribution" + type="alertmodal"> +By deeding this parcel, the group will be required to have and maintain sufficient land use credits. +The deed will include a simultaneous land contribution to the group from '[FIRST_NAME] [LAST_NAME]'. +The purchase price of the land is not refunded to the owner. If a deeded parcel is sold, the sale price will be divided evenly among group members. + +Deed this [AREA] m² of land to the group '[GROUP_NAME]'? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="DisplaySetToSafe" + type="alertmodal"> +Display settings have been set to safe levels because you have specified the -safe option. + </notification> + + <notification + icon="alertmodal.tga" + name="DisplaySetToRecommended" + type="alertmodal"> +Display settings have been set to recommended levels based on your system configuration. + </notification> + + <notification + icon="alertmodal.tga" + name="ErrorMessage" + type="alertmodal"> +[ERROR_MESSAGE] + </notification> + + <notification + icon="alertmodal.tga" + name="AvatarMovedDesired" + type="alertmodal"> +Your desired location is not currently available. +You have been moved into a nearby region. + </notification> + + <notification + icon="alertmodal.tga" + name="AvatarMovedLast" + type="alertmodal"> +Your last location is not currently available. +You have been moved into a nearby region. + </notification> + + <notification + icon="alertmodal.tga" + name="AvatarMovedHome" + type="alertmodal"> +Your home location is not currently available. +You have been moved into a nearby region. +You may want to set a new home location. + </notification> + + <notification + icon="alertmodal.tga" + name="ClothingLoading" + type="alertmodal"> +Your clothing is still downloading. +You can use [SECOND_LIFE] normally and other users will see you correctly. + <form name="form"> + <ignore name="ignore" + text="When clothing is taking a long time to download"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="FirstRun" + type="alertmodal"> +[SECOND_LIFE] installation is complete. + +If this is your first time using [SECOND_LIFE], you will need to create an account before you can log on. +Return to www.secondlife.com to create a new account? + <usetemplate + name="okcancelbuttons" + notext="Continue" + yestext="New Account..."/> + </notification> + + <notification + icon="alertmodal.tga" + name="LoginPacketNeverReceived" + type="alertmodal"> +We're having trouble connecting. There may be a problem with your internet connection or the Second Life servers. + +You can either check your internet connection and try again in a few minutes, click Help to connect to our support site, or click Teleport to attempt to teleport home. + <url option="1"> + + http://secondlife.com/support/ + </url> + <form name="form"> + <button + default="true" + index="0" + name="OK" + text="OK"/> + <button + index="1" + name="Help" + text="Help"/> + <button + index="2" + name="Teleport" + text="Teleport"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="WelcomeChooseSex" + type="alertmodal"> +Your character will appear in a moment. + +Use arrow keys to walk. +Press the F1 key at any time for help or to learn more about [SECOND_LIFE]. +Please choose the male or female avatar. You can change your mind later. + <usetemplate + name="okcancelbuttons" + notext="Female" + yestext="Male"/> + </notification> + + <notification + icon="alertmodal.tga" + name="NotEnoughCurrency" + type="alertmodal"> +[NAME] L$ [PRICE] You don't have enough L$ to do that. + </notification> + + <notification + icon="alertmodal.tga" + name="GrantedModifyRights" + type="alertmodal"> +You have been granted the privilege to modify [FIRST_NAME] [LAST_NAME]'s objects. + </notification> + + <notification + icon="alertmodal.tga" + name="RevokedModifyRights" + type="alertmodal"> +Your privilege to modify [FIRST_NAME] [LAST_NAME]'s objects has been revoked + </notification> + + <notification + icon="alertmodal.tga" + name="FlushMapVisibilityCaches" + type="alertmodal"> +This will flush the map caches on this region. +This is really only useful for debugging. +(In production, wait 5 minutes, then everyone's map will update after they relog.) + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="BuyOneObjectOnly" + type="alertmodal"> +Unable to buy more than one object at a time. Please select only one object and try again. + </notification> + + <notification + icon="alertmodal.tga" + name="OnlyCopyContentsOfSingleItem" + type="alertmodal"> +Unable to copy the contents of more than one item at a time. +Please select only one object and try again. + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="KickUsersFromRegion" + type="alertmodal"> +Teleport all Residents in this region home? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="EstateObjectReturn" + type="alertmodal"> +Are you sure you want to return objects owned by [USER_NAME]? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="InvalidTerrainBitDepth" + type="alertmodal"> +Couldn't set region textures: +Terrain texture [TEXTURE_NUM] has an invalid bit depth of [TEXTURE_BIT_DEPTH]. + +Replace texture [TEXTURE_NUM] with a 24-bit 512x512 or smaller image then click "Apply" again. + </notification> + + <notification + icon="alertmodal.tga" + name="InvalidTerrainSize" + type="alertmodal"> +Couldn't set region textures: +Terrain texture [TEXTURE_NUM] is too large at [TEXTURE_SIZE_X]x[TEXTURE_SIZE_Y]. + +Replace texture [TEXTURE_NUM] with a 24-bit 512x512 or smaller image then click "Apply" again. + </notification> + + <notification + icon="alertmodal.tga" + name="RawUploadStarted" + type="alertmodal"> +Upload started. It may take up to two minutes, depending on your connection speed. + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmBakeTerrain" + type="alertmodal"> +Do you really want to bake the current terrain, make it the center for terrain raise/lower limits and the default for the 'Revert' tool? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="MaxAllowedAgentOnRegion" + type="alertmodal"> +You can only have [MAX_AGENTS] Allowed Residents. + </notification> + + <notification + icon="alertmodal.tga" + name="MaxBannedAgentsOnRegion" + type="alertmodal"> +You can only have [MAX_BANNED] Banned Residents. + </notification> + + <notification + icon="alertmodal.tga" + name="MaxAgentOnRegionBatch" + type="alertmodal"> +Failure while attempting to add [NUM_ADDED] agents: +Exceeds the [MAX_AGENTS] [LIST_TYPE] limit by [NUM_EXCESS]. + </notification> + + <notification + icon="alertmodal.tga" + name="MaxAllowedGroupsOnRegion" + type="alertmodal"> +You can only have [MAX_GROUPS] Allowed Groups. + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Bake"/> + </notification> + + <notification + icon="alertmodal.tga" + name="MaxManagersOnRegion" + type="alertmodal"> +You can only have [MAX_MANAGER] Estate Managers. + </notification> + + <notification + icon="alertmodal.tga" + name="OwnerCanNotBeDenied" + type="alertmodal"> +Can't add estate owner to estate 'Banned Resident' list. + </notification> + + <notification + icon="alertmodal.tga" + name="CanNotChangeAppearanceUntilLoaded" + type="alertmodal"> +Can't change appearance until clothing and shape are loaded. + </notification> + + <notification + icon="alertmodal.tga" + name="ClassifiedMustBeAlphanumeric" + type="alertmodal"> +The name of your classified must start with a letter from A to Z or a number. No punctuation is allowed. + </notification> + + <notification + icon="alertmodal.tga" + name="CantSetBuyObject" + type="alertmodal"> +Can't set Buy Object, because the object is not for sale. +Please set the object for sale and try again. + </notification> + + <notification + icon="alertmodal.tga" + name="FinishedRawDownload" + type="alertmodal"> +Finished download of raw terrain file to: +[DOWNLOAD_PATH]. + </notification> + + <notification + icon="alertmodal.tga" + name="DownloadWindowsMandatory" + type="alertmodal"> +A new version of [SECOND_LIFE] is available. +[MESSAGE] +You must download this update to use [SECOND_LIFE]. + <usetemplate + name="okcancelbuttons" + notext="Quit" + yestext="Download"/> + </notification> + + <notification + icon="alertmodal.tga" + name="DownloadWindows" + type="alertmodal"> +An updated version of [SECOND_LIFE] is available. +[MESSAGE] +This update is not required, but we suggest you install it to improve performance and stability. + <usetemplate + name="okcancelbuttons" + notext="Continue" + yestext="Download"/> + </notification> + + <notification + icon="alertmodal.tga" + name="DownloadWindowsReleaseForDownload" + type="alertmodal"> +An updated version of [SECOND_LIFE] is available. +[MESSAGE] +This update is not required, but we suggest you install it to improve performance and stability. + <usetemplate + name="okcancelbuttons" + notext="Continue" + yestext="Download"/> + </notification> + + <notification + icon="alertmodal.tga" + name="DownloadMacMandatory" + type="alertmodal"> +A new version of [SECOND_LIFE] is available. +[MESSAGE] +You must download this update to use [SECOND_LIFE]. + +Download to your Applications folder? + <usetemplate + name="okcancelbuttons" + notext="Quit" + yestext="Download"/> + </notification> + + <notification + icon="alertmodal.tga" + name="DownloadMac" + type="alertmodal"> +An updated version of [SECOND_LIFE] is available. +[MESSAGE] +This update is not required, but we suggest you install it to improve performance and stability. + +Download to your Applications folder? + <usetemplate + name="okcancelbuttons" + notext="Continue" + yestext="Download"/> + </notification> + + <notification + icon="alertmodal.tga" + name="DownloadMacReleaseForDownload" + type="alertmodal"> +An updated version of [SECOND_LIFE] is available. +[MESSAGE] +This update is not required, but we suggest you install it to improve performance and stability. + +Download to your Applications folder? + <usetemplate + name="okcancelbuttons" + notext="Continue" + yestext="Download"/> + </notification> + + <notification + icon="alertmodal.tga" + name="DeedObjectToGroup" + type="alertmodal"> +Deeding this object will cause the group to: +* Receive L$ paid into the object + <usetemplate + ignoretext="When deeding objects to groups" + name="okcancelignore" + notext="Cancel" + yestext="Deed"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WebLaunchExternalTarget" + type="alertmodal"> +Open your system Web browser to view this content? + <usetemplate + ignoretext="When opening your system browser to view a Web page" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WebLaunchJoinNow" + type="alertmodal"> +Go to www.secondlife.com to manage your account? + <usetemplate + ignoretext="When launching web browser to manage your account" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WebLaunchBugReport101" + type="alertmodal"> +Visit the [SECOND_LIFE] Wiki and learn how to report bugs correctly. + <usetemplate + ignoretext="When launching web browser to view the Bug Reporting 101 Wiki" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WebLaunchSecurityIssues" + type="alertmodal"> +Visit the [SECOND_LIFE] Wiki for details of how to report a security issue. + <usetemplate + ignoretext="When launching web browser to view Security Issues Wiki" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WebLaunchQAWiki" + type="alertmodal"> +Visit the [SECOND_LIFE] QA Wiki. + <usetemplate + ignoretext="When launching web browser to view the QA Wiki" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WebLaunchPublicIssue" + type="alertmodal"> +Visit the [SECOND_LIFE] Public Issue Tracker, where you can report bugs and other issues. + <usetemplate + ignoretext="When launching web browser to view the Public Issue Tracker" + name="okcancelignore" + notext="Cancel" + yestext="Go to page"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WebLaunchPublicIssueHelp" + type="alertmodal"> +Visit the [SECOND_LIFE] Wiki for info on how to use the Public Issue Tracker. + <usetemplate + ignoretext="When launching web browser to view Public Issue Tracker Wiki" + name="okcancelignore" + notext="Cancel" + yestext="Go to page"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WebLaunchSupportWiki" + type="alertmodal"> +Go to the Official Linden Blog, for the latest news and information. + <usetemplate + ignoretext="When launching web browser to view the blog" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WebLaunchLSLGuide" + type="alertmodal"> +Go to the Scripting Guide for scripting help? + <usetemplate + ignoretext="When launching web browser to view the Scripting Guide" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WebLaunchLSLWiki" + type="alertmodal"> +Go to the LSL Portal for scripting help? + <usetemplate + ignoretext="When launching web browser to view the LSL Portal" + name="okcancelignore" + notext="Cancel" + yestext="Go to page"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ReturnToOwner" + type="alertmodal"> +Are you sure you want to return the selected objects to their owners? Transferable deeded objects will be returned to their previous owners. + +*WARNING* No-transfer deeded objects will be deleted! + <usetemplate + ignoretext="When returning objects to their owners" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alert.tga" + name="GroupLeaveConfirmMember" + type="alert"> +You are currently a member of the group [GROUP]. +Leave Group? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alert.tga" + name="ConfirmKick" + type="alert"> +Do you REALLY want to kick all users off the grid? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Kick All Users"/> + </notification> + + <notification + icon="alertmodal.tga" + name="MuteLinden" + type="alertmodal"> +Sorry, you cannot mute a Linden. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="CannotStartAuctionAlreadyForSale" + type="alertmodal"> +You cannot start an auction on a parcel which is already set for sale. Disable the land sale if you are sure you want to start an auction. + </notification> + + <notification + icon="alertmodal.tga" + label="Mute object by name failed" + name="MuteByNameFailed" + type="alertmodal"> +You already have muted this name. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alert.tga" + name="RemoveItemWarn" + type="alert"> +Though permitted, deleting contents may damage the object. Do you want to delete that item? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alert.tga" + name="CantOfferCallingCard" + type="alert"> +Cannot offer a calling card at this time. Please try again in a moment. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alert.tga" + name="CantOfferFriendship" + type="alert"> +Cannot offer friendship at this time. Please try again in a moment. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alert.tga" + name="BusyModeSet" + type="alert"> +Busy mode set. +Chat and instant messages will be hidden. Instant messages will get your Busy mode response. All teleportation offers will be declined. All inventory offers will go to your Trash. + <usetemplate + ignoretext="When setting busy mode" + name="okignore" + yestext="OK"/> + </notification> + + <notification + icon="alert.tga" + name="JoinedTooManyGroupsMember" + type="alert"> +You are a member of too many groups to join another one. Please leave at least one group before joining this one, or decline the offer. +To leave a group select the 'Groups...' option from the 'Edit' menu. +[NAME] has invited you to join a group as a member. +[INVITE] + <usetemplate + name="okcancelbuttons" + notext="Decline" + yestext="Join"/> + </notification> + + <notification + icon="alert.tga" + name="KickUser" + type="alert"> +Kick this user with what message? + <form name="form"> + <input name="message" type="text"> +An administrator has logged you off. + </input> + <button + default="true" + index="0" + name="OK" + text="OK"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alert.tga" + name="KickAllUsers" + type="alert"> +Kick everyone currently on the grid with what message? + <form name="form"> + <input name="message" type="text"> +An administrator has logged you off. + </input> + <button + default="true" + index="0" + name="OK" + text="OK"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alert.tga" + name="FreezeUser" + type="alert"> +Freeze this user with what message? + <form name="form"> + <input name="message" type="text"> +You have been frozen. You cannot move or chat. An administrator will contact you via instant message (IM). + </input> + <button + default="true" + index="0" + name="OK" + text="OK"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alert.tga" + name="UnFreezeUser" + type="alert"> +Unfreeze this user with what message? + <form name="form"> + <input name="message" type="text"> +You are no longer frozen. + </input> + <button + default="true" + index="0" + name="OK" + text="OK"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="OfferTeleport" + type="alertmodal"> +Offer a teleport to your location with the following message? + <form name="form"> + <input name="message" type="text"> +Join me in [REGION] + </input> + <button + default="true" + index="0" + name="OK" + text="OK"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="OfferTeleportFromGod" + type="alertmodal"> +God summon user to your location? + <form name="form"> + <input name="message" type="text"> +Join me in [REGION] + </input> + <button + default="true" + index="0" + name="OK" + text="OK"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="TeleportFromLandmark" + type="alertmodal"> +Are you sure you want to teleport? + <usetemplate + ignoretext="When teleporting from a landmark in inventory" + name="okcancelignore" + notext="Cancel" + yestext="Teleport"/> + </notification> + + <notification + icon="alert.tga" + label="Message everyone in your Estate" + name="MessageEstate" + type="alert"> +Type a short announcement which will be sent to everyone currently in your estate. + <form name="form"> + <input name="message" type="text"/> + <button + default="true" + index="0" + name="OK" + text="OK"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alert.tga" + label="Change Linden Estate" + name="ChangeLindenEstate" + type="alert"> +You are about to change a Linden owned estate (mainland, teen grid, orientation, etc.). + +This is EXTREMELY DANGEROUS because it can fundamentally affect the user experience. On the mainland, it will change thousands of regions and make the spaceserver hiccup. + +Proceed? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alert.tga" + label="Change Linden Estate Access" + name="ChangeLindenAccess" + type="alert"> +You are about to change the access list for a Linden owned estate (mainland, teen grid, orientation, etc.). + +This is DANGEROUS and should only be done to invoke the hack allowing objects/L$ to be transfered in/out of a grid. +It will change thousands of regions and make the spaceserver hiccup. + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alert.tga" + label="Select estate" + name="EstateAllowedAgentAdd" + type="alert"> +Add to allowed list for this estate only or for [ALL_ESTATES]? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="All Estates" + yestext="This Estate"/> + </notification> + + <notification + icon="alert.tga" + label="Select estate" + name="EstateAllowedAgentRemove" + type="alert"> +Remove from allowed list for this estate only or for [ALL_ESTATES]? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="All Estates" + yestext="This Estate"/> + </notification> + + <notification + icon="alert.tga" + label="Select estate" + name="EstateAllowedGroupAdd" + type="alert"> +Add to group allowed list for this estate only or for [ALL_ESTATES]? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="All Estates" + yestext="This Estate"/> + </notification> + + <notification + icon="alert.tga" + label="Select estate" + name="EstateAllowedGroupRemove" + type="alert"> +Remove from group allowed list for this estate only or [ALL_ESTATES]? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="All Estates" + yestext="This Estate"/> + </notification> + + <notification + icon="alert.tga" + label="Select estate" + name="EstateBannedAgentAdd" + type="alert"> +Deny access for this estate only or for [ALL_ESTATES]? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="All Estates" + yestext="This Estate"/> + </notification> + + <notification + icon="alert.tga" + label="Select estate" + name="EstateBannedAgentRemove" + type="alert"> +Remove this Resident from the ban list for access for this estate only or for [ALL_ESTATES]? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="All Estates" + yestext="This Estate"/> + </notification> + + <notification + icon="alert.tga" + label="Select estate" + name="EstateManagerAdd" + type="alert"> +Add estate manager for this estate only or for [ALL_ESTATES]? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="All Estates" + yestext="This Estate"/> + </notification> + + <notification + icon="alert.tga" + label="Select estate" + name="EstateManagerRemove" + type="alert"> +Remove estate manager for this estate only or for [ALL_ESTATES]? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="All Estates" + yestext="This Estate"/> + </notification> + + <notification + icon="alert.tga" + label="Confirm Kick" + name="EstateKickUser" + type="alert"> +Kick [EVIL_USER] from this estate? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="EstateChangeCovenant" + type="alertmodal"> +Are you sure you want to change the Estate Covenant? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="RegionEntryAccessBlocked" + type="alertmodal"> +You are not allowed in that Region due to your maturity Rating. This may be a result of a lack of information validating your age. + +Please verify you have the latest Viewer installed, and go to the Knowledge Base for details on accessing areas with this maturity rating. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="RegionEntryAccessBlocked_KB" + type="alertmodal"> +You are not allowed in that region due to your maturity Rating. + +Go to the Knowledge Base for more information about maturity Ratings? + <url option="0" name="url"> + https://support.secondlife.com/ics/support/default.asp?deptID=4417&task=knowledge&questionID=6010 + </url> + <usetemplate + name="okcancelignore" + yestext="Go to Knowledge Base" + notext="Close" + ignoretext="When Region entry is blocked due to maturity Rating"/> + </notification> + + <notification + icon="notifytip.tga" + name="RegionEntryAccessBlocked_Notify" + type="notifytip"> +You are not allowed in that region due to your maturity Rating. + </notification> + + <notification + icon="alertmodal.tga" + name="RegionEntryAccessBlocked_Change" + type="alertmodal"> +You are not allowed in that Region due to your maturity Rating preference. + +You can click 'Change Preference' to raise your maturity Rating preference now and allow you to enter. You will be able to search and access [REGIONMATURITY] content from now on. If you later want to change this setting back, go to Edit > Preferences... > General. + <form name="form"> + <button + index="0" + name="OK" + text="Change Preference"/> + <button + default="true" + index="1" + name="Cancel" + text="Close"/> + <ignore name="ignore" text="When Region entry is blocked due to maturity Rating preference"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="LandClaimAccessBlocked" + type="alertmodal"> +You cannot claim this land due to your maturity Rating. This may be a result of a lack of information validating your age. + +Please verify you have the latest Viewer installed, and go to the Knowledge Base for details on accessing areas with this maturity rating. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="LandClaimAccessBlocked_KB" + type="alertmodal"> +You cannot claim this land due to your maturity Rating. + +Go to the Knowledge Base for more information about maturity Ratings? + <url option="0" name="url"> + https://support.secondlife.com/ics/support/default.asp?deptID=4417&task=knowledge&questionID=6010 + </url> + <usetemplate + name="okcancelignore" + yestext="Go to Knowledge Base" + notext="Close" + ignoretext="When claiming land is blocked due to maturity Rating"/> + </notification> + + <notification + icon="notifytip.tga" + name="LandClaimAccessBlocked_Notify" + type="notifytip"> +You cannot claim this land due to your maturity Rating. + </notification> + + <notification + icon="alertmodal.tga" + name="LandClaimAccessBlocked_Change" + type="alertmodal"> +You cannot claim this land due to your maturity Rating preference. + +You can click 'Change Preference' to raise your maturity Rating preference now and allow you to enter. You will be able to search and access [REGIONMATURITY] content from now on. If you later want to change this setting back, go to Edit > Preferences... > General. + <usetemplate + name="okcancelignore" + yestext="Change Preference" + notext="Close" + ignoretext="When claiming land is blocked due to maturity Rating preference"/> + </notification> + + <notification + icon="alertmodal.tga" + name="LandBuyAccessBlocked" + type="alertmodal"> +You cannot buy this land due to your maturity Rating. This may be a result of a lack of information validating your age. + +Please verify you have the latest Viewer installed, and go to the Knowledge Base for details on accessing areas with this maturity rating. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="LandBuyAccessBlocked_KB" + type="alertmodal"> +You cannot buy this land due to your maturity Rating. + +Go to the Knowledge Base for more information about maturity Ratings? + <url option="0" name="url"> + https://support.secondlife.com/ics/support/default.asp?deptID=4417&task=knowledge&questionID=6010 + </url> + <usetemplate + name="okcancelignore" + yestext="Go to Knowledge Base" + notext="Close" + ignoretext="When a Land purchase is blocked due to maturity Rating"/> + </notification> + + <notification + icon="notifytip.tga" + name="LandBuyAccessBlocked_Notify" + type="notifytip"> +You cannot buy this land due to your maturity Rating. + </notification> + + <notification + icon="alertmodal.tga" + name="LandBuyAccessBlocked_Change" + type="alertmodal"> +You cannot buy this land due to your maturity Rating preference. + +You can click 'Change Preference' to raise your maturity Rating preference now and allow you to enter. You will be able to search and access [REGIONMATURITY] content from now on. If you later want to change this setting back, go to Edit > Preferences... > General. + <usetemplate + name="okcancelignore" + yestext="Change Preference" + notext="Close" + ignoretext="When a Land purchase is blocked due to maturity Rating preference"/> + </notification> + + <notification + icon="alertmodal.tga" + name="TooManyPrimsSelected" + type="alertmodal"> + "There are too many prims selected. Please select [MAX_PRIM_COUNT] or fewer prims and try again" + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ProblemImportingEstateCovenant" + type="alertmodal"> +Problem importing estate covenant. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ProblemAddingEstateManager" + type="alertmodal"> +Problems adding a new estate manager. One or more estates may have a full manager list. + </notification> + + <notification + icon="alertmodal.tga" + name="ProblemAddingEstateGeneric" + type="alertmodal"> +Problems adding to this estate list. One or more estates may have a full list. + </notification> + + <notification + icon="alertmodal.tga" + name="UnableToLoadNotecardAsset" + type="alertmodal"> +Unable to load notecard's asset at this time. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="NotAllowedToViewNotecard" + type="alertmodal"> +Insufficient permissions to view notecard associated with asset ID requested. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="MissingNotecardAssetID" + type="alertmodal"> +Asset ID for notecard is missing from database. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alert.tga" + name="PublishClassified" + type="alert"> +Remember: Classified ad fees are non-refundable. + +Publish this classified now for L$[AMOUNT]? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="SetClassifiedMature" + type="alertmodal"> +Does this classified contain Mature content? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="SetGroupMature" + type="alertmodal"> +Does this group contain Mature content? + <usetemplate + canceltext="Cancel" + name="yesnocancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alert.tga" + label="Confirm restart" + name="ConfirmRestart" + type="alert"> +Do you really want to restart this region in 2 minutes? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alert.tga" + label="Message everyone in this region" + name="MessageRegion" + type="alert"> +Type a short announcement which will be sent to everyone in this region. + <form name="form"> + <input name="message" type="text"/> + <button + default="true" + index="0" + name="OK" + text="OK"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + label="Block Terraform" + name="HelpRegionBlockTerraform" + type="alertmodal"> +If this box is checked, land owners will not be able to terraform their land regardless of the per-parcel 'Edit Terrain' setting. + +Default: off + </notification> + + <notification + icon="alertmodal.tga" + label="Block Fly" + name="HelpRegionBlockFly" + type="alertmodal"> +If this box is checked, people will not be able to fly in this region regardless of the per-parcel 'Fly' setting. + +Default: off + </notification> + + <notification + icon="alertmodal.tga" + label="Bulk Change Content Permissions" + name="HelpBulkPermission" + type="alertmodal"> +The Bulk Permissions tool helps you to quickly change the permissions on multiple items in the contents of the selected object(s). However, please note that you are only setting permissions on the items in the Contents of the selected objects -- not permissions on the container object(s) themselves. + +Also note, the permissions are not applied to the nested contents of any of the contained items. Your request only operates on items exactly one level deep. + +You can selectively choose which types of items to modify by using the checklist under 'Content Types' here. Snapshots are included when you select Textures. + +* This tool will only succeed at changing permissions on items you are allowed to change. +* You cannot grant any Next owner permissions which you do not already have. +* The Next owner permissions are merely requests. If any item cannot take all of the new permissions, none of its permissions will change. + +When you are ready to change the permissions in bulk, click 'Apply' and wait for the results to display. + +If you close the Bulk Permissions window while permissions are being changed, it will halt the operation. + </notification> + + <notification + icon="alertmodal.tga" + label="Allow Damage" + name="HelpRegionAllowDamage" + type="alertmodal"> +If this box is checked, the health system across all parcels regardless of individual parcel settings. If this box is left unchecked, individual parcel owners will still be able to activate the health system on their parcels. + +Default: off + </notification> + + <notification + icon="alertmodal.tga" + label="Agent Limit" + name="HelpRegionAgentLimit" + type="alertmodal"> +Sets the maximum number of avatars allowed in this region. +Performance may vary depending on the number avatars present. + +Default: 40 + </notification> + + <notification + icon="alertmodal.tga" + label="Object Bonus" + name="HelpRegionObjectBonus" + type="alertmodal"> +The Object Bonus is a multiplier for primitives allowed on any given parcel. The range allowed is 1 to 10. Set at '1', each 512m² parcel is allowed 117 objects. Set at '2', each 512m² parcel is allowed 234, or twice as many, and so on. The max number of objects allowed per region remains 15,000 no matter what the Object Bonus is. Once set, be aware that lowering the Object Bonus may cause objects to be returned or deleted. + +Default: 1.0 + </notification> + + <notification + icon="alertmodal.tga" + label="Maturity" + name="HelpRegionMaturity" + type="alertmodal"> +Sets the maturity Rating of the Region, as shown in the menu bar at the top of any Resident's viewer, and in tooltips on the World Map when the cursor hovers over this Region. This setting also affects access to this Region and search results. Other Residents may only enter Regions or view search results with the same maturity Ratings they have chosen in their preferences. + +It may take some time for this change to be reflected on the map. + </notification> + + <notification + icon="alertmodal.tga" + label="Restrict Pushing" + name="HelpRegionRestrictPushObject" + type="alertmodal"> +This checkbox sets the full region to restricted push permissions. +When enabled, Residents may only be pushed by themselves or by the parcel's owner. +(Push refers to the llPushObject() LSL function.) + +Default: Off + </notification> + + <notification + icon="alertmodal.tga" + label="Parcel Join/Subdivide" + name="HelpParcelChanges" + type="alertmodal"> +This checkbox sets whether or not parcels not owned by the estate owner can be joined or subdivided. +If this option is unchecked: + * Only estate owners or managers can join or subdivide parcels. + * They may only join or subdivide parcels belonging to the owner, or to a group where they have the appropriate group powers. +If this option is checked: + * All parcel owners can join or subdivide the parcels they own. + * For group owned parcels, those with appropriate group powers may join or subdivide parcels. + +Default: Checked + </notification> + + <notification + icon="alertmodal.tga" + label="Do Not Show In Search" + name="HelpRegionSearch" + type="alertmodal"> +Checking this box will block parcel owners from listing their parcels in search. + +Default: Off + </notification> + + <notification + icon="alertmodal.tga" + label="Changed Region Maturity" + name="RegionMaturityChange" + type="alertmodal"> +The maturity rating for this region has been updated. +It may take some time for the change to be reflected on the map. + </notification> + + <notification + icon="alertmodal.tga" + label="Land Resale" + name="HelpRegionLandResell" + type="alertmodal"> +Estate owners and managers can sell any land owned by the estate owner. +If this option is left unchecked, buyers cannot resell their land in this region. +If this option is checked, buyers can resell their land in this region. + +Default: Disallow + </notification> + + <notification + icon="alertmodal.tga" + label="Disable Scripts" + name="HelpRegionDisableScripts" + type="alertmodal"> +When sim performance is poor, a script may be to blame. Open the Statistics Bar (Ctrl-Shift-1). Look at the Simulator Physics FPS. +If it is lower than 45, open the Time panel located at the bottom of the Stats Bar. If Script Time reads 25 ms or higher, click the Get Top Scripts button. You will be given the name and location of scripts that may be causing poor performance. + +Checking the Disable Scripts box and then pressing the Apply button will temporarily disable all scripts in this region. You may need to do this in order to travel to the location of a noted 'top script'. Once you have arrived at the location, investigate the script to determine if it is causing the problem. You may want to contact the owner of the script or delete or return the object. +Uncheck the Disable Script box and then Apply to reactivate the scripts in the region. + +Default: off + </notification> + + <notification + icon="alertmodal.tga" + label="Disable Collisions" + name="HelpRegionDisableCollisions" + type="alertmodal"> +When sim performance is poor, physical objects may be to blame. +Open the Statistics Bar (Ctrl-Shift-1). Look at the Simulator Physics FPS. If it is lower than 45, open the Time panel located at the bottom of the Stats Bar. If Sim Time (Physics) reads 20 ms or higher, click the Get Top Colliders button. +You will be given the name and location of physical objects that may be causing poor performance. + +Checking the Disable Collisions box and then pressing the Apply button will temporarily disable object-object collisions. You may need to do this in order to travel to the location of a noted 'top collider'. Once you have arrived at the location, investigate the object - is it constantly colliding with other objects? You may want to contact the owner of the object or delete or return the object. +Uncheck the Disable Collisions box and then Apply to reactivate collisions in the region. + +Default: off + </notification> + + <notification + icon="alertmodal.tga" + label="Disable Physics" + name="HelpRegionDisablePhysics" + type="alertmodal"> +Disable Physics is similar to Disable Collisions, except all physics simulation is disabled. This means that not only will objects stop colliding, but avatars will be unable to move. + +This should only be used when Disable Collisions does not give back enough performance to the region to investigate a physics problem or Top Collider. + +Be sure to re-enable physics when you are done, or avatars will continue to be unable to move. + +Default: off + </notification> + + <notification + icon="alertmodal.tga" + label="Top Colliders" + name="HelpRegionTopColliders" + type="alertmodal"> +Show a list of objects experiencing the greatest number of potential object-object collisions. These objects can slow performance. Select View > Statistics Bar and look under Simulator > Time > Sim Time (Physics) to see if more than 20 ms is being spent in physics. + </notification> + + <notification + icon="alertmodal.tga" + label="Top Scripts" + name="HelpRegionTopScripts" + type="alertmodal"> +Show a list of objects spending the most time running LSL scripts. These objects can slow performance. +Select View > Statistics Bar and look under Simulator > Time > Script Time to see if more than 25 ms is being spent in scripts. + </notification> + + <notification + icon="alertmodal.tga" + label="Restart Region" + name="HelpRegionRestart" + type="alertmodal"> +Restart the server process running this region after a two minute warning. All Residents in the region will be disconnected. The region will save its data, and should come back up within 90 seconds. + +Restarting the region will not fix most performance problems, and should usually be used only when directed. + </notification> + + <notification + icon="alertmodal.tga" + label="Water Height" + name="HelpRegionWaterHeight" + type="alertmodal"> +This is the height in meters where water appears. If this setting is anything other than 20 and you have water that is adjacent to the edge of world or 'void' water, there will be a visible gap. + +Default: 20 + </notification> + + <notification + icon="alertmodal.tga" + label="Terrain Raise" + name="HelpRegionTerrainRaise" + type="alertmodal"> +This is the distance in meters that parcel owners can raise their terrain above the 'baked' terrain default height. + +Default: 4 + </notification> + + <notification + icon="alertmodal.tga" + label="Terrain Lower" + name="HelpRegionTerrainLower" + type="alertmodal"> +This is the distance in meters that parcel owners can lower their terrain below the 'baked' terrain default height. + +Default: -4 + </notification> + + <notification + icon="alertmodal.tga" + label="Upload RAW Terrain" + name="HelpRegionUploadRaw" + type="alertmodal"> +This button uploads a .RAW file to the region you are in. +The file must have the correct dimensions (RGB, 256x256) and 13 channels. The best way to create a terrain file is to download the existing RAW file. A good first step is to modify the red channel (land height), and upload it. + +The upload can take up to 45 seconds. Note that uploading a terrain file *will not* move the objects that are on the land, only the terrain itself and the permissions associated with the parcels. This can result in objects going underground. + +For more information on editing region height fields, consult F1 Help. + </notification> + + <notification + icon="alertmodal.tga" + label="Download RAW Terrain" + name="HelpRegionDownloadRaw" + type="alertmodal"> +This button downloads a file containing the height field data, parcel dimensions, parcel for sale status and some parcel permissions for this region. When opening the file in a program such as Photoshop you must specify the document's dimensions which are: RGB, 256x256 with 13 channels. This terrain file cannot be opened in any other way. + +For more information on editing region height fields, consult F1 help. + </notification> + + <notification + icon="alertmodal.tga" + label="Use Estate Sun" + name="HelpRegionUseEstateSun" + type="alertmodal"> +This checkbox makes the sun position in this region the same as the sun position in the rest of the estate. + +Default: on + </notification> + + <notification + icon="alertmodal.tga" + label="Fixed Sun" + name="HelpRegionFixedSun" + type="alertmodal"> +This checkbox sets the sun position to the position in the Phase slider and stops the sun from moving. + +Default: off + </notification> + + <notification + icon="alertmodal.tga" + label="Bake Terrain" + name="HelpRegionBakeTerrain" + type="alertmodal"> +This button saves the current shape of the terrain as the new default for the region. Once baked, the land can revert to the saved shape whenever you or others use the Edit Terrain 'Revert' option. The baked terrain is also the middle point for the terrain raise and lower limits. + </notification> + + <notification + icon="alertmodal.tga" + label="Estate Managers" + name="HelpEstateEstateManager" + type="alertmodal"> +An estate manager is a Resident to whom you have delegated control of region and estate settings. An estate manager can change any setting in these panels, except for uploading, downloading, and baking terrain. In particular, they can allow or ban Residents from your estate. + +Estate managers can only be added or removed by the owner of the estate, not by each other. Please only choose Residents you trust as estate managers, as you will be ultimately responsible for their actions. + </notification> + + <notification + icon="alertmodal.tga" + label="Use Global Time" + name="HelpEstateUseGlobalTime" + type="alertmodal"> +This checkbox makes the sun in your estate follow the same position as on the Linden-owned 'mainland' estates. + +Default: on + </notification> + + <notification + icon="alertmodal.tga" + label="Fixed Sun" + name="HelpEstateFixedSun" + type="alertmodal"> +This checkbox sets the sun position to the position in the Phase slider and stops the sun from moving. + </notification> + + <notification + icon="alertmodal.tga" + label="Public Access" + name="HelpEstateExternallyVisible" + type="alertmodal"> +This checkbox sets whether Residents who are on other estates can enter this estate without being on an access list. + +Default: on + </notification> + + <notification + icon="alertmodal.tga" + label="Allow Direct Teleport" + name="HelpEstateAllowDirectTeleport" + type="alertmodal"> +When checked, allows Residents to directly teleport to any point in your estate. When unchecked, Residents teleport to the nearest telehub. + +Default: off + </notification> + + <notification + icon="alertmodal.tga" + label="Allow Access" + name="HelpEstateAllowResident" + type="alertmodal"> +Access to this estate will be limited to Residents listed here and any groups below. This setting is only available when Public Access is unchecked. + </notification> + + <notification + icon="alertmodal.tga" + label="Allow Group Access" + name="HelpEstateAllowGroup" + type="alertmodal"> +Access to this estate will be limited to groups listed here and any Residents above. This setting is only available when Public Access is unchecked. + </notification> + + <notification + icon="alertmodal.tga" + label="Abuse Email Address" + name="HelpEstateAbuseEmailAddress" + type="alertmodal"> +Setting this to a valid email address will cause abuse reports on this estate to be sent to that address. +Setting it blank will cause abuse reports to be sent only to Linden Lab. + </notification> + + <notification + icon="alertmodal.tga" + label="Deny Access" + name="HelpEstateBanResident" + type="alertmodal"> +Residents on this list are denied access to your estate, regardless of any other settings. + </notification> + + <notification + icon="alertmodal.tga" + label="Allow Voice Chat" + name="HelpEstateVoiceChat" + type="alertmodal"> +Parcels in this estate are allowed to have their own voice channels in which residents may hear and talk with others nearby. + +Default: off + </notification> + + <notification + icon="alertmodal.tga" + label="Voice Version Mismatch" + name="VoiceVersionMismatch" + type="alertmodal"> +This version of Second Life is not compatible with the Voice Chat feature in this region. In order for Voice Chat to function correctly you will need to update Second Life. + </notification> + + <notification + icon="alertmodal.tga" + label="Estate Covenant" + name="HelpEstateCovenant" + type="alertmodal"> +Setting an estate covenant enables you to sell parcels within that estate. If a covenant is not set, you cannot sell the land. The notecard for your covenant can be empty if you do not wish to apply any rules or advise buyers of anything in relation to the land before they buy it. + +A covenant can be used to communicate rules, guidelines, cultural information or simply your own expectations to the prospective buyer. This can include zoning, building regulations, payment options or any other information you feel it is important for the new owner to have seen and to have agreed to before they purchase. + +The buyer must agree to the covenant by ticking the check box before they will be able to finish the purchase. Estate covenants are always visible in the About Land dialog for any parcels that have one set. + </notification> + + <notification + icon="alertmodal.tga" + label="Can't Buy Objects" + name="BuyObjectOneOwner" + type="alertmodal"> +Cannot buy objects from different owners at the same time. +Please select only one object and try again. + </notification> + + <notification + icon="alertmodal.tga" + label="Can't Buy Contents" + name="BuyContentsOneOnly" + type="alertmodal"> +Unable to buy the contents of more than one object at a time. +Please select only one object and try again. + </notification> + + <notification + icon="alertmodal.tga" + label="Can't Buy Contents" + name="BuyContentsOneOwner" + type="alertmodal"> +Cannot buy objects from different owners at the same time. +Please select only one object and try again. + </notification> + + <notification + icon="alertmodal.tga" + name="BuyOriginal" + type="alertmodal"> +Buy original object from [OWNER] for L$[PRICE]? +You will become the owner of this object. +You will be able to: + Modify: [MODIFYPERM] + Copy: [COPYPERM] + Resell or Give Away: [RESELLPERM] + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="BuyOriginalNoOwner" + type="alertmodal"> +Buy original object for L$[PRICE]? +You will become the owner of this object. +You will be able to: + Modify: [MODIFYPERM] + Copy: [COPYPERM] + Resell or Give Away: [RESELLPERM] + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="BuyCopy" + type="alertmodal"> +Buy a copy from [OWNER] for L$[PRICE]? +The object will be copied to your inventory. +You will be able to: + Modify: [MODIFYPERM] + Copy: [COPYPERM] + Resell or Give Away: [RESELLPERM] + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="BuyCopyNoOwner" + type="alertmodal"> +Buy a copy for L$[PRICE]? +The object will be copied to your inventory. +You will be able to: + Modify: [MODIFYPERM] + Copy: [COPYPERM] + Resell or Give Away: [RESELLPERM] + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="BuyContents" + type="alertmodal"> +Buy contents from [OWNER] for L$[PRICE]? +They will be copied to your inventory. + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="BuyContentsNoOwner" + type="alertmodal"> +Buy contents for L$[PRICE]? +They will be copied to your inventory. + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmPurchase" + type="alertmodal"> +This transaction will: +[ACTION] + +Are you sure you want to proceed with this purchase? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmPurchasePassword" + type="password"> +This transaction will: +[ACTION] + +Are you sure you want to proceed with this purchase? +Please re-enter your password and click OK. + <form name="form"> + <input + name="message" + type="password"/> + <button + default="true" + index="0" + name="ConfirmPurchase" + text="OK"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alert.tga" + name="SetPickLocation" + type="alert"> +Note: +You have updated the location of this pick but the other details will retain their original values. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="MoveInventoryFromObject" + type="alertmodal"> +You have selected 'no copy' inventory items. +These items will be moved to your inventory, not copied. + +Move the inventory item(s)? + <usetemplate + ignoretext="When moving no-copy inventory from objects" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="MoveInventoryFromScriptedObject" + type="alertmodal"> +You have selected 'no copy' inventory items. These items will be moved to your inventory, not copied. +Because this object is scripted, moving these items to your inventory may cause the script to malfunction. + +Move the inventory item(s)? + <usetemplate + ignoretext="When moving no-copy inventory from scripted objects" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alert.tga" + name="ClickActionNotPayable" + type="alert"> +Warning: The Pay Object click action has been set, but it will only work if a script is added with a money() event. + <form name="form"> + <ignore name="ignore" + text="When Setting 'Pay' on objects without money() events"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="OpenObjectCannotCopy" + type="alertmodal"> +There are no items in this object that you are allowed to copy. + </notification> + + <notification + icon="alertmodal.tga" + name="WebLaunchAccountHistory" + type="alertmodal"> +Go to the Second Life web site to see your account history? + <usetemplate + ignoretext="When loading account history web page" + name="okcancelignore" + notext="Cancel" + yestext="Go to page"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ClickOpenF1Help" + type="alertmodal"> +Visit the Second Life Support Web site? + <usetemplate + ignoretext="When visiting the Second Life Support Website." + name="okcancelignore" + notext="Cancel" + yestext="Go"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmQuit" + type="alertmodal"> +Are you sure you want to quit? + <usetemplate + ignoretext="When Quitting Second Life." + name="okcancelignore" + notext="Continue" + yestext="Quit"/> + </notification> + + <notification + icon="alertmodal.tga" + name="HelpReportAbuseEmailLL" + type="alertmodal"> +Use this tool to report violations of the Terms of Service and Community Standards. See: + +http://secondlife.com/corporate/tos.php +http://secondlife.com/corporate/cs.php + +All reported abuses of the Terms of Service and Community Standards are investigated and resolved. You can view the incident resolution on the Incident Report at: + +http://secondlife.com/support/incidentreport.php + </notification> + + <notification + icon="alertmodal.tga" + name="HelpReportAbuseEmailEO" + type="alertmodal"> +IMPORTANT: This report will go to the owner of the region you are currently in and not to Linden Lab. + +As a service to residents and visitors, the owner of the region you are in has elected to receive and resolve all reports originating in this region. Linden Lab will not investigate reports you file from this location. + +The region owner will resolve reports based on the local rules of this region as outlined in the estate Covenant. +(View covenants by going to the World menu and selecting About Land.) + +The resolution of this report applies only to this Region; Residents access to other areas of Second Life will not be affected by the outcome of this report. Only Linden Lab can restrict access to the entirety of Second Life. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpReportBug" + type="alertmodal"> +Use this tool to *only* report technical features that do not perform as described or expected, please provide as much detail as possible. +You may reply to the auto-response email to add more details to your report. + +All bug reports are investigated and assessed. No email response will be sent. + +If you are having a technical difficulty, please contact Support at: + +http://secondlife.com/community/support.php + +Note: Incomplete reports will not be investigated + </notification> + + <notification + icon="alertmodal.tga" + name="HelpReportAbuseSelectCategory" + type="alertmodal"> +Please select a category for this abuse report. +Selecting a category helps us file and process abuse reports. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpReportBugSelectCategory" + type="alertmodal"> +Please select a category for this bug. +Selecting a category helps us file and process bug reports. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpReportAbuseAbuserNameEmpty" + type="alertmodal"> +Please enter the name of the abuser. +Entering an accurate value helps us file and process abuse reports. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpReportAbuseAbuserLocationEmpty" + type="alertmodal"> +Please enter the location where the abuse took place. +Entering an accurate value helps us file and process abuse reports. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpReportAbuseSummaryEmpty" + type="alertmodal"> +Please enter a summary of the abuse that took place. +Entering an accurate summary helps us file and process abuse reports. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpReportBugSummaryEmpty" + type="alertmodal"> +Please enter a summary of the bug. +Entering an accurate summary helps us file and process bug reports. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpReportAbuseDetailsEmpty" + type="alertmodal"> +Please enter a detailed description of the abuse that took place. +Be as specific as you can, including names and the details of the incident you are reporting. +Entering an accurate description helps us file and process abuse reports. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpReportBugDetailsEmpty" + type="alertmodal"> +Please enter a detailed description of the bug. +Be as specific as you can, including steps to reproduce the bug if possible. +Entering an accurate description helps us file and process bug reports. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpReportAbuseContainsCopyright" + type="alertmodal"> +Dear Resident, + +You appear to be reporting intellectual property infringement. Please make sure you are reporting it correctly: + +(1) The Abuse Process. You may submit an abuse report if you believe a Resident is exploiting the Second Life permissions system, for example, by using CopyBot or similar copying tools, to infringe intellectual property rights. The Abuse Team investigates and issues appropriate disciplinary action for behavior that violates the Second Life Community Standards or Terms of Service. However, the Abuse Team does not handle and will not respond to requests to remove content from the Second Life world. + +(2) The DMCA or Content Removal Process. To request removal of content from Second Life, you MUST submit a valid notification of infringement as provided in our DMCA Policy at http://secondlife.com/corporate/dmca.php. + +If you still wish to continue with the abuse process, please close this window and finish submitting your report. You may need to select the specific category 'CopyBot or Permissions Exploit'. + +Thank you, + +Linden Lab + </notification> + + <notification + icon="alertmodal.tga" + name="FailedRequirementsCheck" + type="alertmodal"> +The following required components are missing from [FLOATER]: +[COMPONENTS] + </notification> + + <notification + icon="alert.tga" + label="Replace Existing Attachment" + name="ReplaceAttachment" + type="alert"> +There is already an object attached to this point on your body. +Do you want to replace it with the selected object? + <form name="form"> + <ignore name="ignore" + save_option="true" + text="When replacing existing attachments"/> + <button + default="true" + ignore="Replace Automatically" + index="0" + name="Yes" + text="OK"/> + <button + ignore="Never Replace" + index="1" + name="No" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alert.tga" + label="Busy Mode Warning" + name="BusyModePay" + type="alert"> +You are in Busy Mode, which means you will not receive any items offered in exchange for this payment. + +Would you like to leave Busy Mode before completing this transaction? + <form name="form"> + <ignore name="ignore" + save_option="true" + text="When paying a person or object in busy mode"/> + <button + default="true" + ignore="Always leave Busy Mode" + index="0" + name="Yes" + text="OK"/> + <button + ignore="Never leave Busy Mode" + index="1" + name="No" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmEmptyTrash" + type="alertmodal"> +Are you sure you want to permanently remove the contents of your Trash folder? + <usetemplate + ignoretext="When emptying your inventory trash folder" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmClearBrowserCache" + type="alertmodal"> +Are you sure you want to clear your browser cache? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmClearCookies" + type="alertmodal"> +Are you sure you want to clear your cookies? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmClearMediaUrlList" + type="alertmodal"> +Are you sure you want to clear your list of saved URLs? + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmEmptyLostAndFound" + type="alertmodal"> +Are you sure you want to permanently remove the contents of your Lost And Found folder? + <usetemplate + ignoretext="When emptying your inventory Lost And Found folder" + name="okcancelignore" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="CopySLURL" + type="alertmodal"> +The following SLURL has been copied to your clipboard: + [SLURL] + +Put it in a web page to give others easy access to this location or try it out yourself by pasting it into the address bar of your web browser. + <form name="form"> + <ignore name="ignore" + text="When copying a SLURL to your clipboard"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="GraphicsPreferencesHelp" + type="alertmodal"> +This panel controls window size and resolution and the quality of the client's graphics. The Preferences > Graphics interface allows you to choose between four graphics levels: Low, Mid, High, and Ultra. You may also customize your graphics settings by checking the Custom checkbox and manipulating the following settings: + +Shaders: Enable or disable various types of pixel shaders. + +Reflection Detail: Sets the types of objects that water can reflect. + +Avatar Rendering: Sets options that affect how the client renders avatars. + +Draw Distance: Affects how far out from your viewpoint objects will be rendered in the scene. + +Max Particle Count: Sets the maximum number of particles you are able to see on your screen at once. + +Post Process Quality: Sets the resolution with which Glow is rendered. + +Mesh Detail: Sets the amount of detail or number of triangles used in rendering certain objects. A higher value takes longer to render, but makes these objects appear with more detail. + +Lighting Detail: Selects what types of lights you would like to render. + +Terrain Detail: Sets the amount of detail you would like to see for the terrain texture. + </notification> + + <notification + icon="alertmodal.tga" + name="WLSavePresetAlert" + type="alertmodal"> +Do you wish to overwrite the saved preset? + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WLDeletePresetAlert" + type="alertmodal"> +Do you wish to delete [SKY]? + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WLNoEditDefault" + type="alertmodal"> +You cannot edit or delete a default preset. + </notification> + + <notification + icon="alertmodal.tga" + name="WLMissingSky" + type="alertmodal"> +This day cycle file references a missing sky file: [SKY]. + </notification> + + <notification + icon="alertmodal.tga" + name="PPSaveEffectAlert" + type="alertmodal"> +PostProcess Effect exists. Do you still wish overwrite it? + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="HelpEditSky" + type="alertmodal"> +Edit the WindLight sliders to create and save a set of skies. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpEditDayCycle" + type="alertmodal"> +Set which skies to turn to throughout the day. + </notification> + + <notification + icon="alertmodal.tga" + name="EnvSettingsHelpButton" + type="alertmodal"> +These settings adjust the way the environment looks locally on your computer. Your graphics card needs to support atmospheric shaders in order to have access to all of the settings. + +Adjust the "Time of Day" slider to change the day's phase locally on the viewer. + +Adjust the "Cloud Cover" slider to control how much the clouds cover the sky. + +Pick a color in the "Water Color" color picker to change the color of the water. + +Adjust the "Water Fog" slider to control how dense the fog is underwater. + +Click "Use Estate Time" to reset the time of day to the region's current time of day and remain linked to it. + +Click "Advanced Sky" to bring up an editor with more advanced settings for the sky. + +Click "Advanced Water" to bring up an editor with more advanced settings for the water. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpDayCycle" + type="alertmodal"> +The Day Cycle Editor gives you control over the sky during Second Life's day/night cycle. This is the cycle that is used by the Basic Environment Editor's Time of Day slider. + +The Day Cycle Editor works by setting keyframes. These are nodes (represented by the gray blips on the time graph) that have Sky Presets associated with them. As the Time of Day progresses, the WindLight sky "animates" as it interpolates between these keyframes. + +The yellow arrow above the timeline represents your current view, based on Time of Day. Click and drag it to see how your day will animate. You may add or delete keyframes by pressing the Add Key and Delete Key buttons to the right of the timeline. + +You can set the time position of a keyframe by either dragging it along the timeline, or by setting its value manually in the Key Frame Settings frame. Within the Key Frame Settings frame, you'll be able to associate the keyframe with its respective WindLight preset. + +Length of Cycle dictates the overall duration of a "day". Setting this to a low value (for instance, 2 min.) will mean your entire 24-hour timeline will animate in only two real minutes! Once you are satisfied with your timeline and keyframe cycle, use the Play and Stop buttons to preview the results. Remember- you can also move the yellow time-indicator arrow above the timeline to see the cycle animate interactively. Using the Use Estate Time button will synchronize your day length and time of day with the Estate's day cycle. + +Once you are pleased with your Day Cycle, you can save and load it with the Save Test Day and Load Test Day buttons. Note that, for now, we only allow one Day Cycle. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpBlueHorizon" + type="alertmodal"> +Use the Red/Green/Blue (RGB) sliders to adjust the color of the sky. You can use the Intensity (I) slider to move all three RGB sliders in unison. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpHazeHorizon" + type="alertmodal"> +Haze Horizon is one of the most useful parameters for adjusting overall light exposure in the scene. It is effective for simulating many exposure settings, such as white-outs from the sun and darker, closed-iris settings. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpBlueDensity" + type="alertmodal"> +Blue Density affects the overall color saturation of the sky and fog. If you move the Intensity (I) slider to the right, colors will become brighter and more vibrant. If you move it all the way to the left, the colors will become duller, eventually fading to black and white. If you want to fine-tune the sky's color balance, you can control individual elements of saturation by using the Red/Green/Blue (RGB) sliders. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpHazeDensity" + type="alertmodal"> +Haze Density controls the level of dull, gray haze in the atmosphere. It is effective for simulating scenes with high levels of smoke and man-made pollutants. It is also effective for simulating fog and mist. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpDensityMult" + type="alertmodal"> +The Density Multiplier can be used to affect the overall atmospheric density. At lower settings, it creates a feeling of "thin air", and at higher settings, it creates a very heavy, smoggy effect. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpDistanceMult" + type="alertmodal"> +Adjusts WindLight's perceived distance. A value of zero effectively turns off WindLight's influence on terrain and objects. Values greater than 1 simulate greater distances for thicker atmospheric effects. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpMaxAltitude" + type="alertmodal"> +Max Altitude adjusts the altitude calculations WindLight performs when computing its atmospheric lighting. At later times of day, it is useful for adjusting how "deep" the sunset appears. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpSunlightColor" + type="alertmodal"> +Adjusts the color and intensity of the direct light in the scene. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpSunAmbient" + type="alertmodal"> +Adjusts the color and intensity of ambient atmospheric light in the scene. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpSunGlow" + type="alertmodal"> +The Size slider controls the size of the sun. +The Focus slider controls how blurred the sun is over the sky. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpSceneGamma" + type="alertmodal"> +Adjust the screen's distribution of light and dark. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpStarBrightness" + type="alertmodal"> +Adjusts the brightness of the stars in the sky. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpTimeOfDay" + type="alertmodal"> +Controls the location of the sun in the sky. +Similar to elevation. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpEastAngle" + type="alertmodal"> +Controls the location of the sun in the sky. +Similar to azimuth. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpCloudColor" + type="alertmodal"> +Edits the color of the clouds. It is generally recommended to keep it whitish, but hey, have fun if you want. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpCloudDetail" + type="alertmodal"> +Controls the detail image layered on top of the main cloud image. X and Y control its position. D (Density) controls how puffy or fractured the clouds appear. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpCloudDensity" + type="alertmodal"> +Allows you to control the position of the clouds with the X and Y sliders and how dense they are with the the D slider. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpCloudCoverage" + type="alertmodal"> +Controls how much the clouds cover the sky. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpCloudScale" + type="alertmodal"> +Controls the scaling of the cloud image on the sky dome. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpCloudScrollX" + type="alertmodal"> +Controls the speed of the clouds as they move in the X direction. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpCloudScrollY" + type="alertmodal"> +Controls the speed of the clouds as they move in the Y direction. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpClassicClouds" + type="alertmodal"> +Check this box to enable rendering of Second Life's older classic clouds in addition to WindLight's clouds. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpWaterFogColor" + type="alertmodal"> +Chooses the color of the underwater fog. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpWaterFogDensity" + type="alertmodal"> +Controls how dense the water fog is and how far you can see underwater. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpUnderWaterFogMod" + type="alertmodal"> +Modifies the effect of the Fog Density Exponent to control how far you can see when your avatar is underwater. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpWaterGlow" + type="alertmodal"> +Controls how much the surface of the water glows. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpWaterNormalScale" + type="alertmodal"> +Controls the scaling of the three wavelets that make up the water. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpWaterFresnelScale" + type="alertmodal"> +Controls how much light is reflected at different angles. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpWaterFresnelOffset" + type="alertmodal"> +Controls how much light intensity is reflected. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpWaterScaleAbove" + type="alertmodal"> +Controls how much light is refracted from looking above the surface of the water. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpWaterScaleBelow" + type="alertmodal"> +Controls how much light is refracted from looking from below the surface of the water. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpWaterBlurMultiplier" + type="alertmodal"> +Controls how waves and reflections are mixed. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpWaterNormalMap" + type="alertmodal"> +Controls what normal map is layered across the water to determine reflections/refractions. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpWaterWave1" + type="alertmodal"> +Controls where and how fast the large scaled version of the normal map moves in the X and Y direction. + </notification> + + <notification + icon="alertmodal.tga" + name="HelpWaterWave2" + type="alertmodal"> +Controls where and how fast the the small scaled version of the normal map moves in the X and Y direction. + </notification> + + <notification + icon="alert.tga" + name="NewSkyPreset" + type="alert"> +Give me a name for the new sky. + <form name="form"> + <input name="message" type="text"> +New Preset + </input> + <button + default="true" + index="0" + name="OK" + text="OK"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="ExistsSkyPresetAlert" + type="alertmodal"> +Preset already exists! + </notification> + + <notification + icon="alert.tga" + name="NewWaterPreset" + type="alert"> +Give me a name for the new water preset. + <form name="form"> + <input name="message" type="text"> +New Preset + </input> + <button + default="true" + index="0" + name="OK" + text="OK"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="ExistsWaterPresetAlert" + type="alertmodal"> +Preset already exists! + </notification> + + <notification + icon="alertmodal.tga" + name="WaterNoEditDefault" + type="alertmodal"> +You cannot edit or delete a default preset. + </notification> + + <notification + icon="alertmodal.tga" + name="ChatterBoxSessionStartError" + type="alertmodal"> +Unable to start a new chat session with [RECIPIENT]. +[REASON] + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ChatterBoxSessionEventError" + type="alertmodal"> +[EVENT] +[REASON] + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ForceCloseChatterBoxSession" + type="alertmodal"> +Your chat session with [NAME] must close. +[REASON] + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="Cannot_Purchase_an_Attachment" + type="alertmodal"> +Items may not be purchased while they are part of an attachment. + </notification> + + <notification + icon="alertmodal.tga" + label="About Requests for the Debit Permission" + name="DebitPermissionDetails" + type="alertmodal"> +Granting this request gives a script ongoing permission to take Linden dollars (L$) from your account. To revoke this permission, the object owner must delete the object or reset the scripts in the object. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="AutoWearNewClothing" + type="alertmodal"> +Would you like to automatically wear the clothing item you create? + <usetemplate + ignoretext="Automatically wear new clothing" + name="okcancelignore" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="NotAgeVerified" + type="alertmodal"> +You need to be age-verified in order to access this parcel. +Would you like to visit the Second Life website to verify your age? + +[_URL] + <url option="0" name="url"> + + https://secondlife.com/account/verification.php + </url> + <usetemplate + ignoretext="Warn about lack of age verification" + name="okcancelignore" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="Cannot enter parcel: no payment info on file" + type="alertmodal"> +This parcel requires that you have payment information on file before you can access it. +Would you like to visit the Second Life website to set this up? + +[_URL] + <url option="0" name="url"> + + https://secondlife.com/account/ + </url> + <usetemplate + ignoretext="Warn about lack of payment info" + name="okcancelignore" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="MissingString" + type="alertmodal"> +The string [STRING_NAME] is missing from strings.xml + </notification> + + <notification + icon="notifytip.tga" + name="SystemMessageTip" + type="notifytip"> +[MESSAGE] + </notification> + + <notification + icon="notifytip.tga" + name="Cancelled" + type="notifytip"> +Cancelled + </notification> + + <notification + icon="notifytip.tga" + name="CancelledSit" + type="notifytip"> +Cancelled Sit + </notification> + + <notification + icon="notifytip.tga" + name="CancelledAttach" + type="notifytip"> +Cancelled Attach + </notification> + + <notification + icon="notifytip.tga" + name="ReplacedMissingWearable" + type="notifytip"> +Replaced missing clothing/body part with default. + </notification> + + <notification + icon="groupnotify" + name="GroupNotice" + type="groupnotify"> +Topic: [SUBJECT], Message: [MESSAGE] + </notification> + + <notification + icon="notifytip.tga" + name="FriendOnline" + type="notifytip"> +[FIRST] [LAST] is Online + </notification> + + <notification + icon="notifytip.tga" + name="FriendOffline" + type="notifytip"> +[FIRST] [LAST] is Offline + </notification> + + <notification + icon="notifytip.tga" + name="AddSelfFriend" + type="notifytip"> +You cannot add yourself as a friend. + </notification> + + <notification + icon="notifytip.tga" + name="UploadingAuctionSnapshot" + type="notifytip"> +Uploading in-world and web site snapshots... +(Takes about 5 minutes.) + </notification> + + <notification + icon="notify.tga" + name="UploadPayment" + type="notify"> +You paid L$[AMOUNT] to upload. + </notification> + + <notification + icon="notifytip.tga" + name="UploadWebSnapshotDone" + type="notifytip"> +Web site snapshot upload done. + </notification> + + <notification + icon="notifytip.tga" + name="UploadSnapshotDone" + type="notifytip"> +In-world snapshot upload done + </notification> + + <notification + icon="notifytip.tga" + name="TerrainDownloaded" + type="notifytip"> +Terrain.raw downloaded + </notification> + + <notification + icon="notifytip.tga" + name="GestureMissing" + type="notifytip"> +Gesture [NAME] is missing from database. + </notification> + + <notification + icon="notifytip.tga" + name="UnableToLoadGesture" + type="notifytip"> +Unable to load gesture [NAME]. +Please try again. + </notification> + + <notification + icon="notifytip.tga" + name="LandmarkMissing" + type="notifytip"> +Landmark is missing from database. + </notification> + + <notification + icon="notifytip.tga" + name="UnableToLoadLandmark" + type="notifytip"> +Unable to load landmark. Please try again. + </notification> + + <notification + icon="notifytip.tga" + name="CapsKeyOn" + type="notifytip"> +Your Caps Lock key is on. +As this will affect the password you type in, you will probably want to turn it off. + </notification> + + <notification + icon="notifytip.tga" + name="NotecardMissing" + type="notifytip"> +Notecard is missing from database. + </notification> + + <notification + icon="notifytip.tga" + name="NotecardNoPermissions" + type="notifytip"> +Insufficient permissions to view notecard. + </notification> + + <notification + icon="notifytip.tga" + name="RezItemNoPermissions" + type="notifytip"> +Insufficient permissions to rez object. + </notification> + + <notification + icon="notifytip.tga" + name="UnableToLoadNotecard" + type="notifytip"> +Unable to load notecard. +Please try again. + </notification> + + <notification + icon="notifytip.tga" + name="ScriptMissing" + type="notifytip"> +Script is missing from database. + </notification> + + <notification + icon="notifytip.tga" + name="ScriptNoPermissions" + type="notifytip"> +Insufficient permissions to view script. + </notification> + + <notification + icon="notifytip.tga" + name="UnableToLoadScript" + type="notifytip"> +Unable to load script. Please try again. + </notification> + + <notification + icon="notifytip.tga" + name="IncompleteInventory" + type="notifytip"> +The complete contents you are offering are not yet locally available. Please try offering those items again in a minute. + </notification> + + <notification + icon="notifytip.tga" + name="CannotModifyProtectedCategories" + type="notifytip"> +You cannot modify protected categories. + </notification> + + <notification + icon="notifytip.tga" + name="CannotRemoveProtectedCategories" + type="notifytip"> +You cannot remove protected categories. + </notification> + + <notification + icon="notifytip.tga" + name="OfferedCard" + type="notifytip"> +You have offered a calling card to [FIRST] [LAST] + </notification> + + <notification + icon="notifytip.tga" + name="UnableToBuyWhileDownloading" + type="notifytip"> +Unable to buy while downloading object data. +Please try again. + </notification> + + <notification + icon="notifytip.tga" + name="UnableToLinkWhileDownloading" + type="notifytip"> +Unable to link while downloading object data. +Please try again. + </notification> + + <notification + icon="notifytip.tga" + name="CannotBuyObjectsFromDifferentOwners" + type="notifytip"> +Cannot buy objects from different owners at the same time. +Please select a single object. + </notification> + + <notification + icon="notifytip.tga" + name="ObjectNotForSale" + type="notifytip"> +Object does not appear to be for sale. + </notification> + + <notification + icon="notifytip.tga" + name="EnteringGodMode" + type="notifytip"> +Entering god mode, level [LEVEL] + </notification> + + <notification + icon="notifytip.tga" + name="LeavingGodMode" + type="notifytip"> +Leaving god mode, level [LEVEL] + </notification> + + <notification + icon="notifytip.tga" + name="CopyFailed" + type="notifytip"> +Copy failed because you lack copy permission + </notification> + + <notification + icon="notifytip.tga" + name="InventoryAccepted" + type="notifytip"> +[NAME] accepted your inventory offer. + </notification> + + <notification + icon="notifytip.tga" + name="InventoryDeclined" + type="notifytip"> +[NAME] declined your inventory offer. + </notification> + + <notification + icon="notifytip.tga" + name="ObjectMessage" + type="notifytip"> +[NAME]: [MESSAGE] + </notification> + + <notification + icon="notifytip.tga" + name="CallingCardAccepted" + type="notifytip"> +Your calling card was accepted. + </notification> + + <notification + icon="notifytip.tga" + name="CallingCardDeclined" + type="notifytip"> +Your calling card was declined. + </notification> + + <notification + icon="notifytip.tga" + name="TeleportToLandmark" + type="notifytip"> +Now that you have reached the mainland, you can teleport to locations like '[NAME]' by clicking on the Inventory button on the bottom right of your screen, and then select the Landmarks folder. +Double click on the landmark and click on Teleport to travel there. + </notification> + + <notification + icon="notifytip.tga" + name="TeleportToPerson" + type="notifytip"> +Now that you have reached the mainland, you can contact residents like '[NAME]' by clicking on the Inventory button on the bottom right of your screen, and then select the Calling Cards folder. +Double click on the card, click on Instant Message, and type a message. + </notification> + + <notification + icon="notifytip.tga" + name="CantSelectLandFromMultipleRegions" + type="notifytip"> +Can't select land across server boundaries. +Try selecting a smaller piece of land. + </notification> + + <notification + icon="notifytip.tga" + name="SearchWordBanned" + type="notifytip"> +Some terms in your search query were excluded due to content restrictions as clarified in the Community Standards. + </notification> + + <notification + icon="notifytip.tga" + name="NoContentToSearch" + type="notifytip"> +Please select at least one type of content to search (PG, Mature, or Adult). + </notification> + + <notification + icon="notify.tga" + name="GroupVote" + type="notify"> +[NAME] has proposed to vote on: +[MESSAGE] + <form name="form"> + <button + index="0" + name="VoteNow" + text="Vote Now"/> + <button + index="1" + name="Later" + text="Later"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="SystemMessage" + type="notify"> +[MESSAGE] + </notification> + + <notification + icon="notify.tga" + name="EventNotification" + type="notify"> +Event Notification: + +[NAME] +[DATE] + <form name="form"> + <button + index="0" + name="Teleport" + text="Teleport"/> + <button + index="1" + name="Description" + text="Description"/> + <button + index="2" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="TransferObjectsHighlighted" + type="notify"> +All objects on this parcel that will transfer to the purchaser of this parcel are now highlighted. + +* Trees and grasses that will transfer are not highlighted. + <form name="form"> + <button + index="0" + name="Done" + text="Done"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="DeactivatedGesturesTrigger" + type="notify"> +Deactivated gestures with same trigger: +[NAMES] + </notification> + + <notification + icon="notify.tga" + name="NoQuickTime" + type="notify"> +Apple's QuickTime software does not appear to be installed on your system. +If you want to view streaming media on parcels that support it you should go to the QuickTime site (http://www.apple.com/quicktime) and install the QuickTime Player. + </notification> + + <notification + icon="notify.tga" + name="OwnedObjectsReturned" + type="notify"> +The objects you own on the selected parcel of land have been returned back to your inventory. + </notification> + + <notification + icon="notify.tga" + name="OtherObjectsReturned" + type="notify"> +The objects on the selected parcel of land that is owned by [FIRST] [LAST] have been returned to his or her inventory. + </notification> + + <notification + icon="notify.tga" + name="OtherObjectsReturned2" + type="notify"> +The objects on the selected parcel of land owned by the resident '[NAME]' have been returned to their owner. + </notification> + + <notification + icon="notify.tga" + name="GroupObjectsReturned" + type="notify"> +The objects on the selected parcel of land shared with the group [GROUPNAME] have been returned back to their owner's inventory. +Transferable deeded objects have been returned to their previous owners. +Non-transferable objects that are deeded to the group have been deleted. + </notification> + + <notification + icon="notify.tga" + name="UnOwnedObjectsReturned" + type="notify"> +The objects on the selected parcel that are NOT owned by you have been returned to their owners. + </notification> + + <notification + icon="notify.tga" + name="NotSafe" + type="notify"> +This land has damage enabled ('not safe'). +You can be hurt here. If you die, you will be teleported to your home location. + <unique/> + </notification> + + <notification + icon="notify.tga" + name="NoFly" + type="notify"> +This land has flying disabled ('no fly'). +You cannot fly here. + <unique/> + </notification> + + <notification + icon="notify.tga" + name="PushRestricted" + type="notify"> +This land is 'No Pushing'. +You cannot push others here unless you own the land. + <unique/> + </notification> + + <notification + icon="notify.tga" + name="NoVoice" + type="notify"> +This land has voice disabled. + <unique/> + </notification> + + <notification + icon="notify.tga" + name="NoBuild" + type="notify"> +This land has building disabled ('no build'). +You cannot create objects here. + <unique/> + </notification> + + <notification + icon="notify.tga" + name="ScriptsStopped" + type="notify"> +An administrator has temporarily stopped scripts in this region. + </notification> + + <notification + icon="notify.tga" + name="ScriptsNotRunning" + type="notify"> +This region is not running any scripts. + </notification> + + <notification + icon="notify.tga" + name="NoOutsideScripts" + type="notify"> +This land has outside scripts disabled ('no outside scripts'). +No scripts will run except those belonging to the land owner. + </notification> + + <notification + icon="notify.tga" + name="ClaimPublicLand" + type="notify"> +Can only claim public land in region you're in. + </notification> + + <notification + icon="notify.tga" + name="RegionTPAccessBlocked" + type="notify"> +You aren't allowed in that Region due to your maturity Rating. You may need to validate your age and/or install the latest Viewer. + +Please go to the Knowledge Base for details on accessing areas with this maturity Rating. + </notification> + + <notification + icon="notify.tga" + name="URBannedFromRegion" + type="notify"> +You are banned from the region. + </notification> + + <notification + icon="notify.tga" + name="NoTeenGridAccess" + type="notify"> +Your account cannot connect to this teen grid region. + </notification> + + <notification + icon="notify.tga" + name="NoHelpIslandTP" + type="notify"> +You cannot teleport back to Help Island. +Go to 'Help Island Public' to repeat the tutorial. + </notification> + + <notification + icon="notify.tga" + name="ImproperPaymentStatus" + type="notify"> +You do not have proper payment status to enter this region. + </notification> + + <notification + icon="notify.tga" + name="MustGetAgeRgion" + type="notify"> +You must be age-verified to enter this region. + </notification> + + <notification + icon="notify.tga" + name="MustGetAgeParcel" + type="notify"> +You must be age-verified to enter this parcel. + </notification> + + <notification + icon="notify.tga" + name="NoDestRegion" + type="notify"> +No destination region found. + </notification> + + <notification + icon="notify.tga" + name="NotAllowedInDest" + type="notify"> +You are not allowed into the destination. + </notification> + + <notification + icon="notify.tga" + name="RegionParcelBan" + type="notify"> +Cannot region cross into banned parcel. Try another way. + </notification> + + <notification + icon="notify.tga" + name="TelehubRedirect" + type="notify"> +You have been redirected to a telehub. + </notification> + + <notification + icon="notify.tga" + name="CouldntTPCloser" + type="notify"> +Could not teleport closer to destination. + </notification> + + <notification + icon="notify.tga" + name="TPCancelled" + type="notify"> + Teleport cancelled. + </notification> + + <notification + icon="notify.tga" + name="FullRegionTryAgain" + type="notify"> +The region you are attempting to enter is currently full. +Please try again in a few moments. + </notification> + + <notification + icon="notify.tga" + name="GeneralFailure" + type="notify"> +General failure. + </notification> + + <notification + icon="notify.tga" + name="RoutedWrongRegion" + type="notify"> +Routed to wrong region. Please try again. + </notification> + + <notification + icon="notify.tga" + name="NoValidAgentID" + type="notify"> +No valid agent id. + </notification> + + <notification + icon="notify.tga" + name="NoValidSession" + type="notify"> +No valid session id. + </notification> + + <notification + icon="notify.tga" + name="NoValidCircuit" + type="notify"> +No valid circuit code. + </notification> + + <notification + icon="notify.tga" + name="NoValidTimestamp" + type="notify"> +No valid timestamp. + </notification> + + <notification + icon="notify.tga" + name="NoPendingConnection" + type="notify"> +Unable to create pending connection. + </notification> + + <notification + icon="notify.tga" + name="InternalUsherError" + type="notify"> +Internal error attempting to connect agent usher. + </notification> + + <notification + icon="notify.tga" + name="NoGoodTPDestination" + type="notify"> +Unable to find a good teleport destination in this region. + </notification> + + <notification + icon="notify.tga" + name="InternalErrorRegionResolver" + type="notify"> +Internal error attempting to activate region resolver. + </notification> + + <notification + icon="notify.tga" + name="NoValidLanding" + type="notify"> +A valid landing point could not be found. + </notification> + + <notification + icon="notify.tga" + name="NoValidParcel" + type="notify"> +No valid parcel could be found. + </notification> + + <notification + icon="notify.tga" + name="ObjectGiveItem" + type="notify"> +An object named [OBJECTFROMNAME] owned by [FIRST] [LAST] has given you a [OBJECTTYPE] named [OBJECTNAME]. + <form name="form"> + <button + index="0" + name="Keep" + text="Keep"/> + <button + index="1" + name="Discard" + text="Discard"/> + <button + index="2" + name="Mute" + text="Mute"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="ObjectGiveItemUnknownUser" + type="notify"> +An object named [OBJECTFROMNAME] owned by (an unknown user) has given you a [OBJECTTYPE] named [OBJECTNAME]. + <form name="form"> + <button + index="0" + name="Keep" + text="Keep"/> + <button + index="1" + name="Discard" + text="Discard"/> + <button + index="2" + name="Mute" + text="Mute"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="UserGiveItem" + type="notify"> +[NAME] has given you a [OBJECTTYPE] named '[OBJECTNAME]'. + <form name="form"> + <button + index="0" + name="Keep" + text="Keep"/> + <button + index="1" + name="Discard" + text="Discard"/> + <button + index="2" + name="Mute" + text="Mute"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="GodMessage" + type="notify"> +[NAME] +[MESSAGE] + </notification> + + <notification + icon="notify.tga" + name="JoinGroup" + type="notify"> +[MESSAGE] + <form name="form"> + <button + index="0" + name="Join" + text="Join"/> + <button + index="1" + name="Decline" + text="Decline"/> + <button + index="2" + name="Info" + text="Info"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="TeleportOffered" + type="notify"> +[NAME] has offered to teleport you to his or her location: + +[MESSAGE] + <form name="form"> + <button + index="0" + name="Teleport" + text="Teleport"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="GotoURL" + type="notify"> +[MESSAGE] +[URL] + <form name="form"> + <button + index="0" + name="Later" + text="Later"/> + <button + index="1" + name="GoNow..." + text="Go Now..."/> + </form> + </notification> + + <notification + icon="notify.tga" + name="OfferFriendship" + type="notify"> +[NAME] is offering friendship. + +[MESSAGE] + +(By default, you will be able to see each other's online status.) + <form name="form"> + <button + index="0" + name="Accept" + text="Accept"/> + <button + index="1" + name="Decline" + text="Decline"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="OfferFriendshipNoMessage" + type="notify"> +[NAME] is offering friendship. + +(By default, you will be able to see each other's online status.) + <form name="form"> + <button + index="0" + name="Accept" + text="Accept"/> + <button + index="1" + name="Decline" + text="Decline"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="FriendshipAccepted" + type="notify"> +[NAME] accepted your friendship offer. + </notification> + + <notification + icon="notify.tga" + name="FriendshipDeclined" + type="notify"> +[NAME] declined your friendship offer. + </notification> + + <notification + icon="notify.tga" + name="OfferCallingCard" + type="notify"> +[FIRST] [LAST] is offering their calling card. +This will add a bookmark in your inventory so you can quickly IM this resident. + <form name="form"> + <button + index="0" + name="Accept" + text="Accept"/> + <button + index="1" + name="Decline" + text="Decline"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="RegionRestartMinutes" + priority="high" + sound="UISndAlert" + type="notify"> +Region is restarting in [MINUTES] minutes. +If you remain in this region you will be logged out. + </notification> + + <notification + icon="notify.tga" + name="RegionRestartSeconds" + priority="high" + sound="UISndAlert" + type="notify"> +Region is restarting in [SECONDS] seconds. +If you remain in this region you will be logged out. + </notification> + + <notification + icon="notify.tga" + name="LoadWebPage" + type="notify"> +Load web page [URL]? + +[MESSAGE] + +From object: [OBJECTNAME], owner: [NAME]? + <form name="form"> + <button + index="0" + name="Gotopage" + text="Go to page"/> + <button + index="1" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="FailedToFindWearableUnnamed" + type="notify"> +Failed to find [TYPE] in database. + </notification> + + <notification + icon="notify.tga" + name="FailedToFindWearable" + type="notify"> +Failed to find [TYPE] named [DESC] in database. + </notification> + + <notification + icon="notify.tga" + name="InvalidWearable" + type="notify"> + The item you are trying to wear uses a feature that your viewer can't read. Please upgrade your version of Second Life to wear this item. + </notification> + + <notification + icon="notify.tga" + name="ScriptQuestion" + type="notify"> +'[OBJECTNAME]', an object owned by '[NAME]', would like to: + +[QUESTIONS] +Is this OK? + <form name="form"> + <button + index="0" + name="Yes" + text="Yes"/> + <button + index="1" + name="No" + text="No"/> + <button + index="2" + name="Mute" + text="Mute"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="ScriptQuestionCaution" + priority="high" + type="notify"> +'[OBJECTNAME]', an object owned by '[NAME]', would like to: + +[QUESTIONS] +If you do not trust this object and its creator, you should deny the request. For additional information, click the Details button. + +Grant this request? + <form name="form"> + <button + index="0" + name="Grant" + text="Grant"/> + <button + default="true" + index="1" + name="Deny" + text="Deny"/> + <button + index="2" + name="Details" + text="Details..."/> + </form> + </notification> + + <notification + icon="notify.tga" + name="ScriptDialog" + type="notify"> +[FIRST] [LAST]'s '[TITLE]' +[MESSAGE] + <form name="form"> + <button + index="-1" + name="Ignore" + text="Ignore"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="ScriptDialogGroup" + type="notify"> +[GROUPNAME]'s '[TITLE]' +[MESSAGE] + <form name="form"> + <button + index="-1" + name="Ignore" + text="Ignore"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="FirstBalanceIncrease" + type="notify"> +You just received L$[AMOUNT]. +Objects and other users may give you L$. +Your balance is shown in the upper-right corner of the screen. + </notification> + + <notification + icon="notify.tga" + name="FirstBalanceDecrease" + type="notify"> +You just paid L$[AMOUNT]. +Your balance is shown in the upper-right corner of the screen. + </notification> + + <notification + icon="notify.tga" + name="FirstSit" + type="notify"> +You are sitting. +Use the arrow keys (or AWSD) to change the view. +Click the 'Stand Up' button to get up. + </notification> + + <notification + icon="notify.tga" + name="FirstMap" + type="notify"> +Click and drag to scroll the map. +Double-click to teleport. +Use the controls on the right to find things and display different backgrounds. + </notification> + + <notification + icon="notify.tga" + name="FirstBuild" + type="notify"> +You can build new objects in some areas of [SECOND_LIFE]. +Use the tools in the upper left to build, and try holding down Ctrl or Alt to rapidly switch tools. +Press Esc to stop building. + </notification> + + <notification + icon="notify.tga" + name="FirstLeftClickNoHit" + type="notify"> +Left-clicking interacts with special objects. +If the mouse pointer changes to a hand, you can interact with the object. +Right-click always shows a menu of things you can do. + </notification> + + <notification + icon="notify.tga" + name="FirstTeleport" + type="notify"> +This region doesn't allow point-to-point teleports, so you've been transported to the nearest telehub. +Your destination is marked with a tall beacon. +Follow the red arrow to the beacon, or click the arrow to dismiss the beacon. + </notification> + + <notification + icon="notify.tga" + name="FirstOverrideKeys" + type="notify"> +Your movement keys are now being handled by an object. +Try the arrow keys or AWSD to see what they do. +Some objects (like guns) require you to go into mouselook to use them. +Press 'M' to do this. + </notification> + + <notification + icon="notify.tga" + name="FirstAppearance" + type="notify"> +You are editing your appearance. +To rotate and zoom view, use the arrow keys. +When you are finished, press 'Save All' to save your look and exit. +You can edit your appearance as often as you like. + </notification> + + <notification + icon="notify.tga" + name="FirstInventory" + type="notify"> +This is your inventory, which contains objects, notecards, clothing, and other things you own. +* To wear an object or outfit folder, drag it onto yourself. +* To bring an object into the world, drag it onto the ground. +* To read a notecard, double-click it. + </notification> + + <notification + icon="notify.tga" + name="FirstSandbox" + type="notify"> +This is a sandbox region. +Objects you build here may be deleted after you leave the area, Sandboxes clean on a regular basis, please refer to the information at the top of the screen next to the region name. + +Sandbox regions are uncommon, and are marked with signs. + </notification> + + <notification + icon="notify.tga" + name="FirstFlexible" + type="notify"> +This object is flexible. +Flexible objects may not be physical and must be phantom until the flexible checkbox is unchecked. + </notification> + + <notification + icon="notify.tga" + name="FirstDebugMenus" + type="notify"> +You have enabled the Advanced menu. +This menu contains features useful for developers debugging Second Life. +To toggle this menu on Windows press Ctrl-Alt-D. On Mac press Cmd-Opt-Shift-D. + </notification> + + <notification + icon="notify.tga" + name="FirstSculptedPrim" + type="notify"> +You are editing a sculpted prim. +Sculpted prims require a special texture to specify their shape. +You can find example sculpted textures in the inventory library. + </notification> + + <notification + icon="notify.tga" + name="FirstMedia" + type="notify"> +You have begun playing media. Media can set to play automatically in the preferences window under Audio / Video. Note that this can be a security risk for media sites you do not trust. + </notification> + + <notification + icon="notifytip.tga" + name="MaxListSelectMessage" + type="notifytip"> +You may only select up to [MAX_SELECT] items from this list. + </notification> + + <notification + icon="notify.tga" + name="VoiceInviteP2P" + type="notify"> +[NAME] is inviting you to a Voice Chat call. +Click Accept to join the call or Decline to decline the invitation. Click Mute to mute this caller. + <unique> + <context key="NAME"/> + </unique> + <form name="form"> + <button + index="0" + name="Accept" + text="Accept"/> + <button + index="1" + name="Decline" + text="Decline"/> + <button + index="2" + name="Mute" + text="Mute"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="AutoUnmuteByIM" + type="notify"> +[FIRST] [LAST] was sent an instant message and has been automatically unmuted. + </notification> + + <notification + icon="notify.tga" + name="AutoUnmuteByMoney" + type="notify"> +[FIRST] [LAST] was given money and has been automatically unmuted. + </notification> + + <notification + icon="notify.tga" + name="AutoUnmuteByInventory" + type="notify"> +[FIRST] [LAST] was offered inventory and has been automatically unmuted. + </notification> + + <notification + icon="notify.tga" + name="VoiceInviteGroup" + type="notify"> +[NAME] has joined a Voice Chat call with the group [GROUP]. +Click Accept to join the call or Decline to decline the invitation. Click Mute to mute this caller. + <unique> + <context key="NAME"/> + <context key="GROUP"/> + </unique> + <form name="form"> + <button + index="0" + name="Accept" + text="Accept"/> + <button + index="1" + name="Decline" + text="Decline"/> + <button + index="2" + name="Mute" + text="Mute"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="VoiceInviteAdHoc" + type="notify"> +[NAME] has joined a Voice Chat call with a conference chat... +Click Accept to join the call or Decline to decline the invitation. Click Mute to mute this user. + <unique> + <context key="NAME"/> + </unique> + <form name="form"> + <button + index="0" + name="Accept" + text="Accept"/> + <button + index="1" + name="Decline" + text="Decline"/> + <button + index="2" + name="Mute" + text="Mute"/> + </form> + </notification> + + <notification + icon="notify.tga" + name="InviteAdHoc" + type="notify"> +[NAME] is inviting you to a conference chat. +Click Accept to join the chat or Decline to decline the invitation. Click Mute to mute this user. + <unique> + <context key="NAME"/> + </unique> + <form name="form"> + <button + index="0" + name="Accept" + text="Accept"/> + <button + index="1" + name="Decline" + text="Decline"/> + <button + index="2" + name="Mute" + text="Mute"/> + </form> + </notification> + + <notification + icon="notifytip.tga" + name="VoiceChannelFull" + type="notifytip"> +The voice call you are trying to join, [VOICE_CHANNEL_NAME], has reached maximum capacity. Please try again later. + <unique> + <context key="VOICE_CHANNEL_NAME"/> + </unique> + </notification> + + <notification + icon="notifytip.tga" + name="ProximalVoiceChannelFull" + type="notifytip"> +We're sorry. This area has reached maximum capacity for voice conversations. Please try to use voice in another area. + <unique/> + </notification> + + <notification + icon="notifytip.tga" + name="VoiceChannelDisconnected" + type="notifytip"> +You have been disconnected from [VOICE_CHANNEL_NAME]. You will now be reconnected to spatial voice chat. + <unique> + <context key="VOICE_CHANNEL_NAME"/> + </unique> + </notification> + + <notification + icon="notifytip.tga" + name="VoiceChannelDisconnectedP2P" + type="notifytip"> +[VOICE_CHANNEL_NAME] has ended the call. You will now be reconnected to spatial voice chat. + <unique> + <context key="VOICE_CHANNEL_NAME"/> + </unique> + </notification> + + <notification + icon="notifytip.tga" + name="P2PCallDeclined" + type="notifytip"> +[VOICE_CHANNEL_NAME] has declined your call. You will now be reconnected to spatial voice chat. + <unique> + <context key="VOICE_CHANNEL_NAME"/> + </unique> + </notification> + + <notification + icon="notifytip.tga" + name="P2PCallNoAnswer" + type="notifytip"> +[VOICE_CHANNEL_NAME] is not available to take your call. You will now be reconnected to spatial voice chat. + <unique> + <context key="VOICE_CHANNEL_NAME"/> + </unique> + </notification> + + <notification + icon="notifytip.tga" + name="VoiceChannelJoinFailed" + type="notifytip"> +Failed to connect to [VOICE_CHANNEL_NAME], please try again later. You will now be reconnected to spatial voice chat. + <unique> + <context key="VOICE_CHANNEL_NAME"/> + </unique> + </notification> + + <notification + duration="10" + icon="notifytip.tga" + name="VoiceLoginRetry" + type="notifytip"> +We are creating a voice channel for you. This may take up to one minute. + <unique/> + </notification> + + <notification + icon="notifytip.tga" + name="Cannot enter parcel: not a group member" + type="notifytip"> +Cannot enter parcel, you are not a member of the appropriate group. + </notification> + + <notification + icon="notifytip.tga" + name="Cannot enter parcel: banned" + type="notifytip"> +Cannot enter parcel, you have been banned. + </notification> + + <notification + icon="notifytip.tga" + name="Cannot enter parcel: not on access list" + type="notifytip"> +Cannot enter parcel, you are not on the access list. + </notification> + + <notification + icon="notifytip.tga" + name="VoiceNotAllowed" + type="notifytip"> +You do not have permission to connect to voice chat for [VOICE_CHANNEL_NAME]. + <unique> + <context key="VOICE_CHANNEL_NAME"/> + </unique> + </notification> + + <notification + icon="notifytip.tga" + name="VoiceCallGenericError" + type="notifytip"> +An error has occurred while trying to connect to voice chat for [VOICE_CHANNEL_NAME]. Please try again later. + <unique> + <context key="VOICE_CHANNEL_NAME"/> + </unique> + </notification> + + <notification + duration="10" + icon="notifytip.tga" + name="ServerVersionChanged" + priority="high" + type="notifytip"> +The region you have entered is running a different simulator version. Click this message for details. + </notification> + + <notification + icon="notifytip.tga" + name="UnableToOpenCommandURL" + priority="high" + type="notifytip"> +The URL you clicked cannot be opened from this web browser. + </notification> + + <global name="UnsupportedCPU"> +- Your CPU speed does not meet the minimum requirements. + </global> + + <global name="UnsupportedGLRequirements"> +You do not appear to have the proper hardware requirements for Second Life. Second Life requires an OpenGL graphics card that has multitexture support. If this is the case, you may want to make sure that you have the latest drivers for your graphics card, and service packs and patches for your operating system. + +If you continue to have problems, please visit: http://www.secondlife.com/support + </global> + + <global name="UnsupportedCPUAmount"> +796 + </global> + + <global name="UnsupportedRAMAmount"> +510 + </global> + + <global name="UnsupportedGPU"> +- Your graphics card does not meet the minimum requirements. + </global> + + <global name="UnsupportedRAM"> +- Your system memory does not meet the minimum requirements. + </global> + + <global name="PermYes"> +Yes + </global> + + <global name="PermNo"> +No + </global> +</notifications> + diff --git a/indra/newview/skins/default/xui/en/panel_audio_device.xml b/indra/newview/skins/default/xui/en/panel_audio_device.xml new file mode 100644 index 0000000000000000000000000000000000000000..5f495ef8cede254f83c037eac7f7edce1092ba99 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_audio_device.xml @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + height="240" + layout="topleft" + left="8" + name="device_settings" + top="240" + width="404"> + <panel.string + name="default_text"> + Default + </panel.string> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="6" + name="Audio Devices" + width="200"> + Audio Devices + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="20" + name="Input device (microphone):" + top="26" + width="200"> + Input device (microphone): + </text> + <combo_box + height="18" + layout="topleft" + left_delta="0" + max_chars="128" + name="voice_input_device" + top_pad="2" + width="225" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="Output device (speakers):" + top_pad="9" + width="200"> + Output device (speakers): + </text> + <combo_box + height="18" + layout="topleft" + left_delta="0" + max_chars="128" + name="voice_output_device" + top_pad="2" + width="225" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="6" + name="Input level:" + top="121" + width="200"> + Input Level + </text> + <text_editor + type="string" + length="1" + top="135" + bg_readonly_color="0 0 0 0" + enabled="false" + height="60" + hide_border="true" + hide_scrollbar="true" + layout="topleft" + left_delta="10" + max_length="65535" + name="voice_intro_text1" + tab_stop="false" + width="380" + word_wrap="true"> + Adjust the slider to control how loud you sound to other Residents. To test the input level, simply speak into your microphone. + </text_editor> + <slider_bar + follows="left|top" + height="17" + increment="0.05" + initial_value="1.0" + layout="topleft" + left_delta="5" + max_val="2" + name="mic_volume_slider" + tool_tip="Change the volume using this slider" + top="202" + width="90" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="5" + name="wait_text" + top_delta="1" + width="200"> + Please wait + </text> + <locate + height="20" + layout="topleft" + left_delta="0" + name="bar0" + top_delta="5" + width="20" /> + <locate + height="20" + layout="topleft" + left_pad="2" + name="bar1" + top_delta="0" + width="20" /> + <locate + height="20" + layout="topleft" + left_pad="2" + name="bar2" + top_delta="0" + width="20" /> + <locate + height="20" + layout="topleft" + left_pad="2" + name="bar3" + top_delta="0" + width="20" /> + <locate + height="20" + layout="topleft" + left_pad="2" + name="bar4" + top_delta="0" + width="20" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml new file mode 100644 index 0000000000000000000000000000000000000000..bf3f70f54bd1c6bf0b4bb7cfeff34b5eef427758 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<!-- All our XML is utf-8 encoded. --> + +<panel + name="avatar_list_item" + title="avatar_list_item" + visible="true" + width="314" + height="30" + left="0" + top="100" + follows="bottom|right|left" + min_width="150" + max_height="30" + + background_opaque="false" + background_visible="true" + bevel_style="in" + bg_alpha_color="0.3 0.3 0.3 1.0"> + + <avatar_icon + bottom="5" left="5" width="20" height="20" follows="top|left" + color="1 1 1 1" enabled="true" image_name="smile.png" + mouse_opaque="true" name="avatar_icon" + /> + + <text + bottom="4" left="35" width="160" height="20" follows="right|left" + font="SansSerifBigBold" text_color="white" + mouse_opaque="true" name="user_name" > + Boris Linden + </text> + + <text + bottom="3" left="190" width="40" height="20" follows="right" + font="SansSerif" text_color="0.5 0.5 0.5 1.0" + mouse_opaque="true" name="user_status" > + Away + </text> + + <icon + bottom="5" left="230" width="20" height="20" follows="right" + color="1 1 1 1" enabled="true" image_name="speaking_indicator.tga" + mouse_opaque="true" name="locator" + /> + + <button + bottom="5" left="260" width="20" height="20" follows="right" + name="info_btn" label="" + image_unselected="info_btn.tga" image_disabled="info_btn.tga" + image_selected="info_btn_active.tga" image_hover_selected="info_btn_active.tga" + image_disabled_selected="info_btn.tga" font="SansSerifBigBold" + /> + + <button + bottom="5" left="290" width="20" height="20" follows="right" + name="profile_btn" label="" + image_unselected="profile_chevron_btn.tga" image_disabled="profile_chevron_btn.tga" + image_selected="profile_chevron_btn_active.tga" image_hover_selected="profile_chevron_btn_active.tga" + image_disabled_selected="profile_chevron_btn.tga" font="SansSerifBigBold" + /> + + + +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_bars.xml b/indra/newview/skins/default/xui/en/panel_bars.xml new file mode 100644 index 0000000000000000000000000000000000000000..9c06329eaff14fe0e37a504a42d6218562e0bb1c --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_bars.xml @@ -0,0 +1,69 @@ +<?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="bottom_panel" + width="1024"> + <panel + follows="left|right|top|bottom" + height="728" + layout="topleft" + left="0" + mouse_opaque="false" + name="status" + top="0" + width="1024" /> + <layout_stack + border_size="0" + follows="left|right|bottom|top" + height="768" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="bar_stack" + top_delta="0" + use_bounding_rect="true" + width="1024"> + <layout_panel + follows="left|right|top|bottom" + height="768" + layout="topleft" + left="0" + mouse_opaque="false" + name="spacer" + top="0" + user_resize="false" + width="1024" /> + <layout_panel + auto_resize="false" + height="200" + layout="topleft" + min_height="200" + mouse_opaque="false" + name="overlay" + use_bounding_rect="true" + user_resize="false" + width="1024" /> + <layout_panel + auto_resize="false" + filename="panel_toolbar.xml" + layout="topleft" + min_height="28" + name="toolbar" + use_bounding_rect="true" + user_resize="false" + width="1024" /> + </layout_stack> + <panel + follows="left|right|top|bottom" + height="728" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="hud" + top_delta="-10" + width="1024" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml new file mode 100644 index 0000000000000000000000000000000000000000..303487f21ba3631087a347430e65290bc1513773 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel follows="left|bottom|right" name="bottom_tray" bg_opaque_color="0.25 0.25 0.25 1.0" + bg_alpha_color="0.25 0.25 0.25 1.0" background_visible="true" auto_resize="true" + left="0" bottom="0" width="1000" height="28" border_visible="false" has_border="false"> + <layout_stack name="toolbar_stack" follows="left|right|bottom|top" + bottom="0" left="0" width="1000" height="25" orientation="horizontal" border_size="0" auto_resize="false"> + + <icon image_name="spacer24.tga" left="0" width="5" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/> + <panel follows="left|right" auto_resize="true" width="250" height="28" min_height="28"> + <line_editor name="chat_box" follows="left|right" + width="250" height="20" left="0" bottom="6" + bevel_style="in" border_style="line" border_thickness="1"/> + </panel> + <icon image_name="spacer24.tga" left="0" width="5" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/> + <view_border bevel_style="in" bottom="0" height="28" min_height="28" width="1" follows="left|right" left="270" mouse_opaque="false" auto_resize="false"/> + <icon image_name="spacer24.tga" left="0" width="5" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/> + <panel follows="left|right" auto_resize="false" width="100" height="28" min_height="28"> + <chiclet_talk name="talk" left="0" bottom="6" width="100" height="20" follows="left|right" auto_resize="false"/> + </panel> + <icon name="DUMMY" image_name="spacer24.tga" left="0" width="150" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/> + <panel follows="left|right" auto_resize="true" width="250" height="28" min_height="28"> + <chiclet_panel name="chiclet_list" follows="left|right" + width="250" height="25" left="0" bottom="2"/> + </panel> + <icon image_name="spacer24.tga" left="0" width="5" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/> + <panel follows="left|right" auto_resize="false" width="40" height="28" min_height="28"> + <chiclet_notification name="im_well" follows="left|right" auto_resize="false" + left="0" bottom="4" width="40" height="25" + image_unselected="im_notifications.tga" image_selected="im_notifications.tga"/> + </panel> + <icon image_name="spacer24.tga" left="0" width="10" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/> + <view_border bevel_style="in" bottom="0" height="30" width="1" follows="left|right" left="270" mouse_opaque="false" auto_resize="false"/> + <icon image_name="spacer24.tga" left="0" width="10" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/> + <panel follows="left|right" auto_resize="false" width="48" height="28" min_height="28"> + <chiclet_notification name="sys_well" follows="left|right" auto_resize="false" + left="0" bottom="5" width="48" height="25" + image_unselected="sys_notifications.tga" image_selected="sys_notifications.tga"/> + </panel> + <icon image_name="spacer24.tga" left="0" width="5" height="10" bottom="0" follows="left|right" auto_resize="false" color="0 0 0 0"/> + </layout_stack> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_classified.xml b/indra/newview/skins/default/xui/en/panel_classified.xml new file mode 100644 index 0000000000000000000000000000000000000000..f2cec86b38c3627241a1c55b17d5d95722121cdf --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_classified.xml @@ -0,0 +1,135 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + follows="bottom|left" + height="490" + label="Classified" + layout="topleft" + left="330" + name="Classified" + top="490" + width="450"> + <panel.string + name="ad_placed_paid"> + Ad placed: [DATE], Paid L$[AMT] for listing. + </panel.string> + <panel.string + name="update_txt"> + Update + </panel.string> + <panel.string + name="publish_txt"> + Publish... + </panel.string> + <panel.string + name="dateStr"> + [mthnum,datetime,slt]/[day,datetime,slt]/[year,datetime,slt] + </panel.string> + <texture_picker + follows="left|top" + height="300" + layout="topleft" + left="20" + name="snapshot_ctrl" + top="15" + width="400" /> + <line_editor + enabled="false" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left_delta="0" + name="given_name_editor" + tool_tip="Name must begin with a letter or number, not punctuation." + top_delta="288" + width="400" /> + <text_editor + enabled="false" + follows="left|top" + height="90" + layout="topleft" + left="20" + max_length="1023" + name="desc_editor" + width="400" + word_wrap="true" /> + <line_editor + enabled="false" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="20" + name="location_editor" + tool_tip="Set the location for this classified to your current position." + width="400" /> + <button + follows="left|top" + height="20" + label="Set" + layout="topleft" + left_delta="360" + name="set_location_btn" + top_delta="0" + width="60" /> + <button + follows="left|top" + height="20" + label="Teleport" + layout="topleft" + left="20" + name="classified_teleport_btn" + top="449" + width="100" /> + <button + follows="left|top" + height="20" + label="Show on Map" + layout="topleft" + left_pad="5" + name="classified_map_btn" + top_delta="0" + width="100" /> + <button + follows="left|top" + height="20" + label="Profile" + layout="topleft" + left_pad="5" + name="classified_profile_btn" + top_delta="0" + width="100" /> + <combo_box + height="20" + layout="topleft" + left="30" + name="classified_mature_check" + top="48" + width="130"> + <combo_box.item + label="- Select Mature -" + value="Select" /> + <combo_box.item + label="Mature Content" + value="Mature" /> + <combo_box.item + label="PG Content" + value="Not Mature" /> + </combo_box> + <combo_box + bottom="45" + height="18" + layout="topleft" + left="20" + name="classified_category_combo" + right="150" /> + <button + follows="left|top" + height="20" + label="Update" + layout="topleft" + left="30" + name="classified_update_btn" + top="70" + width="70" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml new file mode 100644 index 0000000000000000000000000000000000000000..967cf2f539d5987b1a7f38a6976fd49cfeff42bf --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml @@ -0,0 +1,147 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + bevel_style="in" + bg_alpha_color="0.2 0.2 0.2 1" + height="640" + label="Edit Pick" + layout="topleft" + left="0" + name="panel_edit_pick" + top="0" + width="355"> + <text + type="string" + length="1" + follows="top" + font="SansSerifHugeBold" + height="15" + layout="topleft" + left="10" + name="title" + text_color="white" + top="0" + width="150"> + Edit Pick + </text> + <panel + background_visible="true" + bg_alpha_color="0.5 0.5 0.5 1" + follows="left|right|top|bottom" + height="570" + layout="topleft" + left="10" + right="-10" + top="30"> + <texture_picker + follows="left|top|right" + height="150" + layout="topleft" + left="10" + name="pick_snapshot" + right="-10" + top="10" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="Name:"> + Name: + </text> + <line_editor + follows="left|top|right" + font="SansSerif" + height="20" + layout="topleft" + left="10" + name="pick_name" + right="-10" + width="290" /> + <text + type="string" + length="1" + follows="left|top" + height="30" + layout="topleft" + left="10" + name="description_label" + v_pad="15" + valign="center"> + Description: + </text> + <text_editor + follows="left|top|right" + height="100" + layout="topleft" + left="10" + max_length="1023" + name="pick_desc" + right="-10" + word_wrap="true" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + name="description_label" + v_pad="15" + valign="bottom"> + Location: + </text> + <text + type="string" + length="1" + follows="left|top" + height="50" + layout="topleft" + left="10" + name="pick_location" + right="-10" + v_pad="10" + valign="center" + word_wrap="true"> + loading... + </text> + <button + follows="left|top" + height="20" + label="Set to Current Location" + layout="topleft" + left="10" + name="set_to_curr_location_btn" + width="200" /> + </panel> + <panel + follows="right|bottom" + height="25" + label="bottom_panel" + layout="topleft" + left="5" + name="bottom_panel" + top="605" + width="345"> + <button + follows="bottom|left" + height="20" + label="Save Changes" + layout="topleft" + name="save_changes_btn" + right="-120" + top="5" + width="130" /> + <button + follows="bottom|left" + height="20" + label="Cancel" + layout="topleft" + name="cancel_btn" + right="-10" + top="5" + width="90" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml new file mode 100644 index 0000000000000000000000000000000000000000..e787d03ecaaab3cc60bfdbb478d8c7bc863d11cc --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -0,0 +1,243 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + class="edit_profile_panel" + background_visible="true" + bevel_style="in" + bg_alpha_color="0.3 0.3 0.3 1" + follows="left|top|right|bottom" + height="690" + label="Profile Edit" + layout="topleft" + left="10" + mouse_opaque="true" + name="edit_profile_panel" + top="10" + width="355"> + <text + top="0" + left="9" + height="20" + follows="left|top" + font="SansSerifHugeBold" + layout="topleft" + name="title_text" + text_color="white" + width="350"> + Edit Profile + </text> + <panel + background_visible="true" + bg_alpha_color="0.6 0.6 0.6 1" + follows="left|top|right|bottom" + height="620" + layout="topleft" + left="9" + name="data_panel" + top_pad="10" + width="337"> + <text + top_pad="5" + left="9" + height="20" + follows="left|top" + font="SansSerifBigBold" + layout="topleft" + name="name_text" + text_color="white" + width="350"> + [FIRST] [LAST] + </text> + <panel + follows="left|top" + height="120" + layout="topleft" + left="9" + name="lifes_images_panel" + top_pad="10" + width="250"> + <panel + height="120" + layout="topleft" + left="0" + name="second_life_image_panel" + top="0" + width="125"> + <text + type="string" + length="1" + follows="left|top|right|bottom" + font="SansSerifBold" + height="20" + layout="topleft" + left="0" + name="first_life_photo_title_text" + text_color="white" + top="0" + width="125"> + Second Life photo: + </text> + <texture_picker + allow_no_texture="true" + default_image_name="None" + follows="top|left" + height="105" + layout="topleft" + left="0" + name="2nd_life_pic" + top_pad="5" + width="105" /> + </panel> + <panel + height="120" + layout="topleft" + left_pad="0" + name="first_life_image_panel" + top="0" + width="125"> + <text + type="string" + length="1" + follows="left|top|right|bottom" + font="SansSerifBold" + height="20" + layout="topleft" + left="0" + name="second_life_photo_title_text" + text_color="white" + top="0" + width="125"> + First Life photo: + </text> + <texture_picker + allow_no_texture="true" + default_image_name="None" + follows="top|left" + height="105" + layout="topleft" + left="0" + name="1st_life_pic" + top_pad="5" + width="105" /> + </panel> + </panel> + <text + type="string" + length="1" + follows="left|top" + font="SansSerifBold" + height="15" + layout="topleft" + left="9" + name="title_sl_descr_text" + text_color="white" + top_pad="10" + width="290"> + Second Life description: + </text> + <text_editor + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="45" + layout="topleft" + left="9" + name="sl_description_edit" + text_color="0.1 0.1 0.1 1" + width="290" + word_wrap="true"> + </text_editor> + <text + type="string" + length="1" + follows="left|top" + font="SansSerifBold" + height="15" + layout="topleft" + left="9" + name="title_fl_descr_text" + text_color="white" + top_pad="10" + width="290"> + First Life description: + </text> + <text_editor + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="45" + layout="topleft" + left="9" + name="fl_description_edit" + text_color="0.1 0.1 0.1 1" + width="290" + word_wrap="true"> + </text_editor> + <text + type="string" + length="1" + follows="left|top" + font="SansSerifBold" + height="15" + layout="topleft" + left="9" + name="title_homepage_text" + text_color="white" + top_pad="10" + width="100"> + Homepage: + </text> + <line_editor + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + font.style="UNDERLINE" + height="15" + layout="topleft" + left="9" + name="homepage_edit" + text_color="0.2 0.2 1 1" + width="290"> + TODO + </line_editor> + <check_box + follows="left|top" + label="Show me in Search results" + layout="topleft" + left="9" + name="show_in_search_checkbox" + height="16" + top_pad="10" + width="250"/> + </panel> + <panel + follows="bottom|right" + height="30" + left="96" + name="profile_me_buttons_panel" + top_pad="8" + width="250"> + <button + follows="bottom|right" + font="SansSerifSmallBold" + height="25" + label="Save Changes" + layout="topleft" + left="0" + name="save_btn" + top="0" + width="130" /> + <button + follows="bottom|right" + font="SansSerifSmallBold" + height="25" + label="Cancel" + layout="topleft" + right="-1" + name="cancel_btn" + top_delta="0" + width="105" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_friends.xml b/indra/newview/skins/default/xui/en/panel_friends.xml new file mode 100644 index 0000000000000000000000000000000000000000..a151eed20f87aec840011b7f8d93f2bf6038b51b --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_friends.xml @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="all" + height="347" + layout="topleft" + name="friends" + width="100"> + <panel.string + name="Multiple"> + Multiple friends... + </panel.string> + <scroll_list + bottom="337" + column_padding="0" + draw_heading="true" + follows="left|top|bottom|right" + layout="topleft" + left="10" + multi_select="true" + name="friend_list" + right="-100" + search_column="1" + tool_tip="Hold shift or control while clicking to select multiple friends" + top="10"> + <scroll_list.columns + image="ff_online_status_button.tga" + name="icon_online_status" + tool_tip="Online status" + width="20" /> + <scroll_list.columns + dynamicwidth="true" + label="Name" + name="friend_name" + tool_tip="Name" /> + <scroll_list.columns + image="ff_visible_online_button.tga" + name="icon_visible_online" + tool_tip="Friend can see when you're online" + width="20" /> + <scroll_list.columns + image="ff_visible_map_button.tga" + name="icon_visible_map" + tool_tip="Friend can locate you on the map" + width="20" /> + <scroll_list.columns + image="ff_edit_mine_button.tga" + name="icon_edit_mine" + tool_tip="Friend can edit, delete or take objects" + width="20" /> + <scroll_list.columns + image="ff_edit_theirs_button.tga" + name="icon_edit_theirs" + tool_tip="You can edit this friend's objects" + width="20" /> + <scroll_list.columns + name="friend_last_update_generation" + width="0" /> + </scroll_list> + <locate + bottom="7" + layout="topleft" + left="-90" /> + <button + follows="top|right" + height="22" + label="IM/Call" + layout="topleft" + left_pad="10" + name="im_btn" + tool_tip="Open Instant Message session" + top_pad="3" + width="80" /> + <button + follows="top|right" + height="22" + label="Profile" + layout="topleft" + left_delta="0" + name="profile_btn" + tool_tip="Show picture, groups, and other information" + top_pad="3" + width="80" /> + <button + follows="top|right" + height="22" + label="Teleport..." + layout="topleft" + left_delta="0" + name="offer_teleport_btn" + tool_tip="Offer this friend a teleport to your current location" + top_pad="3" + width="80" /> + <button + follows="top|right" + height="22" + label="Pay..." + layout="topleft" + left_delta="0" + name="pay_btn" + tool_tip="Give Linden dollars (L$) to this friend" + top_pad="3" + width="80" /> + <button + follows="top|right" + height="22" + label="Remove..." + layout="topleft" + left_delta="0" + name="remove_btn" + tool_tip="Remove this person from your friends list" + top_pad="3" + width="80" /> + <button + follows="top|right" + height="22" + label="Add..." + layout="topleft" + left_delta="0" + name="add_btn" + tool_tip="Offer friendship to a resident" + top_pad="13" + width="80" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml new file mode 100644 index 0000000000000000000000000000000000000000..10d10f60ff67247d5a74fa395f832695fc3f316c --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_group_general.xml @@ -0,0 +1,316 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="all" + height="466" + label="General" + layout="topleft" + left="1" + name="general_tab" + top="466" + width="418"> + <panel.string + name="help_text"> + The General tab contains general information about +this group, a list of Owners and visible Members, +general Group Preferences and member options. + +Hover your mouse over the options for more help. + </panel.string> + <panel.string + name="group_info_unchanged"> + General group information has changed. + </panel.string> + <panel.string + name="incomplete_member_data_str"> + Retrieving member data + </panel.string> + <panel.string + name="confirm_group_create_str"> + Creating this group will cost L$100. +Are you really, really, REALLY sure you want to spend L$100 to create this group? +Be aware that if nobody else joins this group within 48 hours, it will be disbanded and the group's name will be unavailable for future use. + </panel.string> + <panel.string + name="group_join_btn"> + Join (L$[AMOUNT]) + </panel.string> + <button + follows="left|top" + height="16" + label="?" + label_selected="?" + layout="topleft" + left="391" + name="help_button" + top="8" + width="20" /> + <line_editor + follows="left|top" + font="SansSerif" + halign="left" + height="16" + label="Type your new group name here" + layout="topleft" + left_delta="-384" + max_length="35" + name="group_name_editor" + top_delta="0" + width="300" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerifBig" + height="16" + layout="topleft" + left_delta="0" + name="group_name" + top_delta="-4" + width="300"> + Type your new group name here + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + name="prepend_founded_by" + top_pad="4" + width="100"> + Founded by + </text> + <name_box + follows="left|top" + height="16" + initial_value="(retrieving)" + layout="topleft" + left_delta="63" + name="founder_name" + top_delta="0" + width="200" /> + <text + type="string" + length="1" + height="16" + layout="topleft" + name="group_charter_label" + right="410" + top="40" + width="265"> + Group Charter + </text> + <texture_picker + follows="left|top" + height="144" + label="Group Insignia" + layout="topleft" + left_delta="-138" + name="insignia" + tool_tip="Click to choose a picture" + top_delta="1" + width="128" /> + <text_editor + type="string" + length="1" + follows="left|top" + halign="left" + height="160" + hide_scrollbar="true" + layout="topleft" + max_length="511" + name="charter" + right="410" + top="55" + width="265" + word_wrap="true"> + Group Charter + </text_editor> + <button + follows="left|top" + height="22" + label="Join (L$0)" + label_selected="Join (L$0)" + layout="topleft" + left="7" + name="join_button" + top="193" + width="128" /> + <button + follows="left|top" + height="22" + label="Detailed View" + label_selected="Detailed View" + layout="topleft" + left_delta="0" + name="info_button" + top_delta="0" + width="128" /> + <text + type="string" + length="1" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="text_owners_and_visible_members" + top_pad="4" + width="160"> + Owners & Visible Members + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + name="text_owners_are_shown_in_bold" + top_delta="16" + width="160"> + (Owners are shown in bold) + </text> + <name_list + column_padding="0" + draw_heading="true" + follows="left|top" + heading_height="14" + height="80" + layout="topleft" + left_delta="0" + name="visible_members" + top_pad="8" + width="404"> + <name_list.columns + label="Member Name" + name="name" + relative_width="0.45" /> + <name_list.columns + label="Title" + name="title" + relative_width="0.3" /> + <name_list.columns + label="Last Login" + name="online" + relative_width="0.25" /> + </name_list> + <text + type="string" + length="1" + bottom_delta="18" + font="SansSerif" + layout="topleft" + name="text_group_preferences"> + Group Preferences + </text> + <panel + background_opaque="true" + bevel_style="in" + border="true" + follows="left|top" + height="96" + layout="topleft" + left_delta="0" + name="preferences_container" + top_pad="8" + width="404"> + <check_box + height="16" + initial_value="true" + label="Show in search" + layout="topleft" + left="4" + name="show_in_group_list" + tool_tip="Let people see this group in search results." + top="4" + width="95" /> + <check_box + follows="right|top" + height="16" + label="Open enrollment" + layout="topleft" + left_delta="0" + name="open_enrollement" + tool_tip="Sets whether this group allows new members to join without being invited." + top_pad="2" + width="95" /> + <check_box + height="16" + label="Enrollment fee: L$" + layout="topleft" + left_delta="16" + name="check_enrollment_fee" + tool_tip="Sets whether to require an enrollment fee to join the group." + top="40" + width="95" /> + <spinner + decimal_digits="0" + follows="left|top" + halign="left" + height="16" + increment="1" + label_width="10" + layout="topleft" + left_pad="21" + max_val="99999" + name="spin_enrollment_fee" + tool_tip="New members must pay this fee to join the group when Enrollment Fee is checked." + top_delta="-2" + width="65" /> + <combo_box + height="20" + layout="topleft" + left="6" + name="group_mature_check" + tool_tip="Sets whether your group information is considered mature." + top="64" + width="130"> + <combo_box.item + label="Select Mature -" + value="Select" /> + <combo_box.item + label="Mature Content" + value="Mature" /> + <combo_box.item + label="PG Content" + value="Not Mature" /> + </combo_box> + <text + type="string" + length="1" + height="16" + layout="topleft" + left="225" + name="active_title_label" + top="4" + width="95"> + My Active Title + </text> + <combo_box + height="16" + layout="topleft" + left_delta="0" + name="active_title" + tool_tip="Sets the title that appears in your avatar's name tag when this group is active." + top_pad="6" + width="95" /> + <check_box + height="16" + label="Receive group notices" + layout="topleft" + left_delta="0" + name="receive_notices" + tool_tip="Sets whether you want to receive Notices from this group. Uncheck this box if this group is spamming you." + top_pad="9" + width="95" /> + <check_box + height="16" + label="List group in my profile" + layout="topleft" + left_delta="0" + name="list_groups_in_profile" + tool_tip="Sets whether you want to list this group in your Profile" + top_pad="2" + width="95" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_invite.xml b/indra/newview/skins/default/xui/en/panel_group_invite.xml new file mode 100644 index 0000000000000000000000000000000000000000..43457ddd61dd058e940fd95fb73a2b233fce914f --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_group_invite.xml @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + height="380" + label="Invite a Member" + layout="topleft" + left="0" + name="invite_panel" + top="380" + width="210"> + <panel.string + name="confirm_invite_owner_str"> + Are you sure you want to invite new owner(s)? This action is permanent! + </panel.string> + <panel.string + name="loading"> + (loading...) + </panel.string> + <text + type="string" + length="1" + height="54" + layout="topleft" + left="7" + name="help_text" + top="24" + width="200"> + You can select multiple residents to +invite to your group. Click 'Open +Resident Chooser' to start. + </text> + <button + font="SansSerifSmall" + height="20" + label="Open Resident Chooser" + layout="topleft" + left_delta="-2" + name="add_button" + top_delta="44" + width="200" /> + <name_list + allow_calling_card_drop="true" + column_padding="0" + height="174" + layout="topleft" + left_delta="0" + multi_select="true" + name="invitee_list" + tool_tip="Hold the Ctrl key and click resident names to multi-select." + top_pad="4" + width="200" /> + <button + font="SansSerifSmall" + height="20" + label="Remove Selected from List" + layout="topleft" + left_delta="0" + name="remove_button" + tool_tip="Removes residents selected above from the invite list." + top_pad="4" + width="200" /> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="4" + name="role_text" + top_pad="5" + width="200"> + Choose what Role to assign them to: + </text> + <combo_box + height="16" + layout="topleft" + left_delta="0" + name="role_name" + tool_tip="Choose from the list of Roles you are allowed to assign members to." + top_delta="16" + width="196" /> + <button + font="SansSerifSmall" + height="20" + label="Send Invitations" + layout="topleft" + left="4" + name="ok_button" + top="356" + width="130" /> + <button + font="SansSerifSmall" + height="20" + label="Cancel" + layout="topleft" + left_pad="2" + name="cancel_button" + top_delta="0" + width="70" /> + <string + name="GroupInvitation"> + Group Invitation + </string> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_land_money.xml b/indra/newview/skins/default/xui/en/panel_group_land_money.xml new file mode 100644 index 0000000000000000000000000000000000000000..35691661f1e3feab2b36379594d593e1611123a9 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_group_land_money.xml @@ -0,0 +1,373 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="all" + height="470" + label="Land & L$" + layout="topleft" + left="1" + name="land_money_tab" + top="470" + width="418"> + <panel.string + name="help_text"> + Parcels owned by the group are listed along with contribution details. A warning appears until the Total Land in Use is less than or equal to the Total Contribution. The Planning, Details, and Sales tabs provide information about the group's finances. + </panel.string> + <panel.string + name="cant_view_group_land_text"> + You do not have permission to view group owned land. + </panel.string> + <panel.string + name="cant_view_group_accounting_text"> + You do not have permission to view the group's accounting information. + </panel.string> + <panel.string + name="loading_txt"> + Loading... + </panel.string> + <panel.string + name="land_contrib_error"> + Unable to set your land contribution. + </panel.string> + <button + height="16" + label="?" + layout="topleft" + left="391" + name="help_button" + top="8" + width="20" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerifBig" + height="16" + layout="topleft" + left_delta="-384" + name="group_land_heading" + top_delta="-4" + width="150"> + Group Owned Land + </text> + <scroll_list + draw_heading="true" + follows="top" + font="SansSerifSmall" + heading_height="14" + height="120" + layout="topleft" + left_delta="0" + name="group_parcel_list" + top_pad="6" + width="404"> + <scroll_list.columns + label="Parcel Name" + name="name" + width="100" /> + <scroll_list.columns + label="Region" + name="location" + width="120" /> + <scroll_list.columns + label="Type" + name="type" + width="100" /> + <scroll_list.columns + label="Area" + name="area" + width="61" /> + <scroll_list.columns + label="" + name="hidden" + width="-1" /> + </scroll_list> + <button + follows="top" + height="20" + label="Show on Map" + label_selected="Show on Map" + layout="topleft" + left="312" + name="map_button" + top="150" + width="100" + enabled="false" /> + <text + type="string" + length="1" + follows="left|top" + halign="right" + height="16" + layout="topleft" + left_delta="-305" + name="total_contributed_land_label" + top_delta="4" + width="120"> + Total Contribution: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="5" + name="total_contributed_land_value" + top_delta="0" + width="100"> + [AREA] sq. meters + </text> + <text + type="string" + length="1" + follows="left|top" + halign="right" + height="16" + layout="topleft" + left="7" + name="total_land_in_use_label" + top="172" + width="120"> + Total Land In Use: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="5" + name="total_land_in_use_value" + top_delta="0" + width="150"> + [AREA] sq. meters + </text> + <text + type="string" + length="1" + follows="left|top" + halign="right" + height="16" + layout="topleft" + left="7" + name="land_available_label" + top="190" + width="120"> + Land Available: + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="5" + name="land_available_value" + top_delta="0" + width="120"> + [AREA] sq. meters + </text> + <text + type="string" + length="1" + follows="left|top" + halign="right" + height="16" + layout="topleft" + left="7" + name="your_contribution_label" + top="208" + width="120"> + Your Contribution: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="5" + max_length="10" + name="your_contribution_line_editor" + top_delta="-2" + width="70" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="5" + name="your_contribution_max_value" + top_delta="2" + width="200"> + sq. meters ([AMOUNT] max) + </text> + <icon + height="16" + image_name="smicon_warn.tga" + layout="topleft" + left="9" + name="group_over_limit_icon" + top="235" + visible="false" + width="16" /> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_pad="5" + name="group_over_limit_text" + text_color="GroupOverTierColor" + top_delta="1" + width="400"> + Group members must contribute more land credits to support land in use. + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerifBig" + height="16" + layout="topleft" + left="12" + name="group_money_heading" + top="261" + width="150"> + Group L$ + </text> + <tab_container + follows="all" + height="180" + layout="topleft" + left="6" + name="group_money_tab_container" + tab_position="top" + top="286" + width="406"> + <panel + border="true" + follows="left|top|right|bottom" + height="255" + label="Planning" + layout="topleft" + left="1" + name="group_money_planning_tab" + top="5" + width="398"> + <text_editor + type="string" + length="1" + bg_readonly_color="0.784314 0.819608 0.8 1" + follows="all" + font="Monospace" + height="150" + layout="topleft" + left="8" + max_length="4096" + name="group_money_planning_text" + top="5" + width="382"> + Computing... + </text_editor> + </panel> + <panel + border="true" + follows="all" + height="250" + label="Details" + layout="topleft" + left_delta="0" + name="group_money_details_tab" + top_delta="163" + width="398"> + <text_editor + type="string" + length="1" + bg_readonly_color="0.784314 0.819608 0.8 1" + follows="left|top" + font="Monospace" + height="125" + layout="topleft" + left="8" + max_length="4096" + name="group_money_details_text" + top="7" + width="382"> + Computing... + </text_editor> + <button + follows="left|top" + height="20" + label="< Earlier" + label_selected="< Earlier" + layout="topleft" + left="24" + name="earlier_details_button" + tool_tip="Go back in time" + top="136" + width="80" /> + <button + follows="left|top" + height="20" + label="Later >" + label_selected="Later >" + layout="topleft" + left_pad="190" + name="later_details_button" + tool_tip="Go forward in time" + top_delta="0" + width="80" /> + </panel> + <panel + border="true" + follows="all" + height="164" + label="Sales" + layout="topleft" + left_delta="0" + name="group_money_sales_tab" + top_delta="-1" + width="398"> + <text_editor + type="string" + length="1" + bg_readonly_color="0.784314 0.819608 0.8 1" + follows="left|top" + font="Monospace" + height="125" + layout="topleft" + left="8" + max_length="4096" + name="group_money_sales_text" + top="7" + width="382"> + Computing... + </text_editor> + <button + follows="left|top" + height="20" + label="< Earlier" + label_selected="< Earlier" + layout="topleft" + left="24" + name="earlier_sales_button" + tool_tip="Go back in time" + top="136" + width="80" /> + <button + follows="left|top" + height="20" + label="Later >" + label_selected="Later >" + layout="topleft" + left_pad="190" + name="later_sales_button" + tool_tip="Go forward in time" + top_delta="0" + width="80" /> + </panel> + </tab_container> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_notices.xml b/indra/newview/skins/default/xui/en/panel_group_notices.xml new file mode 100644 index 0000000000000000000000000000000000000000..345cc734e6fb29acdef634ab63d08a3a723a3ed3 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_group_notices.xml @@ -0,0 +1,378 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="all" + height="466" + label="Notices" + layout="topleft" + left="1" + name="notices_tab" + top="466" + width="418"> + <panel.string + name="help_text"> + Notices are a quick way to communicate across a +group by broadcasting a message and delivering +an optionally attached item. Notices only go to +group members in Roles granted the ability to +receive Notices. You can turn off Notices on +the General tab. + </panel.string> + <panel.string + name="no_notices_text"> + There are no past notices. + </panel.string> + <button + height="16" + label="?" + label_selected="?" + layout="topleft" + left="391" + name="help_button" + top="8" + width="20" /> + <text + type="string" + length="1" + font="SansSerifBig" + height="16" + layout="topleft" + left_delta="-384" + name="lbl" + top_delta="-4" + width="436"> + Group Notices Archive + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + name="lbl2" + top_pad="4" + width="436"> + Notices are kept for 14 days. Click the notice below you wish to view. +Click the 'Refresh' button to check if new notices have been received. +Notice lists are limited to 200 notices per group on a daily basis. + </text> + <scroll_list + column_padding="0" + draw_heading="true" + heading_height="14" + height="109" + layout="topleft" + left_delta="0" + name="notice_list" + top_pad="28" + width="404"> + <scroll_list.columns + label="" + name="icon" + width="16" /> + <scroll_list.columns + label="Subject" + name="subject" + width="171" /> + <scroll_list.columns + label="From" + name="from" + width="125" /> + <scroll_list.columns + label="Date" + name="date" + width="85" /> + <scroll_list.columns + name="sort" + width="-1" /> + </scroll_list> + <text + type="string" + length="1" + layout="topleft" + name="notice_list_none_found" + visible="false"> + None found. + </text> + <button + height="20" + label="Create New Notice" + label_selected="Create New Notice" + layout="topleft" + left_delta="0" + name="create_new_notice" + top_delta="-2" + width="150" /> + <button + height="20" + label="Refresh" + label_selected="Refresh List" + layout="topleft" + left_pad="164" + name="refresh_notices" + top_delta="0" + width="90" /> + <panel + follows="all" + height="268" + label="Create New Notice" + layout="topleft" + left="1" + name="panel_create_new_notice" + top="198" + width="418"> + <text + type="string" + length="1" + font="SansSerifBig" + height="16" + layout="topleft" + left="7" + mouse_opaque="false" + name="lbl" + top="2" + width="436"> + Create a Notice + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + name="lbl2" + top_pad="4" + width="436"> + You must enter a subject to send a notice. You can add a single +item to a notice by dragging it from your inventory to this +panel. Attached items must be copiable and transferrable, +and you can't send a folder. + </text> + <text + type="string" + length="1" + halign="right" + height="16" + layout="topleft" + left_delta="0" + name="lbl3" + top_pad="47" + width="55"> + Subject: + </text> + <line_editor + border_style="line" + border_thickness="1" + height="16" + layout="topleft" + left_pad="3" + max_length="63" + name="create_subject" + top_delta="0" + width="264" /> + <text + type="string" + length="1" + halign="right" + height="16" + layout="topleft" + left="7" + name="lbl4" + top="103" + width="55"> + Message: + </text> + <text_editor + height="120" + hide_scrollbar="true" + layout="topleft" + left_pad="3" + max_length="511" + name="create_message" + top_delta="2" + width="346" + word_wrap="true" /> + <text + type="string" + length="1" + halign="right" + height="16" + layout="topleft" + left="7" + name="lbl5" + top="228" + width="55"> + Attach: + </text> + <line_editor + enabled="false" + height="16" + layout="topleft" + left_pad="4" + max_length="63" + mouse_opaque="false" + name="create_inventory_name" + top_delta="2" + width="211" /> + <icon + height="16" + layout="topleft" + left_delta="0" + name="create_inv_icon" + top_delta="0" + width="16" /> + <button + height="20" + label="Remove Attachment" + label_selected="Remove Attachment" + layout="topleft" + left_pad="197" + name="remove_attachment" + top_delta="-4" + width="135" /> + <button + height="20" + label="Send Notice" + label_selected="Send Notice" + layout="topleft" + left_delta="0" + name="send_notice" + top_delta="20" + width="135" /> + <panel + bevel_style="in" + border="true" + height="76" + layout="topleft" + left="335" + name="drop_target2" + top="20" + width="76" /> + <icon + height="64" + image_name="icon_groupnoticeinventory.tga" + layout="topleft" + left_delta="5" + mouse_opaque="true" + name="drop_icon" + top="25" + width="64" /> + <group_drop_target + height="466" + layout="topleft" + left="0" + name="drop_target" + tool_tip="Drag an inventory item onto the message box to send it with the notice. You must have permission to copy and transfer the object to send it with the notice." + top="-198" + width="422" /> + </panel> + <panel + follows="all" + height="268" + label="View Past Notice" + layout="topleft" + left_delta="0" + name="panel_view_past_notice" + top_delta="0" + width="418"> + <text + type="string" + length="1" + font="SansSerifBig" + height="16" + layout="topleft" + left="7" + mouse_opaque="false" + name="lbl" + top="2" + width="436"> + Archived Notice + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + name="lbl2" + top_pad="4" + width="436"> + To send a new notice, click the 'Create New Notice' button above. + </text> + <text + type="string" + length="1" + halign="right" + height="16" + layout="topleft" + left_delta="0" + name="lbl3" + top_pad="24" + visible="false" + width="55"> + Subject: + </text> + <line_editor + border_style="line" + border_thickness="1" + enabled="false" + height="16" + layout="topleft" + left_pad="3" + max_length="63" + name="view_subject" + top_delta="0" + visible="false" + width="346" /> + <text + type="string" + length="1" + halign="right" + height="16" + layout="topleft" + left="7" + name="lbl4" + top="80" + visible="false" + width="55"> + Message: + </text> + <text_editor + enabled="false" + height="206" + hide_scrollbar="true" + layout="topleft" + left_delta="0" + max_length="511" + name="view_message" + top_delta="-42" + width="404" + word_wrap="true" /> + <button + height="20" + label="Open Attachment" + label_selected="Open Attachment" + layout="topleft" + left_delta="0" + name="open_attachment" + top_pad="4" + width="110" /> + <line_editor + enabled="false" + height="16" + layout="topleft" + left_pad="3" + max_length="63" + mouse_opaque="false" + name="view_inventory_name" + top_delta="1" + width="264" /> + <icon + height="16" + layout="topleft" + left_delta="0" + name="view_inv_icon" + top_delta="0" + width="16" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml new file mode 100644 index 0000000000000000000000000000000000000000..c758da4b6344dcb0c85b7cca03f1301ce5791311 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -0,0 +1,743 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + height="466" + label="Members & Roles" + layout="topleft" + left="1" + name="roles_tab" + top="466" + width="418"> + <panel.string + name="default_needs_apply_text"> + There are unapplied changes on the current sub-tab. + </panel.string> + <panel.string + name="want_apply_text"> + Do you want to apply these changes? + </panel.string> + <panel.string + name="help_text" /> + <button + height="16" + label="?" + layout="topleft" + left="391" + name="help_button" + top="8" + width="20" /> + <panel + height="24" + layout="topleft" + left="7" + name="members_header" + top="0" + width="380"> + <text + type="string" + length="1" + font="SansSerifBig" + height="16" + layout="topleft" + left="0" + name="static" + top="4" + width="150"> + Members & Roles + </text> + <text + type="string" + length="1" + height="32" + layout="topleft" + left_delta="0" + name="static2" + top_pad="4" + width="400"> + Group Members are assigned Roles with Abilities. These settings can +easily be customized, allowing for greater organization and flexibility. + </text> + </panel> + <panel + height="24" + layout="topleft" + left_delta="0" + name="roles_header" + top_delta="0" + visible="false" + width="380"> + <text + type="string" + length="1" + font="SansSerifBig" + height="16" + layout="topleft" + left="0" + name="static" + top="4" + width="100"> + Roles + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + name="role_properties_modifiable" + top_pad="4" + visible="false" + width="394"> + Select a Role below. You can modify its Name, Description and Member Title. + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + name="role_properties_not_modifiable" + top_delta="0" + width="394"> + Select a Role below to see its properties, Members and allowed Abilities. + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + name="role_actions_modifiable" + top_delta="14" + visible="false" + width="394"> + You can also assign Abilities to the Role. + </text> + <text + type="string" + length="1" + height="16" + layout="topleft" + left_delta="0" + name="role_actions_not_modifiable" + top_delta="0" + width="394"> + You may view, but not modify, assigned Abilities. + </text> + </panel> + <panel + height="24" + layout="topleft" + left_delta="0" + name="actions_header" + top_delta="20" + visible="false" + width="380"> + <text + type="string" + length="1" + font="SansSerifBig" + height="16" + layout="topleft" + left="0" + name="static" + top="-16" + width="200"> + Abilities + </text> + <text + type="string" + length="1" + height="32" + layout="topleft" + left_delta="0" + name="static2" + top_pad="4" + width="394"> + You can view an Ability's Description and which Roles and Members can +execute the Ability. + </text> + </panel> + <tab_container + height="180" + layout="topleft" + left_delta="-1" + name="roles_tab_container" + tab_position="top" + top_pad="10" + width="406"> + <panel + border="true" + height="164" + label="Members" + layout="topleft" + left="1" + name="members_sub_tab" + tool_tip="Members" + top="16" + width="406"> + <panel.string + name="help_text"> + You can add or remove Roles assigned to Members. +Select multiple Members by holding the Ctrl key and +clicking on their names. + </panel.string> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + max_length="63" + name="search_text" + top="5" + width="100" /> + <button + font="SansSerifSmall" + height="20" + label="Search" + layout="topleft" + left_pad="5" + name="search_button" + top_delta="-2" + width="60" /> + <button + enabled="false" + font="SansSerifSmall" + height="20" + label="Show All" + layout="topleft" + left_pad="5" + name="show_all_button" + top_delta="0" + width="80" /> + <name_list + column_padding="0" + draw_heading="true" + heading_height="14" + height="120" + layout="topleft" + left="4" + multi_select="true" + name="member_list" + top="24" + width="396"> + <name_list.columns + label="Member Name" + name="name" + width="136" /> + <name_list.columns + label="Donated Tier" + name="donated" + width="136" /> + <name_list.columns + label="Last Login" + name="online" + width="116" /> + </name_list> + <button + height="19" + label="Invite New Member ..." + layout="topleft" + left_delta="0" + name="member_invite" + top_pad="1" + width="146" /> + <button + height="19" + label="Eject From Group" + layout="topleft" + left_pad="103" + name="member_eject" + top_delta="0" + width="146" /> + <icon + height="16" + image_name="inv_folder_plain_closed.tga" + layout="topleft" + name="power_folder_icon" + visible="false" + width="16" /> + </panel> + <panel + border="true" + height="164" + label="Roles" + layout="topleft" + left_delta="0" + name="roles_sub_tab" + top_delta="0" + width="398"> + <panel.string + name="help_text"> + Roles have a title and an allowed list of Abilities +that Members can perform. Members can belong to +one or more Roles. A group can have up to 10 Roles, +including the Everyone and Owner Roles. + </panel.string> + <panel.string + name="cant_delete_role"> + The 'Everyone' and 'Owners' Roles are special and cannot be deleted. + </panel.string> + <panel.string + name="power_folder_icon"> + inv_folder_plain_closed.tga + </panel.string> + <panel.string + name="power_all_have_icon"> + checkbox_enabled_true.tga + </panel.string> + <panel.string + name="power_partial_icon"> + checkbox_enabled_false.tga + </panel.string> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left="4" + max_length="63" + name="search_text" + top="5" + width="100" /> + <button + font="SansSerifSmall" + height="20" + label="Search" + layout="topleft" + left_pad="5" + name="search_button" + top_delta="-2" + width="60" /> + <button + enabled="false" + font="SansSerifSmall" + height="20" + label="Show All" + layout="topleft" + left_pad="5" + name="show_all_button" + top_delta="0" + width="80" /> + <scroll_list + column_padding="0" + draw_heading="true" + follows="left|top" + heading_height="14" + height="120" + layout="topleft" + left="4" + name="role_list" + top="23" + width="396"> + <scroll_list.columns + label="Role Name" + name="name" + width="126" /> + <scroll_list.columns + label="Title" + name="title" + width="186" /> + <scroll_list.columns + label="Members" + name="members" + width="76" /> + </scroll_list> + <button + height="19" + label="Create New Role ..." + layout="topleft" + left_delta="0" + name="role_create" + top_pad="2" + width="146" /> + <button + height="19" + label="Delete Role" + layout="topleft" + left_pad="95" + name="role_delete" + top_delta="0" + width="146" /> + </panel> + <panel + border="true" + height="164" + label="Abilities" + layout="topleft" + left_delta="0" + name="actions_sub_tab" + top_delta="0" + width="398"> + <panel.string + name="help_text"> + Abilities allow Members in Roles to do specific +things in this group. There's a broad variety of Abilities. + </panel.string> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left="6" + max_length="63" + name="search_text" + top="5" + width="100" /> + <button + font="SansSerifSmall" + height="20" + label="Search" + layout="topleft" + left_pad="5" + name="search_button" + top_delta="-2" + width="60" /> + <button + enabled="false" + font="SansSerifSmall" + height="20" + label="Show All" + layout="topleft" + left_pad="5" + name="show_all_button" + top_delta="0" + width="80" /> + <scroll_list + column_padding="0" + draw_stripes="false" + follows="left|top" + height="134" + layout="topleft" + left="6" + multi_select="true" + name="action_list" + search_column="1" + tool_tip="Select an Ability to view more details." + top="23" + width="392"> + <scroll_list.columns + label="" + name="icon" + width="18" /> + <scroll_list.columns + label="" + name="action" + width="356" /> + </scroll_list> + <icon + height="16" + image_name="inv_folder_plain_closed.tga" + layout="topleft" + name="power_folder_icon" + visible="false" + width="16" /> + </panel> + </tab_container> + <panel + height="215" + layout="topleft" + left_delta="1" + name="members_footer" + top_pad="20" + width="406"> + <text + type="string" + length="1" + font="SansSerif" + height="16" + layout="topleft" + left="0" + name="static" + top="-16" + width="100"> + Assigned Roles + </text> + <text + type="string" + length="1" + font="SansSerif" + height="16" + layout="topleft" + left_pad="50" + name="static2" + top_delta="0" + width="150"> + Allowed Abilities + </text> + <scroll_list + draw_stripes="false" + enabled="false" + height="198" + layout="topleft" + left="0" + name="member_assigned_roles" + top="1" + width="145"> + <scroll_list.columns + label="" + name="checkbox" + width="18" /> + <scroll_list.columns + label="" + name="role" + width="109" /> + </scroll_list> + <scroll_list + draw_stripes="false" + enabled="false" + height="198" + layout="topleft" + left_pad="5" + name="member_allowed_actions" + tool_tip="For Details of each Allowed Ability see the Abilities tab." + top_delta="0" + width="254"> + <scroll_list.columns + label="" + name="icon" + width="14" /> + <scroll_list.columns + label="" + name="action" + width="224" /> + </scroll_list> + </panel> + <panel + height="215" + layout="topleft" + left_delta="0" + name="roles_footer" + top_delta="0" + visible="false" + width="406"> + <text + type="string" + length="1" + font="SansSerif" + height="16" + layout="topleft" + left="0" + name="static" + top="-16" + width="100"> + Name + </text> + <text + type="string" + length="1" + font="SansSerif" + height="16" + layout="topleft" + left_pad="50" + name="static2" + top_delta="0" + width="100"> + Description + </text> + <line_editor + type="string" + length="1" + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left="0" + max_length="20" + name="role_name" + top="0" + width="145"> + Employees + </line_editor> + <text + type="string" + length="1" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="static3" + top_delta="16" + width="100"> + Title + </text> + <line_editor + type="string" + length="1" + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + max_length="20" + name="role_title" + top_delta="16" + width="145"> + (waiting) + </line_editor> + <text_editor + type="string" + length="1" + halign="left" + height="48" + hide_scrollbar="true" + layout="topleft" + left="150" + max_length="254" + name="role_description" + top="0" + width="254" + word_wrap="true"> + (waiting) + </text_editor> + <text + type="string" + length="1" + font="SansSerif" + height="16" + layout="topleft" + left="0" + name="static4" + top="58" + width="120"> + Assigned Members + </text> + <text + type="string" + length="1" + font="SansSerif" + height="16" + layout="topleft" + left_pad="30" + name="static5" + tool_tip="A list of Abilities the currently selected role can perform." + top_delta="0" + width="240"> + Allowed Abilities + </text> + <name_list + draw_stripes="false" + enabled="false" + height="105" + layout="topleft" + left="0" + name="role_assigned_members" + top="74" + width="145" /> + <check_box + height="16" + label="Members are visible" + layout="topleft" + left_delta="0" + name="role_visible_in_list" + tool_tip="Sets whether members of this role are visible in the General tab to people outside of the group." + top_pad="4" + width="361" /> + <scroll_list + draw_stripes="false" + height="125" + layout="topleft" + left="150" + name="role_allowed_actions" + search_column="2" + tool_tip="For Details of each Allowed Ability see the Abilities tab." + top="74" + width="254"> + <scroll_list.columns + label="" + name="icon" + width="2" /> + <scroll_list.columns + label="" + name="checkbox" + width="16" /> + <scroll_list.columns + label="" + name="action" + width="220" /> + </scroll_list> + </panel> + <panel + height="215" + layout="topleft" + left_delta="0" + name="actions_footer" + top_delta="0" + visible="false" + width="406"> + <text + type="string" + length="1" + font="SansSerif" + height="16" + layout="topleft" + left="0" + name="static" + top="-16" + width="100"> + Description + </text> + <text_editor + type="string" + length="1" + enabled="false" + halign="left" + height="48" + hide_scrollbar="true" + layout="topleft" + left_delta="0" + max_length="512" + name="action_description" + top_delta="16" + width="404" + word_wrap="true"> + This Ability is 'Eject Members from this Group'. Only an Owner can eject another Owner. + </text_editor> + <text + type="string" + length="1" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="static2" + top_pad="10" + width="145"> + Roles with Ability + </text> + <text + type="string" + length="1" + font="SansSerif" + height="16" + layout="topleft" + left_pad="5" + name="static3" + top_delta="0" + width="200"> + Members with Ability + </text> + <scroll_list + enabled="false" + height="125" + layout="topleft" + left="0" + name="action_roles" + top="74" + width="145" /> + <name_list + enabled="false" + height="125" + layout="topleft" + left_pad="5" + name="action_members" + top_delta="0" + width="254" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_groups.xml b/indra/newview/skins/default/xui/en/panel_groups.xml new file mode 100644 index 0000000000000000000000000000000000000000..bba399481b4e1ab5efb49719adf8de6eb1f45f29 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_groups.xml @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="all" + height="347" + layout="topleft" + left="280" + name="groups" + top="24" + width="350"> + <scroll_list + bottom="302" + follows="left|top|right|bottom" + layout="topleft" + left="10" + name="group list" + top="10" + width="240"> + <scroll_list.columns + label="" + name="name" + width="248" /> + </scroll_list> + <text + type="string" + length="1" + follows="left|bottom" + height="16" + layout="topleft" + left_delta="2" + mouse_opaque="false" + name="groupdesc" + top_pad="7" + width="248"> + Your currently active group is displayed in bold. + </text> + <text + type="string" + length="1" + follows="left|bottom" + height="16" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="groupcount" + top_pad="1" + width="248"> + You belong to [COUNT] groups (of [MAX] maximum). + </text> + <locate + height="0" + layout="topleft" + left="-90" + top="7" + width="1" /> + <button + follows="top|right" + height="22" + label="IM/Call" + layout="topleft" + left_delta="0" + name="IM" + tool_tip="Open Instant Message session" + top_pad="3" + width="80" /> + <button + follows="top|right" + height="22" + label="Info" + layout="topleft" + left_delta="0" + name="Info" + top_pad="3" + width="80" /> + <button + follows="top|right" + height="22" + label="Activate" + layout="topleft" + left_delta="0" + name="Activate" + top_pad="3" + width="80" /> + <button + follows="top|right" + height="22" + label="Leave" + layout="topleft" + left_delta="0" + name="Leave" + top_pad="3" + width="80" /> + <button + follows="top|right" + height="22" + label="Create..." + layout="topleft" + left_delta="0" + name="Create" + top_pad="13" + width="80" /> + <button + follows="top|right" + height="22" + label="Search..." + layout="topleft" + left_delta="0" + name="Search..." + top_pad="3" + width="80" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml new file mode 100644 index 0000000000000000000000000000000000000000..e252788c69ce8457e69a5982c82100373c9ef927 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml @@ -0,0 +1,258 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + bg_alpha_color="0.3 0.3 0.3 1" + height="560" + label="Landmark" + layout="topleft" + left="0" + name="landmark_info" + top="800" + width="355"> + <panel.string + name="not_available"> + (N\A) + </panel.string> + <panel.string + name="unknown"> + (unknown) + </panel.string> + <panel.string + name="public"> + (public) + </panel.string> + <panel.string + name="server_update_text"> + Place information not available without server update. + </panel.string> + <panel.string + name="server_error_text"> + Information about this location is unavailable at this time, please try again later. + </panel.string> + <panel.string + name="server_forbidden_text"> + Information about this location is unavailable due to access restrictions. Please check your permissions with the parcel owner. + </panel.string> + <panel.string + name="acquired_date"> + [wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local] + </panel.string> + <button + follows="top|left" + height="20" + image_overlay="navbar_back.tga" + image_selected="navbar_bg_button.tga" + image_unselected="navbar_bg_button.tga" + layout="topleft" + left="10" + name="back_btn" + picture_style="true" + top="20" + width="20" /> + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerifHugeBold" + height="20" + layout="topleft" + left="50" + name="panel_title" + text_color="white" + top="20" + width="150"> + Landmark + </text> + <texture_picker + follows="top|left" + height="128" + layout="topleft" + left="10" + name="logo" + top="60" + width="128" /> + <text + follows="left|top|right" + font="SansSerifHugeBold" + height="20" + layout="topleft" + left="10" + name="region_name" + text_color="white" + top="180" + width="340" /> + <text + follows="left|top|right" + font="SansSerifBold" + height="20" + layout="topleft" + left="10" + name="parcel_name" + text_color="white" + top="205" + width="340" /> + <panel + follows="left|top|right|bottom" + height="335" + layout="topleft" + left="0" + name="info_panel" + top="225" + width="355"> + <text_editor + bg_focus_color="0.3 0.3 0.3 1" + bg_readonly_color="0.3 0.3 0.3 1" + follows="left|top|right" + font="SansSerif" + height="90" + hide_border="true" + hide_scrollbar="true" + layout="topleft" + left="10" + max_length="1000" + name="description" + read_only="true" + text_color="white" + top="0" + width="340" /> + <icon + follows="top|left" + height="30" + image_name="" + layout="topleft" + left="10" + mouse_opaque="true" + name="maturity" + top="95" + width="30" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="15" + layout="topleft" + left="10" + name="owner_lable" + text_color="white" + top="130" + width="50" + word_wrap="true"> + Owner: + </text> + <text + follows="left|top|right" + font="SansSerif" + height="15" + layout="topleft" + left="80" + name="owner" + text_color="white" + top="130" + width="260" + word_wrap="true" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="15" + layout="topleft" + left="10" + name="creator_lable" + text_color="white" + top="150" + width="50" + word_wrap="true"> + Creator: + </text> + <text + follows="left|top|right" + font="SansSerif" + height="15" + layout="topleft" + left="80" + name="creator" + text_color="white" + top="150" + width="260" + word_wrap="true" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="15" + layout="topleft" + left="10" + name="created_lable" + text_color="white" + top="170" + width="50" + word_wrap="true"> + Created: + </text> + <text + follows="left|top|right" + font="SansSerif" + height="15" + layout="topleft" + left="80" + name="created" + text_color="white" + top="170" + width="260" + word_wrap="true" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="15" + layout="topleft" + left="10" + name="title_lable" + text_color="white" + top="190" + width="50" + word_wrap="true"> + Title: + </text> + <line_editor + follows="left|top|right" + font="SansSerif" + height="22" + layout="topleft" + left="10" + max_length="255" + name="title_editor" + top="210" + width="330" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="15" + layout="topleft" + left="10" + name="notes_lable" + text_color="white" + top="240" + width="90" + word_wrap="true"> + My Notes: + </text> + <text_editor + follows="left|top|bottom|right" + font="SansSerif" + height="70" + hide_scrollbar="true" + layout="topleft" + left="10" + max_length="1000" + name="notes_editor" + top="260" + width="330" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml new file mode 100644 index 0000000000000000000000000000000000000000..f27b584c51e60336f4afdfeeecc6d922ccd44520 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel name="Landmarks" bottom="0" height="326" left="0" width="380" + border="true" follows="left|top|right|bottom"> + <inventory_panel allow_multi_select="true" border="true" bottom="0" + follows="left|top|right|bottom" height="326" left="0" mouse_opaque="true" + name="landmarks_list" width="380"/> + <button bottom="0" halign="center" height="16" label=">" enabled="false" + mouse_opaque="false" name="selector" width="20" left="0" + follows="right|bottom" tool_tip="View landmark properties"/> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml new file mode 100644 index 0000000000000000000000000000000000000000..20da8aa41e106b4818844d7bf9df16a7b84ef692 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -0,0 +1,221 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + follows="left|top|right|bottom" + height="600" + layout="topleft" + left="0" + name="panel_login" + top="600" + width="800"> + <panel.string + name="create_account_url"> + http://secondlife.com/registration/ + </panel.string> + <panel.string + name="real_url"> + http://secondlife.com/app/login/ + </panel.string> + <panel.string + name="forgot_password_url"> + http://secondlife.com/account/request.php + </panel.string> + <web_browser + border_visible="false" + bottom="600" + follows="top|left|bottom|right" + layout="topleft" + left="0" + name="login_html" + right="-1" + start_url="data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody bgcolor=%22#000000%22 text=%22ffffff%22%3E%3Ch1%3E%3Ctt%3Eloading...%3C/tt%3E%3C/h1%3E %3C/body%3E %3C/html%3E" + top="1" /> + <text + type="string" + length="1" + follows="left|bottom" + font="SansSerif" + height="16" + layout="topleft" + left="32" + name="first_name_text" + top="530" + width="120"> + First Name: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|bottom" + font="SansSerif" + handle_edit_keys_directly="true" + height="20" + layout="topleft" + left_delta="0" + max_length="31" + name="first_name_edit" + select_on_focus="true" + top_pad="4" + width="120" /> + <text + type="string" + length="1" + follows="left|bottom" + font="SansSerif" + height="16" + layout="topleft" + left="164" + name="last_name_text" + top="530" + width="120"> + Last Name: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|bottom" + font="SansSerif" + handle_edit_keys_directly="true" + height="20" + layout="topleft" + left_delta="0" + max_length="31" + name="last_name_edit" + select_on_focus="true" + top_pad="4" + width="120" /> + <text + type="string" + length="1" + follows="left|bottom" + font="SansSerif" + height="16" + layout="topleft" + left="296" + name="password_text" + top="530" + width="120"> + Password: + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|bottom" + font="SansSerif" + handle_edit_keys_directly="true" + height="20" + layout="topleft" + left_delta="0" + max_length="16" + name="password_edit" + select_on_focus="true" + top_pad="4" + width="120" /> + <text + type="string" + length="1" + follows="left|bottom" + font="SansSerif" + height="16" + layout="topleft" + left="32" + name="start_location_text" + top="574" + width="95"> + Start Location: + </text> + <combo_box + allow_text_entry="true" + control_name="LoginLocation" + follows="left|bottom" + height="18" + layout="topleft" + left_pad="2" + max_chars="128" + name="start_location_combo" + top_delta="0" + width="155"> + <combo_box.item + label="My Last Location" + value="last" /> + <combo_box.item + label="My Home" + value="home" /> + <combo_box.item + label="<Type region name>" + value="" /> + </combo_box> + <check_box + control_name="RememberPassword" + follows="left|bottom" + height="16" + label="Remember password" + layout="topleft" + left_pad="8" + name="remember_check" + top_delta="0" + width="138" /> + <button + follows="left|bottom" + height="24" + label="Log In" + label_selected="Log In" + layout="topleft" + left="435" + name="connect_btn" + top="548" + width="120" /> + <combo_box + allow_text_entry="true" + follows="left|bottom" + height="18" + layout="topleft" + left_pad="15" + name="server_combo" + top_delta="2" + width="120" /> + <text + type="string" + length="1" + follows="right|bottom" + halign="right" + height="16" + hover="true" + hover_color="0.2 0.45 0.72 1" + layout="topleft" + left="-210" + name="create_new_account_text" + top="539" + width="200"> + Sign up for account + </text> + <text + type="string" + length="1" + follows="right|bottom" + halign="right" + height="16" + hover="true" + hover_color="0.2 0.45 0.72 1" + layout="topleft" + left_delta="0" + name="forgot_password_text" + top_pad="4" + width="200"> + Forgot your name or password? + </text> + <text + type="string" + length="1" + follows="right|bottom" + halign="right" + height="16" + hover="true" + hover_color="0.2 0.45 0.72 1" + layout="topleft" + left="-310" + name="channel_text" + top="579" + width="300"> + [VERSION] + </text> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml new file mode 100644 index 0000000000000000000000000000000000000000..fa1abaa5951ad3b9553af9b8715455f830c94801 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -0,0 +1,142 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_opaque="true" + background_visible="true" + bg_opaque_color="0.25 0.25 0.25 1" + follows="left|top|right" + height="60" + layout="topleft" + name="navigation_bar" + width="600"> + <button + follows="left|top" + font="SansSerifSmall" + height="20" + image_disabled="navbar_bg_button.tga" + image_disabled_selected="navbar_bg_button.tga" + image_overlay="navbar_back.tga" + image_selected="navbar_bg_button.tga" + image_unselected="navbar_bg_button.tga" + layout="topleft" + left="5" + name="back_btn" + picture_style="true" + tool_tip="Go back to previous location" + top="8" + width="20" /> + <button + follows="left|top" + font="SansSerifSmall" + height="20" + image_disabled="navbar_bg_button.tga" + image_disabled_selected="navbar_bg_button.tga" + image_overlay="navbar_forward.tga" + image_selected="navbar_bg_button.tga" + image_unselected="navbar_bg_button.tga" + layout="topleft" + left_pad="2" + name="forward_btn" + picture_style="true" + tool_tip="Go forward one location" + top_delta="0" + width="20" /> + <button + follows="left|top" + font="SansSerifSmall" + height="20" + image_disabled="navbar_bg_button.tga" + image_disabled_selected="navbar_bg_button.tga" + image_overlay="navbar_home.tga" + image_selected="navbar_bg_button.tga" + image_unselected="navbar_bg_button.tga" + layout="topleft" + left_pad="5" + name="home_btn" + picture_style="true" + tool_tip="Teleport to your home location" + top_delta="0" + width="20" /> + <location_input + follows="left|right|top" + halign="right" + height="20" + label="Location" + layout="topleft" + left_pad="5" + max_chars="254" + mouse_opaque="false" + name="location_combo" + top_delta="0" + width="320"> + </location_input> + <button + follows="right|top" + height="20" + image_disabled="navbar_bg_center.tga" + image_disabled_selected="navbar_bg_center.tga" + image_hover_selected="navbar_bg_center.tga" + image_hover_unselected="navbar_bg_center.tga" + image_selected="navbar_bg_center.tga" + image_unselected="navbar_bg_center.tga" + layout="topleft" + left_pad="5" + mouse_opaque="false" + name="search_bg" + picture_style="true" + top_delta="0" + width="168" /> + <line_editor + bevel_style="none" + border_style="line" + commit_on_focus_lost="false" + follows="right|top" + halign="right" + height="18" + label="Search" + layout="topleft" + left_delta="0" + mouse_opaque="false" + name="search_input" + tool_tip="Search" + top_delta="1" + width="152" /> + <button + follows="right|top" + height="16" + image_disabled="status_search_btn.png" + image_disabled_selected="status_search_btn_pressed.png" + image_selected="status_search_btn_pressed.png" + image_unselected="status_search_btn.png" + layout="topleft" + left_delta="152" + name="search_btn" + picture_style="true" + scale_image="false" + tool_tip="Search" + top_delta="1" + width="16" /> + <button + follows="right|top" + font="SansSerifSmall" + height="20" + image_disabled="navbar_bg_button.tga" + image_disabled_selected="navbar_bg_button.tga" + image_overlay="navbar_help.tga" + image_selected="navbar_bg_button.tga" + image_unselected="navbar_bg_button.tga" + layout="topleft" + left_pad="5" + name="help_btn" + picture_style="true" + tool_tip="Help" + top_delta="-2" + width="20" /> + <favorites_bar + follows="left|right|top" + height="25" + layout="topleft" + left="5" + name="favorite" + top="32" + width="590" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml new file mode 100644 index 0000000000000000000000000000000000000000..50a78e1c7152c777fcfbc6ed9d6e4e92115fdc13 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<!-- All our XML is utf-8 encoded. --> + +<panel + name="nearby_chat" visible="true" width="250" height="480" background_opaque="false" + background_visible="true" bevel_style="in" follows="left|top" bg_alpha_color="0.3 0.3 0.3 1.0"> + <panel bottom="380" width="250" height="30" background_visible="true" background_opaque="false" bg_alpha_color="0.0 0.0 0.0 1.0" name="chat_caption"> + <text + width="140" left="25" height="20" follows="left|right|top" + font="SansSerifBigBold" text_color="white" word_wrap="true" + mouse_opaque="true" name="sender_name" >NEARBY CHAT </text> + <icon top="25" left="180" + width="20" height="20" follows="top|right" + color="1 1 1 1" enabled="true" image_name="icn_voice-groupfocus.tga" + mouse_opaque="true" name="nearby_speakers_btn"/> + <icon top="25" left="205" + width="20" height="20" follows="top|right" + color="1 1 1 1" enabled="true" image_name="inv_item_landmark_visited.tga" + mouse_opaque="true" name="tearoff_btn"/> + <icon top="22" left="230" + width="15" height="15" follows="top|right" + color="1 1 1 1" enabled="true" image_name="closebox.tga" + name="close_btn"/> + </panel> + <chat_history_view bottom="0" width="250" height="320" follows="left|right|top|bottom" name="chat_scroll" /> +</panel> + diff --git a/indra/newview/skins/default/xui/en/panel_notes.xml b/indra/newview/skins/default/xui/en/panel_notes.xml new file mode 100644 index 0000000000000000000000000000000000000000..767432a522cbb136972bb8c0f2b496e1b73b4bd6 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_notes.xml @@ -0,0 +1,202 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + follows="top|left|right|bottom" + background_visible="true" + bevel_style="in" + bg_alpha_color="0.5 0.5 0.5 1" + height="705" + label="Notes and Privacy" + layout="topleft" + left="10" + name="panel_notes" + top="10" + width="355"> + <scroll_container + left="1" width="354" height="690" follows="left|top|right|bottom" + layout="topleft" + reserve_scroll_corner="false"> + <panel + layout="topleft" + width="320" + height="690" + left="0" + top="0"> + <text + type="string" + length="1" + follows="left|top" + font="SansSerifHugeBold" + height="35" + layout="topleft" + left="10" + name="pick_title" + text_color="white" + top="10" + width="250" + word_wrap="true"> + Private Notes + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + font.style="ITALIC" + height="15" + layout="topleft" + left="10" + name="status_message" + text_color="0.1 0.1 0.1 1" + top="50" + width="300"> + Your notes about this user: + </text> + <text_editor + bg_focus_color="white" + bg_writeable_color="0.6 0.6 0.6 1" + follows="left|right" + font="SansSerif" + height="300" + hide_scrollbar="true" + layout="topleft" + left="10" + max_length="1000" + name="notes_edit" + text_color="black" + top="70" + width="280" + word_wrap="true" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerifHugeBold" + height="35" + layout="topleft" + left="10" + name="pick_title" + text_color="white" + top="410" + width="250" + word_wrap="true"> + Private Settings + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + font.style="ITALIC" + height="15" + layout="topleft" + left="10" + name="status_message" + text_color="0.1 0.1 0.1 1" + top="435" + width="300"> + This user can: + </text> + <check_box + enabled="false" + follows="left|top" + font="SansSerifBig" + height="20" + label="See my online status" + layout="topleft" + left="10" + name="status_check" + text_disabled_color="0.1 0.1 0.1 1" + text_enabled_color="white" + top="455" + width="300" /> + <check_box + enabled="false" + follows="left|top" + font="SansSerifBig" + height="20" + label="See me on the map" + layout="topleft" + left="10" + name="map_check" + text_disabled_color="0.1 0.1 0.1 1" + text_enabled_color="white" + top="480" + width="300" /> + <check_box + enabled="false" + follows="left|top" + font="SansSerifBig" + height="20" + label="Edit, delite or take my objects" + layout="topleft" + left="10" + name="objects_check" + text_disabled_color="0.1 0.1 0.1 1" + text_enabled_color="white" + top="505" + width="300" /> + <panel + layout="topleft" + follows="bottom" + height="30" + left="0" + name="notes_buttons_panel" + bottom="690" + width="350"> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Add Friend" + layout="topleft" + left="5" + mouse_opaque="false" + name="add_friend" + top="0" + width="75" /> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="IM" + layout="topleft" + left_pad="5" + name="im" + top_delta="0" + width="40" /> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Call" + layout="topleft" + left_pad="5" + name="call" + top_delta="0" + width="50" + enabled="false"/> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Teleport" + layout="topleft" + left_pad="5" + name="teleport" + top_delta="0" + width="65" /> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Share" + layout="topleft" + left_pad="15" + name="share" + top_delta="0" + width="50" + enabled="false"/> + </panel> +</panel> + </scroll_container> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_notifications_channel.xml b/indra/newview/skins/default/xui/en/panel_notifications_channel.xml new file mode 100644 index 0000000000000000000000000000000000000000..c67ae4167732f54afb73d669672bffe75593feac --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_notifications_channel.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + height="100" + layout="topleft" + name="notifications_panel" + width="100"> + <layout_stack + follows="left|right|top|bottom" + height="78" + layout="topleft" + left="0" + name="stack1" + orientation="horizontal" + top="20" + width="100"> + <scroll_list + draw_heading="true" + follows="left|right|top|bottom" + height="78" + layout="topleft" + left="0" + name="notifications_list" + sort_ascending="false" + sort_column="2" + top="-78" + user_resize="true" + width="100"> + <scroll_list.columns + label="Name" + name="name" + width="100" /> + <scroll_list.columns + label="Content" + name="content" + width="150" /> + <scroll_list.columns + label="Date" + name="date" + width="150" /> + </scroll_list> + <scroll_list + draw_heading="true" + follows="left|right|top|bottom" + height="78" + layout="topleft" + left="0" + name="notification_rejects_list" + sort_ascending="false" + sort_column="2" + top="-78" + user_resize="true" + width="100"> + <scroll_list.columns + label="Name" + name="name" + width="100" /> + <scroll_list.columns + label="Content" + name="content" + width="150" /> + <scroll_list.columns + label="Date" + name="date" + width="150" /> + </scroll_list> + </layout_stack> + <button + follows="left|right|top" + height="20" + is_toggle="true" + layout="topleft" + left_delta="0" + name="header" + picture_style="true" + top_delta="-20" + width="100" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml new file mode 100644 index 0000000000000000000000000000000000000000..f53e06494f6393009bb1eaaaab9bd08010b348d9 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -0,0 +1,443 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + layout="topleft" + top="0" left="0" width="355" height="465" + follows="left|top|right|bottom" + background_visible="true" bg_alpha_color="0.3 0.3 0.3 1" + label="People" name="people_panel" +> + <search_editor + layout="topleft" + top="3" left="10" width="335" height="16" + follows="left|top|right" + max_length="300" + label="Filter" name="filter_input" + font="SansSerif" text_color="black" + /> + <tab_container + layout="topleft" + top="30" left="10" width="335" height="400" + follows="left|top|right|bottom" + name="tabs" + tab_position="top" + bg_alpha_color="0.7 0.7 0.1 1" + > + <panel + layout="topleft" + height="390" width="332" + follows="left|top|right|bottom" + background_visible="true" bevel_style="bright" bg_alpha_color="0.7 0.7 0.7 1" + label="Nearby" name="nearby_panel" + > + <avatar_list + layout="topleft" + top="2" left="0" width="332" height="357" + follows="left|top|right|bottom" + name="avatar_list" + /> + <panel + layout="topleft" + bottom="390" left="0" width="333" height="30" + follows="left|right|bottom" + background_visible="true" bevel_style="bright" bg_alpha_color="black" + label="bottom_panel" name="bottom_panel" + > + <button + name="gear_btn" + enabled="false" + layout="topleft" + top="9" left="305" width="16" height="16" + follows="bottom|right" + font="SansSerifBigBold" + image_hover_selected="gear.tga" + image_selected="gear.tga" + image_unselected="gear.tga" + picture_style="true" + /> + </panel> + </panel> + <panel + layout="topleft" + height="390" width="332" + follows="left|top|right|bottom" + background_visible="true" bevel_style="bright" bg_alpha_color="0.7 0.7 0.7 1" + label="Friends" name="friends_panel" + > + <avatar_list + layout="topleft" + top="2" left="0" width="332" height="357" + follows="left|top|right|bottom" + name="avatar_list" + /> + <panel + layout="topleft" + bottom="390" left="0" width="333" height="30" + follows="left|right|bottom" + background_visible="true" bevel_style="in" bg_alpha_color="black" + label="bottom_panel" name="bottom_panel" + > + <button + name="add_btn" + layout="topleft" + top="9" left="10" width="16" height="16" + follows="bottom|left" + font="SansSerifBigBold" + image_hover_selected="add_btn.tga" + image_selected="add_btn.tga" + image_unselected="add_btn.tga" picture_style="true" + /> + <button + name="del_btn" + layout="topleft" + top_delta="0" left_pad="24" width="16" height="16" + follows="bottom|left" + font="SansSerifBigBold" + image_hover_selected="del_btn.tga" + image_selected="del_btn.tga" + image_unselected="del_btn.tga" + picture_style="true" + /> + <button + name="gear_btn" + enabled="false" + layout="topleft" + top_delta="0" left_pad="239" width="16" height="16" + follows="bottom|right" + font="SansSerifBigBold" + image_hover_selected="gear.tga" + image_selected="gear.tga" + image_unselected="gear.tga" + picture_style="true" + /> + </panel> + </panel> + <panel + layout="topleft" + height="390" width="332" + follows="left|top|right|bottom" + background_visible="true" bevel_style="bright" bg_alpha_color="0.7 0.7 0.7 1" + label="Groups" name="groups_panel" + > + <group_list + layout="topleft" + top="2" left="0" width="332" height="357" + follows="left|top|right|bottom" + name="group_list" + /> + <panel + layout="topleft" + bottom="390" left="0" width="333" height="30" + follows="left|right|bottom" + background_visible="true" bevel_style="in" bg_alpha_color="black" + label="bottom_panel" name="bottom_panel" + > + <button + name="plus_btn" + layout="topleft" + top="9" left="10" width="16" height="16" + follows="bottom|left" + font="SansSerifBigBold" + image_hover_selected="add_btn.tga" + image_selected="add_btn.tga" + image_unselected="add_btn.tga" + picture_style="true" + /> + <button + name="minus_btn" + layout="topleft" + top_delta="0" left_pad="24" width="16" height="16" + follows="bottom|left" + font="SansSerifBigBold" + image_hover_selected="del_btn.tga" + image_selected="del_btn.tga" + image_unselected="del_btn.tga" + picture_style="true" + /> + <button + name="activate_btn" + layout="topleft" + top_delta="0" left_pad="24" width="16" height="16" + follows="bottom|left" + font="SansSerifBigBold" + image_hover_selected="activate_btn.tga" + image_selected="activate_btn.tga" + image_unselected="activate_btn.tga" + picture_style="true" + /> + <button + name="gear_btn" + enabled="false" + layout="topleft" + top_delta="0" left="305" width="16" height="16" + follows="bottom|right" + font="SansSerifBigBold" + image_hover_selected="gear.tga" + image_selected="gear.tga" + image_unselected="gear.tga" + picture_style="true" + /> + </panel> + </panel> + <panel + layout="topleft" + height="390" width="332" + follows="left|top|right|bottom" + background_visible="true" bevel_style="bright" bg_alpha_color="0.7 0.7 0.7 1" + label="Recent" name="recent_panel" + > + <avatar_list + layout="topleft" + top="2" left="0" width="332" height="357" + follows="left|top|right|bottom" + name="avatar_list" + /> + <panel + layout="topleft" + bottom="390" left="0" width="333" height="30" + follows="left|right|bottom" + background_visible="true" bevel_style="in" bg_alpha_color="black" + label="bottom_panel" name="bottom_panel" + > + <button + name="gear_btn" + enabled="false" + layout="topleft" + top="9" left="305" width="16" height="16" + follows="bottom|right" + font="SansSerifBigBold" + image_hover_selected="gear.tga" + image_selected="gear.tga" + image_unselected="gear.tga" + picture_style="true" + /> + </panel> + </panel> + </tab_container> + + <layout_stack + name="button_bar" + follows="left|right|bottom" + bottom="6" + left="6" + width="335" + height="27" + orientation="horizontal" + animate="false" + border_size="0"> + <layout_panel + name="view_profile_btn_panel" + border="false" + bottom="0" + default_tab_group="1" + follows="left|top|right" + height="25" + left="0" + min_width="85" + width="85" + visible="true" + > + <button + label="View Profile" + name="view_profile_btn" + layout="topleft" + width="85" height="25" + follows="top|left|right" + font="SansSerifSmallBold" + /> + </layout_panel> + <layout_panel + name="add_friend_btn_panel" + border="false" + bottom="0" + default_tab_group="1" + follows="left|top|right" + height="25" + left="0" + min_width="85" + width="85" + visible="true" + > + <button + label="Add Friend" + name="add_friend_btn" + layout="topleft" + width="85" height="25" + follows="top|left|right" + font="SansSerifSmallBold" + /> + </layout_panel> + <layout_panel + name="group_info_btn_panel" + border="false" + bottom="0" + default_tab_group="1" + follows="left|top|right" + height="25" + left="0" + min_width="80" + width="80" + visible="true" + > + <button + label="Group Info" + name="group_info_btn" + layout="topleft" + width="80" height="25" + follows="top|left|right" + font="SansSerifSmallBold" + /> + </layout_panel> + <layout_panel name="chat_btn_panel" + border="false" + bottom="0" + default_tab_group="1" + follows="left|top|right" + height="25" + left="0" + min_width="45" + width="45" + visible="true" + > + <button + label="Chat" + name="chat_btn" + layout="topleft" + width="45" height="25" + follows="top|left|right" + font="SansSerifSmallBold" + /> + </layout_panel> + <layout_panel + name="im_btn_panel" + border="false" + bottom="0" + default_tab_group="1" + follows="left|top|right" + height="25" + left="0" + min_width="35" + width="35" + visible="true" + > + <button + label="IM" + name="im_btn" + layout="topleft" + width="35" height="25" + follows="top|left|right" + font="SansSerifSmallBold" + /> + </layout_panel> + <layout_panel + name="call_btn_panel" + border="false" + bottom="0" + default_tab_group="1" + follows="left|top|right" + height="25" + left="0" + min_width="40" + width="40" + visible="false" + > + <button + label="Call" + name="call_btn" + enabled="false" + layout="topleft" + width="40" height="25" + follows="top|left|right" + font="SansSerifSmallBold" + /> + </layout_panel> + <layout_panel + name="teleport_btn_panel" + border="false" + bottom="0" + default_tab_group="1" + follows="left|top|right" + height="25" + left="0" + min_width="65" + width="65" + > + <button + label="Teleport" + name="teleport_btn" + width="65" + height="25" + layout="topleft" + follows="left|top|right" + font="SansSerifSmallBold" + /> + </layout_panel> + <layout_panel + name="share_btn_panel" + enabled="false" + border="false" + bottom="0" + default_tab_group="1" + follows="left|top|right" + height="25" + left="0" + min_width="50" + width="50" + visible="false" + > + <button + label="Share" + name="share_btn" + enabled="false" + layout="topleft" + width="50" + height="25" + follows="top|left|right" + font="SansSerifSmallBold" + /> + </layout_panel> + <layout_panel + name="more_btn_panel" + border="false" + bottom="0" + default_tab_group="1" + follows="left|top|right" + height="25" + left="0" + min_width="40" + width="40" + visible="true" + > + <button + label=">>" + name="more_btn" + enabled="false" + layout="topleft" + width="40" + height="25" + follows="top|right" + font="SansSerifSmallBold" + /> + </layout_panel> + </layout_stack> + <string name="no_people"> + No people + </string> + <string name="no_one_near"> + No-one near + </string> + <string name="no_friends"> + No friends + </string> + <panel + layout="topleft" + name="panel_profile_view" + class="panel_profile_view" + filename="panel_profile_view.xml" + top="0" + left="5" + width="345" + height="465" + follows="left|right|top|bottom" + visible="false" + /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_pick_info.xml b/indra/newview/skins/default/xui/en/panel_pick_info.xml new file mode 100644 index 0000000000000000000000000000000000000000..fa04ba7f150639f97e60d81c90894094f0130023 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_pick_info.xml @@ -0,0 +1,184 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + bevel_style="in" + bg_alpha_color="0.2 0.2 0.2 1" + height="640" + layout="topleft" + left="0" + name="panel_pick_info" + top="0" + width="355"> + <button + follows="top|left" + height="20" + image_overlay="navbar_back.tga" + image_selected="navbar_bg_button.tga" + image_unselected="navbar_bg_button.tga" + layout="topleft" + left="10" + name="back_btn" + picture_style="true" + top="5" + width="20" /> + <text + type="string" + length="1" + follows="top" + font="SansSerifHugeBold" + height="15" + layout="topleft" + left="40" + name="title" + text_color="white" + top="0" + width="150"> + Pick Info + </text> + <panel + background_visible="true" + bg_alpha_color="0.5 0.5 0.5 1" + follows="left|right|top|bottom" + height="570" + layout="topleft" + left="10" + right="-10" + top="30"> + <texture_picker + enabled="false" + follows="left|top|right" + height="150" + layout="topleft" + left="10" + name="pick_snapshot" + right="-10" + top="10" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="Name:"> + Name: + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="20" + layout="topleft" + left="10" + name="pick_name" + right="-10" + text_color="white" + word_wrap="true"> + [name] + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + name="description_label" + v_pad="15" + valign="center"> + Description: + </text> + <text + type="string" + length="1" + follows="left|top|right" + height="40" + layout="topleft" + left="10" + name="pick_desc" + right="-10" + text_color="white" + v_pad="15" + valign="center" + word_wrap="true"> + [description] + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + name="description_label" + v_pad="15" + valign="bottom"> + Location: + </text> + <text + type="string" + length="1" + follows="left|top" + height="30" + layout="topleft" + left="10" + name="pick_location" + text_color="white" + v_pad="15" + valign="center"> + [loading...] + </text> + </panel> + <panel + follows="left|right|bottom" + height="30" + layout="topleft" + left="10" + name="buttons" + right="-10" + top_pad="2"> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Edit" + layout="topleft" + left="10" + name="edit_btn" + top="3" + width="50" /> + <button + enabled="false" + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Teleport" + layout="topleft" + left="65" + name="teleport_btn" + top="3" + width="70" /> + <button + enabled="false" + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Show on Map" + layout="topleft" + left="140" + name="show_on_map_btn" + top="3" + width="90" /> + <button + enabled="false" + follows="bottom|right" + font="SansSerifSmallBold" + height="25" + label="Verb" + layout="topleft" + left="270" + name="verb_btn" + top="3" + width="50" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml new file mode 100644 index 0000000000000000000000000000000000000000..95055f43dc4aaff57b76d6da931f7568b95b2970 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_picks.xml @@ -0,0 +1,173 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + bevel_style="in" + bg_alpha_color="0.5 0.5 0.5 1" + height="690" + label="Picks" + layout="topleft" + left="0" + name="panel_picks" + top="0" + width="355"> + <text + type="string" + length="1" + follows="top|left|right" + font="SansSerifHugeBold" + height="55" + layout="topleft" + left="10" + name="pick_title" + text_color="white" + top="10" + width="330" + word_wrap="true"> + [NAME]'s favorite places in Second Life... + </text> + <!-- below is a special title shown for the Agent on the "Picks" tab--> + <text + type="string" + length="1" + follows="top" + font="SansSerifHugeBold" + height="55" + layout="topleft" + left="10" + name="pick_title_agent" + text_color="white" + top="10" + visible="false" + width="330" + word_wrap="true"> + Tell everyone about your favorite Second Life places... + </text> + <scroll_container + follows="left|top|right|bottom" + height="550" + layout="topleft" + left="5" + reserve_scroll_corner="true" + width="345"> + <panel + background_visible="true" + bevel_style="in" + bg_alpha_color="0.6 0.6 0.6 1" + follows="left|top|right|bottom" + height="600" + layout="topleft" + left="0" + name="back_panel" + top="0" + width="325" /> + </scroll_container> + <panel + background_visible="true" + bevel_style="in" + bg_alpha_color="black" + enabled="false" + follows="left|right|bottom" + height="25" + label="bottom_panel" + layout="topleft" + left="5" + name="edit_panel" + visible="false" + width="345"> + <button + enabled="false" + follows="bottom|left" + font="SansSerifBigBold" + height="16" + image_hover_selected="gear.tga" + image_selected="gear.tga" + image_unselected="gear.tga" + layout="topleft" + left="5" + name="gear_menu_btn" + picture_style="true" + top="5" + width="16" /> + <button + follows="bottom|left" + font="SansSerifBigBold" + height="16" + image_disabled="add_btn.tga" + image_disabled_selected="add_btn.tga" + image_hover_selected="add_btn.tga" + image_selected="add_btn.tga" + image_unselected="add_btn.tga" + layout="topleft" + left="35" + name="new_btn" + picture_style="true" + tool_tip="Create New Pick at Current Location" + top="5" + width="16" /> + <button + follows="bottom|right" + font="SansSerifBigBold" + height="16" + image_disabled="del_btn.tga" + image_disabled_selected="del_btn.tga" + image_hover_selected="del_btn.tga" + image_selected="del_btn.tga" + image_unselected="del_btn.tga" + layout="topleft" + name="trash_btn" + picture_style="true" + right="-10" + top="5" + width="16" /> + </panel> + <panel + follows="left|right" + height="25" + layout="topleft" + left="0" + name="buttons_cucks" + top_pad="10" + width="345"> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Info" + layout="topleft" + left="10" + name="info_btn" + top="0" + width="50" /> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Teleport" + layout="topleft" + left="65" + name="teleport_btn" + top="0" + width="70" /> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Show on Map" + layout="topleft" + left="140" + name="show_on_map_btn" + top="0" + width="90" /> + <button + enabled="false" + follows="bottom|right" + font="SansSerifSmallBold" + height="25" + label="Verb" + layout="topleft" + left="270" + name="verb_btn" + top="0" + width="50" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml new file mode 100644 index 0000000000000000000000000000000000000000..66bb38b45e82098085b283700ed4228ecabd5e79 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + bg_alpha_color="0.3 0.3 0.3 1" + follows="left|top|right|bottom" + height="400" + label="Places" + layout="topleft" + left="0" + min_height="350" + min_width="240" + name="places panel" + top="400" + width="355"> + <search_editor + follows="left|top|right" + height="16" + label="Filter" + layout="topleft" + left="10" + name="Filter" + top="4" + width="335" /> + <tab_container + follows="left|top|right|bottom" + height="326" + layout="topleft" + left_delta="0" + name="Places Tabs" + tab_position="top" + top_pad="19" + width="335" /> + <panel + class="panel_landmark_info" + filename="panel_landmark_info.xml" + follows="left|top|right|bottom" + height="675" + layout="topleft" + left="0" + name="panel_landmark_info" + top="-310" + visible="false" + width="355" /> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="TELEPORT" + layout="topleft" + left_delta="10" + name="teleport_btn" + top_pad="5" + width="90" /> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="SHOW ON MAP" + layout="topleft" + left_pad="5" + name="map_btn" + top_delta="0" + width="110" /> + <button + enabled="false" + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="SHARE" + layout="topleft" + left_pad="5" + name="share_btn" + top_delta="0" + width="60" /> + <button + enabled="false" + follows="bottom|right" + font="SansSerifSmallBold" + height="25" + label="â–¼" + layout="topleft" + left_pad="35" + name="overflow_btn" + top_delta="0" + width="30" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml new file mode 100644 index 0000000000000000000000000000000000000000..bda437ab29d154681275a4ad07424c4d43ab2713 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -0,0 +1,370 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="left|top|right|bottom" + height="408" + label="Text Chat" + layout="topleft" + left="102" + name="chat" + top="1" + width="517"> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="12" + mouse_opaque="false" + top="10" + width="128"> + Chat Font Size: + </text> + <radio_group + height="30" + layout="topleft" + left_pad="8" + control_name="ChatFontSize" + name="chat_font_size" + top_delta="0" + width="331"> + <radio_item + height="16" + label="Small" + layout="topleft" + left="0" + name="radio" + top="8" + width="98" /> + <radio_item + height="16" + label="Medium" + layout="topleft" + left_pad="12" + name="radio2" + top_delta="0" + width="98" /> + <radio_item + height="16" + label="Large" + layout="topleft" + left_pad="12" + name="radio3" + top_delta="0" + width="98" /> + </radio_group> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="12" + mouse_opaque="false" + name="text_box2" + top="54" + width="128"> + Chat Color: + </text> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + control_name="UserChatColor" + follows="left|top" + height="47" + label="You" + layout="topleft" + left_pad="8" + name="user" + top_delta="-1" + width="44" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + control_name="AgentChatColor" + follows="left|top" + height="47" + label="Others" + layout="topleft" + left_pad="10" + name="agent" + top_delta="0" + width="44" /> + <color_swatch + 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="IM" + label_width="60" + layout="topleft" + left_pad="10" + name="im" + top_delta="0" + width="44" /> + <color_swatch + 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="System" + label_width="44" + layout="topleft" + left_pad="10" + name="system" + top_delta="0" + width="44" /> + <color_swatch + 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" + label="Errors" + layout="topleft" + left_pad="10" + name="script_error" + top_delta="0" + width="44" /> + <color_swatch + 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" + label="Objects" + layout="topleft" + left="148" + name="objects" + top="103" + width="44" /> + <color_swatch + 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" + label="Owner" + layout="topleft" + left_pad="10" + name="owner" + top_delta="0" + width="44" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + can_apply_immediately="true" + color="0 0 0 1" + control_name="BackgroundChatColor" + follows="left|top" + height="47" + label="Bubble" + layout="topleft" + left_pad="10" + name="background" + top_delta="0" + width="44" /> + <color_swatch + 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" + label="URLs" + layout="topleft" + left_pad="10" + name="links" + top_delta="0" + width="44" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="12" + mouse_opaque="false" + name="text_box3" + top="168" + width="135"> + Chat Console: + </text> + <spinner + control_name="ChatPersistTime" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="10" + label="Fade chat after" + label_width="80" + layout="topleft" + left_pad="1" + max_val="60" + min_val="2" + name="fade_chat_time" + top_delta="2" + width="130" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_pad="4" + mouse_opaque="false" + name="text_box4" + top_delta="0" + width="80"> + (seconds) + </text> + <spinner + control_name="ConsoleMaxLines" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="10" + layout="topleft" + left_delta="58" + max_val="50" + min_val="1" + name="max_chat_count" + top_delta="0" + width="60" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_pad="5" + mouse_opaque="false" + name="text_box5" + top_delta="0" + width="60"> + (# lines) + </text> + <slider + control_name="ConsoleBackgroundOpacity" + follows="left|top" + height="12" + increment="0.05" + initial_value="1" + label="Opacity" + layout="topleft" + left="148" + name="console_opacity" + top="193" + width="200" /> + <check_box + control_name="ChatFullWidth" + height="16" + label="Use full screen width (Requires restart)" + layout="topleft" + left_delta="0" + name="chat_full_width_check" + top_pad="9" + width="239" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="12" + mouse_opaque="false" + name="text_box6" + top="245" + width="135"> + Chat Options: + </text> + <check_box + control_name="CloseChatOnReturn" + height="16" + label="Close chat bar after hitting return" + layout="topleft" + left_pad="1" + name="close_chat_on_return_check" + top_delta="2" + width="237" /> + <check_box + control_name="ArrowKeysMoveAvatar" + height="16" + label="Arrow keys always move avatar when chatting" + layout="topleft" + left_delta="0" + name="arrow_keys_move_avatar_check" + top_pad="4" + width="237" /> + <check_box + control_name="ChatShowTimestamps" + height="16" + label="Show timestamps in Local Chat" + layout="topleft" + left_delta="0" + name="show_timestamps_check" + top_pad="4" + width="237" /> + <check_box + control_name="ScriptErrorsAsChat" + height="16" + label="Show script errors and warnings as regular chat" + layout="topleft" + left_delta="0" + name="script_errors_as_chat" + top_pad="4" + width="275" /> + <check_box + control_name="PlayTypingAnim" + height="16" + initial_value="true" + label="Play typing animation when chatting" + layout="topleft" + left_delta="0" + name="play_typing_animation" + top_pad="4" + width="237" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="12" + mouse_opaque="false" + name="text_box7" + top="359" + width="128"> + Bubble Chat: + </text> + <check_box + control_name="UseChatBubbles" + height="16" + label="Show chat bubbles" + layout="topleft" + left_pad="8" + name="bubble_text_chat" + top_delta="1" + width="237" /> + <slider + control_name="ChatBubbleOpacity" + follows="left|top" + height="12" + increment="0.05" + initial_value="1" + label="Opacity" + layout="topleft" + left_delta="0" + name="bubble_chat_opacity" + top_pad="4" + width="200" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml new file mode 100644 index 0000000000000000000000000000000000000000..b30bda3e5979abc4f1765220aa5e683cad337d7f --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -0,0 +1,427 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="left|top|right|bottom" + height="408" + label="General" + layout="topleft" + left="102" + name="general_panel" + top="1" + width="517"> + <combo_box + control_name="LoginLocation" + follows="left|bottom" + height="18" + layout="topleft" + left_delta="151" + name="start_location_combo" + top="7" + width="155"> + <combo_box.item + label="My Last Location" + value="last" /> + <combo_box.item + label="My Home" + value="home" /> + </combo_box> + <check_box + control_name="ShowStartLocation" + height="16" + initial_value="true" + label="Show Start Location on Login Screen" + layout="topleft" + left_delta="0" + name="show_location_checkbox" + top_pad="3" + width="256" /> + <combo_box + control_name="RenderName" + height="18" + layout="topleft" + left_delta="4" + name="fade_out_combobox" + top_pad="7" + width="146"> + <combo_box.item + label="Never" + value="0" /> + <combo_box.item + label="Show Temporarily" + value="1" /> + <combo_box.item + label="Always" + value="2" /> + </combo_box> + <check_box + control_name="SmallAvatarNames" + height="16" + initial_value="true" + label="Small Avatar Names" + layout="topleft" + left_delta="-4" + name="small_avatar_names_checkbox" + top_pad="9" + width="200" /> + <check_box + control_name="RenderNameHideSelf" + height="16" + label="Hide My Name On My Screen" + layout="topleft" + left_delta="0" + name="show_my_name_checkbox" + top_pad="2" + width="200" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="group_titles_textbox" + top="120" + width="394"> + Group Titles: + </text> + <check_box + control_name="RenderHideGroupTitleAll" + height="16" + label="Hide All Group Titles" + layout="topleft" + left_delta="141" + name="show_all_title_checkbox" + top_delta="0" + width="256" /> + <check_box + control_name="RenderHideGroupTitle" + height="16" + label="Hide My Group Title" + layout="topleft" + left_delta="0" + name="show_my_title_checkbox" + top_pad="2" + width="256" /> + <color_swatch + border_color="0.45098 0.517647 0.607843 1" + control_name="EffectColor" + follows="left|top" + height="48" + layout="topleft" + left_delta="2" + name="effect_color_swatch" + tool_tip="Click to open Color Picker" + top_pad="8" + width="32" /> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="10" + name="UI Size:" + top="203" + width="128"> + UI Size: + </text> + <spinner + control_name="UIScaleFactor" + height="16" + increment="0.025" + initial_value="1" + layout="topleft" + left_pad="16" + max_val="1.4" + min_val="0.75" + name="ui_scale_slider" + top_delta="-2" + width="58" /> + <check_box + control_name="UIAutoScale" + height="16" + label="Use resolution independent scale" + layout="topleft" + left_delta="-3" + name="ui_auto_scale" + top_pad="3" + width="256" /> + <spinner + control_name="AFKTimeout" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="300" + label="Away Timeout:" + label_width="141" + layout="topleft" + left="10" + max_val="600" + min_val="30" + name="afk_timeout_spinner" + top="244" + width="202" /> + <check_box + control_name="NotifyMoneyChange" + height="16" + label="Notify when Linden dollars (L$) spent or received" + layout="topleft" + left="151" + name="notify_money_change_checkbox" + top="270" + width="256" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="maturity_desired_label" + top="312" + width="394"> + Rating: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="141" + name="maturity_desired_prompt" + top_delta="0" + width="394"> + I want to access content rated: + </text> + <combo_box + control_name="PreferredMaturity" + height="18" + layout="topleft" + left_delta="164" + name="maturity_desired_combobox" + top_delta="-2" + width="150"> + <combo_box.item + label="PG, Mature and Adult" + value="42" /> + <combo_box.item + label="PG and Mature" + value="21" /> + <combo_box.item + label="PG only" + value="13" /> + </combo_box> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="maturity_desired_textbox" + top_delta="2" + width="150"> + PG only + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="10" + name="start_location_textbox" + top="10" + width="394"> + Start Location: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="show_names_textbox" + top_pad="34" + width="394"> + Show Names: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left_delta="0" + name="effects_color_textbox" + top_pad="110" + width="394"> + Color For My Effects: + </text> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="220" + name="seconds_textbox" + top="244" + width="128"> + seconds + </text> + <text + type="string" + length="1" + follows="left|top" + height="18" + layout="topleft" + left="10" + name="crash_report_textbox" + top="344" + width="394"> + Crash reports: + </text> + <text + type="string" + length="1" + follows="left|top" + height="18" + layout="topleft" + left_delta="0" + name="language_textbox" + top_pad="4" + width="394"> + Language: + </text> + <text + type="string" + length="1" + follows="left|top" + height="18" + layout="topleft" + left_delta="293" + name="language_textbox2" + top_delta="1" + width="400"> + (Requires restart for full effect) + </text> + <combo_box + control_name="CrashSubmitBehavior" + height="18" + layout="topleft" + left="153" + name="crash_behavior_combobox" + top="344" + width="146"> + <combo_box.item + enabled="true" + label="Ask before sending" + value="Ask before sending" /> + <combo_box.item + enabled="true" + label="Always send" + value="Always send" /> + <combo_box.item + enabled="true" + label="Never send" + value="Never send" /> + </combo_box> + <combo_box + allow_text_entry="true" + control_name="Language" + follows="left|bottom" + height="16" + layout="topleft" + left_delta="0" + max_chars="135" + name="language_combobox" + top_pad="4" + width="146"> + <combo_box.item + enabled="true" + label="System Default" + value="default" /> + <combo_box.item + enabled="true" + label="English" + value="en" /> + <combo_box.item + enabled="true" + label="Dansk (Danish) - Beta" + value="da" /> + <combo_box.item + enabled="true" + label="Deutsch (German) - Beta" + value="de" /> + <combo_box.item + enabled="true" + label="Español (Spanish) - Beta" + value="es" /> + <combo_box.item + enabled="true" + label="Français (French) - Beta" + value="fr" /> + <combo_box.item + enabled="true" + label="Italiano (Italian) - Beta" + value="it" /> + <combo_box.item + enabled="true" + label="Magyar (Hungarian) - Beta" + value="hu" /> + <combo_box.item + enabled="true" + label="Nederlands (Dutch) - Beta" + value="nl" /> + <combo_box.item + enabled="true" + label="Polski (Polish) - Beta" + value="pl" /> + <combo_box.item + enabled="true" + label="Portugués (Portuguese) - Beta" + value="pt" /> + <combo_box.item + enabled="true" + label="РуÑÑкий (Russian) - Beta" + value="ru" /> + <combo_box.item + enabled="true" + label="Türkçe (Turkish) - Beta" + value="tr" /> + <combo_box.item + enabled="true" + label="УкраїнÑька (Ukrainian) - Beta" + value="uk" /> + <combo_box.item + enabled="true" + label="ä¸æ–‡ (简体) (Chinese) - Beta" + value="zh" /> + <combo_box.item + enabled="true" + label="日本語 (Japanese) - Beta" + value="ja" /> + <combo_box.item + enabled="true" + label="í•œêµì–´ (Korean) - Beta" + value="ko" /> + <combo_box.item + enabled="true" + label="Test Language" + value="test" /> + </combo_box> + <check_box + control_name="LanguageIsPublic" + height="16" + label="Share language with objects" + layout="topleft" + left_delta="-2" + name="language_is_public" + tool_tip="This lets in-world objects know your preferred language." + top_pad="2" + width="256" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml new file mode 100644 index 0000000000000000000000000000000000000000..929f857e9015cf0d86c732e9891a0b8be2851d03 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -0,0 +1,915 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="left|top|right|bottom" + height="408" + label="Graphics" + layout="topleft" + left="102" + name="Display panel" + top="1" + width="517"> + <panel.string + name="resolution_format"> + [RES_X] x [RES_Y] + </panel.string> + <panel.string + name="aspect_ratio_text"> + [NUM]:[DEN] + </panel.string> + <button + follows="left|top" + height="18" + label="?" + layout="topleft" + left="470" + name="GraphicsPreferencesHelpButton" + top="4" + width="22"> + <button.commit_callback + function="Pref.OpenHelp" /> + </button> + <check_box + control_name="NotFullScreen" + height="16" + label="Run Second Life in a window" + layout="topleft" + left_delta="-460" + name="windowed mode" + top_delta="3" + width="100"> + <check_box.commit_callback + function="Pref.OpenHelp" /> + </check_box> + <text_editor + make_visible_control="NotFullScreen" + type="string" + length="1" + bg_readonly_color="0 0 0 0" + enabled="false" + follows="left|top" + height="20" + hide_border="true" + hide_scrollbar="true" + layout="topleft" + left_delta="0" + max_length="65535" + name="FullScreenInfo" + tab_stop="false" + top_delta="16" + width="350" + word_wrap="true"> + If unchecked, viewer will display full-screen when logged in. + </text_editor> + <text + make_visible_control="NotFullScreen" + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="WindowSizeLabel" + top_pad="7" + width="128"> + Window Size: + </text> + <combo_box + make_visible_control="NotFullScreen" + height="18" + layout="topleft" + left_pad="47" + name="windowsize combo" + top_delta="-1" + width="150"> + <combo_box.item + enabled="true" + label="640x480" + value="640 x 480" /> + <combo_box.item + enabled="true" + label="800x600 " + value="800 x 600" /> + <combo_box.item + enabled="true" + label="720x480 (NTSC)" + value="720 x 480" /> + <combo_box.item + enabled="true" + label="768x576 (PAL)" + value="768 x 576" /> + <combo_box.item + enabled="true" + label="1024x768" + value="1024 x 768" /> + </combo_box> + <text + make_invisible_control="NotFullScreen" + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="-175" + name="DisplayResLabel" + top_delta="1" + width="128"> + Display Resolution: + </text> + <combo_box + make_invisible_control="NotFullScreen" + height="18" + layout="topleft" + left_pad="47" + name="fullscreen combo" + top_delta="-1" + width="150" /> + <text + make_invisible_control="NotFullScreen" + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="10" + name="AspectRatioLabel1" + tool_tip="width / height" + top="27" + width="160"> + Aspect Ratio: + </text> + <combo_box + make_invisible_control="NotFullScreen" + allow_text_entry="true" + height="16" + layout="topleft" + left_pad="15" + max_chars="100" + name="aspect_ratio" + tool_tip="width / height" + top_delta="0" + width="150"> + <combo_box.item + enabled="true" + label="4:3 (Standard CRT)" + value="1.333333" /> + <combo_box.item + enabled="true" + label="5:4 (1280x1024 LCD)" + value="1.25" /> + <combo_box.item + enabled="true" + label="8:5 (Widescreen)" + value="1.6" /> + <combo_box.item + enabled="true" + label="16:9 (Widescreen)" + value="1.7777777" /> + </combo_box> + <check_box + make_invisible_control="NotFullScreen" + control_name="FullScreenAutoDetectAspectRatio" + height="16" + label="Auto-detect ratio" + layout="topleft" + left_pad="23" + name="aspect_auto_detect" + top_delta="1" + width="256"> + <check_box.commit_callback + function="Pref.AutoDetectAspect" /> + </check_box> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="10" + name="HigherText" + top="73" + width="80"> + Quality and + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="QualityText" + top_pad="2" + width="95"> + Performance: + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="115" + name="FasterText" + top="74" + width="80"> + Faster + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="158" + name="ShadersPrefText" + top="93" + width="40"> + Low + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_pad="7" + name="ShadersPrefText2" + top_delta="0" + width="40"> + Mid + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_pad="7" + name="ShadersPrefText3" + top_delta="0" + width="40"> + High + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_pad="7" + name="ShadersPrefText4" + top_delta="0" + width="40"> + Ultra + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="334" + name="HigherText2" + top="68" + width="80"> + Higher + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="QualityText2" + top_pad="2" + width="95"> + Quality + </text> + <icon + color="0.12 0.12 0.12 1" + height="14" + image_name="rounded_square.tga" + layout="topleft" + left="173" + name="LowGraphicsDivet" + top="75" + width="2" /> + <icon + color="0.12 0.12 0.12 1" + height="14" + image_name="rounded_square.tga" + layout="topleft" + left_pad="42" + name="MidGraphicsDivet" + top_delta="0" + width="2" /> + <icon + color="0.12 0.12 0.12 1" + height="14" + image_name="rounded_square.tga" + layout="topleft" + left_pad="42" + name="HighGraphicsDivet" + top_delta="0" + width="2" /> + <icon + color="0.12 0.12 0.12 1" + height="14" + image_name="rounded_square.tga" + layout="topleft" + left_pad="42" + name="UltraGraphicsDivet" + top_delta="0" + width="2" /> + <slider + control_name="RenderQualityPerformance" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="0" + layout="topleft" + left_delta="-140" + max_val="3" + name="QualityPerformanceSelection" + show_text="false" + top_delta="-1" + width="150" /> + <check_box + control_name="RenderCustomSettings" + height="16" + initial_value="true" + label="Custom" + layout="topleft" + left_pad="70" + name="CustomSettings" + top_delta="1" + width="256"> + <check_box.commit_callback + function="Pref.ChangeCustom" /> + </check_box> + <panel + make_visible_control="RenderCustomSettings" + border="true" + follows="top|left" + height="260" + label="CustomGraphics" + layout="topleft" + left="5" + name="CustomGraphics Panel" + top="115" + width="485"> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="5" + name="ShadersText" + top="3" + width="128"> + Shaders: + </text> + <check_box + control_name="RenderObjectBump" + height="16" + initial_value="true" + label="Bump Mapping and Shiny" + layout="topleft" + left_delta="0" + name="BumpShiny" + top_pad="7" + width="256" /> + <check_box + control_name="VertexShaderEnable" + height="16" + initial_value="true" + label="Basic Shaders" + layout="topleft" + left_delta="0" + name="BasicShaders" + tool_tip="Disabling this option may prevent some graphics card drivers from crashing." + top_pad="1" + width="315"> + <check_box.commit_callback + function="Pref.VertexShaderEnable" /> + </check_box> + <check_box + control_name="WindLightUseAtmosShaders" + height="16" + initial_value="true" + label="Atmospheric Shaders" + layout="topleft" + left_delta="0" + name="WindLightUseAtmosShaders" + top_pad="1" + width="256"> + <check_box.commit_callback + function="Pref.VertexShaderEnable" /> + </check_box> + <check_box + control_name="RenderWaterReflections" + height="16" + initial_value="true" + label="Water Reflections" + layout="topleft" + left_delta="0" + name="Reflections" + top_pad="1" + width="256"> + <check_box.commit_callback + function="Pref.VertexShaderEnable" /> + </check_box> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="ReflectionDetailText" + top_pad="7" + width="128"> + Reflection Detail: + </text> + <radio_group + control_name="RenderReflectionDetail" + draw_border="false" + height="70" + layout="topleft" + left_delta="-2" + name="ReflectionDetailRadio" + top_pad="3" + width="321"> + <radio_item + height="16" + label="Terrain and Trees" + layout="topleft" + left="3" + name="0" + top="3" + width="315" /> + <radio_item + height="16" + label="All Static Objects" + layout="topleft" + left_delta="0" + name="1" + top_delta="16" + width="315" /> + <radio_item + height="16" + label="All Avatars and Objects" + layout="topleft" + left_delta="0" + name="2" + top_delta="16" + width="315" /> + <radio_item + height="16" + label="Everything" + layout="topleft" + left_delta="0" + name="3" + top_delta="16" + width="315" /> + </radio_group> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="2" + name="AvatarRenderingText" + top_pad="5" + width="128"> + Avatar Rendering: + </text> + <check_box + control_name="RenderUseImpostors" + height="16" + initial_value="true" + label="Avatar Impostors" + layout="topleft" + left_delta="0" + name="AvatarImpostors" + top_pad="7" + width="256" /> + <check_box + control_name="RenderAvatarVP" + height="16" + initial_value="true" + label="Hardware Skinning" + layout="topleft" + left_delta="0" + name="AvatarVertexProgram" + top_pad="1" + width="256"> + <check_box.commit_callback + function="Pref.VertexShaderEnable" /> + </check_box> + <check_box + control_name="RenderAvatarCloth" + height="16" + initial_value="true" + label="Avatar Cloth" + layout="topleft" + left_delta="0" + name="AvatarCloth" + top_pad="1" + width="256" /> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="457" + name="DrawDistanceMeterText1" + top="3" + width="128"> + m + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="6" + name="DrawDistanceMeterText2" + top_delta="0" + width="128"> + m + </text> + <slider + control_name="RenderFarClip" + decimal_digits="0" + follows="left|top" + height="16" + increment="8" + initial_value="160" + label="Draw Distance:" + label_width="140" + layout="topleft" + left_delta="-248" + max_val="512" + min_val="64" + name="DrawDistance" + top_delta="0" + width="255"> + <slider.commit_callback + function="Pref.UpdateMeterText" /> + </slider> + <slider + control_name="RenderMaxPartCount" + decimal_digits="0" + follows="left|top" + height="16" + increment="256" + initial_value="4096" + label="Max. Particle Count:" + label_width="140" + layout="topleft" + left_delta="0" + max_val="8192" + name="MaxParticleCount" + top_pad="4" + width="262" /> + <slider + control_name="RenderGlowResolutionPow" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="8" + label="Post Process Quality:" + label_width="140" + layout="topleft" + left_delta="0" + max_val="9" + min_val="8" + name="RenderPostProcess" + show_text="false" + top_pad="4" + width="223"> + <slider.commit_callback + function="Pref.UpdateSliderText" + parameter="PostProcessText" /> + </slider> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="MeshDetailText" + top_pad="5" + width="128"> + Mesh Detail: + </text> + <slider + control_name="RenderVolumeLODFactor" + follows="left|top" + height="16" + increment="0.125" + initial_value="160" + label=" Objects:" + label_width="140" + layout="topleft" + left_delta="0" + max_val="2" + name="ObjectMeshDetail" + show_text="false" + top_pad="6" + width="223"> + <slider.commit_callback + function="Pref.UpdateSliderText" + parameter="ObjectMeshDetailText" /> + </slider> + <slider + control_name="RenderFlexTimeFactor" + follows="left|top" + height="16" + initial_value="160" + label=" Flexiprims:" + label_width="140" + layout="topleft" + left_delta="0" + name="FlexibleMeshDetail" + show_text="false" + top_pad="4" + width="223"> + <slider.commit_callback + function="Pref.UpdateSliderText" + parameter="FlexibleMeshDetailText" /> + </slider> + <slider + control_name="RenderTreeLODFactor" + follows="left|top" + height="16" + increment="0.125" + initial_value="160" + label=" Trees:" + label_width="140" + layout="topleft" + left_delta="0" + name="TreeMeshDetail" + show_text="false" + top_pad="4" + width="223"> + <slider.commit_callback + function="Pref.UpdateSliderText" + parameter="TreeMeshDetailText" /> + </slider> + <slider + control_name="RenderAvatarLODFactor" + follows="left|top" + height="16" + increment="0.125" + initial_value="160" + label=" Avatars:" + label_width="140" + layout="topleft" + left_delta="0" + name="AvatarMeshDetail" + show_text="false" + top_pad="4" + width="223"> + <slider.commit_callback + function="Pref.UpdateSliderText" + parameter="AvatarMeshDetailText" /> + </slider> + <slider + control_name="RenderTerrainLODFactor" + follows="left|top" + height="16" + increment="0.125" + initial_value="160" + label=" Terrain:" + label_width="140" + layout="topleft" + left_delta="0" + max_val="2" + min_val="1" + name="TerrainMeshDetail" + show_text="false" + top_pad="4" + width="223"> + <slider.commit_callback + function="Pref.UpdateSliderText" + parameter="TerrainMeshDetailText" /> + </slider> + <slider + control_name="WLSkyDetail" + enabled_control="WindLightUseAtmosShaders" + decimal_digits="0" + follows="left|top" + height="16" + increment="8" + initial_value="160" + label=" Sky:" + label_width="140" + layout="topleft" + left_delta="0" + max_val="128" + min_val="16" + name="SkyMeshDetail" + show_text="false" + top_pad="4" + width="223"> + <slider.commit_callback + function="Pref.UpdateSliderText" + parameter="SkyMeshDetailText" /> + </slider> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="444" + name="PostProcessText" + top="305" + width="128"> + Low + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="ObjectMeshDetailText" + top_pad="26" + width="128"> + Low + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="FlexibleMeshDetailText" + top_pad="8" + width="128"> + Low + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="TreeMeshDetailText" + top_pad="8" + width="128"> + Low + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="AvatarMeshDetailText" + top_pad="8" + width="128"> + Low + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="TerrainMeshDetailText" + top_pad="8" + width="128"> + Low + </text> + <text + enabled_control="WindLightUseAtmosShaders" + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="SkyMeshDetailText" + top_pad="8" + width="128"> + Low + </text> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="-230" + name="LightingDetailText" + top_pad="8" + width="128"> + Lighting Detail: + </text> + <radio_group + control_name="RenderLightingDetail" + draw_border="false" + height="38" + layout="topleft" + left_delta="0" + name="LightingDetailRadio" + top_pad="5" + width="321"> + <radio_item + height="16" + label="Sun and moon only" + layout="topleft" + left="3" + name="SunMoon" + top="3" + width="156" /> + <radio_item + height="16" + label="Nearby local lights" + layout="topleft" + left_delta="0" + name="LocalLights" + top_delta="16" + width="156" /> + </radio_group> + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="360" + name="TerrainDetailText" + top="465" + width="128"> + Terrain Detail: + </text> + <radio_group + control_name="RenderTerrainDetail" + draw_border="false" + height="38" + layout="topleft" + left_delta="0" + name="TerrainDetailRadio" + top_pad="5" + width="321"> + <radio_item + height="16" + label="Low" + layout="topleft" + left="3" + name="0" + top="3" + width="315" /> + <radio_item + height="16" + label="High" + layout="topleft" + left_delta="0" + name="2" + top_delta="16" + width="315" /> + </radio_group> + </panel> + <button + height="20" + label="Recommended Settings" + layout="topleft" + left="130" + name="Defaults" + top="380" + width="170"> + <button.commit_callback + function="Pref.HardwareDefaults" /> + </button> + <button + height="20" + label="Hardware Options" + label_selected="Hardware Options" + layout="topleft" + left_pad="10" + name="GraphicsHardwareButton" + top_delta="0" + width="170"> + <button.commit_callback + function="Pref.HardwareSettings" /> + </button> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml new file mode 100644 index 0000000000000000000000000000000000000000..a4363d58586b9e93c3364fbba5c2a98cf12e220c --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -0,0 +1,574 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + bevel_style="in" + bg_alpha_color="0.5 0.5 0.5 1" + follows="left|top|right|bottom" + height="705" + label="Profile" + layout="topleft" + left="10" + mouse_opaque="false" + name="panel_profile" + top="10" + width="355"> + <panel.string + name="CaptionTextAcctInfo"> + [ACCTTYPE] [PAYMENTINFO] [AGEVERIFICATION] + </panel.string> + <panel.string + name="AcctTypeResident"> + Resident. + </panel.string> + <panel.string + name="AcctTypeTrial"> + Trial + </panel.string> + <panel.string + name="AcctTypeCharterMember"> + Charter Member + </panel.string> + <panel.string + name="AcctTypeEmployee"> + Linden Lab Employee + </panel.string> + <panel.string + name="PaymentInfoUsed"> + Payment Info Used + </panel.string> + <panel.string + name="PaymentInfoOnFile"> + Payment Info On File + </panel.string> + <panel.string + name="NoPaymentInfoOnFile"> + No Payment Info On File + </panel.string> + <panel.string + name="AgeVerified"> + Age-verified + </panel.string> + <panel.string + name="NotAgeVerified"> + Not Age-verified + </panel.string> + <scroll_container + follows="left|top|right|bottom" + height="690" + layout="topleft" + left="1" + name="profile_scroll" + width="354"> + <panel + height="710" + layout="topleft" + left="0" + top="0" + width="320"> + <panel + follows="left|top" + height="120" + layout="topleft" + left="9" + name="lifes_images_panel" + top_pad="15" + width="250"> + <panel + follows="left|top" + height="120" + layout="topleft" + left="0" + name="second_life_image_panel" + top="0" + width="125"> + <text + type="string" + follows="left|top|right|bottom" + font="SansSerifBold" + height="20" + layout="topleft" + left="0" + name="first_life_photo_title_text" + text_color="white" + top="0" + width="125"> + Second Life photo: + </text> + <texture_picker + allow_no_texture="true" + default_image_name="None" + enabled="false" + follows="top|left" + height="105" + layout="topleft" + left="0" + name="2nd_life_pic" + top_pad="5" + width="105" /> + </panel> + <panel + follows="left|top" + height="120" + layout="topleft" + left_pad="1" + name="first_life_image_panel" + top="0" + width="125"> + <text + type="string" + follows="left|top|right|bottom" + font="SansSerifBold" + height="20" + layout="topleft" + left="0" + name="second_life_photo_title_text" + text_color="white" + top="0" + width="125"> + First Life photo: + </text> + <texture_picker + allow_no_texture="true" + default_image_name="None" + enabled="false" + follows="top|left" + height="105" + layout="topleft" + left="0" + name="1st_life_pic" + top_pad="5" + width="105" /> + </panel> + </panel> + <panel + follows="left|top|right" + height="30" + layout="topleft" + left="0" + name="status_panel" + top="135" + width="300"> + <text + follows="left|top" + font="SansSerifBold" + font.style="ITALIC" + height="15" + layout="topleft" + left="9" + name="online_status" + text_color="green" + width="100" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerifBold" + font.style="ITALIC" + height="15" + layout="topleft" + left="9" + name="status_message" + text_color="0.1 0.1 0.1 1" + width="300"> + <!--TBD--> + </text> + </panel> + <panel + follows="left|top|right" + height="80" + layout="topleft" + left="0" + name="status_me_panel" + top="135" + width="300"> + <text + type="string" + follows="left|top" + font="SansSerifBold" + height="15" + layout="topleft" + left="9" + name="online_me_status_text" + text_color="white" + width="100"> + Status: + </text> + <combo_box + font="SansSerifBold" + height="18" + layout="topleft" + left="10" + name="status_combo" + width="150"> + <combo_box.item + label="Online" + value="online" /> + <combo_box.item + label="Away" + value="away" /> + <combo_box.item + label="Busy" + value="busy" /> + </combo_box> + <text + type="string" + follows="left|top" + font="SansSerifBold" + height="15" + layout="topleft" + left="9" + name="status_me_message_text" + text_color="white" + width="300"> + What're you up to? + </text> + <line_editor + type="string" + border_style="line" + border_thickness="1" + follows="left|top|right" + font="SansSerifBold" + font.style="ITALIC" + height="20" + layout="topleft" + left="9" + name="status_me_message_edit" + select_on_focus="true" + text_color="0.5 0.5 0.5 1" + width="300"> + Type a message about what you're doing in SL! + </line_editor> + </panel> + <text + type="string" + + follows="left|top" + font="SansSerifBold" + height="15" + layout="topleft" + left="9" + name="title_sl_descr_text" + text_color="white" + top_pad="10" + width="290"> + Second Life description: + </text> + <text + type="string" + follows="left|top|right" + font="SansSerif" + height="45" + layout="topleft" + left="9" + name="sl_description_edit" + text_color="0.1 0.1 0.1 1" + width="290" + word_wrap="true"> + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. + </text> + <text + type="string" + follows="left|top" + font="SansSerifBold" + height="15" + layout="topleft" + left="9" + name="title_fl_descr_text" + text_color="white" + top_pad="10" + width="290"> + First Life description: + </text> + <text + type="string" + follows="left|top|right" + font="SansSerif" + height="45" + layout="topleft" + left="9" + name="fl_description_edit" + text_color="0.1 0.1 0.1 1" + width="290" + word_wrap="true"> + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. + </text> + <text + type="string" + follows="left|top" + font="SansSerifBold" + height="15" + layout="topleft" + left="9" + name="title_groups_text" + text_color="white" + top_pad="10" + width="290"> + Second Life groups: + </text> + <text + type="string" + follows="left|top|right" + font="SansSerif" + height="45" + layout="topleft" + left="9" + name="sl_groups" + text_color="0.1 0.1 0.1 1" + width="290" + word_wrap="true"> + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. + </text> + <text + type="string" + follows="left|top" + font="SansSerifBold" + height="15" + layout="topleft" + left="9" + name="title_homepage_text" + text_color="white" + top_pad="10" + width="100"> + Homepage: + </text> + <text + type="string" + follows="left|top|right" + font="SansSerif" + font.style="UNDERLINE" + height="15" + layout="topleft" + left="9" + name="homepage_edit" + text_color="0.2 0.2 1 1" + width="290"> + TODO + </text> + <text + type="string" + follows="left|top" + font="SansSerifBold" + height="15" + layout="topleft" + left="9" + name="title_member_text" + text_color="white" + top_pad="10" + width="100"> + Member since: + </text> + <text + type="string" + follows="left|top|right" + font="SansSerif" + height="15" + layout="topleft" + left="9" + name="register_date" + text_color="0.1 0.1 0.1 1" + width="290" + word_wrap="true"> + 05/31/1976 + </text> + <text + type="string" + follows="left|top" + font="SansSerifBold" + height="15" + layout="topleft" + left="9" + name="title_acc_status_text" + text_color="white" + top_pad="10" + width="100"> + Account status: + </text> + <text + type="string" + follows="left|top|right" + font="SansSerif" + height="30" + layout="topleft" + left="9" + name="acc_status_text" + text_color="0.1 0.1 0.1 1" + width="290" + word_wrap="true"> + Resident. No payment info on file. + </text> + <panel + follows="left|top|right" + height="15" + layout="topleft" + left="9" + name="account_actions_panel" + width="335"> + <text + type="string" + follows="left|top" + font="SansSerif" + font.style="UNDERLINE" + height="15" + layout="topleft" + left="0" + name="my_account_link" + text_color="0.2 0.2 1 1" + top="0" + width="65"> + Update + </text> + <text + type="string" + follows="left|top" + font="SansSerif" + font.style="UNDERLINE" + height="15" + layout="topleft" + left="70" + name="my_account_link" + text_color="0.2 0.2 1 1" + top="0" + width="80"> + My Account + </text> + </panel> + <text + type="string" + follows="left|top" + font="SansSerifBold" + height="15" + layout="topleft" + name="title_partner_text" + text_color="white" + top_pad="10" + width="100"> + Partner: + </text> + <panel + follows="left|top|right" + height="15" + layout="topleft" + left="9" + name="partner_data_panel" + width="335"> + <text + type="string" + follows="left|top|right" + font="SansSerif" + height="15" + layout="topleft" + left="0" + name="partner_text" + text_color="0.1 0.1 0.1 1" + top="0" + width="290" + word_wrap="true"> + [FIRST] [LAST] + </text> + <text + type="string" + follows="top|right" + font="SansSerif" + font.style="UNDERLINE" + halign="right" + height="15" + layout="topleft" + left="270" + name="partner_edit_link" + text_color="0.2 0.2 1 1" + top="0" + width="40"> + Edit + </text> + </panel> + <panel + follows="left|top" + height="30" + layout="topleft" + name="profile_buttons_panel" + width="350"> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Add Friend" + layout="topleft" + left="5" + mouse_opaque="false" + name="add_friend" + top="0" + width="75" /> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="IM" + layout="topleft" + left_pad="5" + name="im" + top_delta="0" + width="40" /> + <button + enabled="false" + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Call" + layout="topleft" + left_pad="5" + name="call" + top_delta="0" + width="50" /> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Teleport" + layout="topleft" + left_pad="5" + name="teleport" + top_delta="0" + width="65" /> + <button + enabled="false" + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Share" + layout="topleft" + left_pad="15" + name="share" + top_delta="0" + width="50" /> + </panel> + <panel + follows="left|top" + height="30" + layout="topleft" + name="profile_me_buttons_panel" + visible="false" + width="350"> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Edit Profile" + layout="topleft" + left="0" + name="edit_profile_btn" + top="0" + width="105" /> + <button + follows="bottom|left" + font="SansSerifSmallBold" + height="25" + label="Edit Appearance" + layout="topleft" + left_pad="15" + name="edit_appearance_btn" + top_delta="0" + width="130" /> + </panel> + </panel> + </scroll_container> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile_view.xml b/indra/newview/skins/default/xui/en/panel_profile_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..fa919776a718948c147694f1fc54ba296b2a2bc2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_profile_view.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + bg_alpha_color="0.3 0.3 0.3 1" + follows="left|top|right|bottom" + height="660" + label="Me" + layout="topleft" + left="0" + name="panel_target_profile" + top="0" + width="355"> + <button + layout="topleft" + name="back" + left="0" + top="5" + width="20" + height="20" + label="" + follows="top|left" + image_selected="navbar_bg_button.tga" + image_unselected="navbar_bg_button.tga" + image_overlay="navbar_back.tga"/> + <text + layout="topleft" + top="0" + left="30" + width="150" + height="20" + font="SansSerifHugeBold" + text_color="white" + follows="top|left" + mouse_opaque="true" + name="user_name">(Loading...)</text> + <tab_container + follows="left|top|right|bottom" + height="600" + layout="topleft" + left="0" + name="profile_tabs" + tab_position="top" + top="35" + width="355"> + <panel + class="panel_profile" + filename="panel_profile.xml" + label="Profile" + layout="topleft" + name="panel_profile"/> + <panel + class="panel_picks" + filename="panel_picks.xml" + label="Picks" + layout="topleft" + name="panel_picks"/> + <panel + class="panel_notes" + filename="panel_notes.xml" + label="Notes" + layout="topleft" + name="panel_notes"/> + </tab_container> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_progress.xml b/indra/newview/skins/default/xui/en/panel_progress.xml new file mode 100644 index 0000000000000000000000000000000000000000..6139bae8749a83faf01a47362d4c0c58347f6354 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_progress.xml @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + follows="left|bottom|right|top" + height="768" + layout="topleft" + left="0" + name="login_progress_panel" + top="768" + width="1024"> + <layout_stack + follows="left|right|top|bottom" + height="768" + layout="topleft" + left="0" + name="stack1" + orientation="horizontal" + top="0" + width="1024"> + <layout_panel + layout="topleft" + min_width="10" + name="panel1" + user_resize="false" + width="150" /> + <layout_panel + height="768" + layout="topleft" + min_width="640" + name="panel2" + user_resize="false" + width="640"> + <layout_stack + follows="left|right|top|bottom" + height="768" + layout="topleft" + left="0" + name="stack2" + top="0" + width="640"> + <layout_panel + height="200" + layout="topleft" + min_height="10" + name="panel3" + width="640" /> + <layout_panel + auto_resize="false" + height="250" + layout="topleft" + min_height="250" + name="panel4" + width="640"> + <icon + color="LoginProgressBoxCenterColor" + follows="left|right|bottom|top" + height="250" + image_name="rounded_square.tga" + layout="topleft" + left="0" + top="0" + width="640" /> + <text + follows="left|right|top" + font="SansSerif" + font_shadow="hard" + halign="center" + height="20" + layout="topleft" + left_delta="0" + name="title_text" + text_color="LoginProgressBoxTextColor" + top_delta="50" + width="640" /> + <text + follows="left|right|top" + font="SansSerif" + font_shadow="hard" + halign="center" + height="20" + layout="topleft" + left_delta="0" + name="progress_text" + text_color="LoginProgressBoxTextColor" + top_pad="5" + width="640" /> + <progress_bar + bottom="115" + color_bar="1 1 1 0.96" + follows="left|right|top" + height="16" + layout="topleft" + left="45" + name="login_progress_bar" + right="-45" /> + <text + follows="left|right|top|bottom" + font="SansSerif" + font_shadow="hard" + halign="center" + height="100" + layout="topleft" + left="20" + line_spacing="8" + name="message_text" + text_color="LoginProgressBoxTextColor" + top="145" + width="600" /> + </layout_panel> + <layout_panel + height="200" + layout="topleft" + min_width="10" + name="panel5" + width="640" /> + </layout_stack> + </layout_panel> + <layout_panel + layout="topleft" + min_width="10" + name="panel6" + user_resize="false" + width="150" /> + </layout_stack> + <button + follows="right|bottom" + height="22" + layout="topleft" + left="-86" + name="cancel_btn" + picture_style="true" + top="730" + width="70" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_covenant.xml b/indra/newview/skins/default/xui/en/panel_region_covenant.xml new file mode 100644 index 0000000000000000000000000000000000000000..7bd548d464e07774a2d2136a6ebd6fb7fda61f8a --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_region_covenant.xml @@ -0,0 +1,328 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="top|left" + height="320" + label="Covenant" + layout="topleft" + left="0" + name="Covenant" + top="320" + width="480"> + <panel.string + name="can_resell"> + Purchased land in this region may be resold. + </panel.string> + <panel.string + name="can_not_resell"> + Purchased land in this region may not be resold. + </panel.string> + <panel.string + name="can_change"> + Purchased land in this region may be joined or subdivided. + </panel.string> + <panel.string + name="can_not_change"> + Purchased land in this region may not be joined or subdivided. + </panel.string> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="5" + mouse_opaque="false" + name="estate_section_lbl" + top="5" + width="100"> + Estate + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="estate_name_lbl" + top_pad="5" + width="100"> + Name: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="estate_name_text" + top_delta="0" + width="150"> + mainland + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="estate_owner_lbl" + top_pad="5" + width="100"> + Owner: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="estate_owner_text" + top_delta="0" + width="150"> + (none) + </text> + + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="estate_cov_lbl" + top_pad="5" + width="100"> + Covenant: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="covenant_timestamp_text" + top_delta="0" + width="308"> + Last Modified Wed Dec 31 16:00:00 1969 + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="5" + name="covenant_help" + top_delta="-2" + width="18" /> + + <text_editor + type="string" + length="1" + enabled="false" + follows="left|top" + height="100" + layout="topleft" + left="110" + max_length="65535" + name="covenant_editor" + top_delta="30" + width="340" + word_wrap="true"> + There is no Covenant provided for this Estate. + </text_editor> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="Reset" + layout="topleft" + left_delta="250" + name="reset_covenant" + top_pad="5" + width="90" /> + + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="120" + name="covenant_help_text" + top_pad="10" + width="460"> + Changes to the covenant will show on all parcels in the estate. + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_delta="0" + name="covenant_instructions" + top_pad="5" + width="465"> + Drag and drop a notecard to change the Covenant for this Estate. + </text> + + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="5" + mouse_opaque="false" + name="region_section_lbl" + top_pad="5" + width="100"> + Region + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="region_name_lbl" + top_pad="5" + width="100"> + Name: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="region_name_text" + top_delta="0" + width="150"> + leyla + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="region_landtype_lbl" + top_pad="5" + width="100"> + Type: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="region_landtype_text" + top_delta="0" + width="150"> + Mainland / Homestead + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="region_maturity_lbl" + top_pad="5" + width="100"> + Rating: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="region_maturity_text" + top_delta="0" + width="150"> + Adult + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="resellable_lbl" + top_pad="5" + width="100"> + Resale: + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="resellable_clause" + top_delta="0" + width="330"> + Land in this region may not be resold. + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + mouse_opaque="false" + name="changeable_lbl" + top_pad="5" + width="100"> + Subdivide: + </text> + <text + type="string" + length="1" + follows="left|top" + height="30" + layout="topleft" + left_pad="10" + mouse_opaque="false" + name="changeable_clause" + top_delta="0" + width="330"> + Land in this region may not be joined/subdivided. + </text> + +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_debug.xml b/indra/newview/skins/default/xui/en/panel_region_debug.xml new file mode 100644 index 0000000000000000000000000000000000000000..22dc0aa0d08e0d04e9aa1ecf177e966bd298d8f7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_region_debug.xml @@ -0,0 +1,272 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="top|left" + height="320" + label="Debug" + layout="topleft" + left="0" + name="Debug" + top="320" + width="480"> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="10" + name="region_text_lbl" + top="10" + width="100"> + Region: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left_delta="50" + name="region_text" + top_delta="0" + width="400"> + unknown + </text> + <check_box + height="20" + label="Disable Scripts" + layout="topleft" + left="10" + name="disable_scripts_check" + tool_tip="Disable all scripts in this region" + top="30" + width="80" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="70" + name="disable_scripts_help" + top_delta="2" + width="18" /> + <check_box + height="20" + label="Disable Collisions" + layout="topleft" + left="10" + name="disable_collisions_check" + tool_tip="Disable non-avatar collisions in this region" + top="50" + width="80" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="70" + name="disable_collisions_help" + top_delta="2" + width="18" /> + <check_box + height="20" + label="Disable Physics" + layout="topleft" + left="10" + name="disable_physics_check" + tool_tip="Disable all physics in this region" + top="70" + width="80" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="70" + name="disable_physics_help" + top_delta="2" + width="18" /> + <button + enabled="false" + follows="left|top" + height="20" + label="Apply" + layout="topleft" + left="60" + name="apply_btn" + top="100" + width="100" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + name="objret_text_lbl" + top="150" + width="90"> + Object Return + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="30" + name="resident_text_lbl" + top="175" + width="60"> + Resident: + </text> + <line_editor + type="string" + length="1" + border_style="line" + border_thickness="1" + enabled="false" + follows="left|top" + height="20" + layout="topleft" + left_delta="60" + mouse_opaque="false" + name="target_avatar_name" + top_delta="-2" + width="180"> + (none) + </line_editor> + <button + follows="left|top" + height="20" + label="Choose..." + layout="topleft" + left_pad="10" + name="choose_avatar_btn" + top_delta="0" + width="80" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="30" + name="options_text_lbl" + top="198" + width="60"> + Options: + </text> + <check_box + height="20" + label="Return only those objects with scripts" + layout="topleft" + left_delta="60" + name="return_scripts" + tool_tip="Return only objects which have scripts." + top_delta="0" + width="80" /> + <check_box + height="20" + label="Return only those objects on someone else's land" + layout="topleft" + left_delta="0" + name="return_other_land" + tool_tip="Return only objects which are on land belonging to someone else" + top_delta="20" + width="80" /> + <check_box + height="20" + label="Return objects in every region of this estate" + layout="topleft" + left_delta="0" + name="return_estate_wide" + tool_tip="Return objects in all of the regions that make up this estate" + top_delta="20" + width="80" /> + <button + follows="left|top" + height="20" + label="Return" + layout="topleft" + left="30" + name="return_btn" + top="263" + width="80" /> + <button + follows="left|top" + height="20" + label="Get Top Colliders..." + layout="topleft" + left="10" + name="top_colliders_btn" + tool_tip="List of objects experiencing the most potential collisions" + top="313" + width="150" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="10" + name="top_colliders_help" + top_delta="2" + width="18" /> + <button + follows="left|top" + height="20" + label="Get Top Scripts..." + layout="topleft" + left="10" + name="top_scripts_btn" + tool_tip="List of objects spending the most time running scripts" + top_pad="5" + width="150" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="10" + name="top_scripts_help" + top_delta="2" + width="18" /> + <button + follows="left|top" + height="20" + label="Restart Region" + layout="topleft" + left="10" + name="restart_btn" + tool_tip="Give 2 minute countdown and restart region" + top_pad="5" + width="130" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="10" + name="restart_help" + top_delta="2" + width="18" /> + <button + follows="left|top" + height="20" + label="Delay Restart" + layout="topleft" + left="10" + name="cancel_restart_btn" + tool_tip="Delay region restart by one hour" + top_pad="5" + width="130" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_estate.xml b/indra/newview/skins/default/xui/en/panel_region_estate.xml new file mode 100644 index 0000000000000000000000000000000000000000..95e1456c6e01804cd64583de70d5d71652630a1f --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_region_estate.xml @@ -0,0 +1,519 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="top|left" + height="320" + label="Estate" + layout="topleft" + left="0" + name="Estate" + top="320" + width="480"> + <panel.string + name="email_unsupported"> + Feature unsupported + </panel.string> + <text + type="string" + length="1" + follows="left|top" + height="32" + layout="topleft" + left="10" + name="estate_help_text" + top="14" + width="300"> + Changes to settings on this tab will affect all +regions in the estate. + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left_delta="0" + name="estate_text" + top_pad="2" + width="80"> + Estate: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left_delta="0" + name="estate_name" + top_delta="16" + width="150"> + (unknown) + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left_delta="0" + name="owner_text" + top_pad="2" + width="80"> + Owner: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left_delta="0" + name="estate_owner" + top_delta="16" + width="150"> + (unknown) + </text> + <view_border + bevel_style="in" + follows="top|left" + height="290" + layout="topleft" + left_delta="-4" + top_pad="5" + width="250" /> + <check_box + height="20" + label="Use Global Time" + layout="topleft" + left="12" + name="use_global_time_check" + top="132" + width="200" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="20" + name="use_global_time_help" + top_delta="2" + width="18" /> + <check_box + height="20" + label="Fixed Sun" + layout="topleft" + left="12" + name="fixed_sun_check" + top="152" + width="100" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="120" + name="fixed_sun_help" + top_delta="2" + width="18" /> + <icon + height="20" + image_name="icon_day_cycle.tga" + layout="topleft" + left="47" + name="daycycle" + top="177" + width="165" /> + <slider + follows="left|top" + height="20" + increment="0.001" + label="Phase" + layout="topleft" + left="12" + max_val="30" + min_val="6" + name="sun_hour_slider" + show_text="false" + top="202" + width="200" /> + <check_box + height="20" + label="Allow Public Access" + layout="topleft" + left_delta="0" + name="externally_visible_check" + top_pad="6" + width="200" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="20" + name="externally_visible_help" + top_delta="2" + width="18" /> + <text + type="string" + length="1" + follows="top|left" + height="16" + layout="topleft" + left="32" + name="Only Allow" + top="250" + width="278"> + Restrict Access To: + </text> + <check_box + follows="top|left" + height="16" + label="Residents with payment info on file" + layout="topleft" + left_delta="0" + name="limit_payment" + tool_tip="Ban unidentified residents." + top_pad="2" + width="278" /> + <check_box + follows="top|left" + height="16" + label="Age-verified adults" + layout="topleft" + left_delta="0" + name="limit_age_verified" + tool_tip="Ban residents who have not verified their age. See support.secondlife.com for more information." + top_pad="2" + width="278" /> + <check_box + height="20" + label="Allow Voice Chat" + layout="topleft" + left="12" + name="voice_chat_check" + top="304" + width="200" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="20" + name="voice_chat_help" + top_delta="2" + width="18" /> + <check_box + height="20" + label="Allow Direct Teleport" + layout="topleft" + left="12" + name="allow_direct_teleport" + top_pad="4" + width="80" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="140" + name="allow_direct_teleport_help" + top_delta="2" + width="18" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + name="abuse_email_text" + top_pad="5" + width="180"> + Abuse email address: + </text> + <line_editor + follows="top|left" + height="19" + layout="topleft" + left="15" + name="abuse_email_address" + top_pad="5" + width="205" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="12" + name="abuse_email_address_help" + top_dekta="0" + width="18" /> + <button + enabled="false" + follows="left|top" + height="20" + label="Apply" + layout="topleft" + name="apply_btn" + right="250" + top_pad="4" + width="90" /> + <button + follows="left|top" + height="20" + label="Send Message To Estate..." + layout="topleft" + left="8" + name="message_estate_btn" + top_pad="5" + width="250" /> + <button + follows="left|top" + height="20" + label="Kick User from Estate..." + layout="topleft" + left="8" + name="kick_user_from_estate_btn" + top_pad="5" + width="250" /> + + <text + type="string" + length="1" + bottom="34" + follows="left|top" + height="20" + layout="topleft" + name="estate_manager_label" + right="470" + width="200"> + Estate Managers: + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="182" + name="estate_manager_help" + top_delta="-1" + width="18" /> + <view_border + bevel_style="none" + follows="top|left" + height="60" + layout="topleft" + right="470" + top_pad="5" + width="200" /> + <name_list + follows="left|top" + height="60" + layout="topleft" + left_delta="0" + multi_select="true" + name="estate_manager_name_list" + top_delta="0" + width="200" /> + <button + follows="left|top" + height="20" + label="Remove..." + layout="topleft" + name="remove_estate_manager_btn" + right="470" + top_pad="5" + width="90" /> + <button + follows="left|top" + height="20" + label="Add..." + layout="topleft" + left_delta="-110" + name="add_estate_manager_btn" + top_delta="0" + width="90" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_delta="0" + name="allow_resident_label" + top_pad="5" + width="200"> + Allowed Residents: + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="182" + name="allow_resident_help" + top_delta="-1" + width="18" /> + <view_border + bevel_style="none" + follows="top|left" + height="60" + layout="topleft" + right="470" + top_pad="5" + width="200" /> + <name_list + follows="left|top" + height="60" + layout="topleft" + left_delta="0" + multi_select="true" + name="allowed_avatar_name_list" + top_delta="0" + width="200" /> + <button + follows="left|top" + height="20" + label="Remove..." + layout="topleft" + name="remove_allowed_avatar_btn" + right="470" + top_pad="5" + width="90" /> + <button + follows="left|top" + height="20" + label="Add..." + layout="topleft" + left_delta="-110" + name="add_allowed_avatar_btn" + top_delta="0" + width="90" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_delta="0" + name="allow_group_label" + top_pad="5" + width="200"> + Allowed Groups: + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="182" + name="allow_group_help" + top_delta="-1" + width="18" /> + <view_border + bevel_style="none" + follows="top|left" + height="60" + layout="topleft" + right="470" + top_pad="5" + width="200" /> + <name_list + follows="left|top" + height="60" + layout="topleft" + left_delta="0" + multi_select="true" + name="allowed_group_name_list" + top_delta="0" + width="200" /> + <button + follows="left|top" + height="20" + label="Remove..." + layout="topleft" + name="remove_allowed_group_btn" + right="470" + top_pad="5" + width="90" /> + <button + follows="left|top" + height="20" + label="Add..." + layout="topleft" + left_delta="-110" + name="add_allowed_group_btn" + top_delta="0" + width="90" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_delta="0" + name="ban_resident_label" + top_pad="5" + width="200"> + Banned Residents: + </text> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_delta="182" + name="ban_resident_help" + top_delta="-1" + width="18" /> + <view_border + bevel_style="none" + follows="top|left" + height="60" + layout="topleft" + right="470" + top_pad="5" + width="200" /> + <name_list + follows="left|top" + height="60" + layout="topleft" + left_delta="0" + multi_select="true" + name="banned_avatar_name_list" + top_delta="0" + width="200" /> + <button + follows="left|top" + height="20" + label="Remove..." + layout="topleft" + name="remove_banned_avatar_btn" + right="470" + top_pad="5" + width="90" /> + <button + follows="left|top" + height="20" + label="Add..." + layout="topleft" + left_delta="-110" + name="add_banned_avatar_btn" + top_delta="0" + width="90" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_general.xml b/indra/newview/skins/default/xui/en/panel_region_general.xml new file mode 100644 index 0000000000000000000000000000000000000000..661cb97c669c8c0fd15e25c5665651706614f819 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_region_general.xml @@ -0,0 +1,350 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="top|left" + height="320" + label="Region" + layout="topleft" + left="0" + name="General" + top="320" + width="480"> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="10" + name="region_text_lbl" + top="10" + width="100"> + Region: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left_delta="50" + name="region_text" + top_delta="0" + width="400"> + unknown + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="10" + name="version_channel_text_lbl" + top="30" + width="100"> + Version: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left_delta="50" + name="version_channel_text" + top_delta="0" + width="200"> + unknown + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="10" + name="region_type_lbl" + top="50" + width="100"> + Type: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left_delta="50" + name="region_type" + top_delta="0" + width="200"> + unknown + </text> + <check_box + height="20" + label="Block Terraform" + layout="topleft" + left="10" + name="block_terraform_check" + top="70" + width="80" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="115" + name="terraform_help" + top_delta="2" + width="18" /> + <check_box + height="20" + label="Block Fly" + layout="topleft" + left="10" + name="block_fly_check" + top="90" + width="80" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="115" + name="fly_help" + top_delta="2" + width="18" /> + <check_box + height="20" + label="Allow Damage" + layout="topleft" + left="10" + name="allow_damage_check" + top="110" + width="80" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="115" + name="damage_help" + top_delta="2" + width="18" /> + <check_box + height="20" + label="Restrict Pushing" + layout="topleft" + left="10" + name="restrict_pushobject" + top="130" + width="80" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="115" + name="restrict_pushobject_help" + top_delta="2" + width="18" /> + <check_box + height="20" + label="Allow Land Resell" + layout="topleft" + left="10" + name="allow_land_resell_check" + top="160" + width="80" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="115" + name="land_resell_help" + top_delta="2" + width="18" /> + <check_box + height="20" + label="Allow Land Join/Divide" + layout="topleft" + left="10" + name="allow_parcel_changes_check" + top="180" + width="80" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="115" + name="parcel_changes_help" + top_delta="2" + width="18" /> + <check_box + height="20" + label="Block Land Show in Search" + layout="topleft" + left="10" + name="block_parcel_search_check" + tool_tip="Let people see this region and its parcels in search results" + top="200" + width="80" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="115" + name="parcel_search_help" + top_delta="2" + width="18" /> + <spinner + follows="left|top" + height="20" + increment="1" + label="Agent Limit" + label_width="97" + layout="topleft" + left="10" + max_val="100" + min_val="1" + name="agent_limit_spin" + top="240" + width="170" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="25" + name="agent_limit_help" + top_delta="2" + width="18" /> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="Object Bonus" + label_width="97" + layout="topleft" + left="10" + max_val="10" + min_val="1" + name="object_bonus_spin" + top="260" + width="170" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="25" + name="object_bonus_help" + top_delta="2" + width="18" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + label="Maturity" + layout="topleft" + left="10" + name="access_text" + top="290" + width="100"> + Rating: + </text> + <combo_box + height="20" + label="Mature" + layout="topleft" + left_delta="100" + name="access_combo" + top_delta="0" + width="85"> + <combo_box.item + label="Adult" + value="42" /> + <combo_box.item + label="Mature" + value="21" /> + <combo_box.item + label="PG" + value="13" /> + </combo_box> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="10" + name="access_help" + top_delta="2" + width="18" /> + <button + enabled="false" + follows="left|top" + height="20" + label="Apply" + layout="topleft" + left="108" + name="apply_btn" + top="320" + width="100" /> + <button + follows="left|top" + height="20" + label="Teleport Home One User..." + layout="topleft" + left="10" + name="kick_btn" + top_pad="10" + width="250" /> + <button + follows="left|top" + height="20" + label="Teleport Home All Users..." + layout="topleft" + left_delta="0" + name="kick_all_btn" + top_pad="3" + width="250" /> + <button + follows="left|top" + height="20" + label="Send Message To Region..." + layout="topleft" + left_delta="0" + name="im_btn" + top_pad="20" + width="200" /> + <button + follows="left|top" + height="20" + label="Manage Telehub..." + layout="topleft" + left="250" + name="manage_telehub_btn" + top="70" + width="150" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_terrain.xml b/indra/newview/skins/default/xui/en/panel_region_terrain.xml new file mode 100644 index 0000000000000000000000000000000000000000..ae3b6507740f354f0469112a1ad2fe3d7010afb3 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_region_terrain.xml @@ -0,0 +1,239 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="top|left" + height="320" + label="Terrain" + layout="topleft" + left="0" + name="Terrain" + top="320" + width="480"> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="10" + name="region_text_lbl" + top="10" + width="100"> + Region: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left_delta="50" + name="region_text" + top_delta="0" + width="400"> + unknown + </text> + <spinner + follows="left|top" + height="20" + label="Water Height" + label_width="120" + layout="topleft" + left="15" + max_val="100" + name="water_height_spin" + top="40" + width="180" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="5" + name="water_height_help" + top_delta="2" + width="18" /> + <spinner + follows="left|top" + height="20" + increment="0.2" + label="Terrain Raise Limit" + label_width="120" + layout="topleft" + left="15" + max_val="100" + name="terrain_raise_spin" + top="60" + width="180" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="5" + name="terrain_raise_help" + top_delta="2" + width="18" /> + <spinner + follows="left|top" + height="20" + increment="0.2" + label="Terrain Lower Limit" + label_width="120" + layout="topleft" + left="15" + max_val="0" + min_val="-100" + name="terrain_lower_spin" + top="80" + width="180" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="5" + name="terrain_lower_help" + top_delta="2" + width="18" /> + <check_box + height="20" + label="Use Estate Sun" + layout="topleft" + left="250" + name="use_estate_sun_check" + top="35" + width="100" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="70" + name="use_estate_sun_help" + top_delta="2" + width="18" /> + <check_box + height="20" + label="Fixed Sun" + layout="topleft" + left="250" + name="fixed_sun_check" + top="55" + width="100" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="70" + name="fixed_sun_help" + top_delta="2" + width="18" /> + <icon + height="20" + image_name="icon_day_cycle.tga" + layout="topleft" + left="285" + name="daycycle" + top="80" + width="165" /> + <slider + follows="left|top" + height="20" + increment="0.001" + label="Phase" + layout="topleft" + left="250" + max_val="30" + min_val="6" + name="sun_hour_slider" + show_text="false" + top="105" + width="200" /> + <button + enabled="false" + follows="left|top" + height="20" + label="Apply" + layout="topleft" + left="350" + name="apply_btn" + top="135" + width="90" /> + <view_border + bevel_style="none" + follows="top|left" + height="130" + layout="topleft" + left="8" + top="30" + width="460" /> + <button + follows="left|top" + height="20" + label="Download RAW terrain..." + layout="topleft" + left_delta="2" + name="download_raw_btn" + tool_tip="Available only to estate owners, not managers" + top_pad="60" + width="170" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="10" + name="download_raw_help" + top_delta="2" + width="18" /> + <button + follows="left|top" + height="20" + label="Upload RAW terrain..." + layout="topleft" + left="10" + name="upload_raw_btn" + tool_tip="Available only to estate owners, not managers" + top="243" + width="170" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="10" + name="upload_raw_help" + top_delta="2" + width="18" /> + <button + follows="left|top" + height="20" + label="Bake Terrain" + layout="topleft" + left="10" + name="bake_terrain_btn" + tool_tip="Set current terrain as mid-point for raise/lower limits" + top="283" + width="100" /> + <button + follows="left|top" + font="SansSerifSmall" + height="18" + label="?" + layout="topleft" + left_pad="10" + name="bake_terrain_help" + top_delta="2" + width="18" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_texture.xml b/indra/newview/skins/default/xui/en/panel_region_texture.xml new file mode 100644 index 0000000000000000000000000000000000000000..f24630f4e30294b184ab55f8f6a18358f4f1758c --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_region_texture.xml @@ -0,0 +1,340 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + border="true" + follows="top|left" + height="320" + label="Ground Textures" + layout="topleft" + left="0" + name="Textures" + top="320" + width="480"> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left="10" + name="region_text_lbl" + top="10" + width="100"> + Region: + </text> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="20" + layout="topleft" + left_delta="50" + name="region_text" + top_delta="0" + width="400"> + unknown + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + name="detail_texture_text" + top="36" + width="300"> + Terrain Textures (requires 512x512, 24 bit .tga files) + </text> + <texture_picker + follows="left|top" + height="100" + layout="topleft" + left_delta="0" + name="texture_detail_0" + top_delta="20" + width="100" /> + <texture_picker + follows="left|top" + height="100" + layout="topleft" + left_pad="10" + name="texture_detail_1" + top_delta="0" + width="100" /> + <texture_picker + follows="left|top" + height="100" + layout="topleft" + left_pad="10" + name="texture_detail_2" + top_delta="0" + width="100" /> + <texture_picker + follows="left|top" + height="100" + layout="topleft" + left_pad="10" + name="texture_detail_3" + top_delta="0" + width="100" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + name="height_text_lbl" + top="146" + width="65"> + 1 (Low) + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="45" + name="height_text_lbl2" + top_delta="0" + width="100"> + 2 + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + name="height_text_lbl3" + top_delta="0" + width="100"> + 3 + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + name="height_text_lbl4" + top_delta="0" + width="100"> + 4 (High) + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + name="height_text_lbl5" + top="186" + width="300"> + Texture Elevation Ranges + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="51" + name="height_text_lbl6" + top="201" + width="100"> + Southwest + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + name="height_text_lbl7" + top_delta="0" + width="100"> + Northwest + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + name="height_text_lbl8" + top_delta="0" + width="100"> + Southeast + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + name="height_text_lbl9" + top_delta="0" + width="100"> + Northeast + </text> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="Low" + label_width="37" + layout="topleft" + left="10" + max_val="500" + min_val="-500" + name="height_start_spin_0" + top="221" + width="100" /> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="Low" + label_width="37" + layout="topleft" + left_pad="10" + max_val="500" + min_val="-500" + name="height_start_spin_1" + top_delta="0" + width="100" /> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="Low" + label_width="37" + layout="topleft" + left_pad="10" + max_val="500" + min_val="-500" + name="height_start_spin_2" + top_delta="0" + width="100" /> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="Low" + label_width="37" + layout="topleft" + left_pad="10" + max_val="500" + min_val="-500" + name="height_start_spin_3" + top_delta="0" + width="100" /> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="High" + label_width="37" + layout="topleft" + left="10" + max_val="500" + min_val="-500" + name="height_range_spin_0" + top="241" + width="100" /> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="High" + label_width="37" + layout="topleft" + left_pad="10" + max_val="500" + min_val="-500" + name="height_range_spin_1" + top_delta="0" + width="100" /> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="High" + label_width="37" + layout="topleft" + left_pad="10" + max_val="500" + min_val="-500" + name="height_range_spin_2" + top_delta="0" + width="100" /> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="High" + label_width="37" + layout="topleft" + left_pad="10" + max_val="500" + min_val="-500" + name="height_range_spin_3" + top_delta="0" + width="100" /> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="25" + name="height_text_lbl10" + top="281" + width="480"> + These values represent the blend range for the textures above. + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_delta="0" + name="height_text_lbl11" + top_delta="16" + width="450"> + Measured in meters, the LOW value is the MAXIMUM height of Texture #1, + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left_delta="0" + name="height_text_lbl12" + top_delta="16" + width="480"> + and the HIGH value is the MINIMUM height of Texture #4. + </text> + <button + enabled="false" + follows="left|bottom" + height="20" + label="Apply" + layout="topleft" + left="350" + name="apply_btn" + top="290" + width="100" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml new file mode 100644 index 0000000000000000000000000000000000000000..5a452bd70629aef044aa589ac6b4ae1c2e8d6009 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml @@ -0,0 +1,190 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + bevel_style="none" + border_style="line" + bottom="550" + follows="left|top|right|bottom" + height="508" + layout="topleft" + left="0" + name="script panel" + width="500"> + <panel.string + name="loading"> + Loading... + </panel.string> + <panel.string + name="can_not_view"> + You are not allowed to view this script. + </panel.string> + <panel.string + name="public_objects_can_not_run"> + Public Objects cannot run scripts + </panel.string> + <panel.string + name="script_running"> + Running + </panel.string> + <panel.string + name="Title"> + Script: [NAME] + </panel.string> + <text_editor + type="string" + length="1" + bevel_style="none" + border_style="line" + bottom="393" + follows="left|top|right|bottom" + font="Monospace" + height="376" + ignore_tab="false" + layout="topleft" + left="4" + max_length="65536" + name="Script Editor" + width="492" + word_wrap="true"> + Loading... + </text_editor> + <button + bottom="499" + follows="right|bottom" + height="20" + label="Save" + label_selected="Save" + layout="topleft" + left="360" + name="Save_btn" + width="128" /> + <scroll_list + bottom="457" + follows="left|right|bottom" + height="60" + layout="topleft" + left="4" + name="lsl errors" + width="492" /> + <combo_box + bottom="499" + follows="left|bottom" + height="20" + label="Insert..." + layout="topleft" + left="12" + name="Insert..." + width="128" /> + <text + bottom="473" + follows="left|bottom" + height="12" + layout="topleft" + left="12" + name="line_col" + width="128" /> + <menu_bar + bg_visible="false" + bottom="18" + follows="left|top|right" + height="18" + layout="topleft" + left="8" + mouse_opaque="false" + name="script_menu" + width="476"> + <menu + bottom="18" + height="62" + label="File" + layout="topleft" + left="0" + mouse_opaque="false" + name="File" + width="138"> + <menu_item_call + label="Save" + layout="topleft" + name="Save" /> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Revert All Changes" + layout="topleft" + name="Revert All Changes" /> + </menu> + <menu + bottom="-647" + height="198" + label="Edit" + layout="topleft" + left="222" + mouse_opaque="false" + name="Edit" + width="139"> + <menu_item_call + enabled="false" + label="Undo" + layout="topleft" + name="Undo" /> + <menu_item_call + enabled="false" + label="Redo" + layout="topleft" + name="Redo" /> + <menu_item_separator + layout="topleft" /> + <menu_item_call + enabled="false" + label="Cut" + layout="topleft" + name="Cut" /> + <menu_item_call + enabled="false" + label="Copy" + layout="topleft" + name="Copy" /> + <menu_item_call + enabled="false" + label="Paste" + layout="topleft" + name="Paste" /> + <menu_item_separator + layout="topleft" + name="separator2" /> + <menu_item_call + label="Select All" + layout="topleft" + name="Select All" /> + <menu_item_call + enabled="false" + label="Deselect" + layout="topleft" + name="Deselect" /> + <menu_item_separator + layout="topleft" + name="separator3" /> + <menu_item_call + label="Search / Replace..." + layout="topleft" + name="Search / Replace..." /> + </menu> + <menu + bottom="18" + height="34" + label="Help" + layout="topleft" + left="0" + mouse_opaque="false" + name="Help" + width="112"> + <menu_item_call + label="Help..." + layout="topleft" + name="Help..." /> + <menu_item_call + label="LSL Wiki Help..." + layout="topleft" + name="LSL Wiki Help..." /> + </menu> + </menu_bar> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_scrolling_param.xml b/indra/newview/skins/default/xui/en/panel_scrolling_param.xml new file mode 100644 index 0000000000000000000000000000000000000000..2805ace906b2ac85441be79f6000820cb22b2f5f --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_scrolling_param.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + height="152" + layout="topleft" + left="0" + name="LLScrollingPanelParam" + top="152" + width="270"> + <text + follows="left|top" + height="16" + layout="topleft" + left="4" + name="min param text" + top="116" + width="128" /> + <text + follows="left|top" + height="16" + layout="topleft" + left_pad="6" + name="max param text" + top_delta="0" + width="128" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="8" + name="Loading..." + top="11" + width="128"> + Loading... + </text> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="6" + name="Loading...2" + top_delta="0" + width="128"> + Loading... + </text> + <button + enabled="false" + height="132" + image_disabled="square_btn_32x128.tga" + image_disabled_selected="square_btn_selected_32x128.tga" + image_selected="square_btn_selected_32x128.tga" + image_unselected="square_btn_32x128.tga" + layout="topleft" + left="2" + name="less" + picture_style="true" + tab_stop="false" + top="0" + width="132" /> + <button + enabled="false" + height="132" + image_disabled="square_btn_32x128.tga" + image_disabled_selected="square_btn_selected_32x128.tga" + image_selected="square_btn_selected_32x128.tga" + image_unselected="square_btn_32x128.tga" + layout="topleft" + left_pad="2" + name="more" + picture_style="true" + tab_stop="false" + top_delta="0" + width="132" /> + <slider + can_edit_text="true" + decimal_digits="0" + enabled="false" + height="16" + increment="1" + initial_value="0" + label="[DESC]" + label_width="100" + layout="topleft" + left="6" + max_val="100" + name="param slider" + top="134" + width="258" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml new file mode 100644 index 0000000000000000000000000000000000000000..220191ddaa38f90e3c9d0e24d376154e612789a0 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<side_tray + name="sidebar" + background_visible="false" + bg_opaque_color="0.0 0.0 0.0 0.0" + mouse_opaque="true" + collapsed="true" +> + <sidetray_tab + name="sidebarpanel2" + mouse_opaque="false" + background_opaque="false" + background_visible="true" + bg_opaque_color="0.5 0.5 0.5 1.0" + image="icn_voice-groupfocus.tga" + tab_title="People" + description="Find your friends, contacts and people nearby." + > + <collapsible_ctrl + name="people_accordion" + title="People" + collapsable="true" + min_width="200" + min_height="200" + expanded="true" + header_visible="false" + > + <panel + class="panel_people" + name="panel_people" + filename="panel_people.xml" + width="355" + height="465" + label="People" + border="true" + /> + </collapsible_ctrl> + </sidetray_tab> + + <sidetray_tab + name="sidebarpanel1" + mouse_opaque="false" + background_visible="true" + label="Places" + bg_opaque_color="0.5 0.5 0.5 1.0" + image="inv_item_landmark.tga" + tab_title="Places" + description="Find places to go and places you've been." + > + <collapsible_ctrl + name="places_accordian" + title="Places" + collapsable="true" + min_width="355" + min_height="570" + header_visible="false" + > + <panel + class="panel_places" + name="panel_places" + filename="panel_places.xml" + label="Places" + border="true" + /> + </collapsible_ctrl> + </sidetray_tab> + + <sidetray_tab + name="sidebar_me" + mouse_opaque="false" + background_visible="true" + bg_opaque_color="0.5 0.5 0.5 1.0" + image="icn_voice-pvtfocus.tga" + tab_title="Me" + description="Change your profile, your look and quick links to your outfits." + > + <collapsible_ctrl + name="me_accordion" + title="Me" + collapsable="false" + min_width="200" + min_height="200" + header_visible="false" + > + <panel + class="panel_me_profile" + name="panel_me_profile" + filename="panel_me_profile.xml" + label="Me" + border="true" + /> + </collapsible_ctrl> + </sidetray_tab> +</side_tray> + diff --git a/indra/newview/skins/default/xui/en/panel_side_tray_tab_caption.xml b/indra/newview/skins/default/xui/en/panel_side_tray_tab_caption.xml new file mode 100644 index 0000000000000000000000000000000000000000..e447e541e0ba6da664a66da09c527f769b5e9817 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_side_tray_tab_caption.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel name="sidetray_tab_panel" + bottom="0" height="25" left="0" background_visible="false" + bg_visible="false" border="false" border_visible="false" + bg_opaque_color="0.7 0.3 0.7 1.0" + follows="left|top|right" + mouse_opaque="true"> + <text type="string" length="1" bg_visible="false" border_visible="false" + bottom="0" enabled="true" follows="left|top" + height="20" left="10" + font="SansSerifBold" halign="left" + name="sidetray_tab_title" width="100"> + Side Panel + </text> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml new file mode 100644 index 0000000000000000000000000000000000000000..37095141475a60497e8c842ed21d99bff3f0aeed --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -0,0 +1,252 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_opaque="true" + background_visible="true" + bg_opaque_color="0.25 0.25 0.25 1" + follows="top|left|right" + height="18" + layout="topleft" + left="0" + mouse_opaque="false" + name="status" + top="18" + width="1000"> + <panel.string + name="StatBarDaysOfWeek"> + Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday + </panel.string> + <panel.string + name="StatBarMonthsOfYear"> + January:February:March:April:May:June:July:August:September:October:November:December + </panel.string> + <panel.string + name="packet_loss_tooltip"> + Packet Loss + </panel.string> + <panel.string + name="bandwidth_tooltip"> + Bandwidth + </panel.string> + <panel.string + name="time"> + [hour12, datetime, slt]:[min, datetime, slt] [ampm, datetime, slt] [timezone,datetime, slt] + </panel.string> + <panel.string + name="timeTooltip"> + [weekday, datetime, slt], [day, datetime, slt] [month, datetime, slt] [year, datetime, slt] + </panel.string> + <button + auto_resize="true" + follows="right|bottom" + font="SansSerifSmall" + height="16" + layout="topleft" + left="-130" + name="buycurrency" + picture_style="true" + tool_tip="Account Balance / Buy currency" + top="1" + width="60" /> + <text + type="string" + length="1" + disabled_color="TimeTextColor" + follows="right|bottom" + halign="right" + height="20" + layout="topleft" + left_pad="5" + name="TimeText" + text_color="TimeTextColor" + tool_tip="Current Time (Pacific)" + top_delta="-1" + v_pad="2" + width="60"> + 12:00 AM + </text> + <button + follows="right|bottom" + height="16" + image_selected="status_script_debug.tga" + image_unselected="status_script_debug.tga" + layout="topleft" + left_delta="-557" + name="scriptout" + picture_style="true" + scale_image="false" + tool_tip="Script Warnings and Errors" + top_delta="2" + visible="false" + width="16" /> + <button + follows="right|bottom" + height="18" + image_selected="status_health.tga" + image_unselected="status_health.tga" + layout="topleft" + left_delta="16" + name="health" + picture_style="true" + scale_image="false" + tool_tip="Health" + top_delta="2" + visible="false" + width="24" /> + <text + type="string" + length="1" + disabled_color="HealthTextColor" + follows="rsight|bottom" + font_shadow="hard" + height="18" + layout="topleft" + left_delta="24" + name="HealthText" + text_color="HealthTextColor" + tool_tip="Health" + top_delta="-4" + v_pad="2" + visible="false" + width="31"> + 100% + </text> + <button + follows="right|bottom" + height="18" + image_selected="status_no_fly.tga" + image_unselected="status_no_fly.tga" + layout="topleft" + left_delta="31" + name="no_fly" + picture_style="true" + scale_image="false" + tool_tip="Flying not allowed" + top_delta="4" + visible="false" + width="24" /> + <button + follows="right|bottom" + height="18" + image_selected="status_no_build.tga" + image_unselected="status_no_build.tga" + layout="topleft" + left_delta="24" + name="no_build" + picture_style="true" + scale_image="false" + tool_tip="Building/Rezzing not allowed" + top_delta="0" + visible="false" + width="24" /> + <button + follows="right|bottom" + height="18" + image_selected="status_no_scripts.tga" + image_unselected="status_no_scripts.tga" + layout="topleft" + left_delta="24" + name="no_scripts" + picture_style="true" + scale_image="false" + tool_tip="Scripts not allowed" + top_delta="0" + visible="false" + width="24" /> + <button + follows="right|bottom" + height="18" + image_selected="status_no_push.tga" + image_unselected="status_no_push.tga" + layout="topleft" + left_delta="24" + name="restrictpush" + picture_style="true" + scale_image="false" + tool_tip="No Pushing" + top_delta="0" + visible="false" + width="24" /> + <button + follows="right|bottom" + height="18" + image_selected="status_no_voice.tga" + image_unselected="status_no_voice.tga" + layout="topleft" + left_delta="24" + name="status_no_voice" + picture_style="true" + scale_image="false" + tool_tip="Voice not available here" + top_delta="0" + visible="false" + width="24" /> + <button + follows="right|bottom" + height="16" + image_selected="status_buy_land_pressed.tga" + image_unselected="status_buy_land.tga" + layout="topleft" + left_pad="7" + name="buyland" + picture_style="true" + tool_tip="Buy this parcel" + top_delta="-3" + visible="false" + width="16" /> + <button + follows="right|bottom" + height="16" + image_disabled="sm_rounded_corners_simple.tga" + image_disabled_selected="sm_rounded_corners_simple.tga" + image_hover_selected="sm_rounded_corners_simple.tga" + image_hover_unselected="sm_rounded_corners_simple.tga" + image_selected="sm_rounded_corners_simple.tga" + image_unselected="sm_rounded_corners_simple.tga" + layout="topleft" + left_pad="313" + mouse_opaque="false" + name="menubar_search_bevel_bg" + picture_style="true" + top_delta="0" + width="94" /> + <line_editor + bevel_style="none" + border_style="line" + commit_on_focus_lost="false" + follows="right|bottom" + height="11" + label="Search" + layout="topleft" + left_delta="1" + name="search_editor" + tab_group="1" + tool_tip="Search Second Life" + top_delta="4" + width="78" /> + <button + follows="right|bottom" + font="SansSerifSmall" + height="16" + image_disabled="status_search_btn.png" + image_disabled_selected="status_search_btn_pressed.png" + image_selected="status_search_btn_pressed.png" + image_unselected="status_search_btn.png" + layout="topleft" + left_delta="78" + name="search_btn" + picture_style="true" + scale_image="false" + tool_tip="Search Second Life" + top_delta="-4" + width="16" /> + <text + enabled="false" + follows="right|bottom" + halign="center" + height="12" + layout="topleft" + left_delta="-4" + name="stat_btn" + top_delta="3" + width="20" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_teleport_history.xml b/indra/newview/skins/default/xui/en/panel_teleport_history.xml new file mode 100644 index 0000000000000000000000000000000000000000..8f6a2d7648c3b18abf1263ef5b869a9550782d02 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_teleport_history.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel name="Teleport History" bottom="0" height="326" left="0" width="380" + border="true" follows="left|top|right|bottom"> + <scroll_list bottom="0" can_resize="true" column_padding="0" draw_heading="true" + draw_stripes="false" follows="left|top|bottom|right" left="0" + multi_select="false" name="history_items" search_column="1" + sort_column="1" height="326" width="380" > + <column name="landmark_icon" width="20" /> + <column dynamicwidth="true" label="Region" name="region" /> + <column name="index" width="0" /> + </scroll_list> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_world_map.xml b/indra/newview/skins/default/xui/en/panel_world_map.xml new file mode 100644 index 0000000000000000000000000000000000000000..532f487780c52525dd0c39b6a366282522dafbe5 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_world_map.xml @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + follows="left|top|right|bottom" + height="300" + layout="topleft" + name="world_map" + width="400"> + <panel.string + name="Loading"> + Loading... + </panel.string> + <panel.string + name="InvalidLocation"> + Invalid Location + </panel.string> + <panel.string + name="world_map_north"> + N + </panel.string> + <panel.string + name="world_map_east"> + E + </panel.string> + <panel.string + name="world_map_west"> + W + </panel.string> + <panel.string + name="world_map_south"> + S + </panel.string> + <panel.string + name="world_map_southeast"> + SE + </panel.string> + <panel.string + name="world_map_northeast"> + NE + </panel.string> + <panel.string + name="world_map_southwest"> + SW + </panel.string> + <panel.string + name="world_map_northwest"> + NW + </panel.string> + <text + type="string" + length="1" + label="N" + layout="topleft" + name="floater_map_north" + text="N" + text_color="1 1 1 0.7"> + N + </text> + <text + type="string" + length="1" + label="E" + layout="topleft" + name="floater_map_east" + text="E" + text_color="1 1 1 0.7"> + E + </text> + <text + type="string" + length="1" + label="W" + layout="topleft" + name="floater_map_west" + text="W" + text_color="1 1 1 0.7"> + W + </text> + <text + type="string" + length="1" + label="S" + layout="topleft" + name="floater_map_south" + text="S" + text_color="1 1 1 0.7"> + S + </text> + <text + type="string" + length="1" + label="SE" + layout="topleft" + name="floater_map_southeast" + text="SE" + text_color="1 1 1 0.7"> + SE + </text> + <text + type="string" + length="1" + label="NE" + layout="topleft" + name="floater_map_northeast" + text="NE" + text_color="1 1 1 0.7"> + NE + </text> + <text + type="string" + length="1" + label="SW" + layout="topleft" + name="floater_map_southwest" + text="SW" + text_color="1 1 1 0.7"> + SW + </text> + <text + type="string" + length="1" + label="NW" + layout="topleft" + name="floater_map_northwest" + text="NW" + text_color="1 1 1 0.7"> + NW + </text> +</panel> diff --git a/indra/newview/skins/default/xui/en/role_actions.xml b/indra/newview/skins/default/xui/en/role_actions.xml new file mode 100644 index 0000000000000000000000000000000000000000..b89a975430a4792364138a87ce1d709d5bf38811 --- /dev/null +++ b/indra/newview/skins/default/xui/en/role_actions.xml @@ -0,0 +1,187 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<role_actions> + <action_set + description="These Abilities include powers to add and remove group Members, and allow new Members to join without an invitation." + name="Membership"> + <action description="Invite People to this Group" + longdescription="Invite People to this Group using the 'Invite New Person...' button in the Members & Roles tab > Members sub-tab." + name="member invite" value="1" /> + <action description="Eject Members from this Group" + longdescription="Eject Members from this Group using the 'Eject From Group' button in the Members & Roles tab > Members sub-tab. An Owner can eject anyone except another Owner. If you're not an Owner, a Member can be ejected from a group if, and only if, they're only in the Everyone Role, and NO other Roles. To remove Members from Roles, you need to have the 'Remove Members from Roles' Ability." + name="member eject" value="2" /> + <action + description="Toggle 'Open Enrollment' and change 'Signup Fee'" + longdescription="Toggle 'Open Enrollment' to let new Members join without an invitation, and change 'Signup Fee' in the Group Preferences section of the General tab." + name="member options" value="3" /> + </action_set> + <action_set + description="These Abilities include powers to add, remove, and change group Roles, add and remove Members in Roles, and assign Abilities to Roles." + name="Roles"> + <action description="Create new Roles" + longdescription="Create new Roles in the Members & Roles tab > Roles sub-tab." + name="role create" value="4" /> + <action description="Delete Roles" + longdescription="Delete Roles in the Members & Roles tab > Roles sub-tab." + name="role delete" value="5" /> + <action description="Change Role names, titles, descriptions, and whether Role members are publicly visible" + longdescription="Change Role names, titles, descriptions, and whether Role members are publicly visible. This is done at the bottom of the the Members & Roles tab > Roles sub-tab after selecting a Role." + name="role properties" value="6" /> + <action description="Assign Members to Assigner's Roles" + longdescription="Assign Members to Roles in the Assigned Roles section of the Members & Roles tab > Members sub-tab. A Member with this Ability can only add Members to a Role the assigner is already in." + name="role assign member limited" value="7" /> + <action description="Assign Members to Any Role" + longdescription="Assign Members to Any Role in the Assigned Roles section of the Members & Roles tab > Members sub-tab. *WARNING* Any Member in a Role with this Ability can assign themselves--and any other non-Owner Member--to Roles that have more powers than they currently have, potentially elevating themselves to near-Owner power. Be sure you know what you're doing before assigning this Ability." + name="role assign member" value="8" /> + <action description="Remove Members from Roles" + longdescription="Remove Members from Roles in the Assigned Roles section of the Members & Roles tab > Members sub-tab. Owners can't be removed." + name="role remove member" value="9" /> + <action description="Assign and Remove Abilities in Roles" + longdescription="Assign and Remove Abilities in Roles in the Allowed Abilities section of the Members & Roles tab > Roles sub-tab. *WARNING* Any Member in a Role with this Ability can assign themselves--and any other non-Owner Member--all Abilities, potentially elevating themselves to near-Owner power. Be sure you know what you're doing before assigning this Ability." + name="role change actions" value="10" /> + </action_set> + <action_set + description="These Abilities include powers to modify this group's identity, such as changing public visibility, charter, and insignia." + name="Group Identity"> + <action + description="Change Charter, Insignia, and 'Show in search'" + longdescription="Change Charter, Insignia, and 'Show in search'. This is done in the General tab." + name="group change identity" value="11" /> + </action_set> + <action_set + description="These Abilities include powers to deed, modify, and sell land in this group's land holdings. To get to the About Land window, right-click the ground and select 'About Land...', or click the parcel info in the menu bar." + name="Parcel Management"> + <action description="Deed land and buy land for group" + longdescription="Deed land and buy land for group. This is done in About Land > General tab." + name="land deed" value="12" /> + <action description="Abandon land to Governor Linden" + longdescription="Abandon land to Governor Linden. *WARNING* Any Member in a Role with this Ability can abandon group-owned land in About Land > General tab, reverting it to Linden ownership without a sale! Be sure you know what you're doing before assigning this Ability." + name="land release" value="13" /> + <action description="Set land for sale info" + longdescription="Set land for sale info. *WARNING* Any Member in a Role with this Ability can sell group-owned land in About Land > General tab as they wish! Be sure you know what you're doing before assigning this Ability." + name="land set sale info" value="14" /> + <action description="Subdivide and join parcels" + longdescription="Subdivide and join parcels. This is done by right-clicking the ground, 'Edit Terrain', and dragging your mouse on the land to make a selection. To subdivide, select what you want to split and click 'Subdivide...'. To join, select two or more contiguous parcels and click 'Join...'. " + name="land divide join" value="15" /> + </action_set> + <action_set + description="These Abilities include powers to change the parcel name and publish settings, Find directory visibility, and landing point & TP routing options." + name="Parcel Identity"> + <action description="Toggle 'Show in Find Places' and set category" + longdescription="Toggle 'Show in Find Places' and setting a parcel's category in About Land > Options tab." + name="land find places" value="17" /> + <action + description="Change parcel name, description, and 'Show in search' settings" + longdescription="Change parcel name, description, and 'Show in search' settings. This is done in About Land > Options tab." + name="land change identity" value="18" /> + <action description="Set landing point and set teleport routing" + longdescription="On a group-owned parcel, Members in a Role with this Ability can set a landing point to specify where incoming teleports arrive, and also set teleport routing for further control. This is done in About Land > Options tab." + name="land set landing point" value="19" /> + </action_set> + <action_set + description="These Abilities include powers which affect parcel options, such as 'Create Objects', 'Edit Terrain', and music & media settings." + name="Parcel Settings"> + <action description="Change music & media settings" + longdescription="Change streaming music and movie settings in About Land > Media tab." + name="land change media" value="20" /> + <action description="Toggle 'Edit Terrain'" + longdescription="Toggle 'Edit Terrain'. *WARNING* About Land > Options tab > Edit Terrain allows anyone to terraform your land's shape, and place and move Linden plants. Be sure you know what you're doing before assigning this Ability. Editing terrain is toggled in About Land > Options tab." + name="land edit" value="21" /> + <action description="Toggle various About Land > Options settings" + longdescription="Toggle 'Safe (no damage)', 'Fly', and allow other Residents to: 'Create Objects', 'Edit Terrain', 'Create Landmarks', and 'Run Scripts' on group-owned land in About Land > Options tab." + name="land options" value="22" /> + </action_set> + <action_set + description="These Abilities include powers which allow Members to bypass restrictions on group-owned parcels." + name="Parcel Powers"> + <action description="Always allow 'Edit Terrain'" + longdescription="Members in a Role with this Ability can edit terrain on a group-owned parcel, even if it's turned off in About Land > Options tab." + name="land allow edit land" value="23" /> + <action description="Always allow 'Fly'" + longdescription="Members in a Role with this Ability can fly on a group-owned parcel, even if it's turned off in About Land > Options tab." + name="land allow fly" value="24" /> + <action description="Always allow 'Create Objects'" + longdescription="Members in a Role with this Ability can create objects on a group-owned parcel, even if it's turned off in About Land > Options tab." + name="land allow create" value="25" /> + <action description="Always allow 'Create Landmark'" + longdescription="Members in a Role with this Ability can landmark a group-owned parcel, even if it's turned off in About Land > Options tab." + name="land allow landmark" value="26" /> + <action description="Allow 'Set Home to Here' on group land" + longdescription="Members in a Role with this Ability can use World menu > Set Home to Here on a parcel deeded to this group." + name="land allow set home" value="28" /> + </action_set> + <action_set + description="These Abilities include powers to allow or restrict access to group-owned parcels, including freezing and ejecting Residents." + name="Parcel Access"> + <action description="Manage parcel Access lists" + longdescription="Manage parcel Access lists in About Land > Access tab." + name="land manage allowed" value="29" /> + <action description="Manage parcel Ban lists" + longdescription="Manage parcel Ban lists in About Land > Ban tab." + name="land manage banned" value="30" /> + <action description="Change parcel 'Sell passes...' settings" + longdescription="Change parcel 'Sell passes...' settings in About Land > Access tab." + name="land manage passes" value="31" /> + <action description="Eject and freeze Residents on parcels" + longdescription="Members in a Role with this Ability can handle an unwelcome Resident on a group-owned parcel by right-clicking them, More >, and selecting 'Eject...' or 'Freeze...'." + name="land admin" value="32" /> + </action_set> + <action_set + description="These Abilities include powers to allow members to return objects and place and move Linden plants. This is useful for Members to clean up litter and do landscaping, but it should also be used with care, because there's no undo for returning objects." + name="Parcel Content"> + <action description="Return objects owned by group" + longdescription="Return objects on group-owned parcels that are owned by the group in About Land > Objects tab." + name="land return group owned" value="48" /> + <action description="Return objects set to group" + longdescription="Return objects on group-owned parcels that are set to the group in About Land > Objects tab." + name="land return group set" value="33" /> + <action description="Return non-group objects" + longdescription="Return objects on group-owned parcels that are non-group in About Land > Objects tab." + name="land return non group" value="34" /> + <action description="Landscaping using Linden plants" + longdescription="Landscaping ability to place and move Linden trees, plants, and grasses. These items can be found in your inventory's Library > Objects folder or they can be created via the Build button." + name="land gardening" value="35" /> + </action_set> + <action_set + description="These Abilities include powers to deed, modify, and sell group-owned objects. These changes are done in the Edit Tools > General Tab. Right-click an object and Edit to see its settings. " + name="Object Management"> + <action description="Deed objects to group" + longdescription="Deed objects to group in the Edit Tools > General Tab." + name="object deed" value="36" /> + <action description="Manipulate (move, copy, modify) group-owned objects" + longdescription="Manipulate (move, copy, modify) group-owned objects in the Edit Tools > General Tab." + name="object manipulate" value="38" /> + <action description="Set group-owned objects for sale" + longdescription="Set group-owned objects for sale in the Edit Tools > General tab." + name="object set sale" value="39" /> + </action_set> + <action_set + description="These Abilities include powers which require Members to pay group liabilities and receive group dividends, and restrict access to group account history." + name="Accounting"> + <action description="Pay group liabilities and receive group dividends" + longdescription="Members in a Role with this Ability will automatically pay group liabilities and receive group dividends. This means they will receive a portion of group-owned land sales which are distributed daily, as well as contribute towards things like parcel listing fees. " + name="accounting accountable" value="40" /> + </action_set> + <action_set + description="These Abilities include powers to allow Members to send, receive, and view group Notices." + name="Notices"> + <action description="Send Notices" + longdescription="Members in a Role with this Ability can send Notices in Group Information > Notices tab." + name="notices send" value="42" /> + <action description="Receive Notices and view past Notices" + longdescription="Members in a Role with this Ability can receive Notices and view past Notices in Group Information > Notices tab." + name="notices receive" value="43" /> + </action_set> + <action_set + description="These Abilities include powers to allow or restrict access to group chat sessions and group voice chat." + name="Chat"> + <action description="Join Group Chat" + longdescription="Members in a Role with this Ability can join group chat sessions, for text and voice." + name="join group chat" value="16" /> + <action description="Join Group Voice Chat" + longdescription="Members in a Role with this Ability can join group voice chat sessions. NOTE: The Join Group Chat ability is required to access the voice chat session." + name="join voice chat" value="27" /> + <action description="Moderate Group Chat" + longdescription="Members in a Role with this Ability can control access and participation in group voice and text chat sessions." + name="moderate group chat" value="37" /> + </action_set> +</role_actions> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml new file mode 100644 index 0000000000000000000000000000000000000000..58bb16581a95a00ab4968476cc8108f482982469 --- /dev/null +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -0,0 +1,788 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- This file contains strings that used to be hardcoded in the source. + It is only for those strings which do not belong in a floater. + For example, the strings used in avatar chat bubbles, and strings + that are returned from one component and may appear in many places--> +<strings> + + <!-- Default Args - these arguments will be replaced in all strings --> + <string name="SECOND_LIFE">Second Life</string> + <string name="SECOND_LIFE_VIEWER">Second Life</string> + <string name="SECOND_LIFE_GRID">Second Life</string> + <string name="SECOND_LIFE_SUPPORT">Second Life Support Portal</string> + + <!-- starting up --> + <string name="StartupDetectingHardware">Detecting hardware...</string> + <string name="StartupLoading">Loading</string> + <string name="Fullbright">Fullbright (Legacy)</string> + <string name="CacheWaiting">(Loading...)</string> + <string name="CacheNobody">(nobody)</string> + <string name="CacheNone">(none)</string> + <!-- Login --> + <string name="LoginInProgress">Logging in. [SECOND_LIFE_VIEWER] may appear frozen. Please wait.</string> + <string name="LoginInProgressNoFrozen">Logging in...</string> + <string name="LoginAuthenticating">Authenticating</string> + <string name="LoginMaintenance">Performing account maintenance...</string> + <string name="LoginAttempt">Previous login attempt failed. Logging in, attempt [NUMBER]</string> + <string name="LoginPrecaching">Loading world...</string> + <string name="LoginInitializingBrowser">Initializing embedded web browser...</string> + <string name="LoginInitializingMultimedia">Initializing multimedia...</string> + <string name="LoginInitializingFonts">Loading fonts...</string> + <string name="LoginVerifyingCache">Verifying cache files (can take 60-90 seconds)...</string> + <string name="LoginProcessingResponse">Processing Response...</string> + <string name="LoginInitializingWorld">Initializing World...</string> + <string name="LoginDecodingImages">Decoding images...</string> + <string name="LoginInitializingQuicktime">Initializing QuickTime...</string> + <string name="LoginQuicktimeNotFound">QuickTime not found - unable to initialize.</string> + <string name="LoginQuicktimeOK">QuickTime initialized successfully.</string> + <string name="LoginWaitingForRegionHandshake">Waiting for region handshake...</string> + <string name="LoginConnectingToRegion">Connecting to region...</string> + <string name="LoginDownloadingClothing">Downloading clothing...</string> + <string name="LoginFailedNoNetwork">Network Error: Could not establish connection, please check your network connection.</string> + <string name="Quit">Quit</string> + <string name="create_account_url">http://secondlife.com/registration/</string> + + <!-- Disconnection --> + <string name="AgentLostConnection">This region may be experiencing trouble. Please check your connection to the Internet.</string> + + + <!-- Tooltip, llhoverview.cpp --> + <string name="TooltipPerson">Person</string><!-- Object under mouse pointer is an avatar --> + <string name="TooltipNoName">(no name)</string> <!-- No name on an object --> + <string name="TooltipOwner">Owner:</string> <!-- Owner name follows --> + <string name="TooltipPublic">Public</string> <!-- Public permissions on an object --> + <string name="TooltipIsGroup">(Group)</string> <!-- The name before this text is that of a group --> + <string name="TooltipFlagScript">Script</string> + <string name="TooltipFlagPhysics">Physics</string> + <string name="TooltipFlagTouch">Touch</string> + <string name="TooltipFlagL$">L$</string> + <string name="TooltipFlagDropInventory">Drop Inventory</string> + <string name="TooltipFlagPhantom">Phantom</string> + <string name="TooltipFlagTemporary">Temporary</string> + <string name="TooltipFlagRightClickMenu">(Right-click for menu)</string> + <string name="TooltipFreeToCopy">Free to copy</string> + <string name="TooltipForSaleL$">For Sale: L$[AMOUNT]</string> <!-- L$ version --> + <string name="TooltipForSaleMsg">For Sale: [MESSAGE]</string> <!-- Message (RetrievingData) --> + <string name="TooltipFlagGroupBuild">Group Build</string> + <string name="TooltipFlagNoBuild">No Build</string> + <string name="TooltipFlagNoEdit">Group Build</string> + <string name="TooltipFlagNotSafe">Not Safe</string><!-- damage area --> + <string name="TooltipFlagNoFly">No Fly</string> + <string name="TooltipFlagGroupScripts">Group Scripts</string> + <string name="TooltipFlagNoScripts">No Scripts</string> + <string name="TooltipLand">Land:</string> + <string name="TooltipMustSingleDrop">Only a single item can be dragged here</string> + <string name="TooltipAltLeft">Alt-Left arrow for previous tab</string> + <string name="TooltipAltRight">Alt-Right arrow for next tab</string> + + <!-- ButtonToolTips, llfloater.cpp --> + <string name="BUTTON_CLOSE_DARWIN">Close (Cmd-W)</string> + <string name="BUTTON_CLOSE_WIN">Close (Ctrl-W)</string> + <string name="BUTTON_RESTORE">Restore</string> + <string name="BUTTON_MINIMIZE">Minimize</string> + <string name="BUTTON_TEAR_OFF">Tear Off</string> + <string name="BUTTON_EDIT">Edit</string> + + <!-- searching - generic --> + <string name="Searching">Searching...</string> + <string name="NoneFound">None found.</string> + + <!-- Indicates that an avatar name or other similar datum is being retrieved. General usage. --> + <string name="RetrievingData">Retrieving...</string> + + <string name="ReleaseNotes">Release Notes</string> + <string name="RELEASE_NOTES_BASE_URL">http://secondlife.com/app/releasenotes/</string> + + <!-- Indicates something is being loaded. Maybe should be merged with RetrievingData --> + <string name="LoadingData">Loading...</string> + + + <!-- namecache --> + <!-- Avatar name: text shown for LLUUID::null --> + <string name="AvatarNameNobody">(nobody)</string> + + <!-- Avatar name: text shown while fetching name --> + <string name="AvatarNameWaiting">(waiting)</string> + + <!-- Avatar name: text shown as an alternative to AvatarNameFetching, easter egg. --> + <string name="AvatarNameHippos">(hippos)</string> + + <!-- Group name: text shown for LLUUID::null --> + <string name="GroupNameNone">(none)</string> + + <!-- Asset errors. Used in llassetstorage.cpp, translation from error code to error message. --> + <string name="AssetErrorNone">No error</string> + <string name="AssetErrorRequestFailed">Asset request: failed</string> + <string name="AssetErrorNonexistentFile">Asset request: non-existent file</string> + <string name="AssetErrorNotInDatabase">Asset request: asset not found in database</string> + <string name="AssetErrorEOF">End of file</string> + <string name="AssetErrorCannotOpenFile">Cannot open file</string> + <string name="AssetErrorFileNotFound">File not found</string> + <string name="AssetErrorTCPTimeout">File transfer timeout</string> + <string name="AssetErrorCircuitGone">Circuit gone</string> + <string name="AssetErrorPriceMismatch">Viewer and server do not agree on price</string> + <string name="AssetErrorUnknownStatus">Unknown status</string> + + <!-- Asset Type Human Names --> + <string name="texture">texture</string> + <string name="sound">sound</string> + <string name="calling card">calling card</string> + <string name="landmark">landmark</string> + <string name="legacy script">legacy script</string> + <string name="clothing">clothing</string> + <string name="object">object</string> + <string name="note card">note card</string> + <string name="folder">folder</string> + <string name="root">root</string> + <string name="lsl2 script">lsl2 script</string> + <string name="lsl bytecode">lsl bytecode</string> + <string name="tga texture">tga texture</string> + <string name="body part">body part</string> + <string name="snapshot">snapshot</string> + <string name="lost and found">lost and found</string> + <string name="targa image">targa image</string> + <string name="trash">trash</string> + <string name="jpeg image">jpeg image</string> + <string name="animation">animation</string> + <string name="gesture">gesture</string> + <string name="simstate">simstate</string> + <string name="favorite">favorite</string> + + <!-- llvoavatar. Displayed in the avatar chat bubble --> + <string name="AvatarEditingAppearance">(Editing Appearance)</string> + <string name="AvatarAway">Away</string> + <string name="AvatarBusy">Busy</string> + <string name="AvatarMuted">Muted</string> + + <!-- animations --> + <string name="anim_express_afraid">Afraid</string> + <string name="anim_express_anger">Angry</string> + <string name="anim_away">Away</string> + <string name="anim_backflip">Backflip</string> + <string name="anim_express_laugh">Belly Laugh</string> + <string name="anim_express_toothsmile">BigSmile</string> + <string name="anim_blowkiss">Blow Kiss</string> + <string name="anim_express_bored">Bored</string> + <string name="anim_bow">Bow</string> + <string name="anim_clap">Clap</string> + <string name="anim_courtbow">Court Bow</string> + <string name="anim_express_cry">Cry</string> + <string name="anim_dance1">Dance 1</string> + <string name="anim_dance2">Dance 2</string> + <string name="anim_dance3">Dance 3</string> + <string name="anim_dance4">Dance 4</string> + <string name="anim_dance5">Dance 5</string> + <string name="anim_dance6">Dance 6</string> + <string name="anim_dance7">Dance 7</string> + <string name="anim_dance8">Dance 8</string> + <string name="anim_express_disdain">Disdain</string> + <string name="anim_drink">Drink</string> + <string name="anim_express_embarrased">Embarrassed</string> + <string name="anim_angry_fingerwag">Finger Wag</string> + <string name="anim_fist_pump">Fist Pump</string> + <string name="anim_yoga_float">Floating Yoga</string> + <string name="anim_express_frown">Frown</string> + <string name="anim_impatient">Impatient</string> + <string name="anim_jumpforjoy">Jump For Joy</string> + <string name="anim_kissmybutt">Kiss My Butt</string> + <string name="anim_express_kiss">Kiss</string> + <string name="anim_laugh_short">Laugh</string> + <string name="anim_musclebeach">Muscle Beach</string> + <string name="anim_no_unhappy">No (Unhappy)</string> + <string name="anim_no_head">No</string> + <string name="anim_nyanya">Nya-nya-nya</string> + <string name="anim_punch_onetwo">One-Two Punch</string> + <string name="anim_express_open_mouth">Open Mouth</string> + <string name="anim_peace">Peace</string> + <string name="anim_point_you">Point at Other</string> + <string name="anim_point_me">Point at Self</string> + <string name="anim_punch_l">Punch Left</string> + <string name="anim_punch_r">Punch Right</string> + <string name="anim_rps_countdown">RPS count</string> + <string name="anim_rps_paper">RPS paper</string> + <string name="anim_rps_rock">RPS rock</string> + <string name="anim_rps_scissors">RPS scissors</string> + <string name="anim_express_repulsed">Repulsed</string> + <string name="anim_kick_roundhouse_r">Roundhouse Kick</string> + <string name="anim_express_sad">Sad</string> + <string name="anim_salute">Salute</string> + <string name="anim_shout">Shout</string> + <string name="anim_express_shrug">Shrug</string> + <string name="anim_express_smile">Smile</string> + <string name="anim_smoke_idle">Smoke Idle</string> + <string name="anim_smoke_inhale">Smoke Inhale</string> + <string name="anim_smoke_throw_down">Smoke Throw Down</string> + <string name="anim_express_surprise">Surprise</string> + <string name="anim_sword_strike_r">Sword Strike</string> + <string name="anim_angry_tantrum">Tantrum</string> + <string name="anim_express_tongue_out">TongueOut</string> + <string name="anim_hello">Wave</string> + <string name="anim_whisper">Whisper</string> + <string name="anim_whistle">Whistle</string> + <string name="anim_express_wink">Wink</string> + <string name="anim_wink_hollywood">Wink (Hollywood)</string> + <string name="anim_express_worry">Worry</string> + <string name="anim_yes_happy">Yes (Happy)</string> + <string name="anim_yes_head">Yes</string> + + <string name="texture_loading">Loading...</string> + <string name="worldmap_offline">Offline</string> + + <!-- animations uploading status codes --> + <string name="Ok">OK</string> + <string name="Premature end of file">Premature end of file</string> + <string name="ST_NO_JOINT">Can't find ROOT or JOINT.</string> + + <!-- Chat --> + <string name="whisper">whispers:</string> + <string name="shout">shouts:</string> + <string name="ringing">Connecting to in-world Voice Chat...</string> + <string name="connected">Connected</string> + <string name="unavailable">Voice not available at your current location</string> + <string name="hang_up">Disconnected from in-world Voice Chat</string> + <string name="ScriptQuestionCautionChatGranted">'[OBJECTNAME]', an object owned by '[OWNERNAME]', located in [REGIONNAME] at [REGIONPOS], has been granted permission to: [PERMISSIONS].</string> + <string name="ScriptQuestionCautionChatDenied">'[OBJECTNAME]', an object owned by '[OWNERNAME]', located in [REGIONNAME] at [REGIONPOS], has been denied permission to: [PERMISSIONS].</string> + <string name="ScriptTakeMoney">Take Linden dollars (L$) from you</string> + <string name="ActOnControlInputs">Act on your control inputs</string> + <string name="RemapControlInputs">Remap your control inputs</string> + <string name="AnimateYourAvatar">Animate your avatar</string> + <string name="AttachToYourAvatar">Attach to your avatar</string> + <string name="ReleaseOwnership">Release ownership and become public</string> + <string name="LinkAndDelink">Link and delink from other objects</string> + <string name="AddAndRemoveJoints">Add and remove joints with other objects</string> + <string name="ChangePermissions">Change its permissions</string> + <string name="TrackYourCamera">Track your camera</string> + <string name="ControlYourCamera">Control your camera</string> + + <!-- IM --> + <string name="IM_logging_string">-- Instant message logging enabled --</string> + + <!-- Sim Access labels --> + <string name="SIM_ACCESS_PG">PG</string> + <string name="SIM_ACCESS_MATURE">Mature</string> + <string name="SIM_ACCESS_ADULT">Adult</string> + <string name="SIM_ACCESS_DOWN">Offline</string> + <string name="SIM_ACCESS_MIN">Unknown</string> + + <!-- For use when we do not have land type back from the server --> + <string name="land_type_unknown">(unknown)</string> + + <!-- File load/save dialogs --> + <string name="all_files">All Files</string> + <string name="sound_files">Sounds</string> + <string name="animation_files">Animations</string> + <string name="image_files">Images</string> + <string name="save_file_verb">Save</string> + <string name="load_file_verb">Load</string> + <string name="targa_image_files">Targa Images</string> + <string name="bitmap_image_files">Bitmap Images</string> + <string name="avi_movie_file">AVI Movie File</string> + <string name="xaf_animation_file">XAF Anim File</string> + <string name="xml_file">XML File</string> + <string name="dot_raw_file">RAW File</string> + <string name="compressed_image_files">Compressed Images</string> + <string name="load_files">Load Files</string> + <string name="choose_the_directory">Choose Directory</string> + + <!-- Avatar busy/away mode --> + <string name="AvatarSetNotAway">Set Not Away</string> + <string name="AvatarSetAway">Set Away</string> + <string name="AvatarSetNotBusy">Set Not Busy</string> + <string name="AvatarSetBusy">Set Busy</string> + + <!-- Wearable Types --> + <string name="shape">Shape</string> + <string name="skin">Skin</string> + <string name="hair">Hair</string> + <string name="eyes">Eyes</string> + <string name="shirt">Shirt</string> + <string name="pants">Pants</string> + <string name="shoes">Shoes</string> + <string name="socks">Socks</string> + <string name="jacket">Jacket</string> + <string name="gloves">Gloves</string> + <string name="undershirt">Undershirt</string> + <string name="underpants">Underpants</string> + <string name="skirt">Skirt</string> + <string name="alpha">Alpha</string> + <string name="tattoo">Tattoo</string> + <string name="invalid">invalid</string> + + <!-- notify --> + <string name="next">Next</string> + <string name="ok">OK</string> + <string name="GroupNotifyGroupNotice">Group Notice</string> + <string name="GroupNotifyGroupNotices">Group Notices</string> + <string name="GroupNotifySentBy">Sent by</string> + <string name="GroupNotifyAttached">Attached:</string> + <string name="GroupNotifyViewPastNotices">View past notices or opt-out of receiving these messages here.</string> + <string name="GroupNotifyOpenAttachment">Open Attachment</string> + <string name="GroupNotifySaveAttachment">Save Attachment</string> + + <!-- body parts --> + <string name="BodyPartsRightArm">Right Arm</string> + <string name="BodyPartsHead">Head</string> + <string name="BodyPartsLeftArm">Left Arm</string> + <string name="BodyPartsLeftLeg">Left Leg</string> + <string name="BodyPartsTorso">Torso</string> + <string name="BodyPartsRightLeg">Right Leg</string> + + <!-- slider --> + <string name="GraphicsQualityLow">Low</string> + <string name="GraphicsQualityMid">Mid</string> + <string name="GraphicsQualityHigh">High</string> + + <!-- mouselook --> + <string name="LeaveMouselook">Press ESC to leave Mouselook.</string> + + <!-- inventory --> + <string name="InventoryNoMatchingItems">No matching items found in inventory.</string> + <string name="InventoryNoTexture"> + You do not have a copy of +this texture in your inventory + </string> + <string name="no_transfer"> (no transfer)</string> + <string name="no_modify"> (no modify)</string> + <string name="no_copy"> (no copy)</string> + <string name="worn"> (worn)</string> + <string name="LoadingContents">Loading contents...</string> + <string name="NoContents">No contents</string> + + <!-- Gestures labels --> + <string name="Chat"> Chat : </string> + <string name="Sound"> Sound : </string> + <string name="Wait"> --- Wait : </string> + <string name="AnimFlagStop"> Stop Animation : </string> + <string name="AnimFlagStart"> Start Animation : </string> + <string name="Wave"> Wave </string> + <string name="HelloAvatar"> Hello, avatar! </string> + + <!-- inventory filter --> + <string name="Animations"> Animations,</string> + <string name="Calling Cards"> Calling Cards,</string> + <string name="Clothing"> Clothing,</string> + <string name="Gestures"> Gestures,</string> + <string name="Landmarks"> Landmarks,</string> + <string name="Notecards"> Notecards,</string> + <string name="Objects"> Objects,</string> + <string name="Scripts"> Scripts,</string> + <string name="Sounds"> Sounds,</string> + <string name="Textures"> Textures,</string> + <string name="Snapshots"> Snapshots,</string> + <string name="No Filters"> No </string> + <string name="Since Logoff"> - Since Logoff</string> + + <!-- inventory folder --> + <string name="InvFolder My Inventory">My Inventory</string> + <string name="InvFolder My Favorites">My Favorites</string> + <string name="InvFolder Library">Library</string> + <string name="InvFolder Textures">Textures</string> + <string name="InvFolder Sounds">Sounds</string> + <string name="InvFolder Calling Cards">Calling Cards</string> + <string name="InvFolder Landmarks">Landmarks</string> + <string name="InvFolder Scripts">Scripts</string> + <string name="InvFolder Clothing">Clothing</string> + <string name="InvFolder Objects">Objects</string> + <string name="InvFolder Notecards">Notecards</string> + <string name="InvFolder New Folder">New Folder</string> + <string name="InvFolder Inventory">Inventory</string> + <string name="InvFolder Uncompressed Images">Uncompressed Images</string> + <string name="InvFolder Body Parts">Body Parts</string> + <string name="InvFolder Trash">Trash</string> + <string name="InvFolder Photo Album">Photo Album</string> + <string name="InvFolder Lost And Found">Lost And Found</string> + <string name="InvFolder Uncompressed Sounds">Uncompressed Sounds</string> + <string name="InvFolder Animations">Animations</string> + <string name="InvFolder Gestures">Gestures</string> + <string name="InvFolder favorite">Favorites</string> + + <!-- inventory FVBridge --> + <string name="NO_COPY"> (no copy)</string> + <string name="NO_MOD"> (no modify)</string> + <string name="NO_XFER"> (no transfer)</string> + + <string name="Buy">Buy</string> + <string name="BuyforL$">Buy for L$</string> + + <string name="Stone">Stone</string> + <string name="Metal">Metal</string> + <string name="Glass">Glass</string> + <string name="Wood">Wood</string> + <string name="Flesh">Flesh</string> + <string name="Plastic">Plastic</string> + <string name="Rubber">Rubber</string> + <string name="Light">Light</string> + + <!-- keyboard --> + <string name="KBShift">Shift</string> + <string name="KBCtrl">Ctrl</string> + + <!-- Avatar Skeleton --> + <string name="Chest">Chest</string> + <string name="Skull">Skull</string> + <string name="Left Shoulder">Left Shoulder</string> + <string name="Right Shoulder">Right Shoulder</string> + <string name="Left Hand">Left Hand</string> + <string name="Right Hand">Right Hand</string> + <string name="Left Foot">Left Foot</string> + <string name="Right Foot">Right Foot</string> + <string name="Spine">Spine</string> + <string name="Pelvis">Pelvis</string> + <string name="Mouth">Mouth</string> + <string name="Chin">Chin</string> + <string name="Left Ear">Left Ear</string> + <string name="Right Ear">Right Ear</string> + <string name="Left Eyeball">Left Eyeball</string> + <string name="Right Eyeball">Right Eyeball</string> + <string name="Nose">Nose</string> + <string name="R Upper Arm">R Upper Arm</string> + <string name="R Forearm">R Forearm</string> + <string name="L Upper Arm">L Upper Arm</string> + <string name="L Forearm">L Forearm</string> + <string name="Right Hip">Right Hip</string> + <string name="R Upper Leg">R Upper Leg</string> + <string name="R Lower Leg">R Lower Leg</string> + <string name="Left Hip">Left Hip</string> + <string name="L Upper Leg">L Upper Leg</string> + <string name="L Lower Leg">L Lower Leg</string> + <string name="Stomach">Stomach</string> + <string name="Left Pec">Left Pec</string> + <string name="Right Pec">Right Pec</string> + + <!-- HUD Position --> + <string name="Center 2">Center 2</string> + <string name="Top Right">Top Right</string> + <string name="Top">Top</string> + <string name="Top Left">Top Left</string> + <string name="Center">Center</string> + <string name="Bottom Left">Bottom Left</string> + <string name="Bottom">Bottom</string> + <string name="Bottom Right">Bottom Right</string> + + <!-- compile queue--> + <string name="CompileQueueDownloadedCompiling">Downloaded, now compiling</string> + <string name="CompileQueueScriptNotFound">Script not found on server.</string> + <string name="CompileQueueProblemDownloading">Problem downloading</string> + <string name="CompileQueueInsufficientPermDownload">Insufficient permissions to download a script.</string> + <string name="CompileQueueInsufficientPermFor">Insufficient permissions for</string> + <string name="CompileQueueUnknownFailure">Unknown failure to download</string> + <string name="CompileQueueTitle">Recompilation Progress</string> + <string name="CompileQueueStart">recompile</string> + <string name="ResetQueueTitle">Reset Progress</string> + <string name="ResetQueueStart">reset</string> + <string name="RunQueueTitle">Set Running Progress</string> + <string name="RunQueueStart">set running</string> + <string name="NotRunQueueTitle">Set Not Running Progress</string> + <string name="NotRunQueueStart">set not running</string> + + <!-- compile comment text--> + <string name="CompileSuccessful">Compile successful!</string> + <string name="CompileSuccessfulSaving">Compile successful, saving...</string> + <string name="SaveComplete">Save complete.</string> + <string name="ObjectOutOfRange">Script (object out of range)</string> + + <!-- god tools --> + <string name="GodToolsObjectOwnedBy">Object [OBJECT] owned by [OWNER]</string> + + <!-- groups --> + <string name="GroupsNone">none</string> + <string name="Group"> (group)</string> + <string name="Unknown">(Unknown)</string> + <string name="SummaryForTheWeek">Summary for this week, beginning on </string> + <string name="NextStipendDay">The next stipend day is </string> + <string name="GroupIndividualShare"> Group Individual Share + + </string> + <string name="Balance">Balance</string> + <string name="Credits">Credits</string> + <string name="Debits">Debits</string> + <string name="Total">Total</string> + <string name="NoGroupDataFound">No group data found for group </string> + + <!-- floater IM --> + <string name="IMParentEstate">parent estate</string> + <string name="IMMainland">mainland</string> + <string name="IMTeen">teen</string> + + <!-- floater region info --> + <string name="RegionInfoError">error</string> + <string name="RegionInfoAllEstatesOwnedBy"> + all estates +owned by [OWNER] + </string> + <string name="RegionInfoAllEstatesYouOwn">all estates you owned</string> + <string name="RegionInfoAllEstatesYouManage"> + all estates that +you managed for [OWNER] + </string> + <string name="RegionInfoAllowedResidents">Allowed residents: ([ALLOWEDAGENTS], max [MAXACCESS])</string> + <string name="RegionInfoAllowedGroups">Allowed groups: ([ALLOWEDGROUPS], max [MAXACCESS])</string> + + <!-- script editor --> + <string name="CursorPos">Line [LINE], Column [COLUMN]</string> + + <!-- panel dir browser --> + <string name="PanelDirCountFound">[COUNT] found</string> + <string name="PanelDirTimeStr">[hour12,datetime,slt]:[min,datetime,slt] [ampm,datetime,slt]</string> + + <!-- panel dir events --> + <string name="PanelDirEventsDateText">[mthnum,datetime,slt]/[day,datetime,slt]</string> + + <!-- panel contents --> + <string name="PanelContentsNewScript">New Script</string> + + <!-- panel avatar --> + <!-- <string name="None">None</string> Duplicate--> + + <!-- Mute --> + <string name="MuteByName">(by name)</string> + <string name="MuteAgent">(resident)</string> + <string name="MuteObject">(object)</string> + <string name="MuteGroup">(group)</string> + + <!-- Region/Estate Covenant --> + <string name="RegionNoCovenant">There is no Covenant provided for this Estate.</string> + <string name="RegionNoCovenantOtherOwner">There is no Covenant provided for this Estate. The land on this estate is being sold by the Estate owner, not Linden Lab. Please contact the Estate Owner for sales details.</string> + <string name="covenant_last_modified">Last Modified:</string> + <string name="none_text"> (none) </string> + <string name="never_text"> (never) </string> + + <!--Region Details--> + <string name="GroupOwned">Group Owned</string> + <string name="Public">Public</string> + + <!-- panel classified --> + <string name="ClassifiedClicksTxt">Clicks: [TELEPORT] teleport, [MAP] map, [PROFILE] profile</string> + <string name="ClassifiedUpdateAfterPublish">(will update after publish)</string> + + <!-- group voting dialog --> + <string name="GroupVoteYes">Yes</string> + <string name="GroupVoteNo">No</string> + <string name="GroupVoteNoActiveProposals">There are currently no active proposals</string> + <string name="GroupVoteNoArchivedProposals">There are currently no archived proposals</string> + <string name="GroupVoteRetrievingArchivedProposals">Retrieving archived proposals</string> + <string name="GroupVoteRetrievingActiveProposals">Retrieving active proposals</string> + + <!-- Multi Preview Floater --> + <string name="MultiPreviewTitle">Preview</string> + <string name="MultiPropertiesTitle">Properties</string> + + <!-- inventory offer --> + <string name="InvOfferAnObjectNamed">An object named</string> + <string name="InvOfferOwnedByGroup">owned by the group</string> + <string name="InvOfferOwnedByUnknownGroup">owned by an unknown group</string> + <string name="InvOfferOwnedBy">owned by</string> + <string name="InvOfferOwnedByUnknownUser">owned by an unknown user</string> + <string name="InvOfferGaveYou">gave you</string> + <string name="InvOfferYouDecline">You decline</string> + <string name="InvOfferFrom">from</string> + + <!-- group money --> + <string name="GroupMoneyTotal">Total</string> + <string name="GroupMoneyBought">bought</string> + <string name="GroupMoneyPaidYou">paid you</string> + <string name="GroupMoneyPaidInto">paid into</string> + <string name="GroupMoneyBoughtPassTo">bought pass to</string> + <string name="GroupMoneyPaidFeeForEvent">paid fee for event</string> + <string name="GroupMoneyPaidPrizeForEvent">paid prize for event</string> + <string name="GroupMoneyBalance">Balance</string> + <string name="GroupMoneyCredits">Credits</string> + <string name="GroupMoneyDebits">Debits</string> + + <!-- viewer object --> + <string name="ViewerObjectContents">Contents</string> + + <!-- Viewer menu --> + <string name="AcquiredItems">Acquired Items</string> + <string name="Cancel">Cancel</string> + <string name="UploadingCosts">Uploading %s costs</string> + <string name="UnknownFileExtension"> + Unknown file extension .%s +Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh + </string> + + <!-- Previews --> + <string name="FileSaved">File Saved</string> + <string name="Receiving">Receiving</string> + + <!-- status bar , Time --> + <string name="AM">AM</string> + <string name="PM">PM</string> + <string name="PST">PST</string> + <string name="PDT">PDT</string> + + <!-- Directions, HUD --> + <string name="Forward">Forward</string> + <string name="Left">Left</string> + <string name="Right">Right</string> + <string name="Back">Back</string> + <string name="North">North</string> + <string name="South">South</string> + <string name="West">West</string> + <string name="East">East</string> + <string name="Up">Up</string> + <string name="Down">Down</string> + + <!-- Search Category Strings --> + <string name="Any Category">Any Category</string> + <string name="Shopping">Shopping</string> + <string name="Land Rental">Land Rental</string> + <string name="Property Rental">Property Rental</string> + <string name="Special Attraction">Special Attraction</string> + <string name="New Products">New Products</string> + <string name="Employment">Employment</string> + <string name="Wanted">Wanted</string> + <string name="Service">Service</string> + <string name="Personal">Personal</string> + + <!-- PARCEL_CATEGORY_UI_STRING --> + <string name="None">None</string> + <string name="Linden Location">Linden Location</string> + <string name="Adult">Adult</string> + <string name="Arts&Culture">Arts & Culture</string> + <string name="Business">Business</string> + <string name="Educational">Educational</string> + <string name="Gaming">Gaming</string> + <string name="Hangout">Hangout</string> + <string name="Newcomer Friendly">Newcomer Friendly</string> + <string name="Parks&Nature">Parks & Nature</string> + <string name="Residential">Residential</string> + <!--<string name="Shopping">Shopping</string> --> + <string name="Stage">Stage</string> + <string name="Other">Other</string> + <string name="Any">Any</string> + + <!-- puncutations --> + <string name=":">:</string> + <string name=",">,</string> + <string name="...">...</string> + <string name="***">***</string> + <string name="(">(</string> + <string name=")">)</string> + <string name=".">.</string> + <string name="'">'</string> + <string name="---">---</string> + + <!-- OSMessageBox messages --> + <string name="MBCmdLineError"> + An error was found parsing the command line. +Please see: http://wiki.secondlife.com/wiki/Client_parameters +Error: + </string> + <string name="MBCmdLineUsg">[SECOND_LIFE] Command line usage:</string> + <string name="MBUnableToAccessFile"> + [SECOND_LIFE] is unable to access a file that it needs. + +This can be because you somehow have multiple copies running, or your system incorrectly thinks a file is open. +If this message persists, restart your computer and try again. +If it continues to persist, you may need to completely uninstall [SECOND_LIFE] and reinstall it. + </string> + <string name="MBFatalError">Fatal Error</string> + <string name="MBRequiresAltiVec"> [SECOND_LIFE] requires a processor with AltiVec (G4 or later).</string> + <string name="MBAlreadyRunning"> + [SECOND_LIFE] is already running. +Check your task bar for a minimized copy of the program. +If this message persists, restart your computer. + </string> + <string name="MBFrozenCrashed"> + [SECOND_LIFE] appears to have frozen or crashed on the previous run. +Would you like to send a crash report? + </string> + <string name="MBAlert">Alert</string> + <string name="MBNoDirectX"> + [SECOND_LIFE] is unable to detect DirectX 9.0b or greater. +[SECOND_LIFE] uses DirectX to detect hardware and/or outdated drivers that can cause stability problems, poor performance and crashes. While you can run [SECOND_LIFE] without it, we highly recommend running with DirectX 9.0b. + +Do you wish to continue? + </string> + <string name="MBWarning">Warning</string> + <string name="MBNoAutoUpdate"> + Automatic updating is not yet implemented for Linux. +Please download the latest version from www.secondlife.com. + </string> + <string name="MBRegClassFailed">RegisterClass failed</string> + <string name="MBError">Error</string> + <string name="MBFullScreenErr"> + Unable to run fullscreen at [WIDTH] x [HEIGHT]. +Running in window. + </string> + <string name="MBDestroyWinFailed">Shutdown Error while destroying window (DestroyWindow() failed)</string> + <string name="MBShutdownErr">Shutdown Error</string> + <string name="MBDevContextErr">Can't make GL device context</string> + <string name="MBPixelFmtErr">Can't find suitable pixel format</string> + <string name="MBPixelFmtDescErr">Can't get pixel format description</string> + <string name="MBTrueColorWindow"> + [SECOND_LIFE] requires True Color (32-bit) to run in a window. +Please go to Control Panels > Display > Settings and set the screen to 32-bit color. +Alternately, if you choose to run fullscreen, [SECOND_LIFE] will automatically adjust the screen each time it runs. + </string> + <string name="MBAlpha"> + [SECOND_LIFE] is unable to run because it can't get an 8 bit alpha channel. Usually this is due to video card driver issues. +Please make sure you have the latest video card drivers installed. +Also be sure your monitor is set to True Color (32-bit) in Control Panels > Display > Settings. +If you continue to receive this message, contact customer support. + </string> + <string name="MBPixelFmtSetErr">Can't set pixel format</string> + <string name="MBGLContextErr">Can't create GL rendering context</string> + <string name="MBGLContextActErr">Can't activate GL rendering context</string> + <string name="MBVideoDrvErr"> + [SECOND_LIFE] is unable to run because your video card drivers did not install properly, are out of date, or are for unsupported hardware. Please make sure you have the latest video card drivers and even if you do have the latest, try reinstalling them. + +If you continue to receive this message, contact customer support. + </string> + + <!-- Group Information --> + + + <!-- Locale Information --> + <string name="MicrosoftLocale">english</string> + <string name="DarwinLocale">C</string> + <string name="LinuxLocale">C</string> + + <!-- + datetimeToCodes["wkday"] = "%a"; // Thu + datetimeToCodes["weekday"] = "%A"; // Thursday + datetimeToCodes["year4"] = "%Y"; // 2009 + datetimeToCodes["year"] = "%Y"; // 2009 + datetimeToCodes["year2"] = "%y"; // 09 + datetimeToCodes["mth"] = "%b"; // Aug + datetimeToCodes["month"] = "%B"; // August + datetimeToCodes["mthnum"] = "%m"; // 08 + datetimeToCodes["day"] = "%d"; // 31 + datetimeToCodes["hour24"] = "%H"; // 14 + datetimeToCodes["hour"] = "%H"; // 14 + datetimeToCodes["hour12"] = "%I"; // 02 + datetimeToCodes["min"] = "%M"; // 59 + datetimeToCodes["ampm"] = "%p"; // AM + datetimeToCodes["second"] = "%S"; // 59 + datetimeToCodes["timezone"] = "%Z"; // PST + --> + + <string name="TimeHour">hour,datetime,slt</string> + <string name="TimeMin">min,datetime,slt</string> + <string name="TimeYear">year,datetime,slt</string> + <string name="TimeDay">day,datetime,slt</string> + <string name="TimeMonth">mthnum,datetime,slt</string> + <string name="TimeWeek">wkday,datetime,slt</string> + <string name="TimeAMPM">ampm,datetime,slt</string> + <string name="TimeHour12">hour12,datetime,slt</string> + + <string name="LTimeMthNum">mthnum,datetime,local</string> + <string name="LTimeWeek">wkday,datetime,local</string> + <string name="LTimeMonth">mth,datetime,local</string> + <string name="LTimeDay">day,datetime,local</string> + <string name="LTimeSec">second,datetime,local</string> + <string name="LTimeHour">hour,datetime,local</string> + <string name="LTimeMin">min,datetime,local</string> + <string name="LTimeYear">year,datetime,local</string> + <string name="LTimeSec">second,datetime,local</string> + + <string name="UTCTimeWeek">weekday,datetime,utc</string> + <string name="UTCTimeDay">day,datetime,utc</string> + <string name="UTCTimeMth">mth,datetime,utc</string> + <string name="UTCTimeYr">year,datetime,utc</string> + <string name="UTCTimeHr">hour,datetime,utc</string> + <string name="UTCTimeMin">min,datetime,utc</string> + <string name="UTCTimeSec">second,datetime,utc</string> + <string name="UTCTimeTimezone">timezone,datetime,utc</string> +</strings> diff --git a/indra/newview/skins/default/xui/en/teleport_strings.xml b/indra/newview/skins/default/xui/en/teleport_strings.xml new file mode 100644 index 0000000000000000000000000000000000000000..616dc1a1d49fbafc2d5a1f41efb739394f930667 --- /dev/null +++ b/indra/newview/skins/default/xui/en/teleport_strings.xml @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<teleport_messages> + <message_set name="errors"> + <message name="invalid_tport"> + Problem encountered processing your teleport request. You may +need to log back in before you can teleport. If you continue +to get this message, please check the Tech Support FAQ at: +www.secondlife.com/support + </message> + <message name="invalid_region_handoff"> + Problem encountered processing your region crossing. You may +need to log back in before you can cross regions. If you continue +to get this message, please check the Tech Support FAQ at: +www.secondlife.com/support. + </message> + <message name="blocked_tport"> + Sorry, teleport is currently blocked. Try again in a moment. +If you still cannot teleport, please log out and log back in to +resolve the problem. + </message> + <message name="nolandmark_tport"> + Sorry, but system was unable to locate landmark destination. + </message> + <message name="timeout_tport"> + Sorry, but system was unable to complete the teleport connection. +Try again in a moment. + </message> + <message name="noaccess_tport"> + Sorry, you do not have access to that teleport destination. + </message> + <message name="missing_attach_tport"> + Your attachments have not arrived yet. Try waiting for a few +more seconds or log out and back in again before attempting +to teleport. + </message> + <message name="too_many_uploads_tport"> + The asset queue in this region is currently clogged so your teleport +request will not be able to succeed in a timely manner. Please try again +in a few minutes or go to a less busy area. + </message> + <message name="expired_tport"> + Sorry, but the system was unable to complete your teleport request +in a timely fashion. Please try again in a few minutes. + </message> + <message name="expired_region_handoff"> + Sorry, but the system was unable to complete your region crossing +in a timely fashion. Please try again in a few minutes. + </message> + <message name="no_host"> + Unable to find teleport destination. The destination may be +temporarily unavailable or no longer exists. Please try again +in a few minutes. + </message> + <message name="no_inventory_host"> + The inventory system is currently unavailable. + </message> + </message_set> + <message_set name="progress"> + <message name="sending_dest"> + Sending to destination. + </message> + <message name="redirecting"> + Redirecting to different location. + </message> + <message name="relaying"> + Relaying to destination. + </message> + <message name="sending_home"> + Sending home location request. + </message> + <message name="sending_landmark"> + Sending landmark location request. + </message> + <message name="completing"> + Completing teleport. + </message> + <message name="resolving"> + Resolving destination. + </message> + <message name="contacting"> + Contacting new region. + </message> + <message name="arriving"> + Arriving... + </message> + <message name="requesting"> + Requesting Teleport... + </message> + </message_set> +</teleport_messages> diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml new file mode 100644 index 0000000000000000000000000000000000000000..a1e074fae2e00f84359201d3cf4da2fd944cac6d --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/button.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<button image_unselected="button_enabled_32x128.tga" + image_selected="button_enabled_selected_32x128.tga" + image_disabled_selected="button_disabled_32x128.tga" + image_disabled="button_disabled_32x128.tga" + label_color="ButtonLabelColor" + label_color_selected="ButtonLabelSelectedColor" + label_color_disabled="ButtonLabelDisabledColor" + label_color_disabled_selected="ButtonLabelSelectedDisabledColor" + highlight_color="ButtonUnselectedFgColor" + image_color="ButtonImageColor" + image_color_disabled="ButtonImageColor" + flash_color="ButtonFlashBgColor" + hover_glow_amount="0.15" + halign="center" + scale_image="true"> +</button> diff --git a/indra/newview/skins/default/xui/en/widgets/check_box.xml b/indra/newview/skins/default/xui/en/widgets/check_box.xml new file mode 100644 index 0000000000000000000000000000000000000000..ff01dcebd8ac1cb038d99445b8e7b133b83ec265 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/check_box.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<check_box text_enabled_color="LabelTextColor" + text_disabled_color="LabelDisabledColor" + font="SansSerifSmall" + follows="left|top"> + <check_box.label_text name="checkbox label"/> + <check_box.check_button name="CheckboxCtrl Button" + commit_on_return="false" + label="" + is_toggle="true" + hover_glow_amount="0.35" + font="SansSerif" + scale_image="false" + image_unselected="checkbox_enabled_false.tga" + image_selected="checkbox_enabled_true.tga" + image_disabled="checkbox_disabled_false.tga" + image_disabled_selected="checkbox_disabled_true.tga"/> +</check_box> diff --git a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml new file mode 100644 index 0000000000000000000000000000000000000000..304eda2d9706c1f738a7db3dfeeb985b0f8e9308 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<color_swatch alpha_background_image="color_swatch_alpha.tga" + border_color="DefaultHighlightLight" + name="color_swatch"> + <color_swatch.caption_text name="caption" + font="SansSerifSmall" + follows="left|right|bottom"/> + <color_swatch.border name="border" + bevel_type="in"/> +</color_swatch> diff --git a/indra/newview/skins/default/xui/en/widgets/combo_box.xml b/indra/newview/skins/default/xui/en/widgets/combo_box.xml new file mode 100644 index 0000000000000000000000000000000000000000..8a8f3f7f2c2fb0ae3b126b0c54e48fefda3c9878 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/combo_box.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<combo_box font="SansSerifSmall" + arrow_image="combobox_arrow.tga" + list_position="below" + max_chars="20" + follows="left|top"> + <combo_box.combo_button name="Combobox Button" + hover_glow_amount="0.15" + font="SansSerifSmall" + halign="left" + scale_image="true" + 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"/> + <combo_box.combo_list bg_writeable_color="white"/> + <combo_box.combo_editor name="Combo Text Entry" + select_on_focus="true" + font="SansSerifSmall"/> +</combo_box> diff --git a/indra/newview/skins/default/xui/en/widgets/drop_down.xml b/indra/newview/skins/default/xui/en/widgets/drop_down.xml new file mode 100644 index 0000000000000000000000000000000000000000..c35d15ec923c8da82eca44b0f3fa5c9e0a01c4d7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/drop_down.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<drop_down text_enabled_color="LabelTextColor" + text_disabled_color="LabelDisabledColor" + font="SansSerifSmall" + allow_text_entry="false" + follows="left|top"> + <drop_down.combo_button name="Combobox Button" + hover_glow_amount="0.15" + font="SansSerifSmall" + halign="left" + scale_image="true" + 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"/> + <drop_down.combo_list bg_writeable_color="white"/> + <drop_down.combo_editor name="Combo Text Entry" visible="false" select_on_focus="true"/> +</drop_down> diff --git a/indra/newview/skins/default/xui/en/widgets/flyout_button.xml b/indra/newview/skins/default/xui/en/widgets/flyout_button.xml new file mode 100644 index 0000000000000000000000000000000000000000..e0033058c8e3301cdcc99f50a8846c1dd403a18e --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/flyout_button.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<flyout_button list_position="below"> + <action_button scale_image="true" + image_selected="flyout_btn_left_selected.tga" + image_unselected="flyout_btn_left.tga" + image_disabled="flyout_btn_left_disabled.tga"/> + <combo_button image_selected="flyout_btn_right_selected.tga" + image_unselected="flyout_btn_right.tga" + image_disabled="flyout_btn_right_disabled.tga" + pad_right="6" + tab_stop="false"/> +</flyout_button> + diff --git a/indra/newview/skins/default/xui/en/widgets/icon.xml b/indra/newview/skins/default/xui/en/widgets/icon.xml new file mode 100644 index 0000000000000000000000000000000000000000..adb743a628c63def6227e2f8a0307e3db63d30c4 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/icon.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<icon color="1.0 1.0 1.0 1.0" + tab_stop="false" + mouse_opaque="false" + name="icon" + follows="left|top"> +</icon> diff --git a/indra/newview/skins/default/xui/en/widgets/line_editor.xml b/indra/newview/skins/default/xui/en/widgets/line_editor.xml new file mode 100644 index 0000000000000000000000000000000000000000..11081ae30818acef35c0a93ffc149c391ed9975b --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/line_editor.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<line_editor background_image="sm_rounded_corners_simple.tga" + select_on_focus="false" + handle_edit_keys_directly="false" + commit_on_focus_lost="true" + ignore_tab="true" + cursor_color="TextCursorColor" + text_color="TextFgColor" + text_readonly_color="TextFgReadOnlyColor" + text_tentative_color="TextFgTentativeColor" + bg_readonly_color="TextBgReadOnlyColor" + bg_writeable_color="TextBgWriteableColor" + bg_focus_color="TextBgFocusColor" + mouse_opaque="true" + name="line_editor" + font="SansSerifSmall"> + <line_editor.border bevel_style="in"/> +</line_editor> diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml new file mode 100644 index 0000000000000000000000000000000000000000..32f5a18d1cd3c45c24d0962801afc0d8cf1cd59e --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- +*TODO: Replace hardcoded buttons width/height with getting this info from the button images. + Currently that doesn't work because LLUIImage::getWidth/getHeight() return 1 for the images. +--> +<location_input font="SansSerifSmall" + add_landmark_image_enabled="icon_event_adult.tga" + add_landmark_image_disabled="icon_event.tga" + add_landmark_hpad="4" + allow_text_entry="true" + arrow_image="combobox_arrow.tga" + list_position="below" + show_text_as_tentative="false" + max_chars="20" + follows="left|top"> + <location_input.background name="Background" + visible="true" + label="" + follows="left|top|right" + image_unselected="navbar_bg_center.tga" + image_selected="navbar_bg_center.tga" + image_disabled="navbar_bg_center.tga" + image_disabled_selected="navbar_bg_center.tga" + image_hover_selected="navbar_bg_center.tga" + image_hover_unselected="navbar_bg_center.tga" /> + <location_input.info_button name="Place Information" + label="" + tool_tip="About current location" + width="20" + height="20" + follows="left|top" + image_overlay="map_infohub.tga" + image_unselected="navbar_bg_left.tga" + image_selected="navbar_bg_left.tga" + image_hover_selected="navbar_bg_left.tga" + image_hover_unselected="navbar_bg_left.tga" + image_disabled_selected="navbar_bg_left.tga" + image_disabled="navbar_bg_left.tga" /> + <location_input.add_landmark_button name="Add Landmark" + label="" + width="16" + height="16" + tool_tip="Add to My Landmarks" + follows="right|top" + scale_image="false" /> + <location_input.combo_button name="Location History" + label="" + tool_tip="My Location History" + width="20" + height="20" + image_overlay="navbar_history.tga" + image_overlay_alignment="center" + image_unselected="navbar_bg_right.tga" + image_selected="navbar_bg_right.tga" + image_disabled="navbar_bg_right.tga" + image_disabled_selected="navbar_bg_right.tga" + image_hover_selected="navbar_bg_right.tga" + image_hover_unselected="navbar_bg_right.tga" /> + <location_input.combo_list bg_writeable_color="white"/> + <location_input.combo_editor name="Combo Text Entry" + select_on_focus="true" + font="SansSerifSmall" + bevel_style="none" + border_style="line" + border_thickness="0" /> +</location_input> diff --git a/indra/newview/skins/default/xui/en/widgets/menu.xml b/indra/newview/skins/default/xui/en/widgets/menu.xml new file mode 100644 index 0000000000000000000000000000000000000000..10bc124ea3d7686641ad2fa8bb2b4e3e996928d9 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/menu.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu bg_color="MenuDefaultBgColor" + bg_visible="true" + drop_shadow="true" + tear_off="false"> +</menu> diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item_call.xml b/indra/newview/skins/default/xui/en/widgets/menu_item_call.xml new file mode 100644 index 0000000000000000000000000000000000000000..24bda97f44c210f2d47fe50b21ec899d598cb7db --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/menu_item_call.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu_item_call enabled_color="MenuItemEnabledColor" + disabled_color="MenuItemDisabledColor" + highlight_bg_color="MenuItemHighlightBgColor" + highlight_fg_color="MenuItemHighlightFgColor"> +</menu_item_call> diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item_check.xml b/indra/newview/skins/default/xui/en/widgets/menu_item_check.xml new file mode 100644 index 0000000000000000000000000000000000000000..f6b06cb50b8e3774c9c19a157a634eb4692a3f17 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/menu_item_check.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu_item_check enabled_color="MenuItemEnabledColor" + disabled_color="MenuItemDisabledColor" + highlight_bg_color="MenuItemHighlightBgColor" + highlight_fg_color="MenuItemHighlightFgColor"> +</menu_item_check> diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml b/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml new file mode 100644 index 0000000000000000000000000000000000000000..e5cea476dae8c063aa07679c7e2af00109e65490 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu_item_separator enabled_color="MenuItemEnabledColor" + disabled_color="MenuItemDisabledColor" + highlight_bg_color="MenuItemHighlightBgColor" + highlight_fg_color="MenuItemHighlightFgColor"> +</menu_item_separator> diff --git a/indra/newview/skins/default/xui/en/widgets/multi_slider.xml b/indra/newview/skins/default/xui/en/widgets/multi_slider.xml new file mode 100644 index 0000000000000000000000000000000000000000..e0900b48f3b8a4b5d531559b50525fe6c71d4eb5 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/multi_slider.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<multi_slider text_color="LabelTextColor" + text_disabled_color="LabelDisabledColor" + draw_track="true" + use_triangle="false" + font="SansSerifSmall"/> diff --git a/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml b/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml new file mode 100644 index 0000000000000000000000000000000000000000..04a2cd635c80d61ce929b51fe4af880bd04c3bf3 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<multi_slider_bar track_color="MultiSliderTrackColor" + thumb_disabled_color="MultiSliderDisabledThumbColor" + thumb_outline_color="MultiSliderThumbOutlineColor" + thumb_center_color="MultiSliderThumbCenterColor" + thumb_center_selected_color="MultiSliderThumbCenterSelectedColor" + triangle_color="MultiSliderTriangleColor" + draw_track="true" + use_triangle="false" + thumb_width="8"/> diff --git a/indra/newview/skins/default/xui/en/widgets/name_editor.xml b/indra/newview/skins/default/xui/en/widgets/name_editor.xml new file mode 100644 index 0000000000000000000000000000000000000000..21ba5c77f828a480f90f03c4b1e9f2afdf5dca12 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/name_editor.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<name_editor default_text="(retrieving)"/> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/panel.xml b/indra/newview/skins/default/xui/en/widgets/panel.xml new file mode 100644 index 0000000000000000000000000000000000000000..b81a70b845840491322163b5c09dac95808deb9a --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/panel.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel bg_opaque_color="PanelFocusBackgroundColor" + bg_alpha_color="PanelDefaultBackgroundColor" + background_visible="false" + background_opaque="false"/> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/progress_bar.xml b/indra/newview/skins/default/xui/en/widgets/progress_bar.xml new file mode 100644 index 0000000000000000000000000000000000000000..3344de06b075ad138d60ff6295960719d924fee5 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/progress_bar.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<progress_bar image_bar="rounded_square.tga" + image_fill="progressbar_fill.tga" + image_shadow="rounded_square_soft.tga" + color_bar.red="0.5764" + color_bar.green="0.6627" + color_bar.blue="0.8352" + color_bar.alpha="1" + color_bar2.red="0.5764" + color_bar2.green="0.6627" + color_bar2.blue="0.8352" + color_bar2.alpha="1" + color_shadow.red="0.2000" + color_shadow.green="0.2000" + color_shadow.blue="0.4000" + color_shadow="1" + color_bg.red="0.3254" + color_bg.green="0.4000" + color_bg.blue="0.5058" + color_bg.alpha="1" + /> diff --git a/indra/newview/skins/default/xui/en/widgets/radio_group.xml b/indra/newview/skins/default/xui/en/widgets/radio_group.xml new file mode 100644 index 0000000000000000000000000000000000000000..2d851042a50fc442abefe89bcdb71058d4001443 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/radio_group.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<radio_group draw_border="true" + name="radio_group" + mouse_opaque="true" + follows="left|top" + font="SansSerifSmall"/> diff --git a/indra/newview/skins/default/xui/en/widgets/radio_item.xml b/indra/newview/skins/default/xui/en/widgets/radio_item.xml new file mode 100644 index 0000000000000000000000000000000000000000..0a27ca509b2e80484f163e92c894c5f73556cd21 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/radio_item.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<radio_item follows="left|top"> + <radio_item.label_text name="Radio Item label"/> + <radio_item.check_button name="Radio control button" + image_unselected="radio_active_false.tga" + image_selected="radio_active_true.tga" + image_disabled="radio_inactive_false.tga" + image_disabled_selected="radio_inactive_true.tga"/> +</radio_item> diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml new file mode 100644 index 0000000000000000000000000000000000000000..a6c9a56dfd048a35cf444c6699bc07ab6b39aa62 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/scroll_bar.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<scroll_bar thumb_image="rounded_square.tga" + track_image="rounded_square.tga" + track_color="ScrollbarTrackColor" + thumb_color="ScrollbarThumbColor" + thickness="16"> + <up_button image_unselected="scrollbutton_up_out_blue.tga" + image_selected="scrollbutton_up_in_blue.tga" + scale_image="true"/> + <down_button image_unselected="scrollbutton_down_out_blue.tga" + image_selected="scrollbutton_down_in_blue.tga" + scale_image="true"/> + <left_button image_unselected="scrollbutton_left_out_blue.tga" + image_selected="scrollbutton_left_in_blue.tga" + scale_image="true"/> + <right_button image_unselected="scrollbutton_right_out_blue.tga" + image_selected="scrollbutton_right_in_blue.tga" + scale_image="true"/> +</scroll_bar> diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_container.xml b/indra/newview/skins/default/xui/en/widgets/scroll_container.xml new file mode 100644 index 0000000000000000000000000000000000000000..cb9ef0479754fb1fddeb82dd551da28913866ab0 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/scroll_container.xml @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<scroll_container color="black" + opaque="false"/> diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml new file mode 100644 index 0000000000000000000000000000000000000000..9e2c52accaa224c346f06c817a05619fecbf6584 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<scroll_list fg_unselected_color="ScrollUnselectedColor" + fg_selected_color="ScrollSelectedFGColor" + bg_selected_color="ScrollSelectedBGColor" + fg_disable_color="ScrollDisabledColor" + bg_writeable_color="ScrollBgWriteableColor" + bg_read_only_color="ScrollBgReadOnlyColor" + bg_stripe_color="ScrollBGStripeColor" + hovered_color="ScrollHoveredColor" + highlighted_color="ScrollHighlightedColor" + column_padding="5" + draw_stripes="true" + background_visible="true" + heading_height="20" + draw_border="true" + draw_heading="false"/> diff --git a/indra/newview/skins/default/xui/en/widgets/search_editor.xml b/indra/newview/skins/default/xui/en/widgets/search_editor.xml new file mode 100644 index 0000000000000000000000000000000000000000..10080e5e3975c3b5f206de879ae5fb9801004fef --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/search_editor.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<search_editor select_on_focus="true"> + <clear_search_button image_unselected="icn_clear_lineeditor.tga" + image_selected="close_inactive_blue.tga" + image_color="TextFgTentativeColor"/> +</search_editor> diff --git a/indra/newview/skins/default/xui/en/widgets/side_tray.xml b/indra/newview/skins/default/xui/en/widgets/side_tray.xml new file mode 100644 index 0000000000000000000000000000000000000000..e3b70ba6e2e42a064758860aa7c1fb42edaddee8 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/side_tray.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<side_tray tab_btn_image="sidebar_tab_left.tga" + tab_btn_image_selected="sidebar_tab_left_selected.tga" + tab_btn_width = "32" + tab_btn_height = "32" + tab_btn_margin = "0" + > +</side_tray> diff --git a/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml b/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml new file mode 100644 index 0000000000000000000000000000000000000000..20af3bb58f78aae121109d4745158942eb5c03e9 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<simple_text_editor cursor_color="TextCursorColor" + default_color="TextDefaultColor" + text_color="TextFgColor" + text_readonly_color="TextFgReadOnlyColor" + bg_readonly_color="TextBgReadOnlyColor" + bg_writeable_color="TextBgWriteableColor" + bg_focus_color="TextBgFocusColor" + hide_border="false" + hide_scrollbar="false" + font="SansSerif"/> diff --git a/indra/newview/skins/default/xui/en/widgets/slider.xml b/indra/newview/skins/default/xui/en/widgets/slider.xml new file mode 100644 index 0000000000000000000000000000000000000000..f735d09476e973416b85227f7f554fa8e691845e --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/slider.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<slider name="slider" + can_edit_text="false" + font="SansSerifSmall" + volume="false" + mouse_opaque="true" + show_text="true" + text_color="LabelTextColor" + text_disabled_color="LabelDisabledColor"> + <slider.value_editor name="slider editor" + max_length="10" + follows="left|bottom"/> + <slider.value_text name="slider text" + follows="left|bottom"/> + <slider.slider_label name="slider label"/> +</slider> diff --git a/indra/newview/skins/default/xui/en/widgets/slider_bar.xml b/indra/newview/skins/default/xui/en/widgets/slider_bar.xml new file mode 100644 index 0000000000000000000000000000000000000000..ba9ad21cc0e8d458c3116dbef7d4533bf7cccdc6 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/slider_bar.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<slider_bar track_color="SliderTrackColor" + thumb_outline_color="SliderThumbOutlineColor" + thumb_center_color="SliderThumbCenterColor" + thumb_image="icn_slide-thumb_dark.tga" + track_image="icn_slide-groove_dark.tga" + track_highlight_image="icn_slide-highlight.tga"/> diff --git a/indra/newview/skins/default/xui/en/widgets/spinner.xml b/indra/newview/skins/default/xui/en/widgets/spinner.xml new file mode 100644 index 0000000000000000000000000000000000000000..29bf1e805228413f432dfbd9fda63e60b29e4624 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/spinner.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<spinner text_enabled_color="LabelTextColor" + text_disabled_color="LabelDisabledColor" + decimal_digits="3" + label_width="40"/> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/tab_container.xml b/indra/newview/skins/default/xui/en/widgets/tab_container.xml new file mode 100644 index 0000000000000000000000000000000000000000..8245e5ff23ab9f9dd896cacf38cfae2c0465de50 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<tab_container tab_min_width="60" + tab_max_width="150" + tab_top_image_unselected="tab_top_blue.tga" + tab_top_image_selected="tab_top_selected_blue.tga" + tab_bottom_image_unselected="tab_bottom_blue.tga" + tab_bottom_image_selected="tab_bottom_selected_blue.tga" + tab_left_image_unselected="tab_left.tga" + tab_left_image_selected="tab_left_selected.tga"/> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/text.xml b/indra/newview/skins/default/xui/en/widgets/text.xml new file mode 100644 index 0000000000000000000000000000000000000000..3d98cd66f9655e4cf1a7f7aa9c457ed3a8f6994a --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/text.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<text name="text_box" + font="SansSerifSmall" + font_shadow="soft" + tab_stop="false" + halign="left" + hover_color="LabelSelectedColor" + disabled_color="LabelDisabledColor" + background_color="FloaterDefaultBackgroundColor" + border_color="DefaultHighlightLight" + use_ellipses="false" + bg_visible="false" + border_drop_shadow_visible="false" + border_visible="false" + hover="false" + text_color="LabelTextColor"/> diff --git a/indra/newview/skins/default/xui/en/widgets/text_editor.xml b/indra/newview/skins/default/xui/en/widgets/text_editor.xml new file mode 100644 index 0000000000000000000000000000000000000000..dc4c430546f609ec445d3a9e24b18b978044af55 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/text_editor.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<line_editor background_image="sm_rounded_corners_simple.tga" + select_on_focus="false" + handle_edit_keys_directly="false" + commit_on_focus_lost="true" + ignore_tab="true" + cursor_color="TextCursorColor" + text_color="TextFgColor" + text_readonly_color="TextFgReadOnlyColor" + text_tentative_color="TextFgTentativeColor" + bg_readonly_color="TextBgReadOnlyColor" + bg_writeable_color="TextBgWriteableColor" + bg_focus_color="TextBgFocusColor" + mouse_opaque="true" + name="line_editor" + font="SansSerifSmall"> + <line_editor.border bevel_style="in" + follows="all"/> +</line_editor> diff --git a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml new file mode 100644 index 0000000000000000000000000000000000000000..33c3475eb274c5de9e44de0ef0d0165c387b2e8d --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<texture_picker border_color="DefaultHighlightLight"> + <multiselect_text font="SansSerifSmall"/> + <caption_text text="Multiple" + halign="center" + font="SansSerifSmall"/> + <border bevel_style="in"/> +</texture_picker> + diff --git a/indra/newview/skins/default/xui/en/widgets/view_border.xml b/indra/newview/skins/default/xui/en/widgets/view_border.xml new file mode 100644 index 0000000000000000000000000000000000000000..0b0a9beb95973724feb9a023d14ce02a11807027 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/view_border.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<view_border highlight_light_color="DefaultHighlightLight" + highlight_dark_color="DefaultHighlightDark" + shadow_light_color="DefaultShadowLight" + shadow_dark_color="DefaultShadowDark" + border_thickness="1" + border_style="line" + bevel_style="out"/> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/web_browser.xml b/indra/newview/skins/default/xui/en/widgets/web_browser.xml new file mode 100644 index 0000000000000000000000000000000000000000..118d63bbf0720d22fd8fb16295023345dc750578 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/web_browser.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<web_browser border_visible="true"/> diff --git a/indra/newview/skins/default/xui/en/xui_version.xml b/indra/newview/skins/default/xui/en/xui_version.xml new file mode 100644 index 0000000000000000000000000000000000000000..0e777751d3f13b0b47e740254ea5f6ba40b074a1 --- /dev/null +++ b/indra/newview/skins/default/xui/en/xui_version.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<xui_version> + 1.0 +</xui_version> diff --git a/indra/newview/skins/default/xui/es/floater_animation_preview.xml b/indra/newview/skins/default/xui/es/floater_animation_preview.xml index a5b9847c4f5e9a4b5ca6e7ff23a3666354c7f2bf..5a03aa6370c7ba580952c97da23d14f258179044 100644 --- a/indra/newview/skins/default/xui/es/floater_animation_preview.xml +++ b/indra/newview/skins/default/xui/es/floater_animation_preview.xml @@ -6,145 +6,72 @@ <text name="description_label"> Descripción: </text> - <spinner label="Prioridad" name="priority" tool_tip="Controle qué otras animaciones pueden ser anuladas por ésta."/> - <check_box label="Bucle" name="loop_check" tool_tip="Haga esta animación en bucle."/> - <spinner label="Empieza(%)" name="loop_in_point" tool_tip="Indique el punto en el que la animación empieza el bucle."/> - <spinner label="Acaba(%)" name="loop_out_point" tool_tip="Indique el punto en el que la animación acaba el bucle."/> + <spinner label_width="72" width="110" label="Prioridad:" name="priority" tool_tip="Controle qué otras animaciones pueden ser anuladas por ésta."/> + <check_box left="8" label="Bucle:" name="loop_check" tool_tip="Haga esta animación en bucle."/> + <spinner label_width="65" left="65" width="116" label="Empieza(%)" name="loop_in_point" tool_tip="Indique el punto en el que la animación empieza el bucle."/> + <spinner label_width="50" left="185" label="Acaba(%)" name="loop_out_point" tool_tip="Indique el punto en el que la animación acaba el bucle."/> <text name="hand_label"> Posición de las manos </text> - <combo_box label="" name="hand_pose_combo" tool_tip="Control de lo que hacen las manos durante la animación."> - <combo_item name="Spread"> - Extendidas - </combo_item> - <combo_item name="Relaxed"> - Relajadas - </combo_item> - <combo_item name="PointBoth"> - Ambas señalan - </combo_item> - <combo_item name="Fist"> - Puño - </combo_item> - <combo_item name="RelaxedLeft"> - La izquierda relajada - </combo_item> - <combo_item name="PointLeft"> - La izquierda señala - </combo_item> - <combo_item name="FistLeft"> - Puño en la izquierda - </combo_item> - <combo_item name="RelaxedRight"> - La derecha relajada - </combo_item> - <combo_item name="PointRight"> - La derecha señala - </combo_item> - <combo_item name="FistRight"> - Puño en la derecha - </combo_item> - <combo_item name="SaluteRight"> - La derecha saluda - </combo_item> - <combo_item name="Typing"> - Escribiendo - </combo_item> - <combo_item name="PeaceRight"> - Paz en la derecha - </combo_item> + <combo_box left_delta="120" width="164" name="hand_pose_combo" tool_tip="Control de lo que hacen las manos durante la animación."> + <combo_box.item name="Spread" label="Extendidas"/> + <combo_box.item name="Relaxed" label="Relajadas"/> + <combo_box.item name="PointBoth" label="Ambas señalan"/> + <combo_box.item name="Fist" label="Puño"/> + <combo_box.item name="RelaxedLeft" label="La izquierda relajada"/> + <combo_box.item name="PointLeft" label="La izquierda señala"/> + <combo_box.item name="FistLeft" label="Puño en la izquierda"/> + <combo_box.item name="RelaxedRight" label="La derecha relajada"/> + <combo_box.item name="PointRight" label="La derecha señala"/> + <combo_box.item name="FistRight" label="Puño en la derecha"/> + <combo_box.item name="SaluteRight" label="La derecha saluda"/> + <combo_box.item name="Typing" label="Escribiendo"/> + <combo_box.item name="PeaceRight" label="Paz en la derecha"/> </combo_box> <text name="emote_label"> Expresión </text> - <combo_box label="" name="emote_combo" tool_tip="Controle qué hace la cara durante la animación."> - <combo_item name="[None]"> - [Nada] - </combo_item> - <combo_item name="Aaaaah"> - Aaaaah - </combo_item> - <combo_item name="Afraid"> - Con miedo - </combo_item> - <combo_item name="Angry"> - Enfadada - </combo_item> - <combo_item name="BigSmile"> - Gran sonrisa - </combo_item> - <combo_item name="Bored"> - Aburrida - </combo_item> - <combo_item name="Cry"> - Llorar - </combo_item> - <combo_item name="Disdain"> - Desdén - </combo_item> - <combo_item name="Embarrassed"> - Avergonzada - </combo_item> - <combo_item name="Frown"> - Fruncir el ceño - </combo_item> - <combo_item name="Kiss"> - Besar - </combo_item> - <combo_item name="Laugh"> - ReÃr - </combo_item> - <combo_item name="Plllppt"> - Sacar la lengua - </combo_item> - <combo_item name="Repulsed"> - Rechazo - </combo_item> - <combo_item name="Sad"> - Triste - </combo_item> - <combo_item name="Shrug"> - Encogerse de hombros - </combo_item> - <combo_item name="Smile"> - Sonrisa - </combo_item> - <combo_item name="Surprise"> - Sorpresa - </combo_item> - <combo_item name="Wink"> - Guiño - </combo_item> - <combo_item name="Worry"> - Preocupación - </combo_item> + <combo_box left_delta="120" width="164" name="emote_combo" tool_tip="Controle qué hace la cara durante la animación."> + <combo_box.item name="[None]" label="Nada]"/> + <combo_box.item name="Aaaaah" label="Aaaaah"/> + <combo_box.item name="Afraid" label="Con miedo"/> + <combo_box.item name="Angry" label="Enfadada"/> + <combo_box.item name="BigSmile" label="Gran sonrisa"/> + <combo_box.item name="Bored" label="Aburrida"/> + <combo_box.item name="Cry" label="Llorar"/> + <combo_box.item name="Disdain" label="Desdén"/> + <combo_box.item name="Embarrassed" label="Avergonzada"/> + <combo_box.item name="Frown" label="Fruncir el ceño"/> + <combo_box.item name="Kiss" label="Besar"/> + <combo_box.item name="Laugh" label="ReÃr"/> + <combo_box.item name="Plllppt" label="Sacar la lengua"/> + <combo_box.item name="Repulsed" label="Rechazo"/> + <combo_box.item name="Sad" label="Triste"/> + <combo_box.item name="Shrug" label="Encogerse de hombros"/> + <combo_box.item name="Smile" label="Sonrisa"/> + <combo_box.item name="Surprise" label="Sorpresa"/> + <combo_box.item name="Wink" label="Guiño"/> + <combo_box.item name="Worry" label="Preocupación"/> </combo_box> - <text name="preview_label"> + <text name="preview_label" width="250"> Vista previa mientras </text> - <combo_box label="" name="preview_base_anim" tool_tip="Compruebe cómo se comporta su animación a la vez que el avatar realiza acciones comunes."> - <combo_item name="Standing"> - Estar de pie - </combo_item> - <combo_item name="Walking"> - Caminar - </combo_item> - <combo_item name="Sitting"> - Estar sentado - </combo_item> - <combo_item name="Flying"> - Volar - </combo_item> + <combo_box left_delta="120" width="130" name="preview_base_anim" tool_tip="Compruebe cómo se comporta su animación a la vez que el avatar realiza acciones comunes."> + <combo_box.item name="Standing" label="Estar de pie"/> + <combo_box.item name="Walking" label="Caminar"/> + <combo_box.item name="Sitting" label="Estar sentado"/> + <combo_box.item name="Flying" label="Volar"/> </combo_box> - <spinner label="Combinar (sec)" name="ease_in_time" tool_tip="Tiempo (en segundos) en el que se combinan las animaciones."/> - <spinner label="Dejar de combinar (sec)" name="ease_out_time" tool_tip="Tiempo (en segundos) en el que dejan de combinarse las animaciones."/> - <button label="" name="play_btn" tool_tip="Mover/Pausar su animación."/> + <spinner label_width="125" width="192" label="Combinar (sec)" name="ease_in_time" tool_tip="Tiempo (en segundos) en el que se combinan las animaciones."/> + <spinner bottom_delta="-20" label_width="125" left="10" width="192" label="Dejar de combinar (sec)" name="ease_out_time" tool_tip="Tiempo (en segundos) en el que dejan de combinarse las animaciones."/> + <button bottom_delta="-32" name="play_btn" tool_tip="Mover/Pausar su animación."/> <button label="" name="stop_btn" tool_tip="Parar la repetición de la animación"/> <slider label="" name="playback_slider"/> <text name="bad_animation_text"> No se ha podido leer el archivo de la animación. -Recomendamos usar archivos BVH exportados de Poser 4. +Recomendamos usar archivos BVH exportados de +Poser 4. </text> <button label="Cancelar" name="cancel_btn"/> <button label="Subir ([AMOUNT] L$)" name="ok_btn"/> diff --git a/indra/newview/skins/default/xui/es/floater_buy_land.xml b/indra/newview/skins/default/xui/es/floater_buy_land.xml index a0d3734bbbad324cd3bc81b92b033a79dff5bf49..7ee15955eb30aea99b81d50c697deeafb3f596f7 100644 --- a/indra/newview/skins/default/xui/es/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/es/floater_buy_land.xml @@ -3,25 +3,25 @@ <text name="region_name_label"> Región: </text> - <text name="region_name_text"> + <text name="region_name_text" left="565"> (desconocida) </text> <text name="region_type_label"> Tipo: </text> - <text name="region_type_text"> + <text name="region_type_text" left="565"> (desconocido) </text> <text name="estate_name_label"> Estado: </text> - <text name="estate_name_text"> + <text name="estate_name_text" left="565"> (desconocido) </text> - <text name="estate_owner_label"> + <text name="estate_owner_label" width="115" right="565"> Propietario del estado: </text> - <text name="estate_owner_text"> + <text name="estate_owner_text" left="565" > (desconocido) </text> <text name="resellable_changeable_label"> @@ -36,6 +36,7 @@ <text name="covenant_text"> Deve aceptar el Contrato del Estado: </text> + <text left="470" name="covenant_timestamp_text"/> <text_editor name="covenant_editor"> Cargando... </text_editor> @@ -74,15 +75,9 @@ incluyendo los objetos Sólo pueden ser propietarios de terreno los miembros premium. </text> <combo_box name="account_level"> - <combo_item name="US$9.95/month,billedmonthly"> - 9.95 US$/mes, facturados mensualmente - </combo_item> - <combo_item name="US$7.50/month,billedquarterly"> - 7.50 US$/mes, facturados cuatrimestralmente - </combo_item> - <combo_item name="US$6.00/month,billedannually"> - 6.00 US$/mes, facturados anualmente - </combo_item> + <combo_box.item name="US$9.95/month,billedmonthly" label="9.95 US$/mes, facturados mensualmente" /> + <combo_box.item name="US$7.50/month,billedquarterly" label="7.50 US$/mes, facturados cuatrimestralmente" /> + <combo_box.item name="US$6.00/month,billedannually" label="6.00 US$/mes, facturados anualmente" /> </combo_box> <text name="land_use_action"> Aumenta su cuota mensual por uso de terreno a 40 US$/mes. diff --git a/indra/newview/skins/default/xui/es/floater_customize.xml b/indra/newview/skins/default/xui/es/floater_customize.xml index fa3113faf7dcc97853fbc2a8398e86f169d9cdca..5efc989eff7ba41a522bcad7cd73f514f728fc61 100644 --- a/indra/newview/skins/default/xui/es/floater_customize.xml +++ b/indra/newview/skins/default/xui/es/floater_customize.xml @@ -14,12 +14,8 @@ <button label="Torso" label_selected="Torso" name="Torso"/> <button label="Piernas" label_selected="Piernas" name="Legs"/> <radio_group name="sex radio"> - <radio_item length="1" name="radio" type="string"> - Mujer - </radio_item> - <radio_item length="1" name="radio2" type="string"> - Varón - </radio_item> + <radio_item length="1" name="radio" type="string" label="Mujer" /> + <radio_item length="1" name="radio2" type="string" label="Varón" /> </radio_group> <text length="1" name="title" type="string"> [DESC] @@ -188,7 +184,7 @@ avatar. O parta de cero creando una nueva y vistiéndola. No tiene permiso para modificar este Ãtem. </text> <text name="Item Action Label" right="107"> - Camiseta: + Camisa: </text> </panel> <panel label="Pantalones" name="Pants"> @@ -225,7 +221,7 @@ avatar. O parta de cero creando unos nuevos y vistiéndoselos. Pantalones: </text> </panel> - <panel label="Shoes" name="Shoes"> + <panel label="Zapatos" name="Shoes"> <text length="1" name="title" type="string"> [DESC] </text> @@ -468,5 +464,5 @@ avatar. O parta de cero creando una nueva y vistiéndola. <scroll_container left="230" name="panel_container"/> <button label="Cancelar" label_selected="Cancelar" name="Cancel"/> <button label="OK" label_selected="OK" name="Ok"/> - <button label="Hacer un vestuario..." label_selected="Hacer un vestuario..." name="Make Outfit" width="125"/> + <button label="Hacer un vestuario..." label_selected="Hacer un vestuario..." name="Make Outfit" width="130"/> </floater> diff --git a/indra/newview/skins/default/xui/es/floater_god_tools.xml b/indra/newview/skins/default/xui/es/floater_god_tools.xml index 583bc2607f12df24ae7a50025b18354f0079741d..1ba0b685c62d488562c32adaf2b09826520d3652 100644 --- a/indra/newview/skins/default/xui/es/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/es/floater_god_tools.xml @@ -114,29 +114,17 @@ Destino: </text> <combo_box name="destination"> - <combo_item name="Selection"> - Selección - </combo_item> - <combo_item name="AgentRegion"> - Agente de región - </combo_item> + <combo_box.item name="Selection" label="Selección" /> + <combo_box.item name="AgentRegion" label="Agente de región" /> </combo_box> <text name="Request:"> Exigencia: </text> <combo_box name="request"> - <combo_item name="colliders<steps>"> - colisionadores <pasos> - </combo_item> - <combo_item name="scripts<count>,<optionalpattern>"> - scripts <contar>,<patrón opcional> - </combo_item> - <combo_item name="objects<pattern>"> - objetos <patrón> - </combo_item> - <combo_item name="rez<asset_id>"> - rez <asset_id> - </combo_item> + <combo_box.item name="colliders<steps>" label="colisionadores <pasos>" /> + <combo_box.item name="scripts<count>,<optionalpattern>" label="scripts <contar>,<patrón opcional>" /> + <combo_box.item name="objects<pattern>" label="objetos <patrón>" /> + <combo_box.item name="rez<asset_id>" label="rez <asset_id>" /> </combo_box> <text name="Parameter:"> Parámetro: diff --git a/indra/newview/skins/default/xui/es/floater_hardware_settings.xml b/indra/newview/skins/default/xui/es/floater_hardware_settings.xml index e596ee7f9ece94df6efda51dd13ebaa43c797ce9..29750ee7371db337a69f46b56274be6f6c153b73 100644 --- a/indra/newview/skins/default/xui/es/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/es/floater_hardware_settings.xml @@ -7,22 +7,12 @@ <text name="Antialiasing:"> Antialiasing: </text> - <combo_box label="Antialiasing" name="fsaa"> - <combo_item name="FSAADisabled"> - Desactivado - </combo_item> - <combo_item name="2x"> - 2x - </combo_item> - <combo_item name="4x"> - 4x - </combo_item> - <combo_item name="8x"> - 8x - </combo_item> - <combo_item name="16x"> - 16x - </combo_item> + <combo_box label="Antialiasing" name="fsaa" width="94"> + <combo_box.item name="FSAADisabled" label="Desactivado"/> + <combo_box.item name="2x" label="2x"/> + <combo_box.item name="4x" label="4x"/> + <combo_box.item name="8x" label="8x"/> + <combo_box.item name="16x" label="16x"/> </combo_box> <spinner label="Gamma:" name="gamma"/> <text name="(brightness, lower is brighter)"> @@ -32,7 +22,7 @@ Activar VBO: </text> <check_box label="Activar OpenGL Vertex Buffer Objects" name="vbo" tool_tip="En hardware moderno, habilitar esta opción mejora el rendimiento. Pero en hardware antiguo, el habilitarlo hace que, frecuentemente, se obtenga una implementación pobre de VBO, lo que puede provocarle caÃdas."/> - <slider label="Memoria para texturas (MB):" name="GrapicsCardTextureMemory" tool_tip="Cantidad de memoria asignada a las texturas. Por defecto es la memoria de la tarjeta de vÃdeo. Reducir esta cantidad puede mejorar el rendimiento, pero también puede hacer que las texturas se vean borrosas."/> + <slider label_width="150" left="10" width="300" label="Memoria para texturas (MB):" name="GrapicsCardTextureMemory" tool_tip="Cantidad de memoria asignada a las texturas. Por defecto es la memoria de la tarjeta de vÃdeo. Reducir esta cantidad puede mejorar el rendimiento, pero también puede hacer que las texturas se vean borrosas."/> <spinner label="Intensidad de la niebla:" name="fog"/> <button label="OK" label_selected="OK" name="OK"/> </floater> diff --git a/indra/newview/skins/default/xui/es/floater_image_preview.xml b/indra/newview/skins/default/xui/es/floater_image_preview.xml index f682254a50d9a5c0d0b128a11824e2ed3c4e9403..6d51a800b7daf2e4934aba91bf4f6e4ddf27456c 100644 --- a/indra/newview/skins/default/xui/es/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/es/floater_image_preview.xml @@ -7,46 +7,28 @@ Descripción: </text> <text name="preview_label"> - Previsualizar la imagen como: + Previsualizar la +imagen como: </text> - <combo_box label="Tipo de ropa" name="clothing_type_combo"> - <combo_item name="Image"> - Imagen - </combo_item> - <combo_item name="Hair"> - Pelo - </combo_item> - <combo_item name="FemaleHead"> - Cabeza de mujer - </combo_item> - <combo_item name="FemaleUpperBody"> - Mujer: parte superior del cuerpo - </combo_item> - <combo_item name="FemaleLowerBody"> - Mujer: parte inferior del cuerpo - </combo_item> - <combo_item name="MaleHead"> - Cabeza de varón - </combo_item> - <combo_item name="MaleUpperBody"> - Varón: parte superior del cuerpo - </combo_item> - <combo_item name="MaleLowerBody"> - Varón: parte inferior del cuerpo - </combo_item> - <combo_item name="Skirt"> - Falda - </combo_item> - <combo_item name="SculptedPrim"> - Prim sculpted - </combo_item> + <combo_box label="Tipo de ropa" name="clothing_type_combo" left="100" width="186"> + <combo_box.item name="Image" label="Imagen" /> + <combo_box.item name="Hair" label="Pelo" /> + <combo_box.item name="FemaleHead" label="Cabeza de mujer" /> + <combo_box.item name="FemaleUpperBody" label="Mujer: parte superior del cuerpo" /> + <combo_box.item name="FemaleLowerBody" label="Mujer: parte inferior del cuerpo" /> + <combo_box.item name="MaleHead" label="Cabeza de varón" /> + <combo_box.item name="MaleUpperBody" label="Varón: parte superior del cuerpo" /> + <combo_box.item name="MaleLowerBody" label="Varón: parte inferior del cuerpo" /> + <combo_box.item name="Skirt" label="Falda" /> + <combo_box.item name="SculptedPrim" label="Prim sculpted"/> </combo_box> <text name="bad_image_text"> Imposible leer la imagen. -Pruebe a guardar la imagen como Targa (.tga) de 24 bites. +Pruebe a guardar la imagen como Targa (.tga) +de 24 bites. </text> <check_box label="Usar compresión sin pérdida" name="lossless_check"/> <button label="Cancelar" name="cancel_btn"/> - <button label="Subir ([AMOUNT] 10L$)" name="ok_btn"/> + <button label="Subir ([AMOUNT]L$)" name="ok_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/es/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/es/floater_inventory_item_properties.xml index dfe0b8e520e7f28a002d5384f3e6baf037ba3e00..4df3ca2cf6f8b881d2ee2fa4d9f81613d03d647f 100644 --- a/indra/newview/skins/default/xui/es/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/es/floater_inventory_item_properties.xml @@ -30,7 +30,7 @@ Usted puede: </text> <check_box label="Modificarlo" name="CheckOwnerModify"/> - <check_box label="Copiarlo" name="CheckOwnerCopy"/> + <check_box left_delta="88" label="Copiarlo" name="CheckOwnerCopy"/> <check_box label="Venderlo/darlo" name="CheckOwnerTransfer"/> <text name="BaseMaskDebug"> B: @@ -49,23 +49,19 @@ </text> <check_box label="Compartir con el grupo" name="CheckShareWithGroup"/> <check_box label="Permitir a cualquiera que lo copie" name="CheckEveryoneCopy"/> - <text name="NextOwnerLabel"> + <text name="NextOwnerLabel" width="230"> El próximo propietario puede: </text> <check_box label="Modificarlo" name="CheckNextOwnerModify"/> - <check_box label="Copiarlo" name="CheckNextOwnerCopy"/> + <check_box left_delta="88" label="Copiarlo" name="CheckNextOwnerCopy"/> <check_box label="Revenderlo/darlo" name="CheckNextOwnerTransfer"/> <text name="SaleLabel"> Marcar Ãtem como: </text> <check_box label="En venta" name="CheckPurchase"/> - <radio_group name="RadioSaleType"> - <radio_item name="radio"> - Original - </radio_item> - <radio_item name="radio2"> - Copia - </radio_item> + <radio_group name="RadioSaleType" left_delta="88" > + <radio_item name="radio" label="Original" /> + <radio_item name="radio2" label="Copia" /> </radio_group> <text name="TextPrice"> Precio: L$ diff --git a/indra/newview/skins/default/xui/es/floater_preview_gesture.xml b/indra/newview/skins/default/xui/es/floater_preview_gesture.xml index 4513fc6f3cc7abf7c993e3e34cff50dd9afeca8c..0e43ce536cfe7d05bb80d80092030d7c2423f3d2 100644 --- a/indra/newview/skins/default/xui/es/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/es/floater_preview_gesture.xml @@ -15,15 +15,15 @@ <text name="trigger_label"> Palabra clave: </text> - <text name="replace_text" tool_tip="Reemplaza la/s palabra/s clave con estas palabras. Por ejemplo, si cambia la palabra clave 'hola' por 'qué tal', se cambiará en el chat 'Quise decir hola' por 'Quise decir qué tal' en cuanto realice el gesto."> + <text left="208" name="replace_text" tool_tip="Reemplaza la/s palabra/s clave con estas palabras. Por ejemplo, si cambia la palabra clave 'hola' por 'qué tal', se cambiará en el chat 'Quise decir hola' por 'Quise decir qué tal' en cuanto realice el gesto."> Reemplazar por: </text> <line_editor name="replace_editor" tool_tip="Reemplaza la/s palabra/s clave con estas palabras. Por ejemplo, si cambia la palabra clave 'hola' por 'qué tal', se cambiará en el chat 'Quise decir hola' por 'Quise decir qué tal' en cuanto realice el gesto."/> <text name="key_label"> Atajo de teclado: </text> - <combo_box label="Ninguno" name="modifier_combo"/> - <combo_box label="Ninguno" name="key_combo"/> + <combo_box label="Ninguno" name="modifier_combo" left="116" width="76"/> + <combo_box label="Ninguno" name="key_combo" width="76" left_delta="80"/> <text name="library_label"> Biblioteca: </text> @@ -44,17 +44,15 @@ Esperar Todos los pasos suceden a la vez, a menos que añada pasos de espera. </text> + <text left="230" name="options_text" width="200" /> <radio_group name="animation_trigger_type"> - <radio_item name="start"> - Empezar - </radio_item> - <radio_item name="stop"> - Parar - </radio_item> + <radio_item name="start" label="Empezar" /> + <radio_item name="stop" label="Parar" /> </radio_group> - <check_box label="hasta que las animaciones estén hechas" name="wait_anim_check"/> - <check_box label="tiempo en segundos" name="wait_time_check"/> - <check_box label="Disponible" name="active_check" tool_tip="Los gestos disponibles pueden realizarse escribiendo en el chat su frase clave o pulsando su tecla de acceso rápido. Generalmente, los gestos pasan a no disponibles cuando hay un conflicto de teclas."/> - <button label="Vista previa" name="preview_btn"/> + <check_box bottom_delta="34" label="hasta que las animaciones estén hechas" name="wait_anim_check"/> + <check_box bottom_delta="-30" label="tiempo en segundos" name="wait_time_check"/> + <line_editor left_delta="130" name="wait_time_editor" /> + <check_box left="130" label="Disponible" name="active_check" tool_tip="Los gestos disponibles pueden realizarse escribiendo en el chat su frase clave o pulsando su tecla de acceso rápido. Generalmente, los gestos pasan a no disponibles cuando hay un conflicto de teclas."/> + <button label="Vista previa" name="preview_btn" width="85"/> <button label="Guardar" name="save_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/es/floater_report_abuse.xml b/indra/newview/skins/default/xui/es/floater_report_abuse.xml index 0624f48a013c03a284614b0202078fc2b5a90a68..caa0f2a748f6594c827c53345723dab7751ec82c 100644 --- a/indra/newview/skins/default/xui/es/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/es/floater_report_abuse.xml @@ -37,123 +37,51 @@ Hendrerit Vulputate </text> <combo_box name="category_combo" tool_tip="CategorÃa -- Elija la categorÃa que describa mejor esta denuncia"> - <combo_item name="Select_category"> - Elegir la categorÃa - </combo_item> - <combo_item name="Age__Age_play"> - Edad > Jugar a ser niño - </combo_item> - <combo_item name="Age__Adult_resident_on_Teen_Second_Life"> - Edad > Residente adulto en Teen Second Life - </combo_item> + <combo_box.item name="Select_category" label="Elegir la categorÃa"/> + <combo_box.item name="Age__Age_play" label="Edad > Jugar a ser niño"/> + <combo_box.item name="Age__Adult_resident_on_Teen_Second_Life" label="Edad > Residente adulto en Teen Second Life"/> <combo_item name="Age__Underage_resident_outside_of_Teen_Second_Life"> Edad > Residente menor de edad fuera de Teen Second Life </combo_item> - <combo_item name="Assault__Combat_sandbox___unsafe_area"> - Ataque > Sandbox de combate / Zona no segura - </combo_item> - <combo_item name="Assault__Safe_area"> - Ataque > Zona segura - </combo_item> - <combo_item name="Assault__Weapons_testing_sandbox"> - Ataque > Sandbox de prueba de armas - </combo_item> - <combo_item name="Commerce__Failure_to_deliver_product_or_service"> - Comercio > Error en la entrega de productos o servicios - </combo_item> - <combo_item name="Disclosure__Real_world_information"> - Indiscreción > Información del mundo real - </combo_item> - <combo_item name="Disclosure__Remotely_monitoring chat"> - Indiscreción > Monitorizar a distancia el chat - </combo_item> - <combo_item name="Disclosure__Second_Life_information_chat_IMs"> - Indiscreción > Información Se Second Life, el chat o los MI - </combo_item> - <combo_item name="Disturbing_the_peace__Unfair_use_of_region_resources"> - Perturbando la paz > Abuso de los recursos de la región - </combo_item> - <combo_item name="Disturbing_the_peace__Excessive_scripted_objects"> - Perturbando la paz > Excesivos objetos con script - </combo_item> - <combo_item name="Disturbing_the_peace__Object_littering"> - Perturbando la paz > Objeto basura - </combo_item> - <combo_item name="Disturbing_the_peace__Repetitive_spam"> - Perturbando la paz > Spam (mensajes no pedidos) repetitivo - </combo_item> - <combo_item name="Disturbing_the_peace__Unwanted_advert_spam"> - Perturbando la paz > Publicidad no deseada - </combo_item> - <combo_item name="Fraud__L$"> - Fraude > L$ - </combo_item> - <combo_item name="Fraud__Land"> - Fraude > Terreno - </combo_item> - <combo_item name="Fraud__Pyramid_scheme_or_chain_letter"> - Fraude > Esquemas piramidales o cadenas de cartas - </combo_item> - <combo_item name="Fraud__US$"> - Fraude > US$ - </combo_item> - <combo_item name="Harassment__Advert_farms___visual_spam"> - Acoso > Anuncios múltiples / Spam visual - </combo_item> - <combo_item name="Harassment__Defaming_individuals_or_groups"> - Acoso > Difamación de individuos o grupos - </combo_item> - <combo_item name="Harassment__Impeding_movement"> - Acoso > Impedir el movimiento - </combo_item> - <combo_item name="Harassment__Sexual_harassment"> - Acoso > Acoso sexual - </combo_item> - <combo_item name="Harassment__Solicting_inciting_others_to_violate_ToS"> - Acoso > Incitar a, o pedir, que otros violen las Condiciones del Servicio - </combo_item> - <combo_item name="Harassment__Verbal_abuse"> - Acoso > Abuso verbal - </combo_item> - <combo_item name="Indecency__Broadly_offensive_content_or_conduct"> - Indecencia > En general, contenido o conducta ofensivos - </combo_item> - <combo_item name="Indecency__Inappropriate_avatar_name"> - Indecencia > Nombre inapropiado del avatar - </combo_item> + <combo_box.item name="Assault__Combat_sandbox___unsafe_area" label="Ataque > Sandbox de combate / Zona no segura"/> + <combo_box.item name="Assault__Safe_area" label="Ataque > Zona segura"/> + <combo_box.item name="Assault__Weapons_testing_sandbox" label="Ataque > Sandbox de prueba de armas"/> + <combo_box.item name="Commerce__Failure_to_deliver_product_or_service" label="Comercio > Error en la entrega de productos o servicios"/> + <combo_box.item name="Disclosure__Real_world_information" label="Indiscreción > Información del mundo real"/> + <combo_box.item name="Disclosure__Remotely_monitoring chat" label="Indiscreción > Monitorizar a distancia el chat"/> + <combo_box.item name="Disclosure__Second_Life_information_chat_IMs" label="Indiscreción > Información Se Second Life, el chat o los MI"/> + <combo_box.item name="Disturbing_the_peace__Unfair_use_of_region_resources" label="Perturbando la paz > Abuso de los recursos de la región"/> + <combo_box.item name="Disturbing_the_peace__Excessive_scripted_objects" label="Perturbando la paz > Excesivos objetos con script"/> + <combo_box.item name="Disturbing_the_peace__Object_littering" label="Perturbando la paz > Objeto basura"/> + <combo_box.item name="Disturbing_the_peace__Repetitive_spam" label="Perturbando la paz > Spam (mensajes no pedidos) repetitivo"/> + <combo_box.item name="Disturbing_the_peace__Unwanted_advert_spam" label="Perturbando la paz > Publicidad no deseada"/> + <combo_box.item name="Fraud__L$" label="Fraude > L$"/> + <combo_box.item name="Fraud__Land" label="Fraude > Terreno"/> + <combo_box.item name="Fraud__Pyramid_scheme_or_chain_letter" label="Fraude > Esquemas piramidales o cadenas de cartas"/> + <combo_box.item name="Fraud__US$" label="Fraude > US$"/> + <combo_box.item name="Harassment__Advert_farms___visual_spam" label="Acoso > Anuncios múltiples / Spam visual"/> + <combo_box.item name="Harassment__Defaming_individuals_or_groups" label="Acoso > Difamación de individuos o grupos"/> + <combo_box.item name="Harassment__Impeding_movement" label="Acoso > Impedir el movimiento"/> + <combo_box.item name="Harassment__Sexual_harassment" label="Acoso > Acoso sexual"/> + <combo_box.item name="Harassment__Solicting_inciting_others_to_violate_ToS" label="Acoso > Incitar a, o pedir, que otros violen las Condiciones del Servicio"/> + <combo_box.item name="Harassment__Verbal_abuse" label="Acoso > Abuso verbal"/> + <combo_box.item name="Indecency__Broadly_offensive_content_or_conduct" label="Indecencia > En general, contenido o conducta ofensivos"/> + <combo_box.item name="Indecency__Inappropriate_avatar_name" label="Indecencia > Nombre inapropiado del avatar"/> <combo_item name="Indecency__Mature_content_in_PG_region"> Indecencia > Contenido o conducta inapropiada en una región 'PG' </combo_item> <combo_item name="Indecency__Inappropriate_content_in_Mature_region"> Indecencia > Contenido o conducta inapropiada en una región 'Mature' </combo_item> - <combo_item name="Intellectual_property_infringement_Content_Removal"> - Infracción de la propiedad intelectual > Eliminación de contenidos - </combo_item> - <combo_item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"> - Infracción de la propiedad intelectual > CopyBot o Exploit (programa malicioso) de permisos - </combo_item> - <combo_item name="Intolerance"> - Intolerancia - </combo_item> - <combo_item name="Land__Abuse_of_sandbox_resources"> - Terreno > Abuso de los recursos de un sandbox - </combo_item> - <combo_item name="Land__Encroachment__Objects_textures"> - Terreno > Invasión > Objetos/Texturas - </combo_item> - <combo_item name="Land__Encroachment__Particles"> - Terreno > Invasión > PartÃculas - </combo_item> - <combo_item name="Land__Encroachment__Trees_plants"> - Terreno > Invasión > Ãrboles/Plantas - </combo_item> - <combo_item name="Wagering_gambling"> - Apuestas/Juego - </combo_item> - <combo_item name="Other"> - Otra - </combo_item> + <combo_box.item name="Intellectual_property_infringement_Content_Removal" label="Infracción de la propiedad intelectual > Eliminación de contenidos"/> + <combo_box.item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit" label="Infracción de la propiedad intelectual > CopyBot o Exploit (programa malicioso) de permisos"/> + <combo_box.item name="Intolerance" label="Intolerancia"/> + <combo_box.item name="Land__Abuse_of_sandbox_resources" label="Terreno > Abuso de los recursos de un sandbox"/> + <combo_box.item name="Land__Encroachment__Objects_textures" label="Terreno > Invasión > Objetos/Texturas"/> + <combo_box.item name="Land__Encroachment__Particles" label="Terreno > Invasión > PartÃculas"/> + <combo_box.item name="Land__Encroachment__Trees_plants" label="Terreno > Invasión > Ãrboles/Plantas"/> + <combo_box.item name="Wagering_gambling" label="Apuestas/Juego"/> + <combo_box.item name="Other" label="Otra"/> </combo_box> <text name="abuser_name_title"> Nombre del infractor: @@ -170,7 +98,9 @@ Detalles: </text> <text name="bug_aviso"> - Por favor, sea muy concreto sobre la fecha, la localización, la naturaleza de la infracción, el aportar textos relevantes del chat o los MI, y, si es posible, seleccione el objeto. + Por favor, sea muy concreto sobre la fecha, la localización, +la naturaleza de la infracción, el aportar textos relevantes +del chat o los MI, y, si es posible, seleccione el objeto. </text> <text name="incomplete_title"> Nota: las denuncias incompletas no se investigarán. diff --git a/indra/newview/skins/default/xui/es/floater_sell_land.xml b/indra/newview/skins/default/xui/es/floater_sell_land.xml index 26aa56f22bb648d2ca3ee74645fc9e92884dce0b..6d1122a771eff47b81944d3d224087934a7235bd 100644 --- a/indra/newview/skins/default/xui/es/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/es/floater_sell_land.xml @@ -35,15 +35,9 @@ Elija si venderlo a cualquiera o a un comprador concreto. </text> <combo_box name="sell_to"> - <combo_item name="--selectone--"> - -- seleccione -- - </combo_item> - <combo_item name="Anyone"> - Cualquiera - </combo_item> - <combo_item name="Specificuser:"> - Un usuario concreto: - </combo_item> + <combo_box.item name="--selectone--" label="seleccione --" /> + <combo_box.item name="Anyone" label="Cualquiera" /> + <combo_box.item name="Specificuser:" label="Un usuario concreto:" /> </combo_box> <button label="Seleccionar..." name="sell_to_select_agent"/> <text name="sell_objects_label"> @@ -54,12 +48,8 @@ de propietario. </text> <radio_group name="sell_objects" bottom_delta="-58" > - <radio_item name="no"> - No, mantener la propiedad de los objetos - </radio_item> - <radio_item name="yes"> - SÃ, vender los objetos con el terreno - </radio_item> + <radio_item name="no" label="No, mantener la propiedad de los objetos" /> + <radio_item name="yes" label="SÃ, vender los objetos con el terreno" /> </radio_group> <button label="Mostrar los objetos" name="show_objects" width="120"/> <text name="nag_message_label"> diff --git a/indra/newview/skins/default/xui/es/floater_settings_debug.xml b/indra/newview/skins/default/xui/es/floater_settings_debug.xml index 056d71a7bcb48cbe707241333176c2fc04d26f09..1d5ad2f34cdceab163a9cb435f86de2445db1e5e 100644 --- a/indra/newview/skins/default/xui/es/floater_settings_debug.xml +++ b/indra/newview/skins/default/xui/es/floater_settings_debug.xml @@ -1,17 +1,13 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="settings_debug" title="Configuración del depurador"> <combo_box name="boolean_combo"> - <combo_item name="TRUE"> - TRUE - </combo_item> - <combo_item name="FALSE"> - FALSE - </combo_item> + <combo_box.item name="TRUE" label="TRUE" /> + <combo_box.item name="FALSE" label="FALSE" /> </combo_box> <color_swatch label="Color" name="color_swatch"/> <spinner label="x" name="val_spinner_1"/> <spinner label="x" name="val_spinner_2"/> <spinner label="x" name="val_spinner_3"/> <spinner label="x" name="val_spinner_4"/> - <button label="Volver a las opciones por defecto" name="default_btn"/> + <button label="Volver a las opciones por defecto" name="default_btn" width="210"/> </floater> diff --git a/indra/newview/skins/default/xui/es/floater_snapshot.xml b/indra/newview/skins/default/xui/es/floater_snapshot.xml index ad23be31668dafcddd0041f716497aaa185d5ce5..c1ace235030f3baff75905cc91973dbc1c615cfa 100644 --- a/indra/newview/skins/default/xui/es/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/es/floater_snapshot.xml @@ -4,15 +4,9 @@ Destino de la foto </text> <radio_group label="Tipo de la foto" name="snapshot_type_radio"> - <radio_item name="postcard"> - Enviar por correo electrónico - </radio_item> - <radio_item name="texture"> - Guardarla en su inventario ([AMOUNT] L$) - </radio_item> - <radio_item name="local"> - Guardarla en su disco duro - </radio_item> + <radio_item name="postcard" label="Enviar por correo electrónico" /> + <radio_item name="texture" label="Guardarla en su inventario ([AMOUNT] L$)" /> + <radio_item name="local" label="Guardarla en su disco duro" /> </radio_group> <text name="file_size_label"> Tamaño del archivo: [SIZE] KB @@ -21,12 +15,8 @@ <button label="Enviar" name="send_btn"/> <button label="Guardar ([AMOUNT] L$)" name="upload_btn"/> <flyout_button label="Guardar" name="save_btn" tool_tip="Guardar la imagen en un archivo"> - <flyout_button_item name="save_item"> - Guardar - </flyout_button_item> - <flyout_button_item name="saveas_item"> - Guardar como... - </flyout_button_item> + <flyout_button_item name="save_item" label="Guardar"/> + <flyout_button_item name="saveas_item" label="Guardar como..."/> </flyout_button> <button label="Cancelar" name="discard_btn"/> <button label="Más >>" name="more_btn" tool_tip="Opciones avanzadas"/> @@ -38,99 +28,51 @@ Formato </text> <combo_box label="Resolución" name="postcard_size_combo"> - <combo_item name="CurrentWindow"> - Ventana actual - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="Custom"> - Personalizar - </combo_item> + <combo_box.item name="CurrentWindow" label="Ventana actual"/> + <combo_box.item name="640x480" label="640x480"/> + <combo_box.item name="800x600" label="800x600"/> + <combo_box.item name="1024x768" label="1024x768"/> + <combo_box.item name="Custom" label="Personalizar"/> </combo_box> <combo_box label="Resolución" name="texture_size_combo"> - <combo_item name="CurrentWindow"> - Ventana actual - </combo_item> - <combo_item name="Small(128x128)"> - Pequeño (128x128) - </combo_item> - <combo_item name="Medium(256x256)"> - Medio (256x256) - </combo_item> - <combo_item name="Large(512x512)"> - Grande (512x512) - </combo_item> - <combo_item name="Custom"> - Personalizar - </combo_item> + <combo_box.item name="CurrentWindow" label="Ventana actual"/> + <combo_box.item name="Small(128x128)" label="Pequeño (128x128)"/> + <combo_box.item name="Medium(256x256)" label="Medio (256x256)"/> + <combo_box.item name="Large(512x512)" label="Grande (512x512)"/> + <combo_box.item name="Custom" label="Personalizar"/> </combo_box> <combo_box label="Resolución" name="local_size_combo"> - <combo_item name="CurrentWindow"> - Ventana actual - </combo_item> - <combo_item name="320x240"> - 320x240 - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="1280x1024"> - 1280x1024 - </combo_item> - <combo_item name="1600x1200"> - 1600x1200 - </combo_item> - <combo_item name="Custom"> - Personalizar - </combo_item> + <combo_box.item name="CurrentWindow" label="Ventana actual"/> + <combo_box.item name="320x240" label="320x240"/> + <combo_box.item name="640x480" label="640x480"/> + <combo_box.item name="800x600" label="800x600"/> + <combo_box.item name="1024x768" label="1024x768"/> + <combo_box.item name="1280x1024" label="1280x1024"/> + <combo_box.item name="1600x1200" label="1600x1200"/> + <combo_box.item name="Custom" label="Personalizar"/> </combo_box> <combo_box label="Formato" name="local_format_combo"> - <combo_item name="PNG"> - PNG - </combo_item> - <combo_item name="JPEG"> - JPEG - </combo_item> - <combo_item name="BMP"> - BMP - </combo_item> + <combo_box.item name="PNG" label="PNG"/> + <combo_box.item name="JPEG" label="JPEG"/> + <combo_box.item name="BMP" label="BMP"/> </combo_box> - <spinner label="Ancho" name="snapshot_width"/> - <spinner label="Alto" name="snapshot_height"/> + <spinner label="Ancho" name="snapshot_width" label_width="41" width="101"/> + <spinner label="Alto" name="snapshot_height" label_width="30" width="90" left="121"/> <check_box label="Mantener las proporciones" name="keep_aspect_check"/> <slider label="Calidad de la imagen" name="image_quality_slider"/> <text name="layer_type_label"> Captura: </text> <combo_box label="Capas de la imagen" name="layer_types"> - <combo_item name="Colors"> - Colores - </combo_item> - <combo_item name="Depth"> - Profundidad - </combo_item> - <combo_item name="ObjectMattes"> - Bandas negras - </combo_item> + <combo_box.item name="Colors" label="Colores"/> + <combo_box.item name="Depth" label="Profundidad"/> + <combo_box.item name="ObjectMattes" label="Bandas negras"/> </combo_box> <check_box label="Incluir la interfaz en la foto" name="ui_check"/> - <check_box label="Incluir los HUD en la foto" name="hud_check"/> - <check_box label="Mantenerla abierta tras guardarla" name="keep_open_check"/> - <check_box label="Congelar la toma (vista previa en pantalla completa)" name="freeze_frame_check"/> - <check_box label="Actualizar automáticamente" name="auto_snapshot_check"/> + <check_box bottom_delta="-17" label="Incluir los HUD en la foto" name="hud_check"/> + <check_box bottom_delta="-17" label="Mantenerla abierta tras guardarla" name="keep_open_check"/> + <check_box bottom_delta="-17" label="Congelar la toma (vista previa en pantalla completa)" name="freeze_frame_check"/> + <check_box bottom_delta="-29" label="Actualizar automáticamente" name="auto_snapshot_check"/> <string name="unknown"> desconocido </string> diff --git a/indra/newview/skins/default/xui/es/floater_world_map.xml b/indra/newview/skins/default/xui/es/floater_world_map.xml index aad417790f66a3f5345d3e143ac8fd0897b8ea12..3bfae282cb709c482fa06972c98b843a8be6709f 100644 --- a/indra/newview/skins/default/xui/es/floater_world_map.xml +++ b/indra/newview/skins/default/xui/es/floater_world_map.xml @@ -28,14 +28,10 @@ <check_box label="'Mature'" name="event_mature_chk"/> <check_box label="'Adult'" name="event_adult_chk"/> <combo_box label="Amigos conectados" name="friend combo" tool_tip="Amigo a mostrar en el mapa"> - <combo_item name="none_selected"> - Amigos conectados - </combo_item> + <combo_box.item name="none_selected" label="Amigos conectados" /> </combo_box> <combo_box label="Hitos" name="landmark combo" tool_tip="Hito a mostrar en el mapa"> - <combo_item name="none_selected"> - Hitos - </combo_item> + <combo_box.item name="none_selected" label="Hitos" /> </combo_box> <line_editor label="Buscar por el nombre de la región" name="location" tool_tip="Escriba el nombre de una región"/> <button label="Buscar" name="DoSearch" tool_tip="Buscar una región"/> diff --git a/indra/newview/skins/default/xui/es/panel_login.xml b/indra/newview/skins/default/xui/es/panel_login.xml index 04edcc4faaf965c97c748c897f6691b0ed84f552..8c3d7ae5755587a91836fb19b65e3ee85b4ae82e 100644 --- a/indra/newview/skins/default/xui/es/panel_login.xml +++ b/indra/newview/skins/default/xui/es/panel_login.xml @@ -19,15 +19,9 @@ Posición inicial: </text> <combo_box name="start_location_combo"> - <combo_item name="MyHome"> - Mi Base - </combo_item> - <combo_item name="MyLastLocation"> - Mi última posición - </combo_item> - <combo_item name="Typeregionname"> - <Escriba el nombre de la Región> - </combo_item> + <combo_box.item name="MyHome" label="Mi Base"/> + <combo_box.item name="MyLastLocation" label="Mi última posición"/> + <combo_box.item name="Typeregionname" label="lt;Escriba el nombre de la Región>"/> </combo_box> <check_box label="Recordar la contraseña" name="remember_check"/> <button label="Iniciar sesión" label_selected="Iniciar sesión" name="connect_btn"/> diff --git a/indra/newview/skins/default/xui/es/panel_preferences_chat.xml b/indra/newview/skins/default/xui/es/panel_preferences_chat.xml index 0e092e58a29be23bde5aafb49287e518829f9584..b8c9cc5b448590b4450655560b1f7927d2f9ab6b 100644 --- a/indra/newview/skins/default/xui/es/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/es/panel_preferences_chat.xml @@ -1,18 +1,13 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Chat de texto" name="chat"> <text length="1" name="text_box" type="string"> - Tamaño de la fuente del chat: + Tamaño de la fuente +del chat: </text> <radio_group name="chat_font_size"> - <radio_item name="radio"> - Pequeño - </radio_item> - <radio_item name="radio2"> - Medio - </radio_item> - <radio_item name="radio3"> - Grande - </radio_item> + <radio_item name="radio" label="Pequeño" /> + <radio_item name="radio2" label="Medio" /> + <radio_item name="radio3" label="Grande" /> </radio_group> <text length="1" name="text_box2" type="string"> Color del chat: @@ -35,7 +30,7 @@ </text> <spinner label="Quitar el chat tras" name="fade_chat_time" label_width="95" width="145" /> <text length="1" name="text_box4" type="string" left="297" > - (s) + (seg.) </text> <text length="1" name="text_box5" type="string"> (# lÃneas) diff --git a/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml index 03eb802117dc0f4555a5da18bf0a3efcd61f1012..7e19c6dd6bfc077b9abe7d0016de45d02a5207e5 100644 --- a/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml @@ -2,57 +2,40 @@ <panel label="Gráficos" name="Display panel"> <button label="?" name="GraphicsPreferencesHelpButton"/> <check_box label="Abrir Second Life en una ventana" name="windowed mode"/> - <text_editor name="FullScreenInfo"> + <text_editor name="FullScreenInfo" width="480"> Si no está marcado, el visor se mostrará en pantalla completa cuando inicie sesión. </text_editor> <text name="WindowSizeLabel"> Tamaño de la ventana: </text> - <combo_box name="windowsize combo"> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="720x480"> - 720x480 (NTSC) - </combo_item> - <combo_item name="768x576"> - 768x576 (PAL) - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> + <combo_box left="124" name="windowsize combo"> + <combo_box.item name="640x480" label="640x480"/> + <combo_box.item name="800x600" label="800x600"/> + <combo_box.item name="720x480" label="720x480 (NTSC)"/> + <combo_box.item name="768x576" label="768x576 (PAL)"/> + <combo_box.item name="1024x768" label="1024x768"/> </combo_box> <text name="DisplayResLabel"> Resolución: </text> + <combo_box left="124" name="fullscreen combo" /> <text name="AspectRatioLabel1" tool_tip="ancho / alto"> Proporción: </text> - <combo_box name="aspect_ratio" tool_tip="ancho / alto"> - <combo_item length="1" name="4:3(StandardCRT)" type="string"> - 4:3 (Standard CRT) - </combo_item> - <combo_item length="1" name="5:4(1280x1024LCD)" type="string"> - 5:4 (1280x1024 LCD) - </combo_item> - <combo_item name="8:5(Widescreen)"> - 8:5 (Widescreen) - </combo_item> - <combo_item length="1" name="16:9(Widescreen)" type="string"> - 16:9 (Widescreen) - </combo_item> + <combo_box left="124" name="aspect_ratio" tool_tip="ancho / alto"> + <combo_box.item length="1" name="4:3(StandardCRT)" type="string" label="4:3 (Standard CRT)"/> + <combo_box.item length="1" name="5:4(1280x1024LCD)" type="string" label="5:4 (1280x1024 LCD)"/> + <combo_box.item name="8:5(Widescreen)" label="8:5 (Widescreen)"/> + <combo_box.item length="1" name="16:9(Widescreen)" type="string" label="16:9 (Widescreen)"/> </combo_box> - <check_box label="Detectar automáticamente la proporción" name="aspect_auto_detect"/> + <check_box label="Detectar automáticamente la proporción" name="aspect_auto_detect" left="295" /> <text name="HigherText"> Calidad y </text> <text name="QualityText"> Rendimiento: </text> - <text name="FasterText"> + <text name="FasterText" left="95"> El más rápido </text> <text name="ShadersPrefText"> @@ -67,11 +50,11 @@ <text name="ShadersPrefText4"> Ultra </text> - <text name="HigherText2"> + <text name="HigherText2" left="325" > Más alto </text> - <text name="QualityText2"> - Calidad + <text name="QualityText2" left="325" > + calidad </text> <check_box label="Personalizar" name="CustomSettings"/> <text name="ShadersText"> @@ -85,18 +68,10 @@ Objetos reflejados: </text> <radio_group name="ReflectionDetailRadio"> - <radio_item name="0"> - Terreno y árboles - </radio_item> - <radio_item name="1"> - Todos los objetos estáticos - </radio_item> - <radio_item name="2"> - Todos los avatares y objetos - </radio_item> - <radio_item name="3"> - Todo - </radio_item> + <radio_item name="0" label="Terreno y árboles" /> + <radio_item name="1" label="Todos los objetos estáticos" /> + <radio_item name="2" label="Todos los avatares y objetos" /> + <radio_item name="3" label="Todo" /> </radio_group> <text name="AvatarRenderingText"> Renderización del avatar: @@ -112,16 +87,16 @@ </text> <slider label="Distancia de dibujo:" name="DrawDistance"/> <slider label="Núm. máx. de partÃculas:" name="MaxParticleCount"/> - <slider label="Calidad del procesamiento:" name="RenderPostProcess"/> + <slider label="Calidad del procesamiento:" name="RenderPostProcess" label_width="142"/> <text name="MeshDetailText"> Detalle de la malla: </text> - <slider label="Objetos:" name="ObjectMeshDetail"/> - <slider label="Prims flexibles:" name="FlexibleMeshDetail"/> - <slider label="Ãrboles:" name="TreeMeshDetail"/> - <slider label="Avatares:" name="AvatarMeshDetail"/> - <slider label="Terreno:" name="TerrainMeshDetail"/> - <slider label="Cielo:" name="SkyMeshDetail"/> + <slider label=" Objetos:" name="ObjectMeshDetail"/> + <slider label=" Prims flexibles:" name="FlexibleMeshDetail"/> + <slider label=" Ãrboles:" name="TreeMeshDetail"/> + <slider label=" Avatares:" name="AvatarMeshDetail"/> + <slider label=" Terreno:" name="TerrainMeshDetail"/> + <slider label=" Cielo:" name="SkyMeshDetail"/> <text name="PostProcessText"> Baja </text> @@ -143,30 +118,23 @@ <text name="SkyMeshDetailText"> Bajo </text> - <text name="LightingDetailText"> + <text name="LightingDetailText" width="135"> Detalles de la iluminación: </text> <radio_group name="LightingDetailRadio"> - <radio_item name="SunMoon"> - Sólo el Sol y la Luna - </radio_item> - <radio_item name="LocalLights"> - Puntos de luz cercanos - </radio_item> + <radio_item name="SunMoon" label="Sólo el Sol y la Luna" /> + <radio_item name="LocalLights" label="Puntos de luz cercanos" /> </radio_group> <text name="TerrainDetailText"> - Nivel de detalle del terreno: - </text> - <radio_group name="TerrainDetailRadio"> - <radio_item name="0"> - Bajo - </radio_item> - <radio_item name="2"> - Alto - </radio_item> + Nivel de detalle del + terreno: + </text> + <radio_group name="TerrainDetailRadio" left_delta="60"> + <radio_item name="0" label="Bajo" /> + <radio_item name="2" label="Alto" /> </radio_group> - <button label="Configuraciones recomendadas" name="Defaults"/> - <button label="Opciones del hardware" label_selected="Opciones del hardware" name="GraphicsHardwareButton"/> + <button label="Configuraciones recomendadas" name="Defaults" width="195" left="110"/> + <button label="Opciones del hardware" label_selected="Opciones del hardware" name="GraphicsHardwareButton" left="315"/> <string name="resolution_format"> [RES_X] x [RES_Y] </string> diff --git a/indra/newview/skins/default/xui/fr/floater_animation_preview.xml b/indra/newview/skins/default/xui/fr/floater_animation_preview.xml index 66e12be5cfe2d92b761eebd17956288b1d36b6e2..af6cb41ba857de2b6c95a4445cad3ee5e8691c20 100644 --- a/indra/newview/skins/default/xui/fr/floater_animation_preview.xml +++ b/indra/newview/skins/default/xui/fr/floater_animation_preview.xml @@ -11,18 +11,10 @@ Prévisualiser pendant </text> <combo_box label="" name="preview_base_anim" tool_tip="Utilisez cette option pour tester votre animation pendant que votre avatar fait des choses banales." left_delta="116" width="124"> - <combo_item name="Standing"> - Debout - </combo_item> - <combo_item name="Walking"> - En train de marcher - </combo_item> - <combo_item name="Sitting"> - Assis - </combo_item> - <combo_item name="Flying"> - En train de voler - </combo_item> + <combo_box.item name="Standing" label="Debout" /> + <combo_box.item name="Walking" label="En train de marcher" /> + <combo_box.item name="Sitting" label="Assis" /> + <combo_box.item name="Flying" label="En train de voler" /> </combo_box> <check_box left="6" label="Boucle" name="loop_check" tool_tip="Joue cette animation en boucle."/> <spinner left="76" label_width="55" width="105" label="Début (%)" name="loop_in_point" tool_tip="Définit le moment de l'animation où la boucle repart."/> @@ -31,110 +23,44 @@ Mouvement de main </text> <combo_box label="" name="hand_pose_combo" tool_tip="Contrôle le mouvement des mains au cours de l'animation" left_delta="116" width="124"> - <combo_item name="Spread"> - Doigts écartés - </combo_item> - <combo_item name="Relaxed"> - Détendues - </combo_item> - <combo_item name="PointBoth"> - Pointer (les deux) - </combo_item> - <combo_item name="Fist"> - Poing - </combo_item> - <combo_item name="RelaxedLeft"> - Détendue (gauche) - </combo_item> - <combo_item name="PointLeft"> - Pointer (gauche) - </combo_item> - <combo_item name="FistLeft"> - Poing (gauche) - </combo_item> - <combo_item name="RelaxedRight"> - Détendue (droite) - </combo_item> - <combo_item name="PointRight"> - Pointer (droite) - </combo_item> - <combo_item name="FistRight"> - Poing (droite) - </combo_item> - <combo_item name="SaluteRight"> - Saluer (droite) - </combo_item> - <combo_item name="Typing"> - Taper - </combo_item> - <combo_item name="PeaceRight"> - Paix (main droite) - </combo_item> + <combo_box.item name="Spread" label="Doigts écartés" /> + <combo_box.item name="Relaxed" label="Détendues" /> + <combo_box.item name="PointBoth" label="Pointer (les deux)" /> + <combo_box.item name="Fist" label="Poing" /> + <combo_box.item name="RelaxedLeft" label="Détendue (gauche)" /> + <combo_box.item name="PointLeft" label="Pointer (gauche)" /> + <combo_box.item name="FistLeft" label="Poing (gauche)" /> + <combo_box.item name="RelaxedRight" label="Détendue (droite)" /> + <combo_box.item name="PointRight" label="Pointer (droite)" /> + <combo_box.item name="FistRight" label="Poing (droite)" /> + <combo_box.item name="SaluteRight" label="Saluer (droite)" /> + <combo_box.item name="Typing" label="Taper" /> + <combo_box.item name="PeaceRight" label="Paix (main droite)" /> </combo_box> <text name="emote_label"> Expression </text> <combo_box label="" name="emote_combo" tool_tip="Contrôle l'expression du visage au cours de l'animation." left_delta="116" width="124"> - <combo_item name="[None]"> - [None] - </combo_item> - <combo_item name="Aaaaah"> - Aaaaah - </combo_item> - <combo_item name="Afraid"> - Effrayé - </combo_item> - <combo_item name="Angry"> - En colère - </combo_item> - <combo_item name="BigSmile"> - Grand sourire - </combo_item> - <combo_item name="Bored"> - Ennui - </combo_item> - <combo_item name="Cry"> - Pleurer - </combo_item> - <combo_item name="Disdain"> - Mépris - </combo_item> - <combo_item name="Embarrassed"> - Gêne - </combo_item> - <combo_item name="Frown"> - Froncer les sourcils - </combo_item> - <combo_item name="Kiss"> - Embrasser - </combo_item> - <combo_item name="Laugh"> - Rire - </combo_item> - <combo_item name="Plllppt"> - Plllppt - </combo_item> - <combo_item name="Repulsed"> - Dégoût - </combo_item> - <combo_item name="Sad"> - Triste - </combo_item> - <combo_item name="Shrug"> - Hausser les épaules - </combo_item> - <combo_item name="Smile"> - Sourire - </combo_item> - <combo_item name="Surprise"> - Surprise - </combo_item> - <combo_item name="Wink"> - Clin d'Å“il - </combo_item> - <combo_item name="Worry"> - Soucis - </combo_item> + <combo_box.item name="[None]" label="None]" /> + <combo_box.item name="Aaaaah" label="Aaaaah" /> + <combo_box.item name="Afraid" label="Effrayé" /> + <combo_box.item name="Angry" label="En colère" /> + <combo_box.item name="BigSmile" label="Grand sourire" /> + <combo_box.item name="Bored" label="Ennui" /> + <combo_box.item name="Cry" label="Pleurer" /> + <combo_box.item name="Disdain" label="Mépris" /> + <combo_box.item name="Embarrassed" label="Gêne" /> + <combo_box.item name="Frown" label="Froncer les sourcils" /> + <combo_box.item name="Kiss" label="Embrasser" /> + <combo_box.item name="Laugh" label="Rire" /> + <combo_box.item name="Plllppt" label="Plllppt" /> + <combo_box.item name="Repulsed" label="Dégoût" /> + <combo_box.item name="Sad" label="Triste" /> + <combo_box.item name="Shrug" label="Hausser les épaules" /> + <combo_box.item name="Smile" label="Sourire" /> + <combo_box.item name="Surprise" label="Surprise" /> + <combo_box.item name="Wink" label="Clin d'Å“il" /> + <combo_box.item name="Worry" label="Soucis" /> </combo_box> <spinner label_width="65" label="Transition début (s)" name="ease_in_time" tool_tip="Durée (en secondes) pendant laquelle l'animation s'intègre au mouvement."/> <spinner label_width="65" left="160" width="125" label="Transition fin (s)" name="ease_out_time" tool_tip="Durée (en secondes) pendant laquelle l'animation disparaît du mouvement."/> diff --git a/indra/newview/skins/default/xui/fr/floater_auction.xml b/indra/newview/skins/default/xui/fr/floater_auction.xml index 6fe3f66e13a3abe2d30f10e4654c1dcfa868d619..4bdf9df1beb17101fa21a3fbb0d18de22f8f201a 100644 --- a/indra/newview/skins/default/xui/fr/floater_auction.xml +++ b/indra/newview/skins/default/xui/fr/floater_auction.xml @@ -2,12 +2,8 @@ <floater name="floater_auction" title="Commencer la vente de terrain Linden"> <check_box label="Inclure le marquage de sélection jaune" name="fence_check" /> <combo_box name="saletype_combo"> - <combo_item name="Auction"> - Enchères - </combo_item> - <combo_item name="FirstLand"> - Premier terrain - </combo_item> + <combo_box.item name="Auction" label="Enchères" /> + <combo_box.item name="FirstLand" label="Premier terrain" /> </combo_box> <button label="Capture d'écran" label_selected="Capture d'écran" name="snapshot_btn" width="110" /> diff --git a/indra/newview/skins/default/xui/fr/floater_buy_land.xml b/indra/newview/skins/default/xui/fr/floater_buy_land.xml index 80b40ca5e3fa1e830d5db73248853ac8d9c646e1..aaf1577114bfb62fd7d71e663e935ef4a8eb0171 100644 --- a/indra/newview/skins/default/xui/fr/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/fr/floater_buy_land.xml @@ -36,6 +36,7 @@ <text name="covenant_text"> Vous devez accepter le règlement du domaine : </text> + <text left="470" name="covenant_timestamp_text"/> <text_editor name="covenant_editor"> Chargement... </text_editor> @@ -74,15 +75,9 @@ Seuls les membres Premium peuvent posséder du terrain. </text> <combo_box name="account_level"> - <combo_item name="US$9.95/month,billedmonthly"> - 9,95 US$/mois, facturation mensuelle - </combo_item> - <combo_item name="US$7.50/month,billedquarterly"> - 7,50 US$/mois, facturation trimestrielle - </combo_item> - <combo_item name="US$6.00/month,billedannually"> - 6,00 US$/mois, facturation annuelle - </combo_item> + <combo_box.item name="US$9.95/month,billedmonthly" label="9,95 US$/mois, facturation mensuelle"/> + <combo_box.item name="US$7.50/month,billedquarterly" label="7,50 US$/mois, facturation trimestrielle"/> + <combo_box.item name="US$6.00/month,billedannually" label="6,00 US$/mois, facturation annuelle"/> </combo_box> <text name="land_use_action"> Augmentez vos frais d'occupation de terrain à 40 US$/mois. diff --git a/indra/newview/skins/default/xui/fr/floater_god_tools.xml b/indra/newview/skins/default/xui/fr/floater_god_tools.xml index 81b69eb110395ddc9208783f2d2385b96eeff19a..4f43be47eaf39d3178490050ffbc4f09b96fb80a 100644 --- a/indra/newview/skins/default/xui/fr/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/fr/floater_god_tools.xml @@ -78,29 +78,17 @@ Destination : </text> <combo_box name="destination"> - <combo_item name="Selection"> - Sélection - </combo_item> - <combo_item name="AgentRegion"> - Région de l'avatar - </combo_item> + <combo_box.item name="Selection" label="Sélection" /> + <combo_box.item name="AgentRegion" label="Région de l'avatar" /> </combo_box> <text name="Request:"> Requête : </text> <combo_box name="request"> - <combo_item name="colliders<steps>"> - Objets responsables de collisions : étapes - </combo_item> - <combo_item name="scripts<count>,<optionalpattern>"> - Nombre de scripts et schéma optionnel - </combo_item> - <combo_item name="objects<pattern>"> - Schéma des objets - </combo_item> - <combo_item name="rez<asset_id>"> - rezzer <asset_id> - </combo_item> + <combo_box.item name="colliders<steps>" label="Objets responsables de collisions : étapes" /> + <combo_box.item name="scripts<count>,<optionalpattern>" label="Nombre de scripts et schéma optionnel" /> + <combo_box.item name="objects<pattern>" label="Schéma des objets" /> + <combo_box.item name="rez<asset_id>" label="rezzer <asset_id>" /> </combo_box> <text name="Parameter:"> Paramètre : diff --git a/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml b/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml index e3624c7ccbbbc5eaf72481260984fada533a3094..11d7fc28e947d644422e71abc5c0667b50d1e4b8 100644 --- a/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/fr/floater_hardware_settings.xml @@ -8,21 +8,11 @@ Anti-aliasing : </text> <combo_box label="Anti-aliasing" name="fsaa" width="84"> - <combo_item name="FSAADisabled"> - Désactivé - </combo_item> - <combo_item name="2x"> - 2x - </combo_item> - <combo_item name="4x"> - 4x - </combo_item> - <combo_item name="8x"> - 8x - </combo_item> - <combo_item name="16x"> - 16x - </combo_item> + <combo_box.item name="FSAADisabled" label="Désactivé" /> + <combo_box.item name="2x" label="2x" /> + <combo_box.item name="4x" label="4x" /> + <combo_box.item name="8x" label="8x" /> + <combo_box.item name="16x" label="16x" /> </combo_box> <spinner label="Gamma :" name="gamma"/> <text left="217" name="(brightness, lower is brighter)"> diff --git a/indra/newview/skins/default/xui/fr/floater_image_preview.xml b/indra/newview/skins/default/xui/fr/floater_image_preview.xml index 3727e3590da5222dd8c923c318519084584936c7..f12c1fee448736f04c70de54f3b395c65e803502 100644 --- a/indra/newview/skins/default/xui/fr/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/fr/floater_image_preview.xml @@ -10,36 +10,16 @@ Prévisualiser comme : </text> <combo_box label="Habits" name="clothing_type_combo" left="126" > - <combo_item name="Image"> - Image - </combo_item> - <combo_item name="Hair"> - Cheveux - </combo_item> - <combo_item name="FemaleHead"> - Tête de femme - </combo_item> - <combo_item name="FemaleUpperBody"> - Corps de femme (haut) - </combo_item> - <combo_item name="FemaleLowerBody"> - Corps de femme (bas) - </combo_item> - <combo_item name="MaleHead"> - Tête d'homme - </combo_item> - <combo_item name="MaleUpperBody"> - Corps d'homme (haut) - </combo_item> - <combo_item name="MaleLowerBody"> - Corps d'homme (bas) - </combo_item> - <combo_item name="Skirt"> - Jupe - </combo_item> - <combo_item name="SculptedPrim"> - Sculptie - </combo_item> + <combo_box.item name="Image" label="Image" /> + <combo_box.item name="Hair" label="Cheveux" /> + <combo_box.item name="FemaleHead" label="Tête de femme" /> + <combo_box.item name="FemaleUpperBody" label="Corps de femme (haut)" /> + <combo_box.item name="FemaleLowerBody" label="Corps de femme (bas)" /> + <combo_box.item name="MaleHead" label="Tête d'homme" /> + <combo_box.item name="MaleUpperBody" label="Corps d'homme (haut)" /> + <combo_box.item name="MaleLowerBody" label="Corps d'homme (bas)" /> + <combo_box.item name="Skirt" label="Jupe" /> + <combo_box.item name="SculptedPrim" label="Sculptie" /> </combo_box> <text name="bad_image_text"> Impossible de lire l'image. diff --git a/indra/newview/skins/default/xui/fr/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/fr/floater_inventory_item_properties.xml index 92dbc36a039a3ca7c77e929f56f04a516143c208..ec83d5bcaa20843f6961c1b3ad02c29cb83efc70 100644 --- a/indra/newview/skins/default/xui/fr/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/fr/floater_inventory_item_properties.xml @@ -60,12 +60,8 @@ </text> <check_box label="À vendre" name="CheckPurchase"/> <radio_group name="RadioSaleType"> - <radio_item name="radio"> - Original - </radio_item> - <radio_item name="radio2"> - Copie - </radio_item> + <radio_item name="radio" label="Original" /> + <radio_item name="radio2" label="Copie" /> </radio_group> <text name="TextPrice"> Prix : L$ diff --git a/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml b/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml index 5322993b0b9c2834b4b6a7f55cb39d2747c2e396..b2c3d18cbd1fd6a061e01ebfa223e99fb2599286 100644 --- a/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml @@ -49,15 +49,12 @@ simultanément, sauf si vous ajoutez des pauses. </text> <radio_group name="animation_trigger_type"> - <radio_item name="start"> - Commencer - </radio_item> - <radio_item name="stop"> - Stop - </radio_item> + <radio_item name="start" label="Commencer" /> + <radio_item name="stop" label="Stop" /> </radio_group> <check_box label="jusqu'à la fin des animations" name="wait_anim_check" /> <check_box label="temps en secondes" name="wait_time_check" /> + <line_editor left_delta="130" name="wait_time_editor" /> <check_box label="Actifs" name="active_check" tool_tip="Les gestes actifs peuvent être déclenchés en saisissant leur raccourci dans le chat ou en appuyant sur les raccourcis. Les gestes deviennent généralement inactifs lorsqu'il y a un conflit entre les raccourcis." /> <button label="Prévisualiser" name="preview_btn" width="86" /> diff --git a/indra/newview/skins/default/xui/fr/floater_sell_land.xml b/indra/newview/skins/default/xui/fr/floater_sell_land.xml index cf394643bcfd481db74665fd41cc17988a706fe0..6ef12fab4a6d1fe8cd906b711b7c2361f705d60a 100644 --- a/indra/newview/skins/default/xui/fr/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/fr/floater_sell_land.xml @@ -37,15 +37,9 @@ parcelle : spécifique. </text> <combo_box name="sell_to" bottom_delta="-32"> - <combo_item name="--selectone--"> - -- Sélectionnez -- - </combo_item> - <combo_item name="Anyone"> - N'importe qui - </combo_item> - <combo_item name="Specificuser:"> - Acheteur spécifique : - </combo_item> + <combo_box.item name="--selectone--" label="Sélectionnez --" /> + <combo_box.item name="Anyone" label="N'importe qui" /> + <combo_box.item name="Specificuser:" label="Acheteur spécifique :" /> </combo_box> <button label="Sélectionner..." name="sell_to_select_agent" width="100"/> <text name="sell_objects_label"> @@ -56,12 +50,8 @@ spécifique. de propriétaire. </text> <radio_group name="sell_objects" right="430" bottom_delta="-54"> - <radio_item name="no"> - Non, rester le propriétaire des objets - </radio_item> - <radio_item name="yes"> - Oui, vendre les objets avec le terrain - </radio_item> + <radio_item name="no" label="Non, rester le propriétaire des objets" /> + <radio_item name="yes" label="Oui, vendre les objets avec le terrain" /> </radio_group> <button label="Afficher les objets" name="show_objects" right="420" width="120"/> <text name="nag_message_label" bottom_delta="-30"> diff --git a/indra/newview/skins/default/xui/fr/floater_settings_debug.xml b/indra/newview/skins/default/xui/fr/floater_settings_debug.xml index 30183340fc14aafd6a9d8291963de9b07861b34d..e67b8e2f797b435d7da1c03aa7e2110e773cad62 100644 --- a/indra/newview/skins/default/xui/fr/floater_settings_debug.xml +++ b/indra/newview/skins/default/xui/fr/floater_settings_debug.xml @@ -1,12 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater name="settings_debug" title="Paramétrages du mode Debug"> <combo_box name="boolean_combo"> - <combo_item name="TRUE"> - TRUE - </combo_item> - <combo_item name="FALSE"> - FALSE - </combo_item> + <combo_box.item name="TRUE" label="TRUE" /> + <combo_box.item name="FALSE" label="FALSE" /> </combo_box> <color_swatch label="Couleur" name="color_swatch" width="43" /> <spinner label="x" name="val_spinner_1" /> diff --git a/indra/newview/skins/default/xui/fr/floater_snapshot.xml b/indra/newview/skins/default/xui/fr/floater_snapshot.xml index 4351a1a7897109359f509c64a7c56c158a68db84..90feea91e092228ac02ff939c63a2979989b13b5 100644 --- a/indra/newview/skins/default/xui/fr/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/fr/floater_snapshot.xml @@ -4,15 +4,9 @@ Destination de la photo </text> <radio_group label="Type de photo" name="snapshot_type_radio" width="228"> - <radio_item name="postcard"> - Envoyer par e-mail - </radio_item> - <radio_item name="texture"> - Enregistrer dans votre inventaire ([AMOUNT] L$) - </radio_item> - <radio_item name="local"> - Enregistrer sur votre disque dur - </radio_item> + <radio_item name="postcard" label="Envoyer par e-mail" /> + <radio_item name="texture" label="Enregistrer dans votre inventaire ([AMOUNT] L$)" /> + <radio_item name="local" label="Enregistrer sur votre disque dur" /> </radio_group> <button label="Plus >>" name="more_btn" tool_tip="Options avancées"/> <button label="<< Moins" name="less_btn" tool_tip="Options avancées"/> @@ -23,75 +17,33 @@ Format </text> <combo_box label="Résolution" name="postcard_size_combo"> - <combo_item name="640x480"> - 640 x 480 - </combo_item> - <combo_item name="800x600"> - 800 x 600 - </combo_item> - <combo_item name="1024x768"> - 1024 x 768 - </combo_item> - <combo_item name="CurrentWindow"> - Fenêtre actuelle - </combo_item> - <combo_item name="Custom"> - Personnaliser - </combo_item> + <combo_box.item name="640x480" label="640 x 480" /> + <combo_box.item name="800x600" label="800 x 600" /> + <combo_box.item name="1024x768" label="1024 x 768" /> + <combo_box.item name="CurrentWindow" label="Fenêtre actuelle" /> + <combo_box.item name="Custom" label="Personnaliser" /> </combo_box> <combo_box label="Résolution" name="texture_size_combo"> - <combo_item name="CurrentWindow"> - Fenêtre actuelle - </combo_item> - <combo_item name="Small(128x128)"> - Petite (128 x 128) - </combo_item> - <combo_item name="Medium(256x256)"> - Moyenne (256 x 256) - </combo_item> - <combo_item name="Large(512x512)"> - Grande (512 x 512) - </combo_item> - <combo_item name="Custom"> - Personnaliser - </combo_item> + <combo_box.item name="CurrentWindow" label="Fenêtre actuelle" /> + <combo_box.item name="Small(128x128)" label="Petite (128 x 128)" /> + <combo_box.item name="Medium(256x256)" label="Moyenne (256 x 256)" /> + <combo_box.item name="Large(512x512)" label="Grande (512 x 512)" /> + <combo_box.item name="Custom" label="Personnaliser" /> </combo_box> <combo_box label="Résolution" name="local_size_combo"> - <combo_item name="CurrentWindow"> - Fenêtre actuelle - </combo_item> - <combo_item name="320x240"> - 320 x 240 - </combo_item> - <combo_item name="640x480"> - 640 x 480 - </combo_item> - <combo_item name="800x600"> - 800 x 600 - </combo_item> - <combo_item name="1024x768"> - 1024 x 768 - </combo_item> - <combo_item name="1280x1024"> - 1280 x 1024 - </combo_item> - <combo_item name="1600x1200"> - 1600 x 1200 - </combo_item> - <combo_item name="Custom"> - Personnaliser - </combo_item> + <combo_box.item name="CurrentWindow" label="Fenêtre actuelle" /> + <combo_box.item name="320x240" label="320 x 240" /> + <combo_box.item name="640x480" label="640 x 480" /> + <combo_box.item name="800x600" label="800 x 600" /> + <combo_box.item name="1024x768" label="1024 x 768" /> + <combo_box.item name="1280x1024" label="1280 x 1024" /> + <combo_box.item name="1600x1200" label="1600 x 1200" /> + <combo_box.item name="Custom" label="Personnaliser" /> </combo_box> <combo_box label="Format" name="local_format_combo"> - <combo_item name="PNG"> - PNG - </combo_item> - <combo_item name="JPEG"> - JPEG - </combo_item> - <combo_item name="BMP"> - BMP - </combo_item> + <combo_box.item name="PNG" label="PNG" /> + <combo_box.item name="JPEG" label="JPEG" /> + <combo_box.item name="BMP" label="BMP" /> </combo_box> <spinner label="Largeur" label_width="41" name="snapshot_width" width="101"/> <spinner label="Hauteur" label_width="41" left="121" name="snapshot_height" width="101"/> @@ -100,15 +52,9 @@ Capturer : </text> <combo_box label="Couches de l'image" name="layer_types"> - <combo_item name="Colors"> - Couleurs - </combo_item> - <combo_item name="Depth"> - Profondeur - </combo_item> - <combo_item name="ObjectMattes"> - Matte des objets - </combo_item> + <combo_box.item name="Colors" label="Couleurs" /> + <combo_box.item name="Depth" label="Profondeur" /> + <combo_box.item name="ObjectMattes" label="Matte des objets" /> </combo_box> <text name="file_size_label"> Taille du fichier : [SIZE] Ko @@ -123,12 +69,12 @@ <button label="Enregistrer ([AMOUNT] L$)" name="upload_btn" width="118"/> <button label="Envoyer" name="send_btn" width="118"/> <flyout_button label="Enregistrer" name="save_btn" tool_tip="Enregistrer l'image dans un fichier" width="118"> - <flyout_button_item name="save_item"> - Enregistrer - </flyout_button_item> - <flyout_button_item name="saveas_item"> - Enregistrer sous... - </flyout_button_item> + <flyout_button.item name="save_item"> + Enregistrer + </flyout_button.item> + <flyout_button.item name="saveas_item"> + Enregistrer sous... + </flyout_button.item> </flyout_button> <button label="Annuler" name="discard_btn" left="133" width="72" /> <string name="unknown"> diff --git a/indra/newview/skins/default/xui/fr/floater_sound_preview.xml b/indra/newview/skins/default/xui/fr/floater_sound_preview.xml index 199a6b846f047c8091e00a5e605c23f03e4b7f75..1ab3a4a7147e65746a5ee7968e6ba7894747d9de 100644 --- a/indra/newview/skins/default/xui/fr/floater_sound_preview.xml +++ b/indra/newview/skins/default/xui/fr/floater_sound_preview.xml @@ -12,17 +12,9 @@ Débit (kbps) : </text> <radio_group name="bitrate"> - <radio_item name="32"> - 32 - </radio_item> - <radio_item name="64"> - 64 - </radio_item> - <radio_item name="96"> - 96 - </radio_item> - <radio_item name="128"> - 128 - </radio_item> + <radio_item name="32" label="32" /> + <radio_item name="64" label="64" /> + <radio_item name="96" label="96" /> + <radio_item name="128" label="128" /> </radio_group> </floater> diff --git a/indra/newview/skins/default/xui/fr/floater_tools.xml b/indra/newview/skins/default/xui/fr/floater_tools.xml index f34100f56f4805b5b42a81862f659dc92d0e4a41..8c462fc6ecec9cfef401b7d1da5de340298a6c33 100644 --- a/indra/newview/skins/default/xui/fr/floater_tools.xml +++ b/indra/newview/skins/default/xui/fr/floater_tools.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="toolbox floater" title=""> +<floater name="toolbox floater" title="" short_title="Construire"> <button label="" label_selected="" name="button focus" tool_tip="Mise au point"/> <button label="" label_selected="" name="button move" tool_tip="Déplacer"/> <button label="" label_selected="" name="button edit" tool_tip="Modifier"/> @@ -20,15 +20,9 @@ Axe : </text> <combo_box name="combobox grid mode"> - <combo_item name="World"> - Monde - </combo_item> - <combo_item name="Local"> - Local - </combo_item> - <combo_item name="Reference"> - Référence - </combo_item> + <combo_box.item name="World" label="Monde"/> + <combo_box.item name="Local" label="Local"/> + <combo_box.item name="Reference" label="Référence"/> </combo_box> <check_box label="Étirer les deux côtés" name="checkbox uniform"/> <check_box label="Étirer les textures" name="checkbox stretch textures"/> @@ -130,15 +124,9 @@ Prix : L$ </text> <radio_group name="sale type"> - <radio_item name="Original"> - Original - </radio_item> - <radio_item name="Copy"> - Copie - </radio_item> - <radio_item name="Contents"> - Contenus - </radio_item> + <radio_item name="Original" label="Original" /> + <radio_item name="Copy" label="Copie" /> + <radio_item name="Contents" label="Contenus" /> </radio_group> <text name="Next owner can:"> Le prochain propriétaire pourra : @@ -150,27 +138,13 @@ Action du clic-gauche : </text> <combo_box name="clickaction" width="178"> - <combo_item name="Touch/grab(default)"> - Toucher/attraper (défaut) - </combo_item> - <combo_item name="Sitonobject"> - S'asseoir sur l'objet - </combo_item> - <combo_item name="Buyobject"> - Acheter l'objet - </combo_item> - <combo_item name="Payobject"> - Payer l'objet - </combo_item> - <combo_item name="Open"> - Ouvrir - </combo_item> - <combo_item name="Play"> - Jouer le média de la parcelle - </combo_item> - <combo_item name="Opemmedia"> - Ouvrir le média de la parcelle - </combo_item> + <combo_box.item name="Touch/grab(default)" label="Toucher/attraper (défaut)"/> + <combo_box.item name="Sitonobject" label="S'asseoir sur l'objet"/> + <combo_box.item name="Buyobject" label="Acheter l'objet"/> + <combo_box.item name="Payobject" label="Payer l'objet"/> + <combo_box.item name="Open" label="Ouvrir"/> + <combo_box.item name="Play" label="Jouer le média de la parcelle"/> + <combo_box.item name="Opemmedia" label="Ouvrir le média de la parcelle"/> </combo_box> <text name="B:"> B : @@ -254,56 +228,26 @@ Matériau </text> <combo_box name="material"> - <combo_item name="Stone"> - Pierre - </combo_item> - <combo_item name="Metal"> - Métal - </combo_item> - <combo_item name="Glass"> - Verre - </combo_item> - <combo_item name="Wood"> - Bois - </combo_item> - <combo_item name="Flesh"> - Chair - </combo_item> - <combo_item name="Plastic"> - Plastique - </combo_item> - <combo_item name="Rubber"> - Caoutchouc - </combo_item> + <combo_box.item name="Stone" label="Pierre"/> + <combo_box.item name="Metal" label="Métal"/> + <combo_box.item name="Glass" label="Verre"/> + <combo_box.item name="Wood" label="Bois"/> + <combo_box.item name="Flesh" label="Chair"/> + <combo_box.item name="Plastic" label="Plastique"/> + <combo_box.item name="Rubber" label="Caoutchouc"/> </combo_box> <text name="label basetype"> Type de construction </text> <combo_box name="comboBaseType"> - <combo_item name="Box"> - Boîte - </combo_item> - <combo_item name="Cylinder"> - Cylindre - </combo_item> - <combo_item name="Prism"> - Prisme - </combo_item> - <combo_item name="Sphere"> - Sphère - </combo_item> - <combo_item name="Torus"> - Tore - </combo_item> - <combo_item name="Tube"> - Tube - </combo_item> - <combo_item name="Ring"> - Anneau - </combo_item> - <combo_item name="Sculpted"> - Sculptie - </combo_item> + <combo_box.item name="Box" label="Boîte"/> + <combo_box.item name="Cylinder" label="Cylindre"/> + <combo_box.item name="Prism" label="Prisme"/> + <combo_box.item name="Sphere" label="Sphère"/> + <combo_box.item name="Torus" label="Tore"/> + <combo_box.item name="Tube" label="Tube"/> + <combo_box.item name="Ring" label="Anneau"/> + <combo_box.item name="Sculpted" label="Sculptie"/> </combo_box> <text name="text cut"> Début et fin de découpe du tracé @@ -320,18 +264,10 @@ Forme du creux </text> <combo_box name="hole"> - <combo_item name="Default"> - Défaut - </combo_item> - <combo_item name="Circle"> - Cercle - </combo_item> - <combo_item name="Square"> - Carré - </combo_item> - <combo_item name="Triangle"> - Triangle - </combo_item> + <combo_box.item name="Default" label="Défaut"/> + <combo_box.item name="Circle" label="Cercle"/> + <combo_box.item name="Square" label="Carré"/> + <combo_box.item name="Triangle" label="Triangle"/> </combo_box> <text name="text twist"> Début et fin de vrille @@ -380,21 +316,11 @@ Type de raccord </text> <combo_box name="sculpt type control"> - <combo_item name="None"> - (aucun) - </combo_item> - <combo_item name="Sphere"> - Sphère - </combo_item> - <combo_item name="Torus"> - Tore - </combo_item> - <combo_item name="Plane"> - Plan - </combo_item> - <combo_item name="Cylinder"> - Cylindre - </combo_item> + <combo_box.item name="None" label="aucun)"/> + <combo_box.item name="Sphere" label="Sphère"/> + <combo_box.item name="Torus" label="Tore"/> + <combo_box.item name="Plane" label="Plan"/> + <combo_box.item name="Cylinder" label="Cylindre"/> </combo_box> </panel> <panel label="Attributs" name="Features"> @@ -436,88 +362,40 @@ Application </text> <combo_box name="combobox texgen"> - <combo_item name="Default"> - Défaut - </combo_item> - <combo_item name="Planar"> - Planar - </combo_item> + <combo_box.item name="Default" label="Défaut"/> + <combo_box.item name="Planar" label="Planar"/> </combo_box> <text name="label shininess"> Brillance </text> <combo_box name="combobox shininess"> - <combo_item name="None"> - Aucune - </combo_item> - <combo_item name="Low"> - Faible - </combo_item> - <combo_item name="Medium"> - Moyenne - </combo_item> - <combo_item name="High"> - Élevée - </combo_item> + <combo_box.item name="None" label="Aucune"/> + <combo_box.item name="Low" label="Faible"/> + <combo_box.item name="Medium" label="Moyenne"/> + <combo_box.item name="High" label="Élevée"/> </combo_box> <text name="label bumpiness"> Relief </text> <combo_box name="combobox bumpiness"> - <combo_item name="None"> - Aucun - </combo_item> - <combo_item name="Brightness"> - Luminosité - </combo_item> - <combo_item name="Darkness"> - Obscurité - </combo_item> - <combo_item name="woodgrain"> - Aggloméré - </combo_item> - <combo_item name="bark"> - Écorce - </combo_item> - <combo_item name="bricks"> - Briques - </combo_item> - <combo_item name="checker"> - Damier - </combo_item> - <combo_item name="concrete"> - Béton - </combo_item> - <combo_item name="crustytile"> - Carrelage - </combo_item> - <combo_item name="cutstone"> - Pierre de taille - </combo_item> - <combo_item name="discs"> - Disques - </combo_item> - <combo_item name="gravel"> - Gravier - </combo_item> - <combo_item name="petridish"> - Boîte de Petri - </combo_item> - <combo_item name="siding"> - Lattes - </combo_item> - <combo_item name="stonetile"> - Carreaux - </combo_item> - <combo_item name="stucco"> - Stuc - </combo_item> - <combo_item name="suction"> - Ventouses - </combo_item> - <combo_item name="weave"> - Tissage - </combo_item> + <combo_box.item name="None" label="Aucun"/> + <combo_box.item name="Brightness" label="Luminosité"/> + <combo_box.item name="Darkness" label="Obscurité"/> + <combo_box.item name="woodgrain" label="Aggloméré"/> + <combo_box.item name="bark" label="Écorce"/> + <combo_box.item name="bricks" label="Briques"/> + <combo_box.item name="checker" label="Damier"/> + <combo_box.item name="concrete" label="Béton"/> + <combo_box.item name="crustytile" label="Carrelage"/> + <combo_box.item name="cutstone" label="Pierre de taille"/> + <combo_box.item name="discs" label="Disques"/> + <combo_box.item name="gravel" label="Gravier"/> + <combo_box.item name="petridish" label="Boîte de Petri"/> + <combo_box.item name="siding" label="Lattes"/> + <combo_box.item name="stonetile" label="Carreaux"/> + <combo_box.item name="stucco" label="Stuc"/> + <combo_box.item name="suction" label="Ventouses"/> + <combo_box.item name="weave" label="Tissage"/> </combo_box> <text name="tex scale"> Répétitions par face diff --git a/indra/newview/skins/default/xui/fr/floater_tos.xml b/indra/newview/skins/default/xui/fr/floater_tos.xml index b77838d92ce13cdc418b85e892da637e3535ae6d..dc4bd8cf2bb0e155f1e764e7e9a5240eb2db3cdf 100644 --- a/indra/newview/skins/default/xui/fr/floater_tos.xml +++ b/indra/newview/skins/default/xui/fr/floater_tos.xml @@ -3,12 +3,8 @@ <button label="Continuer" label_selected="Continuer" name="Continue" /> <button label="Annuler" label_selected="Annuler" name="Cancel" /> <radio_group name="tos_agreement"> - <radio_item name="radio_disagree"> - Je n'accepte pas les Conditions Générales d'Utilisation - </radio_item> - <radio_item name="radio_agree"> - J'accepte les Conditions Générales d'Utilisation - </radio_item> + <radio_item name="radio_disagree" label="Je n'accepte pas les Conditions Générales d'Utilisation" /> + <radio_item name="radio_agree" label="J'accepte les Conditions Générales d'Utilisation" /> </radio_group> <text name="tos_title"> Acceptation des Conditions Générales d'Utilisation diff --git a/indra/newview/skins/default/xui/fr/floater_world_map.xml b/indra/newview/skins/default/xui/fr/floater_world_map.xml index bf7004e66fdcb037b327cba85784123d90a74daf..d7ffe9205d96311463eab2f2a52234b53e5dd81d 100644 --- a/indra/newview/skins/default/xui/fr/floater_world_map.xml +++ b/indra/newview/skins/default/xui/fr/floater_world_map.xml @@ -40,15 +40,11 @@ <check_box label="Adult" name="event_adult_chk"/> <icon left="973" name="avatar_icon"/> <combo_box label="Amis connectés" name="friend combo" tool_tip="Ami à afficher sur la carte" width="232"> - <combo_item name="none_selected"> - Amis connectés - </combo_item> + <combo_box.item name="none_selected" label="Amis connectés" /> </combo_box> <icon left="973" name="landmark_icon"/> <combo_box label="Repères" name="landmark combo" tool_tip="Repère à afficher sur la carte" width="232"> - <combo_item name="none_selected"> - Repères - </combo_item> + <combo_box.item name="none_selected" label="Repères" /> </combo_box> <icon left="973" name="location_icon"/> <line_editor label="Rechercher par nom de région" name="location" tool_tip="Saisissez le nom d'une région" width="155"/> diff --git a/indra/newview/skins/default/xui/fr/panel_login.xml b/indra/newview/skins/default/xui/fr/panel_login.xml index c4c6350b4ad6805d75f1564b0ba1b0e4de3ecfa1..74bbe9c5b6164353ff643e03fa23a4ee20df670b 100644 --- a/indra/newview/skins/default/xui/fr/panel_login.xml +++ b/indra/newview/skins/default/xui/fr/panel_login.xml @@ -16,18 +16,10 @@ Lieu de départ : </text> <combo_box name="start_location_combo"> - <combo_item name="MyHome"> - Domicile - </combo_item> - <combo_item name="MyLastLocation"> - Dernier emplacement - </combo_item> - <combo_item name="<Typeregionname>"> - <Choisir région> - </combo_item> - <combo_item name="Typeregionname"> - <Nom de la région> - </combo_item> + <combo_box.item name="MyHome" label="Domicile" /> + <combo_box.item name="MyLastLocation" label="Dernier emplacement" /> + <combo_box.item name="<Typeregionname>" label="lt;Choisir région>" /> + <combo_box.item name="Typeregionname" label="lt;Nom de la région>" /> </combo_box> <check_box label="Mémoriser" name="remember_check"/> <text name="full_screen_text"> diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml b/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml index d29ec67272b5196d249a2b107547af4acdb92ee7..5fbd3cec224c010716f168f289f8472c53e5b5fa 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml @@ -5,15 +5,9 @@ du chat : </text> <radio_group name="chat_font_size"> - <radio_item length="1" name="radio" type="string"> - Petite - </radio_item> - <radio_item length="1" name="radio2" type="string"> - Moyenne - </radio_item> - <radio_item length="1" name="radio3" type="string"> - Grande - </radio_item> + <radio_item length="1" name="radio" type="string" label="Petite" /> + <radio_item length="1" name="radio2" type="string" label="Moyenne" /> + <radio_item length="1" name="radio3" type="string" label="Grande" /> </radio_group> <text length="1" name="text_box2" type="string"> Couleur du chat : diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/fr/panel_preferences_graphics1.xml index 27825b7ff976acbedab49a631deb2607ba93ebce..cc9e2a8569841b0fef79006f2ba5230bbf1289c5 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_graphics1.xml @@ -8,21 +8,11 @@ Taille de la fenêtre : </text> <combo_box name="windowsize combo"> - <combo_item name="640x480"> - 640 x 480 - </combo_item> - <combo_item name="800x600"> - 800 x 600 - </combo_item> - <combo_item name="720x480"> - 720 x 480 (NTSC) - </combo_item> - <combo_item name="768x576"> - 768 x 576 (PAL) - </combo_item> - <combo_item name="1024x768"> - 1024 x 768 - </combo_item> + <combo_box.item name="640x480" label="640 x 480" /> + <combo_box.item name="800x600" label="800 x 600" /> + <combo_box.item name="720x480" label="720 x 480 (NTSC)" /> + <combo_box.item name="768x576" label="768 x 576 (PAL)" /> + <combo_box.item name="1024x768" label="1024 x 768" /> </combo_box> <text name="DisplayResLabel" width="165"> Résolution de l'affichage : @@ -31,18 +21,10 @@ Rapport hauteur/largeur : </text> <combo_box name="aspect_ratio" tool_tip="largeur/hauteur"> - <combo_item length="1" name="4:3(StandardCRT)" type="string"> - 4:3 (Standard CRT) - </combo_item> - <combo_item length="1" name="5:4(1280x1024LCD)" type="string"> - 5:4 (1280 x 1024 LCD) - </combo_item> - <combo_item name="8:5(Widescreen)"> - 8:5 (écran large) - </combo_item> - <combo_item length="1" name="16:9(Widescreen)" type="string"> - 16:9 (plein écran) - </combo_item> + <combo_box.item length="1" name="4:3(StandardCRT)" type="string" label="4:3 (Standard CRT)" /> + <combo_box.item length="1" name="5:4(1280x1024LCD)" type="string" label="5:4 (1280 x 1024 LCD)" /> + <combo_box.item name="8:5(Widescreen)" label="8:5 (écran large)" /> + <combo_box.item length="1" name="16:9(Widescreen)" type="string" label="16:9 (plein écran)" /> </combo_box> <text length="1" name="text" type="string"> Résolution d'affichage : @@ -104,18 +86,10 @@ Objets reflétés : </text> <radio_group name="ReflectionDetailRadio"> - <radio_item name="0"> - Terrain et Arbres - </radio_item> - <radio_item name="1"> - Objets statiques - </radio_item> - <radio_item name="2"> - Objets et avatars - </radio_item> - <radio_item name="3"> - Tout - </radio_item> + <radio_item name="0" label="Terrain et Arbres" /> + <radio_item name="1" label="Objets statiques" /> + <radio_item name="2" label="Objets et avatars" /> + <radio_item name="3" label="Tout" /> </radio_group> <text name="AvatarRenderingText"> Rendu de l'avatar : @@ -166,23 +140,15 @@ Sources lumineuses : </text> <radio_group name="LightingDetailRadio"> - <radio_item name="SunMoon"> - Soleil et lune uniquement - </radio_item> - <radio_item name="LocalLights"> - Lumières à proximité - </radio_item> + <radio_item name="SunMoon" label="Soleil et lune uniquement" /> + <radio_item name="LocalLights" label="Lumières à proximité" /> </radio_group> <text left="380" name="TerrainDetailText"> Rendu du terrain : </text> <radio_group name="TerrainDetailRadio"> - <radio_item name="0"> - Faible - </radio_item> - <radio_item name="2"> - Élevé - </radio_item> + <radio_item name="0" label="Faible" /> + <radio_item name="2" label="Élevé" /> </radio_group> <button label="Paramètres recommandés" name="Defaults"/> <button label="Configuration du matériel" label_selected="Configuration du matériel" name="GraphicsHardwareButton"/> diff --git a/indra/newview/skins/default/xui/it/floater_animation_preview.xml b/indra/newview/skins/default/xui/it/floater_animation_preview.xml index 90b6dfe89993093d092468d89ab54d20706f7b84..b6d6148afb251d3ae11703b4a40f374022604016 100644 --- a/indra/newview/skins/default/xui/it/floater_animation_preview.xml +++ b/indra/newview/skins/default/xui/it/floater_animation_preview.xml @@ -6,144 +6,71 @@ <text name="description_label"> Descrizione: </text> - <spinner label="Priorità " name="priority" tool_tip="Controlla quali altre animazioni possono essere annullate da questa animazione."/> + <spinner label_width="72" width="110" label="Priorità " name="priority" tool_tip="Controlla quali altre animazioni possono essere annullate da questa animazione."/> <check_box label="Ciclica" name="loop_check" tool_tip="Rende questa animazione ciclica."/> <spinner label="In(%)" name="loop_in_point" tool_tip="Imposta il punto nell'animazione in cui ritornare dopo ogni ciclo."/> <spinner label="Out(%)" name="loop_out_point" tool_tip="Imposta il punto nell'animazione in cui terminare dopo ogni ciclo."/> <text name="hand_label"> Postura della mano </text> - <combo_box label="" name="hand_pose_combo" tool_tip="Controlla cosa fanno le mani durante l'animazione."> - <combo_item name="Spread"> - Aperte - </combo_item> - <combo_item name="Relaxed"> - Rilassate - </combo_item> - <combo_item name="PointBoth"> - Entrambe indicano - </combo_item> - <combo_item name="Fist"> - Pugno - </combo_item> - <combo_item name="RelaxedLeft"> - Sinistra Rilassata - </combo_item> - <combo_item name="PointLeft"> - Sinistra Indica - </combo_item> - <combo_item name="FistLeft"> - Sinistra a pugno - </combo_item> - <combo_item name="RelaxedRight"> - Destra rilassata - </combo_item> - <combo_item name="PointRight"> - Destra Indica - </combo_item> - <combo_item name="FistRight"> - Destra a Pugno - </combo_item> - <combo_item name="SaluteRight"> - Destra Saluta - </combo_item> - <combo_item name="Typing"> - Digitano - </combo_item> - <combo_item name="PeaceRight"> - Destra 'segno di pace' - </combo_item> + <combo_box left_delta="100" width="184" name="hand_pose_combo" tool_tip="Controlla cosa fanno le mani durante l'animazione."> + <combo_box.item name="Spread" label="Aperte"/> + <combo_box.item name="Relaxed" label="Rilassate"/> + <combo_box.item name="PointBoth" label="Entrambe indicano"/> + <combo_box.item name="Fist" label="Pugno"/> + <combo_box.item name="RelaxedLeft" label="Sinistra Rilassata"/> + <combo_box.item name="PointLeft" label="Sinistra Indica"/> + <combo_box.item name="FistLeft" label="Sinistra a pugno"/> + <combo_box.item name="RelaxedRight" label="Destra rilassata"/> + <combo_box.item name="PointRight" label="Destra Indica"/> + <combo_box.item name="FistRight" label="Destra a Pugno"/> + <combo_box.item name="SaluteRight" label="Destra Saluta"/> + <combo_box.item name="Typing" label="Digitano"/> + <combo_box.item name="PeaceRight" label="Destra 'segno di pace'"/> </combo_box> <text name="emote_label"> Espressione </text> - <combo_box label="" name="emote_combo" tool_tip="Controlla l'espressione del viso durante l'animazione."> - <combo_item name="[None]"> - [None] - </combo_item> - <combo_item name="Aaaaah"> - Aaaaah - </combo_item> - <combo_item name="Afraid"> - Paura - </combo_item> - <combo_item name="Angry"> - Rabbia - </combo_item> - <combo_item name="BigSmile"> - Sorriso Aperto - </combo_item> - <combo_item name="Bored"> - Noia - </combo_item> - <combo_item name="Cry"> - Pianto - </combo_item> - <combo_item name="Disdain"> - Sdegno - </combo_item> - <combo_item name="Embarrassed"> - Imbarazzo - </combo_item> - <combo_item name="Frown"> - Accigliato - </combo_item> - <combo_item name="Kiss"> - Bacio - </combo_item> - <combo_item name="Laugh"> - Risata - </combo_item> - <combo_item name="Plllppt"> - Linguaccia - </combo_item> - <combo_item name="Repulsed"> - Repulsione - </combo_item> - <combo_item name="Sad"> - Tristezza - </combo_item> - <combo_item name="Shrug"> - Spallucce - </combo_item> - <combo_item name="Smile"> - Sorriso - </combo_item> - <combo_item name="Surprise"> - Sorpresa - </combo_item> - <combo_item name="Wink"> - Ammiccamento - </combo_item> - <combo_item name="Worry"> - Preoccupazione - </combo_item> + <combo_box left_delta="100" width="184" name="emote_combo" tool_tip="Controlla l'espressione del viso durante l'animazione."> + <combo_box.item name="[None]" label="None]"/> + <combo_box.item name="Aaaaah" label="Aaaaah"/> + <combo_box.item name="Afraid" label="Paura"/> + <combo_box.item name="Angry" label="Rabbia"/> + <combo_box.item name="BigSmile" label="Sorriso Aperto"/> + <combo_box.item name="Bored" label="Noia"/> + <combo_box.item name="Cry" label="Pianto"/> + <combo_box.item name="Disdain" label="Sdegno"/> + <combo_box.item name="Embarrassed" label="Imbarazzo"/> + <combo_box.item name="Frown" label="Accigliato"/> + <combo_box.item name="Kiss" label="Bacio"/> + <combo_box.item name="Laugh" label="Risata"/> + <combo_box.item name="Plllppt" label="Linguaccia"/> + <combo_box.item name="Repulsed" label="Repulsione"/> + <combo_box.item name="Sad" label="Tristezza"/> + <combo_box.item name="Shrug" label="Spallucce"/> + <combo_box.item name="Smile" label="Sorriso"/> + <combo_box.item name="Surprise" label="Sorpresa"/> + <combo_box.item name="Wink" label="Ammiccamento"/> + <combo_box.item name="Worry" label="Preoccupazione"/> </combo_box> - <text name="preview_label"> + <text name="preview_label" width="250"> Vedi anteprima mentre </text> - <combo_box label="" name="preview_base_anim" tool_tip="Da usarsi per controllare il comportamento dell'animazione mentre l'avatar svolge azioni abituali."> - <combo_item name="Standing"> - In piedi - </combo_item> - <combo_item name="Walking"> - Passeggia - </combo_item> - <combo_item name="Sitting"> - Siede - </combo_item> - <combo_item name="Flying"> - Vola - </combo_item> + <combo_box left_delta="154" width="130" name="preview_base_anim" tool_tip="Da usarsi per controllare il comportamento dell'animazione mentre l'avatar svolge azioni abituali."> + <combo_box.item name="Standing" label="In piedi"/> + <combo_box.item name="Walking" label="Passeggia"/> + <combo_box.item name="Sitting" label="Siede"/> + <combo_box.item name="Flying" label="Vola"/> </combo_box> - <spinner label="Avvio lento (sec)" name="ease_in_time" tool_tip="Tempo (in secondi) in cui le animazioni iniziano a sfumare."/> - <spinner label="Arresto lento (sec)" name="ease_out_time" tool_tip="Tempo (in secondi) in cui le animazioni iniziano a sfumare."/> - <button label="" name="play_btn" tool_tip="Attiva/sospendi l'animazione."/> + <spinner label_width="125" width="192" label="Avvio lento (sec)" name="ease_in_time" tool_tip="Tempo (in secondi) in cui le animazioni iniziano a sfumare."/> + <spinner bottom_delta="-20" label_width="125" left="10" width="192" label="Arresto lento (sec)" name="ease_out_time" tool_tip="Tempo (in secondi) in cui le animazioni iniziano a sfumare."/> + <button bottom_delta="-32" name="play_btn" tool_tip="Attiva/sospendi l'animazione."/> <button label="" name="stop_btn" tool_tip="Ferma la riproduzione dell'animazione"/> <text name="bad_animation_text"> Impossibile leggere il file dell'animazione. -Raccomandiamo file di tipo BVH esportati da Poser 4. +Raccomandiamo file di tipo BVH esportati da +Poser 4. </text> <button label="Annulla" name="cancel_btn"/> <button label="Importa ([AMOUNT]L$)" name="ok_btn"/> diff --git a/indra/newview/skins/default/xui/it/floater_buy_land.xml b/indra/newview/skins/default/xui/it/floater_buy_land.xml index 8697a66f86136e2139d16e6ce736eea8ade6bf64..d6036c19dd6084cf83d02b51304d31c88010cf76 100644 --- a/indra/newview/skins/default/xui/it/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/it/floater_buy_land.xml @@ -18,10 +18,10 @@ <text name="estate_name_text"> (sconosciuto) </text> - <text name="estate_owner_label"> - Proprietario della regione + <text name="estate_owner_label" width="120" right="575"> + Proprietario della regione: </text> - <text name="estate_owner_text"> + <text name="estate_owner_text" left="580" width="155"> (sconosciuto) </text> <text name="resellable_changeable_label"> @@ -36,6 +36,7 @@ <text name="covenant_text"> Devi accettare il regolamento della regione: </text> + <text left="470" name="covenant_timestamp_text"/> <text_editor name="covenant_editor"> Attendi... </text_editor> @@ -74,15 +75,9 @@ venduta con gli oggetti Solo i membri premium possono possedere terra. </text> <combo_box name="account_level"> - <combo_item name="US$9.95/month,billedmonthly"> - 9.95 US$/mese, addebitati mensilmente - </combo_item> - <combo_item name="US$7.50/month,billedquarterly"> - 7.50 US$/mese, addebitati ogni quadrimestre - </combo_item> - <combo_item name="US$6.00/month,billedannually"> - 6.00 US$/mese, addebitati annualmente - </combo_item> + <combo_box.item name="US$9.95/month,billedmonthly" label="9.95 US$/mese, addebitati mensilmente"/> + <combo_box.item name="US$7.50/month,billedquarterly" label="7.50 US$/mese, addebitati ogni quadrimestre"/> + <combo_box.item name="US$6.00/month,billedannually" label="6.00 US$/mese, addebitati annualmente"/> </combo_box> <text name="land_use_action"> Aumenta il tasso di pagamento mensile delle tasse d'uso della terra a 40 US$/mese. @@ -96,10 +91,10 @@ venduta con gli oggetti <text name="currency_reason"> Possiedi 2.100 L$. </text> - <text name="currency_action"> + <text name="currency_action" width="106"> Compra ulteriori L$ </text> - <line_editor name="currency_amt"> + <line_editor name="currency_amt" left="174" width="80"> 1000 </line_editor> <text name="currency_est"> diff --git a/indra/newview/skins/default/xui/it/floater_customize.xml b/indra/newview/skins/default/xui/it/floater_customize.xml index aeb285e7432a20c48af69f7babaa8cdf269750b3..70fc27b3bb9cf5236f4c6ebe17c1f7789a1b11f6 100644 --- a/indra/newview/skins/default/xui/it/floater_customize.xml +++ b/indra/newview/skins/default/xui/it/floater_customize.xml @@ -14,12 +14,8 @@ <button label="Torso" label_selected="Torso" name="Torso"/> <button label="Gambe" label_selected="Gambe" name="Legs"/> <radio_group name="sex radio"> - <radio_item name="radio"> - Femmina - </radio_item> - <radio_item name="radio2"> - Maschio - </radio_item> + <radio_item name="radio" label="Femmina" /> + <radio_item name="radio2" label="Maschio" /> </radio_group> <text name="title"> [DESC] diff --git a/indra/newview/skins/default/xui/it/floater_hardware_settings.xml b/indra/newview/skins/default/xui/it/floater_hardware_settings.xml index b3179dc534ee680ea925d1de9f29ff42d15f6f63..688f9137a251f6dcba9778e71a4f83660cc8357e 100644 --- a/indra/newview/skins/default/xui/it/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/it/floater_hardware_settings.xml @@ -7,32 +7,22 @@ <text name="Antialiasing:"> Antialiasing: </text> - <combo_box label="Antialiasing" name="fsaa"> - <combo_item name="FSAADisabled"> - Disattivato - </combo_item> - <combo_item name="2x"> - 2x - </combo_item> - <combo_item name="4x"> - 4x - </combo_item> - <combo_item name="8x"> - 8x - </combo_item> - <combo_item name="16x"> - 16x - </combo_item> + <combo_box label="Antialiasing" name="fsaa" width="94"> + <combo_box.item name="FSAADisabled" label="Disattivato"/> + <combo_box.item name="2x" label="2x"/> + <combo_box.item name="4x" label="4x"/> + <combo_box.item name="8x" label="8x"/> + <combo_box.item name="16x" label="16x"/> </combo_box> <spinner label="Gamma:" name="gamma"/> <text name="(brightness, lower is brighter)"> - (luminosità, più basso = più luminoso, 0=default) + (Luminosità , più basso = più luminoso, 0=default) </text> <text name="Enable VBO:"> Attiva VBO: </text> <check_box label="Attiva oggetti OpenGL Vertex Buffer" name="vbo" tool_tip="Attivandolo su un hardware moderno aumenta la performance. Ma, su un vecchio hardware, spesso l'implementazione dei VBO è scarsa e potresti avere dei crash quando è attivato."/> <slider label="Memoria Texture (MB):" name="GrapicsCardTextureMemory" tool_tip="Quantità di memoria allocata per le texture. Impostata di default sulla memoria della scheda grafica. Ridurla può aumentare la performance, ma può anche rendere le texture sfocate."/> - <spinner label="Indice della distanza della nebbia:" name="fog"/> + <spinner label="Indice della distanza della nebbia:" name="fog"/> <button label="OK" label_selected="OK" name="OK"/> </floater> diff --git a/indra/newview/skins/default/xui/it/floater_image_preview.xml b/indra/newview/skins/default/xui/it/floater_image_preview.xml index 74796a54000fdf054857518b0a085f3b5f7f9c4d..8ee3181bce33d5b62fd1668d5d60503ce88904be 100644 --- a/indra/newview/skins/default/xui/it/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/it/floater_image_preview.xml @@ -7,39 +7,20 @@ Descrizione: </text> <text name="preview_label"> - Anteprima dell'immagine come: + Anteprima dell' +immagine come: </text> - <combo_box label="Tipo d'abito" name="clothing_type_combo"> - <combo_item name="Image"> - Immagine - </combo_item> - <combo_item name="Hair"> - Capelli - </combo_item> - <combo_item name="FemaleHead"> - Testa femminile - </combo_item> - <combo_item name="FemaleUpperBody"> - Corpo femminile superiore - </combo_item> - <combo_item name="FemaleLowerBody"> - Corpo femminile inferiore - </combo_item> - <combo_item name="MaleHead"> - Testa maschile - </combo_item> - <combo_item name="MaleUpperBody"> - Corpo maschile superiore - </combo_item> - <combo_item name="MaleLowerBody"> - Corpo maschile inferiore - </combo_item> - <combo_item name="Skirt"> - Gonna - </combo_item> - <combo_item name="SculptedPrim"> - Oggetto sculpt - </combo_item> + <combo_box label="Tipo d'abito" name="clothing_type_combo" left="120" width="166"> + <combo_box.item name="Image" label="Immagine"/> + <combo_box.item name="Hair" label="Capelli"/> + <combo_box.item name="FemaleHead" label="Testa femminile"/> + <combo_box.item name="FemaleUpperBody" label="Corpo femminile superiore"/> + <combo_box.item name="FemaleLowerBody" label="Corpo femminile inferiore"/> + <combo_box.item name="MaleHead" label="Testa maschile"/> + <combo_box.item name="MaleUpperBody" label="Corpo maschile superiore"/> + <combo_box.item name="MaleLowerBody" label="Corpo maschile inferiore"/> + <combo_box.item name="Skirt" label="Gonna"/> + <combo_box.item name="SculptedPrim" label="Oggetto sculpt"/> </combo_box> <text name="bad_image_text"> Non è stato possibile leggere l'immagine. diff --git a/indra/newview/skins/default/xui/it/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/it/floater_inventory_item_properties.xml index 6c681e7d1f80329a6cbfb1f279882b50e159d228..e32f57e9f4e635f4b25701ae4f805ac658e3c0d8 100644 --- a/indra/newview/skins/default/xui/it/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/it/floater_inventory_item_properties.xml @@ -30,7 +30,7 @@ Tu puoi: </text> <check_box label="Modificare" name="CheckOwnerModify"/> - <check_box label="Copiare" name="CheckOwnerCopy"/> + <check_box left_delta="88" label="Copiare" name="CheckOwnerCopy"/> <check_box label="Rivendere/Regalare" name="CheckOwnerTransfer"/> <text name="BaseMaskDebug"> B: @@ -49,23 +49,19 @@ </text> <check_box label="Condividi con il gruppo" name="CheckShareWithGroup"/> <check_box label="Permetti a tutti di copiare" name="CheckEveryoneCopy"/> - <text name="NextOwnerLabel"> + <text name="NextOwnerLabel" width="230"> Il prossimo proprietario può: </text> <check_box label="Modificare" name="CheckNextOwnerModify"/> - <check_box label="Copiare" name="CheckNextOwnerCopy"/> + <check_box left_delta="88" label="Copiare" name="CheckNextOwnerCopy"/> <check_box label="Rivendere/Regalare" name="CheckNextOwnerTransfer"/> <text name="SaleLabel"> Metti l'oggetto: </text> <check_box label="In vendita" name="CheckPurchase"/> - <radio_group name="RadioSaleType"> - <radio_item name="radio"> - Originale - </radio_item> - <radio_item name="radio2"> - Copia - </radio_item> + <radio_group name="RadioSaleType" left_delta="88" > + <radio_item name="radio" label="Originale" /> + <radio_item name="radio2" label="Copia" /> </radio_group> <text name="TextPrice"> Prezzo: L$ diff --git a/indra/newview/skins/default/xui/it/floater_preview_gesture.xml b/indra/newview/skins/default/xui/it/floater_preview_gesture.xml index 2e3f20a520bcb1f4b17afef0f9c760dd8341921f..60d3a7710ef5dc7a56b8b601a3d126f386f3394b 100644 --- a/indra/newview/skins/default/xui/it/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/it/floater_preview_gesture.xml @@ -15,15 +15,15 @@ <text name="trigger_label"> Parole chiave: </text> - <text name="replace_text" tool_tip="Sostituisci le parole chiave con questi termini. Per esempio, sostituire la parola chiave 'salve' con 'ciao' modificherà la chat 'Volevo solo dire salve' in 'Volevo solo dire ciao' e avvierà la gesture!"> + <text left="208" name="replace_text" tool_tip="Sostituisci le parole chiave con questi termini. Per esempio, sostituire la parola chiave 'salve' con 'ciao' modificherà la chat 'Volevo solo dire salve' in 'Volevo solo dire ciao' e avvierà la gesture!"> Sostituisci con: </text> <line_editor name="replace_editor" tool_tip="Sostituisci le parole chiave con questi termini. Per esempio, sostituire la parola chiave 'salve' con 'ciao' modificherà la chat 'Volevo solo dire salve' in 'Volevo solo dire ciao' e avvierà la gesture!"/> <text name="key_label"> Scorciatoia da tastiera: </text> - <combo_box label="Nessuno" name="modifier_combo"/> - <combo_box label="Nessuno" name="key_combo"/> + <combo_box label="Nessuno" name="modifier_combo" left="156" width="76"/> + <combo_box label="Nessuno" name="key_combo" width="76" left_delta="80"/> <text name="library_label"> Libreria: </text> @@ -46,15 +46,12 @@ simultaneamente, a meno che tu non aggiunga pause. </text> <radio_group name="animation_trigger_type"> - <radio_item name="start"> - Avvio - </radio_item> - <radio_item name="stop"> - Stop - </radio_item> + <radio_item name="start" label="Avvio" /> + <radio_item name="stop" label="Stop" /> </radio_group> - <check_box label="finché le animazioni sono eseguite" name="wait_anim_check"/> + <check_box left="226" label="finché le animazioni sono eseguite" name="wait_anim_check"/> <check_box label="tempo in secondi" name="wait_time_check"/> + <line_editor left_delta="114" name="wait_time_editor" /> <check_box label="Attiva" name="active_check" tool_tip="Le gesture attivate possono essere eseguite scrivendo in chat la parola chiave o premendo i tasti chiave. Le gesture generalmente si disattivano quando c'è un conflitto nei relativi tasti."/> <button label="Anteprima" name="preview_btn"/> <button label="Salva" name="save_btn"/> diff --git a/indra/newview/skins/default/xui/it/floater_report_abuse.xml b/indra/newview/skins/default/xui/it/floater_report_abuse.xml index 99165da2539501e41543f44b47e525b22630e764..abcd953c13df42afad0238e9afe9151566e6d783 100644 --- a/indra/newview/skins/default/xui/it/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/it/floater_report_abuse.xml @@ -36,123 +36,51 @@ Hendrerit Vulputate </text> <combo_box name="category_combo" tool_tip="Categoria -- scegli la categoria che descrive meglio questa segnalazione"> - <combo_item name="Select_category"> - Scegli la categoria - </combo_item> - <combo_item name="Age__Age_play"> - Età > Far finta di essere minore - </combo_item> - <combo_item name="Age__Adult_resident_on_Teen_Second_Life"> - Età > Residente adulto nella Teen Second Life - </combo_item> + <combo_box.item name="Select_category" label="Scegli la categoria"/> + <combo_box.item name="Age__Age_play" label="Età > Far finta di essere minore"/> + <combo_box.item name="Age__Adult_resident_on_Teen_Second_Life" label="Età > Residente adulto nella Teen Second Life"/> <combo_item name="Age__Underage_resident_outside_of_Teen_Second_Life"> Età > Residente minorenne al di fuori della 'Second Life per Teenager' </combo_item> - <combo_item name="Assault__Combat_sandbox___unsafe_area"> - Assalto > sandbox da combattimento / area pericolosa - </combo_item> - <combo_item name="Assault__Safe_area"> - Assalto > Area sicura - </combo_item> - <combo_item name="Assault__Weapons_testing_sandbox"> - Assalto > Test di armi in sandbox - </combo_item> - <combo_item name="Commerce__Failure_to_deliver_product_or_service"> - Commercio > Problema nella consegna di un prodotto o servizio - </combo_item> - <combo_item name="Disclosure__Real_world_information"> - Divulgazione > Informazioni del mondo reale - </combo_item> - <combo_item name="Disclosure__Remotely_monitoring chat"> - Divulgazione > Monitoraggio remoto di chat - </combo_item> - <combo_item name="Disclosure__Second_Life_information_chat_IMs"> - Divulgazione > Informazione/chat/IMs di Second Life - </combo_item> - <combo_item name="Disturbing_the_peace__Unfair_use_of_region_resources"> - Disturbo della quiete > Uso sleale delle risorse di una regione - </combo_item> - <combo_item name="Disturbing_the_peace__Excessive_scripted_objects"> - Disturbo della quiete > Numero eccessivo di oggetti scriptati - </combo_item> - <combo_item name="Disturbing_the_peace__Object_littering"> - Disturbo della quiete > Oggetti messi a soqquadro - </combo_item> - <combo_item name="Disturbing_the_peace__Repetitive_spam"> - Disturbo della quiete > Spam continuato - </combo_item> - <combo_item name="Disturbing_the_peace__Unwanted_advert_spam"> - Disturbo della quiete > Spam pubblicitario non richiesto - </combo_item> - <combo_item name="Fraud__L$"> - Truffa > L$ - </combo_item> - <combo_item name="Fraud__Land"> - Truffa > Terreno - </combo_item> - <combo_item name="Fraud__Pyramid_scheme_or_chain_letter"> - Truffa > Multilivello o catena di Sant'Antonio - </combo_item> - <combo_item name="Fraud__US$"> - Truffa > Dollari US$ - </combo_item> - <combo_item name="Harassment__Advert_farms___visual_spam"> - Molestie > Territori adibiti a pubblicità / spam visivo - </combo_item> - <combo_item name="Harassment__Defaming_individuals_or_groups"> - Molestie > Diffamazione di individui o gruppi - </combo_item> - <combo_item name="Harassment__Impeding_movement"> - Molestie > Impedimento di movimenti - </combo_item> - <combo_item name="Harassment__Sexual_harassment"> - Molestie > Molestie sessuali - </combo_item> - <combo_item name="Harassment__Solicting_inciting_others_to_violate_ToS"> - Molestie > Sollecitare/incitare altri a violare i Termini di Servizio - </combo_item> - <combo_item name="Harassment__Verbal_abuse"> - Molestie > Abusi verbali - </combo_item> - <combo_item name="Indecency__Broadly_offensive_content_or_conduct"> - Indecenza > Condotta o contenuti largamente offensivi - </combo_item> - <combo_item name="Indecency__Inappropriate_avatar_name"> - Indecenza > Nome di un avatar inappropriato - </combo_item> + <combo_box.item name="Assault__Combat_sandbox___unsafe_area" label="Assalto > sandbox da combattimento / area pericolosa"/> + <combo_box.item name="Assault__Safe_area" label="Assalto > Area sicura"/> + <combo_box.item name="Assault__Weapons_testing_sandbox" label="Assalto > Test di armi in sandbox"/> + <combo_box.item name="Commerce__Failure_to_deliver_product_or_service" label="Commercio > Problema nella consegna di un prodotto o servizio"/> + <combo_box.item name="Disclosure__Real_world_information" label="Divulgazione > Informazioni del mondo reale"/> + <combo_box.item name="Disclosure__Remotely_monitoring chat" label="Divulgazione > Monitoraggio remoto di chat"/> + <combo_box.item name="Disclosure__Second_Life_information_chat_IMs" label="Divulgazione > Informazione/chat/IMs di Second Life"/> + <combo_box.item name="Disturbing_the_peace__Unfair_use_of_region_resources" label="Disturbo della quiete > Uso sleale delle risorse di una regione"/> + <combo_box.item name="Disturbing_the_peace__Excessive_scripted_objects" label="Disturbo della quiete > Numero eccessivo di oggetti scriptati"/> + <combo_box.item name="Disturbing_the_peace__Object_littering" label="Disturbo della quiete > Oggetti messi a soqquadro"/> + <combo_box.item name="Disturbing_the_peace__Repetitive_spam" label="Disturbo della quiete > Spam continuato"/> + <combo_box.item name="Disturbing_the_peace__Unwanted_advert_spam" label="Disturbo della quiete > Spam pubblicitario non richiesto"/> + <combo_box.item name="Fraud__L$" label="Truffa > L$"/> + <combo_box.item name="Fraud__Land" label="Truffa > Terreno"/> + <combo_box.item name="Fraud__Pyramid_scheme_or_chain_letter" label="Truffa > Multilivello o catena di Sant'Antonio"/> + <combo_box.item name="Fraud__US$" label="Truffa > Dollari US$"/> + <combo_box.item name="Harassment__Advert_farms___visual_spam" label="Molestie > Territori adibiti a pubblicità / spam visivo"/> + <combo_box.item name="Harassment__Defaming_individuals_or_groups" label="Molestie > Diffamazione di individui o gruppi"/> + <combo_box.item name="Harassment__Impeding_movement" label="Molestie > Impedimento di movimenti"/> + <combo_box.item name="Harassment__Sexual_harassment" label="Molestie > Molestie sessuali"/> + <combo_box.item name="Harassment__Solicting_inciting_others_to_violate_ToS" label="Molestie > Sollecitare/incitare altri a violare i Termini di Servizio"/> + <combo_box.item name="Harassment__Verbal_abuse" label="Molestie > Abusi verbali"/> + <combo_box.item name="Indecency__Broadly_offensive_content_or_conduct" label="Indecenza > Condotta o contenuti largamente offensivi"/> + <combo_box.item name="Indecency__Inappropriate_avatar_name" label="Indecenza > Nome di un avatar inappropriato"/> <combo_item name="Indecency__Mature_content_in_PG_region"> Indecenza > Contenuto o condotta inappropriata in una regione PG </combo_item> <combo_item name="Indecency__Inappropriate_content_in_Mature_region"> Indecenza > Contenuto o condotta inappropriata in una regione Mature </combo_item> - <combo_item name="Intellectual_property_infringement_Content_Removal"> - Violazione della proprietà intellettuale > Rimozione contenuti - </combo_item> - <combo_item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"> - Violazione della proprietà intellettuale > CopyBot o sblocco di permessi - </combo_item> - <combo_item name="Intolerance"> - Intolleranza - </combo_item> - <combo_item name="Land__Abuse_of_sandbox_resources"> - Terreno > Abuso delle risorse di una sandbox - </combo_item> - <combo_item name="Land__Encroachment__Objects_textures"> - Terreno > Invasione > Oggetti/textures - </combo_item> - <combo_item name="Land__Encroachment__Particles"> - Terreno > Invasione > Particelle - </combo_item> - <combo_item name="Land__Encroachment__Trees_plants"> - Terreno > Invasione > Alberi/piante - </combo_item> - <combo_item name="Wagering_gambling"> - Chiedere l'elemosina/gioco d'azzardo - </combo_item> - <combo_item name="Other"> - Altro - </combo_item> + <combo_box.item name="Intellectual_property_infringement_Content_Removal" label="Violazione della proprietà intellettuale > Rimozione contenuti"/> + <combo_box.item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit" label="Violazione della proprietà intellettuale > CopyBot o sblocco di permessi"/> + <combo_box.item name="Intolerance" label="Intolleranza"/> + <combo_box.item name="Land__Abuse_of_sandbox_resources" label="Terreno > Abuso delle risorse di una sandbox"/> + <combo_box.item name="Land__Encroachment__Objects_textures" label="Terreno > Invasione > Oggetti/textures"/> + <combo_box.item name="Land__Encroachment__Particles" label="Terreno > Invasione > Particelle"/> + <combo_box.item name="Land__Encroachment__Trees_plants" label="Terreno > Invasione > Alberi/piante"/> + <combo_box.item name="Wagering_gambling" label="Chiedere l'elemosina/gioco d'azzardo"/> + <combo_box.item name="Other" label="Altro"/> </combo_box> <text name="abuser_name_title"> Nome di chi ha commesso l'abuso: @@ -169,8 +97,9 @@ Dettagli: </text> <text name="bug_aviso"> - Ti preghiamo di essere circostanziato riguardo data, luogo, natura -dell'abuso, testo rilevante di chat/IM, e, se possibile, indica l'oggetto. + Ti preghiamo di essere circostanziato riguardo data, +luogo, natura dell'abuso, testo rilevante di chat/IM, e, +se possibile, indica l'oggetto. </text> <text name="incomplete_title"> Nota: Segnalazioni incomplete non saranno esaminate. diff --git a/indra/newview/skins/default/xui/it/floater_sell_land.xml b/indra/newview/skins/default/xui/it/floater_sell_land.xml index 3f47c0ef78cbba7aa60e389c2b701f5a5b28c12a..d9cf612d335ef541d34468b77ea90c2cd540bd4e 100644 --- a/indra/newview/skins/default/xui/it/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/it/floater_sell_land.xml @@ -36,15 +36,9 @@ terreno: Scegli se vendere a tutti o ad un compratore in particolare. </text> <combo_box name="sell_to"> - <combo_item name="--selectone--"> - -- selezionane uno -- - </combo_item> - <combo_item name="Anyone"> - Chiunque - </combo_item> - <combo_item name="Specificuser:"> - Utente specifico: - </combo_item> + <combo_box.item name="--selectone--" label="selezionane uno --"/> + <combo_box.item name="Anyone" label="Chiunque"/> + <combo_box.item name="Specificuser:" label="Utente specifico:"/> </combo_box> <button label="Seleziona..." name="sell_to_select_agent"/> <text name="sell_objects_label"> @@ -55,12 +49,8 @@ terreno: cambieranno proprietario. </text> <radio_group name="sell_objects" bottom_delta="-58" > - <radio_item name="no"> - No, voglio mantenere la proprietà degli oggetti - </radio_item> - <radio_item name="yes"> - Si, vendi gli oggetti con la terra - </radio_item> + <radio_item name="no" label="No, voglio mantenere la proprietà degli oggetti" /> + <radio_item name="yes" label="Si, vendi gli oggetti con la terra" /> </radio_group> <button label="Mostra oggetti" name="show_objects"/> <text name="nag_message_label"> diff --git a/indra/newview/skins/default/xui/it/floater_settings_debug.xml b/indra/newview/skins/default/xui/it/floater_settings_debug.xml index 9bedc69a0599c548134805919faea8d8350c3de3..6dd1b7978de2e22fe8235e658113ae9d7cafdf75 100644 --- a/indra/newview/skins/default/xui/it/floater_settings_debug.xml +++ b/indra/newview/skins/default/xui/it/floater_settings_debug.xml @@ -1,17 +1,13 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="settings_debug" title="Configurazioni per il debug"> <combo_box name="boolean_combo"> - <combo_item name="TRUE"> - VERO - </combo_item> - <combo_item name="FALSE"> - FALSO - </combo_item> + <combo_box.item name="TRUE" label="VERO"/> + <combo_box.item name="FALSE" label="FALSO"/> </combo_box> <color_swatch label="Colore" name="color_swatch"/> <spinner label="x" name="val_spinner_1"/> <spinner label="x" name="val_spinner_2"/> <spinner label="x" name="val_spinner_3"/> <spinner label="x" name="val_spinner_4"/> - <button label="Reimposta i valori di default" name="default_btn"/> + <button label="Reimposta i valori di default" name="default_btn" width="210"/> </floater> diff --git a/indra/newview/skins/default/xui/it/floater_snapshot.xml b/indra/newview/skins/default/xui/it/floater_snapshot.xml index 7e1bc2cf5ddf6474496579df5ec70b966d4f477f..808158ff7e70eddd57176cf1063c50199fc4cc4c 100644 --- a/indra/newview/skins/default/xui/it/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/it/floater_snapshot.xml @@ -1,18 +1,12 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Snapshot" title="Anteprima della fotografia"> +<floater name="Snapshot" title="Anteprima della fotografia" width="247"> <text name="type_label"> Destinazione della fotografia </text> - <radio_group label="Tipo di fotografia" name="snapshot_type_radio"> - <radio_item name="postcard"> - Invia via email - </radio_item> - <radio_item name="texture"> - Salva nel tuo inventario ([AMOUNT] L$) - </radio_item> - <radio_item name="local"> - Salva sul tuo pc - </radio_item> + <radio_group label="Tipo di fotografia" name="snapshot_type_radio" width="228"> + <radio_item name="postcard" label="Invia via email" /> + <radio_item name="texture" label="Salva nel tuo inventario ([AMOUNT] L$)" /> + <radio_item name="local" label="Salva sul tuo pc" /> </radio_group> <text name="file_size_label"> Grandezza del file: [SIZE] KB @@ -20,13 +14,9 @@ <button label="Aggiorna la fotografia" name="new_snapshot_btn"/> <button label="Invia" name="send_btn"/> <button label="Salva ([AMOUNT] L$)" name="upload_btn"/> - <flyout_button label="Salva" name="save_btn" tool_tip="Salva l'immagine come file"> - <flyout_button_item name="save_item"> - Salva - </flyout_button_item> - <flyout_button_item name="saveas_item"> - Salva come... - </flyout_button_item> + <flyout_button label="Salva" name="save_btn" tool_tip="Salva l'immagine come file" > + <flyout_button_item name="save_item" label="Salva"/> + <flyout_button_item name="saveas_item" label="Salva come..."/> </flyout_button> <button label="Annulla" name="discard_btn"/> <button label="Espandi >>" name="more_btn" tool_tip="Opzioni avanzate"/> @@ -38,99 +28,51 @@ Formato </text> <combo_box label="Risoluzione" name="postcard_size_combo"> - <combo_item name="CurrentWindow"> - Finestra corrente - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="Custom"> - Personalizzata - </combo_item> + <combo_box.item name="CurrentWindow" label="Finestra corrente"/> + <combo_box.item name="640x480" label="640x480"/> + <combo_box.item name="800x600" label="800x600"/> + <combo_box.item name="1024x768" label="1024x768"/> + <combo_box.item name="Custom" label="Personalizzata"/> </combo_box> <combo_box label="Risoluzione" name="texture_size_combo"> - <combo_item name="CurrentWindow"> - Finestra corrente - </combo_item> - <combo_item name="Small(128x128)"> - Piccola (128x128) - </combo_item> - <combo_item name="Medium(256x256)"> - Media (256x256) - </combo_item> - <combo_item name="Large(512x512)"> - Larga (512x512) - </combo_item> - <combo_item name="Custom"> - Personalizzata - </combo_item> + <combo_box.item name="CurrentWindow" label="Finestra corrente"/> + <combo_box.item name="Small(128x128)" label="Piccola (128x128)"/> + <combo_box.item name="Medium(256x256)" label="Media (256x256)"/> + <combo_box.item name="Large(512x512)" label="Larga (512x512)"/> + <combo_box.item name="Custom" label="Personalizzata"/> </combo_box> <combo_box label="Risoluzione" name="local_size_combo"> - <combo_item name="CurrentWindow"> - Finestra corrente - </combo_item> - <combo_item name="320x240"> - 320x240 - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="1280x1024"> - 1280x1024 - </combo_item> - <combo_item name="1600x1200"> - 1600x1200 - </combo_item> - <combo_item name="Custom"> - Personalizzata - </combo_item> + <combo_box.item name="CurrentWindow" label="Finestra corrente"/> + <combo_box.item name="320x240" label="320x240"/> + <combo_box.item name="640x480" label="640x480"/> + <combo_box.item name="800x600" label="800x600"/> + <combo_box.item name="1024x768" label="1024x768"/> + <combo_box.item name="1280x1024" label="1280x1024"/> + <combo_box.item name="1600x1200" label="1600x1200"/> + <combo_box.item name="Custom" label="Personalizzata"/> </combo_box> <combo_box label="Formato" name="local_format_combo"> - <combo_item name="PNG"> - PNG - </combo_item> - <combo_item name="JPEG"> - JPEG - </combo_item> - <combo_item name="BMP"> - BMP - </combo_item> + <combo_box.item name="PNG" label="PNG"/> + <combo_box.item name="JPEG" label="JPEG"/> + <combo_box.item name="BMP" label="BMP"/> </combo_box> - <spinner label="Larghezza" name="snapshot_width"/> - <spinner label="Altezza" name="snapshot_height"/> + <spinner label="Larghezza" name="snapshot_width" label_width="58" width="116"/> + <spinner label="Altezza" name="snapshot_height" label_width="41" width="101" left="130"/> <check_box label="Mantieni le proporzioni" name="keep_aspect_check"/> <slider label="Qualità d'immagine" name="image_quality_slider"/> - <text name="layer_type_label"> + <text name="layer_type_label" width="55"> Fotografa: </text> - <combo_box label="Layer dell'immagine" name="layer_types"> - <combo_item name="Colors"> - Colori - </combo_item> - <combo_item name="Depth"> - Profondità - </combo_item> - <combo_item name="ObjectMattes"> - Colori primari degli oggetti - </combo_item> + <combo_box label="Layer dell'immagine" name="layer_types" left="68" width="165"> + <combo_box.item name="Colors" label="Colori"/> + <combo_box.item name="Depth" label="Profondità "/> + <combo_box.item name="ObjectMattes" label="Colori primari degli oggetti"/> </combo_box> <check_box label="Mostra l'interfaccia nella fotografia" name="ui_check"/> - <check_box label="Mostra i dispositivi indossati nella fotografia" name="hud_check"/> - <check_box label="Mantieni aperto dopo aver salvato" name="keep_open_check"/> - <check_box label="Blocca l'anteprima (Anteprima a schermo intero)" name="freeze_frame_check"/> - <check_box label="Auto-Aggiorna" name="auto_snapshot_check"/> + <check_box bottom_delta="-17" label="Mostra i dispositivi indossati nella foto" name="hud_check"/> + <check_box bottom_delta="-17" label="Mantieni aperto dopo aver salvato" name="keep_open_check"/> + <check_box bottom_delta="-17" label="Blocca l'anteprima (Anteprima a schermo intero)" name="freeze_frame_check"/> + <check_box bottom_delta="-29" label="Auto-Aggiorna" name="auto_snapshot_check"/> <string name="unknown"> sconosciuto </string> diff --git a/indra/newview/skins/default/xui/it/floater_world_map.xml b/indra/newview/skins/default/xui/it/floater_world_map.xml index 8d58b7df3e326e453243a7fa56f30c85ba9de67e..088c8a7189a7110905caee12b64e32004861cb2a 100644 --- a/indra/newview/skins/default/xui/it/floater_world_map.xml +++ b/indra/newview/skins/default/xui/it/floater_world_map.xml @@ -30,14 +30,10 @@ <check_box label="Adult" name="event_adult_chk"/> <icon bottom="-200" name="avatar_icon" /> <combo_box label="Amici Online" name="friend combo" tool_tip="Amici da mostrare sulla mappa"> - <combo_item name="none_selected"> - Amici Online - </combo_item> + <combo_box.item name="none_selected" label="Amici Online"/> </combo_box> <combo_box label="Landmark" name="landmark combo" tool_tip="Landmarks da mostrare sulla mappa"> - <combo_item name="none_selected"> - Landmark - </combo_item> + <combo_box.item name="none_selected" label="Landmark"/> </combo_box> <line_editor label="Cerca per nome di regione" name="location" tool_tip="Scrivi il nome di una regione"/> <button label="Cerca" name="DoSearch" tool_tip="Cerca regione"/> diff --git a/indra/newview/skins/default/xui/it/panel_preferences_chat.xml b/indra/newview/skins/default/xui/it/panel_preferences_chat.xml index fd20b11c02cea373097a8edfc3e61cece7bc2414..8afcd74bf7c6f312e077a4d52a543e5eee8a1081 100644 --- a/indra/newview/skins/default/xui/it/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/it/panel_preferences_chat.xml @@ -5,15 +5,9 @@ chat: </text> <radio_group name="chat_font_size"> - <radio_item name="radio"> - Piccolo - </radio_item> - <radio_item name="radio2"> - Medio - </radio_item> - <radio_item name="radio3"> - Grande - </radio_item> + <radio_item name="radio" label="Piccolo" /> + <radio_item name="radio2" label="Medio" /> + <radio_item name="radio3" label="Grande" /> </radio_group> <text name="text_box2"> Colore carattere chat: @@ -49,7 +43,7 @@ chat: <check_box label="Chiudi la barra chat dopo aver premuto invio" name="close_chat_on_return_check"/> <check_box label="Le frecce muovono comunque l'avatar quando si sta scrivendo" name="arrow_keys_move_avatar_check"/> <check_box label="Mostra orario nella chat principale" name="show_timestamps_check"/> - <check_box label="Simula la battitura tasti quando chatti" name="play_typing_animation"/> + <check_box label="Simula la battitura tasti quando scrivi" name="play_typing_animation"/> <text name="text_box7"> Chat con vignette: </text> diff --git a/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml index 6ae5b6bb2fae2cf9afd0539035b965975c0d76b6..f9aaa58f09b04a4fdcb6aafadececefcc526986d 100644 --- a/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml @@ -2,28 +2,18 @@ <panel label="Grafica" name="Display panel"> <button label="?" name="GraphicsPreferencesHelpButton"/> <check_box label="Esegui Second Life in una finestra" name="windowed mode"/> - <text_editor name="FullScreenInfo"> - Se deselezionato, il viewer partirà a schermo intero all'avvio. + <text_editor name="FullScreenInfo" width="480"> + Se deselezionato, all'avvio il programma partirà a schermo intero. </text_editor> <text name="WindowSizeLabel"> Dimensione della finestra: </text> <combo_box name="windowsize combo"> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="720x480"> - 720x480 (NTSC) - </combo_item> - <combo_item name="768x576"> - 768x576 (PAL) - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> + <combo_box.item name="640x480" label="640x480"/> + <combo_box.item name="800x600" label="800x600"/> + <combo_box.item name="720x480" label="720x480 (NTSC)"/> + <combo_box.item name="768x576" label="768x576 (PAL)"/> + <combo_box.item name="1024x768" label="1024x768"/> </combo_box> <text name="DisplayResLabel"> Risoluzione del monitor: @@ -32,18 +22,10 @@ Rapporto di visualizzazione: </text> <combo_box name="aspect_ratio" tool_tip="larghezza/altezza"> - <combo_item name="4:3(StandardCRT)"> - 4:3 (Monitor Standard) - </combo_item> - <combo_item name="5:4(1280x1024LCD)"> - 5:4 (1280x1024 LCD) - </combo_item> - <combo_item name="8:5(Widescreen)"> - 8:5 (Widescreen) - </combo_item> - <combo_item name="16:9(Widescreen)"> - 16:9 (Widescreen) - </combo_item> + <combo_box.item name="4:3(StandardCRT)" label="4:3 (Monitor Standard)"/> + <combo_box.item name="5:4(1280x1024LCD)" label="5:4 (1280x1024 LCD)"/> + <combo_box.item name="8:5(Widescreen)" label="8:5 (Widescreen)"/> + <combo_box.item name="16:9(Widescreen)" label="16:9 (Widescreen)"/> </combo_box> <check_box label="Autoconfigurazione" name="aspect_auto_detect"/> <text name="HigherText"> @@ -68,7 +50,7 @@ Ultra </text> <text name="HigherText2"> - più alto + Più alto </text> <text name="QualityText2"> Qualità @@ -77,26 +59,18 @@ <text name="ShadersText"> Effetti grafici: </text> - <check_box label="Bump Mapping (piccoli rilievi) e scintillii" name="BumpShiny"/> - <check_box label="Effetti grafici base" name="BasicShaders" tool_tip="Disabilite questa opzione può evitare che qualche scheda grafica vada in crash."/> + <check_box label="Piccoli rilievi e scintillii" name="BumpShiny"/> + <check_box label="Effetti grafici base" name="BasicShaders" tool_tip="Disabilitare questa opzione può evitare che qualche scheda grafica vada in crash."/> <check_box label="Effetti grafici atmosferici" name="WindLightUseAtmosShaders"/> <check_box label="Riflessi dell'acqua" name="Reflections"/> <text name="ReflectionDetailText"> Dettaglio dei riflessi </text> <radio_group name="ReflectionDetailRadio"> - <radio_item name="0"> - Terreno ed alberi - </radio_item> - <radio_item name="1"> - Tutti gli aggetti statici - </radio_item> - <radio_item name="2"> - Tutti gli avatar e gli oggetti - </radio_item> - <radio_item name="3"> - Tutto - </radio_item> + <radio_item name="0" label="Terreno ed alberi" /> + <radio_item name="1" label="Tutti gli aggetti statici" /> + <radio_item name="2" label="Tutti gli avatar e gli oggetti" /> + <radio_item name="3" label="Tutto" /> </radio_group> <text name="AvatarRenderingText"> Rendering dell'avatar: @@ -110,18 +84,18 @@ <text name="DrawDistanceMeterText2"> m </text> - <slider label="Distanza di disegno:" name="DrawDistance"/> - <slider label="Conteggio massimo particelle:" name="MaxParticleCount"/> - <slider label="Qualità in post-produzione:" name="RenderPostProcess"/> + <slider label="Distanza di disegno:" name="DrawDistance" label_width="158" width="255"/> + <slider label="Conteggio massimo particelle:" name="MaxParticleCount" label_width="158" width="262" /> + <slider label="Qualità in post-produzione:" name="RenderPostProcess" label_width="158" width="223"/> <text name="MeshDetailText"> Dettagli reticolo: </text> - <slider label="Oggetti:" name="ObjectMeshDetail"/> - <slider label="Prims flessibili:" name="FlexibleMeshDetail"/> - <slider label="Alberi:" name="TreeMeshDetail"/> - <slider label="Avatar:" name="AvatarMeshDetail"/> - <slider label="Terreno:" name="TerrainMeshDetail"/> - <slider label="Cielo:" name="SkyMeshDetail"/> + <slider label=" Oggetti:" name="ObjectMeshDetail"/> + <slider label=" Prims flessibili:" name="FlexibleMeshDetail"/> + <slider label=" Alberi:" name="TreeMeshDetail"/> + <slider label=" Avatar:" name="AvatarMeshDetail"/> + <slider label=" Terreno:" name="TerrainMeshDetail"/> + <slider label=" Cielo:" name="SkyMeshDetail"/> <text name="PostProcessText"> Basso </text> @@ -147,23 +121,15 @@ Dettagli illuminazione: </text> <radio_group name="LightingDetailRadio"> - <radio_item name="SunMoon"> - Sole e luna solamente - </radio_item> - <radio_item name="LocalLights"> - Luci locali - </radio_item> + <radio_item name="SunMoon" label="Solo il sole e la luna" /> + <radio_item name="LocalLights" label="Luci locali" /> </radio_group> <text name="TerrainDetailText"> Dettagli terreno: </text> <radio_group name="TerrainDetailRadio"> - <radio_item name="0"> - Bassi - </radio_item> - <radio_item name="2"> - Alti - </radio_item> + <radio_item name="0" label="Bassi" /> + <radio_item name="2" label="Alti" /> </radio_group> <button label="Configurazione raccomandata" name="Defaults" left="110" width="190" /> <button label="Opzioni hardware" label_selected="Opzioni hardware" name="GraphicsHardwareButton"/> diff --git a/indra/newview/skins/default/xui/ja/floater_animation_preview.xml b/indra/newview/skins/default/xui/ja/floater_animation_preview.xml index 27a07e633b550af11426a0cbd0d5161a25b06129..b61007d86e61de81fb4a275a7357d63debae4543 100644 --- a/indra/newview/skins/default/xui/ja/floater_animation_preview.xml +++ b/indra/newview/skins/default/xui/ja/floater_animation_preview.xml @@ -13,18 +13,10 @@ </text> <combo_box label="" name="preview_base_anim" tool_tip="ã‚¢ãƒã‚¿ãƒ¼ãŒæ™®é€šã®è¡Œå‹•ã‚’ã™ã‚‹ã¨ãã®ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã®å‹•ãをテストã™ã‚‹ãŸã‚ã«ã“れを使ã„ã¾ã™ã€‚"> - <combo_item name="Standing"> - 立㤠- </combo_item> - <combo_item name="Walking"> - æ©ã - </combo_item> - <combo_item name="Sitting"> - 座る - </combo_item> - <combo_item name="Flying"> - 飛行 - </combo_item> + <combo_box.item name="Standing" label="ç«‹ã¤" /> + <combo_box.item name="Walking" label="æ©ã" /> + <combo_box.item name="Sitting" label="座る" /> + <combo_box.item name="Flying" label="飛行" /> </combo_box> <pad height="7" /> <check_box label="ループ" name="loop_check" @@ -38,111 +30,45 @@ </text> <combo_box label="" name="hand_pose_combo" tool_tip="アニメーションã®æ‰‹ã®å‹•ãをコントãƒãƒ¼ãƒ«ã—ã¾ã™ã€‚"> - <combo_item name="Spread"> - 広ãŒã‚‹ - </combo_item> - <combo_item name="Relaxed"> - リラックス - </combo_item> - <combo_item name="PointBoth"> - 両方を指㙠- </combo_item> - <combo_item name="Fist"> - 拳 - </combo_item> - <combo_item name="RelaxedLeft"> - リラックス左 - </combo_item> - <combo_item name="PointLeft"> - 左を指㙠- </combo_item> - <combo_item name="FistLeft"> - 拳左 - </combo_item> - <combo_item name="RelaxedRight"> - ãƒªãƒ©ãƒƒã‚¯ã‚¹å³ - </combo_item> - <combo_item name="PointRight"> - å³ã‚’指㙠- </combo_item> - <combo_item name="FistRight"> - æ‹³å³ - </combo_item> - <combo_item name="SaluteRight"> - æ•¬ç¤¼å³ - </combo_item> - <combo_item name="Typing"> - 入力ã™ã‚‹ - </combo_item> - <combo_item name="PeaceRight"> - ãƒ”ãƒ¼ã‚¹ãƒ»ã‚µã‚¤ãƒ³å³ - </combo_item> + <combo_box.item name="Spread" label="広ãŒã‚‹" /> + <combo_box.item name="Relaxed" label="リラックス" /> + <combo_box.item name="PointBoth" label="両方を指ã™" /> + <combo_box.item name="Fist" label="拳" /> + <combo_box.item name="RelaxedLeft" label="リラックス左" /> + <combo_box.item name="PointLeft" label="左を指ã™" /> + <combo_box.item name="FistLeft" label="拳左" /> + <combo_box.item name="RelaxedRight" label="リラックスå³" /> + <combo_box.item name="PointRight" label="å³ã‚’指ã™" /> + <combo_box.item name="FistRight" label="拳å³" /> + <combo_box.item name="SaluteRight" label="敬礼å³" /> + <combo_box.item name="Typing" label="入力ã™ã‚‹" /> + <combo_box.item name="PeaceRight" label="ピース・サインå³" /> </combo_box> <text name="emote_label"> è¡¨ç¾ </text> <combo_box label="" name="emote_combo" tool_tip="アニメーションã®é¡”を表情をコントãƒãƒ¼ãƒ«ã—ã¾ã™ã€‚"> - <combo_item name="[None]"> - [None] - </combo_item> - <combo_item name="Aaaaah"> - アーーーーー - </combo_item> - <combo_item name="Afraid"> - 怖れ - </combo_item> - <combo_item name="Angry"> - 怒り - </combo_item> - <combo_item name="BigSmile"> - 満é¢ã®ç¬‘ã¿ - </combo_item> - <combo_item name="Bored"> - 退屈 - </combo_item> - <combo_item name="Cry"> - æ³£ã - </combo_item> - <combo_item name="Disdain"> - 侮蔑 - </combo_item> - <combo_item name="Embarrassed"> - 困惑 - </combo_item> - <combo_item name="Frown"> - ã—ã‹ã‚ã£é¢ - </combo_item> - <combo_item name="Kiss"> - ã‚ス - </combo_item> - <combo_item name="Laugh"> - 笑ㆠ- </combo_item> - <combo_item name="Plllppt"> - Plllppt - </combo_item> - <combo_item name="Repulsed"> - 嫌悪感 - </combo_item> - <combo_item name="Sad"> - 悲ã—ã„ - </combo_item> - <combo_item name="Shrug"> - è‚©ã‚’ã™ãã‚ã‚‹ - </combo_item> - <combo_item name="Smile"> - 笑㿠- </combo_item> - <combo_item name="Surprise"> - é©šã - </combo_item> - <combo_item name="Wink"> - ウィンク - </combo_item> - <combo_item name="Worry"> - å¿ƒé… - </combo_item> + <combo_box.item name="[None]" label="None]" /> + <combo_box.item name="Aaaaah" label="アーーーーー" /> + <combo_box.item name="Afraid" label="怖れ" /> + <combo_box.item name="Angry" label="怒り" /> + <combo_box.item name="BigSmile" label="満é¢ã®ç¬‘ã¿" /> + <combo_box.item name="Bored" label="退屈" /> + <combo_box.item name="Cry" label="æ³£ã" /> + <combo_box.item name="Disdain" label="侮蔑" /> + <combo_box.item name="Embarrassed" label="困惑" /> + <combo_box.item name="Frown" label="ã—ã‹ã‚ã£é¢" /> + <combo_box.item name="Kiss" label="ã‚ス" /> + <combo_box.item name="Laugh" label="笑ã†" /> + <combo_box.item name="Plllppt" label="Plllppt" /> + <combo_box.item name="Repulsed" label="嫌悪感" /> + <combo_box.item name="Sad" label="悲ã—ã„" /> + <combo_box.item name="Shrug" label="è‚©ã‚’ã™ãã‚ã‚‹" /> + <combo_box.item name="Smile" label="笑ã¿" /> + <combo_box.item name="Surprise" label="é©šã" /> + <combo_box.item name="Wink" label="ウィンク" /> + <combo_box.item name="Worry" label="心é…" /> </combo_box> <spinner label="フェーズイï¾(秒)" name="ease_in_time" tool_tip="アニメーションã®ãƒ–レンド・イン時間(秒)" /> diff --git a/indra/newview/skins/default/xui/ja/floater_buy_land.xml b/indra/newview/skins/default/xui/ja/floater_buy_land.xml index ba51e7263dbecfd4091102e55604fe680ec515cf..1ccd1f53a4ca28ddfd927c04d2fc39fc951e577d 100644 --- a/indra/newview/skins/default/xui/ja/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/ja/floater_buy_land.xml @@ -36,6 +36,7 @@ <text name="covenant_text"> ä¸å‹•ç”£ç´„款ã«åŒæ„ã—ã¦ãã ã•ã„: </text> + <text left="470" name="covenant_timestamp_text"/> <text_editor name="covenant_editor"> ãƒãƒ¼ãƒ‰ä¸ï¼Žï¼Žï¼Ž </text_editor> @@ -74,15 +75,9 @@ 土地をä¿æœ‰ã§ãã‚‹ã®ã¯ãƒ—レミアム・メンãƒãƒ¼ã ã‘ã§ã™ </text> <combo_box name="account_level"> - <combo_item name="US$9.95/month,billedmonthly"> - 月é¡9.95米ドルã€æœˆæ‰•ã„ - </combo_item> - <combo_item name="US$7.50/month,billedquarterly"> - 月é¡7.50米ドルã€å¹´4回払ㄠ- </combo_item> - <combo_item name="US$6.00/month,billedannually"> - 月é¡6.00米ドルã€å¹´æ‰•ã„ - </combo_item> + <combo_box.item name="US$9.95/month,billedmonthly" label="月é¡9.95米ドルã€æœˆæ‰•ã„" /> + <combo_box.item name="US$7.50/month,billedquarterly" label="月é¡7.50米ドルã€å¹´4回払ã„" /> + <combo_box.item name="US$6.00/month,billedannually" label="月é¡6.00米ドルã€å¹´æ‰•ã„" /> </combo_box> <text name="land_use_action"> 毎月ã®åœŸåœ°ä½¿ç”¨æ–™ã‚’US$40ã«å¼•ã上ã’ã¾ã™ diff --git a/indra/newview/skins/default/xui/ja/floater_hardware_settings.xml b/indra/newview/skins/default/xui/ja/floater_hardware_settings.xml index 2466dd5943791ef3b79e7a9e957aa4e7db87adea..67d105c2a44561df8af7f8d22952a6ce40e5c81a 100644 --- a/indra/newview/skins/default/xui/ja/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/ja/floater_hardware_settings.xml @@ -10,21 +10,11 @@ アンãƒã‚¨ã‚¤ãƒªã‚¢ã‚·ãƒ³ã‚°: </text> <combo_box label="アンãƒã‚¨ã‚¤ãƒªã‚¢ã‚·ãƒ³ã‚°" name="fsaa"> - <combo_item name="FSAADisabled"> - 無効 - </combo_item> - <combo_item name="2x"> - 2x - </combo_item> - <combo_item name="4x"> - 4x - </combo_item> - <combo_item name="8x"> - 8x - </combo_item> - <combo_item name="16x"> - 16x - </combo_item> + <combo_box.item name="FSAADisabled" label="無効" /> + <combo_box.item name="2x" label="2x" /> + <combo_box.item name="4x" label="4x" /> + <combo_box.item name="8x" label="8x" /> + <combo_box.item name="16x" label="16x" /> </combo_box> <spinner label="ガンマ:" name="gamma" /> <text name="(brightness, lower is brighter)"> diff --git a/indra/newview/skins/default/xui/ja/floater_image_preview.xml b/indra/newview/skins/default/xui/ja/floater_image_preview.xml index be8e5c6416949f56056e0c56485e6021124b9bc8..fae9c87da481fb861f1c3480e5d57b69a7505ab6 100644 --- a/indra/newview/skins/default/xui/ja/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/ja/floater_image_preview.xml @@ -10,36 +10,16 @@ イメージã®ï¾Œï¾Ÿï¾šï¾‹ï¾žï½ï½°ï¼š </text> <combo_box label="æœã®ç¨®é¡ž" name="clothing_type_combo"> - <combo_item name="Image"> - ç”»åƒ - </combo_item> - <combo_item name="Hair"> - 髪 - </combo_item> - <combo_item name="FemaleHead"> - 女性ã®é - </combo_item> - <combo_item name="FemaleUpperBody"> - 女性ã®ä¸ŠåŠèº« - </combo_item> - <combo_item name="FemaleLowerBody"> - 女性ã®ä¸‹åŠèº« - </combo_item> - <combo_item name="MaleHead"> - 男性ã®é - </combo_item> - <combo_item name="MaleUpperBody"> - 男性ã®ä¸ŠåŠèº« - </combo_item> - <combo_item name="MaleLowerBody"> - 男性ã®ä¸‹åŠèº« - </combo_item> - <combo_item name="Skirt"> - スカート - </combo_item> - <combo_item name="SculptedPrim"> - 変形ã•ã‚ŒãŸãƒ—リム- </combo_item> + <combo_box.item name="Image" label="ç”»åƒ" /> + <combo_box.item name="Hair" label="髪" /> + <combo_box.item name="FemaleHead" label="女性ã®é " /> + <combo_box.item name="FemaleUpperBody" label="女性ã®ä¸ŠåŠèº«" /> + <combo_box.item name="FemaleLowerBody" label="女性ã®ä¸‹åŠèº«" /> + <combo_box.item name="MaleHead" label="男性ã®é " /> + <combo_box.item name="MaleUpperBody" label="男性ã®ä¸ŠåŠèº«" /> + <combo_box.item name="MaleLowerBody" label="男性ã®ä¸‹åŠèº«" /> + <combo_box.item name="Skirt" label="スカート" /> + <combo_box.item name="SculptedPrim" label="変形ã•ã‚ŒãŸãƒ—リム" /> </combo_box> <text name="bad_image_text"> イメージをèªã¿å–ã‚Œã¾ã›ã‚“。 diff --git a/indra/newview/skins/default/xui/ja/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/ja/floater_inventory_item_properties.xml index 9a408b92a9404e5b64f00a2f8611b6da6476ec68..8588ee1a96669a6a589f628837bb91809a95497e 100644 --- a/indra/newview/skins/default/xui/ja/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/ja/floater_inventory_item_properties.xml @@ -60,12 +60,8 @@ </text> <check_box label="売り出ã—ä¸" name="CheckPurchase" /> <radio_group name="RadioSaleType"> - <radio_item name="radio"> - オリジナル - </radio_item> - <radio_item name="radio2"> - コピー - </radio_item> + <radio_item name="radio" label="オリジナル" /> + <radio_item name="radio2" label="コピー" /> </radio_group> <text name="TextPrice"> 料金:L$ diff --git a/indra/newview/skins/default/xui/ja/floater_preview_gesture.xml b/indra/newview/skins/default/xui/ja/floater_preview_gesture.xml index 9ddf537fee0c321fdc787eec05b618646d3a77ac..1ec868d0d8fc57cc128e257dc5280e4652763aab 100644 --- a/indra/newview/skins/default/xui/ja/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/ja/floater_preview_gesture.xml @@ -46,12 +46,8 @@ ã¾ã™ã€‚ </text> <radio_group name="animation_trigger_type"> - <radio_item name="start"> - 開始 - </radio_item> - <radio_item name="stop"> - åœæ¢ - </radio_item> + <radio_item name="start" label="開始" /> + <radio_item name="stop" label="åœæ¢" /> </radio_group> <check_box label="アニメーションãŒå®Œäº†ã™ã‚‹ã¾ã§" name="wait_anim_check"/> <check_box label="秒表示ã®æ™‚é–“" name="wait_time_check"/> diff --git a/indra/newview/skins/default/xui/ja/floater_sell_land.xml b/indra/newview/skins/default/xui/ja/floater_sell_land.xml index 90c83c2103005dee4d683fe5070eb070a0925f30..3860c599fbaa0cb8d98fec77da2697db799ad43e 100644 --- a/indra/newview/skins/default/xui/ja/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/ja/floater_sell_land.xml @@ -36,15 +36,9 @@ 誰ã«ã§ã‚‚販売ã™ã‚‹ã‹ã€ç‰¹å®šã®äººã«ã®ã¿è²©å£²ã™ã‚‹ã‹ã‚’é¸æŠžã—ã¦ãã ã•ã„ </text> <combo_box name="sell_to"> - <combo_item name="--selectone--"> - ï¼ï¼1ã¤é¸æŠžï¼ï¼ - </combo_item> - <combo_item name="Anyone"> - 誰ã§ã‚‚ - </combo_item> - <combo_item name="Specificuser:"> - 特定ユーザー: - </combo_item> + <combo_box.item name="--selectone--" label="1ã¤é¸æŠžï¼ï¼" /> + <combo_box.item name="Anyone" label="誰ã§ã‚‚" /> + <combo_box.item name="Specificuser:" label="特定ユーザー:" /> </combo_box> <button label="é¸æŠž..." name="sell_to_select_agent" /> <text name="sell_objects_label"> diff --git a/indra/newview/skins/default/xui/ja/floater_settings_debug.xml b/indra/newview/skins/default/xui/ja/floater_settings_debug.xml index 1de3763f79d75327177f69e6988de62526d4fb15..133a8ce2cd38c0e5c8c8b5990a9bb11d192ac1be 100644 --- a/indra/newview/skins/default/xui/ja/floater_settings_debug.xml +++ b/indra/newview/skins/default/xui/ja/floater_settings_debug.xml @@ -1,12 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater name="settings_debug" title="デãƒãƒƒã‚°è¨å®š"> <combo_box name="boolean_combo"> - <combo_item name="TRUE"> - æ£ - </combo_item> - <combo_item name="FALSE"> - 誤 - </combo_item> + <combo_box.item name="TRUE" label="æ£" /> + <combo_box.item name="FALSE" label="誤" /> </combo_box> <color_swatch label="色" name="color_swatch" /> <spinner label="x" name="val_spinner_1" /> diff --git a/indra/newview/skins/default/xui/ja/floater_snapshot.xml b/indra/newview/skins/default/xui/ja/floater_snapshot.xml index 7937de117c7f68ece8be028ed24f3ec63a49128f..98db0e358e55308c9220a2cb73064416febdf994 100644 --- a/indra/newview/skins/default/xui/ja/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/ja/floater_snapshot.xml @@ -4,15 +4,9 @@ スナップショットã®é€ã‚Šå…ˆ </text> <radio_group label="スナップショット・タイプ" name="snapshot_type_radio"> - <radio_item name="postcard"> - Eメールã§é€ä¿¡ - </radio_item> - <radio_item name="texture"> - æŒã¡ç‰©ã«ä¿å˜ï¼ˆL$[AMOUNT]) - </radio_item> - <radio_item name="local"> - ãƒãƒ¼ãƒ‰ãƒ‡ã‚£ã‚¹ã‚¯ã«ä¿å˜ - </radio_item> + <radio_item name="postcard" label="Eメールã§é€ä¿¡" /> + <radio_item name="texture" label="æŒã¡ç‰©ã«ä¿å˜ï¼ˆL$[AMOUNT])" /> + <radio_item name="local" label="ãƒãƒ¼ãƒ‰ãƒ‡ã‚£ã‚¹ã‚¯ã«ä¿å˜" /> </radio_group> <text name="file_size_label"> ファイル・サイズ: [SIZE] KB @@ -21,12 +15,12 @@ <button label="é€ä¿¡" name="send_btn"/> <button label="ä¿å˜ï¼ˆL$[AMOUNT])" name="upload_btn"/> <flyout_button label="ä¿å˜" name="save_btn" tool_tip="ç”»åƒã‚’ファイルã«ä¿å˜"> - <flyout_button_item name="save_item"> - ä¿å˜ - </flyout_button_item> - <flyout_button_item name="saveas_item"> - åå‰ã‚’付ã‘ã¦ä¿å˜ - </flyout_button_item> + <flyout_button.item name="save_item"> + ä¿å˜ + </flyout_button.item> + <flyout_button.item name="saveas_item"> + åå‰ã‚’付ã‘ã¦ä¿å˜ + </flyout_button.item> </flyout_button> <button label="ã‚ャンセル" name="discard_btn"/> <button label="全表示 >>" name="more_btn" tool_tip="高度ãªã‚ªãƒ—ション"/> @@ -38,75 +32,33 @@ å½¢å¼ </text> <combo_box label="解åƒåº¦" name="postcard_size_combo"> - <combo_item name="CurrentWindow"> - ç¾åœ¨ã®ï½³ï½¨ï¾ï¾„゙ウ - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="Custom"> - カスタム- </combo_item> + <combo_box.item name="CurrentWindow" label="ç¾åœ¨ã®ï½³ï½¨ï¾ï¾„゙ウ" /> + <combo_box.item name="640x480" label="640x480" /> + <combo_box.item name="800x600" label="800x600" /> + <combo_box.item name="1024x768" label="1024x768" /> + <combo_box.item name="Custom" label="カスタム" /> </combo_box> <combo_box label="解åƒåº¦" name="texture_size_combo"> - <combo_item name="CurrentWindow"> - ç¾åœ¨ã®ï½³ï½¨ï¾ï¾„゙ウ - </combo_item> - <combo_item name="Small(128x128)"> - å°ï¼ˆ128x128) - </combo_item> - <combo_item name="Medium(256x256)"> - ä¸ï¼ˆ256x256) - </combo_item> - <combo_item name="Large(512x512)"> - 大(512x512) - </combo_item> - <combo_item name="Custom"> - カスタム- </combo_item> + <combo_box.item name="CurrentWindow" label="ç¾åœ¨ã®ï½³ï½¨ï¾ï¾„゙ウ" /> + <combo_box.item name="Small(128x128)" label="å°ï¼ˆ128x128)" /> + <combo_box.item name="Medium(256x256)" label="ä¸ï¼ˆ256x256)" /> + <combo_box.item name="Large(512x512)" label="大(512x512)" /> + <combo_box.item name="Custom" label="カスタム" /> </combo_box> <combo_box label="解åƒåº¦" name="local_size_combo"> - <combo_item name="CurrentWindow"> - ç¾åœ¨ã®ï½³ï½¨ï¾ï¾„゙ウ - </combo_item> - <combo_item name="320x240"> - 320x240 - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="1280x1024"> - 1280x1024 - </combo_item> - <combo_item name="1600x1200"> - 1600x1200 - </combo_item> - <combo_item name="Custom"> - カスタム- </combo_item> + <combo_box.item name="CurrentWindow" label="ç¾åœ¨ã®ï½³ï½¨ï¾ï¾„゙ウ" /> + <combo_box.item name="320x240" label="320x240" /> + <combo_box.item name="640x480" label="640x480" /> + <combo_box.item name="800x600" label="800x600" /> + <combo_box.item name="1024x768" label="1024x768" /> + <combo_box.item name="1280x1024" label="1280x1024" /> + <combo_box.item name="1600x1200" label="1600x1200" /> + <combo_box.item name="Custom" label="カスタム" /> </combo_box> <combo_box label="å½¢å¼" name="local_format_combo"> - <combo_item name="PNG"> - PNG - </combo_item> - <combo_item name="JPEG"> - JPEG - </combo_item> - <combo_item name="BMP"> - BMP - </combo_item> + <combo_box.item name="PNG" label="PNG" /> + <combo_box.item name="JPEG" label="JPEG" /> + <combo_box.item name="BMP" label="BMP" /> </combo_box> <spinner label="å¹…" name="snapshot_width" label_width="25" width="90"/> <spinner label="高ã•" name="snapshot_height" label_width="30" left="115" width="90"/> @@ -116,15 +68,9 @@ キャプï¾ï½¬ï¼š </text> <combo_box label="ç”»åƒãƒ¬ã‚¤ãƒ¤ãƒ¼" name="layer_types"> - <combo_item name="Colors"> - 色 - </combo_item> - <combo_item name="Depth"> - 深㕠- </combo_item> - <combo_item name="ObjectMattes"> - オグジェクトã®ã¤ã‚„消㗠- </combo_item> + <combo_box.item name="Colors" label="色" /> + <combo_box.item name="Depth" label="æ·±ã•" /> + <combo_box.item name="ObjectMattes" label="オグジェクトã®ã¤ã‚„消ã—" /> </combo_box> <check_box label="インタフェースを表示" name="ui_check"/> <check_box label="HUD オブジェクトを表示" name="hud_check"/> diff --git a/indra/newview/skins/default/xui/ja/floater_sound_preview.xml b/indra/newview/skins/default/xui/ja/floater_sound_preview.xml index 6bc259536f91545b1bd0ca0a914a08a32d9d8047..b24791438992c83aabd64c66ac84eea92fa7cf5d 100644 --- a/indra/newview/skins/default/xui/ja/floater_sound_preview.xml +++ b/indra/newview/skins/default/xui/ja/floater_sound_preview.xml @@ -12,17 +12,9 @@ ビットレート(kbps): </text> <radio_group name="bitrate"> - <radio_item name="32"> - 32 - </radio_item> - <radio_item name="64"> - 64 - </radio_item> - <radio_item name="96"> - 96 - </radio_item> - <radio_item name="128"> - 128 - </radio_item> + <radio_item name="32" label="32" /> + <radio_item name="64" label="64" /> + <radio_item name="96" label="96" /> + <radio_item name="128" label="128" /> </radio_group> </floater> diff --git a/indra/newview/skins/default/xui/ja/floater_tools.xml b/indra/newview/skins/default/xui/ja/floater_tools.xml index 0b03a04f3e2826b927e01a46537abc1d4748b89a..477ba2bdcb507579b23e04d5e0fdfdc63c98e2cc 100644 --- a/indra/newview/skins/default/xui/ja/floater_tools.xml +++ b/indra/newview/skins/default/xui/ja/floater_tools.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="toolbox floater" title=""> +<floater name="toolbox floater" title="" short_title="制作"> <button label="" label_selected="" name="button focus" tool_tip="フォーカス"/> <button label="" label_selected="" name="button move" tool_tip="å‹•ã‹ã™"/> <button label="" label_selected="" name="button edit" tool_tip="編集"/> @@ -20,15 +20,9 @@ ルーラー: </text> <combo_box left_delta="60" name="combobox grid mode" width="76"> - <combo_item name="World"> - 世界 - </combo_item> - <combo_item name="Local"> - ãƒãƒ¼ã‚«ãƒ« - </combo_item> - <combo_item name="Reference"> - リファレンス - </combo_item> + <combo_box.item name="World" label="世界"/> + <combo_box.item name="Local" label="ãƒãƒ¼ã‚«ãƒ«"/> + <combo_box.item name="Reference" label="リファレンス"/> </combo_box> <check_box label="両å´ã‚’引伸ã°ã™" left="116" name="checkbox uniform"/> <check_box label="テクスãƒãƒ£ãƒ¼ã‚’引伸ã°ã™" name="checkbox stretch textures"/> @@ -130,15 +124,9 @@ ä¾¡æ ¼ï¼š L$ </text> <radio_group left="30" name="sale type"> - <radio_item name="Original"> - オリジナル - </radio_item> - <radio_item left="82" name="Copy"> - コピー - </radio_item> - <radio_item left="148" name="Contents"> - コンテンツ - </radio_item> + <radio_item name="Original" label="オリジナル" /> + <radio_item left="82" name="Copy" label="コピー" /> + <radio_item left="148" name="Contents" label="コンテンツ" /> </radio_group> <text name="Next owner can:"> 次ã®ã‚ªãƒ¼ãƒŠãƒ¼ãŒå®Ÿè¡Œã§ãã‚‹æ“作: @@ -150,27 +138,13 @@ 左クリックã™ã‚‹ã¨ï¼š </text> <combo_box name="clickaction"> - <combo_item name="Touch/grab(default)"> - 触るï¼ã¤ã‹ã‚€ (デフォルト) - </combo_item> - <combo_item name="Sitonobject"> - オブジェクトã«åº§ã‚‹ - </combo_item> - <combo_item name="Buyobject"> - オブジェクトを購入 - </combo_item> - <combo_item name="Payobject"> - オブジェクトã¸ã®æ”¯æ‰•ã„ - </combo_item> - <combo_item name="Open"> - é–‹ã - </combo_item> - <combo_item name="Play"> - 区画メディアをå†ç”Ÿ - </combo_item> - <combo_item name="Opemmedia"> - 区画メディアを開ã - </combo_item> + <combo_box.item name="Touch/grab(default)" label="触るï¼ã¤ã‹ã‚€ (デフォルト)"/> + <combo_box.item name="Sitonobject" label="オブジェクトã«åº§ã‚‹"/> + <combo_box.item name="Buyobject" label="オブジェクトを購入"/> + <combo_box.item name="Payobject" label="オブジェクトã¸ã®æ”¯æ‰•ã„"/> + <combo_box.item name="Open" label="é–‹ã"/> + <combo_box.item name="Play" label="区画メディアをå†ç”Ÿ"/> + <combo_box.item name="Opemmedia" label="区画メディアを開ã"/> </combo_box> <text name="B:"> B: @@ -254,56 +228,26 @@ ç´ æ </text> <combo_box name="material"> - <combo_item name="Stone"> - 石æ - </combo_item> - <combo_item name="Metal"> - 金属 - </combo_item> - <combo_item name="Glass"> - ガラス - </combo_item> - <combo_item name="Wood"> - 木æ - </combo_item> - <combo_item name="Flesh"> - è‚Œ - </combo_item> - <combo_item name="Plastic"> - プラスãƒãƒƒã‚¯ - </combo_item> - <combo_item name="Rubber"> - ゴム- </combo_item> + <combo_box.item name="Stone" label="石æ"/> + <combo_box.item name="Metal" label="金属"/> + <combo_box.item name="Glass" label="ガラス"/> + <combo_box.item name="Wood" label="木æ"/> + <combo_box.item name="Flesh" label="è‚Œ"/> + <combo_box.item name="Plastic" label="プラスãƒãƒƒã‚¯"/> + <combo_box.item name="Rubber" label="ゴム"/> </combo_box> <text name="label basetype"> å»ºé€ ç‰©ãƒ–ãƒãƒƒã‚¯ãƒ»ã‚¿ã‚¤ãƒ— </text> <combo_box name="comboBaseType"> - <combo_item name="Box"> - ボックス - </combo_item> - <combo_item name="Cylinder"> - シリンダー - </combo_item> - <combo_item name="Prism"> - プリズム- </combo_item> - <combo_item name="Sphere"> - çƒå½¢ - </combo_item> - <combo_item name="Torus"> - トーラス - </combo_item> - <combo_item name="Tube"> - ãƒãƒ¥ãƒ¼ãƒ– - </combo_item> - <combo_item name="Ring"> - リング - </combo_item> - <combo_item name="Sculpted"> - スカルプト - </combo_item> + <combo_box.item name="Box" label="ボックス"/> + <combo_box.item name="Cylinder" label="シリンダー"/> + <combo_box.item name="Prism" label="プリズム"/> + <combo_box.item name="Sphere" label="çƒå½¢"/> + <combo_box.item name="Torus" label="トーラス"/> + <combo_box.item name="Tube" label="ãƒãƒ¥ãƒ¼ãƒ–"/> + <combo_box.item name="Ring" label="リング"/> + <combo_box.item name="Sculpted" label="スカルプト"/> </combo_box> <text name="text cut"> パス・カットã®å§‹ç‚¹ã¨çµ‚点 @@ -320,18 +264,10 @@ ä¸ç©ºï¼ˆç©ºæ´žï¼‰ã®å½¢ </text> <combo_box name="hole"> - <combo_item name="Default"> - デフォルト - </combo_item> - <combo_item name="Circle"> - サークル - </combo_item> - <combo_item name="Square"> - æ£æ–¹å½¢ - </combo_item> - <combo_item name="Triangle"> - 三角形 - </combo_item> + <combo_box.item name="Default" label="デフォルト"/> + <combo_box.item name="Circle" label="サークル"/> + <combo_box.item name="Square" label="æ£æ–¹å½¢"/> + <combo_box.item name="Triangle" label="三角形"/> </combo_box> <text name="text twist"> ã²ãã‚Šã®å§‹ã¾ã‚Šã¨çµ‚ã‚ã‚Š @@ -380,21 +316,11 @@ 縫ã„ç›®ã®ã‚¿ã‚¤ãƒ— </text> <combo_box name="sculpt type control"> - <combo_item name="None"> - (ãªã—) - </combo_item> - <combo_item name="Sphere"> - çƒå½¢ - </combo_item> - <combo_item name="Torus"> - トーラス - </combo_item> - <combo_item name="Plane"> - å¹³é¢ - </combo_item> - <combo_item name="Cylinder"> - シリンダー - </combo_item> + <combo_box.item name="None" label="ãªã—)"/> + <combo_box.item name="Sphere" label="çƒå½¢"/> + <combo_box.item name="Torus" label="トーラス"/> + <combo_box.item name="Plane" label="å¹³é¢"/> + <combo_box.item name="Cylinder" label="シリンダー"/> </combo_box> </panel> <panel label="特徴" name="Features"> @@ -436,88 +362,40 @@ マッピング </text> <combo_box name="combobox texgen"> - <combo_item name="Default"> - デフォルト - </combo_item> - <combo_item name="Planar"> - å¹³é¢ - </combo_item> + <combo_box.item name="Default" label="デフォルト"/> + <combo_box.item name="Planar" label="å¹³é¢"/> </combo_box> <text name="label shininess"> è¼ã </text> <combo_box name="combobox shininess"> - <combo_item name="None"> - ãªã— - </combo_item> - <combo_item name="Low"> - 低 - </combo_item> - <combo_item name="Medium"> - ä¸ - </combo_item> - <combo_item name="High"> - 高 - </combo_item> + <combo_box.item name="None" label="ãªã—"/> + <combo_box.item name="Low" label="低"/> + <combo_box.item name="Medium" label="ä¸"/> + <combo_box.item name="High" label="高"/> </combo_box> <text name="label bumpiness"> 凹凸 </text> <combo_box name="combobox bumpiness"> - <combo_item name="None"> - ãªã— - </combo_item> - <combo_item name="Brightness"> - 明る㕠- </combo_item> - <combo_item name="Darkness"> - æš—ã• - </combo_item> - <combo_item name="woodgrain"> - 木目調 - </combo_item> - <combo_item name="bark"> - 木ã®çš® - </combo_item> - <combo_item name="bricks"> - レンガ - </combo_item> - <combo_item name="checker"> - ãƒã‚§ãƒƒã‚«ãƒ¼ - </combo_item> - <combo_item name="concrete"> - コンクリート - </combo_item> - <combo_item name="crustytile"> - クラスティ・タイル - </combo_item> - <combo_item name="cutstone"> - カットストーン - </combo_item> - <combo_item name="discs"> - ディスク - </combo_item> - <combo_item name="gravel"> - ç ‚åˆ© - </combo_item> - <combo_item name="petridish"> - ペトリ - </combo_item> - <combo_item name="siding"> - ç¾½ç›®æ¿ - </combo_item> - <combo_item name="stonetile"> - ストーン・タイル - </combo_item> - <combo_item name="stucco"> - ã—ã£ãã„ - </combo_item> - <combo_item name="suction"> - å¸ã„込㿠- </combo_item> - <combo_item name="weave"> - 織目 - </combo_item> + <combo_box.item name="None" label="ãªã—"/> + <combo_box.item name="Brightness" label="明るã•"/> + <combo_box.item name="Darkness" label="æš—ã•"/> + <combo_box.item name="woodgrain" label="木目調"/> + <combo_box.item name="bark" label="木ã®çš®"/> + <combo_box.item name="bricks" label="レンガ"/> + <combo_box.item name="checker" label="ãƒã‚§ãƒƒã‚«ãƒ¼"/> + <combo_box.item name="concrete" label="コンクリート"/> + <combo_box.item name="crustytile" label="クラスティ・タイル"/> + <combo_box.item name="cutstone" label="カットストーン"/> + <combo_box.item name="discs" label="ディスク"/> + <combo_box.item name="gravel" label="ç ‚åˆ©"/> + <combo_box.item name="petridish" label="ペトリ"/> + <combo_box.item name="siding" label="羽目æ¿"/> + <combo_box.item name="stonetile" label="ストーン・タイル"/> + <combo_box.item name="stucco" label="ã—ã£ãã„"/> + <combo_box.item name="suction" label="å¸ã„è¾¼ã¿"/> + <combo_box.item name="weave" label="織目"/> </combo_box> <text name="tex scale"> é¢ã”ã¨ã«ç¹°ã‚Šè¿”ã™ diff --git a/indra/newview/skins/default/xui/ja/floater_tos.xml b/indra/newview/skins/default/xui/ja/floater_tos.xml index 31e3a240459a4ce52b2107cd6de9ce1c54aa68a0..c0d1af1d6ac589e7aad2ca20645f72171ac42a35 100644 --- a/indra/newview/skins/default/xui/ja/floater_tos.xml +++ b/indra/newview/skins/default/xui/ja/floater_tos.xml @@ -3,12 +3,8 @@ <button label="続行" label_selected="続行" name="Continue" /> <button label="å–り消ã—" label_selected="å–り消ã—" name="Cancel" /> <radio_group name="tos_agreement"> - <radio_item name="radio_disagree"> - 利用è¦ç´„ã«åŒæ„ã—ã¾ã›ã‚“ - </radio_item> - <radio_item name="radio_agree"> - 利用è¦ç´„ã«åŒæ„ã—ã¾ã™ - </radio_item> + <radio_item name="radio_disagree" label="利用è¦ç´„ã«åŒæ„ã—ã¾ã›ã‚“" /> + <radio_item name="radio_agree" label="利用è¦ç´„ã«åŒæ„ã—ã¾ã™" /> </radio_group> <text name="tos_title"> 利用è¦ç´„ diff --git a/indra/newview/skins/default/xui/ja/floater_world_map.xml b/indra/newview/skins/default/xui/ja/floater_world_map.xml index a7a6e305ae186eb3f1396f1a9728cbe36a23a5ea..c6385980efe14f906f6c4154a0e94a3ba1253898 100644 --- a/indra/newview/skins/default/xui/ja/floater_world_map.xml +++ b/indra/newview/skins/default/xui/ja/floater_world_map.xml @@ -29,14 +29,10 @@ <check_box label="Mature" name="event_mature_chk"/> <check_box label="Adult" name="event_adult_chk"/> <combo_box label="オンラインã®ãƒ•ãƒ¬ãƒ³ãƒ‰" name="friend combo" tool_tip="地図ã«è¡¨ç¤ºã•ã‚ŒãŸãƒ•ãƒ¬ãƒ³ãƒ‰"> - <combo_item name="none_selected"> - オンラインã®ãƒ•ãƒ¬ãƒ³ãƒ‰ - </combo_item> + <combo_box.item name="none_selected" label="オンラインã®ãƒ•ãƒ¬ãƒ³ãƒ‰" /> </combo_box> <combo_box label="ランドマーク" name="landmark combo" tool_tip="地図ã«è¡¨ç¤ºã•ã‚ŒãŸãƒ©ãƒ³ãƒ‰ãƒžãƒ¼ã‚¯"> - <combo_item name="none_selected"> - ランドマーク - </combo_item> + <combo_box.item name="none_selected" label="ランドマーク" /> </combo_box> <line_editor label="地域åã§æ¤œç´¢" name="location" tool_tip="地域åを入力ã—ã¦ãã ã•ã„。"/> <button label="検索" name="DoSearch" tool_tip="地域検索"/> diff --git a/indra/newview/skins/default/xui/ja/panel_login.xml b/indra/newview/skins/default/xui/ja/panel_login.xml index c93aeacc95b692c22cbdbc8d46e6a6299906f1da..dc57b51b0d8be314123cb49e5cc7308566e9ef6d 100644 --- a/indra/newview/skins/default/xui/ja/panel_login.xml +++ b/indra/newview/skins/default/xui/ja/panel_login.xml @@ -15,15 +15,9 @@ ãƒã‚°ã‚¤ãƒ³ä½ç½®ï¼š </text> <combo_box name="start_location_combo" left_delta="92" width="172"> - <combo_item name="MyHome"> - 自宅(ホーム) - </combo_item> - <combo_item name="MyLastLocation"> - 最後ã«ãƒã‚°ã‚¢ã‚¦ãƒˆã—ãŸå ´æ‰€ - </combo_item> - <combo_item name="Typeregionname"> - < 地域ã®åå‰å…¥åŠ› > - </combo_item> + <combo_box.item name="MyHome" label="自宅(ホーム)" /> + <combo_box.item name="MyLastLocation" label="最後ã«ãƒã‚°ã‚¢ã‚¦ãƒˆã—ãŸå ´æ‰€" /> + <combo_box.item name="Typeregionname" label="lt; 地域ã®åå‰å…¥åŠ› >" /> </combo_box> <check_box label="パスワードを記憶" name="remember_check" left_delta="180"/> <text name="full_screen_text"> @@ -43,7 +37,7 @@ [VERSION] </text> <text name="forgot_password_text" left="-230" width="220"> - åå‰ã¾ãŸã¯ãƒ‘スワードをãŠå¿˜ã‚Œã§ã™ã‹? + åå‰ã¾ãŸã¯ãƒ‘スワードをãŠå¿˜ã‚Œã§ã™ã‹ï¼Ÿ </text> <text name="forgot_password_url"> http://secondlife.com/account/request.php diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml b/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml index cc2421c9e955268471e8e5ad22029a856b6365e8..875755a8c780eb5840da56ac219fe546517d6ee8 100644 --- a/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml @@ -4,15 +4,9 @@ ãƒãƒ£ãƒƒãƒˆã®ãƒ•ã‚©ãƒ³ãƒˆï¼š </text> <radio_group name="chat_font_size"> - <radio_item length="1" name="radio" type="string"> - å° - </radio_item> - <radio_item length="1" name="radio2" type="string"> - ä¸ - </radio_item> - <radio_item length="1" name="radio3" type="string"> - 大 - </radio_item> + <radio_item length="1" name="radio" type="string" label="å°" /> + <radio_item length="1" name="radio2" type="string" label="ä¸" /> + <radio_item length="1" name="radio3" type="string" label="大" /> </radio_group> <text length="1" name="text_box2" type="string"> ãƒãƒ£ãƒƒãƒˆãƒ»ã‚«ãƒ©ãƒ¼ï¼š diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/ja/panel_preferences_graphics1.xml index 167bc2a1ce04c141f87e8bf104484ebf3480169c..b70f04645f35679c9505d9f5d8211d48c6f89123 100644 --- a/indra/newview/skins/default/xui/ja/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/ja/panel_preferences_graphics1.xml @@ -21,21 +21,11 @@ ウィンドウ・サイズ: </text> <combo_box name="windowsize combo"> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="720x480"> - 720x480 (NTSC) - </combo_item> - <combo_item name="768x576"> - 768x576 (PAL) - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> + <combo_box.item name="640x480" label="640x480" /> + <combo_box.item name="800x600" label="800x600" /> + <combo_box.item name="720x480" label="720x480 (NTSC)" /> + <combo_box.item name="768x576" label="768x576 (PAL)" /> + <combo_box.item name="1024x768" label="1024x768" /> </combo_box> <text name="DisplayResLabel"> 表示解åƒåº¦ï¼š @@ -44,18 +34,10 @@ 縦横比: </text> <combo_box name="aspect_ratio" tool_tip="(幅/高ã•ï¼‰"> - <combo_item type="string" length="1" name="4:3(StandardCRT)"> - 4:3(標準CRT) - </combo_item> - <combo_item type="string" length="1" name="5:4(1280x1024LCD)"> - 5:4(1280x1024 LCD) - </combo_item> - <combo_item name="8:5(Widescreen)"> - 8:5(ワイドスクリï¼ãƒ³ï¼‰ - </combo_item> - <combo_item type="string" length="1" name="16:9(Widescreen)"> - 16:9(ワイドスクリï¼ãƒ³ï¼‰ - </combo_item> + <combo_box.item type="string" length="1" name="4:3(StandardCRT)" label="4:3(標準CRT)" /> + <combo_box.item type="string" length="1" name="5:4(1280x1024LCD)" label="5:4(1280x1024 LCD)" /> + <combo_box.item name="8:5(Widescreen)" label="8:5(ワイドスクリï¼ãƒ³ï¼‰" /> + <combo_box.item type="string" length="1" name="16:9(Widescreen)" label="16:9(ワイドスクリï¼ãƒ³ï¼‰" /> </combo_box> <check_box label="自動検出率" name="aspect_auto_detect" /> <text type="string" length="1" name="UI Size:"> @@ -110,18 +92,10 @@ å射詳細: </text> <radio_group name="ReflectionDetailRadio"> - <radio_item name="0"> - 地形ã¨æ¨¹æœ¨ - </radio_item> - <radio_item name="1"> - ã™ã¹ã¦ã®é™çš„オブジェクト - </radio_item> - <radio_item name="2"> - ã™ã¹ã¦ã®ã‚¢ãƒã‚¿ãƒ¼ã¨ã‚ªãƒ–ジェクト - </radio_item> - <radio_item name="3"> - ã™ã¹ã¦ - </radio_item> + <radio_item name="0" label="地形ã¨æ¨¹æœ¨" /> + <radio_item name="1" label="ã™ã¹ã¦ã®é™çš„オブジェクト" /> + <radio_item name="2" label="ã™ã¹ã¦ã®ã‚¢ãƒã‚¿ãƒ¼ã¨ã‚ªãƒ–ジェクト" /> + <radio_item name="3" label="ã™ã¹ã¦" /> </radio_group> <text name="AvatarRenderingText"> ã‚¢ãƒã‚¿ãƒ¼è¡¨ç¤ºï¼š @@ -172,23 +146,15 @@ ライティング詳細: </text> <radio_group name="LightingDetailRadio"> - <radio_item name="SunMoon"> - 太陽ã¨æœˆã®ã¿ - </radio_item> - <radio_item name="LocalLights"> - 近隣ã®ãƒãƒ¼ã‚«ãƒ«ãƒ»ãƒ©ã‚¤ãƒˆ - </radio_item> + <radio_item name="SunMoon" label="太陽ã¨æœˆã®ã¿" /> + <radio_item name="LocalLights" label="近隣ã®ãƒãƒ¼ã‚«ãƒ«ãƒ»ãƒ©ã‚¤ãƒˆ" /> </radio_group> <text name="TerrainDetailText"> 地形詳細: </text> <radio_group name="TerrainDetailRadio"> - <radio_item name="0"> - 低 - </radio_item> - <radio_item name="2"> - 高 - </radio_item> + <radio_item name="0" label="低" /> + <radio_item name="2" label="高" /> </radio_group> <button label="推奨ã•ã‚ŒãŸè¨å®š" name="Defaults" /> <button label="ãƒãƒ¼ãƒ‰ã‚¦ã‚§ã‚¢ãƒ»ã‚ªãƒ—ション" diff --git a/indra/newview/skins/default/xui/nl/floater_buy_land.xml b/indra/newview/skins/default/xui/nl/floater_buy_land.xml index 69726fc2c8f8a1f75509d5c840c0c5f3575ffa02..1bb02cc7d069d4cc21e8011ead35a3406d2d0de8 100644 --- a/indra/newview/skins/default/xui/nl/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/nl/floater_buy_land.xml @@ -36,10 +36,11 @@ <text name="covenant_text"> U moet instemmen met het estate convenant: </text> + <text left="470" name="covenant_timestamp_text"/> <text_editor name="covenant_editor"> Laden... </text_editor> - <check_box label="Ik ga akkoord met het hierboven beschreven convenant." name="agree_covenant"/> + <check_box label="Ik ga akkoord met het hierboven beschreven convenant." name="agree_covenant"/> <text name="info_parcel_label"> Perceel: </text> @@ -74,15 +75,9 @@ verkocht met objecten Alleen premiumleden kunnen land bezitten. </text> <combo_box name="account_level"> - <combo_item name="US$9.95/month,billedmonthly"> - US$9.95/maand, gefactureerd per maand - </combo_item> - <combo_item name="US$7.50/month,billedquarterly"> - US$7.50/maand, gefactureerd per kwartaal - </combo_item> - <combo_item name="US$6.00/month,billedannually"> - US$6.00/maand, gefactureerd per jaar - </combo_item> + <combo_box.item name="US$9.95/month,billedmonthly" label="US$9.95/maand, gefactureerd per maand"/> + <combo_box.item name="US$7.50/month,billedquarterly" label="US$7.50/maand, gefactureerd per kwartaal"/> + <combo_box.item name="US$6.00/month,billedannually" label="US$6.00/maand, gefactureerd per jaar"/> </combo_box> <text name="land_use_action"> Verhoog uw maandelijkse landgebruikskosten tot US$ 40/maand diff --git a/indra/newview/skins/default/xui/nl/floater_customize.xml b/indra/newview/skins/default/xui/nl/floater_customize.xml index 7354c9104734dade2bf8eb0627e7fe6b17199115..a94f4f2348d663dce834c03c95fcc3929407ee85 100644 --- a/indra/newview/skins/default/xui/nl/floater_customize.xml +++ b/indra/newview/skins/default/xui/nl/floater_customize.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floater customize" title="Uiterlijk" width="504"> - <tab_container name="customize tab container" tab_min_width="106" width="502"> +<floater name="floater customize" title="Uiterlijk" width="551"> + <tab_container name="customize tab container" tab_min_width="120" width="549"> <panel label="Lichaamsdelen" name="body_parts_placeholder"/> - <panel label="Postuur" name="Shape" left="112" width="389"> + <panel label="Postuur" name="Shape" left="124" width="389"> <button label="Herstel" label_selected="Herstel" name="Revert"/> <button label="Lichaam" label_selected="Lichaam" name="Body"/> <button label="Hoofd" label_selected="Hoofd" name="Head"/> @@ -14,12 +14,8 @@ <button label="Torso" label_selected="Torso" name="Torso"/> <button label="Benen" label_selected="Benen" name="Legs"/> <radio_group name="sex radio"> - <radio_item name="radio"> - Vrouw - </radio_item> - <radio_item name="radio2"> - Man - </radio_item> + <radio_item name="radio" label="Vrouw" /> + <radio_item name="radio2" label="Man" /> </radio_group> <text name="title"> [DESC] @@ -51,10 +47,10 @@ te slepen. Ook kunt u zelf van begin af aan een nieuwe creëren en dragen. <button label="Opslaan als..." label_selected="Opslaan als..." name="Save As"/> </panel> <panel label="Huid" name="Skin"> - <button width="88" label="Huidskleur" label_selected="Huidskleur" name="Skin Color"/> - <button width="88" label="Gezichtsdetail" label_selected="Gezichtsdetail" name="Face Detail"/> - <button width="88" label="Make-up" label_selected="Make-up" name="Makeup"/> - <button width="88" label="Lichaam detail" label_selected="Lichaam detail" name="Body Detail"/> + <button width="104" label="Huidskleur" label_selected="Huidskleur" name="Skin Color"/> + <button width="104" label="Gezichtsdetail" label_selected="Gezichtsdetail" name="Face Detail"/> + <button width="104" label="Make-up" label_selected="Make-up" name="Makeup"/> + <button width="104" label="Lichaam detail" label_selected="Lichaam detail" name="Body Detail"/> <text name="title"> [DESC] </text> @@ -80,9 +76,9 @@ slepen. Ook kunt u zelf van begin af aan een nieuwe creëren en dragen. <text name="Item Action Label"> Huid: </text> - <texture_picker width="88" label="Hoofd tatoeages" name="Head Tattoos" tool_tip="Klik om een afbeelding te kiezen"/> - <texture_picker width="88" label="Bovenste tatoeage" name="Upper Tattoos" tool_tip="Klik om een afbeelding te kiezen"/> - <texture_picker width="88" label="Onderste tatoeages" name="Lower Tattoos" tool_tip="Klik om een afbeelding te kiezen"/> + <texture_picker width="104" label="Hoofd tatoeages" name="Head Tattoos" tool_tip="Klik om een afbeelding te kiezen"/> + <texture_picker width="104" label="Bovenste tatoeage" name="Upper Tattoos" tool_tip="Klik om een afbeelding te kiezen"/> + <texture_picker width="104" label="Onderste tatoeages" name="Lower Tattoos" tool_tip="Klik om een afbeelding te kiezen"/> <button label="Nieuwe huid maken" label_selected="Nieuwe huid maken" name="Create New"/> <button label="Opslaan" label_selected="Opslaan" name="Save"/> <button label="Opslaan als..." label_selected="Opslaan als..." name="Save As"/> @@ -356,7 +352,7 @@ te slepen. Ook kunt u zelf van begin af aan nieuwe creëren en dragen. </text> <texture_picker label="Stof" name="Fabric" tool_tip="Klik om een afbeelding te kiezen"/> <color_swatch label="Kleur/tint" name="Color/Tint" tool_tip="Klik om de kleurkiezer te openen"/> - <button label="Nieuwe handschoenen maken" label_selected="Nieuwe handschoenen maken" name="Create New" width="180"/> + <button label="Nieuwe handschoenen maken" label_selected="Nieuwe handschoenen maken" name="Create New" width="190"/> <button label="Uitdoen" label_selected="Uitdoen" name="Take Off"/> <button label="Opslaan" label_selected="Opslaan" name="Save"/> <button label="Opslaan als..." label_selected="Opslaan als..." name="Save As"/> @@ -466,7 +462,7 @@ slepen. Ook kunt u zelf van begin af aan een nieuwe creëren en dragen. <button label="Herstel" label_selected="Herstel" name="Revert"/> </panel> </tab_container> - <scroll_container left="207" name="panel_container"/> + <scroll_container left="254" name="panel_container"/> <button label="Annuleren" label_selected="Annuleren" name="Cancel"/> <button label="OK" label_selected="OK" name="Ok"/> <button label="Maak kleding..." label_selected="Maak kleding..." name="Make Outfit" left="110"/> diff --git a/indra/newview/skins/default/xui/nl/floater_report_abuse.xml b/indra/newview/skins/default/xui/nl/floater_report_abuse.xml index 98027a81327c5f0408a3639cdc8a30dc8f7777a6..e82a5a3b89927cec273e1a39198ed8a375eed0a4 100644 --- a/indra/newview/skins/default/xui/nl/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/nl/floater_report_abuse.xml @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="floater_report_abuse" title="Misbruik rapporteren"> <check_box label="Voeg schermafbeelding toe" name="screen_check"/> - <text name="reporter_title"> + <text name="reporter_title" width="110"> Rapporteur: </text> - <text name="reporter_field"> + <text name="reporter_field" left_delta="70"> Loremipsum Dolorsitamut </text> <text name="sim_title"> Regio: </text> - <text name="sim_field"> + <text name="sim_field" left_delta="70"> Regionaam </text> <text name="pos_title"> Positie: </text> - <text name="pos_field"> + <text name="pos_field" left_delta="70"> {128.1, 128.1, 15.4} </text> <text name="select_object_label"> @@ -26,7 +26,7 @@ <text name="object_name_label"> Naam: </text> - <text name="object_name"> + <text name="object_name" width="120"> Consetetur Sadipscing </text> <text name="owner_name_label"> @@ -36,123 +36,51 @@ Hendrerit Vulputate </text> <combo_box name="category_combo" tool_tip="Categorie -- selecteer de categorie die dit rapport het best beschrijft"> - <combo_item name="Select_category"> - Selecteer categorie - </combo_item> - <combo_item name="Age__Age_play"> - Leeftijd > Leeftijd spelen - </combo_item> - <combo_item name="Age__Adult_resident_on_Teen_Second_Life"> - Leeftijd > Volwassen inwoner in Teen Second Life - </combo_item> + <combo_box.item name="Select_category" label="Selecteer categorie"/> + <combo_box.item name="Age__Age_play" label="Leeftijd > Leeftijd spelen"/> + <combo_box.item name="Age__Adult_resident_on_Teen_Second_Life" label="Leeftijd > Volwassen inwoner in Teen Second Life"/> <combo_item name="Age__Underage_resident_outside_of_Teen_Second_Life"> Leeftijd > Minderjarige inwoner buiten Teen Second Life </combo_item> - <combo_item name="Assault__Combat_sandbox___unsafe_area"> - Aanval > Gevechtszandbak / onveilig gebied - </combo_item> - <combo_item name="Assault__Safe_area"> - Aanval > Veilig gebied - </combo_item> - <combo_item name="Assault__Weapons_testing_sandbox"> - Aanval > Zandbak voor het testen van wapens - </combo_item> - <combo_item name="Commerce__Failure_to_deliver_product_or_service"> - Handel > Product of dienst is niet geleverd - </combo_item> - <combo_item name="Disclosure__Real_world_information"> - Openbaring > Echte wereld informatie - </combo_item> - <combo_item name="Disclosure__Remotely_monitoring chat"> - Openbaring > Op afstand chat afluisteren - </combo_item> - <combo_item name="Disclosure__Second_Life_information_chat_IMs"> - Openbaring > Second Life informatie/chat/IMs - </combo_item> - <combo_item name="Disturbing_the_peace__Unfair_use_of_region_resources"> - Vredebreuk > Oneerlijk gebruik van regiomiddelen - </combo_item> - <combo_item name="Disturbing_the_peace__Excessive_scripted_objects"> - Vredebreuk > Excessieve gescripte objecten - </combo_item> - <combo_item name="Disturbing_the_peace__Object_littering"> - Vredebreuk > Objecten laten rondslingeren - </combo_item> - <combo_item name="Disturbing_the_peace__Repetitive_spam"> - Vredebreuk > Herhaalde spam - </combo_item> - <combo_item name="Disturbing_the_peace__Unwanted_advert_spam"> - Vredebreuk > Ongewenste reclame-spam - </combo_item> - <combo_item name="Fraud__L$"> - Fraude > L$ - </combo_item> - <combo_item name="Fraud__Land"> - Fraude > Land - </combo_item> - <combo_item name="Fraud__Pyramid_scheme_or_chain_letter"> - Fraude > Piramideschema of kettingbrief - </combo_item> - <combo_item name="Fraud__US$"> - Fraude > US$ - </combo_item> - <combo_item name="Harassment__Advert_farms___visual_spam"> - Intimidatie > Reclameverzamelingen / visuele spam - </combo_item> - <combo_item name="Harassment__Defaming_individuals_or_groups"> - Intimidatie > Individuen of groepen in diskrediet brengen - </combo_item> - <combo_item name="Harassment__Impeding_movement"> - Intimidatie > Beweging verhinderen - </combo_item> - <combo_item name="Harassment__Sexual_harassment"> - Intimidatie > Seksuele intimidatie - </combo_item> - <combo_item name="Harassment__Solicting_inciting_others_to_violate_ToS"> - Intimidatie > Anderen uitnodigen/aanzetten tot het schenden van de ToS - </combo_item> - <combo_item name="Harassment__Verbal_abuse"> - Intimidatie > Verbaal misbruik - </combo_item> - <combo_item name="Indecency__Broadly_offensive_content_or_conduct"> - Onfatsoenlijkheid > Globaal beledigende inhoud of gedrag - </combo_item> - <combo_item name="Indecency__Inappropriate_avatar_name"> - Onfatsoenlijkheid > Ongepaste avatar naam - </combo_item> + <combo_box.item name="Assault__Combat_sandbox___unsafe_area" label="Aanval > Gevechtszandbak / onveilig gebied"/> + <combo_box.item name="Assault__Safe_area" label="Aanval > Veilig gebied"/> + <combo_box.item name="Assault__Weapons_testing_sandbox" label="Aanval > Zandbak voor het testen van wapens"/> + <combo_box.item name="Commerce__Failure_to_deliver_product_or_service" label="Handel > Product of dienst is niet geleverd"/> + <combo_box.item name="Disclosure__Real_world_information" label="Openbaring > Echte wereld informatie"/> + <combo_box.item name="Disclosure__Remotely_monitoring chat" label="Openbaring > Op afstand chat afluisteren"/> + <combo_box.item name="Disclosure__Second_Life_information_chat_IMs" label="Openbaring > Second Life informatie/chat/IMs"/> + <combo_box.item name="Disturbing_the_peace__Unfair_use_of_region_resources" label="Vredebreuk > Oneerlijk gebruik van regiomiddelen"/> + <combo_box.item name="Disturbing_the_peace__Excessive_scripted_objects" label="Vredebreuk > Excessieve gescripte objecten"/> + <combo_box.item name="Disturbing_the_peace__Object_littering" label="Vredebreuk > Objecten laten rondslingeren"/> + <combo_box.item name="Disturbing_the_peace__Repetitive_spam" label="Vredebreuk > Herhaalde spam"/> + <combo_box.item name="Disturbing_the_peace__Unwanted_advert_spam" label="Vredebreuk > Ongewenste reclame-spam"/> + <combo_box.item name="Fraud__L$" label="Fraude > L$"/> + <combo_box.item name="Fraud__Land" label="Fraude > Land"/> + <combo_box.item name="Fraud__Pyramid_scheme_or_chain_letter" label="Fraude > Piramideschema of kettingbrief"/> + <combo_box.item name="Fraud__US$" label="Fraude > US$"/> + <combo_box.item name="Harassment__Advert_farms___visual_spam" label="Intimidatie > Reclameverzamelingen / visuele spam"/> + <combo_box.item name="Harassment__Defaming_individuals_or_groups" label="Intimidatie > Individuen of groepen in diskrediet brengen"/> + <combo_box.item name="Harassment__Impeding_movement" label="Intimidatie > Beweging verhinderen"/> + <combo_box.item name="Harassment__Sexual_harassment" label="Intimidatie > Seksuele intimidatie"/> + <combo_box.item name="Harassment__Solicting_inciting_others_to_violate_ToS" label="Intimidatie > Anderen uitnodigen/aanzetten tot het schenden van de ToS"/> + <combo_box.item name="Harassment__Verbal_abuse" label="Intimidatie > Verbaal misbruik"/> + <combo_box.item name="Indecency__Broadly_offensive_content_or_conduct" label="Onfatsoenlijkheid > Globaal beledigende inhoud of gedrag"/> + <combo_box.item name="Indecency__Inappropriate_avatar_name" label="Onfatsoenlijkheid > Ongepaste avatar naam"/> <combo_item name="Indecency__Mature_content_in_PG_region"> Onfatsoenlijkheid > Ongepaste inhoud of gedrag in een PG regio </combo_item> <combo_item name="Indecency__Inappropriate_content_in_Mature_region"> Onfatsoenlijkheid > Ongepaste inhoud of gedrag in een Mature regio </combo_item> - <combo_item name="Intellectual_property_infringement_Content_Removal"> - Inbreuk op intellectueel eigendom > Verwijderen van inhoud - </combo_item> - <combo_item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"> - Inbreuk op intellectueel eigendom > CopyBot of misbruik van permissies - </combo_item> - <combo_item name="Intolerance"> - Intolerantie - </combo_item> - <combo_item name="Land__Abuse_of_sandbox_resources"> - Land > Misbruik van zandbakmiddelen - </combo_item> - <combo_item name="Land__Encroachment__Objects_textures"> - Land > Indringing > Objecten/texturen - </combo_item> - <combo_item name="Land__Encroachment__Particles"> - Land > Indringing > Particles - </combo_item> - <combo_item name="Land__Encroachment__Trees_plants"> - Land > Indringing > Bomen/planten - </combo_item> - <combo_item name="Wagering_gambling"> - Weddenschappen/gokken - </combo_item> - <combo_item name="Other"> - Anders - </combo_item> + <combo_box.item name="Intellectual_property_infringement_Content_Removal" label="Inbreuk op intellectueel eigendom > Verwijderen van inhoud"/> + <combo_box.item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit" label="Inbreuk op intellectueel eigendom > CopyBot of misbruik van permissies"/> + <combo_box.item name="Intolerance" label="Intolerantie"/> + <combo_box.item name="Land__Abuse_of_sandbox_resources" label="Land > Misbruik van zandbakmiddelen"/> + <combo_box.item name="Land__Encroachment__Objects_textures" label="Land > Indringing > Objecten/texturen"/> + <combo_box.item name="Land__Encroachment__Particles" label="Land > Indringing > Particles"/> + <combo_box.item name="Land__Encroachment__Trees_plants" label="Land > Indringing > Bomen/planten"/> + <combo_box.item name="Wagering_gambling" label="Weddenschappen/gokken"/> + <combo_box.item name="Other" label="Anders"/> </combo_box> <text name="abuser_name_title"> Misbruikernaam: @@ -169,7 +97,9 @@ Details: </text> <text name="bug_aviso"> - Wees alstublieft zo specifiek mogelijk m.b.t. datum, locatie, aard van het misbruik, relevante chat/IM tekst, en selecteer het object indien mogelijk. + Wees alstublieft zo specifiek mogelijk m.b.t. datum, locatie, +aard van het misbruik, relevante chat/IM tekst, en selecteer +het object indien mogelijk. </text> <text name="incomplete_title"> Let op: onvolledige rapporten zullen niet worden onderzocht. diff --git a/indra/newview/skins/default/xui/nl/floater_sell_land.xml b/indra/newview/skins/default/xui/nl/floater_sell_land.xml index 0208886813348d0a8a38027b594e66176a3aa825..ed5cd501651fe0eff5fa0e81898178032cbb7b8f 100644 --- a/indra/newview/skins/default/xui/nl/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/nl/floater_sell_land.xml @@ -36,15 +36,9 @@ verkopen: Kies of u aan iedereen wil verkopen of een specifieke koper. </text> <combo_box name="sell_to"> - <combo_item name="--selectone--"> - -- selecteer een -- - </combo_item> - <combo_item name="Anyone"> - Iedereen - </combo_item> - <combo_item name="Specificuser:"> - Specifieke gebruiker: - </combo_item> + <combo_box.item name="--selectone--" label="selecteer een --"/> + <combo_box.item name="Anyone" label="Iedereen"/> + <combo_box.item name="Specificuser:" label="Specifieke gebruiker:"/> </combo_box> <button label="Selecteren..." name="sell_to_select_agent"/> <text name="sell_objects_label"> @@ -55,12 +49,8 @@ verkopen: zullen van eigenaar veranderen. </text> <radio_group name="sell_objects" bottom_delta="-58"> - <radio_item name="no"> - Nee, behoud het eigendom van objecten - </radio_item> - <radio_item name="yes"> - Ja, verkoop objecten met het land - </radio_item> + <radio_item name="no" label="Nee, behoud het eigendom van objecten" /> + <radio_item name="yes" label="Ja, verkoop objecten met het land" /> </radio_group> <button label="Toon objecten" name="show_objects"/> <text name="nag_message_label"> diff --git a/indra/newview/skins/default/xui/nl/floater_snapshot.xml b/indra/newview/skins/default/xui/nl/floater_snapshot.xml index 44447dd15328479132f8a145dc6e380f00fe48a8..c7174d42f3c908775402fd4530c669f8913f299d 100644 --- a/indra/newview/skins/default/xui/nl/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/nl/floater_snapshot.xml @@ -4,15 +4,9 @@ Fotobestemming </text> <radio_group label="Fototype" name="snapshot_type_radio"> - <radio_item name="postcard"> - Verzend via e-mail - </radio_item> - <radio_item name="texture"> - Opslaan in uw inventaris (L$[AMOUNT]) - </radio_item> - <radio_item name="local"> - Opslaan op uw harde schijf - </radio_item> + <radio_item name="postcard" label="Verzend via e-mail" /> + <radio_item name="texture" label="Opslaan in uw inventaris (L$[AMOUNT])" /> + <radio_item name="local" label="Opslaan op uw harde schijf" /> </radio_group> <text name="file_size_label"> Bestandsgrootte: [SIZE] KB @@ -21,12 +15,8 @@ <button label="Verzenden" name="send_btn"/> <button label="Opslaan (L$[AMOUNT])" name="upload_btn"/> <flyout_button label="Opslaan" name="save_btn" tool_tip="Afbeelding in een bestand opslaan"> - <flyout_button_item name="save_item"> - Opslaan - </flyout_button_item> - <flyout_button_item name="saveas_item"> - Opslaan als... - </flyout_button_item> + <flyout_button_item name="save_item" label="Opslaan"/> + <flyout_button_item name="saveas_item" label="Opslaan als..."/> </flyout_button> <button label="Annuleren" name="discard_btn"/> <button label="Meer >>" name="more_btn" tool_tip="Geavanceerde opties"/> @@ -38,98 +28,50 @@ Formaat </text> <combo_box label="Resolutie" name="postcard_size_combo"> - <combo_item name="CurrentWindow"> - Huidig venster - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="Custom"> - Aangepast - </combo_item> + <combo_box.item name="CurrentWindow" label="Huidig venster"/> + <combo_box.item name="640x480" label="640x480"/> + <combo_box.item name="800x600" label="800x600"/> + <combo_box.item name="1024x768" label="1024x768"/> + <combo_box.item name="Custom" label="Aangepast"/> </combo_box> <combo_box label="Resolutie" name="texture_size_combo"> - <combo_item name="CurrentWindow"> - Huidig venster - </combo_item> - <combo_item name="Small(128x128)"> - Klein (128x128) - </combo_item> - <combo_item name="Medium(256x256)"> - Middel (256x256) - </combo_item> - <combo_item name="Large(512x512)"> - Groot (512x512) - </combo_item> - <combo_item name="Custom"> - Aangepast - </combo_item> + <combo_box.item name="CurrentWindow" label="Huidig venster"/> + <combo_box.item name="Small(128x128)" label="Klein (128x128)"/> + <combo_box.item name="Medium(256x256)" label="Middel (256x256)"/> + <combo_box.item name="Large(512x512)" label="Groot (512x512)"/> + <combo_box.item name="Custom" label="Aangepast"/> </combo_box> <combo_box label="Resolutie" name="local_size_combo"> - <combo_item name="CurrentWindow"> - Huidig venster - </combo_item> - <combo_item name="320x240"> - 320x240 - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="1280x1024"> - 1280x1024 - </combo_item> - <combo_item name="1600x1200"> - 1600x1200 - </combo_item> - <combo_item name="Custom"> - Aangepast - </combo_item> + <combo_box.item name="CurrentWindow" label="Huidig venster"/> + <combo_box.item name="320x240" label="320x240"/> + <combo_box.item name="640x480" label="640x480"/> + <combo_box.item name="800x600" label="800x600"/> + <combo_box.item name="1024x768" label="1024x768"/> + <combo_box.item name="1280x1024" label="1280x1024"/> + <combo_box.item name="1600x1200" label="1600x1200"/> + <combo_box.item name="Custom" label="Aangepast"/> </combo_box> <combo_box label="Formaat" name="local_format_combo"> - <combo_item name="PNG"> - PNG - </combo_item> - <combo_item name="JPEG"> - JPEG - </combo_item> - <combo_item name="BMP"> - BMP - </combo_item> + <combo_box.item name="PNG" label="PNG"/> + <combo_box.item name="JPEG" label="JPEG"/> + <combo_box.item name="BMP" label="BMP"/> </combo_box> - <spinner label="Breedte" name="snapshot_width"/> - <spinner label="Hoogte" name="snapshot_height"/> + <spinner label="Breedte" name="snapshot_width" label_width="48" width="100"/> + <spinner label="Hoogte" name="snapshot_height" label_width="41" width="95" left="114"/> <check_box label="Beperk verhoudingen" name="keep_aspect_check"/> <slider label="Afbeeldingkwaliteit" name="image_quality_slider"/> - <text name="layer_type_label"> + <text name="layer_type_label" width="100"> Vastleggen: </text> - <combo_box label="Afbeeldingslagen" name="layer_types"> - <combo_item name="Colors"> - Kleuren - </combo_item> - <combo_item name="Depth"> - Diepte - </combo_item> - <combo_item name="ObjectMattes"> - Object matheid - </combo_item> + <combo_box label="Afbeeldingslagen" name="layer_types" width="130" left="76"> + <combo_box.item name="Colors" label="Kleuren"/> + <combo_box.item name="Depth" label="Diepte"/> + <combo_box.item name="ObjectMattes" label="Object matheid"/> </combo_box> <check_box label="Toon interface in foto" name="ui_check"/> <check_box label="Toon HUD objecten in foto" name="hud_check"/> <check_box label="Open houden na opslaan" name="keep_open_check"/> - <check_box label="Frame bevriezen (volledig scherm voorbeeld)" name="freeze_frame_check"/> + <check_box label="Frame bevriezen" name="freeze_frame_check"/> <check_box label="Automatisch verversen" name="auto_snapshot_check"/> <string name="unknown"> onbekend diff --git a/indra/newview/skins/default/xui/nl/floater_world_map.xml b/indra/newview/skins/default/xui/nl/floater_world_map.xml index a13eba4dc7bbf7722ee1806195abd06ddad79edf..1205884062d051ac2e0e4722d3beccce3cf9eac3 100644 --- a/indra/newview/skins/default/xui/nl/floater_world_map.xml +++ b/indra/newview/skins/default/xui/nl/floater_world_map.xml @@ -29,14 +29,10 @@ <check_box label="Mature" name="event_mature_chk"/> <check_box label="Adult" name="event_adult_chk"/> <combo_box label="Online vrienden" name="friend combo" tool_tip="Vriend die op kaart getoond wordt"> - <combo_item name="none_selected"> - Online vrienden - </combo_item> + <combo_box.item name="none_selected" label="Online vrienden"/> </combo_box> <combo_box label="Landmarkeringen" name="landmark combo" tool_tip="Landmarkering die op kaart getoond wordt"> - <combo_item name="none_selected"> - Landmarkeringen - </combo_item> + <combo_box.item name="none_selected" label="Landmarkeringen"/> </combo_box> <line_editor label="Zoek op regionaam" name="location" tool_tip="Type de naam van een regio"/> <button label="Zoeken" name="DoSearch" tool_tip="Zoek naar regio"/> diff --git a/indra/newview/skins/default/xui/nl/panel_login.xml b/indra/newview/skins/default/xui/nl/panel_login.xml index fcf79982c705b45c61f27f01141e1343826277c6..5014d7761c0ebecdddfa3429f3bc6fb83d25285e 100644 --- a/indra/newview/skins/default/xui/nl/panel_login.xml +++ b/indra/newview/skins/default/xui/nl/panel_login.xml @@ -16,18 +16,12 @@ Wachtwoord: </text> <text name="start_location_text"> - Start Locatie: + Startlocatie: </text> <combo_box name="start_location_combo"> - <combo_item name="MyHome"> - Mijn Thuis - </combo_item> - <combo_item name="MyLastLocation"> - Mijn Laatste Locatie - </combo_item> - <combo_item name="Typeregionname"> - < Type regio naam > - </combo_item> + <combo_box.item name="MyHome" label="Mijn Thuis"/> + <combo_box.item name="MyLastLocation" label="Mijn Laatste Locatie"/> + <combo_box.item name="Typeregionname" label="lt; Type regio naam >"/> </combo_box> <check_box label="Onthoud wachtwoord" name="remember_check"/> <button label="Inloggen" label_selected="Inloggen" name="connect_btn"/> diff --git a/indra/newview/skins/default/xui/pl/floater_buy_land.xml b/indra/newview/skins/default/xui/pl/floater_buy_land.xml index 110360656945ed213f3dbaefd05f643980714936..ff371b38c083a77989d44b559e47314c01f12956 100755 --- a/indra/newview/skins/default/xui/pl/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/pl/floater_buy_land.xml @@ -74,15 +74,9 @@ sprzedaż z obiektami Tylko czÅ‚onkowie z kontem Premium mogÄ… mieć PosiadÅ‚osci. </text> <combo_box name="account_level"> - <combo_item name="US$9.95/month,billedmonthly"> - 9.95US$/miesiÄ…c, pÅ‚atne miesiÄ™cznie - </combo_item> - <combo_item name="US$7.50/month,billedquarterly"> - 7.50US$/miesiÄ…c, pÅ‚atne kwartalnie - </combo_item> - <combo_item name="US$6.00/month,billedannually"> - 6.00US$/miesiÄ…c, pÅ‚atne rocznie - </combo_item> + <combo_box.item name="US$9.95/month,billedmonthly" label="9.95US$/miesiÄ…c, pÅ‚atne miesiÄ™cznie" /> + <combo_box.item name="US$7.50/month,billedquarterly" label="7.50US$/miesiÄ…c, pÅ‚atne kwartalnie" /> + <combo_box.item name="US$6.00/month,billedannually" label="6.00US$/miesiÄ…c, pÅ‚atne rocznie" /> </combo_box> <text name="land_use_action"> ZwiÄ™ksz opÅ‚atÄ™ za używanie PosiadÅ‚oÅ›ci do 40US$/miesiÄ…c. diff --git a/indra/newview/skins/default/xui/pl/floater_god_tools.xml b/indra/newview/skins/default/xui/pl/floater_god_tools.xml index f46cbaa862c8df1cc0f93018060b21b48cb2f307..c978da6d65edd55dcb46788247d55405f6fe2871 100755 --- a/indra/newview/skins/default/xui/pl/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/pl/floater_god_tools.xml @@ -80,29 +80,17 @@ Cel: </text> <combo_box name="destination"> - <combo_item name="Selection"> - Selekcja - </combo_item> - <combo_item name="AgentRegion"> - Agent Regionu - </combo_item> + <combo_box.item name="Selection" label="Selekcja" /> + <combo_box.item name="AgentRegion" label="Agent Regionu" /> </combo_box> <text name="Request:"> Żądanie: </text> <combo_box name="request"> - <combo_item name="colliders<steps>"> - kolidery <kroki> - </combo_item> - <combo_item name="scripts<count>,<optionalpattern>"> - skrypty <policz>,<opcjonalnie powtórzenie> - </combo_item> - <combo_item name="objects<pattern>"> - obiekty <powtórzenia> - </combo_item> - <combo_item name="rez<asset_id>"> - rez <asset_id> - </combo_item> + <combo_box.item name="colliders<steps>" label="kolidery <kroki>" /> + <combo_box.item name="scripts<count>,<optionalpattern>" label="skrypty <policz>,<opcjonalnie powtórzenie>" /> + <combo_box.item name="objects<pattern>" label="obiekty <powtórzenia>" /> + <combo_box.item name="rez<asset_id>" label="rez <asset_id>" /> </combo_box> <text name="Parameter:"> Parameter: diff --git a/indra/newview/skins/default/xui/pl/floater_hardware_settings.xml b/indra/newview/skins/default/xui/pl/floater_hardware_settings.xml index 010537d5555d0fb3ae772be266c73c32eb1c4984..051e9b510d002be7ff7999f212f96cfaf1d162e6 100755 --- a/indra/newview/skins/default/xui/pl/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/pl/floater_hardware_settings.xml @@ -8,21 +8,11 @@ Antialiasing: </text> <combo_box label="Antialiasing" name="fsaa" width="84"> - <combo_item name="FSAADisabled"> - WyÅ‚Ä…czone - </combo_item> - <combo_item name="2x"> - 2x - </combo_item> - <combo_item name="4x"> - 4x - </combo_item> - <combo_item name="8x"> - 8x - </combo_item> - <combo_item name="16x"> - 16x - </combo_item> + <combo_box.item name="FSAADisabled" label="WyÅ‚Ä…czone" /> + <combo_box.item name="2x" label="2x" /> + <combo_box.item name="4x" label="4x" /> + <combo_box.item name="8x" label="8x" /> + <combo_box.item name="16x" label="16x" /> </combo_box> <spinner label="Gamma:" name="gamma" /> <text type="string" length="1" name="(brightness, lower is brighter)"> diff --git a/indra/newview/skins/default/xui/pl/floater_image_preview.xml b/indra/newview/skins/default/xui/pl/floater_image_preview.xml index 9772dc780818d2857be278812a1fa75ec6c5b845..27f898a66b2c109a9a093703d8e6fb1fc45f1bf3 100755 --- a/indra/newview/skins/default/xui/pl/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/pl/floater_image_preview.xml @@ -10,36 +10,16 @@ WyÅ›wietl obraz jako: </text> <combo_box label="Rodzaj Ubrania" name="clothing_type_combo"> - <combo_item name="Image"> - Obraz - </combo_item> - <combo_item name="Hair"> - WÅ‚osy - </combo_item> - <combo_item name="FemaleHead"> - Damska GÅ‚owa - </combo_item> - <combo_item name="FemaleUpperBody"> - Damska Górna Część CiaÅ‚a - </combo_item> - <combo_item name="FemaleLowerBody"> - Damska Górna Część CiaÅ‚a - </combo_item> - <combo_item name="MaleHead"> - MÄ™ska GÅ‚owa - </combo_item> - <combo_item name="MaleUpperBody"> - MÄ™ska Górna Część CiaÅ‚a - </combo_item> - <combo_item name="MaleLowerBody"> - MÄ™ska Dolna Część CiaÅ‚a - </combo_item> - <combo_item name="Skirt"> - Spódnica - </combo_item> - <combo_item name="SculptedPrim"> - Sculpt - </combo_item> + <combo_box.item name="Image" label="Obraz" /> + <combo_box.item name="Hair" label="WÅ‚osy" /> + <combo_box.item name="FemaleHead" label="Damska GÅ‚owa" /> + <combo_box.item name="FemaleUpperBody" label="Damska Górna Część CiaÅ‚a" /> + <combo_box.item name="FemaleLowerBody" label="Damska Górna Część CiaÅ‚a" /> + <combo_box.item name="MaleHead" label="MÄ™ska GÅ‚owa" /> + <combo_box.item name="MaleUpperBody" label="MÄ™ska Górna Część CiaÅ‚a" /> + <combo_box.item name="MaleLowerBody" label="MÄ™ska Dolna Część CiaÅ‚a" /> + <combo_box.item name="Skirt" label="Spódnica" /> + <combo_box.item name="SculptedPrim" label="Sculpt" /> </combo_box> <text name="bad_image_text"> Nie można wczytać obrazu. diff --git a/indra/newview/skins/default/xui/pl/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/pl/floater_inventory_item_properties.xml index f754610ee329b5670c8b8ce1867301de132162a9..c32d1eeabfb5c58d07b3c5072684e87257e37d59 100755 --- a/indra/newview/skins/default/xui/pl/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/pl/floater_inventory_item_properties.xml @@ -60,12 +60,8 @@ </text> <check_box label="Sprzedaż" name="CheckPurchase" /> <radio_group name="RadioSaleType"> - <radio_item name="radio"> - OryginaÅ‚ - </radio_item> - <radio_item name="radio2"> - Kopia - </radio_item> + <radio_item name="radio" label="OryginaÅ‚" /> + <radio_item name="radio2" label="Kopia" /> </radio_group> <text name="TextPrice"> Cena: L$ diff --git a/indra/newview/skins/default/xui/pl/floater_preview_gesture.xml b/indra/newview/skins/default/xui/pl/floater_preview_gesture.xml index 02c6e1ef8a4400114a7413235817b3c4d73b4417..1c7a3f663181c1415074d0a96916e3e71a01736c 100755 --- a/indra/newview/skins/default/xui/pl/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/pl/floater_preview_gesture.xml @@ -45,12 +45,8 @@ Wstrzymaj chyba, że dodasz pauzy. </text> <radio_group name="animation_trigger_type"> - <radio_item name="start"> - Start - </radio_item> - <radio_item name="stop"> - Stop - </radio_item> + <radio_item name="start" label="Start" /> + <radio_item name="stop" label="Stop" /> </radio_group> <check_box label="do koÅ„ca animacji" name="wait_anim_check"/> <check_box label="czas w sekundach" name="wait_time_check"/> diff --git a/indra/newview/skins/default/xui/pl/floater_report_abuse.xml b/indra/newview/skins/default/xui/pl/floater_report_abuse.xml index d4ad72a3e1f4ae94014c3709935950edfd67115b..a831c7e511cb91a1170a422b126ed2331178f0a6 100755 --- a/indra/newview/skins/default/xui/pl/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/pl/floater_report_abuse.xml @@ -37,123 +37,51 @@ Hendrerit Vulputate </text> <combo_box name="category_combo" tool_tip="Wybór kategorii - wybierz kategoriÄ™, której dotyczy raport"> - <combo_item name="Select_category"> - Wybierz KategoriÄ™: - </combo_item> - <combo_item name="Age__Age_play"> - Wiek > Udawanie Nieletniej Osoby - </combo_item> - <combo_item name="Age__Adult_resident_on_Teen_Second_Life"> - Wiek > DorosÅ‚y Rezydent w Teen Second Life - </combo_item> + <combo_box.item name="Select_category" label="Wybierz KategoriÄ™:"/> + <combo_box.item name="Age__Age_play" label="Wiek > Udawanie Nieletniej Osoby"/> + <combo_box.item name="Age__Adult_resident_on_Teen_Second_Life" label="Wiek > DorosÅ‚y Rezydent w Teen Second Life"/> <combo_item name="Age__Underage_resident_outside_of_Teen_Second_Life"> Wiek > Nieletni Rezydent poza Teen Second Life </combo_item> - <combo_item name="Assault__Combat_sandbox___unsafe_area"> - Napaść > Strefa Militarna / Niebezpieczny Obszar - </combo_item> - <combo_item name="Assault__Safe_area"> - Napaść > Bezpieczny Obszar - </combo_item> - <combo_item name="Assault__Weapons_testing_sandbox"> - Napaść > Obszar do Testowania Broni - </combo_item> - <combo_item name="Commerce__Failure_to_deliver_product_or_service"> - Handel > Niedostarczenie Produktu lub UsÅ‚ugi - </combo_item> - <combo_item name="Disclosure__Real_world_information"> - Naruszenie PrywatnoÅ›ci > Dane Osobiste - </combo_item> - <combo_item name="Disclosure__Remotely_monitoring chat"> - Ujawnienie > Monitorowanie Czatu - </combo_item> - <combo_item name="Disclosure__Second_Life_information_chat_IMs"> - Ujawnienie > Dane z Second Life / Czatu / IM - </combo_item> - <combo_item name="Disturbing_the_peace__Unfair_use_of_region_resources"> - Zakłócanie Spokoju > Nieuczciwe Używanie Zasobów Regionu - </combo_item> - <combo_item name="Disturbing_the_peace__Excessive_scripted_objects"> - Zakłócanie Spokoju > Przesadnie Skryptowane Obiekty - </combo_item> - <combo_item name="Disturbing_the_peace__Object_littering"> - Zakłócanie Spokoju > Åšmiecenie Obiektami - </combo_item> - <combo_item name="Disturbing_the_peace__Repetitive_spam"> - Zakłócanie Spokoju > CiÄ…gÅ‚y Spam - </combo_item> - <combo_item name="Disturbing_the_peace__Unwanted_advert_spam"> - Zakłócanie Spokoju > NieporzÄ…dany Spam Reklamowy - </combo_item> - <combo_item name="Fraud__L$"> - Oszustwo > L$ - </combo_item> - <combo_item name="Fraud__Land"> - Oszustwo > PosiadÅ‚oÅ›ci - </combo_item> - <combo_item name="Fraud__Pyramid_scheme_or_chain_letter"> - Oszustwo > Piramidy albo Listy ÅaÅ„cuchowe - </combo_item> - <combo_item name="Fraud__US$"> - Oszustwo > US$ - </combo_item> - <combo_item name="Harassment__Advert_farms___visual_spam"> - PrzeÅ›ladowanie > Farmy Reklamowe / Wizualny Spam - </combo_item> - <combo_item name="Harassment__Defaming_individuals_or_groups"> - PrzeÅ›ladowanie > ZniesÅ‚awianie Jedostek lub Grup - </combo_item> - <combo_item name="Harassment__Impeding_movement"> - PrzeÅ›ladowanie > Ograniczanie Ruchu - </combo_item> - <combo_item name="Harassment__Sexual_harassment"> - PrzeÅ›ladowanie > Molestowanie Seksualne - </combo_item> - <combo_item name="Harassment__Solicting_inciting_others_to_violate_ToS"> - PrzeÅ›ladowanie > Namawianie/ZachÄ™canie Innych do Åamania Warunków Umowy (ToS) - </combo_item> - <combo_item name="Harassment__Verbal_abuse"> - PrzeÅ›ladowanie > Znieważanie SÅ‚owne - </combo_item> - <combo_item name="Indecency__Broadly_offensive_content_or_conduct"> - Nieprzyzwoitość > Obraźliwa Treść lub PostÄ™powanie - </combo_item> - <combo_item name="Indecency__Inappropriate_avatar_name"> - Nieprzyzwoitość > Niestosowne ImiÄ™ Awatara - </combo_item> + <combo_box.item name="Assault__Combat_sandbox___unsafe_area" label="Napaść > Strefa Militarna / Niebezpieczny Obszar"/> + <combo_box.item name="Assault__Safe_area" label="Napaść > Bezpieczny Obszar"/> + <combo_box.item name="Assault__Weapons_testing_sandbox" label="Napaść > Obszar do Testowania Broni"/> + <combo_box.item name="Commerce__Failure_to_deliver_product_or_service" label="Handel > Niedostarczenie Produktu lub UsÅ‚ugi"/> + <combo_box.item name="Disclosure__Real_world_information" label="Naruszenie PrywatnoÅ›ci > Dane Osobiste"/> + <combo_box.item name="Disclosure__Remotely_monitoring chat" label="Ujawnienie > Monitorowanie Czatu"/> + <combo_box.item name="Disclosure__Second_Life_information_chat_IMs" label="Ujawnienie > Dane z Second Life / Czatu / IM"/> + <combo_box.item name="Disturbing_the_peace__Unfair_use_of_region_resources" label="Zakłócanie Spokoju > Nieuczciwe Używanie Zasobów Regionu"/> + <combo_box.item name="Disturbing_the_peace__Excessive_scripted_objects" label="Zakłócanie Spokoju > Przesadnie Skryptowane Obiekty"/> + <combo_box.item name="Disturbing_the_peace__Object_littering" label="Zakłócanie Spokoju > Åšmiecenie Obiektami"/> + <combo_box.item name="Disturbing_the_peace__Repetitive_spam" label="Zakłócanie Spokoju > CiÄ…gÅ‚y Spam"/> + <combo_box.item name="Disturbing_the_peace__Unwanted_advert_spam" label="Zakłócanie Spokoju > NieporzÄ…dany Spam Reklamowy"/> + <combo_box.item name="Fraud__L$" label="Oszustwo > L$"/> + <combo_box.item name="Fraud__Land" label="Oszustwo > PosiadÅ‚oÅ›ci"/> + <combo_box.item name="Fraud__Pyramid_scheme_or_chain_letter" label="Oszustwo > Piramidy albo Listy ÅaÅ„cuchowe"/> + <combo_box.item name="Fraud__US$" label="Oszustwo > US$"/> + <combo_box.item name="Harassment__Advert_farms___visual_spam" label="PrzeÅ›ladowanie > Farmy Reklamowe / Wizualny Spam"/> + <combo_box.item name="Harassment__Defaming_individuals_or_groups" label="PrzeÅ›ladowanie > ZniesÅ‚awianie Jedostek lub Grup"/> + <combo_box.item name="Harassment__Impeding_movement" label="PrzeÅ›ladowanie > Ograniczanie Ruchu"/> + <combo_box.item name="Harassment__Sexual_harassment" label="PrzeÅ›ladowanie > Molestowanie Seksualne"/> + <combo_box.item name="Harassment__Solicting_inciting_others_to_violate_ToS" label="PrzeÅ›ladowanie > Namawianie/ZachÄ™canie Innych do Åamania Warunków Umowy (ToS)"/> + <combo_box.item name="Harassment__Verbal_abuse" label="PrzeÅ›ladowanie > Znieważanie SÅ‚owne"/> + <combo_box.item name="Indecency__Broadly_offensive_content_or_conduct" label="Nieprzyzwoitość > Obraźliwa Treść lub PostÄ™powanie"/> + <combo_box.item name="Indecency__Inappropriate_avatar_name" label="Nieprzyzwoitość > Niestosowne ImiÄ™ Awatara"/> <combo_item name="Indecency__Mature_content_in_PG_region"> Nieprzyzwoitość > Obraźliwa treść i postÄ™powanie w regionie 'PG' </combo_item> <combo_item name="Indecency__Inappropriate_content_in_Mature_region"> Nieprzyzwoitość > Obraźliwa treść i postÄ™powanie w regionie 'Mature' </combo_item> - <combo_item name="Intellectual_property_infringement_Content_Removal"> - Naruszenie WÅ‚asnoÅ›ci Intelektualnej > UsuniÄ™cie TreÅ›ci - </combo_item> - <combo_item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"> - Naruszenie WÅ‚asnoÅ›ci Intelektualnej > CopyBot albo Nadużycie Przywilejów - </combo_item> - <combo_item name="Intolerance"> - Nietolerancja - </combo_item> - <combo_item name="Land__Abuse_of_sandbox_resources"> - PosiadÅ‚oÅ›ci > Nadużywanie Piaskownicy - </combo_item> - <combo_item name="Land__Encroachment__Objects_textures"> - PosiadÅ‚oÅ›ci > Naruszenie > Obiekty/Tekstury - </combo_item> - <combo_item name="Land__Encroachment__Particles"> - PosiadÅ‚oÅ›ci > Naruszenie > CzÄ…steczki - </combo_item> - <combo_item name="Land__Encroachment__Trees_plants"> - PosiadÅ‚oÅ›ci > Naruszenie > Drzewa/RoÅ›liny - </combo_item> - <combo_item name="Wagering_gambling"> - ZakÅ‚ady/Hazard - </combo_item> - <combo_item name="Other"> - Inne - </combo_item> + <combo_box.item name="Intellectual_property_infringement_Content_Removal" label="Naruszenie WÅ‚asnoÅ›ci Intelektualnej > UsuniÄ™cie TreÅ›ci"/> + <combo_box.item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit" label="Naruszenie WÅ‚asnoÅ›ci Intelektualnej > CopyBot albo Nadużycie Przywilejów"/> + <combo_box.item name="Intolerance" label="Nietolerancja"/> + <combo_box.item name="Land__Abuse_of_sandbox_resources" label="PosiadÅ‚oÅ›ci > Nadużywanie Piaskownicy"/> + <combo_box.item name="Land__Encroachment__Objects_textures" label="PosiadÅ‚oÅ›ci > Naruszenie > Obiekty/Tekstury"/> + <combo_box.item name="Land__Encroachment__Particles" label="PosiadÅ‚oÅ›ci > Naruszenie > CzÄ…steczki"/> + <combo_box.item name="Land__Encroachment__Trees_plants" label="PosiadÅ‚oÅ›ci > Naruszenie > Drzewa/RoÅ›liny"/> + <combo_box.item name="Wagering_gambling" label="ZakÅ‚ady/Hazard"/> + <combo_box.item name="Other" label="Inne"/> </combo_box> <text name="abuser_name_title"> Dane osobowe: diff --git a/indra/newview/skins/default/xui/pl/floater_sell_land.xml b/indra/newview/skins/default/xui/pl/floater_sell_land.xml index 94500d0295c4e45a36abfebb934506a49c5b24f6..70451fb5f6e9971be56a8a680f6ad23a245e7aa2 100755 --- a/indra/newview/skins/default/xui/pl/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/pl/floater_sell_land.xml @@ -34,15 +34,9 @@ Wybierz sprzedaż dla kogokolwiek albo dla wybranego kupca. </text> <combo_box name="sell_to"> - <combo_item name="--selectone--"> - -- wybierz -- - </combo_item> - <combo_item name="Anyone"> - Ktokolwiek - </combo_item> - <combo_item name="Specificuser:"> - Wybrany kupiec: - </combo_item> + <combo_box.item name="--selectone--" label="wybierz --" /> + <combo_box.item name="Anyone" label="Ktokolwiek" /> + <combo_box.item name="Specificuser:" label="Wybrany kupiec:" /> </combo_box> <button label="Wybierz..." name="sell_to_select_agent" /> <text name="sell_objects_label"> @@ -52,12 +46,8 @@ Przekazywalne obiekty wÅ‚aÅ›ciciela PosiadÅ‚oÅ›ci zmieniÄ… wÅ‚aÅ›ciciela. </text> <radio_group name="sell_objects"> - <radio_item name="no"> - Nie, zatrzymaj obiekty - </radio_item> - <radio_item name="yes"> - Tak, sprzedaj obiekty razem z PosiadÅ‚oÅ›ciÄ… - </radio_item> + <radio_item name="no" label="Nie, zatrzymaj obiekty" /> + <radio_item name="yes" label="Tak, sprzedaj obiekty razem z PosiadÅ‚oÅ›ciÄ…" /> </radio_group> <button label="Pokaż Obiekty" name="show_objects" /> <text name="nag_message_label"> diff --git a/indra/newview/skins/default/xui/pl/floater_settings_debug.xml b/indra/newview/skins/default/xui/pl/floater_settings_debug.xml index 496f8af2db548ae09ad98fc6df481af8a42e2cf4..99fa444a1bcbbdf8761647056b1c06f4623361fd 100755 --- a/indra/newview/skins/default/xui/pl/floater_settings_debug.xml +++ b/indra/newview/skins/default/xui/pl/floater_settings_debug.xml @@ -1,12 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="settings_debug" title="Ustawienia Usuwania BÅ‚Ä™dów"> <combo_box name="boolean_combo"> - <combo_item name="TRUE"> - PRAWDA - </combo_item> - <combo_item name="FALSE"> - NIEPRAWDA - </combo_item> + <combo_box.item name="TRUE" label="PRAWDA" /> + <combo_box.item name="FALSE" label="NIEPRAWDA" /> </combo_box> <color_swatch label="Kolor" name="color_swatch"/> <spinner label="x" name="val_spinner_1"/> diff --git a/indra/newview/skins/default/xui/pl/floater_snapshot.xml b/indra/newview/skins/default/xui/pl/floater_snapshot.xml index 9c011b9a646908d13e65e2bf6a8c4d9c0f6b9603..24bf88da855832b0c7952bb859a6db564dd51b34 100755 --- a/indra/newview/skins/default/xui/pl/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/pl/floater_snapshot.xml @@ -4,15 +4,9 @@ Lokacja zapisu </text> <radio_group label="Rodzaje zdjęć" name="snapshot_type_radio"> - <radio_item name="postcard"> - WyÅ›lij (email) pocztówkÄ™ - </radio_item> - <radio_item name="texture"> - ZaÅ‚aduj do szafy ([AMOUNT]L$) - </radio_item> - <radio_item name="local"> - Zapisz na dysk - </radio_item> + <radio_item name="postcard" label="WyÅ›lij (email) pocztówkÄ™" /> + <radio_item name="texture" label="ZaÅ‚aduj do szafy ([AMOUNT]L$)" /> + <radio_item name="local" label="Zapisz na dysk" /> </radio_group> <text name="file_size_label"> Rozmiar pliku: [SIZE] KB @@ -21,12 +15,12 @@ <button label="WyÅ›lij" name="send_btn"/> <button label="ZaÅ‚aduj (L$[AMOUNT])" name="upload_btn"/> <flyout_button label="Zapisz" name="save_btn" tool_tip="Zapisz zdjÄ™cie na dysk"> - <flyout_button_item name="save_item"> - Zapisz - </flyout_button_item> - <flyout_button_item name="saveas_item"> - Zapisz Jako... - </flyout_button_item> + <flyout_button.item name="save_item"> + Zapisz + </flyout_button.item> + <flyout_button.item name="saveas_item"> + Zapisz Jako... + </flyout_button.item> </flyout_button> <button label="Anuluj" name="discard_btn"/> <button label="WiÄ™cej >>" name="more_btn" tool_tip="Ustawienia Zaawansowane"/> @@ -38,75 +32,33 @@ Format </text> <combo_box label="Rozdzielczość" name="postcard_size_combo"> - <combo_item name="CurrentWindow"> - Obecne Okno - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="Custom"> - Wybierz - </combo_item> + <combo_box.item name="CurrentWindow" label="Obecne Okno" /> + <combo_box.item name="640x480" label="640x480" /> + <combo_box.item name="800x600" label="800x600" /> + <combo_box.item name="1024x768" label="1024x768" /> + <combo_box.item name="Custom" label="Wybierz" /> </combo_box> <combo_box label="Rozdzielczość" name="texture_size_combo"> - <combo_item name="CurrentWindow"> - Obecne Okno - </combo_item> - <combo_item name="Small(128x128)"> - MaÅ‚y (128x128) - </combo_item> - <combo_item name="Medium(256x256)"> - Åšredni (256x256) - </combo_item> - <combo_item name="Large(512x512)"> - Duży (512x512) - </combo_item> - <combo_item name="Custom"> - Wybierz - </combo_item> + <combo_box.item name="CurrentWindow" label="Obecne Okno" /> + <combo_box.item name="Small(128x128)" label="MaÅ‚y (128x128)" /> + <combo_box.item name="Medium(256x256)" label="Åšredni (256x256)" /> + <combo_box.item name="Large(512x512)" label="Duży (512x512)" /> + <combo_box.item name="Custom" label="Wybierz" /> </combo_box> <combo_box label="Rozdzielczość" name="local_size_combo"> - <combo_item name="CurrentWindow"> - Obecne Okno - </combo_item> - <combo_item name="320x240"> - 320x240 - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="1280x1024"> - 1280x1024 - </combo_item> - <combo_item name="1600x1200"> - 1600x1200 - </combo_item> - <combo_item name="Custom"> - Wybierz - </combo_item> + <combo_box.item name="CurrentWindow" label="Obecne Okno" /> + <combo_box.item name="320x240" label="320x240" /> + <combo_box.item name="640x480" label="640x480" /> + <combo_box.item name="800x600" label="800x600" /> + <combo_box.item name="1024x768" label="1024x768" /> + <combo_box.item name="1280x1024" label="1280x1024" /> + <combo_box.item name="1600x1200" label="1600x1200" /> + <combo_box.item name="Custom" label="Wybierz" /> </combo_box> <combo_box label="Format" name="local_format_combo"> - <combo_item name="PNG"> - PNG - </combo_item> - <combo_item name="JPEG"> - JPEG - </combo_item> - <combo_item name="BMP"> - BMP - </combo_item> + <combo_box.item name="PNG" label="PNG" /> + <combo_box.item name="JPEG" label="JPEG" /> + <combo_box.item name="BMP" label="BMP" /> </combo_box> <spinner label="Szer." name="snapshot_width"/> <spinner label="Wys." name="snapshot_height"/> @@ -116,15 +68,9 @@ Zapisz: </text> <combo_box label="Warstwy Obrazu" name="layer_types"> - <combo_item name="Colors"> - Kolory - </combo_item> - <combo_item name="Depth"> - GÅ‚Ä™bokość - </combo_item> - <combo_item name="ObjectMattes"> - Obiekty Åšlepe - </combo_item> + <combo_box.item name="Colors" label="Kolory" /> + <combo_box.item name="Depth" label="GÅ‚Ä™bokość" /> + <combo_box.item name="ObjectMattes" label="Obiekty Åšlepe" /> </combo_box> <check_box label="Pokaż interfejs na zdjÄ™ciu" name="ui_check"/> <check_box label="Pokaż obiekty HUD na zdjÄ™ciu" name="hud_check"/> diff --git a/indra/newview/skins/default/xui/pl/floater_world_map.xml b/indra/newview/skins/default/xui/pl/floater_world_map.xml index 46e6091b33e8b8b1446409aea7d39de8123eb073..c18c529c9423b983ffa8fa263e2028a863780ad4 100755 --- a/indra/newview/skins/default/xui/pl/floater_world_map.xml +++ b/indra/newview/skins/default/xui/pl/floater_world_map.xml @@ -30,14 +30,10 @@ <check_box label="'Adult'" name="event_adult_chk"/> <icon bottom="-196" name="avatar_icon"/> <combo_box label="DostÄ™pni Znajomi" name="friend combo" tool_tip="Znajomi na mapie"> - <combo_item name="none_selected"> - DostÄ™pni Znajomi - </combo_item> + <combo_box.item name="none_selected" label="DostÄ™pni Znajomi" /> </combo_box> <combo_box label="Zapisane Miejsca" name="landmark combo" tool_tip="Zapisane miejsca na mapie"> - <combo_item name="none_selected"> - Zapisane Miejsca - </combo_item> + <combo_box.item name="none_selected" label="Zapisane Miejsca" /> </combo_box> <line_editor label="Szukaj po nazwie regionu" name="location" tool_tip="Wpisz nazwÄ™ regionu"/> <button label="Szukaj" name="DoSearch" tool_tip="Wyszukiwaie regionu"/> diff --git a/indra/newview/skins/default/xui/pl/panel_login.xml b/indra/newview/skins/default/xui/pl/panel_login.xml index 08a768d44fa560609d81439edfb048b92c236de1..63659cf4295daebff56d1bc366adc2a5b401010c 100755 --- a/indra/newview/skins/default/xui/pl/panel_login.xml +++ b/indra/newview/skins/default/xui/pl/panel_login.xml @@ -18,16 +18,10 @@ <text name="start_location_text"> Miejsce Startu: </text> - <combo_box name="start_location_combo"> - <combo_item name="MyHome"> - Mój Start - </combo_item> - <combo_item name="MyLastLocation"> - Ostatnie Miejsce - </combo_item> - <combo_item name="Typeregionname"> - <Wpisz Region> - </combo_item> + <combo_box name="start_location_combo"> + <combo_box.item name="MyHome" label="Mój Start" /> + <combo_box.item name="MyLastLocation" label="Ostatnie Miejsce" /> + <combo_box.item name="Typeregionname" label="lt;Wpisz Region>" /> </combo_box> <check_box label="ZapamiÄ™taj HasÅ‚o" name="remember_check" /> <button label="PoÅ‚Ä…cz" label_selected="PoÅ‚Ä…cz" name="connect_btn" /> diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_chat.xml b/indra/newview/skins/default/xui/pl/panel_preferences_chat.xml index 5e397c2b06eb8b44a731314e19c885980b19155a..67252f6fd28ee52d155c4130376ed24d419e1b47 100755 --- a/indra/newview/skins/default/xui/pl/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_chat.xml @@ -4,15 +4,9 @@ Rozmiar Czcionki Czatu: </text> <radio_group name="chat_font_size"> - <radio_item type="string" length="1" name="radio"> - MaÅ‚a - </radio_item> - <radio_item type="string" length="1" name="radio2"> - Åšrednia - </radio_item> - <radio_item type="string" length="1" name="radio3"> - Duża - </radio_item> + <radio_item type="string" length="1" name="radio" label="MaÅ‚a" /> + <radio_item type="string" length="1" name="radio2" label="Åšrednia" /> + <radio_item type="string" length="1" name="radio3" label="Duża" /> </radio_group> <text type="string" length="1" name="text_box2"> Kolor Czatu: diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml index 302501ef33239498be79a7733e755dbd0eb73099..d59e6dbaf0466647991da673dcf080f9b734817d 100755 --- a/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml @@ -9,21 +9,11 @@ Wymiary Okna: </text> <combo_box name="windowsize combo"> - <combo_item type="string" length="1" name="640x480"> - 640x480 - </combo_item> - <combo_item type="string" length="1" name="800x600"> - 800x600 - </combo_item> - <combo_item type="string" length="1" name="720x480"> - 720x480 (NTSC) - </combo_item> - <combo_item type="string" length="1" name="768x576"> - 768x576 (PAL) - </combo_item> - <combo_item type="string" length="1" name="1024x768"> - 1024x768 - </combo_item> + <combo_box.item type="string" length="1" name="640x480" label="640x480" /> + <combo_box.item type="string" length="1" name="800x600" label="800x600" /> + <combo_box.item type="string" length="1" name="720x480" label="720x480 (NTSC)" /> + <combo_box.item type="string" length="1" name="768x576" label="768x576 (PAL)" /> + <combo_box.item type="string" length="1" name="1024x768" label="1024x768" /> </combo_box> <text type="string" length="1" name="DisplayResLabel"> Rozdzielczość: @@ -32,18 +22,10 @@ Proporcje: </text> <combo_box name="aspect_ratio" tool_tip="width / height"> - <combo_item type="string" length="1" name="4:3(StandardCRT)"> - 4:3 (Standardowy CRT) - </combo_item> - <combo_item type="string" length="1" name="5:4(1280x1024LCD)"> - 5:4 (1280x1024 LCD) - </combo_item> - <combo_item type="string" length="1" name="8:5(Widescreen)"> - 8:5 (Panoramiczny) - </combo_item> - <combo_item type="string" length="1" name="16:9(Widescreen)"> - 16:9 (Panoramiczny) - </combo_item> + <combo_box.item type="string" length="1" name="4:3(StandardCRT)" label="4:3 (Standardowy CRT)" /> + <combo_box.item type="string" length="1" name="5:4(1280x1024LCD)" label="5:4 (1280x1024 LCD)" /> + <combo_box.item type="string" length="1" name="8:5(Widescreen)" label="8:5 (Panoramiczny)" /> + <combo_box.item type="string" length="1" name="16:9(Widescreen)" label="16:9 (Panoramiczny)" /> </combo_box> <check_box label="Detekcja proporcji" name="aspect_auto_detect" /> <text type="string" length="1" name="HigherText"> @@ -87,18 +69,10 @@ Ustawienia Odbić: </text> <radio_group name="ReflectionDetailRadio"> - <radio_item type="string" length="1" name="0"> - Teren i Drzewa - </radio_item> - <radio_item type="string" length="1" name="1"> - Obiekty Statyczne - </radio_item> - <radio_item type="string" length="1" name="2"> - Awatary i Obiekty - </radio_item> - <radio_item type="string" length="1" name="3"> - Wszystko - </radio_item> + <radio_item type="string" length="1" name="0" label="Teren i Drzewa" /> + <radio_item type="string" length="1" name="1" label="Obiekty Statyczne" /> + <radio_item type="string" length="1" name="2" label="Awatary i Obiekty" /> + <radio_item type="string" length="1" name="3" label="Wszystko" /> </radio_group> <text type="string" length="1" name="AvatarRenderingText"> Prezentacja Awatarów: @@ -149,23 +123,15 @@ Ustawienia ÅšwiatÅ‚a: </text> <radio_group name="LightingDetailRadio"> - <radio_item type="string" length="1" name="SunMoon"> - Tylko SÅ‚oÅ„ce i Księżyc - </radio_item> - <radio_item type="string" length="1" name="LocalLights"> - Tylko Bliskie ÅšwiatÅ‚a - </radio_item> + <radio_item type="string" length="1" name="SunMoon" label="Tylko SÅ‚oÅ„ce i Księżyc" /> + <radio_item type="string" length="1" name="LocalLights" label="Tylko Bliskie ÅšwiatÅ‚a" /> </radio_group> <text type="string" length="1" name="TerrainDetailText"> Szczgóły Terenu: </text> <radio_group name="TerrainDetailRadio"> - <radio_item type="string" length="1" name="0"> - MaÅ‚o - </radio_item> - <radio_item type="string" length="1" name="2"> - Dużo - </radio_item> + <radio_item type="string" length="1" name="0" label="MaÅ‚o" /> + <radio_item type="string" length="1" name="2" label="Dużo" /> </radio_group> <button label="Ustawienia DomyÅ›lne" name="Defaults" /> <button label="Ustawnia SprzÄ™towe" label_selected="Ustawienia SprzÄ™towe" diff --git a/indra/newview/skins/default/xui/pt/floater_animation_preview.xml b/indra/newview/skins/default/xui/pt/floater_animation_preview.xml index f258e23bc4b87db8d0d9bf02042a65e08ce0b6d8..f3297ea5ee8bb2950c2049ddd5923f1de0a2d506 100644 --- a/indra/newview/skins/default/xui/pt/floater_animation_preview.xml +++ b/indra/newview/skins/default/xui/pt/floater_animation_preview.xml @@ -6,142 +6,71 @@ <text name="description_label"> Descrição: </text> - <spinner label="Prioridade" name="priority" tool_tip="Controla quais animações podem se sobrepor a esta animação."/> + <spinner label_width="72" width="110" label="Prioridade" name="priority" tool_tip="Controla quais animações podem se sobrepor a esta animação."/> <check_box label="Loop" name="loop_check" tool_tip="Executa a animação repetidamente."/> - <spinner label="Dentro(%)" name="loop_in_point" tool_tip="Ajusta o ponto da animação onde a repetição começa."/> - <spinner label="Fora(%)" name="loop_out_point" tool_tip="Ajusta o ponto da animação onde a repetição termina."/> + <spinner label_width="56" left="65" width="116" label="Dentro(%)" name="loop_in_point" tool_tip="Ajusta o ponto da animação onde a repetição começa."/> + <spinner label_width="40" left="185" label="Fora(%)" name="loop_out_point" tool_tip="Ajusta o ponto da animação onde a repetição termina."/> <text name="hand_label"> Pose de Mão </text> - <combo_box label="" name="hand_pose_combo" tool_tip="Controla o que as mãos fazem durante a animação"> - <combo_item name="Spread"> - Espreguiçar - </combo_item> - <combo_item name="Relaxed"> - Relaxado - </combo_item> - <combo_item name="PointBoth"> - Apontar Ambos - </combo_item> - <combo_item name="Fist"> - Punho - </combo_item> - <combo_item name="RelaxedLeft"> - Relaxado para Esquerda - </combo_item> - <combo_item name="PointLeft"> - Apontar à Esquerda - </combo_item> - <combo_item name="FistLeft"> - Punho Esquerdo - </combo_item> - <combo_item name="RelaxedRight"> - Relaxado para Direita - </combo_item> - <combo_item name="PointRight"> - Apontar à Direita - </combo_item> - <combo_item name="FistRight"> - Punho Direito - </combo_item> - <combo_item name="SaluteRight"> - Saudar à Direita - </combo_item> - <combo_item name="Typing"> - Digitando - </combo_item> - <combo_item name="PeaceRight"> - PacÃfico à Direita - </combo_item> + <combo_box left_delta="100" width="184" name="hand_pose_combo" tool_tip="Controla o que as mãos fazem durante a animação"> + <combo_box.item name="Spread" label="Espreguiçar" /> + <combo_box.item name="Relaxed" label="Relaxado" /> + <combo_box.item name="PointBoth" label="Apontar Ambos" /> + <combo_box.item name="Fist" label="Punho" /> + <combo_box.item name="RelaxedLeft" label="Relaxado para Esquerda" /> + <combo_box.item name="PointLeft" label="Apontar à Esquerda" /> + <combo_box.item name="FistLeft" label="Punho Esquerdo" /> + <combo_box.item name="RelaxedRight" label="Relaxado para Direita" /> + <combo_box.item name="PointRight" label="Apontar à Direita" /> + <combo_box.item name="FistRight" label="Punho Direito" /> + <combo_box.item name="SaluteRight" label="Saudar à Direita" /> + <combo_box.item name="Typing" label="Digitando" /> + <combo_box.item name="PeaceRight" label="PacÃfico à Direita" /> </combo_box> <text name="emote_label"> Expressão </text> - <combo_box label="" name="emote_combo" tool_tip="Controla o que a face faz durante a animação."> - <combo_item name="[None]"> - [None] - </combo_item> - <combo_item name="Aaaaah"> - Aaaaah - </combo_item> - <combo_item name="Afraid"> - Temeroso - </combo_item> - <combo_item name="Angry"> - Raivoso - </combo_item> - <combo_item name="BigSmile"> - Sorrisão - </combo_item> - <combo_item name="Bored"> - Entediado - </combo_item> - <combo_item name="Cry"> - Chorar - </combo_item> - <combo_item name="Disdain"> - Desprezar - </combo_item> - <combo_item name="Embarrassed"> - Envergonhado - </combo_item> - <combo_item name="Frown"> - Franzir a testa - </combo_item> - <combo_item name="Kiss"> - Beijar - </combo_item> - <combo_item name="Laugh"> - Rir - </combo_item> - <combo_item name="Plllppt"> - Plllppt - </combo_item> - <combo_item name="Repulsed"> - Enojado - </combo_item> - <combo_item name="Sad"> - Triste - </combo_item> - <combo_item name="Shrug"> - Indiferença - </combo_item> - <combo_item name="Smile"> - Sorriso - </combo_item> - <combo_item name="Surprise"> - Surpreso - </combo_item> - <combo_item name="Wink"> - Piscar - </combo_item> - <combo_item name="Worry"> - Preocupado - </combo_item> + <combo_box left_delta="100" width="184" name="emote_combo" tool_tip="Controla o que a face faz durante a animação."> + <combo_box.item name="[None]" label="None]" /> + <combo_box.item name="Aaaaah" label="Aaaaah" /> + <combo_box.item name="Afraid" label="Temeroso" /> + <combo_box.item name="Angry" label="Raivoso" /> + <combo_box.item name="BigSmile" label="Sorrisão" /> + <combo_box.item name="Bored" label="Entediado" /> + <combo_box.item name="Cry" label="Chorar" /> + <combo_box.item name="Disdain" label="Desprezar" /> + <combo_box.item name="Embarrassed" label="Envergonhado" /> + <combo_box.item name="Frown" label="Franzir a testa" /> + <combo_box.item name="Kiss" label="Beijar" /> + <combo_box.item name="Laugh" label="Rir" /> + <combo_box.item name="Plllppt" label="Plllppt" /> + <combo_box.item name="Repulsed" label="Enojado" /> + <combo_box.item name="Sad" label="Triste" /> + <combo_box.item name="Shrug" label="Indiferença" /> + <combo_box.item name="Smile" label="Sorriso" /> + <combo_box.item name="Surprise" label="Surpreso" /> + <combo_box.item name="Wink" label="Piscar" /> + <combo_box.item name="Worry" label="Preocupado" /> </combo_box> - <text name="preview_label"> + <text name="preview_label" width="250"> Prever enquanto </text> - <combo_box label="" name="preview_base_anim" tool_tip="Use isto para testar o comportamento de sua animação enquanto seu avatar executa ações comuns."> - <combo_item name="Standing"> - Parado - </combo_item> - <combo_item name="Walking"> - Andando - </combo_item> - <combo_item name="Sitting"> - Sentando - </combo_item> - <combo_item name="Flying"> - Voando - </combo_item> + <combo_box left_delta="100" width="130" name="preview_base_anim" tool_tip="Use isto para testar o comportamento de sua animação enquanto seu avatar executa ações comuns."> + <combo_box.item name="Standing" label="Parado" /> + <combo_box.item name="Walking" label="Andando" /> + <combo_box.item name="Sitting" label="Sentando" /> + <combo_box.item name="Flying" label="Voando" /> </combo_box> - <spinner label="Facilitar a entrada (sec)" name="ease_in_time" tool_tip="Quantidade de tempo (em segundos) para que as animações se mesclem."/> - <spinner label="Facilitar a saÃda (sec)" name="ease_out_time" tool_tip="Quantidade de tempo (em segundos) para que a animações se mesclem."/> - <button label="" name="play_btn" tool_tip="Executa/pausa sua animação."/> + <spinner label_width="125" width="192" label="Facilitar a entrada (sec)" name="ease_in_time" tool_tip="Quantidade de tempo (em segundos) para que as animações se mesclem."/> + <spinner bottom_delta="-20" label_width="125" left="10" width="192" label="Facilitar a saÃda (sec)" name="ease_out_time" tool_tip="Quantidade de tempo (em segundos) para que a animações se mesclem."/> + <button bottom_delta="-32" name="play_btn" tool_tip="Executa/pausa sua animação."/> <button label="" name="stop_btn" tool_tip="Interrompe a execução da animação."/> <text name="bad_animation_text"> - Incapaz de ler o arquivo de animação. Nós recomendamos exportar arquivos BVH do Poser 4. + Incapaz de ler o arquivo de animação. + +Nós recomendamos exportar arquivos BVH do +Poser 4. </text> <button label="Cancelar" name="cancel_btn"/> <button label="Carregar (L$[AMOUNT])" name="ok_btn"/> diff --git a/indra/newview/skins/default/xui/pt/floater_buy_land.xml b/indra/newview/skins/default/xui/pt/floater_buy_land.xml index 25716d025732b4c6164e179fe483745f3d8432f3..2caf057283f42acd94d59981c2a972e2d6cdeaed 100644 --- a/indra/newview/skins/default/xui/pt/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/pt/floater_buy_land.xml @@ -3,25 +3,25 @@ <text name="region_name_label"> Região: </text> - <text name="region_name_text"> + <text name="region_name_text" left="560"> (desconhecido) </text> <text name="region_type_label"> Tipo: </text> - <text name="region_type_text"> + <text name="region_type_text" left="560"> (desconhecido) </text> <text name="estate_name_label"> Propriedade: </text> - <text name="estate_name_text"> + <text name="estate_name_text" left="560"> (desconhecido) </text> - <text name="estate_owner_label"> + <text name="estate_owner_label" width="105" right="565"> Dono da propriedade: </text> - <text name="estate_owner_text"> + <text name="estate_owner_text" left="560" > (desconhecido) </text> <text name="resellable_changeable_label"> @@ -36,10 +36,11 @@ <text name="covenant_text"> Você deve concordar com o Corretor da Propriedade: </text> + <text left="470" name="covenant_timestamp_text"/> <text_editor name="covenant_editor"> Carregando... </text_editor> - <check_box label="Eu concordo com as definições do Corretor feitas acima." name="agree_covenant"/> + <check_box label="Eu concordo com as definições do Corretor feitas acima." name="agree_covenant"/> <text name="info_parcel_label"> Lote: </text> @@ -66,7 +67,7 @@ vendido com os objetos <text name="error_message"> Algo ainda não está correto. </text> - <button label="Ir para a página da web" name="error_web"/> + <button label="Ir para a página da web" name="error_web" width="150" /> <text name="account_action"> Evoluir sua conta para membro Premium </text> @@ -74,15 +75,9 @@ vendido com os objetos Somente membros Premium podem possuir terra. </text> <combo_box name="account_level"> - <combo_item name="US$9.95/month,billedmonthly"> - US$9.95/mês, debitado mensalmente - </combo_item> - <combo_item name="US$7.50/month,billedquarterly"> - US$7.50/mês, debitado trimestralmente - </combo_item> - <combo_item name="US$6.00/month,billedannually"> - US$6.00/mês, debitado anualmente - </combo_item> + <combo_box.item name="US$9.95/month,billedmonthly" label="US$9.95/mês, debitado mensalmente" /> + <combo_box.item name="US$7.50/month,billedquarterly" label="US$7.50/mês, debitado trimestralmente" /> + <combo_box.item name="US$6.00/month,billedannually" label="US$6.00/mês, debitado anualmente" /> </combo_box> <text name="land_use_action"> Aumente sua taxa de locação de terra para US$ 40/mês. @@ -97,10 +92,10 @@ Este lote tem 512 m² de terra. <text name="currency_reason"> Você tem L$2,100. </text> - <text name="currency_action"> + <text name="currency_action" width="116"> Compre L$ adicionais </text> - <line_editor name="currency_amt"> + <line_editor name="currency_amt" left="190" width="65"> 1000 </line_editor> <text name="currency_est"> diff --git a/indra/newview/skins/default/xui/pt/floater_customize.xml b/indra/newview/skins/default/xui/pt/floater_customize.xml index 31f3f3d59c2f7b57b1b1bdf4502bb1fa20d0241b..7c4fa20f1b00b8b8598ef2c1936bb48d29f8ea8f 100644 --- a/indra/newview/skins/default/xui/pt/floater_customize.xml +++ b/indra/newview/skins/default/xui/pt/floater_customize.xml @@ -14,12 +14,8 @@ <button label="Tórax" label_selected="Tórax" name="Torso"/> <button label="Pernas" label_selected="Pernas" name="Legs"/> <radio_group name="sex radio"> - <radio_item length="1" name="radio" type="string"> - Feminino - </radio_item> - <radio_item length="1" name="radio2" type="string"> - Masculino - </radio_item> + <radio_item length="1" name="radio" type="string" label="Feminino" /> + <radio_item length="1" name="radio2" type="string" label="Masculino" /> </radio_group> <text length="1" name="title" type="string"> [DESC] diff --git a/indra/newview/skins/default/xui/pt/floater_god_tools.xml b/indra/newview/skins/default/xui/pt/floater_god_tools.xml index 86c6b087f876d29ca96785b9d0ef8ad265a0a609..6b88db1d9cf838490e7c205bb6831622e0afba7f 100644 --- a/indra/newview/skins/default/xui/pt/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/pt/floater_god_tools.xml @@ -73,29 +73,17 @@ Destino: </text> <combo_box name="destination"> - <combo_item name="Selection"> - Seleção - </combo_item> - <combo_item name="AgentRegion"> - Região do Agente - </combo_item> + <combo_box.item name="Selection" label="Seleção" /> + <combo_box.item name="AgentRegion" label="Região do Agente" /> </combo_box> <text name="Request:"> Requisição: </text> <combo_box name="request"> - <combo_item name="colliders<steps>"> - Passos de Colisão - </combo_item> - <combo_item name="scripts<count>,<optionalpattern>"> - Contagem de scripts, padrão opcional - </combo_item> - <combo_item name="objects<pattern>"> - Padrão de Objetos - </combo_item> - <combo_item name="rez<asset_id>"> - rez <asset_id> - </combo_item> + <combo_box.item name="colliders<steps>" label="Passos de Colisão" /> + <combo_box.item name="scripts<count>,<optionalpattern>" label="Contagem de scripts, padrão opcional" /> + <combo_box.item name="objects<pattern>" label="Padrão de Objetos" /> + <combo_box.item name="rez<asset_id>" label="rez <asset_id>" /> </combo_box> <text name="Parameter:"> Parametro: diff --git a/indra/newview/skins/default/xui/pt/floater_hardware_settings.xml b/indra/newview/skins/default/xui/pt/floater_hardware_settings.xml index 10ed0339a3d1dee0bff0cd377197c9b046a821ff..0f9c1fd4871d1118d3127893010610298a0afec3 100644 --- a/indra/newview/skins/default/xui/pt/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/pt/floater_hardware_settings.xml @@ -8,21 +8,11 @@ Suavização: </text> <combo_box label="Suavização" name="fsaa" width="94"> - <combo_item name="FSAADisabled"> - Desabilitado - </combo_item> - <combo_item name="2x"> - 2x - </combo_item> - <combo_item name="4x"> - 4x - </combo_item> - <combo_item name="8x"> - 8x - </combo_item> - <combo_item name="16x"> - 16x - </combo_item> + <combo_box.item name="FSAADisabled" label="Desabilitado"/> + <combo_box.item name="2x" label="2x"/> + <combo_box.item name="4x" label="4x"/> + <combo_box.item name="8x" label="8x"/> + <combo_box.item name="16x" label="16x"/> </combo_box> <spinner label="Gama:" name="gamma"/> <text name="(brightness, lower is brighter)"> diff --git a/indra/newview/skins/default/xui/pt/floater_image_preview.xml b/indra/newview/skins/default/xui/pt/floater_image_preview.xml index 414f9bcae399bfeb8d9ad526b031253793e680fb..a0d8c02ef0550e5c801bd693660e7795ff83d6a8 100644 --- a/indra/newview/skins/default/xui/pt/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/pt/floater_image_preview.xml @@ -7,39 +7,20 @@ Descrição: </text> <text name="preview_label"> - Prévia da Imagem como: + Prévia da +imagem como: </text> - <combo_box label="Tipo de Roupas" name="clothing_type_combo"> - <combo_item name="Image"> - Imagem - </combo_item> - <combo_item name="Hair"> - Cabelo - </combo_item> - <combo_item name="FemaleHead"> - Cabeça Feminina - </combo_item> - <combo_item name="FemaleUpperBody"> - Parte Superior do Corpo Feminino - </combo_item> - <combo_item name="FemaleLowerBody"> - Parte Inferior do Corpo Feminino - </combo_item> - <combo_item name="MaleHead"> - Cabeça Masculina - </combo_item> - <combo_item name="MaleUpperBody"> - Parte Superior do Corpo Masculino - </combo_item> - <combo_item name="MaleLowerBody"> - Parte Inferiro do Corpo Masculino - </combo_item> - <combo_item name="Skirt"> - Saia - </combo_item> - <combo_item name="SculptedPrim"> - Primitiva Esculpida - </combo_item> + <combo_box label="Tipo de Roupas" name="clothing_type_combo" left="100" width="186"> + <combo_box.item name="Image" label="Imagem" /> + <combo_box.item name="Hair" label="Cabelo" /> + <combo_box.item name="FemaleHead" label="Cabeça Feminina" /> + <combo_box.item name="FemaleUpperBody" label="Parte Superior do Corpo Feminino" /> + <combo_box.item name="FemaleLowerBody" label="Parte Inferior do Corpo Feminino" /> + <combo_box.item name="MaleHead" label="Cabeça Masculina" /> + <combo_box.item name="MaleUpperBody" label="Parte Superior do Corpo Masculino" /> + <combo_box.item name="MaleLowerBody" label="Parte Inferiro do Corpo Masculino" /> + <combo_box.item name="Skirt" label="Saia" /> + <combo_box.item name="SculptedPrim" label="Primitiva Esculpida" /> </combo_box> <text name="bad_image_text"> Incapaz de ler a imagem. diff --git a/indra/newview/skins/default/xui/pt/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/pt/floater_inventory_item_properties.xml index 3711a4c8711f9be3815f7abf86e1439cca2e1ba0..69752253b6db25f69efa23bbbc925f8c69a5fd99 100644 --- a/indra/newview/skins/default/xui/pt/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/pt/floater_inventory_item_properties.xml @@ -49,7 +49,7 @@ </text> <check_box label="Compartilhar com o grupo" name="CheckShareWithGroup"/> <check_box label="Permitir qualquer um copiar" name="CheckEveryoneCopy"/> - <text name="NextOwnerLabel"> + <text name="NextOwnerLabel" width="230"> Próximo dono pode: </text> <check_box label="Modificar" name="CheckNextOwnerModify"/> @@ -60,12 +60,8 @@ </text> <check_box label="À venda" name="CheckPurchase"/> <radio_group name="RadioSaleType"> - <radio_item name="radio"> - Original - </radio_item> - <radio_item name="radio2"> - Cópia - </radio_item> + <radio_item name="radio" label="Original" /> + <radio_item name="radio2" label="Cópia" /> </radio_group> <text name="TextPrice"> Price: L$ diff --git a/indra/newview/skins/default/xui/pt/floater_preview_gesture.xml b/indra/newview/skins/default/xui/pt/floater_preview_gesture.xml index 416d65fde422f6fc2bf4f410e826cd0fb02db927..87bf86c2827b983c58117e8294bb2c453c942e82 100644 --- a/indra/newview/skins/default/xui/pt/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/pt/floater_preview_gesture.xml @@ -22,37 +22,37 @@ <text name="key_label"> Tecla de Atalho: </text> - <combo_box label="Nenhum" name="modifier_combo"/> - <combo_box label="Nenhum" name="key_combo"/> + <combo_box label="Nenhum" name="modifier_combo" left="116" width="76"/> + <combo_box label="Nenhum" name="key_combo" width="76" left_delta="80"/> <text name="library_label"> Biblioteca: </text> <text name="steps_label"> Passos: </text> - <scroll_list name="library_list"> + <scroll_list name="library_list" width="84"> Animação Som Bate Papo Esperar </scroll_list> - <button label="Incluir" name="add_btn"/> - <button label="Mover Para Cima" name="up_btn"/> - <button label="Mover Para Baixo" name="down_btn"/> - <button label="Remover" name="delete_btn"/> + <button label="Incluir" name="add_btn" left="118" width="87"/> + <button label="Mover Para Cima" name="up_btn" width="114" left_delta="-13"/> + <button label="Mover Para Baixo" name="down_btn" width="114"/> + <button label="Remover" name="delete_btn" width="84" left_delta="13"/> + <scroll_list left="226" name="step_list" width="205" /> <text name="help_label"> - Todos os passos acontecem simultaneamente, a menos que você inclua passos de espera. + Todos os passos acontecem +simultaneamente, a menos que +você inclua passos de espera. </text> <radio_group name="animation_trigger_type"> - <radio_item name="start"> - Iniciar - </radio_item> - <radio_item name="stop"> - Parar - </radio_item> + <radio_item name="start" label="Iniciar" /> + <radio_item name="stop" label="Parar" /> </radio_group> - <check_box label="até que as animações estejam concluÃdas" name="wait_anim_check"/> - <check_box label="tempo em segundos" name="wait_time_check"/> + <check_box bottom_delta="34" label="até que as animações estejam concluÃdas" name="wait_anim_check"/> + <check_box bottom_delta="-30" label="tempo em segundos" name="wait_time_check"/> + <line_editor left_delta="130" name="wait_time_editor" /> <check_box label="Ativar" name="active_check" tool_tip="Gestos ativos podem ser gatilhados escrevendo suas frases de gatilho no chat ou através de suas teclas de atalho. Gestos normalmente ficam inativos quando existe um conflito nas teclas de atalho."/> <button label="Prévia" name="preview_btn"/> <button label="Salvar" name="save_btn"/> diff --git a/indra/newview/skins/default/xui/pt/floater_report_abuse.xml b/indra/newview/skins/default/xui/pt/floater_report_abuse.xml index 9091386681d575715100a7ebd8c70a0c2d3f4a61..79dcf7649433e28dc2fd19e19c74477c6c1e8d46 100644 --- a/indra/newview/skins/default/xui/pt/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/pt/floater_report_abuse.xml @@ -36,123 +36,51 @@ Hendrerit Vulputate </text> <combo_box name="category_combo" tool_tip="Categoria -- Selecione a categoria que melhor descreve este report"> - <combo_item name="Select_category"> - Selecionar categoria - </combo_item> - <combo_item name="Age__Age_play"> - Idade > Idade no jogo - </combo_item> - <combo_item name="Age__Adult_resident_on_Teen_Second_Life"> - Idade > Residente adulto no Second Life Jovem - </combo_item> + <combo_box.item name="Select_category" label="Selecionar categoria"/> + <combo_box.item name="Age__Age_play" label="Idade > Idade no jogo"/> + <combo_box.item name="Age__Adult_resident_on_Teen_Second_Life" label="Idade > Residente adulto no Second Life Jovem"/> <combo_item name="Age__Underage_resident_outside_of_Teen_Second_Life"> Idade > Residente menor de idade fora do Second Life Teen </combo_item> - <combo_item name="Assault__Combat_sandbox___unsafe_area"> - Assalto > Sandbox de combate / área não segura - </combo_item> - <combo_item name="Assault__Safe_area"> - Assalto > Ãrea segura - </combo_item> - <combo_item name="Assault__Weapons_testing_sandbox"> - Assalto > Testando armas em sandbox - </combo_item> - <combo_item name="Commerce__Failure_to_deliver_product_or_service"> - Comércio > Falha em enviar produto ou serviço - </combo_item> - <combo_item name="Disclosure__Real_world_information"> - Revelar > Informação do mundo real - </combo_item> - <combo_item name="Disclosure__Remotely_monitoring chat"> - Revelar > Conversa monitorada remotamente - </combo_item> - <combo_item name="Disclosure__Second_Life_information_chat_IMs"> - Revelar > Informação do Second Life/conversa/MIs - </combo_item> - <combo_item name="Disturbing_the_peace__Unfair_use_of_region_resources"> - Distúrbio da paz > Uso injusto dos recursos da região - </combo_item> - <combo_item name="Disturbing_the_peace__Excessive_scripted_objects"> - Distúrbio da paz > Objetos com excesso de scripts - </combo_item> - <combo_item name="Disturbing_the_peace__Object_littering"> - Distúrbio da paz > Objeto despejando lixo - </combo_item> - <combo_item name="Disturbing_the_peace__Repetitive_spam"> - Distúrbio da paz > Spam repetitivo - </combo_item> - <combo_item name="Disturbing_the_peace__Unwanted_advert_spam"> - Distúrbio da paz > Spam de anúncio indesejado - </combo_item> - <combo_item name="Fraud__L$"> - Fraude > L$ - </combo_item> - <combo_item name="Fraud__Land"> - Fraude > Terra - </combo_item> - <combo_item name="Fraud__Pyramid_scheme_or_chain_letter"> - Fraude > Esquema de pirâmide ou cartas encadeadas - </combo_item> - <combo_item name="Fraud__US$"> - Fraude > R$ - </combo_item> - <combo_item name="Harassment__Advert_farms___visual_spam"> - Perturbação > Fazendas de Anúncios / spam visual - </combo_item> - <combo_item name="Harassment__Defaming_individuals_or_groups"> - Perturbação > Difamação de indivÃduos ou grupos - </combo_item> - <combo_item name="Harassment__Impeding_movement"> - Perturbação > Impedindo movimentos - </combo_item> - <combo_item name="Harassment__Sexual_harassment"> - Perturbação > Perturbação sexual - </combo_item> - <combo_item name="Harassment__Solicting_inciting_others_to_violate_ToS"> - Perturbação > Solicitando/incitando outros a violarem o ToS - </combo_item> - <combo_item name="Harassment__Verbal_abuse"> - Perturbação > Abuso verbal - </combo_item> - <combo_item name="Indecency__Broadly_offensive_content_or_conduct"> - Indecência > Conteúdo ou conduta amplamente ofensivos - </combo_item> - <combo_item name="Indecency__Inappropriate_avatar_name"> - Indecência > Nome de avatar inapropriado - </combo_item> + <combo_box.item name="Assault__Combat_sandbox___unsafe_area" label="Assalto > Sandbox de combate / área não segura"/> + <combo_box.item name="Assault__Safe_area" label="Assalto > Ãrea segura"/> + <combo_box.item name="Assault__Weapons_testing_sandbox" label="Assalto > Testando armas em sandbox"/> + <combo_box.item name="Commerce__Failure_to_deliver_product_or_service" label="Comércio > Falha em enviar produto ou serviço"/> + <combo_box.item name="Disclosure__Real_world_information" label="Revelar > Informação do mundo real"/> + <combo_box.item name="Disclosure__Remotely_monitoring chat" label="Revelar > Conversa monitorada remotamente"/> + <combo_box.item name="Disclosure__Second_Life_information_chat_IMs" label="Revelar > Informação do Second Life/conversa/MIs"/> + <combo_box.item name="Disturbing_the_peace__Unfair_use_of_region_resources" label="Distúrbio da paz > Uso injusto dos recursos da região"/> + <combo_box.item name="Disturbing_the_peace__Excessive_scripted_objects" label="Distúrbio da paz > Objetos com excesso de scripts"/> + <combo_box.item name="Disturbing_the_peace__Object_littering" label="Distúrbio da paz > Objeto despejando lixo"/> + <combo_box.item name="Disturbing_the_peace__Repetitive_spam" label="Distúrbio da paz > Spam repetitivo"/> + <combo_box.item name="Disturbing_the_peace__Unwanted_advert_spam" label="Distúrbio da paz > Spam de anúncio indesejado"/> + <combo_box.item name="Fraud__L$" label="Fraude > L$"/> + <combo_box.item name="Fraud__Land" label="Fraude > Terra"/> + <combo_box.item name="Fraud__Pyramid_scheme_or_chain_letter" label="Fraude > Esquema de pirâmide ou cartas encadeadas"/> + <combo_box.item name="Fraud__US$" label="Fraude > R$"/> + <combo_box.item name="Harassment__Advert_farms___visual_spam" label="Perturbação > Fazendas de Anúncios / spam visual"/> + <combo_box.item name="Harassment__Defaming_individuals_or_groups" label="Perturbação > Difamação de indivÃduos ou grupos"/> + <combo_box.item name="Harassment__Impeding_movement" label="Perturbação > Impedindo movimentos"/> + <combo_box.item name="Harassment__Sexual_harassment" label="Perturbação > Perturbação sexual"/> + <combo_box.item name="Harassment__Solicting_inciting_others_to_violate_ToS" label="Perturbação > Solicitando/incitando outros a violarem o ToS"/> + <combo_box.item name="Harassment__Verbal_abuse" label="Perturbação > Abuso verbal"/> + <combo_box.item name="Indecency__Broadly_offensive_content_or_conduct" label="Indecência > Conteúdo ou conduta amplamente ofensivos"/> + <combo_box.item name="Indecency__Inappropriate_avatar_name" label="Indecência > Nome de avatar inapropriado"/> <combo_item name="Indecency__Mature_content_in_PG_region"> Indecência > Conduta ou conteúdo inapropriados numa região PG </combo_item> <combo_item name="Indecency__Inappropriate_content_in_Mature_region"> Indecência > Conduta ou conteúdo inapropriados numa região Mature </combo_item> - <combo_item name="Intellectual_property_infringement_Content_Removal"> - Violação de propriedade intelectual > Remoção de Conteúdo - </combo_item> - <combo_item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"> - Violação de Propriedade intelectual > Cópia Ilegal ou Aproveitar-se de Permissões - </combo_item> - <combo_item name="Intolerance"> - Intolerância - </combo_item> - <combo_item name="Land__Abuse_of_sandbox_resources"> - Terra > Abuso dos recursos da sandbox - </combo_item> - <combo_item name="Land__Encroachment__Objects_textures"> - Terra > Invasão > Objetos/texturas - </combo_item> - <combo_item name="Land__Encroachment__Particles"> - Terra > Invasão > PartÃculas - </combo_item> - <combo_item name="Land__Encroachment__Trees_plants"> - Terra > Violação > Ãrvores/plantas - </combo_item> - <combo_item name="Wagering_gambling"> - Apostas/jogos de azar - </combo_item> - <combo_item name="Other"> - Outro - </combo_item> + <combo_box.item name="Intellectual_property_infringement_Content_Removal" label="Violação de propriedade intelectual > Remoção de Conteúdo"/> + <combo_box.item name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit" label="Violação de Propriedade intelectual > Cópia Ilegal ou Aproveitar-se de Permissões"/> + <combo_box.item name="Intolerance" label="Intolerância"/> + <combo_box.item name="Land__Abuse_of_sandbox_resources" label="Terra > Abuso dos recursos da sandbox"/> + <combo_box.item name="Land__Encroachment__Objects_textures" label="Terra > Invasão > Objetos/texturas"/> + <combo_box.item name="Land__Encroachment__Particles" label="Terra > Invasão > PartÃculas"/> + <combo_box.item name="Land__Encroachment__Trees_plants" label="Terra > Violação > Ãrvores/plantas"/> + <combo_box.item name="Wagering_gambling" label="Apostas/jogos de azar"/> + <combo_box.item name="Other" label="Outro"/> </combo_box> <text name="abuser_name_title"> Nome do Denunciado: @@ -170,8 +98,8 @@ </text> <text name="bug_aviso"> Por favor, seja especÃfico(a) sobre data, localidade, -natureza do abuso, texto relevante de conversa/MI e selecione o objeto, -se possÃvel. +natureza do abuso, texto relevante de conversa/MI e +selecione o objeto, se possÃvel. </text> <text name="incomplete_title"> Nota: Relatos incompletos não serão investigados. diff --git a/indra/newview/skins/default/xui/pt/floater_sell_land.xml b/indra/newview/skins/default/xui/pt/floater_sell_land.xml index 4236d2a4658b2b0574e02baee125914eb21ea6e5..20f9972c73efd5de26d676fa161394c0bc60ec9a 100644 --- a/indra/newview/skins/default/xui/pt/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/pt/floater_sell_land.xml @@ -36,15 +36,9 @@ particular. </text> <combo_box name="sell_to" bottom_delta="-32"> - <combo_item name="--selectone--"> - -- Selecione um -- - </combo_item> - <combo_item name="Anyone"> - Qualquer um - </combo_item> - <combo_item name="Specificuser:"> - Usuário EspecÃfico: - </combo_item> + <combo_box.item name="--selectone--" label="Selecione um --" /> + <combo_box.item name="Anyone" label="Qualquer um" /> + <combo_box.item name="Specificuser:" label="Usuário EspecÃfico:" /> </combo_box> <button label="Selecione..." name="sell_to_select_agent"/> <text name="sell_objects_label"> @@ -55,12 +49,8 @@ particular. lote irão mudar de propriedade. </text> <radio_group name="sell_objects" bottom_delta="-58"> - <radio_item name="no"> - Não, manter a propriedade sobre os objetos - </radio_item> - <radio_item name="yes"> - Sim, vender objetos com a terra - </radio_item> + <radio_item name="no" label="Não, manter a propriedade sobre os objetos" /> + <radio_item name="yes" label="Sim, vender objetos com a terra" /> </radio_group> <button label="Mostrar Objetos" name="show_objects"/> <text name="nag_message_label"> diff --git a/indra/newview/skins/default/xui/pt/floater_settings_debug.xml b/indra/newview/skins/default/xui/pt/floater_settings_debug.xml index 2109c311e346d8b34e0540235daa9aaeae140748..f7b468bb22022f9d70b10a03b1f0e133f49db51e 100644 --- a/indra/newview/skins/default/xui/pt/floater_settings_debug.xml +++ b/indra/newview/skins/default/xui/pt/floater_settings_debug.xml @@ -1,12 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="settings_debug" title="Configurações de Debug"> <combo_box name="boolean_combo"> - <combo_item name="TRUE"> - VERDADEIRO - </combo_item> - <combo_item name="FALSE"> - FALSO - </combo_item> + <combo_box.item name="TRUE" label="VERDADEIRO" /> + <combo_box.item name="FALSE" label="FALSO" /> </combo_box> <color_swatch label="Cor" name="color_swatch"/> <spinner label="x" name="val_spinner_1"/> diff --git a/indra/newview/skins/default/xui/pt/floater_snapshot.xml b/indra/newview/skins/default/xui/pt/floater_snapshot.xml index f0e9d4b92cbd03424ad3a153fae7256ac53cd722..2f6efd49986e05d2d314b9a026cb54a5b5ccddef 100644 --- a/indra/newview/skins/default/xui/pt/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/pt/floater_snapshot.xml @@ -4,15 +4,9 @@ Destino da foto </text> <radio_group label="Tipo de Foto" name="snapshot_type_radio"> - <radio_item name="postcard"> - Enviar por email - </radio_item> - <radio_item name="texture"> - Salvar no seu inventário (L$[AMOUNT]) - </radio_item> - <radio_item name="local"> - Salvar no seu disco rÃgido - </radio_item> + <radio_item name="postcard" label="Enviar por email" /> + <radio_item name="texture" label="Salvar no seu inventário (L$[AMOUNT])" /> + <radio_item name="local" label="Salvar no seu disco rÃgido" /> </radio_group> <text name="file_size_label"> Tamanho do arquivo: [SIZE] KB @@ -21,12 +15,12 @@ <button label="Enviar" name="send_btn"/> <button label="Salvar (L$[AMOUNT])" name="upload_btn"/> <flyout_button label="Salvar" name="save_btn" tool_tip="Salvar imagem em um arquivo"> - <flyout_button_item name="save_item"> - Salvar - </flyout_button_item> - <flyout_button_item name="saveas_item"> - Salvar como... - </flyout_button_item> + <flyout_button.item name="save_item"> + Salvar + </flyout_button.item> + <flyout_button.item name="saveas_item"> + Salvar como... + </flyout_button.item> </flyout_button> <button label="Cancelar" name="discard_btn"/> <button label="Mais >" name="more_btn" tool_tip="Opções Avançadas"/> @@ -38,99 +32,51 @@ Formato </text> <combo_box label="Resolução" name="postcard_size_combo"> - <combo_item name="CurrentWindow"> - Janela Atual - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="Custom"> - Customizado - </combo_item> + <combo_box.item name="CurrentWindow" label="Janela Atual" /> + <combo_box.item name="640x480" label="640x480" /> + <combo_box.item name="800x600" label="800x600" /> + <combo_box.item name="1024x768" label="1024x768" /> + <combo_box.item name="Custom" label="Customizado" /> </combo_box> <combo_box label="Resolução" name="texture_size_combo"> - <combo_item name="CurrentWindow"> - Janela Atual - </combo_item> - <combo_item name="Small(128x128)"> - Pequeno (128x128) - </combo_item> - <combo_item name="Medium(256x256)"> - Médio (256x256) - </combo_item> - <combo_item name="Large(512x512)"> - Grande (512x512) - </combo_item> - <combo_item name="Custom"> - Customizado - </combo_item> + <combo_box.item name="CurrentWindow" label="Janela Atual" /> + <combo_box.item name="Small(128x128)" label="Pequeno (128x128)" /> + <combo_box.item name="Medium(256x256)" label="Médio (256x256)" /> + <combo_box.item name="Large(512x512)" label="Grande (512x512)" /> + <combo_box.item name="Custom" label="Customizado" /> </combo_box> <combo_box label="Resolução" name="local_size_combo"> - <combo_item name="CurrentWindow"> - Janela Atual - </combo_item> - <combo_item name="320x240"> - 320x240 - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="1280x1024"> - 1280x1024 - </combo_item> - <combo_item name="1600x1200"> - 1600x1200 - </combo_item> - <combo_item name="Custom"> - Customizado - </combo_item> + <combo_box.item name="CurrentWindow" label="Janela Atual" /> + <combo_box.item name="320x240" label="320x240" /> + <combo_box.item name="640x480" label="640x480" /> + <combo_box.item name="800x600" label="800x600" /> + <combo_box.item name="1024x768" label="1024x768" /> + <combo_box.item name="1280x1024" label="1280x1024" /> + <combo_box.item name="1600x1200" label="1600x1200" /> + <combo_box.item name="Custom" label="Customizado" /> </combo_box> <combo_box label="Formato" name="local_format_combo"> - <combo_item name="PNG"> - PNG - </combo_item> - <combo_item name="JPEG"> - JPEG - </combo_item> - <combo_item name="BMP"> - BMP - </combo_item> + <combo_box.item name="PNG" label="PNG" /> + <combo_box.item name="JPEG" label="JPEG" /> + <combo_box.item name="BMP" label="BMP" /> </combo_box> - <spinner label="Largura" name="snapshot_width"/> - <spinner label="Altura" name="snapshot_height"/> + <spinner label="Largura" name="snapshot_width" label_width="41" width="101"/> + <spinner label="Altura" name="snapshot_height" label_width="31" width="91" left="119"/> <check_box label="Restringir proporções" name="keep_aspect_check"/> <slider label="Qualidade da Imagem" name="image_quality_slider"/> <text name="layer_type_label"> Capturar: </text> <combo_box label="Camadas da Imagem" name="layer_types"> - <combo_item name="Colors"> - Cores - </combo_item> - <combo_item name="Depth"> - Formato - </combo_item> - <combo_item name="ObjectMattes"> - Decoração do Objeto - </combo_item> + <combo_box.item name="Colors" label="Cores" /> + <combo_box.item name="Depth" label="Formato" /> + <combo_box.item name="ObjectMattes" label="Decoração do Objeto" /> </combo_box> <check_box label="Mostrar interface na Foto" name="ui_check"/> - <check_box label="Mostrar Objetos HUD na Foto" name="hud_check"/> - <check_box label="Manter aberto após salvar" name="keep_open_check"/> - <check_box label="Quadro Congelado (prévia da tela inteira)" name="freeze_frame_check"/> - <check_box label="Auto-atualizar" name="auto_snapshot_check"/> + <check_box bottom_delta="-17" label="Mostrar Objetos HUD na Foto" name="hud_check"/> + <check_box bottom_delta="-17" label="Manter aberto após salvar" name="keep_open_check"/> + <check_box bottom_delta="-17" label="Quadro Congelado (prévia da tela inteira)" name="freeze_frame_check"/> + <check_box bottom_delta="-29" label="Auto-atualizar" name="auto_snapshot_check"/> <string name="unknown"> desconhecido </string> diff --git a/indra/newview/skins/default/xui/pt/floater_world_map.xml b/indra/newview/skins/default/xui/pt/floater_world_map.xml index 66279e82d35809257544f6a223cfcded32b8eeec..0fb868407758b6694e9edaf9bc0893acef0cc3e5 100644 --- a/indra/newview/skins/default/xui/pt/floater_world_map.xml +++ b/indra/newview/skins/default/xui/pt/floater_world_map.xml @@ -28,14 +28,10 @@ <check_box label="Mature" name="event_mature_chk"/> <check_box label="Adult" name="event_adult_chk"/> <combo_box label="Amigos Conectados" name="friend combo" tool_tip="Amigos para mostrar no Mapa"> - <combo_item name="none_selected"> - Amigos Conectados - </combo_item> + <combo_box.item name="none_selected" label="Amigos Conectados" /> </combo_box> <combo_box label="Landmarks" name="landmark combo" tool_tip="Landmark para mostrar no Mapa"> - <combo_item name="none_selected"> - Landmarks - </combo_item> + <combo_box.item name="none_selected" label="Landmarks" /> </combo_box> <line_editor label="Procurar por nome de região" name="location" tool_tip="Digite o nome de uma Região"/> <button label="Procurar" name="DoSearch" tool_tip="Procurar por região"/> diff --git a/indra/newview/skins/default/xui/pt/panel_login.xml b/indra/newview/skins/default/xui/pt/panel_login.xml index bee5dd132814110f236fa2f712f39126f7fe3995..9f9b80912d5a63e73392c282b7611414c2cc4c88 100644 --- a/indra/newview/skins/default/xui/pt/panel_login.xml +++ b/indra/newview/skins/default/xui/pt/panel_login.xml @@ -10,25 +10,19 @@ Senha: </text> <text name="start_location_text"> - Localização inicial: + Posição inicial: </text> <combo_box name="start_location_combo"> - <combo_item name="MyHome"> - Minha casa - </combo_item> - <combo_item name="MyLastLocation"> - Minha última localização - </combo_item> - <combo_item name="Typeregionname"> - < Digite o nome da região; - </combo_item> + <combo_box.item name="MyHome" label="Minha casa" /> + <combo_box.item name="MyLastLocation" label="Minha última localização" /> + <combo_box.item name="Typeregionname" label="lt; Digite o nome da região;" /> </combo_box> <check_box label="Lembrar senha" name="remember_check"/> <button label="Entrar" label_selected="Entrar" name="connect_btn"/> <text name="create_new_account_text"> Registrar-se para uma conta </text> - <text name="forgot_password_text"> + <text name="forgot_password_text" left="-240" width="230"> Esqueceu seu nome de usuário ou senha? </text> <text name="channel_text"> diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml b/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml index 8ae635bbaeb280f4ad8d37b5d27e13679256f5fc..b32e1fb3e15560a5113bffd2689e3056548cee47 100644 --- a/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml @@ -5,15 +5,9 @@ do Chat: </text> <radio_group name="chat_font_size"> - <radio_item name="radio"> - Pequeno - </radio_item> - <radio_item name="radio2"> - Médio - </radio_item> - <radio_item name="radio3"> - Grande - </radio_item> + <radio_item name="radio" label="Pequeno" /> + <radio_item name="radio2" label="Médio" /> + <radio_item name="radio3" label="Grande" /> </radio_group> <text length="1" name="text_box2" type="string"> Cor do Chat: @@ -34,7 +28,7 @@ do Chat: <text length="1" name="text_box3" type="string"> Console do Chat: </text> - <spinner label="Ocultar Chat depois" label_width="112" name="fade_chat_time" width="162"/> + <spinner label="Ocultar Chat depois" label_width="108" name="fade_chat_time" width="160"/> <text left="310" length="1" name="text_box4" type="string"> (segundos) </text> diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml index 44bfb2d18e4de65f963a2b459e7cfb86af7779d5..ec46c8b99ccbef072111e25fc16ccad27ff1b49b 100644 --- a/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml @@ -9,21 +9,11 @@ Tamanho da Janela: </text> <combo_box name="windowsize combo"> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="720x480"> - 720x480 (NTSC) - </combo_item> - <combo_item name="768x576"> - 768x576 (PAL) - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> + <combo_box.item name="640x480" label="640x480" /> + <combo_box.item name="800x600" label="800x600" /> + <combo_box.item name="720x480" label="720x480 (NTSC)" /> + <combo_box.item name="768x576" label="768x576 (PAL)" /> + <combo_box.item name="1024x768" label="1024x768" /> </combo_box> <text name="DisplayResLabel"> Resolução de Display: @@ -32,18 +22,10 @@ Relação de Aspecto: </text> <combo_box name="aspect_ratio" tool_tip="largura / altura"> - <combo_item length="1" name="4:3(StandardCRT)" type="string"> - 4:3 (CRT Padrão) - </combo_item> - <combo_item length="1" name="5:4(1280x1024LCD)" type="string"> - 5:4 (1280x1024 LCD) - </combo_item> - <combo_item name="8:5(Widescreen)"> - 8:5 (tela ampla) - </combo_item> - <combo_item length="1" name="16:9(Widescreen)" type="string"> - 16:9 (tela ampla) - </combo_item> + <combo_box.item length="1" name="4:3(StandardCRT)" type="string" label="4:3 (CRT Padrão)" /> + <combo_box.item length="1" name="5:4(1280x1024LCD)" type="string" label="5:4 (1280x1024 LCD)" /> + <combo_box.item name="8:5(Widescreen)" label="8:5 (tela ampla)" /> + <combo_box.item length="1" name="16:9(Widescreen)" type="string" label="16:9 (tela ampla)" /> </combo_box> <check_box label="Auto-detectar a relação" name="aspect_auto_detect"/> <text name="HigherText"> @@ -86,18 +68,10 @@ rápido Detalhes de Reflexão: </text> <radio_group name="ReflectionDetailRadio"> - <radio_item name="0"> - Terreno e Ãrvores - </radio_item> - <radio_item name="1"> - Todos os objetos estáticos - </radio_item> - <radio_item name="2"> - Todos os avatares e Objetos - </radio_item> - <radio_item name="3"> - Tudo - </radio_item> + <radio_item name="0" label="Terreno e Ãrvores" /> + <radio_item name="1" label="Todos os objetos estáticos" /> + <radio_item name="2" label="Todos os avatares e Objetos" /> + <radio_item name="3" label="Tudo" /> </radio_group> <text name="AvatarRenderingText"> Renderização de Avatar: @@ -111,18 +85,18 @@ rápido <text name="DrawDistanceMeterText2"> m </text> - <slider label="Distancia de desenho:" label_width="146" name="DrawDistance" width="255"/> - <slider label="Contador máx. de partÃculas:" label_width="146" name="MaxParticleCount" width="262"/> - <slider label="Qualidade de Pós-processamento:" label_width="146" name="RenderPostProcess" width="223"/> + <slider label="Distancia de desenho:" label_width="150" name="DrawDistance" width="255"/> + <slider label="Contador máx. de partÃculas:" label_width="150" name="MaxParticleCount" width="262"/> + <slider label="Qualidade de Pós-processamento:" label_width="178" name="RenderPostProcess" width="223"/> <text name="MeshDetailText"> Detalhes de Malha: </text> - <slider label="Objetos:" name="ObjectMeshDetail"/> - <slider label="Primitivas Flexiveis:" name="FlexibleMeshDetail"/> - <slider label="Ãrvores:" name="TreeMeshDetail"/> - <slider label="Avatares:" name="AvatarMeshDetail"/> - <slider label="Terreno:" name="TerrainMeshDetail"/> - <slider label="Céu:" name="SkyMeshDetail"/> + <slider label=" Objetos:" name="ObjectMeshDetail"/> + <slider label=" Primitivas Flexiveis:" name="FlexibleMeshDetail"/> + <slider label=" Ãrvores:" name="TreeMeshDetail"/> + <slider label=" Avatares:" name="AvatarMeshDetail"/> + <slider label=" Terreno:" name="TerrainMeshDetail"/> + <slider label=" Céu:" name="SkyMeshDetail"/> <text name="PostProcessText"> Baixo </text> @@ -148,25 +122,17 @@ rápido Detalhes de Iluminação: </text> <radio_group name="LightingDetailRadio"> - <radio_item name="SunMoon"> - Sol e Lua apenas - </radio_item> - <radio_item name="LocalLights"> - Luzes locais nas proximidades - </radio_item> + <radio_item name="SunMoon" label="Sol e Lua apenas" /> + <radio_item name="LocalLights" label="Luzes locais nas proximidades" /> </radio_group> <text name="TerrainDetailText"> Detalhe do Terreno: </text> <radio_group left_delta="45" name="TerrainDetailRadio" width="276"> - <radio_item name="0"> - Baixo - </radio_item> - <radio_item name="2"> - Alto - </radio_item> + <radio_item name="0" label="Baixo" /> + <radio_item name="2" label="Alto" /> </radio_group> - <button label="Configurações Recomendadas" name="Defaults"/> + <button label="Configurações Recomendadas" name="Defaults" width="190" left="110"/> <button label="Opções de Hardware" label_selected="Opções de Hardware" name="GraphicsHardwareButton"/> <string name="resolution_format"> [RES_X] x [RES_Y] diff --git a/indra/newview/skins/paths.xml b/indra/newview/skins/paths.xml index 949cc145d9c4b01f6d2043a94feb8fcc96a36ed3..3b91a904b0f2aab15956fc4051ec8062712b5c69 100644 --- a/indra/newview/skins/paths.xml +++ b/indra/newview/skins/paths.xml @@ -1,4 +1,4 @@ <paths> - <directory>xui/en-us</directory> + <directory>xui/en</directory> <directory>xui/[LANGUAGE]</directory> </paths> \ No newline at end of file diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp index fc18f10e7d5fdabb07f28eaa900be36688af2dab..42872d85fba7a6d403d54cff380bfc7ba682bb35 100644 --- a/indra/newview/tests/llagentaccess_test.cpp +++ b/indra/newview/tests/llagentaccess_test.cpp @@ -3,59 +3,73 @@ * @brief LLAgentAccess tests * * $LicenseInfo:firstyear=2001&license=viewergpl$ + * * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ #include "../test/lltut.h" #include "../llagentaccess.h" -#include "llcontrolgroupreader.h" +#include "llcontrol.h" #include "indra_constants.h" #include <iostream> -class LLControlGroupReader_Test : public LLControlGroupReader +//---------------------------------------------------------------------------- +// Implementation of enough of LLControlGroup to support the tests: + +static U32 test_preferred_maturity = SIM_ACCESS_PG; + +LLControlGroup::LLControlGroup(const std::string& name) + : LLInstanceTracker<LLControlGroup, std::string>(name) { -public: - LLControlGroupReader_Test() : test_preferred_maturity(SIM_ACCESS_PG) {} - - virtual std::string getString(const std::string& name) - { - return ""; - } - virtual std::string getText(const std::string& name) - { - return ""; - } - virtual BOOL getBOOL(const std::string& name) - { - return false; - } - virtual S32 getS32(const std::string& name) - { - return 0; - } - virtual F32 getF32(const std::string& name) - { - return 0; - } - virtual U32 getU32(const std::string& name) - { - return test_preferred_maturity; - } - - //-------------------------------------- - // Everything from here down is test code and not part of the interface - void setPreferredMaturity(U32 m) - { - test_preferred_maturity = m; - } -private: - U32 test_preferred_maturity; - -}; +} +LLControlGroup::~LLControlGroup() +{ +} + +// Implementation of just the LLControlGroup methods we requre +BOOL LLControlGroup::declareU32(const std::string& name, U32 initial_val, const std::string& comment, BOOL persist) +{ + test_preferred_maturity = initial_val; + return true; +} + +void LLControlGroup::setU32(const std::string& name, U32 val) +{ + test_preferred_maturity = val; +} + +U32 LLControlGroup::getU32(const std::string& name) +{ + return test_preferred_maturity; +} +//---------------------------------------------------------------------------- + namespace tut { struct agentaccess @@ -69,20 +83,21 @@ namespace tut template<> template<> void agentaccess_object_t::test<1>() { - LLControlGroupReader_Test cgr; + LLControlGroup cgr("test"); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); LLAgentAccess aa(cgr); - cgr.setPreferredMaturity(SIM_ACCESS_PG); + cgr.setU32("PreferredMaturity", SIM_ACCESS_PG); ensure("1 prefersPG", aa.prefersPG()); ensure("1 prefersMature", !aa.prefersMature()); ensure("1 prefersAdult", !aa.prefersAdult()); - cgr.setPreferredMaturity(SIM_ACCESS_MATURE); + cgr.setU32("PreferredMaturity", SIM_ACCESS_MATURE); ensure("2 prefersPG", !aa.prefersPG()); ensure("2 prefersMature", aa.prefersMature()); ensure("2 prefersAdult", !aa.prefersAdult()); - cgr.setPreferredMaturity(SIM_ACCESS_ADULT); + cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT); ensure("3 prefersPG", !aa.prefersPG()); ensure("3 prefersMature", aa.prefersMature()); ensure("3 prefersAdult", aa.prefersAdult()); @@ -91,7 +106,8 @@ namespace tut template<> template<> void agentaccess_object_t::test<2>() { - LLControlGroupReader_Test cgr; + LLControlGroup cgr("test"); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); LLAgentAccess aa(cgr); // make sure default is PG @@ -140,7 +156,8 @@ namespace tut template<> template<> void agentaccess_object_t::test<3>() { - LLControlGroupReader_Test cgr; + LLControlGroup cgr("test"); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); LLAgentAccess aa(cgr); ensure("starts normal", !aa.isGodlike()); @@ -163,7 +180,8 @@ namespace tut template<> template<> void agentaccess_object_t::test<4>() { - LLControlGroupReader_Test cgr; + LLControlGroup cgr("test"); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); LLAgentAccess aa(cgr); ensure("1 pg to start", aa.wantsPGOnly()); @@ -188,12 +206,12 @@ namespace tut ensure("2 mature pref pg", !aa.canAccessMature()); ensure("3 mature pref pg", !aa.canAccessAdult()); - cgr.setPreferredMaturity(SIM_ACCESS_MATURE); + cgr.setU32("PreferredMaturity", SIM_ACCESS_MATURE); ensure("1 mature", !aa.wantsPGOnly()); ensure("2 mature", aa.canAccessMature()); ensure("3 mature", !aa.canAccessAdult()); - cgr.setPreferredMaturity(SIM_ACCESS_PG); + cgr.setU32("PreferredMaturity", SIM_ACCESS_PG); ensure("1 mature pref pg", aa.wantsPGOnly()); ensure("2 mature pref pg", !aa.canAccessMature()); ensure("3 mature pref pg", !aa.canAccessAdult()); @@ -203,14 +221,14 @@ namespace tut ensure("2 adult pref pg", !aa.canAccessMature()); ensure("3 adult pref pg", !aa.canAccessAdult()); - cgr.setPreferredMaturity(SIM_ACCESS_ADULT); + cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT); ensure("1 adult", !aa.wantsPGOnly()); ensure("2 adult", aa.canAccessMature()); ensure("3 adult", aa.canAccessAdult()); // make sure that even if pref is high, if access is low we block access // this shouldn't occur in real life but we want to be safe - cgr.setPreferredMaturity(SIM_ACCESS_ADULT); + cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT); aa.setMaturity('P'); ensure("1 pref adult, actual pg", aa.wantsPGOnly()); ensure("2 pref adult, actual pg", !aa.canAccessMature()); @@ -221,7 +239,8 @@ namespace tut template<> template<> void agentaccess_object_t::test<5>() { - LLControlGroupReader_Test cgr; + LLControlGroup cgr("test"); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); LLAgentAccess aa(cgr); ensure("1 transition starts false", !aa.isInTransition()); @@ -229,6 +248,20 @@ namespace tut ensure("2 transition now true", aa.isInTransition()); } + template<> template<> + void agentaccess_object_t::test<6>() + { + LLControlGroup cgr("test"); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); + LLAgentAccess aa(cgr); + + cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT); + aa.setMaturity('M'); + ensure("1 preferred maturity pegged to M when maturity is M", cgr.getU32("PreferredMaturity") == SIM_ACCESS_MATURE); + + aa.setMaturity('P'); + ensure("1 preferred maturity pegged to P when maturity is P", cgr.getU32("PreferredMaturity") == SIM_ACCESS_PG); + } } diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 599882500c8b97d2d2536569e1365ca8db808edf..2838ff6335495f901b7be475c49a58f7d01f6a23 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -84,6 +84,7 @@ class ViewerManifest(LLManifest): self.path("textures.xml") self.end_prefix("*/textures") self.path("*/xui/*/*.xml") + self.path("*/xui/*/widgets/*.xml") self.path("*/*.xml") # Local HTML files (e.g. loading screen) @@ -255,9 +256,9 @@ class WindowsManifest(ViewerManifest): dst="updater.exe") # For google-perftools tcmalloc allocator. - #if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""): - # self.path("libtcmalloc_minimal.dll") - # self.end_prefix() + if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""): + self.path("libtcmalloc_minimal.dll") + self.end_prefix() def nsi_file_commands(self, install=True): @@ -438,6 +439,18 @@ class DarwinManifest(ViewerManifest): self.path("German.lproj") self.path("Japanese.lproj") self.path("Korean.lproj") + self.path("da.lproj") + self.path("es.lproj") + self.path("fr.lproj") + self.path("hu.lproj") + self.path("it.lproj") + self.path("nl.lproj") + self.path("pl.lproj") + self.path("pt.lproj") + self.path("ru.lproj") + self.path("tr.lproj") + self.path("uk.lproj") + self.path("zh-Hans.lproj") # SLVoice and vivox lols self.path("vivox-runtime/universal-darwin/libalut.dylib", "libalut.dylib") @@ -655,7 +668,7 @@ class Linux_i686Manifest(LinuxManifest): self.path("app_settings/mozilla-runtime-linux-i686") if self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"): - self.path("libkdu_v42R.so", "libkdu.so") + #self.path("libkdu_v42R.so", "libkdu.so") self.path("libfmod-3.75.so") self.path("libapr-1.so.0") self.path("libaprutil-1.so.0") diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 49a0a8f36139e8265bef616492278b4d55d5d5f4..9ea8d5e5fb1adb121437d1f47591bf638a87a76f 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -36,6 +36,7 @@ set(test_SOURCE_FILES llbuffer_tut.cpp lldate_tut.cpp lldependencies_tut.cpp + lldoubledispatch_tut.cpp llerror_tut.cpp llevents_tut.cpp llhost_tut.cpp @@ -67,6 +68,7 @@ set(test_SOURCE_FILES lltimestampcache_tut.cpp lltiming_tut.cpp lltranscode_tut.cpp + lltreeiterators_tut.cpp lltut.cpp lluri_tut.cpp lluuidhashmap_tut.cpp @@ -124,7 +126,10 @@ target_link_libraries(test ${APRICONV_LIBRARIES} ${PTHREAD_LIBRARY} ${WINDOWS_LIBRARIES} + ${BOOST_PROGRAM_OPTIONS_LIBRARY} + ${BOOST_REGEX_LIBRARY} ${DL_LIBRARY} + ${GOOGLE_PERFTOOLS_LIBRARIES} ) if (WINDOWS) diff --git a/indra/test/lldoubledispatch_tut.cpp b/indra/test/lldoubledispatch_tut.cpp new file mode 100755 index 0000000000000000000000000000000000000000..63ef4d4497043629a1291632fc8a2c245849d591 --- /dev/null +++ b/indra/test/lldoubledispatch_tut.cpp @@ -0,0 +1,245 @@ +/** + * @file lldoubledispatch_tut.cpp + * @author Nat Goodspeed + * @date 2008-11-13 + * @brief Test for lldoubledispatch.h + * + * This program tests the DoubleDispatch class, using a variation on the example + * from Scott Meyers' "More Effective C++", Item 31. + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +// Precompiled header +#include "linden_common.h" +// associated header +#include "lldoubledispatch.h" +// STL headers +// std headers +#include <string> +#include <iostream> +#include <typeinfo> +// external library headers +// other Linden headers +#include "lltut.h" + + +/*---------------------------- Class hierarchy -----------------------------*/ +// All objects are GameObjects. +class GameObject +{ +public: + GameObject(const std::string& name): mName(name) {} + virtual ~GameObject() {} + virtual std::string stringize() { return std::string(typeid(*this).name()) + " " + mName; } + +protected: + std::string mName; +}; + +// SpaceStation, Asteroid and SpaceShip are peer GameObjects. +struct SpaceStation: public GameObject +{ + SpaceStation(const std::string& name): GameObject(name) {} + // Only a dummy SpaceStation is constructed without a name + SpaceStation(): GameObject("dummy") {} +}; + +struct Asteroid: public GameObject +{ + Asteroid(const std::string& name): GameObject(name) {} + Asteroid(): GameObject("dummy") {} +}; + +struct SpaceShip: public GameObject +{ + SpaceShip(const std::string& name): GameObject(name) {} + SpaceShip(): GameObject("dummy") {} +}; + +// SpaceShip is specialized further into CommercialShip and MilitaryShip. +struct CommercialShip: public SpaceShip +{ + CommercialShip(const std::string& name): SpaceShip(name) {} + CommercialShip(): SpaceShip("dummy") {} +}; + +struct MilitaryShip: public SpaceShip +{ + MilitaryShip(const std::string& name): SpaceShip(name) {} + MilitaryShip(): SpaceShip("dummy") {} +}; + +/*-------------------------- Collision functions ---------------------------*/ +// This mechanism permits us to overcome a limitation of Meyers' approach: we +// can declare the parameter types exactly as we want, rather than having to +// make them all GameObject& parameters. +std::string shipAsteroid(SpaceShip& ship, Asteroid& rock) +{ +// std::cout << rock.stringize() << " has pulverized " << ship.stringize() << std::endl; + return "shipAsteroid"; +} + +std::string militaryShipAsteroid(MilitaryShip& ship, Asteroid& rock) +{ +// std::cout << rock.stringize() << " has severely damaged " << ship.stringize() << std::endl; + return "militaryShipAsteroid"; +} + +std::string shipStation(SpaceShip& ship, SpaceStation& dock) +{ +// std::cout << ship.stringize() << " has docked at " << dock.stringize() << std::endl; + return "shipStation"; +} + +std::string asteroidStation(Asteroid& rock, SpaceStation& dock) +{ +// std::cout << rock.stringize() << " has damaged " << dock.stringize() << std::endl; + return "asteroidStation"; +} + +/*------------------------------- Test code --------------------------------*/ +namespace tut +{ + struct dispatch_data + { + dispatch_data(): + home(new SpaceStation("Terra Station")), + obstacle(new Asteroid("Ganymede")), + tug(new CommercialShip("Pilotfish")), + patrol(new MilitaryShip("Enterprise")) + {} + + // Instantiate and populate the DoubleDispatch object. + typedef LLDoubleDispatch<std::string, GameObject> DD; + DD dispatcher; + + // Instantiate a few GameObjects. Make sure we refer to them + // polymorphically, and don't let them leak. + std::auto_ptr<GameObject> home; + std::auto_ptr<GameObject> obstacle; + std::auto_ptr<GameObject> tug; + std::auto_ptr<GameObject> patrol; + + // prototype objects + Asteroid dummyAsteroid; + SpaceShip dummyShip; + MilitaryShip dummyMilitary; + CommercialShip dummyCommercial; + SpaceStation dummyStation; + }; + typedef test_group<dispatch_data> dispatch_group; + typedef dispatch_group::object dispatch_object; + tut::dispatch_group ddgr("double dispatch"); + + template<> template<> + void dispatch_object::test<1>() + { + // Describe param types using explicit DD::Type objects + // (order-sensitive add() variant) + dispatcher.add(DD::Type<SpaceShip>(), DD::Type<Asteroid>(), shipAsteroid, true); + // naive adding, won't work + dispatcher.add(DD::Type<MilitaryShip>(), DD::Type<Asteroid>(), militaryShipAsteroid, true); + dispatcher.add(DD::Type<SpaceShip>(), DD::Type<SpaceStation>(), shipStation, true); + dispatcher.add(DD::Type<Asteroid>(), DD::Type<SpaceStation>(), asteroidStation, true); + + // Try colliding them. + ensure_equals(dispatcher(*home, *tug), // reverse params, SpaceShip subclass + "shipStation"); + ensure_equals(dispatcher(*patrol, *home), // forward params, SpaceShip subclass + "shipStation"); + ensure_equals(dispatcher(*obstacle, *home), // forward params + "asteroidStation"); + ensure_equals(dispatcher(*home, *obstacle), // reverse params + "asteroidStation"); + ensure_equals(dispatcher(*tug, *obstacle), // forward params, SpaceShip subclass + "shipAsteroid"); + ensure_equals(dispatcher(*obstacle, *patrol), // reverse params, SpaceShip subclass + // won't use militaryShipAsteroid() because it was added + // in wrong order + "shipAsteroid"); + } + + template<> template<> + void dispatch_object::test<2>() + { + // Describe param types using explicit DD::Type objects + // (order-sensitive add() variant) + // adding in correct order + dispatcher.add(DD::Type<MilitaryShip>(), DD::Type<Asteroid>(), militaryShipAsteroid, true); + dispatcher.add(DD::Type<SpaceShip>(), DD::Type<Asteroid>(), shipAsteroid, true); + dispatcher.add(DD::Type<SpaceShip>(), DD::Type<SpaceStation>(), shipStation, true); + dispatcher.add(DD::Type<Asteroid>(), DD::Type<SpaceStation>(), asteroidStation, true); + + ensure_equals(dispatcher(*patrol, *obstacle), "militaryShipAsteroid"); + ensure_equals(dispatcher(*tug, *obstacle), "shipAsteroid"); + } + + template<> template<> + void dispatch_object::test<3>() + { + // Describe param types with actual prototype instances + // (order-insensitive add() variant) + dispatcher.add(dummyMilitary, dummyAsteroid, militaryShipAsteroid); + dispatcher.add(dummyShip, dummyAsteroid, shipAsteroid); + dispatcher.add(dummyShip, dummyStation, shipStation); + dispatcher.add(dummyAsteroid, dummyStation, asteroidStation); + + ensure_equals(dispatcher(*patrol, *obstacle), "militaryShipAsteroid"); + ensure_equals(dispatcher(*tug, *obstacle), "shipAsteroid"); + ensure_equals(dispatcher(*obstacle, *patrol), ""); + } + + template<> template<> + void dispatch_object::test<4>() + { + // Describe param types with actual prototype instances + // (order-insensitive add() variant) + dispatcher.add(dummyShip, dummyAsteroid, shipAsteroid); + // Even if we add the militaryShipAsteroid in the wrong order, it + // should still work. + dispatcher.add(dummyMilitary, dummyAsteroid, militaryShipAsteroid); + dispatcher.add(dummyShip, dummyStation, shipStation); + dispatcher.add(dummyAsteroid, dummyStation, asteroidStation); + + ensure_equals(dispatcher(*patrol, *obstacle), "militaryShipAsteroid"); + ensure_equals(dispatcher(*tug, *obstacle), "shipAsteroid"); + } + + template<> template<> + void dispatch_object::test<5>() + { + dispatcher.add<SpaceShip, Asteroid>(shipAsteroid); + dispatcher.add<MilitaryShip, Asteroid>(militaryShipAsteroid); + dispatcher.add<SpaceShip, SpaceStation>(shipStation); + dispatcher.add<Asteroid, SpaceStation>(asteroidStation); + + ensure_equals(dispatcher(*patrol, *obstacle), "militaryShipAsteroid"); + ensure_equals(dispatcher(*tug, *obstacle), "shipAsteroid"); + } +} // namespace tut diff --git a/indra/test/llhttpdate_tut.cpp b/indra/test/llhttpdate_tut.cpp index b764696daecdab0320e0f26e0b46a95f05d825a7..b9733dc0304b0cc2599faa4ba0ee0720c958624e 100644 --- a/indra/test/llhttpdate_tut.cpp +++ b/indra/test/llhttpdate_tut.cpp @@ -50,6 +50,7 @@ namespace tut template<> template<> void httpdate_object::test<1>() { + static std::string epoch_expected = "Thursday, 01 Jan 1970 00:00:00 GMT" ; ensure("Check Epoch in RFC 1123", ( epoch_expected == some_date.asRFC1123())); } @@ -57,6 +58,7 @@ namespace tut template<> template<> void httpdate_object::test<2>() { + static std::string expected = "Wednesday, 18 Jul 2007 22:17:24 GMT" ; some_date = LLDate(1184797044.037586); ensure("Check some timestamp in RFC 1123", ( expected == some_date.asRFC1123())); @@ -66,6 +68,7 @@ namespace tut template<> template<> void httpdate_object::test<3>() { + //F64 sometime = LLFrameTimer::getTotalSeconds(); time_t sometime; time(&sometime); diff --git a/indra/test/llpermissions_tut.cpp b/indra/test/llpermissions_tut.cpp index 9dbb9642dd91771f9c1802149894e80c4e68efe5..4eadc64b5af5340196533c595bbd491112c8001f 100644 --- a/indra/test/llpermissions_tut.cpp +++ b/indra/test/llpermissions_tut.cpp @@ -485,15 +485,8 @@ namespace tut template<> template<> void permission_object_t::test<22>() { - LLPermissions perm,perm1; - LLUUID creator("abf0d56b-82e5-47a2-a8ad-74741bb2c29e"); - LLUUID owner("68edcf47-ccd7-45b8-9f90-1649d7f12806"); - LLUUID lastOwner("5e47a0dc-97bf-44e0-8b40-de06718cee9d"); - LLUUID group("9c8eca51-53d5-42a7-bb58-cef070395db8"); - perm.init(creator,owner,lastOwner,group); - LLXMLNode* xml_node = perm.exportFileXML(); - perm1.importXML(xml_node); - ensure("exportFileXML()/importXML():failed to export and import the data ", perm1 == perm); + // Deleted LLPermissions::exportFileXML() and LLPermissions::importXML() + // because I can't find any non-test code references to it. 2009-05-04 JC } template<> template<> diff --git a/indra/test/llsaleinfo_tut.cpp b/indra/test/llsaleinfo_tut.cpp index 7f8219cdc80b447abac1a56117470234457c2ff0..fa5e047513aa5c5b44f0045c274912e8fc73d365 100644 --- a/indra/test/llsaleinfo_tut.cpp +++ b/indra/test/llsaleinfo_tut.cpp @@ -167,19 +167,8 @@ namespace tut template<> template<> void llsaleinfo_test_t::test<4>() { -// LLXMLNode is teh suck. -#if 0 - S32 sale_price = 23445; - LLSaleInfo saleinfo(LLSaleInfo::FS_CONTENTS, sale_price); - - LLXMLNode* x_node = saleinfo.exportFileXML(); - - LLSaleInfo saleinfo1(LLSaleInfo::FS_NOT, 0); - - saleinfo1.importXML(x_node); - ensure_equals("1.importXML() fn failed", saleinfo.getSalePrice(), saleinfo1.getSalePrice()); - ensure_equals("2.importXML() fn failed", saleinfo.getSaleType(), saleinfo1.getSaleType()); -#endif + // Deleted LLSaleInfo::exportFileXML() and LLSaleInfo::importXML() + // because I can't find any non-test code references to it. 2009-05-04 JC } template<> template<> diff --git a/indra/test/llscriptresource_tut.cpp b/indra/test/llscriptresource_tut.cpp index e384c275a3bf1ff4a1b4125bbd9930399285b693..705fdd16ae840bf7e43080e3699087e67ac6ff8a 100644 --- a/indra/test/llscriptresource_tut.cpp +++ b/indra/test/llscriptresource_tut.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2006-2007, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/test/lltimestampcache_tut.cpp b/indra/test/lltimestampcache_tut.cpp index 9e0de0fe60882efc5552e4f016039efc7c42f06f..3b102a336619f3bc91abe8b4f986f329b9ab5f69 100644 --- a/indra/test/lltimestampcache_tut.cpp +++ b/indra/test/lltimestampcache_tut.cpp @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2008, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -13,12 +13,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/test/lltranscode_tut.cpp b/indra/test/lltranscode_tut.cpp index 8abf9dc2245ab2f5b98c96b411703636586f6ded..eb21979db08d3380a023c434a837e38972e95e0c 100644 --- a/indra/test/lltranscode_tut.cpp +++ b/indra/test/lltranscode_tut.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2008&license=viewergpl$ * - * Copyright (c) 2006-2007, Linden Research, Inc. + * Copyright (c) 2008-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -12,12 +12,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/test/test.h b/indra/test/test.h index 16ec4effcf123b3928ce0e732a396a6a8f0a0a37..cee185140c01732cfdc633ca05e9e93ed36aba40 100644 --- a/indra/test/test.h +++ b/indra/test/test.h @@ -13,12 +13,13 @@ * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, diff --git a/indra/win_crash_logger/CMakeLists.txt b/indra/win_crash_logger/CMakeLists.txt index 27022680b861e9d8eb5e5b43742da74e3784a250..0bd59f09908e981e6e12195e17a9cdf546e096a1 100644 --- a/indra/win_crash_logger/CMakeLists.txt +++ b/indra/win_crash_logger/CMakeLists.txt @@ -72,6 +72,7 @@ target_link_libraries(windows-crash-logger ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES} ${DXGUID_LIBRARY} + ${GOOGLE_PERFTOOLS_LIBRARIES} user32 gdi32 ole32 diff --git a/install.xml b/install.xml index a0d53dbcc03dbde1e25e4d9a6ee29169b5699d12..1b3c34737c93672679ff3cb24cfe03e3289deea3 100644 --- a/install.xml +++ b/install.xml @@ -541,6 +541,25 @@ </map> </map> </map> + <key>google-perftools</key> + <map> + <key>copyright</key> + <string>Copyright (c) 2005, Google Inc.</string> + <key>description</key> + <string>Heap performance and validity checking tools from google. Includes TCMalloc, heap-checker, heap-profiler and cpu-profiler.</string> + <key>license</key> + <string>bsd</string> + <key>packages</key> + <map> + <key>windows</key> + <map> + <key>md5sum</key> + <string>32dba32ddd460a08e082898ebba6315c</string> + <key>url</key> + <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google-perftools-1.0-windows-20090406.tar.bz2</uri> + </map> + </map> + </map> <key>gstreamer</key> <map> <key>license</key>