diff options
398 files changed, 9551 insertions, 4673 deletions
@@ -17,6 +17,7 @@ build-linux-* build-darwin-* build-vc80/ build-vc100/ +build-vc120/ indra/build-vc[0-9]* indra/CMakeFiles indra/lib/mono/1.0/*.dll diff --git a/BuildParams b/BuildParams index c2fadf5943..74bd2b4923 100755 --- a/BuildParams +++ b/BuildParams @@ -11,9 +11,14 @@ Linux.symbolfiles = "newview/secondlife-symbols-linux.tar.bz2" # Use Public Upload Locations public_build = true +build_docs = true -# skip windows debug build until we can get a fix in. +# disable all Debug builds (RelWithDebInfo is sufficient) build_CYGWIN_Debug = false +build_Linux_Debug = false +build_Darwin_Debug = false +build_Debug = false + # Update Public Inworld Build Status Indicators (setting should mirror "public_build") email_status_this_is_os = true @@ -47,13 +52,24 @@ Linux.cxx_version = /usr/bin/g++-4.6 ################################################################ viewer_channel = "Second Life Test" -# Setup default packaging parameters. +################################################################ +# Special packaging parameters. +# These parameters can be used to create additional packages +# which identify themselves in a distinct way with either +# a sourceid (sent to web services) or a channel name (sent to login) +# the default sourceid should always be a null string: sourceid = "" -additional_packages = "Amazon Desura" -Amazon_sourceid = "1207v_Amazon" -Amazon_viewer_channel_suffix = "Amazon" -Desura_sourceid = "1208_desura" -Desura_viewer_channel_suffix = "Desura" +# the additional_packages variable is a blank separated list of package prefixes: +additional_packages = "" +# to set the special values for a package, create variables using each prefix: +# additional_packages = "Foo Bar" +# Foo_sourceid = "bingo" +# Foo_viewer_channel_suffix = "Foo" +# Bar_sourceid = "bongo" +# Bar_viewer_channel_suffix = "Bar" +# the viewer_channel_suffix is prefixed by a blank and then appended to the viewer_channel +# for the package in a setting that overrides the compiled-in value +################################################################ # Notifications - to configure email notices, add a setting like this: # <username>_<reponame>.email = <email-address> diff --git a/autobuild.xml b/autobuild.xml index 5bc45604b8..e74825f945 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -3,56 +3,12 @@ <map> <key>installables</key> <map> - <key>GLOD</key> - <map> - <key>license</key> - <string>GLOD</string> - <key>license_file</key> - <string>LICENSES/glod.txt</string> - <key>name</key> - <string>GLOD</string> - <key>platforms</key> - <map> - <key>darwin</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>e6071abd822c0688390382a26f8a782c</string> - <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/267984/arch/Darwin/installer/glod-1.0pre4-darwin-20121211.tar.bz2</string> - </map> - <key>name</key> - <string>darwin</string> - </map> - <key>linux</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>176736c52b3cde6ca8e7d9e173d91731</string> - <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/268002/arch/Linux/installer/glod-1.0pre4-linux-20121212.tar.bz2</string> - </map> - <key>name</key> - <string>linux</string> - </map> - <key>windows</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>842208365f5b108dac4c7c733b99da9c</string> - <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/232684/arch/CYGWIN/installer/glod-1.0pre4-windows-20110610.tar.bz2</string> - </map> - <key>name</key> - <string>windows</string> - </map> - </map> - </map> <key>SDL</key> <map> + <key>copyright</key> + <string>Copyright (C) 1997-2012 Sam Lantinga</string> + <key>description</key> + <string>Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.</string> <key>license</key> <string>lgpl</string> <key>license_file</key> @@ -66,17 +22,23 @@ <key>archive</key> <map> <key>hash</key> - <string>8da309d24fb0bad8eaaa667fb04c6dc7</string> + <string>459cdc8d7c19a8025f98f61db95622ff</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-sdl-update/rev/290561/arch/Linux/installer/SDL-1.2.15-linux-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/sdl_3p-update-sdl/rev/297546/arch/Linux/installer/SDL-1.2.15-linux-297546.tar.bz2</string> </map> <key>name</key> <string>linux</string> </map> </map> + <key>version</key> + <string>1.2.15</string> </map> <key>apr_suite</key> <map> + <key>copyright</key> + <string>Copyright © 2012 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.</string> + <key>description</key> + <string>Apache portable runtime project</string> <key>license</key> <string>apache</string> <key>license_file</key> @@ -90,9 +52,9 @@ <key>archive</key> <map> <key>hash</key> - <string>2dfcd809e747f714b3fe0bf82a175812</string> + <string>0c53148aa00e51c06fa246c4130915be</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/259951/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120618.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/apr_3p-update-apr/rev/297252/arch/Darwin/installer/apr_suite-1.4.5.297252-darwin-297252.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -102,9 +64,9 @@ <key>archive</key> <map> <key>hash</key> - <string>f38c966a430012dc157fdc104f23a59b</string> + <string>402552cf158e2fe953b7224f4615a957</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/259951/arch/Linux/installer/apr_suite-1.4.5-linux-20120618.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/apr_3p-update-apr/rev/297252/arch/Linux/installer/apr_suite-1.4.5.297252-linux-297252.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -114,17 +76,23 @@ <key>archive</key> <map> <key>hash</key> - <string>4a9d040582342699c58c886c5ccd2caf</string> + <string>8f865b509bb5011caf3dd95a22a4589d</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/259951/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120618.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/apr_3p-update-apr/rev/297252/arch/CYGWIN/installer/apr_suite-1.4.5.297252-windows-297252.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>1.4.5.297252</string> </map> <key>ares</key> <map> + <key>copyright</key> + <string>Copyright 1998 by the Massachusetts Institute of Technology.</string> + <key>description</key> + <string>C-ares, an asynchronous resolver library.</string> <key>license</key> <string>c-ares</string> <key>license_file</key> @@ -138,9 +106,9 @@ <key>archive</key> <map> <key>hash</key> - <string>127c6c37726b11a0750cd4d3b920beff</string> + <string>637b4996f703f3e5bf835d847fc4cb81</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-ares-update/rev/290399/arch/Darwin/installer/ares-1.10.0-darwin-20140529.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/ares_3p-update-ares/rev/295506/arch/Darwin/installer/ares-1.10.0.295506-darwin-295506.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -150,9 +118,9 @@ <key>archive</key> <map> <key>hash</key> - <string>92f6a454d90b5740a38fb68e369cc13e</string> + <string>7771d3653a0daf22d35bf96055d02d9a</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-ares-update/rev/290399/arch/Linux/installer/ares-1.10.0-linux-20140529.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/ares_3p-update-ares/rev/295506/arch/Linux/installer/ares-1.10.0.295506-linux-295506.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -162,19 +130,25 @@ <key>archive</key> <map> <key>hash</key> - <string>887c93c4075beefefa44b69fb2c0461e</string> + <string>f044de05e704d3f3fb6934adf42447c2</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-ares-update/rev/290399/arch/CYGWIN/installer/ares-1.10.0-windows-20140529.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/ares_3p-update-ares/rev/295506/arch/CYGWIN/installer/ares-1.10.0.295506-windows-295506.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>1.10.0.295506</string> </map> <key>boost</key> <map> + <key>copyright</key> + <string>(see individual source files)</string> + <key>description</key> + <string>Boost C++ Libraries</string> <key>license</key> - <string>boost</string> + <string>boost 1.0</string> <key>license_file</key> <string>LICENSES/boost.txt</string> <key>name</key> @@ -186,9 +160,9 @@ <key>archive</key> <map> <key>hash</key> - <string>b57789bd22dd166aade4a35ec5d36fbb</string> + <string>c296845cad075250c1ae2620f175a957</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-boost-update/rev/290566/arch/Darwin/installer/boost-1.55.0-darwin-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/boost_3p-update-boost/rev/297445/arch/Darwin/installer/boost-1.57-darwin-297445.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -198,9 +172,9 @@ <key>archive</key> <map> <key>hash</key> - <string>2f076eae296600a1b810ce375dc4b42d</string> + <string>fb1537f7ad0b490fcb4f096c15dce9cd</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-boost-update/rev/290566/arch/Linux/installer/boost-1.55.0-linux-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/boost_3p-update-boost/rev/297445/arch/Linux/installer/boost-1.57-linux-297445.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -210,19 +184,23 @@ <key>archive</key> <map> <key>hash</key> - <string>8af0500013739866a41cfc2ce90e4f4b</string> + <string>76a607d8a625062b9a63a88b62819894</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-boost-update/rev/290566/arch/CYGWIN/installer/boost-1.55.0-windows-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/boost_3p-update-boost/rev/297445/arch/CYGWIN/installer/boost-1.57-windows-297445.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>1.57</string> </map> <key>colladadom</key> <map> + <key>copyright</key> + <string>Copyright 2006 Sony Computer Entertainment Inc.</string> <key>license</key> - <string>scea</string> + <string>SCEA</string> <key>license_file</key> <string>LICENSES/collada.txt</string> <key>name</key> @@ -234,9 +212,9 @@ <key>archive</key> <map> <key>hash</key> - <string>68dc13f49a686331df6f0128c5483da3</string> + <string>66849777a83cb69cec3c06b07da7cd3d</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-colladadom-update/rev/290576/arch/Darwin/installer/colladadom-2.3-darwin-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/colladadom_3p-update-colladadom/rev/297450/arch/Darwin/installer/colladadom-2.3.297450-darwin-297450.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -246,9 +224,9 @@ <key>archive</key> <map> <key>hash</key> - <string>bdec5fe5fd008da4328f84115128ee61</string> + <string>d627c2a679f3afb8d3e090d42f53cd2e</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-colladadom-update/rev/290576/arch/Linux/installer/colladadom-2.3-linux-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/colladadom_3p-update-colladadom/rev/297450/arch/Linux/installer/colladadom-2.3.297450-linux-297450.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -258,17 +236,23 @@ <key>archive</key> <map> <key>hash</key> - <string>ae103c9481be20cd6c035940832b2650</string> + <string>220897a1893a188aa9d31efb48909878</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-colladadom-update/rev/290576/arch/CYGWIN/installer/colladadom-2.3-windows-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/colladadom_3p-update-colladadom/rev/297450/arch/CYGWIN/installer/colladadom-2.3.297450-windows-297450.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>2.3.297450</string> </map> <key>curl</key> <map> + <key>copyright</key> + <string>Copyright (c) 1996 - 2014, Daniel Stenberg, (daniel@haxx.se).</string> + <key>description</key> + <string>Library for transferring data specified with URL syntax</string> <key>license</key> <string>curl</string> <key>license_file</key> @@ -282,9 +266,9 @@ <key>archive</key> <map> <key>hash</key> - <string>40b1c6b3727ebedafc2f1a172797ccd1</string> + <string>d1c5125650a339a5209f429c70f4d395</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-curl-update/rev/295367/arch/Darwin/installer/curl-7.38.0-darwin-20141010.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/curl_3p-update-curl/rev/297172/arch/Darwin/installer/curl-7.38.0.297172-darwin-297172.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -294,9 +278,9 @@ <key>archive</key> <map> <key>hash</key> - <string>06149da3d7a34adf40853f813ae55328</string> + <string>ee6c089ee193e551040d610befc5d1c1</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-curl-update/rev/295367/arch/Linux/installer/curl-7.38.0-linux-20141010.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/curl_3p-update-curl/rev/297172/arch/Linux/installer/curl-7.38.0.297172-linux-297172.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -306,17 +290,23 @@ <key>archive</key> <map> <key>hash</key> - <string>e4280eae792a5f13bc9d01d8cfb7c557</string> + <string>fdeca7cbc074a88d2701d74a31d21bd8</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-curl-update/rev/295367/arch/CYGWIN/installer/curl-7.38.0-windows-20141010.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/curl_3p-update-curl/rev/297172/arch/CYGWIN/installer/curl-7.38.0.297172-windows-297172.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>7.38.0.297172</string> </map> <key>db</key> <map> + <key>copyright</key> + <string>Copyright (c) 1990, 2010 Oracle and/or its affiliates. All rights reserved.</string> + <key>description</key> + <string>Berkeley DB (libdb) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.</string> <key>license</key> <string>bsd</string> <key>license_file</key> @@ -330,23 +320,29 @@ <key>archive</key> <map> <key>hash</key> - <string>8f57c413e0786681cbcb9ed2fb8a6d37</string> + <string>1cc7940e500858a9754e9a3cc3ba2237</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/db-5.1.25-linux-20110309.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/db_3p-update-db/rev/295315/arch/Linux/installer/db-5.1.25-linux-295315.tar.bz2</string> </map> <key>name</key> <string>linux</string> </map> </map> + <key>version</key> + <string>5.1.25</string> </map> - <key>dbusglib</key> + <key>dbus_glib</key> <map> + <key>copyright</key> + <string>Copyright (C) Red Hat Inc.</string> + <key>description</key> + <string>D-Bus bindings for glib</string> <key>license</key> - <string>AFL2.1</string> + <string>Academic Free License v. 2.1</string> <key>license_file</key> <string>LICENSES/dbus-glib.txt</string> <key>name</key> - <string>dbusglib</string> + <string>dbus_glib</string> <key>platforms</key> <map> <key>linux</key> @@ -354,62 +350,46 @@ <key>archive</key> <map> <key>hash</key> - <string>94b058b9a81114dc4567bd78e4335425</string> + <string>c11ff7e2e0bd59e6e59628f24902bbcd</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/dbus_glib-0.76-linux-20110310.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/dbus-glib_3p-update-dbus-glib/rev/297768/arch/Linux/installer/dbus_glib-0.76-linux-297768.tar.bz2</string> </map> <key>name</key> <string>linux</string> </map> </map> + <key>version</key> + <string>0.76</string> </map> <key>dictionaries</key> <map> + <key>copyright</key> + <string>Copyright 2014 Apache OpenOffice software</string> + <key>description</key> + <string>Spell checking dictionaries to bundled into the viewer</string> <key>license</key> - <string>various open</string> + <string>various open source</string> <key>license_file</key> <string>LICENSES/dictionaries.txt</string> <key>name</key> <string>dictionaries</string> <key>platforms</key> <map> - <key>darwin</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>06a6c49eb1873e95623d3d2d07aee903</string> - <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-dictionaries/rev/259873/arch/Darwin/installer/dictionaries-1-darwin-20120616.tar.bz2</string> - </map> - <key>name</key> - <string>darwin</string> - </map> - <key>linux</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>4f0ca21d27e0cd0b002149062b0a4b25</string> - <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-dictionaries/rev/259873/arch/Linux/installer/dictionaries-1-linux-20120616.tar.bz2</string> - </map> - <key>name</key> - <string>linux</string> - </map> - <key>windows</key> + <key>common</key> <map> <key>archive</key> <map> <key>hash</key> - <string>7520d75f6af325328322201c888191d4</string> + <string>a62723a6deea8187702a2f926e98a35f</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-dictionaries/rev/259873/arch/CYGWIN/installer/dictionaries-1-windows-20120616.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/dictionaries_3p-update-dictionaries/rev/297347/arch/Linux/installer/dictionaries-1.297347-common-297347.tar.bz2</string> </map> <key>name</key> - <string>windows</string> + <string>common</string> </map> </map> + <key>version</key> + <string>1.297347</string> </map> <key>elfio</key> <map> @@ -437,8 +417,12 @@ </map> <key>expat</key> <map> + <key>copyright</key> + <string>Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper - Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.</string> + <key>description</key> + <string>Expat is an XML parser library written in C</string> <key>license</key> - <string>mit</string> + <string>expat</string> <key>license_file</key> <string>LICENSES/expat.txt</string> <key>name</key> @@ -450,9 +434,9 @@ <key>archive</key> <map> <key>hash</key> - <string>180e03d0be1f1acfc3244e78742d7bef</string> + <string>452d1910ef853329cd59858e6c5b2c48</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-expat/rev/221695/arch/Darwin/installer/expat-2.0.1-darwin-20110218.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/expat_3p-update-expat/rev/297014/arch/Darwin/installer/expat-2.0.1.297014-darwin-297014.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -462,9 +446,9 @@ <key>archive</key> <map> <key>hash</key> - <string>9bd79781b58e556ab1c36084ec4a1c0c</string> + <string>f546615d76bc0f9e8bc2b9ef89f0ca86</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-expat/rev/221695/arch/Linux/installer/expat-2.0.1-linux-20110219.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/expat_3p-update-expat/rev/297014/arch/Linux/installer/expat-2.0.1.297014-linux-297014.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -474,17 +458,21 @@ <key>archive</key> <map> <key>hash</key> - <string>e72db1bda49b205ebdf4945d4ed2b8f8</string> + <string>c70c72a8a0a1e508691a9b35739b373f</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/expat-2.0.1-windows-20110215.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/expat_3p-update-expat/rev/297014/arch/CYGWIN/installer/expat-2.0.1.297014-windows-297014.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>2.0.1.297014</string> </map> <key>fmodex</key> <map> + <key>copyright</key> + <string>COPYRIGHT 2014 FIRELIGHT TECHNOLOGIES PTY LTD. ALL RIGHTS RESERVED</string> <key>license</key> <string>fmodex</string> <key>license_file</key> @@ -498,9 +486,9 @@ <key>archive</key> <map> <key>hash</key> - <string>862b9244ed8a27bec16b62883fe3580a</string> + <string>ed0d8767652aecd65a7fef3e28645bad</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/288122/arch/Darwin/installer/fmodex-4.44.31-darwin-20140314.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/fmodex_3p-update-fmodex/rev/297261/arch/Darwin/installer/fmodex-4.44.31.297261-darwin-297261.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -510,9 +498,9 @@ <key>archive</key> <map> <key>hash</key> - <string>180f4d703deec104469e6a9044243110</string> + <string>dd0135d53706a4040d65974f7e804d6f</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/288122/arch/Linux/installer/fmodex-4.44.31-linux-20140315.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/fmodex_3p-update-fmodex/rev/297261/arch/Linux/installer/fmodex-4.44.31.297261-linux-297261.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -522,19 +510,25 @@ <key>archive</key> <map> <key>hash</key> - <string>6c859cd17fb8c9cdd96b188c2a2c2838</string> + <string>5aa7b826e7c1cf95e9cd3ef77e314f35</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/288122/arch/CYGWIN/installer/fmodex-4.44.31-windows-20140314.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/fmodex_3p-update-fmodex/rev/297261/arch/CYGWIN/installer/fmodex-4.44.31.297261-windows-297261.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>4.44.31.297261</string> </map> <key>fontconfig</key> <map> + <key>copyright</key> + <string>Copyright (C) 2000,2001,2002,2003,2004,2006,2007 Keith Packard, 2005 Patrick Lam, 2009 Roozbeh Pournader, 2008,2009 Red Hat, Inc., 2008 Danilo Å egan, 2012 Google, Inc.</string> + <key>description</key> + <string>Fontconfig is a library for configuring and customizing font access.</string> <key>license</key> - <string>mit</string> + <string>bsd</string> <key>license_file</key> <string>LICENSES/fontconfig.txt</string> <key>name</key> @@ -546,19 +540,25 @@ <key>archive</key> <map> <key>hash</key> - <string>2843c48e6c84a51e3d6aa05dace4c8c0</string> + <string>864f9361661748ecf0e2cec7110d70b3</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-fontconfig-update/rev/290569/arch/Linux/installer/fontconfig-2.11.0-linux-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/fontconfig_3p-update-fontconfig/rev/297551/arch/Linux/installer/fontconfig-2.11.0-linux-297551.tar.bz2</string> </map> <key>name</key> <string>linux</string> </map> </map> + <key>version</key> + <string>2.11.0</string> </map> <key>freeglut</key> <map> + <key>copyright</key> + <string>Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.</string> + <key>description</key> + <string>freeglut is a completely OpenSourced alternative to the OpenGL Utility Toolkit (GLUT) library.</string> <key>license</key> - <string>mit</string> + <string>freeglut</string> <key>license_file</key> <string>LICENSES/freeglut.txt</string> <key>name</key> @@ -570,19 +570,25 @@ <key>archive</key> <map> <key>hash</key> - <string>825d5a9bafcc5bfe28dc4c1c4f87c576</string> + <string>58e328a8b2f3788f932c57ad77e3e117</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-freeglut/rev/221064/arch/CYGWIN/installer/freeglut-2.6.0-windows-20110214.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/freeglut_3p-update-freeglut/rev/295926/arch/CYGWIN/installer/freeglut-2.6.0.295926-windows-295926.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>2.6.0.295926</string> </map> <key>freetype</key> <map> + <key>copyright</key> + <string>Copyright 2006, 2007, 2008, 2009, 2010 by David Turner, Robert Wilhelm, and Werner Lemberg.</string> + <key>description</key> + <string>Font rendering library</string> <key>license</key> - <string>freetype</string> + <string>FreeType</string> <key>license_file</key> <string>LICENSES/freetype.txt</string> <key>name</key> @@ -594,9 +600,9 @@ <key>archive</key> <map> <key>hash</key> - <string>71c8d80de052f0c2a49e4c7ddf1a56a0</string> + <string>83618d16d974eb0af93926a10ac13297</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-freetype-update/rev/290557/arch/Darwin/installer/freetype-2.4.4-darwin-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/freetype_3p-update-freetype/rev/297053/arch/Darwin/installer/freetype-2.4.4.297053-darwin-297053.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -606,9 +612,9 @@ <key>archive</key> <map> <key>hash</key> - <string>52f87a65cc61ec4b05721c079d015b19</string> + <string>1ac3152b440287c58509d8af0a50326d</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-freetype-update/rev/290557/arch/Linux/installer/freetype-2.4.4-linux-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/freetype_3p-update-freetype/rev/297053/arch/Linux/installer/freetype-2.4.4.297053-linux-297053.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -618,19 +624,25 @@ <key>archive</key> <map> <key>hash</key> - <string>6e9fc0fe628a7c88f6f614bf3b0450ae</string> + <string>207aa1a29bfe4ba63edbca38170970a1</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-freetype-update/rev/290557/arch/CYGWIN/installer/freetype-2.4.4-windows-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/freetype_3p-update-freetype/rev/297053/arch/CYGWIN/installer/freetype-2.4.4.297053-windows-297053.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>2.4.4.297053</string> </map> <key>glext</key> <map> + <key>copyright</key> + <string>Copyright (c) 2007-2010 The Khronos Group Inc.</string> + <key>description</key> + <string>glext headers define function prototypes and constants for OpenGL extensions</string> <key>license</key> - <string>glext</string> + <string>Copyright (c) 2007-2010 The Khronos Group Inc.</string> <key>license_file</key> <string>LICENSES/glext.txt</string> <key>name</key> @@ -642,9 +654,9 @@ <key>archive</key> <map> <key>hash</key> - <string>5de58ca0fe19abf68b25956762ee0d29</string> + <string>4bf4f9e65168138eebbc769e9e12230b</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glext-68-windows-20110406.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/glext_3p-update-glext/rev/296893/arch/Linux/installer/glext-68-linux-296893.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -654,23 +666,57 @@ <key>archive</key> <map> <key>hash</key> - <string>5de58ca0fe19abf68b25956762ee0d29</string> + <string>6eb51c6f17e717a5617b112858d41c80</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glext-68-windows-20110406.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/glext_3p-update-glext/rev/296893/arch/CYGWIN/installer/glext-68-windows-296893.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>68</string> + </map> + <key>glh-linear</key> + <map> + <key>copyright</key> + <string>Copyright (c) 2000 Cass Everitt</string> + <key>description</key> + <string>glh - is a platform-indepenedent C++ OpenGL helper library</string> + <key>license</key> + <string>BSD</string> + <key>license_file</key> + <string>LICENSES/glh-linear.txt</string> + <key>name</key> + <string>glh-linear</string> + <key>platforms</key> + <map> + <key>common</key> + <map> + <key>archive</key> + <map> + <key>hash</key> + <string>f577144536fd7c9d26d9f989acf17857</string> + <key>url</key> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/glh-linear_3p-update-glh-linear/rev/297692/arch/Linux/installer/glh_linear-0.0.0-common-297692.tar.bz2</string> + </map> + <key>name</key> + <string>common</string> + </map> + </map> + <key>version</key> + <string>0.0.0</string> </map> - <key>glh_linear</key> + <key>glod</key> <map> + <key>copyright</key> + <string>Copyright 2003 Jonathan Cohen, Nat Duca, David Luebke, Brenden Schubert - Johns Hopkins University and University of Virginia</string> <key>license</key> - <string>glh_linear</string> + <string>GLOD Open-Source License Version 1.0</string> <key>license_file</key> - <string>LICENSES/glh_linear.txt</string> + <string>LICENSES/GLOD.txt</string> <key>name</key> - <string>glh_linear</string> + <string>glod</string> <key>platforms</key> <map> <key>darwin</key> @@ -678,9 +724,11 @@ <key>archive</key> <map> <key>hash</key> - <string>366f940f2634b0e05954646927620bfd</string> + <string>71e678d70e276fc42a56926fc28a7abd</string> + <key>hash_algorithm</key> + <string>md5</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glh_linear-darwin-20101004.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/glod_3p-update-glod/rev/296895/arch/Darwin/installer/glod-1.0pre4.296895-darwin-296895.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -690,9 +738,11 @@ <key>archive</key> <map> <key>hash</key> - <string>1b1f1e9975e3a671c9faf32fcf4b6d43</string> + <string>fffd130f17cbbe2b93cc241b27262647</string> + <key>hash_algorithm</key> + <string>md5</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glh_linear/rev/263308/arch/Linux/installer/glh_linear-0.0.0-linux-20120810.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/glod_3p-update-glod/rev/296895/arch/Linux/installer/glod-1.0pre4.296895-linux-296895.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -702,19 +752,27 @@ <key>archive</key> <map> <key>hash</key> - <string>57f8be28bbaa2505ae3b59deb2c77cdf</string> + <string>b0b32155319c6441997c034bdae28a22</string> + <key>hash_algorithm</key> + <string>md5</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glh_linear-windows-20101011.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/glod_3p-update-glod/rev/296895/arch/CYGWIN/installer/glod-1.0pre4.296895-windows-296895.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>1.0pre4.296895</string> </map> <key>glui</key> <map> + <key>copyright</key> + <string>Copyright 2006 Paul Rademacher</string> + <key>description</key> + <string>GLUI is a GLUT-based C++ user interface library which provides controls such as buttons, checkboxes, radio buttons, and spinners to OpenGL applications.</string> <key>license</key> - <string>lgpl</string> + <string>ZLIB</string> <key>license_file</key> <string>LICENSES/glui.txt</string> <key>name</key> @@ -726,35 +784,53 @@ <key>archive</key> <map> <key>hash</key> - <string>bd2f84ef8bd308570e2e532a371dc2ef</string> + <string>9b7e2ab9b208b3001803294f83d2b610</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glui-2.36-darwin-20110309.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/glui_3p-update-glui/rev/297273/arch/Darwin/installer/glui-2.36.297273-darwin-297273.tar.bz2</string> </map> <key>name</key> <string>darwin</string> </map> + <key>linux</key> + <map> + <key>archive</key> + <map> + <key>hash</key> + <string>f330b3acd03526d827030eefeeb06240</string> + <key>url</key> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/glui_3p-update-glui/rev/297273/arch/Linux/installer/glui-2.36.297273-linux-297273.tar.bz2</string> + </map> + <key>name</key> + <string>linux</string> + </map> <key>windows</key> <map> <key>archive</key> <map> <key>hash</key> - <string>e006635a741420a15f40bbdac13bd8d7</string> + <string>75b16a5a606c78aaeb2f8e6046310a58</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glui-2.36-windows-20110214.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/glui_3p-update-glui/rev/297273/arch/CYGWIN/installer/glui-2.36.297273-windows-297273.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>2.36.297273</string> </map> - <key>gmock</key> + <key>google_breakpad</key> <map> + <key>copyright</key> + <string>Copyright (c) 2006, Google Inc.</string> + <key>description</key> + <string>Breakpad is a crossplatform library for capturing crash callstacks and runtime data.</string> <key>license</key> <string>bsd</string> <key>license_file</key> - <string>LICENSES/gmock.txt</string> + <string>LICENSES/google_breakpad.txt</string> <key>name</key> - <string>gmock</string> + <string>google_breakpad</string> <key>platforms</key> <map> <key>darwin</key> @@ -762,9 +838,9 @@ <key>archive</key> <map> <key>hash</key> - <string>36b0ea1a8be38f5749a7b13536b871ab</string> + <string>171b39db6d0702535b41fad5b476e39d</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-google-mock-update/rev/290574/arch/Darwin/installer/gmock-1.7.0-darwin-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/google-breakpad_3p-update-google-breakpad/rev/298033/arch/Darwin/installer/google_breakpad-1413.298033-darwin-298033.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -774,9 +850,9 @@ <key>archive</key> <map> <key>hash</key> - <string>3de99704847b34c7acccf5ab87222f6c</string> + <string>0bf69fbc829d964820b798a0494278c9</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-google-mock-update/rev/290574/arch/Linux/installer/gmock-1.7.0-linux-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/google-breakpad_3p-update-google-breakpad/rev/298033/arch/Linux/installer/google_breakpad-1413.298033-linux-298033.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -786,23 +862,29 @@ <key>archive</key> <map> <key>hash</key> - <string>5d91c1d03780aa26bcd5481145ee9e86</string> + <string>c73a7c9aa53a4e266df2d5230a650fbf</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-google-mock-update/rev/290574/arch/CYGWIN/installer/gmock-1.7.0-windows-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/google-breakpad_3p-update-google-breakpad/rev/298127/arch/CYGWIN/installer/google_breakpad-1413.298127-windows-298127.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>1413.298127</string> </map> - <key>google_breakpad</key> + <key>googlemock</key> <map> + <key>copyright</key> + <string>Copyright 2008, Google Inc.</string> + <key>description</key> + <string>a library for writing and using C++ mock classes</string> <key>license</key> - <string>bsd</string> + <string>BSD</string> <key>license_file</key> - <string>LICENSES/google_breakpad.txt</string> + <string>LICENSES/gmock.txt</string> <key>name</key> - <string>google_breakpad</string> + <string>googlemock</string> <key>platforms</key> <map> <key>darwin</key> @@ -810,9 +892,9 @@ <key>archive</key> <map> <key>hash</key> - <string>aff5566e04003de0383941981198e04e</string> + <string>022649e284163b8ee23e3c9a81302fa7</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273073/arch/Darwin/installer/google_breakpad-0.0.0-rev1099-darwin-20130329.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/googlemock_3p-update-googlemock/rev/297460/arch/Darwin/installer/googlemock-1.7.0.297460-darwin-297460.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -822,9 +904,9 @@ <key>archive</key> <map> <key>hash</key> - <string>52257e5eb166a0b69c9c0c38f6e1920e</string> + <string>e08b0e9e269b80b549f6044c4e608fb5</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273079/arch/Linux/installer/google_breakpad-0.0.0-rev1099-linux-20130329.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/googlemock_3p-update-googlemock/rev/297460/arch/Linux/installer/googlemock-1.7.0.297460-linux-297460.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -834,33 +916,51 @@ <key>archive</key> <map> <key>hash</key> - <string>a1e519d08c507c12f9d412b2ae8328c8</string> + <string>f30de5bf36e8ca8681883fe8fd8e0092</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/279804/arch/CYGWIN/installer/google_breakpad-0.0.0-rev1099-windows-20130813.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/googlemock_3p-update-googlemock/rev/297460/arch/CYGWIN/installer/googlemock-1.7.0.297460-windows-297460.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>1.7.0.297460</string> </map> <key>gperftools</key> <map> + <key>copyright</key> + <string>Copyright (c) 2005, Google Inc.</string> + <key>description</key> + <string>Fast, multi-threaded malloc() and nifty performance analysis tools</string> <key>license</key> - <string>bsd</string> + <string>BSD</string> <key>license_file</key> <string>LICENSES/gperftools.txt</string> <key>name</key> <string>gperftools</string> <key>platforms</key> <map> + <key>darwin</key> + <map> + <key>archive</key> + <map> + <key>hash</key> + <string>0137e450bf24cff7e78634bb9a1c85e4</string> + <key>url</key> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/google-perftools_3p-update-google-perftools/rev/297263/arch/Darwin/installer/gperftools-2.0.297263-darwin-297263.tar.bz2</string> + </map> + <key>name</key> + <string>darwin</string> + </map> <key>linux</key> <map> <key>archive</key> <map> <key>hash</key> - <string>8aedfdcf670348c18a9991ae1b384a61</string> + <string>0c252bcaa1cb852f5c4e46a13ed459c5</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/Linux/installer/gperftools-2.0-linux-20120727.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/google-perftools_3p-update-google-perftools/rev/297263/arch/Linux/installer/gperftools-2.0.297263-linux-297263.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -870,19 +970,23 @@ <key>archive</key> <map> <key>hash</key> - <string>f62841804acb91e1309603a84f3f0ce8</string> + <string>2946f9bbf227dee8881af43856ebb3a1</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/CYGWIN/installer/gperftools-2.0-windows-20120727.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/google-perftools_3p-update-google-perftools/rev/297263/arch/CYGWIN/installer/gperftools-2.0.297263-windows-297263.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>2.0.297263</string> </map> <key>gstreamer</key> <map> + <key>copyright</key> + <string>Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/></string> <key>license</key> - <string>lgpl</string> + <string>LGPL</string> <key>license_file</key> <string>LICENSES/gstreamer.txt</string> <key>name</key> @@ -894,17 +998,21 @@ <key>archive</key> <map> <key>hash</key> - <string>ddbc0a64ad788107877fee777403592c</string> + <string>fb1479533a7699b44d34e3a550037eb7</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/gstreamer-linux-20101013.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/gstreamer_3p-update-gstreamer/rev/294903/arch/Linux/installer/gstreamer-0.10.6.294903-linux-294903.tar.bz2</string> </map> <key>name</key> <string>linux</string> </map> </map> + <key>version</key> + <string>0.10.6.294903</string> </map> <key>gtk-atk-pango-glib</key> <map> + <key>copyright</key> + <string>Copyright (various, see sources)</string> <key>license</key> <string>lgpl</string> <key>license_file</key> @@ -918,31 +1026,25 @@ <key>archive</key> <map> <key>hash</key> - <string>03694ade27f53199229c03cbbda89214</string> + <string>15af375116f5c943ea6f4190bc764224</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/gtk-atk-pango-glib-linux-20101001.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/gtk_3p-gtk-atk-pango-glib/rev/294804/arch/Linux/installer/gtk_atk_pango_glib-0.1-linux-294804.tar.bz2</string> </map> <key>name</key> <string>linux</string> </map> - <key>windows</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>c257d718abdde8cfe8a0af26175161a7</string> - <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/gtk-atk-pango-glib-windows-20101001a.tar.bz2</string> - </map> - <key>name</key> - <string>windows</string> - </map> </map> + <key>version</key> + <string>0.0</string> </map> <key>havok-source</key> <map> + <key>copyright</key> + <string>Uses Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details.</string> + <key>description</key> + <string>Havok source code for libs and demos</string> <key>license</key> - <string>havok-ares</string> + <string>havok</string> <key>license_file</key> <string>LICENSES/havok.txt</string> <key>name</key> @@ -954,9 +1056,9 @@ <key>archive</key> <map> <key>hash</key> - <string>e6feee3b452c2f70ce8558e30d6bc10a</string> + <string>5c5b4820999ae9e398801d6a46f45897</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/lindenlab_3p-havok-source/rev/268409/arch/Darwin/installer/havok_source-2012.1-darwin-20121219.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/havok-source_3p-update-havok-source/rev/297312/arch/Darwin/installer/havok_source-2012.1-darwin-297312.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -966,9 +1068,9 @@ <key>archive</key> <map> <key>hash</key> - <string>0c0d2058ba48446e274d6595d1d8063e</string> + <string>6b0f41ddddfa60d8424d8a2e0bc2077d</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/lindenlab_3p-havok-source/rev/268409/arch/Linux/installer/havok_source-2012.1-linux-20121219.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/havok-source_3p-update-havok-source/rev/296959/arch/Linux/installer/havok_source-2012.1-linux-296959.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -978,17 +1080,23 @@ <key>archive</key> <map> <key>hash</key> - <string>88391b6e08d473506d406ca6f3e88cfb</string> + <string>ab30ae74a665950d73ea559f019ff358</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/lindenlab_3p-havok-source/rev/268409/arch/CYGWIN/installer/havok_source-2012.1-windows-20121219.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/havok-source_3p-update-havok-source/rev/297566/arch/CYGWIN/installer/havok_source-2012.1-windows-297566.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>2012.1</string> </map> <key>jpeglib</key> <map> + <key>copyright</key> + <string>Copyright (C) 1991-2011, Thomas G. Lane, Guido Vollbeding.</string> + <key>description</key> + <string>JPEG encoding, decoding library</string> <key>license</key> <string>jpeglib</string> <key>license_file</key> @@ -1002,9 +1110,9 @@ <key>archive</key> <map> <key>hash</key> - <string>71bd6efbf508e1f2e7d98a6195a93e9e</string> + <string>4d7658997fd0f93a9c55e40e40b1b0e5</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jpeglib-8c-darwin-20110228.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/jpeglib_3p-update-jpeglib/rev/296854/arch/Darwin/installer/jpeglib-8c.296854-darwin-296854.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1014,9 +1122,9 @@ <key>archive</key> <map> <key>hash</key> - <string>dcca1db348831cdb7c6b26dc4076c597</string> + <string>0a6641f030e173a7bc0dc8a3087b6c7d</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-jpeglib/rev/224895/arch/Linux/installer/jpeglib-8c-linux-20110323.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/jpeglib_3p-update-jpeglib/rev/296854/arch/Linux/installer/jpeglib-8c.296854-linux-296854.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1026,19 +1134,25 @@ <key>archive</key> <map> <key>hash</key> - <string>a202ec58cef9097c94acfa958ed6da8d</string> + <string>98d3dc8d107d04b572fe47bd43a56e74</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jpeglib-8c-windows-20110217.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/jpeglib_3p-update-jpeglib/rev/296854/arch/CYGWIN/installer/jpeglib-8c.296854-windows-296854.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>8c.296854</string> </map> <key>jsoncpp</key> <map> + <key>copyright</key> + <string>Copyright (c) 2007-2010 Baptiste Lepilleur</string> + <key>description</key> + <string>jsoncpp is an implementation of a JSON (http://json.org) reader and writer in C++.</string> <key>license</key> - <string>jsoncpp</string> + <string>public domain</string> <key>license_file</key> <string>LICENSES/jsoncpp.txt</string> <key>name</key> @@ -1050,9 +1164,9 @@ <key>archive</key> <map> <key>hash</key> - <string>de8b96120c274e052abb4f692861be46</string> + <string>b25a4f480e07c670ffef00c3da578f87</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jsoncpp-0.5.0-darwin-20110131.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/jsoncpp_3p-update-jsoncpp/rev/297281/arch/Darwin/installer/jsoncpp-0.5.0.297281-darwin-297281.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1062,9 +1176,9 @@ <key>archive</key> <map> <key>hash</key> - <string>840cd9455638c0ea52c613cfddd07d5b</string> + <string>5b3b5dbf0c82c1046482a74ce9e11c38</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jsoncpp-0.5.0-linux-20110315.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/jsoncpp_3p-update-jsoncpp/rev/297281/arch/Linux/installer/jsoncpp-0.5.0.297281-linux-297281.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1074,19 +1188,25 @@ <key>archive</key> <map> <key>hash</key> - <string>afff2018e6a887c281b072eecdd9343e</string> + <string>e5a832cffe307a1e814ca0664be30b10</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jsoncpp-0.5.0-windows-20110208.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/jsoncpp_3p-update-jsoncpp/rev/297580/arch/CYGWIN/installer/jsoncpp-0.5.0.297580-windows-297580.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>0.5.0.297580</string> </map> <key>kdu</key> <map> + <key>copyright</key> + <string>Kakadu software</string> + <key>description</key> + <string>JPEG2000 library by Kakadu</string> <key>license</key> - <string>kdu</string> + <string>Kakadu</string> <key>license_file</key> <string>LICENSES/kdu.txt</string> <key>name</key> @@ -1098,9 +1218,9 @@ <key>archive</key> <map> <key>hash</key> - <string>a5b2dff0d97b643227a58473e5c57906</string> + <string>e62f2fc1ee9ab791d603c5b717b46119</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/256978/arch/Darwin/installer/kdu-7.0.0-darwin-20120515.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/kdu_3p-update-kdu/rev/296932/arch/Darwin/installer/kdu-7.2.296932-darwin-296932.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1110,9 +1230,9 @@ <key>archive</key> <map> <key>hash</key> - <string>fbf8a4f78dff986d7c16b3a0437e033e</string> + <string>ed952c0cb86329e63a8db190953962d8</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/223538/arch/Linux/installer/kdu-6.4.1-linux-20110311.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/kdu_3p-update-kdu/rev/296932/arch/Linux/installer/kdu-7.2.296932-linux-296932.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1122,19 +1242,25 @@ <key>archive</key> <map> <key>hash</key> - <string>6d80d35524e1c0c32d3385014d02d48c</string> + <string>a0e5c050a4975c81611d9f1862ac57fb</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/256978/arch/CYGWIN/installer/kdu-7.0.0-windows-20120515.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/kdu_3p-update-kdu/rev/296932/arch/CYGWIN/installer/kdu-7.2.296932-windows-296932.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>7.2.296932</string> </map> <key>libhunspell</key> <map> + <key>copyright</key> + <string>See hunspell.txt</string> + <key>description</key> + <string>Spell checking library</string> <key>license</key> - <string>libhunspell</string> + <string>LGPL</string> <key>license_file</key> <string>LICENSES/hunspell.txt</string> <key>name</key> @@ -1146,9 +1272,9 @@ <key>archive</key> <map> <key>hash</key> - <string>6f5db0ef258df6e5c93c843ec559db6d</string> + <string>05eda16106df26a211f8bdd874d1fca5</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-hunspell/rev/259874/arch/Darwin/installer/libhunspell-1.3.2-darwin-20120616.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/hunspell_3p-update-hunspell/rev/296916/arch/Darwin/installer/libhunspell-1.3.2.296916-darwin-296916.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1158,9 +1284,9 @@ <key>archive</key> <map> <key>hash</key> - <string>0c432d2626aea2e91a56335879c92965</string> + <string>988deae5c63ec638ad222b400a431f5b</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-hunspell/rev/259874/arch/Linux/installer/libhunspell-1.3.2-linux-20120616.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/hunspell_3p-update-hunspell/rev/296916/arch/Linux/installer/libhunspell-1.3.2.296916-linux-296916.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1170,17 +1296,65 @@ <key>archive</key> <map> <key>hash</key> - <string>6a140e5620826aa5e587b4157f57b389</string> + <string>ada0ad726842d902c09ab20a7ad5ac8f</string> + <key>url</key> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/hunspell_3p-update-hunspell/rev/296916/arch/CYGWIN/installer/libhunspell-1.3.2.296916-windows-296916.tar.bz2</string> + </map> + <key>name</key> + <string>windows</string> + </map> + </map> + <key>version</key> + <string>1.3.2.296916</string> + </map> + <key>libndofdev</key> + <map> + <key>copyright</key> + <string>Copyright (c) 2007, 3Dconnexion, Inc. - All rights reserved.</string> + <key>description</key> + <string>3DConnexion SDK</string> + <key>license</key> + <string>BSD</string> + <key>license_file</key> + <string>LICENSES/libndofdev.txt</string> + <key>name</key> + <string>libndofdev</string> + <key>platforms</key> + <map> + <key>darwin</key> + <map> + <key>archive</key> + <map> + <key>hash</key> + <string>a01b411433dbf8a4b481de9e76d9a652</string> + <key>url</key> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/libndofdev_3p-update-libndofdev/rev/297264/arch/Darwin/installer/libndofdev-0.1.297264-darwin-297264.tar.bz2</string> + </map> + <key>name</key> + <string>darwin</string> + </map> + <key>windows</key> + <map> + <key>archive</key> + <map> + <key>hash</key> + <string>1c40c22fb7b84ccccefbf797e2478ec4</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-hunspell/rev/259874/arch/CYGWIN/installer/libhunspell-1.3.2-windows-20120616.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/libndofdev_3p-update-libndofdev/rev/297264/arch/CYGWIN/installer/libndofdev-0.1.297264-windows-297264.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>0.1.297264</string> </map> <key>libpng</key> <map> + <key>copyright</key> + <string>Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson</string> + <key>description</key> + <string>PNG Reference library</string> <key>license</key> <string>libpng</string> <key>license_file</key> @@ -1194,9 +1368,9 @@ <key>archive</key> <map> <key>hash</key> - <string>80a84bbbb363e1a38f39bb6be8a3f166</string> + <string>14cb5c8686a472e9e60179e46cd196f7</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-libpng-update/rev/290558/arch/Darwin/installer/libpng-1.6.8-darwin-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/libpng_3p-update-libpng/rev/297708/arch/Darwin/installer/libpng-1.6.8.297708-darwin-297708.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1206,9 +1380,9 @@ <key>archive</key> <map> <key>hash</key> - <string>3368a25b361c22a03f7ec7e0f8d5ff9d</string> + <string>6dec32fc2527f8cafd616f9271ff3478</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-libpng-update/rev/290558/arch/Linux/installer/libpng-1.6.8-linux-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/libpng_3p-update-libpng/rev/297051/arch/Linux/installer/libpng-1.6.8.297051-linux-297051.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1218,21 +1392,27 @@ <key>archive</key> <map> <key>hash</key> - <string>596f4798f90941817b1ca5009c24d16a</string> + <string>09eb65e66e0230ab01e57e643647a4f1</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-libpng-update/rev/290558/arch/CYGWIN/installer/libpng-1.6.8-windows-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/libpng_3p-update-libpng/rev/297708/arch/CYGWIN/installer/libpng-1.6.8.297708-windows-297708.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>1.6.8.297708</string> </map> <key>libuuid</key> <map> + <key>copyright</key> + <string>Copyright (c) 2004-2008 The OSSP Project <http://www.ossp.org/></string> + <key>description</key> + <string>OSSP uuid is a ISO-C:1999 application programming interface (API) and corresponding command line interface (CLI) for the generation of DCE 1.1, ISO/IEC 11578:1996 and RFC 4122 compliant Universally Unique Identifier (UUID). </string> <key>license</key> - <string>lgpl</string> + <string>UUID</string> <key>license_file</key> - <string>LICENSES/libuuid.txt</string> + <string>LICENSES/uuid.txt</string> <key>name</key> <string>libuuid</string> <key>platforms</key> @@ -1242,17 +1422,23 @@ <key>archive</key> <map> <key>hash</key> - <string>873e8e99d29711df2efa30646dca1795</string> + <string>f231b6ec8bc2f050cfb1ee20bd83190d</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/uuid-1.6.2-linux-20110315.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/libuuid_3p-update-libuuid/rev/295209/arch/Linux/installer/libuuid-1.6.2-linux-295209.tar.bz2</string> </map> <key>name</key> <string>linux</string> </map> </map> + <key>version</key> + <string>1.6.2</string> </map> <key>libxml2</key> <map> + <key>copyright</key> + <string>Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved.</string> + <key>description</key> + <string>Libxml2 is the XML C parser and toolkit developed for the Gnome project.</string> <key>license</key> <string>mit</string> <key>license_file</key> @@ -1266,9 +1452,9 @@ <key>archive</key> <map> <key>hash</key> - <string>4a5880b8235beb5ca21f1e252a46e342</string> + <string>9303f0dd174129e297eca6cc2eb1ab3f</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-libxml-update/rev/290562/arch/Darwin/installer/libxml2-2.9.1-darwin-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/libxml_3p-update-libxml/rev/297050/arch/Darwin/installer/libxml2-2.9.1.297050-darwin-297050.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1278,9 +1464,9 @@ <key>archive</key> <map> <key>hash</key> - <string>7eb90f075730f8d7d176f8fb7bad5ef5</string> + <string>b8b584853dc1344bb3571c13b06ec39e</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-libxml-update/rev/290562/arch/Linux/installer/libxml2-2.9.1-linux-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/libxml_3p-update-libxml/rev/297050/arch/Linux/installer/libxml2-2.9.1.297050-linux-297050.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1290,23 +1476,29 @@ <key>archive</key> <map> <key>hash</key> - <string>ba20e2634b4c249a7064620d135f7972</string> + <string>37fa0e86e54f5f283aa653d770fc8ed5</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-libxml-update/rev/290562/arch/CYGWIN/installer/libxml2-2.9.1-windows-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/libxml_3p-update-libxml/rev/297050/arch/CYGWIN/installer/libxml2-2.9.1.297050-windows-297050.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>2.9.1.297050</string> </map> - <key>llappearanceutility-source</key> + <key>llappearance_utility</key> <map> + <key>copyright</key> + <string>Copyright (c) 2000-2012, Linden Research, Inc.</string> + <key>description</key> + <string>Linden Lab appearance utility for server-side avatar baking services.</string> <key>license</key> - <string>TEMPORARY</string> + <string>Proprietary</string> <key>license_file</key> <string>LICENSES/llappearanceutility.txt</string> <key>name</key> - <string>llappearanceutility-source</string> + <string>llappearance_utility</string> <key>platforms</key> <map> <key>linux</key> @@ -1314,21 +1506,23 @@ <key>archive</key> <map> <key>hash</key> - <string>0e15751836ac0492250001b80aea379f</string> + <string>ce1261a54d877ab5530ae6a9134a77a3</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/293888/arch/Linux/installer/llappearanceutility_source-0.1-linux-20140908.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearance_viewer-update-llappearance-utility/rev/294906/arch/Linux/installer/llappearance_utility-0.0.1-linux-294906.tar.bz2</string> </map> <key>name</key> <string>linux</string> </map> </map> <key>version</key> - <string>0.1</string> + <string>0.0.1</string> </map> <key>llphysicsextensions_source</key> <map> + <key>copyright</key> + <string>Copyright (c) 2010, Linden Research, Inc.</string> <key>license</key> - <string>TEMPORARY</string> + <string>internal</string> <key>license_file</key> <string>LICENSES/llphysicsextensions.txt</string> <key>name</key> @@ -1340,11 +1534,11 @@ <key>archive</key> <map> <key>hash</key> - <string>0578fa67ef9906c6aaa326f51db2669f</string> + <string>468e88a527e610804c3eecf07f4ed70b</string> <key>hash_algorithm</key> <string>md5</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/263415/arch/Darwin/installer/llphysicsextensions_source-0.3-darwin-20120814.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source_llphysicsextensions-update/rev/298369/arch/Darwin/installer/llphysicsextensions_source-1.0.298369-darwin-298369.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1354,9 +1548,9 @@ <key>archive</key> <map> <key>hash</key> - <string>a6856b4d58a3b71321acad7e1fa9c8d4</string> + <string>793964e49c935b414c4bdbb8a0d14ad1</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/265749/arch/Linux/installer/llphysicsextensions_source-0.3-linux-20121011.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source_llphysicsextensions-update/rev/298369/arch/Linux/installer/llphysicsextensions_source-1.0.298369-linux-298369.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1366,21 +1560,23 @@ <key>archive</key> <map> <key>hash</key> - <string>0cebd359ea732a7db363d88f9886a1ef</string> + <string>922aad5261aac150e5ce3c094e57f373</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/263415/arch/CYGWIN/installer/llphysicsextensions_source-0.3-windows-20120814.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source_llphysicsextensions-update/rev/298369/arch/CYGWIN/installer/llphysicsextensions_source-1.0.298369-windows-298369.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> <key>version</key> - <string>0.2</string> + <string>1.0.298369</string> </map> <key>llphysicsextensions_stub</key> <map> + <key>copyright</key> + <string>Copyright (c) 2010, Linden Research, Inc.</string> <key>license</key> - <string>TEMPORARY</string> + <string>internal</string> <key>license_file</key> <string>LICENSES/llphysicsextensions.txt</string> <key>name</key> @@ -1392,11 +1588,11 @@ <key>archive</key> <map> <key>hash</key> - <string>3ae798d4dfb54a1d806ee5f8b31f7626</string> + <string>1175977a191ffc936fd0ccca433c8278</string> <key>hash_algorithm</key> <string>md5</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/263415/arch/Darwin/installer/llphysicsextensions_stub-0.3-darwin-20120814.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub_llphysicsextensions-update/rev/298370/arch/Darwin/installer/llphysicsextensions_stub-1.0.298370-darwin-298370.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1406,9 +1602,9 @@ <key>archive</key> <map> <key>hash</key> - <string>aa8a2f25e8629cf5e6a96cc0eb93de8e</string> + <string>d13d7927692eab2d6a63e36166b72a8a</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/263415/arch/Linux/installer/llphysicsextensions_stub-0.3-linux-20120814.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub_llphysicsextensions-update/rev/298370/arch/Linux/installer/llphysicsextensions_stub-1.0.298370-linux-298370.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1418,21 +1614,25 @@ <key>archive</key> <map> <key>hash</key> - <string>3ea4cee6a8dd4c89fbfd3ad6abd703c2</string> + <string>9594f6fd79ee924fe675a4a23e30516e</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/263415/arch/CYGWIN/installer/llphysicsextensions_stub-0.3-windows-20120814.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub_llphysicsextensions-update/rev/298370/arch/CYGWIN/installer/llphysicsextensions_stub-1.0.298370-windows-298370.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> <key>version</key> - <string>0.2</string> + <string>1.0.298370</string> </map> <key>llqtwebkit</key> <map> + <key>copyright</key> + <string>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</string> + <key>description</key> + <string>QT cross-platform application and UI framework.</string> <key>license</key> - <string>lgpl</string> + <string>LGPL</string> <key>license_file</key> <string>LICENSES/llqtwebkit.txt</string> <key>name</key> @@ -1445,6 +1645,8 @@ <map> <key>hash</key> <string>3c2b6be4c78b2479c3fae612e1053d37</string> + <key>hash_algorithm</key> + <string>md5</string> <key>url</key> <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/canonical_3p-llqtwebkit2/rev/295522/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20141015.tar.bz2</string> </map> @@ -1457,6 +1659,8 @@ <map> <key>hash</key> <string>d31358176b9ba8c676458cc061767c0b</string> + <key>hash_algorithm</key> + <string>md5</string> <key>url</key> <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/canonical_3p-llqtwebkit2/rev/295522/arch/Linux/installer/llqtwebkit-4.7.1-linux-20141015.tar.bz2</string> </map> @@ -1469,6 +1673,8 @@ <map> <key>hash</key> <string>bb4e8c8006c8a7aef6d3e3c36a8cebbf</string> + <key>hash_algorithm</key> + <string>md5</string> <key>url</key> <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/canonical_3p-llqtwebkit2/rev/295522/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20141015.tar.bz2</string> </map> @@ -1476,6 +1682,8 @@ <string>windows</string> </map> </map> + <key>version</key> + <string>4.7.1</string> </map> <key>mesa</key> <map> @@ -1492,67 +1700,25 @@ <key>archive</key> <map> <key>hash</key> - <string>1f600840463c7327ea17486821425750</string> + <string>22c50a5d362cad311b4f413cfcffbba2</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/mesa-7.0-linux-20100930.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/mesa_3p-update-mesa/rev/297294/arch/Linux/installer/mesa-7.11.1.297294-linux-297294.tar.bz2</string> </map> <key>name</key> <string>linux</string> </map> </map> - </map> - <key>ndofdev</key> - <map> - <key>license</key> - <string>linden</string> - <key>license_file</key> - <string>LICENSES/libndofdev.txt</string> - <key>name</key> - <string>ndofdev</string> - <key>platforms</key> - <map> - <key>darwin</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>674d37d2ba76a2df7f18c47bf50b5d03</string> - <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libndofdev-0.1-darwin-20110308.tar.bz2</string> - </map> - <key>name</key> - <string>darwin</string> - </map> - <key>linux</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>9bf7a96c1d2fadb180fda91740c945c6</string> - <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-libndofdev-linux/rev/233137/arch/Linux/installer/libndofdev-0.3-linux-20110617.tar.bz2</string> - </map> - <key>name</key> - <string>linux</string> - </map> - <key>windows</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>3a4bec9562ed6ac53e85abcb1afc5fc0</string> - <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libndofdev-0.1-windows-20110223.tar.bz2</string> - </map> - <key>name</key> - <string>windows</string> - </map> - </map> + <key>version</key> + <string>7.11.1.297294</string> </map> <key>nvapi</key> <map> + <key>copyright</key> + <string>Copyright © 2012 NVIDIA Corporation. All rights reserved.</string> + <key>description</key> + <string>NVAPI provides an interface to NVIDIA devices.</string> <key>license</key> - <string>NVAPI</string> + <string>NVIDIA Corporation Software License Agreement – NVAPI SDK</string> <key>license_file</key> <string>LICENSES/NVAPI_SDK_License_Agreement.pdf</string> <key>name</key> @@ -1564,23 +1730,29 @@ <key>archive</key> <map> <key>hash</key> - <string>baf519d36dffe4e4a59471450e391d01</string> + <string>9e30c9e228d6a825b6774b97ff052973</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-nvapi/rev/267102/arch/CYGWIN/installer/nvapi-304-windows-20121116.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/nvapi_3p-update-nvapi/rev/295118/arch/CYGWIN/installer/nvapi-304-windows-295118.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>304</string> </map> - <key>ogg-vorbis</key> + <key>ogg_vorbis</key> <map> + <key>copyright</key> + <string>Copyright (c) 2002, Xiph.org Foundation</string> + <key>description</key> + <string>Audio encoding library</string> <key>license</key> <string>ogg-vorbis</string> <key>license_file</key> <string>LICENSES/ogg-vorbis.txt</string> <key>name</key> - <string>ogg-vorbis</string> + <string>ogg_vorbis</string> <key>platforms</key> <map> <key>darwin</key> @@ -1588,9 +1760,9 @@ <key>archive</key> <map> <key>hash</key> - <string>e849bc2b779fb7cc5e81aeb021a542c0</string> + <string>07fca1531a27915f642a5c1d95008d54</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ogvorbis/rev/229529/arch/Darwin/installer/ogg_vorbis-1.2.2-1.3.2-darwin-20110510.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oggvorbis_3p-update-oggvorbis/rev/296878/arch/Darwin/installer/ogg_vorbis-1.2.2-1.3.2.296878-darwin-296878.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1600,9 +1772,9 @@ <key>archive</key> <map> <key>hash</key> - <string>71eaa462eb0bf8842277a3436483a354</string> + <string>b0cd31d5b07a9fc25c4d69ba2f95eace</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ogvorbis/rev/229529/arch/Linux/installer/ogg_vorbis-1.2.2-1.3.2-linux-20110511.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oggvorbis_3p-update-oggvorbis/rev/296878/arch/Linux/installer/ogg_vorbis-1.2.2-1.3.2.296878-linux-296878.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1612,23 +1784,59 @@ <key>archive</key> <map> <key>hash</key> - <string>291dbba89dd8162b76f2c2d82e908c6f</string> + <string>f358717739c288ec7401d6d1936ef878</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ogvorbis/rev/229529/arch/CYGWIN/installer/ogg_vorbis-1.2.2-1.3.2-windows-20110510.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/oggvorbis_3p-update-oggvorbis/rev/296878/arch/CYGWIN/installer/ogg_vorbis-1.2.2-1.3.2.296878-windows-296878.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>1.2.2-1.3.2.296878</string> </map> - <key>openal_soft</key> + <key>open-libndofdev</key> <map> + <key>copyright</key> + <string>Copyright (c) 2008, Jan Ciger (jan.ciger (at) gmail.com)</string> + <key>description</key> + <string>Open Source replacement for 3DConnection SDK</string> + <key>license</key> + <string>BSD</string> + <key>license_file</key> + <string>LICENSES/libndofdev.txt</string> + <key>name</key> + <string>open-libndofdev</string> + <key>platforms</key> + <map> + <key>linux</key> + <map> + <key>archive</key> + <map> + <key>hash</key> + <string>b1245d467d5914a266efa16afeb55406</string> + <key>url</key> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/libndofdev_3p-update-libndofdev/rev/297553/arch/Linux/installer/open_libndofdev-0.3-linux-297553.tar.bz2</string> + </map> + <key>name</key> + <string>linux</string> + </map> + </map> + <key>version</key> + <string>0.3</string> + </map> + <key>openal</key> + <map> + <key>copyright</key> + <string>Creative Labs</string> + <key>description</key> + <string>OpenAL is a cross-platform 3D audio API appropriate for use with gaming applications and many other types of audio applications.</string> <key>license</key> <string>lgpl</string> <key>license_file</key> - <string>LICENSES/OPENAL.txt</string> + <string>LICENSES/openal.txt</string> <key>name</key> - <string>openal_soft</string> + <string>openal</string> <key>platforms</key> <map> <key>linux</key> @@ -1636,11 +1844,11 @@ <key>archive</key> <map> <key>hash</key> - <string>fccdca18a950ac9363c6fb39118b80e1</string> + <string>15ebe611213c9577691ffbade081549d</string> <key>hash_algorithm</key> <string>md5</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-3ad86a1c-linux-20110114.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/openal_3p-update-openal/rev/297677/arch/Linux/installer/openal-1.12.854-1.1.0.297677-linux-297677.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1650,21 +1858,27 @@ <key>archive</key> <map> <key>hash</key> - <string>04df406f3e5d04cf176660bdac66c3a1</string> + <string>3bf6e26aeec71f36c8b6e20c6b883fe9</string> + <key>hash_algorithm</key> + <string>md5</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-1.12.854-1.1.0-windows-20110301.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/openal_3p-update-openal/rev/297677/arch/CYGWIN/installer/openal-1.12.854-1.1.0.297677-windows-297677.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> <key>version</key> - <string>3ad86a1c</string> + <string>1.12.854-1.1.0.297677</string> </map> <key>openjpeg</key> <map> + <key>copyright</key> + <string>Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium, Copyright (c) 2002-2007, Professor Benoit Macq, Copyright (c) 2001-2003, David Janssens, Copyright (c) 2002-2003, Yannick Verschueren, Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe, Copyright (c) 2005, Herve Drolon, FreeImage Team</string> + <key>description</key> + <string>The OpenJPEG library is an open-source JPEG 2000 codec written in C language.</string> <key>license</key> - <string>openjpeg</string> + <string>BSD</string> <key>license_file</key> <string>LICENSES/openjpeg.txt</string> <key>name</key> @@ -1676,9 +1890,9 @@ <key>archive</key> <map> <key>hash</key> - <string>4be51c7cca7d84831e30b63279df7ae5</string> + <string>2adb5b8bd2493d576c5d02b992d8f819</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-darwin-20110302.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/openjpeg_3p-update-openjpeg/rev/297018/arch/Darwin/installer/openjpeg-1.4.297018-darwin-297018.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1688,9 +1902,9 @@ <key>archive</key> <map> <key>hash</key> - <string>fb2382014c79e0049746e4e29bd834f9</string> + <string>675c283030879d3d9c49082bfa2192eb</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-linux-20110314.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/openjpeg_3p-update-openjpeg/rev/297018/arch/Linux/installer/openjpeg-1.4.297018-linux-297018.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1700,17 +1914,23 @@ <key>archive</key> <map> <key>hash</key> - <string>ca5765af55f798724d601720afdf6953</string> + <string>b35adcf74d22c128045aa87aade74736</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-windows-20110302.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/openjpeg_3p-update-openjpeg/rev/297018/arch/CYGWIN/installer/openjpeg-1.4.297018-windows-297018.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>1.4.297018</string> </map> <key>openssl</key> <map> + <key>copyright</key> + <string>Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved; Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)</string> + <key>description</key> + <string>Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) Library</string> <key>license</key> <string>openssl</string> <key>license_file</key> @@ -1724,9 +1944,9 @@ <key>archive</key> <map> <key>hash</key> - <string>4db126327bbb125ea2490c79c73103bf</string> + <string>0a77d56769e6075957f614be6575423e</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-openssl-update/rev/290662/arch/Darwin/installer/openssl-1.0.1h-darwin-20140605.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/openssl_3p-update-openssl/rev/297168/arch/Darwin/installer/openssl-1.0.1h.297168-darwin-297168.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1736,9 +1956,9 @@ <key>archive</key> <map> <key>hash</key> - <string>0665c18f8cdbe2f90cb0a2f088cfe1a6</string> + <string>c310ba9971cbd796b303c3be67fb11c6</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-openssl-update/rev/290662/arch/Linux/installer/openssl-1.0.1h-linux-20140605.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/openssl_3p-update-openssl/rev/297168/arch/Linux/installer/openssl-1.0.1h.297168-linux-297168.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1748,17 +1968,23 @@ <key>archive</key> <map> <key>hash</key> - <string>138997e1a73c65525d45c00f43f08010</string> + <string>398743f47578cbb44f5504128780369f</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-openssl-update/rev/290662/arch/CYGWIN/installer/openssl-1.0.1h-windows-20140605.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/openssl_3p-update-openssl/rev/297168/arch/CYGWIN/installer/openssl-1.0.1h.297168-windows-297168.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>1.0.1h.297168</string> </map> <key>pcre</key> <map> + <key>copyright</key> + <string>Copyright (c) 1997-2014 University of Cambridge; Copyright(c) 2009-2014 Zoltan Herczeg; Copyright (c) 2007-2012, Google Inc.</string> + <key>description</key> + <string>PCRE Perl-compatible regular expression library</string> <key>license</key> <string>bsd</string> <key>license_file</key> @@ -1772,9 +1998,9 @@ <key>archive</key> <map> <key>hash</key> - <string>af0d38a4c56b52c4df40a4ff0d51efef</string> + <string>6d2b38897f1adf354b299345d5fc759b</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-pcre-update/rev/290406/arch/Darwin/installer/pcre-8.35-darwin-20140529.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/pcre_3p-update-pcre/rev/297155/arch/Darwin/installer/pcre-8.35.-darwin-297155.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1784,9 +2010,9 @@ <key>archive</key> <map> <key>hash</key> - <string>5e6368d39b95f2c0d5162dac2c17c67f</string> + <string>b82817bcc2f63094d9c915d018d0b036</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-pcre-update/rev/290406/arch/Linux/installer/pcre-8.35-linux-20140530.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/pcre_3p-update-pcre/rev/297155/arch/Linux/installer/pcre-8.35.-linux-297155.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1796,19 +2022,25 @@ <key>archive</key> <map> <key>hash</key> - <string>9250f74fed826ad1b8700229e964519d</string> + <string>96ed836c89a99dfc22f9c16a0d7272d3</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-pcre-update/rev/290406/arch/CYGWIN/installer/pcre-8.35-windows-20140529.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/pcre_3p-update-pcre/rev/297155/arch/CYGWIN/installer/pcre-8.35.-windows-297155.tar.bz2</string> </map> <key>name</key> <string>linux</string> </map> </map> + <key>version</key> + <string>8.35.</string> </map> <key>quicktime</key> <map> + <key>copyright</key> + <string>2010 Apple</string> + <key>description</key> + <string>QuickTime 7.3 SDK for Windows</string> <key>license</key> - <string>quicktime</string> + <string>unknown</string> <key>license_file</key> <string>LICENSES/quicktime.txt</string> <key>name</key> @@ -1820,19 +2052,81 @@ <key>archive</key> <map> <key>hash</key> - <string>52e49ab6937b09882389da0dbaec17f5</string> + <string>3f8b52280cb1eff2d1acd0214bce1b16</string> + <key>url</key> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/quicktime_3p-update-quicktime/rev/296445/arch/CYGWIN/installer/quicktime-7.3-windows-296445.tar.bz2</string> + </map> + <key>name</key> + <string>windows</string> + </map> + </map> + <key>version</key> + <string>7.3</string> + </map> + <key>slplugins</key> + <map> + <key>copyright</key> + <string>Second Life Viewer Source Code - Copyright (C) 2010, Linden Research, Inc.</string> + <key>description</key> + <string>Second Life Viewer Plugins and launcher</string> + <key>license</key> + <string>LGPL</string> + <key>license_file</key> + <string>LICENSES/slplugins-license.txt</string> + <key>name</key> + <string>slplugins</string> + <key>platforms</key> + <map> + <key>darwin</key> + <map> + <key>archive</key> + <map> + <key>hash</key> + <string>f6bfb026572f03a4c8ac6b2b7d7eb0ae</string> + <key>url</key> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/slplugins_3p-update-slplugins/rev/298079/arch/Darwin/installer/slplugins-3.7.24.297623.298079-darwin-298079.tar.bz2</string> + </map> + <key>name</key> + <string>darwin</string> + </map> + <key>linux</key> + <map> + <key>archive</key> + <map> + <key>hash</key> + <string>64b8a3bac95b5888a7ede3d7661a18b8</string> + <key>url</key> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/slplugins_3p-update-slplugins/rev/298079/arch/Linux/installer/slplugins-3.7.24.297623.298079-linux-298079.tar.bz2</string> + </map> + <key>name</key> + <string>linux</string> + </map> + <key>windows</key> + <map> + <key>archive</key> + <map> + <key>hash</key> + <string>3a1ea3385303b78b0327c8cea929ef27</string> + <key>hash_algorithm</key> + <string>md5</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/quicktime-7.3-windows-20110127.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/slplugins_3p-update-slplugins/rev/298079/arch/CYGWIN/installer/slplugins-3.7.24.297623.298079-windows-298079.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>3.7.24.297623.298079</string> </map> <key>slvoice</key> <map> + <key>copyright</key> + <string>2010 Vivox, including audio coding using Polycom¨ Siren14TM (ITU-T Rec. G.722.1 Annex C)</string> + <key>description</key> + <string>Vivox SDK components</string> <key>license</key> - <string>vivox</string> + <string>Mixed</string> <key>license_file</key> <string>LICENSES/slvoice.txt</string> <key>name</key> @@ -1844,9 +2138,9 @@ <key>archive</key> <map> <key>hash</key> - <string>88181b9f66b7db650e0d571bbb632bdc</string> + <string>68a8fab5ad3a180487598d3a3e0d57b1</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/287264/arch/Darwin/installer/slvoice-4.6.0009.20030-darwin-20140226.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/slvoice_3p-update-slvoice/rev/298329/arch/Darwin/installer/slvoice-4.6.0017.21209.298329-darwin-298329.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1856,9 +2150,9 @@ <key>archive</key> <map> <key>hash</key> - <string>957773fff7148ffaca42b1ea4a18d192</string> + <string>48ed7ddcf93fa3c751d677f5eb5f9367</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/270512/arch/Linux/installer/slvoice-4.5.0009.17865-linux-20130216.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/slvoice_3p-update-slvoice/rev/298329/arch/Linux/installer/slvoice-3.2.0002.10426.298329-linux-298329.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1868,17 +2162,23 @@ <key>archive</key> <map> <key>hash</key> - <string>ce89b881ee24977641d1ecbf8aff6dc7</string> + <string>399afab7047e6fa62e7b2fb1768059ea</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/287264/arch/CYGWIN/installer/slvoice-4.6.0009.20030-windows-20140227.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/slvoice_3p-update-slvoice/rev/298329/arch/CYGWIN/installer/slvoice-4.6.0017.21209.298329-windows-298329.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>4.6.0017.21209.2988329</string> </map> <key>tut</key> <map> + <key>copyright</key> + <string>Copyright 2002-2006 Vladimir Dyuzhev, Copyright 2007 Denis Kononenko, Copyright 2008-2009 MichaÅ‚ Rzechonek</string> + <key>description</key> + <string>TUT is a small and portable unit test framework for C++.</string> <key>license</key> <string>bsd</string> <key>license_file</key> @@ -1892,65 +2192,77 @@ <key>archive</key> <map> <key>hash</key> - <string>5c6d3e606f027e78f056cb77b20f228e</string> + <string>2f32faa00e600911f838a7d82da5a8db</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/tut-2008-11-30-common-20101001.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/tut_3p-update-tut/rev/297257/arch/Linux/installer/tut-2008.11.30-common-297257.tar.bz2</string> </map> <key>name</key> <string>common</string> </map> </map> + <key>version</key> + <string>2008.11.30</string> </map> <key>uriparser</key> <map> - <key>license</key> - <string>uriparser</string> - <key>license_file</key> - <string>LICENSES/uriparser.txt</string> - <key>name</key> - <string>uriparser</string> - <key>platforms</key> + <key>copyright</key> + <string>Copyright (C) 2007, Weijia Song <songweijia@gmail.com>, Sebastian Pipping <webmaster@hartwork.org></string> + <key>description</key> + <string>uriparser is a strictly RFC 3986 compliant URI parsing and handling library written in C. uriparser is cross-platform, fast, supports Unicode and is licensed under the New BSD license.</string> + <key>license</key> + <string>New BSD license</string> + <key>license_file</key> + <string>LICENSES/uriparser.txt</string> + <key>name</key> + <string>uriparser</string> + <key>platforms</key> + <map> + <key>darwin</key> <map> - <key>darwin</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>99c5a966ac74eea5a505317396152168</string> - <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-uriparser/rev/294299/arch/Darwin/installer/uriparser-0.8.0.1-darwin-20140917.tar.bz2</string> - </map> - <key>name</key> - <string>darwin</string> - </map> - <key>linux</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>34306fb90364b182dc770375140d8557</string> - <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-uriparser/rev/294298/arch/Linux/installer/uriparser-0.8.0.1-linux-20140918.tar.bz2</string> - </map> - <key>name</key> - <string>linux</string> - </map> - <key>windows</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>73817db47bc0f87269861b7887319414</string> - <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-uriparser/rev/294274/arch/CYGWIN/installer/uriparser-0.8.0.1-windows-20140917.tar.bz2</string> - </map> - <key>name</key> - <string>windows</string> - </map> + <key>archive</key> + <map> + <key>hash</key> + <string>22608adaf54e8ddc9182a719ba6e2b32</string> + <key>url</key> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/uriparser_3p-update-uriparser/rev/299435/arch/Darwin/installer/uriparser-0.8.0.1-darwin-299435.tar.bz2</string> + </map> + <key>name</key> + <string>darwin</string> + </map> + <key>linux</key> + <map> + <key>archive</key> + <map> + <key>hash</key> + <string>dddfc8dea540801f93ba0382cb1e3685</string> + <key>url</key> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/uriparser_3p-update-uriparser/rev/299435/arch/Linux/installer/uriparser-0.8.0.1-linux-299435.tar.bz2</string> + </map> + <key>name</key> + <string>linux</string> </map> + <key>windows</key> + <map> + <key>archive</key> + <map> + <key>hash</key> + <string>e4520158dda88453e46942eab6f9c0a8</string> + <key>url</key> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/uriparser_3p-update-uriparser/rev/299435/arch/CYGWIN/installer/uriparser-0.8.0.1-windows-299435.tar.bz2</string> + </map> + <key>name</key> + <string>windows</string> + </map> + </map> + <key>version</key> + <string>0.8.0.1</string> </map> <key>xmlrpc-epi</key> <map> + <key>copyright</key> + <string>Copyright: (C) 2000 Epinions, Inc.</string> + <key>description</key> + <string>XMLRPC Library</string> <key>license</key> <string>xmlrpc-epi</string> <key>license_file</key> @@ -1964,9 +2276,9 @@ <key>archive</key> <map> <key>hash</key> - <string>a3e0fb4b4a51b01690a99747a1cca531</string> + <string>ffd3aab8e0c0ff6dadbce49ca2809078</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/xmlrpc_epi-0.54.1-darwin-20110307.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/xmlrpc-emi_3p-update-xmlrpc-epi/rev/297075/arch/Darwin/installer/xmlrpc_epi-0.54.1.297075-darwin-297075.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1976,9 +2288,9 @@ <key>archive</key> <map> <key>hash</key> - <string>174ab797440157956eda7061dae37564</string> + <string>30bb26d6cc78c16047fc85a63f48fcdb</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/xmlrpc_epi-0.54.1-linux-20110314.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/xmlrpc-emi_3p-update-xmlrpc-epi/rev/297075/arch/Linux/installer/xmlrpc_epi-0.54.1.297075-linux-297075.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1988,17 +2300,23 @@ <key>archive</key> <map> <key>hash</key> - <string>5181d1a8f2516928ac064d72acf164a4</string> + <string>a7e1a8369a5afd52e1b6fc1f14155033</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/xmlrpc_epi-0.54.1-windows-20110224.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/xmlrpc-emi_3p-update-xmlrpc-epi/rev/297075/arch/CYGWIN/installer/xmlrpc_epi-0.54.1.297075-windows-297075.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>0.54.1.297075</string> </map> <key>zlib</key> <map> + <key>copyright</key> + <string>Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler</string> + <key>description</key> + <string>Zlib Data Compression Library</string> <key>license</key> <string>zlib</string> <key>license_file</key> @@ -2012,9 +2330,9 @@ <key>archive</key> <map> <key>hash</key> - <string>6658071e3b54b1dd5f5279227aff402a</string> + <string>1a79eeac199c2d94e4ae4e5d0194e25f</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-zlib-update/rev/290556/arch/Darwin/installer/zlib-1.2.8-darwin-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/zlib_3p-update-zlib/rev/296881/arch/Darwin/installer/zlib-1.2.8.296881-darwin-296881.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -2024,9 +2342,11 @@ <key>archive</key> <map> <key>hash</key> - <string>63a62bb3cbef2aad3cca49cb6f2d0aeb</string> + <string>2eb8e59b6464222dcf4435016ad5f618</string> + <key>hash_algorithm</key> + <string>md5</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-zlib-update/rev/290556/arch/Linux/installer/zlib-1.2.8-linux-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/zlib_3p-update-zlib/rev/296881/arch/Linux/installer/zlib-1.2.8.296881-linux-296881.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -2036,22 +2356,28 @@ <key>archive</key> <map> <key>hash</key> - <string>ab45a628e22a495814e806ce46081806</string> + <string>ae420ec6d30411c07aac2502d7bbc0f3</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-zlib-update/rev/290556/arch/CYGWIN/installer/zlib-1.2.8-windows-20140602.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/zlib_3p-update-zlib/rev/296881/arch/CYGWIN/installer/zlib-1.2.8.296881-windows-296881.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> + <key>version</key> + <string>1.2.8.296881</string> </map> </map> <key>package_description</key> <map> + <key>copyright</key> + <string>Copyright (c) 2014, Linden Research, Inc.</string> <key>description</key> <string>Second Life Viewer</string> <key>license</key> <string>LGPL</string> + <key>license_file</key> + <string>docs/LICENSE-source.txt</string> <key>name</key> <string>Second Life Viewer</string> <key>platforms</key> @@ -2060,47 +2386,6 @@ <map> <key>configurations</key> <map> - <key>Debug</key> - <map> - <key>build</key> - <map> - </map> - <key>configure</key> - <map> - <key>command</key> - <string>cmake</string> - <key>options</key> - <array> - <string>-DCMAKE_BUILD_TYPE:STRING=Debug</string> - <string>-DWORD_SIZE:STRING=32</string> - <string>-DROOT_PROJECT_NAME:STRING=SecondLife</string> - <string>-DINSTALL_PROPRIETARY=TRUE</string> - </array> - </map> - <key>name</key> - <string>Debug</string> - </map> - <key>DebugOS</key> - <map> - <key>configure</key> - <map> - <key>arguments</key> - <array> - <string>../indra</string> - </array> - <key>command</key> - <string>cmake</string> - <key>options</key> - <array> - <string>-DCMAKE_BUILD_TYPE:STRING=Debug</string> - <string>-DWORD_SIZE:STRING=32</string> - <string>-DROOT_PROJECT_NAME:STRING=SecondLife</string> - <string>-DINSTALL_PROPRIETARY=FALSE</string> - </array> - </map> - <key>name</key> - <string>DebugOS</string> - </map> <key>RelWithDebInfo</key> <map> <key>build</key> @@ -2193,60 +2478,6 @@ <string>build-darwin-i386</string> <key>configurations</key> <map> - <key>Debug</key> - <map> - <key>build</key> - <map> - <key>command</key> - <string>xcodebuild</string> - <key>filters</key> - <array> - <string>setenv</string> - </array> - <key>options</key> - <array> - <string>-configuration Debug</string> - <string>-project SecondLife.xcodeproj</string> - </array> - </map> - <key>configure</key> - <map> - <key>arguments</key> - <array> - <string>../indra</string> - </array> - <key>options</key> - <array> - <string>-G</string> - <string>'Xcode'</string> - </array> - </map> - <key>name</key> - <string>Debug</string> - </map> - <key>DebugOS</key> - <map> - <key>build</key> - <map> - <key>command</key> - <string>xcodebuild</string> - <key>options</key> - <array> - <string>-configuration Debug</string> - <string>-project SecondLife.xcodeproj</string> - </array> - </map> - <key>configure</key> - <map> - <key>options</key> - <array> - <string>-G</string> - <string>'Xcode'</string> - </array> - </map> - <key>name</key> - <string>DebugOS</string> - </map> <key>RelWithDebInfo</key> <map> <key>build</key> @@ -2371,54 +2602,6 @@ <string>build-linux-i686</string> <key>configurations</key> <map> - <key>Debug</key> - <map> - <key>build</key> - <map> - <key>command</key> - <string>make</string> - <key>options</key> - <array> - <string>-j 12</string> - </array> - </map> - <key>configure</key> - <map> - <key>arguments</key> - <array> - <string>../indra</string> - </array> - <key>options</key> - <array> - <string>-G</string> - <string>'Unix Makefiles'</string> - </array> - </map> - <key>name</key> - <string>Debug</string> - </map> - <key>DebugOS</key> - <map> - <key>build</key> - <map> - <key>command</key> - <string>make</string> - <key>options</key> - <array> - <string>-j 7</string> - </array> - </map> - <key>configure</key> - <map> - <key>options</key> - <array> - <string>-G</string> - <string>'Unix Makefiles'</string> - </array> - </map> - <key>name</key> - <string>DebugOS</string> - </map> <key>RelWithDebInfo</key> <map> <key>build</key> @@ -2532,94 +2715,9 @@ <key>windows</key> <map> <key>build_directory</key> - <string>build-vc100</string> + <string>build-vc120</string> <key>configurations</key> <map> - <key>Debug</key> - <map> - <key>build</key> - <map> - <key>arguments</key> - <array> - <string>SecondLife.sln</string> - </array> - <key>command</key> - <string>BuildConsole</string> - <key>options</key> - <array> - <string>/build</string> - <string>"/cfg=Debug|Win32"</string> - </array> - </map> - <key>configure</key> - <map> - <key>arguments</key> - <array> - <string>..\indra</string> - <string>&&</string> - <string>..\indra\tools\vstool\VSTool.exe</string> - <string>--solution</string> - <string>SecondLife.sln</string> - <string>--config</string> - <string>Debug</string> - <string>--startup</string> - <string>secondlife-bin</string> - </array> - <key>options</key> - <array> - <string>-G</string> - <string>"Visual Studio 10"</string> - </array> - </map> - <key>name</key> - <string>Debug</string> - </map> - <key>DebugOS</key> - <map> - <key>build</key> - <map> - <key>arguments</key> - <array> - <string>SecondLife.sln</string> - </array> - <key>command</key> - <string>msbuild.exe</string> - <key>options</key> - <array> - <string>/p:Configuration=Debug</string> - <string>/p:Platform=Win32</string> - <string>/t:Build</string> - <string>/p:useenv=true</string> - <string>/verbosity:minimal</string> - <string>/toolsversion:4.0</string> - <string>/p:"VCBuildAdditionalOptions= /incremental"</string> - </array> - </map> - <key>configure</key> - <map> - <key>arguments</key> - <array> - <string>..\indra</string> - <string>&&</string> - <string>..\indra\tools\vstool\VSTool.exe</string> - <string>--solution</string> - <string>SecondLife.sln</string> - <string>--config</string> - <string>Debug</string> - <string>--startup</string> - <string>secondlife-bin</string> - </array> - <key>options</key> - <array> - <string>-G</string> - <string>"Visual Studio 10"</string> - <string>-DUNATTENDED:BOOL=ON</string> - <string>-DUSE_KDU=FALSE</string> - </array> - </map> - <key>name</key> - <string>DebugOS</string> - </map> <key>RelWithDebInfo</key> <map> <key>build</key> @@ -2653,7 +2751,7 @@ <key>options</key> <array> <string>-G</string> - <string>"Visual Studio 10"</string> + <string>"Visual Studio 12"</string> </array> </map> <key>default</key> @@ -2699,7 +2797,7 @@ <key>options</key> <array> <string>-G</string> - <string>"Visual Studio 10"</string> + <string>"Visual Studio 12"</string> <string>-DUNATTENDED:BOOL=ON</string> <string>-DINSTALL_PROPRIETARY=FALSE</string> <string>-DUSE_KDU=FALSE</string> @@ -2741,7 +2839,7 @@ <key>options</key> <array> <string>-G</string> - <string>"Visual Studio 10"</string> + <string>"Visual Studio 12"</string> </array> </map> <key>name</key> @@ -2785,7 +2883,7 @@ <key>options</key> <array> <string>-G</string> - <string>"Visual Studio 10"</string> + <string>"Visual Studio 12"</string> <string>-DUNATTENDED:BOOL=ON</string> <string>-DINSTALL_PROPRIETARY=FALSE</string> <string>-DUSE_KDU=FALSE</string> @@ -2799,12 +2897,12 @@ <string>windows</string> </map> </map> - <key>version</key> - <string>1.0</string> + <key>version_file</key> + <string>newview/viewer_version.txt</string> </map> <key>type</key> <string>autobuild</string> <key>version</key> - <string>1.2</string> + <string>1.3</string> </map> </llsd> @@ -1,6 +1,7 @@ #!/bin/sh -# This is a the master build script - it is intended to be run by parabuild +# This is a the master build script - it is intended to be run by the Linden +# Lab build farm # It is called by a wrapper script in the shared repository which sets up # the environment from the various BuildParams files and does all the build # result post-processing. @@ -12,8 +13,6 @@ # * The special style in which python is invoked is intentional to permit # use of a native python install on windows - which requires paths in DOS form # * This script relies heavily on parameters defined in BuildParams -# * The basic convention is that the build name can be mapped onto a mercurial URL, -# which is also used as the "branch" name. check_for() { @@ -33,7 +32,7 @@ build_dir_Linux() build_dir_CYGWIN() { - echo build-vc100 + echo build-vc120 } viewer_channel_suffix() @@ -102,7 +101,7 @@ pre_build() check_for "Confirm dictionaries are installed before 'autobuild configure'" ${build_dir}/packages/dictionaries - "$AUTOBUILD" configure -c $variant -- \ + "$autobuild" configure -c $variant -- \ -DPACKAGE:BOOL=ON \ -DRELEASE_CRASH_REPORTING:BOOL=ON \ -DVIEWER_CHANNEL:STRING="\"$viewer_channel\"" \ @@ -120,14 +119,20 @@ package_llphysicsextensions_tpv() if [ "$variant" = "Release" ] then llpetpvcfg=$build_dir/packages/llphysicsextensions/autobuild-tpv.xml - "$AUTOBUILD" build --verbose --config-file $llpetpvcfg -c Tpv + "$autobuild" build --verbose --config-file $llpetpvcfg -c Tpv # capture the package file name for use in upload later... PKGTMP=`mktemp -t pgktpv.XXXXXX` trap "rm $PKGTMP* 2>/dev/null" 0 - "$AUTOBUILD" package --verbose --config-file $llpetpvcfg > $PKGTMP + "$autobuild" package --verbose --config-file $llpetpvcfg --results-file "$(native_path $PKGTMP)" tpv_status=$? - sed -n -e 's/^wrote *//p' $PKGTMP > $build_dir/llphysicsextensions_package + if [ -r "${PKGTMP}" ] + then + cat "${PKGTMP}" >> "$build_log" + eval $(cat "${PKGTMP}") # sets autobuild_package_{name,filename,md5} + autobuild_package_filename="$(shell_path "${autobuild_package_filename}")" + echo "${autobuild_package_filename}" > $build_dir/llphysicsextensions_package + fi else echo "Do not provide llphysicsextensions_tpv for $variant" llphysicsextensions_package="" @@ -143,7 +148,7 @@ build() then begin_section "Viewer$variant" - "$AUTOBUILD" build --no-configure -c $variant + "$autobuild" build --no-configure -c $variant build_ok=$? end_section "Viewer$variant" @@ -172,11 +177,22 @@ build() # This is called from the branch independent script upon completion of all platform builds. build_docs() { - begin_section Docs - # Stub code to generate docs - echo Hello world > documentation.txt - upload_item docs documentation.txt text/plain - end_section Docs + begin_section "Building Documentation" + begin_section "Autobuild metadata" + if [ -r "$build_dir/autobuild-package.xml" ] + then + upload_item docs "$build_dir/autobuild-package.xml" text/xml + else + record_event "no metadata at '$build_dir/autobuild-package.xml'" + fi + end_section "Autobuild metadata" + if [ "$arch" != "Linux" ] + then + record_dependencies_graph # defined in build.sh + else + echo "TBD - skipping linux graph (probable python version dependency)" 1>&2 + fi + end_section "Building Documentation" } @@ -200,33 +216,23 @@ fi # Check to see if we're skipping the platform eval '$build_'"$arch" || pass -if [ -z "$AUTOBUILD" ] +# ensure AUTOBUILD is in native path form for child processes +AUTOBUILD="$(native_path "$AUTOBUILD")" +# set "$autobuild" to cygwin path form for use locally in this script +autobuild="$(shell_path "$AUTOBUILD")" +if [ ! -x "$autobuild" ] then - export autobuild_dir="$here/../../../autobuild/bin/" - if [ -d "$autobuild_dir" ] - then - export AUTOBUILD="$autobuild_dir"autobuild - if [ -x "$AUTOBUILD" ] - then - # *HACK - bash doesn't know how to pass real pathnames to native windows python - case "$arch" in - CYGWIN) AUTOBUILD=$(cygpath -u $AUTOBUILD.cmd) ;; - esac - else - record_failure "Not executable: $AUTOBUILD" - exit 1 - fi - else - record_failure "Not found: $autobuild_dir" - exit 1 - fi + record_failure "AUTOBUILD not executable: '$autobuild'" + exit 1 fi -# load autbuild provided shell functions and variables -eval "$("$AUTOBUILD" source_environment)" +# load autobuild provided shell functions and variables +eval "$("$autobuild" source_environment)" # dump environment variables for debugging +begin_section "Environment" env|sort +end_section "Environment" # Now run the build succeeded=true @@ -276,6 +282,8 @@ do end_section "Do$variant" done +build_docs + # If we are building variants in parallel, wait, then collect results. # This requires that the build dirs are variant specific if $build_link_parallel && [ x"$build_processes" != x ] @@ -375,7 +383,6 @@ then fi fi - # check status and upload results to S3 if $succeeded then diff --git a/doc/contributions.txt b/doc/contributions.txt index 3720774c59..2923139405 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -314,6 +314,7 @@ Cinder Roxley BUG-2326 BUG-3863 OPEN-185 + OPEN-282 STORM-1703 STORM-1948 STORM-1831 @@ -1231,6 +1232,7 @@ Sovereign Engineer STORM-1972 OPEN-195 OPEN-217 + OPEN-295 SpacedOut Frye VWR-34 VWR-45 @@ -1272,6 +1274,7 @@ TankMaster Finesmith OPEN-140 OPEN-142 OPEN-154 + OPEN-295 STORM-1100 STORM-1258 STORM-1602 diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 24ea59ca49..10692402a5 100755 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -20,12 +20,6 @@ if (NOT CMAKE_BUILD_TYPE) "Build type. One of: Debug Release RelWithDebInfo" FORCE) endif (NOT CMAKE_BUILD_TYPE) -# For the library installation process; -# see cmake/Prebuild.cmake for the counterpart code. -if ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${CMAKE_BINARY_DIR}/temp/sentinel_installed") - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/temp) - file(WRITE ${CMAKE_BINARY_DIR}/temp/sentinel_installed "0") -endif ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${CMAKE_BINARY_DIR}/temp/sentinel_installed") add_subdirectory(cmake) add_subdirectory(${LIBS_OPEN_PREFIX}llaudio) @@ -60,6 +54,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components) # Legacy C++ tests. Build always, run if LL_TESTS is true. add_subdirectory(${VIEWER_PREFIX}test) +if (ENABLE_MEDIA_PLUGINS) # viewer media plugins add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins) @@ -68,6 +63,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins) add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest) add_subdirectory(${VIEWER_PREFIX}test_apps/llfbconnecttest) endif (LL_TESTS AND NOT LINUX) +endif (ENABLE_MEDIA_PLUGINS) if (LINUX) add_subdirectory(${VIEWER_PREFIX}linux_crash_logger) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 52b0f4e8b4..7a320ffc59 100755 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -49,12 +49,13 @@ if (WINDOWS) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP -D_SCL_SECURE_NO_WARNINGS=1" CACHE STRING "C++ compiler debug options" FORCE) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO - "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /Ob0 -D_SECURE_STL=0" + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /Zo /MD /MP /Ob0 -D_SECURE_STL=0" CACHE STRING "C++ compiler release-with-debug options" FORCE) set(CMAKE_CXX_FLAGS_RELEASE - "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0" + "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /Zo /MD /MP /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0" CACHE STRING "C++ compiler release options" FORCE) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") + # zlib has assembly-language object files incompatible with SAFESEH + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT") set(CMAKE_CXX_STANDARD_LIBRARIES "") set(CMAKE_C_STANDARD_LIBRARIES "") @@ -190,22 +191,28 @@ if (DARWIN) add_definitions(-DLL_DARWIN=1) set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") - set(DARWIN_extra_cstar_flags "-mlong-branch -g") + set(DARWIN_extra_cstar_flags "-g") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}") # NOTE: it's critical that the optimization flag is put in front. # NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered. set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_C_FLAGS_RELWITHDEBINFO}") - if (XCODE_VERSION GREATER 4.2) - set(ENABLE_SIGNING TRUE) - set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.") - endif (XCODE_VERSION GREATER 4.2) + set(ENABLE_SIGNING TRUE) + set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.") endif (DARWIN) if (LINUX OR DARWIN) - set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs") + if (CMAKE_CXX_COMPILER MATCHES ".*clang") + set(CMAKE_COMPILER_IS_CLANGXX 1) + endif (CMAKE_CXX_COMPILER MATCHES ".*clang") + + if (CMAKE_COMPILER_IS_GNUCXX) + set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs") + elseif (CMAKE_COMPILER_IS_CLANGXX) + set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs") + endif() if (NOT GCC_DISABLE_FATAL_WARNINGS) set(GCC_WARNINGS "${GCC_WARNINGS} -Werror") diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index 876b7f82a8..f95439245a 100755 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -8,7 +8,7 @@ if (USESYSTEMLIBS) pkg_check_modules(VORBISENC REQUIRED vorbisenc) pkg_check_modules(VORBISFILE REQUIRED vorbisfile) else (USESYSTEMLIBS) - use_prebuilt_binary(ogg-vorbis) + use_prebuilt_binary(ogg_vorbis) set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS}) set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS}) diff --git a/indra/cmake/BerkeleyDB.cmake b/indra/cmake/BerkeleyDB.cmake index 5f6b644a15..ee670ac650 100755 --- a/indra/cmake/BerkeleyDB.cmake +++ b/indra/cmake/BerkeleyDB.cmake @@ -1,5 +1,5 @@ # -*- cmake -*- - +include(Prebuilt) set(DB_FIND_QUIETLY ON) set(DB_FIND_REQUIRED ON) diff --git a/indra/cmake/BuildPackagesInfo.cmake b/indra/cmake/BuildPackagesInfo.cmake new file mode 100644 index 0000000000..0f574ee39a --- /dev/null +++ b/indra/cmake/BuildPackagesInfo.cmake @@ -0,0 +1,10 @@ +# -*- cmake -*- +# Construct the version and copyright information based on package data. +include(Python) + +add_custom_command(OUTPUT packages-info.txt + COMMENT Generating packages-info.txt for the about box + MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/../autobuild.xml + DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py > packages-info.txt + ) diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 9abdb4b146..cd7da5d6c1 100755 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -23,7 +23,7 @@ set(cmake_SOURCE_FILES DirectX.cmake DragDrop.cmake EXPAT.cmake - ExamplePlugin.cmake +## ExamplePlugin.cmake FindAPR.cmake FindAutobuild.cmake FindBerkeleyDB.cmake @@ -45,9 +45,9 @@ set(cmake_SOURCE_FILES GLEXT.cmake GLH.cmake GLOD.cmake - GStreamer010Plugin.cmake +## GStreamer010Plugin.cmake GetPrerequisites_2_8.cmake - Glui.cmake +## Glui.cmake Glut.cmake GoogleBreakpad.cmake GoogleMock.cmake @@ -82,18 +82,18 @@ set(cmake_SOURCE_FILES LLXML.cmake LScript.cmake Linking.cmake - MediaPluginBase.cmake +## MediaPluginBase.cmake NDOF.cmake OPENAL.cmake OpenGL.cmake OpenJPEG.cmake OpenSSL.cmake PNG.cmake - PluginAPI.cmake +## PluginAPI.cmake Prebuilt.cmake PulseAudio.cmake Python.cmake - QuickTimePlugin.cmake +## QuickTimePlugin.cmake TemplateCheck.cmake Tut.cmake UI.cmake @@ -102,7 +102,7 @@ set(cmake_SOURCE_FILES Variables.cmake ViewerMiscLibs.cmake VisualLeakDetector.cmake - WebKitLibPlugin.cmake +## WebKitLibPlugin.cmake XmlRpcEpi.cmake ZLIB.cmake ) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 28202f85d6..84947adaae 100755 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -66,126 +66,80 @@ if(WINDOWS) set(release_files ${release_files} fmodex.dll) endif (FMODEX) -#******************************* -# Copy MS C runtime dlls, required for packaging. -# *TODO - Adapt this to support VC9 -if (MSVC80) - FIND_PATH(debug_msvc8_redist_path msvcr80d.dll - PATHS - ${MSVC_DEBUG_REDIST_PATH} - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT - NO_DEFAULT_PATH - NO_DEFAULT_PATH - ) - - if(EXISTS ${debug_msvc8_redist_path}) - set(debug_msvc8_files - msvcr80d.dll - msvcp80d.dll - Microsoft.VC80.DebugCRT.manifest - ) - - copy_if_different( - ${debug_msvc8_redist_path} - "${SHARED_LIB_STAGING_DIR_DEBUG}" - out_targets - ${debug_msvc8_files} - ) - set(third_party_targets ${third_party_targets} ${out_targets}) - - endif (EXISTS ${debug_msvc8_redist_path}) - - FIND_PATH(release_msvc8_redist_path msvcr80.dll - PATHS - ${MSVC_REDIST_PATH} - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT - NO_DEFAULT_PATH - NO_DEFAULT_PATH - ) - - if(EXISTS ${release_msvc8_redist_path}) - set(release_msvc8_files - msvcr80.dll - msvcp80.dll - Microsoft.VC80.CRT.manifest - ) - - copy_if_different( - ${release_msvc8_redist_path} - "${SHARED_LIB_STAGING_DIR_RELEASE}" - out_targets - ${release_msvc8_files} - ) - set(third_party_targets ${third_party_targets} ${out_targets}) - - copy_if_different( - ${release_msvc8_redist_path} - "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" - out_targets - ${release_msvc8_files} - ) - set(third_party_targets ${third_party_targets} ${out_targets}) - - endif (EXISTS ${release_msvc8_redist_path}) -elseif (MSVC_VERSION EQUAL 1600) # VisualStudio 2010 - FIND_PATH(debug_msvc10_redist_path msvcr100d.dll + #******************************* + # Copy MS C runtime dlls, required for packaging. + # *TODO - Adapt this to support VC9 + if (MSVC80) + set(MSVC_VER 80) + set(MSVC_VERDOT 8.0) + elseif (MSVC_VERSION EQUAL 1600) # VisualStudio 2010 + set(MSVC_VER 100) + set(MSVC_VERDOT 10.0) + elseif (MSVC_VERSION EQUAL 1800) # VisualStudio 2013, which is (sigh) VS 12 + set(MSVC_VER 120) + set(MSVC_VERDOT 12.0) + else (MSVC80) + MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake") + endif (MSVC80) + + FIND_PATH(debug_msvc_redist_path msvcr${MSVC_VER}d.dll PATHS ${MSVC_DEBUG_REDIST_PATH} - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC100.DebugCRT + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_VERDOT}\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC${MSVC_VER}.DebugCRT [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64 [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32 NO_DEFAULT_PATH ) - if(EXISTS ${debug_msvc10_redist_path}) - set(debug_msvc10_files - msvcr100d.dll - msvcp100d.dll + if(EXISTS ${debug_msvc_redist_path}) + set(debug_msvc_files + msvcr${MSVC_VER}d.dll + msvcp${MSVC_VER}d.dll ) copy_if_different( - ${debug_msvc10_redist_path} + ${debug_msvc_redist_path} "${SHARED_LIB_STAGING_DIR_DEBUG}" out_targets - ${debug_msvc10_files} + ${debug_msvc_files} ) set(third_party_targets ${third_party_targets} ${out_targets}) endif () - FIND_PATH(release_msvc10_redist_path msvcr100.dll + FIND_PATH(release_msvc_redist_path msvcr${MSVC_VER}.dll PATHS ${MSVC_REDIST_PATH} - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC100.CRT + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_VERDOT}\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC${MSVC_VER}.CRT [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64 [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32 NO_DEFAULT_PATH ) - if(EXISTS ${release_msvc10_redist_path}) - set(release_msvc10_files - msvcr100.dll - msvcp100.dll + if(EXISTS ${release_msvc_redist_path}) + set(release_msvc_files + msvcr${MSVC_VER}.dll + msvcp${MSVC_VER}.dll ) copy_if_different( - ${release_msvc10_redist_path} + ${release_msvc_redist_path} "${SHARED_LIB_STAGING_DIR_RELEASE}" out_targets - ${release_msvc10_files} + ${release_msvc_files} ) set(third_party_targets ${third_party_targets} ${out_targets}) copy_if_different( - ${release_msvc10_redist_path} + ${release_msvc_redist_path} "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" out_targets - ${release_msvc10_files} + ${release_msvc_files} ) set(third_party_targets ${third_party_targets} ${out_targets}) endif () -endif (MSVC80) + elseif(DARWIN) set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources") diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake index d148a35a5b..5e46b6711a 100755 --- a/indra/cmake/DBusGlib.cmake +++ b/indra/cmake/DBusGlib.cmake @@ -7,7 +7,7 @@ if (USESYSTEMLIBS) pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1) elseif (LINUX) - use_prebuilt_binary(dbusglib) + use_prebuilt_binary(dbus_glib) set(DBUSGLIB_FOUND ON FORCE BOOL) set(DBUSGLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/dbus diff --git a/indra/cmake/FindAutobuild.cmake b/indra/cmake/FindAutobuild.cmake index 4b5fd484ae..ea5ad6d108 100755 --- a/indra/cmake/FindAutobuild.cmake +++ b/indra/cmake/FindAutobuild.cmake @@ -4,14 +4,18 @@ # # Output variables: # -# AUTOBUILD_EXECUTABLE - path to autobuild or pautobuild executable +# AUTOBUILD_EXECUTABLE - path to autobuild executable + -# *TODO - if cmake was executed by autobuild, autobuild will have set the AUTOBUILD env var -# update this to check for that case IF (NOT AUTOBUILD_EXECUTABLE) + + # If cmake was executed by autobuild, autobuild will have set the AUTOBUILD env var + IF (DEFINED ENV{AUTOBUILD}) + SET(AUTOBUILD_EXECUTABLE $ENV{AUTOBUILD}) + ELSE (DEFINED ENV{AUTOBUILD}) IF(WIN32) - SET(AUTOBUILD_EXE_NAMES autobuild.cmd autobuild.exe) + SET(AUTOBUILD_EXE_NAMES autobuild.exe autobuild.cmd) ELSE(WIN32) SET(AUTOBUILD_EXE_NAMES autobuild) ENDIF(WIN32) @@ -21,21 +25,19 @@ IF (NOT AUTOBUILD_EXECUTABLE) AUTOBUILD_EXECUTABLE NAMES ${AUTOBUILD_EXE_NAMES} PATHS - ENV PATH - ${CMAKE_SOURCE_DIR}/.. - ${CMAKE_SOURCE_DIR}/../.. - ${CMAKE_SOURCE_DIR}/../../.. + ENV PATH + ${CMAKE_SOURCE_DIR}/.. + ${CMAKE_SOURCE_DIR}/../.. + ${CMAKE_SOURCE_DIR}/../../.. PATH_SUFFIXES "/autobuild/bin/" ) + ENDIF (DEFINED ENV{AUTOBUILD}) - IF (AUTOBUILD_EXECUTABLE) - GET_FILENAME_COMPONENT(_autobuild_name ${AUTOBUILD_EXECUTABLE} NAME_WE) - MESSAGE(STATUS "Using autobuild at: ${AUTOBUILD_EXECUTABLE}") - ELSE (AUTOBUILD_EXECUTABLE) - IF (AUTOBUILD_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find autobuild executable") - ENDIF (AUTOBUILD_FIND_REQUIRED) - ENDIF (AUTOBUILD_EXECUTABLE) + IF (NOT AUTOBUILD_EXECUTABLE) + IF (AUTOBUILD_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find autobuild executable") + ENDIF (AUTOBUILD_FIND_REQUIRED) + ENDIF (NOT AUTOBUILD_EXECUTABLE) - MARK_AS_ADVANCED(AUTOBUILD_EXECUTABLE) + MARK_AS_ADVANCED(AUTOBUILD_EXECUTABLE) ENDIF (NOT AUTOBUILD_EXECUTABLE) diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake index a749644202..2a08c8fbae 100644 --- a/indra/cmake/GLEXT.cmake +++ b/indra/cmake/GLEXT.cmake @@ -2,7 +2,9 @@ include(Prebuilt) if (NOT USESYSTEMLIBS) - use_prebuilt_binary(glext) - use_prebuilt_binary(glh_linear) + if (WINDOWS OR LINUX) + use_prebuilt_binary(glext) + endif (WINDOWS OR LINUX) + use_prebuilt_binary(glh-linear) set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) endif (NOT USESYSTEMLIBS) diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index d5262f2efa..d0992f57b8 100755 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -7,5 +7,5 @@ set(GLH_FIND_QUIETLY TRUE) if (USESYSTEMLIBS) include(FindGLH) else (USESYSTEMLIBS) - use_prebuilt_binary(glh_linear) + use_prebuilt_binary(glh-linear) endif (USESYSTEMLIBS) diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake index 3683768af9..a347eb6fee 100755 --- a/indra/cmake/GLOD.cmake +++ b/indra/cmake/GLOD.cmake @@ -2,7 +2,7 @@ include(Prebuilt) if (NOT USESYSTEMLIBS) - use_prebuilt_binary(GLOD) + use_prebuilt_binary(glod) endif (NOT USESYSTEMLIBS) set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index cac072988e..5a00546927 100755 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -2,20 +2,20 @@ include(Prebuilt) include(Linking) -use_prebuilt_binary(gmock) +use_prebuilt_binary(googlemock) -set(GOOGLEMOCK_INCLUDE_DIRS +set(GOOGLEMOCK_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) if (LINUX) # VWR-24366: gmock is underlinked, it needs gtest. - set(GOOGLEMOCK_LIBRARIES + set(GOOGLEMOCK_LIBRARIES gmock -Wl,--no-as-needed gtest -Wl,--as-needed) elseif(WINDOWS) - set(GOOGLEMOCK_LIBRARIES + set(GOOGLEMOCK_LIBRARIES gmock) - set(GOOGLEMOCK_INCLUDE_DIRS + set(GOOGLEMOCK_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include ${LIBS_PREBUILT_DIR}/include/gmock ${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1) diff --git a/indra/cmake/Havok.cmake b/indra/cmake/Havok.cmake index 8b7f01d20b..99e7334118 100755 --- a/indra/cmake/Havok.cmake +++ b/indra/cmake/Havok.cmake @@ -1,5 +1,5 @@ # -*- cmake -*- - +include(Prebuilt) if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") @@ -61,14 +61,14 @@ foreach(HAVOK_LIB ${HAVOK_LIBS}) set(relwithdebinfo_dir "${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}/${HAVOK_LIB}") # Try to avoid extracting havok library each time we run cmake. - if("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted") - file(READ ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted "havok_${HAVOK_LIB}_extracted") + if("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted") + file(READ ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted "havok_${HAVOK_LIB}_extracted") if(DEBUG_PREBUILT) message(STATUS "havok_${HAVOK_LIB}_extracted: \"${havok_${HAVOK_LIB}_extracted}\"") endif(DEBUG_PREBUILT) - endif("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted") + endif("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted") - if(${CMAKE_BINARY_DIR}/temp/havok-source_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0) + if(${PREBUILD_TRACKING_DIR}/havok_source_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0) if(DEBUG_PREBUILT) MESSAGE(STATUS "Extracting ${HAVOK_LIB}...") endif(DEBUG_PREBUILT) @@ -109,9 +109,9 @@ foreach(HAVOK_LIB ${HAVOK_LIBS}) # Just assume success for now. set(havok_${HAVOK_LIB}_extracted 0) - file(WRITE ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted "${havok_${HAVOK_LIB}_extracted}") + file(WRITE ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted "${havok_${HAVOK_LIB}_extracted}") - endif(${CMAKE_BINARY_DIR}/temp/havok-source_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0) + endif(${PREBUILD_TRACKING_DIR}/havok_source_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0) file(GLOB extracted_debug "${debug_dir}/*.o") file(GLOB extracted_release "${release_dir}/*.o") diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake index 0aab2d6634..079619adf8 100755 --- a/indra/cmake/JsonCpp.cmake +++ b/indra/cmake/JsonCpp.cmake @@ -11,10 +11,10 @@ else (USESYSTEMLIBS) use_prebuilt_binary(jsoncpp) if (WINDOWS) set(JSONCPP_LIBRARIES - debug json_vc100debug_libmt.lib - optimized json_vc100_libmt) + debug json_libmdd.lib + optimized json_libmd.lib) elseif (DARWIN) - set(JSONCPP_LIBRARIES libjson_linux-gcc-4.0.1_libmt.a) + set(JSONCPP_LIBRARIES libjson_darwin_libmt.a) elseif (LINUX) set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a) endif (WINDOWS) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 804624f5ec..ac5c5c6a2a 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -137,7 +137,7 @@ INCLUDE(GoogleMock) # # Setup test targets # - GET_TARGET_PROPERTY(TEST_EXE PROJECT_${project}_TEST_${name} LOCATION) + SET(TEST_EXE $<TARGET_FILE:PROJECT_${project}_TEST_${name}>) SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt) SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR}) @@ -225,7 +225,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST # Create the test running command SET(test_command ${ARGN}) - GET_TARGET_PROPERTY(TEST_EXE INTEGRATION_TEST_${testname} LOCATION) + SET(TEST_EXE $<TARGET_FILE:INTEGRATION_TEST_${testname}>) LIST(FIND test_command "{}" test_exe_pos) IF(test_exe_pos LESS 0) # The {} marker means "the full pathname of the test executable." diff --git a/indra/cmake/LLAppearanceUtility.cmake b/indra/cmake/LLAppearanceUtility.cmake index bea45543de..709b91c134 100644 --- a/indra/cmake/LLAppearanceUtility.cmake +++ b/indra/cmake/LLAppearanceUtility.cmake @@ -4,7 +4,7 @@ include(Prebuilt) # Linux proprietary build only if (INSTALL_PROPRIETARY) if(LINUX) - use_prebuilt_binary(llappearanceutility-source) + use_prebuilt_binary(llappearance_utility) set(LLAPPEARANCEUTILITY_SRC_DIR ${LIBS_PREBUILT_DIR}/llappearanceutility/src) set(LLAPPEARANCEUTILITY_BIN_DIR ${CMAKE_BINARY_DIR}/llappearanceutility) endif (LINUX) diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake index 14dd67f32f..a3c1c871aa 100755 --- a/indra/cmake/LLSharedLibs.cmake +++ b/indra/cmake/LLSharedLibs.cmake @@ -1,7 +1,7 @@ # ll_deploy_sharedlibs_command # target_exe: the cmake target of the executable for which the shared libs will be deployed. macro(ll_deploy_sharedlibs_command target_exe) - get_target_property(TARGET_LOCATION ${target_exe} LOCATION) + set(TARGET_LOCATION $<TARGET_FILE:${target_exe}>) get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH) if(DARWIN) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 74fe3f1137..c95f0c3702 100755 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -6,7 +6,7 @@ set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") include(Variables) set(ARCH_PREBUILT_DIRS ${AUTOBUILD_INSTALL_DIR}/lib) -set(ARCH_PREBUILT_DIRS_PLUGINS ${AUTOBUILD_INSTALL_DIR}/plugins) +##set(ARCH_PREBUILT_DIRS_PLUGINS ${AUTOBUILD_INSTALL_DIR}/plugins) set(ARCH_PREBUILT_DIRS_RELEASE ${AUTOBUILD_INSTALL_DIR}/lib/release) set(ARCH_PREBUILT_DIRS_DEBUG ${AUTOBUILD_INSTALL_DIR}/lib/debug) if (WINDOWS) diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index e72845db53..388df16a52 100755 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -8,7 +8,11 @@ if (NDOF) set(NDOF_FIND_REQUIRED ON) include(FindNDOF) else (USESYSTEMLIBS) - use_prebuilt_binary(ndofdev) + if (WINDOWS OR DARWIN) + use_prebuilt_binary(libndofdev) + elseif (LINUX) + use_prebuilt_binary(open-libndofdev) + endif (WINDOWS OR DARWIN) if (WINDOWS) set(NDOF_LIBRARY libndofdev) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index c084d68de7..1bbfff6f98 100755 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -16,7 +16,7 @@ if (OPENAL) pkg_check_modules(OPENAL_LIB REQUIRED openal) pkg_check_modules(FREEALUT_LIB REQUIRED freealut) else (USESYSTEMLIBS) - use_prebuilt_binary(openal_soft) + use_prebuilt_binary(openal) endif (USESYSTEMLIBS) if(WINDOWS) set(OPENAL_LIBRARIES @@ -30,7 +30,3 @@ if (OPENAL) ) endif() endif (OPENAL) - -if (OPENAL) - message(STATUS "Building with OpenAL audio support") -endif (OPENAL) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index e548805148..98013da2f2 100755 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -8,44 +8,50 @@ if(INSTALL_PROPRIETARY) include(FindSCP) endif(INSTALL_PROPRIETARY) +set(PREBUILD_TRACKING_DIR ${AUTOBUILD_INSTALL_DIR}/cmake_tracking) +# For the library installation process; +# see cmake/Prebuild.cmake for the counterpart code. +if ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING_DIR}/sentinel_installed") + file(MAKE_DIRECTORY ${PREBUILD_TRACKING_DIR}) + file(WRITE ${PREBUILD_TRACKING_DIR}/sentinel_installed "0") +endif ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING_DIR}/sentinel_installed") + # The use_prebuilt_binary macro handles automated installation of package # dependencies using autobuild. The goal is that 'autobuild install' should # only be run when we know we need to install a new package. This should be # the case in a clean checkout, or if autobuild.xml has been updated since the -# last run (encapsulated by the file ${CMAKE_BINARY_DIR}/temp/sentinel_installed), +# last run (encapsulated by the file ${PREBUILD_TRACKING_DIR}/sentinel_installed), # or if a previous attempt to install the package has failed (the exit status # of previous attempts is serialized in the file -# ${CMAKE_BINARY_DIR}/temp/${_binary}_installed) +# ${PREBUILD_TRACKING_DIR}/${_binary}_installed) macro (use_prebuilt_binary _binary) if (NOT DEFINED USESYSTEMLIBS_${_binary}) set(USESYSTEMLIBS_${_binary} ${USESYSTEMLIBS}) endif (NOT DEFINED USESYSTEMLIBS_${_binary}) if (NOT USESYSTEMLIBS_${_binary}) - if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/${_binary}_installed") - file(READ ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${_binary}_installed") + if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed") + file(READ ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${_binary}_installed") if(DEBUG_PREBUILT) message(STATUS "${_binary}_installed: \"${${_binary}_installed}\"") endif(DEBUG_PREBUILT) - endif("${${_binary}_installed}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/${_binary}_installed") + endif("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed") - if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0) + if(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0) if(DEBUG_PREBUILT) message("cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install --install-dir=${AUTOBUILD_INSTALL_DIR} - --skip-license-check ${_binary} ") endif(DEBUG_PREBUILT) execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}" install --install-dir=${AUTOBUILD_INSTALL_DIR} - --skip-license-check ${_binary} WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" RESULT_VARIABLE ${_binary}_installed ) - file(WRITE ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${${_binary}_installed}") - endif(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0) + file(WRITE ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${${_binary}_installed}") + endif(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0) if(NOT ${_binary}_installed EQUAL 0) message(FATAL_ERROR diff --git a/indra/cmake/QuickTimePlugin.cmake b/indra/cmake/QuickTimePlugin.cmake index 012f4e20d8..c08e153ee3 100755 --- a/indra/cmake/QuickTimePlugin.cmake +++ b/indra/cmake/QuickTimePlugin.cmake @@ -2,7 +2,9 @@ if(INSTALL_PROPRIETARY) include(Prebuilt) - use_prebuilt_binary(quicktime) + if (WINDOWS) + use_prebuilt_binary(quicktime) + endif (WINDOWS) endif(INSTALL_PROPRIETARY) if (DARWIN) diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 58acdc22bd..31174209a3 100755 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -32,7 +32,10 @@ if (USESYSTEMLIBS) add_definitions(${${pkg}_CFLAGS_OTHERS}) endforeach(pkg) else (USESYSTEMLIBS) - use_prebuilt_binary(gtk-atk-pango-glib) + if (LINUX OR WINDOWS) + use_prebuilt_binary(gtk-atk-pango-glib) + endif (LINUX OR WINDOWS) + if (LINUX) set(UI_LIBRARIES atk-1.0 diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 963b1bd386..faca12c347 100755 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -26,6 +26,7 @@ set(VIEWER_PREFIX) set(INTEGRATION_TESTS_PREFIX) set(LL_TESTS ON CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation") set(INCREMENTAL_LINK OFF CACHE BOOL "Use incremental linking on win32 builds (enable for faster links on some machines)") +set(ENABLE_MEDIA_PLUGINS OFF CACHE BOOL "Turn off building media plugins if they are imported by third-party library mechanism") if(LIBS_CLOSED_DIR) file(TO_CMAKE_PATH "${LIBS_CLOSED_DIR}" LIBS_CLOSED_DIR) @@ -129,44 +130,25 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(DARWIN 1) - execute_process( - COMMAND sh -c "xcodebuild -version | grep Xcode | cut -d ' ' -f2 | cut -d'.' -f1-2" - OUTPUT_VARIABLE XCODE_VERSION ) - - # To support a different SDK update these Xcode settings: - if (XCODE_VERSION GREATER 4.5) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8) - set(CMAKE_OSX_SYSROOT macosx10.8) - else (XCODE_VERSION GREATER 4.5) - if (XCODE_VERSION GREATER 4.2) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6) - set(CMAKE_OSX_SYSROOT macosx10.7) - else (XCODE_VERSION GREATER 4.2) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6) - set(CMAKE_OSX_SYSROOT macosx10.7) - endif (XCODE_VERSION GREATER 4.2) - endif (XCODE_VERSION GREATER 4.5) - - set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42") + # now we only support Xcode 6.0 using 10.9 (Mavericks), minimum OS 10.7 (Lion) + set(XCODE_VERSION 6.0) + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7) + set(CMAKE_OSX_SYSROOT macosx10.9) + + set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0") + set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL 3) + set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO) + set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH YES) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS ssse3) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++") set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym) - # NOTE: To attempt an i386/PPC Universal build, add this on the configure line: - # -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc' - # Build only for i386 by default, system default on MacOSX 10.6 is x86_64 + # Build only for i386 by default, system default on MacOSX 10.6+ is x86_64 if (NOT CMAKE_OSX_ARCHITECTURES) - set(CMAKE_OSX_ARCHITECTURES i386) + set(CMAKE_OSX_ARCHITECTURES "i386") endif (NOT CMAKE_OSX_ARCHITECTURES) - if (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc") - set(ARCH universal) - else (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc") - if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc") - set(ARCH ppc) - else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc") - set(ARCH i386) - endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc") - endif (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc") - + set(ARCH ${CMAKE_OSX_ARCHITECTURES}) set(LL_ARCH ${ARCH}_darwin) set(LL_ARCH_DIR universal-darwin) set(WORD_SIZE 32) @@ -177,10 +159,8 @@ set(GRID agni CACHE STRING "Target Grid") set(VIEWER_CHANNEL "Second Life Test" CACHE STRING "Viewer Channel Name") -if (XCODE_VERSION GREATER 4.2) - set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer") - set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.") -endif (XCODE_VERSION GREATER 4.2) +set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer") +set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.") set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside") set(USESYSTEMLIBS OFF CACHE BOOL "Use libraries from your system rather than Linden-supplied prebuilt libraries.") diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index d4be24799f..fc5bdedb5a 100755 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -2,9 +2,11 @@ include(Prebuilt) if (NOT USESYSTEMLIBS) + if (LINUX) + use_prebuilt_binary(libuuid) + use_prebuilt_binary(fontconfig) + endif (LINUX) use_prebuilt_binary(libhunspell) - use_prebuilt_binary(libuuid) use_prebuilt_binary(slvoice) - use_prebuilt_binary(fontconfig) endif(NOT USESYSTEMLIBS) diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 3a0caa0a06..8c3790ea89 100755 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -9,7 +9,7 @@ if (USESYSTEMLIBS) else (USESYSTEMLIBS) use_prebuilt_binary(xmlrpc-epi) if (WINDOWS) - set(XMLRPCEPI_LIBRARIES + set(XMLRPCEPI_LIBRARIES debug xmlrpc-epid optimized xmlrpc-epi ) diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py index a2ef61c8fd..582185e5ab 100755 --- a/indra/cmake/run_build_test.py +++ b/indra/cmake/run_build_test.py @@ -46,6 +46,7 @@ $/LicenseInfo$ import os import sys +import errno import signal import subprocess @@ -112,7 +113,23 @@ def main(command, libpath=[], vars={}): print "Running: %s" % " ".join(command) # Make sure we see all relevant output *before* child-process output. sys.stdout.flush() - return subprocess.call(command) + try: + return subprocess.call(command) + except OSError as err: + # If the caller is trying to execute a test program that doesn't + # exist, we want to produce a reasonable error message rather than a + # traceback. This happens when the build is halted by errors, but + # CMake tries to proceed with testing anyway <eyeroll/>. However, do + # NOT attempt to handle any error but "doesn't exist." + if err.errno != errno.ENOENT: + raise + # In practice, the pathnames into CMake's build tree are so long as to + # obscure the name of the test program. Just print its basename. + print "No such program %s; check for preceding build errors" % \ + os.path.basename(command[0]) + # What rc should we simulate for missing executable? Windows produces + # 9009. + return 9009 # swiped from vita, sigh, seems like a Bad Idea to introduce dependency def translate_rc(rc): diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h index 7e712f9e94..3c2c68079c 100644 --- a/indra/llappearance/llpolymorph.h +++ b/indra/llappearance/llpolymorph.h @@ -182,6 +182,16 @@ public: void applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert); void addPendingMorphMask() { mNumMorphMasksPending++; } + void* operator new(size_t size) + { + return ll_aligned_malloc_16(size); + } + + void operator delete(void* ptr) + { + ll_aligned_free_16(ptr); + } + protected: LLPolyMorphTarget(const LLPolyMorphTarget& pOther); diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h index ea2adb8a87..ab1a132d19 100644 --- a/indra/llappearance/llpolyskeletaldistortion.h +++ b/indra/llappearance/llpolyskeletaldistortion.h @@ -73,6 +73,19 @@ public: /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); + + + void* operator new(size_t size) + { + return ll_aligned_malloc_16(size); + } + + void operator delete(void* ptr) + { + ll_aligned_free_16(ptr); + } + + protected: typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t; bone_info_list_t mBoneInfoList; diff --git a/indra/llappearance/lltexturemanagerbridge.h b/indra/llappearance/lltexturemanagerbridge.h index 4b814b522d..101704b162 100644 --- a/indra/llappearance/lltexturemanagerbridge.h +++ b/indra/llappearance/lltexturemanagerbridge.h @@ -35,6 +35,8 @@ class LLTextureManagerBridge { public: + virtual ~LLTextureManagerBridge() {} + virtual LLPointer<LLGLTexture> getLocalTexture(BOOL usemipmaps = TRUE, BOOL generate_gl_tex = TRUE) = 0; virtual LLPointer<LLGLTexture> getLocalTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps, BOOL generate_gl_tex = TRUE) = 0; virtual LLGLTexture* getFetchedTexture(const LLUUID &image_id) = 0; diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 4bce3f99ed..41c06f4368 100755 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -86,10 +86,10 @@ LLAssetType::EType LLWearable::getAssetType() const return LLWearableType::getAssetType(mType); } -BOOL LLWearable::exportFile(LLFILE* fp) const +BOOL LLWearable::exportFile(const std::string& filename) const { - llofstream ofs(fp); - return exportStream(ofs); + llofstream ofs(filename, std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); + return ofs.is_open() && exportStream(ofs); } // virtual @@ -201,10 +201,11 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp) } } -LLWearable::EImportResult LLWearable::importFile(LLFILE* fp, LLAvatarAppearance* avatarp ) +LLWearable::EImportResult LLWearable::importFile(const std::string& filename, + LLAvatarAppearance* avatarp ) { - llifstream ifs(fp); - return importStream(ifs, avatarp); + llifstream ifs(filename, std::ios_base::in | std::ios_base::binary); + return (! ifs.is_open())? FAILURE : importStream(ifs, avatarp); } // virtual diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h index 406fc7e883..875c2932f1 100755 --- a/indra/llappearance/llwearable.h +++ b/indra/llappearance/llwearable.h @@ -81,8 +81,8 @@ public: SUCCESS, BAD_HEADER }; - BOOL exportFile(LLFILE* file) const; - EImportResult importFile(LLFILE* file, LLAvatarAppearance* avatarp ); + BOOL exportFile(const std::string& filename) const; + EImportResult importFile(const std::string& filename, LLAvatarAppearance* avatarp ); virtual BOOL exportStream( std::ostream& output_stream ) const; virtual EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp ); @@ -113,6 +113,9 @@ public: // Update the baked texture hash. virtual void addToBakedTextureHash(LLMD5& hash) const = 0; + typedef std::map<S32, LLVisualParam *> visual_param_index_map_t; + visual_param_index_map_t mVisualParamIndexMap; + protected: typedef std::map<S32, LLLocalTextureObject*> te_map_t; void syncImages(te_map_t &src, te_map_t &dst); @@ -132,9 +135,6 @@ protected: typedef std::map<S32, F32> param_map_t; param_map_t mSavedVisualParamMap; // last saved version of visual params - typedef std::map<S32, LLVisualParam *> visual_param_index_map_t; - visual_param_index_map_t mVisualParamIndexMap; - te_map_t mTEMap; // maps TE to LocalTextureObject te_map_t mSavedTEMap; // last saved version of TEMap }; diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp index cf1ee435a8..5dfb201fc4 100755 --- a/indra/llappearance/llwearabledata.cpp +++ b/indra/llappearance/llwearabledata.cpp @@ -173,8 +173,9 @@ bool LLWearableData::swapWearables(const LLWearableType::EType type, U32 index_a } wearableentry_vec_t& wearable_vec = wearable_iter->second; - if (0 > index_a || index_a >= wearable_vec.size()) return false; - if (0 > index_b || index_b >= wearable_vec.size()) return false; + // removed 0 > index_a and index_b comparisions - can never be true + if (index_a >= wearable_vec.size()) return false; + if (index_b >= wearable_vec.size()) return false; LLWearable* wearable = wearable_vec[index_a]; wearable_vec[index_a] = wearable_vec[index_b]; diff --git a/indra/llappearance/llwearabletype.h b/indra/llappearance/llwearabletype.h index e51e6731d3..7c9594644d 100644 --- a/indra/llappearance/llwearabletype.h +++ b/indra/llappearance/llwearabletype.h @@ -35,6 +35,9 @@ class LLTranslationBridge { public: + // clang needs this to be happy + virtual ~LLTranslationBridge() {} + virtual std::string getString(const std::string &xml_desc) = 0; }; diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index 1b2bdb9888..e943dd5d5c 100755 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -3,7 +3,6 @@ project(llaudio) include(00-Common) -include(Audio) include(LLAudio) include(FMODEX) include(OPENAL) diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index 20a7afc748..77e57b14f5 100755 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -247,8 +247,7 @@ BOOL LLVorbisDecodeState::initDecode() LL_WARNS("AudioEngine") << "Illegal sample count: " << sample_count << LL_ENDL; } - if( size_guess > LLVORBIS_CLIP_REJECT_SIZE || - size_guess < 0) + if( size_guess > LLVORBIS_CLIP_REJECT_SIZE ) { abort_decode = true; LL_WARNS("AudioEngine") << "Illegal sample size: " << size_guess << LL_ENDL; @@ -697,11 +696,3 @@ BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid) LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " no file available" << LL_ENDL; return FALSE; } - -#if LL_DARWIN || LL_LINUX -// HACK: to fool the compiler into not emitting unused warnings. -namespace { - const ov_callbacks callback_array[4] = {OV_CALLBACKS_DEFAULT, OV_CALLBACKS_NOCLOSE, OV_CALLBACKS_STREAMONLY, - OV_CALLBACKS_STREAMONLY_NOCLOSE}; -} -#endif diff --git a/indra/llcharacter/lleditingmotion.cpp b/indra/llcharacter/lleditingmotion.cpp index 36341065ae..f4a37a139a 100755 --- a/indra/llcharacter/lleditingmotion.cpp +++ b/indra/llcharacter/lleditingmotion.cpp @@ -39,8 +39,6 @@ //----------------------------------------------------------------------------- const LLQuaternion EDIT_MOTION_WRIST_ROTATION(F_PI_BY_TWO * 0.7f, LLVector3(1.0f, 0.0f, 0.0f)); const F32 TARGET_LAG_HALF_LIFE = 0.1f; // half-life of IK targeting -const F32 TORSO_LAG_HALF_LIFE = 0.2f; -const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation S32 LLEditingMotion::sHandPose = LLHandMotion::HAND_POSE_RELAXED_R; S32 LLEditingMotion::sHandPosePriority = 3; diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp index d045bca22e..812c4201af 100755 --- a/indra/llcharacter/llheadrotmotion.cpp +++ b/indra/llcharacter/llheadrotmotion.cpp @@ -43,11 +43,8 @@ const F32 TORSO_LAG = 0.35f; // torso rotation factor const F32 NECK_LAG = 0.5f; // neck rotation factor const F32 HEAD_LOOKAT_LAG_HALF_LIFE = 0.15f; // half-life of lookat targeting for head const F32 TORSO_LOOKAT_LAG_HALF_LIFE = 0.27f; // half-life of lookat targeting for torso -const F32 EYE_LOOKAT_LAG_HALF_LIFE = 0.06f; // half-life of lookat targeting for eye const F32 HEAD_ROTATION_CONSTRAINT = F_PI_BY_TWO * 0.8f; // limit angle for head rotation - const F32 MIN_HEAD_LOOKAT_DISTANCE = 0.3f; // minimum distance from head before we turn to look at it -const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation const F32 EYE_JITTER_MIN_TIME = 0.3f; // min amount of time between eye "jitter" motions const F32 EYE_JITTER_MAX_TIME = 2.5f; // max amount of time between eye "jitter" motions const F32 EYE_JITTER_MAX_YAW = 0.08f; // max yaw of eye jitter motion diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 22aa4f1d2f..cd201a65b4 100755 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -902,7 +902,7 @@ void LLKeyframeMotion::deactivateConstraint(JointConstraint *constraintp) constraintp->mSourceVolume->mUpdateXform = FALSE; } - if (!constraintp->mSharedData->mConstraintTargetType == CONSTRAINT_TARGET_TYPE_GROUND) + if (constraintp->mSharedData->mConstraintTargetType != CONSTRAINT_TARGET_TYPE_GROUND) { if (constraintp->mTargetVolume) { @@ -1048,7 +1048,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 LLVector3 source_to_target = target_pos - keyframe_source_pos; - S32 max_iteration_count = llround(clamp_rescale( + S32 max_iteration_count = ll_round(clamp_rescale( mCharacter->getPixelArea(), MAX_PIXEL_AREA_CONSTRAINTS, MIN_PIXEL_AREA_CONSTRAINTS, diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index 7c1fcacf8a..f180702385 100755 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -45,10 +45,7 @@ const F32 TIME_EPSILON = 0.001f; // minumum frame time const F32 MAX_TIME_DELTA = 2.f; // max two seconds a frame for calculating interpolation F32 SPEED_ADJUST_MAX_SEC = 2.f; // maximum adjustment to walk animation playback speed for a second F32 ANIM_SPEED_MAX = 1.5f; // absolute upper limit on animation speed -const F32 DRIFT_COMP_MAX_TOTAL = 0.1f; // maximum drift compensation overall, in any direction -const F32 DRIFT_COMP_MAX_SPEED = 4.f; // speed at which drift compensation total maxes out const F32 MAX_ROLL = 0.6f; -const F32 PELVIS_COMPENSATION_WIEGHT = 0.7f; // proportion of foot drift that is compensated by moving the avatar directly const F32 SPEED_ADJUST_TIME_CONSTANT = 0.1f; // time constant for speed adjustment interpolation //----------------------------------------------------------------------------- diff --git a/indra/llcharacter/lltargetingmotion.cpp b/indra/llcharacter/lltargetingmotion.cpp index 007834b178..69681e4197 100755 --- a/indra/llcharacter/lltargetingmotion.cpp +++ b/indra/llcharacter/lltargetingmotion.cpp @@ -38,9 +38,6 @@ // Constants //----------------------------------------------------------------------------- const F32 TORSO_TARGET_HALF_LIFE = 0.25f; -const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation -const F32 TARGET_PLANE_THRESHOLD_DOT = 0.6f; -const F32 TORSO_ROT_FRACTION = 0.5f; //----------------------------------------------------------------------------- // LLTargetingMotion() diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index debb42fb5f..1459b9ada2 100755 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -306,7 +306,7 @@ if (LL_TESTS) LL_ADD_INTEGRATION_TEST(llunits "" "${test_libs}") LL_ADD_INTEGRATION_TEST(stringize "" "${test_libs}") LL_ADD_INTEGRATION_TEST(lleventdispatcher "" "${test_libs}") - LL_ADD_INTEGRATION_TEST(lleventcoro "" "${test_libs};${BOOST_CONTEXT_LIBRARY};${BOOST_COROUTINE_LIBRARY};${BOOST_SYSTEM_LIBRARY}") + LL_ADD_INTEGRATION_TEST(lleventcoro "" "${test_libs};${BOOST_CONTEXT_LIBRARY};${BOOST_THREAD_LIBRARY};${BOOST_COROUTINE_LIBRARY};${BOOST_SYSTEM_LIBRARY}") LL_ADD_INTEGRATION_TEST(llprocess "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llleap "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llstreamqueue "" "${test_libs}") diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h index 5a95a58d93..3a4b5dad18 100755 --- a/indra/llcommon/llassettype.h +++ b/indra/llcommon/llassettype.h @@ -107,6 +107,9 @@ public: AT_LINK_FOLDER = 25, // Inventory folder link + AT_MARKETPLACE_FOLDER = 26, + // Marketplace folder. Same as an AT_CATEGORY but different display methods. + AT_WIDGET = 40, // UI Widget: this is *not* an inventory asset type, only a viewer side asset (e.g. button, other ui items...) diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 22cd861c72..8119b14887 100755 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -126,7 +126,7 @@ namespace { mFile.close(); } - bool okay() { return mFile; } + bool okay() { return mFile.good(); } virtual void recordMessage(LLError::ELevel level, const std::string& message) diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h index a42af63b65..abbeeaa373 100755 --- a/indra/llcommon/lleventcoro.h +++ b/indra/llcommon/lleventcoro.h @@ -67,7 +67,7 @@ public: LLEventPumpOrPumpName() {} operator LLEventPump& () const { return *mPump; } LLEventPump& getPump() const { return *mPump; } - operator bool() const { return mPump; } + operator bool() const { return bool(mPump); } bool operator!() const { return ! mPump; } private: @@ -102,6 +102,9 @@ LLVoidListener<LISTENER> voidlistener(const LISTENER& listener) namespace LLEventDetail { + /// Implementation for listenerNameForCoro(), see below + LL_COMMON_API std::string listenerNameForCoroImpl(const void* self_id); + /** * waitForEventOn() permits a coroutine to temporarily listen on an * LLEventPump any number of times. We don't really want to have to ask @@ -129,9 +132,6 @@ namespace LLEventDetail return listenerNameForCoroImpl(self.get_id()); } - /// Implementation for listenerNameForCoro() - LL_COMMON_API std::string listenerNameForCoroImpl(const void* self_id); - /** * Implement behavior described for postAndWait()'s @a replyPumpNamePath * parameter: diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp index 259187c52f..304d702979 100755 --- a/indra/llcommon/llfile.cpp +++ b/indra/llcommon/llfile.cpp @@ -807,7 +807,7 @@ std::streamsize llstdio_filebuf::xsgetn(char_type* __s, std::streamsize __n) return __ret; } -std::streamsize llstdio_filebuf::xsputn(char_type* __s, std::streamsize __n) +std::streamsize llstdio_filebuf::xsputn(const char_type* __s, std::streamsize __n) { // Optimization in the always_noconv() case, to be generalized in the // future: when __n is sufficiently large we write directly instead of @@ -919,6 +919,7 @@ llifstream::llifstream(const char* _Filename, #endif +#if llstream_LLFILE // explicit llifstream::llifstream(_Filet *_File, ios_base::openmode _Mode, size_t _Size) : @@ -942,6 +943,7 @@ llifstream::llifstream(int __fd, this->init(&_M_filebuf); } #endif +#endif // llstream_LLFILE bool llifstream::is_open() const { // test if C stream has been opened @@ -1039,6 +1041,7 @@ llofstream::llofstream(const char* _Filename, } #endif +#if llstream_LLFILE // explicit llofstream::llofstream(_Filet *_File, ios_base::openmode _Mode, size_t _Size) : @@ -1062,6 +1065,7 @@ llofstream::llofstream(int __fd, this->init(&_M_filebuf); } #endif +#endif // llstream_LLFILE bool llofstream::is_open() const { // test if C stream has been opened diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h index f56b22bf9a..44a1e42fa5 100755 --- a/indra/llcommon/llfile.h +++ b/indra/llcommon/llfile.h @@ -86,6 +86,12 @@ public: static const char * tmpdir(); }; +// Remove ll[io]fstream support for [LL]FILE*, preparing to remove dependency +// on GNU's standard library. +#if ! defined(llstream_LLFILE) +#define llstream_LLFILE 0 +#endif + /** * @brief Provides a layer of compatibility for C/POSIX. * @@ -188,7 +194,7 @@ protected: /*virtual*/ int sync(); std::streamsize xsgetn(char_type*, std::streamsize); - std::streamsize xsputn(char_type*, std::streamsize); + std::streamsize xsputn(const char_type*, std::streamsize); #endif }; @@ -228,6 +234,7 @@ public: explicit llifstream(const char* _Filename, ios_base::openmode _Mode = ios_base::in); +#if llstream_LLFILE /** * @brief Create a stream using an open c file stream. * @param File An open @c FILE*. @@ -253,6 +260,7 @@ public: //size_t _Size = static_cast<size_t>(BUFSIZ)); size_t _Size = static_cast<size_t>(1)); #endif +#endif // llstream_LLFILE /** * @brief The destructor does nothing. @@ -263,6 +271,7 @@ public: virtual ~llifstream() {} // Members: +#if llstream_LLFILE /** * @brief Accessing the underlying buffer. * @return The current basic_filebuf buffer. @@ -271,6 +280,7 @@ public: */ llstdio_filebuf* rdbuf() const { return const_cast<llstdio_filebuf*>(&_M_filebuf); } +#endif // llstream_LLFILE /** * @brief Wrapper to test for an open file. @@ -340,6 +350,7 @@ public: explicit llofstream(const char* _Filename, ios_base::openmode _Mode = ios_base::out|ios_base::trunc); +#if llstream_LLFILE /** * @brief Create a stream using an open c file stream. * @param File An open @c FILE*. @@ -365,6 +376,7 @@ public: //size_t _Size = static_cast<size_t>(BUFSIZ)); size_t _Size = static_cast<size_t>(1)); #endif +#endif // llstream_LLFILE /** * @brief The destructor does nothing. @@ -375,6 +387,7 @@ public: virtual ~llofstream() {} // Members: +#if llstream_LLFILE /** * @brief Accessing the underlying buffer. * @return The current basic_filebuf buffer. @@ -383,6 +396,7 @@ public: */ llstdio_filebuf* rdbuf() const { return const_cast<llstdio_filebuf*>(&_M_filebuf); } +#endif // llstream_LLFILE /** * @brief Wrapper to test for an open file. diff --git a/indra/llcommon/llframetimer.cpp b/indra/llcommon/llframetimer.cpp index 1af2cb8afd..1e9920746b 100755 --- a/indra/llcommon/llframetimer.cpp +++ b/indra/llcommon/llframetimer.cpp @@ -37,7 +37,6 @@ U64 LLFrameTimer::sTotalTime = 0; F64 LLFrameTimer::sTotalSeconds = 0.0; S32 LLFrameTimer::sFrameCount = 0; U64 LLFrameTimer::sFrameDeltaTime = 0; -const F64 USEC_PER_SECOND = 1000000.0; const F64 USEC_TO_SEC_F64 = 0.000001; // static diff --git a/indra/llcommon/llhash.h b/indra/llcommon/llhash.h index c077ebe93f..4b58e81565 100755 --- a/indra/llcommon/llhash.h +++ b/indra/llcommon/llhash.h @@ -27,26 +27,7 @@ #ifndef LL_LLHASH_H #define LL_LLHASH_H -#include "llpreprocessor.h" // for GCC_VERSION - -#if (LL_WINDOWS) -#include <hash_map> -#include <algorithm> -#elif LL_DARWIN || LL_LINUX -# if GCC_VERSION >= 40300 // gcc 4.3 and up -# include <backward/hashtable.h> -# elif GCC_VERSION >= 30400 // gcc 3.4 and up -# include <ext/hashtable.h> -# elif __GNUC__ >= 3 -# include <ext/stl_hashtable.h> -# else -# include <hashtable.h> -# endif -#elif LL_SOLARIS -#include <ext/hashtable.h> -#else -#error Please define your platform. -#endif +#include <boost/functional/hash.hpp> // Warning - an earlier template-based version of this routine did not do // the correct thing on Windows. Since this is only used to get @@ -55,17 +36,17 @@ inline size_t llhash( const char * value ) { -#if LL_WINDOWS - return stdext::hash_value(value); -#elif ( (defined _STLPORT_VERSION) || ((LL_LINUX) && (__GNUC__ <= 2)) ) - std::hash<const char *> H; - return H(value); -#elif LL_DARWIN || LL_LINUX || LL_SOLARIS - __gnu_cxx::hash<const char *> H; - return H(value); -#else -#error Please define your platform. -#endif + // boost::hash is defined for std::string and for char, but there's no + // special overload for const char*. The lazy approach would be to + // instantiate a std::string and take its hash, but that might be more + // overhead than our callers want. Or we could use boost::hash_range() -- + // but that would require a preliminary pass over the value to determine + // the end iterator. Instead, use boost::hash_combine() to hash individual + // characters. + std::size_t seed = 0; + for ( ; *value; ++value) + boost::hash_combine(seed, *value); + return seed; } #endif diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 7aa87fcd0e..c65b05f610 100755 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -435,7 +435,7 @@ namespace LLInitParam typedef self_t type_value_t; TypeValuesHelper(const std::string& val) - : TypeValuesHelper(val) + : base_t(val) {} void operator ()(const std::string& name) @@ -1123,7 +1123,7 @@ namespace LLInitParam void set(const value_t& val, bool flag_as_provided = true) { named_value_t::clearValueName(); - setValue(val); + named_value_t::setValue(val); setProvided(flag_as_provided); } @@ -1287,7 +1287,7 @@ namespace LLInitParam // assign block contents to this param-that-is-a-block void set(const value_t& val, bool flag_as_provided = true) { - setValue(val); + named_value_t::setValue(val); named_value_t::clearValueName(); setProvided(flag_as_provided); } @@ -2054,7 +2054,7 @@ namespace LLInitParam Optional& operator =(const value_t& val) { - set(val); + super_t::set(val); return *this; } @@ -2084,7 +2084,7 @@ namespace LLInitParam Mandatory& operator =(const value_t& val) { - set(val); + super_t::set(val); return *this; } @@ -2120,7 +2120,7 @@ namespace LLInitParam Multiple& operator =(const container_t& val) { - set(val); + super_t::set(val); return *this; } diff --git a/indra/llcommon/llpredicate.h b/indra/llcommon/llpredicate.h index a0e970a799..e6c56a5711 100644 --- a/indra/llcommon/llpredicate.h +++ b/indra/llcommon/llpredicate.h @@ -139,9 +139,9 @@ namespace LLPredicate Rule() {} - void require(ENUM e) + void require(ENUM e, bool match) { - mRule.set(e, require); + mRule.set(e, match); } void allow(ENUM e) diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index 309165da7f..2c4bcc91f6 100755 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -101,6 +101,11 @@ #endif +#if LL_WINDOWS +# define LL_THREAD_LOCAL __declspec(thread) +#else +# define LL_THREAD_LOCAL __thread +#endif // Static linking with apr on windows needs to be declared. #if LL_WINDOWS && !LL_COMMON_LINK_SHARED diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index 69043dc173..e3e1d0c391 100755 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -204,21 +204,6 @@ namespace return "Unknown"; } - std::string compute_CPUFamilyName(const char* cpu_vendor, int composed_family) - { - const char* intel_string = "GenuineIntel"; - const char* amd_string = "AuthenticAMD"; - if(!strncmp(cpu_vendor, intel_string, strlen(intel_string))) - { - return intel_CPUFamilyName(composed_family); - } - else if(!strncmp(cpu_vendor, amd_string, strlen(amd_string))) - { - return amd_CPUFamilyName(composed_family); - } - return "Unknown"; - } - std::string compute_CPUFamilyName(const char* cpu_vendor, int family, int ext_family) { const char* intel_string = "GenuineIntel"; @@ -793,7 +778,7 @@ private: setInfo(eFamily, family); } - setInfo(eFamilyName, compute_CPUFamilyName(cpuinfo["vendor_id"].c_str(), family)); + setInfo(eFamilyName, compute_CPUFamilyName(cpuinfo["vendor_id"].c_str(), family, 0)); // setInfo(eExtendedModel, getSysctlInt("machdep.cpu.extmodel")); // setInfo(eBrandID, getSysctlInt("machdep.cpu.brand")); diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index 72011d04a0..3836a9b5fb 100755 --- a/indra/llcommon/llrefcount.h +++ b/indra/llcommon/llrefcount.h @@ -151,29 +151,25 @@ private: * intrusive pointer support for LLThreadSafeRefCount * this allows you to use boost::intrusive_ptr with any LLThreadSafeRefCount-derived type */ -namespace boost -{ - inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p) - { - p->ref(); - } - - inline void intrusive_ptr_release(LLThreadSafeRefCount* p) - { - p->unref(); - } - inline void intrusive_ptr_add_ref(LLRefCount* p) - { - p->ref(); - } +inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p) +{ + p->ref(); +} - inline void intrusive_ptr_release(LLRefCount* p) - { - p->unref(); - } -}; +inline void intrusive_ptr_release(LLThreadSafeRefCount* p) +{ + p->unref(); +} +inline void intrusive_ptr_add_ref(LLRefCount* p) +{ + p->ref(); +} +inline void intrusive_ptr_release(LLRefCount* p) +{ + p->unref(); +} #endif diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index d8bbb3a74f..57aa7d9c07 100755 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -789,10 +789,7 @@ namespace { inline LLSD::Impl& safe(LLSD::Impl* impl) { return LLSD::Impl::safe(impl); } - - inline const LLSD::Impl& safe(const LLSD::Impl* impl) - { return LLSD::Impl::safe(impl); } - + inline ImplMap& makeMap(LLSD::Impl*& var) { return safe(var).makeMap(var); } diff --git a/indra/llcommon/llsdparam.h b/indra/llcommon/llsdparam.h index 1542f95e68..09f1bdf1e3 100755 --- a/indra/llcommon/llsdparam.h +++ b/indra/llcommon/llsdparam.h @@ -106,7 +106,6 @@ private: Parser::name_stack_t mNameStack; const LLSD* mCurReadSD; LLSD* mWriteRootSD; - LLSD* mCurWriteSD; }; diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index 562fd26658..6ad4a97149 100755 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -572,7 +572,7 @@ std::string llsd_matches(const LLSD& prototype, const LLSD& data, const std::str return match_types(prototype.type(), TypeVector(), data.type(), pfx); } -bool llsd_equals(const LLSD& lhs, const LLSD& rhs, unsigned bits) +bool llsd_equals(const LLSD& lhs, const LLSD& rhs, int bits) { // We're comparing strict equality of LLSD representation rather than // performing any conversions. So if the types aren't equal, the LLSD diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h index d0b536c39a..99cb79aa54 100755 --- a/indra/llcommon/llsdutil.h +++ b/indra/llcommon/llsdutil.h @@ -126,7 +126,7 @@ LL_COMMON_API std::string llsd_matches(const LLSD& prototype, const LLSD& data, /// Deep equality. If you want to compare LLSD::Real values for approximate /// equality rather than bitwise equality, pass @a bits as for /// is_approx_equal_fraction(). -LL_COMMON_API bool llsd_equals(const LLSD& lhs, const LLSD& rhs, unsigned bits=-1); +LL_COMMON_API bool llsd_equals(const LLSD& lhs, const LLSD& rhs, int bits=-1); // Simple function to copy data out of input & output iterators if // there is no need for casting. diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 76979f29f6..617969ab2a 100755 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -1397,7 +1397,7 @@ void LLStringUtilBase<T>::testHarness() s2.erase( 4, 1 ); llassert( s2 == "hell"); - s2.insert( 0, 'y' ); + s2.insert( 0, "y" ); llassert( s2 == "yhell"); s2.erase( 1, 3 ); llassert( s2 == "yl"); diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 06e118aa44..1a66612e87 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -99,8 +99,6 @@ const char MEMINFO_FILE[] = "/proc/meminfo"; extern int errno; #endif - -static const S32 CPUINFO_BUFFER_SIZE = 16383; LLCPUInfo gSysCPU; // Don't log memory info any more often than this. It also serves as our @@ -672,8 +670,6 @@ const std::string& LLOSInfo::getOSVersionString() const return mOSVersionString; } -const S32 STATUS_SIZE = 8192; - //static U32 LLOSInfo::getProcessVirtualSizeKB() { @@ -681,6 +677,7 @@ U32 LLOSInfo::getProcessVirtualSizeKB() #if LL_WINDOWS #endif #if LL_LINUX +# define STATUS_SIZE 2048 LLFILE* status_filep = LLFile::fopen("/proc/self/status", "rb"); if (status_filep) { diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 51c89e1eaf..c3f235c6ee 100755 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -92,13 +92,7 @@ void set_thread_name( DWORD dwThreadID, const char* threadName) // //---------------------------------------------------------------------------- -#if LL_DARWIN -// statically allocated thread local storage not supported in Darwin executable formats -#elif LL_WINDOWS -U32 __declspec(thread) sThreadID = 0; -#elif LL_LINUX -U32 __thread sThreadID = 0; -#endif +U32 LL_THREAD_LOCAL sThreadID = 0; U32 LLThread::sIDIter = 0; @@ -115,9 +109,7 @@ LL_COMMON_API void assert_main_thread() void LLThread::registerThreadID() { -#if !LL_DARWIN sThreadID = ++sIDIter; -#endif } // @@ -134,9 +126,7 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap // for now, hard code all LLThreads to report to single master thread recorder, which is known to be running on main thread threadp->mRecorder = new LLTrace::ThreadRecorder(*LLTrace::get_master_thread_recorder()); -#if !LL_DARWIN sThreadID = threadp->mID; -#endif // Run the user supplied function threadp->run(); @@ -347,13 +337,7 @@ void LLThread::setQuitting() // static U32 LLThread::currentID() { -#if LL_DARWIN - // statically allocated thread local storage not supported in Darwin executable formats - return (U32)apr_os_thread_current(); -#else return sThreadID; -#endif - } // static diff --git a/indra/llcommon/llthreadlocalstorage.h b/indra/llcommon/llthreadlocalstorage.h index ec3b52c8cb..3b5786023f 100644 --- a/indra/llcommon/llthreadlocalstorage.h +++ b/indra/llcommon/llthreadlocalstorage.h @@ -130,56 +130,19 @@ class LLThreadLocalSingletonPointer public: LL_FORCE_INLINE static DERIVED_TYPE* getInstance() { -#if LL_DARWIN - createTLSKey(); - return (DERIVED_TYPE*)pthread_getspecific(sInstanceKey); -#else return sInstance; -#endif } static void setInstance(DERIVED_TYPE* instance) { -#if LL_DARWIN - createTLSKey(); - pthread_setspecific(sInstanceKey, (void*)instance); -#else sInstance = instance; -#endif } private: - -#if LL_WINDOWS - static __declspec(thread) DERIVED_TYPE* sInstance; -#elif LL_LINUX - static __thread DERIVED_TYPE* sInstance; -#elif LL_DARWIN - static void TLSError() - { - LL_ERRS() << "Could not create thread local storage" << LL_ENDL; - } - static void createTLSKey() - { - static S32 key_created = pthread_key_create(&sInstanceKey, NULL); - if (key_created != 0) - { - LL_ERRS() << "Could not create thread local storage" << LL_ENDL; - } - } - static pthread_key_t sInstanceKey; -#endif + static LL_THREAD_LOCAL DERIVED_TYPE* sInstance; }; -#if LL_WINDOWS -template<typename DERIVED_TYPE> -__declspec(thread) DERIVED_TYPE* LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstance = NULL; -#elif LL_LINUX -template<typename DERIVED_TYPE> -__thread DERIVED_TYPE* LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstance = NULL; -#elif LL_DARWIN template<typename DERIVED_TYPE> -pthread_key_t LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstanceKey; -#endif +LL_THREAD_LOCAL DERIVED_TYPE* LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstance = NULL; #endif // LL_LLTHREADLOCALSTORAGE_H diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index ab105a82e6..76e892212a 100755 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -39,14 +39,10 @@ # error "architecture not supported" #endif - // // Locally used constants // -const F64 SEC_TO_MICROSEC = 1000000.f; const U64 SEC_TO_MICROSEC_U64 = 1000000; -const F64 USEC_TO_SEC_F64 = 0.000001; - //--------------------------------------------------------------------------- // Globals and statics diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h index 42fad8a793..6f27b97dff 100644 --- a/indra/llcommon/lltraceaccumulators.h +++ b/indra/llcommon/lltraceaccumulators.h @@ -62,11 +62,11 @@ namespace LLTrace {} public: - - AccumulatorBuffer(const AccumulatorBuffer& other = *getDefaultBuffer()) - : mStorageSize(0), + AccumulatorBuffer() + : mStorageSize(0), mStorage(NULL) { + const AccumulatorBuffer& other = *getDefaultBuffer(); resize(sNextStorageSlot); for (S32 i = 0; i < sNextStorageSlot; i++) { @@ -93,6 +93,18 @@ namespace LLTrace return mStorage[index]; } + + AccumulatorBuffer(const AccumulatorBuffer& other) + : mStorageSize(0), + mStorage(NULL) + { + resize(sNextStorageSlot); + for (S32 i = 0; i < sNextStorageSlot; i++) + { + mStorage[i] = other.mStorage[i]; + } + } + void addSamples(const AccumulatorBuffer<ACCUMULATOR>& other, EBufferAppendType append_type) { llassert(mStorageSize >= sNextStorageSlot && other.mStorageSize >= sNextStorageSlot); diff --git a/indra/llcommon/llunittype.h b/indra/llcommon/llunittype.h index 0e05ecd683..ac8504ca61 100644 --- a/indra/llcommon/llunittype.h +++ b/indra/llcommon/llunittype.h @@ -87,6 +87,40 @@ struct LLUnit : mValue(value) {} + + LL_FORCE_INLINE static self_t convert(self_t v) + { + return v; + } + + template<typename FROM_STORAGE_TYPE> + LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, UNITS> v) + { + self_t result; + result.mValue = (STORAGE_TYPE)v.value(); + return result; + } + + template<typename FROM_UNITS> + LL_FORCE_INLINE static self_t convert(LLUnit<STORAGE_TYPE, FROM_UNITS> v) + { + self_t result; + STORAGE_TYPE divisor = ll_convert_units(v, result); + result.mValue /= divisor; + return result; + } + + template<typename FROM_STORAGE_TYPE, typename FROM_UNITS> + LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, FROM_UNITS> v) + { + typedef typename LLResultTypePromote<FROM_STORAGE_TYPE, STORAGE_TYPE>::type_t result_storage_t; + LLUnit<result_storage_t, UNITS> result; + result_storage_t divisor = ll_convert_units(v, result); + result.value(result.value() / divisor); + return self_t(result.value()); + } + + // unit initialization and conversion template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE LLUnit(LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) @@ -183,38 +217,6 @@ struct LLUnit return mValue >= convert(other).value(); } - LL_FORCE_INLINE static self_t convert(self_t v) - { - return v; - } - - template<typename FROM_STORAGE_TYPE> - LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, UNITS> v) - { - self_t result; - result.mValue = (STORAGE_TYPE)v.value(); - return result; - } - - template<typename FROM_UNITS> - LL_FORCE_INLINE static self_t convert(LLUnit<STORAGE_TYPE, FROM_UNITS> v) - { - self_t result; - STORAGE_TYPE divisor = ll_convert_units(v, result); - result.mValue /= divisor; - return result; - } - - template<typename FROM_STORAGE_TYPE, typename FROM_UNITS> - LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, FROM_UNITS> v) - { - typedef typename LLResultTypePromote<FROM_STORAGE_TYPE, STORAGE_TYPE>::type_t result_storage_t; - LLUnit<result_storage_t, UNITS> result; - result_storage_t divisor = ll_convert_units(v, result); - result.value(result.value() / divisor); - return self_t(result.value()); - } - protected: storage_t mValue; }; @@ -269,7 +271,7 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS> template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE void operator += (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) { - base_t::mValue += convert(other).value(); + base_t::mValue += base_t::convert(other).value(); } using base_t::operator -=; @@ -283,19 +285,19 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS> template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE void operator -= (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) { - base_t::mValue -= convert(other).value(); + base_t::mValue -= base_t::convert(other).value(); } template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE bool operator == (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const { - return base_t::mValue == convert(other).value(); + return base_t::mValue == base_t::convert(other).value(); } template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE bool operator == (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const { - return base_t::mValue == convert(other).value(); + return base_t::mValue == base_t::convert(other).value(); } template<typename STORAGE_T> @@ -313,7 +315,7 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS> template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE bool operator != (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const { - return base_t::mValue != convert(other).value(); + return base_t::mValue != base_t::convert(other).value(); } template<typename STORAGE_T> @@ -325,13 +327,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS> template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE bool operator < (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const { - return base_t::mValue < convert(other).value(); + return base_t::mValue < base_t::convert(other).value(); } template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE bool operator < (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const { - return base_t::mValue < convert(other).value(); + return base_t::mValue < base_t::convert(other).value(); } template<typename STORAGE_T> @@ -343,13 +345,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS> template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE bool operator <= (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const { - return base_t::mValue <= convert(other).value(); + return base_t::mValue <= base_t::convert(other).value(); } template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE bool operator <= (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const { - return base_t::mValue <= convert(other).value(); + return base_t::mValue <= base_t::convert(other).value(); } template<typename STORAGE_T> @@ -361,13 +363,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS> template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE bool operator > (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const { - return base_t::mValue > convert(other).value(); + return base_t::mValue > base_t::convert(other).value(); } template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE bool operator > (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const { - return base_t::mValue > convert(other).value(); + return base_t::mValue > base_t::convert(other).value(); } template<typename STORAGE_T> @@ -379,13 +381,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS> template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE bool operator >= (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const { - return base_t::mValue >= convert(other).value(); + return base_t::mValue >= base_t::convert(other).value(); } template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS> LL_FORCE_INLINE bool operator >= (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const { - return base_t::mValue >= convert(other).value(); + return base_t::mValue >= base_t::convert(other).value(); } template<typename STORAGE_T> diff --git a/indra/llcommon/stringize.h b/indra/llcommon/stringize.h index 2df008febb..a5a90d7297 100755 --- a/indra/llcommon/stringize.h +++ b/indra/llcommon/stringize.h @@ -30,7 +30,7 @@ #define LL_STRINGIZE_H #include <sstream> -#include <boost/lambda/lambda.hpp> +#include <boost/phoenix/phoenix.hpp> #include <llstring.h> /** @@ -108,7 +108,7 @@ std::string stringize_f(Functor const & f) * return out.str(); * @endcode */ -#define STRINGIZE(EXPRESSION) (stringize_f(boost::lambda::_1 << EXPRESSION)) +#define STRINGIZE(EXPRESSION) (stringize_f(boost::phoenix::placeholders::arg1 << EXPRESSION)) /** @@ -144,7 +144,7 @@ void destringize_f(std::string const & str, Functor const & f) * in >> item1 >> item2 >> item3 ... ; * @endcode */ -#define DESTRINGIZE(STR, EXPRESSION) (destringize_f((STR), (boost::lambda::_1 >> EXPRESSION))) +#define DESTRINGIZE(STR, EXPRESSION) (destringize_f((STR), (boost::phoenix::placeholders::arg1 >> EXPRESSION))) #endif /* ! defined(LL_STRINGIZE_H) */ diff --git a/indra/llcommon/tests/lldependencies_test.cpp b/indra/llcommon/tests/lldependencies_test.cpp index 5395d785b6..b5e189a465 100755 --- a/indra/llcommon/tests/lldependencies_test.cpp +++ b/indra/llcommon/tests/lldependencies_test.cpp @@ -37,29 +37,14 @@ // associated header #include "../lldependencies.h" // other Linden headers -#include "../test/lltut.h" - -using boost::assign::list_of; #if LL_WINDOWS #pragma warning (disable : 4675) // "resolved by ADL" -- just as I want! #endif -typedef LLDependencies<> StringDeps; -typedef StringDeps::KeyList StringList; - -// We use the very cool boost::assign::list_of() construct to specify vectors -// of strings inline. For reasons on which I'm not entirely clear, though, it -// needs a helper function. You can use list_of() to construct an implicit -// StringList (std::vector<std::string>) by conversion, e.g. for a function -// parameter -- but if you simply write StringList(list_of("etc.")), you get -// ambiguity errors. Shrug! -template<typename CONTAINER> -CONTAINER make(const CONTAINER& data) -{ - return data; -} - +/***************************************************************************** +* Display helpers: must be defined BEFORE lltut.h! +*****************************************************************************/ // Display an arbitary value as itself... template<typename T> std::ostream& display(std::ostream& out, const T& value) @@ -113,6 +98,31 @@ std::ostream& operator<<(std::ostream& out, const std::set<ENTRY>& set) return out; } +/***************************************************************************** +* Now we can #include lltut.h +*****************************************************************************/ +#include "../test/lltut.h" + +/***************************************************************************** +* Other helpers +*****************************************************************************/ +using boost::assign::list_of; + +typedef LLDependencies<> StringDeps; +typedef StringDeps::KeyList StringList; + +// We use the very cool boost::assign::list_of() construct to specify vectors +// of strings inline. For reasons on which I'm not entirely clear, though, it +// needs a helper function. You can use list_of() to construct an implicit +// StringList (std::vector<std::string>) by conversion, e.g. for a function +// parameter -- but if you simply write StringList(list_of("etc.")), you get +// ambiguity errors. Shrug! +template<typename CONTAINER> +CONTAINER make(const CONTAINER& data) +{ + return data; +} + const std::string& extract_key(const LLDependencies<>::value_type& entry) { return entry.first; diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index a5aaff10c5..f51279e817 100755 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -38,6 +38,9 @@ namespace { +#ifdef __clang__ +# pragma clang diagnostic ignored "-Wunused-function" +#endif void test_that_error_h_includes_enough_things_to_compile_a_message() { LL_INFOS() << "!" << LL_ENDL; @@ -381,8 +384,6 @@ namespace }; std::string logFromNamespace(bool id) { return Foo::logFromNamespace(id); } - std::string logFromClassWithNoLogTypeMember(bool id) { ClassWithNoLogType c; return c.logFromMember(id); } - std::string logFromClassWithNoLogTypeStatic(bool id) { return ClassWithNoLogType::logFromStatic(id); } std::string logFromClassWithLogTypeMember(bool id) { ClassWithLogType c; return c.logFromMember(id); } std::string logFromClassWithLogTypeStatic(bool id) { return ClassWithLogType::logFromStatic(id); } @@ -393,8 +394,8 @@ namespace if (n1 == std::string::npos) { std::stringstream ss; - ss << message << ": " << "expected to find a copy of " << expected - << " in actual " << actual; + ss << message << ": " << "expected to find a copy of '" << expected + << "' in actual '" << actual << "'"; throw tut::failure(ss.str().c_str()); } } @@ -435,9 +436,6 @@ namespace tut testLogName(mRecorder, logFromStatic); testLogName(mRecorder, logFromAnon); testLogName(mRecorder, logFromNamespace); - //testLogName(mRecorder, logFromClassWithNoLogTypeMember, "ClassWithNoLogType"); - //testLogName(mRecorder, logFromClassWithNoLogTypeStatic, "ClassWithNoLogType"); - // XXX: figure out what the exepcted response is for these testLogName(mRecorder, logFromClassWithLogTypeMember, "ClassWithLogType"); testLogName(mRecorder, logFromClassWithLogTypeStatic, "ClassWithLogType"); } @@ -457,11 +455,6 @@ namespace return "bar"; } - void uberLogger() - { - LL_INFOS() << "uber(" << outerLogger() << "," << innerLogger() << ")" << LL_ENDL; - } - class LogWhileLogging { public: @@ -494,17 +487,10 @@ namespace tut ensure_message_contains(1, "outside(moo)"); ensure_message_count(2); - uberLogger(); - ensure_message_contains(2, "inside"); - ensure_message_contains(3, "inside"); - ensure_message_contains(4, "outside(moo)"); - ensure_message_contains(5, "uber(bar,moo)"); - ensure_message_count(6); - metaLogger(); - ensure_message_contains(6, "logging"); - ensure_message_contains(7, "meta(baz)"); - ensure_message_count(8); + ensure_message_contains(2, "logging"); + ensure_message_contains(3, "meta(baz)"); + ensure_message_count(4); } template<> template<> diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp index cb5e15eff2..2096807e53 100755 --- a/indra/llcommon/tests/lleventcoro_test.cpp +++ b/indra/llcommon/tests/lleventcoro_test.cpp @@ -94,7 +94,6 @@ using coroutines::coroutine; template<typename Iter> bool match(Iter first, Iter last, std::string match) { std::string::iterator i = match.begin(); - i != match.end(); for(; (first != last) && (i != match.end()); ++i) { if (*first != *i) return false; diff --git a/indra/llcommon/tests/llframetimer_test.cpp b/indra/llcommon/tests/llframetimer_test.cpp index 8ac1c91a3a..be372bb855 100755 --- a/indra/llcommon/tests/llframetimer_test.cpp +++ b/indra/llcommon/tests/llframetimer_test.cpp @@ -84,25 +84,34 @@ namespace tut template<> template<> void frametimer_object_t::test<3>() { + clock_t t1 = clock(); + ms_sleep(200); + clock_t t2 = clock(); + clock_t elapsed = t2 - t1 + 1; + std::cout << "Note: using clock(), ms_sleep() actually took " << (long)elapsed << "ms" << std::endl; + F64 seconds_since_epoch = LLFrameTimer::getTotalSeconds(); seconds_since_epoch += 2.0; LLFrameTimer timer; timer.setExpiryAt(seconds_since_epoch); - ensure("timer not expired on create", !timer.hasExpired()); - int ii; - for(ii = 0; ii < 10; ++ii) + /* + * Note that the ms_sleep(200) below is only guaranteed to return + * in 200ms _or_more_, so it should be true that by the 10th + * iteration we've gotten to the 2 seconds requested above + * and the timer should expire, but it can expire in fewer iterations + * if one or more of the ms_sleep calls takes longer. + * (as it did when we moved to Mac OS X 10.10) + */ + int iterations_until_expiration = 0; + while ( !timer.hasExpired() ) { - ms_sleep(150); - LLFrameTimer::updateFrameTime(); - } - ensure("timer not expired after a bit", !timer.hasExpired()); - for(ii = 0; ii < 10; ++ii) - { - ms_sleep(100); - LLFrameTimer::updateFrameTime(); + ms_sleep(200); + LLFrameTimer::updateFrameTime(); + iterations_until_expiration++; } - ensure("timer expired", timer.hasExpired()); + ensure("timer took too long to expire", iterations_until_expiration <= 10); } + /* template<> template<> void frametimer_object_t::test<4>() diff --git a/indra/llcommon/tests/llleap_test.cpp b/indra/llcommon/tests/llleap_test.cpp index 9ea822cb8d..2d88e2c676 100755 --- a/indra/llcommon/tests/llleap_test.cpp +++ b/indra/llcommon/tests/llleap_test.cpp @@ -17,7 +17,7 @@ // std headers // external library headers #include <boost/assign/list_of.hpp> -#include <boost/lambda/lambda.hpp> +#include <boost/phoenix/core/argument.hpp> #include <boost/foreach.hpp> // other Linden headers #include "../test/lltut.h" @@ -38,24 +38,7 @@ StringVec sv(const StringVec& listof) { return listof; } #define sleep(secs) _sleep((secs) * 1000) #endif -#if ! LL_WINDOWS const size_t BUFFERED_LENGTH = 1023*1024; // try wrangling just under a megabyte of data -#else -// "Then there's Windows... sigh." The "very large message" test is flaky in a -// way that seems to point to either the OS (nonblocking writes to pipes) or -// possibly the apr_file_write() function. Poring over log messages reveals -// that at some point along the way apr_file_write() returns 11 (Resource -// temporarily unavailable, i.e. EAGAIN) and says it wrote 0 bytes -- even -// though it did write the chunk! Our next write attempt retries the same -// chunk, resulting in the chunk being duplicated at the child end, corrupting -// the data stream. Much as I would love to be able to fix it for real, such a -// fix would appear to require distinguishing bogus EAGAIN returns from real -// ones -- how?? Empirically this behavior is only observed when writing a -// "very large message". To be able to move forward at all, try to bypass this -// particular failure by adjusting the size of a "very large message" on -// Windows. -const size_t BUFFERED_LENGTH = 65336; -#endif // LL_WINDOWS void waitfor(const std::vector<LLLeap*>& instances, int timeout=60) { @@ -109,7 +92,7 @@ namespace tut llleap_data(): reader(".py", // This logic is adapted from vita.viewerclient.receiveEvent() - boost::lambda::_1 << + boost::phoenix::placeholders::arg1 << "import re\n" "import os\n" "import sys\n" @@ -403,7 +386,7 @@ namespace tut AckAPI api; Result result; NamedTempFile script("py", - boost::lambda::_1 << + boost::phoenix::placeholders::arg1 << "from " << reader_module << " import *\n" // make a request on our little API "request(pump='" << api.getName() << "', data={})\n" @@ -441,7 +424,7 @@ namespace tut ReqIDAPI api; Result result; NamedTempFile script("py", - boost::lambda::_1 << + boost::phoenix::placeholders::arg1 << "import sys\n" "from " << reader_module << " import *\n" // Note that since reader imports llsd, this @@ -484,7 +467,7 @@ namespace tut ReqIDAPI api; Result result; NamedTempFile script("py", - boost::lambda::_1 << + boost::phoenix::placeholders::arg1 << "import sys\n" "from " << reader_module << " import *\n" // Generate a very large string value. diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp index e4e766d51b..5ba343b183 100755 --- a/indra/llcommon/tests/llprocess_test.cpp +++ b/indra/llcommon/tests/llprocess_test.cpp @@ -85,7 +85,7 @@ static std::string readfile(const std::string& pathname, const std::string& desc } std::ifstream inf(pathname.c_str()); std::string output; - tut::ensure(STRINGIZE("No output " << use_desc), std::getline(inf, output)); + tut::ensure(STRINGIZE("No output " << use_desc), bool(std::getline(inf, output))); std::string more; while (std::getline(inf, more)) { @@ -154,7 +154,7 @@ struct PythonProcessLauncher void launch() { mPy = LLProcess::create(mParams); - tut::ensure(STRINGIZE("Couldn't launch " << mDesc << " script"), mPy); + tut::ensure(STRINGIZE("Couldn't launch " << mDesc << " script"), bool(mPy)); } /// Run Python script and wait for it to complete. @@ -873,7 +873,7 @@ namespace tut std::string threw; \ /* Both the following calls should work. */ \ (PROCESS).GETPIPE(VALID); \ - ensure(#GETOPTPIPE "(" #VALID ") failed", (PROCESS).GETOPTPIPE(VALID)); \ + ensure(#GETOPTPIPE "(" #VALID ") failed", bool((PROCESS).GETOPTPIPE(VALID))); \ /* pass obviously bogus PIPESLOT */ \ CATCH_IN(threw, LLProcess::NoPipe, (PROCESS).GETPIPE(LLProcess::FILESLOT(4))); \ ensure_contains("didn't reject bad slot", threw, "no slot"); \ diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index b5893135ea..6fbb9abfc0 100755 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -46,9 +46,10 @@ typedef U32 uint32_t; #include "boost/range.hpp" #include "boost/foreach.hpp" #include "boost/function.hpp" -#include "boost/lambda/lambda.hpp" -#include "boost/lambda/bind.hpp" -namespace lambda = boost::lambda; +#include "boost/bind.hpp" +#include "boost/phoenix/bind/bind_function.hpp" +#include "boost/phoenix/core/argument.hpp" +using namespace boost::phoenix; #include "../llsd.h" #include "../llsdserialize.h" @@ -1612,6 +1613,20 @@ namespace tut "print 'Running on', sys.platform\n"); } + // helper for test<3> + static void writeLLSDArray(std::ostream& out, const LLSD& array) + { + BOOST_FOREACH(LLSD item, llsd::inArray(array)) + { + LLSDSerialize::toNotation(item, out); + // It's important to separate with newlines because Python's llsd + // module doesn't support parsing from a file stream, only from a + // string, so we have to know how much of the file to read into a + // string. + out << '\n'; + } + } + template<> template<> void TestPythonCompatibleObject::test<3>() { @@ -1639,26 +1654,16 @@ namespace tut " assert False, 'Too many data items'\n"; // Create an llsdXXXXXX file containing 'data' serialized to - // notation. It's important to separate with newlines because Python's - // llsd module doesn't support parsing from a file stream, only from a - // string, so we have to know how much of the file to read into a - // string. + // notation. NamedTempFile file("llsd", // NamedTempFile's boost::function constructor // takes a callable. To this callable it passes the // std::ostream with which it's writing the - // NamedTempFile. This lambda-based expression - // first calls LLSD::Serialize() with that ostream, - // then streams a newline to it, etc. - (lambda::bind(LLSDSerialize::toNotation, cdata[0], lambda::_1), - lambda::_1 << '\n', - lambda::bind(LLSDSerialize::toNotation, cdata[1], lambda::_1), - lambda::_1 << '\n', - lambda::bind(LLSDSerialize::toNotation, cdata[2], lambda::_1), - lambda::_1 << '\n')); + // NamedTempFile. + boost::bind(writeLLSDArray, _1, cdata)); python("read C++ notation", - lambda::_1 << + placeholders::arg1 << import_llsd << "def parse_each(iterable):\n" " for item in iterable:\n" @@ -1679,7 +1684,7 @@ namespace tut NamedTempFile file("llsd", ""); python("write Python notation", - lambda::_1 << + placeholders::arg1 << "from __future__ import with_statement\n" << import_llsd << "DATA = [\n" diff --git a/indra/llcommon/tests/llstring_test.cpp b/indra/llcommon/tests/llstring_test.cpp index 93d3968dbf..a7aa347222 100755 --- a/indra/llcommon/tests/llstring_test.cpp +++ b/indra/llcommon/tests/llstring_test.cpp @@ -27,11 +27,11 @@ */ #include "linden_common.h" -#include "../test/lltut.h" #include <boost/assign/list_of.hpp> #include "../llstring.h" -#include "StringVec.h" +#include "StringVec.h" // must come BEFORE lltut.h +#include "../test/lltut.h" using boost::assign::list_of; diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 7482a89dac..b9632a7921 100755 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -104,7 +104,6 @@ char * os_strltrim(char * str); void os_strlower(char * str); // Error testing and reporting for libcurl status codes -void check_curl_easy_code(CURLcode code); void check_curl_easy_code(CURLcode code, int curl_setopt_option); static const char * const LOG_CORE("CoreHttp"); @@ -588,9 +587,18 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) (mReqLength ? fmt1 : fmt2), (unsigned long) mReqOffset, (unsigned long) (mReqOffset + mReqLength - 1)); #else - snprintf(range_line, sizeof(range_line), - (mReqLength ? fmt1 : fmt2), - (unsigned long) mReqOffset, (unsigned long) (mReqOffset + mReqLength - 1)); + if ( mReqLength ) + { + snprintf(range_line, sizeof(range_line), + fmt1, + (unsigned long) mReqOffset, (unsigned long) (mReqOffset + mReqLength - 1)); + } + else + { + snprintf(range_line, sizeof(range_line), + fmt2, + (unsigned long) mReqOffset); + } #endif // LL_WINDOWS range_line[sizeof(range_line) - 1] = '\0'; mCurlHeaders = curl_slist_append(mCurlHeaders, range_line); @@ -1151,18 +1159,4 @@ void check_curl_easy_code(CURLcode code, int curl_setopt_option) } } - -void check_curl_easy_code(CURLcode code) -{ - if (CURLE_OK != code) - { - // Comment from old llcurl code which may no longer apply: - // - // linux appears to throw a curl error once per session for a bad initialization - // at a pretty random time (when enabling cookies). - LL_WARNS(LOG_CORE) << "libcurl error detected: " << curl_easy_strerror(code) - << LL_ENDL; - } -} - } // end anonymous namespace diff --git a/indra/llcorehttp/bufferstream.cpp b/indra/llcorehttp/bufferstream.cpp index 6553900eef..678bf5ea9f 100755 --- a/indra/llcorehttp/bufferstream.cpp +++ b/indra/llcorehttp/bufferstream.cpp @@ -257,8 +257,6 @@ std::streampos BufferArrayStreamBuf::seekoff(std::streamoff off, return ret; } - if (pos < 0) - return ret; if (pos > mBufferArray->size()) { pos = mBufferArray->size(); diff --git a/indra/llcorehttp/examples/http_texture_load.cpp b/indra/llcorehttp/examples/http_texture_load.cpp index b76c874557..9d9631b980 100755 --- a/indra/llcorehttp/examples/http_texture_load.cpp +++ b/indra/llcorehttp/examples/http_texture_load.cpp @@ -212,7 +212,7 @@ int main(int argc, char** argv) char * end; value = strtoul(optarg, &end, 10); - if (value < 0 || value > 100 || *end != '\0') + if (value > 100 || *end != '\0') { usage(std::cerr); return 1; @@ -227,7 +227,7 @@ int main(int argc, char** argv) char * end; value = strtoul(optarg, &end, 10); - if (value < 0 || value > 3 || *end != '\0') + if (value > 3 || *end != '\0') { usage(std::cerr); return 1; diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index d336eeaabc..ecdcd95d29 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1036,13 +1036,13 @@ void LLImageRaw::copyLineScaled( U8* in, U8* out, S32 in_pixel_len, S32 out_pixe a *= norm_factor; // skip conditional S32 t4 = x * out_pixel_step * components; - out[t4 + 0] = U8(llround(r)); + out[t4 + 0] = U8(ll_round(r)); if (components >= 2) - out[t4 + 1] = U8(llround(g)); + out[t4 + 1] = U8(ll_round(g)); if (components >= 3) - out[t4 + 2] = U8(llround(b)); + out[t4 + 2] = U8(ll_round(b)); if( components == 4) - out[t4 + 3] = U8(llround(a)); + out[t4 + 3] = U8(ll_round(a)); } } } @@ -1117,10 +1117,10 @@ void LLImageRaw::compositeRowScaled4onto3( U8* in, U8* out, S32 in_pixel_len, S3 b *= norm_factor; a *= norm_factor; - in_scaled_r = U8(llround(r)); - in_scaled_g = U8(llround(g)); - in_scaled_b = U8(llround(b)); - in_scaled_a = U8(llround(a)); + in_scaled_r = U8(ll_round(r)); + in_scaled_g = U8(ll_round(g)); + in_scaled_b = U8(ll_round(b)); + in_scaled_a = U8(ll_round(a)); } if( in_scaled_a ) diff --git a/indra/llinventory/llfoldertype.cpp b/indra/llinventory/llfoldertype.cpp index 23bf6da1f9..86aca77de8 100755 --- a/indra/llinventory/llfoldertype.cpp +++ b/indra/llinventory/llfoldertype.cpp @@ -96,6 +96,10 @@ LLFolderDictionary::LLFolderDictionary() addEntry(LLFolderType::FT_OUTBOX, new FolderEntry("outbox", TRUE)); addEntry(LLFolderType::FT_BASIC_ROOT, new FolderEntry("basic_rt", TRUE)); + + addEntry(LLFolderType::FT_MARKETPLACE_LISTINGS, new FolderEntry("merchant", FALSE)); + addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new FolderEntry("stock", FALSE)); + addEntry(LLFolderType::FT_MARKETPLACE_VERSION, new FolderEntry("version", FALSE)); addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE)); }; diff --git a/indra/llinventory/llfoldertype.h b/indra/llinventory/llfoldertype.h index a0c847914f..515bb05a3f 100755..100644 --- a/indra/llinventory/llfoldertype.h +++ b/indra/llinventory/llfoldertype.h @@ -87,6 +87,10 @@ public: FT_BASIC_ROOT = 52, + FT_MARKETPLACE_LISTINGS = 53, + FT_MARKETPLACE_STOCK = 54, + FT_MARKETPLACE_VERSION = 55, // Note: We actually *never* create folders with that type. This is used for icon override only. + FT_COUNT, FT_NONE = -1 diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h index fb1f6535ba..02281152bf 100755 --- a/indra/llkdu/llimagej2ckdu.h +++ b/indra/llkdu/llimagej2ckdu.h @@ -36,7 +36,17 @@ #include "kdu_elementary.h" #include "kdu_messaging.h" #include "kdu_params.h" + +// don't *really* want to rebuild KDU so turn off specific warnings for this header +#if LL_DARWIN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-private-field" +#include "kdu_compressed.h" +#pragma clang diagnostic pop +#else #include "kdu_compressed.h" +#endif + #include "kdu_sample_processing.h" class LLKDUDecodeState; diff --git a/indra/llkdu/llkdumem.h b/indra/llkdu/llkdumem.h index dbdf88b2d9..fab913d93b 100755 --- a/indra/llkdu/llkdumem.h +++ b/indra/llkdu/llkdumem.h @@ -29,7 +29,17 @@ // Support classes for reading and writing from memory buffers in KDU #define KDU_NO_THREADS +// don't *really* want to rebuild KDU so turn off specific warnings for this header +#if LL_DARWIN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-assign-field" +#pragma clang diagnostic ignored "-Wunused-private-field" #include "kdu_image.h" +#pragma clang diagnostic pop +#else +#include "kdu_image.h" +#endif + #include "kdu_elementary.h" #include "kdu_messaging.h" #include "kdu_params.h" diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp index 3f627b65e1..0605fad068 100755 --- a/indra/llkdu/tests/llimagej2ckdu_test.cpp +++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp @@ -28,7 +28,16 @@ #include "linden_common.h" // Class to test #include "llimagej2ckdu.h" + +#if LL_DARWIN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-private-field" +#include "llkdumem.h" +#pragma clang diagnostic pop +#else #include "llkdumem.h" +#endif + #include "kdu_block_coding.h" // Tut header #include "lltut.h" @@ -114,7 +123,6 @@ kdu_block_encoder::kdu_block_encoder() { } kdu_block_decoder::kdu_block_decoder() { } void kdu_block::set_max_passes(int , bool ) { } void kdu_block::set_max_bytes(int , bool ) { } -void kdu_block::set_max_samples(int ) { } void kdu_tile::close(kdu_thread_env* ) { } int kdu_tile::get_num_components() { return 0; } bool kdu_tile::get_ycc() { return false; } @@ -157,7 +165,7 @@ void kdu_codestream::get_valid_tiles(kdu_dims& ) { } void kdu_codestream::create(kdu_compressed_source*, kdu_thread_env*) { } void kdu_codestream::apply_input_restrictions( int, int, int, int, kdu_dims*, kdu_component_access_mode ) { } void kdu_codestream::get_subsampling(int , kdu_coords&, bool ) { } -void kdu_codestream::flush(kdu_long *, int , kdu_uint16 *, bool, bool, double, kdu_thread_env*) { } +void kdu_codestream::flush(kdu_long *, int, kdu_uint16 *, bool, bool, double, kdu_thread_env*, int) { } void kdu_codestream::set_resilient(bool ) { } int kdu_codestream::get_num_components(bool ) { return 0; } kdu_long kdu_codestream::get_total_bytes(bool ) { return 0; } @@ -175,8 +183,7 @@ kdu_block* kdu_subband::open_block(kdu_coords, int*, kdu_thread_env*) { return N bool kdu_codestream_comment::put_text(const char*) { return false; } void kdu_customize_warnings(kdu_message*) { } void kdu_customize_errors(kdu_message*) { } - -kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, bool, kdu_roi_image*, bool, int, kdu_thread_env*, kdu_thread_queue*, bool ) { kdu_long a = 0; return a; } +kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, kdu_thread_env*, kdu_thread_queue*, int, kdu_roi_image*, int) { kdu_long a = 0; return a; } siz_params::siz_params() : kdu_params(NULL, false, false, false, false, false) { } void siz_params::finalize(bool ) { } void siz_params::copy_with_xforms(kdu_params*, int, int, bool, bool, bool) { } @@ -184,20 +191,12 @@ int siz_params::write_marker_segment(kdu_output*, kdu_params*, int) { return 0; bool siz_params::check_marker_segment(kdu_uint16, int, kdu_byte a[], int&) { return false; } bool siz_params::read_marker_segment(kdu_uint16, int, kdu_byte a[], int) { return false; } -#ifdef LL_LINUX -// Linux use the old pre KDU v7.0.0 -// *TODO: Supress this legacy stubbs once Linux migrates to v7.0.0 -kdu_decoder::kdu_decoder(kdu_subband , kdu_sample_allocator*, bool , float, int, kdu_thread_env*, kdu_thread_queue*) { } -void kdu_codestream::create(siz_params*, kdu_compressed_target*, kdu_dims*, int, kdu_long ) { } -void kdu_convert_ycc_to_rgb(kdu_line_buf&, kdu_line_buf&, kdu_line_buf&, int) { } -#else kdu_decoder::kdu_decoder(kdu_subband , kdu_sample_allocator*, bool , float, int, kdu_thread_env*, kdu_thread_queue*, int) { } void kdu_codestream::create(siz_params*, kdu_compressed_target*, kdu_dims*, int, kdu_long, kdu_thread_env* ) { } void (*kdu_convert_ycc_to_rgb_rev16)(kdu_int16*,kdu_int16*,kdu_int16*,int); void (*kdu_convert_ycc_to_rgb_irrev16)(kdu_int16*,kdu_int16*,kdu_int16*,int); void (*kdu_convert_ycc_to_rgb_rev32)(kdu_int32*,kdu_int32*,kdu_int32*,int); void (*kdu_convert_ycc_to_rgb_irrev32)(float*,float*,float*,int); -#endif // ------------------------------------------------------------------------------------------- // TUT diff --git a/indra/llmath/llline.cpp b/indra/llmath/llline.cpp index f26231840b..cfee315b55 100755 --- a/indra/llmath/llline.cpp +++ b/indra/llmath/llline.cpp @@ -30,7 +30,6 @@ #include "llline.h" #include "llrand.h" -const F32 SOME_SMALL_NUMBER = 1.0e-5f; const F32 SOME_VERY_SMALL_NUMBER = 1.0e-8f; LLLine::LLLine() diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index a8b27ad189..93b9f22b25 100755 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -206,16 +206,16 @@ inline S32 llceil( F32 f ) #ifndef BOGUS_ROUND // Use this round. Does an arithmetic round (0.5 always rounds up) -inline S32 llround(const F32 val) +inline S32 ll_round(const F32 val) { return llfloor(val + 0.5f); } #else // BOGUS_ROUND -// Old llround implementation - does banker's round (toward nearest even in the case of a 0.5. +// Old ll_round implementation - does banker's round (toward nearest even in the case of a 0.5. // Not using this because we don't have a consistent implementation on both platforms, use // llfloor(val + 0.5f), which is consistent on all platforms. -inline S32 llround(const F32 val) +inline S32 ll_round(const F32 val) { #if LL_WINDOWS // Note: assumes that the floating point control word is set to rounding mode (the default) @@ -254,12 +254,12 @@ inline int round_int(double x) } #endif // BOGUS_ROUND -inline F32 llround( F32 val, F32 nearest ) +inline F32 ll_round( F32 val, F32 nearest ) { return F32(floor(val * (1.0f / nearest) + 0.5f)) * nearest; } -inline F64 llround( F64 val, F64 nearest ) +inline F64 ll_round( F64 val, F64 nearest ) { return F64(floor(val * (1.0 / nearest) + 0.5)) * nearest; } @@ -309,25 +309,6 @@ const S32 LL_SHIFT_AMOUNT = 16; //16.16 fixed point represe #define LL_MAN_INDEX 1 #endif -/* Deprecated: use llround(), lltrunc(), or llfloor() instead -// ================================================================================================ -// Real2Int -// ================================================================================================ -inline S32 F64toS32(F64 val) -{ - val = val + LL_DOUBLE_TO_FIX_MAGIC; - return ((S32*)&val)[LL_MAN_INDEX] >> LL_SHIFT_AMOUNT; -} - -// ================================================================================================ -// Real2Int -// ================================================================================================ -inline S32 F32toS32(F32 val) -{ - return F64toS32 ((F64)val); -} -*/ - //////////////////////////////////////////////// // // Fast exp and log @@ -351,9 +332,7 @@ static union #define LL_EXP_A (1048576 * OO_LN2) // use 1512775 for integer #define LL_EXP_C (60801) // this value of C good for -4 < y < 4 -#define LL_FAST_EXP(y) (LLECO.n.i = llround(F32(LL_EXP_A*(y))) + (1072693248 - LL_EXP_C), LLECO.d) - - +#define LL_FAST_EXP(y) (LLECO.n.i = ll_round(F32(LL_EXP_A*(y))) + (1072693248 - LL_EXP_C), LLECO.d) inline F32 llfastpow(const F32 x, const F32 y) { @@ -370,9 +349,6 @@ inline F32 snap_to_sig_figs(F32 foo, S32 sig_figs) bar *= 10.f; } - //F32 new_foo = (F32)llround(foo * bar); - // the llround() implementation sucks. Don't us it. - F32 sign = (foo > 0.f) ? 1.f : -1.f; F32 new_foo = F32( S64(foo * bar + sign * 0.5f)); new_foo /= bar; diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index 7b5240c651..280d2653d3 100755 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -322,7 +322,7 @@ public: //is it here? if (isInside(data->getPositionGroup())) { - if (((getElementCount() < gOctreeMaxCapacity || getSize()[0] <= gOctreeMinSize) && contains(data->getBinRadius()) || + if ((((getElementCount() < gOctreeMaxCapacity || getSize()[0] <= gOctreeMinSize) && contains(data->getBinRadius())) || (data->getBinRadius() > getSize()[0] && parent && parent->getElementCount() >= gOctreeMaxCapacity))) { //it belongs here mData.push_back(NULL); @@ -445,7 +445,7 @@ public: mDataEnd = &mData[0]; } - notifyRemoval(data); + this->notifyRemoval(data); checkAlive(); } @@ -711,7 +711,7 @@ public: //(don't notify listeners of addition) for (U32 i = 0; i < child->getChildCount(); i++) { - addChild(child->getChild(i), TRUE); + this->addChild(child->getChild(i), TRUE); } //destroy child @@ -755,10 +755,10 @@ public: return false; } - if (this->getSize()[0] > data->getBinRadius() && isInside(data->getPositionGroup())) + if (this->getSize()[0] > data->getBinRadius() && this->isInside(data->getPositionGroup())) { //we got it, just act like a branch - oct_node* node = getNodeAt(data); + oct_node* node = this->getNodeAt(data); if (node == this) { LLOctreeNode<T>::insert(data); @@ -771,7 +771,7 @@ public: else if (this->getChildCount() == 0) { //first object being added, just wrap it up - while (!(this->getSize()[0] > data->getBinRadius() && isInside(data->getPositionGroup()))) + while (!(this->getSize()[0] > data->getBinRadius() && this->isInside(data->getPositionGroup()))) { LLVector4a center, size; center = this->getCenter(); @@ -786,7 +786,7 @@ public: } else { - while (!(this->getSize()[0] > data->getBinRadius() && isInside(data->getPositionGroup()))) + while (!(this->getSize()[0] > data->getBinRadius() && this->isInside(data->getPositionGroup()))) { //the data is outside the root node, we need to grow LLVector4a center(this->getCenter()); @@ -814,7 +814,7 @@ public: //clear our children and add the root copy this->clearChildren(); - addChild(newnode); + this->addChild(newnode); } //insert the data diff --git a/indra/llmath/llquantize.h b/indra/llmath/llquantize.h index 1595dbecf8..10c950abbb 100755 --- a/indra/llmath/llquantize.h +++ b/indra/llmath/llquantize.h @@ -52,7 +52,7 @@ inline U16 F32_to_U16_ROUND(F32 val, F32 lower, F32 upper) val /= (upper - lower); // round the value. Sreturn the U16 - return (U16)(llround(val*U16MAX)); + return (U16)(ll_round(val*U16MAX)); } @@ -92,7 +92,7 @@ inline U8 F32_to_U8_ROUND(F32 val, F32 lower, F32 upper) val /= (upper - lower); // return the rounded U8 - return (U8)(llround(val*U8MAX)); + return (U8)(ll_round(val*U8MAX)); } diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index d9a68cb577..dedd90eab2 100755 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -56,8 +56,6 @@ #define DEBUG_SILHOUETTE_NORMALS 0 // TomY: Use this to display normals using the silhouette #define DEBUG_SILHOUETTE_EDGE_MAP 0 // DaveP: Use this to display edge map using the silhouette -const F32 CUT_MIN = 0.f; -const F32 CUT_MAX = 1.f; const F32 MIN_CUT_DELTA = 0.02f; const F32 HOLLOW_MIN = 0.f; @@ -560,7 +558,7 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3 // Scale to have size "match" scale. Compensates to get object to generally fill bounding box. - S32 total_sides = llround(sides / ang_scale); // Total number of sides all around + S32 total_sides = ll_round(sides / ang_scale); // Total number of sides all around if (total_sides < 8) { @@ -2076,7 +2074,7 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge generate(); - if (mParams.getSculptID().isNull() && mParams.getSculptType() == LL_SCULPT_TYPE_NONE || mParams.getSculptType() == LL_SCULPT_TYPE_MESH) + if ((mParams.getSculptID().isNull() && mParams.getSculptType() == LL_SCULPT_TYPE_NONE) || mParams.getSculptType() == LL_SCULPT_TYPE_MESH) { createVolumeFaces(); } @@ -4027,7 +4025,6 @@ LLVertexIndexPair::LLVertexIndexPair(const LLVector3 &vertex, const S32 index) } const F32 VERTEX_SLOP = 0.00001f; -const F32 VERTEX_SLOP_SQRD = VERTEX_SLOP * VERTEX_SLOP; struct lessVertex { @@ -4914,9 +4911,7 @@ F64 find_vertex_score(LLVCacheVertexData& data) { F64 score = -1.0; - if (data.mActiveTriangles >= 0) - { - score = 0.0; + score = 0.0; S32 cache_idx = data.mCacheTag; @@ -4938,9 +4933,8 @@ F64 find_vertex_score(LLVCacheVertexData& data) } //bonus points for having low valence - F64 valence_boost = pow((F64)data.mActiveTriangles, -FindVertexScore_ValenceBoostPower); + F64 valence_boost = pow((F64)data.mActiveTriangles, -FindVertexScore_ValenceBoostPower); score += FindVertexScore_ValenceBoostScale * valence_boost; - } return score; } diff --git a/indra/llmath/tests/llquaternion_test.cpp b/indra/llmath/tests/llquaternion_test.cpp index e69010b2d6..3490829743 100755 --- a/indra/llmath/tests/llquaternion_test.cpp +++ b/indra/llmath/tests/llquaternion_test.cpp @@ -175,10 +175,10 @@ namespace tut void llquat_test_object_t::test<6>() { LLQuaternion quat1(3.0f, 2.0f, 6.0f, 0.0f), quat2(1.0f, 1.0f, 1.0f, 1.0f); - ensure("1. The two values are different", llround(12.000000f, 2) == llround(dot(quat1, quat2), 2)); + ensure("1. The two values are different", ll_round(12.000000f, 2) == ll_round(dot(quat1, quat2), 2)); LLQuaternion quat0(3.0f, 9.334f, 34.5f, 23.0f), quat(34.5f, 23.23f, 2.0f, 45.5f); - ensure("2. The two values are different", llround(1435.828807f, 2) == llround(dot(quat0, quat), 2)); + ensure("2. The two values are different", ll_round(1435.828807f, 2) == ll_round(dot(quat0, quat), 2)); } //test case for LLQuaternion &LLQuaternion::constrain(F32 radians) fn. diff --git a/indra/llmath/tests/mathmisc_test.cpp b/indra/llmath/tests/mathmisc_test.cpp index 91a2e6c009..f12140cf8f 100755 --- a/indra/llmath/tests/mathmisc_test.cpp +++ b/indra/llmath/tests/mathmisc_test.cpp @@ -128,33 +128,33 @@ namespace tut void math_object::test<8>() { F32 val = 430903.2f; - S32 val1 = llround(val); - ensure("float llround value 1", (430903 == val1)); + S32 val1 = ll_round(val); + ensure("float ll_round value 1", (430903 == val1)); val = -430903.9f; - val1 = llround(val); - ensure("float llround value 2", (-430904 == val1)); + val1 = ll_round(val); + ensure("float ll_round value 2", (-430904 == val1)); } template<> template<> void math_object::test<9>() { F32 val = 430905.2654f, nearest = 100.f; - val = llround(val, nearest); - ensure("float llround value 1", (430900 == val)); + val = ll_round(val, nearest); + ensure("float ll_round value 1", (430900 == val)); val = -430905.2654f, nearest = 10.f; - val = llround(val, nearest); - ensure("float llround value 1", (-430910 == val)); + val = ll_round(val, nearest); + ensure("float ll_round value 1", (-430910 == val)); } template<> template<> void math_object::test<10>() { F64 val = 430905.2654, nearest = 100.0; - val = llround(val, nearest); - ensure("double llround value 1", (430900 == val)); + val = ll_round(val, nearest); + ensure("double ll_round value 1", (430900 == val)); val = -430905.2654, nearest = 10.0; - val = llround(val, nearest); - ensure("double llround value 1", (-430910.00000 == val)); + val = ll_round(val, nearest); + ensure("double ll_round value 1", (-430910.00000 == val)); } template<> template<> diff --git a/indra/llmath/tests/v4coloru_test.cpp b/indra/llmath/tests/v4coloru_test.cpp index 128f6f3564..12e607a820 100755 --- a/indra/llmath/tests/v4coloru_test.cpp +++ b/indra/llmath/tests/v4coloru_test.cpp @@ -300,8 +300,8 @@ namespace tut LLColor4U llcolor4u(r,g,b,a),llcolor4u1; const F32 fVal = 3.f; llcolor4u1 = llcolor4u.multAll(fVal); - ensure("multAll:Fail to multiply ", (((U8)llround(r * fVal) == llcolor4u1.mV[VX]) && (U8)llround(g * fVal) == llcolor4u1.mV[VY] - && ((U8)llround(b * fVal) == llcolor4u1.mV[VZ])&& ((U8)llround(a * fVal) == llcolor4u1.mV[VW]))); + ensure("multAll:Fail to multiply ", (((U8)ll_round(r * fVal) == llcolor4u1.mV[VX]) && (U8)ll_round(g * fVal) == llcolor4u1.mV[VY] + && ((U8)ll_round(b * fVal) == llcolor4u1.mV[VZ])&& ((U8)ll_round(a * fVal) == llcolor4u1.mV[VW]))); } template<> template<> @@ -329,8 +329,8 @@ namespace tut llcolor4u.setVecScaleClamp(color3); const S32 MAX_COLOR = 255; F32 color_scale_factor = MAX_COLOR/r; - S32 r2 = llround(r * color_scale_factor); - S32 g2 = llround(g * color_scale_factor); + S32 r2 = ll_round(r * color_scale_factor); + S32 g2 = ll_round(g * color_scale_factor); ensure("setVecScaleClamp():Fail to add the value ", ((r2 == llcolor4u.mV[VX]) && (g2 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW]))); } } diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp index cd2be7c8fd..79a64b24f2 100755 --- a/indra/llmath/v4color.cpp +++ b/indra/llmath/v4color.cpp @@ -125,10 +125,10 @@ LLColor4 LLColor4::cyan6(0.2f, 0.6f, 0.6f, 1.0f); LLColor4::operator const LLColor4U() const { return LLColor4U( - (U8)llclampb(llround(mV[VRED]*255.f)), - (U8)llclampb(llround(mV[VGREEN]*255.f)), - (U8)llclampb(llround(mV[VBLUE]*255.f)), - (U8)llclampb(llround(mV[VALPHA]*255.f))); + (U8)llclampb(ll_round(mV[VRED]*255.f)), + (U8)llclampb(ll_round(mV[VGREEN]*255.f)), + (U8)llclampb(ll_round(mV[VBLUE]*255.f)), + (U8)llclampb(ll_round(mV[VALPHA]*255.f))); } LLColor4::LLColor4(const LLColor3 &vec, F32 a) diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index 12da7e2dd7..fddad34978 100755 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h @@ -353,10 +353,10 @@ inline LLColor4U LLColor4U::multAll(const F32 k) { // Round to nearest return LLColor4U( - (U8)llround(mV[VX] * k), - (U8)llround(mV[VY] * k), - (U8)llround(mV[VZ] * k), - (U8)llround(mV[VW] * k)); + (U8)ll_round(mV[VX] * k), + (U8)ll_round(mV[VY] * k), + (U8)ll_round(mV[VZ] * k), + (U8)ll_round(mV[VW] * k)); } /* inline LLColor4U operator*(const LLColor4U &a, U8 k) @@ -471,7 +471,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color) color_scale_factor /= max_color; } const S32 MAX_COLOR = 255; - S32 r = llround(color.mV[0] * color_scale_factor); + S32 r = ll_round(color.mV[0] * color_scale_factor); if (r > MAX_COLOR) { r = MAX_COLOR; @@ -482,7 +482,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color) } mV[0] = r; - S32 g = llround(color.mV[1] * color_scale_factor); + S32 g = ll_round(color.mV[1] * color_scale_factor); if (g > MAX_COLOR) { g = MAX_COLOR; @@ -493,7 +493,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color) } mV[1] = g; - S32 b = llround(color.mV[2] * color_scale_factor); + S32 b = ll_round(color.mV[2] * color_scale_factor); if (b > MAX_COLOR) { b = MAX_COLOR; @@ -505,7 +505,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color) mV[2] = b; // Alpha shouldn't be scaled, just clamped... - S32 a = llround(color.mV[3] * MAX_COLOR); + S32 a = ll_round(color.mV[3] * MAX_COLOR); if (a > MAX_COLOR) { a = MAX_COLOR; @@ -527,7 +527,7 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color) } const S32 MAX_COLOR = 255; - S32 r = llround(color.mV[0] * color_scale_factor); + S32 r = ll_round(color.mV[0] * color_scale_factor); if (r > MAX_COLOR) { r = MAX_COLOR; @@ -539,7 +539,7 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color) } mV[0] = r; - S32 g = llround(color.mV[1] * color_scale_factor); + S32 g = ll_round(color.mV[1] * color_scale_factor); if (g > MAX_COLOR) { g = MAX_COLOR; @@ -551,7 +551,7 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color) } mV[1] = g; - S32 b = llround(color.mV[2] * color_scale_factor); + S32 b = ll_round(color.mV[2] * color_scale_factor); if (b > MAX_COLOR) { b = MAX_COLOR; diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 4dd8d04656..daf3e0b4de 100755 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -51,9 +51,6 @@ static const std::string NAME("name"); // We won't re-request a name during this time const U32 PENDING_TIMEOUT_SECS = 5 * 60; -// File version number -const S32 CN_FILE_VERSION = 2; - // Globals LLCacheName* gCacheName = NULL; std::map<std::string, std::string> LLCacheName::sCacheName; diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp index 5aaada63b1..3eb0e0d057 100755 --- a/indra/llmessage/llcircuit.cpp +++ b/indra/llmessage/llcircuit.cpp @@ -688,7 +688,7 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) // now, check to see if we've got a gap U32 gap = 0; - if ((mPacketsInID == id)) + if (mPacketsInID == id) { // nope! bump and wrap the counter, then return mPacketsInID++; diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp index a30140e8f3..e202154445 100755 --- a/indra/llmessage/llhttpassetstorage.cpp +++ b/indra/llmessage/llhttpassetstorage.cpp @@ -47,8 +47,7 @@ const char* const LOCAL_ASSET_URL_FORMAT = "http://%s:12041/asset"; const U32 MAX_RUNNING_REQUESTS = 1; -const F32 MAX_PROCESSING_TIME = 0.005f; -const S32 CURL_XFER_BUFFER_SIZE = 65536; + // Try for 30 minutes for now. const F32 GET_URL_TO_FILE_TIMEOUT = 1800.0f; diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 200116337d..a8c3b86192 100755 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -572,6 +572,17 @@ void LLHTTPClient::patch( request(url, HTTP_PATCH, new LLSDInjector(body), responder, timeout, headers); } +void LLHTTPClient::putRaw( + const std::string& url, + const U8* data, + S32 size, + ResponderPtr responder, + const LLSD& headers, + const F32 timeout) +{ + request(url, HTTP_PUT, new RawInjector(data, size), responder, timeout, headers); +} + void LLHTTPClient::post( const std::string& url, const LLSD& body, diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h index b18258fd7b..fd48b4a743 100755 --- a/indra/llmessage/llhttpclient.h +++ b/indra/llmessage/llhttpclient.h @@ -79,6 +79,14 @@ public: ResponderPtr, const LLSD& headers = LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); + static void putRaw( + const std::string& url, + const U8* data, + S32 size, + ResponderPtr responder, + const LLSD& headers = LLSD(), + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); + static void patch( const std::string& url, diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h index 9a0a427efd..7fd4cee8ba 100755 --- a/indra/llmessage/lliopipe.h +++ b/indra/llmessage/lliopipe.h @@ -56,11 +56,8 @@ void pump_debug(const char *file, S32 line); /** * intrusive pointer support */ -namespace boost -{ - void intrusive_ptr_add_ref(LLIOPipe* p); - void intrusive_ptr_release(LLIOPipe* p); -}; +void intrusive_ptr_add_ref(LLIOPipe* p); +void intrusive_ptr_release(LLIOPipe* p); /** * @class LLIOPipe @@ -251,68 +248,21 @@ protected: LLPumpIO* pump) = 0; private: - friend void boost::intrusive_ptr_add_ref(LLIOPipe* p); - friend void boost::intrusive_ptr_release(LLIOPipe* p); + friend void intrusive_ptr_add_ref(LLIOPipe* p); + friend void intrusive_ptr_release(LLIOPipe* p); U32 mReferenceCount; }; -namespace boost +inline void intrusive_ptr_add_ref(LLIOPipe* p) { - inline void intrusive_ptr_add_ref(LLIOPipe* p) - { - ++p->mReferenceCount; - } - inline void intrusive_ptr_release(LLIOPipe* p) + ++p->mReferenceCount; +} +inline void intrusive_ptr_release(LLIOPipe* p) +{ + if(p && 0 == --p->mReferenceCount) { - if(p && 0 == --p->mReferenceCount) - { - delete p; - } + delete p; } -}; - - -#if 0 -/** - * @class LLIOBoiler - * @brief This class helps construct new LLIOPipe specializations - * @see LLIOPipe - * - * THOROUGH_DESCRIPTION - */ -class LLIOBoiler : public LLIOPipe -{ -public: - LLIOBoiler(); - virtual ~LLIOBoiler(); - -protected: - /* @name LLIOPipe virtual implementations - */ - //@{ - /** - * @brief Process the data in buffer - */ - virtual EStatus process_impl( - const LLChannelDescriptors& channels, - buffer_ptr_t& buffer, - bool& eos, - LLSD& context, - LLPumpIO* pump); - //@} -}; - -// virtual -LLIOPipe::EStatus process_impl( - const LLChannelDescriptors& channels, - buffer_ptr_t& buffer, - bool& eos, - LLSD& context, - LLPumpIO* pump) -{ - return STATUS_NOT_IMPLEMENTED; } -#endif // #if 0 - use this block as a boilerplate - #endif // LL_LLIOPIPE_H diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp index 41a0310ce0..53aa35c0f9 100755 --- a/indra/llmessage/llpartdata.cpp +++ b/indra/llmessage/llpartdata.cpp @@ -49,11 +49,6 @@ const S32 PS_MAX_DATA_BLOCK_SIZE = PS_SYS_DATA_BLOCK_SIZE+ const S32 PS_LEGACY_DATA_BLOCK_SIZE = PS_SYS_DATA_BLOCK_SIZE + PS_LEGACY_PART_DATA_BLOCK_SIZE; - -const U32 PART_DATA_MASK = LLPartData::LL_PART_DATA_GLOW | LLPartData::LL_PART_DATA_BLEND; - - - const F32 MAX_PART_SCALE = 4.f; bool LLPartData::hasGlow() const diff --git a/indra/llmessage/llregionhandle.h b/indra/llmessage/llregionhandle.h index e3ddd46acd..085757dcbc 100755 --- a/indra/llmessage/llregionhandle.h +++ b/indra/llmessage/llregionhandle.h @@ -73,7 +73,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl } else { - x_int = (U32)llround(x_pos); + x_int = (U32)ll_round(x_pos); } if (y_pos < 0.f) { @@ -82,7 +82,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl } else { - y_int = (U32)llround(y_pos); + y_int = (U32)ll_round(y_pos); } *region_handle = to_region_handle(x_int, y_int); return TRUE; diff --git a/indra/llmessage/llthrottle.cpp b/indra/llmessage/llthrottle.cpp index e484bd258d..7605da4d3f 100755 --- a/indra/llmessage/llthrottle.cpp +++ b/indra/llmessage/llthrottle.cpp @@ -391,7 +391,7 @@ BOOL LLThrottleGroup::dynamicAdjust() } mBitsSentThisPeriod[i] = 0; - total += llround(mBitsSentHistory[i]); + total += ll_round(mBitsSentHistory[i]); } // Look for busy channels diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp index b518dd1b72..0ab67b8dda 100755 --- a/indra/llmessage/llxfermanager.cpp +++ b/indra/llmessage/llxfermanager.cpp @@ -261,7 +261,7 @@ U32 LLXferManager::numActiveListEntries(LLXfer *list_head) while (list_head) { - if ((list_head->mStatus == e_LL_XFER_IN_PROGRESS)) + if (list_head->mStatus == e_LL_XFER_IN_PROGRESS) { num_entries++; } diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index cc2d5d66ad..0c3c14969b 100755 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -2752,7 +2752,7 @@ void LLMessageSystem::dumpReceiveCounts() if (mt->mReceiveCount > 0) { LL_INFOS("Messaging") << "Num: " << std::setw(3) << mt->mReceiveCount << " Bytes: " << std::setw(6) << mt->mReceiveBytes - << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime.value()) << "%" << LL_ENDL; + << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << ll_round(100 * mt->mDecodeTimeThisFrame / mReceiveTime.value()) << "%" << LL_ENDL; } } } diff --git a/indra/llmessage/tests/llhost_test.cpp b/indra/llmessage/tests/llhost_test.cpp index eadf83c428..efca1bbfca 100755 --- a/indra/llmessage/tests/llhost_test.cpp +++ b/indra/llmessage/tests/llhost_test.cpp @@ -151,11 +151,31 @@ namespace tut template<> template<> void host_object::test<9>() { - skip("this test is flaky, but we should figure out why..."); + skip("this test is irreparably flaky"); // skip("setHostByName(\"google.com\"); getHostName() -> (e.g.) \"yx-in-f100.1e100.net\""); - std::string hostStr = "lindenlab.com"; + // nat: is it reasonable to expect LLHost::getHostName() to echo + // back something resembling the string passed to setHostByName()? + // + // If that's not even reasonable, would a round trip in the /other/ + // direction make more sense? (Call getHostName() for something with + // known IP address; call setHostByName(); verify IP address) + // + // Failing that... is there a plausible way to test getHostName() and + // setHostByName()? Hopefully without putting up a dummy local DNS + // server? + + // monty: If you don't control the DNS server or the DNS configuration + // for the test point then, no, none of these will necessarily be + // reliable and may start to fail at any time. Forward translation + // is subject to CNAME records and round-robin address assignment. + // Reverse lookup is 1-to-many and is more and more likely to have + // nothing to do with the forward translation. + // + // So the test is increasingly meaningless on a real network. + + std::string hostStr = "lindenlab.com"; LLHost host; - host.setHostByName(hostStr); + host.setHostByName(hostStr); // reverse DNS will likely result in appending of some // sub-domain to the main hostname. so look for @@ -177,9 +197,9 @@ namespace tut template<> template<> void host_object::test<10>() { - std::string hostStr = "64.233.167.99"; + std::string hostStr = "64.233.167.99"; LLHost host; - host.setHostByName(hostStr); + host.setHostByName(hostStr); ensure("SetHostByName for dotted IP Address failed", host.getAddress() == ip_string_to_u32(hostStr.c_str())); } diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 75d89aac78..05fc12e338 100755 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -68,7 +68,7 @@ list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) add_library (llplugin ${llplugin_SOURCE_FILES}) -add_subdirectory(slplugin) +##add_subdirectory(slplugin) # Add tests if (LL_TESTS) diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 0644d2638c..52626b0302 100755 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -32,8 +32,6 @@ #include "llpluginclassmedia.h" #include "llpluginmessageclasses.h" -#include "llqtwebkit.h" - static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256; static int nextPowerOf2( int value ) diff --git a/indra/llplugin/slplugin/slplugin-objc.h b/indra/llplugin/slplugin/slplugin-objc.h index f2c2b3239c..af0ebe1af2 100755 --- a/indra/llplugin/slplugin/slplugin-objc.h +++ b/indra/llplugin/slplugin/slplugin-objc.h @@ -29,7 +29,9 @@ */ //Protos for ObjectiveC classes (cannot import cocoa here due to BOOL conflict) +#ifndef __OBJC__ class NSWindow; +#endif // __OBJC__ /* Defined in slplugin-objc.mm: */ diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index 7f3c8da434..57ceb3e11b 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -119,18 +119,18 @@ LLSD LLMaterial::asLLSD() const LLSD material_data; material_data[MATERIALS_CAP_NORMAL_MAP_FIELD] = mNormalID; - material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = llround(mNormalOffsetX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = llround(mNormalOffsetY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = llround(mNormalRepeatX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = llround(mNormalRepeatY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = llround(mNormalRotation * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = ll_round(mNormalOffsetX * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = ll_round(mNormalOffsetY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = ll_round(mNormalRepeatX * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = ll_round(mNormalRepeatY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = ll_round(mNormalRotation * MATERIALS_MULTIPLIER); material_data[MATERIALS_CAP_SPECULAR_MAP_FIELD] = mSpecularID; - material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = llround(mSpecularOffsetX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = llround(mSpecularOffsetY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = llround(mSpecularRepeatX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = llround(mSpecularRepeatY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = llround(mSpecularRotation * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = ll_round(mSpecularOffsetX * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = ll_round(mSpecularOffsetY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = ll_round(mSpecularRepeatX * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = ll_round(mSpecularRepeatY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = ll_round(mSpecularRotation * MATERIALS_MULTIPLIER); material_data[MATERIALS_CAP_SPECULAR_COLOR_FIELD] = mSpecularLightColor.getValue(); material_data[MATERIALS_CAP_SPECULAR_EXP_FIELD] = mSpecularLightExponent; diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index aa8dd7697c..caabbf997f 100755 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -191,7 +191,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa U32 tc_count = (tc_source && tc_source->getFloat_array()) ? tc.getCount() : 0; U32 norm_count = (norm_source && norm_source->getFloat_array()) ? n.getCount(): 0; - if ((vertex_count == 0)) + if (vertex_count == 0) { LL_WARNS() << "Unable to process mesh with empty position array; invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index a505ea04a7..6e4ccb9ea1 100755 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -107,8 +107,6 @@ const F32 FLEXIBLE_OBJECT_DEFAULT_LENGTH = 1.0f; const BOOL FLEXIBLE_OBJECT_DEFAULT_USING_COLLISION_SPHERE = FALSE; const BOOL FLEXIBLE_OBJECT_DEFAULT_RENDERING_COLLISION_SPHERE = FALSE; -const S32 MAX_FACE_BITS = 9; - const char *SCULPT_DEFAULT_TEXTURE = "be293869-d0d9-0a69-5989-ad27f1946fd4"; // old inverted texture: "7595d345-a24c-e7ef-f0bd-78793792133e"; // Texture rotations are sent over the wire as a S16. This is used to scale the actual float @@ -993,8 +991,6 @@ BOOL LLPrimitive::setMaterial(U8 material) } } -const F32 LL_MAX_SCALE_S = 100.0f; -const F32 LL_MAX_SCALE_T = 100.0f; S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_face_index, EMsgVariableType type) const { S32 face_index; @@ -1148,12 +1144,12 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const const LLTextureEntry* te = getTE(face_index); scale_s[face_index] = (F32) te->mScaleS; scale_t[face_index] = (F32) te->mScaleT; - offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ; - offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ; - image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR)); + offset_s[face_index] = (S16) ll_round((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ; + offset_t[face_index] = (S16) ll_round((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ; + image_rot[face_index] = (S16) ll_round(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR)); bump[face_index] = te->getBumpShinyFullbright(); media_flags[face_index] = te->getMediaTexGen(); - glow[face_index] = (U8) llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF)); + glow[face_index] = (U8) ll_round((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF)); // Directly sending material_ids is not safe! memcpy(&material_data[face_index*16],getTE(face_index)->getMaterialID().get(),16); /* Flawfinder: ignore */ @@ -1233,12 +1229,12 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const const LLTextureEntry* te = getTE(face_index); scale_s[face_index] = (F32) te->mScaleS; scale_t[face_index] = (F32) te->mScaleT; - offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ; - offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ; - image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR)); + offset_s[face_index] = (S16) ll_round((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ; + offset_t[face_index] = (S16) ll_round((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ; + image_rot[face_index] = (S16) ll_round(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR)); bump[face_index] = te->getBumpShinyFullbright(); media_flags[face_index] = te->getMediaTexGen(); - glow[face_index] = (U8) llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF)); + glow[face_index] = (U8) ll_round((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF)); // Directly sending material_ids is not safe! memcpy(&material_data[face_index*16],getTE(face_index)->getMaterialID().get(),16); /* Flawfinder: ignore */ diff --git a/indra/llprimitive/llvolumemessage.cpp b/indra/llprimitive/llvolumemessage.cpp index a2c2666146..8d47a7147f 100755 --- a/indra/llprimitive/llvolumemessage.cpp +++ b/indra/llprimitive/llvolumemessage.cpp @@ -52,13 +52,13 @@ bool LLVolumeMessage::packProfileParams( tempU8 = params->getCurveType(); mesgsys->addU8Fast(_PREHASH_ProfileCurve, tempU8); - tempU16 = (U16) llround( params->getBegin() / CUT_QUANTA); + tempU16 = (U16) ll_round( params->getBegin() / CUT_QUANTA); mesgsys->addU16Fast(_PREHASH_ProfileBegin, tempU16); - tempU16 = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA); + tempU16 = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA); mesgsys->addU16Fast(_PREHASH_ProfileEnd, tempU16); - tempU16 = (U16) llround(params->getHollow() / HOLLOW_QUANTA); + tempU16 = (U16) ll_round(params->getHollow() / HOLLOW_QUANTA); mesgsys->addU16Fast(_PREHASH_ProfileHollow, tempU16); return true; @@ -80,13 +80,13 @@ bool LLVolumeMessage::packProfileParams( tempU8 = params->getCurveType(); dp.packU8(tempU8, "Curve"); - tempU16 = (U16) llround( params->getBegin() / CUT_QUANTA); + tempU16 = (U16) ll_round( params->getBegin() / CUT_QUANTA); dp.packU16(tempU16, "Begin"); - tempU16 = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA); + tempU16 = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA); dp.packU16(tempU16, "End"); - tempU16 = (U16) llround(params->getHollow() / HOLLOW_QUANTA); + tempU16 = (U16) ll_round(params->getHollow() / HOLLOW_QUANTA); dp.packU16(tempU16, "Hollow"); return true; } @@ -217,46 +217,46 @@ bool LLVolumeMessage::packPathParams( U8 curve = params->getCurveType(); mesgsys->addU8Fast(_PREHASH_PathCurve, curve); - U16 begin = (U16) llround(params->getBegin() / CUT_QUANTA); + U16 begin = (U16) ll_round(params->getBegin() / CUT_QUANTA); mesgsys->addU16Fast(_PREHASH_PathBegin, begin); - U16 end = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA); + U16 end = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA); mesgsys->addU16Fast(_PREHASH_PathEnd, end); // Avoid truncation problem with direct F32->U8 cast. // (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50. - U8 pack_scale_x = 200 - (U8) llround(params->getScaleX() / SCALE_QUANTA); + U8 pack_scale_x = 200 - (U8) ll_round(params->getScaleX() / SCALE_QUANTA); mesgsys->addU8Fast(_PREHASH_PathScaleX, pack_scale_x ); - U8 pack_scale_y = 200 - (U8) llround(params->getScaleY() / SCALE_QUANTA); + U8 pack_scale_y = 200 - (U8) ll_round(params->getScaleY() / SCALE_QUANTA); mesgsys->addU8Fast(_PREHASH_PathScaleY, pack_scale_y ); - U8 pack_shear_x = (U8) llround(params->getShearX() / SHEAR_QUANTA); + U8 pack_shear_x = (U8) ll_round(params->getShearX() / SHEAR_QUANTA); mesgsys->addU8Fast(_PREHASH_PathShearX, pack_shear_x ); - U8 pack_shear_y = (U8) llround(params->getShearY() / SHEAR_QUANTA); + U8 pack_shear_y = (U8) ll_round(params->getShearY() / SHEAR_QUANTA); mesgsys->addU8Fast(_PREHASH_PathShearY, pack_shear_y ); - S8 twist = (S8) llround(params->getTwist() / SCALE_QUANTA); + S8 twist = (S8) ll_round(params->getTwist() / SCALE_QUANTA); mesgsys->addS8Fast(_PREHASH_PathTwist, twist); - S8 twist_begin = (S8) llround(params->getTwistBegin() / SCALE_QUANTA); + S8 twist_begin = (S8) ll_round(params->getTwistBegin() / SCALE_QUANTA); mesgsys->addS8Fast(_PREHASH_PathTwistBegin, twist_begin); - S8 radius_offset = (S8) llround(params->getRadiusOffset() / SCALE_QUANTA); + S8 radius_offset = (S8) ll_round(params->getRadiusOffset() / SCALE_QUANTA); mesgsys->addS8Fast(_PREHASH_PathRadiusOffset, radius_offset); - S8 taper_x = (S8) llround(params->getTaperX() / TAPER_QUANTA); + S8 taper_x = (S8) ll_round(params->getTaperX() / TAPER_QUANTA); mesgsys->addS8Fast(_PREHASH_PathTaperX, taper_x); - S8 taper_y = (S8) llround(params->getTaperY() / TAPER_QUANTA); + S8 taper_y = (S8) ll_round(params->getTaperY() / TAPER_QUANTA); mesgsys->addS8Fast(_PREHASH_PathTaperY, taper_y); - U8 revolutions = (U8) llround( (params->getRevolutions() - 1.0f) / REV_QUANTA); + U8 revolutions = (U8) ll_round( (params->getRevolutions() - 1.0f) / REV_QUANTA); mesgsys->addU8Fast(_PREHASH_PathRevolutions, revolutions); - S8 skew = (S8) llround(params->getSkew() / SCALE_QUANTA); + S8 skew = (S8) ll_round(params->getSkew() / SCALE_QUANTA); mesgsys->addS8Fast(_PREHASH_PathSkew, skew); return true; @@ -274,46 +274,46 @@ bool LLVolumeMessage::packPathParams( U8 curve = params->getCurveType(); dp.packU8(curve, "Curve"); - U16 begin = (U16) llround(params->getBegin() / CUT_QUANTA); + U16 begin = (U16) ll_round(params->getBegin() / CUT_QUANTA); dp.packU16(begin, "Begin"); - U16 end = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA); + U16 end = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA); dp.packU16(end, "End"); // Avoid truncation problem with direct F32->U8 cast. // (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50. - U8 pack_scale_x = 200 - (U8) llround(params->getScaleX() / SCALE_QUANTA); + U8 pack_scale_x = 200 - (U8) ll_round(params->getScaleX() / SCALE_QUANTA); dp.packU8(pack_scale_x, "ScaleX"); - U8 pack_scale_y = 200 - (U8) llround(params->getScaleY() / SCALE_QUANTA); + U8 pack_scale_y = 200 - (U8) ll_round(params->getScaleY() / SCALE_QUANTA); dp.packU8(pack_scale_y, "ScaleY"); - S8 pack_shear_x = (S8) llround(params->getShearX() / SHEAR_QUANTA); + S8 pack_shear_x = (S8) ll_round(params->getShearX() / SHEAR_QUANTA); dp.packU8(*(U8 *)&pack_shear_x, "ShearX"); - S8 pack_shear_y = (S8) llround(params->getShearY() / SHEAR_QUANTA); + S8 pack_shear_y = (S8) ll_round(params->getShearY() / SHEAR_QUANTA); dp.packU8(*(U8 *)&pack_shear_y, "ShearY"); - S8 twist = (S8) llround(params->getTwist() / SCALE_QUANTA); + S8 twist = (S8) ll_round(params->getTwist() / SCALE_QUANTA); dp.packU8(*(U8 *)&twist, "Twist"); - S8 twist_begin = (S8) llround(params->getTwistBegin() / SCALE_QUANTA); + S8 twist_begin = (S8) ll_round(params->getTwistBegin() / SCALE_QUANTA); dp.packU8(*(U8 *)&twist_begin, "TwistBegin"); - S8 radius_offset = (S8) llround(params->getRadiusOffset() / SCALE_QUANTA); + S8 radius_offset = (S8) ll_round(params->getRadiusOffset() / SCALE_QUANTA); dp.packU8(*(U8 *)&radius_offset, "RadiusOffset"); - S8 taper_x = (S8) llround(params->getTaperX() / TAPER_QUANTA); + S8 taper_x = (S8) ll_round(params->getTaperX() / TAPER_QUANTA); dp.packU8(*(U8 *)&taper_x, "TaperX"); - S8 taper_y = (S8) llround(params->getTaperY() / TAPER_QUANTA); + S8 taper_y = (S8) ll_round(params->getTaperY() / TAPER_QUANTA); dp.packU8(*(U8 *)&taper_y, "TaperY"); - U8 revolutions = (U8) llround( (params->getRevolutions() - 1.0f) / REV_QUANTA); + U8 revolutions = (U8) ll_round( (params->getRevolutions() - 1.0f) / REV_QUANTA); dp.packU8(*(U8 *)&revolutions, "Revolutions"); - S8 skew = (S8) llround(params->getSkew() / SCALE_QUANTA); + S8 skew = (S8) ll_round(params->getSkew() / SCALE_QUANTA); dp.packU8(*(U8 *)&skew, "Skew"); return true; diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index dba12d048e..331f988382 100755 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -121,7 +121,6 @@ target_link_libraries(llrender ${LLCOMMON_LIBRARIES} ${LLIMAGE_LIBRARIES} ${LLMATH_LIBRARIES} - ${LLRENDER_LIBRARIES} ${LLVFS_LIBRARIES} ${LLXML_LIBRARIES} ${LLVFS_LIBRARIES} diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 25b1c533c1..de26d19efc 100755 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -103,7 +103,6 @@ LLFontGlyphInfo::LLFontGlyphInfo(U32 index) LLFontFreetype::LLFontFreetype() : LLTrace::MemTrackable<LLFontFreetype>("LLFontFreetype"), mFontBitmapCachep(new LLFontBitmapCache), - mValid(FALSE), mAscender(0.f), mDescender(0.f), mLineHeight(0.f), @@ -184,8 +183,8 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v mDescender = -mFTFace->descender * pixels_per_unit; mLineHeight = mFTFace->height * pixels_per_unit; - S32 max_char_width = llround(0.5f + (x_max - x_min)); - S32 max_char_height = llround(0.5f + (y_max - y_min)); + S32 max_char_width = ll_round(0.5f + (x_max - x_min)); + S32 max_char_height = ll_round(0.5f + (y_max - y_min)); mFontBitmapCachep->init(components, max_char_width, max_char_height); claimMem(mFontBitmapCachep); diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h index 2963fbd43d..a5ece42b88 100755 --- a/indra/llrender/llfontfreetype.h +++ b/indra/llrender/llfontfreetype.h @@ -162,8 +162,6 @@ private: BOOL mIsFallback; font_vector_t mFallbackFonts; // A list of fallback fonts to look for glyphs in (for Unicode chars) - BOOL mValid; - typedef boost::unordered_map<llwchar, LLFontGlyphInfo*> char_glyph_info_map_t; mutable char_glyph_info_map_t mCharGlyphInfoMap; // Information about glyph location in bitmap diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 1d181b476a..53ca080d66 100755 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -61,12 +61,6 @@ LLCoordGL LLFontGL::sCurOrigin; F32 LLFontGL::sCurDepth; std::vector<std::pair<LLCoordGL, F32> > LLFontGL::sOriginStack; -const F32 EXT_X_BEARING = 1.f; -const F32 EXT_Y_BEARING = 0.f; -const F32 EXT_KERNING = 1.f; -const F32 PIXEL_BORDER_THRESHOLD = 0.0001f; -const F32 PIXEL_CORRECTION_DISTANCE = 0.01f; - const F32 PAD_UVY = 0.5f; // half of vertical padding between glyphs in the glyph texture const F32 DROP_SHADOW_SOFT_STRENGTH = 0.3f; @@ -217,10 +211,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons case LEFT: break; case RIGHT: - cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)); + cur_x -= llmin(scaled_max_pixels, ll_round(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)); break; case HCENTER: - cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)) / 2; + cur_x -= llmin(scaled_max_pixels, ll_round(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)) / 2; break; default: break; @@ -229,7 +223,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons cur_render_y = cur_y; cur_render_x = cur_x; - F32 start_x = (F32)llround(cur_x); + F32 start_x = (F32)ll_round(cur_x); const LLFontBitmapCache* font_bitmap_cache = mFontFreetype->getFontBitmapCache(); @@ -243,12 +237,12 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons if (use_ellipses) { // check for too long of a string - S32 string_width = llround(getWidthF32(wstr.c_str(), begin_offset, max_chars) * sScaleX); + S32 string_width = ll_round(getWidthF32(wstr.c_str(), begin_offset, max_chars) * sScaleX); if (string_width > scaled_max_pixels) { // use four dots for ellipsis width to generate padding const LLWString dots(utf8str_to_wstring(std::string("...."))); - scaled_max_pixels = llmax(0, scaled_max_pixels - llround(getWidthF32(dots.c_str()))); + scaled_max_pixels = llmax(0, scaled_max_pixels - ll_round(getWidthF32(dots.c_str()))); draw_ellipses = TRUE; } } @@ -313,10 +307,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons (fgi->mXBitmapOffset + fgi->mWidth) * inv_width, (fgi->mYBitmapOffset - PAD_UVY) * inv_height); // snap glyph origin to whole screen pixel - LLRectf screen_rect((F32)llround(cur_render_x + (F32)fgi->mXBearing), - (F32)llround(cur_render_y + (F32)fgi->mYBearing), - (F32)llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth, - (F32)llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight); + LLRectf screen_rect((F32)ll_round(cur_render_x + (F32)fgi->mXBearing), + (F32)ll_round(cur_render_y + (F32)fgi->mYBearing), + (F32)ll_round(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth, + (F32)ll_round(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight); if (glyph_count >= GLYPH_BATCH_SIZE) { @@ -347,8 +341,8 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons // Must do this to cur_x, not just to cur_render_x, otherwise you // will squish sub-pixel kerned characters too close together. // For example, "CCCCC" looks bad. - cur_x = (F32)llround(cur_x); - //cur_y = (F32)llround(cur_y); + cur_x = (F32)ll_round(cur_x); + //cur_y = (F32)ll_round(cur_y); cur_render_x = cur_x; cur_render_y = cur_y; @@ -458,7 +452,7 @@ S32 LLFontGL::getWidth(const std::string& utf8text, S32 begin_offset, S32 max_ch S32 LLFontGL::getWidth(const llwchar* wchars, S32 begin_offset, S32 max_chars) const { F32 width = getWidthF32(wchars, begin_offset, max_chars); - return llround(width); + return ll_round(width); } F32 LLFontGL::getWidthF32(const std::string& utf8text) const @@ -520,7 +514,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars cur_x += mFontFreetype->getXKerning(fgi, next_glyph); } // Round after kerning. - cur_x = (F32)llround(cur_x); + cur_x = (F32)ll_round(cur_x); } // add in extra pixels for last character's width past its xadvance @@ -628,7 +622,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch } // Round after kerning. - cur_x = (F32)llround(cur_x); + cur_x = (F32)ll_round(cur_x); } if( clip ) @@ -698,7 +692,7 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_ } // Round after kerning. - total_width = (F32)llround(total_width); + total_width = (F32)ll_round(total_width); } if (drawable_chars == 0) @@ -781,7 +775,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t // Round after kerning. - cur_x = (F32)llround(cur_x); + cur_x = (F32)ll_round(cur_x); } return llmin(max_chars, pos - begin_offset); diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp index a95bb7027b..b6ea5aa7f1 100755 --- a/indra/llrender/llpostprocess.cpp +++ b/indra/llrender/llpostprocess.cpp @@ -49,17 +49,8 @@ static LLStaticHashedString sBlurWidth("blurWidth"); LLPostProcess * gPostProcess = NULL; - static const unsigned int NOISE_SIZE = 512; -/// CALCULATING LUMINANCE (Using NTSC lum weights) -/// http://en.wikipedia.org/wiki/Luma_%28video%29 -static const float LUMINANCE_R = 0.299f; -static const float LUMINANCE_G = 0.587f; -static const float LUMINANCE_B = 0.114f; - -static const char * const XML_FILENAME = "postprocesseffects.xml"; - LLPostProcess::LLPostProcess(void) : initialized(false), mAllEffects(LLSD::emptyMap()), diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index df5d79a436..4e2ebfd51e 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -433,8 +433,8 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex F32 image_width = image->getWidth(0); F32 image_height = image->getHeight(0); - S32 image_natural_width = llround(image_width * uv_width); - S32 image_natural_height = llround(image_height * uv_height); + S32 image_natural_width = ll_round(image_width * uv_width); + S32 image_natural_height = ll_round(image_height * uv_height); LLRectf draw_center_rect( uv_center_rect.mLeft * image_width, uv_center_rect.mTop * image_height, @@ -468,10 +468,10 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex draw_center_rect.setCenterAndSize(uv_center_rect.getCenterX() * width, uv_center_rect.getCenterY() * height, scaled_width, scaled_height); } - draw_center_rect.mLeft = llround(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * ui_scale.mV[VX]); - draw_center_rect.mTop = llround(ui_translation.mV[VY] + (F32)draw_center_rect.mTop * ui_scale.mV[VY]); - draw_center_rect.mRight = llround(ui_translation.mV[VX] + (F32)draw_center_rect.mRight * ui_scale.mV[VX]); - draw_center_rect.mBottom = llround(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * ui_scale.mV[VY]); + draw_center_rect.mLeft = ll_round(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * ui_scale.mV[VX]); + draw_center_rect.mTop = ll_round(ui_translation.mV[VY] + (F32)draw_center_rect.mTop * ui_scale.mV[VY]); + draw_center_rect.mRight = ll_round(ui_translation.mV[VX] + (F32)draw_center_rect.mRight * ui_scale.mV[VX]); + draw_center_rect.mBottom = ll_round(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * ui_scale.mV[VY]); LLRectf draw_outer_rect(ui_translation.mV[VX], ui_translation.mV[VY] + height * ui_scale.mV[VY], @@ -703,8 +703,8 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre ui_translation.mV[VY] += y; ui_translation.scaleVec(ui_scale); S32 index = 0; - S32 scaled_width = llround(width * ui_scale.mV[VX]); - S32 scaled_height = llround(height * ui_scale.mV[VY]); + S32 scaled_width = ll_round(width * ui_scale.mV[VX]); + S32 scaled_height = ll_round(height * ui_scale.mV[VY]); uv[index] = LLVector2(uv_rect.mRight, uv_rect.mTop); pos[index] = LLVector3(ui_translation.mV[VX] + scaled_width, ui_translation.mV[VY] + scaled_height, 0.f); diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp index 6f1fae92cd..5d8f92b2e6 100644 --- a/indra/llrender/lluiimage.cpp +++ b/indra/llrender/lluiimage.cpp @@ -149,13 +149,13 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c S32 LLUIImage::getWidth() const { // return clipped dimensions of actual image area - return llround((F32)mImage->getWidth(0) * mClipRegion.getWidth()); + return ll_round((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()); + return ll_round((F32)mImage->getHeight(0) * mClipRegion.getHeight()); } S32 LLUIImage::getTextureWidth() const diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index b787794b95..623f570cef 100755 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -36,25 +36,17 @@ #include "boost/bind.hpp" -static const S32 DRAGGER_BAR_MARGIN = 4; -static const S32 DRAGGER_BAR_HEIGHT = 5; static const S32 BORDER_MARGIN = 2; static const S32 PARENT_BORDER_MARGIN = 5; - -static const S32 panel_delta = DRAGGER_BAR_MARGIN; // Distanse between two panels - -static const S32 HORIZONTAL_MULTIPLE = 8; static const S32 VERTICAL_MULTIPLE = 16; static const F32 MIN_AUTO_SCROLL_RATE = 120.f; static const F32 MAX_AUTO_SCROLL_RATE = 500.f; static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f; - // LLAccordionCtrl =================================================================| static LLDefaultChildRegistry::Register<LLAccordionCtrl> t2("accordion"); - LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) , mFitParent(params.fit_parent) , mAutoScrolling( false ) @@ -613,7 +605,7 @@ BOOL LLAccordionCtrl::autoScroll (S32 x, S32 y) // autoscroll region should take up no more than one third of visible scroller area S32 auto_scroll_region_height = llmin(rect_local.getHeight() / 3, 10); - S32 auto_scroll_speed = llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32()); + S32 auto_scroll_speed = ll_round(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32()); LLRect bottom_scroll_rect = screen_local_extents; bottom_scroll_rect.mTop = rect_local.mBottom + auto_scroll_region_height; diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp index 30cb18812b..42726de0ad 100755 --- a/indra/llui/llbadge.cpp +++ b/indra/llui/llbadge.cpp @@ -196,10 +196,10 @@ void renderBadgeBackground(F32 centerX, F32 centerY, F32 width, F32 height, cons F32 x = LLFontGL::sCurOrigin.mX + centerX - width * 0.5f; F32 y = LLFontGL::sCurOrigin.mY + centerY - height * 0.5f; - LLRectf screen_rect(llround(x), - llround(y), - llround(x) + width, - llround(y) + height); + LLRectf screen_rect(ll_round(x), + ll_round(y), + ll_round(x) + width, + ll_round(y) + height); LLVector3 vertices[4]; vertices[0] = LLVector3(screen_rect.mRight, screen_rect.mTop, 1.0f); diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index ce8383857c..8c7df45884 100755 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -606,8 +606,8 @@ void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height) overlay_height = mImageOverlay->getHeight(); F32 scale_factor = llmin((F32)getRect().getWidth() / (F32)overlay_width, (F32)getRect().getHeight() / (F32)overlay_height, 1.f); - overlay_width = llround((F32)overlay_width * scale_factor); - overlay_height = llround((F32)overlay_height * scale_factor); + overlay_width = ll_round((F32)overlay_width * scale_factor); + overlay_height = ll_round((F32)overlay_height * scale_factor); } @@ -776,7 +776,7 @@ void LLButton::draw() if (hasFocus()) { F32 lerp_amt = gFocusMgr.getFocusFlashAmt(); - drawBorder(imagep, gFocusMgr.getFocusColor() % alpha, llround(lerp(1.f, 3.f, lerp_amt))); + drawBorder(imagep, gFocusMgr.getFocusColor() % alpha, ll_round(lerp(1.f, 3.f, lerp_amt))); } if (use_glow_effect) @@ -1067,7 +1067,7 @@ void LLButton::resize(LLUIString label) { S32 overlay_width = mImageOverlay->getWidth(); F32 scale_factor = (getRect().getHeight() - (mImageOverlayBottomPad + mImageOverlayTopPad)) / (F32)mImageOverlay->getHeight(); - overlay_width = llround((F32)overlay_width * scale_factor); + overlay_width = ll_round((F32)overlay_width * scale_factor); switch(mImageOverlayAlignment) { diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 5525520d78..eee6339caf 100755 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -41,8 +41,6 @@ #include "lltextbox.h" #include "llkeyboard.h" -const U32 MAX_STRING_LENGTH = 10; - static LLDefaultChildRegistry::Register<LLCheckBoxCtrl> r("check_box"); // Compiler optimization, generate extern template diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 56be52f69a..b32aea5ffa 100755 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -788,6 +788,11 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask) // since the dropdown button eats the key if (key == KEY_RETURN) { + if (mask == MASK_NONE) + { + mOnReturnSignal(this, getValue()); + } + // don't show list and don't eat key input when committing // free-form text entry with RETURN since user already knows // what they are trying to select diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index 67393504e7..c9b1212b70 100755 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -199,6 +199,11 @@ public: void setTextEntryCallback( commit_callback_t cb ) { mTextEntryCallback = cb; } void setTextChangedCallback( commit_callback_t cb ) { mTextChangedCallback = cb; } + /** + * Connects callback to signal called when Return key is pressed. + */ + boost::signals2::connection setReturnCallback( const commit_signal_t::slot_type& cb ) { return mOnReturnSignal.connect(cb); } + void setButtonVisible(BOOL visible); void onButtonMouseDown(); @@ -231,6 +236,7 @@ private: commit_callback_t mTextChangedCallback; commit_callback_t mSelectionCallback; boost::signals2::connection mTopLostSignalConnection; + commit_signal_t mOnReturnSignal; S32 mLastSelectedIndex; }; diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 74ef8dd0c3..3e159365e5 100755 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -131,6 +131,25 @@ LLCommand * LLCommandManager::getCommand(const LLCommandId& commandId) return command_match; } +LLCommand * LLCommandManager::getCommand(const std::string& name) +{ + LLCommand * command_match = NULL; + + CommandVector::const_iterator it = mCommands.begin(); + + while (it != mCommands.end()) + { + if ((*it)->name() == name) + { + command_match = *it; + break; + } + it++; + } + + return command_match; +} + void LLCommandManager::addCommand(LLCommand * command) { LLCommandId command_id = command->id(); diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h index ff5a8a3257..f2f2145953 100755 --- a/indra/llui/llcommandmanager.h +++ b/indra/llui/llcommandmanager.h @@ -190,6 +190,7 @@ public: U32 commandCount() const; LLCommand * getCommand(U32 commandIndex); LLCommand * getCommand(const LLCommandId& commandId); + LLCommand * getCommand(const std::string& name); static bool load(); diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index fdfaf284de..26ae31cac6 100755 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -52,7 +52,6 @@ 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; static LLDefaultChildRegistry::Register<LLConsole> r("console"); diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index 7c6559eddb..48bf5bb80f 100755 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -46,7 +46,6 @@ const S32 LEADING_PAD = 5; const S32 TITLE_HPAD = 8; const S32 BORDER_PAD = 1; const S32 LEFT_PAD = BORDER_PAD + TITLE_HPAD + LEADING_PAD; -const S32 RIGHT_PAD = BORDER_PAD + 32; // HACK: space for close btn and minimize btn S32 LLDragHandle::sSnapMargin = 5; diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 3dbc9a5902..14f75a2352 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1954,7 +1954,7 @@ void LLFloater::drawShadow(LLPanel* panel) } gl_drop_shadow(left, top, right, bottom, shadow_color % getCurrentTransparency(), - llround(shadow_offset)); + ll_round(shadow_offset)); } void LLFloater::updateTransparency(LLView* view, ETypeTransparency transparency_type) @@ -2082,16 +2082,16 @@ void LLFloater::updateTitleButtons() btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH, 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)); + ll_round((F32)floater_close_box_size * mButtonScale), + ll_round((F32)floater_close_box_size * mButtonScale)); } else { btn_rect.setLeftTopAndSize( 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)); + ll_round((F32)floater_close_box_size * mButtonScale), + ll_round((F32)floater_close_box_size * mButtonScale)); } // first time here, init 'buttons_rect' @@ -2142,16 +2142,16 @@ void LLFloater::buildButtons(const Params& floater_params) btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH, 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)); + ll_round(floater_close_box_size * mButtonScale), + ll_round(floater_close_box_size * mButtonScale)); } else { btn_rect.setLeftTopAndSize( 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)); + ll_round(floater_close_box_size * mButtonScale), + ll_round(floater_close_box_size * mButtonScale)); } LLButton::Params p; @@ -3466,28 +3466,28 @@ LLCoordCommon LL_COORD_FLOATER::convertToCommon() const LLCoordCommon out; if (self.mX < -0.5f) { - out.mX = llround(rescale(self.mX, -1.f, -0.5f, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft)); + out.mX = ll_round(rescale(self.mX, -1.f, -0.5f, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft)); } else if (self.mX > 0.5f) { - out.mX = llround(rescale(self.mX, 0.5f, 1.f, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS)); + out.mX = ll_round(rescale(self.mX, 0.5f, 1.f, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS)); } else { - out.mX = llround(rescale(self.mX, -0.5f, 0.5f, snap_rect.mLeft, snap_rect.mRight - floater_width)); + out.mX = ll_round(rescale(self.mX, -0.5f, 0.5f, snap_rect.mLeft, snap_rect.mRight - floater_width)); } if (self.mY < -0.5f) { - out.mY = llround(rescale(self.mY, -1.f, -0.5f, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom)); + out.mY = ll_round(rescale(self.mY, -1.f, -0.5f, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom)); } else if (self.mY > 0.5f) { - out.mY = llround(rescale(self.mY, 0.5f, 1.f, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS)); + out.mY = ll_round(rescale(self.mY, 0.5f, 1.f, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS)); } else { - out.mY = llround(rescale(self.mY, -0.5f, 0.5f, snap_rect.mBottom, snap_rect.mTop - floater_height)); + out.mY = ll_round(rescale(self.mY, -0.5f, 0.5f, snap_rect.mBottom, snap_rect.mTop - floater_height)); } // return center point instead of lower left diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h index 1c7326260c..afd2a8ce06 100755 --- a/indra/llui/llfocusmgr.h +++ b/indra/llui/llfocusmgr.h @@ -92,7 +92,7 @@ public: void setKeystrokesOnly(BOOL keystrokes_only) { mKeystrokesOnly = keystrokes_only; } F32 getFocusFlashAmt() const; - S32 getFocusFlashWidth() const { return llround(lerp(1.f, 3.f, getFocusFlashAmt())); } + S32 getFocusFlashWidth() const { return ll_round(lerp(1.f, 3.f, getFocusFlashAmt())); } LLColor4 getFocusColor() const; void triggerFocusFlash(); BOOL getAppHasFocus() const { return mAppHasFocus; } diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 474b545f00..46f87f8cfc 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -53,7 +53,6 @@ /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -const S32 RENAME_WIDTH_PAD = 4; const S32 RENAME_HEIGHT_PAD = 1; const S32 AUTO_OPEN_STACK_DEPTH = 16; @@ -307,18 +306,18 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height ) LLFolderViewFolder::arrange(&mMinWidth, &target_height); LLRect scroll_rect = (mScrollContainer ? mScrollContainer->getContentWindowRect() : LLRect()); - reshape( llmax(scroll_rect.getWidth(), mMinWidth), llround(mCurHeight) ); + reshape( llmax(scroll_rect.getWidth(), mMinWidth), ll_round(mCurHeight) ); LLRect new_scroll_rect = (mScrollContainer ? mScrollContainer->getContentWindowRect() : LLRect()); if (new_scroll_rect.getWidth() != scroll_rect.getWidth()) { - reshape( llmax(scroll_rect.getWidth(), mMinWidth), llround(mCurHeight) ); + reshape( llmax(scroll_rect.getWidth(), mMinWidth), ll_round(mCurHeight) ); } // move item renamer text field to item's new position updateRenamerPosition(); - return llround(mTargetHeight); + return ll_round(mTargetHeight); } static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View"); @@ -341,7 +340,7 @@ void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent) scroll_rect = mScrollContainer->getContentWindowRect(); } width = llmax(mMinWidth, scroll_rect.getWidth()); - height = llmax(llround(mCurHeight), scroll_rect.getHeight()); + height = llmax(ll_round(mCurHeight), scroll_rect.getHeight()); // Restrict width within scroll container's width if (mUseEllipses && mScrollContainer) @@ -947,7 +946,6 @@ void LLFolderView::cut() if (listener) { listener->cutToClipboard(); - listener->removeItem(); } } diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 6dd6f94d02..5981c95b27 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -104,7 +104,8 @@ LLFolderViewItem::Params::Params() item_height("item_height"), item_top_pad("item_top_pad"), creation_date(), - allow_open("allow_open", true), + allow_wear("allow_wear", true), + allow_drop("allow_drop", true), font_color("font_color"), font_highlight_color("font_highlight_color"), left_pad("left_pad", 0), @@ -137,7 +138,8 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mRoot(p.root), mViewModelItem(p.listener), mIsMouseOverTitle(false), - mAllowOpen(p.allow_open), + mAllowWear(p.allow_wear), + mAllowDrop(p.allow_drop), mFontColor(p.font_color), mFontHighlightColor(p.font_highlight_color), mLeftPad(p.left_pad), @@ -471,7 +473,7 @@ void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags) void LLFolderViewItem::openItem( void ) { - if (mAllowOpen) + if (mAllowWear || !getViewModelItem()->isItemWearable()) { getViewModelItem()->openItem(); } @@ -861,7 +863,7 @@ void LLFolderViewItem::draw() if (filter_string_length > 0) { - S32 left = llround(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2; + S32 left = ll_round(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2; S32 right = left + font->getWidth(combined_string, mViewModelItem->getFilterStringOffset(), filter_string_length) + 2; S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD); S32 top = getRect().getHeight() - TOP_PAD; @@ -1045,7 +1047,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) { S32 child_width = *width; S32 child_height = 0; - S32 child_top = parent_item_height - llround(running_height); + S32 child_top = parent_item_height - ll_round(running_height); target_height += folderp->arrange( &child_width, &child_height ); @@ -1064,7 +1066,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) { S32 child_width = *width; S32 child_height = 0; - S32 child_top = parent_item_height - llround(running_height); + S32 child_top = parent_item_height - ll_round(running_height); target_height += itemp->arrange( &child_width, &child_height ); // don't change width, as this item is as wide as its parent folder by construction @@ -1101,7 +1103,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) folders_t::iterator fit = iter++; // number of pixels that bottom of folder label is from top of parent folder if (getRect().getHeight() - (*fit)->getRect().mTop + (*fit)->getItemHeight() - > llround(mCurHeight) + mMaxFolderItemOverlap) + > ll_round(mCurHeight) + mMaxFolderItemOverlap) { // hide if beyond current folder height (*fit)->setVisible(FALSE); @@ -1114,7 +1116,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) items_t::iterator iit = iter++; // number of pixels that bottom of item label is from top of parent folder if (getRect().getHeight() - (*iit)->getRect().mBottom - > llround(mCurHeight) + mMaxFolderItemOverlap) + > ll_round(mCurHeight) + mMaxFolderItemOverlap) { (*iit)->setVisible(FALSE); } @@ -1126,12 +1128,12 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) } // don't change width as this item is already as wide as its parent folder - reshape(getRect().getWidth(),llround(mCurHeight)); + reshape(getRect().getWidth(),ll_round(mCurHeight)); // pass current height value back to parent - *height = llround(mCurHeight); + *height = ll_round(mCurHeight); - return llround(mTargetHeight); + return ll_round(mTargetHeight); } BOOL LLFolderViewFolder::needsArrange() @@ -1494,12 +1496,14 @@ void LLFolderViewFolder::destroyView() while (!mItems.empty()) { LLFolderViewItem *itemp = mItems.back(); + mItems.pop_back(); itemp->destroyView(); // LLFolderViewItem::destroyView() removes entry from mItems } while (!mFolders.empty()) { LLFolderViewFolder *folderp = mFolders.back(); + mFolders.pop_back(); folderp->destroyView(); // LLFolderVievFolder::destroyView() removes entry from mFolders } @@ -1797,9 +1801,16 @@ BOOL LLFolderViewFolder::handleDragAndDropToThisFolder(MASK mask, EAcceptance* accept, std::string& tooltip_msg) { + if (!mAllowDrop) + { + *accept = ACCEPT_NO; + tooltip_msg = LLTrans::getString("TooltipOutboxCannotDropOnRoot"); + return TRUE; + } + BOOL accepted = getViewModelItem()->dragOrDrop(mask,drop,cargo_type,cargo_data, tooltip_msg); - - if (accepted) + + if (accepted) { mDragAndDropTarget = TRUE; *accept = ACCEPT_YES_MULTI; diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index 0cd20a0f2d..4c2bb09cc5 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -59,7 +59,8 @@ public: item_top_pad; Optional<time_t> creation_date; - Optional<bool> allow_open; + Optional<bool> allow_wear; + Optional<bool> allow_drop; Optional<LLUIColor> font_color; Optional<LLUIColor> font_highlight_color; @@ -117,7 +118,8 @@ protected: mIsCurSelection, mDragAndDropTarget, mIsMouseOverTitle, - mAllowOpen, + mAllowWear, + mAllowDrop, mSelectPending; LLUIColor mFontColor; diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index f6550eae42..d60e36183b 100755 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -156,6 +156,8 @@ public: virtual void openItem( void ) = 0; virtual void closeItem( void ) = 0; virtual void selectItem(void) = 0; + + virtual BOOL isItemWearable() const { return FALSE; } virtual BOOL isItemRenameable() const = 0; virtual BOOL renameItem(const std::string& new_name) = 0; @@ -169,7 +171,7 @@ public: virtual BOOL isItemCopyable() const = 0; virtual BOOL copyToClipboard() const = 0; - virtual BOOL cutToClipboard() const = 0; + virtual BOOL cutToClipboard() = 0; virtual BOOL isClipboardPasteable() const = 0; virtual void pasteFromClipboard() = 0; diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index c59286fc60..69246a2f57 100755 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -103,7 +103,7 @@ F32 LLLayoutPanel::getVisibleAmount() const S32 LLLayoutPanel::getLayoutDim() const { - return llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL) + return ll_round((F32)((mOrientation == LLLayoutStack::HORIZONTAL) ? getRect().getWidth() : getRect().getHeight())); } @@ -130,7 +130,7 @@ void LLLayoutPanel::setTargetDim(S32 value) S32 LLLayoutPanel::getVisibleDim() const { F32 min_dim = getRelevantMinDim(); - return llround(mVisibleAmt + return ll_round(mVisibleAmt * (min_dim + (((F32)mTargetDim - min_dim) * (1.f - mCollapseAmt)))); } @@ -138,7 +138,7 @@ S32 LLLayoutPanel::getVisibleDim() const void LLLayoutPanel::setOrientation( LLView::EOrientation orientation ) { mOrientation = orientation; - S32 layout_dim = llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL) + S32 layout_dim = ll_round((F32)((mOrientation == LLLayoutStack::HORIZONTAL) ? getRect().getWidth() : getRect().getHeight())); @@ -381,14 +381,14 @@ void LLLayoutStack::updateLayout() { panelp->mTargetDim = panelp->getRelevantMinDim(); } - space_to_distribute -= panelp->getVisibleDim() + llround((F32)mPanelSpacing * panelp->getVisibleAmount()); + space_to_distribute -= panelp->getVisibleDim() + ll_round((F32)mPanelSpacing * panelp->getVisibleAmount()); total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor(); } llassert(total_visible_fraction < 1.05f); // don't need spacing after last panel - space_to_distribute += panelp ? llround((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0; + space_to_distribute += panelp ? ll_round((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0; S32 remaining_space = space_to_distribute; F32 fraction_distributed = 0.f; @@ -399,7 +399,7 @@ void LLLayoutStack::updateLayout() if (panelp->mAutoResize) { F32 fraction_to_distribute = (panelp->mFractionalSize * panelp->getAutoResizeFactor()) / (total_visible_fraction); - S32 delta = llround((F32)space_to_distribute * fraction_to_distribute); + S32 delta = ll_round((F32)space_to_distribute * fraction_to_distribute); fraction_distributed += fraction_to_distribute; panelp->mTargetDim += delta; remaining_space -= delta; @@ -431,23 +431,23 @@ void LLLayoutStack::updateLayout() LLRect panel_rect; if (mOrientation == HORIZONTAL) { - panel_rect.setLeftTopAndSize(llround(cur_pos), + panel_rect.setLeftTopAndSize(ll_round(cur_pos), getRect().getHeight(), - llround(panel_dim), + ll_round(panel_dim), getRect().getHeight()); } else { panel_rect.setLeftTopAndSize(0, - llround(cur_pos), + ll_round(cur_pos), getRect().getWidth(), - llround(panel_dim)); + ll_round(panel_dim)); } LLRect resize_bar_rect(panel_rect); F32 panel_spacing = (F32)mPanelSpacing * panelp->getVisibleAmount(); F32 panel_visible_dim = panelp->getVisibleDim(); - S32 panel_spacing_round = (S32)(llround(panel_spacing)); + S32 panel_spacing_round = (S32)(ll_round(panel_spacing)); if (mOrientation == HORIZONTAL) { diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 45f4272aa7..a08cf91a69 100755 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -88,6 +88,7 @@ LLLineEditor::Params::Params() background_image("background_image"), background_image_disabled("background_image_disabled"), background_image_focused("background_image_focused"), + bg_image_always_focused("bg_image_always_focused", false), select_on_focus("select_on_focus", false), revert_on_esc("revert_on_esc", true), spellcheck("spellcheck", false), @@ -147,6 +148,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) mBgImage( p.background_image ), mBgImageDisabled( p.background_image_disabled ), mBgImageFocused( p.background_image_focused ), + mShowImageFocused( p.bg_image_always_focused ), mHaveHistory(FALSE), mReplaceNewlinesWithSpaces( TRUE ), mLabel(p.label), @@ -829,7 +831,7 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask) // Scroll if mouse cursor outside of bounds if (mScrollTimer.hasExpired()) { - S32 increment = llround(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME); + S32 increment = ll_round(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME); mScrollTimer.reset(); mScrollTimer.setTimerExpirySec(AUTO_SCROLL_TIME); if( (x < mTextLeftEdge) && (mScrollHPos > 0 ) ) @@ -1675,7 +1677,7 @@ void LLLineEditor::drawBackground() { image = mBgImageDisabled; } - else if ( has_focus ) + else if ( has_focus || mShowImageFocused) { image = mBgImageFocused; } @@ -1833,7 +1835,7 @@ void LLLineEditor::draw() 0, LLFontGL::NO_SHADOW, select_left - mScrollHPos, - mTextRightEdge - llround(rendered_pixels_right), + mTextRightEdge - ll_round(rendered_pixels_right), &rendered_pixels_right); } @@ -1843,8 +1845,8 @@ void LLLineEditor::draw() color.setAlpha(alpha); // selected middle S32 width = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos + rendered_text, select_right - mScrollHPos - rendered_text); - width = llmin(width, mTextRightEdge - llround(rendered_pixels_right)); - gl_rect_2d(llround(rendered_pixels_right), cursor_top, llround(rendered_pixels_right)+width, cursor_bottom, color); + width = llmin(width, mTextRightEdge - ll_round(rendered_pixels_right)); + gl_rect_2d(ll_round(rendered_pixels_right), cursor_top, ll_round(rendered_pixels_right)+width, cursor_bottom, color); LLColor4 tmp_color( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], alpha ); rendered_text += mGLFont->render( @@ -1855,7 +1857,7 @@ void LLLineEditor::draw() 0, LLFontGL::NO_SHADOW, select_right - mScrollHPos - rendered_text, - mTextRightEdge - llround(rendered_pixels_right), + mTextRightEdge - ll_round(rendered_pixels_right), &rendered_pixels_right); } @@ -1870,7 +1872,7 @@ void LLLineEditor::draw() 0, LLFontGL::NO_SHADOW, S32_MAX, - mTextRightEdge - llround(rendered_pixels_right), + mTextRightEdge - ll_round(rendered_pixels_right), &rendered_pixels_right); } } @@ -1884,7 +1886,7 @@ void LLLineEditor::draw() 0, LLFontGL::NO_SHADOW, S32_MAX, - mTextRightEdge - llround(rendered_pixels_right), + mTextRightEdge - ll_round(rendered_pixels_right), &rendered_pixels_right); } #if 1 // for when we're ready for image art. @@ -2044,7 +2046,7 @@ void LLLineEditor::draw() 0, LLFontGL::NO_SHADOW, S32_MAX, - mTextRightEdge - llround(rendered_pixels_right), + mTextRightEdge - ll_round(rendered_pixels_right), &rendered_pixels_right, FALSE); } @@ -2069,7 +2071,7 @@ void LLLineEditor::draw() 0, LLFontGL::NO_SHADOW, S32_MAX, - mTextRightEdge - llround(rendered_pixels_right), + mTextRightEdge - ll_round(rendered_pixels_right), &rendered_pixels_right, FALSE); } // Draw children (border) @@ -2573,7 +2575,7 @@ void LLLineEditor::markAsPreedit(S32 position, S32 length) S32 LLLineEditor::getPreeditFontSize() const { - return llround(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]); + return ll_round(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]); } void LLLineEditor::setReplaceNewlinesWithSpaces(BOOL replace) diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 40f931ecc1..c6d472f59b 100755 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -90,6 +90,7 @@ public: spellcheck, commit_on_focus_lost, ignore_tab, + bg_image_always_focused, is_password; // colors @@ -375,6 +376,8 @@ protected: BOOL mReadOnly; + BOOL mShowImageFocused; + LLWString mPreeditWString; LLWString mPreeditOverwrittenWString; std::vector<S32> mPreeditPositions; diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 31df853ab4..f290edb5ff 100755 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -101,17 +101,10 @@ const std::string LLMenuGL::ARROW_DOWN("vvvvvvv"); const F32 MAX_MOUSE_SLOPE_SUB_MENU = 0.9f; -const S32 PIE_GESTURE_ACTIVATE_DISTANCE = 10; - BOOL LLMenuGL::sKeyboardMode = FALSE; LLHandle<LLView> LLMenuHolderGL::sItemLastSelectedHandle; LLFrameTimer LLMenuHolderGL::sItemActivationTimer; -//LLColor4 LLMenuGL::sBackgroundColor( 0.8f, 0.8f, 0.0f, 1.0f ); - -const S32 PIE_CENTER_SIZE = 20; // pixels, radius of center hole -const F32 PIE_SCALE_FACTOR = 1.7f; // scale factor for pie menu when mouse is initially down -const F32 PIE_SHRINK_TIME = 0.2f; // time of transition between unbounded and bounded display of pie menu const F32 ACTIVATE_HIGHLIGHT_TIME = 0.3f; @@ -1589,7 +1582,7 @@ void LLMenuItemBranchDownGL::draw( void ) std::string::size_type offset = upper_case_label.find(getJumpKey()); if (offset != std::string::npos) { - S32 x_offset = llround((F32)getRect().getWidth() / 2.f - getFont()->getWidthF32(mLabel.getString(), 0, S32_MAX) / 2.f); + S32 x_offset = ll_round((F32)getRect().getWidth() / 2.f - getFont()->getWidthF32(mLabel.getString(), 0, S32_MAX) / 2.f); S32 x_begin = x_offset + getFont()->getWidth(mLabel, 0, offset); S32 x_end = x_offset + getFont()->getWidth(mLabel, 0, offset + 1); gl_line_2d(x_begin, LABEL_BOTTOM_PAD_PIXELS, x_end, LABEL_BOTTOM_PAD_PIXELS); @@ -3026,8 +3019,8 @@ BOOL LLMenuGL::handleHover( S32 x, S32 y, MASK mask ) LLVector2 mouse_avg_dir((F32)mMouseVelX, (F32)mMouseVelY); mouse_avg_dir.normVec(); F32 interp = 0.5f * (llclamp(mouse_dir * mouse_avg_dir, 0.f, 1.f)); - mMouseVelX = llround(lerp((F32)mouse_delta_x, (F32)mMouseVelX, interp)); - mMouseVelY = llround(lerp((F32)mouse_delta_y, (F32)mMouseVelY, interp)); + mMouseVelX = ll_round(lerp((F32)mouse_delta_x, (F32)mMouseVelX, interp)); + mMouseVelY = ll_round(lerp((F32)mouse_delta_y, (F32)mMouseVelY, interp)); mLastMouseX = x; mLastMouseY = y; diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 33e66add18..8cf88ad5eb 100755 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -287,7 +287,7 @@ void LLModalDialog::draw() void LLModalDialog::centerOnScreen() { LLVector2 window_size = LLUI::getWindowSize(); - centerWithin(LLRect(0, 0, llround(window_size.mV[VX]), llround(window_size.mV[VY]))); + centerWithin(LLRect(0, 0, ll_round(window_size.mV[VX]), ll_round(window_size.mV[VY]))); } diff --git a/indra/llui/llprogressbar.cpp b/indra/llui/llprogressbar.cpp index 84a890edfa..209796565c 100755 --- a/indra/llui/llprogressbar.cpp +++ b/indra/llui/llprogressbar.cpp @@ -77,7 +77,7 @@ void LLProgressBar::draw() LLColor4 bar_color = mColorBar.get(); bar_color.mV[VALPHA] *= alpha; // modulate alpha LLRect progress_rect = getLocalRect(); - progress_rect.mRight = llround(getRect().getWidth() * (mPercentDone / 100.f)); + progress_rect.mRight = ll_round(getRect().getWidth() * (mPercentDone / 100.f)); mImageFill->draw(progress_rect, bar_color); } diff --git a/indra/llui/llrngwriter.cpp b/indra/llui/llrngwriter.cpp index cd9fe3610e..e4a31d6a79 100755 --- a/indra/llui/llrngwriter.cpp +++ b/indra/llui/llrngwriter.cpp @@ -28,7 +28,16 @@ #include "llrngwriter.h" #include "lluicolor.h" + +#if LL_DARWIN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-incomplete" +#include "lluictrlfactory.h" +#pragma clang diagnostic pop +#else #include "lluictrlfactory.h" +#endif + #include "boost/bind.hpp" static LLInitParam::Parser::parser_read_func_map_t sReadFuncs; diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 8c506d76bb..f70eebc594 100755 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -48,7 +48,6 @@ /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -static const S32 HORIZONTAL_MULTIPLE = 8; static const S32 VERTICAL_MULTIPLE = 16; static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f; @@ -315,7 +314,7 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) // clip rect against root view inner_rect_local.intersectWith(screen_local_extents); - S32 auto_scroll_speed = llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32()); + S32 auto_scroll_speed = ll_round(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32()); // autoscroll region should take up no more than one third of visible scroller area S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, 10); S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, 10); diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 5f72ee3ac6..899a0bbab9 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -648,7 +648,7 @@ bool LLScrollListCtrl::updateColumnWidths() S32 new_width = 0; if (column->mRelWidth >= 0) { - new_width = (S32)llround(column->mRelWidth*mItemListRect.getWidth()); + new_width = (S32)ll_round(column->mRelWidth*mItemListRect.getWidth()); } else if (column->mDynamicWidth) { @@ -2095,9 +2095,6 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) // not called from parent means we have keyboard focus or a child does if (mCanSelect) { - // Ignore capslock - mask = mask; - if (mask == MASK_NONE) { switch(key) @@ -2682,7 +2679,7 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params } if (new_column->mRelWidth >= 0) { - new_column->setWidth((S32)llround(new_column->mRelWidth*mItemListRect.getWidth())); + new_column->setWidth((S32)ll_round(new_column->mRelWidth*mItemListRect.getWidth())); } else if(new_column->mDynamicWidth) { diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index 2da39fa54b..0056cb6dc4 100755 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -43,8 +43,6 @@ #include "llresmgr.h" #include "lluictrlfactory.h" -const U32 MAX_STRING_LENGTH = 10; - static LLDefaultChildRegistry::Register<LLSliderCtrl> r("slider"); LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p) diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp index ebdbdf59c0..8b1ba406c8 100755 --- a/indra/llui/llspinctrl.cpp +++ b/indra/llui/llspinctrl.cpp @@ -153,7 +153,7 @@ F32 clamp_precision(F32 value, S32 decimal_precision) for (S32 i = 0; i < decimal_precision; i++) clamped_value *= 10.0; - clamped_value = llround((F32)clamped_value); + clamped_value = ll_round((F32)clamped_value); for (S32 i = 0; i < decimal_precision; i++) clamped_value /= 10.0; diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 303417c337..35f5330a3f 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -711,7 +711,7 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) if (tick_begin > last_label + MIN_LABEL_SPACING) { gl_rect_2d(tick_begin, bar_rect.mTop, tick_end, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.25f)); - S32 label_pos = tick_begin - llround((F32)tick_label_width * ((F32)tick_begin / (F32)bar_rect.getWidth())); + S32 label_pos = tick_begin - ll_round((F32)tick_label_width * ((F32)tick_begin / (F32)bar_rect.getWidth())); LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, label_pos, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.5f), LLFontGL::LEFT, LLFontGL::TOP); diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 89d7ff24ed..1ff4c67fc5 100755 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -80,7 +80,6 @@ private: mFloatingTargetMaxBar, mCurMaxBar, mCurMinBar, - mLabelSpacing, mTickSpacing; S32 mDecimalDigits, mNumHistoryFrames, diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index 98962aff9a..3fe314e77a 100755 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -111,7 +111,7 @@ void LLStatGraph::draw() color = it->mColor; gGL.color4fv(color.mV); - gl_rect_2d(1, llround(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE); + gl_rect_2d(1, ll_round(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE); } void LLStatGraph::setMin(const F32 min) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 09f923e74f..43e048d216 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1557,7 +1557,7 @@ void LLTextBase::reflow() line_count)); line_start_index = segment->getStart() + seg_offset; - cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels; + cur_top -= ll_round((F32)line_height * mLineSpacingMult) + mLineSpacingPixels; remaining_pixels = text_available_width; line_height = 0; } @@ -1569,7 +1569,7 @@ void LLTextBase::reflow() last_segment_char_on_line, line_rect, line_count)); - cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels; + cur_top -= ll_round((F32)line_height * mLineSpacingMult) + mLineSpacingPixels; break; } // ...or finished a segment and there are segments remaining on this line @@ -1584,7 +1584,7 @@ void LLTextBase::reflow() line_rect, line_count)); line_start_index = segment->getStart() + seg_offset; - cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels; + cur_top -= ll_round((F32)line_height * mLineSpacingMult) + mLineSpacingPixels; line_height = 0; remaining_pixels = text_available_width; } diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index cf5fdef539..c433f8ccab 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2840,7 +2840,7 @@ void LLTextEditor::markAsPreedit(S32 position, S32 length) S32 LLTextEditor::getPreeditFontSize() const { - return llround((F32)mFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]); + return ll_round((F32)mFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]); } BOOL LLTextEditor::isDirty() const diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp index 234e600ccd..324ceb7fba 100755 --- a/indra/llui/lltextvalidate.cpp +++ b/indra/llui/lltextvalidate.cpp @@ -336,7 +336,7 @@ namespace LLTextValidate S32 len = str.length(); while(len--) { - if (str[len] < 0x20 && str[len] != 0xA || str[len] > 0x7f) + if ((str[len] < 0x20 && str[len] != 0xA) || str[len] > 0x7f) { rv = FALSE; break; diff --git a/indra/llui/lltimectrl.cpp b/indra/llui/lltimectrl.cpp index 9ea1e8815e..516057f8fd 100755 --- a/indra/llui/lltimectrl.cpp +++ b/indra/llui/lltimectrl.cpp @@ -153,7 +153,7 @@ U32 LLTimeCtrl::getMinutes() const void LLTimeCtrl::setTime24(F32 time) { time = llclamp(time, 0.0f, 23.99f); // fix out of range values - mTime = llround(time * MINUTES_PER_HOUR); // fixes values like 4.99999 + mTime = ll_round(time * MINUTES_PER_HOUR); // fixes values like 4.99999 updateText(); } @@ -381,7 +381,7 @@ bool LLTimeCtrl::isHoursStringValid(const std::string& str) bool LLTimeCtrl::isMinutesStringValid(const std::string& str) { U32 minutes; - if (!LLStringUtil::convertToU32(str, minutes) || (minutes <= MINUTES_MAX) && str.length() < 3) + if (!LLStringUtil::convertToU32(str, minutes) || ((minutes <= MINUTES_MAX) && str.length() < 3)) return true; return false; @@ -415,7 +415,8 @@ U32 LLTimeCtrl::parseHours(const std::string& str) U32 LLTimeCtrl::parseMinutes(const std::string& str) { U32 minutes; - if (LLStringUtil::convertToU32(str, minutes) && (minutes >= MINUTES_MIN) && (minutes <= MINUTES_MAX)) + // not sure of this fix - clang doesnt like compare minutes U32 to >= MINUTES_MIN (0) but MINUTES_MIN can change + if (LLStringUtil::convertToU32(str, minutes) && ((S32)minutes >= MINUTES_MIN) && ((S32)minutes <= MINUTES_MAX)) { return minutes; } diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 1f570edd88..aabc7ed2e4 100755 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -236,8 +236,8 @@ void LLUI::dirtyRect(LLRect rect) void LLUI::setMousePositionScreen(S32 x, S32 y) { S32 screen_x, screen_y; - screen_x = llround((F32)x * getScaleFactor().mV[VX]); - screen_y = llround((F32)y * getScaleFactor().mV[VY]); + screen_x = ll_round((F32)x * getScaleFactor().mV[VX]); + screen_y = ll_round((F32)y * getScaleFactor().mV[VY]); LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert()); } @@ -248,8 +248,8 @@ void LLUI::getMousePositionScreen(S32 *x, S32 *y) LLCoordWindow cursor_pos_window; getWindow()->getCursorPosition(&cursor_pos_window); LLCoordGL cursor_pos_gl(cursor_pos_window.convert()); - *x = llround((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]); - *y = llround((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]); + *x = ll_round((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]); + *y = ll_round((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]); } //static @@ -369,15 +369,15 @@ LLVector2 LLUI::getWindowSize() //static void LLUI::screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y) { - *gl_x = llround((F32)screen_x * getScaleFactor().mV[VX]); - *gl_y = llround((F32)screen_y * getScaleFactor().mV[VY]); + *gl_x = ll_round((F32)screen_x * getScaleFactor().mV[VX]); + *gl_y = ll_round((F32)screen_y * getScaleFactor().mV[VY]); } //static void LLUI::glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y) { - *screen_x = llround((F32)gl_x / getScaleFactor().mV[VX]); - *screen_y = llround((F32)gl_y / getScaleFactor().mV[VY]); + *screen_x = ll_round((F32)gl_x / getScaleFactor().mV[VX]); + *screen_y = ll_round((F32)gl_y / getScaleFactor().mV[VY]); } //static diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index a5796c8af2..3ce39c947f 100755 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -183,7 +183,15 @@ public: if (!widget) { LL_WARNS() << "Widget in " << filename << " was of type " << typeid(view).name() << " instead of expected type " << typeid(T).name() << LL_ENDL; + +#if LL_DARWIN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdelete-incomplete" + delete view; +#pragma clang diagnostic pop +#else delete view; +#endif view = NULL; } } diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index c06d6144b9..7e4104c49b 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -868,9 +868,9 @@ void LLUrlEntryParcel::processParcelInfo(const LLParcelData& parcel_data) // If parcel name is empty use Sim_name (x, y, z) for parcel label. else if (!parcel_data.sim_name.empty()) { - S32 region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS; - S32 region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS; - S32 region_z = llround(parcel_data.global_z); + S32 region_x = ll_round(parcel_data.global_x) % REGION_WIDTH_UNITS; + S32 region_y = ll_round(parcel_data.global_y) % REGION_WIDTH_UNITS; + S32 region_z = ll_round(parcel_data.global_z); label = llformat("%s (%d, %d, %d)", parcel_data.sim_name.c_str(), region_x, region_y, region_z); diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 9e6bebc93b..a8beb9cfc9 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -2164,10 +2164,6 @@ LLControlVariable *LLView::findControl(const std::string& name) return control_group.getControl(name); } -const S32 FLOATER_H_MARGIN = 15; -const S32 MIN_WIDGET_HEIGHT = 10; -const S32 VPAD = 4; - void LLView::initFromParams(const LLView::Params& params) { LLRect required_rect = getRequiredRect(); diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 37d88cb9f9..99a0869ce3 100755 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -58,7 +58,9 @@ static LLInitParam::Parser::parser_inspect_func_map_t sSimpleXUIInspectFuncs; const char* NO_VALUE_MARKER = "no_value"; +#ifdef LL_WINDOWS const S32 LINE_NUMBER_HERE = 0; +#endif struct MaxOccursValues : public LLInitParam::TypeValuesHelper<U32, MaxOccursValues> { diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp index a9d96c9807..76296ff877 100755 --- a/indra/llvfs/lldiriterator.cpp +++ b/indra/llvfs/lldiriterator.cpp @@ -127,7 +127,8 @@ bool LLDirIterator::Impl::next(std::string &fname) { boost::smatch match; std::string name = mIter->path().filename().string(); - if (found = boost::regex_match(name, match, mFilterExp)) + found = boost::regex_match(name, match, mFilterExp); + if (found) { fname = name; } diff --git a/indra/llvfs/llvfs_objc.h b/indra/llvfs/llvfs_objc.h index 90101eb2e9..56cdbebfc5 100755 --- a/indra/llvfs/llvfs_objc.h +++ b/indra/llvfs/llvfs_objc.h @@ -40,4 +40,4 @@ std::string* getSystemResourceFolder(); std::string* getSystemExecutableFolder(); -#endif LL_LLVFS_OBJC_H +#endif // LL_LLVFS_OBJC_H diff --git a/indra/llvfs/llvfs_objc.mm b/indra/llvfs/llvfs_objc.mm index 47b0e73978..282ea41339 100755 --- a/indra/llvfs/llvfs_objc.mm +++ b/indra/llvfs/llvfs_objc.mm @@ -48,7 +48,7 @@ std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory, { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - std::string *result; + std::string *result = nil; NSString *path = nil; // Search for the path diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 9e7093782e..1c9160a42d 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -104,20 +104,20 @@ attributedStringInfo getSegments(NSAttributedString *str) - (unsigned long)getVramSize { CGLRendererInfoObj info = 0; - GLint vram_mbytes = 0; + GLint vram_megabytes = 0; int num_renderers = 0; CGLError the_err = CGLQueryRendererInfo (CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay), &info, &num_renderers); if(0 == the_err) { - CGLDescribeRenderer (info, 0, kCGLRPTextureMemoryMegabytes, &vram_mbytes); + CGLDescribeRenderer (info, 0, kCGLRPTextureMemoryMegabytes, &vram_megabytes); CGLDestroyRendererInfo (info); } else { - vram_mbytes = 256; + vram_megabytes = 256; } - return (unsigned long)vram_mbytes; + return (unsigned long)vram_megabytes; // return value is in megabytes. } - (void)viewDidMoveToWindow diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index d7aa47f378..b2f1d618ef 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -44,15 +44,9 @@ extern BOOL gDebugWindowProc; -// culled from winuser.h -//const S32 WHEEL_DELTA = 120; /* Value for rolling one detent */ -// On the Mac, the scroll wheel reports a delta of 1 for each detent. -// There's also acceleration for faster scrolling, based on a slider in the system preferences. -const S32 WHEEL_DELTA = 1; /* Value for rolling one detent */ const S32 BITS_PER_PIXEL = 32; const S32 MAX_NUM_RESOLUTIONS = 32; - // // LLWindowMacOSX // @@ -244,8 +238,8 @@ void callRightMouseDown(float *pos, MASK mask) } LLCoordGL outCoords; - outCoords.mX = llround(pos[0]); - outCoords.mY = llround(pos[1]); + outCoords.mX = ll_round(pos[0]); + outCoords.mY = ll_round(pos[1]); gWindowImplementation->getCallbacks()->handleRightMouseDown(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); } @@ -257,8 +251,8 @@ void callRightMouseUp(float *pos, MASK mask) } LLCoordGL outCoords; - outCoords.mX = llround(pos[0]); - outCoords.mY = llround(pos[1]); + outCoords.mX = ll_round(pos[0]); + outCoords.mY = ll_round(pos[1]); gWindowImplementation->getCallbacks()->handleRightMouseUp(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); } @@ -270,8 +264,8 @@ void callLeftMouseDown(float *pos, MASK mask) } LLCoordGL outCoords; - outCoords.mX = llround(pos[0]); - outCoords.mY = llround(pos[1]); + outCoords.mX = ll_round(pos[0]); + outCoords.mY = ll_round(pos[1]); gWindowImplementation->getCallbacks()->handleMouseDown(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); } @@ -283,8 +277,8 @@ void callLeftMouseUp(float *pos, MASK mask) } LLCoordGL outCoords; - outCoords.mX = llround(pos[0]); - outCoords.mY = llround(pos[1]); + outCoords.mX = ll_round(pos[0]); + outCoords.mY = ll_round(pos[1]); gWindowImplementation->getCallbacks()->handleMouseUp(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); } @@ -297,8 +291,8 @@ void callDoubleClick(float *pos, MASK mask) } LLCoordGL outCoords; - outCoords.mX = llround(pos[0]); - outCoords.mY = llround(pos[1]); + outCoords.mX = ll_round(pos[0]); + outCoords.mY = ll_round(pos[1]); gWindowImplementation->getCallbacks()->handleDoubleClick(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); } @@ -313,8 +307,8 @@ void callResize(unsigned int width, unsigned int height) void callMouseMoved(float *pos, MASK mask) { LLCoordGL outCoords; - outCoords.mX = llround(pos[0]); - outCoords.mY = llround(pos[1]); + outCoords.mX = ll_round(pos[0]); + outCoords.mY = ll_round(pos[1]); float deltas[2]; gWindowImplementation->getMouseDeltas(deltas); outCoords.mX += deltas[0]; @@ -376,8 +370,8 @@ void callDeltaUpdate(float *delta, MASK mask) void callMiddleMouseDown(float *pos, MASK mask) { LLCoordGL outCoords; - outCoords.mX = llround(pos[0]); - outCoords.mY = llround(pos[1]); + outCoords.mX = ll_round(pos[0]); + outCoords.mY = ll_round(pos[1]); float deltas[2]; gWindowImplementation->getMouseDeltas(deltas); outCoords.mX += deltas[0]; @@ -388,8 +382,8 @@ void callMiddleMouseDown(float *pos, MASK mask) void callMiddleMouseUp(float *pos, MASK mask) { LLCoordGL outCoords; - outCoords.mX = llround(pos[0]); - outCoords.mY = llround(pos[1]); + outCoords.mX = ll_round(pos[0]); + outCoords.mY = ll_round(pos[1]); float deltas[2]; gWindowImplementation->getMouseDeltas(deltas); outCoords.mX += deltas[0]; @@ -525,8 +519,8 @@ void LLWindowMacOSX::updateMouseDeltas(float* deltas) { if (mCursorDecoupled) { - mCursorLastEventDeltaX = llround(deltas[0]); - mCursorLastEventDeltaY = llround(-deltas[1]); + mCursorLastEventDeltaX = ll_round(deltas[0]); + mCursorLastEventDeltaY = ll_round(-deltas[1]); if (mCursorIgnoreNextDelta) { diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index cb99496ef1..455df13e48 100755 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -43,8 +43,6 @@ #include "lluuid.h" #include "lldir.h" -const S32 MAX_COLUMN_WIDTH = 80; - // static BOOL LLXMLNode::sStripEscapedStrings = TRUE; BOOL LLXMLNode::sStripWhitespaceValues = FALSE; diff --git a/indra/lscript/lscript_execute/lscript_readlso.cpp b/indra/lscript/lscript_execute/lscript_readlso.cpp index 7ec56c2409..abcb28e998 100755 --- a/indra/lscript/lscript_execute/lscript_readlso.cpp +++ b/indra/lscript/lscript_execute/lscript_readlso.cpp @@ -114,7 +114,7 @@ void LLScriptLSOParse::printRegisters(LLFILE *fp) else if (gMajorVersion == LSL2_MAJOR_VERSION_TWO) { U64 data = get_register_u64(mRawData, (LSCRIPTRegisters)i); - fprintf(fp, "%s: 0x%X%X\n", gLSCRIPTRegisterNames[i], (U32)(data>>32), (U32)(data && 0xFFFFFFFF)); + fprintf(fp, "%s: 0x%X%X\n", gLSCRIPTRegisterNames[i], (U32)(data>>32), (U32)(data & 0xFFFFFFFF)); } } fprintf(fp, "=============================\n\n"); diff --git a/indra/media_plugins/example/media_plugin_example.cpp b/indra/media_plugins/example/media_plugin_example.cpp index da7de01799..66c00cd58c 100755 --- a/indra/media_plugins/example/media_plugin_example.cpp +++ b/indra/media_plugins/example/media_plugin_example.cpp @@ -363,10 +363,10 @@ void MediaPluginExample::update( F64 milliseconds ) }; if ( mXpos[ n ] + mXInc[ n ] < 0 || mXpos[ n ] + mXInc[ n ] >= mWidth - mBlockSize[ n ] ) - mXInc[ n ] =- mXInc[ n ]; + mXInc[ n ]= -mXInc[ n ]; if ( mYpos[ n ] + mYInc[ n ] < 0 || mYpos[ n ] + mYInc[ n ] >= mHeight - mBlockSize[ n ] ) - mYInc[ n ] =- mYInc[ n ]; + mYInc[ n ]= -mYInc[ n ]; mXpos[ n ] += mXInc[ n ]; mYpos[ n ] += mYInc[ n ]; diff --git a/indra/media_plugins/winmmshim/forwarding_api.cpp b/indra/media_plugins/winmmshim/forwarding_api.cpp index 495e08942b..33f0675028 100755 --- a/indra/media_plugins/winmmshim/forwarding_api.cpp +++ b/indra/media_plugins/winmmshim/forwarding_api.cpp @@ -1338,7 +1338,7 @@ extern "C" { return joySetThreshold_orig( uJoyID, uThreshold); } - BOOL WINAPI mciDriverNotify(HWND hwndCallback, UINT uDeviceID, UINT uStatus) + BOOL WINAPI mciDriverNotify(HANDLE hwndCallback, MCIDEVICEID uDeviceID, UINT uStatus) { ll_winmm_shim_initialize(); //OutputDebugString(L"mciDriverNotify\n"); @@ -1610,7 +1610,7 @@ extern "C" { return mciGetYieldProc_orig( mciId, pdwYieldData); } - UINT WINAPI mciLoadCommandResource(HINSTANCE hInstance, LPCWSTR lpResName, UINT uType) + UINT WINAPI mciLoadCommandResource(HANDLE hInstance, LPCWSTR lpResName, UINT uType) { ll_winmm_shim_initialize(); //OutputDebugString(L"mciLoadCommandResource"); diff --git a/indra/media_plugins/winmmshim/forwarding_api.h b/indra/media_plugins/winmmshim/forwarding_api.h index 076a08f769..1418fc9e1d 100755 --- a/indra/media_plugins/winmmshim/forwarding_api.h +++ b/indra/media_plugins/winmmshim/forwarding_api.h @@ -306,7 +306,7 @@ typedef MMRESULT (WINAPI *joySetCapture_type)( HWND hwnd, UINT uJoyID, UINT uPer extern joySetCapture_type joySetCapture_orig; typedef MMRESULT (WINAPI *joySetThreshold_type)( UINT uJoyID, UINT uThreshold); extern joySetThreshold_type joySetThreshold_orig; -typedef BOOL (WINAPI *mciDriverNotify_type)(HWND hwndCallback, UINT uDeviceID, UINT uStatus); +typedef BOOL(WINAPI *mciDriverNotify_type)(HANDLE hwndCallback, MCIDEVICEID uDeviceID, UINT uStatus); extern mciDriverNotify_type mciDriverNotify_orig; typedef UINT (WINAPI *mciDriverYield_type)(UINT uDeviceID); extern mciDriverYield_type mciDriverYield_orig; @@ -384,7 +384,7 @@ typedef HTASK (WINAPI *mciGetCreatorTask_type)( MCIDEVICEID mciId); extern mciGetCreatorTask_type mciGetCreatorTask_orig; typedef YIELDPROC (WINAPI *mciGetYieldProc_type)( MCIDEVICEID mciId, LPDWORD pdwYieldData); extern mciGetYieldProc_type mciGetYieldProc_orig; -typedef UINT (WINAPI *mciLoadCommandResource_type)(HINSTANCE hInstance, LPCWSTR lpResName, UINT uType); +typedef UINT (WINAPI *mciLoadCommandResource_type)(HANDLE hInstance, LPCWSTR lpResName, UINT uType); extern mciLoadCommandResource_type mciLoadCommandResource_orig; typedef BOOL (WINAPI *mciExecute_type)(LPCSTR pszCommand); extern mciExecute_type mciExecute_orig; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 318e3c8688..99cc707fbc 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -4,17 +4,19 @@ project(viewer) include(00-Common) include(Boost) +include(BuildPackagesInfo) include(BuildVersion) +include(CMakeCopyIfDifferent) include(DBusGlib) include(DirectX) -include(OpenSSL) include(DragDrop) include(EXPAT) include(FMODEX) -include(OPENAL) -include(OpenGL) +include(GLOD) +include(GooglePerfTools) include(Hunspell) include(JsonCpp) +include(LLAppearance) include(LLAudio) include(LLCharacter) include(LLCommon) @@ -22,6 +24,8 @@ include(LLCoreHttp) include(LLImage) include(LLImageJ2COJ) include(LLInventory) +include(LLKDU) +include(LLLogin) include(LLMath) include(LLMessage) include(LLPhysicsExtensions) @@ -36,18 +40,16 @@ include(LScript) include(Linking) include(NDOF) include(NVAPI) -include(GooglePerfTools) +include(OPENAL) +include(OpenGL) +include(OpenSSL) +include(PNG) +include(Prebuilt) include(TemplateCheck) include(UI) include(UnixInstall) -include(LLKDU) include(ViewerMiscLibs) -include(LLLogin) include(VisualLeakDetector) -include(GLOD) -include(CMakeCopyIfDifferent) -include(LLAppearance) -include(PNG) include(ZLIB) include(URIPARSER) @@ -60,6 +62,9 @@ if(FMODEX) include_directories(${FMODEX_INCLUDE_DIR}) endif(FMODEX) +# install SLPlugin host executable and its dynamic-library plugins +use_prebuilt_binary(slplugins) + include_directories( ${DBUSGLIB_INCLUDE_DIRS} ${JSONCPP_INCLUDE_DIR} @@ -257,6 +262,7 @@ set(viewer_SOURCE_FILES llfloaterlagmeter.cpp llfloaterland.cpp llfloaterlandholdings.cpp + llfloatermarketplacelistings.cpp llfloatermap.cpp llfloatermediasettings.cpp llfloatermemleak.cpp @@ -867,6 +873,7 @@ set(viewer_HEADER_FILES llfloaterland.h llfloaterlandholdings.h llfloatermap.h + llfloatermarketplacelistings.h llfloatermediasettings.h llfloatermemleak.h llfloatermodelpreview.h @@ -1301,7 +1308,7 @@ set(viewer_HEADER_FILES source_group("CMake Rules" FILES ViewerInstall.cmake) -# the viewer_version.txt file created here is for passing to viewer_manifest +# the viewer_version.txt file created here is for passing to viewer_manifest and autobuild # the summary.json file is created for the benefit of the TeamCity builds, where # it is used to provide descriptive information to the build results page add_custom_target(generate_viewer_version ALL @@ -1372,6 +1379,9 @@ if (LINUX) set(viewer_LIBRARIES Xinerama ) + if (OPENAL) + LIST(APPEND viewer_LIBRARIES ${OPENAL_LIBRARIES}) + endif (OPENAL) endif (LINUX) if (WINDOWS) @@ -1586,6 +1596,7 @@ set(viewer_APPSETTINGS_FILES app_settings/viewerart.xml ${CMAKE_SOURCE_DIR}/../etc/message.xml ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg + packages-info.txt ) source_group("App Settings" FILES ${viewer_APPSETTINGS_FILES}) @@ -1666,6 +1677,9 @@ if (WINDOWS) LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO /LARGEADDRESSAWARE" LINK_FLAGS_RELEASE "/FORCE:MULTIPLE /MAP\"secondlife-bin.MAP\" /OPT:REF /LARGEADDRESSAWARE" ) + + add_dependencies(${VIEWER_BINARY_NAME} generate_viewer_version) + if(USE_PRECOMPILED_HEADERS) set_target_properties( ${VIEWER_BINARY_NAME} @@ -1801,7 +1815,6 @@ if (WINDOWS) --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - generate_viewer_version stage_third_party_libs ${COPY_INPUT_DEPENDENCIES} COMMENT "Performing viewer_manifest copy" @@ -1815,10 +1828,10 @@ if (WINDOWS) add_dependencies(${VIEWER_BINARY_NAME} copy_win_scripts) endif (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts) - add_dependencies(${VIEWER_BINARY_NAME} - SLPlugin - windows-crash-logger - ) +## add_dependencies(${VIEWER_BINARY_NAME} +## SLPlugin +## windows-crash-logger +## ) # sets the 'working directory' for debugging from visual studio. if (NOT UNATTENDED) @@ -1873,10 +1886,9 @@ if (WINDOWS) ${COPY_INPUT_DEPENDENCIES} ) - add_custom_target(package ALL DEPENDS + add_custom_target(llpackage ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat windows-setup-build-all - generate_viewer_version ) # temporarily disable packaging of event_host until hg subrepos get # sorted out on the parabuild cluster... @@ -1986,12 +1998,14 @@ if (LINUX) set(COPY_INPUT_DEPENDENCIES ${VIEWER_BINARY_NAME} linux-crash-logger - SLPlugin - media_plugin_webkit - media_plugin_gstreamer010 +## SLPlugin +## media_plugin_webkit +## media_plugin_gstreamer010 llcommon ) + add_dependencies(${VIEWER_BINARY_NAME} generate_viewer_version) + add_custom_command( OUTPUT ${product}.tar.bz2 COMMAND ${PYTHON_EXECUTABLE} @@ -2010,7 +2024,6 @@ if (LINUX) --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - generate_viewer_version ${COPY_INPUT_DEPENDENCIES} ) @@ -2035,7 +2048,6 @@ if (LINUX) --source=${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - generate_viewer_version ${COPY_INPUT_DEPENDENCIES} COMMENT "Performing viewer_manifest copy" ) @@ -2043,10 +2055,10 @@ if (LINUX) add_custom_target(copy_l_viewer_manifest ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched) if (PACKAGE) - add_custom_target(package ALL DEPENDS ${product}.tar.bz2) + add_custom_target(llpackage ALL DEPENDS ${product}.tar.bz2) # Make sure we don't run two instances of viewer_manifest.py at the same time. - add_dependencies(package copy_l_viewer_manifest) - check_message_template(package) + add_dependencies(llpackage copy_l_viewer_manifest) + check_message_template(llpackage) endif (PACKAGE) endif (LINUX) @@ -2077,6 +2089,8 @@ if (DARWIN) "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app/Contents/Info.plist" ) + add_dependencies(${VIEWER_BINARY_NAME} generate_viewer_version) + add_custom_command( TARGET ${VIEWER_BINARY_NAME} POST_BUILD COMMAND ${PYTHON_EXECUTABLE} @@ -2096,10 +2110,10 @@ if (DARWIN) DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - generate_viewer_version ) - add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-crash-logger) +##add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-crash-logger) + add_dependencies(${VIEWER_BINARY_NAME} mac-crash-logger) if (ENABLE_SIGNING) set(SIGNING_SETTING "--signature=${SIGNING_IDENTITY}") @@ -2108,11 +2122,11 @@ if (DARWIN) endif (ENABLE_SIGNING) if (PACKAGE) - add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME}) - add_dependencies(package generate_viewer_version) + add_custom_target(llpackage ALL DEPENDS ${VIEWER_BINARY_NAME}) + add_dependencies(llpackage generate_viewer_version) add_custom_command( - TARGET package POST_BUILD + TARGET llpackage POST_BUILD COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py @@ -2131,7 +2145,6 @@ if (DARWIN) ${SIGNING_SETTING} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - generate_viewer_version ) endif (PACKAGE) endif (DARWIN) @@ -2154,19 +2167,21 @@ if (PACKAGE) if (DARWIN) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") # *TODO: Generate these search dirs in the cmake files related to each binary. - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}") +## list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}") - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}") - list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/webkit/${CMAKE_CFG_INTDIR}") +## list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") +## list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}") +## list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/webkit/${CMAKE_CFG_INTDIR}") set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin.tar.bz2") - set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger") +## set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger") + set(VIEWER_EXE_GLOBS "'Second Life' mac-crash-logger") set(VIEWER_LIB_GLOB "*.dylib") endif (DARWIN) if (LINUX) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged") set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-linux.tar.bz2") - set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin") +## set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin") + set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin") set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*") set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest) endif (LINUX) @@ -2194,7 +2209,7 @@ if (PACKAGE) add_custom_target(generate_breakpad_symbols DEPENDS "${VIEWER_SYMBOL_FILE}") add_dependencies(generate_breakpad_symbols "${VIEWER_BINARY_NAME}" "${VIEWER_COPY_MANIFEST}") - add_dependencies(package generate_breakpad_symbols) + add_dependencies(llpackage generate_breakpad_symbols) endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) endif (PACKAGE) @@ -2372,11 +2387,6 @@ include(LLAddBuildTest) SET(viewer_TEST_SOURCE_FILES llagentaccess.cpp llwlparammanager.cpp - # Not *actually* a unit test, it's an integration test. - # Because it won't work in the new unit test iface, i've commented out - # and notified Nat. Delete this when it's replaced! - # + poppy & brad 2009-06-05 - # llcapabilitylistener.cpp ) set_source_files_properties( ${viewer_TEST_SOURCE_FILES} diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 7b329e2092..2cd6638042 100755 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -118,6 +118,18 @@ tooltip_ref="Command_Marketplace_Tooltip" execute_function="Avatar.OpenMarketplace" /> + <command name="marketplacelistings" + available_in_toybox="true" + icon="Command_MktListings_Icon" + label_ref="Command_MarketplaceListings_Label" + tooltip_ref="Command_MarketplaceListings_Tooltip" + execute_function="Marketplace.Toggle" + execute_parameters="marketplace" + is_enabled_function="Marketplace.Enabled" + is_enabled_parameters="marketplace" + is_running_function="Floater.IsOpen" + is_running_parameters="marketplace_listings" + /> <command name="minimap" available_in_toybox="true" icon="Command_MiniMap_Icon" diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 138bdde9e9..d8565aec2f 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4669,17 +4669,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>InventoryDisplayOutbox</key> - <map> - <key>Comment</key> - <string>Override merchant inventory outbox display</string> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>InventoryInboxToggleState</key> <map> <key>Comment</key> @@ -4702,6 +4691,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>InventoryOutboxDisplayBoth</key> + <map> + <key>Comment</key> + <string>Show the legacy Merchant Outbox UI as well as the Marketplace Listings UI</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>InventoryOutboxLogging</key> <map> <key>Comment</key> @@ -4733,7 +4733,7 @@ <key>Type</key> <string>U32</string> <key>Value</key> - <integer>21</integer> + <integer>20</integer> </map> <key>InventoryOutboxMaxFolderDepth</key> <map> @@ -4757,6 +4757,17 @@ <key>Value</key> <integer>200</integer> </map> + <key>InventoryOutboxMaxStockItemCount</key> + <map> + <key>Comment</key> + <string>Maximum number of items allowed in a stock folder.</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>200</integer> + </map> <key>InventorySortOrder</key> <map> <key>Comment</key> @@ -5616,6 +5627,17 @@ <key>Value</key> <string /> </map> + <key>MarketplaceListingsLogging</key> + <map> + <key>Comment</key> + <string>Enable debug output associated with the Marketplace Listings (SLM) API.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>MarketplaceURL</key> <map> <key>Comment</key> diff --git a/indra/newview/generate_breakpad_symbols.py b/indra/newview/generate_breakpad_symbols.py index 4181e4ebb3..d351c406bc 100755 --- a/indra/newview/generate_breakpad_symbols.py +++ b/indra/newview/generate_breakpad_symbols.py @@ -31,7 +31,6 @@ $/LicenseInfo$ import collections import fnmatch import itertools -import operator import os import re import sys @@ -149,7 +148,7 @@ def main(configuration, search_dirs, viewer_exes, libs_suffix, dump_syms_tool, v == os.path.splitext(os.path.basename(m))[0].lower() # there must be at least one .sym file in tarfile_members that matches # each required module (ignoring file extensions) - if not reduce(operator.or_, itertools.imap(match_module_basename, tarfile_members)): + if not any(itertools.imap(match_module_basename, tarfile_members)): print >> sys.stderr, "failed to find required %s in generated %s" \ % (required_module, viewer_symbol_file) os.remove(viewer_symbol_file) diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 65581a6781..8c8b4971cf 100755 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; secondlife setup.nsi
-;; Copyright 2004-2011, Linden Research, Inc.
+;; Second Life setup.nsi
+;; Copyright 2004-2015, Linden Research, Inc.
;;
;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public
@@ -18,26 +18,27 @@ ;;
;; Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
;;
-;; NSIS Unicode 2.38.1 or higher required
+;; NSIS Unicode 2.46.5 or higher required
;; http://www.scratchpaper.com/
;;
-;; Author: James Cook, Don Kjer, Callum Prentice
+;; Author: James Cook, TankMaster Finesmith, Don Kjer, Callum Prentice
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Compiler flags
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-SetOverwrite on ; overwrite files
-SetCompress auto ; compress iff saves space
-SetCompressor /solid lzma ; compress whole installer as one block
-SetDatablockOptimize off ; only saves us 0.1%, not worth it
-XPStyle on ; add an XP manifest to the installer
-RequestExecutionLevel admin ; on Vista we must be admin because we write to Program Files
+SetOverwrite on # Overwrite files
+SetCompress auto # Compress if saves space
+SetCompressor /solid lzma # Compress whole installer as one block
+SetDatablockOptimize off # Only saves us 0.1%, not worth it
+XPStyle on # Add an XP manifest to the installer
+RequestExecutionLevel admin # For when we write to Program Files
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Project flags
+;; Project flags
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+# This placeholder is replaced by viewer_manifest.py
%%VERSION%%
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -72,140 +73,317 @@ LangString LanguageCode ${LANG_RUSSIAN} "ru" LangString LanguageCode ${LANG_TURKISH} "tr"
LangString LanguageCode ${LANG_TRADCHINESE} "zh"
-;; this placeholder is replaced by viewer_manifest.py
+# This placeholder is replaced by viewer_manifest.py
%%INST_VARS%%
Name ${INSTNAME}
-SubCaption 0 $(LicenseSubTitleSetup) ; override "license agreement" text
+SubCaption 0 $(LicenseSubTitleSetup) # Override "license agreement" text
-BrandingText " " ; bottom of window text
+BrandingText " " # Bottom of window text
Icon %%SOURCE%%\installers\windows\install_icon.ico
UninstallIcon %%SOURCE%%\installers\windows\uninstall_icon.ico
-WindowIcon on ; show our icon in left corner
-BGGradient off ; no big background window
-CRCCheck on ; make sure CRC is OK
-InstProgressFlags smooth colored ; new colored smooth look
-ShowInstDetails nevershow ; no details, no "show" button
-SetOverwrite on ; stomp files by default
-AutoCloseWindow true ; after all files install, close window
+WindowIcon on # Show our icon in left corner
+BGGradient off # No big background window
+CRCCheck on # Make sure CRC is OK
+InstProgressFlags smooth colored # New colored smooth look
+SetOverwrite on # Overwrite files by default
+AutoCloseWindow true # After all files install, close window
InstallDir "$PROGRAMFILES\${INSTNAME}"
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" ""
+UninstallText $(UninstallTextMsg)
DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup)
Page directory dirPre
Page instfiles
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Variables
+;; Variables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Var INSTPROG
Var INSTEXE
Var INSTSHORTCUT
-Var COMMANDLINE ; command line passed to this installer, set in .onInit
-Var SHORTCUT_LANG_PARAM ; "--set InstallLanguage de", passes language to viewer
-Var SKIP_DIALOGS ; set from command line in .onInit. autoinstall
- ; GUI and the defaults.
-Var SKIP_AUTORUN ; skip automatic launch of viewer after install
-Var DO_UNINSTALL_V2 ; If non-null, path to a previous Viewer 2 installation that will be uninstalled.
-
-;;; Function definitions should go before file includes, because calls to
-;;; DLLs like LangDLL trigger an implicit file include, so if that call is at
-;;; the end of this script NSIS has to decompress the whole installer before
-;;; it can call the DLL function. JC
-
-!include "FileFunc.nsh" ; For GetParameters, GetOptions
+Var COMMANDLINE # Command line passed to this installer, set in .onInit
+Var SHORTCUT_LANG_PARAM # "--set InstallLanguage de", Passes language to viewer
+Var SKIP_DIALOGS # Set from command line in .onInit. autoinstall GUI and the defaults.
+Var SKIP_AUTORUN # Skip automatic launch of the viewer after install
+Var DO_UNINSTALL_V2 # If non-null, path to a previous Viewer 2 installation that will be uninstalled.
+
+# Function definitions should go before file includes, because calls to
+# DLLs like LangDLL trigger an implicit file include, so if that call is at
+# the end of this script NSIS has to decompress the whole installer before
+# it can call the DLL function. JC
+
+!include "FileFunc.nsh" # For GetParameters, GetOptions
!insertmacro GetParameters
!insertmacro GetOptions
-!include WinVer.nsh ; For OS and SP detection
-!include x64.nsh ; For 64bit OS detection
+!include WinVer.nsh # For OS and SP detection
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; After install completes, launch app
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function .onInstSuccess
-Call CheckWindowsServPack ; Warn if not on the latest SP before asking to launch.
- Push $R0 # Option value, unused
- StrCmp $SKIP_AUTORUN "true" +2;
- # Assumes SetOutPath $INSTDIR
- Exec '"$INSTDIR\$INSTEXE" $SHORTCUT_LANG_PARAM'
- Pop $R0
-FunctionEnd
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Pre-directory page callback
+;; Pre-directory page callback
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function dirPre
StrCmp $SKIP_DIALOGS "true" 0 +2
Abort
+
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Make sure this computer meets the minimum system requirements.
-; Currently: Windows 32bit XP SP3, 64bit XP SP2 and Server 2003 SP2
+;; Prep Installer Section
+;;
+;; Note: to add new languages, add a language file include to the list
+;; at the top of this file, add an entry to the menu and then add an
+;; entry to the language ID selector below
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function CheckWindowsVersion
- ${If} ${AtMostWin2000}
- MessageBox MB_OK $(CheckWindowsVersionMB)
+Function .onInit
+Call CheckCPUFlags # Make sure we have SSE2 support
+Call CheckWindowsVersion # Don't install On unsupported systems
+ Push $0
+ ${GetParameters} $COMMANDLINE # Get our command line
+
+ ${GetOptions} $COMMANDLINE "/SKIP_DIALOGS" $0
+ IfErrors +2 0 # If error jump past setting SKIP_DIALOGS
+ StrCpy $SKIP_DIALOGS "true"
+
+ ${GetOptions} $COMMANDLINE "/SKIP_AUTORUN" $0
+ IfErrors +2 0 ; If error jump past setting SKIP_AUTORUN
+ StrCpy $SKIP_AUTORUN "true"
+
+ ${GetOptions} $COMMANDLINE "/LANGID=" $0 # /LANGID=1033 implies US English
+
+# If no language (error), then proceed
+ IfErrors lbl_configure_default_lang
+# No error means we got a language, so use it
+ StrCpy $LANGUAGE $0
+ Goto lbl_return
+
+lbl_configure_default_lang:
+# If we currently have a version of SL installed, default to the language of that install
+# Otherwise don't change $LANGUAGE and it will default to the OS UI language.
+ ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage"
+ IfErrors +2 0 # If error skip the copy instruction
+ StrCpy $LANGUAGE $0
+
+# For silent installs, no language prompt, use default
+ IfSilent lbl_return
+ StrCmp $SKIP_DIALOGS "true" lbl_return
+
+lbl_build_menu:
+ Push ""
+# Use separate file so labels can be UTF-16 but we can still merge changes into this ASCII file. JC
+ !include "%%SOURCE%%\installers\windows\language_menu.nsi"
+
+ Push A # A means auto count languages for the auto count to work the first empty push (Push "") must remain
+ LangDLL::LangDialog $(InstallerLanguageTitle) $(SelectInstallerLanguage)
+ Pop $0
+ StrCmp $0 "cancel" 0 +2
+ Abort
+ StrCpy $LANGUAGE $0
+
+# Save language in registry
+ WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage" $LANGUAGE
+lbl_return:
+ Pop $0
+ Return
+
+FunctionEnd
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Prep Uninstaller Section
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function un.onInit
+# Read language from registry and set for uninstaller. Key will be removed on successful uninstall
+ ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage"
+ IfErrors lbl_end
+ StrCpy $LANGUAGE $0
+lbl_end:
+ Return
+
+FunctionEnd
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Checks for CPU valid (must have SSE2 support)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function CheckCPUFlags
+ Push $1
+ System::Call 'kernel32::IsProcessorFeaturePresent(i) i(10) .r1'
+ IntCmp $1 1 OK_SSE2
+ MessageBox MB_OKCANCEL $(MissingSSE2) /SD IDOK IDOK OK_SSE2
Quit
- ${EndIf}
- ${If} ${IsWinXP}
- ${AndIfNot} ${RunningX64}
- ${AndIfNot} ${IsServicePack} 3
+ OK_SSE2:
+ Pop $1
+ Return
+
+FunctionEnd
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Make sure this computer meets the minimum system requirements.
+;; Currently: Windows Vista SP2
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function CheckWindowsVersion
+ ${If} ${AtMostWin2003}
MessageBox MB_OK $(CheckWindowsVersionMB)
Quit
${EndIf}
- ${If} ${IsWinXP}
- ${AndIf} ${RunningX64}
+ ${If} ${IsWinVista}
${AndIfNot} ${IsServicePack} 2
MessageBox MB_OK $(CheckWindowsVersionMB)
Quit
${EndIf}
- ${If} ${IsWin2003}
+ ${If} ${IsWin2008}
${AndIfNot} ${IsServicePack} 2
MessageBox MB_OK $(CheckWindowsVersionMB)
Quit
${EndIf}
+
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;Recommend Upgrading Service Pack
+;; Install Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function CheckWindowsServPack
- ${If} ${IsWinVista}
- ${AndIfNot} ${IsServicePack} 2
- MessageBox MB_OK $(CheckWindowsServPackMB)
- DetailPrint $(UseLatestServPackDP)
- Return
- ${EndIf}
+Section ""
- ${If} ${IsWin2008}
- ${AndIfNot} ${IsServicePack} 2
- MessageBox MB_OK $(CheckWindowsServPackMB)
- DetailPrint $(UseLatestServPackDP)
- Return
- ${EndIf}
+SetShellVarContext all # Install for all users (if you change this, change it in the uninstall as well)
- ${If} ${IsWin7}
- ${AndIfNot} ${IsServicePack} 1
- MessageBox MB_OK $(CheckWindowsServPackMB)
- DetailPrint $(UseLatestServPackDP)
- Return
- ${EndIf}
+# Start with some default values.
+StrCpy $INSTPROG "${INSTNAME}"
+StrCpy $INSTEXE "${INSTEXE}"
+StrCpy $INSTSHORTCUT "${SHORTCUT}"
- ${If} ${IsWin2008R2}
- ${AndIfNot} ${IsServicePack} 1
- MessageBox MB_OK $(CheckWindowsServPackMB)
- DetailPrint $(UseLatestServPackDP)
- Return
- ${EndIf}
-FunctionEnd
+Call CheckIfAdministrator # Make sure the user can install/uninstall
+Call CheckIfAlreadyCurrent # Make sure this version is not already installed
+Call CloseSecondLife # Make sure Second Life not currently running
+Call CheckNetworkConnection # Ping secondlife.com
+Call CheckWillUninstallV2 # Check if Second Life is already installed
+
+StrCmp $DO_UNINSTALL_V2 "" PRESERVE_DONE
+PRESERVE_DONE:
+
+Call RemoveProgFilesOnInst # Remove existing files to prevent certain errors when running the new version of the viewer
+
+# This placeholder is replaced by the complete list of all the files in the installer, by viewer_manifest.py
+%%INSTALL_FILES%%
+
+# Pass the installer's language to the client to use as a default
+StrCpy $SHORTCUT_LANG_PARAM "--set InstallLanguage $(LanguageCode)"
+
+# Shortcuts in start menu
+CreateDirectory "$SMPROGRAMS\$INSTSHORTCUT"
+SetOutPath "$INSTDIR"
+CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT.lnk" \
+ "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM"
+
+
+WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Create Account.url" \
+ "InternetShortcut" "URL" \
+ "http://join.secondlife.com/"
+WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Your Account.url" \
+ "InternetShortcut" "URL" \
+ "http://www.secondlife.com/account/"
+WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Scripting Language Help.url" \
+ "InternetShortcut" "URL" \
+ "http://wiki.secondlife.com/wiki/LSL_Portal"
+CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\Uninstall $INSTSHORTCUT.lnk" \
+ '"$INSTDIR\uninst.exe"' ''
+
+# Other shortcuts
+SetOutPath "$INSTDIR"
+CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" \
+ "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM"
+CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" \
+ "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM"
+CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \
+ '"$INSTDIR\uninst.exe"' ''
+
+# Write registry
+WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" "$INSTDIR"
+WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" "${VERSION_LONG}"
+WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut" "$INSTSHORTCUT"
+WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$INSTEXE"
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "Publisher" "Linden Research, Inc."
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "URLInfoAbout" "http://secondlife.com/whatis/"
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "URLUpdateInfo" "http://secondlife.com/support/downloads/"
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "HelpLink" "https://support.secondlife.com/contact-support/"
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayName" "$INSTPROG"
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "UninstallString" '"$INSTDIR\uninst.exe"'
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayVersion" "${VERSION_LONG}"
+WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "EstimatedSize" "0x0001D500" # ~117 MB
+# BUG-2707 Disable SEHOP for installed viewer.
+WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$INSTEXE" "DisableExceptionChainValidation" 1
+
+# Write URL registry info
+WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "(default)" "URL:Second Life"
+WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "URL Protocol" ""
+WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}\DefaultIcon" "" '"$INSTDIR\$INSTEXE"'
+
+# URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks.
+WriteRegExpandStr HKEY_CLASSES_ROOT "${URLNAME}\shell\open\command" "" '"$INSTDIR\$INSTEXE" -url "%1"'
+WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info"(default)" "URL:Second Life"
+WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info" "URL Protocol" ""
+WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\DefaultIcon" "" '"$INSTDIR\$INSTEXE"'
+
+# URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks.
+WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$INSTEXE" -url "%1"'
+
+# Write out uninstaller
+WriteUninstaller "$INSTDIR\uninst.exe"
+
+# Uninstall existing "Second Life Viewer 2" install if needed.
+StrCmp $DO_UNINSTALL_V2 "" REMOVE_SLV2_DONE
+ ExecWait '"$PROGRAMFILES\SecondLifeViewer2\uninst.exe" /S _?=$PROGRAMFILES\SecondLifeViewer2'
+ Delete "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" # With _? option above, uninst.exe will be left behind.
+ RMDir "$PROGRAMFILES\SecondLifeViewer2" # Will remove only if empty.
+
+REMOVE_SLV2_DONE:
+
+SectionEnd
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Uninstall Section
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Section Uninstall
+
+# Start with some default values.
+StrCpy $INSTPROG "${INSTNAME}"
+StrCpy $INSTEXE "${INSTEXE}"
+StrCpy $INSTSHORTCUT "${SHORTCUT}"
+
+# Make sure the user can install/uninstall
+Call un.CheckIfAdministrator
+
+# Uninstall for all users (if you change this, change it in the install as well)
+SetShellVarContext all
+
+# Make sure we're not running
+Call un.CloseSecondLife
+
+# Clean up registry keys and subkeys (these should all be !defines somewhere)
+DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG"
+DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG"
+# BUG-2707 Remove entry that disabled SEHOP
+DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$INSTEXE"
+
+# Clean up shortcuts
+Delete "$SMPROGRAMS\$INSTSHORTCUT\*.*"
+RMDir "$SMPROGRAMS\$INSTSHORTCUT"
+
+Delete "$DESKTOP\$INSTSHORTCUT.lnk"
+Delete "$INSTDIR\$INSTSHORTCUT.lnk"
+Delete "$INSTDIR\Uninstall $INSTSHORTCUT.lnk"
+
+# Remove the main installation directory
+Call un.ProgramFiles
+
+# Clean up cache and log files, but leave them in-place for non AGNI installs.
+Call un.UserSettingsFiles
+
+SectionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Make sure the user can install/uninstall
+;; Make sure the user can install
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function CheckIfAdministrator
DetailPrint $(CheckAdministratorInstDP)
@@ -216,10 +394,11 @@ Function CheckIfAdministrator Quit
lbl_is_admin:
Return
+
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
+;; Make sure the user can uninstall
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function un.CheckIfAdministrator
DetailPrint $(CheckAdministratorUnInstDP)
@@ -230,11 +409,12 @@ Function un.CheckIfAdministrator Quit
lbl_is_admin:
Return
+
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Checks to see if the current version has already been installed (according to the registry).
-; If it has, allow user to bail out of install process.
+;; Checks to see if the current version has already been installed (according to the registry).
+;; If it has, allow user to bail out of install process.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function CheckIfAlreadyCurrent
Push $0
@@ -246,26 +426,34 @@ Function CheckIfAlreadyCurrent continue_install:
Pop $0
Return
+
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Checks for CPU valid (must have SSE2 support)
+;; Function CheckWillUninstallV2
+;;
+;; If called through auto-update, need to uninstall any existing V2 installation.
+;; Don't want to end up with SecondLifeViewer2 and SecondLifeViewer installations
+;; existing side by side with no indication on which to use.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function CheckCPUFlags
- Push $1
- System::Call 'kernel32::IsProcessorFeaturePresent(i) i(10) .r1'
- IntCmp $1 1 OK_SSE2
- MessageBox MB_OKCANCEL $(MissingSSE2) /SD IDOK IDOK OK_SSE2
- Quit
+Function CheckWillUninstallV2
+
+ StrCpy $DO_UNINSTALL_V2 ""
+
+ StrCmp $SKIP_DIALOGS "true" 0 CHECKV2_DONE
+ StrCmp $INSTDIR "$PROGRAMFILES\SecondLifeViewer2" CHECKV2_DONE # Don't uninstall our own install dir.
+ IfFileExists "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" CHECKV2_FOUND CHECKV2_DONE
+
+CHECKV2_FOUND:
+ StrCpy $DO_UNINSTALL_V2 "true"
+
+CHECKV2_DONE:
- OK_SSE2:
- Pop $1
- Return
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Close the program, if running. Modifies no variables.
-; Allows user to bail out of install process.
+;; Close the program, if running. Modifies no variables.
+;; Allows user to bail out of install process.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function CloseSecondLife
Push $0
@@ -291,334 +479,134 @@ Function CloseSecondLife DONE:
Pop $0
Return
+
+FunctionEnd
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Close the program, if running. Modifies no variables.
+;; Allows user to bail out of uninstall process.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function un.CloseSecondLife
+ Push $0
+ FindWindow $0 "Second Life" ""
+ IntCmp $0 0 DONE
+ MessageBox MB_OKCANCEL $(CloseSecondLifeUnInstMB) IDOK CLOSE IDCANCEL CANCEL_UNINSTALL
+
+ CANCEL_UNINSTALL:
+ Quit
+
+ CLOSE:
+ DetailPrint $(CloseSecondLifeUnInstDP)
+ SendMessage $0 16 0 0
+
+ LOOP:
+ FindWindow $0 "Second Life" ""
+ IntCmp $0 0 DONE
+ Sleep 500
+ Goto LOOP
+
+ DONE:
+ Pop $0
+ Return
+
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Test our connection to secondlife.com
-; Also allows us to count attempted installs by examining web logs.
-; *TODO: Return current SL version info and have installer check
-; if it is up to date.
+;; Test our connection to secondlife.com
+;; Also allows us to count attempted installs by examining web logs.
+;; *TODO: Return current SL version info and have installer check
+;; if it is up to date.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function CheckNetworkConnection
Push $0
Push $1
Push $2 # Option value for GetOptions
DetailPrint $(CheckNetworkConnectionDP)
- ; Look for a tag value from the stub installer, used for statistics
- ; to correlate installs. Default to "" if not found on command line.
+# Look for a tag value from the stub installer, used for statistics to correlate installs.
+# Default to "" if not found on command line.
StrCpy $2 ""
${GetOptions} $COMMANDLINE "/STUBTAG=" $2
GetTempFileName $0
- !define HTTP_TIMEOUT 5000 ; milliseconds
- ; Don't show secondary progress bar, this will be quick.
+ !define HTTP_TIMEOUT 5000 # Milliseconds
+# Don't show secondary progress bar, this will be quick.
NSISdl::download_quiet \
/TIMEOUT=${HTTP_TIMEOUT} \
"http://install.secondlife.com/check/?stubtag=$2&version=${VERSION_LONG}" \
$0
- Pop $1 ; Return value, either "success", "cancel" or an error message
+ Pop $1 # Return value, either "success", "cancel" or an error message
; MessageBox MB_OK "Download result: $1"
; Result ignored for now
; StrCmp $1 "success" +2
; DetailPrint "Connection failed: $1"
- Delete $0 ; temporary file
+ Delete $0 # Temporary file
Pop $2
Pop $1
Pop $0
Return
-FunctionEnd
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Function CheckOldExeName
-; Viewer versions < 3.6.12 used the name 'SecondLife.exe'
-; If that name is found in the install folder, delete it to invalidate any
-; old shortcuts to it that may be in non-standard locations, so that the user
-; does not end up running the old version (potentially getting caught in an
-; infinite update loop). See MAINT-3575
-; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-Function CheckOldExeName
- IfFileExists "$INSTDIR\SecondLife.exe" CHECKOLDEXE_FOUND CHECKOLDEXE_DONE
-
-CHECKOLDEXE_FOUND:
- Delete "$INSTDIR\SecondLife.exe"
-CHECKOLDEXE_DONE:
-FunctionEnd
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Function CheckWillUninstallV2
-;
-; If we are being called through auto-update, we need to uninstall any
-; existing V2 installation. Otherwise, we wind up with
-; SecondLifeViewer2 and SecondLifeViewer installations existing side
-; by side no indication which to use.
-; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function CheckWillUninstallV2
-
- StrCpy $DO_UNINSTALL_V2 ""
-
- StrCmp $SKIP_DIALOGS "true" 0 CHECKV2_DONE
- StrCmp $INSTDIR "$PROGRAMFILES\SecondLifeViewer2" CHECKV2_DONE ; don't uninstall our own install dir.
- IfFileExists "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" CHECKV2_FOUND CHECKV2_DONE
-
-CHECKV2_FOUND:
- StrCpy $DO_UNINSTALL_V2 "true"
-
-CHECKV2_DONE:
-
-FunctionEnd
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Save user files to temp location
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function PreserveUserFiles
-
-Push $0
-Push $1
-Push $2
-
- RMDir /r "$TEMP\SecondLifeSettingsBackup"
- CreateDirectory "$TEMP\SecondLifeSettingsBackup"
- StrCpy $0 0 ; Index number used to iterate via EnumRegKey
-
- LOOP:
- EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
- StrCmp $1 "" DONE ; no more users
-
- ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
- StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing
-
- ; Required since ProfileImagePath is of type REG_EXPAND_SZ
- ExpandEnvStrings $2 $2
-
- CreateDirectory "$TEMP\SecondLifeSettingsBackup\$0"
- CopyFiles /SILENT "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\$0"
-
- CONTINUE:
- IntOp $0 $0 + 1
- Goto LOOP
- DONE:
-
-Pop $2
-Pop $1
-Pop $0
-
-; Copy files in Documents and Settings\All Users\SecondLife
-Push $0
- ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
- StrCmp $0 "" +2
- CreateDirectory "$TEMP\SecondLifeSettingsBackup\AllUsers\"
- CopyFiles /SILENT "$2\Application Data\SecondLife\*" "$TEMP\SecondLifeSettingsBackup\AllUsers\"
-Pop $0
-
-FunctionEnd
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Restore user files from temp location
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function RestoreUserFiles
-
-Push $0
-Push $1
-Push $2
-
- StrCpy $0 0 ; Index number used to iterate via EnumRegKey
-
- LOOP:
- EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
- StrCmp $1 "" DONE ; no more users
-
- ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
- StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing
-
- ; Required since ProfileImagePath is of type REG_EXPAND_SZ
- ExpandEnvStrings $2 $2
-
- CreateDirectory "$2\Application Data\SecondLife\"
- CopyFiles /SILENT "$TEMP\SecondLifeSettingsBackup\$0\*" "$2\Application Data\SecondLife\"
-
- CONTINUE:
- IntOp $0 $0 + 1
- Goto LOOP
- DONE:
-
-Pop $2
-Pop $1
-Pop $0
-
-; Copy files in Documents and Settings\All Users\SecondLife
-Push $0
- ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
- StrCmp $0 "" +2
- CreateDirectory "$2\Application Data\SecondLife\"
- CopyFiles /SILENT "$TEMP\SecondLifeSettingsBackup\AllUsers\*" "$2\Application Data\SecondLife\"
-Pop $0
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Remove temp dirs
+;; Delete files on install if previous install exists to prevent undesired behavior
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function RemoveTempUserFiles
-
-Push $0
-Push $1
-Push $2
+Function RemoveProgFilesOnInst
- StrCpy $0 0 ; Index number used to iterate via EnumRegKey
-
- LOOP:
- EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
- StrCmp $1 "" DONE ; no more users
-
- ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
- StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing
-
- ; Required since ProfileImagePath is of type REG_EXPAND_SZ
- ExpandEnvStrings $2 $2
-
- RMDir /r "$TEMP\SecondLifeSettingsBackup\$0\*"
-
- CONTINUE:
- IntOp $0 $0 + 1
- Goto LOOP
- DONE:
-
-Pop $2
-Pop $1
-Pop $0
-
-; Copy files in Documents and Settings\All Users\SecondLife
-Push $0
- ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
- StrCmp $0 "" +2
- RMDir /r "$TEMP\SecondLifeSettingsBackup\AllUsers\*"
-Pop $0
-
-FunctionEnd
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Clobber user files - TEST ONLY
-; This is here for testing, generally not desirable to call it.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;Function ClobberUserFilesTESTONLY
-
-;Push $0
-;Push $1
-;Push $2
-;
-; StrCpy $0 0 ; Index number used to iterate via EnumRegKey
-;
-; LOOP:
-; EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
-; StrCmp $1 "" DONE ; no more users
-;
-; ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
-; StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing
-;
-; ; Required since ProfileImagePath is of type REG_EXPAND_SZ
-; ExpandEnvStrings $2 $2
-;
-; RMDir /r "$2\Application Data\SecondLife\"
-;
-; CONTINUE:
-; IntOp $0 $0 + 1
-; Goto LOOP
-; DONE:
-;
-;Pop $2
-;Pop $1
-;Pop $0
-;
-;; Copy files in Documents and Settings\All Users\SecondLife
-;Push $0
-; ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
-; StrCmp $0 "" +2
-; RMDir /r "$2\Application Data\SecondLife\"
-;Pop $0
-;
-;FunctionEnd
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Delete the installed shader files
-;;; Since shaders are in active development, we'll likely need to shuffle them
-;;; around a bit from build to build. This ensures that shaders that we move
-;;; or rename in the dev tree don't get left behind in the install.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function RemoveOldShaders
-
-;; Remove old shader files first so fallbacks will work. see DEV-5663
-RMDir /r "$INSTDIR\app_settings\shaders\*"
-
-FunctionEnd
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Delete the installed XUI files
-;;; We've changed the directory hierarchy for skins, putting all XUI and texture
-;;; files under a specific skin directory, i.e. skins/default/xui/en-us as opposed
-;;; to skins/xui/en-us. Need to clean up the old path when upgrading
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function RemoveOldXUI
+# Remove old SecondLife.exe to invalidate any old shortcuts to it that may be in non-standard locations. See MAINT-3575
+Delete "$INSTDIR\SecondLife.exe"
-;; remove old XUI and texture files
-RmDir /r "$INSTDIR\skins\html"
-RmDir /r "$INSTDIR\skins\xui"
-RmDir /r "$INSTDIR\skins\textures"
-Delete "$INSTDIR\skins\*.txt"
+# Remove old shader files first so fallbacks will work. See DEV-5663
+RMDir /r "$INSTDIR\app_settings\shaders"
-FunctionEnd
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Remove any releasenotes files.
-;;; We are no longer including release notes with the viewer. This will delete
-;;; any that were left behind by an older installer. Delete will not fail if
-;;; the files do not exist
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function RemoveOldReleaseNotes
+# Remove skins folder to clean up files removed during development
+RMDir /r "$INSTDIR\skins"
-;; remove releasenotes.txt file from application directory, and the shortcut
-;; from the start menu.
+# We are no longer including release notes with the viewer, so remove them.
Delete "$SMPROGRAMS\$INSTSHORTCUT\SL Release Notes.lnk"
Delete "$INSTDIR\releasenotes.txt"
FunctionEnd
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Delete files in Documents and Settings\<user>\SecondLife
-; Delete files in Documents and Settings\All Users\SecondLife
+;; Delete files in \Users\<User>\AppData\
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function un.DocumentsAndSettingsFolder
+Function un.UserSettingsFiles
+
+StrCmp $DO_UNINSTALL_V2 "true" Keep # Don't remove user's settings files on auto upgrade
-; Delete files in Documents and Settings\<user>\SecondLife
+# Ask if user wants to keep data files or not
+MessageBox MB_YESNO|MB_ICONQUESTION $(RemoveDataFilesMB) IDYES Remove IDNO Keep
+
+Remove:
Push $0
Push $1
Push $2
- DetailPrint "Deleting files in Documents and Settings folder"
+ DetailPrint "Deleting Second Life data files"
- StrCpy $0 0 ; Index number used to iterate via EnumRegKey
+ StrCpy $0 0 # Index number used to iterate via EnumRegKey
LOOP:
EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
- StrCmp $1 "" DONE ; no more users
+ StrCmp $1 "" DONE # No more users
ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
- StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing
+ StrCmp $2 "" CONTINUE 0 # "ProfileImagePath" value is missing
- ; Required since ProfileImagePath is of type REG_EXPAND_SZ
+# Required since ProfileImagePath is of type REG_EXPAND_SZ
ExpandEnvStrings $2 $2
- ; Remove all cache and settings files but leave any other .txt files to preserve the chat logs
-; RMDir /r "$2\Application Data\SecondLife\logs"
- RMDir /r "$2\Application Data\SecondLife\browser_profile"
- RMDir /r "$2\Application Data\SecondLife\user_settings"
- Delete "$2\Application Data\SecondLife\*.xml"
- Delete "$2\Application Data\SecondLife\*.bmp"
- Delete "$2\Application Data\SecondLife\search_history.txt"
- Delete "$2\Application Data\SecondLife\plugin_cookies.txt"
- Delete "$2\Application Data\SecondLife\typed_locations.txt"
+# Delete files in \Users\<User>\AppData\Roaming\SecondLife
+# Remove all settings files but leave any other .txt files to preserve the chat logs
+; RMDir /r "$2\AppData\Roaming\SecondLife\logs"
+ RMDir /r "$2\AppData\Roaming\SecondLife\browser_profile"
+ RMDir /r "$2\AppData\Roaming\SecondLife\user_settings"
+ Delete "$2\AppData\Roaming\SecondLife\*.xml"
+ Delete "$2\AppData\Roaming\SecondLife\*.bmp"
+ Delete "$2\AppData\Roaming\SecondLife\search_history.txt"
+ Delete "$2\AppData\Roaming\SecondLife\plugin_cookies.txt"
+ Delete "$2\AppData\Roaming\SecondLife\typed_locations.txt"
+# Delete files in \Users\<User>\AppData\Local\SecondLife
+ RmDir /r "$2\AppData\Local\SecondLife" #Delete the cache folder
CONTINUE:
IntOp $0 $0 + 1
@@ -629,82 +617,30 @@ Pop $2 Pop $1
Pop $0
-; Delete files in Documents and Settings\All Users\SecondLife
+# Delete files in ProgramData\Secondlife
Push $0
ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
StrCmp $0 "" +2
RMDir /r "$0\SecondLife"
Pop $0
-; Delete files in C:\Windows\Application Data\SecondLife
-; If the user is running on a pre-NT system, Application Data lives here instead of
-; in Documents and Settings.
-RMDir /r "$WINDIR\Application Data\SecondLife"
-
-FunctionEnd
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Close the program, if running. Modifies no variables.
-; Allows user to bail out of uninstall process.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function un.CloseSecondLife
- Push $0
- FindWindow $0 "Second Life" ""
- IntCmp $0 0 DONE
- MessageBox MB_OKCANCEL $(CloseSecondLifeUnInstMB) IDOK CLOSE IDCANCEL CANCEL_UNINSTALL
-
- CANCEL_UNINSTALL:
- Quit
-
- CLOSE:
- DetailPrint $(CloseSecondLifeUnInstDP)
- SendMessage $0 16 0 0
-
- LOOP:
- FindWindow $0 "Second Life" ""
- IntCmp $0 0 DONE
- Sleep 500
- Goto LOOP
-
- DONE:
- Pop $0
- Return
-FunctionEnd
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;
-; Delete the stored password for the current Windows user
-; DEV-10821 -- Unauthorised user can gain access to an SL account after a real user has uninstalled
-;
-Function un.RemovePassword
-
-DetailPrint "Removing Second Life password"
-
-SetShellVarContext current
-Delete "$APPDATA\SecondLife\user_settings\password.dat"
-SetShellVarContext all
+Keep:
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Delete the installed files
-;;; This deletes the uninstall executable, but it works
-;;; because it is copied to temp directory before running
-;;;
-;;; Note: You must list all files here, because we only
-;;; want to delete our files, not things users left in the
-;;; application directories.
+;; Delete the installed files
+;; This deletes the uninstall executable, but it works because it is copied to temp directory before running
+;;
+;; Note: You must list all files here, because we only want to delete our files,
+;; not things users left in the program directory.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function un.ProgramFiles
-;; Remove mozilla file first so recursive directory deletion doesn't get hung up
-Delete "$INSTDIR\app_settings\mozilla\components"
-
-;; This placeholder is replaced by the complete list of files to uninstall by viewer_manifest.py
+# This placeholder is replaced by the complete list of files to uninstall by viewer_manifest.py
%%DELETE_FILES%%
-;; Optional/obsolete files. Delete won't fail if they don't exist.
+# Optional/obsolete files. Delete won't fail if they don't exist.
Delete "$INSTDIR\dronesettings.ini"
Delete "$INSTDIR\message_template.msg"
Delete "$INSTDIR\newview.pdb"
@@ -717,19 +653,12 @@ Delete "$INSTDIR\motions\*.lla" Delete "$INSTDIR\trial\*.html"
Delete "$INSTDIR\newview.exe"
Delete "$INSTDIR\SecondLife.exe"
-;; MAINT-3099 workaround - prevent these log files, if present, from causing a user alert
+
+# MAINT-3099 workaround - prevent these log files, if present, from causing a user alert
Delete "$INSTDIR\VivoxVoiceService-*.log"
-;; Remove entire help directory
-Delete "$INSTDIR\help\Advanced\*"
-RMDir "$INSTDIR\help\Advanced"
-Delete "$INSTDIR\help\basics\*"
-RMDir "$INSTDIR\help\basics"
-Delete "$INSTDIR\help\Concepts\*"
-RMDir "$INSTDIR\help\Concepts"
-Delete "$INSTDIR\help\welcome\*"
-RMDir "$INSTDIR\help\welcome"
-Delete "$INSTDIR\help\*"
-RMDir "$INSTDIR\help"
+
+# Remove entire help directory
+RMDir /r "$INSTDIR\help"
Delete "$INSTDIR\uninst.exe"
RMDir "$INSTDIR"
@@ -737,7 +666,7 @@ RMDir "$INSTDIR" IfFileExists "$INSTDIR" FOLDERFOUND NOFOLDER
FOLDERFOUND:
- ; Silent uninstall always removes all files (/SD IDYES)
+# Silent uninstall always removes all files (/SD IDYES)
MessageBox MB_YESNO $(DeleteProgramFilesMB) /SD IDYES IDNO NOFOLDER
RMDir /r "$INSTDIR"
@@ -746,240 +675,78 @@ NOFOLDER: FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Uninstall settings
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-UninstallText $(UninstallTextMsg)
-ShowUninstDetails show
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Uninstall section
+;; After install completes, launch app
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Section Uninstall
-
-; Start with some default values.
-StrCpy $INSTPROG "${INSTNAME}"
-StrCpy $INSTEXE "${INSTEXE}"
-StrCpy $INSTSHORTCUT "${SHORTCUT}"
-Call un.CheckIfAdministrator ; Make sure the user can install/uninstall
-
-; uninstall for all users (if you change this, change it in the install as well)
-SetShellVarContext all
-
-; Make sure we're not running
-Call un.CloseSecondLife
-
-; Clean up registry keys and subkeys (these should all be !defines somewhere)
-DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG"
-DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG"
-
-; Clean up shortcuts
-Delete "$SMPROGRAMS\$INSTSHORTCUT\*.*"
-RMDir "$SMPROGRAMS\$INSTSHORTCUT"
-
-Delete "$DESKTOP\$INSTSHORTCUT.lnk"
-Delete "$INSTDIR\$INSTSHORTCUT.lnk"
-Delete "$INSTDIR\Uninstall $INSTSHORTCUT.lnk"
-
-; Clean up cache and log files.
-; Leave them in-place for non AGNI installs.
-
-!ifdef UNINSTALL_SETTINGS
-Call un.DocumentsAndSettingsFolder
-!endif
-
-; remove stored password on uninstall
-Call un.RemovePassword
-
-Call un.ProgramFiles
+Function .onInstSuccess
+Call CheckWindowsServPack # Warn if not on the latest SP before asking to launch.
+ Push $R0 # Option value, unused
+ StrCmp $SKIP_AUTORUN "true" +2;
+# Assumes SetOutPath $INSTDIR
+ Exec '"$WINDIR\explorer.exe" "$INSTDIR\$INSTEXE"'
+ Pop $R0
-SectionEnd ; end of uninstall section
+FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Note: to add new languages, add a language file include to the list
-;; at the top of this file, add an entry to the menu and then add an
-;; entry to the language ID selector below
+;; Recommend Upgrading to Service Pack 1 for Windows 7, if not present
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function .onInit
-Call CheckWindowsVersion ; Don't install On unsupported systems
- Push $0
- ${GetParameters} $COMMANDLINE ; get our command line
-
- ${GetOptions} $COMMANDLINE "/SKIP_DIALOGS" $0
- IfErrors +2 0 ; If error jump past setting SKIP_DIALOGS
- StrCpy $SKIP_DIALOGS "true"
-
- ${GetOptions} $COMMANDLINE "/SKIP_AUTORUN" $0
- IfErrors +2 0 ; If error jump past setting SKIP_AUTORUN
- StrCpy $SKIP_AUTORUN "true"
-
- ${GetOptions} $COMMANDLINE "/LANGID=" $0 ; /LANGID=1033 implies US English
-
- ; If no language (error), then proceed
- IfErrors lbl_configure_default_lang
- ; No error means we got a language, so use it
- StrCpy $LANGUAGE $0
- Goto lbl_return
-
-lbl_configure_default_lang:
- ; If we currently have a version of SL installed, default to the language of that install
- ; Otherwise don't change $LANGUAGE and it will default to the OS UI language.
- ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage"
- IfErrors +2 0 ; If error skip the copy instruction
- StrCpy $LANGUAGE $0
-
- ; For silent installs, no language prompt, use default
- IfSilent lbl_return
- StrCmp $SKIP_DIALOGS "true" lbl_return
-
-lbl_build_menu:
- Push ""
- # Use separate file so labels can be UTF-16 but we can still merge changes
- # into this ASCII file. JC
- !include "%%SOURCE%%\installers\windows\language_menu.nsi"
-
- Push A ; A means auto count languages for the auto count to work the first empty push (Push "") must remain
- LangDLL::LangDialog $(InstallerLanguageTitle) $(SelectInstallerLanguage)
- Pop $0
- StrCmp $0 "cancel" 0 +2
- Abort
- StrCpy $LANGUAGE $0
-
- ; save language in registry
- WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage" $LANGUAGE
-lbl_return:
- Pop $0
+Function CheckWindowsServPack
+ ${If} ${IsWin7}
+ ${AndIfNot} ${IsServicePack} 1
+ MessageBox MB_OK $(CheckWindowsServPackMB)
+ DetailPrint $(UseLatestServPackDP)
Return
-FunctionEnd
+ ${EndIf}
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function un.onInit
- ; read language from registry and set for uninstaller
- ; Key will be removed on successful uninstall
- ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage"
- IfErrors lbl_end
- StrCpy $LANGUAGE $0
-lbl_end:
+ ${If} ${IsWin2008R2}
+ ${AndIfNot} ${IsServicePack} 1
+ MessageBox MB_OK $(CheckWindowsServPackMB)
+ DetailPrint $(UseLatestServPackDP)
Return
-FunctionEnd
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; MAIN SECTION
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Section "" ; (default section)
-
-SetShellVarContext all ; install for all users (if you change this, change it in the uninstall as well)
-
-; Start with some default values.
-StrCpy $INSTPROG "${INSTNAME}"
-StrCpy $INSTEXE "${INSTEXE}"
-StrCpy $INSTSHORTCUT "${SHORTCUT}"
-
-Call CheckCPUFlags ; Make sure we have SSE2 support
-Call CheckIfAdministrator ; Make sure the user can install/uninstall
-Call CheckIfAlreadyCurrent ; Make sure that we haven't already installed this version
-Call CloseSecondLife ; Make sure we're not running
-Call CheckNetworkConnection ; ping secondlife.com
-Call CheckWillUninstallV2 ; See if a V2 install exists and will be removed.
-Call CheckOldExeName ; Clean up a previous version of the exe
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-StrCmp $DO_UNINSTALL_V2 "" PRESERVE_DONE
- Call PreserveUserFiles
-PRESERVE_DONE:
-
-;;; Don't remove cache files during a regular install, removing the inventory cache on upgrades results in lots of damage to the servers.
-;Call RemoveCacheFiles ; Installing over removes potentially corrupted
- ; VFS and cache files.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Need to clean out shader files from previous installs to fix DEV-5663
-Call RemoveOldShaders
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Need to clean out old XUI files that predate skinning
-Call RemoveOldXUI
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Clear out old releasenotes.txt files. These are now on the public wiki.
-Call RemoveOldReleaseNotes
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Files
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; This placeholder is replaced by the complete list of all the files in the installer, by viewer_manifest.py
-%%INSTALL_FILES%%
-
-# Pass the installer's language to the client to use as a default
-StrCpy $SHORTCUT_LANG_PARAM "--set InstallLanguage $(LanguageCode)"
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Shortcuts in start menu
-CreateDirectory "$SMPROGRAMS\$INSTSHORTCUT"
-SetOutPath "$INSTDIR"
-CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT.lnk" \
- "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM"
-
-
-WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Create Account.url" \
- "InternetShortcut" "URL" \
- "http://join.secondlife.com/"
-WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Your Account.url" \
- "InternetShortcut" "URL" \
- "http://www.secondlife.com/account/"
-WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Scripting Language Help.url" \
- "InternetShortcut" "URL" \
- "http://wiki.secondlife.com/wiki/LSL_Portal"
-CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\Uninstall $INSTSHORTCUT.lnk" \
- '"$INSTDIR\uninst.exe"' ''
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Other shortcuts
-SetOutPath "$INSTDIR"
-CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" \
- "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM"
-CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" \
- "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM"
-CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \
- '"$INSTDIR\uninst.exe"' ''
+ ${EndIf}
+FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Write registry
-WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" "$INSTDIR"
-WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" "${VERSION_LONG}"
-WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut" "$INSTSHORTCUT"
-WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$INSTEXE"
-WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayName" "$INSTPROG (remove only)"
-WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "UninstallString" '"$INSTDIR\uninst.exe"'
-
+;; Clobber user files - TEST ONLY
+;; This is here for testing, DO NOT USE UNLESS YOU KNOW WHAT YOU ARE TESTING FOR!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Write URL registry info
-WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "(default)" "URL:Second Life"
-WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "URL Protocol" ""
-WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}\DefaultIcon" "" '"$INSTDIR\$INSTEXE"'
-;; URL param must be last item passed to viewer, it ignores subsequent params
-;; to avoid parameter injection attacks.
-WriteRegExpandStr HKEY_CLASSES_ROOT "${URLNAME}\shell\open\command" "" '"$INSTDIR\$INSTEXE" -url "%1"'
-WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info"(default)" "URL:Second Life"
-WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info" "URL Protocol" ""
-WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\DefaultIcon" "" '"$INSTDIR\$INSTEXE"'
-;; URL param must be last item passed to viewer, it ignores subsequent params
-;; to avoid parameter injection attacks.
-WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$INSTEXE" -url "%1"'
-
-; write out uninstaller
-WriteUninstaller "$INSTDIR\uninst.exe"
-
-; Uninstall existing "Second Life Viewer 2" install if needed.
-StrCmp $DO_UNINSTALL_V2 "" REMOVE_SLV2_DONE
- ExecWait '"$PROGRAMFILES\SecondLifeViewer2\uninst.exe" /S _?=$PROGRAMFILES\SecondLifeViewer2'
- Delete "$PROGRAMFILES\SecondLifeViewer2\uninst.exe" ; with _? option above, uninst.exe will be left behind.
- RMDir "$PROGRAMFILES\SecondLifeViewer2" ; will remove only if empty.
-
- Call RestoreUserFiles
- Call RemoveTempUserFiles
-REMOVE_SLV2_DONE:
+;Function ClobberUserFilesTESTONLY
-; end of default section
-SectionEnd
+;Push $0
+;Push $1
+;Push $2
+;
+; StrCpy $0 0 # Index number used to iterate via EnumRegKey
+;
+; LOOP:
+; EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0
+; StrCmp $1 "" DONE # no more users
+;
+; ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath"
+; StrCmp $2 "" CONTINUE 0 # "ProfileImagePath" value is missing
+;
+;# Required since ProfileImagePath is of type REG_EXPAND_SZ
+; ExpandEnvStrings $2 $2
+;
+; RMDir /r "$2\Application Data\SecondLife\"
+;
+; CONTINUE:
+; IntOp $0 $0 + 1
+; Goto LOOP
+; DONE:
+;
+;Pop $2
+;Pop $1
+;Pop $0
+;
+;# Copy files in Documents and Settings\All Users\SecondLife
+;Push $0
+; ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData"
+; StrCmp $0 "" +2
+; RMDir /r "$2\Application Data\SecondLife\"
+;Pop $0
+;
+;FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; EOF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/indra/newview/installers/windows/lang_da.nsi b/indra/newview/installers/windows/lang_da.nsi Binary files differindex 2352649b4b..83e1a3ea94 100755 --- a/indra/newview/installers/windows/lang_da.nsi +++ b/indra/newview/installers/windows/lang_da.nsi diff --git a/indra/newview/installers/windows/lang_de.nsi b/indra/newview/installers/windows/lang_de.nsi Binary files differindex 397262afe1..866accae99 100755 --- a/indra/newview/installers/windows/lang_de.nsi +++ b/indra/newview/installers/windows/lang_de.nsi diff --git a/indra/newview/installers/windows/lang_en-us.nsi b/indra/newview/installers/windows/lang_en-us.nsi Binary files differindex df0d55d9e0..343c312ddc 100755 --- a/indra/newview/installers/windows/lang_en-us.nsi +++ b/indra/newview/installers/windows/lang_en-us.nsi diff --git a/indra/newview/installers/windows/lang_es.nsi b/indra/newview/installers/windows/lang_es.nsi Binary files differindex 32967a0dfa..f4f0786332 100755 --- a/indra/newview/installers/windows/lang_es.nsi +++ b/indra/newview/installers/windows/lang_es.nsi diff --git a/indra/newview/installers/windows/lang_fr.nsi b/indra/newview/installers/windows/lang_fr.nsi Binary files differindex 7c75e25360..1b5dbfc975 100755 --- a/indra/newview/installers/windows/lang_fr.nsi +++ b/indra/newview/installers/windows/lang_fr.nsi diff --git a/indra/newview/installers/windows/lang_it.nsi b/indra/newview/installers/windows/lang_it.nsi Binary files differindex ce66b61f9f..a456e6e417 100755 --- a/indra/newview/installers/windows/lang_it.nsi +++ b/indra/newview/installers/windows/lang_it.nsi diff --git a/indra/newview/installers/windows/lang_ja.nsi b/indra/newview/installers/windows/lang_ja.nsi Binary files differindex e68830123a..5b1c5f4ce9 100755 --- a/indra/newview/installers/windows/lang_ja.nsi +++ b/indra/newview/installers/windows/lang_ja.nsi diff --git a/indra/newview/installers/windows/lang_pl.nsi b/indra/newview/installers/windows/lang_pl.nsi Binary files differindex 7883819190..a172f0cdeb 100755 --- a/indra/newview/installers/windows/lang_pl.nsi +++ b/indra/newview/installers/windows/lang_pl.nsi diff --git a/indra/newview/installers/windows/lang_pt-br.nsi b/indra/newview/installers/windows/lang_pt-br.nsi Binary files differindex eb3fb2386c..9ef252d232 100755 --- a/indra/newview/installers/windows/lang_pt-br.nsi +++ b/indra/newview/installers/windows/lang_pt-br.nsi diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi Binary files differindex 3b0042fbf5..d7c728d3e2 100755 --- a/indra/newview/installers/windows/lang_ru.nsi +++ b/indra/newview/installers/windows/lang_ru.nsi diff --git a/indra/newview/installers/windows/lang_tr.nsi b/indra/newview/installers/windows/lang_tr.nsi Binary files differindex b9be1eab08..97c602f4fc 100755 --- a/indra/newview/installers/windows/lang_tr.nsi +++ b/indra/newview/installers/windows/lang_tr.nsi diff --git a/indra/newview/installers/windows/lang_zh.nsi b/indra/newview/installers/windows/lang_zh.nsi Binary files differindex 3c6f6fd289..39c005a683 100755 --- a/indra/newview/installers/windows/lang_zh.nsi +++ b/indra/newview/installers/windows/lang_zh.nsi diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 5cb03cd2ae..21a060d834 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -408,10 +408,8 @@ LLAgent::LLAgent() : mCurrentFidget(0), mFirstLogin(FALSE), mOutfitChosen(FALSE), - - mVoiceConnected(false), - mAppearanceSerialNum(0), + mVoiceConnected(false), mMouselookModeInSignal(NULL), mMouselookModeOutSignal(NULL) @@ -2260,8 +2258,6 @@ void LLAgent::heardChat(const LLUUID& id) mChatTimer.reset(); } -const F32 SIT_POINT_EXTENTS = 0.2f; - LLSD ll_sdmap_from_vector3(const LLVector3& vec) { LLSD ret; @@ -3875,6 +3871,12 @@ void LLAgent::handleTeleportFinished() LLNotificationsUtil::add("PreferredMaturityChanged", args); mIsMaturityRatingChangingDuringTeleport = false; } + + // Init SLM Marketplace connection so we know which UI should be used for the user as a merchant + // Note: Eventually, all merchant will be migrated to the new SLM system and there will be no reason to show the old UI at all. + // Note: Some regions will not support the SLM cap for a while so we need to do that check for each teleport. + // *TODO : Suppress that line from here once the whole grid migrated to SLM and move it to idle_startup() (llstartup.cpp) + check_merchant_status(); } void LLAgent::handleTeleportFailed() diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index a2e9cedd88..56bd1428ce 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -787,8 +787,7 @@ public: private: BOOL mShowAvatar; // Should we render the avatar? - U32 mAppearanceSerialNum; - + //-------------------------------------------------------------------- // Rendering state bitmap helpers //-------------------------------------------------------------------- diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 2356a84688..291dffa210 100755 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -885,7 +885,6 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction) } - LLVector3d camera_offset(mCameraFocusOffsetTarget); LLVector3d camera_offset_unit(mCameraFocusOffsetTarget); F32 min_zoom = LAND_MIN_ZOOM; F32 current_distance = (F32)camera_offset_unit.normalize(); @@ -957,7 +956,6 @@ void LLAgentCamera::cameraOrbitIn(const F32 meters) } else { - LLVector3d camera_offset(mCameraFocusOffsetTarget); LLVector3d camera_offset_unit(mCameraFocusOffsetTarget); F32 current_distance = (F32)camera_offset_unit.normalize(); F32 new_distance = current_distance - meters; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d7ef5fcba7..a64d5b50b3 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3790,7 +3790,7 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b //to cause appearance of the agent to be updated bool result = false; - if (result = gAgentWearables.moveWearable(item, closer_to_body)) + if ((result = gAgentWearables.moveWearable(item, closer_to_body))) { gAgentAvatarp->wearableUpdated(item->getWearableType()); } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f6b6c71cfc..4bf719ec31 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -745,6 +745,15 @@ public: } }; +namespace { +// With Xcode 6, _exit() is too magical to use with boost::bind(), so provide +// this little helper function. +void fast_exit(int rc) +{ + _exit(rc); +} +} + bool LLAppViewer::init() { setupErrorHandling(mSecondInstance); @@ -801,10 +810,10 @@ bool LLAppViewer::init() S32 rc(gSavedSettings.getS32("QAModeTermCode")); if (rc >= 0) { - // QAModeTermCode set, terminate with that rc on LL_ERRS. Use _exit() - // rather than exit() because normal cleanup depends too much on - // successful startup! - LLError::setFatalFunction(boost::bind(_exit, rc)); + // QAModeTermCode set, terminate with that rc on LL_ERRS. Use + // fast_exit() rather than exit() because normal cleanup depends too + // much on successful startup! + LLError::setFatalFunction(boost::bind(fast_exit, rc)); } mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling")); @@ -1679,19 +1688,12 @@ bool LLAppViewer::cleanup() //dump scene loading monitor results LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv")); - if (LLFastTimerView::sAnalyzePerformance) - { - LL_INFOS() << "Analyzing performance" << LL_ENDL; - std::string baseline_name = LLTrace::BlockTimer::sLogName + "_baseline.slp"; - std::string current_name = LLTrace::BlockTimer::sLogName + ".slp"; - std::string report_name = LLTrace::BlockTimer::sLogName + "_report.csv"; - - LLFastTimerView::doAnalysis( - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, baseline_name), - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, current_name), - gDirUtilp->getExpandedFilename(LL_PATH_LOGS, report_name)); - } - LLMetricPerformanceTesterBasic::cleanClass(); + // There used to be an 'if (LLFastTimerView::sAnalyzePerformance)' block + // here, completely redundant with the one that occurs later in this same + // function. Presumably the duplication was due to an automated merge gone + // bad. Not knowing which instance to prefer, we chose to retain the later + // one because it happens just after mFastTimerLogThread is deleted. This + // comment is in case we guessed wrong, so we can move it here instead. // remove any old breakpad minidump files from the log directory if (! isError()) @@ -2036,7 +2038,7 @@ bool LLAppViewer::cleanup() sImageDecodeThread = NULL; delete mFastTimerLogThread; mFastTimerLogThread = NULL; - + if (LLFastTimerView::sAnalyzePerformance) { LL_INFOS() << "Analyzing performance" << LL_ENDL; diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index c792eb8813..56154a2de3 100755 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -63,16 +63,7 @@ namespace int gArgC; char** gArgV; LLAppViewerMacOSX* gViewerAppPtr; -#ifdef LL_CARBON_CRASH_HANDLER - OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) - { - OSErr result = noErr; - - LLAppViewer::instance()->userQuit(); - - return(result); - } -#endif + void (*gOldTerminateHandler)() = NULL; } diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index a98ff64d0a..e5c2d212fe 100755 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -63,9 +63,6 @@ #include "llsdutil.h" #include "llvfs.h" -// When uploading multiple files, don't display any of them when uploading more than this number. -static const S32 FILE_COUNT_DISPLAY_THRESHOLD = 5; - void dialog_refresh_all(); void on_new_single_inventory_upload_complete( diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp index 1c68fabf8b..272a68bdf7 100755 --- a/indra/newview/llblocklist.cpp +++ b/indra/newview/llblocklist.cpp @@ -40,7 +40,6 @@ static const LLBlockListNameTypeComparator NAME_TYPE_COMPARATOR; LLBlockList::LLBlockList(const Params& p) : LLFlatListViewEx(p), - mSelectedItem(NULL), mDirty(true), mShouldAddAll(true), mActionType(NONE), diff --git a/indra/newview/llblocklist.h b/indra/newview/llblocklist.h index bac79f869e..0f7fa41c32 100755 --- a/indra/newview/llblocklist.h +++ b/indra/newview/llblocklist.h @@ -83,7 +83,6 @@ private: LLHandle<LLToggleableMenu> mContextMenu; - LLBlockedListItem* mSelectedItem; std::string mNameFilter; bool mDirty; bool mShouldAddAll; diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp index 28e367fbe1..d8b04f7004 100755 --- a/indra/newview/llchicletbar.cpp +++ b/indra/newview/llchicletbar.cpp @@ -35,16 +35,6 @@ namespace { const std::string& PANEL_CHICLET_NAME = "chiclet_list_panel"; - - S32 get_curr_width(LLUICtrl* ctrl) - { - S32 cur_width = 0; - if ( ctrl && ctrl->getVisible() ) - { - cur_width = ctrl->getRect().getWidth(); - } - return cur_width; - } } LLChicletBar::LLChicletBar(const LLSD&) diff --git a/indra/newview/llcommunicationchannel.cpp b/indra/newview/llcommunicationchannel.cpp index 0821510645..cf98b56b4c 100755 --- a/indra/newview/llcommunicationchannel.cpp +++ b/indra/newview/llcommunicationchannel.cpp @@ -103,11 +103,11 @@ void LLCommunicationChannel::onDelete(LLNotificationPtr p) void LLCommunicationChannel::onFilterFail(LLNotificationPtr pNotificationPtr) { std::string notificationType = pNotificationPtr->getType(); - if ((notificationType == "groupnotify") + if (((notificationType == "groupnotify") || (notificationType == "offer") - || (notificationType == "notifytoast") + || (notificationType == "notifytoast")) && !pNotificationPtr->isCancelled()) { - mHistory.insert(std::make_pair<LLDate, LLNotificationPtr>(pNotificationPtr->getDate(), pNotificationPtr)); + mHistory.insert(history_list_t::value_type(pNotificationPtr->getDate(), pNotificationPtr)); } } diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 56e1a26709..af7b50802c 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -86,7 +86,7 @@ public: virtual void move( LLFolderViewModelItem* parent_listener ) { } virtual BOOL isItemCopyable() const { return FALSE; } virtual BOOL copyToClipboard() const { return FALSE; } - virtual BOOL cutToClipboard() const { return FALSE; } + virtual BOOL cutToClipboard() { return FALSE; } virtual BOOL isClipboardPasteable() const { return FALSE; } virtual void pasteFromClipboard() { } virtual void pasteLinkFromClipboard() { } @@ -213,7 +213,6 @@ private: void onAvatarNameCache(const LLAvatarName& av_name); // callback used by fetchAvatarName void updateName(const LLAvatarName& av_name); - bool mIsMuted; // default is false bool mIsModerator; // default is false bool mDisplayModeratorLabel; // default is false std::string mDisplayName; diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index c56006d9a3..3293b02131 100755 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -54,7 +54,6 @@ const F32 MIN_INTERPOLATE_DISTANCE_SQUARED = 0.001f * 0.001f; const F32 MAX_INTERPOLATE_DISTANCE_SQUARED = 10.f * 10.f; const F32 OBJECT_DAMPING_TIME_CONSTANT = 0.06f; -const F32 MIN_SHADOW_CASTER_RADIUS = 2.0f; static LLTrace::BlockTimerStatHandle FTM_CULL_REBOUND("Cull Rebound"); @@ -874,7 +873,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) } pos -= camera.getOrigin(); - mDistanceWRTCamera = llround(pos.magVec(), 0.01f); + mDistanceWRTCamera = ll_round(pos.magVec(), 0.01f); mVObjp->updateLOD(); } } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index ab96201a63..e1d3d1a905 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -71,8 +71,6 @@ extern BOOL gUseGLPick; F32 CLOTHING_GRAVITY_EFFECT = 0.7f; F32 CLOTHING_ACCEL_FORCE_FACTOR = 0.2f; -const S32 NUM_TEST_AVATARS = 30; -const S32 MIN_PIXEL_AREA_2_PASS_SKINNING = 500000000; // Format for gAGPVertices // vertex format for bumpmapping: diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 67d1642639..33f7bc305c 100755 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -1329,7 +1329,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI for( i = minimum; i <= maximum; i++ ) { F32 minus_one_to_one = F32(maximum - i) * twice_one_over_range - 1.f; - bias_and_scale_lut[i] = llclampb(llround(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128)); + bias_and_scale_lut[i] = llclampb(ll_round(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128)); } } else @@ -1337,7 +1337,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI for( i = minimum; i <= maximum; i++ ) { F32 minus_one_to_one = F32(i - minimum) * twice_one_over_range - 1.f; - bias_and_scale_lut[i] = llclampb(llround(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128)); + bias_and_scale_lut[i] = llclampb(ll_round(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128)); } } diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 76c37439ab..4a059fdc67 100755 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -219,7 +219,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) if (hasMouseCapture()) { F32 lerp = llclamp(1.f - (F32) (x - mGraphRect.mLeft) / (F32) mGraphRect.getWidth(), 0.f, 1.f); - mScrollIndex = llround( lerp * (F32)(mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY)); + mScrollIndex = ll_round( lerp * (F32)(mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY)); mScrollIndex = llclamp( mScrollIndex, 0, (S32)mRecording.getNumRecordedPeriods()); return TRUE; } @@ -361,7 +361,6 @@ BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks) static BlockTimerStatHandle FTM_RENDER_TIMER("Timers"); static const S32 MARGIN = 10; -static const S32 LEGEND_WIDTH = 220; static std::vector<LLColor4> sTimerColors; @@ -1136,7 +1135,7 @@ void LLFastTimerView::drawLineGraph() max_time = llmax(F32Microseconds(1.f), F32Microseconds(cur_max)); } - max_calls = llround(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f))); + max_calls = ll_round(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f))); if (llabs((S32)(max_calls - cur_max_calls)) <= 1) { max_calls = cur_max_calls; @@ -1472,7 +1471,7 @@ void LLFastTimerView::drawBars() LLRect frame_bar_rect; frame_bar_rect.setLeftTopAndSize(mBarRect.mLeft, bars_top, - llround((mAverageTimerRow.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()), + ll_round((mAverageTimerRow.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()), bar_height); mAverageTimerRow.mTop = frame_bar_rect.mTop; mAverageTimerRow.mBottom = frame_bar_rect.mBottom; @@ -1486,7 +1485,7 @@ void LLFastTimerView::drawBars() row.mTop = frame_bar_rect.mTop; row.mBottom = frame_bar_rect.mBottom; frame_bar_rect.mRight = frame_bar_rect.mLeft - + llround((row.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()); + + ll_round((row.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()); drawBar(frame_bar_rect, row, image_width, image_height); frame_bar_rect.translate(0, -(bar_height + vpad)); @@ -1617,8 +1616,8 @@ S32 LLFastTimerView::drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width, } LLRect children_rect; - children_rect.mLeft = llround(timer_bar.mChildrenStart / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft; - children_rect.mRight = llround(timer_bar.mChildrenEnd / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft; + children_rect.mLeft = ll_round(timer_bar.mChildrenStart / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft; + children_rect.mRight = ll_round(timer_bar.mChildrenEnd / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft; if (bar_rect.getHeight() > MIN_BAR_HEIGHT) { diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index d89599cb45..af84aea6a6 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -76,6 +76,8 @@ const char FEATURE_TABLE_FILENAME[] = "featuretable%s.txt"; const char FEATURE_TABLE_VER_FILENAME[] = "featuretable%s.%s.txt"; #endif +#if 0 // consuming code in #if 0 below +#endif LLFeatureInfo::LLFeatureInfo(const std::string& name, const BOOL available, const F32 level) : mValid(TRUE), mName(name), mAvailable(available), mRecommendedLevel(level) { diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 0e0cec3943..b6e67375cd 100755 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -164,11 +164,9 @@ private: #if LL_DARWIN S32 mPickOptions; std::vector<std::string> mFileVector; - UInt32 mFileIndex; bool doNavChooseDialog(ELoadFilter filter); bool doNavSaveDialog(ESaveFilter filter, const std::string& filename); - //static Boolean navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode); std::vector<std::string>* navOpenFilterProc(ELoadFilter filter); #endif diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index b64034b945..b6e61f83b1 100755 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -308,7 +308,7 @@ void LLVolumeImplFlexible::updateRenderRes() mRenderRes = (S32) (12.f*app_angle); #else //legacy behavior //number of segments only cares about z axis - F32 app_angle = llround((F32) atan2( mVO->getScale().mV[2]*2.f, drawablep->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); + F32 app_angle = ll_round((F32) atan2( mVO->getScale().mV[2]*2.f, drawablep->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); // Rendering sections increases with visible angle on the screen mRenderRes = (S32)(FLEXIBLE_OBJECT_MAX_SECTIONS*4*app_angle*DEG_TO_RAD/LLViewerCamera::getInstance()->getView()); diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 66149a4367..7ac3ac2f61 100755 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -123,18 +123,17 @@ BOOL LLFloaterAbout::postBuild() LLViewerTextEditor *support_widget = getChild<LLViewerTextEditor>("support_editor", true); - LLViewerTextEditor *linden_names_widget = - getChild<LLViewerTextEditor>("linden_names", true); - LLViewerTextEditor *contrib_names_widget = getChild<LLViewerTextEditor>("contrib_names", true); - LLViewerTextEditor *trans_names_widget = - getChild<LLViewerTextEditor>("trans_names", true); + LLViewerTextEditor *licenses_widget = + getChild<LLViewerTextEditor>("licenses_editor", true); getChild<LLUICtrl>("copy_btn")->setCommitCallback( boost::bind(&LLFloaterAbout::onClickCopyToClipboard, this)); + static const LLUIColor about_color = LLUIColorTable::instance().getColor("TextFgReadOnlyColor"); + if (gAgent.getRegion()) { // start fetching server release notes URL @@ -153,24 +152,6 @@ BOOL LLFloaterAbout::postBuild() support_widget->setEnabled(FALSE); support_widget->startOfDoc(); - // Get the names of Lindens, added by viewer_manifest.py at build time - std::string lindens_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"lindens.txt"); - llifstream linden_file; - std::string lindens; - linden_file.open(lindens_path); /* Flawfinder: ignore */ - if (linden_file.is_open()) - { - std::getline(linden_file, lindens); // all names are on a single line - linden_file.close(); - linden_names_widget->setText(lindens); - } - else - { - LL_INFOS("AboutInit") << "Could not read lindens file at " << lindens_path << LL_ENDL; - } - linden_names_widget->setEnabled(FALSE); - linden_names_widget->startOfDoc(); - // Get the names of contributors, extracted from .../doc/contributions.txt by viewer_manifest.py at build time std::string contributors_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"contributors.txt"); llifstream contrib_file; @@ -189,23 +170,28 @@ BOOL LLFloaterAbout::postBuild() contrib_names_widget->setEnabled(FALSE); contrib_names_widget->startOfDoc(); - // Get the names of translators, extracted from .../doc/tranlations.txt by viewer_manifest.py at build time - std::string translators_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"translators.txt"); - llifstream trans_file; - std::string translators; - trans_file.open(translators_path); /* Flawfinder: ignore */ - if (trans_file.is_open()) + // Get the Versions and Copyrights, created at build time + std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"packages-info.txt"); + llifstream licenses_file; + licenses_file.open(licenses_path); /* Flawfinder: ignore */ + if (licenses_file.is_open()) { - std::getline(trans_file, translators); // all names are on a single line - trans_file.close(); + std::string license_line; + licenses_widget->clear(); + while ( std::getline(licenses_file, license_line) ) + { + licenses_widget->appendText(license_line+"\n", FALSE, + LLStyle::Params() .color(about_color)); + } + licenses_file.close(); } else { - LL_WARNS("AboutInit") << "Could not read translators file at " << translators_path << LL_ENDL; + // this case will use the (out of date) hard coded value from the XUI + LL_INFOS("AboutInit") << "Could not read licenses file at " << licenses_path << LL_ENDL; } - trans_names_widget->setText(translators); - trans_names_widget->setEnabled(FALSE); - trans_names_widget->startOfDoc(); + licenses_widget->setEnabled(FALSE); + licenses_widget->startOfDoc(); return TRUE; } diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 060c091737..0a0e5ffc06 100755 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -65,9 +65,6 @@ // NOTE: This is duplicated in lldatamoney.cpp ... const F32 GROUP_LAND_BONUS_FACTOR = 1.1f; -const F64 CURRENCY_ESTIMATE_FREQUENCY = 0.5; - // how long of a pause in typing a currency buy amount before an - // estimate is fetched from the server class LLFloaterBuyLandUI : public LLFloater @@ -392,9 +389,9 @@ void LLFloaterBuyLandUI::updateParcelInfo() } mParcelBillableArea = - llround(mRegion->getBillableFactor() * mParcelActualArea); + ll_round(mRegion->getBillableFactor() * mParcelActualArea); - mParcelSupportedObjects = llround( + mParcelSupportedObjects = ll_round( parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); // Can't have more than region max tasks, regardless of parcel // object bonus factor. diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index d0939b3eee..6a82b8c74c 100755 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -47,9 +47,7 @@ static LLDefaultChildRegistry::Register<LLPanelCameraItem> r("panel_camera_item" const F32 NUDGE_TIME = 0.25f; // in seconds const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed -// Constants -const F32 CAMERA_BUTTON_DELAY = 0.0f; - +// constants #define ORBIT "cam_rotate_stick" #define PAN "cam_track_stick" #define ZOOM "zoom" diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp index 6888e076aa..3a2047cfef 100644 --- a/indra/newview/llfloaterfacebook.cpp +++ b/indra/newview/llfloaterfacebook.cpp @@ -59,7 +59,6 @@ static LLPanelInjector<LLFacebookPhotoPanel> t_panel_photo("llfacebookphotopanel static LLPanelInjector<LLFacebookCheckinPanel> t_panel_checkin("llfacebookcheckinpanel"); static LLPanelInjector<LLFacebookFriendsPanel> t_panel_friends("llfacebookfriendspanel"); -const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/"; const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazonaws.com/map_placeholder.png"; const std::string DEFAULT_CHECKIN_QUERY_PARAMETERS = "?sourceid=slshare_checkin&utm_source=facebook&utm_medium=checkin&utm_campaign=slshare"; diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp index 36afab86b7..51352e083a 100644 --- a/indra/newview/llfloaterflickr.cpp +++ b/indra/newview/llfloaterflickr.cpp @@ -55,7 +55,6 @@ static LLPanelInjector<LLFlickrPhotoPanel> t_panel_photo("llflickrphotopanel"); static LLPanelInjector<LLFlickrAccountPanel> t_panel_account("llflickraccountpanel"); -const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=flickr&utm_medium=photo&utm_campaign=slshare"; const std::string DEFAULT_TAG_TEXT = "secondlife "; const std::string FLICKR_MACHINE_TAGS_NAMESPACE = "secondlife"; diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 6966ca5639..37774fbc5c 100755 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -401,14 +401,9 @@ void LLFloaterGodTools::sendGodUpdateRegionInfo() // Floats because spinners only support floats. JC const F32 BILLABLE_FACTOR_DEFAULT = 1; -const F32 BILLABLE_FACTOR_MIN = 0.0f; -const F32 BILLABLE_FACTOR_MAX = 4.f; // floats because spinners only understand floats. JC const F32 PRICE_PER_METER_DEFAULT = 1.f; -const F32 PRICE_PER_METER_MIN = 0.f; -const F32 PRICE_PER_METER_MAX = 100.f; - LLPanelRegionTools::LLPanelRegionTools() : LLPanel() @@ -833,9 +828,6 @@ void LLPanelRegionTools::onSelectRegion() // ^ ^ ^ // LEFT R2 RIGHT -const F32 HOURS_TO_RADIANS = (2.f*F_PI)/24.f; - - LLPanelGridTools::LLPanelGridTools() : LLPanel() { diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index 9def253ba5..fc7fcf3ab9 100755 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -396,7 +396,7 @@ bool LLFloaterIMSession::canAddSelectedToChat(const uuid_vec_t& uuids) { if (!mSession || mDialog == IM_SESSION_GROUP_START - || mDialog == IM_SESSION_INVITE && gAgent.isInGroup(mSessionID)) + || (mDialog == IM_SESSION_INVITE && gAgent.isInGroup(mSessionID))) { return false; } @@ -779,7 +779,7 @@ bool LLFloaterIMSession::toggle(const LLUUID& session_id) floater->setVisible(false); return false; } - else if(floater && (!floater->isDocked() || floater->getVisible() && !floater->hasFocus())) + else if(floater && ((!floater->isDocked() || floater->getVisible()) && !floater->hasFocus())) { floater->setVisible(TRUE); floater->setFocus(TRUE); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 7621c35ed2..8c4feff1d9 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1224,7 +1224,7 @@ void LLPanelLandObjects::refresh() { S32 sw_max = parcel->getSimWideMaxPrimCapacity(); S32 sw_total = parcel->getSimWidePrimCount(); - S32 max = llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); + S32 max = ll_round(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); S32 total = parcel->getPrimCount(); S32 owned = parcel->getOwnerPrimCount(); S32 group = parcel->getGroupPrimCount(); @@ -2049,9 +2049,9 @@ void LLPanelLandOptions::refresh() else { mLocationText->setTextArg("[LANDING]",llformat("%d, %d, %d (%d\xC2\xB0)", - llround(pos.mV[VX]), - llround(pos.mV[VY]), - llround(pos.mV[VZ]), + ll_round(pos.mV[VX]), + ll_round(pos.mV[VY]), + ll_round(pos.mV[VZ]), user_look_at_angle)); } diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index cf03087afb..f34760a6bf 100755 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -208,8 +208,8 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**) self->mActualArea += actual_area; self->mBillableArea += billable_area; - S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; - S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; + S32 region_x = ll_round(global_x) % REGION_WIDTH_UNITS; + S32 region_y = ll_round(global_y) % REGION_WIDTH_UNITS; std::string location; location = llformat("%s (%d, %d)", sim_name.c_str(), region_x, region_y); diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 473e2938be..333ff863e5 100755 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -52,10 +52,7 @@ // The minor cardinal direction labels are hidden if their height is more // than this proportion of the map. const F32 MAP_MINOR_DIR_THRESHOLD = 0.07f; -const S32 MAP_PADDING_LEFT = 0; -const S32 MAP_PADDING_TOP = 2; -const S32 MAP_PADDING_RIGHT = 2; -const S32 MAP_PADDING_BOTTOM = 0; + // // Member functions // @@ -156,8 +153,8 @@ void LLFloaterMap::setDirectionPos( LLTextBox* text_box, F32 rotation ) 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 )) ); + ll_round(map_half_width - text_half_width + radius * cos( rotation )), + ll_round(map_half_height - text_half_height + radius * sin( rotation )) ); } void LLFloaterMap::updateMinorDirections() diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp new file mode 100755 index 0000000000..5d3eb50240 --- /dev/null +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -0,0 +1,916 @@ +/** + * @file llfloatermarketplacelistings.cpp + * @brief Implementation of the marketplace listings floater and panels + * @author merov@lindenlab.com + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatermarketplacelistings.h" + +#include "llfloaterreg.h" +#include "llfiltereditor.h" +#include "llfolderview.h" +#include "llinventorybridge.h" +#include "llinventorymodelbackgroundfetch.h" +#include "llinventoryobserver.h" +#include "llinventoryfunctions.h" +#include "llmarketplacefunctions.h" +#include "llnotificationhandler.h" +#include "llnotificationmanager.h" +#include "llnotificationsutil.h" +#include "llsidepaneliteminfo.h" +#include "lltextbox.h" +#include "lltrans.h" + +///---------------------------------------------------------------------------- +/// LLPanelMarketplaceListings +///---------------------------------------------------------------------------- + +static LLPanelInjector<LLPanelMarketplaceListings> t_panel_status("llpanelmarketplacelistings"); + +LLPanelMarketplaceListings::LLPanelMarketplaceListings() +: mRootFolder(NULL) +, mSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME) +, mFilterListingFoldersOnly(false) +{ + mCommitCallbackRegistrar.add("Marketplace.ViewSort.Action", boost::bind(&LLPanelMarketplaceListings::onViewSortMenuItemClicked, this, _2)); + mEnableCallbackRegistrar.add("Marketplace.ViewSort.CheckItem", boost::bind(&LLPanelMarketplaceListings::onViewSortMenuItemCheck, this, _2)); +} + +BOOL LLPanelMarketplaceListings::postBuild() +{ + childSetAction("add_btn", boost::bind(&LLPanelMarketplaceListings::onAddButtonClicked, this)); + childSetAction("audit_btn", boost::bind(&LLPanelMarketplaceListings::onAuditButtonClicked, this)); + + mFilterEditor = getChild<LLFilterEditor>("filter_editor"); + mFilterEditor->setCommitCallback(boost::bind(&LLPanelMarketplaceListings::onFilterEdit, this, _2)); + + mAuditBtn = getChild<LLButton>("audit_btn"); + mAuditBtn->setEnabled(FALSE); + + return LLPanel::postBuild(); +} + +BOOL LLPanelMarketplaceListings::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) +{ + LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + BOOL handled = (handled_view != NULL); + // Special case the drop zone + if (handled && (handled_view->getName() == "marketplace_drop_zone")) + { + LLFolderView* root_folder = getRootFolder(); + handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + } + return handled; +} + +void LLPanelMarketplaceListings::buildAllPanels() +{ + // Build the All panel first + LLInventoryPanel* panel_all_items; + panel_all_items = buildInventoryPanel("All Items", "panel_marketplace_listings_inventory.xml"); + panel_all_items->getFilter().setEmptyLookupMessage("MarketplaceNoMatchingItems"); + panel_all_items->getFilter().markDefault(); + + // Build the other panels + LLInventoryPanel* panel; + panel = buildInventoryPanel("Active Items", "panel_marketplace_listings_listed.xml"); + panel->getFilter().setFilterMarketplaceActiveFolders(); + panel->getFilter().setEmptyLookupMessage("MarketplaceNoMatchingItems"); + panel->getFilter().markDefault(); + panel = buildInventoryPanel("Inactive Items", "panel_marketplace_listings_unlisted.xml"); + panel->getFilter().setFilterMarketplaceInactiveFolders(); + panel->getFilter().setEmptyLookupMessage("MarketplaceNoMatchingItems"); + panel->getFilter().markDefault(); + panel = buildInventoryPanel("Unassociated Items", "panel_marketplace_listings_unassociated.xml"); + panel->getFilter().setFilterMarketplaceUnassociatedFolders(); + panel->getFilter().setEmptyLookupMessage("MarketplaceNoMatchingItems"); + panel->getFilter().markDefault(); + + // Set the tab panel + LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs"); + tabs_panel->setCommitCallback(boost::bind(&LLPanelMarketplaceListings::onTabChange, this)); + tabs_panel->selectTabPanel(panel_all_items); // All panel selected by default + mRootFolder = panel_all_items->getRootFolder(); // Keep the root of the all panel +} + +LLInventoryPanel* LLPanelMarketplaceListings::buildInventoryPanel(const std::string& childname, const std::string& filename) +{ + LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs"); + LLInventoryPanel* panel = LLUICtrlFactory::createFromFile<LLInventoryPanel>(filename, tabs_panel, LLInventoryPanel::child_registry_t::instance()); + llassert(panel != NULL); + + // Set sort order and callbacks + panel = getChild<LLInventoryPanel>(childname); + panel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_FOLDERS_BY_NAME); + panel->setSelectCallback(boost::bind(&LLPanelMarketplaceListings::onSelectionChange, this, panel, _1, _2)); + + return panel; +} + +void LLPanelMarketplaceListings::onFilterEdit(const std::string& search_string) +{ + // Find active panel + LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel(); + if (panel) + { + // Save filter string (needed when switching tabs) + mFilterSubString = search_string; + // Set filter string on active panel + panel->setFilterSubString(mFilterSubString); + } +} + +void LLPanelMarketplaceListings::draw() +{ + if (LLMarketplaceData::instance().checkDirtyCount()) + { + update_all_marketplace_count(); + } + + // Get the audit button enabled only after the whole inventory is fetched + if (!mAuditBtn->getEnabled()) + { + mAuditBtn->setEnabled(LLInventoryModelBackgroundFetch::instance().isEverythingFetched()); + } + + LLPanel::draw(); +} + +void LLPanelMarketplaceListings::onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, BOOL user_action) +{ + panel->onSelectionChange(items, user_action); +} + +bool LLPanelMarketplaceListings::allowDropOnRoot() +{ + LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel(); + return (panel ? panel->getAllowDropOnRoot() : false); +} + +void LLPanelMarketplaceListings::onTabChange() +{ + // Find active panel + LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel(); + if (panel) + { + // If the panel doesn't allow drop on root, it doesn't allow the creation of new folder on root either + LLButton* add_btn = getChild<LLButton>("add_btn"); + add_btn->setEnabled(panel->getAllowDropOnRoot()); + + // Set filter string on active panel + panel->setFilterSubString(mFilterSubString); + + // Show/hide the drop zone and resize the inventory tabs panel accordingly + LLPanel* drop_zone = (LLPanel*)getChild<LLPanel>("marketplace_drop_zone"); + bool drop_zone_visible = drop_zone->getVisible(); + if (drop_zone_visible != panel->getAllowDropOnRoot()) + { + LLPanel* tabs = (LLPanel*)getChild<LLPanel>("tab_container_panel"); + S32 delta_height = drop_zone->getRect().getHeight(); + delta_height = (drop_zone_visible ? delta_height : -delta_height); + tabs->reshape(tabs->getRect().getWidth(),tabs->getRect().getHeight() + delta_height); + tabs->translate(0,-delta_height); + } + drop_zone->setVisible(panel->getAllowDropOnRoot()); + } +} + +void LLPanelMarketplaceListings::onAddButtonClicked() +{ + // Find active panel + LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel(); + if (panel) + { + LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + llassert(marketplacelistings_id.notNull()); + LLFolderType::EType preferred_type = LLFolderType::lookup("category"); + LLUUID category = gInventory.createNewCategory(marketplacelistings_id, preferred_type, LLStringUtil::null); + gInventory.notifyObservers(); + panel->setSelectionByID(category, TRUE); + panel->getRootFolder()->setNeedsAutoRename(TRUE); + } +} + +void LLPanelMarketplaceListings::onAuditButtonClicked() +{ + LLSD data(LLSD::emptyMap()); + LLFloaterReg::showInstance("marketplace_validation", data); +} + +void LLPanelMarketplaceListings::onViewSortMenuItemClicked(const LLSD& userdata) +{ + std::string chosen_item = userdata.asString(); + + // Sort options + if (chosen_item == "sort_by_stock_amount") + { + mSortOrder = (mSortOrder == LLInventoryFilter::SO_FOLDERS_BY_NAME ? LLInventoryFilter::SO_FOLDERS_BY_WEIGHT : LLInventoryFilter::SO_FOLDERS_BY_NAME); + // Set each panel with that sort order + LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs"); + LLInventoryPanel* panel = (LLInventoryPanel*)tabs_panel->getPanelByName("All Items"); + panel->setSortOrder(mSortOrder); + panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Active Items"); + panel->setSortOrder(mSortOrder); + panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Inactive Items"); + panel->setSortOrder(mSortOrder); + panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Unassociated Items"); + panel->setSortOrder(mSortOrder); + } + // Filter option + else if (chosen_item == "show_only_listing_folders") + { + mFilterListingFoldersOnly = !mFilterListingFoldersOnly; + // Set each panel with that filter flag + LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs"); + LLInventoryPanel* panel = (LLInventoryPanel*)tabs_panel->getPanelByName("All Items"); + panel->getFilter().setFilterMarketplaceListingFolders(mFilterListingFoldersOnly); + panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Active Items"); + panel->getFilter().setFilterMarketplaceListingFolders(mFilterListingFoldersOnly); + panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Inactive Items"); + panel->getFilter().setFilterMarketplaceListingFolders(mFilterListingFoldersOnly); + panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Unassociated Items"); + panel->getFilter().setFilterMarketplaceListingFolders(mFilterListingFoldersOnly); + } +} + +bool LLPanelMarketplaceListings::onViewSortMenuItemCheck(const LLSD& userdata) +{ + std::string chosen_item = userdata.asString(); + + if (chosen_item == "sort_by_stock_amount") + { + return mSortOrder == LLInventoryFilter::SO_FOLDERS_BY_WEIGHT; + } + else if (chosen_item == "show_only_listing_folders") + { + return mFilterListingFoldersOnly; + } + return false; +} + +///---------------------------------------------------------------------------- +/// LLMarketplaceListingsAddedObserver helper class +///---------------------------------------------------------------------------- + +class LLMarketplaceListingsAddedObserver : public LLInventoryCategoryAddedObserver +{ +public: + LLMarketplaceListingsAddedObserver(LLFloaterMarketplaceListings * marketplace_listings_floater) + : LLInventoryCategoryAddedObserver() + , mMarketplaceListingsFloater(marketplace_listings_floater) + { + } + + void done() + { + for (cat_vec_t::iterator it = mAddedCategories.begin(); it != mAddedCategories.end(); ++it) + { + LLViewerInventoryCategory* added_category = *it; + + LLFolderType::EType added_category_type = added_category->getPreferredType(); + + if (added_category_type == LLFolderType::FT_MARKETPLACE_LISTINGS) + { + mMarketplaceListingsFloater->initializeMarketPlace(); + } + } + } + +private: + LLFloaterMarketplaceListings * mMarketplaceListingsFloater; +}; + +///---------------------------------------------------------------------------- +/// LLFloaterMarketplaceListings +///---------------------------------------------------------------------------- + +LLFloaterMarketplaceListings::LLFloaterMarketplaceListings(const LLSD& key) +: LLFloater(key) +, mCategoriesObserver(NULL) +, mCategoryAddedObserver(NULL) +, mRootFolderId(LLUUID::null) +, mInventoryStatus(NULL) +, mInventoryInitializationInProgress(NULL) +, mInventoryPlaceholder(NULL) +, mInventoryText(NULL) +, mInventoryTitle(NULL) +, mPanelListings(NULL) +, mPanelListingsSet(false) +{ +} + +LLFloaterMarketplaceListings::~LLFloaterMarketplaceListings() +{ + if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver)) + { + gInventory.removeObserver(mCategoriesObserver); + } + delete mCategoriesObserver; + + if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver)) + { + gInventory.removeObserver(mCategoryAddedObserver); + } + delete mCategoryAddedObserver; +} + +BOOL LLFloaterMarketplaceListings::postBuild() +{ + mInventoryStatus = getChild<LLTextBox>("marketplace_status"); + mInventoryInitializationInProgress = getChild<LLView>("initialization_progress_indicator"); + mInventoryPlaceholder = getChild<LLView>("marketplace_listings_inventory_placeholder_panel"); + mInventoryText = mInventoryPlaceholder->getChild<LLTextBox>("marketplace_listings_inventory_placeholder_text"); + mInventoryTitle = mInventoryPlaceholder->getChild<LLTextBox>("marketplace_listings_inventory_placeholder_title"); + + mPanelListings = static_cast<LLPanelMarketplaceListings*>(getChild<LLUICtrl>("panel_marketplace_listing")); + + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLFloaterMarketplaceListings::onFocusReceived, this)); + + // Observe category creation to catch marketplace listings creation (moot if already existing) + mCategoryAddedObserver = new LLMarketplaceListingsAddedObserver(this); + gInventory.addObserver(mCategoryAddedObserver); + + // Fetch aggressively so we can interact with listings right onOpen() + fetchContents(); + + return TRUE; +} + +void LLFloaterMarketplaceListings::onClose(bool app_quitting) +{ +} + +void LLFloaterMarketplaceListings::onOpen(const LLSD& key) +{ + // + // Initialize the Market Place or go update the marketplace listings + // + if (LLMarketplaceData::instance().getSLMStatus() <= MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE) + { + initializeMarketPlace(); + } + else + { + updateView(); + } +} + +void LLFloaterMarketplaceListings::onFocusReceived() +{ + updateView(); +} + +void LLFloaterMarketplaceListings::fetchContents() +{ + if (mRootFolderId.notNull() && + (LLMarketplaceData::instance().getSLMDataFetched() != MarketplaceFetchCodes::MARKET_FETCH_LOADING) && + (LLMarketplaceData::instance().getSLMDataFetched() != MarketplaceFetchCodes::MARKET_FETCH_DONE)) + { + LLMarketplaceData::instance().setDataFetchedSignal(boost::bind(&LLFloaterMarketplaceListings::updateView, this)); + LLMarketplaceData::instance().setSLMDataFetched(MarketplaceFetchCodes::MARKET_FETCH_LOADING); + LLInventoryModelBackgroundFetch::instance().start(mRootFolderId); + LLMarketplaceData::instance().getSLMListings(); + } +} + +void LLFloaterMarketplaceListings::setRootFolder() +{ + if ((LLMarketplaceData::instance().getSLMStatus() != MarketplaceStatusCodes::MARKET_PLACE_MERCHANT) && + (LLMarketplaceData::instance().getSLMStatus() != MarketplaceStatusCodes::MARKET_PLACE_MIGRATED_MERCHANT)) + { + // If we are *not* a merchant or we have no market place connection established yet, do nothing + return; + } + + // We are a merchant. Get the Marketplace listings folder, create it if needs be. + LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, true); + if (marketplacelistings_id.isNull()) + { + // We should never get there unless the inventory fails badly + LL_ERRS("SLM") << "Inventory problem: failure to create the marketplace listings folder for a merchant!" << LL_ENDL; + return; + } + + // No longer need to observe new category creation + if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver)) + { + gInventory.removeObserver(mCategoryAddedObserver); + delete mCategoryAddedObserver; + mCategoryAddedObserver = NULL; + } + llassert(!mCategoryAddedObserver); + + if (marketplacelistings_id == mRootFolderId) + { + LL_WARNS("SLM") << "Inventory warning: Marketplace listings folder already set" << LL_ENDL; + return; + } + + mRootFolderId = marketplacelistings_id; +} + +void LLFloaterMarketplaceListings::setPanels() +{ + if (mRootFolderId.isNull()) + { + return; + } + + // Consolidate Marketplace listings + // We shouldn't have to do that but with a client/server system relying on a "well known folder" convention, + // things get messy and conventions get broken down eventually + gInventory.consolidateForType(mRootFolderId, LLFolderType::FT_MARKETPLACE_LISTINGS); + + // Now that we do have a non NULL root, we can build the inventory panels + mPanelListings->buildAllPanels(); + + // Create observer for marketplace listings modifications + if (!mCategoriesObserver) + { + mCategoriesObserver = new LLInventoryCategoriesObserver(); + llassert(mCategoriesObserver); + gInventory.addObserver(mCategoriesObserver); + mCategoriesObserver->addCategory(mRootFolderId, boost::bind(&LLFloaterMarketplaceListings::onChanged, this)); + } + + // Get the content of the marketplace listings folder + fetchContents(); + + // Flag that this is done + mPanelListingsSet = true; +} + +void LLFloaterMarketplaceListings::initializeMarketPlace() +{ + LLMarketplaceData::instance().initializeSLM(boost::bind(&LLFloaterMarketplaceListings::updateView, this)); +} + +S32 LLFloaterMarketplaceListings::getFolderCount() +{ + if (mPanelListings && mRootFolderId.notNull()) + { + LLInventoryModel::cat_array_t * cats; + LLInventoryModel::item_array_t * items; + gInventory.getDirectDescendentsOf(mRootFolderId, cats, items); + + return (cats->size() + items->size()); + } + else + { + return 0; + } +} + +void LLFloaterMarketplaceListings::setStatusString(const std::string& statusString) +{ + mInventoryStatus->setText(statusString); +} + +void LLFloaterMarketplaceListings::updateView() +{ + U32 mkt_status = LLMarketplaceData::instance().getSLMStatus(); + bool is_merchant = (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT) || (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MIGRATED_MERCHANT); + U32 data_fetched = LLMarketplaceData::instance().getSLMDataFetched(); + + // Get or create the root folder if we are a merchant and it hasn't been done already + if (mRootFolderId.isNull() && is_merchant) + { + setRootFolder(); + } + + // Update the bottom initializing status and progress dial if we are initializing or if we're a merchant and still loading + if ((mkt_status <= MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING) || (is_merchant && (data_fetched <= MarketplaceFetchCodes::MARKET_FETCH_LOADING)) ) + { + // Just show the loading indicator in that case and fetch the data (fetch will be skipped if it's already loading) + mInventoryInitializationInProgress->setVisible(true); + mPanelListings->setVisible(FALSE); + fetchContents(); + return; + } + else + { + mInventoryInitializationInProgress->setVisible(false); + } + + // Update the middle portion : tabs or messages + if (getFolderCount() > 0) + { + if (!mPanelListingsSet) + { + // We need to rebuild the tabs cleanly the first time we make them visible + setPanels(); + } + mPanelListings->setVisible(TRUE); + mInventoryPlaceholder->setVisible(FALSE); + } + else + { + mPanelListings->setVisible(FALSE); + mInventoryPlaceholder->setVisible(TRUE); + + std::string text; + std::string title; + std::string tooltip; + + const LLSD& subs = getMarketplaceStringSubstitutions(); + + // Update the top message or flip to the tabs and folders view + // *TODO : check those messages and create better appropriate ones in strings.xml + if (mRootFolderId.notNull()) + { + // "Marketplace listings is empty!" message strings + text = LLTrans::getString("InventoryMarketplaceListingsNoItems", subs); + title = LLTrans::getString("InventoryMarketplaceListingsNoItemsTitle"); + tooltip = LLTrans::getString("InventoryMarketplaceListingsNoItemsTooltip"); + } + else if (mkt_status <= MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING) + { + // "Initializing!" message strings + text = LLTrans::getString("InventoryOutboxInitializing", subs); + title = LLTrans::getString("InventoryOutboxInitializingTitle"); + tooltip = LLTrans::getString("InventoryOutboxInitializingTooltip"); + } + else if (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT) + { + // "Not a merchant!" message strings + text = LLTrans::getString("InventoryOutboxNotMerchant", subs); + title = LLTrans::getString("InventoryOutboxNotMerchantTitle"); + tooltip = LLTrans::getString("InventoryOutboxNotMerchantTooltip"); + } + else + { + // "Errors!" message strings + text = LLTrans::getString("InventoryMarketplaceError", subs); + title = LLTrans::getString("InventoryOutboxErrorTitle"); + tooltip = LLTrans::getString("InventoryOutboxErrorTooltip"); + } + + mInventoryText->setValue(text); + mInventoryTitle->setValue(title); + mInventoryPlaceholder->getParent()->setToolTip(tooltip); + } +} + +bool LLFloaterMarketplaceListings::isAccepted(EAcceptance accept) +{ + return (accept >= ACCEPT_YES_COPY_SINGLE); +} + +BOOL LLFloaterMarketplaceListings::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) +{ + // If there's no panel to accept drops or no existing marketplace listings folder, we refuse all drop + if (!mPanelListings || mRootFolderId.isNull()) + { + return FALSE; + } + + tooltip_msg = ""; + + // Pass to the children + LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + BOOL handled = (handled_view != NULL); + + // If no one handled it or it was not accepted and we drop on an empty panel, we try to accept it at the floater level + // as if it was dropped on the marketplace listings root folder + if ((!handled || !isAccepted(*accept)) && !mPanelListings->getVisible() && mRootFolderId.notNull()) + { + if (!mPanelListingsSet) + { + setPanels(); + } + LLFolderView* root_folder = mPanelListings->getRootFolder(); + handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + } + + return handled; +} + +BOOL LLFloaterMarketplaceListings::handleHover(S32 x, S32 y, MASK mask) +{ + return LLFloater::handleHover(x, y, mask); +} + +void LLFloaterMarketplaceListings::onMouseLeave(S32 x, S32 y, MASK mask) +{ + LLFloater::onMouseLeave(x, y, mask); +} + +void LLFloaterMarketplaceListings::onChanged() +{ + LLViewerInventoryCategory* category = gInventory.getCategory(mRootFolderId); + if (mRootFolderId.notNull() && category) + { + updateView(); + } + else + { + // Invalidate the marketplace listings data + mRootFolderId.setNull(); + } +} + +//----------------------------------------------------------------------------- +// LLFloaterAssociateListing +//----------------------------------------------------------------------------- + +// Tell if a listing has one only version folder +bool hasUniqueVersionFolder(const LLUUID& folder_id) +{ + LLInventoryModel::cat_array_t* categories; + LLInventoryModel::item_array_t* items; + gInventory.getDirectDescendentsOf(folder_id, categories, items); + return (categories->size() == 1); +} + +LLFloaterAssociateListing::LLFloaterAssociateListing(const LLSD& key) +: LLFloater(key) +, mUUID() +{ +} + +LLFloaterAssociateListing::~LLFloaterAssociateListing() +{ + gFocusMgr.releaseFocusIfNeeded( this ); +} + +BOOL LLFloaterAssociateListing::postBuild() +{ + getChild<LLButton>("OK")->setCommitCallback(boost::bind(&LLFloaterAssociateListing::apply, this, TRUE)); + getChild<LLButton>("Cancel")->setCommitCallback(boost::bind(&LLFloaterAssociateListing::cancel, this)); + getChild<LLLineEditor>("listing_id")->setPrevalidate(&LLTextValidate::validateNonNegativeS32); + center(); + + return LLFloater::postBuild(); +} + +BOOL LLFloaterAssociateListing::handleKeyHere(KEY key, MASK mask) +{ + if (key == KEY_RETURN && mask == MASK_NONE) + { + apply(); + return TRUE; + } + else if (key == KEY_ESCAPE && mask == MASK_NONE) + { + cancel(); + return TRUE; + } + + return LLFloater::handleKeyHere(key, mask); +} + +// static +LLFloaterAssociateListing* LLFloaterAssociateListing::show(const LLUUID& folder_id) +{ + LLFloaterAssociateListing* floater = LLFloaterReg::showTypedInstance<LLFloaterAssociateListing>("associate_listing"); + + floater->mUUID = folder_id; + + return floater; +} + +// Callback for apply if DAMA required... +void LLFloaterAssociateListing::callback_apply(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES + { + apply(FALSE); + } +} + +void LLFloaterAssociateListing::apply(BOOL user_confirm) +{ + if (mUUID.notNull()) + { + S32 id = (S32)getChild<LLUICtrl>("listing_id")->getValue().asInteger(); + if (id > 0) + { + // Check if the id exists in the merchant SLM DB: note that this record might exist in the LLMarketplaceData + // structure even if unseen in the UI, for instance, if its listing_uuid doesn't exist in the merchant inventory + LLUUID listing_uuid = LLMarketplaceData::instance().getListingFolder(id); + if (listing_uuid.notNull() && user_confirm && LLMarketplaceData::instance().getActivationState(listing_uuid) && !hasUniqueVersionFolder(mUUID)) + { + // Look for user confirmation before unlisting + LLNotificationsUtil::add("ConfirmMerchantUnlist", LLSD(), LLSD(), boost::bind(&LLFloaterAssociateListing::callback_apply, this, _1, _2)); + return; + } + // Associate the id with the user chosen folder + LLMarketplaceData::instance().associateListing(mUUID,listing_uuid,id); + } + else + { + LLNotificationsUtil::add("AlertMerchantListingInvalidID"); + } + } + closeFloater(); +} + +void LLFloaterAssociateListing::cancel() +{ + closeFloater(); +} + +//----------------------------------------------------------------------------- +// LLFloaterMarketplaceValidation +//----------------------------------------------------------------------------- + +// Note: The key is the UUID of the folder to validate. +// Validates the whole marketplace listings content if UUID is null. + +LLFloaterMarketplaceValidation::LLFloaterMarketplaceValidation(const LLSD& key) +: LLFloater(key), +mEditor(NULL) +{ +} + +BOOL LLFloaterMarketplaceValidation::postBuild() +{ + childSetAction("OK", onOK, this); + + // This widget displays the validation messages + mEditor = getChild<LLTextEditor>("validation_text"); + mEditor->setEnabled(FALSE); + mEditor->setFocus(TRUE); + mEditor->setValue(LLSD()); + + return TRUE; +} + +LLFloaterMarketplaceValidation::~LLFloaterMarketplaceValidation() +{ +} + +// virtual +void LLFloaterMarketplaceValidation::draw() +{ + // draw children + LLFloater::draw(); +} + +void LLFloaterMarketplaceValidation::onOpen(const LLSD& key) +{ + // Clear the messages + clearMessages(); + + // Get the folder UUID to validate. Use the whole marketplace listing if none provided. + LLUUID cat_id(key.asUUID()); + if (cat_id.isNull()) + { + cat_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + } + + // Validates the folder + if (cat_id.notNull()) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); + validate_marketplacelistings(cat, boost::bind(&LLFloaterMarketplaceValidation::appendMessage, this, _1, _2, _3), false); + } + + // Handle the listing folder being processed + handleCurrentListing(); + + // Dump result to the editor panel + if (mEditor) + { + mEditor->setValue(LLSD()); + if (mMessages.empty()) + { + // Display a no error message + mEditor->appendText(LLTrans::getString("Marketplace Validation No Error"), false); + } + else + { + // Print out all the messages to the panel + message_list_t::iterator mCurrentLine = mMessages.begin(); + bool new_line = false; + while (mCurrentLine != mMessages.end()) + { + // Errors are printed in bold, other messages in normal font + LLStyle::Params style; + LLFontDescriptor new_desc(mEditor->getFont()->getFontDesc()); + new_desc.setStyle(mCurrentLine->mErrorLevel == LLError::LEVEL_ERROR ? LLFontGL::BOLD : LLFontGL::NORMAL); + LLFontGL* new_font = LLFontGL::getFont(new_desc); + style.font = new_font; + mEditor->appendText(mCurrentLine->mMessage, new_line, style); + new_line = true; + mCurrentLine++; + } + } + } + // We don't need the messages anymore + clearMessages(); +} + +// static +void LLFloaterMarketplaceValidation::onOK( void* userdata ) +{ + // destroys this object + LLFloaterMarketplaceValidation* self = (LLFloaterMarketplaceValidation*) userdata; + self->clearMessages(); + self->closeFloater(); +} + +void LLFloaterMarketplaceValidation::appendMessage(std::string& message, S32 depth, LLError::ELevel log_level) +{ + // Dump previous listing messages if we're starting a new listing + if (depth == 1) + { + handleCurrentListing(); + } + + // Store the message in the current listing message list + Message current_message; + current_message.mErrorLevel = log_level; + current_message.mMessage = message; + mCurrentListingMessages.push_back(current_message); + mCurrentListingErrorLevel = (mCurrentListingErrorLevel < log_level ? log_level : mCurrentListingErrorLevel); +} + +// Move the current listing messages to the general list if needs be and reset the current listing data +void LLFloaterMarketplaceValidation::handleCurrentListing() +{ + // Dump the current folder messages to the general message list if level warrants it + if (mCurrentListingErrorLevel > LLError::LEVEL_INFO) + { + message_list_t::iterator mCurrentLine = mCurrentListingMessages.begin(); + while (mCurrentLine != mCurrentListingMessages.end()) + { + mMessages.push_back(*mCurrentLine); + mCurrentLine++; + } + } + + // Reset the current listing + mCurrentListingMessages.clear(); + mCurrentListingErrorLevel = LLError::LEVEL_INFO; +} + +void LLFloaterMarketplaceValidation::clearMessages() +{ + mMessages.clear(); + mCurrentListingMessages.clear(); + mCurrentListingErrorLevel = LLError::LEVEL_INFO; +} + +//----------------------------------------------------------------------------- +// LLFloaterItemProperties +//----------------------------------------------------------------------------- + +LLFloaterItemProperties::LLFloaterItemProperties(const LLSD& key) +: LLFloater(key) +{ +} + +LLFloaterItemProperties::~LLFloaterItemProperties() +{ +} + +BOOL LLFloaterItemProperties::postBuild() +{ + // On the standalone properties floater, we have no need for a back button... + LLSidepanelItemInfo* panel = getChild<LLSidepanelItemInfo>("item_panel"); + LLButton* back_btn = panel->getChild<LLButton>("back_btn"); + back_btn->setVisible(FALSE); + + return LLFloater::postBuild(); +} + +void LLFloaterItemProperties::onOpen(const LLSD& key) +{ + // Tell the panel which item it needs to visualize + LLSidepanelItemInfo* panel = getChild<LLSidepanelItemInfo>("item_panel"); + panel->setItemID(key["id"].asUUID()); +} + diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h new file mode 100755 index 0000000000..594451ede4 --- /dev/null +++ b/indra/newview/llfloatermarketplacelistings.h @@ -0,0 +1,224 @@ +/** + * @file llfloatermarketplacelistings.h + * @brief Implementation of the marketplace listings floater and panels + * @author merov@lindenlab.com + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * ABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERMARKETPLACELISTINGS_H +#define LL_LLFLOATERMARKETPLACELISTINGS_H + +#include "llfloater.h" +#include "llinventoryfilter.h" +#include "llinventorypanel.h" +#include "llnotificationptr.h" +#include "llmodaldialog.h" +#include "lltexteditor.h" + +class LLInventoryCategoriesObserver; +class LLInventoryCategoryAddedObserver; +class LLTextBox; +class LLView; +class LLFilterEditor; + +class LLFloaterMarketplaceListings; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLPanelMarketplaceListings +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLPanelMarketplaceListings : public LLPanel +{ +public: + LLPanelMarketplaceListings(); + BOOL postBuild(); + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg); + void draw(); + LLFolderView* getRootFolder() { return mRootFolder; } + bool allowDropOnRoot(); + + void buildAllPanels(); + +private: + LLInventoryPanel* buildInventoryPanel(const std::string& childname, const std::string& filename); + + // UI callbacks + void onViewSortMenuItemClicked(const LLSD& userdata); + bool onViewSortMenuItemCheck(const LLSD& userdata); + void onAddButtonClicked(); + void onAuditButtonClicked(); + void onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, BOOL user_action); + void onTabChange(); + void onFilterEdit(const std::string& search_string); + + LLFolderView* mRootFolder; + LLButton* mAuditBtn; + LLFilterEditor* mFilterEditor; + std::string mFilterSubString; + bool mFilterListingFoldersOnly; + LLInventoryFilter::ESortOrderType mSortOrder; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLFloaterMarketplaceListings +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLFloaterMarketplaceListings : public LLFloater +{ +public: + LLFloaterMarketplaceListings(const LLSD& key); + ~LLFloaterMarketplaceListings(); + + void initializeMarketPlace(); + + // virtuals + BOOL postBuild(); + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg); + + void showNotification(const LLNotificationPtr& notification); + + BOOL handleHover(S32 x, S32 y, MASK mask); + void onMouseLeave(S32 x, S32 y, MASK mask); + +protected: + void setRootFolder(); + void setPanels(); + void fetchContents(); + + void setStatusString(const std::string& statusString); + + void onClose(bool app_quitting); + void onOpen(const LLSD& key); + void onFocusReceived(); + void onChanged(); + + bool isAccepted(EAcceptance accept); + + void updateView(); + +private: + S32 getFolderCount(); + + LLInventoryCategoriesObserver * mCategoriesObserver; + LLInventoryCategoryAddedObserver * mCategoryAddedObserver; + + LLTextBox * mInventoryStatus; + LLView * mInventoryInitializationInProgress; + LLView * mInventoryPlaceholder; + LLTextBox * mInventoryText; + LLTextBox * mInventoryTitle; + + LLUUID mRootFolderId; + LLPanelMarketplaceListings * mPanelListings; + bool mPanelListingsSet; +}; + +//----------------------------------------------------------------------------- +// LLFloaterAssociateListing +//----------------------------------------------------------------------------- +class LLFloaterAssociateListing : public LLFloater +{ + friend class LLFloaterReg; +public: + virtual BOOL postBuild(); + virtual BOOL handleKeyHere(KEY key, MASK mask); + + static LLFloaterAssociateListing* show(const LLUUID& folder_id); + +private: + LLFloaterAssociateListing(const LLSD& key); + virtual ~LLFloaterAssociateListing(); + + // UI Callbacks + void apply(BOOL user_confirm = TRUE); + void cancel(); + void callback_apply(const LLSD& notification, const LLSD& response); + + LLUUID mUUID; +}; + +//----------------------------------------------------------------------------- +// LLFloaterMarketplaceValidation +//----------------------------------------------------------------------------- +// Note: The key is the UUID of the folder to validate. Validates the whole +// marketplace listings content if UUID is null. +// Note: For the moment, we just display the validation text. Eventually, we should +// get the validation triggered on the server and display the html report. +// *TODO : morph into an html/text window using the pattern in llfloatertos + +class LLFloaterMarketplaceValidation : public LLFloater +{ +public: + LLFloaterMarketplaceValidation(const LLSD& key); + virtual ~LLFloaterMarketplaceValidation(); + + virtual BOOL postBuild(); + virtual void draw(); + virtual void onOpen(const LLSD& key); + + void clearMessages(); + void appendMessage(std::string& message, S32 depth, LLError::ELevel log_level); + static void onOK( void* userdata ); + +private: + struct Message { + LLError::ELevel mErrorLevel; + std::string mMessage; + }; + typedef std::vector<Message> message_list_t; + + void handleCurrentListing(); + + message_list_t mCurrentListingMessages; + LLError::ELevel mCurrentListingErrorLevel; + + message_list_t mMessages; + + LLTextEditor* mEditor; +}; + +//----------------------------------------------------------------------------- +// LLFloaterItemProperties +//----------------------------------------------------------------------------- + +class LLFloaterItemProperties : public LLFloater +{ +public: + LLFloaterItemProperties(const LLSD& key); + virtual ~LLFloaterItemProperties(); + + BOOL postBuild(); + virtual void onOpen(const LLSD& key); + +private: +}; + +#endif // LL_LLFLOATERMARKETPLACELISTINGS_H diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp index 4f2a6ec1b7..4fd5c0587a 100755 --- a/indra/newview/llfloatermediasettings.cpp +++ b/indra/newview/llfloatermediasettings.cpp @@ -47,7 +47,6 @@ LLFloaterMediaSettings::LLFloaterMediaSettings(const LLSD& key) mPanelMediaSettingsGeneral(NULL), mPanelMediaSettingsSecurity(NULL), mPanelMediaSettingsPermissions(NULL), - mWaitingToClose( false ), mIdenticalHasMediaInfo( true ), mMultipleMedia(false), mMultipleValidMedia(false) diff --git a/indra/newview/llfloatermediasettings.h b/indra/newview/llfloatermediasettings.h index 1d25530986..f93512eb3a 100755 --- a/indra/newview/llfloatermediasettings.h +++ b/indra/newview/llfloatermediasettings.h @@ -83,7 +83,6 @@ private: bool haveValuesChanged() const; LLSD mInitialValues; - bool mWaitingToClose; }; #endif // LL_LLFLOATERMEDIASETTINGS_H diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 0c81ab7e79..ec905558aa 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -121,12 +121,6 @@ S32 LLFloaterModelPreview::sUploadAmount = 10; LLFloaterModelPreview* LLFloaterModelPreview::sInstance = NULL; std::list<LLModelLoader*> LLModelLoader::sActiveLoaderList; -const S32 PREVIEW_BORDER_WIDTH = 2; -const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH; -const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; -const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16; -const S32 PREVIEW_TEXTURE_HEIGHT = 300; - // "Retain%" decomp parameter has values from 0.0 to 1.0 by 0.01 // But according to the UI spec for upload model floater, this parameter // should be represented by Retain spinner with values from 1 to 100 by 1. diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index ee7f413a59..0cca715fe2 100755 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -52,14 +52,9 @@ #include "llinventorytype.h" 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 = 3 * PREVIEW_LINE_HEIGHT + PREVIEW_VPAD; -const S32 PREF_BUTTON_WIDTH = 64; -const S32 PREF_BUTTON_HEIGHT = 16; //----------------------------------------------------------------------------- // LLFloaterNameDesc() diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index e5efca1102..b7b1634a5f 100755 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -160,6 +160,12 @@ BOOL LLFloaterOutbox::postBuild() mCategoryAddedObserver = new LLOutboxAddedObserver(this); gInventory.addObserver(mCategoryAddedObserver); + // Setup callbacks for importer + LLMarketplaceInventoryImporter& importer = LLMarketplaceInventoryImporter::instance(); + importer.setInitializationErrorCallback(boost::bind(&LLFloaterOutbox::initializationReportError, this, _1, _2)); + importer.setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1)); + importer.setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2)); + return TRUE; } @@ -298,12 +304,8 @@ void LLFloaterOutbox::initializeMarketPlace() // Initialize the marketplace import API // LLMarketplaceInventoryImporter& importer = LLMarketplaceInventoryImporter::instance(); - if (!importer.isInitialized()) { - importer.setInitializationErrorCallback(boost::bind(&LLFloaterOutbox::initializationReportError, this, _1, _2)); - importer.setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1)); - importer.setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2)); importer.initialize(); } } @@ -516,7 +518,7 @@ void LLFloaterOutbox::onImportButtonClicked() { mOutboxInventoryPanel.get()->clearSelection(); } - + mImportBusy = LLMarketplaceInventoryImporter::instance().triggerImport(); } @@ -617,3 +619,5 @@ void LLFloaterOutbox::showNotification(const LLNotificationPtr& notification) notification_handler->processNotification(notification); } + + diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h index 40519c8fd2..2cf69fc3cc 100755 --- a/indra/newview/llfloateroutbox.h +++ b/indra/newview/llfloateroutbox.h @@ -1,7 +1,6 @@ /** * @file llfloateroutbox.h - * @brief LLFloaterOutbox - * class definition + * @brief Implementation of the merchant outbox window * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code @@ -30,6 +29,7 @@ #include "llfloater.h" #include "llfoldertype.h" +#include "llinventoryfilter.h" #include "llnotificationptr.h" diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index 69c9d94dfa..87f927ff65 100755 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -224,7 +224,7 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListItemData(const LLPa columns[2]["column"] = "owner"; columns[2]["value"] = getOwnerName(pCharacterPtr); - S32 cpuTime = llround(pCharacterPtr->getCPUTime()); + S32 cpuTime = ll_round(pCharacterPtr->getCPUTime()); std::string cpuTimeString = llformat("%d", cpuTime); LLStringUtil::format_map_t string_args; string_args["[CPU_TIME]"] = cpuTimeString; diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index d72ee073e1..f6ff83eaf4 100755 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -406,7 +406,7 @@ void LLFloaterPathfindingObjects::addObjectToScrollList(const LLPathfindingObjec if (pObjectPtr->hasOwner() && !pObjectPtr->hasOwnerName()) { - mMissingNameObjectsScrollListItems.insert(std::make_pair<std::string, LLScrollListItem *>(pObjectPtr->getUUID().asString(), scrollListItem)); + mMissingNameObjectsScrollListItems.insert(scroll_list_item_map::value_type(pObjectPtr->getUUID().asString(), scrollListItem)); pObjectPtr->registerOwnerNameListener(boost::bind(&LLFloaterPathfindingObjects::handleObjectNameResponse, this, _1)); } } diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index a4d13ce1d5..172f81d078 100755 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -119,7 +119,6 @@ protected: }; -const S32 MAX_AMOUNT_LENGTH = 10; const S32 FASTPAY_BUTTON_WIDTH = 80; const S32 PAY_AMOUNT_NOTIFICATION = 200; diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 598c7f9feb..4ccb8f23cd 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -109,13 +109,9 @@ #include "lllogininstance.h" // to check if logged in yet #include "llsdserialize.h" -const F32 MAX_USER_FAR_CLIP = 512.f; -const F32 MIN_USER_FAR_CLIP = 64.f; const F32 BANDWIDTH_UPDATER_TIMEOUT = 0.5f; char const* const VISIBILITY_DEFAULT = "default"; char const* const VISIBILITY_HIDDEN = "hidden"; -char const* const VISIBILITY_VISIBLE = "visible"; -char const* const VISIBILITY_INVISIBLE = "invisible"; //control value for middle mouse as talk2push button const static std::string MIDDLE_MOUSE_CV = "MiddleMouse"; @@ -291,8 +287,8 @@ void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator) { if (fmodf((decimal_val * test_denominator) + 0.01f, 1.f) < 0.02f) { - numerator = llround(decimal_val * test_denominator); - denominator = llround(test_denominator); + numerator = ll_round(decimal_val * test_denominator); + denominator = ll_round(test_denominator); break; } } diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index a3b9713e3e..ae330211db 100755 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -82,8 +82,6 @@ #include "lltrans.h" -const U32 INCLUDE_SCREENSHOT = 0x01 << 0; - //----------------------------------------------------------------------------- // Globals //----------------------------------------------------------------------------- diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h index a5cb1b6184..5ba0185d32 100755 --- a/indra/newview/llfloaterscriptlimits.h +++ b/indra/newview/llfloaterscriptlimits.h @@ -170,21 +170,17 @@ private: LLSD mContent; LLUUID mParcelId; bool mGotParcelMemoryUsed; - bool mGotParcelMemoryUsedDetails; bool mGotParcelMemoryMax; S32 mParcelMemoryMax; S32 mParcelMemoryUsed; - S32 mParcelMemoryUsedDetails; - + bool mGotParcelURLsUsed; - bool mGotParcelURLsUsedDetails; bool mGotParcelURLsMax; S32 mParcelURLsMax; S32 mParcelURLsUsed; - S32 mParcelURLsUsedDetails; - + std::vector<LLSD> mObjectListItems; - + protected: // LLRemoteParcelInfoObserver interface: @@ -208,17 +204,11 @@ public: LLPanelScriptLimitsAttachment() : LLPanelScriptLimitsInfo(), mGotAttachmentMemoryUsed(false), - mGotAttachmentMemoryUsedDetails(false), - mGotAttachmentMemoryMax(false), mAttachmentMemoryMax(0), mAttachmentMemoryUsed(0), - mAttachmentMemoryUsedDetails(0), mGotAttachmentURLsUsed(false), - mGotAttachmentURLsUsedDetails(false), - mGotAttachmentURLsMax(false), mAttachmentURLsMax(0), - mAttachmentURLsUsed(0), - mAttachmentURLsUsedDetails(0) + mAttachmentURLsUsed(0) {}; ~LLPanelScriptLimitsAttachment() @@ -237,18 +227,12 @@ public: private: bool mGotAttachmentMemoryUsed; - bool mGotAttachmentMemoryUsedDetails; - bool mGotAttachmentMemoryMax; S32 mAttachmentMemoryMax; S32 mAttachmentMemoryUsed; - S32 mAttachmentMemoryUsedDetails; - + bool mGotAttachmentURLsUsed; - bool mGotAttachmentURLsUsedDetails; - bool mGotAttachmentURLsMax; S32 mAttachmentURLsMax; S32 mAttachmentURLsUsed; - S32 mAttachmentURLsUsedDetails; protected: diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 04329ff66e..dbc643881e 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -924,11 +924,11 @@ BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S3 //change another value proportionally if(isWidthChanged) { - height = llround(width / aspect_ratio) ; + height = ll_round(width / aspect_ratio) ; } else { - width = llround(height * aspect_ratio) ; + width = ll_round(height * aspect_ratio) ; } //bound w/h by the max_value diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 0613ffc94d..c1c21c593e 100755 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -50,7 +50,6 @@ LLFloaterTOS::LLFloaterTOS(const LLSD& data) : LLModalDialog( data["message"].asString() ), mMessage(data["message"].asString()), - mWebBrowserWindowId( 0 ), mLoadingScreenLoaded(false), mSiteAlive(false), mRealNavigateBegun(false), diff --git a/indra/newview/llfloatertos.h b/indra/newview/llfloatertos.h index 8921d11489..47126d06a6 100755 --- a/indra/newview/llfloatertos.h +++ b/indra/newview/llfloatertos.h @@ -62,7 +62,6 @@ public: private: std::string mMessage; - int mWebBrowserWindowId; bool mLoadingScreenLoaded; bool mSiteAlive; bool mRealNavigateBegun; diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp index 868d623d57..c48b1a3325 100644 --- a/indra/newview/llfloatertwitter.cpp +++ b/indra/newview/llfloatertwitter.cpp @@ -54,7 +54,6 @@ static LLPanelInjector<LLTwitterPhotoPanel> t_panel_photo("lltwitterphotopanel"); static LLPanelInjector<LLTwitterAccountPanel> t_panel_account("lltwitteraccountpanel"); -const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_PHOTO_LOCATION_URL = "http://maps.secondlife.com/"; const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=twitter&utm_medium=photo&utm_campaign=slshare"; const std::string DEFAULT_STATUS_TEXT = " #SecondLife"; diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index bfc36a6bfb..76ad2146f1 100755 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -180,7 +180,6 @@ private: 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?) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index ff66bdedb0..cc4753577d 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -659,9 +659,9 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); std::string full_name = llformat("%s (%d, %d, %d)", sim_name.c_str(), - llround(region_x), - llround(region_y), - llround((F32)pos_global.mdV[VZ])); + ll_round(region_x), + ll_round(region_y), + ll_round((F32)pos_global.mdV[VZ])); std::string tooltip(""); mTrackedStatus = LLTracker::TRACKING_LOCATION; diff --git a/indra/newview/llfolderviewmodelinventory.cpp b/indra/newview/llfolderviewmodelinventory.cpp index 3271a40ea0..8c360befc3 100755 --- a/indra/newview/llfolderviewmodelinventory.cpp +++ b/indra/newview/llfolderviewmodelinventory.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llfolderviewmodelinventory.h" #include "llinventorymodelbackgroundfetch.h" +#include "llinventoryfunctions.h" #include "llinventorypanel.h" #include "lltooldraganddrop.h" #include "llfavoritesbar.h" @@ -277,7 +278,7 @@ bool LLInventorySort::operator()(const LLFolderViewModelItemInventory* const& a, // We sort by name if we aren't sorting by date // OR if these are folders and we are sorting folders by name. - bool by_name = (!mByDate || (mFoldersByName && (a->getSortGroup() != SG_ITEM))); + bool by_name = ((!mByDate || (mFoldersByName && (a->getSortGroup() != SG_ITEM))) && !mFoldersByWeight); if (a->getSortGroup() != b->getSortGroup()) { @@ -309,6 +310,31 @@ bool LLInventorySort::operator()(const LLFolderViewModelItemInventory* const& a, return (compare < 0); } } + else if (mFoldersByWeight) + { + S32 weight_a = compute_stock_count(a->getUUID()); + S32 weight_b = compute_stock_count(b->getUUID()); + if (weight_a == weight_b) + { + // Equal weight -> use alphabetical order + return (LLStringUtil::compareDict(a->getDisplayName(), b->getDisplayName()) < 0); + } + else if (weight_a == -1) + { + // No weight -> move a at the end of the list + return false; + } + else if (weight_b == -1) + { + // No weight -> move b at the end of the list + return true; + } + else + { + // Lighter is first (sorted in increasing order of weight) + return (weight_a < weight_b); + } + } else { time_t first_create = a->getCreationDate(); diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h index 8772185ad0..0516fc3b4b 100755 --- a/indra/newview/llfolderviewmodelinventory.h +++ b/indra/newview/llfolderviewmodelinventory.h @@ -89,6 +89,7 @@ public: mByDate = (mSortOrder & LLInventoryFilter::SO_DATE); mSystemToTop = (mSortOrder & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP); mFoldersByName = (mSortOrder & LLInventoryFilter::SO_FOLDERS_BY_NAME); + mFoldersByWeight = (mSortOrder & LLInventoryFilter::SO_FOLDERS_BY_WEIGHT); } bool operator()(const LLFolderViewModelItemInventory* const& a, const LLFolderViewModelItemInventory* const& b) const; @@ -97,6 +98,7 @@ private: bool mByDate; bool mSystemToTop; bool mFoldersByName; + bool mFoldersByWeight; }; class LLFolderViewModelInventory diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 64f796e1fd..c80dec0e75 100755 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -80,10 +80,10 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) S32 top = llmax(y, mDragStartY); S32 bottom =llmin(y, mDragStartY); - left = llround((F32) left * LLUI::getScaleFactor().mV[VX]); - right = llround((F32) right * LLUI::getScaleFactor().mV[VX]); - top = llround((F32) top * LLUI::getScaleFactor().mV[VY]); - bottom = llround((F32) bottom * LLUI::getScaleFactor().mV[VY]); + left = ll_round((F32) left * LLUI::getScaleFactor().mV[VX]); + right = ll_round((F32) right * LLUI::getScaleFactor().mV[VX]); + top = ll_round((F32) top * LLUI::getScaleFactor().mV[VY]); + bottom = ll_round((F32) bottom * LLUI::getScaleFactor().mV[VY]); F32 old_far_plane = LLViewerCamera::getInstance()->getFar(); F32 old_near_plane = LLViewerCamera::getInstance()->getNear(); diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index b1b7a87ae8..ef238cefe3 100755 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -50,6 +50,8 @@ S32 LLGroupListItem::sIconWidth = 0; class LLGroupComparator : public LLFlatListView::ItemComparator { public: + LLGroupComparator() {}; + /** Returns true if item1 < item2, false otherwise */ /*virtual*/ bool compare(const LLPanel* item1, const LLPanel* item2) const { diff --git a/indra/newview/llhudeffecttrail.cpp b/indra/newview/llhudeffecttrail.cpp index 8771219034..fc6efdb840 100755 --- a/indra/newview/llhudeffecttrail.cpp +++ b/indra/newview/llhudeffecttrail.cpp @@ -42,13 +42,6 @@ #include "llvoavatar.h" #include "llworld.h" - -const F32 PARTICLE_SPACING = 0.01f; -const F32 MAX_SIZE = 0.025f; -const F32 START_POS_MAG = 1.f; -const F32 END_POS_MAG = 1.2f; - - LLHUDEffectSpiral::LLHUDEffectSpiral(const U8 type) : LLHUDEffect(type), mbInit(FALSE) { mKillTime = 10.f; diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index 31d832e524..c7d108b6de 100755 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -52,17 +52,12 @@ const F32 SPRING_STRENGTH = 0.7f; -const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f; const F32 HORIZONTAL_PADDING = 16.f; const F32 VERTICAL_PADDING = 12.f; const F32 LINE_PADDING = 3.f; // aka "leading" const F32 BUFFER_SIZE = 2.f; -const F32 MIN_EDGE_OVERLAP = 3.f; const F32 HUD_TEXT_MAX_WIDTH = 190.f; -const F32 HUD_TEXT_MAX_WIDTH_NO_BUBBLE = 1000.f; -const F32 RESIZE_TIME = 0.f; const S32 NUM_OVERLAP_ITERATIONS = 10; -const F32 NEIGHBOR_FORCE_FRACTION = 1.f; const F32 POSITION_DAMPING_TC = 0.2f; const F32 MAX_STABLE_CAMERA_VELOCITY = 0.1f; const F32 LOD_0_SCREEN_COVERAGE = 0.15f; @@ -315,7 +310,7 @@ void LLHUDNameTag::renderText(BOOL for_select) { LLUIImagePtr rect_top_image = LLUI::getUIImage("Rounded_Rect_Top"); LLRect label_top_rect = screen_rect; - const S32 label_height = llround((mFontp->getLineHeight() * (F32)mLabelSegments.size() + (VERTICAL_PADDING / 3.f))); + const S32 label_height = ll_round((mFontp->getLineHeight() * (F32)mLabelSegments.size() + (VERTICAL_PADDING / 3.f))); label_top_rect.mBottom = label_top_rect.mTop - label_height; LLColor4 label_top_color = text_color; label_top_color.mV[VALPHA] = gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor; diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index f648d7baae..2c204170f2 100755 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -48,23 +48,11 @@ #include "pipeline.h" #include <boost/tokenizer.hpp> - -const F32 SPRING_STRENGTH = 0.7f; -const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f; const F32 HORIZONTAL_PADDING = 15.f; const F32 VERTICAL_PADDING = 12.f; const F32 BUFFER_SIZE = 2.f; -const F32 MIN_EDGE_OVERLAP = 3.f; const F32 HUD_TEXT_MAX_WIDTH = 190.f; const F32 HUD_TEXT_MAX_WIDTH_NO_BUBBLE = 1000.f; -const F32 RESIZE_TIME = 0.f; -const S32 NUM_OVERLAP_ITERATIONS = 10; -const F32 NEIGHBOR_FORCE_FRACTION = 1.f; -const F32 POSITION_DAMPING_TC = 0.2f; -const F32 MAX_STABLE_CAMERA_VELOCITY = 0.1f; -//const F32 LOD_0_SCREEN_COVERAGE = 0.15f; -//const F32 LOD_1_SCREEN_COVERAGE = 0.30f; -//const F32 LOD_2_SCREEN_COVERAGE = 0.40f; std::set<LLPointer<LLHUDText> > LLHUDText::sTextObjects; std::vector<LLPointer<LLHUDText> > LLHUDText::sVisibleTextObjects; diff --git a/indra/newview/llhudview.cpp b/indra/newview/llhudview.cpp index 9a63e99357..cead4dbce6 100755 --- a/indra/newview/llhudview.cpp +++ b/indra/newview/llhudview.cpp @@ -44,10 +44,6 @@ LLHUDView *gHUDView = NULL; -const S32 HUD_ARROW_SIZE = 32; - - - LLHUDView::LLHUDView(const LLRect& r) { buildFromFile( "panel_hud.xml"); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1910656066..b7b2d1b285 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -40,6 +40,7 @@ #include "llfavoritesbar.h" // management of favorites folder #include "llfloateropenobject.h" #include "llfloaterreg.h" +#include "llfloatermarketplacelistings.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterworldmap.h" #include "llfolderview.h" @@ -65,6 +66,7 @@ #include "llsidepanelappearance.h" #include "lltooldraganddrop.h" #include "lltrans.h" +#include "llurlaction.h" #include "llviewerassettype.h" #include "llviewerfoldertype.h" #include "llviewermenu.h" @@ -79,11 +81,6 @@ void copy_slurl_to_clipboard_callback_inv(const std::string& slurl); -// Marketplace outbox current disabled -#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1 -#define ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU 0 -#define BLOCK_WORN_ITEMS_IN_OUTBOX 1 - typedef std::pair<LLUUID, LLUUID> two_uuids_t; typedef std::list<two_uuids_t> two_uuids_list_t; @@ -269,13 +266,49 @@ BOOL LLInvFVBridge::isLibraryItem() const /** * @brief Adds this item into clipboard storage */ -BOOL LLInvFVBridge::cutToClipboard() const +BOOL LLInvFVBridge::cutToClipboard() +{ + const LLInventoryObject* obj = gInventory.getObject(mUUID); + if (obj && isItemMovable() && isItemRemovable()) + { + const LLUUID &marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + const BOOL cut_from_marketplacelistings = gInventory.isObjectDescendentOf(mUUID, marketplacelistings_id); + + if (cut_from_marketplacelistings && (LLMarketplaceData::instance().isInActiveFolder(mUUID) || + LLMarketplaceData::instance().isListedAndActive(mUUID))) + { + // Prompt the user if cutting from a marketplace active listing + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLInvFVBridge::callback_cutToClipboard, this, _1, _2)); + } + else + { + // Otherwise just perform the cut + return perform_cutToClipboard(); + } + } + return FALSE; +} + +// Callback for cutToClipboard if DAMA required... +BOOL LLInvFVBridge::callback_cutToClipboard(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES + { + return perform_cutToClipboard(); + } + return FALSE; +} + +BOOL LLInvFVBridge::perform_cutToClipboard() { const LLInventoryObject* obj = gInventory.getObject(mUUID); if (obj && isItemMovable() && isItemRemovable()) { LLClipboard::instance().setCutMode(true); - return LLClipboard::instance().addToClipboard(mUUID); + BOOL added_to_clipboard = LLClipboard::instance().addToClipboard(mUUID); + removeObject(&gInventory, mUUID); // Always perform the remove even if the object couldn't make it to the clipboard + return added_to_clipboard; } return FALSE; } @@ -290,15 +323,22 @@ BOOL LLInvFVBridge::copyToClipboard() const return FALSE; } -// *TODO: make sure this does the right thing void LLInvFVBridge::showProperties() { - show_item_profile(mUUID); - - // Disable old properties floater; this is replaced by the sidepanel. - /* - LLFloaterReg::showInstance("properties", mUUID); - */ + if (isMarketplaceListingsFolder()) + { + LLFloaterReg::showInstance("item_properties", LLSD().with("id",mUUID),TRUE); + // Force it to show on top as this floater has a tendency to hide when confirmation dialog shows up + LLFloater* floater_properties = LLFloaterReg::findInstance("item_properties", LLSD().with("id",mUUID)); + if (floater_properties) + { + floater_properties->setVisibleAndFrontmost(); + } + } + else + { + show_item_profile(mUUID); + } } void LLInvFVBridge::removeBatch(std::vector<LLFolderViewModelItem*>& batch) @@ -655,7 +695,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, if (!isInboxFolder()) { items.push_back(std::string("Rename")); - if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0) + if (!isItemRenameable() || ((flags & FIRST_SELECTED_ITEM) == 0)) { disabled_items.push_back(std::string("Rename")); } @@ -693,15 +733,28 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, disabled_items.push_back(std::string("Cut")); } - if (canListOnMarketplace()) + if (canListOnMarketplace() && !isMarketplaceListingsFolder() && !isInboxFolder()) { items.push_back(std::string("Marketplace Separator")); - items.push_back(std::string("Merchant Copy")); - if (!canListOnMarketplaceNow()) - { - disabled_items.push_back(std::string("Merchant Copy")); - } + if (gMenuHolder->getChild<LLView>("MerchantOutbox")->getVisible()) + { + items.push_back(std::string("Merchant Copy")); + if (!canListOnOutboxNow()) + { + disabled_items.push_back(std::string("Merchant Copy")); + } + } + if (gMenuHolder->getChild<LLView>("MarketplaceListings")->getVisible()) + { + items.push_back(std::string("Marketplace Copy")); + items.push_back(std::string("Marketplace Move")); + if (!canListOnMarketplaceNow()) + { + disabled_items.push_back(std::string("Marketplace Copy")); + disabled_items.push_back(std::string("Marketplace Move")); + } + } } } } @@ -835,21 +888,114 @@ void LLInvFVBridge::addOutboxContextMenuOptions(U32 flags, { disabled_items.push_back(std::string("Rename")); } - -#if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU - if (isOutboxFolderDirectParent()) - { - items.push_back(std::string("Marketplace Separator")); - items.push_back(std::string("Marketplace Send")); - - if ((flags & FIRST_SELECTED_ITEM) == 0) - { - disabled_items.push_back(std::string("Marketplace Send")); - } - } -#endif // ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU } +void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, + menuentry_vec_t &items, + menuentry_vec_t &disabled_items) +{ + S32 depth = depth_nesting_in_marketplace(mUUID); + if (depth == 1) + { + // Options available at the Listing Folder level + items.push_back(std::string("Marketplace Create Listing")); + items.push_back(std::string("Marketplace Associate Listing")); + items.push_back(std::string("Marketplace Check Listing")); + items.push_back(std::string("Marketplace List")); + items.push_back(std::string("Marketplace Unlist")); + if (LLMarketplaceData::instance().isUpdating(mUUID) || ((flags & FIRST_SELECTED_ITEM) == 0)) + { + // During SLM update, disable all marketplace related options + // Also disable all if multiple selected items + disabled_items.push_back(std::string("Marketplace Create Listing")); + disabled_items.push_back(std::string("Marketplace Associate Listing")); + disabled_items.push_back(std::string("Marketplace Check Listing")); + disabled_items.push_back(std::string("Marketplace List")); + disabled_items.push_back(std::string("Marketplace Unlist")); + } + else + { + if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) + { + items.push_back(std::string("Marketplace Get Listing")); + } + if (LLMarketplaceData::instance().isListed(mUUID)) + { + disabled_items.push_back(std::string("Marketplace Create Listing")); + disabled_items.push_back(std::string("Marketplace Associate Listing")); + if (LLMarketplaceData::instance().getVersionFolder(mUUID).isNull()) + { + disabled_items.push_back(std::string("Marketplace List")); + disabled_items.push_back(std::string("Marketplace Unlist")); + } + else + { + if (LLMarketplaceData::instance().getActivationState(mUUID)) + { + disabled_items.push_back(std::string("Marketplace List")); + } + else + { + disabled_items.push_back(std::string("Marketplace Unlist")); + } + } + } + else + { + disabled_items.push_back(std::string("Marketplace List")); + disabled_items.push_back(std::string("Marketplace Unlist")); + if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) + { + disabled_items.push_back(std::string("Marketplace Get Listing")); + } + } + } + } + if (depth == 2) + { + // Options available at the Version Folder levels and only for folders + LLInventoryCategory* cat = gInventory.getCategory(mUUID); + if (cat && LLMarketplaceData::instance().isListed(cat->getParentUUID())) + { + items.push_back(std::string("Marketplace Activate")); + items.push_back(std::string("Marketplace Deactivate")); + if (LLMarketplaceData::instance().isUpdating(mUUID) || ((flags & FIRST_SELECTED_ITEM) == 0)) + { + // During SLM update, disable all marketplace related options + // Also disable all if multiple selected items + disabled_items.push_back(std::string("Marketplace Activate")); + disabled_items.push_back(std::string("Marketplace Deactivate")); + } + else + { + if (LLMarketplaceData::instance().isVersionFolder(mUUID)) + { + disabled_items.push_back(std::string("Marketplace Activate")); + if (LLMarketplaceData::instance().getActivationState(mUUID)) + { + disabled_items.push_back(std::string("Marketplace Deactivate")); + } + } + else + { + disabled_items.push_back(std::string("Marketplace Deactivate")); + } + } + } + } + // Options available at all levels on items and categories + items.push_back(std::string("Marketplace Edit Listing")); + LLUUID listing_folder_id = nested_parent_id(mUUID,depth); + LLUUID version_folder_id = LLMarketplaceData::instance().getVersionFolder(listing_folder_id); + if (!LLMarketplaceData::instance().isListed(listing_folder_id) || version_folder_id.isNull()) + { + disabled_items.push_back(std::string("Marketplace Edit Listing")); + } + // Separator + items.push_back(std::string("Marketplace Listings Separator")); +} + + // *TODO: remove this BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const { @@ -952,6 +1098,7 @@ BOOL LLInvFVBridge::isCOFFolder() const return LLAppearanceMgr::instance().getIsInCOF(mUUID); } +// *TODO : Suppress isInboxFolder() once Merchant Outbox is fully deprecated BOOL LLInvFVBridge::isInboxFolder() const { const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false); @@ -964,6 +1111,18 @@ BOOL LLInvFVBridge::isInboxFolder() const return gInventory.isObjectDescendentOf(mUUID, inbox_id); } +BOOL LLInvFVBridge::isMarketplaceListingsFolder() const +{ + const LLUUID folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + + if (folder_id.isNull()) + { + return FALSE; + } + + return gInventory.isObjectDescendentOf(mUUID, folder_id); +} + BOOL LLInvFVBridge::isOutboxFolder() const { const LLUUID outbox_id = getOutboxFolder(); @@ -1125,11 +1284,18 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, case LLAssetType::AT_CATEGORY: if (actual_asset_type == LLAssetType::AT_LINK_FOLDER) { - // Create a link folder handler instead. + // Create a link folder handler instead new_listener = new LLLinkFolderBridge(inventory, root, uuid); - break; } - new_listener = new LLFolderBridge(inventory, root, uuid); + else if (actual_asset_type == LLAssetType::AT_MARKETPLACE_FOLDER) + { + // Create a marketplace folder handler + new_listener = new LLMarketplaceFolderBridge(inventory, root, uuid); + } + else + { + new_listener = new LLFolderBridge(inventory, root, uuid); + } break; case LLAssetType::AT_LINK: case LLAssetType::AT_LINK_FOLDER: @@ -1172,6 +1338,22 @@ void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid) } } +void LLInvFVBridge::removeObject(LLInventoryModel *model, const LLUUID &uuid) +{ + // Keep track of the parent + LLInventoryItem* itemp = model->getItem(uuid); + LLUUID parent_id = (itemp ? itemp->getParentUUID() : LLUUID::null); + // Remove the object + model->removeObject(uuid); + // Get the parent updated + if (parent_id.notNull()) + { + LLViewerInventoryCategory* parent_cat = model->getCategory(parent_id); + model->updateCategory(parent_cat); + model->notifyObservers(); + } +} + bool LLInvFVBridge::canShare() const { bool can_share = false; @@ -1202,11 +1384,9 @@ bool LLInvFVBridge::canShare() const bool LLInvFVBridge::canListOnMarketplace() const { -#if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU - LLInventoryModel * model = getInventoryModel(); - const LLViewerInventoryCategory * cat = model->getCategory(mUUID); + LLViewerInventoryCategory * cat = model->getCategory(mUUID); if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType())) { return false; @@ -1217,16 +1397,6 @@ bool LLInvFVBridge::canListOnMarketplace() const return false; } - if (getOutboxFolder().isNull()) - { - return false; - } - - if (isInboxFolder() || isOutboxFolder()) - { - return false; - } - LLViewerInventoryItem * item = model->getItem(mUUID); if (item) { @@ -1242,16 +1412,11 @@ bool LLInvFVBridge::canListOnMarketplace() const } return true; - -#else - return false; -#endif } -bool LLInvFVBridge::canListOnMarketplaceNow() const +// *TODO : Suppress canListOnOutboxNow() once we deprecate Merchant Outbox completely +bool LLInvFVBridge::canListOnOutboxNow() const { -#if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU - bool can_list = true; // Do not allow listing while import is in progress @@ -1297,10 +1462,49 @@ bool LLInvFVBridge::canListOnMarketplaceNow() const } return can_list; +} -#else - return false; -#endif +bool LLInvFVBridge::canListOnMarketplaceNow() const +{ + bool can_list = true; + + const LLInventoryObject* obj = getInventoryObject(); + can_list &= (obj != NULL); + + if (can_list) + { + const LLUUID& object_id = obj->getLinkedUUID(); + can_list = object_id.notNull(); + + if (can_list) + { + LLFolderViewFolder * object_folderp = mInventoryPanel.get() ? mInventoryPanel.get()->getFolderByID(object_id) : NULL; + if (object_folderp) + { + can_list = !static_cast<LLFolderBridge*>(object_folderp->getViewModelItem())->isLoading(); + } + } + + if (can_list) + { + std::string error_msg; + LLInventoryModel* model = getInventoryModel(); + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + LLViewerInventoryCategory * master_folder = model->getCategory(marketplacelistings_id); + LLInventoryCategory *cat = model->getCategory(mUUID); + if (cat) + { + can_list = can_move_folder_to_marketplace(master_folder, master_folder, cat, error_msg); + } + else + { + LLInventoryItem *item = model->getItem(mUUID); + can_list = (item ? can_move_item_to_marketplace(master_folder, master_folder, item, error_msg) : false); + } + } + } + + return can_list; } LLToolDragAndDrop::ESource LLInvFVBridge::getDragSource() const @@ -1392,7 +1596,6 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) else if ("cut" == action) { cutToClipboard(); - gInventory.removeObject(mUUID); return; } else if ("copy" == action) @@ -1433,6 +1636,14 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); copy_item_to_outbox(itemp, outbox_id, LLUUID::null, LLToolDragAndDrop::getOperationId()); } + else if (("move_to_marketplace_listings" == action) || ("copy_to_marketplace_listings" == action) || ("copy_or_move_to_marketplace_listings" == action)) + { + LLInventoryItem* itemp = model->getItem(mUUID); + if (!itemp) return; + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + // Note: For a single item, if it's not a copy, then it's a move + move_item_to_marketplacelistings(itemp, marketplacelistings_id, ("copy_to_marketplace_listings" == action)); + } else if ("copy_slurl" == action) { LLViewerInventoryItem* item = static_cast<LLViewerInventoryItem*>(getItem()); @@ -1452,6 +1663,11 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) { doActionOnCurSelectedLandmark(boost::bind(&LLItemBridge::doShowOnMap, this, _1)); } + else if ("marketplace_edit_listing" == action) + { + std::string url = LLMarketplaceData::instance().getListingURL(mUUID); + LLUrlAction::openURL(url); + } } void LLItemBridge::doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb) @@ -1917,6 +2133,22 @@ void LLFolderBridge::buildDisplayName() const } } +std::string LLFolderBridge::getLabelSuffix() const +{ + static LLCachedControl<F32> folder_loading_message_delay(gSavedSettings, "FolderLoadingMessageWaitTime", 0.5f); + + if (mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= folder_loading_message_delay()) + { + return llformat(" ( %s ) ", LLTrans::getString("LoadingData").c_str()); + } + + return LLInvFVBridge::getLabelSuffix(); +} + +LLFontGL::StyleFlags LLFolderBridge::getLabelStyle() const +{ + return LLFontGL::NORMAL; +} void LLFolderBridge::update() { @@ -1973,6 +2205,11 @@ BOOL LLFolderBridge::isItemRemovable() const return FALSE; } } + + if (isMarketplaceListingsFolder() && LLMarketplaceData::instance().getActivationState(mUUID)) + { + return FALSE; + } return TRUE; } @@ -2108,88 +2345,11 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const } -static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_msg) -{ - // Collapse links directly to items/folders - LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; - LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem(); - if (linked_item != NULL) - { - inv_item = linked_item; - } - - bool allow_transfer = inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); - if (!allow_transfer) - { - tooltip_msg = LLTrans::getString("TooltipOutboxNoTransfer"); - return false; - } - -#if BLOCK_WORN_ITEMS_IN_OUTBOX - bool worn = get_is_item_worn(inv_item->getUUID()); - if (worn) - { - tooltip_msg = LLTrans::getString("TooltipOutboxWorn"); - return false; - } -#endif - - bool calling_card = (LLAssetType::AT_CALLINGCARD == inv_item->getType()); - if (calling_card) - { - tooltip_msg = LLTrans::getString("TooltipOutboxCallingCard"); - return false; - } - - return true; -} - - -int get_folder_levels(LLInventoryCategory* inv_cat) -{ - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - gInventory.getDirectDescendentsOf(inv_cat->getUUID(), cats, items); - - int max_child_levels = 0; - - for (S32 i=0; i < cats->size(); ++i) - { - LLInventoryCategory* category = cats->at(i); - max_child_levels = llmax(max_child_levels, get_folder_levels(category)); - } - - return 1 + max_child_levels; -} - -int get_folder_path_length(const LLUUID& ancestor_id, const LLUUID& descendant_id) -{ - int depth = 0; - - if (ancestor_id == descendant_id) return depth; - - const LLInventoryCategory* category = gInventory.getCategory(descendant_id); - - while(category) - { - LLUUID parent_id = category->getParentUUID(); - - if (parent_id.isNull()) break; - - depth++; - - if (parent_id == ancestor_id) return depth; - - category = gInventory.getCategory(parent_id); - } - - LL_WARNS() << "get_folder_path_length() couldn't trace a path from the descendant to the ancestor" << LL_ENDL; - return -1; -} BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, BOOL drop, - std::string& tooltip_msg) + std::string& tooltip_msg, + BOOL user_confirm) { LLInventoryModel* model = getInventoryModel(); @@ -2208,10 +2368,14 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, const LLUUID &cat_id = inv_cat->getUUID(); const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + const LLUUID from_folder_uuid = inv_cat->getParentUUID(); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); const BOOL move_is_from_outbox = model->isObjectDescendentOf(cat_id, outbox_id); + const BOOL move_is_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); + const BOOL move_is_from_marketplacelistings = model->isObjectDescendentOf(cat_id, marketplacelistings_id); // check to make sure source is agent inventory, and is represented there. LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); @@ -2239,6 +2403,18 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, BOOL is_movable = TRUE; + if (is_movable && (marketplacelistings_id == cat_id)) + { + is_movable = FALSE; + tooltip_msg = LLTrans::getString("TooltipOutboxCannotMoveRoot"); + } + if (is_movable && move_is_from_marketplacelistings && LLMarketplaceData::instance().getActivationState(cat_id)) + { + // If the incoming folder is listed and active (and is therefore either the listing or the version folder), + // then moving is *not* allowed + is_movable = FALSE; + tooltip_msg = LLTrans::getString("TooltipOutboxDragActive"); + } if (is_movable && (mUUID == cat_id)) { is_movable = FALSE; @@ -2264,6 +2440,12 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, is_movable = FALSE; // tooltip? } + if (is_movable && (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK)) + { + // One cannot move a folder into a stock folder + is_movable = FALSE; + // tooltip? + } LLInventoryModel::cat_array_t descendent_categories; LLInventoryModel::item_array_t descendent_items; @@ -2331,93 +2513,13 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } - if (is_movable && move_is_into_outbox) + + if (is_movable && (move_is_into_outbox || move_is_into_marketplacelistings)) { - const int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat); - - if (nested_folder_levels > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) - { - tooltip_msg = LLTrans::getString("TooltipOutboxFolderLevels"); - is_movable = FALSE; - } - else - { - int dragged_folder_count = descendent_categories.size(); - int existing_item_count = 0; - int existing_folder_count = 0; - - const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); - - if (master_folder != NULL) - { - if (model->isObjectDescendentOf(cat_id, master_folder->getUUID())) - { - // Don't use count because we're already inside the same category anyway - dragged_folder_count = 0; - } - else - { - existing_folder_count = 1; // Include the master folder in the count! - - // If we're in the drop operation as opposed to the drag without drop, we are doing a - // single category at a time so don't block based on the total amount of cargo data items - if (drop) - { - dragged_folder_count += 1; - } - else - { - // NOTE: The cargo id's count is a total of categories AND items but we err on the side of - // prevention rather than letting too many folders into the hierarchy of the outbox, - // when we're dragging the item to a new parent - dragged_folder_count += LLToolDragAndDrop::instance().getCargoCount(); - } - } - - // Tally the total number of categories and items inside the master folder - - LLInventoryModel::cat_array_t existing_categories; - LLInventoryModel::item_array_t existing_items; - - model->collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE); - - existing_folder_count += existing_categories.size(); - existing_item_count += existing_items.size(); - } - else - { - // Assume a single category is being dragged to the outbox since we evaluate one at a time - // when not putting them under a parent item. - dragged_folder_count += 1; - } - - const int nested_folder_count = existing_folder_count + dragged_folder_count; - const int nested_item_count = existing_item_count + descendent_items.size(); - - if (nested_folder_count > gSavedSettings.getU32("InventoryOutboxMaxFolderCount")) - { - tooltip_msg = LLTrans::getString("TooltipOutboxTooManyFolders"); - is_movable = FALSE; - } - else if (nested_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount")) - { - tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects"); - is_movable = FALSE; - } - - if (is_movable == TRUE) - { - for (S32 i=0; i < descendent_items.size(); ++i) - { - LLInventoryItem* item = descendent_items[i]; - if (!can_move_to_outbox(item, tooltip_msg)) - { - is_movable = FALSE; - break; - } - } - } - } + const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); + LLViewerInventoryCategory * dest_folder = getCategory(); + S32 bundle_size = (drop ? 1 : LLToolDragAndDrop::instance().getCargoCount()); + is_movable = can_move_folder_to_marketplace(master_folder, dest_folder, inv_cat, tooltip_msg, bundle_size); } if (is_movable) @@ -2460,6 +2562,48 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, if (accept && drop) { + // Dropping in or out of marketplace needs (sometimes) confirmation + if (user_confirm && (move_is_from_marketplacelistings || move_is_into_marketplacelistings)) + { + if (move_is_from_marketplacelistings && (LLMarketplaceData::instance().isInActiveFolder(cat_id) || + LLMarketplaceData::instance().isListedAndActive(cat_id))) + { + if (LLMarketplaceData::instance().isListed(cat_id) || LLMarketplaceData::instance().isVersionFolder(cat_id)) + { + // Move the active version folder or listing folder itself outside marketplace listings will unlist the listing so ask that question specifically + LLNotificationsUtil::add("ConfirmMerchantUnlist", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + } + else + { + // Any other case will simply modify but not unlist an active listed listing + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + } + return true; + } + if (move_is_from_marketplacelistings && LLMarketplaceData::instance().isVersionFolder(cat_id)) + { + // Moving the version folder from its location will deactivate it. Ask confirmation. + LLNotificationsUtil::add("ConfirmMerchantClearVersion", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + return true; + } + if (move_is_into_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID)) + { + // Moving something in an active listed listing will modify it. Ask confirmation. + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + return true; + } + if (move_is_from_marketplacelistings && LLMarketplaceData::instance().isListed(cat_id)) + { + // Moving a whole listing folder will result in archival of SLM data. Ask confirmation. + LLNotificationsUtil::add("ConfirmListingCutOrDelete", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + return true; + } + if (move_is_into_marketplacelistings && !move_is_from_marketplacelistings) + { + LLNotificationsUtil::add("ConfirmMerchantMoveInventory", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropCategoryIntoFolder, this, _1, _2, inv_cat)); + return true; + } + } // Look for any gestures and deactivate them if (move_is_into_trash) { @@ -2485,6 +2629,10 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, { copy_folder_to_outbox(inv_cat, mUUID, cat_id, LLToolDragAndDrop::getOperationId()); } + else if (move_is_into_marketplacelistings) + { + move_folder_to_marketplacelistings(inv_cat, mUUID); + } else { if (model->isObjectDescendentOf(cat_id, model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false))) @@ -2500,11 +2648,38 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, mUUID, move_is_into_trash); } + if (move_is_from_marketplacelistings) + { + // If we are moving a folder at the listing folder level (i.e. its parent is the marketplace listings folder) + if (from_folder_uuid == marketplacelistings_id) + { + // Clear the folder from the marketplace in case it is a listing folder + if (LLMarketplaceData::instance().isListed(cat_id)) + { + LLMarketplaceData::instance().clearListing(cat_id); + } + } + else + { + // If we move from within an active (listed) listing, checks that it's still valid, if not, unlist + LLUUID version_folder_id = LLMarketplaceData::instance().getActiveFolder(from_folder_uuid); + if (version_folder_id.notNull()) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(version_folder_id); + if (!validate_marketplacelistings(cat,NULL)) + { + LLMarketplaceData::instance().activateListing(version_folder_id,false); + } + } + // In all cases, update the listing we moved from so suffix are updated + update_marketplace_category(from_folder_uuid); + } + } } } else if (LLToolDragAndDrop::SOURCE_WORLD == source) { - if (move_is_into_outbox) + if (move_is_into_outbox || move_is_into_marketplacelistings) { tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; @@ -2516,7 +2691,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else if (LLToolDragAndDrop::SOURCE_LIBRARY == source) { - if (move_is_into_outbox) + if (move_is_into_outbox || move_is_into_marketplacelistings) { tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; @@ -2886,7 +3061,6 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) else if ("cut" == action) { cutToClipboard(); - gInventory.removeObject(mUUID); return; } else if ("copy" == action) @@ -2914,6 +3088,98 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) restoreItem(); return; } + else if ("marketplace_list" == action) + { + if (depth_nesting_in_marketplace(mUUID) == 1) + { + LLUUID version_folder_id = LLMarketplaceData::instance().getVersionFolder(mUUID); + LLViewerInventoryCategory* cat = gInventory.getCategory(version_folder_id); + mMessage = ""; + if (!validate_marketplacelistings(cat,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2, _3))) + { + LLSD subs; + subs["[ERROR_CODE]"] = mMessage; + LLNotificationsUtil::add("MerchantListingFailed", subs); + } + else + { + LLMarketplaceData::instance().activateListing(mUUID,true); + } + } + return; + } + else if ("marketplace_activate" == action) + { + if (depth_nesting_in_marketplace(mUUID) == 2) + { + LLInventoryCategory* category = gInventory.getCategory(mUUID); + mMessage = ""; + if (!validate_marketplacelistings(category,boost::bind(&LLFolderBridge::gatherMessage, this, _1, _2, _3),false,2)) + { + LLSD subs; + subs["[ERROR_CODE]"] = mMessage; + LLNotificationsUtil::add("MerchantFolderActivationFailed", subs); + } + else + { + LLMarketplaceData::instance().setVersionFolder(category->getParentUUID(), mUUID); + } + } + return; + } + else if ("marketplace_unlist" == action) + { + if (depth_nesting_in_marketplace(mUUID) == 1) + { + LLMarketplaceData::instance().activateListing(mUUID,false); + } + return; + } + else if ("marketplace_deactivate" == action) + { + if (depth_nesting_in_marketplace(mUUID) == 2) + { + LLInventoryCategory* category = gInventory.getCategory(mUUID); + LLMarketplaceData::instance().setVersionFolder(category->getParentUUID(), LLUUID::null); + } + return; + } + else if ("marketplace_create_listing" == action) + { + LLMarketplaceData::instance().createListing(mUUID); + return; + } + else if ("marketplace_disassociate_listing" == action) + { + LLMarketplaceData::instance().clearListing(mUUID); + return; + } + else if ("marketplace_get_listing" == action) + { + // This is used only to exercise the SLM API but won't be shown to end users + LLMarketplaceData::instance().getListing(mUUID); + return; + } + else if ("marketplace_associate_listing" == action) + { + LLFloaterAssociateListing::show(mUUID); + return; + } + else if ("marketplace_check_listing" == action) + { + LLSD data(mUUID); + LLFloaterReg::showInstance("marketplace_validation", data); + return; + } + else if ("marketplace_edit_listing" == action) + { + std::string url = LLMarketplaceData::instance().getListingURL(mUUID); + if (!url.empty()) + { + LLUrlAction::openURL(url); + } + return; + } #ifndef LL_RELEASE_FOR_DOWNLOAD else if ("delete_system_folder" == action) { @@ -2930,17 +3196,31 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); copy_folder_to_outbox(cat, outbox_id, cat->getUUID(), LLToolDragAndDrop::getOperationId()); } -#if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU - else if (isMarketplaceSendAction(action)) + else if (("move_to_marketplace_listings" == action) || ("copy_to_marketplace_listings" == action) || ("copy_or_move_to_marketplace_listings" == action)) { - LL_INFOS() << "Send to marketplace action!" << LL_ENDL; - LLInventoryCategory * cat = gInventory.getCategory(mUUID); if (!cat) return; - - send_to_marketplace(cat); - } -#endif // ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + move_folder_to_marketplacelistings(cat, marketplacelistings_id, ("move_to_marketplace_listings" != action), (("copy_or_move_to_marketplace_listings" == action))); + } +} + +void LLFolderBridge::gatherMessage(std::string& message, S32 depth, LLError::ELevel log_level) +{ + if (log_level >= LLError::LEVEL_ERROR) + { + if (!mMessage.empty()) + { + // Currently, we do not gather all messages as it creates very long alerts + // Users can get to the whole list of errors on a listing using the "Check for Errors" audit button or "Check listing" right click menu + //mMessage += "\n"; + return; + } + // Take the leading spaces out... + std::string::size_type start = message.find_first_not_of(" "); + // Append the message + mMessage += message.substr(start, message.length() - start); + } } void LLFolderBridge::openItem() @@ -3010,25 +3290,24 @@ LLFolderType::EType LLFolderBridge::getPreferredType() const // Icons for folders are based on the preferred type LLUIImagePtr LLFolderBridge::getIcon() const { - LLFolderType::EType preferred_type = LLFolderType::FT_NONE; - LLViewerInventoryCategory* cat = getCategory(); - if(cat) - { - preferred_type = cat->getPreferredType(); - } - return getIcon(preferred_type); + return getFolderIcon(FALSE); } -// static -LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type) +LLUIImagePtr LLFolderBridge::getIconOpen() const { - return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, FALSE)); + return getFolderIcon(TRUE); } -LLUIImagePtr LLFolderBridge::getIconOpen() const +LLUIImagePtr LLFolderBridge::getFolderIcon(BOOL is_open) const { - return LLUI::getUIImage(LLViewerFolderType::lookupIconName(getPreferredType(), TRUE)); + LLFolderType::EType preferred_type = getPreferredType(); + return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, is_open)); +} +// static : use by LLLinkFolderBridge to get the closed type icons +LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type) +{ + return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, FALSE)); } LLUIImagePtr LLFolderBridge::getIconOverlay() const @@ -3040,14 +3319,6 @@ LLUIImagePtr LLFolderBridge::getIconOverlay() const return NULL; } -std::string LLFolderBridge::getLabelSuffix() const -{ - static LLCachedControl<F32> folder_loading_message_delay(gSavedSettings, "FolderLoadingMessageWaitTime", 0.5f); - return mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= folder_loading_message_delay() - ? llformat(" ( %s ) ", LLTrans::getString("LoadingData").c_str()) - : LLStringUtil::null; -} - BOOL LLFolderBridge::renameItem(const std::string& new_name) { @@ -3131,10 +3402,42 @@ void LLFolderBridge::updateHierarchyCreationDate(time_t date) void LLFolderBridge::pasteFromClipboard() { LLInventoryModel* model = getInventoryModel(); - if(model && isClipboardPasteable()) + if (model && isClipboardPasteable()) { - const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + const BOOL paste_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); + + if (paste_into_marketplacelistings && !LLMarketplaceData::instance().isListed(mUUID) && LLMarketplaceData::instance().isInActiveFolder(mUUID)) + { + // Prompt the user if pasting in a marketplace active version listing (note that pasting right under the listing folder root doesn't need a prompt) + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_pasteFromClipboard, this, _1, _2)); + } + else + { + // Otherwise just do the paste + perform_pasteFromClipboard(); + } + } +} + +// Callback for pasteFromClipboard if DAMA required... +void LLFolderBridge::callback_pasteFromClipboard(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES + { + perform_pasteFromClipboard(); + } +} + +void LLFolderBridge::perform_pasteFromClipboard() +{ + LLInventoryModel* model = getInventoryModel(); + if (model && isClipboardPasteable()) + { + const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); const LLUUID &favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE, false); const LLUUID &my_outifts_id = model->findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS, false); @@ -3142,58 +3445,70 @@ void LLFolderBridge::pasteFromClipboard() const BOOL move_is_into_my_outfits = (mUUID == my_outifts_id) || model->isObjectDescendentOf(mUUID, my_outifts_id); const BOOL move_is_into_outfit = move_is_into_my_outfits || (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); + const BOOL move_is_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); const BOOL move_is_into_favorites = (mUUID == favorites_id); std::vector<LLUUID> objects; LLClipboard::instance().pasteFromClipboard(objects); - - if (move_is_into_outbox) - { - LLFolderViewItem * outbox_itemp = mInventoryPanel.get()->getItemByID(mUUID); - - if (outbox_itemp) - { - LLToolDragAndDrop::instance().setCargoCount(objects.size()); - - BOOL can_list = TRUE; - - for (std::vector<LLUUID>::const_iterator iter = objects.begin(); - (iter != objects.end()) && (can_list == TRUE); - ++iter) - { - const LLUUID& item_id = (*iter); - LLInventoryItem *item = model->getItem(item_id); - - if (item) - { - MASK mask = 0x0; - BOOL drop = FALSE; - EDragAndDropType cargo_type = LLViewerAssetType::lookupDragAndDropType(item->getActualType()); - void * cargo_data = (void *) item; - std::string tooltip_msg; - - can_list = outbox_itemp->getViewModelItem()->dragOrDrop(mask, drop, cargo_type, cargo_data, tooltip_msg); - } - } - - LLToolDragAndDrop::instance().resetCargoCount(); - - if (can_list == FALSE) - { - // Notify user of failure somehow -- play error sound? modal dialog? - return; - } + + LLViewerInventoryCategory * dest_folder = getCategory(); + if (move_is_into_outbox || move_is_into_marketplacelistings) + { + std::string error_msg; + const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); + int index = 0; + for (std::vector<LLUUID>::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) + { + const LLUUID& item_id = (*iter); + LLInventoryItem *item = model->getItem(item_id); + LLInventoryCategory *cat = model->getCategory(item_id); + + if (item && !can_move_item_to_marketplace(master_folder, dest_folder, item, error_msg, objects.size() - index, true)) + { + break; + } + if (cat && !can_move_folder_to_marketplace(master_folder, dest_folder, cat, error_msg, objects.size() - index, true, true)) + { + break; + } + ++index; } - } - + if (!error_msg.empty()) + { + LLSD subs; + subs["[ERROR_CODE]"] = error_msg; + LLNotificationsUtil::add("MerchantPasteFailed", subs); + return; + } + } + else + { + // Check that all items can be moved into that folder : for the moment, only stock folder mismatch is checked + for (std::vector<LLUUID>::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) + { + const LLUUID& item_id = (*iter); + LLInventoryItem *item = model->getItem(item_id); + LLInventoryCategory *cat = model->getCategory(item_id); + + if ((item && !dest_folder->acceptItem(item)) || (cat && (dest_folder->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK))) + { + std::string error_msg = LLTrans::getString("TooltipOutboxMixedStock"); + LLSD subs; + subs["[ERROR_CODE]"] = error_msg; + LLNotificationsUtil::add("StockPasteFailed", subs); + return; + } + } + } + const LLUUID parent_id(mUUID); - + for (std::vector<LLUUID>::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) { const LLUUID& item_id = (*iter); - + LLInventoryItem *item = model->getItem(item_id); LLInventoryObject *obj = model->getObject(item_id); if (obj) @@ -3221,21 +3536,44 @@ void LLFolderBridge::pasteFromClipboard() LLViewerInventoryCategory* vicat = (LLViewerInventoryCategory *) model->getCategory(item_id); llassert(vicat); if (vicat) - { - //changeCategoryParent() implicity calls dirtyFilter - changeCategoryParent(model, vicat, parent_id, FALSE); + { + // Clear the cut folder from the marketplace if it is a listing folder + if (LLMarketplaceData::instance().isListed(item_id)) + { + LLMarketplaceData::instance().clearListing(item_id); + } + if (move_is_into_marketplacelistings) + { + move_folder_to_marketplacelistings(vicat, parent_id); + } + else + { + //changeCategoryParent() implicity calls dirtyFilter + changeCategoryParent(model, vicat, parent_id, FALSE); + } } } else - { - LLViewerInventoryItem* viitem = dynamic_cast<LLViewerInventoryItem*>(item); - llassert(viitem); - if (viitem) - { - //changeItemParent() implicity calls dirtyFilter - changeItemParent(model, viitem, parent_id, FALSE); - } - } + { + LLViewerInventoryItem* viitem = dynamic_cast<LLViewerInventoryItem*>(item); + llassert(viitem); + if (viitem) + { + if (move_is_into_marketplacelistings) + { + if (!move_item_to_marketplacelistings(viitem, parent_id)) + { + // Stop pasting into the marketplace as soon as we get an error + break; + } + } + else + { + //changeItemParent() implicity calls dirtyFilter + changeItemParent(model, viitem, parent_id, FALSE); + } + } + } } else { @@ -3246,22 +3584,45 @@ void LLFolderBridge::pasteFromClipboard() llassert(vicat); if (vicat) { - copy_inventory_category(model, vicat, parent_id); + if (move_is_into_marketplacelistings) + { + move_folder_to_marketplacelistings(vicat, parent_id, true); + } + else + { + copy_inventory_category(model, vicat, parent_id); + } } } - else - { - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - parent_id, - std::string(), - LLPointer<LLInventoryCallback>(NULL)); - } - } - } - } + else + { + LLViewerInventoryItem* viitem = dynamic_cast<LLViewerInventoryItem*>(item); + llassert(viitem); + if (viitem) + { + if (move_is_into_marketplacelistings) + { + if (!move_item_to_marketplacelistings(viitem, parent_id, true)) + { + // Stop pasting into the marketplace as soon as we get an error + break; + } + } + else + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + parent_id, + std::string(), + LLPointer<LLInventoryCallback>(NULL)); + } + } + } + } + } + } // Change mode to paste for next paste LLClipboard::instance().setCutMode(false); } @@ -3274,14 +3635,16 @@ void LLFolderBridge::pasteLinkFromClipboard() { const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); const LLUUID &my_outifts_id = model->findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS, false); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); const BOOL move_is_into_my_outfits = (mUUID == my_outifts_id) || model->isObjectDescendentOf(mUUID, my_outifts_id); const BOOL move_is_into_outfit = move_is_into_my_outfits || (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); + const BOOL move_is_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); - if (move_is_into_outbox) + if (move_is_into_outbox || move_is_into_marketplacelistings) { // Notify user of failure somehow -- play error sound? modal dialog? return; @@ -3341,9 +3704,10 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items LLInventoryModel* model = getInventoryModel(); llassert(model != NULL); - const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); - const LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - const LLUUID favorites = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); + const LLUUID &lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); + const LLUUID &favorites = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + const LLUUID &marketplace_listings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); if (lost_and_found_id == mUUID) { @@ -3361,6 +3725,35 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items { disabled_items.push_back(std::string("New Folder")); } + if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + if (LLMarketplaceData::instance().isUpdating(mUUID)) + { + disabled_items.push_back(std::string("New Folder")); + disabled_items.push_back(std::string("Rename")); + disabled_items.push_back(std::string("Cut")); + disabled_items.push_back(std::string("Copy")); + disabled_items.push_back(std::string("Paste")); + disabled_items.push_back(std::string("Delete")); + } + } + if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + disabled_items.push_back(std::string("New Folder")); + disabled_items.push_back(std::string("New Script")); + disabled_items.push_back(std::string("New Note")); + disabled_items.push_back(std::string("New Gesture")); + disabled_items.push_back(std::string("New Clothes")); + disabled_items.push_back(std::string("New Body Parts")); + } + if (marketplace_listings_id == mUUID) + { + disabled_items.push_back(std::string("New Folder")); + disabled_items.push_back(std::string("Rename")); + disabled_items.push_back(std::string("Cut")); + disabled_items.push_back(std::string("Delete")); + } if(trash_id == mUUID) { // This is the trash. @@ -3390,12 +3783,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items { items.push_back(std::string("New Folder")); } - - items.push_back(std::string("New Script")); - items.push_back(std::string("New Note")); - items.push_back(std::string("New Gesture")); - items.push_back(std::string("New Clothes")); - items.push_back(std::string("New Body Parts")); + if (!isMarketplaceListingsFolder()) + { + items.push_back(std::string("New Script")); + items.push_back(std::string("New Note")); + items.push_back(std::string("New Gesture")); + items.push_back(std::string("New Clothes")); + items.push_back(std::string("New Body Parts")); + } } getClipboardEntries(false, items, disabled_items, flags); } @@ -3429,9 +3824,9 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items LLIsType is_object( LLAssetType::AT_OBJECT ); LLIsType is_gesture( LLAssetType::AT_GESTURE ); - if (checkFolderForContentsOfType(model, is_wearable) || - checkFolderForContentsOfType(model, is_object) || - checkFolderForContentsOfType(model, is_gesture) ) + if (checkFolderForContentsOfType(model, is_wearable) || + checkFolderForContentsOfType(model, is_object) || + checkFolderForContentsOfType(model, is_gesture) ) { mWearables=TRUE; } @@ -3443,7 +3838,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("Delete System Folder")); } - if (!isOutboxFolder()) + if (!isOutboxFolder() && !isMarketplaceListingsFolder()) { items.push_back(std::string("Share")); if (!canShare()) @@ -3453,7 +3848,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } // Add menu items that are dependent on the contents of the folder. LLViewerInventoryCategory* category = (LLViewerInventoryCategory *) model->getCategory(mUUID); - if (category) + if (category && (marketplace_listings_id != mUUID)) { uuid_vec_t folders; folders.push_back(category->getUUID()); @@ -3472,8 +3867,8 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items { // it's all on its way - add an observer, and the inventory will call done for us when everything is here. gInventory.addObserver(fetch); - } -} + } + } } void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& items, menuentry_vec_t& disabled_items) @@ -3490,6 +3885,12 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& if (isItemInTrash()) return; if (!isAgentInventory()) return; if (isOutboxFolder()) return; + + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Delete")); + } + if (isMarketplaceListingsFolder()) return; LLFolderType::EType type = category->getPreferredType(); const bool is_system_folder = LLFolderType::lookupIsProtectedType(type); @@ -3509,11 +3910,6 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& } } - if (!isItemRemovable()) - { - disabled_items.push_back(std::string("Delete")); - } - #ifndef LL_RELEASE_FOR_DOWNLOAD if (LLFolderType::lookupIsProtectedType(type)) { @@ -3802,6 +4198,96 @@ void LLFolderBridge::modifyOutfit(BOOL append) LLAppearanceMgr::instance().wearInventoryCategory( cat, FALSE, append ); } +// +=================================================+ +// | LLMarketplaceFolderBridge | +// +=================================================+ + +// LLMarketplaceFolderBridge is a specialized LLFolderBridge for use in Marketplace Inventory panels + +LLUIImagePtr LLMarketplaceFolderBridge::getIcon() const +{ + return getMarketplaceFolderIcon(FALSE); +} + +LLUIImagePtr LLMarketplaceFolderBridge::getIconOpen() const +{ + return getMarketplaceFolderIcon(TRUE); +} + +LLUIImagePtr LLMarketplaceFolderBridge::getMarketplaceFolderIcon(BOOL is_open) const +{ + LLFolderType::EType preferred_type = getPreferredType(); + S32 depth = depth_nesting_in_marketplace(mUUID); + if ((preferred_type == LLFolderType::FT_NONE) && (depth == 2)) + { + // We override the type when in the marketplace listings folder and only for version folder + preferred_type = LLFolderType::FT_MARKETPLACE_VERSION; + } + return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, is_open)); +} + +std::string LLMarketplaceFolderBridge::getLabelSuffix() const +{ + static LLCachedControl<F32> folder_loading_message_delay(gSavedSettings, "FolderLoadingMessageWaitTime", 0.5f); + + if (mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= folder_loading_message_delay()) + { + return llformat(" ( %s ) ", LLTrans::getString("LoadingData").c_str()); + } + + std::string suffix = ""; + // Listing folder case + if (LLMarketplaceData::instance().isListed(getUUID())) + { + suffix = llformat("%d",LLMarketplaceData::instance().getListingID(getUUID())); + if (suffix.empty()) + { + suffix = LLTrans::getString("MarketplaceNoID"); + } + suffix = " (" + suffix + ")"; + if (LLMarketplaceData::instance().getActivationState(getUUID())) + { + suffix += " (" + LLTrans::getString("MarketplaceLive") + ")"; + } + } + // Version folder case + else if (LLMarketplaceData::instance().isVersionFolder(getUUID())) + { + suffix += " (" + LLTrans::getString("MarketplaceActive") + ")"; + } + // Add stock amount + S32 stock_count = compute_stock_count(getUUID()); + if (stock_count == 0) + { + suffix += " (" + LLTrans::getString("MarketplaceNoStock") + ")"; + } + else if (stock_count != -1) + { + if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + suffix += " (" + LLTrans::getString("MarketplaceStock") + "=" + llformat("%d", stock_count) + ")"; + } + else + { + suffix += " (" + LLTrans::getString("MarketplaceMax") + "=" + llformat("%d", stock_count) + ")"; + } + } + // Add updating suffix + if (LLMarketplaceData::instance().isUpdating(getUUID())) + { + suffix += " (" + LLTrans::getString("MarketplaceUpdating") + ")"; + } + return LLInvFVBridge::getLabelSuffix() + suffix; +} + +LLFontGL::StyleFlags LLMarketplaceFolderBridge::getLabelStyle() const +{ + return (LLMarketplaceData::instance().getActivationState(getUUID()) ? LLFontGL::BOLD : LLFontGL::NORMAL); +} + + + + // helper stuff bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv* move_inv) { @@ -3922,12 +4408,35 @@ void LLFolderBridge::dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_c } } +// Callback for drop item if DAMA required... +void LLFolderBridge::callback_dropItemIntoFolder(const LLSD& notification, const LLSD& response, LLInventoryItem* inv_item) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES + { + std::string tooltip_msg; + dragItemIntoFolder(inv_item, TRUE, tooltip_msg, FALSE); + } +} + +// Callback for drop category if DAMA required... +void LLFolderBridge::callback_dropCategoryIntoFolder(const LLSD& notification, const LLSD& response, LLInventoryCategory* inv_category) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES + { + std::string tooltip_msg; + dragCategoryIntoFolder(inv_category, TRUE, tooltip_msg, FALSE); + } +} + // This is used both for testing whether an item can be dropped // into the folder, as well as performing the actual drop, depending // if drop == TRUE. BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop, - std::string& tooltip_msg) + std::string& tooltip_msg, + BOOL user_confirm) { LLInventoryModel* model = getInventoryModel(); @@ -3945,7 +4454,9 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, const LLUUID &favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE, false); const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); const LLUUID &my_outifts_id = model->findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS, false); + const LLUUID from_folder_uuid = inv_item->getParentUUID(); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); const BOOL move_is_into_favorites = (mUUID == favorites_id); @@ -3954,6 +4465,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id); const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); const BOOL move_is_from_outbox = model->isObjectDescendentOf(inv_item->getUUID(), outbox_id); + const BOOL move_is_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); + const BOOL move_is_from_marketplacelistings = model->isObjectDescendentOf(inv_item->getUUID(), marketplacelistings_id); LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); BOOL accept = FALSE; @@ -4007,59 +4520,45 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, //-------------------------------------------------------------------------------- // Determine if item can be moved & dropped - // + // Note: if user_confirm is false, we already went through those accept logic test and can skip them accept = TRUE; - if (!is_movable) + if (user_confirm && !is_movable) { accept = FALSE; } - else if ((mUUID == inv_item->getParentUUID()) && !move_is_into_favorites) + else if (user_confirm && (mUUID == inv_item->getParentUUID()) && !move_is_into_favorites) { accept = FALSE; } - else if (move_is_into_current_outfit || move_is_into_outfit) + else if (user_confirm && (move_is_into_current_outfit || move_is_into_outfit)) { accept = can_move_to_outfit(inv_item, move_is_into_current_outfit); } - else if (move_is_into_favorites || move_is_into_landmarks) + else if (user_confirm && (move_is_into_favorites || move_is_into_landmarks)) { accept = can_move_to_landmarks(inv_item); } - else if (move_is_into_outbox) + else if (user_confirm && (move_is_into_outbox || move_is_into_marketplacelistings)) { - accept = can_move_to_outbox(inv_item, tooltip_msg); - - if (accept) - { - const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); - - int existing_item_count = LLToolDragAndDrop::instance().getCargoCount(); - - if (master_folder != NULL) - { - LLInventoryModel::cat_array_t existing_categories; - LLInventoryModel::item_array_t existing_items; - - gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE); - - existing_item_count += existing_items.size(); - } - - if (existing_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount")) - { - tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects"); - accept = FALSE; - } - } + const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); + LLViewerInventoryCategory * dest_folder = getCategory(); + accept = can_move_item_to_marketplace(master_folder, dest_folder, inv_item, tooltip_msg, LLToolDragAndDrop::instance().getCargoCount() - LLToolDragAndDrop::instance().getCargoIndex()); } + // Check that the folder can accept this item based on folder/item type compatibility (e.g. stock folder compatibility) + if (user_confirm && accept) + { + LLViewerInventoryCategory * dest_folder = getCategory(); + accept = dest_folder->acceptItem(inv_item); + } + LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); // Check whether the item being dragged from active inventory panel // passes the filter of the destination panel. - if (accept && active_panel && use_filter) + if (user_confirm && accept && active_panel && use_filter) { LLFolderViewItem* fv_item = active_panel->getItemByID(inv_item->getUUID()); if (!fv_item) return false; @@ -4079,9 +4578,25 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // RN: a better solution would be to deselect automatically when an item is moved // and then select any item that is dropped only in the panel that it is dropped in if (active_panel && (destination_panel != active_panel)) - { - active_panel->unSelectAll(); - } + { + active_panel->unSelectAll(); + } + // Dropping in or out of marketplace needs (sometimes) confirmation + if (user_confirm && (move_is_from_marketplacelistings || move_is_into_marketplacelistings)) + { + if ((move_is_from_marketplacelistings && (LLMarketplaceData::instance().isInActiveFolder(inv_item->getUUID()) + || LLMarketplaceData::instance().isListedAndActive(inv_item->getUUID()))) || + (move_is_into_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID))) + { + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropItemIntoFolder, this, _1, _2, inv_item)); + return true; + } + if (move_is_into_marketplacelistings && !move_is_from_marketplacelistings) + { + LLNotificationsUtil::add("ConfirmMerchantMoveInventory", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropItemIntoFolder, this, _1, _2, inv_item)); + return true; + } + } //-------------------------------------------------------------------------------- // Destination folder logic @@ -4094,7 +4609,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLFolderViewItem* itemp = destination_panel->getRootFolder()->getDraggingOverItem(); if (itemp) { - LLUUID srcItemId = inv_item->getUUID(); + LLUUID srcItemId = inv_item->getUUID(); LLUUID destItemId = static_cast<LLFolderViewModelItemInventory*>(itemp->getViewModelItem())->getUUID(); LLFavoritesOrderStorage::instance().rearrangeFavoriteLandmarks(srcItemId, destItemId); } @@ -4112,6 +4627,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { dropToOutfit(inv_item, move_is_into_current_outfit); } + // MERCHANT OUTBOX folder + // Move the item else if (move_is_into_outbox) { if (move_is_from_outbox) @@ -4123,6 +4640,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, copy_item_to_outbox(inv_item, mUUID, LLUUID::null, LLToolDragAndDrop::getOperationId()); } } + // MARKETPLACE LISTINGS folder + // Move the item + else if (move_is_into_marketplacelistings) + { + move_item_to_marketplacelistings(inv_item, mUUID); + } // NORMAL or TRASH folder // (move the item, restamp if into trash) else @@ -4139,8 +4662,24 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, mUUID, move_is_into_trash); } - - // + + if (move_is_from_marketplacelistings) + { + // If we move from an active (listed) listing, checks that it's still valid, if not, unlist + LLUUID version_folder_id = LLMarketplaceData::instance().getActiveFolder(from_folder_uuid); + if (version_folder_id.notNull()) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(version_folder_id); + if (!validate_marketplacelistings(cat,NULL)) + { + LLMarketplaceData::instance().activateListing(version_folder_id,false); + } + } + // Update the listing we moved from anyway + update_marketplace_category(from_folder_uuid); + } + + // //-------------------------------------------------------------------------------- } } @@ -4189,7 +4728,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = FALSE; } - else if (move_is_into_outbox) + else if (move_is_into_outbox || move_is_into_marketplacelistings) { tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; @@ -4227,7 +4766,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } else if(LLToolDragAndDrop::SOURCE_NOTECARD == source) { - if (move_is_into_outbox) + if (move_is_into_outbox || move_is_into_marketplacelistings) { tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; @@ -4261,7 +4800,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = TRUE; - if (move_is_into_outbox) + if (move_is_into_outbox || move_is_into_marketplacelistings) { tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; @@ -4434,6 +4973,12 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { addOutboxContextMenuOptions(flags, items, disabled_items); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); + } else { items.push_back(std::string("Share")); @@ -4501,6 +5046,12 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { addOutboxContextMenuOptions(flags, items, disabled_items); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); + } else { if (isItemInTrash()) @@ -4576,6 +5127,12 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { addOutboxContextMenuOptions(flags, items, disabled_items); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); + } else { if(isItemInTrash()) @@ -4868,6 +5425,12 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Delete")); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); + } else { items.push_back(std::string("Share")); @@ -5000,6 +5563,25 @@ void LLNotecardBridge::openItem() } } +void LLNotecardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + LL_DEBUGS() << "LLNotecardBridge::buildContextMenu()" << LL_ENDL; + + if (isMarketplaceListingsFolder()) + { + menuentry_vec_t items; + menuentry_vec_t disabled_items; + addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); + hide_context_entries(menu, items, disabled_items); + } + else + { + LLItemBridge::buildContextMenu(menu, flags); + } +} + // +=================================================+ // | LLGestureBridge | // +=================================================+ @@ -5135,6 +5717,12 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Delete")); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); + } else { items.push_back(std::string("Share")); @@ -5189,6 +5777,12 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Delete")); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); + } else { if(isItemInTrash()) @@ -5472,6 +6066,12 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Delete")); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); + } else { items.push_back(std::string("Share")); @@ -5694,6 +6294,12 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Delete")); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); + } else { // FWIW, it looks like SUPPRESS_OPEN_ITEM is not set anywhere BOOL can_open = ((flags & SUPPRESS_OPEN_ITEM) != SUPPRESS_OPEN_ITEM); @@ -5994,6 +6600,12 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { addOutboxContextMenuOptions(flags, items, disabled_items); } + else if (isMarketplaceListingsFolder()) + { + addMarketplaceContextMenuOptions(flags, items, disabled_items); + items.push_back(std::string("Properties")); + getClipboardEntries(false, items, disabled_items, flags); + } else { items.push_back(std::string("Properties")); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index e8d5db4437..67239ff09e 100755 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -76,6 +76,7 @@ public: bool canShare() const; bool canListOnMarketplace() const; + bool canListOnOutboxNow() const; bool canListOnMarketplaceNow() const; //-------------------------------------------------------------------- @@ -114,7 +115,7 @@ public: virtual void move(LLFolderViewModelItem* new_parent_bridge) {} virtual BOOL isItemCopyable() const { return FALSE; } virtual BOOL copyToClipboard() const; - virtual BOOL cutToClipboard() const; + virtual BOOL cutToClipboard(); virtual BOOL isClipboardPasteable() const; virtual BOOL isClipboardPasteableAsLink() const; virtual void pasteFromClipboard() {} @@ -146,6 +147,9 @@ protected: virtual void addOutboxContextMenuOptions(U32 flags, menuentry_vec_t &items, menuentry_vec_t &disabled_items); + virtual void addMarketplaceContextMenuOptions(U32 flags, + menuentry_vec_t &items, + menuentry_vec_t &disabled_items); protected: LLInvFVBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid); @@ -160,6 +164,7 @@ protected: BOOL isInboxFolder() const; // true if COF or descendant of marketplace inbox BOOL isOutboxFolderDirectParent() const; + BOOL isMarketplaceListingsFolder() const; // true if descendant of Marketplace listings folder const LLUUID getOutboxFolder() const; virtual BOOL isItemPermissive() const; @@ -172,6 +177,9 @@ protected: const LLUUID& new_parent, BOOL restamp); void removeBatchNoCheck(std::vector<LLFolderViewModelItem*>& batch); + + BOOL callback_cutToClipboard(const LLSD& notification, const LLSD& response); + BOOL perform_cutToClipboard(); public: BOOL isOutboxFolder() const; // true if COF or descendant of marketplace outbox @@ -187,6 +195,7 @@ protected: mutable std::string mSearchableName; void purgeItem(LLInventoryModel *model, const LLUUID &uuid); + void removeObject(LLInventoryModel *model, const LLUUID &uuid); virtual void buildDisplayName() const {} }; @@ -199,6 +208,7 @@ protected: class LLInventoryFolderViewModelBuilder { public: + LLInventoryFolderViewModelBuilder() {} virtual ~LLInventoryFolderViewModelBuilder() {} virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type, LLAssetType::EType actual_asset_type, @@ -262,8 +272,10 @@ public: mIsLoading(false) {} - BOOL dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop, std::string& tooltip_msg); - BOOL dragCategoryIntoFolder(LLInventoryCategory* inv_category, BOOL drop, std::string& tooltip_msg); + BOOL dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop, std::string& tooltip_msg, BOOL user_confirm = TRUE); + BOOL dragCategoryIntoFolder(LLInventoryCategory* inv_category, BOOL drop, std::string& tooltip_msg, BOOL user_confirm = TRUE); + void callback_dropItemIntoFolder(const LLSD& notification, const LLSD& response, LLInventoryItem* inv_item); + void callback_dropCategoryIntoFolder(const LLSD& notification, const LLSD& response, LLInventoryCategory* inv_category); virtual void buildDisplayName() const; @@ -278,10 +290,9 @@ public: virtual LLUIImagePtr getIcon() const; virtual LLUIImagePtr getIconOpen() const; virtual LLUIImagePtr getIconOverlay() const; - static LLUIImagePtr getIcon(LLFolderType::EType preferred_type); - virtual std::string getLabelSuffix() const; + virtual LLFontGL::StyleFlags getLabelStyle() const; virtual BOOL renameItem(const std::string& new_name); @@ -353,12 +364,17 @@ public: static LLHandle<LLFolderBridge> sSelf; static void staticFolderOptionsMenu(); -private: +protected: + void callback_pasteFromClipboard(const LLSD& notification, const LLSD& response); + void perform_pasteFromClipboard(); + void gatherMessage(std::string& message, S32 depth, LLError::ELevel log_level); + LLUIImagePtr getFolderIcon(BOOL is_open) const; bool mCallingCards; bool mWearables; bool mIsLoading; LLTimer mTimeSinceRequestStart; + std::string mMessage; LLRootHandle<LLFolderBridge> mHandle; }; @@ -439,6 +455,7 @@ public: const LLUUID& uuid) : LLItemBridge(inventory, root, uuid) {} virtual void openItem(); + virtual void buildContextMenu(LLMenuGL& menu, U32 flags); }; class LLGestureBridge : public LLItemBridge @@ -482,6 +499,7 @@ public: virtual LLUIImagePtr getIcon() const; virtual void performAction(LLInventoryModel* model, std::string action); virtual void openItem(); + virtual BOOL isItemWearable() const { return TRUE; } virtual std::string getLabelSuffix() const; virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual BOOL renameItem(const std::string& new_name); @@ -514,6 +532,7 @@ public: virtual LLUIImagePtr getIcon() const; virtual void performAction(LLInventoryModel* model, std::string action); virtual void openItem(); + virtual BOOL isItemWearable() const { return TRUE; } virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual std::string getLabelSuffix() const; virtual BOOL renameItem(const std::string& new_name); @@ -654,6 +673,7 @@ public: class LLRecentInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder { public: + LLRecentInventoryBridgeBuilder() {} // Overrides FolderBridge for Recent Inventory Panel. // It use base functionality for bridges other than FolderBridge. virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type, @@ -666,6 +686,29 @@ public: U32 flags = 0x00) const; }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Marketplace Inventory Panel related classes +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLMarketplaceFolderBridge : public LLFolderBridge +{ +public: + // Overloads some display related methods specific to folders in a marketplace floater context + LLMarketplaceFolderBridge(LLInventoryPanel* inventory, + LLFolderView* root, + const LLUUID& uuid) : + LLFolderBridge(inventory, root, uuid) { } + + virtual LLUIImagePtr getIcon() const; + virtual LLUIImagePtr getIconOpen() const; + virtual std::string getLabelSuffix() const; + virtual LLFontGL::StyleFlags getLabelStyle() const; + +private: + LLUIImagePtr getMarketplaceFolderIcon(BOOL is_open) const; +}; + + void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment, bool replace = false); diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index dc8b15a5bf..0f393de79c 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -33,6 +33,8 @@ #include "llfolderviewitem.h" #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" +#include "llinventoryfunctions.h" +#include "llmarketplacefunctions.h" #include "llviewercontrol.h" #include "llfolderview.h" #include "llinventorybridge.h" @@ -136,12 +138,55 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const } // when applying a filter, matching folders get their contents downloaded first - if (mFilterSubString.size() + if (isNotDefault() && !gInventory.isCategoryComplete(folder_id)) { LLInventoryModelBackgroundFetch::instance().start(folder_id); } + // Marketplace folder filtering + const U32 filterTypes = mFilterOps.mFilterTypes; + const U32 marketplace_filter = FILTERTYPE_MARKETPLACE_ACTIVE | FILTERTYPE_MARKETPLACE_INACTIVE | + FILTERTYPE_MARKETPLACE_UNASSOCIATED | FILTERTYPE_MARKETPLACE_LISTING_FOLDER; + if (filterTypes & marketplace_filter) + { + S32 depth = depth_nesting_in_marketplace(folder_id); + + if (filterTypes & FILTERTYPE_MARKETPLACE_LISTING_FOLDER) + { + if (depth > 1) + { + return false; + } + } + + if (depth > 0) + { + LLUUID listing_uuid = nested_parent_id(folder_id, depth); + if (filterTypes & FILTERTYPE_MARKETPLACE_ACTIVE) + { + if (!LLMarketplaceData::instance().getActivationState(listing_uuid)) + { + return false; + } + } + else if (filterTypes & FILTERTYPE_MARKETPLACE_INACTIVE) + { + if (!LLMarketplaceData::instance().isListed(listing_uuid) || LLMarketplaceData::instance().getActivationState(listing_uuid)) + { + return false; + } + } + else if (filterTypes & FILTERTYPE_MARKETPLACE_UNASSOCIATED) + { + if (LLMarketplaceData::instance().isListed(listing_uuid)) + { + return false; + } + } + } + } + // show folder links LLViewerInventoryItem* item = gInventory.getItem(folder_id); if (item && item->getActualType() == LLAssetType::AT_LINK_FOLDER) @@ -501,6 +546,35 @@ void LLInventoryFilter::setFilterEmptySystemFolders() mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS; } +void LLInventoryFilter::setFilterMarketplaceActiveFolders() +{ + mFilterOps.mFilterTypes |= FILTERTYPE_MARKETPLACE_ACTIVE; +} + +void LLInventoryFilter::setFilterMarketplaceInactiveFolders() +{ + mFilterOps.mFilterTypes |= FILTERTYPE_MARKETPLACE_INACTIVE; +} + +void LLInventoryFilter::setFilterMarketplaceUnassociatedFolders() +{ + mFilterOps.mFilterTypes |= FILTERTYPE_MARKETPLACE_UNASSOCIATED; +} + +void LLInventoryFilter::setFilterMarketplaceListingFolders(bool select_only_listing_folders) +{ + if (select_only_listing_folders) + { + mFilterOps.mFilterTypes |= FILTERTYPE_MARKETPLACE_LISTING_FOLDER; + setModified(FILTER_MORE_RESTRICTIVE); + } + else + { + mFilterOps.mFilterTypes &= ~FILTERTYPE_MARKETPLACE_LISTING_FOLDER; + setModified(FILTER_LESS_RESTRICTIVE); + } +} + void LLInventoryFilter::setFilterUUID(const LLUUID& object_id) { if (mFilterOps.mFilterUUID == LLUUID::null) @@ -550,7 +624,7 @@ void LLInventoryFilter::setFilterSubString(const std::string& string) if (mFilterOps.mFilterTypes == FILTERTYPE_UUID) { mFilterOps.mFilterTypes &= ~FILTERTYPE_UUID; - mFilterOps.mFilterUUID == LLUUID::null; + mFilterOps.mFilterUUID = LLUUID::null; setModified(FILTER_RESTART); } @@ -663,13 +737,13 @@ void LLInventoryFilter::setHoursAgo(U32 hours) BOOL more_restrictive; if (FILTERDATEDIRECTION_NEWER == mFilterOps.mDateSearchDirection) { - less_restrictive = (are_date_limits_valid && ((is_increasing && mFilterOps.mHoursAgo)) || !hours); - more_restrictive = (are_date_limits_valid && (!is_increasing && hours) || is_increasing_from_zero); + less_restrictive = ((are_date_limits_valid && ((is_increasing && mFilterOps.mHoursAgo))) || !hours); + more_restrictive = ((are_date_limits_valid && (!is_increasing && hours)) || is_increasing_from_zero); } else { - less_restrictive = (are_date_limits_valid && ((is_decreasing && mFilterOps.mHoursAgo)) || !hours); - more_restrictive = (are_date_limits_valid && (!is_decreasing && hours) || is_increasing_from_zero); + less_restrictive = ((are_date_limits_valid && ((is_decreasing && mFilterOps.mHoursAgo))) || !hours); + more_restrictive = ((are_date_limits_valid && (!is_decreasing && hours)) || is_increasing_from_zero); } mFilterOps.mHoursAgo = hours; diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index 5e18ad4d20..90fa444cf2 100755 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -52,7 +52,11 @@ public: FILTERTYPE_UUID = 0x1 << 2, // find the object with UUID and any links to it FILTERTYPE_DATE = 0x1 << 3, // search by date range FILTERTYPE_WEARABLE = 0x1 << 4, // search by wearable type - FILTERTYPE_EMPTYFOLDERS = 0x1 << 5 // pass if folder is not a system folder to be hidden if + FILTERTYPE_EMPTYFOLDERS = 0x1 << 5, // pass if folder is not a system folder to be hidden if empty + FILTERTYPE_MARKETPLACE_ACTIVE = 0x1 << 6, // pass if folder is a marketplace active folder + FILTERTYPE_MARKETPLACE_INACTIVE = 0x1 << 7, // pass if folder is a marketplace inactive folder + FILTERTYPE_MARKETPLACE_UNASSOCIATED = 0x1 << 8, // pass if folder is a marketplace non associated (no market ID) folder + FILTERTYPE_MARKETPLACE_LISTING_FOLDER = 0x1 << 9 // pass iff folder is a listing folder }; enum EFilterDateDirection @@ -73,7 +77,8 @@ public: SO_NAME = 0, // Sort inventory by name SO_DATE = 0x1, // Sort inventory by date SO_FOLDERS_BY_NAME = 0x1 << 1, // Force folder sort by name - SO_SYSTEM_FOLDERS_TO_TOP = 0x1 << 2 // Force system folders to be on top + SO_SYSTEM_FOLDERS_TO_TOP = 0x1 << 2,// Force system folders to be on top + SO_FOLDERS_BY_WEIGHT = 0x1 << 3, // Force folder sort by weight, usually, amount of some elements in their descendents }; struct FilterOps @@ -170,6 +175,10 @@ public: void setFilterUUID(const LLUUID &object_id); void setFilterWearableTypes(U64 types); void setFilterEmptySystemFolders(); + void setFilterMarketplaceActiveFolders(); + void setFilterMarketplaceInactiveFolders(); + void setFilterMarketplaceUnassociatedFolders(); + void setFilterMarketplaceListingFolders(bool select_only_listing_folders); void updateFilterTypes(U64 types, U64& current_types); void setFilterSubString(const std::string& string); diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 1abc09bf3b..1a7b804d44 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -59,6 +59,7 @@ #include "llinventorypanel.h" #include "lllineeditor.h" #include "llmarketplacenotifications.h" +#include "llmarketplacefunctions.h" #include "llmenugl.h" #include "llnotificationsutil.h" #include "llpanelmaininventory.h" @@ -89,6 +90,126 @@ BOOL LLInventoryState::sWearNewClothing = FALSE; LLUUID LLInventoryState::sWearNewClothingTransactionID; +std::list<LLUUID> LLInventoryAction::sMarketplaceFolders; + +// Helper function : callback to update a folder after inventory action happened in the background +void update_folder_cb(const LLUUID& dest_folder) +{ + LLViewerInventoryCategory* dest_cat = gInventory.getCategory(dest_folder); + gInventory.updateCategory(dest_cat); + gInventory.notifyObservers(); +} + +// Helper function : Count only the copyable items, i.e. skip the stock items (which are no copy) +S32 count_copyable_items(LLInventoryModel::item_array_t& items) +{ + S32 count = 0; + for (LLInventoryModel::item_array_t::const_iterator it = items.begin(); it != items.end(); ++it) + { + LLViewerInventoryItem* item = *it; + if (item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + count++; + } + } + return count; +} + +// Helper function : Count only the non-copyable items, i.e. the stock items, skip the others +S32 count_stock_items(LLInventoryModel::item_array_t& items) +{ + S32 count = 0; + for (LLInventoryModel::item_array_t::const_iterator it = items.begin(); it != items.end(); ++it) + { + LLViewerInventoryItem* item = *it; + if (!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + count++; + } + } + return count; +} + +// Helper function : Count the number of stock folders +S32 count_stock_folders(LLInventoryModel::cat_array_t& categories) +{ + S32 count = 0; + for (LLInventoryModel::cat_array_t::const_iterator it = categories.begin(); it != categories.end(); ++it) + { + LLInventoryCategory* cat = *it; + if (cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + count++; + } + } + return count; +} + +// Helper funtion : Count the number of items (not folders) in the descending hierarchy +S32 count_descendants_items(const LLUUID& cat_id) +{ + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(cat_id,cat_array,item_array); + + S32 count = item_array->size(); + + LLInventoryModel::cat_array_t cat_array_copy = *cat_array; + for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) + { + LLViewerInventoryCategory* category = *iter; + count += count_descendants_items(category->getUUID()); + } + + return count; +} + +// Helper function : Returns true if the hierarchy contains nocopy items +bool contains_nocopy_items(const LLUUID& id) +{ + LLInventoryCategory* cat = gInventory.getCategory(id); + + if (cat) + { + // Get the content + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(id,cat_array,item_array); + + // Check all the items: returns true upon encountering a nocopy item + for (LLInventoryModel::item_array_t::iterator iter = item_array->begin(); iter != item_array->end(); iter++) + { + LLInventoryItem* item = *iter; + LLViewerInventoryItem * inv_item = (LLViewerInventoryItem *) item; + if (!inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + return true; + } + } + + // Check all the sub folders recursively + for (LLInventoryModel::cat_array_t::iterator iter = cat_array->begin(); iter != cat_array->end(); iter++) + { + LLViewerInventoryCategory* cat = *iter; + if (contains_nocopy_items(cat->getUUID())) + { + return true; + } + } + } + else + { + LLInventoryItem* item = gInventory.getItem(id); + LLViewerInventoryItem * inv_item = (LLViewerInventoryItem *) item; + if (!inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + return true; + } + } + + // Exit without meeting a nocopy item + return false; +} // Generates a string containing the path to the item specified by // item_id. @@ -111,6 +232,134 @@ void append_path(const LLUUID& id, std::string& path) path.append(temp); } +void update_marketplace_folder_hierarchy(const LLUUID cat_id) +{ + // When changing the marketplace status of a folder, the only thing that needs to happen is + // for all observers of the folder to, possibly, change the display label of the folder + // so that's the only thing we change on the update mask. + gInventory.addChangedMask(LLInventoryObserver::LABEL, cat_id); + + // Update all descendent folders down + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(cat_id,cat_array,item_array); + + LLInventoryModel::cat_array_t cat_array_copy = *cat_array; + for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) + { + LLInventoryCategory* category = *iter; + update_marketplace_folder_hierarchy(category->getUUID()); + } + return; +} + +void update_marketplace_category(const LLUUID& cur_uuid, bool perform_consistency_enforcement) +{ + // When changing the marketplace status of an item, we usually have to change the status of all + // folders in the same listing. This is because the display of each folder is affected by the + // overall status of the whole listing. + // Consequently, the only way to correctly update an item anywhere in the marketplace is to + // update the whole listing from its listing root. + // This is not as bad as it seems as we only update folders, not items, and the folder nesting depth + // is limited to 4. + // We also take care of degenerated cases so we don't update all folders in the inventory by mistake. + + if (cur_uuid.isNull()) + { + return; + } + + // Grab marketplace listing data for this item + S32 depth = depth_nesting_in_marketplace(cur_uuid); + if (depth > 0) + { + // Retrieve the listing uuid this object is in + LLUUID listing_uuid = nested_parent_id(cur_uuid, depth); + + // Verify marketplace data consistency for this listing + if (perform_consistency_enforcement && LLMarketplaceData::instance().isListed(listing_uuid)) + { + LLUUID version_folder_uuid = LLMarketplaceData::instance().getVersionFolder(listing_uuid); + S32 version_depth = depth_nesting_in_marketplace(version_folder_uuid); + if (version_folder_uuid.notNull() && (!gInventory.isObjectDescendentOf(version_folder_uuid, listing_uuid) || (version_depth != 2))) + { + LL_INFOS("SLM") << "Unlist and clear version folder as the version folder is not at the right place anymore!!" << LL_ENDL; + LLMarketplaceData::instance().setVersionFolder(listing_uuid, LLUUID::null); + } + } + + // Check if the count on hand needs to be updated on SLM + if (perform_consistency_enforcement && !LLMarketplaceData::instance().isUpdating(listing_uuid) && + (compute_stock_count(listing_uuid) != LLMarketplaceData::instance().getCountOnHand(listing_uuid))) + { + LLMarketplaceData::instance().updateCountOnHand(listing_uuid); + } + // Update all descendents starting from the listing root + update_marketplace_folder_hierarchy(listing_uuid); + } + else if (depth == 0) + { + // If this is the marketplace listings root itself, update all descendents + if (gInventory.getCategory(cur_uuid)) + { + update_marketplace_folder_hierarchy(cur_uuid); + } + } + else + { + // If the folder is outside the marketplace listings root, clear its SLM data if needs be + if (perform_consistency_enforcement && LLMarketplaceData::instance().isListed(cur_uuid)) + { + LL_INFOS("SLM") << "Disassociate as the listing folder is not under the marketplace folder anymore!!" << LL_ENDL; + LLMarketplaceData::instance().clearListing(cur_uuid); + } + // Update all descendents if this is a category + if (gInventory.getCategory(cur_uuid)) + { + update_marketplace_folder_hierarchy(cur_uuid); + } + } + + return; +} + +// Iterate through the marketplace and flag for label change all categories that countain a stock folder (i.e. stock folders and embedding folders up the hierarchy) +void update_all_marketplace_count(const LLUUID& cat_id) +{ + // Get all descendent folders down + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(cat_id,cat_array,item_array); + + LLInventoryModel::cat_array_t cat_array_copy = *cat_array; + for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) + { + LLInventoryCategory* category = *iter; + if (category->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + // Listing containing stock folders needs to be updated but not others + // Note: we take advantage of the fact that stock folder *do not* contain sub folders to avoid a recursive call here + update_marketplace_category(category->getUUID()); + } + else + { + // Explore the contained folders recursively + update_all_marketplace_count(category->getUUID()); + } + } +} + +void update_all_marketplace_count() +{ + // Get the marketplace root and launch the recursive exploration + const LLUUID marketplace_listings_uuid = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + if (!marketplace_listings_uuid.isNull()) + { + update_all_marketplace_count(marketplace_listings_uuid); + } + return; +} + void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name) { LLViewerInventoryCategory* cat; @@ -131,7 +380,8 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id, - const LLUUID& root_copy_id) + const LLUUID& root_copy_id, + bool move_no_copy_items ) { // Create the initial folder LLUUID new_cat_uuid = gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName()); @@ -144,19 +394,42 @@ void copy_inventory_category(LLInventoryModel* model, LLInventoryModel::cat_array_t* cat_array; LLInventoryModel::item_array_t* item_array; gInventory.getDirectDescendentsOf(cat->getUUID(),cat_array,item_array); + + // If root_copy_id is null, tell the marketplace model we'll be waiting for new items to be copied over for this folder + if (root_copy_id.isNull()) + { + LLMarketplaceData::instance().setValidationWaiting(root_id,count_descendants_items(cat->getUUID())); + } // Copy all the items LLInventoryModel::item_array_t item_array_copy = *item_array; for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) { LLInventoryItem* item = *iter; - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - new_cat_uuid, - std::string(), - LLPointer<LLInventoryCallback>(NULL)); + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(update_folder_cb, new_cat_uuid)); + + if (!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + // If the item is nocopy, we do nothing or, optionally, move it + if (move_no_copy_items) + { + // Reparent the item + LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) item; + gInventory.changeItemParent(viewer_inv_item, new_cat_uuid, true); + } + // Decrement the count in root_id since that one item won't be copied over + LLMarketplaceData::instance().decrementValidationWaiting(root_id); + } + else + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + new_cat_uuid, + std::string(), + cb); + } } // Copy all the folders @@ -166,7 +439,7 @@ void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* category = *iter; if (category->getUUID() != root_id) { - copy_inventory_category(model, category, new_cat_uuid, root_id); + copy_inventory_category(model, category, new_cat_uuid, root_id, move_no_copy_items); } } } @@ -508,14 +781,22 @@ void open_outbox() LLFloaterReg::showInstance("outbox"); } -LLUUID create_folder_in_outbox_for_item(LLInventoryItem* item, const LLUUID& destFolderId, S32 operation_id) +void open_marketplace_listings() +{ + LLFloaterReg::showInstance("marketplace_listings"); +} + +// Create a new folder in destFolderId with the same name as the item name and return the uuid of the new folder +// Note: this is used locally in various situation where we need to wrap an item into a special folder +LLUUID create_folder_for_item(LLInventoryItem* item, const LLUUID& destFolderId) { llassert(item); llassert(destFolderId.notNull()); LLUUID created_folder_id = gInventory.createNewCategory(destFolderId, LLFolderType::FT_NONE, item->getName()); gInventory.notifyObservers(); - + + // *TODO : Create different notifications for the various cases LLNotificationsUtil::add("OutboxFolderCreated"); return created_folder_id; @@ -531,8 +812,7 @@ void move_to_outbox_cb_action(const LLSD& payload) // when moving item directly into outbox create folder with that name if (dest_folder_id == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false)) { - S32 operation_id = payload["operation_id"].asInteger(); - dest_folder_id = create_folder_in_outbox_for_item(viitem, dest_folder_id, operation_id); + dest_folder_id = create_folder_for_item(viitem, dest_folder_id); } LLUUID parent = viitem->getParentUUID(); @@ -603,7 +883,7 @@ void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LL // when moving item directly into outbox create folder with that name if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false)) { - dest_folder = create_folder_in_outbox_for_item(inv_item, dest_folder, operation_id); + dest_folder = create_folder_for_item(inv_item, dest_folder); } copy_inventory_item(gAgent.getID(), @@ -633,7 +913,7 @@ void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, S32 // when moving item directly into outbox create folder with that name if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false)) { - dest_folder = create_folder_in_outbox_for_item(inv_item, dest_folder, operation_id); + dest_folder = create_folder_for_item(inv_item, dest_folder); } LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; @@ -674,6 +954,971 @@ void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_fold } ///---------------------------------------------------------------------------- +// Marketplace functions +// +// Handles Copy and Move to or within the Marketplace listings folder. +// Handles creation of stock folders, nesting of listings and version folders, +// permission checking and listings validation. +///---------------------------------------------------------------------------- + +S32 depth_nesting_in_marketplace(LLUUID cur_uuid) +{ + // Get the marketplace listings root, exit with -1 (i.e. not under the marketplace listings root) if none + const LLUUID marketplace_listings_uuid = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + if (marketplace_listings_uuid.isNull()) + { + return -1; + } + // If not a descendent of the marketplace listings root, then the nesting depth is -1 by definition + if (!gInventory.isObjectDescendentOf(cur_uuid, marketplace_listings_uuid)) + { + return -1; + } + + // Iterate through the parents till we hit the marketplace listings root + // Note that the marketplace listings root itself will return 0 + S32 depth = 0; + LLInventoryObject* cur_object = gInventory.getObject(cur_uuid); + while (cur_uuid != marketplace_listings_uuid) + { + depth++; + cur_uuid = cur_object->getParentUUID(); + cur_object = gInventory.getCategory(cur_uuid); + } + return depth; +} + +// Returns the UUID of the marketplace listing this object is in +LLUUID nested_parent_id(LLUUID cur_uuid, S32 depth) +{ + if (depth < 1) + { + // For objects outside the marketplace listings root (or root itself), we return a NULL UUID + return LLUUID::null; + } + else if (depth == 1) + { + // Just under the root, we return the passed UUID itself if it's a folder, NULL otherwise (not a listing) + LLViewerInventoryCategory* cat = gInventory.getCategory(cur_uuid); + return (cat ? cur_uuid : LLUUID::null); + } + + // depth > 1 + LLInventoryObject* cur_object = gInventory.getObject(cur_uuid); + while (depth > 1) + { + depth--; + cur_uuid = cur_object->getParentUUID(); + cur_object = gInventory.getCategory(cur_uuid); + } + return cur_uuid; +} + +S32 compute_stock_count(LLUUID cat_uuid) +{ + // Handle the case of the folder being a stock folder immediately + LLViewerInventoryCategory* cat = gInventory.getCategory(cat_uuid); + if (!cat) + { + // Not a category so no stock count to speak of + return -1; + } + if (cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + // Note: stock folders are *not* supposed to have nested subfolders so we stop recursion here but we count only items (subfolders will be ignored) + // Note: we *always* give a stock count for stock folders, it's useful even if the listing is unassociated + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(cat_uuid,cat_array,item_array); + return item_array->size(); + } + + // Grab marketplace data for this folder + S32 depth = depth_nesting_in_marketplace(cat_uuid); + LLUUID listing_uuid = nested_parent_id(cat_uuid, depth); + if (!LLMarketplaceData::instance().isListed(listing_uuid)) + { + // If not listed, the notion of stock is meaningless so it won't be computed for any level + return -1; + } + + LLUUID version_folder_uuid = LLMarketplaceData::instance().getVersionFolder(listing_uuid); + // Handle the case of the first 2 levels : listing and version folders + if (depth == 1) + { + if (version_folder_uuid.notNull()) + { + // If there is a version folder, the stock value for the listing is the version folder stock + return compute_stock_count(version_folder_uuid); + } + else + { + // If there's no version folder associated, the notion of stock count has no meaning + return -1; + } + } + else if (depth == 2) + { + if (version_folder_uuid.notNull() && (version_folder_uuid != cat_uuid)) + { + // If there is a version folder but we're not it, our stock count is meaningless + return -1; + } + } + + // In all other cases, the stock count is the min of stock folders count found in the descendents + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(cat_uuid,cat_array,item_array); + + // "-1" denotes a folder that doesn't countain any stock folders in its descendents + S32 curr_count = -1; + + // Note: marketplace listings have a maximum depth nesting of 4 + LLInventoryModel::cat_array_t cat_array_copy = *cat_array; + for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) + { + LLInventoryCategory* category = *iter; + S32 count = compute_stock_count(category->getUUID()); + if ((curr_count == -1) || ((count != -1) && (count < curr_count))) + { + curr_count = count; + } + } + + return curr_count; +} + +// local helper +bool can_move_to_marketplace(LLInventoryItem* inv_item, std::string& tooltip_msg, bool resolve_links) +{ + // Collapse links directly to items/folders + LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; + LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem(); + LLViewerInventoryCategory * linked_category = viewer_inv_item->getLinkedCategory(); + + // Linked items and folders cannot be put for sale + if (linked_category || linked_item) + { + tooltip_msg = LLTrans::getString("TooltipOutboxLinked"); + return false; + } + + // A category is always considered as passing... + if (linked_category != NULL) + { + return true; + } + + // Take the linked item if necessary + if (linked_item != NULL) + { + inv_item = linked_item; + } + + // Check that the agent has transfer permission on the item: this is required as a resident cannot + // put on sale items she cannot transfer. Proceed with move if we have permission. + bool allow_transfer = inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); + if (!allow_transfer) + { + tooltip_msg = LLTrans::getString("TooltipOutboxNoTransfer"); + return false; + } + + // Check worn/not worn status: worn items cannot be put on the marketplace + bool worn = get_is_item_worn(inv_item->getUUID()); + if (worn) + { + tooltip_msg = LLTrans::getString("TooltipOutboxWorn"); + return false; + } + + // Check library status: library items cannot be put on the marketplace + if (!gInventory.isObjectDescendentOf(inv_item->getUUID(), gInventory.getRootFolderID())) + { + tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); + return false; + } + + // Check type: for the moment, calling cards cannot be put on the marketplace + bool calling_card = (LLAssetType::AT_CALLINGCARD == inv_item->getType()); + if (calling_card) + { + tooltip_msg = LLTrans::getString("TooltipOutboxCallingCard"); + return false; + } + + return true; +} + +// local helper +// Returns the max tree length (in folder nodes) down from the argument folder +int get_folder_levels(LLInventoryCategory* inv_cat) +{ + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + gInventory.getDirectDescendentsOf(inv_cat->getUUID(), cats, items); + + int max_child_levels = 0; + + for (S32 i=0; i < cats->size(); ++i) + { + LLInventoryCategory* category = cats->at(i); + max_child_levels = llmax(max_child_levels, get_folder_levels(category)); + } + + return 1 + max_child_levels; +} + +// local helper +// Returns the distance (in folder nodes) between the ancestor and its descendant. Returns -1 if not related. +int get_folder_path_length(const LLUUID& ancestor_id, const LLUUID& descendant_id) +{ + int depth = 0; + + if (ancestor_id == descendant_id) return depth; + + const LLInventoryCategory* category = gInventory.getCategory(descendant_id); + + while (category) + { + LLUUID parent_id = category->getParentUUID(); + + if (parent_id.isNull()) break; + + depth++; + + if (parent_id == ancestor_id) return depth; + + category = gInventory.getCategory(parent_id); + } + + LL_WARNS("SLM") << "get_folder_path_length() couldn't trace a path from the descendant to the ancestor" << LL_ENDL; + return -1; +} + +// local helper +// Returns true if all items within the argument folder are fit for sale, false otherwise +bool has_correct_permissions_for_sale(LLInventoryCategory* cat, std::string& error_msg) +{ + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(cat->getUUID(),cat_array,item_array); + + LLInventoryModel::item_array_t item_array_copy = *item_array; + + for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) + { + LLInventoryItem* item = *iter; + if (!can_move_to_marketplace(item, error_msg, false)) + { + return false; + } + } + + LLInventoryModel::cat_array_t cat_array_copy = *cat_array; + + for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) + { + LLInventoryCategory* category = *iter; + if (!has_correct_permissions_for_sale(category, error_msg)) + { + return false; + } + } + return true; +} + +// Returns true if inv_item can be dropped in dest_folder, a folder nested in marketplace listings (or merchant inventory) under the root_folder root +// If returns is false, tooltip_msg contains an error message to display to the user (localized and all). +// bundle_size is the amount of sibling items that are getting moved to the marketplace at the same time. +bool can_move_item_to_marketplace(const LLInventoryCategory* root_folder, LLInventoryCategory* dest_folder, LLInventoryItem* inv_item, std::string& tooltip_msg, S32 bundle_size, bool from_paste) +{ + // Check stock folder type matches item type in marketplace listings or merchant outbox (even if of no use there for the moment) + LLViewerInventoryCategory* view_folder = dynamic_cast<LLViewerInventoryCategory*>(dest_folder); + bool move_in_stock = (view_folder && (view_folder->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK)); + bool accept = (view_folder && view_folder->acceptItem(inv_item)); + if (!accept) + { + tooltip_msg = LLTrans::getString("TooltipOutboxMixedStock"); + } + + // Check that the item has the right type and permissions to be sold on the marketplace + if (accept) + { + accept = can_move_to_marketplace(inv_item, tooltip_msg, true); + } + + // Check that the total amount of items won't violate the max limit on the marketplace + if (accept) + { + // If the dest folder is a stock folder, we do not count the incoming items toward the total (stock items are seen as one) + int existing_item_count = (move_in_stock ? 0 : bundle_size); + + // If the dest folder is a stock folder, we do assume that the incoming items are also stock items (they should anyway) + int existing_stock_count = (move_in_stock ? bundle_size : 0); + + // Get the version folder: that's where the counts start from + const LLViewerInventoryCategory * version_folder = ((root_folder && (root_folder != dest_folder)) ? gInventory.getFirstDescendantOf(root_folder->getUUID(), dest_folder->getUUID()) : NULL); + + if (version_folder) + { + if (!from_paste && gInventory.isObjectDescendentOf(inv_item->getUUID(), version_folder->getUUID())) + { + // Clear those counts or they will be counted twice because we're already inside the version category + existing_item_count = 0; + } + + LLInventoryModel::cat_array_t existing_categories; + LLInventoryModel::item_array_t existing_items; + + gInventory.collectDescendents(version_folder->getUUID(), existing_categories, existing_items, FALSE); + + existing_item_count += count_copyable_items(existing_items) + count_stock_folders(existing_categories); + existing_stock_count += count_stock_items(existing_items); + } + + if (existing_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount")) + { + LLStringUtil::format_map_t args; + U32 amount = gSavedSettings.getU32("InventoryOutboxMaxItemCount"); + args["[AMOUNT]"] = llformat("%d",amount); + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects", args); + accept = false; + } + else if (existing_stock_count > gSavedSettings.getU32("InventoryOutboxMaxStockItemCount")) + { + LLStringUtil::format_map_t args; + U32 amount = gSavedSettings.getU32("InventoryOutboxMaxStockItemCount"); + args["[AMOUNT]"] = llformat("%d",amount); + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyStockItems", args); + accept = false; + } + } + + return accept; +} + +// Returns true if inv_cat can be dropped in dest_folder, a folder nested in marketplace listings (or merchant inventory) under the root_folder root +// If returns is false, tooltip_msg contains an error message to display to the user (localized and all). +// bundle_size is the amount of sibling items that are getting moved to the marketplace at the same time. +bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLInventoryCategory* dest_folder, LLInventoryCategory* inv_cat, std::string& tooltip_msg, S32 bundle_size, bool check_items, bool from_paste) +{ + bool accept = true; + + // Compute the nested folders level we'll add into with that incoming folder + int incoming_folder_depth = get_folder_levels(inv_cat); + // Compute the nested folders level we're inserting ourselves in + // Note: add 1 when inserting under a listing folder as we need to take the root listing folder in the count + int insertion_point_folder_depth = (root_folder ? get_folder_path_length(root_folder->getUUID(), dest_folder->getUUID()) + 1 : 0); + + // Get the version folder: that's where the folders and items counts start from + const LLViewerInventoryCategory * version_folder = (insertion_point_folder_depth >= 2 ? gInventory.getFirstDescendantOf(root_folder->getUUID(), dest_folder->getUUID()) : NULL); + + // Compare the whole with the nested folders depth limit + // Note: substract 2 as we leave root and version folder out of the count threshold + if ((incoming_folder_depth + insertion_point_folder_depth - 2) > (S32)(gSavedSettings.getU32("InventoryOutboxMaxFolderDepth"))) + { + LLStringUtil::format_map_t args; + U32 amount = gSavedSettings.getU32("InventoryOutboxMaxFolderDepth"); + args["[AMOUNT]"] = llformat("%d",amount); + tooltip_msg = LLTrans::getString("TooltipOutboxFolderLevels", args); + accept = false; + } + + if (accept) + { + LLInventoryModel::cat_array_t descendent_categories; + LLInventoryModel::item_array_t descendent_items; + gInventory.collectDescendents(inv_cat->getUUID(), descendent_categories, descendent_items, FALSE); + + int dragged_folder_count = descendent_categories.size() + bundle_size; // Note: We assume that we're moving a bunch of folders in. That might be wrong... + int dragged_item_count = count_copyable_items(descendent_items) + count_stock_folders(descendent_categories); + int dragged_stock_count = count_stock_items(descendent_items); + int existing_item_count = 0; + int existing_stock_count = 0; + int existing_folder_count = 0; + + if (version_folder) + { + if (!from_paste && gInventory.isObjectDescendentOf(inv_cat->getUUID(), version_folder->getUUID())) + { + // Clear those counts or they will be counted twice because we're already inside the version category + dragged_folder_count = 0; + dragged_item_count = 0; + dragged_stock_count = 0; + } + + // Tally the total number of categories and items inside the root folder + LLInventoryModel::cat_array_t existing_categories; + LLInventoryModel::item_array_t existing_items; + gInventory.collectDescendents(version_folder->getUUID(), existing_categories, existing_items, FALSE); + + existing_folder_count += existing_categories.size(); + existing_item_count += count_copyable_items(existing_items) + count_stock_folders(existing_categories); + existing_stock_count += count_stock_items(existing_items); + } + + const int total_folder_count = existing_folder_count + dragged_folder_count; + const int total_item_count = existing_item_count + dragged_item_count; + const int total_stock_count = existing_stock_count + dragged_stock_count; + + if (total_folder_count > gSavedSettings.getU32("InventoryOutboxMaxFolderCount")) + { + LLStringUtil::format_map_t args; + U32 amount = gSavedSettings.getU32("InventoryOutboxMaxFolderCount"); + args["[AMOUNT]"] = llformat("%d",amount); + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyFolders", args); + accept = false; + } + else if (total_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount")) + { + LLStringUtil::format_map_t args; + U32 amount = gSavedSettings.getU32("InventoryOutboxMaxItemCount"); + args["[AMOUNT]"] = llformat("%d",amount); + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects", args); + accept = false; + } + else if (total_stock_count > gSavedSettings.getU32("InventoryOutboxMaxStockItemCount")) + { + LLStringUtil::format_map_t args; + U32 amount = gSavedSettings.getU32("InventoryOutboxMaxStockItemCount"); + args["[AMOUNT]"] = llformat("%d",amount); + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyStockItems", args); + accept = false; + } + + // Now check that each item in the folder can be moved in the marketplace + if (accept && check_items) + { + for (S32 i=0; i < descendent_items.size(); ++i) + { + LLInventoryItem* item = descendent_items[i]; + if (!can_move_to_marketplace(item, tooltip_msg, false)) + { + accept = false; + break; + } + } + } + } + + return accept; +} + +bool move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_folder, bool copy) +{ + // Get the marketplace listings depth of the destination folder, exit with error if not under marketplace + S32 depth = depth_nesting_in_marketplace(dest_folder); + if (depth < 0) + { + LLSD subs; + subs["[ERROR_CODE]"] = LLTrans::getString("Marketplace Error Prefix") + LLTrans::getString("Marketplace Error Not Merchant"); + LLNotificationsUtil::add("MerchantPasteFailed", subs); + return false; + } + + // We will collapse links into items/folders + LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; + LLViewerInventoryCategory * linked_category = viewer_inv_item->getLinkedCategory(); + + if (linked_category != NULL) + { + // Move the linked folder directly + return move_folder_to_marketplacelistings(linked_category, dest_folder, copy); + } + else + { + // Grab the linked item if any + LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem(); + viewer_inv_item = (linked_item != NULL ? linked_item : viewer_inv_item); + + // If we want to copy but the item is no copy, fail silently (this is a common case that doesn't warrant notification) + if (copy && !viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + return false; + } + + // Check that the agent has transfer permission on the item: this is required as a resident cannot + // put on sale items she cannot transfer. Proceed with move if we have permission. + std::string error_msg; + if (can_move_to_marketplace(inv_item, error_msg, true)) + { + // When moving an isolated item, we might need to create the folder structure to support it + if (depth == 0) + { + // We need a listing folder + dest_folder = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, viewer_inv_item->getName()); + depth++; + } + if (depth == 1) + { + // We need a version folder + dest_folder = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, viewer_inv_item->getName()); + depth++; + } + LLViewerInventoryCategory* dest_cat = gInventory.getCategory(dest_folder); + if (!viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()) && + (dest_cat->getPreferredType() != LLFolderType::FT_MARKETPLACE_STOCK)) + { + // We need to create a stock folder to move a no copy item + dest_folder = gInventory.createNewCategory(dest_folder, LLFolderType::FT_MARKETPLACE_STOCK, viewer_inv_item->getName()); + dest_cat = gInventory.getCategory(dest_folder); + depth++; + } + + // Verify we can have this item in that destination category + if (!dest_cat->acceptItem(viewer_inv_item)) + { + LLSD subs; + subs["[ERROR_CODE]"] = LLTrans::getString("Marketplace Error Prefix") + LLTrans::getString("Marketplace Error Not Accepted"); + LLNotificationsUtil::add("MerchantPasteFailed", subs); + return false; + } + + // Get the parent folder of the moved item : we may have to update it + LLUUID src_folder = viewer_inv_item->getParentUUID(); + + if (copy) + { + // Copy the item + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(update_folder_cb, dest_folder)); + copy_inventory_item( + gAgent.getID(), + viewer_inv_item->getPermissions().getOwner(), + viewer_inv_item->getUUID(), + dest_folder, + std::string(), + cb); + } + else + { + // Reparent the item + gInventory.changeItemParent(viewer_inv_item, dest_folder, true); + } + + // Update the modified folders + update_marketplace_category(src_folder); + update_marketplace_category(dest_folder); + gInventory.notifyObservers(); + } + else + { + LLSD subs; + subs["[ERROR_CODE]"] = LLTrans::getString("Marketplace Error Prefix") + error_msg; + LLNotificationsUtil::add("MerchantPasteFailed", subs); + return false; + } + } + + open_marketplace_listings(); + return true; +} + +bool move_folder_to_marketplacelistings(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, bool copy, bool move_no_copy_items) +{ + // Check that we have adequate permission on all items being moved. Proceed if we do. + std::string error_msg; + if (has_correct_permissions_for_sale(inv_cat, error_msg)) + { + // Get the destination folder + LLViewerInventoryCategory* dest_cat = gInventory.getCategory(dest_folder); + + // Check it's not a stock folder + if (dest_cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + LLSD subs; + subs["[ERROR_CODE]"] = LLTrans::getString("Marketplace Error Prefix") + LLTrans::getString("Marketplace Error Not Accepted"); + LLNotificationsUtil::add("MerchantPasteFailed", subs); + return false; + } + + // Get the parent folder of the moved item : we may have to update it + LLUUID src_folder = inv_cat->getParentUUID(); + + LLViewerInventoryCategory * viewer_inv_cat = (LLViewerInventoryCategory *) inv_cat; + if (copy) + { + // Copy the folder + copy_inventory_category(&gInventory, viewer_inv_cat, dest_folder, LLUUID::null, move_no_copy_items); + } + else + { + // Reparent the folder + gInventory.changeCategoryParent(viewer_inv_cat, dest_folder, false); + // Check the destination folder recursively for no copy items and promote the including folders if any + validate_marketplacelistings(dest_cat); + } + + // Update the modified folders + update_marketplace_category(src_folder); + update_marketplace_category(dest_folder); + gInventory.notifyObservers(); + } + else + { + LLSD subs; + subs["[ERROR_CODE]"] = LLTrans::getString("Marketplace Error Prefix") + error_msg; + LLNotificationsUtil::add("MerchantPasteFailed", subs); + return false; + } + + open_marketplace_listings(); + return true; +} + +// Make all relevant business logic checks on the marketplace listings starting with the folder as argument. +// This function does no deletion of listings but a mere audit and raises issues to the user (through the +// optional callback cb). It also returns a boolean, true if things validate, false if issues are raised. +// The only inventory changes that are done is to move and sort folders containing no-copy items to stock folders. +bool sort_alpha(const LLViewerInventoryCategory* cat1, const LLViewerInventoryCategory* cat2) +{ + return cat1->getName().compare(cat2->getName()) < 0; +} + +bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_t cb, bool fix_hierarchy, S32 depth) +{ + // Folder is valid unless issue is raised + bool result = true; + + // Get the type and the depth of the folder + LLViewerInventoryCategory * viewer_cat = (LLViewerInventoryCategory *) (cat); + const LLFolderType::EType folder_type = cat->getPreferredType(); + if (depth < 0) + { + // If the depth argument was not provided, evaluate the depth directly + depth = depth_nesting_in_marketplace(cat->getUUID()); + } + if (depth < 0) + { + // If the folder is not under the marketplace listings root, we run validation as if it was a listing folder and prevent any hierarchy fix + // This allows the function to be used to pre-validate a folder anywhere in the inventory + depth = 1; + fix_hierarchy = false; + } + + // Set the indentation for print output (typically, audit button in marketplace folder floater) + std::string indent; + for (int i = 1; i < depth; i++) + { + indent += " "; + } + + // Check out that version folders are marketplace ready + if (depth == 2) + { + std::string message; + // Note: if we fix the hierarchy, we want to check the items individually, hence the last argument here + if (!can_move_folder_to_marketplace(cat, cat, cat, message, 0, fix_hierarchy)) + { + result = false; + if (cb) + { + message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Error") + " " + message; + cb(message,depth,LLError::LEVEL_ERROR); + } + } + } + + // Check out that stock folders are at the right level + if ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && (depth <= 2)) + { + if (fix_hierarchy) + { + if (cb) + { + std::string message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Warning") + " " + LLTrans::getString("Marketplace Validation Warning Stock"); + cb(message,depth,LLError::LEVEL_WARN); + } + // Nest the stock folder one level deeper in a normal folder and restart from there + LLUUID parent_uuid = cat->getParentUUID(); + LLUUID folder_uuid = gInventory.createNewCategory(parent_uuid, LLFolderType::FT_NONE, cat->getName()); + LLInventoryCategory* new_cat = gInventory.getCategory(folder_uuid); + gInventory.changeCategoryParent(viewer_cat, folder_uuid, false); + result &= validate_marketplacelistings(new_cat, cb, fix_hierarchy, depth + 1); + return result; + } + else + { + result = false; + if (cb) + { + std::string message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Error") + " " + LLTrans::getString("Marketplace Validation Warning Stock"); + cb(message,depth,LLError::LEVEL_ERROR); + } + } + } + + // Item sorting and validation : sorting and moving the various stock items is complicated as the set of constraints is high + // We need to: + // * separate non stock items, stock items per types in different folders + // * have stock items nested at depth 2 at least + // * never ever move the non-stock items + + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(cat->getUUID(),cat_array,item_array); + + std::vector<std::vector<LLUUID> > items_vector; + items_vector.resize(LLInventoryType::IT_COUNT+1); + + // Parse the items and create vectors of item UUIDs sorting copyable items and stock items of various types + bool has_bad_items = false; + LLInventoryModel::item_array_t item_array_copy = *item_array; + for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) + { + LLInventoryItem* item = *iter; + LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) item; + + // Test but skip items that shouldn't be there to start with, raise an error message for those + std::string error_msg; + if (!can_move_to_marketplace(item, error_msg, false)) + { + has_bad_items = true; + if (cb && fix_hierarchy) + { + std::string message = indent + viewer_inv_item->getName() + LLTrans::getString("Marketplace Validation Error") + " " + error_msg; + cb(message,depth,LLError::LEVEL_ERROR); + } + continue; + } + // Update the appropriate vector item for that type + LLInventoryType::EType type = LLInventoryType::IT_COUNT; // Default value for non stock items + if (!viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + // Get the item type for stock items + type = viewer_inv_item->getInventoryType(); + } + items_vector[type].push_back(viewer_inv_item->getUUID()); + } + + // How many types of items? Which type is it if only one? + S32 count = 0; + LLInventoryType::EType type = LLInventoryType::IT_COUNT; + for (S32 i = 0; i <= LLInventoryType::IT_COUNT; i++) + { + if (!items_vector[i].empty()) + { + count++; + type = (LLInventoryType::EType)(i); + } + } + + // If we have no items in there (only folders or empty), analyze a bit further + if ((count == 0) && !has_bad_items) + { + if (cat_array->size() == 0) + { + // So we have no item and no folder. That's at least a warning. + if (depth == 2) + { + // If this is an empty version folder, warn only (listing won't be delivered by AIS, but only AIS should unlist) + if (cb) + { + std::string message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Error Empty Version"); + cb(message,depth,LLError::LEVEL_WARN); + } + } + else if ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && (depth > 2)) + { + // If this is a legit but empty stock folder, warn only (listing must stay searchable when out of stock) + if (cb) + { + std::string message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Error Empty Stock"); + cb(message,depth,LLError::LEVEL_WARN); + } + } + else if (cb) + { + // We warn if there's nothing in a regular folder (may be it's an under construction listing) + std::string message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Warning Empty"); + cb(message,depth,LLError::LEVEL_WARN); + } + } + else + { + // Done with that folder : Print out the folder name unless we already found an error here + if (cb && result && (depth >= 1)) + { + std::string message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Log"); + cb(message,depth,LLError::LEVEL_INFO); + } + } + } + // If we have a single type of items of the right type in the right place, we're done + else if ((count == 1) && !has_bad_items && (((type == LLInventoryType::IT_COUNT) && (depth > 1)) || ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && (depth > 2) && (cat_array->size() == 0)))) + { + // Done with that folder : Print out the folder name unless we already found an error here + if (cb && result && (depth >= 1)) + { + std::string message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Log"); + cb(message,depth,LLError::LEVEL_INFO); + } + } + else + { + if (fix_hierarchy && !has_bad_items) + { + // Alert the user when an existing stock folder has to be split + if ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && ((count >= 2) || (cat_array->size() > 0))) + { + LLNotificationsUtil::add("AlertMerchantStockFolderSplit"); + } + // If we have more than 1 type of items or we are at the listing level or we have stok/no stock type mismatch, wrap the items in subfolders + if ((count > 1) || (depth == 1) || + ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && (type == LLInventoryType::IT_COUNT)) || + ((folder_type != LLFolderType::FT_MARKETPLACE_STOCK) && (type != LLInventoryType::IT_COUNT))) + { + // Create one folder per vector at the right depth and of the right type + for (S32 i = 0; i <= LLInventoryType::IT_COUNT; i++) + { + if (!items_vector[i].empty()) + { + // Create a new folder + LLUUID parent_uuid = (depth > 2 ? viewer_cat->getParentUUID() : viewer_cat->getUUID()); + LLViewerInventoryItem* viewer_inv_item = gInventory.getItem(items_vector[i].back()); + std::string folder_name = (depth > 1 ? viewer_cat->getName() : viewer_inv_item->getName()); + LLFolderType::EType new_folder_type = (i == LLInventoryType::IT_COUNT ? LLFolderType::FT_NONE : LLFolderType::FT_MARKETPLACE_STOCK); + if (cb) + { + std::string message = ""; + if (new_folder_type == LLFolderType::FT_MARKETPLACE_STOCK) + { + message = indent + folder_name + LLTrans::getString("Marketplace Validation Warning Create Stock"); + } + else + { + message = indent + folder_name + LLTrans::getString("Marketplace Validation Warning Create Version"); + } + cb(message,depth,LLError::LEVEL_WARN); + } + LLUUID folder_uuid = gInventory.createNewCategory(parent_uuid, new_folder_type, folder_name); + + // Move each item to the new folder + while (!items_vector[i].empty()) + { + LLViewerInventoryItem* viewer_inv_item = gInventory.getItem(items_vector[i].back()); + if (cb) + { + std::string message = indent + viewer_inv_item->getName() + LLTrans::getString("Marketplace Validation Warning Move"); + cb(message,depth,LLError::LEVEL_WARN); + } + gInventory.changeItemParent(viewer_inv_item, folder_uuid, true); + items_vector[i].pop_back(); + } + update_marketplace_category(folder_uuid); + gInventory.notifyObservers(); + } + } + } + // Stock folder should have no sub folder so reparent those up + if (folder_type == LLFolderType::FT_MARKETPLACE_STOCK) + { + LLUUID parent_uuid = cat->getParentUUID(); + gInventory.getDirectDescendentsOf(cat->getUUID(),cat_array,item_array); + LLInventoryModel::cat_array_t cat_array_copy = *cat_array; + for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) + { + LLViewerInventoryCategory * viewer_cat = (LLViewerInventoryCategory *) (*iter); + gInventory.changeCategoryParent(viewer_cat, parent_uuid, false); + result &= validate_marketplacelistings(viewer_cat, cb, fix_hierarchy, depth); + } + } + } + else if (cb) + { + // We are not fixing the hierarchy but reporting problems, report everything we can find + // Print the folder name + if (result && (depth >= 1)) + { + if ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && (count >= 2)) + { + // Report if a stock folder contains a mix of items + result = false; + std::string message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Error Mixed Stock"); + cb(message,depth,LLError::LEVEL_ERROR); + } + else if ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && (cat_array->size() != 0)) + { + // Report if a stock folder contains subfolders + result = false; + std::string message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Error Subfolder In Stock"); + cb(message,depth,LLError::LEVEL_ERROR); + } + else + { + // Simply print the folder name + std::string message = indent + cat->getName() + LLTrans::getString("Marketplace Validation Log"); + cb(message,depth,LLError::LEVEL_INFO); + } + } + // Scan each item and report if there's a problem + LLInventoryModel::item_array_t item_array_copy = *item_array; + for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) + { + LLInventoryItem* item = *iter; + LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) item; + std::string error_msg; + if (!can_move_to_marketplace(item, error_msg, false)) + { + // Report items that shouldn't be there to start with + result = false; + std::string message = indent + " " + viewer_inv_item->getName() + LLTrans::getString("Marketplace Validation Error") + " " + error_msg; + cb(message,depth,LLError::LEVEL_ERROR); + } + else if ((!viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) && (folder_type != LLFolderType::FT_MARKETPLACE_STOCK)) + { + // Report stock items that are misplaced + result = false; + std::string message = indent + " " + viewer_inv_item->getName() + LLTrans::getString("Marketplace Validation Error Stock Item"); + cb(message,depth,LLError::LEVEL_ERROR); + } + else if (depth == 1) + { + // Report items not wrapped in version folder + std::string message = indent + " " + viewer_inv_item->getName() + LLTrans::getString("Marketplace Validation Warning Unwrapped Item"); + cb(message,depth,LLError::LEVEL_WARN); + } + } + } + + // Clean up + if (viewer_cat->getDescendentCount() == 0) + { + // Remove the current folder if it ends up empty + if (cb) + { + std::string message = indent + viewer_cat->getName() + LLTrans::getString("Marketplace Validation Warning Delete"); + cb(message,depth,LLError::LEVEL_WARN); + } + gInventory.removeCategory(cat->getUUID()); + gInventory.notifyObservers(); + return result && !has_bad_items; + } + else + { + // Update the current folder + update_marketplace_category(cat->getUUID()); + gInventory.notifyObservers(); + } + } + + // Recursion : Perform the same validation on each nested folder + gInventory.getDirectDescendentsOf(cat->getUUID(),cat_array,item_array); + LLInventoryModel::cat_array_t cat_array_copy = *cat_array; + // Sort the folders in alphabetical order first + std::sort(cat_array_copy.begin(), cat_array_copy.end(), sort_alpha); + + for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) + { + LLInventoryCategory* category = *iter; + result &= validate_marketplacelistings(category, cb, fix_hierarchy, depth + 1); + } + + return result && !has_bad_items; +} + +///---------------------------------------------------------------------------- /// LLInventoryCollectFunctor implementations ///---------------------------------------------------------------------------- @@ -1060,18 +2305,109 @@ void LLOpenFoldersWithSelection::doFolder(LLFolderViewFolder* folder) } } -void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root, const std::string& action) +// Callback for doToSelected if DAMA required... +void LLInventoryAction::callback_doToSelected(const LLSD& notification, const LLSD& response, class LLInventoryModel* model, class LLFolderView* root, const std::string& action) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES + { + doToSelected(model, root, action, FALSE); + } +} + +void LLInventoryAction::callback_copySelected(const LLSD& notification, const LLSD& response, class LLInventoryModel* model, class LLFolderView* root, const std::string& action) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // YES, Move no copy item(s) + { + doToSelected(model, root, "copy_or_move_to_marketplace_listings", FALSE); + } + else if (option == 1) // NO, Don't move no copy item(s) (leave them behind) + { + doToSelected(model, root, "copy_to_marketplace_listings", FALSE); + } +} + +void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root, const std::string& action, BOOL user_confirm) { + std::set<LLFolderViewItem*> selected_items = root->getSelectionList(); + + // Prompt the user and check for authorization for some marketplace active listing edits + if (user_confirm && (("delete" == action) || ("cut" == action) || ("rename" == action) || ("properties" == action) || ("task_properties" == action) || ("open" == action))) + { + std::set<LLFolderViewItem*>::iterator set_iter = selected_items.begin(); + LLFolderViewModelItemInventory * viewModel = NULL; + for (; set_iter != selected_items.end(); ++set_iter) + { + viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*set_iter)->getViewModelItem()); + if (viewModel && (depth_nesting_in_marketplace(viewModel->getUUID()) >= 0)) + { + break; + } + } + if (set_iter != selected_items.end()) + { + if ("open" == action) + { + if (get_can_item_be_worn(viewModel->getUUID())) + { + // Wearing an object from any listing, active or not, is verbotten + LLNotificationsUtil::add("AlertMerchantListingCannotWear"); + return; + } + // Note: we do not prompt for change when opening items (e.g. textures or note cards) on the marketplace... + } + else if (LLMarketplaceData::instance().isInActiveFolder(viewModel->getUUID()) || + LLMarketplaceData::instance().isListedAndActive(viewModel->getUUID())) + { + // If item is in active listing, further confirmation is required + if ((("cut" == action) || ("delete" == action)) && (LLMarketplaceData::instance().isListed(viewModel->getUUID()) || LLMarketplaceData::instance().isVersionFolder(viewModel->getUUID()))) + { + // Cut or delete of the active version folder or listing folder itself will unlist the listing so ask that question specifically + LLNotificationsUtil::add("ConfirmMerchantUnlist", LLSD(), LLSD(), boost::bind(&LLInventoryAction::callback_doToSelected, _1, _2, model, root, action)); + return; + } + // Any other case will simply modify but not unlist a listing + LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLInventoryAction::callback_doToSelected, _1, _2, model, root, action)); + return; + } + // Cutting or deleting a whole listing needs confirmation as SLM will be archived and inaccessible to the user + else if (LLMarketplaceData::instance().isListed(viewModel->getUUID()) && (("cut" == action) || ("delete" == action))) + { + LLNotificationsUtil::add("ConfirmListingCutOrDelete", LLSD(), LLSD(), boost::bind(&LLInventoryAction::callback_doToSelected, _1, _2, model, root, action)); + return; + } + } + } + // Copying to the marketplace needs confirmation if nocopy items are involved + if (user_confirm && ("copy_to_marketplace_listings" == action)) + { + std::set<LLFolderViewItem*>::iterator set_iter = selected_items.begin(); + LLFolderViewModelItemInventory * viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*set_iter)->getViewModelItem()); + if (contains_nocopy_items(viewModel->getUUID())) + { + LLNotificationsUtil::add("ConfirmCopyToMarketplace", LLSD(), LLSD(), boost::bind(&LLInventoryAction::callback_copySelected, _1, _2, model, root, action)); + return; + } + } + + // Keep track of the marketplace folders that will need update of their status/name after the operation is performed + buildMarketplaceFolders(root); + if ("rename" == action) { root->startRenamingSelectedItem(); + // Update the marketplace listings that have been affected by the operation + updateMarketplaceFolders(); return; } + if ("delete" == action) { LLSD args; args["QUESTION"] = LLTrans::getString(root->getSelectedCount() > 1 ? "DeleteItems" : "DeleteItem"); LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLInventoryAction::onItemsRemovalConfirmation, _1, _2, root)); + // Note: marketplace listings will be updated in the callback if delete confirmed return; } if (("copy" == action) || ("cut" == action)) @@ -1089,12 +2425,12 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root LLViewerInventoryCategory *cat = model->getCategory(inventory_item->getUUID()); if (!cat) return; cat->changeType(new_folder_type); + // Update the marketplace listings that have been affected by the operation + updateMarketplaceFolders(); return; } - std::set<LLFolderViewItem*> selected_items = root->getSelectionList(); - LLMultiPreview* multi_previewp = NULL; LLMultiProperties* multi_propertiesp = NULL; @@ -1125,6 +2461,9 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root bridge->performAction(model, action); } + // Update the marketplace listings that have been affected by the operation + updateMarketplaceFolders(); + LLFloater::setFloaterHost(NULL); if (multi_previewp) { @@ -1168,5 +2507,47 @@ void LLInventoryAction::onItemsRemovalConfirmation( const LLSD& notification, co //because once removed from root folder view the item is no longer a selected item removeItemFromDND(root); root->removeSelectedItems(); + + // Update the marketplace listings that have been affected by the operation + updateMarketplaceFolders(); } } + +void LLInventoryAction::buildMarketplaceFolders(LLFolderView* root) +{ + // Make a list of all marketplace folders containing the elements in the selected list + // as well as the elements themselves. + // Once those elements are updated (cut, delete in particular but potentially any action), their + // containing folder will need to be updated as well as their initially containing folder. For + // instance, moving a stock folder from a listed folder to another will require an update of the + // target listing *and* the original listing. So we need to keep track of both. + sMarketplaceFolders.clear(); + const LLUUID &marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + std::set<LLFolderViewItem*> selected_items = root->getSelectionList(); + std::set<LLFolderViewItem*>::iterator set_iter = selected_items.begin(); + LLFolderViewModelItemInventory * viewModel = NULL; + for (; set_iter != selected_items.end(); ++set_iter) + { + viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*set_iter)->getViewModelItem()); + if (viewModel && gInventory.isObjectDescendentOf(viewModel->getInventoryObject()->getParentUUID(), marketplacelistings_id)) + { + sMarketplaceFolders.push_back(viewModel->getInventoryObject()->getParentUUID()); + sMarketplaceFolders.push_back(viewModel->getInventoryObject()->getUUID()); + } + } + // Suppress dupes in the list so we won't update listings twice + sMarketplaceFolders.sort(); + sMarketplaceFolders.unique(); +} + +void LLInventoryAction::updateMarketplaceFolders() +{ + while (!sMarketplaceFolders.empty()) + { + update_marketplace_category(sMarketplaceFolders.back()); + sMarketplaceFolders.pop_back(); + } +} + + + diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 6b3861aa79..86124e1dad 100755 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -58,18 +58,33 @@ void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id); void show_item_original(const LLUUID& item_uuid); void reset_inventory_filter(); +// Nudge the listing categories in the inventory to signal that their marketplace status changed +void update_marketplace_category(const LLUUID& cat_id, bool perform_consistency_enforcement = true); +// Nudge all listing categories to signal that their marketplace status changed +void update_all_marketplace_count(); + void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name); -void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id, const LLUUID& root_copy_id = LLUUID::null); +void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id, const LLUUID& root_copy_id = LLUUID::null, bool move_no_copy_items = false); // Generates a string containing the path to the item specified by item_id. void append_path(const LLUUID& id, std::string& path); void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder, S32 operation_id); void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, S32 operation_id); - void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder, S32 operation_id); +typedef boost::function<void(std::string& validation_message, S32 depth, LLError::ELevel log_level)> validation_callback_t; + +bool can_move_item_to_marketplace(const LLInventoryCategory* root_folder, LLInventoryCategory* dest_folder, LLInventoryItem* inv_item, std::string& tooltip_msg, S32 bundle_size = 1, bool from_paste = false); +bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLInventoryCategory* dest_folder, LLInventoryCategory* inv_cat, std::string& tooltip_msg, S32 bundle_size = 1, bool check_items = true, bool from_paste = false); +bool move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_folder, bool copy = false); +bool move_folder_to_marketplacelistings(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, bool copy = false, bool move_no_copy_items = false); +bool validate_marketplacelistings(LLInventoryCategory* inv_cat, validation_callback_t cb = NULL, bool fix_hierarchy = true, S32 depth = -1); +S32 depth_nesting_in_marketplace(LLUUID cur_uuid); +LLUUID nested_parent_id(LLUUID cur_uuid, S32 depth); +S32 compute_stock_count(LLUUID cat_uuid); + /** Miscellaneous global functions ** ** *******************************************************************************/ @@ -437,10 +452,17 @@ public: struct LLInventoryAction { - static void doToSelected(class LLInventoryModel* model, class LLFolderView* root, const std::string& action); + static void doToSelected(class LLInventoryModel* model, class LLFolderView* root, const std::string& action, BOOL user_confirm = TRUE); + static void callback_doToSelected(const LLSD& notification, const LLSD& response, class LLInventoryModel* model, class LLFolderView* root, const std::string& action); + static void callback_copySelected(const LLSD& notification, const LLSD& response, class LLInventoryModel* model, class LLFolderView* root, const std::string& action); static void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLFolderView* root); static void removeItemFromDND(LLFolderView* root); + +private: + static void buildMarketplaceFolders(LLFolderView* root); + static void updateMarketplaceFolders(); + static std::list<LLUUID> sMarketplaceFolders; // Marketplace folders that will need update once the action is completed }; diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index f92332dea5..1cfa0a9ebf 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1023,7 +1023,7 @@ LLInventoryModel::item_array_t* LLInventoryModel::getUnlockedItemArray(const LLU // an existing item with the matching id, or it will add the category. void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat, U32 mask) { - if(cat->getUUID().isNull()) + if(!cat || cat->getUUID().isNull()) { return; } @@ -1037,7 +1037,8 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat, U32 LLPointer<LLViewerInventoryCategory> old_cat = getCategory(cat->getUUID()); if(old_cat) { - // We already have an old category, modify it's values + // We already have an old category, modify its values + U32 mask = LLInventoryObserver::NONE; LLUUID old_parent_id = old_cat->getParentUUID(); LLUUID new_parent_id = cat->getParentUUID(); if(old_parent_id != new_parent_id) @@ -1061,7 +1062,13 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat, U32 { mask |= LLInventoryObserver::LABEL; } - old_cat->copyViewerCategory(cat); + // Under marketplace, category labels are quite complex and need extra upate + const LLUUID marketplace_id = findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + if (marketplace_id.notNull() && isObjectDescendentOf(cat->getUUID(), marketplace_id)) + { + mask |= LLInventoryObserver::LABEL; + } + old_cat->copyViewerCategory(cat); addChangedMask(mask, cat->getUUID()); } else @@ -1411,6 +1418,11 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, boo LLPointer<LLViewerInventoryCategory> cat = (LLViewerInventoryCategory*)((LLInventoryObject*)obj); vector_replace_with_last(*cat_list, cat); } + + // Note : We need to tell the inventory observers that those things are going to be deleted *before* the tree is cleared or they won't know what to delete (in views and view models) + addChangedMask(LLInventoryObserver::REMOVE, id); + gInventory.notifyObservers(); + item_list = getUnlockedItemArray(id); if(item_list) { @@ -1558,10 +1570,11 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent) } } - mModifyMask |= mask; - if (referent.notNull()) + mModifyMask |= mask; + if (referent.notNull() && (mChangedItemIDs.find(referent) == mChangedItemIDs.end())) { mChangedItemIDs.insert(referent); + update_marketplace_category(referent, false); if (mask & LLInventoryObserver::ADD) { diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 3546317471..19aa1bf6e7 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -191,6 +191,7 @@ LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) p.show_empty_message = mShowEmptyMessage; p.show_item_link_overlays = mShowItemLinkOverlays; p.root = NULL; + p.allow_drop = mParams.allow_drop_on_root; p.options_menu = "menu_inventory.xml"; return LLUICtrlFactory::create<LLFolderView>(p); @@ -290,7 +291,12 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_OUTBOX)); } - + // hide marketplace listing box, unless we are a marketplace panel + if (!gSavedSettings.getBOOL("InventoryOutboxMakeVisible") && !mParams.use_marketplace_folders) + { + getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_MARKETPLACE_LISTINGS)); + } + // set the filter for the empty folder if the debug setting is on if (gSavedSettings.getBOOL("DebugHideEmptySystemFolders")) { @@ -599,13 +605,13 @@ void LLInventoryPanel::modelChanged(U32 mask) LLUUID LLInventoryPanel::getRootFolderID() { + LLUUID root_id; if (mFolderRoot.get() && mFolderRoot.get()->getViewModelItem()) { - return static_cast<LLFolderViewModelItemInventory*>(mFolderRoot.get()->getViewModelItem())->getUUID(); + root_id = static_cast<LLFolderViewModelItemInventory*>(mFolderRoot.get()->getViewModelItem())->getUUID(); } else { - LLUUID root_id; if (mParams.start_folder.id.isChosen()) { root_id = mParams.start_folder.id; @@ -633,8 +639,8 @@ LLUUID LLInventoryPanel::getRootFolderID() } } } - return root_id; } + return root_id; } // static @@ -756,7 +762,7 @@ void LLInventoryPanel::initializeViews() } -LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) +LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop) { LLFolderViewFolder::Params params(mParams.folder); @@ -764,6 +770,7 @@ LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * br params.root = mFolderRoot.get(); params.listener = bridge; params.tool_tip = params.name; + params.allow_drop = allow_drop; params.font_color = (bridge->isLibraryItem() ? sLibraryColor : (bridge->isLink() ? sLinkColor : sDefaultColor)); params.font_highlight_color = (bridge->isLibraryItem() ? sLibraryColor : (bridge->isLink() ? sLinkColor : sDefaultHighlightColor)); @@ -792,37 +799,56 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) { LLInventoryObject const* objectp = gInventory.getObject(id); - if (!objectp) return NULL; + if (!objectp) + { + return NULL; + } LLFolderViewItem* folder_view_item = getItemByID(id); - const LLUUID &parent_id = objectp->getParentUUID(); + const LLUUID &parent_id = objectp->getParentUUID(); LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)getItemByID(parent_id); + // Force the creation of an extra root level folder item if required by the inventory panel (default is "false") + bool allow_drop = true; + bool create_root = false; + if (mParams.show_root_folder) + { + LLUUID root_id = getRootFolderID(); + if (root_id == id) + { + // We insert an extra level that's seen by the UI but has no influence on the model + parent_folder = dynamic_cast<LLFolderViewFolder*>(folder_view_item); + folder_view_item = NULL; + allow_drop = mParams.allow_drop_on_root; + create_root = true; + } + } + if (!folder_view_item && parent_folder) { if (objectp->getType() <= LLAssetType::AT_NONE || objectp->getType() >= LLAssetType::AT_COUNT) { LL_WARNS() << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " - << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() - << LL_ENDL; + << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() + << LL_ENDL; return NULL; } if ((objectp->getType() == LLAssetType::AT_CATEGORY) && (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) { - LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), - objectp->getType(), + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + (mParams.use_marketplace_folders ? LLAssetType::AT_MARKETPLACE_FOLDER : LLAssetType::AT_CATEGORY), LLInventoryType::IT_CATEGORY, this, - &mInventoryViewModel, + &mInventoryViewModel, mFolderRoot.get(), objectp->getUUID()); if (new_listener) { - folder_view_item = createFolderViewFolder(new_listener); + folder_view_item = createFolderViewFolder(new_listener,allow_drop); } } else @@ -845,11 +871,16 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) } if (folder_view_item) - { + { llassert(parent_folder != NULL); folder_view_item->addToFolder(parent_folder); addItemID(id, folder_view_item); - } + // In the case of the root folder been shown, open that folder by default once the widget is created + if (create_root) + { + folder_view_item->setOpen(TRUE); + } + } } // If this is a folder, add the children of the folder and recursively add any @@ -958,7 +989,7 @@ BOOL LLInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, // If folder view is empty the (x, y) point won't be in its rect // so the handler must be called explicitly. // but only if was not handled before. See EXT-6746. - if (!handled && !mFolderRoot.get()->hasVisibleChildren()) + if (!handled && mParams.allow_drop_on_root && !mFolderRoot.get()->hasVisibleChildren()) { handled = mFolderRoot.get()->handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } @@ -1523,5 +1554,8 @@ namespace LLInitParam declare(LLFolderType::lookup(LLFolderType::FT_INBOX) , LLFolderType::FT_INBOX); declare(LLFolderType::lookup(LLFolderType::FT_OUTBOX) , LLFolderType::FT_OUTBOX); declare(LLFolderType::lookup(LLFolderType::FT_BASIC_ROOT) , LLFolderType::FT_BASIC_ROOT); + declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_LISTINGS) , LLFolderType::FT_MARKETPLACE_LISTINGS); + declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_STOCK), LLFolderType::FT_MARKETPLACE_STOCK); + declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_VERSION), LLFolderType::FT_MARKETPLACE_VERSION); } } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index a490dfce5d..5edb244af6 100755 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -96,6 +96,9 @@ public: Optional<StartFolder> start_folder; Optional<bool> use_label_suffix; Optional<bool> show_empty_message; + Optional<bool> show_root_folder; + Optional<bool> allow_drop_on_root; + Optional<bool> use_marketplace_folders; Optional<LLScrollContainer::Params> scroll; Optional<bool> accepts_drag_and_drop; Optional<LLFolderView::Params> folder_view; @@ -110,7 +113,10 @@ public: filter("filter"), start_folder("start_folder"), use_label_suffix("use_label_suffix", true), - show_empty_message("show_empty_message", true), + show_empty_message("show_empty_message", true), + show_root_folder("show_root_folder", false), + allow_drop_on_root("allow_drop_on_root", true), + use_marketplace_folders("use_marketplace_folders", false), scroll("scroll"), accepts_drag_and_drop("accepts_drag_and_drop"), folder_view("folder_view"), @@ -184,6 +190,7 @@ public: LLFolderView* getRootFolder() { return mFolderRoot.get(); } LLUUID getRootFolderID(); LLScrollContainer* getScrollableContainer() { return mScroller; } + bool getAllowDropOnRoot() { return mParams.allow_drop_on_root; } void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); @@ -291,7 +298,7 @@ protected: BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; virtual LLFolderView * createFolderRoot(LLUUID root_id ); - virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge); + virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop); virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge); private: bool mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild() diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index f893daaeb2..9c00243f44 100755 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -74,9 +74,9 @@ public: if (!landmark->getGlobalPos(landmark_global_pos)) return false; //we have to round off each coordinates to compare positions properly - return llround(mPos.mdV[VX]) == llround(landmark_global_pos.mdV[VX]) - && llround(mPos.mdV[VY]) == llround(landmark_global_pos.mdV[VY]) - && llround(mPos.mdV[VZ]) == llround(landmark_global_pos.mdV[VZ]); + return ll_round(mPos.mdV[VX]) == ll_round(landmark_global_pos.mdV[VX]) + && ll_round(mPos.mdV[VY]) == ll_round(landmark_global_pos.mdV[VY]) + && ll_round(mPos.mdV[VZ]) == ll_round(landmark_global_pos.mdV[VZ]); } }; @@ -320,7 +320,7 @@ void LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(const LLVector3d& gl { LLVector3 pos = sim_infop->getLocalPos(global_pos); std::string name = sim_infop->getName() ; - cb(name, llround(pos.mV[VX]), llround(pos.mV[VY]),llround(pos.mV[VZ])); + cb(name, ll_round(pos.mV[VX]), ll_round(pos.mV[VY]),ll_round(pos.mV[VZ])); } else { @@ -364,7 +364,7 @@ void LLLandmarkActions::onRegionResponseNameAndCoords(region_name_and_coords_cal { LLVector3 local_pos = sim_infop->getLocalPos(global_pos); std::string name = sim_infop->getName() ; - cb(name, llround(local_pos.mV[VX]), llround(local_pos.mV[VY]), llround(local_pos.mV[VZ])); + cb(name, ll_round(local_pos.mV[VX]), ll_round(local_pos.mV[VY]), ll_round(local_pos.mV[VZ])); } } diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 897ee8429a..2c2e66e08f 100755 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -74,7 +74,6 @@ bool LLLocalBitmapMgr::sNeedsRebake; static const F32 LL_LOCAL_TIMER_HEARTBEAT = 3.0; static const BOOL LL_LOCAL_USE_MIPMAPS = true; static const S32 LL_LOCAL_DISCARD_LEVEL = 0; -static const U32 LL_LOCAL_TEXLAYER_FOR_IDX = 0; static const bool LL_LOCAL_SLAM_FOR_DEBUG = true; static const bool LL_LOCAL_REPLACE_ON_DEL = true; static const S32 LL_LOCAL_UPDATE_RETRIES = 5; diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index df59283bc4..b4d0bb6823 100755 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -58,7 +58,6 @@ #include "llmachineid.h" #include "llupdaterservice.h" #include "llevents.h" -#include "llnotificationsutil.h" #include "llappviewer.h" #include <boost/scoped_ptr.hpp> @@ -75,9 +74,14 @@ namespace { { public: MandatoryUpdateMachine(LLLoginInstance & loginInstance, LLUpdaterService & updaterService); - + void start(void); - + + LLNotificationsInterface& getNotificationsInterface() const + { + return mLoginInstance.getNotificationsInterface(); + } + private: class State; class CheckingForUpdate; @@ -85,9 +89,9 @@ namespace { class ReadyToInstall; class StartingUpdaterService; class WaitingForDownload; - - LLLoginInstance & mLoginInstance; + boost::scoped_ptr<State> mState; + LLLoginInstance & mLoginInstance; LLUpdaterService & mUpdaterService; void setCurrentState(State * newState); @@ -145,7 +149,7 @@ namespace { virtual void exit(void); private: - MandatoryUpdateMachine & mMachine; + //MandatoryUpdateMachine & mMachine; }; @@ -328,7 +332,7 @@ MandatoryUpdateMachine::Error::Error(MandatoryUpdateMachine & machine): void MandatoryUpdateMachine::Error::enter(void) { LL_INFOS() << "entering error" << LL_ENDL; - LLNotificationsUtil::add("FailedRequiredUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2)); + mMachine.getNotificationsInterface().add("FailedRequiredUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2)); } @@ -349,8 +353,8 @@ void MandatoryUpdateMachine::Error::onButtonClicked(const LLSD &, const LLSD &) //----------------------------------------------------------------------------- -MandatoryUpdateMachine::ReadyToInstall::ReadyToInstall(MandatoryUpdateMachine & machine): - mMachine(machine) +MandatoryUpdateMachine::ReadyToInstall::ReadyToInstall(MandatoryUpdateMachine & machine) //: + //mMachine(machine) { ; // No op. } @@ -384,7 +388,7 @@ MandatoryUpdateMachine::StartingUpdaterService::StartingUpdaterService(Mandatory void MandatoryUpdateMachine::StartingUpdaterService::enter(void) { LL_INFOS() << "entering start update service" << LL_ENDL; - LLNotificationsUtil::add("UpdaterServiceNotRunning", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked, this, _1, _2)); + mMachine.getNotificationsInterface().add("UpdaterServiceNotRunning", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked, this, _1, _2)); } diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index b0247da7c8..c6773bbf68 100755 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -70,6 +70,7 @@ public: void setPlatformInfo(const std::string platform, const std::string platform_version); void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; } + LLNotificationsInterface& getNotificationsInterface() const { return *mNotifications; } typedef boost::function<void()> UpdaterLauncherCallback; void setUpdaterLauncher(const UpdaterLauncherCallback& ulc) { mUpdaterLauncher = ulc; } diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 0935691ebc..8567180dd6 100755 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -521,8 +521,8 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string std::string val_string; std::string fraction_string; - F32 val_to_print = llround(value, 0.001f); - S32 fractional_portion = llround(fmodf(llabs(val_to_print), 1.f) * 100.f); + F32 val_to_print = ll_round(value, 0.001f); + S32 fractional_portion = ll_round(fmodf(llabs(val_to_print), 1.f) * 100.f); if (val_to_print < 0.f) { if (fractional_portion == 0) diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index b2350e5a75..f172aa0955 100755 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -368,9 +368,9 @@ void LLManipRotate::render() LLQuaternion object_rot = first_object->getRotationEdit(); object_rot.getEulerAngles(&(euler_angles.mV[VX]), &(euler_angles.mV[VY]), &(euler_angles.mV[VZ])); euler_angles *= RAD_TO_DEG; - euler_angles.mV[VX] = llround(fmodf(euler_angles.mV[VX] + 360.f, 360.f), 0.05f); - euler_angles.mV[VY] = llround(fmodf(euler_angles.mV[VY] + 360.f, 360.f), 0.05f); - euler_angles.mV[VZ] = llround(fmodf(euler_angles.mV[VZ] + 360.f, 360.f), 0.05f); + euler_angles.mV[VX] = ll_round(fmodf(euler_angles.mV[VX] + 360.f, 360.f), 0.05f); + euler_angles.mV[VY] = ll_round(fmodf(euler_angles.mV[VY] + 360.f, 360.f), 0.05f); + euler_angles.mV[VZ] = ll_round(fmodf(euler_angles.mV[VZ] + 360.f, 360.f), 0.05f); renderXYZ(euler_angles); } @@ -1524,7 +1524,6 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f); F32 relative_mouse_angle = fmodf(mouse_angle + (SNAP_ANGLE_DETENTE / 2), SNAP_ANGLE_INCREMENT); - //fmodf(llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f); LLVector3 object_axis; getObjectAxisClosestToMouse(object_axis); @@ -1608,7 +1607,6 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f); F32 relative_mouse_angle = fmodf(mouse_angle + (SNAP_ANGLE_DETENTE / 2), SNAP_ANGLE_INCREMENT); - //fmodf(llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f); LLVector3 object_axis; getObjectAxisClosestToMouse(object_axis); diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 52222c3727..407613d32c 100755 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -228,8 +228,6 @@ void LLManipScale::render() const F32 BOX_HANDLE_BASE_SIZE = 50.0f; // box size in pixels = BOX_HANDLE_BASE_SIZE * BOX_HANDLE_BASE_FACTOR const F32 BOX_HANDLE_BASE_FACTOR = 0.2f; - LLVector3 center_agent = gAgent.getPosAgentFromGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal()); - if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { for (S32 i = 0; i < NUM_MANIPULATORS; i++) @@ -1536,8 +1534,8 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) mScaleSnapUnit1 = mScaleSnapUnit1 / (mSnapDir1 * mScaleDir); mScaleSnapUnit2 = mScaleSnapUnit2 / (mSnapDir2 * mScaleDir); - mTickPixelSpacing1 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length()); - mTickPixelSpacing2 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length()); + mTickPixelSpacing1 = ll_round((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length()); + mTickPixelSpacing2 = ll_round((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length()); if (uniform) { @@ -1608,8 +1606,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) F32 grid_offset2 = fmodf(dist_grid_axis, smallest_subdivision2); // how many smallest grid units are we away from largest grid scale? - S32 sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / smallest_subdivision1); - S32 sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / smallest_subdivision2); + S32 sub_div_offset_1 = ll_round(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / smallest_subdivision1); + S32 sub_div_offset_2 = ll_round(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / smallest_subdivision2); S32 num_ticks_per_side1 = llmax(1, lltrunc(0.5f * mSnapGuideLength / smallest_subdivision1)); S32 num_ticks_per_side2 = llmax(1, lltrunc(0.5f * mSnapGuideLength / smallest_subdivision2)); @@ -1663,7 +1661,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) LLVector2 screen_translate_axis(llabs(mScaleDir * LLViewerCamera::getInstance()->getLeftAxis()), llabs(mScaleDir * LLViewerCamera::getInstance()->getUpAxis())); screen_translate_axis.normalize(); - S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing); + S32 tick_label_spacing = ll_round(screen_translate_axis * sTickLabelSpacing); for (pass = 0; pass < 3; pass++) { @@ -1743,8 +1741,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) stop_tick = llmin(max_ticks1, num_ticks_per_side1); F32 grid_resolution = mObjectSelection->getSelectType() == SELECT_TYPE_HUD ? 0.25f : llmax(gSavedSettings.getF32("GridResolution"), 0.001f); - S32 label_sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / smallest_subdivision1); - S32 label_sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / smallest_subdivision2); + S32 label_sub_div_offset_1 = ll_round(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / smallest_subdivision1); + S32 label_sub_div_offset_2 = ll_round(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / smallest_subdivision2); for (S32 i = start_tick; i <= stop_tick; i++) { diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index d22672bc16..394db71fb9 100755 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -65,7 +65,6 @@ const S32 NUM_AXES = 3; const S32 MOUSE_DRAG_SLOP = 2; // pixels -const F32 HANDLE_HIDE_ANGLE = 0.15f; // radians const F32 SELECTED_ARROW_SCALE = 1.3f; const F32 MANIPULATOR_HOTSPOT_START = 0.2f; const F32 MANIPULATOR_HOTSPOT_END = 1.2f; @@ -1246,7 +1245,7 @@ void LLManipTranslate::renderSnapGuides() // find distance to nearest smallest grid unit F32 offset_nearest_grid_unit = fmodf(dist_grid_axis, smallest_grid_unit_scale); // how many smallest grid units are we away from largest grid scale? - S32 sub_div_offset = llround(fmodf(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale); + S32 sub_div_offset = ll_round(fmodf(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale); S32 num_ticks_per_side = llmax(1, llfloor(0.5f * guide_size_meters / smallest_grid_unit_scale)); LLGLDepthTest gls_depth(GL_FALSE); @@ -1361,12 +1360,12 @@ void LLManipTranslate::renderSnapGuides() } } - sub_div_offset = llround(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale); + sub_div_offset = ll_round(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale); LLVector2 screen_translate_axis(llabs(translate_axis * LLViewerCamera::getInstance()->getLeftAxis()), llabs(translate_axis * LLViewerCamera::getInstance()->getUpAxis())); screen_translate_axis.normVec(); - S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing); + S32 tick_label_spacing = ll_round(screen_translate_axis * sTickLabelSpacing); // render tickmark values for (S32 i = -num_ticks_per_side; i <= num_ticks_per_side; i++) @@ -1404,7 +1403,7 @@ void LLManipTranslate::renderSnapGuides() F32 offset_val = 0.5f * tick_offset.mV[ARROW_TO_AXIS[mManipPart]] / getMinGridScale(); EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode(); F32 text_highlight = 0.8f; - if(i - llround(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime) + if(i - ll_round(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime) { text_highlight = 1.f; } diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 4a7a4e268d..ab3be79a2e 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -29,14 +29,22 @@ #include "llmarketplacefunctions.h" #include "llagent.h" +#include "llbufferstream.h" #include "llhttpclient.h" +#include "llinventoryfunctions.h" +#include "llinventoryobserver.h" +#include "llnotificationsutil.h" #include "llsdserialize.h" #include "lltimer.h" #include "lltrans.h" #include "llviewercontrol.h" +#include "llviewerinventory.h" #include "llviewermedia.h" #include "llviewernetwork.h" +#include "llviewerregion.h" +#include "reader.h" // JSON +#include "writer.h" // JSON // // Helpers @@ -93,6 +101,539 @@ LLSD getMarketplaceStringSubstitutions() return marketplace_sub_map; } +// Get the version folder: if there is only one subfolder, we will use it as a version folder +LLUUID getVersionFolderIfUnique(const LLUUID& folder_id) +{ + LLUUID version_id = LLUUID::null; + LLInventoryModel::cat_array_t* categories; + LLInventoryModel::item_array_t* items; + gInventory.getDirectDescendentsOf(folder_id, categories, items); + if (categories->size() == 1) + { + version_id = categories->begin()->get()->getUUID(); + } + else + { + LLNotificationsUtil::add("AlertMerchantListingActivateRequired"); + } + return version_id; +} + +/////////////////////////////////////////////////////////////////////////////// +// SLM Responders +void log_SLM_warning(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description) +{ + LL_WARNS("SLM") << "SLM API : Responder to " << request << ". status : " << status << ", reason : " << reason << ", code : " << code << ", description : " << description << LL_ENDL; + if (status == 422) + { + // Unprocessable Entity : Special case that error as it is a frequent answer when trying to list an incomplete listing + LLNotificationsUtil::add("MerchantUnprocessableEntity"); + } + else + { + // Prompt the user with the warning (so they know why things are failing) + LLSD subs; + subs["[ERROR_REASON]"] = reason; + // We do show long descriptions in the alert (unlikely to be readable). The description string will be in the log though. + subs["[ERROR_DESCRIPTION]"] = (description.length() <= 512 ? description : ""); + LLNotificationsUtil::add("MerchantTransactionFailed", subs); + } +} +void log_SLM_infos(const std::string& request, U32 status, const std::string& body) +{ + if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) + { + LL_INFOS("SLM") << "SLM API : Responder to " << request << ". status : " << status << ", body or description : " << body << LL_ENDL; + } +} +void log_SLM_infos(const std::string& request, const std::string& url, const std::string& body) +{ + if (gSavedSettings.getBOOL("MarketplaceListingsLogging")) + { + LL_INFOS("SLM") << "SLM API : Sending " << request << ". url : " << url << ", body : " << body << LL_ENDL; + } +} + +class LLSLMGetMerchantResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLSLMGetMerchantResponder); +public: + + LLSLMGetMerchantResponder() {} + +protected: + virtual void httpFailure() + { + if (HTTP_NOT_FOUND == getStatus()) + { + log_SLM_infos("Get /merchant", getStatus(), "User is not a merchant"); + LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT); + } + else if (HTTP_SERVICE_UNAVAILABLE == getStatus()) + { + log_SLM_infos("Get /merchant", getStatus(), "Merchant is not migrated"); + LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_MIGRATED_MERCHANT); + } + else + { + log_SLM_warning("Get /merchant", getStatus(), getReason(), getContent().get("error_code"), getContent().get("error_description")); + LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE); + } + } + + virtual void httpSuccess() + { + log_SLM_infos("Get /merchant", getStatus(), "User is a merchant"); + LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_MERCHANT); + } + +}; + +class LLSLMGetListingsResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLSLMGetListingsResponder); +public: + + LLSLMGetListingsResponder(const LLUUID& folder_id) + { + mExpectedFolderId = folder_id; + } + + virtual void completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + LLMarketplaceData::instance().setUpdating(mExpectedFolderId,false); + + LLBufferStream istr(channels, buffer.get()); + std::stringstream strstrm; + strstrm << istr.rdbuf(); + const std::string body = strstrm.str(); + + if (!isGoodStatus()) + { + log_SLM_warning("Get /listings", getStatus(), getReason(), "", body); + LLMarketplaceData::instance().setSLMDataFetched(MarketplaceFetchCodes::MARKET_FETCH_FAILED); + update_marketplace_category(mExpectedFolderId, false); + gInventory.notifyObservers(); + return; + } + + Json::Value root; + Json::Reader reader; + if (!reader.parse(body,root)) + { + log_SLM_warning("Get /listings", getStatus(), "Json parsing failed", reader.getFormatedErrorMessages(), body); + LLMarketplaceData::instance().setSLMDataFetched(MarketplaceFetchCodes::MARKET_FETCH_FAILED); + update_marketplace_category(mExpectedFolderId, false); + gInventory.notifyObservers(); + return; + } + + log_SLM_infos("Get /listings", getStatus(), body); + + // Extract the info from the Json string + Json::ValueIterator it = root["listings"].begin(); + + while (it != root["listings"].end()) + { + Json::Value listing = *it; + + int listing_id = listing["id"].asInt(); + bool is_listed = listing["is_listed"].asBool(); + std::string edit_url = listing["edit_url"].asString(); + std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString(); + std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString(); + int count = listing["inventory_info"]["count_on_hand"].asInt(); + + LLUUID folder_id(folder_uuid_string); + LLUUID version_id(version_uuid_string); + if (folder_id.notNull()) + { + LLMarketplaceData::instance().addListing(folder_id,listing_id,version_id,is_listed,edit_url,count); + } + it++; + } + + // Update all folders under the root + LLMarketplaceData::instance().setSLMDataFetched(MarketplaceFetchCodes::MARKET_FETCH_DONE); + update_marketplace_category(mExpectedFolderId, false); + gInventory.notifyObservers(); + } +private: + LLUUID mExpectedFolderId; +}; + +class LLSLMCreateListingsResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLSLMCreateListingsResponder); +public: + + LLSLMCreateListingsResponder(const LLUUID& folder_id) + { + mExpectedFolderId = folder_id; + } + + virtual void completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + LLMarketplaceData::instance().setUpdating(mExpectedFolderId,false); + + LLBufferStream istr(channels, buffer.get()); + std::stringstream strstrm; + strstrm << istr.rdbuf(); + const std::string body = strstrm.str(); + + if (!isGoodStatus()) + { + log_SLM_warning("Post /listings", getStatus(), getReason(), "", body); + update_marketplace_category(mExpectedFolderId, false); + gInventory.notifyObservers(); + return; + } + + Json::Value root; + Json::Reader reader; + if (!reader.parse(body,root)) + { + log_SLM_warning("Post /listings", getStatus(), "Json parsing failed", reader.getFormatedErrorMessages(), body); + update_marketplace_category(mExpectedFolderId, false); + gInventory.notifyObservers(); + return; + } + + log_SLM_infos("Post /listings", getStatus(), body); + + // Extract the info from the Json string + Json::ValueIterator it = root["listings"].begin(); + + while (it != root["listings"].end()) + { + Json::Value listing = *it; + + int listing_id = listing["id"].asInt(); + bool is_listed = listing["is_listed"].asBool(); + std::string edit_url = listing["edit_url"].asString(); + std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString(); + std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString(); + int count = listing["inventory_info"]["count_on_hand"].asInt(); + + LLUUID folder_id(folder_uuid_string); + LLUUID version_id(version_uuid_string); + LLMarketplaceData::instance().addListing(folder_id,listing_id,version_id,is_listed,edit_url,count); + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); + it++; + } + } +private: + LLUUID mExpectedFolderId; +}; + +class LLSLMGetListingResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLSLMGetListingResponder); +public: + + LLSLMGetListingResponder(const LLUUID& folder_id) + { + mExpectedFolderId = folder_id; + } + + virtual void completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + LLMarketplaceData::instance().setUpdating(mExpectedFolderId,false); + + LLBufferStream istr(channels, buffer.get()); + std::stringstream strstrm; + strstrm << istr.rdbuf(); + const std::string body = strstrm.str(); + + if (!isGoodStatus()) + { + log_SLM_warning("Get /listing", getStatus(), getReason(), "", body); + update_marketplace_category(mExpectedFolderId, false); + gInventory.notifyObservers(); + return; + } + + Json::Value root; + Json::Reader reader; + if (!reader.parse(body,root)) + { + log_SLM_warning("Get /listing", getStatus(), "Json parsing failed", reader.getFormatedErrorMessages(), body); + update_marketplace_category(mExpectedFolderId, false); + gInventory.notifyObservers(); + return; + } + + log_SLM_infos("Get /listing", getStatus(), body); + + // Extract the info from the Json string + Json::ValueIterator it = root["listings"].begin(); + + while (it != root["listings"].end()) + { + Json::Value listing = *it; + + int listing_id = listing["id"].asInt(); + bool is_listed = listing["is_listed"].asBool(); + std::string edit_url = listing["edit_url"].asString(); + std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString(); + std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString(); + int count = listing["inventory_info"]["count_on_hand"].asInt(); + + LLUUID folder_id(folder_uuid_string); + LLUUID version_id(version_uuid_string); + + // Update that listing + LLMarketplaceData::instance().setListingID(folder_id, listing_id, false); + LLMarketplaceData::instance().setVersionFolderID(folder_id, version_id, false); + LLMarketplaceData::instance().setActivationState(folder_id, is_listed, false); + LLMarketplaceData::instance().setListingURL(folder_id, edit_url, false); + LLMarketplaceData::instance().setCountOnHand(folder_id,count,false); + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); + + it++; + } + } +private: + LLUUID mExpectedFolderId; +}; + +class LLSLMUpdateListingsResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLSLMUpdateListingsResponder); +public: + + LLSLMUpdateListingsResponder(const LLUUID& folder_id, bool expected_listed_state, const LLUUID& expected_version_id) + { + mExpectedFolderId = folder_id; + mExpectedListedState = expected_listed_state; + mExpectedVersionUUID = expected_version_id; + } + + virtual void completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + LLMarketplaceData::instance().setUpdating(mExpectedFolderId,false); + + LLBufferStream istr(channels, buffer.get()); + std::stringstream strstrm; + strstrm << istr.rdbuf(); + const std::string body = strstrm.str(); + + if (!isGoodStatus()) + { + log_SLM_warning("Put /listing", getStatus(), getReason(), "", body); + update_marketplace_category(mExpectedFolderId, false); + gInventory.notifyObservers(); + return; + } + + Json::Value root; + Json::Reader reader; + if (!reader.parse(body,root)) + { + log_SLM_warning("Put /listing", getStatus(), "Json parsing failed", reader.getFormatedErrorMessages(), body); + update_marketplace_category(mExpectedFolderId, false); + gInventory.notifyObservers(); + return; + } + + log_SLM_infos("Put /listing", getStatus(), body); + + // Extract the info from the Json string + Json::ValueIterator it = root["listings"].begin(); + + while (it != root["listings"].end()) + { + Json::Value listing = *it; + + int listing_id = listing["id"].asInt(); + bool is_listed = listing["is_listed"].asBool(); + std::string edit_url = listing["edit_url"].asString(); + std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString(); + std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString(); + int count = listing["inventory_info"]["count_on_hand"].asInt(); + + LLUUID folder_id(folder_uuid_string); + LLUUID version_id(version_uuid_string); + + // Update that listing + LLMarketplaceData::instance().setListingID(folder_id, listing_id, false); + LLMarketplaceData::instance().setVersionFolderID(folder_id, version_id, false); + LLMarketplaceData::instance().setActivationState(folder_id, is_listed, false); + LLMarketplaceData::instance().setListingURL(folder_id, edit_url, false); + LLMarketplaceData::instance().setCountOnHand(folder_id,count,false); + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); + + // Show a notification alert if what we got is not what we expected + // (this actually doesn't result in an error status from the SLM API protocol) + if ((mExpectedListedState != is_listed) || (mExpectedVersionUUID != version_id)) + { + LLSD subs; + subs["[URL]"] = edit_url; + LLNotificationsUtil::add("AlertMerchantListingNotUpdated", subs); + } + + it++; + } + } +private: + LLUUID mExpectedFolderId; + bool mExpectedListedState; + LLUUID mExpectedVersionUUID; +}; + +class LLSLMAssociateListingsResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLSLMAssociateListingsResponder); +public: + + LLSLMAssociateListingsResponder(const LLUUID& folder_id, const LLUUID& source_folder_id) + { + mExpectedFolderId = folder_id; + mSourceFolderId = source_folder_id; + } + + virtual void completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + LLMarketplaceData::instance().setUpdating(mExpectedFolderId,false); + LLMarketplaceData::instance().setUpdating(mSourceFolderId,false); + + LLBufferStream istr(channels, buffer.get()); + std::stringstream strstrm; + strstrm << istr.rdbuf(); + const std::string body = strstrm.str(); + + if (!isGoodStatus()) + { + log_SLM_warning("Put /associate_inventory", getStatus(), getReason(), "", body); + update_marketplace_category(mExpectedFolderId, false); + update_marketplace_category(mSourceFolderId, false); + gInventory.notifyObservers(); + return; + } + + Json::Value root; + Json::Reader reader; + if (!reader.parse(body,root)) + { + log_SLM_warning("Put /associate_inventory", getStatus(), "Json parsing failed", reader.getFormatedErrorMessages(), body); + update_marketplace_category(mExpectedFolderId, false); + update_marketplace_category(mSourceFolderId, false); + gInventory.notifyObservers(); + return; + } + + log_SLM_infos("Put /associate_inventory", getStatus(), body); + + // Extract the info from the Json string + Json::ValueIterator it = root["listings"].begin(); + + while (it != root["listings"].end()) + { + Json::Value listing = *it; + + int listing_id = listing["id"].asInt(); + bool is_listed = listing["is_listed"].asBool(); + std::string edit_url = listing["edit_url"].asString(); + std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString(); + std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString(); + int count = listing["inventory_info"]["count_on_hand"].asInt(); + + LLUUID folder_id(folder_uuid_string); + LLUUID version_id(version_uuid_string); + + // Check that the listing ID is not already associated to some other record + LLUUID old_listing = LLMarketplaceData::instance().getListingFolder(listing_id); + if (old_listing.notNull()) + { + // If it is already used, unlist the old record (we can't have 2 listings with the same listing ID) + LLMarketplaceData::instance().deleteListing(old_listing); + } + + // Add the new association + LLMarketplaceData::instance().addListing(folder_id,listing_id,version_id,is_listed,edit_url,count); + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); + + it++; + } + + // Always update the source folder so its widget updates + update_marketplace_category(mSourceFolderId, false); + } +private: + LLUUID mExpectedFolderId; // This is the folder now associated with the id. + LLUUID mSourceFolderId; // This is the folder initially associated with the id. Can be LLUUI::null +}; + +class LLSLMDeleteListingsResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLSLMDeleteListingsResponder); +public: + + LLSLMDeleteListingsResponder(const LLUUID& folder_id) + { + mExpectedFolderId = folder_id; + } + + virtual void completedRaw(const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + LLMarketplaceData::instance().setUpdating(mExpectedFolderId,false); + + LLBufferStream istr(channels, buffer.get()); + std::stringstream strstrm; + strstrm << istr.rdbuf(); + const std::string body = strstrm.str(); + + if (!isGoodStatus()) + { + log_SLM_warning("Delete /listing", getStatus(), getReason(), "", body); + update_marketplace_category(mExpectedFolderId, false); + gInventory.notifyObservers(); + return; + } + + Json::Value root; + Json::Reader reader; + if (!reader.parse(body,root)) + { + log_SLM_warning("Delete /listing", getStatus(), "Json parsing failed", reader.getFormatedErrorMessages(), body); + update_marketplace_category(mExpectedFolderId, false); + gInventory.notifyObservers(); + return; + } + + log_SLM_infos("Delete /listing", getStatus(), body); + + // Extract the info from the Json string + Json::ValueIterator it = root["listings"].begin(); + + while (it != root["listings"].end()) + { + Json::Value listing = *it; + + int listing_id = listing["id"].asInt(); + LLUUID folder_id = LLMarketplaceData::instance().getListingFolder(listing_id); + LLMarketplaceData::instance().deleteListing(folder_id); + + it++; + } + } +private: + LLUUID mExpectedFolderId; +}; + +// SLM Responders End +/////////////////////////////////////////////////////////////////////////////// + namespace LLMarketplaceImport { // Basic interface for this namespace @@ -156,7 +697,7 @@ namespace LLMarketplaceImport { if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { - LL_INFOS() << " SLM POST clearing marketplace cookie due to client or server error" << LL_ENDL; + LL_INFOS() << " SLM POST : Clearing marketplace cookie due to client or server error" << LL_ENDL; } sMarketplaceCookie.clear(); } @@ -236,7 +777,7 @@ namespace LLMarketplaceImport S32 getResultStatus() { - return sImportResultStatus; + return sImportResultStatus; } const LLSD& getResults() @@ -427,15 +968,15 @@ void LLMarketplaceInventoryImporter::initialize() return; } - if (!LLMarketplaceImport::hasSessionCookie()) - { - mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING; - LLMarketplaceImport::establishMarketplaceSessionCookie(); - } - else - { - mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_MERCHANT; - } + if (!LLMarketplaceImport::hasSessionCookie()) + { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING; + LLMarketplaceImport::establishMarketplaceSessionCookie(); + } + else + { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_MERCHANT; + } } void LLMarketplaceInventoryImporter::reinitializeAndTriggerImport() @@ -479,54 +1020,848 @@ void LLMarketplaceInventoryImporter::updateImport() // If we are no longer in progress if (!mImportInProgress) { - if (mInitialized) - { - // Report results - if (mStatusReportSignal) - { - (*mStatusReportSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults()); - } - } - else - { - // Look for results success - mInitialized = LLMarketplaceImport::hasSessionCookie(); - - if (mInitialized) - { - mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_MERCHANT; - // Follow up with auto trigger of import - if (mAutoTriggerImport) - { - mAutoTriggerImport = false; - mImportInProgress = triggerImport(); - } - } - else - { - U32 status = LLMarketplaceImport::getResultStatus(); - if ((status == MarketplaceErrorCodes::IMPORT_FORBIDDEN) || - (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR)) - { - mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT; - } - else - { - mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE; - } - if (mErrorInitSignal && (mMarketPlaceStatus == MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE)) - { - (*mErrorInitSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults()); - } - } - } - } + // Look for results success + mInitialized = LLMarketplaceImport::hasSessionCookie(); - // Make sure we trigger the status change with the final state (in case of auto trigger after initialize) - if (mStatusChangedSignal) - { - (*mStatusChangedSignal)(mImportInProgress); + // Report results + if (mStatusReportSignal) + { + (*mStatusReportSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults()); + } + + if (mInitialized) + { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_MERCHANT; + // Follow up with auto trigger of import + if (mAutoTriggerImport) + { + mAutoTriggerImport = false; + mImportInProgress = triggerImport(); + } + } + else + { + U32 status = LLMarketplaceImport::getResultStatus(); + if ((status == MarketplaceErrorCodes::IMPORT_FORBIDDEN) || + (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR)) + { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT; + } + else if (status == MarketplaceErrorCodes::IMPORT_SERVER_API_DISABLED) + { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_MIGRATED_MERCHANT; + } + else + { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE; + } + if (mErrorInitSignal && (mMarketPlaceStatus == MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE)) + { + (*mErrorInitSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults()); + } + } } } + + // Make sure we trigger the status change with the final state (in case of auto trigger after initialize) + if (mStatusChangedSignal) + { + (*mStatusChangedSignal)(mImportInProgress); + } +} + +// +// Direct Delivery : Marketplace tuples and data +// +class LLMarketplaceInventoryObserver : public LLInventoryObserver +{ +public: + LLMarketplaceInventoryObserver() {} + virtual ~LLMarketplaceInventoryObserver() {} + virtual void changed(U32 mask); +}; + +void LLMarketplaceInventoryObserver::changed(U32 mask) +{ + // When things are added to the marketplace, we might need to re-validate and fix the containing listings + if (mask & LLInventoryObserver::ADD) + { + const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); + + std::set<LLUUID>::const_iterator id_it = changed_items.begin(); + std::set<LLUUID>::const_iterator id_end = changed_items.end(); + // First, count the number of items in this list... + S32 count = 0; + for (;id_it != id_end; ++id_it) + { + LLInventoryObject* obj = gInventory.getObject(*id_it); + if (obj && (LLAssetType::AT_CATEGORY != obj->getType())) + { + count++; + } + } + // Then, decrement the folders of that amount + // Note that of all of those, only one folder will be a listing folder (if at all). + // The other will be ignored by the decrement method. + id_it = changed_items.begin(); + for (;id_it != id_end; ++id_it) + { + LLInventoryObject* obj = gInventory.getObject(*id_it); + if (obj && (LLAssetType::AT_CATEGORY == obj->getType())) + { + LLMarketplaceData::instance().decrementValidationWaiting(obj->getUUID(),count); + } + } + } + + // When things are changed in the inventory, this can trigger a host of changes in the marketplace listings folder: + // * stock counts changing : no copy items coming in and out will change the stock count on folders + // * version and listing folders : moving those might invalidate the marketplace data itself + // Since we should cannot raise inventory change while the observer is called (the list will be cleared + // once observers are called) we need to raise a flag in the inventory to signal that things have been dirtied. + + if (mask & (LLInventoryObserver::INTERNAL | LLInventoryObserver::STRUCTURE)) + { + const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); + + std::set<LLUUID>::const_iterator id_it = changed_items.begin(); + std::set<LLUUID>::const_iterator id_end = changed_items.end(); + for (;id_it != id_end; ++id_it) + { + LLInventoryObject* obj = gInventory.getObject(*id_it); + if (obj) + { + if (LLAssetType::AT_CATEGORY == obj->getType()) + { + // If it's a folder known to the marketplace, let's check it's in proper shape + if (LLMarketplaceData::instance().isListed(*id_it) || LLMarketplaceData::instance().isVersionFolder(*id_it)) + { + LLInventoryCategory* cat = (LLInventoryCategory*)(obj); + validate_marketplacelistings(cat); + } + } + else + { + // If it's not a category, it's an item... + LLInventoryItem* item = (LLInventoryItem*)(obj); + // If it's a no copy item, we may need to update the label count of marketplace listings + if (!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + LLMarketplaceData::instance().setDirtyCount(); + } + } + } + } + } +} + +// Tuple == Item +LLMarketplaceTuple::LLMarketplaceTuple() : + mListingFolderId(), + mListingId(0), + mVersionFolderId(), + mIsActive(false), + mEditURL("") +{ +} + +LLMarketplaceTuple::LLMarketplaceTuple(const LLUUID& folder_id) : + mListingFolderId(folder_id), + mListingId(0), + mVersionFolderId(), + mIsActive(false), + mEditURL("") +{ +} + +LLMarketplaceTuple::LLMarketplaceTuple(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed) : + mListingFolderId(folder_id), + mListingId(listing_id), + mVersionFolderId(version_id), + mIsActive(is_listed), + mEditURL("") +{ +} + + +// Data map +LLMarketplaceData::LLMarketplaceData() : + mMarketPlaceStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED), + mMarketPlaceDataFetched(MarketplaceFetchCodes::MARKET_FETCH_NOT_DONE), + mStatusUpdatedSignal(NULL), + mDataFetchedSignal(NULL), + mDirtyCount(false) +{ + mInventoryObserver = new LLMarketplaceInventoryObserver; + gInventory.addObserver(mInventoryObserver); +} + +LLMarketplaceData::~LLMarketplaceData() +{ + gInventory.removeObserver(mInventoryObserver); +} + +void LLMarketplaceData::initializeSLM(const status_updated_signal_t::slot_type& cb) +{ + if (mStatusUpdatedSignal == NULL) + { + mStatusUpdatedSignal = new status_updated_signal_t(); + } + mStatusUpdatedSignal->connect(cb); + + if (mMarketPlaceStatus != MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED) + { + // If already initialized, just confirm the status so the callback gets called + setSLMStatus(mMarketPlaceStatus); + } + else + { + // Initiate SLM connection and set responder + std::string url = getSLMConnectURL("/merchant"); + if (url != "") + { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING; + log_SLM_infos("LLHTTPClient::get", url, ""); + LLHTTPClient::get(url, new LLSLMGetMerchantResponder(), LLSD()); + } + } +} + +void LLMarketplaceData::setDataFetchedSignal(const status_updated_signal_t::slot_type& cb) +{ + if (mDataFetchedSignal == NULL) + { + mDataFetchedSignal = new status_updated_signal_t(); + } + mDataFetchedSignal->connect(cb); +} + +// Get/Post/Put requests to the SLM Server using the SLM API +void LLMarketplaceData::getSLMListings() +{ + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "application/json"; + headers["Content-Type"] = "application/json"; + + // Send request + std::string url = getSLMConnectURL("/listings"); + log_SLM_infos("LLHTTPClient::get", url, ""); + const LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + setUpdating(marketplacelistings_id,true); + LLHTTPClient::get(url, new LLSLMGetListingsResponder(marketplacelistings_id), headers); +} + +void LLMarketplaceData::getSLMListing(S32 listing_id) +{ + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "application/json"; + headers["Content-Type"] = "application/json"; + + // Send request + std::string url = getSLMConnectURL("/listing/") + llformat("%d",listing_id); + log_SLM_infos("LLHTTPClient::get", url, ""); + LLUUID folder_id = LLMarketplaceData::instance().getListingFolder(listing_id); + setUpdating(folder_id,true); + LLHTTPClient::get(url, new LLSLMGetListingResponder(folder_id), headers); +} + +void LLMarketplaceData::createSLMListing(const LLUUID& folder_id) +{ + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "application/json"; + headers["Content-Type"] = "application/json"; + + LLViewerInventoryCategory* category = gInventory.getCategory(folder_id); + + // Get the version folder: if there is only one subfolder, we will set it as a version folder immediately + LLUUID version_id = getVersionFolderIfUnique(folder_id); + + // Build the json message + Json::Value root; + Json::FastWriter writer; + + root["listing"]["name"] = category->getName(); + root["listing"]["inventory_info"]["listing_folder_id"] = folder_id.asString(); + root["listing"]["inventory_info"]["version_folder_id"] = version_id.asString(); + root["listing"]["inventory_info"]["count_on_hand"] = -1; + + std::string json_str = writer.write(root); + + // postRaw() takes ownership of the buffer and releases it later. + size_t size = json_str.size(); + U8 *data = new U8[size]; + memcpy(data, (U8*)(json_str.c_str()), size); + + // Send request + std::string url = getSLMConnectURL("/listings"); + log_SLM_infos("LLHTTPClient::postRaw", url, json_str); + setUpdating(folder_id,true); + LLHTTPClient::postRaw(url, data, size, new LLSLMCreateListingsResponder(folder_id), headers); +} + +void LLMarketplaceData::updateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed, S32 count) +{ + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "application/json"; + headers["Content-Type"] = "application/json"; + + Json::Value root; + Json::FastWriter writer; + + // Note : we're assuming that sending unchanged info won't break anything server side... + root["listing"]["id"] = listing_id; + root["listing"]["is_listed"] = is_listed; + root["listing"]["inventory_info"]["listing_folder_id"] = folder_id.asString(); + root["listing"]["inventory_info"]["version_folder_id"] = version_id.asString(); + root["listing"]["inventory_info"]["count_on_hand"] = count; + + std::string json_str = writer.write(root); + + // postRaw() takes ownership of the buffer and releases it later. + size_t size = json_str.size(); + U8 *data = new U8[size]; + memcpy(data, (U8*)(json_str.c_str()), size); + + // Send request + std::string url = getSLMConnectURL("/listing/") + llformat("%d",listing_id); + log_SLM_infos("LLHTTPClient::putRaw", url, json_str); + setUpdating(folder_id,true); + LLHTTPClient::putRaw(url, data, size, new LLSLMUpdateListingsResponder(folder_id, is_listed, version_id), headers); +} + +void LLMarketplaceData::associateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& source_folder_id) +{ + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "application/json"; + headers["Content-Type"] = "application/json"; + + // Get the version folder: if there is only one subfolder, we will set it as a version folder immediately + LLUUID version_id = getVersionFolderIfUnique(folder_id); + + Json::Value root; + Json::FastWriter writer; + + // Note : we're assuming that sending unchanged info won't break anything server side... + root["listing"]["id"] = listing_id; + root["listing"]["inventory_info"]["listing_folder_id"] = folder_id.asString(); + root["listing"]["inventory_info"]["version_folder_id"] = version_id.asString(); + root["listing"]["inventory_info"]["count_on_hand"] = -1; + + std::string json_str = writer.write(root); + + // postRaw() takes ownership of the buffer and releases it later. + size_t size = json_str.size(); + U8 *data = new U8[size]; + memcpy(data, (U8*)(json_str.c_str()), size); + + // Send request + std::string url = getSLMConnectURL("/associate_inventory/") + llformat("%d",listing_id); + log_SLM_infos("LLHTTPClient::putRaw", url, json_str); + setUpdating(folder_id,true); + setUpdating(source_folder_id,true); + LLHTTPClient::putRaw(url, data, size, new LLSLMAssociateListingsResponder(folder_id,source_folder_id), headers); +} + +void LLMarketplaceData::deleteSLMListing(S32 listing_id) +{ + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "application/json"; + headers["Content-Type"] = "application/json"; + + // Send request + std::string url = getSLMConnectURL("/listing/") + llformat("%d",listing_id); + log_SLM_infos("LLHTTPClient::del", url, ""); + LLUUID folder_id = LLMarketplaceData::instance().getListingFolder(listing_id); + setUpdating(folder_id,true); + LLHTTPClient::del(url, new LLSLMDeleteListingsResponder(folder_id), headers); +} + +std::string LLMarketplaceData::getSLMConnectURL(const std::string& route) +{ + std::string url(""); + LLViewerRegion *regionp = gAgent.getRegion(); + if (regionp) + { + // Get DirectDelivery cap + url = regionp->getCapability("DirectDelivery"); + if (url != "") + { + url += route; + } + } + return url; +} + +void LLMarketplaceData::setSLMStatus(U32 status) +{ + mMarketPlaceStatus = status; + if (mStatusUpdatedSignal) + { + (*mStatusUpdatedSignal)(); + } +} + +void LLMarketplaceData::setSLMDataFetched(U32 status) +{ + mMarketPlaceDataFetched = status; + if (mDataFetchedSignal) + { + (*mDataFetchedSignal)(); + } +} + +// Creation / Deletion / Update +// Methods publicly called +bool LLMarketplaceData::createListing(const LLUUID& folder_id) +{ + if (isListed(folder_id)) + { + // Listing already exists -> exit with error + return false; + } + + // Post the listing creation request to SLM + createSLMListing(folder_id); + + return true; +} + +bool LLMarketplaceData::clearListing(const LLUUID& folder_id) +{ + if (folder_id.isNull()) + { + // Folder doesn't exists -> exit with error + return false; + } + + // Folder id can be the root of the listing or not so we need to retrieve the root first + S32 depth = depth_nesting_in_marketplace(folder_id); + LLUUID listing_uuid = (isListed(folder_id) ? folder_id : nested_parent_id(folder_id, depth)); + S32 listing_id = getListingID(listing_uuid); + + if (listing_id == 0) + { + // Listing doesn't exists -> exit with error + return false; + } + + // Update the SLM Server so that this listing is deleted (actually, archived...) + deleteSLMListing(listing_id); + + return true; +} + +bool LLMarketplaceData::getListing(const LLUUID& folder_id) +{ + if (folder_id.isNull()) + { + // Folder doesn't exists -> exit with error + return false; + } + + // Folder id can be the root of the listing or not so we need to retrieve the root first + S32 depth = depth_nesting_in_marketplace(folder_id); + LLUUID listing_uuid = (isListed(folder_id) ? folder_id : nested_parent_id(folder_id, depth)); + S32 listing_id = getListingID(listing_uuid); + + if (listing_id == 0) + { + // Listing doesn't exists -> exit with error + return false; + } + + // Get listing data from SLM + getSLMListing(listing_id); + + return true; +} + +bool LLMarketplaceData::getListing(S32 listing_id) +{ + if (listing_id == 0) + { + return false; + } + + // Get listing data from SLM + getSLMListing(listing_id); + return true; +} + +bool LLMarketplaceData::activateListing(const LLUUID& folder_id, bool activate) +{ + // Folder id can be the root of the listing or not so we need to retrieve the root first + S32 depth = depth_nesting_in_marketplace(folder_id); + LLUUID listing_uuid = nested_parent_id(folder_id, depth); + S32 listing_id = getListingID(listing_uuid); + if (listing_id == 0) + { + // Listing doesn't exists -> exit with error + return false; + } + + LLUUID version_uuid = getVersionFolder(listing_uuid); + + // Also update the count on hand + S32 count = compute_stock_count(folder_id); + + // Post the listing update request to SLM + updateSLMListing(listing_uuid, listing_id, version_uuid, activate, count); + + return true; +} + +bool LLMarketplaceData::setVersionFolder(const LLUUID& folder_id, const LLUUID& version_id) +{ + // Folder id can be the root of the listing or not so we need to retrieve the root first + S32 depth = depth_nesting_in_marketplace(folder_id); + LLUUID listing_uuid = nested_parent_id(folder_id, depth); + S32 listing_id = getListingID(listing_uuid); + if (listing_id == 0) + { + // Listing doesn't exists -> exit with error + return false; + } + + // Note: if the version_id is cleared, we need to unlist the listing, otherwise, state unchanged + bool is_listed = (version_id.isNull() ? false : getActivationState(listing_uuid)); + + // Also update the count on hand + S32 count = compute_stock_count(version_id); + + // Post the listing update request to SLM + updateSLMListing(listing_uuid, listing_id, version_id, is_listed, count); + + return true; +} + +bool LLMarketplaceData::updateCountOnHand(const LLUUID& folder_id) +{ + // Folder id can be the root of the listing or not so we need to retrieve the root first + S32 depth = depth_nesting_in_marketplace(folder_id); + LLUUID listing_uuid = nested_parent_id(folder_id, depth); + S32 listing_id = getListingID(listing_uuid); + if (listing_id == 0) + { + // Listing doesn't exists -> exit with error + return false; + } + + // Get the unchanged values + bool is_listed = getActivationState(listing_uuid); + LLUUID version_uuid = getVersionFolder(listing_uuid); + + // Compute the new count on hand + S32 count = compute_stock_count(folder_id); + + // Post the listing update request to SLM + updateSLMListing(listing_uuid, listing_id, version_uuid, is_listed, count); + + return true; +} + +bool LLMarketplaceData::associateListing(const LLUUID& folder_id, const LLUUID& source_folder_id, S32 listing_id) +{ + if (isListed(folder_id)) + { + // Listing already exists -> exit with error + return false; + } + + // Post the listing update request to SLM + associateSLMListing(folder_id, listing_id, source_folder_id); + + return true; +} + +// Methods privately called or called by SLM responders to perform changes +bool LLMarketplaceData::addListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed, const std::string& edit_url, S32 count) +{ + mMarketplaceItems[folder_id] = LLMarketplaceTuple(folder_id, listing_id, version_id, is_listed); + mMarketplaceItems[folder_id].mEditURL = edit_url; + mMarketplaceItems[folder_id].mCountOnHand = count; + return true; +} + +bool LLMarketplaceData::deleteListing(const LLUUID& folder_id, bool update) +{ + if (mMarketplaceItems.erase(folder_id) != 1) + { + return false; + } + + if (update) + { + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); + } + return true; +} + +bool LLMarketplaceData::deleteListing(S32 listing_id, bool update) +{ + if (listing_id == 0) + { + return false; + } + + LLUUID folder_id = getListingFolder(listing_id); + return deleteListing(folder_id, update); +} + +// Accessors +bool LLMarketplaceData::getActivationState(const LLUUID& folder_id) +{ + // Listing folder case + if (isListed(folder_id)) + { + marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); + return (it->second).mIsActive; + } + // We need to iterate through the list to check it's not a version folder + marketplace_items_list_t::iterator it = mMarketplaceItems.begin(); + while (it != mMarketplaceItems.end()) + { + if ((it->second).mVersionFolderId == folder_id) + { + return (it->second).mIsActive; + } + it++; + } + return false; +} + +S32 LLMarketplaceData::getListingID(const LLUUID& folder_id) +{ + marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); + return (it == mMarketplaceItems.end() ? 0 : (it->second).mListingId); +} + +S32 LLMarketplaceData::getCountOnHand(const LLUUID& folder_id) +{ + marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); + return (it == mMarketplaceItems.end() ? -1 : (it->second).mCountOnHand); +} + +LLUUID LLMarketplaceData::getVersionFolder(const LLUUID& folder_id) +{ + marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); + return (it == mMarketplaceItems.end() ? LLUUID::null : (it->second).mVersionFolderId); +} + +// Reverse lookup : find the listing folder id from the listing id +LLUUID LLMarketplaceData::getListingFolder(S32 listing_id) +{ + marketplace_items_list_t::iterator it = mMarketplaceItems.begin(); + while (it != mMarketplaceItems.end()) + { + if ((it->second).mListingId == listing_id) + { + return (it->second).mListingFolderId; + } + it++; + } + return LLUUID::null; +} + +std::string LLMarketplaceData::getListingURL(const LLUUID& folder_id) +{ + S32 depth = depth_nesting_in_marketplace(folder_id); + LLUUID listing_uuid = nested_parent_id(folder_id, depth); + + marketplace_items_list_t::iterator it = mMarketplaceItems.find(listing_uuid); + return (it == mMarketplaceItems.end() ? "" : (it->second).mEditURL); +} + +bool LLMarketplaceData::isListed(const LLUUID& folder_id) +{ + marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); + return (it != mMarketplaceItems.end()); +} + +bool LLMarketplaceData::isListedAndActive(const LLUUID& folder_id) +{ + return (isListed(folder_id) && getActivationState(folder_id)); +} + +bool LLMarketplaceData::isVersionFolder(const LLUUID& folder_id) +{ + marketplace_items_list_t::iterator it = mMarketplaceItems.begin(); + while (it != mMarketplaceItems.end()) + { + if ((it->second).mVersionFolderId == folder_id) + { + return true; + } + it++; + } + return false; +} + +bool LLMarketplaceData::isInActiveFolder(const LLUUID& obj_id) +{ + S32 depth = depth_nesting_in_marketplace(obj_id); + LLUUID listing_uuid = nested_parent_id(obj_id, depth); + bool active = getActivationState(listing_uuid); + LLUUID version_uuid = getVersionFolder(listing_uuid); + return (active && ((obj_id == version_uuid) || gInventory.isObjectDescendentOf(obj_id, version_uuid))); +} + +LLUUID LLMarketplaceData::getActiveFolder(const LLUUID& obj_id) +{ + S32 depth = depth_nesting_in_marketplace(obj_id); + LLUUID listing_uuid = nested_parent_id(obj_id, depth); + return (getActivationState(listing_uuid) ? getVersionFolder(listing_uuid) : LLUUID::null); +} + +bool LLMarketplaceData::isUpdating(const LLUUID& folder_id) +{ + S32 depth = depth_nesting_in_marketplace(folder_id); + if ((depth <= 0) || (depth > 2)) + { + // Only listing and version folders though are concerned by that status + return false; + } + else + { + const LLUUID marketplace_listings_uuid = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + std::set<LLUUID>::iterator it = mPendingUpdateSet.find(marketplace_listings_uuid); + if (it != mPendingUpdateSet.end()) + { + // If we're waiting for data for the marketplace listings root, we are in the updating process for all + return true; + } + else + { + // Check if the listing folder is waiting or data + LLUUID listing_uuid = nested_parent_id(folder_id, depth); + it = mPendingUpdateSet.find(listing_uuid); + return (it != mPendingUpdateSet.end()); + } + } +} + +void LLMarketplaceData::setUpdating(const LLUUID& folder_id, bool isUpdating) +{ + std::set<LLUUID>::iterator it = mPendingUpdateSet.find(folder_id); + if (it != mPendingUpdateSet.end()) + { + mPendingUpdateSet.erase(it); + } + if (isUpdating) + { + mPendingUpdateSet.insert(folder_id); + } +} + +void LLMarketplaceData::setValidationWaiting(const LLUUID& folder_id, S32 count) +{ + mValidationWaitingList[folder_id] = count; +} + +void LLMarketplaceData::decrementValidationWaiting(const LLUUID& folder_id, S32 count) +{ + waiting_list_t::iterator found = mValidationWaitingList.find(folder_id); + if (found != mValidationWaitingList.end()) + { + found->second -= count; + if (found->second <= 0) + { + mValidationWaitingList.erase(found); + LLInventoryCategory *cat = gInventory.getCategory(folder_id); + validate_marketplacelistings(cat); + update_marketplace_category(folder_id); + gInventory.notifyObservers(); + } + } +} + +// Private Modifiers +bool LLMarketplaceData::setListingID(const LLUUID& folder_id, S32 listing_id, bool update) +{ + marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); + if (it == mMarketplaceItems.end()) + { + return false; + } + + (it->second).mListingId = listing_id; + + if (update) + { + update_marketplace_category(folder_id, false); + gInventory.notifyObservers(); + } + return true; +} + +bool LLMarketplaceData::setCountOnHand(const LLUUID& folder_id, S32 count, bool update) +{ + marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); + if (it == mMarketplaceItems.end()) + { + return false; + } + + (it->second).mCountOnHand = count; + + return true; } +bool LLMarketplaceData::setVersionFolderID(const LLUUID& folder_id, const LLUUID& version_id, bool update) +{ + marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); + if (it == mMarketplaceItems.end()) + { + return false; + } + + LLUUID old_version_id = (it->second).mVersionFolderId; + if (old_version_id == version_id) + { + return false; + } + + (it->second).mVersionFolderId = version_id; + + if (update) + { + update_marketplace_category(old_version_id, false); + update_marketplace_category(version_id, false); + gInventory.notifyObservers(); + } + return true; +} + +bool LLMarketplaceData::setActivationState(const LLUUID& folder_id, bool activate, bool update) +{ + marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); + if (it == mMarketplaceItems.end()) + { + return false; + } + + (it->second).mIsActive = activate; + + if (update) + { + update_marketplace_category((it->second).mListingFolderId, false); + gInventory.notifyObservers(); + } + return true; +} + +bool LLMarketplaceData::setListingURL(const LLUUID& folder_id, const std::string& edit_url, bool update) +{ + marketplace_items_list_t::iterator it = mMarketplaceItems.find(folder_id); + if (it == mMarketplaceItems.end()) + { + return false; + } + + (it->second).mEditURL = edit_url; + return true; +} + + + diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h index abe60890a3..34b650b0ce 100755 --- a/indra/newview/llmarketplacefunctions.h +++ b/indra/newview/llmarketplacefunctions.h @@ -66,8 +66,21 @@ namespace MarketplaceStatusCodes MARKET_PLACE_NOT_INITIALIZED = 0, MARKET_PLACE_INITIALIZING = 1, MARKET_PLACE_CONNECTION_FAILURE = 2, - MARKET_PLACE_MERCHANT = 3, - MARKET_PLACE_NOT_MERCHANT = 4, + MARKET_PLACE_NOT_MERCHANT = 3, + MARKET_PLACE_MERCHANT = 4, + MARKET_PLACE_NOT_MIGRATED_MERCHANT = 5, + MARKET_PLACE_MIGRATED_MERCHANT = 6 + }; +} + +namespace MarketplaceFetchCodes +{ + enum sCode + { + MARKET_FETCH_NOT_DONE = 0, + MARKET_FETCH_LOADING = 1, + MARKET_FETCH_FAILED = 2, + MARKET_FETCH_DONE = 3 }; } @@ -109,6 +122,163 @@ private: }; +// Classes handling the data coming from and going to the Marketplace SLM Server DB: +// * implement the Marketplace API +// * cache the current Marketplace data (tuples) +// * provide methods to get Marketplace data on any inventory item +// * set Marketplace data +// * signal Marketplace updates to inventory +namespace SLMErrorCodes +{ + enum eCode + { + SLM_SUCCESS = 200, + SLM_RECORD_CREATED = 201, + SLM_MALFORMED_PAYLOAD = 400, + SLM_NOT_FOUND = 404, + }; +} + +class LLMarketplaceData; +class LLInventoryObserver; + +// A Marketplace item is known by its tuple +class LLMarketplaceTuple +{ +public: + friend class LLMarketplaceData; + + LLMarketplaceTuple(); + LLMarketplaceTuple(const LLUUID& folder_id); + LLMarketplaceTuple(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed = false); + +private: + // Representation of a marketplace item in the Marketplace DB (well, what we know of it...) + LLUUID mListingFolderId; + S32 mListingId; + LLUUID mVersionFolderId; + bool mIsActive; + S32 mCountOnHand; + std::string mEditURL; +}; +// Notes: +// * The mListingFolderId is used as a key to this map. It could therefore be taken off the LLMarketplaceTuple objects themselves. +// * The SLM DB however uses mListingId as its primary key and it shows in its API. In the viewer though, the mListingFolderId is what we use to grab an inventory record. +typedef std::map<LLUUID, LLMarketplaceTuple> marketplace_items_list_t; + +// Session cache of all Marketplace tuples +// Notes: +// * There's one and only one possible set of Marketplace dataset per agent and per session thus making it an LLSingleton +// * Some of those records might correspond to folders that do not exist in the inventory anymore. We do not clear them out though. They just won't show up in the UI. + +class LLSLMGetMerchantResponder; +class LLSLMGetListingsResponder; +class LLSLMCreateListingsResponder; +class LLSLMGetListingResponder; +class LLSLMUpdateListingsResponder; +class LLSLMAssociateListingsResponder; +class LLSLMDeleteListingsResponder; + +class LLMarketplaceData + : public LLSingleton<LLMarketplaceData> +{ +public: + friend class LLSLMGetMerchantResponder; + friend class LLSLMGetListingsResponder; + friend class LLSLMCreateListingsResponder; + friend class LLSLMGetListingResponder; + friend class LLSLMUpdateListingsResponder; + friend class LLSLMAssociateListingsResponder; + friend class LLSLMDeleteListingsResponder; + + LLMarketplaceData(); + virtual ~LLMarketplaceData(); + + // Public SLM API : Initialization and status + typedef boost::signals2::signal<void ()> status_updated_signal_t; + void initializeSLM(const status_updated_signal_t::slot_type& cb); + U32 getSLMStatus() const { return mMarketPlaceStatus; } + void setSLMStatus(U32 status); + void getSLMListings(); + bool isEmpty() { return (mMarketplaceItems.size() == 0); } + void setDataFetchedSignal(const status_updated_signal_t::slot_type& cb); + void setSLMDataFetched(U32 status); + U32 getSLMDataFetched() { return mMarketPlaceDataFetched; } + + // High level create/delete/set Marketplace data: each method returns true if the function succeeds, false if error + bool createListing(const LLUUID& folder_id); + bool activateListing(const LLUUID& folder_id, bool activate); + bool clearListing(const LLUUID& folder_id); + bool setVersionFolder(const LLUUID& folder_id, const LLUUID& version_id); + bool associateListing(const LLUUID& folder_id, const LLUUID& source_folder_id, S32 listing_id); + bool updateCountOnHand(const LLUUID& folder_id); + bool getListing(const LLUUID& folder_id); + bool getListing(S32 listing_id); + bool deleteListing(S32 listing_id, bool update = true); + + // Probe the Marketplace data set to identify folders + bool isListed(const LLUUID& folder_id); // returns true if folder_id is a Listing folder + bool isListedAndActive(const LLUUID& folder_id); // returns true if folder_id is an active (listed) Listing folder + bool isVersionFolder(const LLUUID& folder_id); // returns true if folder_id is a Version folder + bool isInActiveFolder(const LLUUID& obj_id); // returns true if the obj_id is buried in an active version folder + LLUUID getActiveFolder(const LLUUID& obj_id); // returns the UUID of the active version folder obj_id is in + bool isUpdating(const LLUUID& folder_id); // returns true if we're waiting from SLM incoming data for folder_id + + // Access Marketplace data set : each method returns a default value if the argument can't be found + bool getActivationState(const LLUUID& folder_id); + S32 getListingID(const LLUUID& folder_id); + LLUUID getVersionFolder(const LLUUID& folder_id); + std::string getListingURL(const LLUUID& folder_id); + LLUUID getListingFolder(S32 listing_id); + S32 getCountOnHand(const LLUUID& folder_id); + + // Used to flag if stock count values for Marketplace have to be updated + bool checkDirtyCount() { if (mDirtyCount) { mDirtyCount = false; return true; } else { return false; } } + void setDirtyCount() { mDirtyCount = true; } + void setUpdating(const LLUUID& folder_id, bool isUpdating); + + // Used to decide when to run a validation on listing folders + void setValidationWaiting(const LLUUID& folder_id, S32 count); + void decrementValidationWaiting(const LLUUID& folder_id, S32 count = 1); + +private: + // Modify Marketplace data set : each method returns true if the function succeeds, false if error + // Used internally only by SLM Responders when data are received from the SLM Server + bool addListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed, const std::string& edit_url, S32 count); + bool deleteListing(const LLUUID& folder_id, bool update = true); + bool setListingID(const LLUUID& folder_id, S32 listing_id, bool update = true); + bool setVersionFolderID(const LLUUID& folder_id, const LLUUID& version_id, bool update = true); + bool setActivationState(const LLUUID& folder_id, bool activate, bool update = true); + bool setListingURL(const LLUUID& folder_id, const std::string& edit_url, bool update = true); + bool setCountOnHand(const LLUUID& folder_id, S32 count, bool update = true); + + // Private SLM API : package data and get/post/put requests to the SLM Server through the SLM API + void createSLMListing(const LLUUID& folder_id); + void getSLMListing(S32 listing_id); + void updateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed, S32 count); + void associateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id); + void deleteSLMListing(S32 listing_id); + std::string getSLMConnectURL(const std::string& route); + + // Handling Marketplace connection and inventory connection + U32 mMarketPlaceStatus; + status_updated_signal_t* mStatusUpdatedSignal; + LLInventoryObserver* mInventoryObserver; + bool mDirtyCount; // If true, stock count value need to be updated at the next check + + // Update data + U32 mMarketPlaceDataFetched; + status_updated_signal_t* mDataFetchedSignal; + std::set<LLUUID> mPendingUpdateSet; + + // Listing folders waiting for validation + typedef std::map<LLUUID,S32> waiting_list_t; + waiting_list_t mValidationWaitingList; + + // The cache of SLM data (at last...) + marketplace_items_list_t mMarketplaceItems; +}; + #endif // LL_LLMARKETPLACEFUNCTIONS_H diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index f4e08dc790..b96bdd73ff 100755 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -120,8 +120,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : if(!getDecoupleTextureSize()) { - S32 screen_width = llround((F32)getRect().getWidth() * LLUI::getScaleFactor().mV[VX]); - S32 screen_height = llround((F32)getRect().getHeight() * LLUI::getScaleFactor().mV[VY]); + S32 screen_width = ll_round((F32)getRect().getWidth() * LLUI::getScaleFactor().mV[VX]); + S32 screen_height = ll_round((F32)getRect().getHeight() * LLUI::getScaleFactor().mV[VY]); setTextureSize(screen_width, screen_height); } @@ -474,8 +474,8 @@ void LLMediaCtrl::reshape( S32 width, S32 height, BOOL called_from_parent ) { if(!getDecoupleTextureSize()) { - S32 screen_width = llround((F32)width * LLUI::getScaleFactor().mV[VX]); - S32 screen_height = llround((F32)height * LLUI::getScaleFactor().mV[VY]); + S32 screen_width = ll_round((F32)width * LLUI::getScaleFactor().mV[VX]); + S32 screen_height = ll_round((F32)height * LLUI::getScaleFactor().mV[VY]); // when floater is minimized, these sizes are negative if ( screen_height > 0 && screen_width > 0 ) @@ -789,13 +789,13 @@ void LLMediaCtrl::draw() { // max width, adjusted height width = r.getWidth(); - height = llmin(llmax(llround(width / media_aspect), 0), r.getHeight()); + height = llmin(llmax(ll_round(width / media_aspect), 0), r.getHeight()); } else { // max height, adjusted width height = r.getHeight(); - width = llmin(llmax(llround(height * media_aspect), 0), r.getWidth()); + width = llmin(llmax(ll_round(height * media_aspect), 0), r.getWidth()); } } else @@ -879,14 +879,14 @@ void LLMediaCtrl::convertInputCoords(S32& x, S32& y) coords_opengl = mMediaSource->getMediaPlugin()->getTextureCoordsOpenGL(); } - x = llround((F32)x * LLUI::getScaleFactor().mV[VX]); + x = ll_round((F32)x * LLUI::getScaleFactor().mV[VX]); if ( ! coords_opengl ) { - y = llround((F32)(y) * LLUI::getScaleFactor().mV[VY]); + y = ll_round((F32)(y) * LLUI::getScaleFactor().mV[VY]); } else { - y = llround((F32)(getRect().getHeight() - y) * LLUI::getScaleFactor().mV[VY]); + y = ll_round((F32)(getRect().getHeight() - y) * LLUI::getScaleFactor().mV[VY]); }; } diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 691be13610..2fb9e60b29 100755 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -92,7 +92,7 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::Request &q); template <typename T> -static typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type) +typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type) { for(typename T::iterator iter = c.begin(); iter != c.end(); ++iter) { @@ -106,7 +106,7 @@ static typename T::iterator find_matching_request(T &c, const LLMediaDataClient: } template <typename T> -static typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) +typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) { for(typename T::iterator iter = c.begin(); iter != c.end(); ++iter) { @@ -123,7 +123,7 @@ static typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMedi // to other elements in the container (such as std::vector). // If the implementation is changed to use a container with this property, this will need to be revisited. template <typename T> -static void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) +void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) { for(typename T::iterator iter = c.begin(); iter != c.end();) { @@ -171,10 +171,10 @@ bool LLMediaDataClient::isEmpty() const bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) { - if(find_matching_request(mQueue, object->getID()) != mQueue.end()) + if(find_matching_request(mQueue, object->getID(), LLMediaDataClient::Request::ANY) != mQueue.end()) return true; - if(find_matching_request(mUnQueuedRequests, object->getID()) != mUnQueuedRequests.end()) + if(find_matching_request(mUnQueuedRequests, object->getID(), LLMediaDataClient::Request::ANY) != mUnQueuedRequests.end()) return true; return false; @@ -183,8 +183,8 @@ bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) void LLMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object) { LL_DEBUGS("LLMediaDataClient") << "removing requests matching ID " << object->getID() << LL_ENDL; - remove_matching_requests(mQueue, object->getID()); - remove_matching_requests(mUnQueuedRequests, object->getID()); + remove_matching_requests(mQueue, object->getID(), LLMediaDataClient::Request::ANY); + remove_matching_requests(mUnQueuedRequests, object->getID(), LLMediaDataClient::Request::ANY); } void LLMediaDataClient::startQueueTimer() @@ -785,7 +785,7 @@ bool LLObjectMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &ob if(LLMediaDataClient::isInQueue(object)) return true; - if(find_matching_request(mRoundRobinQueue, object->getID()) != mRoundRobinQueue.end()) + if(find_matching_request(mRoundRobinQueue, object->getID(), LLMediaDataClient::Request::ANY) != mRoundRobinQueue.end()) return true; return false; @@ -796,7 +796,7 @@ void LLObjectMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr // First, call parent impl. LLMediaDataClient::removeFromQueue(object); - remove_matching_requests(mRoundRobinQueue, object->getID()); + remove_matching_requests(mRoundRobinQueue, object->getID(), LLMediaDataClient::Request::ANY); } bool LLObjectMediaDataClient::processQueueTimer() @@ -952,7 +952,7 @@ void LLObjectMediaNavigateClient::enqueue(Request *request) } // If there's already a matching request in the queue, remove it. - request_queue_t::iterator iter = find_matching_request(mQueue, request); + request_queue_t::iterator iter = find_matching_request(mQueue, request, LLMediaDataClient::Request::ANY); if(iter != mQueue.end()) { LL_DEBUGS("LLMediaDataClient") << "removing matching queued request " << (**iter) << LL_ENDL; @@ -960,7 +960,7 @@ void LLObjectMediaNavigateClient::enqueue(Request *request) } else { - request_set_t::iterator set_iter = find_matching_request(mUnQueuedRequests, request); + request_set_t::iterator set_iter = find_matching_request(mUnQueuedRequests, request, LLMediaDataClient::Request::ANY); if(set_iter != mUnQueuedRequests.end()) { LL_DEBUGS("LLMediaDataClient") << "removing matching unqueued request " << (**set_iter) << LL_ENDL; diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index 231b883c32..80dd519812 100755 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -281,10 +281,9 @@ private: bool mQueueTimerIsRunning; - template <typename T> friend typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); - template <typename T> friend typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); - template <typename T> friend void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); - + template <typename T> friend typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type); + template <typename T> friend typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type); + template <typename T> friend void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type); }; // MediaDataClient specific for the ObjectMedia cap diff --git a/indra/newview/llmorphview.cpp b/indra/newview/llmorphview.cpp index 252d1b78ea..ff86400a56 100755 --- a/indra/newview/llmorphview.cpp +++ b/indra/newview/llmorphview.cpp @@ -47,17 +47,8 @@ LLMorphView *gMorphView = NULL; - -const F32 EDIT_AVATAR_ORBIT_SPEED = 0.1f; -const F32 EDIT_AVATAR_MAX_CAMERA_PITCH = 0.5f; - -const F32 CAMERA_MOVE_TIME = 0.5f; const F32 MORPH_NEAR_CLIP = 0.1f; -const F32 CAMERA_DIST_MIN = 0.4f; -const F32 CAMERA_DIST_MAX = 4.0f; -const F32 CAMERA_DIST_STEP = 1.5f; - //----------------------------------------------------------------------------- // LLMorphView() //----------------------------------------------------------------------------- diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 1685a18e26..d7e7f13e87 100755 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -67,7 +67,6 @@ const F32 LLNetMap::MAP_SCALE_MIN = 32; const F32 LLNetMap::MAP_SCALE_MID = 1024; const F32 LLNetMap::MAP_SCALE_MAX = 4096; -const F32 MAP_SCALE_INCREMENT = 16; const F32 MAP_SCALE_ZOOM_FACTOR = 1.04f; // Zoom in factor per click of scroll wheel (4%) const F32 MIN_DOT_RADIUS = 3.5f; const F32 DOT_SCALE = 0.75f; @@ -210,7 +209,7 @@ void LLNetMap::draw() } // figure out where agent is - S32 region_width = llround(LLWorld::getInstance()->getRegionWidthInMeters()); + S32 region_width = ll_round(LLWorld::getInstance()->getRegionWidthInMeters()); for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) @@ -381,8 +380,8 @@ void LLNetMap::draw() (pos_map.mV[VX] >= getRect().getWidth()) || (pos_map.mV[VY] >= getRect().getHeight()) ) { - S32 x = llround( pos_map.mV[VX] ); - S32 y = llround( pos_map.mV[VY] ); + S32 x = ll_round( pos_map.mV[VX] ); + S32 y = ll_round( pos_map.mV[VY] ); LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10); } else { @@ -422,12 +421,12 @@ void LLNetMap::draw() // Draw dot for self avatar position LLVector3d pos_global = gAgent.getPositionGlobal(); pos_map = globalPosToView(pos_global); - S32 dot_width = llround(mDotRadius * 2.f); + S32 dot_width = ll_round(mDotRadius * 2.f); LLUIImagePtr you = LLWorldMapView::sAvatarYouLargeImage; if (you) { - you->draw(llround(pos_map.mV[VX] - mDotRadius), - llround(pos_map.mV[VY] - mDotRadius), + you->draw(ll_round(pos_map.mV[VX] - mDotRadius), + ll_round(pos_map.mV[VY] - mDotRadius), dot_width, dot_width); @@ -531,8 +530,8 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, { if (draw_arrow) { - S32 x = llround( pos_local.mV[VX] ); - S32 y = llround( pos_local.mV[VY] ); + S32 x = ll_round( pos_local.mV[VX] ); + S32 y = ll_round( pos_local.mV[VY] ); LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10 ); LLWorldMapView::drawTrackingArrow( getRect(), x, y, color ); } @@ -548,8 +547,8 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y ) { - x -= llround(getRect().getWidth() / 2 + mCurPan.mV[VX]); - y -= llround(getRect().getHeight() / 2 + mCurPan.mV[VY]); + x -= ll_round(getRect().getWidth() / 2 + mCurPan.mV[VX]); + y -= ll_round(getRect().getHeight() / 2 + mCurPan.mV[VY]); LLVector3 pos_local( (F32)x, (F32)y, 0 ); @@ -685,7 +684,7 @@ void LLNetMap::renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U & LLVector3 local_pos; local_pos.setVec( pos - mObjectImageCenterGlobal ); - S32 diameter_pixels = llround(2 * radius_meters * mObjectMapTPM); + S32 diameter_pixels = ll_round(2 * radius_meters * mObjectMapTPM); renderPoint( local_pos, color, diameter_pixels ); } @@ -701,8 +700,8 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color, const S32 image_width = (S32)mObjectImagep->getWidth(); const S32 image_height = (S32)mObjectImagep->getHeight(); - S32 x_offset = llround(pos_local.mV[VX] * mObjectMapTPM + image_width / 2); - S32 y_offset = llround(pos_local.mV[VY] * mObjectMapTPM + image_height / 2); + S32 x_offset = ll_round(pos_local.mV[VX] * mObjectMapTPM + image_width / 2); + S32 y_offset = ll_round(pos_local.mV[VY] * mObjectMapTPM + image_height / 2); if ((x_offset < 0) || (x_offset >= image_width)) { @@ -781,7 +780,7 @@ void LLNetMap::createObjectImage() // ... which is, the diagonal of the rect. F32 width = (F32)getRect().getWidth(); F32 height = (F32)getRect().getHeight(); - S32 square_size = llround( sqrt(width*width + height*height) ); + S32 square_size = ll_round( sqrt(width*width + height*height) ); // Find the least power of two >= the minimum size. const S32 MIN_SIZE = 64; diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 3cd39d7c7e..878f1af9ef 100755 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -462,9 +462,9 @@ std::string LLPanelClassifiedInfo::createLocationText( if (!pos_global.isNull()) { - 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]); + S32 region_x = ll_round((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = ll_round((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = ll_round((F32)pos_global.mdV[VZ]); location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); } diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 02e05d3d9a..cc8b7d2a52 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -77,8 +77,6 @@ const S32 MATMEDIA_MEDIA = 1; // Media const S32 MATTYPE_DIFFUSE = 0; // Diffuse material texture const S32 MATTYPE_NORMAL = 1; // Normal map const S32 MATTYPE_SPECULAR = 2; // Specular map -const S32 ALPHAMODE_NONE = 0; // No alpha mask applied -const S32 ALPHAMODE_BLEND = 1; // Alpha blending mode const S32 ALPHAMODE_MASK = 2; // Alpha masking mode const S32 BUMPY_TEXTURE = 18; // use supplied normal map const S32 SHINY_TEXTURE = 4; // use supplied specular map diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 2f7c44f899..a2e136bd5a 100755 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -503,8 +503,8 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) land_type = LLTrans::getString("land_type_unknown"); } - S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; - S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; + S32 region_x = ll_round(global_x) % REGION_WIDTH_UNITS; + S32 region_y = ll_round(global_y) % REGION_WIDTH_UNITS; std::string location = sim_name + llformat(" (%d, %d)", region_x, region_y); std::string area; diff --git a/indra/newview/llpanellandaudio.h b/indra/newview/llpanellandaudio.h index 32a45100f4..7e4fce80e4 100755 --- a/indra/newview/llpanellandaudio.h +++ b/indra/newview/llpanellandaudio.h @@ -51,7 +51,6 @@ private: LLCheckBoxCtrl* mCheckEstateDisabledVoice; LLCheckBoxCtrl* mCheckParcelVoiceLocal; LLLineEditor* mMusicURLEdit; - LLCheckBoxCtrl* mMusicUrlCheck; LLCheckBoxCtrl* mCheckAVSoundAny; LLCheckBoxCtrl* mCheckAVSoundGroup; diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 63ddc05037..a660cb3b21 100755 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -131,9 +131,9 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type) if (name.empty()) { - S32 region_x = llround(agent_pos.mV[VX]); - S32 region_y = llround(agent_pos.mV[VY]); - S32 region_z = llround(agent_pos.mV[VZ]); + S32 region_x = ll_round(agent_pos.mV[VX]); + S32 region_y = ll_round(agent_pos.mV[VY]); + S32 region_z = ll_round(agent_pos.mV[VZ]); std::string region_name; LLViewerRegion* region = parcel_mgr->getSelectionRegion(); diff --git a/indra/newview/llpanellandmedia.h b/indra/newview/llpanellandmedia.h index 0e6292a25e..63cfa01470 100755 --- a/indra/newview/llpanellandmedia.h +++ b/indra/newview/llpanellandmedia.h @@ -59,12 +59,10 @@ private: LLButton* mSetURLButton; LLSpinCtrl* mMediaHeightCtrl; LLSpinCtrl* mMediaWidthCtrl; - LLTextBox* mMediaResetCtrlLabel; LLTextBox* mMediaSizeCtrlLabel; LLTextureCtrl* mMediaTextureCtrl; LLCheckBoxCtrl* mMediaAutoScaleCheck; LLCheckBoxCtrl* mMediaLoopCheck; - LLCheckBoxCtrl* mMediaUrlCheck; LLHandle<LLFloater> mURLEntryFloater; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 34f3bbf73e..89c898001f 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -75,9 +75,6 @@ #include "llsdserialize.h" -const S32 BLACK_BORDER_HEIGHT = 160; -const S32 MAX_PASSWORD = 16; - LLPanelLogin *LLPanelLogin::sInstance = NULL; BOOL LLPanelLogin::sCapslockDidNotification = FALSE; @@ -175,7 +172,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, mUsernameLength(0), mPasswordLength(0), mLocationLength(0), - mFavoriteSelected(false), mShowFavorites(false) { setBackgroundVisible(FALSE); @@ -196,7 +192,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, } else { - buildFromFile( "panel_login.xml"); + buildFromFile( "panel_login.xml"); } reshape(rect.getWidth(), rect.getHeight()); @@ -204,22 +200,18 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLLineEditor* password_edit(getChild<LLLineEditor>("password_edit")); password_edit->setKeystrokeCallback(onPassKey, this); // STEAM-14: When user presses Enter with this field in focus, initiate login - password_edit->setCommitCallback(boost::bind(&LLPanelLogin::onClickConnectLast, this)); + password_edit->setCommitCallback(boost::bind(&LLPanelLogin::onClickConnect, this)); // change z sort of clickable text to be behind buttons sendChildToBack(getChildView("forgot_password_text")); LLComboBox* favorites_combo = getChild<LLComboBox>("start_location_combo"); updateLocationSelectorsVisibility(); // separate so that it can be called from preferences + favorites_combo->setReturnCallback(boost::bind(&LLPanelLogin::onClickConnect, this)); favorites_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onLocationSLURL, this)); - favorites_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectFavorite, this)); LLComboBox* server_choice_combo = getChild<LLComboBox>("server_combo"); server_choice_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectServer, this)); - - LLLineEditor* location_edit = sInstance->getChild<LLLineEditor>("location_edit"); - location_edit->setKeystrokeCallback(boost::bind(&LLPanelLogin::onLocationEditChanged, this, _1), NULL); - location_edit->setCommitCallback(boost::bind(&LLPanelLogin::onClickConnectLocation, this)); // Load all of the grids, sorted, and then add a bar and the current grid at the top server_choice_combo->removeall(); @@ -267,9 +259,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLPanelLogin::onUpdateStartSLURL(start_slurl); // updates grid if needed } - childSetAction("connect_btn", onClickConnectLast, this); - childSetAction("connect_favorite_btn", onClickConnectFavorite, this); - childSetAction("connect_location_btn", onClickConnectLocation, this); + childSetAction("connect_btn", onClickConnect, this); LLButton* def_btn = getChild<LLButton>("connect_btn"); setDefaultBtn(def_btn); @@ -303,7 +293,7 @@ void LLPanelLogin::addFavoritesToStartLocation() LLComboBox* combo = getChild<LLComboBox>("start_location_combo"); if (!combo) return; int num_items = combo->getItemCount(); - for (int i = num_items - 1; i > 0; i--) + for (int i = num_items - 1; i > 1; i--) { combo->remove(i); } @@ -351,6 +341,10 @@ void LLPanelLogin::addFavoritesToStartLocation() { mShowFavorites = true; combo->add(label, value); + if ( LLStartUp::getStartSLURL().getSLURLString() == value) + { + combo->selectByValue(value); + } } } break; @@ -665,7 +659,6 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl) LL_DEBUGS("AppInit")<<new_start_slurl.asString()<<LL_ENDL; LLComboBox* location_combo = sInstance->getChild<LLComboBox>("start_location_combo"); - LLLineEditor* location_edit = sInstance->getChild<LLLineEditor>("location_edit"); /* * Determine whether or not the new_start_slurl modifies the grid. * @@ -697,7 +690,10 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl) } if ( new_start_slurl.getLocationString().length() ) { - location_edit->setValue(new_start_slurl.getLocationString()); + if (location_combo->getCurrentIndex() == -1) + { + location_combo->setLabel(new_start_slurl.getLocationString()); + } sInstance->mLocationLength = new_start_slurl.getLocationString().length(); sInstance->updateLoginButtons(); } @@ -836,33 +832,6 @@ void LLPanelLogin::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent ev // Protected methods //--------------------------------------------------------------------------- // static -void LLPanelLogin::onClickConnectLast(void *) -{ - std::string location = LLSLURL::SIM_LOCATION_LAST; - LLStartUp::setStartSLURL(location); - - void* unused_parameter = 0; - LLPanelLogin::sInstance->onClickConnect(unused_parameter); -} - -void LLPanelLogin::onClickConnectFavorite(void *) -{ - LLPanelLogin::sInstance->onLocationSLURL(); - - void* unused_parameter = 0; - LLPanelLogin::sInstance->onClickConnect(unused_parameter); -} - -void LLPanelLogin::onClickConnectLocation(void *) -{ - std::string location = sInstance->getChild<LLUICtrl>("location_edit")->getValue().asString(); - LLStartUp::setStartSLURL(location); - - void* unused_parameter = 0; - LLPanelLogin::sInstance->onClickConnect(unused_parameter); -} - -// static void LLPanelLogin::onClickConnect(void *) { if (sInstance && sInstance->mCallback) @@ -1010,60 +979,9 @@ void LLPanelLogin::updateServer() void LLPanelLogin::updateLoginButtons() { - LLButton* last_login_btn = getChild<LLButton>("connect_btn"); - LLButton* loc_btn = getChild<LLButton>("connect_location_btn"); - LLButton* fav_btn = getChild<LLButton>("connect_favorite_btn"); + LLButton* login_btn = getChild<LLButton>("connect_btn"); - // no username or no password - turn all buttons off - if ( mUsernameLength == 0 || mPasswordLength == 0 ) - { - last_login_btn->setEnabled(false); - loc_btn->setEnabled(false); - fav_btn->setEnabled(false); - }; - - // we have a username and a password - if ( mUsernameLength != 0 && mPasswordLength != 0 ) - { - // last login button always enabled for this case - last_login_btn->setEnabled(true); - - // double check status of favorites combo (must be items there and one must be selected to enable button) - LLComboBox* favorites_combo = getChild<LLComboBox>("start_location_combo"); - int num_items = favorites_combo->getItemCount(); - int selected_index = favorites_combo->getCurrentIndex(); - if ( num_items > 0 && selected_index >=0 ) - mFavoriteSelected = true; - else - mFavoriteSelected = false; - - // only turn on favorites login button if one is selected - fav_btn->setEnabled( mFavoriteSelected ); - - // only enable location login if there is content there - if ( mLocationLength > 0 ) - loc_btn->setEnabled(true); - else - loc_btn->setEnabled(false); - } -} - -void LLPanelLogin::onLocationEditChanged(LLUICtrl* ctrl) -{ - LLLineEditor* self = (LLLineEditor*)ctrl; - if (self ) - { - mLocationLength = self->getText().length(); - updateLoginButtons(); - } -} - -void LLPanelLogin::onSelectFavorite() -{ - // no way to unselect a favorite once it's selected (i think) - mFavoriteSelected = true; - - updateLoginButtons(); + login_btn->setEnabled(mUsernameLength != 0 && mPasswordLength != 0); } void LLPanelLogin::onSelectServer() @@ -1108,7 +1026,6 @@ void LLPanelLogin::onSelectServer() // the grid specified by the location is not this one, so clear the combo location_combo->setCurrentByIndex(0); // last location on the new grid location_combo->setTextEntry(LLStringUtil::null); - mFavoriteSelected = true; } } break; diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index aa63ffabfc..869f2f8d39 100755 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -90,14 +90,9 @@ private: friend class LLPanelLoginListener; void addFavoritesToStartLocation(); void addUsersWithFavoritesToUsername(); - void onLocationEditChanged(LLUICtrl* ctrl); - void onSelectFavorite(); void onSelectServer(); void onLocationSLURL(); - static void onClickConnectLast(void*); - static void onClickConnectFavorite(void*); - static void onClickConnectLocation(void*); static void onClickConnect(void*); static void onClickNewAccount(void*); static void onClickVersion(void*); @@ -120,7 +115,7 @@ private: static LLPanelLogin* sInstance; static BOOL sCapslockDidNotification; bool mFirstLoginThisInstall; - bool mFavoriteSelected; + unsigned int mUsernameLength; unsigned int mPasswordLength; unsigned int mLocationLength; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index eb037577be..37273a7793 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -248,7 +248,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) llofstream filtersFile(filterSaveName.str()); if(!LLSDSerialize::toPrettyXML(filterRoot, filtersFile)) { - LL_WARNS() << "Could not write to filters save file " << filterSaveName << LL_ENDL; + LL_WARNS() << "Could not write to filters save file " << filterSaveName.str() << LL_ENDL; } else filtersFile.close(); diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index f7c2f629ec..c5fda3c136 100755 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -62,7 +62,7 @@ LLInboxInventoryPanel::LLInboxInventoryPanel(const LLInboxInventoryPanel::Params LLInboxInventoryPanel::~LLInboxInventoryPanel() {} -LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) +LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop) { LLUIColor item_color = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); @@ -74,6 +74,7 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge params.tool_tip = params.name; params.font_color = item_color; params.font_highlight_color = item_color; + params.allow_drop = allow_drop; return LLUICtrlFactory::create<LLInboxFolderViewFolder>(params); } diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index c05e18c300..66aafe83d1 100755 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -46,7 +46,7 @@ public: ~LLInboxInventoryPanel(); // virtual - LLFolderViewFolder * createFolderViewFolder(LLInvFVBridge * bridge); + LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop); LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge); }; diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 2fece32449..dcd0aab3ab 100755 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -412,9 +412,9 @@ void LLPanelObject::getState( ) LLQuaternion object_rot = objectp->getRotationEdit(); object_rot.getEulerAngles(&(mCurEulerDegrees.mV[VX]), &(mCurEulerDegrees.mV[VY]), &(mCurEulerDegrees.mV[VZ])); mCurEulerDegrees *= RAD_TO_DEG; - mCurEulerDegrees.mV[VX] = fmod(llround(mCurEulerDegrees.mV[VX], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); - mCurEulerDegrees.mV[VY] = fmod(llround(mCurEulerDegrees.mV[VY], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); - mCurEulerDegrees.mV[VZ] = fmod(llround(mCurEulerDegrees.mV[VZ], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); + mCurEulerDegrees.mV[VX] = fmod(ll_round(mCurEulerDegrees.mV[VX], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); + mCurEulerDegrees.mV[VY] = fmod(ll_round(mCurEulerDegrees.mV[VY], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); + mCurEulerDegrees.mV[VZ] = fmod(ll_round(mCurEulerDegrees.mV[VZ], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); if (enable_rotate) { @@ -1568,9 +1568,9 @@ void LLPanelObject::sendRotation(BOOL btn_down) if (mObject.isNull()) return; LLVector3 new_rot(mCtrlRotX->get(), mCtrlRotY->get(), mCtrlRotZ->get()); - new_rot.mV[VX] = llround(new_rot.mV[VX], OBJECT_ROTATION_PRECISION); - new_rot.mV[VY] = llround(new_rot.mV[VY], OBJECT_ROTATION_PRECISION); - new_rot.mV[VZ] = llround(new_rot.mV[VZ], OBJECT_ROTATION_PRECISION); + new_rot.mV[VX] = ll_round(new_rot.mV[VX], OBJECT_ROTATION_PRECISION); + new_rot.mV[VY] = ll_round(new_rot.mV[VY], OBJECT_ROTATION_PRECISION); + new_rot.mV[VZ] = ll_round(new_rot.mV[VZ], OBJECT_ROTATION_PRECISION); // Note: must compare before conversion to radians LLVector3 delta = new_rot - mCurEulerDegrees; diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 6354b5a02b..a7a0196770 100755 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -130,7 +130,7 @@ public: virtual void move(LLFolderViewModelItem* parent_listener); virtual BOOL isItemCopyable() const; virtual BOOL copyToClipboard() const; - virtual BOOL cutToClipboard() const; + virtual BOOL cutToClipboard(); virtual BOOL isClipboardPasteable() const; virtual void pasteFromClipboard(); virtual void pasteLinkFromClipboard(); @@ -542,7 +542,7 @@ BOOL LLTaskInvFVBridge::copyToClipboard() const return FALSE; } -BOOL LLTaskInvFVBridge::cutToClipboard() const +BOOL LLTaskInvFVBridge::cutToClipboard() { return FALSE; } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 55eaf74f74..c1d7a134fa 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -149,7 +149,6 @@ private: Updater* mFriendListUpdater; Updater* mNearbyListUpdater; Updater* mRecentListUpdater; - Updater* mFacebookListUpdater; Updater* mButtonsUpdater; LLHandle< LLFloater > mPicker; }; diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 44cca21a76..8fa9aac024 100755 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -284,9 +284,9 @@ std::string LLPanelPickInfo::createLocationText(const std::string& owner_name, c if (!pos_global.isNull()) { - 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]); + S32 region_x = ll_round((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = ll_round((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = ll_round((F32)pos_global.mdV[VZ]); location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); } return location_text; diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 4e7c5f6ed2..e62b5a4f1d 100755 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -231,15 +231,15 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) // 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); + region_x = ll_round(parcel_data.global_x) % REGION_WIDTH_UNITS; + region_y = ll_round(parcel_data.global_y) % REGION_WIDTH_UNITS; + region_z = ll_round(parcel_data.global_z); } else { - region_x = llround(mPosRegion.mV[VX]); - region_y = llround(mPosRegion.mV[VY]); - region_z = llround(mPosRegion.mV[VZ]); + region_x = ll_round(mPosRegion.mV[VX]); + region_y = ll_round(mPosRegion.mV[VY]); + region_z = ll_round(mPosRegion.mV[VZ]); } if (!parcel_data.name.empty()) diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index ed91d277dd..e853b2d050 100755 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -551,7 +551,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, // Can't have more than region max tasks, regardless of parcel // object bonus factor. - S32 primitives = llmin(llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()), + S32 primitives = llmin(ll_round(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()), (S32)region->getMaxTasks()); const U8* available = (U8*)getString("available").c_str(); diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 2be96b9b78..4bcd932d4b 100755 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -75,7 +75,6 @@ #include "llviewerwindow.h" // Constants -static const S32 LANDMARK_FOLDERS_MENU_WIDTH = 250; static const F32 PLACE_INFO_UPDATE_INTERVAL = 3.0; static const std::string AGENT_INFO_TYPE = "agent"; static const std::string CREATE_LANDMARK_INFO_TYPE = "create_landmark"; diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 7c0e448a99..f42df221e4 100755 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -630,12 +630,12 @@ void LLPanelPrimMediaControls::updateShape() // convert screenspace bbox to pixels (in screen coords) LLRect window_rect = gViewerWindow->getWorldViewRectScaled(); LLCoordGL screen_min; - screen_min.mX = llround((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (min.mV[VX] + 1.f) * 0.5f); - screen_min.mY = llround((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (min.mV[VY] + 1.f) * 0.5f); + screen_min.mX = ll_round((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (min.mV[VX] + 1.f) * 0.5f); + screen_min.mY = ll_round((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (min.mV[VY] + 1.f) * 0.5f); LLCoordGL screen_max; - screen_max.mX = llround((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (max.mV[VX] + 1.f) * 0.5f); - screen_max.mY = llround((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (max.mV[VY] + 1.f) * 0.5f); + screen_max.mX = ll_round((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (max.mV[VX] + 1.f) * 0.5f); + screen_max.mY = ll_round((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (max.mV[VY] + 1.f) * 0.5f); // grow panel so that screenspace bounding box fits inside "media_region" element of panel LLRect media_panel_rect; diff --git a/indra/newview/llplacesinventorybridge.h b/indra/newview/llplacesinventorybridge.h index 07d18d03c5..108991210f 100755 --- a/indra/newview/llplacesinventorybridge.h +++ b/indra/newview/llplacesinventorybridge.h @@ -85,6 +85,8 @@ protected: class LLPlacesInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder { public: + LLPlacesInventoryBridgeBuilder() {} + /*virtual*/ LLInvFVBridge* createBridge(LLAssetType::EType asset_type, LLAssetType::EType actual_asset_type, LLInventoryType::EType inv_type, diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index a41986373e..5415c273e2 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -106,9 +106,6 @@ const std::string DEFAULT_SCRIPT_NAME = "New Script"; // *TODO:Translate? const std::string DEFAULT_SCRIPT_DESC = "(No Description)"; // *TODO:Translate? // Description and header information - -const S32 MAX_EXPORT_SIZE = 1000; - const S32 MAX_HISTORY_COUNT = 10; const F32 LIVE_HELP_REFRESH_TIME = 1.f; diff --git a/indra/newview/llscripteditor.cpp b/indra/newview/llscripteditor.cpp index 81920562a7..cd3a4dfd11 100644 --- a/indra/newview/llscripteditor.cpp +++ b/indra/newview/llscripteditor.cpp @@ -32,7 +32,6 @@ #include "lllocalcliprect.h" const S32 UI_TEXTEDITOR_LINE_NUMBER_MARGIN = 32; -const S32 UI_TEXTEDITOR_LINE_NUMBER_DIGITS = 4; static LLDefaultChildRegistry::Register<LLScriptEditor> r("script_editor"); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index eb3a4c37d9..9e0bd9b6ed 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -99,14 +99,11 @@ LLViewerObject* getSelectedParentObject(LLViewerObject *object) ; // Consts // -const S32 NUM_SELECTION_UNDO_ENTRIES = 200; const F32 SILHOUETTE_UPDATE_THRESHOLD_SQUARED = 0.02f; -const S32 MAX_ACTION_QUEUE_SIZE = 20; const S32 MAX_SILS_PER_FRAME = 50; const S32 MAX_OBJECTS_PER_PACKET = 254; // For linked sets const S32 MAX_CHILDREN_PER_TASK = 255; -const S32 MAX_CHILDREN_PER_PHYSICAL_TASK = 32; // // Globals @@ -1941,7 +1938,7 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data) llassert(mMediaData.isMap()); const LLTextureEntry *texture_entry = object->getTE(te); if (!mMediaData.isMap() || - (NULL != texture_entry) && !texture_entry->hasMedia() && !mMediaData.has(LLMediaEntry::HOME_URL_KEY)) + ((NULL != texture_entry) && !texture_entry->hasMedia() && !mMediaData.has(LLMediaEntry::HOME_URL_KEY))) { // skip adding/updating media } diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index cde05a8d9b..440fce07bb 100755 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -90,9 +90,6 @@ private: LLTextBox* mCurrentLookName; LLTextBox* mOutfitStatus; - // Used to make sure the user's inventory is in memory. - LLCurrentlyWornFetchObserver* mFetchWorn; - // Search string for filtering landmarks and teleport // history locations std::string mFilterSubString; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 4970eec636..0e23e2ad10 100755 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -70,10 +70,7 @@ static LLPanelInjector<LLSidepanelInventory> t_inventory("sidepanel_inventory"); static const char * const INBOX_BUTTON_NAME = "inbox_btn"; static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel"; -static const char * const MAIN_INVENTORY_LAYOUT_PANEL_NAME = "main_inventory_layout_panel"; - static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"; - static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox"; // diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index 3a82233320..728fc69723 100755 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -323,9 +323,9 @@ LLSLURL::LLSLURL(const std::string& grid, { mGrid = grid; mRegion = region; - S32 x = llround( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) ); - S32 y = llround( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) ); - S32 z = llround( (F32)position[VZ] ); + S32 x = ll_round( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) ); + S32 y = ll_round( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) ); + S32 z = ll_round( (F32)position[VZ] ); mType = LOCATION; mPosition = LLVector3(x, y, z); } @@ -379,9 +379,9 @@ std::string LLSLURL::getSLURLString() const case LOCATION: { // lookup the grid - S32 x = llround( (F32)mPosition[VX] ); - S32 y = llround( (F32)mPosition[VY] ); - S32 z = llround( (F32)mPosition[VZ] ); + S32 x = ll_round( (F32)mPosition[VX] ); + S32 y = ll_round( (F32)mPosition[VY] ); + S32 z = ll_round( (F32)mPosition[VZ] ); return LLGridManager::getInstance()->getSLURLBase(mGrid) + LLURI::escape(mRegion) + llformat("/%d/%d/%d",x,y,z); } @@ -416,9 +416,9 @@ std::string LLSLURL::getLoginString() const case LOCATION: unescaped_start << "uri:" << mRegion << "&" - << llround(mPosition[0]) << "&" - << llround(mPosition[1]) << "&" - << llround(mPosition[2]); + << ll_round(mPosition[0]) << "&" + << ll_round(mPosition[1]) << "&" + << ll_round(mPosition[2]); break; case HOME_LOCATION: unescaped_start << "home"; @@ -462,9 +462,9 @@ std::string LLSLURL::getLocationString() const { return llformat("%s/%d/%d/%d", mRegion.c_str(), - (int)llround(mPosition[0]), - (int)llround(mPosition[1]), - (int)llround(mPosition[2])); + (int)ll_round(mPosition[0]), + (int)ll_round(mPosition[1]), + (int)ll_round(mPosition[2])); } // static diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 600ebf5914..ee5fd7cb71 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -177,14 +177,14 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail if (image_aspect_ratio > window_aspect_ratio) { // trim off top and bottom - S32 new_height = llround((F32)getRect().getWidth() / image_aspect_ratio); + S32 new_height = ll_round((F32)getRect().getWidth() / image_aspect_ratio); rect.mBottom += (getRect().getHeight() - new_height) / 2; rect.mTop -= (getRect().getHeight() - new_height) / 2; } else if (image_aspect_ratio < window_aspect_ratio) { // trim off left and right - S32 new_width = llround((F32)getRect().getHeight() * image_aspect_ratio); + S32 new_width = ll_round((F32)getRect().getHeight() * image_aspect_ratio); rect.mLeft += (getRect().getWidth() - new_width) / 2; rect.mRight -= (getRect().getWidth() - new_width) / 2; } @@ -345,9 +345,9 @@ void LLSnapshotLivePreview::draw() LLLocalClipRect clip(getLocalRect()); { // draw diagonal stripe with gradient that passes over screen - S32 x1 = gViewerWindow->getWindowWidthScaled() * llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f))); - S32 x2 = x1 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); - S32 x3 = x2 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); + S32 x1 = gViewerWindow->getWindowWidthScaled() * ll_round((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f))); + S32 x2 = x1 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); + S32 x3 = x2 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); S32 y1 = 0; S32 y2 = gViewerWindow->getWindowHeightScaled(); @@ -429,7 +429,7 @@ void LLSnapshotLivePreview::draw() gGL.pushMatrix(); { LLRect& rect = mImageRect[old_image_index]; - gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f); + gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - ll_round(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f); gGL.rotatef(-45.f * fall_interp, 0.f, 0.f, 1.f); gGL.begin(LLRender::QUADS); { @@ -483,13 +483,13 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize() { // image too wide, shrink to width mThumbnailWidth = max_width; - mThumbnailHeight = llround((F32)max_width / aspect_ratio); + mThumbnailHeight = ll_round((F32)max_width / aspect_ratio); } else { // image too tall, shrink to height mThumbnailHeight = max_height; - mThumbnailWidth = llround((F32)max_height * aspect_ratio); + mThumbnailWidth = ll_round((F32)max_height * aspect_ratio); } if (mThumbnailWidth > width || mThumbnailHeight > height) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d5f9268a64..733d1a5bbe 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1875,6 +1875,11 @@ bool idle_startup() } display_startup(); + + // *TODO : Uncomment that line once the whole grid migrated to SLM and suppress it from LLAgent::handleTeleportFinished() (llagent.cpp) + //check_merchant_status(); + + display_startup(); if (gSavedSettings.getBOOL("HelpFloaterOpen")) { diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index eedb829b48..2d4b23d892 100755 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -94,16 +94,11 @@ extern S32 MENU_BAR_HEIGHT; // TODO: these values ought to be in the XML too -const S32 MENU_PARCEL_SPACING = 1; // Distance from right of menu item to parcel information const S32 SIM_STAT_WIDTH = 8; -const F32 SIM_WARN_FRACTION = 0.75f; -const F32 SIM_FULL_FRACTION = 0.98f; const LLColor4 SIM_OK_COLOR(0.f, 1.f, 0.f, 1.f); const LLColor4 SIM_WARN_COLOR(1.f, 1.f, 0.f, 1.f); const LLColor4 SIM_FULL_COLOR(1.f, 0.f, 0.f, 1.f); const F32 ICON_TIMER_EXPIRY = 3.f; // How long the balance and health icons should flash after a change. -const F32 ICON_FLASH_FREQUENCY = 2.f; -const S32 TEXT_HEIGHT = 18; static void onClickVolume(void*); diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index e75af8db53..503dd6747d 100755 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -1232,10 +1232,10 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y, S32 x_begin, y_begin, x_end, y_end; - x_begin = llround(x * scale_inv); - y_begin = llround(y * scale_inv); - x_end = llround((x + width) * scale_inv); - y_end = llround((y + width) * scale_inv); + x_begin = ll_round(x * scale_inv); + y_begin = ll_round(y * scale_inv); + x_end = ll_round((x + width) * scale_inv); + y_end = ll_round((y + width) * scale_inv); if (x_end > tex_width) { @@ -1283,9 +1283,9 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y, // Want non-linear curve for transparency gradient coloru = MAX_WATER_COLOR; const F32 frac = 1.f - 2.f/(2.f - (height - WATER_HEIGHT)); - S32 alpha = 64 + llround((255-64)*frac); + S32 alpha = 64 + ll_round((255-64)*frac); - alpha = llmin(llround((F32)MAX_WATER_COLOR.mV[3]), alpha); + alpha = llmin(ll_round((F32)MAX_WATER_COLOR.mV[3]), alpha); alpha = llmax(64, alpha); coloru.mV[3] = alpha; diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index a426669b5e..3e5b91c8fc 100755 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -72,12 +72,6 @@ #include "llfloaterreg.h" #include "lllocalbitmaps.h" -static const S32 HPAD = 4; -static const S32 VPAD = 4; -static const S32 LINE = 16; -static const S32 FOOTER_HEIGHT = 100; -static const S32 BORDER_PAD = HPAD; -static const S32 TEXTURE_INVENTORY_PADDING = 30; static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; static const F32 CONTEXT_FADE_TIME = 0.08f; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index acd4cf2d8d..fab4203ec3 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -340,7 +340,7 @@ private: // Threads: Ttf DecodeResponder(LLTextureFetch* fetcher, const LLUUID& id, LLTextureFetchWorker* worker) - : mFetcher(fetcher), mID(id), mWorker(worker) + : mFetcher(fetcher), mID(id) { } @@ -356,7 +356,6 @@ private: private: LLTextureFetch* mFetcher; LLUUID mID; - LLTextureFetchWorker* mWorker; // debug only (may get deleted from under us, use mFetcher/mID) }; struct Compare diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index c82894a5cc..530bd9a18f 100755 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -48,7 +48,6 @@ const S32 MAX_ALLOWED_MSG_WIDTH = 400; const F32 DEFAULT_BUTTON_DELAY = 0.5f; -const S32 MSG_PAD = 8; /*static*/ LLControlGroup* LLToastAlertPanel::sSettings = NULL; /*static*/ LLToastAlertPanel::URLLoader* LLToastAlertPanel::sURLLoader; @@ -68,19 +67,19 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal mLabel(notification->getName()), mLineEditor(NULL) { - // EXP-1822 - // save currently focused view, so that return focus to it - // on destroying this toast. - LLView* current_selection = dynamic_cast<LLView*>(gFocusMgr.getKeyboardFocus()); - while(current_selection) - { - if (current_selection->isFocusRoot()) - { - mPreviouslyFocusedView = current_selection->getHandle(); - break; - } - current_selection = current_selection->getParent(); - } + // EXP-1822 + // save currently focused view, so that return focus to it + // on destroying this toast. + LLView* current_selection = dynamic_cast<LLView*>(gFocusMgr.getKeyboardFocus()); + while(current_selection) + { + if (current_selection->isFocusRoot()) + { + mPreviouslyFocusedView = current_selection->getHandle(); + break; + } + current_selection = current_selection->getParent(); + } const LLFontGL* font = LLFontGL::getFontSansSerif(); const S32 LINE_HEIGHT = font->getLineHeight(); @@ -432,7 +431,24 @@ LLToastAlertPanel::~LLToastAlertPanel() // return focus to the previously focused view if the viewer is not exiting if (mPreviouslyFocusedView.get() && !LLApp::isExiting()) { - mPreviouslyFocusedView.get()->setFocus(TRUE); + LLView* current_selection = dynamic_cast<LLView*>(gFocusMgr.getKeyboardFocus()); + while(current_selection) + { + if (current_selection->isFocusRoot()) + { + break; + } + current_selection = current_selection->getParent(); + } + if (current_selection) + { + // If the focus moved to some other view though, move the focus there + current_selection->setFocus(TRUE); + } + else + { + mPreviouslyFocusedView.get()->setFocus(TRUE); + } } } diff --git a/indra/newview/lltoastgroupnotifypanel.h b/indra/newview/lltoastgroupnotifypanel.h index 431fd32da2..269c23798c 100755 --- a/indra/newview/lltoastgroupnotifypanel.h +++ b/indra/newview/lltoastgroupnotifypanel.h @@ -60,8 +60,6 @@ private: static const S32 DEFAULT_MESSAGE_MAX_LINE_COUNT; - LLButton* mSaveInventoryBtn; - LLUUID mGroupID; LLOfferInfo* mInventoryOffer; }; diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index e3eb8ba7af..0a0bfaf58b 100755 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -65,8 +65,7 @@ const std::string REGION_BLOCKS_TERRAFORM_MSG = "This region does not allow terr const S32 LAND_BRUSH_SIZE_COUNT = 3; const F32 LAND_BRUSH_SIZE[LAND_BRUSH_SIZE_COUNT] = {1.0f, 2.0f, 4.0f}; -const S32 LAND_STEPS = 3; -const F32 LAND_METERS_PER_SECOND = 1.0f; + enum { E_LAND_LEVEL = 0, diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index 4bda9072d0..5a63f6e286 100755 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -52,14 +52,8 @@ #include "llfloatertools.h" #include "llviewercontrol.h" -const S32 BUTTON_HEIGHT = 16; -const S32 BUTTON_WIDTH_SMALL = 32; -const S32 BUTTON_WIDTH_BIG = 48; -const S32 HPAD = 4; - extern LLControlGroup gSavedSettings; - // we use this in various places instead of NULL static LLPointer<LLTool> sNullTool(new LLTool(std::string("null"), NULL)); diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 8561d265de..98a0180702 100755 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -820,6 +820,7 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop, if (!handled) { + // *TODO: Suppress the "outbox" case once "marketplace" is used everywhere for everyone // Disallow drag and drop to 3D from the outbox const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); if (outbox_id.notNull()) @@ -834,6 +835,20 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop, } } } + // Disallow drag and drop to 3D from the marketplace + const LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + if (marketplacelistings_id.notNull()) + { + for (S32 item_index = 0; item_index < (S32)mCargoIDs.size(); item_index++) + { + if (gInventory.isObjectDescendentOf(mCargoIDs[item_index], marketplacelistings_id)) + { + *acceptance = ACCEPT_NO; + mToolTipMsg = LLTrans::getString("TooltipOutboxDragToWorld"); + return; + } + } + } dragOrDrop3D( x, y, mask, drop, acceptance ); } @@ -947,8 +962,7 @@ void LLToolDragAndDrop::pick(const LLPickInfo& pick_info) const S32 item_index = mCurItemIndex; const EDragAndDropType dad_type = mCargoTypes[item_index]; // Call the right implementation function - (U32)callMemberFunction(*this, - LLDragAndDropDictionary::instance().get(dad_type, target)) + callMemberFunction(*this, LLDragAndDropDictionary::instance().get(dad_type, target)) (hit_obj, hit_face, pick_info.mKeyMask, TRUE); } } diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index de501ea32a..63be1ef09b 100755 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -89,6 +89,7 @@ public: void setCargoCount(U32 count) { mCargoCount = count; } void resetCargoCount() { mCargoCount = 0; } U32 getCargoCount() const { return (mCargoCount > 0) ? mCargoCount : mCargoIDs.size(); } + S32 getCargoIndex() const { return mCurItemIndex; } static S32 getOperationId() { return sOperationId; } diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 58073d1186..7de91c7757 100755 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -61,7 +61,6 @@ BOOL gCameraBtnOrbit = FALSE; BOOL gCameraBtnPan = FALSE; const S32 SLOP_RANGE = 4; -const F32 FOCUS_OFFSET_FACTOR = 1.f; // // Camera - shared functionality diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 175227173f..3ecb4015ce 100755 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -37,6 +37,7 @@ #include "llfloaterinspect.h" #include "lltool.h" #include "llmanipscale.h" +#include "llmarketplacefunctions.h" #include "llselectmgr.h" #include "lltoolbrush.h" #include "lltoolcomp.h" @@ -83,6 +84,8 @@ LLToolMgr::LLToolMgr() 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, _2)); + LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Marketplace.Enabled", boost::bind(&LLToolMgr::canAccessMarketplace, this)); + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Marketplace.Toggle", boost::bind(&LLToolMgr::toggleMarketplace, this, _2)); gToolNull = new LLTool(LLStringUtil::null); // Does nothing setCurrentTool(gToolNull); @@ -345,6 +348,23 @@ bool LLToolMgr::inBuildMode() return b; } +bool LLToolMgr::canAccessMarketplace() +{ + return (LLMarketplaceData::instance().getSLMStatus() != MarketplaceStatusCodes::MARKET_PLACE_NOT_MIGRATED_MERCHANT) || gSavedSettings.getBOOL("InventoryOutboxDisplayBoth"); +} + +void LLToolMgr::toggleMarketplace(const LLSD& sdname) +{ + const std::string& param = sdname.asString(); + + if ((param != "marketplace") || !canAccessMarketplace()) + { + return; + } + + LLFloaterReg::toggleInstanceOrBringToFront("marketplace_listings"); +} + void LLToolMgr::setTransientTool(LLTool* tool) { if (!tool) diff --git a/indra/newview/lltoolmgr.h b/indra/newview/lltoolmgr.h index e7d1c56c83..a3c1045aac 100755 --- a/indra/newview/lltoolmgr.h +++ b/indra/newview/lltoolmgr.h @@ -54,7 +54,9 @@ public: bool inEdit(); bool canEdit(); + bool canAccessMarketplace(); void toggleBuildMode(const LLSD& sdname); + void toggleMarketplace(const LLSD& sdname); /* Determines if we are in Build mode or not. */ bool inBuildMode(); diff --git a/indra/newview/lltoolselectland.cpp b/indra/newview/lltoolselectland.cpp index 44c0cb3124..ff991dc9fd 100755 --- a/indra/newview/lltoolselectland.cpp +++ b/indra/newview/lltoolselectland.cpp @@ -219,8 +219,8 @@ void LLToolSelectLand::handleDeselect() void LLToolSelectLand::roundXY(LLVector3d &vec) { - vec.mdV[VX] = llround( vec.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); - vec.mdV[VY] = llround( vec.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); + vec.mdV[VX] = ll_round( vec.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); + vec.mdV[VY] = ll_round( vec.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); } diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 6a8fad0134..5cc7d7bed3 100755 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -38,8 +38,6 @@ #error "Channel or Version information is undefined" #endif -const char * const LL_CHANNEL = LL_VIEWER_CHANNEL; - // // Set the version numbers in indra/VIEWER_VERSION // diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 981e4c40aa..cd9b2ed11b 100755 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1176,8 +1176,8 @@ LLRect get_whole_screen_region() if (zoom_factor > 1.f) { S32 num_horizontal_tiles = llceil(zoom_factor); - S32 tile_width = llround((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor); - S32 tile_height = llround((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor); + S32 tile_width = ll_round((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor); + S32 tile_height = ll_round((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor); int tile_y = sub_region / num_horizontal_tiles; int tile_x = sub_region - (tile_y * num_horizontal_tiles); @@ -1471,8 +1471,8 @@ void render_ui_2d() int pos_y = sub_region / llceil(zoom_factor); int pos_x = sub_region - (pos_y*llceil(zoom_factor)); // offset for this tile - LLFontGL::sCurOrigin.mX -= llround((F32)gViewerWindow->getWindowWidthScaled() * (F32)pos_x / zoom_factor); - LLFontGL::sCurOrigin.mY -= llround((F32)gViewerWindow->getWindowHeightScaled() * (F32)pos_y / zoom_factor); + LLFontGL::sCurOrigin.mX -= ll_round((F32)gViewerWindow->getWindowWidthScaled() * (F32)pos_x / zoom_factor); + LLFontGL::sCurOrigin.mY -= ll_round((F32)gViewerWindow->getWindowHeightScaled() * (F32)pos_y / zoom_factor); } stop_glerror(); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index fc18b20758..8add0c226c 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -81,6 +81,7 @@ #include "llfloaterland.h" #include "llfloaterlandholdings.h" #include "llfloatermap.h" +#include "llfloatermarketplacelistings.h" #include "llfloatermediasettings.h" #include "llfloatermemleak.h" #include "llfloatermodelpreview.h" @@ -183,6 +184,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("block_timers", "floater_fast_timers.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFastTimerView>); LLFloaterReg::add("about_land", "floater_about_land.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLand>); LLFloaterReg::add("appearance", "floater_my_appearance.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>); + LLFloaterReg::add("associate_listing", "floater_associate_listing.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAssociateListing>); LLFloaterReg::add("auction", "floater_auction.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAuction>); LLFloaterReg::add("avatar", "floater_avatar.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAvatar>); LLFloaterReg::add("avatar_picker", "floater_avatar_picker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAvatarPicker>); @@ -232,6 +234,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIncomingCallDialog>); LLFloaterReg::add("inventory", "floater_my_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>); LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInspect>); + LLFloaterReg::add("item_properties", "floater_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterItemProperties>); LLInspectAvatarUtil::registerFloater(); LLInspectGroupUtil::registerFloater(); LLInspectObjectUtil::registerFloater(); @@ -250,6 +253,8 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("tex_fetch_debugger", "floater_texture_fetch_debugger.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTextureFetchDebugger>); } LLFloaterReg::add("media_settings", "floater_media_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMediaSettings>); + LLFloaterReg::add("marketplace_listings", "floater_marketplace_listings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMarketplaceListings>); + LLFloaterReg::add("marketplace_validation", "floater_marketplace_validation.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMarketplaceValidation>); LLFloaterReg::add("message_critical", "floater_critical.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTOS>); LLFloaterReg::add("message_tos", "floater_tos.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTOS>); LLFloaterReg::add("moveview", "floater_moveview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMove>); diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 0401de7e69..158cacbc81 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -140,7 +140,11 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_OUTBOX, new ViewerFolderEntry("Merchant Outbox", "Inv_SysOpen", "Inv_SysClosed", FALSE, boxes_invisible)); addEntry(LLFolderType::FT_BASIC_ROOT, new ViewerFolderEntry("Basic Root", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); - + + addEntry(LLFolderType::FT_MARKETPLACE_LISTINGS, new ViewerFolderEntry("Marketplace Listings", "Inv_SysOpen", "Inv_SysClosed", FALSE, boxes_invisible)); + addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new ViewerFolderEntry("New Stock", "Inv_StockFolderOpen", "Inv_StockFolderClosed", FALSE, false, "default")); + addEntry(LLFolderType::FT_MARKETPLACE_VERSION, new ViewerFolderEntry("New Version", "Inv_VersionFolderOpen","Inv_VersionFolderClosed", FALSE, false, "default")); + addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false, "default")); for (U32 type = (U32)LLFolderType::FT_ENSEMBLE_START; type <= (U32)LLFolderType::FT_ENSEMBLE_END; ++type) diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index d6c8ba10f6..a424e3c15b 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -808,6 +808,36 @@ bool LLViewerInventoryCategory::exportFileLocal(LLFILE* fp) const return true; } +bool LLViewerInventoryCategory::acceptItem(LLInventoryItem* inv_item) +{ + if (!inv_item) + { + return false; + } + + // Only stock folders have limitation on which item they will accept + bool accept = true; + if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + // If the item is copyable (i.e. non stock) do not accept the drop in a stock folder + if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + accept = false; + } + else + { + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(getUUID(),cat_array,item_array); + // Destination stock folder must be empty OR types of incoming and existing items must be identical and have the same permissions + accept = (!item_array->size() || + ((item_array->at(0)->getInventoryType() == inv_item->getInventoryType()) && + (item_array->at(0)->getPermissions().getMaskNextOwner() == inv_item->getPermissions().getMaskNextOwner()))); + } + } + return accept; +} + void LLViewerInventoryCategory::determineFolderType() { /* Do NOT uncomment this code. This is for future 2.1 support of ensembles. diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index ca92565600..4e91e4110a 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -228,6 +228,9 @@ public: void changeType(LLFolderType::EType new_folder_type); virtual void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); virtual BOOL unpackMessage(const LLSD& category); + + // returns true if the category object will accept the incoming item + bool acceptItem(LLInventoryItem* inv_item); private: friend class LLInventoryModel; diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index a4a05587d3..9b8c913c6b 100755 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -53,7 +53,6 @@ const F32 FLY_FRAMES = 4; const F32 NUDGE_TIME = 0.25f; // in seconds const S32 NUDGE_FRAMES = 2; const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed -const F32 YAW_NUDGE_RATE = 0.05f; // fraction of normal speed struct LLKeyboardActionRegistry : public LLRegistrySingleton<std::string, boost::function<void (EKeystate keystate)>, LLKeyboardActionRegistry> @@ -66,7 +65,7 @@ void agent_jump( EKeystate s ) { if( KEYSTATE_UP == s ) return; F32 time = gKeyboard->getCurKeyElapsedTime(); - S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); + S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount()); if( time < FLY_TIME || frame_count <= FLY_FRAMES @@ -133,7 +132,7 @@ static void agent_push_forwardbackward( EKeystate s, S32 direction, LLAgent::EDo if (KEYSTATE_UP == s) return; F32 time = gKeyboard->getCurKeyElapsedTime(); - S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); + S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount()); if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES) { @@ -184,7 +183,7 @@ static void agent_slide_leftright( EKeystate s, S32 direction, LLAgent::EDoubleT agent_handle_doubletap_run(s, mode); if( KEYSTATE_UP == s ) return; F32 time = gKeyboard->getCurKeyElapsedTime(); - S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); + S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount()); if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES) { diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 721ee1f0f5..c758bbcc9e 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -924,7 +924,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) { F32 approximate_interest_dimension = (F32) sqrt(pimpl->getInterest()); - pimpl->setLowPrioritySizeLimit(llround(approximate_interest_dimension)); + pimpl->setLowPrioritySizeLimit(ll_round(approximate_interest_dimension)); } } else @@ -2330,8 +2330,8 @@ void LLViewerMediaImpl::scaleTextureCoords(const LLVector2& texture_coords, S32 texture_y = 1.0 + texture_y; // scale x and y to texel units. - *x = llround(texture_x * mMediaSource->getTextureWidth()); - *y = llround((1.0f - texture_y) * mMediaSource->getTextureHeight()); + *x = ll_round(texture_x * mMediaSource->getTextureWidth()); + *y = ll_round((1.0f - texture_y) * mMediaSource->getTextureHeight()); // Adjust for the difference between the actual texture height and the amount of the texture in use. *y -= (mMediaSource->getTextureHeight() - mMediaSource->getHeight()); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a23d02a00a..89e0c0deda 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -88,6 +88,7 @@ #include "llinventoryfunctions.h" #include "llpanellogin.h" #include "llpanelblockedlist.h" +#include "llmarketplacefunctions.h" #include "llmenuoptionpathfindingrebakenavmesh.h" #include "llmoveview.h" #include "llparcel.h" @@ -98,6 +99,7 @@ #include "llspellcheckmenuhandler.h" #include "llstatusbar.h" #include "lltextureview.h" +#include "lltoolbarview.h" #include "lltoolcomp.h" #include "lltoolmgr.h" #include "lltoolpie.h" @@ -386,6 +388,66 @@ void set_underclothes_menu_options() } } +void set_merchant_SLM_menu() +{ + // DD-170 : SLM Alpha and Beta program : for the moment, we always show the SLM menu and + // tools so that all merchants can try out the UI, even if not migrated. + // *TODO : Keep SLM UI hidden for non migrated merchant in released viewer + + //if (LLMarketplaceData::instance().getSLMStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_MIGRATED_MERCHANT) + //{ + // Merchant not migrated: show only the old Merchant Outbox menu + // gMenuHolder->getChild<LLView>("MerchantOutbox")->setVisible(TRUE); + //} + //else + //{ + // All other cases (new merchant, not merchant, migrated merchant): show the new Marketplace Listings menu and enable the tool + gMenuHolder->getChild<LLView>("MarketplaceListings")->setVisible(TRUE); + LLCommand* command = LLCommandManager::instance().getCommand("marketplacelistings"); + gToolBarView->enableCommand(command->id(), true); + //} +} + +void set_merchant_outbox_menu(U32 status, const LLSD& content) +{ + // If the merchant is fully migrated, the API is disabled (503) and we won't show the old menu item. + // In all other cases, we show it. + if (status != MarketplaceErrorCodes::IMPORT_SERVER_API_DISABLED) + { + gMenuHolder->getChild<LLView>("MerchantOutbox")->setVisible(TRUE); + } +} + +void check_merchant_status() +{ + if (!gSavedSettings.getBOOL("InventoryOutboxDisplayBoth")) + { + // Reset the SLM status: we actually want to check again, that's the point of calling check_merchant_status() + LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED); + + // Hide SLM related menu item + gMenuHolder->getChild<LLView>("MarketplaceListings")->setVisible(FALSE); + + // Also disable the toolbar button for Marketplace Listings + LLCommand* command = LLCommandManager::instance().getCommand("marketplacelistings"); + gToolBarView->enableCommand(command->id(), false); + + // Launch an SLM test connection to get the merchant status + LLMarketplaceData::instance().initializeSLM(boost::bind(&set_merchant_SLM_menu)); + + // Do the Merchant Outbox init only once per session + if (LLMarketplaceInventoryImporter::instance().getMarketPlaceStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED) + { + // Hide merchant outbox related menu item + gMenuHolder->getChild<LLView>("MerchantOutbox")->setVisible(FALSE); + + // Launch a Merchant Outbox test connection to get the migration status + LLMarketplaceInventoryImporter::instance().setStatusReportCallback(boost::bind(&set_merchant_outbox_menu,_1, _2)); + LLMarketplaceInventoryImporter::instance().initialize(); + } + } +} + void init_menus() { // Initialize actions diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 7f09fc2d8f..b7bdf00157 100755 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -83,6 +83,7 @@ BOOL enable_god_full(void* user_data); BOOL enable_god_liaison(void* user_data); BOOL enable_god_basic(void* user_data); void set_underclothes_menu_options(); +void check_merchant_status(); void exchange_callingcard(const LLUUID& dest_id); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 44eb4361f1..8a1b703b13 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -71,6 +71,7 @@ #include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llfloaterimnearbychat.h" +#include "llmarketplacefunctions.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llpanelgrouplandmoney.h" @@ -128,10 +129,7 @@ extern void on_new_message(const LLSD& msg); // // Constants // -const F32 BIRD_AUDIBLE_RADIUS = 32.0f; -const F32 SIT_DISTANCE_FROM_TARGET = 0.25f; const F32 CAMERA_POSITION_THRESHOLD_SQUARED = 0.001f * 0.001f; -static const F32 LOGOUT_REPLY_TIME = 3.f; // Wait this long after LogoutReply before quitting. // Determine how quickly residents' scripts can issue question dialogs // Allow bursts of up to 5 dialogs in 10 seconds. 10*2=20 seconds recovery if throttle kicks in @@ -2411,7 +2409,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) BOOL is_do_not_disturb = gAgent.isDoNotDisturb(); BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat) // object IMs contain sender object id in session_id (STORM-1209) - || dialog == IM_FROM_TASK && LLMuteList::getInstance()->isMuted(session_id); + || (dialog == IM_FROM_TASK && LLMuteList::getInstance()->isMuted(session_id)); BOOL is_owned_by_me = FALSE; BOOL is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL) ? false : true; BOOL accept_im_from_only_friend = gSavedSettings.getBOOL("VoiceCallsFriendsOnly"); @@ -5116,7 +5114,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data) if (object) { LLVector3 sit_spot = object->getPositionAgent() + (sitPosition * object->getRotation()); - if (!use_autopilot || isAgentAvatarValid() && gAgentAvatarp->isSitting() && gAgentAvatarp->getRoot() == object->getRoot()) + if (!use_autopilot || (isAgentAvatarValid() && gAgentAvatarp->isSitting() && gAgentAvatarp->getRoot() == object->getRoot())) { //we're already sitting on this object, so don't autopilot } @@ -5882,7 +5880,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) LL_WARNS() << "attempt_standard_notification: Attempted to read notification parameter data into LLSD but failed:" << llsdRaw << LL_ENDL; } } - + if ( (notificationID == "RegionEntryAccessBlocked") || (notificationID == "LandClaimAccessBlocked") || @@ -5963,7 +5961,25 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) make_ui_sound("UISndRestart"); } - + + // Special Marketplace update notification + if (notificationID == "SLM_UPDATE_FOLDER") + { + std::string state = llsdBlock["state"].asString(); + if (state == "deleted") + { + // Perform the deletion viewer side, no alert shown in this case + LLMarketplaceData::instance().deleteListing(llsdBlock["listing_id"].asInteger()); + return true; + } + else + { + // In general, no message will be displayed, all we want is to get the listing updated in the marketplace floater + // If getListing() fails though, the message of the alert will be shown by the caller of attempt_standard_notification() + return LLMarketplaceData::instance().getListing(llsdBlock["listing_id"].asInteger()); + } + } + LLNotificationsUtil::add(notificationID, llsdBlock); return true; } @@ -7117,8 +7133,6 @@ void process_user_info_reply(LLMessageSystem* msg, void**) //--------------------------------------------------------------------------- const S32 SCRIPT_DIALOG_MAX_BUTTONS = 12; -const S32 SCRIPT_DIALOG_BUTTON_STR_SIZE = 24; -const S32 SCRIPT_DIALOG_MAX_MESSAGE_SIZE = 512; const char* SCRIPT_DIALOG_HEADER = "Script Dialog:\n"; bool callback_script_dialog(const LLSD& notification, const LLSD& response) diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 2f4365036c..991f1c77a5 100755 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -281,7 +281,7 @@ S32 LLViewerParcelMgr::getSelectedArea() const F64 width = mEastNorth.mdV[VX] - mWestSouth.mdV[VX]; F64 height = mEastNorth.mdV[VY] - mWestSouth.mdV[VY]; F32 area = (F32)(width * height); - rv = llround(area); + rv = ll_round(area); } return rv; } @@ -301,10 +301,10 @@ void LLViewerParcelMgr::writeHighlightSegments(F32 west, F32 south, F32 east, F32 north) { S32 x, y; - S32 min_x = llround( west / PARCEL_GRID_STEP_METERS ); - S32 max_x = llround( east / PARCEL_GRID_STEP_METERS ); - S32 min_y = llround( south / PARCEL_GRID_STEP_METERS ); - S32 max_y = llround( north / PARCEL_GRID_STEP_METERS ); + S32 min_x = ll_round( west / PARCEL_GRID_STEP_METERS ); + S32 max_x = ll_round( east / PARCEL_GRID_STEP_METERS ); + S32 min_y = ll_round( south / PARCEL_GRID_STEP_METERS ); + S32 max_y = ll_round( north / PARCEL_GRID_STEP_METERS ); const S32 STRIDE = mParcelsPerEdge+1; @@ -416,12 +416,12 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectParcelAt(const LLVector3d& pos_ LLVector3d northeast = pos_global; southwest -= LLVector3d( PARCEL_GRID_STEP_METERS/2, PARCEL_GRID_STEP_METERS/2, 0 ); - southwest.mdV[VX] = llround( southwest.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); - southwest.mdV[VY] = llround( southwest.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); + southwest.mdV[VX] = ll_round( southwest.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); + southwest.mdV[VY] = ll_round( southwest.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); northeast += LLVector3d( PARCEL_GRID_STEP_METERS/2, PARCEL_GRID_STEP_METERS/2, 0 ); - northeast.mdV[VX] = llround( northeast.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); - northeast.mdV[VY] = llround( northeast.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); + northeast.mdV[VX] = ll_round( northeast.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); + northeast.mdV[VY] = ll_round( northeast.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); // Snap to parcel return selectLand( southwest, northeast, TRUE ); diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 76418ad6a6..230bdca4ef 100755 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -42,8 +42,6 @@ #include "llvovolume.h" const F32 PART_SIM_BOX_SIDE = 16.f; -const F32 PART_SIM_BOX_OFFSET = 0.5f*PART_SIM_BOX_SIDE; -const F32 PART_SIM_BOX_RAD = 0.5f*F_SQRT3*PART_SIM_BOX_SIDE; //static S32 LLViewerPartSim::sMaxParticleCount = 0; @@ -311,7 +309,6 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) if (part->mFlags & LLPartData::LL_PART_WIND_MASK) { - LLVector3 tempVel(part->mVelocity); part->mVelocity *= 1.f - 0.1f*dt; part->mVelocity += 0.1f*dt*regionp->mWind.getVelocity(regionp->getPosRegionFromAgent(part->mPosAgent)); } @@ -391,7 +388,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) } // Do glow interpolation - part->mGlow.mV[3] = (U8) llround(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); + part->mGlow.mV[3] = (U8) ll_round(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); // Set the last update time to now. part->mLastUpdateTime = cur_time; diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index a7fd2e0fe4..7efa821bbf 100755 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -313,7 +313,7 @@ void LLViewerPartSourceScript::update(const F32 dt) part->mStartGlow = mPartSysData.mPartData.mStartGlow; part->mEndGlow = mPartSysData.mPartData.mEndGlow; - part->mGlow = LLColor4U(0, 0, 0, (U8) llround(part->mStartGlow*255.f)); + part->mGlow = LLColor4U(0, 0, 0, (U8) ll_round(part->mStartGlow*255.f)); if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_DROP) { diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 7ebe12cc07..b8ac65f630 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -88,8 +88,6 @@ // out the two lists of capabilities for analysis. //#define DEBUG_CAPS_GRANTS -const F32 WATER_TEXTURE_SCALE = 8.f; // Number of times to repeat the water texture across a region -const S16 MAX_MAP_DIST = 10; // The server only keeps our pending agent info for 60 seconds. // We want to allow for seed cap retry, but its not useful after that 60 seconds. // Give it 3 chances, each at 18 seconds to give ourselves a few seconds to connect anyways if we give up. @@ -1937,7 +1935,6 @@ public: } else if( i != you_index) { - U32 loc = x << 16 | y << 8 | z; loc = loc; U32 pos = 0x0; pos |= x; pos <<= 8; @@ -2721,6 +2718,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("CopyInventoryFromNotecard"); capabilityNames.append("CreateInventoryCategory"); capabilityNames.append("DispatchRegionInfo"); + capabilityNames.append("DirectDelivery"); capabilityNames.append("EnvironmentSettings"); capabilityNames.append("EstateChangeInfo"); capabilityNames.append("EventQueueGet"); diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index 65ba3fb6e5..66e5742911 100755 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -39,9 +39,6 @@ #include "pipeline.h" #include "llviewercontrol.h" -static const S32 BAKE_UPLOAD_ATTEMPTS = 7; -static const F32 BAKE_UPLOAD_RETRY_DELAY = 2.f; // actual delay grows by power of 2 each attempt - // runway consolidate extern std::string self_av_string(); diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 0c4f55d704..85ae64aeff 100755 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -169,8 +169,7 @@ public: mImage(image), mLabel(utf8str_to_wstring(inv_item->getName())), mItem(inv_item), - mEditor(editor), - mHasMouseHover(false) + mEditor(editor) { mStyle = new LLStyle(LLStyle::Params().font(LLFontGL::getFontSansSerif())); @@ -262,8 +261,6 @@ private: std::string mToolTip; LLPointer<LLInventoryItem> mItem; LLTextEditor& mEditor; - bool mHasMouseHover; - }; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 4e2eef39d6..023457c0c8 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -452,7 +452,6 @@ void LLViewerTexture::initClass() // tuning params const F32 discard_bias_delta = .25f; const F32 discard_delta_time = 0.5f; -const S32 min_non_tex_system_mem = (128<<20); // 128 MB // non-const (used externally F32 texmem_lower_bound_scale = 0.85f; F32 texmem_middle_bound_scale = 0.925f; diff --git a/indra/newview/llviewertextureanim.cpp b/indra/newview/llviewertextureanim.cpp index 2b364851a7..9af92d7377 100755 --- a/indra/newview/llviewertextureanim.cpp +++ b/indra/newview/llviewertextureanim.cpp @@ -179,7 +179,7 @@ S32 LLViewerTextureAnim::animateTextures(F32 &off_s, F32 &off_t, if (!(mMode & SMOOTH)) { - frame_counter = (F32)llround(frame_counter); + frame_counter = (F32)ll_round(frame_counter); } // diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index b98726900f..8c27ddc63c 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1258,9 +1258,6 @@ LLPointer<LLImageJ2C> LLViewerTextureList::convertToUploadFile(LLPointer<LLImage return compressedImage; } -const S32 MIN_VIDEO_RAM = 32; -const S32 MAX_VIDEO_RAM = 512; // 512MB max for performance reasons. - // Returns min setting for TextureMemory (in MB) S32Megabytes LLViewerTextureList::getMinVideoRamSetting() { diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index 7de82a4710..0f73515b5d 100755 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -509,18 +509,7 @@ void LLViewerWearable::saveNewAsset() const //LL_INFOS() << *this << LL_ENDL; 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)) - { - successful_save = TRUE; - } - if(fp) - { - fclose(fp); - fp = NULL; - } - if(!successful_save) + if(! exportFile(filename)) { std::string buffer = llformat("Unable to save '%s' to wearable file.", mName.c_str()); LL_WARNS() << buffer << LL_ENDL; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 9dcd0b81e0..b63222590d 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -898,8 +898,8 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK const char* buttonstatestr = ""; S32 x = pos.mX; S32 y = pos.mY; - x = llround((F32)x / mDisplayScale.mV[VX]); - y = llround((F32)y / mDisplayScale.mV[VY]); + x = ll_round((F32)x / mDisplayScale.mV[VX]); + y = ll_round((F32)y / mDisplayScale.mV[VY]); // only send mouse clicks to UI if UI is visible if(gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) @@ -1065,8 +1065,8 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK { S32 x = pos.mX; S32 y = pos.mY; - x = llround((F32)x / mDisplayScale.mV[VX]); - y = llround((F32)y / mDisplayScale.mV[VY]); + x = ll_round((F32)x / mDisplayScale.mV[VX]); + y = ll_round((F32)y / mDisplayScale.mV[VY]); BOOL down = TRUE; BOOL handle = handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_RIGHT,down); @@ -1263,8 +1263,8 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask S32 x = pos.mX; S32 y = pos.mY; - x = llround((F32)x / mDisplayScale.mV[VX]); - y = llround((F32)y / mDisplayScale.mV[VY]); + x = ll_round((F32)x / mDisplayScale.mV[VX]); + y = ll_round((F32)y / mDisplayScale.mV[VY]); mMouseInWindow = TRUE; @@ -1722,7 +1722,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) LLCoordWindow size; mWindow->getSize(&size); mWindowRectRaw.set(0, size.mY, size.mX, 0); - mWindowRectScaled.set(0, llround((F32)size.mY / mDisplayScale.mV[VY]), llround((F32)size.mX / mDisplayScale.mV[VX]), 0); + mWindowRectScaled.set(0, ll_round((F32)size.mY / mDisplayScale.mV[VY]), ll_round((F32)size.mX / mDisplayScale.mV[VX]), 0); } LLFontManager::initClass(); @@ -2250,8 +2250,8 @@ void LLViewerWindow::reshape(S32 width, S32 height) LLUI::setScaleFactor(mDisplayScale); // update our window rectangle - mWindowRectScaled.mRight = mWindowRectScaled.mLeft + llround((F32)width / mDisplayScale.mV[VX]); - mWindowRectScaled.mTop = mWindowRectScaled.mBottom + llround((F32)height / mDisplayScale.mV[VY]); + mWindowRectScaled.mRight = mWindowRectScaled.mLeft + ll_round((F32)width / mDisplayScale.mV[VX]); + mWindowRectScaled.mTop = mWindowRectScaled.mBottom + ll_round((F32)height / mDisplayScale.mV[VY]); setup2DViewport(); @@ -2444,8 +2444,8 @@ void LLViewerWindow::draw() microsecondsToTimecodeString(gFrameTime,text); const LLFontGL* font = LLFontGL::getFontSansSerif(); font->renderUTF8(text, 0, - llround((getWindowWidthScaled()/2)-100.f), - llround((getWindowHeightScaled()-60.f)), + ll_round((getWindowWidthScaled()/2)-100.f), + ll_round((getWindowHeightScaled()-60.f)), LLColor4( 1.f, 1.f, 1.f, 1.f ), LLFontGL::LEFT, LLFontGL::TOP); } @@ -2521,7 +2521,7 @@ void LLViewerWindow::draw() const S32 DIST_FROM_TOP = 20; LLFontGL::getFontSansSerifBig()->renderUTF8( mOverlayTitle, 0, - llround( getWindowWidthScaled() * 0.5f), + ll_round( getWindowWidthScaled() * 0.5f), getWindowHeightScaled() - DIST_FROM_TOP, LLColor4(1, 1, 1, 0.4f), LLFontGL::HCENTER, LLFontGL::TOP); @@ -3373,7 +3373,7 @@ void LLViewerWindow::updateMouseDelta() fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds.value()*amount,1.f); fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds.value()*amount,1.f); - mCurrentMouseDelta.set(llround(fdx), llround(fdy)); + mCurrentMouseDelta.set(ll_round(fdx), ll_round(fdy)); mouse_vel.setVec(fdx,fdy); } else @@ -3488,10 +3488,10 @@ void LLViewerWindow::updateWorldViewRect(bool use_full_window) new_world_rect.mTop = llmax(new_world_rect.mTop, new_world_rect.mBottom + 1); new_world_rect.mRight = llmax(new_world_rect.mRight, new_world_rect.mLeft + 1); - new_world_rect.mLeft = llround((F32)new_world_rect.mLeft * mDisplayScale.mV[VX]); - new_world_rect.mRight = llround((F32)new_world_rect.mRight * mDisplayScale.mV[VX]); - new_world_rect.mBottom = llround((F32)new_world_rect.mBottom * mDisplayScale.mV[VY]); - new_world_rect.mTop = llround((F32)new_world_rect.mTop * mDisplayScale.mV[VY]); + new_world_rect.mLeft = ll_round((F32)new_world_rect.mLeft * mDisplayScale.mV[VX]); + new_world_rect.mRight = ll_round((F32)new_world_rect.mRight * mDisplayScale.mV[VX]); + new_world_rect.mBottom = ll_round((F32)new_world_rect.mBottom * mDisplayScale.mV[VY]); + new_world_rect.mTop = ll_round((F32)new_world_rect.mTop * mDisplayScale.mV[VY]); } if (mWorldViewRectRaw != new_world_rect) @@ -5140,10 +5140,10 @@ void LLViewerWindow::calcDisplayScale() LLRect LLViewerWindow::calcScaledRect(const LLRect & rect, const LLVector2& display_scale) { LLRect res = rect; - res.mLeft = llround((F32)res.mLeft / display_scale.mV[VX]); - res.mRight = llround((F32)res.mRight / display_scale.mV[VX]); - res.mBottom = llround((F32)res.mBottom / display_scale.mV[VY]); - res.mTop = llround((F32)res.mTop / display_scale.mV[VY]); + res.mLeft = ll_round((F32)res.mLeft / display_scale.mV[VX]); + res.mRight = ll_round((F32)res.mRight / display_scale.mV[VX]); + res.mBottom = ll_round((F32)res.mBottom / display_scale.mV[VY]); + res.mTop = ll_round((F32)res.mTop / display_scale.mV[VY]); return res; } @@ -5406,8 +5406,8 @@ void LLPickInfo::updateXYCoords() LLPointer<LLViewerTexture> imagep = LLViewerTextureManager::getFetchedTexture(tep->getID()); if(mUVCoords.mV[VX] >= 0.f && mUVCoords.mV[VY] >= 0.f && imagep.notNull()) { - mXYCoords.mX = llround(mUVCoords.mV[VX] * (F32)imagep->getWidth()); - mXYCoords.mY = llround((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight()); + mXYCoords.mX = ll_round(mUVCoords.mV[VX] * (F32)imagep->getWidth()); + mXYCoords.mY = ll_round((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight()); } } } @@ -5436,7 +5436,7 @@ void LLPickInfo::getSurfaceInfo() if (objectp) { - if (gViewerWindow->cursorIntersect(llround((F32)mMousePt.mX), llround((F32)mMousePt.mY), 1024.f, + if (gViewerWindow->cursorIntersect(ll_round((F32)mMousePt.mX), ll_round((F32)mMousePt.mY), 1024.f, objectp, -1, mPickTransparent, &mObjectFace, &intersection, @@ -5478,52 +5478,6 @@ void LLPickInfo::getSurfaceInfo() } } - -/* code to get UV via a special UV render - removed in lieu of raycast method -LLVector2 LLPickInfo::pickUV() -{ - LLVector2 result(-1.f, -1.f); - - LLViewerObject* objectp = getObject(); - if (!objectp) - { - return result; - } - - if (mObjectFace > -1 && - objectp->mDrawable.notNull() && objectp->getPCode() == LL_PCODE_VOLUME && - mObjectFace < objectp->mDrawable->getNumFaces()) - { - S32 scaled_x = llround((F32)mPickPt.mX * gViewerWindow->getDisplayScale().mV[VX]); - S32 scaled_y = llround((F32)mPickPt.mY * gViewerWindow->getDisplayScale().mV[VY]); - const S32 UV_PICK_WIDTH = 5; - const S32 UV_PICK_HALF_WIDTH = (UV_PICK_WIDTH - 1) / 2; - U8 uv_pick_buffer[UV_PICK_WIDTH * UV_PICK_WIDTH * 4]; - LLFace* facep = objectp->mDrawable->getFace(mObjectFace); - if (facep) - { - LLGLState scissor_state(GL_SCISSOR_TEST); - scissor_state.enable(); - LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION, scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH, FALSE); - //glViewport(scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH); - glScissor(scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH); - - glClear(GL_DEPTH_BUFFER_BIT); - - facep->renderSelectedUV(); - - glReadPixels(scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH, GL_RGBA, GL_UNSIGNED_BYTE, uv_pick_buffer); - U8* center_pixel = &uv_pick_buffer[4 * ((UV_PICK_WIDTH * UV_PICK_HALF_WIDTH) + UV_PICK_HALF_WIDTH + 1)]; - - result.mV[VX] = (F32)((center_pixel[VGREEN] & 0xf) + (16.f * center_pixel[VRED])) / 4095.f; - result.mV[VY] = (F32)((center_pixel[VGREEN] >> 4) + (16.f * center_pixel[VBLUE])) / 4095.f; - } - } - - return result; -} */ - - //static bool LLPickInfo::isFlora(LLViewerObject* object) { diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index 4e9400872a..c4430f4308 100755 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -123,10 +123,10 @@ BOOL LLVLComposition::generateHeights(const F32 x, const F32 y, S32 x_begin, y_begin, x_end, y_end; - x_begin = llround( x * mScaleInv ); - y_begin = llround( y * mScaleInv ); - x_end = llround( (x + width) * mScaleInv ); - y_end = llround( (y + width) * mScaleInv ); + x_begin = ll_round( x * mScaleInv ); + y_begin = ll_round( y * mScaleInv ); + x_end = ll_round( (x + width) * mScaleInv ); + y_end = ll_round( (y + width) * mScaleInv ); if (x_end > mWidth) { @@ -318,8 +318,8 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y, S32 x_begin, y_begin, x_end, y_end; x_begin = (S32)(x * mScaleInv); y_begin = (S32)(y * mScaleInv); - x_end = llround( (x + width) * mScaleInv ); - y_end = llround( (y + width) * mScaleInv ); + x_end = ll_round( (x + width) * mScaleInv ); + y_end = ll_round( (y + width) * mScaleInv ); if (x_end > mWidth) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a90fade3c9..1b905713b3 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -137,10 +137,6 @@ const LLUUID ANIM_AGENT_PHYSICS_MOTION = LLUUID("7360e029-3cb8-ebc4-863e-212df44 //----------------------------------------------------------------------------- // Constants //----------------------------------------------------------------------------- - -const S32 MIN_PIXEL_AREA_FOR_COMPOSITE = 1024; -const F32 SHADOW_OFFSET_AMT = 0.03f; - const F32 DELTA_TIME_MIN = 0.01f; // we clamp measured deltaTime to this const F32 DELTA_TIME_MAX = 0.2f; // range to insure stability of computations. @@ -148,22 +144,15 @@ const F32 PELVIS_LAG_FLYING = 0.22f;// pelvis follow half life while flying const F32 PELVIS_LAG_WALKING = 0.4f; // ...while walking const F32 PELVIS_LAG_MOUSELOOK = 0.15f; const F32 MOUSELOOK_PELVIS_FOLLOW_FACTOR = 0.5f; -const F32 PELVIS_LAG_WHEN_FOLLOW_CAM_IS_ON = 0.0001f; // not zero! - something gets divided by this! const F32 TORSO_NOISE_AMOUNT = 1.0f; // Amount of deviation from up-axis, in degrees const F32 TORSO_NOISE_SPEED = 0.2f; // Time scale factor on torso noise. const F32 BREATHE_ROT_MOTION_STRENGTH = 0.05f; -const F32 BREATHE_SCALE_MOTION_STRENGTH = 0.005f; - -const F32 MIN_SHADOW_HEIGHT = 0.f; -const F32 MAX_SHADOW_HEIGHT = 0.3f; const S32 MIN_REQUIRED_PIXEL_AREA_BODY_NOISE = 10000; const S32 MIN_REQUIRED_PIXEL_AREA_BREATHE = 10000; 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 = 512 / 4; // The size of local textures for other (!isSelf()) avatars const F32 HEAD_MOVEMENT_AVG_TIME = 0.9f; @@ -4188,8 +4177,8 @@ 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 ( getImage(TEX_HAIR_BAKED, 0) && - getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE || LLDrawPoolAlpha::sShowDebugAlpha) + if ( ( getImage(TEX_HAIR_BAKED, 0) && + getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE ) || LLDrawPoolAlpha::sShowDebugAlpha) { LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR); if (hair_mesh) @@ -7264,7 +7253,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe if (it != contents.mParams.end()) { S32 index = it - contents.mParams.begin(); - contents.mParamAppearanceVersion = llround(contents.mParamWeights[index]); + contents.mParamAppearanceVersion = ll_round(contents.mParamWeights[index]); LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mParamAppearanceVersion << LL_ENDL; } } diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index b8e9bbb77a..dc5e64d547 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -109,7 +109,6 @@ private: private: LLUUID mInitialBakeIDs[6]; - bool mInitialBakesLoaded; /******************************************************************************** diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index b79a48012a..8d8f33b601 100755 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -51,7 +51,6 @@ const S32 GRASS_MAX_BLADES = 32; const F32 GRASS_BLADE_BASE = 0.25f; // Width of grass at base -const F32 GRASS_BLADE_TOP = 0.25f; // Width of grass at top const F32 GRASS_BLADE_HEIGHT = 0.5f; // meters const F32 GRASS_DISTRIBUTION_SD = 0.15f; // empirically defined diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp index 23a8a61b85..cb83cf8fdf 100755 --- a/indra/newview/llvoicevisualizer.cpp +++ b/indra/newview/llvoicevisualizer.cpp @@ -70,7 +70,6 @@ const F32 DEFAULT_MAXIMUM_GESTICULATION_AMPLITUDE = 1.0f; //-------------------------------------------------------------------------------------- // other constants //-------------------------------------------------------------------------------------- -const F32 ONE_HALF = 1.0f; // to clarify intent and reduce magic numbers in the code. const LLVector3 WORLD_UPWARD_DIRECTION = LLVector3( 0.0f, 0.0f, 1.0f ); // Z is up in SL //------------------------------------------------------------------ diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index b6aecb4aaa..a6a7a35b03 100755 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -2519,7 +2519,7 @@ void LLVivoxVoiceClient::sendPositionalUpdate(void) if(!p->mIsSelf) { // scale from the range 0.0-1.0 to vivox volume in the range 0-100 - S32 volume = llround(p->mVolume / VOLUME_SCALE_VIVOX); + S32 volume = ll_round(p->mVolume / VOLUME_SCALE_VIVOX); bool mute = p->mOnMuteList; if(mute) diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index c1593fa5fc..1ba0868544 100755 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -44,8 +44,6 @@ #include "pipeline.h" #include "llspatialpartition.h" -const F32 MAX_PART_LIFETIME = 120.f; - extern U64MicrosecondsImplicit gFrameTime; LLPointer<LLVertexBuffer> LLVOPartGroup::sVB = NULL; @@ -683,7 +681,7 @@ void LLVOPartGroup::getGeometry(S32 idx, } else { - pglow = LLColor4U(0, 0, 0, (U8) llround(255.f*part.mStartGlow)); + pglow = LLColor4U(0, 0, 0, (U8) ll_round(255.f*part.mStartGlow)); pcolor = part.mStartColor; } } diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 07c2f0d44d..4dab213fa0 100755 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -62,8 +62,6 @@ static const S32 NUM_TILES = NUM_TILES_X * NUM_TILES_Y; static const F32 SUN_DISK_RADIUS = 0.5f; static const F32 MOON_DISK_RADIUS = SUN_DISK_RADIUS * 0.9f; static const F32 SUN_INTENSITY = 1e5; -static const F32 SUN_DISK_INTENSITY = 24.f; - // Texture coordinates: static const LLVector2 TEX00 = LLVector2(0.f, 0.f); @@ -619,21 +617,6 @@ static inline LLColor3 colorMix(LLColor3 const & left, LLColor3 const & right, F return (left + ((right - left) * amount)); } -static inline F32 texture2D(LLPointer<LLImageRaw> const & tex, LLVector2 const & uv) -{ - U16 w = tex->getWidth(); - U16 h = tex->getHeight(); - - U16 r = U16(uv[0] * w) % w; - U16 c = U16(uv[1] * h) % h; - - U8 const * imageBuffer = tex->getData(); - - U8 sample = imageBuffer[r * w + c]; - - return sample / 255.f; -} - static inline LLColor3 smear(F32 val) { return LLColor3(val, val, val); diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 66c0ace79d..367fa21b91 100755 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -396,9 +396,6 @@ void LLVOTree::idleUpdate(LLAgent &agent, const F64 &time) mTrunkLOD = trunk_LOD; } -const F32 TREE_BLEND_MIN = 1.f; -const F32 TREE_BLEND_RANGE = 1.f; - void LLVOTree::render(LLAgent &agent) { } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 66ee386874..18cc6d32a5 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -78,10 +78,8 @@ #include "llvocache.h" #include "llmaterialmgr.h" -const S32 MIN_QUIET_FRAMES_COALESCE = 30; const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; const F32 FORCE_CULL_AREA = 8.f; -const F32 MAX_LOD_DISTANCE = 24.f; U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG = 20; BOOL gAnimateTextures = TRUE; @@ -1222,7 +1220,7 @@ S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius) { // We've got LOD in the profile, and in the twist. Use radius. F32 tan_angle = (LLVOVolume::sLODFactor*radius)/distance; - cur_detail = LLVolumeLODGroup::getDetailFromTan(llround(tan_angle, 0.01f)); + cur_detail = LLVolumeLODGroup::getDetailFromTan(ll_round(tan_angle, 0.01f)); } else { @@ -1280,8 +1278,8 @@ BOOL LLVOVolume::calcLOD() // DON'T Compensate for field of view changing on FOV zoom. distance *= F_PI/3.f; - cur_detail = computeLODDetail(llround(distance, 0.01f), - llround(radius, 0.01f)); + cur_detail = computeLODDetail(ll_round(distance, 0.01f), + ll_round(radius, 0.01f)); if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) && @@ -1294,7 +1292,7 @@ BOOL LLVOVolume::calcLOD() if (cur_detail != mLOD) { - mAppAngle = llround((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); + mAppAngle = ll_round((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); mLOD = cur_detail; return TRUE; } diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index e3419af10d..9ce16a1674 100755 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -43,9 +43,6 @@ #include "pipeline.h" #include "llspatialpartition.h" -const BOOL gUseRoam = FALSE; - - /////////////////////////////////// template<class T> inline T LERP(T a, T b, F32 factor) @@ -53,12 +50,6 @@ template<class T> inline T LERP(T a, T b, F32 factor) return a + (b - a) * factor; } -const U32 N_RES_HALF = (N_RES >> 1); - -const U32 WIDTH = (N_RES * WAVE_STEP); //128.f //64 // width of wave tile, in meters -const F32 WAVE_STEP_INV = (1. / WAVE_STEP); - - LLVOWater::LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 58a00c5be0..c731a7d6cf 100755 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -382,6 +382,10 @@ class LLWearableItemCreationDateComparator : public LLWearableItemNameComparator { LOG_CLASS(LLWearableItemCreationDateComparator); +public: + // clang demands a default ctor here + LLWearableItemCreationDateComparator() {} + protected: /*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* item1, const LLPanelInventoryListItemBase* item2) const; }; diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index a8e06511d7..734018cfc2 100755 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -44,10 +44,7 @@ #include <typeinfo> #include <map> #include <boost/scoped_ptr.hpp> -#include <boost/lambda/core.hpp> -#include <boost/lambda/bind.hpp> - -namespace bll = boost::lambda; +#include <boost/bind.hpp> LLWindowListener::LLWindowListener(LLViewerWindow *window, const KeyboardGetter& kbgetter) : LLEventAPI("LLWindow", "Inject input events into the LLWindow instance"), @@ -358,6 +355,30 @@ static WhichButton buttons; typedef boost::function<bool(LLCoordGL, MASK)> MouseFunc; +// Wrap a function returning 'void' to return 'true' instead. I'm sure there's +// a more generic way to accomplish this, but generically handling the +// arguments seems to require variadic templates and perfect forwarding. (We +// used to be able to write (boost::lambda::bind(...), true), counting on +// boost::lambda's comma operator overload, until +// https://svn.boost.org/trac/boost/ticket/10864. And boost::phoenix doesn't +// seem to overload comma the same way; or at least not with bind().) +class MouseFuncTrue +{ + typedef boost::function<void(LLCoordGL, MASK)> MouseFuncVoid; + MouseFuncVoid mFunc; + +public: + MouseFuncTrue(const MouseFuncVoid& func): + mFunc(func) + {} + + bool operator()(LLCoordGL coords, MASK mask) const + { + mFunc(coords, mask); + return true; + } +}; + static void mouseEvent(const MouseFunc& func, const LLSD& request) { // Ensure we send response @@ -464,11 +485,11 @@ void LLWindowListener::mouseDown(LLSD const & request) if (actions.valid) { // Normally you can pass NULL to an LLWindow* without compiler - // complaint, but going through boost::lambda::bind() evidently + // complaint, but going through boost::bind() evidently // bypasses that special case: it only knows you're trying to pass an // int to a pointer. Explicitly cast NULL to the desired pointer type. - mouseEvent(bll::bind(actions.down, mWindow, - static_cast<LLWindow*>(NULL), bll::_1, bll::_2), + mouseEvent(boost::bind(actions.down, mWindow, + static_cast<LLWindow*>(NULL), _1, _2), request); } } @@ -478,8 +499,8 @@ void LLWindowListener::mouseUp(LLSD const & request) Actions actions(buttons.lookup(request["button"])); if (actions.valid) { - mouseEvent(bll::bind(actions.up, mWindow, - static_cast<LLWindow*>(NULL), bll::_1, bll::_2), + mouseEvent(boost::bind(actions.up, mWindow, + static_cast<LLWindow*>(NULL), _1, _2), request); } } @@ -489,12 +510,10 @@ void LLWindowListener::mouseMove(LLSD const & request) // We want to call the same central mouseEvent() routine for // handleMouseMove() as for button clicks. But handleMouseMove() returns // void, whereas mouseEvent() accepts a function returning bool -- and - // uses that bool return. Use (void-lambda-expression, true) to construct - // a callable that returns bool anyway. Pass 'true' because we expect that - // our caller will usually treat 'false' as a problem. - mouseEvent((bll::bind(&LLWindowCallbacks::handleMouseMove, mWindow, - static_cast<LLWindow*>(NULL), bll::_1, bll::_2), - true), + // uses that bool return. Use MouseFuncTrue to construct a callable that + // returns bool anyway. + mouseEvent(MouseFuncTrue(boost::bind(&LLWindowCallbacks::handleMouseMove, mWindow, + static_cast<LLWindow*>(NULL), _1, _2)), request); } diff --git a/indra/newview/llwlanimator.cpp b/indra/newview/llwlanimator.cpp index e568638cf6..2142885767 100755 --- a/indra/newview/llwlanimator.cpp +++ b/indra/newview/llwlanimator.cpp @@ -242,7 +242,7 @@ std::string LLWLAnimator::timeToString(F32 curTime) // get hours and minutes hours = (S32) (24.0 * curTime); curTime -= ((F32) hours / 24.0f); - min = llround(24.0f * 60.0f * curTime); + min = ll_round(24.0f * 60.0f * curTime); // handle case where it's 60 if(min == 60) diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index b4e8114a5f..74fb1ec78e 100755 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -70,7 +70,6 @@ U32 gAgentPauseSerialNum = 0; // // Constants // -const S32 MAX_NUMBER_OF_CLOUDS = 750; const S32 WORLD_PATCH_SIZE = 16; extern LLColor4U MAX_WATER_COLOR; @@ -978,8 +977,8 @@ void LLWorld::updateWaterObjects() } // Resize and reshape the water objects - const S32 water_center_x = center_x + llround((wx + dim[0]) * 0.5f * gDirAxes[dir][0]); - const S32 water_center_y = center_y + llround((wy + dim[1]) * 0.5f * gDirAxes[dir][1]); + const S32 water_center_x = center_x + ll_round((wx + dim[0]) * 0.5f * gDirAxes[dir][0]); + const S32 water_center_y = center_y + ll_round((wy + dim[1]) * 0.5f * gDirAxes[dir][1]); LLVOWater* waterp = mEdgeWaterObjects[dir]; if (!waterp || waterp->isDead()) diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 7cb53a0706..62fad32246 100755 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -67,7 +67,6 @@ const F32 OCEAN_GREEN = (F32)(0x47)/255.f; const F32 OCEAN_BLUE = (F32)(0x5F)/255.f; const F32 GODLY_TELEPORT_HEIGHT = 200.f; -const S32 SCROLL_HINT_WIDTH = 65; const F32 BIG_DOT_RADIUS = 5.f; BOOL LLWorldMapView::sHandledLastClick = FALSE; @@ -420,8 +419,8 @@ void LLWorldMapView::draw() if (overlayimage) { // Inform the fetch mechanism of the size we need - S32 draw_size = llround(sMapScale); - overlayimage->setKnownDrawSize(llround(draw_size * LLUI::getScaleFactor().mV[VX]), llround(draw_size * LLUI::getScaleFactor().mV[VY])); + S32 draw_size = ll_round(sMapScale); + overlayimage->setKnownDrawSize(ll_round(draw_size * LLUI::getScaleFactor().mV[VX]), ll_round(draw_size * LLUI::getScaleFactor().mV[VY])); // Draw something whenever we have enough info if (overlayimage->hasGLTexture()) { @@ -509,7 +508,7 @@ void LLWorldMapView::draw() drawImage(pos_global, sAvatarYouImage); LLVector3 pos_map = globalPosToView(pos_global); - if (!pointInView(llround(pos_map.mV[VX]), llround(pos_map.mV[VY]))) + if (!pointInView(ll_round(pos_map.mV[VX]), ll_round(pos_map.mV[VY]))) { drawTracking(pos_global, lerp(LLColor4::yellow, LLColor4::orange, 0.4f), @@ -774,8 +773,8 @@ void LLWorldMapView::drawGenericItem(const LLItemInfo& item, LLUIImagePtr image) void LLWorldMapView::drawImage(const LLVector3d& global_pos, LLUIImagePtr image, const LLColor4& color) { LLVector3 pos_map = globalPosToView( global_pos ); - image->draw(llround(pos_map.mV[VX] - image->getWidth() /2.f), - llround(pos_map.mV[VY] - image->getHeight()/2.f), + image->draw(ll_round(pos_map.mV[VX] - image->getWidth() /2.f), + ll_round(pos_map.mV[VY] - image->getHeight()/2.f), color); } @@ -784,8 +783,8 @@ void LLWorldMapView::drawImageStack(const LLVector3d& global_pos, LLUIImagePtr i LLVector3 pos_map = globalPosToView( global_pos ); for(U32 i=0; i<count; i++) { - image->draw(llround(pos_map.mV[VX] - image->getWidth() /2.f), - llround(pos_map.mV[VY] - image->getHeight()/2.f + i*offset), + image->draw(ll_round(pos_map.mV[VX] - image->getWidth() /2.f), + ll_round(pos_map.mV[VY] - image->getHeight()/2.f + i*offset), color); } } @@ -959,8 +958,8 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4& const std::string& label, const std::string& tooltip, S32 vert_offset ) { LLVector3 pos_local = globalPosToView( pos_global ); - S32 x = llround( pos_local.mV[VX] ); - S32 y = llround( pos_local.mV[VY] ); + S32 x = ll_round( pos_local.mV[VX] ); + S32 y = ll_round( pos_local.mV[VY] ); LLFontGL* font = LLFontGL::getFontSansSerifSmall(); S32 text_x = x; S32 text_y = (S32)(y - sTrackCircleImage->getHeight()/2 - font->getLineHeight()); @@ -1111,8 +1110,8 @@ static void drawDot(F32 x_pixels, F32 y_pixels, if(-HEIGHT_THRESHOLD <= relative_z && relative_z <= HEIGHT_THRESHOLD) { - dot_image->draw(llround(x_pixels) - dot_image->getWidth()/2, - llround(y_pixels) - dot_image->getHeight()/2, + dot_image->draw(ll_round(x_pixels) - dot_image->getWidth()/2, + ll_round(y_pixels) - dot_image->getHeight()/2, color); } else @@ -1167,9 +1166,9 @@ void LLWorldMapView::drawAvatar(F32 x_pixels, dot_image = sAvatarAboveImage; } } - S32 dot_width = llround(dot_radius * 2.f); - dot_image->draw(llround(x_pixels - dot_radius), - llround(y_pixels - dot_radius), + S32 dot_width = ll_round(dot_radius * 2.f); + dot_image->draw(ll_round(x_pixels - dot_radius), + ll_round(y_pixels - dot_radius), dot_width, dot_width, color); @@ -1196,8 +1195,8 @@ void LLWorldMapView::drawIconName(F32 x_pixels, const std::string& second_line) { const S32 VERT_PAD = 8; - S32 text_x = llround(x_pixels); - S32 text_y = llround(y_pixels + S32 text_x = ll_round(x_pixels); + S32 text_y = ll_round(y_pixels - BIG_DOT_RADIUS - VERT_PAD); @@ -1385,8 +1384,8 @@ void LLWorldMapView::setDirectionPos( LLTextBox* text_box, F32 rotation ) F32 radius = llmin( map_half_height - text_half_height, map_half_width - text_half_width ); text_box->setOrigin( - llround(map_half_width - text_half_width + radius * cos( rotation )), - llround(map_half_height - text_half_height + radius * sin( rotation )) ); + ll_round(map_half_width - text_half_width + radius * cos( rotation )), + ll_round(map_half_height - text_half_height + radius * sin( rotation )) ); } @@ -1434,8 +1433,8 @@ void LLWorldMapView::reshape( S32 width, S32 height, BOOL called_from_parent ) bool LLWorldMapView::checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track) { LLVector3 pos_view = globalPosToView(item.getGlobalPosition()); - S32 item_x = llround(pos_view.mV[VX]); - S32 item_y = llround(pos_view.mV[VY]); + S32 item_x = ll_round(pos_view.mV[VX]); + S32 item_y = ll_round(pos_view.mV[VY]); if (x < item_x - BIG_DOT_RADIUS) return false; if (x > item_x + BIG_DOT_RADIUS) return false; @@ -1599,8 +1598,8 @@ BOOL LLWorldMapView::handleMouseDown( S32 x, S32 y, MASK mask ) { gFocusMgr.setMouseCapture( this ); - mMouseDownPanX = llround(sPanX); - mMouseDownPanY = llround(sPanY); + mMouseDownPanX = ll_round(sPanX); + mMouseDownPanY = ll_round(sPanY); mMouseDownX = x; mMouseDownY = y; sHandledLastClick = TRUE; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3dfe1e5992..03712c1065 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -207,15 +207,9 @@ F32 LLPipeline::CameraDoFResScale; F32 LLPipeline::RenderAutoHideSurfaceAreaLimit; LLTrace::EventStatHandle<S64> LLPipeline::sStatBatchSize("renderbatchsize"); -const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f; -const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f; const F32 BACKLIGHT_DAY_MAGNITUDE_OBJECT = 0.1f; const F32 BACKLIGHT_NIGHT_MAGNITUDE_OBJECT = 0.08f; -const S32 MAX_OFFSCREEN_GEOMETRY_CHANGES_PER_FRAME = 10; -const U32 REFLECTION_MAP_RES = 128; const U32 DEFERRED_VB_MASK = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1; -// Max number of occluders to search for. JC -const S32 MAX_OCCLUDER_COUNT = 2; extern S32 gBoxFrame; //extern BOOL gHideSelectedObjects; @@ -410,16 +404,6 @@ static LLPipelineListener sPipelineListener; static LLCullResult* sCull = NULL; -static const U32 gl_cube_face[] = -{ - GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, - GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, - GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, - GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, - GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, - GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, -}; - void validate_framebuffer_object(); diff --git a/indra/newview/skins/default/textures/icons/Inv_StockFolderClosed.png b/indra/newview/skins/default/textures/icons/Inv_StockFolderClosed.png Binary files differnew file mode 100644 index 0000000000..4dc484dc22 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Inv_StockFolderClosed.png diff --git a/indra/newview/skins/default/textures/icons/Inv_StockFolderOpen.png b/indra/newview/skins/default/textures/icons/Inv_StockFolderOpen.png Binary files differnew file mode 100644 index 0000000000..0d140b56a7 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Inv_StockFolderOpen.png diff --git a/indra/newview/skins/default/textures/icons/Inv_VersionFolderClosed.png b/indra/newview/skins/default/textures/icons/Inv_VersionFolderClosed.png Binary files differnew file mode 100644 index 0000000000..e89a4d7f31 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Inv_VersionFolderClosed.png diff --git a/indra/newview/skins/default/textures/icons/Inv_VersionFolderOpen.png b/indra/newview/skins/default/textures/icons/Inv_VersionFolderOpen.png Binary files differnew file mode 100644 index 0000000000..659d7d392f --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Inv_VersionFolderOpen.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 9c2d55e7b4..d9d5e607cb 100755 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -140,6 +140,7 @@ with the same filename but different name <texture name="Command_Inventory_Icon" file_name="toolbar_icons/inventory.png" preload="true" /> <texture name="Command_Map_Icon" file_name="toolbar_icons/map.png" preload="true" /> <texture name="Command_Marketplace_Icon" file_name="toolbar_icons/marketplace.png" preload="true" /> + <texture name="Command_MktListings_Icon" file_name="toolbar_icons/mktlistings.png" preload="true" /> <texture name="Command_MiniCart_Icon" file_name="toolbar_icons/mini_cart.png" preload="true" /> <texture name="Command_MiniMap_Icon" file_name="toolbar_icons/mini_map.png" preload="true" /> <texture name="Command_Move_Icon" file_name="toolbar_icons/move.png" preload="true" /> @@ -305,6 +306,8 @@ with the same filename but different name <texture name="Inv_Snapshot" file_name="icons/Inv_Snapshot.png" preload="false" /> <texture name="Inv_Socks" file_name="icons/Inv_Socks.png" preload="false" /> <texture name="Inv_Sound" file_name="icons/Inv_Sound.png" preload="false" /> + <texture name="Inv_StockFolderClosed" file_name="icons/Inv_StockFolderClosed.png" preload="false" /> + <texture name="Inv_StockFolderOpen" file_name="icons/Inv_StockFolderOpen.png" preload="false" /> <texture name="Inv_SysClosed" file_name="icons/Inv_SysClosed.png" preload="false" /> <texture name="Inv_SysOpen" file_name="icons/Inv_SysOpen.png" preload="false" /> <texture name="Inv_Tattoo" file_name="icons/Inv_Tattoo.png" preload="false" /> @@ -316,6 +319,8 @@ with the same filename but different name <texture name="Inv_Undershirt" file_name="icons/Inv_Undershirt.png" preload="false" /> <texture name="Inv_Link" file_name="icons/Inv_Link.png" preload="false" /> <texture name="Inv_Invalid" file_name="icons/Inv_Invalid.png" preload="false" /> + <texture name="Inv_VersionFolderClosed" file_name="icons/Inv_VersionFolderClosed.png" preload="false" /> + <texture name="Inv_VersionFolderOpen" file_name="icons/Inv_VersionFolderOpen.png" preload="false" /> <texture name="Linden_Dollar_Alert" file_name="widgets/Linden_Dollar_Alert.png"/> <texture name="Linden_Dollar_Background" file_name="widgets/Linden_Dollar_Background.png"/> @@ -333,6 +338,7 @@ with the same filename but different name <texture name="Map_Placeholder_Icon" file_name="icons/map_placeholder.png" preload="true" /> + <texture name="Marketplace_Dropzone_Background" file_name="widgets/Marketplace_Dropzone_Background.png" preload="true" /> <texture name="MarketplaceBtn_Off" file_name="widgets/MarketplaceBtn_Off.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" /> <texture name="MarketplaceBtn_Selected" file_name="widgets/MarketplaceBtn_Selected.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" /> diff --git a/indra/newview/skins/default/textures/toolbar_icons/mktlistings.png b/indra/newview/skins/default/textures/toolbar_icons/mktlistings.png Binary files differnew file mode 100644 index 0000000000..a6f90461d7 --- /dev/null +++ b/indra/newview/skins/default/textures/toolbar_icons/mktlistings.png diff --git a/indra/newview/skins/default/textures/widgets/Marketplace_Dropzone_Background.png b/indra/newview/skins/default/textures/widgets/Marketplace_Dropzone_Background.png Binary files differnew file mode 100644 index 0000000000..9478f7b813 --- /dev/null +++ b/indra/newview/skins/default/textures/widgets/Marketplace_Dropzone_Background.png diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index ef2f158a86..60f36770bb 100755 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -51,44 +51,20 @@ name="credits_panel"> <text follows="top|left|right" - height="10" + height="20" layout="topleft" left="5" name="linden_intro" top="10" width="435" wrap="true"> -Second Life is brought to you by the Lindens: - </text> - <text_editor - enabled="false" - follows="top|left" - height="98" - bg_readonly_color="Transparent" - left="5" - text_color="LtGray" - max_length="65536" - name="linden_names" - top_pad="10" - width="435" - word_wrap="true"> -Philip, Andrew, Doug, Richard, Phoenix, Ian, Mark, Robin, Dan, Char, Ryan, Eric, Jim, Lee, Jeff, Michael, Kelly, Steve, Catherine, Bub, Ramzi, Jill, Jeska, Don, Kona, Callum, Charity, Jack, Shawn, babbage, James, Lauren, Blue, Brent, Reuben, Pathfinder, Jesse, Patsy, Torley, Bo, Cyn, Jonathan, Gia, Annette, Ginsu, Harry, Lex, Runitai, Guy, Cornelius, Beth, Swiss, Thumper, Wendy, Teeple, Seth, Dee, Mia, Sally, Liana, Aura, Beez, Milo, Red, Gulliver, Marius, Joe, Jose, Dore, Justin, Nora, Morpheus, Lexie, Amber, Chris, Xan, Leyla, Walker, Sabin, Joshua, Hiromi, Tofu, Fritz, June, Jean, Ivy, Dez, Ken, Betsy, Which, Spike, Rob, Zee, Dustin, George, Claudia, del, Matthew, jane, jay, Adrian, Yool, Rika, Yoz, siobhan, Qarl, Benjamin, Beast, Everett, madhavi, Christopher, Izzy, stephany, Jeremy, sean, adreanne, Pramod, Tobin, sejong, Iridium, maurice, kj, Meta, kari, JP, bert, kyle, Jon, Socrates, Bridie, Ivan, maria, Aric, Coco, Periapse, sandy, Storrs, Lotte, Colossus, Brad, Pastrami, Zen, BigPapi, Banzai, Sardonyx, Mani, Garry, Jaime, Neuro, Samuel, Niko, CeeLo, Austin, Soft, Poppy, emma, tessa, angelo, kurz, alexa, Sue, CG, Blake, Erica, Brett, Bevis, kristen, Q, simon, Enus, MJ, laurap, Kip, Scouse, Ron, Ram, kend, Marty, Prospero, melissa, kraft, Nat, Seraph, Hamilton, Lordan, Green, miz, Ashlei, Trinity, Ekim, Echo, Charlie, Rowan, Rome, Jt, Doris, benoc, Christy, Bao, Kate, Tj, Patch, Cheah, Johan, Brandy, Angela, Oreh, Cogsworth, Lan, Mitchell, Space, Bambers, Einstein, Bender, Malbers, Matias, Maggie, Rothman, Milton, Niall, Marin, Allison, Mango, Andrea, Katt, Yi, Ambroff, Rico, Raymond, Gail, Christa, William, Dawn, Usi, Dynamike, M, Corr, Dante, Molly, kaylee, Danica, Kelv, Lil, jacob, Nya, Rodney, elsie, Blondin, Grant, Nyx, Devin, Monty, Minerva, Keira, Katie, Jenn, Makai, Clare, Joy, Cody, Gayathri, FJ, spider, Oskar, Landon, Jarv, Noelle, Al, Doc, Gray, Vir, t, Maestro, Simone, Shannon, yang, Courtney, Scott, charlene, Quixote, Susan, Zed, Amanda, Katelin, Esbee, JoRoan, Enkidu, roxie, Scarlet, Merov, Kevin, Judy, Rand, Newell, Les, Dessie, Galen, Michon, Geo, Siz, Calyle, Pete, Praveen, Callen, Sheldon, Pink, Nelson, jenelle, Terrence, Nathan, Juan, Sascha, Huseby, Karina, Kaye, Kotler, Lis, Darv, Charrell, Dakota, Kimmora, Theeba, Taka, Mae, Perry, Ducot, dana, Esther, Dough, gisele, Doten, Viale, Fisher, jessieann, ashley, Torres, delby, rountree, kurt, Slaton, Madison, Rue, Gino, Wen, Casssandra, Brodesky, Squid, Gez, Rakesh, Gecko, Ladan, Tony, Tatem, Squire, Falcon, BK, Crimp, Tiggs, Bacon, Coyot, Carmilla, Webb, Sea, Arch, Jillian, Jason, Bernard, Vogt, Peggy, dragon, Pup, xandix, Wallace, Bewest, Inoshiro, Rhett, AG, Aimee, Ghengis, Itiaes, Eli, Steffan, Epic, Grapes, Stone, Prep, Scobu, Robert, Alain, Carla, Vicky, Tia, Alec, Taras, Lisa, Oz, Ariane, Log, House, Kazu, Kim, Drofnas, Tyler, Campbell, Michele, Madeline, Nelly, Baron, Thor, Lori, Hele, Fredrik, Teddy, Pixie, Berry, Gabrielle, Alfonso, Brooke, Wolf, Ringo, Cru, Charlar, Rodvik, Gibson, Elise, Bagman, Greger, Leonidas, Jerm, Leslie, CB, Brenda, Durian, Carlo, mm, Zeeshan, Caleb, Max, Elikak, Mercille, Steph, Chase, Baker - </text_editor> - <text - follows="top|left" - height="10" - layout="topleft" - left="5" - name="contrib_intro" - top_pad="10" - width="435" - wrap="true"> +Second Life is brought to you by the Lindens, with open source contributions from: </text> <text_editor enabled="false" follows="top|left" - height="98" + height="340" bg_readonly_color="Transparent" left="5" text_color="LtGray" @@ -99,31 +75,6 @@ with open source contributions from: word_wrap="true"> Dummy Name replaced at run time </text_editor> - <text - follows="top|left" - height="10" - layout="topleft" - left="5" - name="trans_intro" - top_pad="10" - width="435" - wrap="true"> -and translations from: - </text> - <text_editor - enabled="false" - follows="top|left" - height="98" - bg_readonly_color="Transparent" - left="5" - text_color="LtGray" - max_length="65536" - name="trans_names" - top_pad="10" - width="435" - word_wrap="true"> -Dummy Name replaced at run time - </text_editor> </panel> <panel border="true" @@ -138,7 +89,7 @@ Dummy Name replaced at run time left="5" text_color="LtGray" max_length="65536" - name="credits_editor" + name="licenses_editor" top="5" width="435" word_wrap="true"> diff --git a/indra/newview/skins/default/xui/en/floater_associate_listing.xml b/indra/newview/skins/default/xui/en/floater_associate_listing.xml new file mode 100755 index 0000000000..e019ed58dd --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_associate_listing.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + can_minimize="false" + height="110" + layout="topleft" + name="associate listing" + help_topic="associate_listing" + title="ASSOCIATE LISTING" + width="375"> + <text + type="string" + length="1" + follows="top|left" + font="SansSerifLarge" + height="16" + layout="topleft" + left="10" + top="25" + name="message"> + Listing ID: + </text> + <line_editor + type="string" + length="1" + follows="top|right" + font="SansSerif" + height="20" + layout="topleft" + left_delta="0" + name="listing_id" + top_pad="5" + width="350"> + Type ID here + </line_editor> + <button + follows="bottom|left" + height="23" + label="OK" + layout="topleft" + left="155" + name="OK" + top_pad="10" + width="100" /> + <button + follows="bottom|right" + height="23" + label="Cancel" + layout="topleft" + left_pad="5" + name="Cancel" + width="100" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_item_properties.xml b/indra/newview/skins/default/xui/en/floater_item_properties.xml new file mode 100755 index 0000000000..0fc54a9c8b --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_item_properties.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + height="570" + layout="topleft" + name="Item Properties" + help_topic="item+properties" + title="ITEM PROPERTIES" + width="330"> + <panel + follows="all" + layout="topleft" + left="0" + class="sidepanel_item_info" + filename="sidepanel_item_info.xml" + name="item_panel" + top="20" + label="" + height="570" + visible="true" + width="330"> + </panel> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_marketplace_listings.xml b/indra/newview/skins/default/xui/en/floater_marketplace_listings.xml new file mode 100755 index 0000000000..0806a87288 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_marketplace_listings.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<floater + title="MARKETPLACE LISTINGS" + name="floater_marketplace_listings" + help_topic="floater_marketplace_listings" + positioning="cascading" + width="333" + height="445" + min_width="200" + min_height="300" + can_close="true" + can_resize="true" + save_rect="true" + save_visibility="false" + reuse_instance="true"> + <panel + name="marketplace_listings_panel" + follows="all" + layout="topleft" + left="0" + top="0" + height="440" + width="333"> + <panel + follows="all" + left="10" + height="440" + width="313" + top="0" + bg_opaque_color="InventoryBackgroundColor"> + <panel + name="marketplace_listings_inventory_placeholder_panel" + follows="all" + layout="topleft" + top="0" + left="0" + width="313" + height="440" + bg_opaque_color="InventoryBackgroundColor"> + <text + name="marketplace_listings_inventory_placeholder_title" + type="string" + follows="top|left|right" + layout="topleft" + top="10" + left="0" + width="313" + height="25" + wrap="true" + halign="center" + font="SansSerifBold"> + Loading... + </text> + <text + name="marketplace_listings_inventory_placeholder_text" + type="string" + follows="top|left|right" + layout="topleft" + top="35" + left="0" + width="313" + height="130" + wrap="true" + halign="left" /> + </panel> + <panel + name="panel_marketplace_listing" + filename="panel_marketplace_listings.xml" + class="llpanelmarketplacelistings" + top="0" + follows="all"/> + </panel> + <panel + name="marketplace_panel_status" + follows="bottom|left|right" + layout="topleft" + left="10" + width="313" + height="20"> + <text + name="marketplace_status" + type="string" + follows="bottom|left|right" + layout="topleft" + top="0" + left="5" + width="150" + height="20" + wrap="true" + halign="left" + valign="center" + font="SansSerif"/> + </panel> + <layout_stack name="initialization_progress_indicator" orientation="vertical" left="0" height="440" top="0" width="333" follows="all" visible="false"> + <layout_panel /> + <layout_panel height="24" auto_resize="false"> + <layout_stack orientation="horizontal" left="0" height="24" top="0" width="333" follows="all"> + <layout_panel width="0" /> + <layout_panel width="24" auto_resize="false"> + <loading_indicator + height="24" + layout="topleft" + left="0" + top="0" + width="24" /> + </layout_panel> + <layout_panel width="0" /> + </layout_stack> + </layout_panel> + <layout_panel /> + </layout_stack> + </panel> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_marketplace_validation.xml b/indra/newview/skins/default/xui/en/floater_marketplace_validation.xml new file mode 100755 index 0000000000..9035a7c161 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_marketplace_validation.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + title="Audit Marketplace Listings" + name="floater_marketplace_validation" + help_topic="floater_marketplace_validation" + layout="topleft" + positioning="cascading" + legacy_header_height="18" + width="600" + height="500" + min_width="400" + min_height="200" + can_close="true" + can_resize="true" + can_minimize="true" + save_rect="true" + reuse_instance="true" + save_visibility="false"> + <button + name="OK" + label="OK" + label_selected="OK" + layout="topleft" + follows="right|bottom" + top="465" + width="100" + height="20" + left="484"/> + <text_editor + name="validation_text" + type="string" + font="SansSerif" + length="1" + max_length="65536" + layout="topleft" + follows="all" + bg_readonly_color="TextBgReadOnlyColor" + text_readonly_color="TextFgReadOnlyColor" + top="25" + bottom="455" + left="20" + right="-20" + word_wrap="true"> + MARKETPLACE_VALIDATION_TEXT + </text_editor> +</floater> diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 7099db63ab..91adec0789 100755 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -4,6 +4,81 @@ layout="topleft" name="Popup" visible="false"> + <menu_item_call + label="Create listing" + layout="topleft" + name="Marketplace Create Listing"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="marketplace_create_listing" /> + </menu_item_call> + <menu_item_call + label="Associate listing" + layout="topleft" + name="Marketplace Associate Listing"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="marketplace_associate_listing" /> + </menu_item_call> + <menu_item_call + label="Get (Refresh) listing" + layout="topleft" + name="Marketplace Get Listing"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="marketplace_get_listing" /> + </menu_item_call> + <menu_item_call + label="Check for errors" + layout="topleft" + name="Marketplace Check Listing"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="marketplace_check_listing" /> + </menu_item_call> + <menu_item_call + label="Edit listing" + layout="topleft" + name="Marketplace Edit Listing"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="marketplace_edit_listing" /> + </menu_item_call> + <menu_item_call + label="List" + layout="topleft" + name="Marketplace List"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="marketplace_list" /> + </menu_item_call> + <menu_item_call + label="Unlist" + layout="topleft" + name="Marketplace Unlist"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="marketplace_unlist" /> + </menu_item_call> + <menu_item_call + label="Activate" + layout="topleft" + name="Marketplace Activate"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="marketplace_activate" /> + </menu_item_call> + <menu_item_call + label="Deactivate" + layout="topleft" + name="Marketplace Deactivate"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="marketplace_deactivate" /> + </menu_item_call> + <menu_item_separator + layout="topleft" + name="Marketplace Listings Separator" /> <menu_item_call label="Share" layout="topleft" @@ -718,12 +793,20 @@ parameter="copy_to_outbox" /> </menu_item_call> <menu_item_call - label="Send to Marketplace" - layout="topleft" - name="Marketplace Send"> + label="Copy to Marketplace Listings" + layout="topleft" + name="Marketplace Copy"> <menu_item_call.on_click - function="Inventory.DoToSelected" - parameter="send_to_marketplace" /> + function="Inventory.DoToSelected" + parameter="copy_to_marketplace_listings" /> + </menu_item_call> + <menu_item_call + label="Move to Marketplace Listings" + layout="topleft" + name="Marketplace Move"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="move_to_marketplace_listings" /> </menu_item_call> <menu_item_call label="--no options--" diff --git a/indra/newview/skins/default/xui/en/menu_marketplace_view.xml b/indra/newview/skins/default/xui/en/menu_marketplace_view.xml new file mode 100755 index 0000000000..a9e9b5a28f --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_marketplace_view.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<toggleable_menu + name="menu_marketplace_sort" + left="0" bottom="0" visible="false" + mouse_opaque="false"> + <menu_item_check + label="Sort by stock amount (low to high)" + name="sort_by_stock_amount"> + <menu_item_check.on_click + function="Marketplace.ViewSort.Action" + parameter="sort_by_stock_amount"/> + <menu_item_check.on_check + function="Marketplace.ViewSort.CheckItem" + parameter="sort_by_stock_amount"/> + </menu_item_check> + <menu_item_check + label="Show only listing folders" + name="show_only_listing_folders"> + <menu_item_check.on_click + function="Marketplace.ViewSort.Action" + parameter="show_only_listing_folders"/> + <menu_item_check.on_check + function="Marketplace.ViewSort.CheckItem" + parameter="show_only_listing_folders"/> + </menu_item_check> +</toggleable_menu> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 560f81a6fd..08c4151dbb 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -173,6 +173,13 @@ function="Floater.ToggleOrBringToFront" parameter="outbox" /> </menu_item_call> + <menu_item_call + label="Marketplace listings..." + name="MarketplaceListings"> + <menu_item_call.on_click + function="Floater.ToggleOrBringToFront" + parameter="marketplace_listings" /> + </menu_item_call> <menu_item_call label="Account dashboard..." name="Manage My Account"> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index b4d8046d18..541a240745 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -308,9 +308,215 @@ Initialization with the Marketplace failed because of a system or network error. name="okbutton" yestext="OK"/> </notification> + + <notification + icon="OutboxStatus_Error" + name="StockPasteFailed" + type="outbox"> + Copy or move to Stock Folder failed with error : + + '[ERROR_CODE]' + + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="OutboxStatus_Error" + name="MerchantPasteFailed" + type="outbox"> + Copy or move to Marketplace Listings failed with error : + + '[ERROR_CODE]' + + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + <notification + icon="OutboxStatus_Error" + name="MerchantTransactionFailed" + type="outbox"> + The transaction with the Marketplace failed with the following error : + + Reason : '[ERROR_REASON]' + [ERROR_DESCRIPTION] + + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="OutboxStatus_Error" + name="MerchantUnprocessableEntity" + type="outbox"> + We are unable to list this product or activate the version folder. Usually this is caused by missing information in the listing description form, but it may be due to errors in the folder structure. Either edit the listing or check the listing folder for errors. + + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> <notification + icon="OutboxStatus_Error" + name="MerchantListingFailed" + type="outbox"> + Listing to Marketplace failed with error : + + '[ERROR_CODE]' + + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="OutboxStatus_Error" + name="MerchantFolderActivationFailed" + type="outbox"> + Activating this version folder failed with error : + + '[ERROR_CODE]' + + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmMerchantActiveChange" + type="alertmodal"> + This action will change the active content of this listing. Do you want to continue? + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm before I change an active listing on the marketplace" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmMerchantMoveInventory" + type="alertmodal"> + Items dragged to the Marketplace Listings window are moved from their original locations, not copied. Do you want to continue? + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm before I move an item from the inventory to the marketplace" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmListingCutOrDelete" + type="alertmodal"> + Moving or deleting a listing folder will delete your Marketplace listing. If you would like to keep the Marketplace listing, move or delete the contents of the version folder you would like to modify. Do you want to continue? + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm before I move or delete a listing from the marketplace" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmCopyToMarketplace" + type="alertmodal"> + You don't have permission to copy one or more of these items to the Marketplace. You can move them or leave them behind. + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm before I try to copy a selection containing no copy items to the marketplace" + name="yesnocancelbuttons" + yestext="Move item(s)" + notext="Don't move item(s)" + canceltext="Cancel"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmMerchantUnlist" + type="alertmodal"> + This action will unlist this listing. Do you want to continue? + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm before I unlist an active listing on the marketplace" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmMerchantClearVersion" + type="alertmodal"> + This action will deactivate the version folder of the current listing. Do you want to continue? + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm before I deactivate the version folder of a listing on the marketplace" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="AlertMerchantListingNotUpdated" + type="alertmodal"> +This listing could not be updated. +[[URL] Click here] to edit it on the Marketplace. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="AlertMerchantListingCannotWear" + type="alertmodal"> + You cannot wear clothes or body parts that are in the Marketplace Listings folder. + <tag>fail</tag> + </notification> + + <notification + icon="alertmodal.tga" + name="AlertMerchantListingInvalidID" + type="alertmodal"> + Invalid listing ID. + <tag>fail</tag> + </notification> + + <notification + icon="alertmodal.tga" + name="AlertMerchantListingActivateRequired" + type="alertmodal"> + There are several or no version folders in this listing. You will need to select and activate one independently later. + <tag>confirm</tag> + <usetemplate + ignoretext="Alert about version folder activation when I create a listing with several version folders" + name="okignore" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="AlertMerchantStockFolderSplit" + type="alertmodal"> + We have separated stock items of different types into separate stock folders, so your folder is arranged in a way that we can list it. + <tag>confirm</tag> + <usetemplate + ignoretext="Alert when stock folder is being split before being listed" + name="okignore" + yestext="OK"/> + </notification> + + <notification icon="alertmodal.tga" name="CompileQueueSaveText" type="alertmodal"> @@ -4491,6 +4697,13 @@ Are you sure you want to change the Estate Covenant? </notification> <notification + icon="alertmodal.tga" + name="SLM_UPDATE_FOLDER" + type="alertmodal"> + [MESSAGE] + </notification> + + <notification icon="alertmodal.tga" name="RegionEntryAccessBlocked_AdultsOnlyContent" type="alertmodal"> diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index a258a874b0..183ae2e824 100755 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -19,7 +19,7 @@ left="0" name="ui_stack" orientation="horizontal" - top="0" + top="10" width="1024"> <layout_panel height="172" @@ -30,7 +30,7 @@ auto_resize="false" follows="left|right|top" name="ui_container" - width="960" + width="1000" left="0" top="0" height="172"> @@ -56,7 +56,8 @@ name="username_combo" width="232"> <combo_box.combo_editor - text_pad_left="8" /> + text_pad_left="8" + bg_image_always_focused="true"/> <combo_box.combo_button visible="false" /> <combo_box.drop_down_button @@ -65,79 +66,42 @@ <line_editor follows="left|top" height="32" - left_pad="0" + left_pad="-11" max_length_bytes="16" text_pad_left="8" name="password_edit" label="Password" + bg_image_always_focused="true" font="SansSerifLarge" is_password="true" select_on_focus="true" commit_on_focus_lost="false" bottom_delta="0" - width="200" /> - <check_box - control_name="RememberPassword" - follows="left|top" - font="SansSerifMedium" - left_pad="20" - bottom_delta="-14" - height="24" - label="Remember me" - check_button.bottom="3" - name="remember_check" - width="145" /> - <text - follows="left|top" - font="SansSerifMedium" - text_color="EmphasisColor" - height="16" - name="forgot_password_text" - left_delta="0" - bottom_delta="16" - width="200"> - Forgotten password - </text> - <button - follows="left|top" - image_unselected="PushButton_Login" - image_pressed="PushButton_Login_Pressed" - image_hover="PushButton_Login_Over" - label="Log In" - label_color="White" - font="SansSerifMedium" - name="connect_btn" - enabled="true" - left="0" - width="80" - height="26" - bottom_delta="44" /> - <text - follows="left|top" - font="SansSerifLarge" - height="24" - name="At_My_Last_Location_Label" - left_pad="8" - bottom_delta="1" - width="120"> - at last location - </text> + width="165" /> <combo_box - control_name="NextLoginLocation" + allow_text_entry="true" + control_name="NextLoginLocation" follows="left|top" label="My favorite places" - height="26" + height="32" max_chars="128" - combo_editor.font="SansSerifMedium" - left_pad="20" + combo_editor.font="SansSerifLarge" + left_pad="15" bottom_delta="0" name="start_location_combo" width="175" combo_button.scale_image="true"> + <combo_box.combo_editor + bg_image_always_focused="true" + text_pad_left="8"/> + <combo_box.item + label="My last location" + name="MyLastLocation" + value="last" /> <combo_box.item label="My home" name="MyHome" - value="home" /> + value="home" /> </combo_box> <button follows="left|top" @@ -147,53 +111,48 @@ label="Log In" label_color="White" font="SansSerifMedium" - name="connect_favorite_btn" - left_pad="8" - width="80" - enabled="false" - height="26" - bottom_delta="0" /> - <line_editor + name="connect_btn" + enabled="true" + width="120" + height="32" + left_pad="15" + bottom_delta="0" /> + <check_box + control_name="RememberPassword" follows="left|top" - width="170" - height="26" - left_pad="40" - text_pad_left="8" - name="location_edit" - label="Type a location" font="SansSerifMedium" - select_on_focus="true" - commit_on_focus_lost="false" - bottom_delta="0" /> - <button + left="185" + bottom_delta="21" + height="24" + label="Remember me" + check_button.bottom="3" + name="remember_check" + width="145" /> + <text follows="left|top" - image_unselected="PushButton_Login" - image_pressed="PushButton_Login_Pressed" - image_hover="PushButton_Login_Over" - label="Log In" - enabled="false" - label_color="White" font="SansSerifMedium" - name="connect_location_btn" - left_pad="8" - width="80" - height="26" - bottom_delta="0" /> + text_color="EmphasisColor" + height="16" + name="forgot_password_text" + left="408" + bottom_delta="0" + width="200"> + Forgotten password + </text> <combo_box allow_text_entry="false" font="SansSerifTiny" follows="left|top" height="26" + left="588" + bottom_delta="10" max_chars="128" - label="Select grid" - left_pad="40" - bottom_delta="0" + label="Select grid" layout="topleft" - top_pad="2" name="server_combo" - width="128" /> - </layout_panel> - <layout_panel + width="149" /> + </layout_panel> + <layout_panel height="172" auto_resize="true" name="ui_elastic_pad_right" diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml new file mode 100755 index 0000000000..2b17473a84 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings.xml @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + label="Marketplace" + name="Marketplace Panel" + follows="all" + layout="topleft" + width="308" + height="440"> + <panel + name="tool_panel" + follows="left|top|right" + layout="topleft" + height="30" + width="308" + top="0" + left="0"> + <menu_button + name="sort_btn" + tool_tip="View/sort options" + layout="topleft" + follows="top|left" + width="31" + height="25" + left="2" + menu_filename="menu_marketplace_view.xml" + image_hover_unselected="Toolbar_Middle_Over" + image_overlay="Conv_toolbar_sort" + image_selected="Toolbar_Middle_Selected" + image_unselected="Toolbar_Middle_Off" + menu_position="bottomleft"/> + <button + name="add_btn" + tool_tip="Create a new listing folder" + layout="topleft" + follows="top|left" + width="31" + height="25" + left_pad="2" + image_hover_unselected="Toolbar_Middle_Over" + image_overlay="Conv_toolbar_plus" + image_selected="Toolbar_Middle_Selected" + image_unselected="Toolbar_Middle_Off"/> + <button + name="audit_btn" + label="Check for Errors" + tool_tip="Check your marketplace listings" + layout="topleft" + follows="top|right" + width="97" + height="26" + left_pad="143"/> + </panel> + <panel + name="tab_container_panel" + follows="all" + layout="topleft" + default_tab_group="1" + width="308" + height="350"> + <filter_editor + text_pad_left="10" + follows="left|top|right" + height="23" + label="Filter Marketplace Listings" + layout="topleft" + left="0" + max_length_chars="300" + name="filter_editor" + top="0" + width="308" /> + <tab_container + name="marketplace_filter_tabs" + follows="all" + layout="topleft" + top="30" + left="0" + top_pad="0" + width="308" + height="320" + halign="center" + tab_height="30" + tab_group="1" + tab_position="top" + tab_min_width="50"> + </tab_container> + </panel> + <panel + name="marketplace_drop_zone" + mouse_opaque="true" + follows="bottom|left|right" + left="2" + width="306" + height="40" + background_visible="true" + background_opaque="true" + bg_alpha_image="none" + bg_alpha_color="EmphasisColor_35" + bg_opaque_image="Marketplace_Dropzone_Background" + border="true" + bevel_style="in" + visible="true"> + <text + type="string" + follows="bottom|left|right" + layout="topleft" + top="13" + height="20" + left="2" + width="306" + halign="center" + font="SansSerifMedium" + font_shadow="hard" + valign="top"> + Drop folders here to create new listings + </text> + </panel> +</panel>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml new file mode 100755 index 0000000000..8d5fa265e2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inventory_panel + label="ALL" + name="All Items" + help_topic="marketplace_tab" + layout="topleft" + follows="all" + width="308" + height="370" + top="16" + left="0" + start_folder.name="Marketplace listings" + show_empty_message="true" + show_root_folder="false" + use_marketplace_folders="true" + start_folder.type="merchant" + tool_tip="Drag and drop items here to list them" + bg_opaque_color="DkGray2" + bg_alpha_color="DkGray2" + background_visible="true" + border="false" + bevel_style="none" + show_item_link_overlays="true"> + <item allow_wear="false"/> +</inventory_panel> diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml new file mode 100755 index 0000000000..44f507ad84 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inventory_panel + label="LISTED" + name="Active Items" + help_topic="marketplace_tab" + layout="topleft" + follows="all" + width="308" + height="370" + left_delta="0" + start_folder.name="Marketplace listings" + show_empty_message="true" + show_root_folder="false" + use_marketplace_folders="true" + allow_drop_on_root="false" + start_folder.type="merchant" + bg_opaque_color="DkGray2" + bg_alpha_color="DkGray2" + background_visible="true" + border="false" + bevel_style="none" + show_item_link_overlays="true"> + <item allow_wear="false"/> +</inventory_panel> diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml new file mode 100755 index 0000000000..871e8773c4 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inventory_panel + label="UNASSOCIATED" + name="Unassociated Items" + help_topic="marketplace_tab" + layout="topleft" + follows="all" + width="308" + height="370" + left_delta="0" + start_folder.name="Marketplace listings" + show_empty_message="true" + show_root_folder="false" + use_marketplace_folders="true" + start_folder.type="merchant" + bg_opaque_color="DkGray2" + bg_alpha_color="DkGray2" + background_visible="true" + border="false" + bevel_style="none" + show_item_link_overlays="true"> + <item allow_wear="false"/> +</inventory_panel> diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml new file mode 100755 index 0000000000..98bef04aa7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inventory_panel + label="UNLISTED" + name="Inactive Items" + help_topic="marketplace_tab" + layout="topleft" + follows="all" + width="308" + height="370" + left_delta="0" + start_folder.name="Marketplace listings" + show_empty_message="true" + show_root_folder="false" + use_marketplace_folders="true" + allow_drop_on_root="false" + start_folder.type="merchant" + bg_opaque_color="DkGray2" + bg_alpha_color="DkGray2" + background_visible="true" + border="false" + bevel_style="none" + show_item_link_overlays="true"> + <item allow_wear="false"/> +</inventory_panel> diff --git a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml index c80e5b168a..b2d8bb874b 100755 --- a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml @@ -3,7 +3,6 @@ name="inventory_outbox" start_folder.name="Outbox" show_empty_message="false" - show_load_status="false" start_folder.type="outbox" follows="all" layout="topleft" top="0" left="0" height="165" width="308" @@ -28,5 +27,5 @@ text_pad_right="4" arrow_size="12" max_folder_item_overlap="2"/> - <item allow_open="false"/> + <item allow_wear="false"/> </inventory_panel> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 945a77c071..f69884a2a9 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -236,14 +236,20 @@ Please try logging in again in a minute.</string> <string name="TooltipTooManyWearables">You can't wear a folder containing more than [AMOUNT] items. You can change this limit in Advanced > Show Debug Settings > WearFolderLimit.</string> <string name="TooltipPrice" value="L$[AMOUNT]: "/> - <string name="TooltipOutboxDragToWorld">You can not rez items in your merchant outbox</string> - <string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred.</string> - <string name="TooltipOutboxNotInInventory">Your merchant outbox can only accept items directly from your inventory</string> - <string name="TooltipOutboxWorn">You can not put items you are wearing into your merchant outbox</string> - <string name="TooltipOutboxCallingCard">You can not put calling cards into your merchant outbox</string> - <string name="TooltipOutboxFolderLevels">Depth of nested folders exceeds 3</string> - <string name="TooltipOutboxTooManyFolders">Subfolder count in top-level folder exceeds 20</string> - <string name="TooltipOutboxTooManyObjects">Item count in top-level folder exceeds 200</string> + <string name="TooltipOutboxDragToWorld">You can't rez items from the Marketplace Listings folder</string> + <string name="TooltipOutboxWorn">You can't put items you are wearing in the Marketplace Listings folder</string> + <string name="TooltipOutboxFolderLevels">Depth of nested folders exceeds [AMOUNT]. Decrease the depth of folders-within-folders; box items if necessary.</string> + <string name="TooltipOutboxTooManyFolders">Subfolder count exceeds [AMOUNT]. Decrease the number of folders in your listing; box items if necessary.</string> + <string name="TooltipOutboxTooManyObjects">Item count exceeds [AMOUNT]. In order to sell more than [AMOUNT] items in one listing, you must box some of them.</string> + <string name="TooltipOutboxTooManyStockItems">Stock items count exceeds [AMOUNT].</string> + <string name="TooltipOutboxCannotDropOnRoot">You can only drop items or folders in the ALL tab. Please select that tab and move your item(s) or folder(s) again.</string> + <string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred</string> + <string name="TooltipOutboxNotInInventory">You can only put items from your inventory on the marketplace</string> + <string name="TooltipOutboxLinked">You can't put linked items or folders on the marketplace</string> + <string name="TooltipOutboxCallingCard">You can't put calling cards on the marketplace</string> + <string name="TooltipOutboxDragActive">You can't move a listed listing</string> + <string name="TooltipOutboxCannotMoveRoot">You can't move the marketplace listings root folder</string> + <string name="TooltipOutboxMixedStock">All items in a stock folder must have the same type and permission</string> <string name="TooltipDragOntoOwnChild">You can't move a folder into its child</string> <string name="TooltipDragOntoSelf">You can't move a folder into itself</string> @@ -2256,6 +2262,7 @@ For AI Character: Get the closest navigable point to the point provided. <string name="InventoryNoMatchingItems">Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search].</string> <string name="PlacesNoMatchingItems">Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search].</string> <string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string> + <string name="MarketplaceNoMatchingItems">No items found. Check the spelling of your search string and try again.</string> <string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string> <string name="InventoryInboxNoItems">Your Marketplace purchases will appear here. You may then drag them into your inventory to use them.</string> <string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string> @@ -2283,16 +2290,45 @@ We are accessing your account on the [[MARKETPLACE_CREATE_STORE_URL] Marketplace <string name="InventoryOutboxError"> The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors. </string> - + <string name="InventoryMarketplaceError"> +This feature is currently in Beta. Please add your name to this [http://goo.gl/forms/FCQ7UXkakz Google form] if you would like to participate. + </string> + <string name="InventoryMarketplaceListingsNoItemsTitle">Your Marketplace Listings folder is empty.</string> + <string name="InventoryMarketplaceListingsNoItemsTooltip"></string> + <string name="InventoryMarketplaceListingsNoItems"> + Drag folders to this area to list them for sale on the [[MARKETPLACE_DASHBOARD_URL] Marketplace]. + </string> + + <string name="Marketplace Validation Log"></string> + <string name="Marketplace Validation Warning Stock">stock folder must be contained by a version folder</string> + <string name="Marketplace Validation Error Mixed Stock">: Error: all items in a stock folder must be no-copy and of the same type</string> + <string name="Marketplace Validation Error Subfolder In Stock">: Error: stock folder cannot contain subfolders</string> + <string name="Marketplace Validation Warning Empty">: Warning: folder doesn't contain any items</string> + <string name="Marketplace Validation Warning Create Stock">: Warning: creating stock folder</string> + <string name="Marketplace Validation Warning Create Version">: Warning: creating version folder</string> + <string name="Marketplace Validation Warning Move">: Warning : moving items</string> + <string name="Marketplace Validation Warning Delete">: Warning: folder content transfered to stock folder, removing empty folder</string> + <string name="Marketplace Validation Error Stock Item">: Error: no-copy items must be contained by a stock folder</string> + <string name="Marketplace Validation Warning Unwrapped Item">: Warning: items must be contained by a version folder</string> + <string name="Marketplace Validation Error">: Error: </string> + <string name="Marketplace Validation Warning">: Warning: </string> + <string name="Marketplace Validation Error Empty Version">: Warning: version folder must contain at least 1 item</string> + <string name="Marketplace Validation Error Empty Stock">: Warning: stock folder must contain at least 1 item</string> + + <string name="Marketplace Validation No Error">No errors or warnings to report</string> <string name="Marketplace Error None">No errors</string> - <string name="Marketplace Error Not Merchant">Error: Before sending items to the Marketplace you will need to set yourself up as a merchant (free of charge).</string> - <string name="Marketplace Error Empty Folder">Error: This folder has no contents.</string> - <string name="Marketplace Error Unassociated Products">Error: This item failed to upload because your merchant account has too many items unassociated with products. To fix this error, log in to the marketplace website and reduce your unassociated item count.</string> - - <string name="Marketplace Error Object Limit">Error: This item contains too many objects. Fix this error by placing objects together in boxes to reduce the total count to less than 200.</string> - <string name="Marketplace Error Folder Depth">Error: This item contains too many levels of nested folders. Reorganize it to a maximum of 3 levels of nested folders.</string> - <string name="Marketplace Error Unsellable Item">Error: This item can not be sold on the marketplace.</string> - <string name="Marketplace Error Internal Import">Error: There was a problem with this item. Try again later.</string> + <string name="Marketplace Error Prefix">Error: </string> + <string name="Marketplace Error Not Merchant">Before sending items to the Marketplace you will need to set yourself up as a merchant (free of charge).</string> + <string name="Marketplace Error Not Accepted">Cannot move item in that folder.</string> + <string name="Marketplace Error Unsellable Item">This item cannot be sold on the Marketplace.</string> + + <string name="MarketplaceNoID">no Mkt ID</string> + <string name="MarketplaceLive">listed</string> + <string name="MarketplaceActive">active</string> + <string name="MarketplaceMax">max</string> + <string name="MarketplaceStock">stock</string> + <string name="MarketplaceNoStock">out of stock</string> + <string name="MarketplaceUpdating">updating...</string> <string name="Open landmarks">Open landmarks</string> <string name="Unconstrained">Unconstrained</string> @@ -3954,6 +3990,7 @@ Try enclosing path to the editor with double quotes. <string name="Command_Inventory_Label">Inventory</string> <string name="Command_Map_Label">Map</string> <string name="Command_Marketplace_Label">Marketplace</string> + <string name="Command_MarketplaceListings_Label">Marketplace</string> <string name="Command_MiniMap_Label">Mini-map</string> <string name="Command_Move_Label">Walk / run / fly</string> <string name="Command_Outbox_Label">Merchant outbox</string> @@ -3984,6 +4021,7 @@ Try enclosing path to the editor with double quotes. <string name="Command_Inventory_Tooltip">View and use your belongings</string> <string name="Command_Map_Tooltip">Map of the world</string> <string name="Command_Marketplace_Tooltip">Go shopping</string> + <string name="Command_MarketplaceListings_Tooltip">Sell your creation</string> <string name="Command_MiniMap_Tooltip">Show nearby people</string> <string name="Command_Move_Tooltip">Moving your avatar</string> <string name="Command_Outbox_Tooltip">Transfer items to your marketplace for sale</string> diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml index d5b10e7f51..92f815d4bf 100755 --- a/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml @@ -1,3 +1,2 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<inbox_inventory_panel show_load_status="false" - start_folder.type="inbox"/> +<inbox_inventory_panel start_folder.type="inbox"/> diff --git a/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml index eaf148c5e4..d5efd723c4 100755 --- a/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml @@ -3,7 +3,6 @@ bg_opaque_color="InventoryBackgroundColor" background_visible="true" background_opaque="true" - show_load_status="true" accepts_drag_and_drop="true" > <scroll diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index adeb848e03..1b0334498e 100755 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -193,14 +193,6 @@ void LLAppViewer::forceQuit(void) {} LLAppViewer * LLAppViewer::sInstance = 0; //----------------------------------------------------------------------------- -#include "llnotificationsutil.h" -LLNotificationPtr LLNotificationsUtil::add(const std::string& name, - const LLSD& substitutions, - const LLSD& payload, - boost::function<void (const LLSD&, const LLSD&)> functor) { return LLNotificationPtr((LLNotification*)0); } - - -//----------------------------------------------------------------------------- #include "llupdaterservice.h" std::string const & LLUpdaterService::pumpName(void) @@ -488,8 +480,6 @@ namespace tut template<> template<> void lllogininstance_object::test<3>() { - skip(); - set_test_name("Test Mandatory Update User Accepts"); // Part 1 - Mandatory Update, with User accepts response. @@ -517,8 +507,6 @@ namespace tut template<> template<> void lllogininstance_object::test<4>() { - skip(); - set_test_name("Test Mandatory Update User Decline"); // Test connect with update needed. diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 7544fe1c41..32cf9d3df6 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -38,7 +38,7 @@ viewer_dir = os.path.dirname(__file__) # Put it FIRST because some of our build hosts have an ancient install of # indra.util.llmanifest under their system Python! sys.path.insert(0, os.path.join(viewer_dir, os.pardir, "lib", "python")) -from indra.util.llmanifest import LLManifest, main, proper_windows_path, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError +from indra.util.llmanifest import LLManifest, main, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError try: from llbase import llsd except ImportError: @@ -55,7 +55,6 @@ class ViewerManifest(LLManifest): def construct(self): super(ViewerManifest, self).construct() - self.exclude("*.svn*") self.path(src="../../scripts/messages/message_template.msg", dst="app_settings/message_template.msg") self.path(src="../../etc/message.xml", dst="app_settings/message.xml") @@ -74,26 +73,6 @@ class ViewerManifest(LLManifest): contributions_path = "../../doc/contributions.txt" contributor_names = self.extract_names(contributions_path) self.put_in_file(contributor_names, "contributors.txt", src=contributions_path) - # include the extracted list of translators - translations_path = "../../doc/translations.txt" - translator_names = self.extract_names(translations_path) - self.put_in_file(translator_names, "translators.txt", src=translations_path) - # include the list of Lindens (if any) - # see https://wiki.lindenlab.com/wiki/Generated_Linden_Credits - linden_names_path = os.getenv("LINDEN_CREDITS") - if not linden_names_path : - print "No 'LINDEN_CREDITS' specified in environment, using built-in list" - else: - try: - linden_file = open(linden_names_path,'r') - except IOError: - print "No Linden names found at '%s', using built-in list" % linden_names_path - else: - # all names should be one line, but the join below also converts to a string - linden_names = ', '.join(linden_file.readlines()) - self.put_in_file(linden_names, "lindens.txt", src=linden_names_path) - linden_file.close() - print "Linden names extracted from '%s'" % linden_names_path # ... and the entire windlight directory self.path("windlight") @@ -107,6 +86,9 @@ class ViewerManifest(LLManifest): self.path("dictionaries") self.end_prefix(pkgdir) + # include the extracted packages information (see BuildPackagesInfo.cmake) + self.path(src=os.path.join(self.args['build'],"packages-info.txt"), dst="packages-info.txt") + # CHOP-955: If we have "sourceid" or "viewer_channel" in the # build process environment, generate it into # settings_install.xml. @@ -349,14 +331,18 @@ class Windows_i686_Manifest(ViewerManifest): def construct(self): super(Windows_i686_Manifest, self).construct() + pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') + relpkgdir = os.path.join(pkgdir, "lib", "release") + debpkgdir = os.path.join(pkgdir, "lib", "debug") + if self.is_packaging_viewer(): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) # Plugin host application - self.path2basename(os.path.join(os.pardir, - 'llplugin', 'slplugin', self.args['configuration']), - "slplugin.exe") + # The current slplugin package places slplugin.exe right into the + # packages base directory. + self.path2basename(pkgdir, "slplugin.exe") self.path2basename("../viewer_components/updater/scripts/windows", "update_install.bat") # Get shared libs from the shared libs staging directory @@ -376,15 +362,10 @@ class Windows_i686_Manifest(ViewerManifest): # Mesh 3rd party libs needed for auto LOD and collada reading try: - if self.args['configuration'].lower() == 'debug': - self.path("libcollada14dom22-d.dll") - else: - self.path("libcollada14dom22.dll") - self.path("glod.dll") except RuntimeError, err: print err.message - print "Skipping COLLADA and GLOD libraries (assumming linked statically)" + print "Skipping GLOD library (assumming linked statically)" # Get fmodex dll, continue if missing try: @@ -404,11 +385,11 @@ class Windows_i686_Manifest(ViewerManifest): # These need to be installed as a SxS assembly, currently a 'private' assembly. # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx if self.args['configuration'].lower() == 'debug': - self.path("msvcr100d.dll") - self.path("msvcp100d.dll") + self.path("msvcr120d.dll") + self.path("msvcp120d.dll") else: - self.path("msvcr100.dll") - self.path("msvcp100.dll") + self.path("msvcr120.dll") + self.path("msvcp120.dll") # Vivox runtimes self.path("SLVoice.exe") @@ -443,82 +424,52 @@ class Windows_i686_Manifest(ViewerManifest): self.path("featuretable_xp.txt") # Media plugins - QuickTime - if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"): - self.path("media_plugin_quicktime.dll") - self.end_prefix() - # Media plugins - WebKit/Qt - if self.prefix(src='../media_plugins/webkit/%s' % self.args['configuration'], dst="llplugin"): + if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="llplugin"): + self.path("media_plugin_quicktime.dll") self.path("media_plugin_webkit.dll") - self.end_prefix() + self.path("qtcore4.dll") + self.path("qtgui4.dll") + self.path("qtnetwork4.dll") + self.path("qtopengl4.dll") + self.path("qtwebkit4.dll") + self.path("qtxmlpatterns4.dll") + + # For WebKit/Qt plugin runtimes (image format plugins) + if self.prefix(src="imageformats", dst="imageformats"): + self.path("qgif4.dll") + self.path("qico4.dll") + self.path("qjpeg4.dll") + self.path("qmng4.dll") + self.path("qsvg4.dll") + self.path("qtiff4.dll") + self.end_prefix() + + # For WebKit/Qt plugin runtimes (codec/character encoding plugins) + if self.prefix(src="codecs", dst="codecs"): + self.path("qcncodecs4.dll") + self.path("qjpcodecs4.dll") + self.path("qkrcodecs4.dll") + self.path("qtwcodecs4.dll") + self.end_prefix() + + self.end_prefix() # winmm.dll shim if self.prefix(src='../media_plugins/winmmshim/%s' % self.args['configuration'], dst=""): self.path("winmm.dll") self.end_prefix() - if self.args['configuration'].lower() == 'debug': - if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'debug'), - dst="llplugin"): + if self.prefix(src=debpkgdir, dst="llplugin"): self.path("libeay32.dll") - self.path("qtcored4.dll") - self.path("qtguid4.dll") - self.path("qtnetworkd4.dll") - self.path("qtopengld4.dll") - self.path("qtwebkitd4.dll") - self.path("qtxmlpatternsd4.dll") self.path("ssleay32.dll") - - # For WebKit/Qt plugin runtimes (image format plugins) - if self.prefix(src="imageformats", dst="imageformats"): - self.path("qgifd4.dll") - self.path("qicod4.dll") - self.path("qjpegd4.dll") - self.path("qmngd4.dll") - self.path("qsvgd4.dll") - self.path("qtiffd4.dll") - self.end_prefix() - - # For WebKit/Qt plugin runtimes (codec/character encoding plugins) - if self.prefix(src="codecs", dst="codecs"): - self.path("qcncodecsd4.dll") - self.path("qjpcodecsd4.dll") - self.path("qkrcodecsd4.dll") - self.path("qtwcodecsd4.dll") - self.end_prefix() - self.end_prefix() + else: - if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'release'), - dst="llplugin"): + if self.prefix(src=relpkgdir, dst="llplugin"): self.path("libeay32.dll") - self.path("qtcore4.dll") - self.path("qtgui4.dll") - self.path("qtnetwork4.dll") - self.path("qtopengl4.dll") - self.path("qtwebkit4.dll") - self.path("qtxmlpatterns4.dll") self.path("ssleay32.dll") - - # For WebKit/Qt plugin runtimes (image format plugins) - if self.prefix(src="imageformats", dst="imageformats"): - self.path("qgif4.dll") - self.path("qico4.dll") - self.path("qjpeg4.dll") - self.path("qmng4.dll") - self.path("qsvg4.dll") - self.path("qtiff4.dll") - self.end_prefix() - - # For WebKit/Qt plugin runtimes (codec/character encoding plugins) - if self.prefix(src="codecs", dst="codecs"): - self.path("qcncodecs4.dll") - self.path("qjpcodecs4.dll") - self.path("qkrcodecs4.dll") - self.path("qtwcodecs4.dll") - self.end_prefix() - self.end_prefix() # pull in the crash logger and updater from other projects @@ -631,7 +582,7 @@ class Windows_i686_Manifest(ViewerManifest): while (not installer_created) and (nsis_attempts > 0): try: nsis_attempts-=1; - self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile)) + self.run_command('"' + NSIS_path + '" ' + self.dst_path_of(tempfile)) installer_created=True # if no exception was raised, the codesign worked except ManifestError, err: if nsis_attempts: @@ -668,12 +619,16 @@ class Darwin_i386_Manifest(ViewerManifest): # copy over the build result (this is a no-op if run within the xcode script) self.path(self.args['configuration'] + "/Second Life.app", dst="") + pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') + relpkgdir = os.path.join(pkgdir, "lib", "release") + debpkgdir = os.path.join(pkgdir, "lib", "debug") + if self.prefix(src="", dst="Contents"): # everything goes in Contents self.path("Info.plist", dst="Info.plist") # copy additional libs in <bundle>/Contents/MacOS/ - self.path("../packages/lib/release/libndofdev.dylib", dst="Resources/libndofdev.dylib") - self.path("../packages/lib/release/libhunspell-1.3.0.dylib", dst="Resources/libhunspell-1.3.0.dylib") + self.path(os.path.join(relpkgdir, "libndofdev.dylib"), dst="Resources/libndofdev.dylib") + self.path(os.path.join(relpkgdir, "libhunspell-1.3.0.dylib"), dst="Resources/libhunspell-1.3.0.dylib") if self.prefix(dst="MacOS"): self.path2basename("../viewer_components/updater/scripts/darwin", "*.py") @@ -733,7 +688,6 @@ class Darwin_i386_Manifest(ViewerManifest): print "Skipping %s" % dst return [] - libdir = "../packages/lib/release" # dylibs is a list of all the .dylib files we expect to need # in our bundled sub-apps. For each of these we'll create a # symlink from sub-app/Contents/Resources to the real .dylib. @@ -743,7 +697,7 @@ class Darwin_i386_Manifest(ViewerManifest): "llcommon", self.args['configuration'], libfile), - os.path.join(libdir, libfile)), + os.path.join(relpkgdir, libfile)), dst=libfile) for libfile in ( @@ -754,7 +708,7 @@ class Darwin_i386_Manifest(ViewerManifest): "libexception_handler.dylib", "libGLOD.dylib", ): - dylibs += path_optional(os.path.join(libdir, libfile), libfile) + dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) # SLVoice and vivox lols, no symlinks needed for libfile in ( @@ -766,38 +720,41 @@ class Darwin_i386_Manifest(ViewerManifest): 'ca-bundle.crt', 'SLVoice', ): - self.path2basename(libdir, libfile) + self.path2basename(relpkgdir, libfile) # dylibs that vary based on configuration if self.args['configuration'].lower() == 'debug': for libfile in ( "libfmodexL.dylib", ): - dylibs += path_optional(os.path.join("../packages/lib/debug", - libfile), libfile) + dylibs += path_optional(os.path.join(debpkgdir, libfile), libfile) else: for libfile in ( "libfmodex.dylib", ): - dylibs += path_optional(os.path.join("../packages/lib/release", - libfile), libfile) + dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) # our apps - for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"), + for app_bld_dir, app in ((os.path.join(os.pardir, + "mac_crash_logger", + self.args['configuration']), + "mac-crash-logger.app"), # plugin launcher - (os.path.join("llplugin", "slplugin"), "SLPlugin.app"), + (pkgdir, "SLPlugin.app"), ): - self.path2basename(os.path.join(os.pardir, - app_bld_dir, self.args['configuration']), - app) + self.path2basename(app_bld_dir, app) # our apps dependencies on shared libs # for each app, for each dylib we collected in dylibs, # create a symlink to the real copy of the dylib. resource_path = self.dst_path_of(os.path.join(app, "Contents", "Resources")) for libfile in dylibs: - symlinkf(os.path.join(os.pardir, os.pardir, os.pardir, libfile), - os.path.join(resource_path, libfile)) + src = os.path.join(os.pardir, os.pardir, os.pardir, libfile) + dst = os.path.join(resource_path, libfile) + try: + symlinkf(src, dst) + except OSError as err: + print "Can't symlink %s -> %s: %s" % (src, dst, err) # SLPlugin.app/Contents/Resources gets those Qt4 libraries it needs. if self.prefix(src="", dst="SLPlugin.app/Contents/Resources"): for libfile in ('libQtCore.4.dylib', @@ -814,26 +771,24 @@ class Darwin_i386_Manifest(ViewerManifest): 'libQtWebKit.4.7.1.dylib', 'libQtXml.4.dylib', 'libQtXml.4.7.1.dylib'): - self.path2basename("../packages/lib/release", libfile) + self.path2basename(relpkgdir, libfile) self.end_prefix("SLPlugin.app/Contents/Resources") # Qt4 codecs go to llplugin. Not certain why but this is the first # location probed according to dtruss so we'll go with that. - if self.prefix(src="../packages/plugins/codecs/", dst="llplugin/codecs"): + if self.prefix(src=os.path.join(pkgdir, "llplugin/codecs/"), dst="llplugin/codecs"): self.path("libq*.dylib") self.end_prefix("llplugin/codecs") # Similarly for imageformats. - if self.prefix(src="../packages/plugins/imageformats/", dst="llplugin/imageformats"): + if self.prefix(src=os.path.join(pkgdir, "llplugin/imageformats/"), dst="llplugin/imageformats"): self.path("libq*.dylib") self.end_prefix("llplugin/imageformats") # SLPlugin plugins proper - if self.prefix(src="", dst="llplugin"): - self.path2basename("../media_plugins/quicktime/" + self.args['configuration'], - "media_plugin_quicktime.dylib") - self.path2basename("../media_plugins/webkit/" + self.args['configuration'], - "media_plugin_webkit.dylib") + if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="llplugin"): + self.path("media_plugin_quicktime.dylib") + self.path("media_plugin_webkit.dylib") self.end_prefix("llplugin") self.end_prefix("Resources") @@ -858,48 +813,6 @@ class Darwin_i386_Manifest(ViewerManifest): def package_finish(self): global CHANNEL_VENDOR_BASE - # Sign the app if requested. - if 'signature' in self.args: - identity = self.args['signature'] - if identity == '': - identity = 'Developer ID Application' - - # Look for an environment variable set via build.sh when running in Team City. - try: - build_secrets_checkout = os.environ['build_secrets_checkout'] - except KeyError: - pass - else: - # variable found so use it to unlock keyvchain followed by codesign - home_path = os.environ['HOME'] - keychain_pwd_path = os.path.join(build_secrets_checkout,'code-signing-osx','password.txt') - keychain_pwd = open(keychain_pwd_path).read().rstrip() - - self.run_command('security unlock-keychain -p "%s" "%s/Library/Keychains/viewer.keychain"' % ( keychain_pwd, home_path ) ) - signed=False - sign_attempts=3 - sign_retry_wait=15 - while (not signed) and (sign_attempts > 0): - try: - sign_attempts-=1; - self.run_command( - 'codesign --verbose --force --keychain "%(home_path)s/Library/Keychains/viewer.keychain" --sign %(identity)r %(bundle)r' % { - 'home_path' : home_path, - 'identity': identity, - 'bundle': self.get_dst_prefix() - }) - signed=True # if no exception was raised, the codesign worked - except ManifestError, err: - if sign_attempts: - print >> sys.stderr, "codesign failed, waiting %d seconds before retrying" % sign_retry_wait - time.sleep(sign_retry_wait) - sign_retry_wait*=2 - else: - print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" - raise - - imagename="SecondLife_" + '_'.join(self.args['version']) - # MBW -- If the mounted volume name changes, it breaks the .DS_Store's background image and icon positioning. # If we really need differently named volumes, we'll need to create multiple DS_Store file images, or use some other trick. @@ -981,6 +894,56 @@ class Darwin_i386_Manifest(ViewerManifest): # Set the disk image root's custom icon bit self.run_command('SetFile -a C %r' % volpath) + + # Sign the app if requested; + # do this in the copy that's in the .dmg so that the extended attributes used by + # the signature are preserved; moving the files using python will leave them behind + # and invalidate the signatures. + if 'signature' in self.args: + app_in_dmg=os.path.join(volpath,self.app_name()+".app") + print "Attempting to sign '%s'" % app_in_dmg + identity = self.args['signature'] + if identity == '': + identity = 'Developer ID Application' + + # Look for an environment variable set via build.sh when running in Team City. + try: + build_secrets_checkout = os.environ['build_secrets_checkout'] + except KeyError: + pass + else: + # variable found so use it to unlock keychain followed by codesign + home_path = os.environ['HOME'] + keychain_pwd_path = os.path.join(build_secrets_checkout,'code-signing-osx','password.txt') + keychain_pwd = open(keychain_pwd_path).read().rstrip() + + self.run_command('security unlock-keychain -p "%s" "%s/Library/Keychains/viewer.keychain"' % ( keychain_pwd, home_path ) ) + signed=False + sign_attempts=3 + sign_retry_wait=15 + while (not signed) and (sign_attempts > 0): + try: + sign_attempts-=1; + self.run_command( + 'codesign --verbose --deep --force --keychain "%(home_path)s/Library/Keychains/viewer.keychain" --sign %(identity)r %(bundle)r' % { + 'home_path' : home_path, + 'identity': identity, + 'bundle': app_in_dmg + }) + signed=True # if no exception was raised, the codesign worked + except ManifestError, err: + if sign_attempts: + print >> sys.stderr, "codesign failed, waiting %d seconds before retrying" % sign_retry_wait + time.sleep(sign_retry_wait) + sign_retry_wait*=2 + else: + print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" + raise + self.run_command('spctl -a -texec -vv %(bundle)r' % { 'bundle': app_in_dmg }) + + imagename="SecondLife_" + '_'.join(self.args['version']) + + finally: # Unmount the image even if exceptions from any of the above self.run_command('hdiutil detach -force %r' % devfile) @@ -995,6 +958,11 @@ class Darwin_i386_Manifest(ViewerManifest): class LinuxManifest(ViewerManifest): def construct(self): super(LinuxManifest, self).construct() + + pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') + relpkgdir = os.path.join(pkgdir, "lib", "release") + debpkgdir = os.path.join(pkgdir, "lib", "debug") + self.path("licenses-linux.txt","licenses.txt") if self.prefix("linux_tools", dst=""): self.path("client-readme.txt","README-linux.txt") @@ -1013,7 +981,7 @@ class LinuxManifest(ViewerManifest): if self.prefix(src="", dst="bin"): self.path("secondlife-bin","do-not-directly-run-secondlife-bin") self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin") - self.path2basename("../llplugin/slplugin", "SLPlugin") + self.path2basename(pkgdir, "SLPlugin") self.path2basename("../viewer_components/updater/scripts/linux", "update_install") self.end_prefix("bin") @@ -1033,9 +1001,9 @@ class LinuxManifest(ViewerManifest): self.end_prefix(icon_path) # plugins - if self.prefix(src="", dst="bin/llplugin"): - self.path2basename("../media_plugins/webkit", "libmedia_plugin_webkit.so") - self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so") + if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="bin/llplugin"): + self.path("libmedia_plugin_webkit.so") + self.path("libmedia_plugin_gstreamer.so") self.end_prefix("bin/llplugin") # llcommon @@ -1097,7 +1065,11 @@ class Linux_i686_Manifest(LinuxManifest): def construct(self): super(Linux_i686_Manifest, self).construct() - if self.prefix("../packages/lib/release", dst="lib"): + pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') + relpkgdir = os.path.join(pkgdir, "lib", "release") + debpkgdir = os.path.join(pkgdir, "lib", "debug") + + if self.prefix(relpkgdir, dst="lib"): self.path("libapr-1.so") self.path("libapr-1.so.0") self.path("libapr-1.so.0.4.5") @@ -1117,8 +1089,8 @@ class Linux_i686_Manifest(LinuxManifest): self.path("libfusion-1.4.so.5") self.path("libdirect-1.4.so.5*") self.path("libhunspell-1.3.so*") - self.path("libalut.so") - self.path("libopenal.so", "libopenal.so.1") + self.path("libalut.so*") + self.path("libopenal.so*") self.path("libopenal.so", "libvivoxoal.so.1") # vivox's sdk expects this soname # KLUDGE: As of 2012-04-11, the 'fontconfig' package installs # libfontconfig.so.1.4.4, along with symlinks libfontconfig.so.1 @@ -1160,10 +1132,10 @@ class Linux_i686_Manifest(LinuxManifest): self.end_prefix("lib") # Vivox runtimes - if self.prefix(src="../packages/lib/release", dst="bin"): + if self.prefix(src=relpkgdir, dst="bin"): self.path("SLVoice") self.end_prefix() - if self.prefix(src="../packages/lib/release", dst="lib"): + if self.prefix(src=relpkgdir, dst="lib"): self.path("libortp.so") self.path("libsndfile.so.1") #self.path("libvivoxoal.so.1") # no - we'll re-use the viewer's own OpenAL lib @@ -1172,7 +1144,7 @@ class Linux_i686_Manifest(LinuxManifest): self.end_prefix("lib") # plugin runtime - if self.prefix(src="../packages/lib/release", dst="lib"): + if self.prefix(src=os.path.join(pkgdir, "lib"), dst="lib"): self.path("libQtCore.so*") self.path("libQtGui.so*") self.path("libQtNetwork.so*") @@ -1183,7 +1155,8 @@ class Linux_i686_Manifest(LinuxManifest): self.end_prefix("lib") # For WebKit/Qt plugin runtimes (image format plugins) - if self.prefix(src="../packages/plugins/imageformats", dst="bin/llplugin/imageformats"): + if self.prefix(src=os.path.join(pkgdir, "llplugin", "imageformats"), + dst="bin/llplugin/imageformats"): self.path("libqgif.so") self.path("libqico.so") self.path("libqjpeg.so") @@ -1193,7 +1166,8 @@ class Linux_i686_Manifest(LinuxManifest): self.end_prefix("bin/llplugin/imageformats") # For WebKit/Qt plugin runtimes (codec/character encoding plugins) - if self.prefix(src="../packages/plugins/codecs", dst="bin/llplugin/codecs"): + if self.prefix(src=os.path.join(pkgdir, "llplugin", "codecs"), + dst="bin/llplugin/codecs"): self.path("libqcncodecs.so") self.path("libqjpcodecs.so") self.path("libqkrcodecs.so") diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 62b1d9db62..01d1d830a2 100755 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -1,6 +1,6 @@ # -*- cmake -*- -project (test) +project (lltest) include(00-Common) include(LLCommon) @@ -80,9 +80,9 @@ set_source_files_properties(${test_HEADER_FILES} list(APPEND test_SOURCE_FILES ${test_HEADER_FILES}) -add_executable(test ${test_SOURCE_FILES}) +add_executable(lltest ${test_SOURCE_FILES}) -target_link_libraries(test +target_link_libraries(lltest ${LLDATABASE_LIBRARIES} ${LLINVENTORY_LIBRARIES} ${LLMESSAGE_LIBRARIES} @@ -102,14 +102,14 @@ target_link_libraries(test ) if (WINDOWS) - set_target_properties(test + set_target_properties(lltest PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT" LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\"" ) endif (WINDOWS) -get_target_property(TEST_EXE test LOCATION) +set(TEST_EXE $<TARGET_FILE:lltest>) SET_TEST_PATH(DYLD_LIBRARY_PATH) @@ -122,7 +122,7 @@ LL_TEST_COMMAND(command ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt COMMAND ${command} - DEPENDS test + DEPENDS lltest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "C++ unit tests" ) diff --git a/indra/test/llbuffer_tut.cpp b/indra/test/llbuffer_tut.cpp index a25fdebb7f..9b8aae6a73 100755 --- a/indra/test/llbuffer_tut.cpp +++ b/indra/test/llbuffer_tut.cpp @@ -27,6 +27,7 @@ */ #include <tut/tut.hpp> + #include "linden_common.h" #include "lltut.h" #include "llbuffer.h" diff --git a/indra/test/llevents_tut.cpp b/indra/test/llevents_tut.cpp index a9114075fc..16edab6282 100755 --- a/indra/test/llevents_tut.cpp +++ b/indra/test/llevents_tut.cpp @@ -48,10 +48,10 @@ #include <boost/shared_ptr.hpp> #include <boost/assign/list_of.hpp> // other Linden headers +#include "tests/listener.h" // must PRECEDE lltut.h #include "lltut.h" #include "catch_and_store_what_in.h" #include "stringize.h" -#include "tests/listener.h" using boost::assign::list_of; diff --git a/indra/test/llpermissions_tut.cpp b/indra/test/llpermissions_tut.cpp index 8d8d47a667..fa4b085fd3 100755 --- a/indra/test/llpermissions_tut.cpp +++ b/indra/test/llpermissions_tut.cpp @@ -28,7 +28,9 @@ #include <tut/tut.hpp> #include "linden_common.h" + #include "lltut.h" + #include "message.h" #include "llpermissions.h" diff --git a/indra/test/llsd_new_tut.cpp b/indra/test/llsd_new_tut.cpp index 03df1d339b..458df3361e 100755 --- a/indra/test/llsd_new_tut.cpp +++ b/indra/test/llsd_new_tut.cpp @@ -33,18 +33,7 @@ #include "llsdtraits.h" #include "llstring.h" -#if LL_WINDOWS -#include <float.h> -namespace -{ - int fpclassify(double x) - { - return _fpclass(x); - } -} -#else using std::fpclassify; -#endif namespace tut { @@ -112,15 +101,15 @@ namespace tut SDTestGroup sdTestGroup("LLSD(new)"); - template<> template<> - void SDTestObject::test<1>() - // construction and test of undefined - { - SDCleanupCheck check; - - LLSD u; - ensure("is undefined", u.isUndefined()); - } + // template<> template<> + // void SDTestObject::test<1>() + // // construction and test of undefined + // { + // SDCleanupCheck check; + + // LLSD u; + // ensure("is undefined", u.isUndefined()); + // } template<> template<> void SDTestObject::test<2>() @@ -277,8 +266,18 @@ namespace tut v = 0.5; checkConversions("point5", v, true, 0, 0.5, "0.5"); v = 0.9; checkConversions("point9", v, true, 0, 0.9, "0.9"); v = -3.9; checkConversions("neg3dot9", v, true, -3, -3.9, "-3.9"); - v = sqrt(-1.0); checkConversions("NaN", v, false, 0, sqrt(-1.0), "nan"); - + // Get rid of NaN test. First, some libraries don't reliably return + // NaN for sqrt(-1.0) -- meaning that I don't even know how to + // portably, reliably produce a NaN value. Second, we observe failures + // on different platforms in the asString() test. But LLSD's + // ImplReal::asString() does not itself recognize NaN! It merely + // passes the value through to llformat(), which passes it through to + // the library vsnprintf(). That is, even when we do produce NaN, + // we're not testing any LLSD code: we're testing the local library's + // vsnprintf() function, which (empirically) produces idiosyncratic + // results. This is just not a good test case. +// v = sqrt(-1.0); checkConversions("NaN", v, false, 0, sqrt(-1.0), "nan"); + v = ""; checkConversions("empty", v, false, 0, 0.0, ""); v = "0"; checkConversions("digit0", v, true, 0, 0.0, "0"); v = "10"; checkConversions("digit10", v, true, 10, 10.0, "10"); diff --git a/indra/test/lltranscode_tut.cpp b/indra/test/lltranscode_tut.cpp index 2431afad27..3fce6e0e2b 100755 --- a/indra/test/lltranscode_tut.cpp +++ b/indra/test/lltranscode_tut.cpp @@ -49,9 +49,6 @@ namespace tut template<> template<> void LLTranscodeTestObject::test<1>() { -#if LL_WINDOWS - skip("Windows APR libs can't transcode."); -#endif // Test utf8 std::stringstream input; std::stringstream output; diff --git a/indra/test/lltut.cpp b/indra/test/lltut.cpp index c43a8f0c7d..5a8ee87afd 100755 --- a/indra/test/lltut.cpp +++ b/indra/test/lltut.cpp @@ -38,43 +38,44 @@ namespace tut { - void ensure_equals(const char* msg, const LLDate& actual, + void ensure_equals(const std::string& msg, const LLDate& actual, const LLDate& expected) { ensure_equals(msg, actual.secondsSinceEpoch(), expected.secondsSinceEpoch()); } - void ensure_equals(const char* msg, const LLURI& actual, + void ensure_equals(const std::string& msg, const LLURI& actual, const LLURI& expected) { ensure_equals(msg, actual.asString(), expected.asString()); } - void ensure_equals(const char* msg, - const std::vector<U8>& actual, const std::vector<U8>& expected) + // The lexical param types here intentionally diverge from the declaration + // in our header file. In lltut.h, LLSD is only a forward-declared type; + // we have no access to its LLSD::Binary nested type, and so must restate + // it explicitly to declare this overload. However, an overload that does + // NOT match LLSD::Binary does us no good whatsoever: it would never be + // engaged. Stating LLSD::Binary for this definition at least means that + // if the LLSD::Binary type ever diverges from what we expect in lltut.h, + // that divergence will produce an error: no definition will match that + // declaration. + void ensure_equals(const std::string& msg, + const LLSD::Binary& actual, const LLSD::Binary& expected) { - std::string s(msg); + ensure_equals(msg + " size", actual.size(), expected.size()); - ensure_equals(s + " size", actual.size(), expected.size()); - - std::vector<U8>::const_iterator i, j; + LLSD::Binary::const_iterator i, j; int k; for (i = actual.begin(), j = expected.begin(), k = 0; i != actual.end(); ++i, ++j, ++k) { - ensure_equals(s + " field", *i, *j); + ensure_equals(msg + " field", *i, *j); } } - void ensure_equals(const char* m, const LLSD& actual, - const LLSD& expected) - { - ensure_equals(std::string(m), actual, expected); - } - void ensure_equals(const std::string& msg, const LLSD& actual, const LLSD& expected) { @@ -158,8 +159,8 @@ namespace tut if( actual.find(expectedStart, 0) != 0 ) { std::stringstream ss; - ss << msg << ": " << "expected to find " << expectedStart - << " at start of actual " << actual; + ss << msg << ": " << "expected to find '" << expectedStart + << "' at start of actual '" << actual << "'"; throw failure(ss.str().c_str()); } } @@ -172,8 +173,8 @@ namespace tut != (actual.size() - expectedEnd.size()) ) { std::stringstream ss; - ss << msg << ": " << "expected to find " << expectedEnd - << " at end of actual " << actual; + ss << msg << ": " << "expected to find '" << expectedEnd + << "' at end of actual '" << actual << "'"; throw failure(ss.str().c_str()); } } @@ -184,8 +185,8 @@ namespace tut if( actual.find(expectedSubString, 0) == std::string::npos ) { std::stringstream ss; - ss << msg << ": " << "expected to find " << expectedSubString - << " in actual " << actual; + ss << msg << ": " << "expected to find '" << expectedSubString + << "' in actual '" << actual << "'"; throw failure(ss.str().c_str()); } } diff --git a/indra/test/lltut.h b/indra/test/lltut.h index 243e869be7..9835565bb6 100755 --- a/indra/test/lltut.h +++ b/indra/test/lltut.h @@ -30,8 +30,6 @@ #define LL_LLTUT_H #include "is_approx_equal_fraction.h" // instead of llmath.h - -#include <tut/tut.hpp> #include <cstring> class LLDate; @@ -40,6 +38,55 @@ class LLURI; namespace tut { + void ensure_equals(const std::string& msg, + const LLDate& actual, const LLDate& expected); + + void ensure_equals(const std::string& msg, + const LLURI& actual, const LLURI& expected); + + // std::vector<U8> is the current definition of LLSD::Binary. Because + // we're only forward-declaring LLSD in this header file, we can't + // directly reference that nested type. If the build complains that + // there's no definition for this declaration, it could be that + // LLSD::Binary has changed, and that this declaration must be adjusted to + // match. + void ensure_equals(const std::string& msg, + const std::vector<U8>& actual, const std::vector<U8>& expected); + + void ensure_equals(const std::string& msg, + const LLSD& actual, const LLSD& expected); + + void ensure_starts_with(const std::string& msg, + const std::string& actual, const std::string& expectedStart); + + void ensure_ends_with(const std::string& msg, + const std::string& actual, const std::string& expectedEnd); + + void ensure_contains(const std::string& msg, + const std::string& actual, const std::string& expectedSubString); + + void ensure_does_not_contain(const std::string& msg, + const std::string& actual, const std::string& expectedSubString); +} + +// This is an odd place to #include an important contributor -- but the usual +// rules are reversed here. Instead of the overloads above referencing tut.hpp +// features, we need calls in tut.hpp template functions to dispatch to our +// overloads declared above. + +// turn off warnings about unused functions from clang for tut package +#if __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-function" +#endif +#include <tut/tut.hpp> +#if __clang__ +#pragma clang diagnostic pop +#endif + +// The functions BELOW this point actually consume tut.hpp functionality. +namespace tut +{ inline void ensure_approximately_equals(const char* msg, F64 actual, F64 expected, U32 frac_bits) { if(!is_approx_equal_fraction(actual, expected, frac_bits)) @@ -107,40 +154,6 @@ namespace tut { ensure_not_equals(NULL, actual, expected); } - - - template <class T,class Q> - void ensure_equals(const std::string& msg, - const Q& actual,const T& expected) - { ensure_equals(msg.c_str(), actual, expected); } - - void ensure_equals(const char* msg, - const LLDate& actual, const LLDate& expected); - - void ensure_equals(const char* msg, - const LLURI& actual, const LLURI& expected); - - void ensure_equals(const char* msg, - const std::vector<U8>& actual, const std::vector<U8>& expected); - - void ensure_equals(const char* msg, - const LLSD& actual, const LLSD& expected); - - void ensure_equals(const std::string& msg, - const LLSD& actual, const LLSD& expected); - - void ensure_starts_with(const std::string& msg, - const std::string& actual, const std::string& expectedStart); - - void ensure_ends_with(const std::string& msg, - const std::string& actual, const std::string& expectedEnd); - - void ensure_contains(const std::string& msg, - const std::string& actual, const std::string& expectedSubString); - - void ensure_does_not_contain(const std::string& msg, - const std::string& actual, const std::string& expectedSubString); } - #endif // LL_LLTUT_H diff --git a/indra/test/namedtempfile.h b/indra/test/namedtempfile.h index 6069064627..7d59cad32c 100755 --- a/indra/test/namedtempfile.h +++ b/indra/test/namedtempfile.h @@ -17,8 +17,8 @@ #include "apr_file_io.h" #include <string> #include <boost/function.hpp> -#include <boost/lambda/lambda.hpp> -#include <boost/lambda/bind.hpp> +#include <boost/phoenix/core/argument.hpp> +#include <boost/phoenix/operator/bitwise.hpp> #include <boost/noncopyable.hpp> #include <iostream> #include <sstream> @@ -34,19 +34,19 @@ public: NamedTempFile(const std::string& pfx, const std::string& content, apr_pool_t* pool=gAPRPoolp): mPool(pool) { - createFile(pfx, boost::lambda::_1 << content); + createFile(pfx, boost::phoenix::placeholders::arg1 << content); } // Disambiguate when passing string literal NamedTempFile(const std::string& pfx, const char* content, apr_pool_t* pool=gAPRPoolp): mPool(pool) { - createFile(pfx, boost::lambda::_1 << content); + createFile(pfx, boost::phoenix::placeholders::arg1 << content); } // Function that accepts an ostream ref and (presumably) writes stuff to // it, e.g.: - // (boost::lambda::_1 << "the value is " << 17 << '\n') + // (boost::phoenix::placeholders::arg1 << "the value is " << 17 << '\n') typedef boost::function<void(std::ostream&)> Streamer; NamedTempFile(const std::string& pfx, const Streamer& func, apr_pool_t* pool=gAPRPoolp): diff --git a/indra/test_apps/llfbconnecttest/CMakeLists.txt b/indra/test_apps/llfbconnecttest/CMakeLists.txt index 512bf202ae..25aaebb783 100644 --- a/indra/test_apps/llfbconnecttest/CMakeLists.txt +++ b/indra/test_apps/llfbconnecttest/CMakeLists.txt @@ -109,27 +109,27 @@ else (DARWIN) ) endif (DARWIN) -get_target_property(BUILT_SLPLUGIN SLPlugin LOCATION) +set(BUILT_SLPLUGIN $<TARGET_FILE:SLPlugin>) add_custom_command(TARGET llfbconnecttest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_SLPLUGIN} ${PLUGINS_DESTINATION_DIR} DEPENDS ${BUILT_SLPLUGIN} ) -get_target_property(BUILT_LLCOMMON llcommon LOCATION) +set(BUILT_LLCOMMON $<TARGET_FILE:llcommon>) add_custom_command(TARGET llfbconnecttest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_LLCOMMON} ${PLUGINS_DESTINATION_DIR} DEPENDS ${BUILT_LLCOMMON} ) -get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION) +set(BUILT_WEBKIT_PLUGIN $<TARGET_FILE:media_plugin_webkit>) add_custom_command(TARGET llfbconnecttest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_WEBKIT_PLUGIN} ${PLUGINS_DESTINATION_DIR} DEPENDS ${BUILT_WEBKIT_PLUGIN} ) # copy over bookmarks file if llfbconnecttest gets built -get_target_property(BUILT_LLFBCONNECTTEST llfbconnecttest LOCATION) +set(BUILT_LLFBCONNECTTEST $<TARGET_FILE:llfbconnecttest>) add_custom_command(TARGET llfbconnecttest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${CMAKE_CURRENT_BINARY_DIR}/ DEPENDS ${BUILT_LLFBCONNECTTEST} diff --git a/indra/test_apps/llfbconnecttest/llfbconnecttest.h b/indra/test_apps/llfbconnecttest/llfbconnecttest.h index 6f442a55b3..77e4d096d0 100644 --- a/indra/test_apps/llfbconnecttest/llfbconnecttest.h +++ b/indra/test_apps/llfbconnecttest/llfbconnecttest.h @@ -144,43 +144,14 @@ class LLFBConnectTest : public LLPluginClassMediaOwner float mDistanceCameraToSelectedGeometry; - int mIdControlAddPanel; - int mIdControlRemPanel; - std::vector< std::pair< std::string, std::string > > mBookmarks; GLUI_Listbox* mBookmarkList; int mIdBookmarks; int mIdUrlEdit; GLUI_EditText* mUrlEdit; - //int mIdUrlInitHistoryEdit; - //GLUI_EditText* mUrlInitHistoryEdit; int mSelBookmark; - //int mIdRandomPanelCount; - //int mRandomPanelCount; - //int mIdRandomBookmarks; - //int mRandomBookmarks; - //int mIdDisableTimeout; - //int mDisableTimeout; - //int mIdUsePluginReadThread; - //int mUsePluginReadThread; - //int mIdLargePanelSpacing; - //int mLargePanelSpacing; - //int mIdControlCrashPlugin; - //int mIdControlHangPlugin; - int mIdControlExitApp; - //GLUI* mGluiMediaTimeControlWindow; - //int mIdMediaTimeControlPlay; - //int mIdMediaTimeControlLoop; - //int mIdMediaTimeControlPause; - //int mIdMediaTimeControlStop; - //int mIdMediaTimeControlSeek; - //int mIdMediaTimeControlVolume; - //int mMediaTimeControlVolume; - //int mIdMediaTimeControlSeekSeconds; - //int mMediaTimeControlSeekSeconds; - //int mIdMediaTimeControlRewind; - //int mIdMediaTimeControlFastForward; + int mIdControlExitApp; GLUI* mGluiMediaBrowserControlWindow; int mIdMediaBrowserControlBack; @@ -188,16 +159,11 @@ class LLFBConnectTest : public LLPluginClassMediaOwner int mIdMediaBrowserControlStop; int mIdMediaBrowserControlForward; GLUI_Button* mMediaBrowserControlForwardButton; - bool mGluiMediaTimeControlWindowFlag; bool mGluiMediaBrowserControlWindowFlag; bool mMediaBrowserControlBackButtonFlag; bool mMediaBrowserControlForwardButtonFlag; int mIdMediaBrowserControlHome; int mIdMediaBrowserControlReload; - int mIdMediaBrowserControlClearCache; - int mIdMediaBrowserControlClearCookies; - int mIdMediaBrowserControlEnableCookies; - int mMediaBrowserControlEnableCookies; GLUI* mBottomGLUIWindow; GLUI_StaticText* mStatusText; diff --git a/indra/test_apps/llplugintest/CMakeLists.txt b/indra/test_apps/llplugintest/CMakeLists.txt index 9d44563e26..0c8bdc464d 100755 --- a/indra/test_apps/llplugintest/CMakeLists.txt +++ b/indra/test_apps/llplugintest/CMakeLists.txt @@ -334,40 +334,40 @@ else (DARWIN) ) endif (DARWIN) -get_target_property(BUILT_SLPLUGIN SLPlugin LOCATION) +set(BUILT_SLPLUGIN $<TARGET_FILE:SLPlugin>) add_custom_command(TARGET llmediaplugintest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_SLPLUGIN} ${PLUGINS_DESTINATION_DIR} DEPENDS ${BUILT_SLPLUGIN} ) -get_target_property(BUILT_LLCOMMON llcommon LOCATION) +set(BUILT_LLCOMMON $<TARGET_FILE:llcommon>) add_custom_command(TARGET llmediaplugintest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_LLCOMMON} ${PLUGINS_DESTINATION_DIR} DEPENDS ${BUILT_LLCOMMON} ) -get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION) +set(BUILT_WEBKIT_PLUGIN $<TARGET_FILE:media_plugin_webkit>) add_custom_command(TARGET llmediaplugintest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_WEBKIT_PLUGIN} ${PLUGINS_DESTINATION_DIR} DEPENDS ${BUILT_WEBKIT_PLUGIN} ) if (DARWIN OR WINDOWS) - get_target_property(BUILT_QUICKTIME_PLUGIN media_plugin_quicktime LOCATION) + set(BUILT_QUICKTIME_PLUGIN $<TARGET_FILE:media_plugin_quicktime>) add_custom_command(TARGET llmediaplugintest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_QUICKTIME_PLUGIN} ${PLUGINS_DESTINATION_DIR} DEPENDS ${BUILT_QUICKTIME_PLUGIN} ) endif (DARWIN OR WINDOWS) -get_target_property(BUILT_EXAMPLE_PLUGIN media_plugin_example LOCATION) +set(BUILT_EXAMPLE_PLUGIN $<TARGET_FILE:media_plugin_example>) add_custom_command(TARGET llmediaplugintest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_EXAMPLE_PLUGIN} ${PLUGINS_DESTINATION_DIR} DEPENDS ${BUILT_EXAMPLE_PLUGIN} ) # copy over bookmarks file if llmediaplugintest gets built -get_target_property(BUILT_LLMEDIAPLUGINTEST llmediaplugintest LOCATION) +set(BUILT_LLMEDIAPLUGINTEST $<TARGET_FILE:llmediaplugintest>) add_custom_command(TARGET llmediaplugintest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${CMAKE_CURRENT_BINARY_DIR}/ DEPENDS ${BUILT_LLMEDIAPLUGINTEST} diff --git a/indra/tools/vstool/VSTool.exe b/indra/tools/vstool/VSTool.exe Binary files differindex 8be428614e..854290b90a 100755 --- a/indra/tools/vstool/VSTool.exe +++ b/indra/tools/vstool/VSTool.exe diff --git a/indra/tools/vstool/main.cs b/indra/tools/vstool/main.cs index cc73261e30..ef2e582b90 100755 --- a/indra/tools/vstool/main.cs +++ b/indra/tools/vstool/main.cs @@ -555,6 +555,10 @@ namespace VSTool version = "VC100";
break;
+ case "12.00":
+ version = "VC120";
+ break;
+
default:
throw new ApplicationException("Unknown .sln version: " + format);
}
@@ -595,6 +599,10 @@ namespace VSTool progid = "VisualStudio.DTE.10.0";
break;
+ case "VC120":
+ progid = "VisualStudio.DTE.12.0";
+ break;
+
default:
throw new ApplicationException("Can't handle VS version: " + version);
}
diff --git a/indra/viewer_components/login/CMakeLists.txt b/indra/viewer_components/login/CMakeLists.txt index ce80d55829..c152f7c0a6 100755 --- a/indra/viewer_components/login/CMakeLists.txt +++ b/indra/viewer_components/login/CMakeLists.txt @@ -46,6 +46,7 @@ target_link_libraries(lllogin ${LLMATH_LIBRARIES} ${LLXML_LIBRARIES} ${BOOST_CONTEXT_LIBRARY} + ${BOOST_THREAD_LIBRARY} ${BOOST_COROUTINE_LIBRARY} ${BOOST_SYSTEM_LIBRARY} ) @@ -57,7 +58,7 @@ if(LL_TESTS) set_source_files_properties( lllogin.cpp PROPERTIES - LL_TEST_ADDITIONAL_LIBRARIES "${BOOST_CONTEXT_LIBRARY};${BOOST_COROUTINE_LIBRARY};${BOOST_SYSTEM_LIBRARY}" + LL_TEST_ADDITIONAL_LIBRARIES "${BOOST_COROUTINE_LIBRARY};${BOOST_CONTEXT_LIBRARY};${BOOST_THREAD_LIBRARY};${BOOST_SYSTEM_LIBRARY}" ) LL_ADD_PROJECT_UNIT_TESTS(lllogin "${lllogin_TEST_SOURCE_FILES}") diff --git a/scripts/automated_build_scripts/opensrc-build.sh b/scripts/automated_build_scripts/opensrc-build.sh deleted file mode 100755 index c1b592a972..0000000000 --- a/scripts/automated_build_scripts/opensrc-build.sh +++ /dev/null @@ -1,391 +0,0 @@ -#!/bin/sh - -# This is the build script used by Linden Lab's autmated build system. -# - -set -x - -export PATH=/bin:/usr/bin:$PATH -arch=`uname | cut -b-6` -here=`echo $0 | sed 's:[^/]*$:.:'` -year=`date +%Y` -branch=`svn info | grep '^URL:' | sed 's:.*/::'` -revision=`svn info | grep '^Revision:' | sed 's/.*: //'` - -[ x"$WGET_CACHE" = x ] && export WGET_CACHE=/var/tmp/parabuild/wget -[ x"$S3GET_URL" = x ] && export S3GET_URL=http://viewer-source-downloads.s3.amazonaws.com/$year -[ x"$S3PUT_URL" = x ] && export S3PUT_URL=https://s3.amazonaws.com/viewer-source-downloads/$year -[ x"$PUBLIC_URL" = x ] && export PUBLIC_URL=http://secondlife.com/developers/opensource/downloads/$year -[ x"$PUBLIC_EMAIL" = x ] && export PUBLIC_EMAIL=sldev-commits@lists.secondlife.com - -# Make sure command worked and bail out if not, reporting failure to parabuild -fail() -{ - release_lock - echo "BUILD FAILED" $@ - exit 1 -} - -pass() -{ - release_lock - echo "BUILD SUCCESSFUL" - exit 0 -} - -# Locking to avoid contention with u-s-c -LOCK_CREATE=/usr/bin/lockfile-create -LOCK_TOUCH=/usr/bin/lockfile-touch -LOCK_REMOVE=/usr/bin/lockfile-remove -LOCK_PROCESS= - -locking_available() -{ - test -x "$LOCK_CREATE"\ - -a -x "$LOCK_TOUCH"\ - -a -x "$LOCK_REMOVE" -} - -acquire_lock() -{ - if locking_available - then - if "$LOCK_CREATE" /var/lock/update-system-config --retry 99 - then - "$LOCK_TOUCH" /var/lock/update-system-config & - LOCK_PROCESS="$!" - else - fail acquire lock - fi - else - true - fi -} - -release_lock() -{ - if locking_available - then - if test x"$LOCK_PROCESS" != x - then - kill "$LOCK_PROCESS" - "$LOCK_REMOVE" /var/lock/update-system-config - else - echo No Lock Acquired >&2 - fi - else - true - fi -} - -get_asset() -{ - mkdir -p "$WGET_CACHE" || fail creating WGET_CACHE - local tarball=`basename "$1"` - test -r "$WGET_CACHE/$tarball" || ( cd "$WGET_CACHE" && curl --location --remote-name "$1" || fail getting $1 ) - case "$tarball" in - *.zip) unzip -qq -d .. -o "$WGET_CACHE/$tarball" || fail unzip $tarball ;; - *.tar.gz|*.tgz) tar -C .. -xzf "$WGET_CACHE/$tarball" || fail untar $tarball ;; - *) fail unrecognized filetype: $tarball ;; - esac -} - -s3_available() -{ - test -x "$helpers/s3get.sh" -a -x "$helpers/s3put.sh" -a -r "$helpers/s3curl.pl" -} - -build_dir_Darwin() -{ - echo build-darwin-universal -} - -build_dir_Linux() -{ - echo viewer-linux-i686-`echo $1 | tr A-Z a-z` -} - -build_dir_CYGWIN() -{ - echo build-vc80 -} - -installer_Darwin() -{ - ls -1td "`build_dir_Darwin Release`/newview/"*.dmg 2>/dev/null | sed 1q -} - -installer_Linux() -{ - ls -1td "`build_dir_Linux Release`/newview/"*.tar.bz2 2>/dev/null | sed 1q -} - -installer_CYGWIN() -{ - d=`build_dir_CYGWIN Release` - p=`sed 's:.*=::' "$d/newview/Release/touched.bat"` - echo "$d/newview/Release/$p" -} - -# deal with aborts etc.. -trap fail 1 2 3 14 15 - -# Check location -cd "$here/../.." - -test -x ../linden/scripts/automated_build_scripts/opensrc-build.sh\ - || fail 'The parent dir of your checkout needs to be named "linden"' - -. doc/asset_urls.txt -get_asset "$SLASSET_ART" - - -# Set up platform specific stuff -case "$arch" in - -# Note that we can only build the "Release" variant for Darwin, because of a compiler bug: -# ld: bl out of range (-16777272 max is +/-16M) -# from __static_initialization_and_destruction_0(int, int)at 0x033D319C -# in __StaticInit of -# indra/build-darwin-universal/newview/SecondLife.build/Debug/Second Life.build/Objects-normal/ppc/llvoicevisualizer.o -# to ___cxa_atexit$island_2 at 0x023D50F8 -# in __text of -# indra/build-darwin-universal/newview/SecondLife.build/Debug/Second Life.build/Objects-normal/ppc/Second Life -# in __static_initialization_and_destruction_0(int, int) -# from indra/build-darwin-universal/newview/SecondLife.build/Debug/Second Life.build/Objects-normal/ppc/llvoicevisualizer.o - -Darwin) - helpers=/usr/local/buildscripts/generic_vc - variants="Release" - cmake_generator="Xcode" - fmod=fmodapi375mac - fmod_tar="$fmod.zip" - fmod_so=libfmod.a - fmod_lib=lib - target_dirs="libraries/universal-darwin/lib_debug - libraries/universal-darwin/lib_release - libraries/universal-darwin/lib_release_client" - other_archs="$S3GET_URL/$branch/$revision/CYGWIN $S3GET_URL/$branch/$revision/Linux" - mail="$helpers"/mail.py - all_done="$helpers"/all_done.py - get_asset "$SLASSET_LIBS_DARWIN" - ;; - -CYGWIN) - helpers=/cygdrive/c/buildscripts - variants="Debug RelWithDebInfo Release" - #variants="Release" - cmake_generator="vc80" - fmod=fmodapi375win - fmod_tar=fmodapi375win.zip - fmod_so=fmodvc.lib - fmod_lib=lib - target_dirs="libraries/i686-win32/lib/debug - libraries/i686-win32/lib/release" - other_archs="$S3GET_URL/$branch/$revision/Darwin $S3GET_URL/$branch/$revision/Linux" - export PATH="/cygdrive/c/Python25:/cygdrive/c/Program Files/Cmake 2.6/bin":$PATH - export PERL="/cygdrive/c/Perl/bin/perl.exe" - export S3CURL="C:\\buildscripts\s3curl.pl" - export CURL="C:\\cygwin\\bin\\curl.exe" - mail="C:\\buildscripts\\mail.py" - all_done="C:\\buildscripts\\all_done.py" - get_asset "$SLASSET_LIBS_WIN32" - ;; - -Linux) - helpers=/var/opt/parabuild/buildscripts/generic_vc - [ x"$CXX" = x ] && test -x /usr/bin/g++-4.1 && export CXX=/usr/bin/g++-4.1 - acquire_lock - variants="Debug RelWithDebInfo Release" - #variants="Release" - cmake_generator="Unix Makefiles" - fmod=fmodapi375linux - fmod_tar="$fmod".tar.gz - fmod_so=libfmod-3.75.so - fmod_lib=. - target_dirs="libraries/i686-linux/lib_debug - libraries/i686-linux/lib_release - libraries/i686-linux/lib_release_client" - other_archs="$S3GET_URL/$branch/$revision/Darwin $S3GET_URL/$branch/$revision/CYGWIN" - mail="$helpers"/mail.py - all_done="$helpers"/all_done.py - # Change the DISTCC_DIR to be somewhere that the parabuild process can write to - if test -r /etc/debian_version - then - [ x"$DISTCC_DIR" = x ] && export DISTCC_DIR=/var/tmp/parabuild - case `cat /etc/debian_version` in - 3.*) [ x"$DISTCC_HOSTS" = x ]\ - && export DISTCC_HOSTS="build-linux-1 - build-linux-2 - build-linux-3 - build-linux-4 - build-linux-5" ;; - 4.*) [ x"$DISTCC_HOSTS" = x ]\ - && export DISTCC_HOSTS="build-linux-6 - build-linux-7 - build-linux-8 - build-linux-9" ;; - esac - fi - - get_asset "$SLASSET_LIBS_LINUXI386" - ;; - -*) fail undefined $arch ;; -esac - -get_asset "http://www.fmod.org/index.php/release/version/$fmod_tar" - -# Special case for Mac... -case "$arch" in - -Darwin) - if lipo -create -output "../$fmod"/api/$fmod_lib/libfmod-universal.a\ - "../$fmod"/api/$fmod_lib/libfmod.a\ - "../$fmod"/api/$fmod_lib/libfmodx86.a - then - mv "../$fmod"/api/$fmod_lib/libfmod.a "../$fmod"/api/$fmod_lib/libfmodppc.a - mv "../$fmod"/api/$fmod_lib/libfmod-universal.a "../$fmod"/api/$fmod_lib/libfmod.a - echo Created fat binary - else - fail running lipo - fi - ;; - -esac - -# ensure helpers are up to date -( cd "$helpers" && svn up ) - -# First, go into the directory where the code was checked out by Parabuild -cd indra - -# This is the way it works now, but it will soon work on a variant dependent way -for target_dir in $target_dirs -do - mkdir -p "../$target_dir" - cp -f "../../$fmod/api/$fmod_lib/$fmod_so" "../$target_dir" -done -mkdir -p "../libraries/include" -cp -f "../../$fmod/api/inc/"* "../libraries/include" - -# Special Windows case -test -r "../../$fmod/api/fmod.dll" && cp -f "../../$fmod/api/fmod.dll" newview - -# Now run the build command over all variants -succeeded=true -cp /dev/null build.log - -### TEST CODE - remove when done -### variants= -### echo "Artificial build failure to test notifications" > build.log -### succeeded=false -### END TEST CODE - -for variant in $variants -do - build_dir=`build_dir_$arch $variant` - rm -rf "$build_dir" - # This is the way it will work in future - #for target_dir in $target_dirs - #do - # mkdir -p "$build_dir/$target_dir" - # cp "../../$fmod/api/$fmod_lib/$fmod_so" "$build_dir/$target_dir" - #done - #mkdir -p "$build_dir/libraries/include" - #cp "../../$fmod/api/inc/"* "$build_dir/libraries/include" - echo "==== $variant ====" >> build.log - if ./develop.py \ - --unattended \ - --incredibuild \ - -t $variant \ - -G "$cmake_generator" \ - configure \ - -DPACKAGE:BOOL=ON >>build.log 2>&1 - then - if ./develop.py\ - --unattended\ - --incredibuild \ - -t $variant\ - -G "$cmake_generator" \ - build package >>build.log 2>&1 - then - # run tests if needed - true - else - succeeded=false - fi - else - succeeded=false - fi -done - -# check statuis and upload results to S3 -subject= -if $succeeded -then - package=`installer_$arch` - test -r "$package" || fail not found: $package - package_file=`echo $package | sed 's:.*/::'` - if s3_available - then - echo "$PUBLIC_URL/$branch/$revision/$package_file" > "$arch" - echo "$PUBLIC_URL/$branch/$revision/good-build.$arch" >> "$arch" - "$helpers/s3put.sh" "$package" "$S3PUT_URL/$branch/$revision/$package_file" binary/octet-stream\ - || fail Uploading "$package" - "$helpers/s3put.sh" build.log "$S3PUT_URL/$branch/$revision/good-build.$arch" text/plain\ - || fail Uploading build.log - "$helpers/s3put.sh" "$arch" "$S3PUT_URL/$branch/$revision/$arch" text/plain\ - || fail Uploading token file - if python "$all_done"\ - curl\ - "$S3GET_URL/$branch/$revision/$arch"\ - $other_archs > message - then - subject="Successful Build for $branch ($revision)" - fi - else - true s3 is not available - fi -else - if s3_available - then - "$helpers/s3put.sh" build.log "$S3PUT_URL/$branch/$revision/failed-build.$arch" text/plain\ - || fail Uploading build.log - subject="Failed Build for $branch ($revision) on $arch" - cat >message <<EOF -Build for $branch ($revision) failed for $arch. -Please see the build log for details: - -$PUBLIC_URL/$branch/$revision/failed-build.$arch - -EOF - else - true s3 is not available - fi -fi - -# We have something to say... -if [ x"$subject" != x ] -then - # Extract change list since last build - if [ x"$PARABUILD_CHANGE_LIST_NUMBER" = x ] - then - echo "No change information available" >> message - elif [ x"$PARABUILD_PREVIOUS_CHANGE_LIST_NUMBER" = x ] - then - ( cd .. && svn log --verbose --stop-on-copy --limit 50 ) >>message - else - ( cd .. && svn log --verbose -r"$PARABUILD_PREVIOUS_CHANGE_LIST_NUMBER":"$PARABUILD_CHANGE_LIST_NUMBER" ) >>message - fi - # $PUBLIC_EMAIL can be a list, so no quotes - python "$mail" "$subject" $PUBLIC_EMAIL <message -fi - -if $succeeded -then - pass -else - fail -fi - diff --git a/scripts/packages-formatter.py b/scripts/packages-formatter.py new file mode 100755 index 0000000000..4e66cf9ed4 --- /dev/null +++ b/scripts/packages-formatter.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +"""\ +This module formats the package version and copyright information for the +viewer and its dependent packages. + +$LicenseInfo:firstyear=2014&license=viewerlgpl$ +Second Life Viewer Source Code +Copyright (C) 2014, Linden Research, Inc. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; +version 2.1 of the License only. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +$/LicenseInfo$ +""" +import os +import sys +import errno +import re +import subprocess + +_autobuild=os.getenv('AUTOBUILD', 'autobuild') + +pkg_line=re.compile('^([\w-]+):\s+(.*)$') + +def autobuild(*args): + """ + Launch autobuild with specified command-line arguments. + Return its stdout pipe from which the caller can read. + """ + # subprocess wants a list, not a tuple + command = [_autobuild] + list(args) + try: + child = subprocess.Popen(command, + stdin=None, stdout=subprocess.PIPE, + universal_newlines=True) + except OSError as err: + if err.errno != errno.ENOENT: + # Don't attempt to interpret anything but ENOENT + raise + # Here it's ENOENT: subprocess can't find the autobuild executable. + print >>sys.stderr, "packages-formatter on %s: can't run autobuild:\n%s\n%s" % \ + (sys.platform, ' '.join(command), err) + sys.exit(1) + + # no exceptions yet, let caller read stdout + return child.stdout + +version={} +versions=autobuild('install', '--versions') +for line in versions: + pkg_info = pkg_line.match(line) + if pkg_info: + pkg = pkg_info.group(1) + if pkg not in version: + version[pkg] = pkg_info.group(2).strip() + else: + sys.exit("Duplicate version for %s" % pkg) + else: + sys.exit("Unrecognized --versions output: %s" % line) + +copyright={} +copyrights=autobuild('install', '--copyrights') +viewer_copyright = copyrights.readline() # first line is the copyright for the viewer itself +for line in copyrights: + pkg_info = pkg_line.match(line) + if pkg_info: + pkg = pkg_info.group(1) + if pkg not in copyright: + copyright[pkg] = pkg_info.group(2).strip() + else: + sys.exit("Duplicate copyright for %s" % pkg) + else: + sys.exit("Unrecognized --copyrights output: %s" % line) + +print viewer_copyright +for pkg in sorted(version): + print ': '.join([pkg, version[pkg]]) + if pkg in copyright: + print copyright[pkg] + else: + sys.exit("No copyright for %s" % pkg) |