diff --git a/indra/llcorehttp/_httpoperation.cpp b/indra/llcorehttp/_httpoperation.cpp index 1c207fd0112af86a84d1dd8aef5d14824e27b1d6..ca719cdf5975e30a703e19d4bcef17bef5271195 100644 --- a/indra/llcorehttp/_httpoperation.cpp +++ b/indra/llcorehttp/_httpoperation.cpp @@ -127,7 +127,6 @@ void HttpOperation::visitNotifier(HttpRequest *) response->setStatus(mStatus); mUserHandler->onCompleted(getHandle(), response); - response->release(); } } diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index a6918df17b6ce9e9a46cbb1a2b0536e87cff3ef8..2c6380825a1f5e0e4d275f3632649bc3173480d4 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -48,6 +48,7 @@ #include "llhttpconstants.h" #include "llproxy.h" +#include "llmessagelog.h" // *DEBUG: "[curl:bugs] #1420" problem and testing. // @@ -145,7 +146,8 @@ HttpOpRequest::HttpOpRequest() mPolicyRetryAt(HttpTime(0)), mPolicyRetryLimit(HTTP_RETRY_COUNT_DEFAULT), mPolicyMinRetryBackoff(HttpTime(HTTP_RETRY_BACKOFF_MIN_DEFAULT)), - mPolicyMaxRetryBackoff(HttpTime(HTTP_RETRY_BACKOFF_MAX_DEFAULT)) + mPolicyMaxRetryBackoff(HttpTime(HTTP_RETRY_BACKOFF_MAX_DEFAULT)), + mRequestId(0) { // *NOTE: As members are added, retry initialization/cleanup // may need to be extended in @see prepareRequest(). @@ -249,6 +251,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request) response->setBody(mReplyBody); response->setHeaders(mReplyHeaders); response->setRequestURL(mReqURL); + response->setRequestId(mRequestId); if (mReplyOffset || mReplyLength) { @@ -258,7 +261,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request) response->setContentType(mReplyConType); response->setRetries(mPolicyRetries, mPolicy503Retries); - HttpResponse::TransferStats::ptr_t stats = HttpResponse::TransferStats::ptr_t(new HttpResponse::TransferStats); + HttpResponse::TransferStats::ptr_t stats = boost::make_shared<HttpResponse::TransferStats>(); curl_easy_getinfo(mCurlHandle, CURLINFO_SIZE_DOWNLOAD, &stats->mSizeDownload); curl_easy_getinfo(mCurlHandle, CURLINFO_TOTAL_TIME, &stats->mTotalTime); @@ -267,7 +270,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request) response->setTransferStats(stats); mUserHandler->onCompleted(this->getHandle(), response); - + if (LLMessageLog::haveLogger()) LLMessageLog::log(response); response->release(); } } @@ -404,6 +407,7 @@ HttpStatus HttpOpRequest::setupMove(HttpRequest::policy_t policy_id, return HttpStatus(); } +static U64 sRequestId = 0; void HttpOpRequest::setupCommon(HttpRequest::policy_t policy_id, HttpRequest::priority_t priority, @@ -412,6 +416,7 @@ void HttpOpRequest::setupCommon(HttpRequest::policy_t policy_id, const HttpOptions::ptr_t & options, const HttpHeaders::ptr_t & headers) { + mRequestId = sRequestId++; mProcFlags = 0U; mReqPolicy = policy_id; mReqPriority = priority; @@ -973,7 +978,7 @@ size_t HttpOpRequest::headerCallback(void * data, size_t size, size_t nmemb, voi // Save headers in response if (! op->mReplyHeaders) { - op->mReplyHeaders = HttpHeaders::ptr_t(new HttpHeaders); + op->mReplyHeaders = boost::make_shared<HttpHeaders>(); } op->mReplyHeaders->append(name, value ? value : ""); } diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h index aceea25f458e066d2c49c51d6ff233166f269e9f..ed14ca7ed66aba0a187dce7bab65e99886d63d29 100644 --- a/indra/llcorehttp/_httpoprequest.h +++ b/indra/llcorehttp/_httpoprequest.h @@ -234,6 +234,9 @@ public: int mPolicyRetryLimit; HttpTime mPolicyMinRetryBackoff; // initial delay between retries (mcs) HttpTime mPolicyMaxRetryBackoff; + + // Alchemy: Request ID for message logger + U64 mRequestId; }; // end class HttpOpRequest @@ -243,8 +246,8 @@ public: class HttpOpRequestCompare { public: - bool operator()(const HttpOpRequest * lhs, const HttpOpRequest * rhs) - { + bool operator()(const HttpOpRequest * lhs, const HttpOpRequest * rhs) const + { return lhs->mReqPriority > rhs->mReqPriority; } }; // end class HttpOpRequestCompare diff --git a/indra/llcorehttp/_httprequestqueue.cpp b/indra/llcorehttp/_httprequestqueue.cpp index ba7b5f7c933f6be52791bdbb88bbd3fd821e81b0..9ed3355e62a077ec76b04da4cfb57116dabda2eb 100644 --- a/indra/llcorehttp/_httprequestqueue.cpp +++ b/indra/llcorehttp/_httprequestqueue.cpp @@ -30,6 +30,7 @@ #include "_httpoperation.h" #include "_mutex.h" +#include "llmessagelog.h" using namespace LLCoreInt; @@ -70,8 +71,9 @@ void HttpRequestQueue::term() } -HttpStatus HttpRequestQueue::addOp(const HttpRequestQueue::opPtr_t &op) +HttpStatus HttpRequestQueue::addOp(const HttpRequestQueue::opPtr_t &op, bool loggable /* = true */) { + if (loggable && LLMessageLog::haveLogger()) LLMessageLog::log(op); bool wake(false); { HttpScopedLock lock(mQueueMutex); diff --git a/indra/llcorehttp/_httprequestqueue.h b/indra/llcorehttp/_httprequestqueue.h index 79d009e1e5801af1a52292293e1839aadfa61917..2fcfb12e2f73808124df593a9cddaec0b962e280 100644 --- a/indra/llcorehttp/_httprequestqueue.h +++ b/indra/llcorehttp/_httprequestqueue.h @@ -85,7 +85,7 @@ public: /// an explicit release() call. /// /// Threading: callable by any thread. - HttpStatus addOp(const opPtr_t &op); + HttpStatus addOp(const opPtr_t &op, bool loggable = true); /// Return the operation on the front of the queue. If /// the queue is empty and @wait is false, call returns diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index b13cc57564ac95ae6107f678dadcc6481731bace..d9cedddf7a97004c4ad65ea6bc53d74745c11188 100644 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -188,8 +188,6 @@ /// #include "linden_common.h" // Modifies curl/curl.h interfaces -#include <boost/intrusive_ptr.hpp> -#include <boost/shared_ptr.hpp> #include <boost/weak_ptr.hpp> #include <boost/function.hpp> #include <string> diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp index 3b91e3edff300f191a75beadbdf14b1a1fdcdb5c..f95de1a896f897389106c5c59b3f0d19262a007b 100644 --- a/indra/llcorehttp/httprequest.cpp +++ b/indra/llcorehttp/httprequest.cpp @@ -48,6 +48,8 @@ bool has_inited(false); } +static const bool NO_LOG = false; + namespace LLCore { @@ -137,7 +139,7 @@ HttpHandle HttpRequest::setPolicyOption(EPolicyOption opt, policy_t pclass, return LLCORE_HTTP_HANDLE_INVALID; } op->setReplyPath(mReplyQueue, handler); - if (! (status = mRequestQueue->addOp(op))) // transfers refcount + if (! (status = mRequestQueue->addOp(op, false))) // transfers refcount { mLastReqStatus = status; return LLCORE_HTTP_HANDLE_INVALID; @@ -472,7 +474,7 @@ HttpHandle HttpRequest::requestCancel(HttpHandle request, HttpHandler::ptr_t use HttpOperation::ptr_t op(new HttpOpCancel(request)); op->setReplyPath(mReplyQueue, user_handler); - if (! (status = mRequestQueue->addOp(op))) // transfers refcount + if (! (status = mRequestQueue->addOp(op, NO_LOG))) // transfers refcount { mLastReqStatus = status; return LLCORE_HTTP_HANDLE_INVALID; @@ -553,7 +555,7 @@ HttpHandle HttpRequest::requestStopThread(HttpHandler::ptr_t user_handler) HttpOperation::ptr_t op(new HttpOpStop()); op->setReplyPath(mReplyQueue, user_handler); - if (! (status = mRequestQueue->addOp(op))) // transfers refcount + if (! (status = mRequestQueue->addOp(op, NO_LOG))) // transfers refcount { mLastReqStatus = status; return handle; @@ -573,7 +575,7 @@ HttpHandle HttpRequest::requestSpin(int mode) HttpOperation::ptr_t op(new HttpOpSpin(mode)); op->setReplyPath(mReplyQueue, HttpHandler::ptr_t()); - if (! (status = mRequestQueue->addOp(op))) // transfers refcount + if (! (status = mRequestQueue->addOp(op, NO_LOG))) // transfers refcount { mLastReqStatus = status; return handle; diff --git a/indra/llcorehttp/httprequest.h b/indra/llcorehttp/httprequest.h index 5b735d158310319b3cd12bf1fc29d859f5cc01eb..d3f4453db6a8f9ab5ab0381229556a9d3e643318 100644 --- a/indra/llcorehttp/httprequest.h +++ b/indra/llcorehttp/httprequest.h @@ -90,8 +90,8 @@ public: virtual ~HttpRequest(); private: - HttpRequest(const HttpRequest &); // Disallowed - void operator=(const HttpRequest &); // Disallowed + HttpRequest(const HttpRequest &) = delete; // Disallowed + void operator=(const HttpRequest &) = delete; // Disallowed public: typedef unsigned int policy_t; diff --git a/indra/llcorehttp/httpresponse.h b/indra/llcorehttp/httpresponse.h index 504504247e17a86747aeaa941eaa9a5e16fb5a25..a38a3bb10c05ced57be7afb3e8c6cb5eb94c03ae 100644 --- a/indra/llcorehttp/httpresponse.h +++ b/indra/llcorehttp/httpresponse.h @@ -189,8 +189,8 @@ public: mStats = stats; } - TransferStats::ptr_t getTransferStats() - { + TransferStats::ptr_t getTransferStats() const + { return mStats; } @@ -204,6 +204,8 @@ public: return mRequestUrl; } + void setRequestId(U64 id) { mRequestId = id; } + U64 getRequestId() const { return mRequestId; } protected: // Response data here @@ -219,6 +221,7 @@ protected: std::string mRequestUrl; TransferStats::ptr_t mStats; + U64 mRequestId; }; diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index baf38b20d6e8ee24307977bfd9bb484a9b3355f9..6dde3e8e22dbc59e5d9e93d3fb30b9bf85b59013 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -31,17 +31,15 @@ #include "llcoproceduremanager.h" #include "llexception.h" #include "stringize.h" -#include <boost/assign.hpp> //========================================================================= // Map of pool sizes for known pools -// *TODO$: When C++11 this can be initialized here as follows: -// = {{"AIS", 25}, {"Upload", 1}} -static std::map<std::string, U32> DefaultPoolSizes = - boost::assign::map_list_of - (std::string("Upload"), 1) - (std::string("AIS"), 1); - // *TODO: Rider for the moment keep AIS calls serialized otherwise the COF will tend to get out of sync. +static std::map<std::string, U32> DefaultPoolSizes = { + {"Upload", 1}, + {"AIS", 1} + // *TODO: Rider for the moment keep AIS calls serialized otherwise the COF will tend to get out of sync. +}; + #define DEFAULT_POOL_SIZE 5 @@ -148,7 +146,7 @@ LLCoprocedureManager::poolPtr_t LLCoprocedureManager::initializePool(const std:: { // Attempt to look up a pool size in the configuration. If found use that std::string keyName = "PoolSize" + poolName; - int size = 0; + size_t size = 0; if (poolName.empty()) LL_ERRS("CoprocedureManager") << "Poolname must not be empty" << LL_ENDL; @@ -161,7 +159,7 @@ LLCoprocedureManager::poolPtr_t LLCoprocedureManager::initializePool(const std:: if (size == 0) { // if not found grab the know default... if there is no known // default use a reasonable number like 5. - std::map<std::string, U32>::iterator it = DefaultPoolSizes.find(poolName); + std::map<std::string, U32>::const_iterator it = DefaultPoolSizes.find(poolName); if (it == DefaultPoolSizes.end()) size = DEFAULT_POOL_SIZE; else @@ -186,7 +184,7 @@ LLUUID LLCoprocedureManager::enqueueCoprocedure(const std::string &pool, const s // Attempt to find the pool and enqueue the procedure. If the pool does // not exist, create it. poolPtr_t targetPool; - poolMap_t::iterator it = mPoolMap.find(pool); + poolMap_t::const_iterator it = mPoolMap.find(pool); if (it == mPoolMap.end()) { diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h index 42153590c529b5fc8823e7548b395395892b78d2..9f71a32d3b20ba07d6d351e43c8cc6902fc57343 100644 --- a/indra/llmessage/llcorehttputil.h +++ b/indra/llmessage/llcorehttputil.h @@ -336,19 +336,19 @@ public: /// not be deallocated during the yield. LLSD postAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD postAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::BufferArray::ptr_t rawbody, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD postAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t &headers) { return postAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + boost::make_shared<LLCore::HttpOptions>(), headers); } LLSD postAndSuspend(LLCore::HttpRequest::ptr_t &request, @@ -356,59 +356,59 @@ public: LLCore::HttpHeaders::ptr_t &headers) { return postAndSuspend(request, url, rawbody, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + boost::make_shared<LLCore::HttpOptions>(), headers); } LLSD postRawAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::BufferArray::ptr_t rawbody, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD postRawAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, LLCore::BufferArray::ptr_t &rawbody, LLCore::HttpHeaders::ptr_t &headers) { return postRawAndSuspend(request, url, rawbody, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + boost::make_shared<LLCore::HttpOptions>(), headers); } LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, std::string fileName, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, std::string fileName, LLCore::HttpHeaders::ptr_t &headers) { return postFileAndSuspend(request, url, fileName, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + boost::make_shared<LLCore::HttpOptions>(), headers); } LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLUUID assetId, LLAssetType::EType assetType, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLUUID assetId, LLAssetType::EType assetType, LLCore::HttpHeaders::ptr_t &headers) { return postFileAndSuspend(request, url, assetId, assetType, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + boost::make_shared<LLCore::HttpOptions>(), headers); } LLSD postJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD postJsonAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t &headers) { return postJsonAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + boost::make_shared<LLCore::HttpOptions>(), headers); } @@ -420,27 +420,27 @@ public: /// not be deallocated during the yield. LLSD putAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD putAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t headers) { return putAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + boost::make_shared<LLCore::HttpOptions>(), headers); } LLSD putJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD putJsonAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t &headers) { return putJsonAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + boost::make_shared<LLCore::HttpOptions>(), headers); } /// Execute a Get transaction on the supplied URL and yield execution of @@ -451,25 +451,25 @@ public: /// LLSD getAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD getAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, LLCore::HttpHeaders::ptr_t &headers) { return getAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + boost::make_shared<LLCore::HttpOptions>(), headers); } LLSD getRawAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD getRawAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, LLCore::HttpHeaders::ptr_t &headers) { return getRawAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + boost::make_shared<LLCore::HttpOptions>(), headers); } @@ -479,13 +479,13 @@ public: /// before being returned to the caller. LLSD getJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD getJsonAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, LLCore::HttpHeaders::ptr_t &headers) { return getJsonAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + boost::make_shared<LLCore::HttpOptions>(), headers); } @@ -497,13 +497,13 @@ public: /// not be deallocated during the yield. LLSD deleteAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD deleteAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::HttpHeaders::ptr_t headers) { return deleteAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + boost::make_shared<LLCore::HttpOptions>(), headers); } @@ -513,13 +513,13 @@ public: /// before being returned to the caller. LLSD deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::HttpHeaders::ptr_t headers) { return deleteJsonAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + boost::make_shared<LLCore::HttpOptions>(), headers); } @@ -531,14 +531,14 @@ public: /// not be deallocated during the yield. LLSD patchAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD patchAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t &headers) { return patchAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + boost::make_shared<LLCore::HttpOptions>(), headers); } /// Execute a COPY transaction on the supplied URL and yield execution of @@ -551,14 +551,14 @@ public: /// not be deallocated during the yield. LLSD copyAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const std::string dest, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD copyAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const std::string & dest, LLCore::HttpHeaders::ptr_t &headers) { return copyAndSuspend(request, url, dest, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + boost::make_shared<LLCore::HttpOptions>(), headers); } /// Execute a MOVE transaction on the supplied URL and yield execution of @@ -571,14 +571,14 @@ public: /// not be deallocated during the yield. LLSD moveAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const std::string dest, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = boost::make_shared<LLCore::HttpOptions>(), + LLCore::HttpHeaders::ptr_t headers = boost::make_shared<LLCore::HttpHeaders>()); LLSD moveAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const std::string & dest, LLCore::HttpHeaders::ptr_t &headers) { return moveAndSuspend(request, url, dest, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + boost::make_shared<LLCore::HttpOptions>(), headers); } /// diff --git a/indra/llmessage/llmessagelog.cpp b/indra/llmessage/llmessagelog.cpp index 5dd645b68742a8bc12c6b36b5a18777cde5b15de..aea14225335aea533915bb6e5fbb567c9c3e63b6 100644 --- a/indra/llmessage/llmessagelog.cpp +++ b/indra/llmessage/llmessagelog.cpp @@ -1,7 +1,7 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com /** - * @file lleasymessagereader.cpp + * @file llmessagelog.cpp * * $LicenseInfo:firstyear=2015&license=viewerlgpl$ * @@ -17,92 +17,87 @@ * $/LicenseInfo$ */ +#include "linden_common.h" #include "llmessagelog.h" -#include "llbuffer.h" + +#include "bufferarray.h" +#include "httprequest.h" +#include "httpresponse.h" +#include "llmemory.h" #include <boost/circular_buffer.hpp> +#include "_httpoprequest.h" static boost::circular_buffer<LogPayload> sRingBuffer = boost::circular_buffer<LogPayload>(2048); -LLMessageLogEntry::LLMessageLogEntry() -: mType(NONE) -, mFromHost(LLHost()) -, mToHost(LLHost()) -, mDataSize(0) -, mData(nullptr) -, mStatusCode(0) -, mMethod() -, mRequestID(0) -{ -} - -LLMessageLogEntry::LLMessageLogEntry(EType type, LLHost from_host, LLHost to_host, U8* data, S32 data_size) -: mType(type) -, mFromHost(from_host) +LLMessageLogEntry::LLMessageLogEntry(LLHost from_host, LLHost to_host, U8* data, size_t data_size) +: mType(TEMPLATE) +, mFromHost(from_host) , mToHost(to_host) , mDataSize(data_size) , mData(nullptr) -, mStatusCode(0) -, mMethod() -, mRequestID(0) +// unused for template +, mURL("") +, mContentType("") +, mHeaders(nullptr) +, mMethod(HTTP_INVALID) +, mStatusCode(0) +, mRequestId(0) { - if(data) + if (data) { mData = new U8[data_size]; memcpy(mData, data, data_size); } } -LLMessageLogEntry::LLMessageLogEntry(EType type, const std::string& url, const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer, const LLSD& headers, U64 request_id, - EHTTPMethod method, U32 status_code) - : mType(type), - mDataSize(0), - mData(nullptr), - mURL(url), - mStatusCode(status_code), - mMethod(method), - mHeaders(headers), - mRequestID(request_id) +LLMessageLogEntry::LLMessageLogEntry(EEntryType etype, U8* data, size_t data_size, const std::string& url, + const std::string& content_type, const LLCore::HttpHeaders::ptr_t& headers, + EHTTPMethod method, U8 status_code, U64 request_id) +: mType(etype) +, mDataSize(data_size) +, mData(nullptr) +, mURL(url) +, mContentType(content_type) +, mHeaders(headers) +, mMethod(method) +, mStatusCode(status_code) +, mRequestId(request_id) { - if(buffer.get()) - { - S32 channel = type == HTTP_REQUEST ? channels.out() : channels.in(); - mDataSize = buffer->countAfter(channel, nullptr); - if (mDataSize > 0) - { - mData = new U8[mDataSize + 1]; - buffer->readAfter(channel, nullptr, mData, mDataSize); - - //make sure this is null terminated, since it's going to be used stringified - mData[mDataSize] = '\0'; - ++mDataSize; - } - } + if (data) + { + mData = new U8[data_size]; + memcpy(mData, data, data_size); + } } + LLMessageLogEntry::LLMessageLogEntry(const LLMessageLogEntry& entry) - : mType(entry.mType), - mFromHost(entry.mFromHost), - mToHost(entry.mToHost), - mDataSize(entry.mDataSize), - mURL(entry.mURL), - mStatusCode(entry.mStatusCode), - mMethod(entry.mMethod), - mHeaders(entry.mHeaders), - mRequestID(entry.mRequestID) +: mType(entry.mType) +, mFromHost(entry.mFromHost) +, mToHost(entry.mToHost) +, mDataSize(entry.mDataSize) +, mURL(entry.mURL) +, mContentType(entry.mContentType) +, mHeaders(entry.mHeaders) +, mMethod(entry.mMethod) +, mStatusCode(entry.mStatusCode) +, mRequestId(entry.mRequestId) { mData = new U8[mDataSize]; memcpy(mData, entry.mData, mDataSize); } +/* virtual */ LLMessageLogEntry::~LLMessageLogEntry() { delete[] mData; mData = nullptr; } +/* static */ LogCallback LLMessageLog::sCallback = nullptr; +/* static */ void LLMessageLog::setCallback(LogCallback callback) { if (callback != nullptr) @@ -115,33 +110,71 @@ void LLMessageLog::setCallback(LogCallback callback) sCallback = callback; } +/* static */ void LLMessageLog::log(LLHost from_host, LLHost to_host, U8* data, S32 data_size) { if(!data_size || data == nullptr) return; - LogPayload payload = std::make_shared<LLMessageLogEntry>(LLMessageLogEntry::TEMPLATE, from_host, to_host, data, data_size); + LogPayload payload = std::make_shared<LLMessageLogEntry>(from_host, to_host, data, data_size); if(sCallback) sCallback(payload); sRingBuffer.push_back(std::move(payload)); } -void LLMessageLog::logHTTPRequest(const std::string& url, EHTTPMethod method, const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer, const LLSD& headers, U64 request_id) +// Why they decided they need two enums for the same thing, idk. +EHTTPMethod convertEMethodToEHTTPMethod(const LLCore::HttpOpRequest::EMethod e_method) { - LogPayload payload = std::make_shared<LLMessageLogEntry>(LLMessageLogEntry::HTTP_REQUEST, url, channels, buffer, - headers, request_id, method); - if (sCallback) sCallback(payload); - - sRingBuffer.push_back(std::move(payload)); + switch (e_method) + { + case LLCore::HttpOpRequest::HOR_GET: return HTTP_GET; + case LLCore::HttpOpRequest::HOR_POST: return HTTP_POST; + case LLCore::HttpOpRequest::HOR_PUT: return HTTP_PUT; + case LLCore::HttpOpRequest::HOR_DELETE: return HTTP_DELETE; + case LLCore::HttpOpRequest::HOR_PATCH: return HTTP_PATCH; + case LLCore::HttpOpRequest::HOR_COPY: return HTTP_COPY; + case LLCore::HttpOpRequest::HOR_MOVE: return HTTP_MOVE; + } + return HTTP_GET; // idk, this isn't possible; } -void LLMessageLog::logHTTPResponse(U32 status_code, const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer, const LLSD& headers, U64 request_id) +/* static */ +void LLMessageLog::log(const LLCore::HttpRequestQueue::opPtr_t& op) { - LogPayload payload = std::make_shared<LLMessageLogEntry>(LLMessageLogEntry::HTTP_RESPONSE, "", channels, buffer, - headers, request_id, HTTP_INVALID, status_code); - if (sCallback) sCallback(payload); + auto req = boost::static_pointer_cast<LLCore::HttpOpRequest>(op); + U8* data = nullptr; + size_t data_size = 0; + LLCore::BufferArray * body = req->mReqBody; + if (body) + { + data = new U8[body->size()]; + size_t len(body->read(0, data, body->size())); + data_size = (len > body->size()) ? len : body->size(); + } + + LogPayload payload = std::make_shared<LLMessageLogEntry>(LLMessageLogEntry::HTTP_REQUEST, std::move(data), data_size, + req->mReqURL, req->mReplyConType, req->mReqHeaders, convertEMethodToEHTTPMethod(req->mReqMethod), + req->mStatus.getType(), req->mRequestId); + if (sCallback) sCallback(payload); + sRingBuffer.push_back(std::move(payload)); +} - sRingBuffer.push_back(std::move(payload)); +/* static */ +void LLMessageLog::log(LLCore::HttpResponse* response) +{ + U8* data = nullptr; + size_t data_size = 0; + LLCore::BufferArray * body = response->getBody(); + if (body) + { + data = new U8[body->size()]; + size_t len(body->read(0, data, body->size())); + data_size = (len > body->size()) ? len : body->size(); + } + + LogPayload payload = std::make_shared<LLMessageLogEntry>(LLMessageLogEntry::HTTP_RESPONSE, std::move(data), data_size, + response->getRequestURL(), response->getContentType(), response->getHeaders(), HTTP_INVALID, + response->getStatus().getType(), response->getRequestId()); + if (sCallback) sCallback(payload); + sRingBuffer.push_back(std::move(payload)); } diff --git a/indra/llmessage/llmessagelog.h b/indra/llmessage/llmessagelog.h index 5de391413602015816716b6af593cbdbf1656953..ef11aa9efc932f21e5cd1a79f149b0cdb108f65e 100644 --- a/indra/llmessage/llmessagelog.h +++ b/indra/llmessage/llmessagelog.h @@ -1,5 +1,5 @@ /** - * @file lleasymessagereader.cpp + * @file llmessagelog.h * * $LicenseInfo:firstyear=2015&license=viewerlgpl$ * @@ -18,65 +18,81 @@ #ifndef LL_LLMESSAGELOG_H #define LL_LLMESSAGELOG_H -#include "linden_common.h" #include "llhttpconstants.h" #include "llhost.h" -#include "lliopipe.h" -#include <queue> -#include <string.h> +#include "httpheaders.h" +#include "_httpoperation.h" +#include "_httprequestqueue.h" + class LLMessageSystem; -class LLMessageLogEntry; -typedef std::shared_ptr<LLMessageLogEntry> LogPayload; +namespace LLCore { + class BufferArray; + class HttpResponse; +} -class LLMessageLogEntry +/** + * @brief Struct containing network message information + * + * This struct maintains several properties for each message + */ +struct LLMessageLogEntry { -public: - enum EType - { - NONE, - TEMPLATE, - HTTP_REQUEST, - HTTP_RESPONSE, - LOG_TYPE_NUM - }; - LLMessageLogEntry(); - LLMessageLogEntry(EType type, LLHost from_host, LLHost to_host, U8* data, S32 data_size); - LLMessageLogEntry(EType type, const std::string& url, const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer, const LLSD& headers, U64 request_id, - EHTTPMethod method = HTTP_INVALID, U32 status_code = 0); - LLMessageLogEntry(const LLMessageLogEntry& entry); - ~LLMessageLogEntry(); - EType mType; + typedef enum e_entry_type { + TEMPLATE, + HTTP_RESPONSE, + HTTP_REQUEST + } EEntryType; + + /// Ctor for TEMPLATE lludp message + LLMessageLogEntry(LLHost from_host, LLHost to_host, U8* data, size_t data_size); + /// Ctor for HTTP message + LLMessageLogEntry(EEntryType etype, U8* data, size_t data_size, const std::string& url, + const std::string& content_type, const LLCore::HttpHeaders::ptr_t& headers, EHTTPMethod method, + U8 status_code, U64 request_id); + /// Copy ctor + LLMessageLogEntry(const LLMessageLogEntry& entry); + + virtual ~LLMessageLogEntry(); + + EEntryType mType; LLHost mFromHost; LLHost mToHost; S32 mDataSize; U8* mData; - //http-related things - std::string mURL; - U32 mStatusCode; - EHTTPMethod mMethod; - LLSD mHeaders; - U64 mRequestID; + // http specific + std::string mURL; + std::string mContentType; + LLCore::HttpHeaders::ptr_t mHeaders; + e_http_method mMethod; + LLCore::HttpStatus::type_enum_t mStatusCode; + U64 mRequestId; }; +typedef std::shared_ptr<LLMessageLogEntry> LogPayload; typedef void(*LogCallback) (LogPayload&); +/** + * @brief Static class used for logging network messages + */ class LLMessageLog { public: + /// Set log callback static void setCallback(LogCallback callback); - static void log(LLHost from_host, LLHost to_host, U8* data, S32 data_size); - static void logHTTPRequest(const std::string& url, EHTTPMethod method, const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer, const LLSD& headers, U64 request_id); - static void logHTTPResponse(U32 status_code, const LLChannelDescriptors& channels, - const LLIOPipe::buffer_ptr_t& buffer, const LLSD& headers, U64 request_id); - - static bool haveLogger(){return sCallback != nullptr;} + /// Log lludp messages + static void log(LLHost from_host, LLHost to_host, U8* data, S32 data_size); + /// Log HTTP Request Op + static void log(const LLCore::HttpRequestQueue::opPtr_t& op); + /// Log HTTP Response + static void log(LLCore::HttpResponse* response); + /// Returns false if sCallback is null + static bool haveLogger() { return sCallback != nullptr; } private: static LogCallback sCallback; }; + #endif diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d1869fb6f104515dab1757e4009759bfd6b1aafd..c9d22839241120dc280e202a096ec9b597c8351b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -207,6 +207,7 @@ set(viewer_SOURCE_FILES lldrawpoolwlsky.cpp lldroptarget.cpp lldynamictexture.cpp + lleasymessagelogentry.cpp lleasymessagereader.cpp lleasymessagesender.cpp llemote.cpp @@ -339,6 +340,7 @@ set(viewer_SOURCE_FILES llfloatertestinspectors.cpp llfloatertestlistview.cpp llfloatertexturefetchdebugger.cpp + llfloatertexturepicker.cpp llfloatertexturezoom.cpp llfloatertools.cpp llfloatertopobjects.cpp @@ -869,6 +871,7 @@ set(viewer_HEADER_FILES lldrawpoolwlsky.h lldroptarget.h lldynamictexture.h + lleasymessagelogentry.h lleasymessagereader.h lleasymessagesender.h llemote.h @@ -1001,6 +1004,7 @@ set(viewer_HEADER_FILES llfloatertestinspectors.h llfloatertestlistview.h llfloatertexturefetchdebugger.h + llfloatertexturepicker.h llfloatertexturezoom.h llfloatertools.h llfloatertopobjects.h diff --git a/indra/newview/alviewermenu.cpp b/indra/newview/alviewermenu.cpp index 5b947b21c4016cfef5c39d128c798d87406be3ef..730bb31a01e1e4af7b45a4226b519c290f82be2c 100644 --- a/indra/newview/alviewermenu.cpp +++ b/indra/newview/alviewermenu.cpp @@ -223,15 +223,6 @@ class ALCheckLocationBar : public view_listener_t } }; -void destroy_texture(const LLUUID& id) -{ - if (id.isNull() || id == IMG_DEFAULT) return; - LLViewerFetchedTexture* texture = LLViewerTextureManager::getFetchedTexture(id); - if (texture) - texture->clearFetchedResults(); - LLAppViewer::getTextureCache()->removeFromCache(id); -} - class LLRefreshTexturesObject : public view_listener_t { bool handleEvent(const LLSD& userdata) override @@ -260,7 +251,7 @@ class LLRefreshTexturesObject : public view_listener_t for (auto it : faces_per_tex) { - destroy_texture(it.first); + ALViewerMenu::destroy_texture(it.first); } if (node->getObject()->isSculpted() && !node->getObject()->isMesh()) @@ -273,7 +264,7 @@ class LLRefreshTexturesObject : public view_listener_t if (tx) { const LLViewerTexture::ll_volume_list_t* pVolumeList = tx->getVolumeList(); - destroy_texture(sculptie); + ALViewerMenu::destroy_texture(sculptie); for (S32 idxVolume = 0; idxVolume < tx->getNumVolumes(); ++idxVolume) { LLVOVolume* pVolume = pVolumeList->at(idxVolume); @@ -297,7 +288,7 @@ class LLRefreshTexturesAvatar : public view_listener_t for (U32 baked_idx = 0; baked_idx < BAKED_NUM_INDICES; ++baked_idx) { ETextureIndex te_idx = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_idx); - destroy_texture(avatar->getTE(te_idx)->getID()); + ALViewerMenu::destroy_texture(avatar->getTE(te_idx)->getID()); } LLAvatarPropertiesProcessor::getInstance()->sendAvatarTexturesRequest(avatar->getID()); @@ -487,6 +478,15 @@ bool enable_music_ticker() && gAudiop->getStreamingAudioImpl()->supportsMetaData(); } +void ALViewerMenu::destroy_texture(const LLUUID& id) +{ + if (id.isNull() || id == IMG_DEFAULT) return; + LLViewerFetchedTexture* texture = LLViewerTextureManager::getFetchedTexture(id); + if (texture) + texture->clearFetchedResults(); + LLAppViewer::getTextureCache()->removeFromCache(id); +} + //////////////////////////////////////////////////////// // Menu registry diff --git a/indra/newview/alviewermenu.h b/indra/newview/alviewermenu.h index 34b6b4d34460d809773dc70accfed72528793253..6d4481ce2d7a2be277db5a21ac3b9db84cca4d4d 100644 --- a/indra/newview/alviewermenu.h +++ b/indra/newview/alviewermenu.h @@ -16,14 +16,15 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * $/LicenseInfo$ -**/ - +**/ + #ifndef AL_LLVIEWERMENU_H #define AL_LLVIEWERMENU_H namespace ALViewerMenu { void initialize_menus(); + void destroy_texture(const LLUUID& id); } #endif // AL_VIEWERMENU_H diff --git a/indra/newview/app_settings/settings_alchemy.xml b/indra/newview/app_settings/settings_alchemy.xml index 2b5e8204739f478a910ab4bf35186c2be9315b74..9b957d75a3985d32a3d1cf6a2909b59c4d96c5f6 100644 --- a/indra/newview/app_settings/settings_alchemy.xml +++ b/indra/newview/app_settings/settings_alchemy.xml @@ -486,6 +486,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>AlchemyMinimapChatRings</key> + <map> + <key>Comment</key> + <string>Draw rings to denote chat range</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>AlchemyMinimapCenterRegion</key> <map> <key>Comment</key> @@ -519,6 +530,39 @@ <key>Value</key> <real>0.1</real> </map> + <key>AlchemyMinimapParcelBoundries</key> + <map> + <key>Comment</key> + <string>Draw parcel boundry lines</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>AlchemyMiniMapForSaleParcels</key> + <map> + <key>Comment</key> + <string>Draw for sale parcels</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>AlchemyMiniMapCollisionParcels</key> + <map> + <key>Comment</key> + <string>Draw collision parcels</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>AlchemyMinimapRenderObjects</key> <map> <key>Comment</key> diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index dc87689432efe5bd136a458abc64f5a3a7b6e8f4..9ddef697d1b3a67f9d7557d725cb4d632c3d6255 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -980,8 +980,8 @@ public: { LL_INFOS() << "created callback" << LL_ENDL; } - /* virtual */ void fire(const LLUUID& inv_item) - { + /* virtual */ void fire(const LLUUID& inv_item) override + { LL_INFOS() << "One item created " << inv_item.asString() << LL_ENDL; LLConstPointer<LLInventoryObject> item = gInventory.getItem(inv_item); mItemsToLink.push_back(item); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 4a5b09f5f07841116aaef8a1c0d1ca9ec0d180e4..4c4cd5223f32e70112c182985f0014a2a66acb04 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -121,7 +121,7 @@ public: } /*virtual*/ - BOOL tick() + BOOL tick() override { if(mEventTimer.hasExpired()) { @@ -144,7 +144,7 @@ public: // requests will be throttled from a non-trusted browser LLAppearanceHandler() : LLCommandHandler("appearance", UNTRUSTED_THROTTLE) {} - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) override { // support secondlife:///app/appearance/show, but for now we just // make all secondlife:///app/appearance SLapps behave this way @@ -181,17 +181,17 @@ public: F32 retry_after = DEFAULT_RETRY_AFTER_INTERVAL, S32 max_retries = DEFAULT_MAX_RETRIES ): - mDstCatID(dst_cat_id), + LLEventTimer(5.0), mTrackingPhase(phase_name), + mDstCatID(dst_cat_id), mOnCompletionFunc(on_completion_func), mOnFailureFunc(on_failure_func), mRetryAfter(retry_after), mMaxRetries(max_retries), mPendingRequests(0), mFailCount(0), - mCompletionOrFailureCalled(false), mRetryCount(0), - LLEventTimer(5.0) + mCompletionOrFailureCalled(false) { if (!mTrackingPhase.empty()) { @@ -300,7 +300,7 @@ public: // virtual // Will be deleted after returning true - only safe to do this if all callbacks have fired. - BOOL tick() + BOOL tick() override { // mPendingRequests will be zero if all requests have been // responded to. mWaitTimes.empty() will be true if we have @@ -400,8 +400,8 @@ public: { sInstanceCount--; } - - virtual bool requestOperation(const LLUUID& item_id) + + bool requestOperation(const LLUUID& item_id) override { LLViewerInventoryItem *item = gInventory.getItem(item_id); llassert(item); @@ -438,7 +438,7 @@ public: {} // virtual - void fire(const LLUUID& id) + void fire(const LLUUID& id) override { // Wear the inventory category. LLInventoryCategory* cat = gInventory.getCategory(id); @@ -460,7 +460,7 @@ public: } // virtual - void fire(const LLUUID& id) + void fire(const LLUUID& id) override { if (mCB) { @@ -578,8 +578,8 @@ struct LLFoundData mName(name), mAssetType(asset_type), mWearableType(wearable_type), - mIsReplacement(is_replacement), - mWearable( NULL ) {} + mWearable( NULL ), + mIsReplacement(is_replacement) {} LLUUID mItemID; LLUUID mAssetID; @@ -2713,8 +2713,8 @@ class LLDeferredCOFLinkObserver: public LLInventoryObserver public: LLDeferredCOFLinkObserver(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb, const std::string& description): mItemID(item_id), - mCallback(cb), - mDescription(description) + mDescription(description), + mCallback(cb) { } @@ -2722,8 +2722,8 @@ public: { } - /* virtual */ void changed(U32 mask) - { + /* virtual */ void changed(U32 mask) override + { const LLInventoryItem *item = gInventory.getItem(mItemID); if (item) { @@ -2909,8 +2909,8 @@ public: { } - /* virtual */ void fire(const LLUUID& item_id) - { + /* virtual */ void fire(const LLUUID& item_id) override + { // just removed cof link, "(wear)" suffix depends on presence of link, so update label gInventory.addChangedMask(LLInventoryObserver::LABEL, mItemID); if (mCB.notNull()) @@ -4016,11 +4016,11 @@ bool LLAppearanceMgr::mActive = true; LLAppearanceMgr::LLAppearanceMgr(): mAttachmentInvLinkEnabled(false), mOutfitIsDirty(false), - mOutfitLocked(false), - mInFlightTimer(), mIsInUpdateAppearanceFromCOF(false), - mOutstandingAppearanceBakeRequest(false), - mRerequestAppearanceBake(false) + mOutstandingAppearanceBakeRequest(false), + mRerequestAppearanceBake(false), + mOutfitLocked(false), + mInFlightTimer() { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); // unlock outfit on save operation completed @@ -4139,7 +4139,8 @@ public: ~CallAfterCategoryFetchStage2() { } - virtual void done() + + void done() override { LL_INFOS() << this << " done with incomplete " << mIncomplete.size() << " complete " << mComplete.size() << " calling callable" << LL_ENDL; @@ -4163,7 +4164,8 @@ public: ~CallAfterCategoryFetchStage1() { } - virtual void done() + + void done() override { // What we do here is get the complete information on the // items in the requested category, and set up an observer @@ -4290,7 +4292,7 @@ public: LLWearFolderHandler() : LLCommandHandler("wear_folder", UNTRUSTED_BLOCK) { } bool handle(const LLSD& tokens, const LLSD& query_map, - LLMediaCtrl* web) + LLMediaCtrl* web) override { LLSD::UUID folder_uuid; diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index e7323b8f80af4f7ec61d203949894b739e16c561..82486103924abc0cfaeb26c94bf8c65f4790c5da 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -65,48 +65,51 @@ public: virtual ~LLConversationItem(); // Stub those things we won't really be using in this conversation context - virtual const std::string& getName() const { return mName; } - virtual const std::string& getDisplayName() const { return mName; } - virtual const std::string& getSearchableName() const { return mName; } - virtual std::string getSearchableDescription() const { return LLStringUtil::null; } - virtual std::string getSearchableCreatorName() const { return LLStringUtil::null; } - virtual std::string getSearchableUUIDString() const {return LLStringUtil::null;} + const std::string& getName() const override { return mName; } + const std::string& getDisplayName() const override { return mName; } + const std::string& getSearchableName() const override { return mName; } + std::string getSearchableDescription() const override { return LLStringUtil::null; } + std::string getSearchableCreatorName() const override { return LLStringUtil::null; } + std::string getSearchableUUIDString() const override {return LLStringUtil::null;} virtual const LLUUID& getUUID() const { return mUUID; } virtual time_t getCreationDate() const { return 0; } - virtual LLPointer<LLUIImage> getIcon() const { return NULL; } + LLPointer<LLUIImage> getIcon() const override { return NULL; } virtual LLPointer<LLUIImage> getOpenIcon() const { return getIcon(); } - virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } - virtual std::string getLabelSuffix() const { return LLStringUtil::null; } - virtual BOOL isItemRenameable() const { return TRUE; } - virtual BOOL renameItem(const std::string& new_name) { mName = new_name; mNeedsRefresh = true; return TRUE; } - virtual BOOL isItemMovable( void ) const { return FALSE; } - virtual BOOL isItemRemovable( void ) const { return FALSE; } + LLFontGL::StyleFlags getLabelStyle() const override { return LLFontGL::NORMAL; } + std::string getLabelSuffix() const override { return LLStringUtil::null; } + BOOL isItemRenameable() const override { return TRUE; } + + BOOL renameItem(const std::string& new_name) override + { mName = new_name; mNeedsRefresh = true; return TRUE; } + + BOOL isItemMovable( void ) const override { return FALSE; } + BOOL isItemRemovable( void ) const override { return FALSE; } virtual BOOL isItemInTrash( void) const { return FALSE; } - virtual BOOL removeItem() { return FALSE; } - virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch) { } - virtual void move( LLFolderViewModelItem* parent_listener ) { } - virtual BOOL isItemCopyable() const { return FALSE; } - virtual BOOL copyToClipboard() const { return FALSE; } - virtual BOOL cutToClipboard() { return FALSE; } - virtual BOOL isClipboardPasteable() const { return FALSE; } - virtual void pasteFromClipboard() { } - virtual void pasteLinkFromClipboard() { } - virtual void buildContextMenu(LLMenuGL& menu, U32 flags) { } + BOOL removeItem() override { return FALSE; } + void removeBatch(std::vector<LLFolderViewModelItem*>& batch) override { } + void move( LLFolderViewModelItem* parent_listener ) override { } + BOOL isItemCopyable() const override { return FALSE; } + BOOL copyToClipboard() const override { return FALSE; } + BOOL cutToClipboard() override { return FALSE; } + BOOL isClipboardPasteable() const override { return FALSE; } + void pasteFromClipboard() override { } + void pasteLinkFromClipboard() override { } + void buildContextMenu(LLMenuGL& menu, U32 flags) override { } virtual BOOL isUpToDate() const { return TRUE; } - virtual bool hasChildren() const { return FALSE; } + bool hasChildren() const override { return FALSE; } - virtual bool potentiallyVisible() { return true; } - virtual bool filter( LLFolderViewFilter& filter) { return false; } - virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; } - virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { } - virtual bool passedFilter(S32 filter_generation = -1) { return true; } + bool potentiallyVisible() override { return true; } + bool filter( LLFolderViewFilter& filter) override { return false; } + bool descendantsPassedFilter(S32 filter_generation = -1) override { return true; } + void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) override { } + bool passedFilter(S32 filter_generation = -1) override { return true; } // The action callbacks virtual void performAction(LLInventoryModel* model, std::string action); - virtual void openItem( void ); - virtual void closeItem( void ); + void openItem( void ) override; + void closeItem( void ) override; virtual void previewItem( void ); - virtual void selectItem(void) { } + void selectItem(void) override { } virtual void showProperties(void); // Methods used in sorting (see LLConversationSort::operator()) @@ -118,10 +121,10 @@ public: // performed, and will set drop to TRUE if a drop is // requested. // Returns TRUE if a drop is possible/happened, FALSE otherwise. - virtual BOOL dragOrDrop(MASK mask, BOOL drop, + BOOL dragOrDrop(MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, - std::string& tooltip_msg) { return FALSE; } + std::string& tooltip_msg) override { return FALSE; } // bool hasSameValues(std::string name, const LLUUID& uuid) { return ((name == mName) && (uuid == mUUID)); } bool hasSameValue(const LLUUID& uuid) { return (uuid == mUUID); } @@ -154,8 +157,8 @@ public: LLConversationItemSession(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model); LLConversationItemSession(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model); - /*virtual*/ bool hasChildren() const; - LLPointer<LLUIImage> getIcon() const { return NULL; } + /*virtual*/ bool hasChildren() const override; + LLPointer<LLUIImage> getIcon() const override { return NULL; } void setSessionID(const LLUUID& session_id) { mUUID = session_id; mNeedsRefresh = true; } void addParticipant(LLConversationItemParticipant* participant); void updateName(LLConversationItemParticipant* participant); @@ -171,14 +174,14 @@ public: bool isLoaded() { return mIsLoaded; } - void buildContextMenu(LLMenuGL& menu, U32 flags); + void buildContextMenu(LLMenuGL& menu, U32 flags) override; void addVoiceOptions(menuentry_vec_t& items); - virtual const bool getTime(F64& time) const; + const bool getTime(F64& time) const override; void dumpDebugData(bool dump_children = false); private: - /*virtual*/ void onAvatarNameCache(const LLAvatarName& av_name); + /*virtual*/ void onAvatarNameCache(const LLAvatarName& av_name) override; bool mIsLoaded; // true if at least one participant has been added to the session, false otherwise }; @@ -188,8 +191,8 @@ class LLConversationItemParticipant : public LLConversationItem public: LLConversationItemParticipant(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model); LLConversationItemParticipant(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model); - - virtual const std::string& getDisplayName() const { return mDisplayName; } + + const std::string& getDisplayName() const override { return mDisplayName; } bool isVoiceMuted(); bool isModerator() const { return mIsModerator; } @@ -198,9 +201,10 @@ public: void setTimeNow() { mLastActiveTime = LLFrameTimer::getElapsedSeconds(); mNeedsRefresh = true; } void setDistance(F64 dist) { mDistToAgent = dist; mNeedsRefresh = true; } - void buildContextMenu(LLMenuGL& menu, U32 flags); + void buildContextMenu(LLMenuGL& menu, U32 flags) override; - virtual const bool getDistanceToAgent(F64& dist) const { dist = mDistToAgent; return (dist >= 0.0); } + const bool getDistanceToAgent(F64& dist) const override + { dist = mDistToAgent; return (dist >= 0.0); } void updateName(); // get from the cache (do *not* fetch) and update the avatar name LLConversationItemSession* getParentSession(); @@ -211,7 +215,7 @@ public: void setGroupBanVisible(bool visible) { mDisplayGroupBanOptions = visible; } private: - void onAvatarNameCache(const LLAvatarName& av_name); // callback used by fetchAvatarName + void onAvatarNameCache(const LLAvatarName& av_name) override; // callback used by fetchAvatarName void updateName(const LLAvatarName& av_name); bool mIsModerator; // default is false @@ -240,32 +244,32 @@ public: LLConversationFilter() { mEmpty.clear(); } ~LLConversationFilter() {} - bool check(const LLFolderViewModelItem* item) { return true; } - bool checkFolder(const LLFolderViewModelItem* folder) const { return true; } - void setEmptyLookupMessage(const std::string& message) { } - std::string getEmptyLookupMessage() const { return mEmpty; } - bool showAllResults() const { return true; } - std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const { return std::string::npos; } - std::string::size_type getFilterStringSize() const { return 0; } + bool check(const LLFolderViewModelItem* item) override { return true; } + bool checkFolder(const LLFolderViewModelItem* folder) const override { return true; } + void setEmptyLookupMessage(const std::string& message) override { } + std::string getEmptyLookupMessage() const override { return mEmpty; } + bool showAllResults() const override { return true; } + std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const override { return std::string::npos; } + std::string::size_type getFilterStringSize() const override { return 0; } - bool isActive() const { return false; } - bool isModified() const { return false; } - void clearModified() { } - const std::string& getName() const { return mEmpty; } - const std::string& getFilterText() { return mEmpty; } - void setModified(EFilterModified behavior = FILTER_RESTART) { } - - void resetTime(S32 timeout) { } - bool isTimedOut() { return false; } + bool isActive() const override { return false; } + bool isModified() const override { return false; } + void clearModified() override { } + const std::string& getName() const override { return mEmpty; } + const std::string& getFilterText() override { return mEmpty; } + void setModified(EFilterModified behavior = FILTER_RESTART) override { } + + void resetTime(S32 timeout) override { } + bool isTimedOut() override { return false; } - bool isDefault() const { return true; } - bool isNotDefault() const { return false; } - void markDefault() { } - void resetDefault() { } + bool isDefault() const override { return true; } + bool isNotDefault() const override { return false; } + void markDefault() override { } + void resetDefault() override { } - S32 getCurrentGeneration() const { return 0; } - S32 getFirstSuccessGeneration() const { return 0; } - S32 getFirstRequiredGeneration() const { return 0; } + S32 getCurrentGeneration() const override { return 0; } + S32 getFirstSuccessGeneration() const override { return 0; } + S32 getFirstRequiredGeneration() const override { return 0; } private: std::string mEmpty; }; @@ -297,9 +301,9 @@ public: : base_t(new LLConversationSort(), new LLConversationFilter()) {} - void sort(LLFolderViewFolder* folder); - bool contentsReady() { return true; } // *TODO : we need to check that participants names are available somewhat - bool startDrag(std::vector<LLFolderViewModelItem*>& items) { return false; } // We do not allow drag of conversation items + void sort(LLFolderViewFolder* folder) override; + bool contentsReady() override { return true; } // *TODO : we need to check that participants names are available somewhat + bool startDrag(std::vector<LLFolderViewModelItem*>& items) override { return false; } // We do not allow drag of conversation items private: }; diff --git a/indra/newview/lleasymessagelogentry.cpp b/indra/newview/lleasymessagelogentry.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6aa5837af8cff63f39f44856504741c5a95bd0fc --- /dev/null +++ b/indra/newview/lleasymessagelogentry.cpp @@ -0,0 +1,259 @@ +/** + * @file lleasymessagelogentry.cpp + * + * $LicenseInfo:firstyear=2018&license=viewerlgpl$ + * + * 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. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "lleasymessagelogentry.h" +#include "lleasymessagereader.h" + +#include "llworld.h" +#include "llviewerregion.h" +#include "message.h" + +#undef XMLCALL //HACK: need to find the expat.h include +#include <libxml/parser.h> +#include <libxml/tree.h> +#include <libxml/HTMLparser.h> +#include <libxml/HTMLtree.h> +#include <boost/algorithm/string.hpp> + +LLEasyMessageLogEntry::LLEasyMessageLogEntry(LogPayload entry, LLEasyMessageReader* message_reader) +: mEntry(entry) +, mResponseMsg(nullptr) +, mEasyMessageReader(message_reader) +{ + mID.generate(); + mSequenceID = 0; + + if (mEntry->mType == LLMessageLogEntry::TEMPLATE) + { + mFlags = mEntry->mData[0]; + + LLMessageTemplate* temp = nullptr; + + if (mEasyMessageReader) + temp = mEasyMessageReader->decodeTemplateMessage(&(mEntry->mData[0]), mEntry->mDataSize, mEntry->mFromHost, mSequenceID); + + if (temp) + mNames.insert(temp->mName); + else + mNames.insert("Invalid"); + + mRegionHosts.insert(isOutgoing() ? mEntry->mToHost : mEntry->mFromHost); + } + else if (mEntry->mType == LLMessageLogEntry::HTTP_REQUEST) // not template + { + std::string base_url = get_base_cap_url(mEntry->mURL); + + if (LLWorld::getInstance()->isCapURLMapped(base_url)) + { + CapUrlMatches matches = LLWorld::getInstance()->getCapURLMatches(base_url); + mNames = matches.mCapNames; + for (auto iter = matches.mRegions.begin(); iter != matches.mRegions.end(); ++iter) + { + mRegionHosts.insert((*iter)->getHost()); + } + } + else + mNames.insert(mEntry->mURL); + } + else // not template + { + mNames.insert("SOMETHING ELSE"); + } +} + +LLEasyMessageLogEntry::~LLEasyMessageLogEntry() +{ +} + +BOOL LLEasyMessageLogEntry::isOutgoing() const +{ + static const U32 LOCALHOST_ADDR = 16777343; + return mEntry->mFromHost == LLHost(LOCALHOST_ADDR, gMessageSystem->getListenPort()); +} + +std::string LLEasyMessageLogEntry::getName() +{ + std::string message_names; + std::set<std::string>::iterator iter = mNames.begin(); + std::set<std::string>::const_iterator begin = mNames.begin(); + std::set<std::string>::const_iterator end = mNames.end(); + + while (iter != end) + { + if (iter != begin) + message_names += ", "; + + message_names += (*iter); + ++iter; + } + + return message_names; +} + +void LLEasyMessageLogEntry::setResponseMessage(LogPayload entry) +{ + mResponseMsg.reset(new LLEasyMessageLogEntry(entry)); +} + +std::string LLEasyMessageLogEntry::getFull(BOOL beautify, BOOL show_header) const +{ + std::ostringstream full; + switch (mEntry->mType) + { + case LLMessageLogEntry::TEMPLATE: + { + LLMessageTemplate* temp = nullptr; + + if (mEasyMessageReader) + temp = mEasyMessageReader->decodeTemplateMessage(&(mEntry->mData[0]), mEntry->mDataSize, mEntry->mFromHost); + + if (temp) + { + full << (isOutgoing() ? "out " : "in "); + full << llformat("%s\n\n", temp->mName); + if (show_header) + { + full << "[Header]\n"; + full << llformat("SequenceID = %u\n", mSequenceID); + full << llformat("LL_ZERO_CODE_FLAG = %s\n", (mFlags & LL_ZERO_CODE_FLAG) ? "True" : "False"); + full << llformat("LL_RELIABLE_FLAG = %s\n", (mFlags & LL_RELIABLE_FLAG) ? "True" : "False"); + full << llformat("LL_RESENT_FLAG = %s\n", (mFlags & LL_RESENT_FLAG) ? "True" : "False"); + full << llformat("LL_ACK_FLAG = %s\n\n", (mFlags & LL_ACK_FLAG) ? "True" : "False"); + } + + for (auto *block : temp->mMemberBlocks) + { + const char* block_name = block->mName; + S32 num_blocks = mEasyMessageReader->getNumberOfBlocks(block_name); + for (S32 block_num = 0; block_num < num_blocks; block_num++) + { + full << llformat("[%s]\n", block->mName); + for (auto *variable : block->mMemberVariables) + { + const char* var_name = variable->getName(); + BOOL returned_hex; + std::string value = mEasyMessageReader->var2Str(block_name, block_num, variable, returned_hex); + if (returned_hex) + full << llformat(" %s =| ", var_name); + else + full << llformat(" %s = ", var_name); + + full << value << "\n"; + } + } + } // blocks_iter + } + else + { + full << (isOutgoing() ? "out" : "in") << "\n"; + for (S32 i = 0; i < mEntry->mDataSize; i++) + full << llformat("%02X ", mEntry->mData[i]); + } + break; + } + case LLMessageLogEntry::HTTP_REQUEST: + case LLMessageLogEntry::HTTP_RESPONSE: + { + if (mEntry->mType == LLMessageLogEntry::HTTP_REQUEST) + full << httpMethodAsVerb(mEntry->mMethod) << " " << mEntry->mURL << "\n"; + if (mEntry->mType == LLMessageLogEntry::HTTP_RESPONSE) + full << llformat("%u\n", mEntry->mStatusCode); + if (!mEntry->mContentType.empty()) + { + full << mEntry->mContentType << "\n"; + } + if (mEntry->mHeaders) + { + LLCore::HttpHeaders::const_iterator iter = mEntry->mHeaders->begin(); + LLCore::HttpHeaders::const_iterator end = mEntry->mHeaders->end(); + + for (; iter != end; ++iter) + { + const auto header = (*iter); + full << header.first << ": " << header.second << "\n"; + } + } + full << "\n"; + + if (mEntry->mDataSize) + { + bool can_beautify = false; + if (beautify) + { + if (!mEntry->mContentType.empty()) + { + std::string parsed_content_type = mEntry->mContentType.substr(0, mEntry->mContentType.find_first_of(';')); + boost::algorithm::trim(parsed_content_type); // trim excess data + boost::algorithm::trim(parsed_content_type); // trim excess data + boost::algorithm::to_lower(parsed_content_type); // convert to lowercase + if (parsed_content_type == "application/llsd+xml" || parsed_content_type == "application/xml") + { + // Use libxml2 instead of expat for safety. + const int parse_opts = XML_PARSE_NONET | XML_PARSE_NOCDATA | XML_PARSE_NOXINCNODE | XML_PARSE_NOBLANKS; + xmlDocPtr doc = xmlReadMemory(reinterpret_cast<char *>(mEntry->mData), mEntry->mDataSize, "noname.xml", nullptr, parse_opts); + if (doc) + { + xmlChar *xmlbuffer = nullptr; + int buffersize = 0; + xmlDocDumpFormatMemory(doc, &xmlbuffer, &buffersize, 1); + full << std::string(reinterpret_cast<char*>(xmlbuffer), buffersize); + + xmlFree(xmlbuffer); + xmlFreeDoc(doc); + can_beautify = true; + } + else + { + LL_DEBUGS("EasyMessageReader") << "libxml2 failed to parse xml" << LL_ENDL; + } + } + else if (parsed_content_type == "text/html") + { + const int parse_opts = HTML_PARSE_NONET | HTML_PARSE_NOERROR | HTML_PARSE_NOIMPLIED | HTML_PARSE_NOBLANKS; + htmlDocPtr doc = htmlReadMemory(reinterpret_cast<char *>(mEntry->mData), mEntry->mDataSize, "noname.html", nullptr, parse_opts); + if (doc) + { + xmlChar * htmlbuffer = nullptr; + int buffersize = 0; + htmlDocDumpMemoryFormat(doc, &htmlbuffer, &buffersize, 1); + full << std::string(reinterpret_cast<char*>(htmlbuffer), buffersize); + + xmlFree(htmlbuffer); + xmlFreeDoc(doc); + can_beautify = true; + } + else + { + LL_DEBUGS("EasyMessageReader") << "libxml2 failed to parse html" << LL_ENDL; + } + } + } + } + if (!can_beautify) + full << mEntry->mData; + } + break; + } + } + return full.str(); +} + +std::string LLEasyMessageLogEntry::getResponseFull(BOOL beautify, BOOL show_header) const +{ + return mResponseMsg.get() ? mResponseMsg->getFull(beautify, show_header) : LLStringUtil::null; +} diff --git a/indra/newview/lleasymessagelogentry.h b/indra/newview/lleasymessagelogentry.h new file mode 100644 index 0000000000000000000000000000000000000000..976c891f6a824298b1959ce48fca063b45f12c78 --- /dev/null +++ b/indra/newview/lleasymessagelogentry.h @@ -0,0 +1,57 @@ +/** +* @file lleasymessagelogentry.h +* +* $LicenseInfo:firstyear=2018&license=viewerlgpl$ +* +* 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. +* $/LicenseInfo$ +*/ + +#ifndef LL_EASYMESSAGELOGENTRY_H +#define LL_EASYMESSAGELOGENTRY_H + +#include "llmessagelog.h" + +class LLEasyMessageReader; + +class LLEasyMessageLogEntry +{ +public: + LLEasyMessageLogEntry(LogPayload entry, LLEasyMessageReader* message_reader = nullptr); + virtual ~LLEasyMessageLogEntry(); + + LogPayload operator()() const { return mEntry; }; + + std::string getFull(BOOL beautify = FALSE, BOOL show_header = FALSE) const; + std::string getName(); + std::string getResponseFull(BOOL beautify = FALSE, BOOL show_header = FALSE) const; + BOOL isOutgoing() const; + + void setResponseMessage(LogPayload entry); + + LLUUID mID; + U32 mSequenceID; + //depending on how the server is configured, two cap handlers + //may have the exact same URI, meaning there may be multiple possible + //cap names for each message. Ditto for possible region hosts. + std::set<std::string> mNames; + std::set<LLHost> mRegionHosts; + std::string mSummary; + U32 mFlags; + +private: + LogPayload mEntry; + + boost::scoped_ptr<LLEasyMessageLogEntry> mResponseMsg; + LLEasyMessageReader* mEasyMessageReader; +}; + +#endif // LL_EASYMESSAGELOGENTRY_H diff --git a/indra/newview/lleasymessagereader.cpp b/indra/newview/lleasymessagereader.cpp index c39b44998bbd2ea7e17f849d9d94827a553b0585..d0d914169a841b708b24b53f85f2965a7cbc276e 100644 --- a/indra/newview/lleasymessagereader.cpp +++ b/indra/newview/lleasymessagereader.cpp @@ -19,273 +19,8 @@ #include "llviewerprecompiledheaders.h" #include "lleasymessagereader.h" -#include "llviewerregion.h" -#include "llworld.h" #include "llsdserialize.h" -#undef XMLCALL //HACK: need to find the expat.h include -#include <libxml/parser.h> -#include <libxml/tree.h> -#include <libxml/HTMLparser.h> -#include <libxml/HTMLtree.h> -#include <boost/algorithm/string.hpp> -#include <boost/algorithm/string/predicate.hpp> -#include <boost/format.hpp> - -//I doubt any of this is thread safe! -LLEasyMessageLogEntry::LLEasyMessageLogEntry(LogPayload entry, LLEasyMessageReader* message_reader) -: mEntry(entry) -, mResponseMsg(nullptr) -, mEasyMessageReader(message_reader) -{ - mID.generate(); - mSequenceID = 0; - - if(mEntry->mType == LLMessageLogEntry::TEMPLATE) - { - mFlags = mEntry->mData[0]; - - LLMessageTemplate* temp = nullptr; - - if (mEasyMessageReader) - temp = mEasyMessageReader->decodeTemplateMessage( - &(mEntry->mData[0]), mEntry->mDataSize, mEntry->mFromHost, mSequenceID); - - if (temp) - mNames.insert(temp->mName); - else - mNames.insert("Invalid"); - - mRegionHosts.insert(isOutgoing() ? mEntry->mToHost : mEntry->mFromHost); - } - else if(mEntry->mType == LLMessageLogEntry::HTTP_REQUEST)// not template - { - std::string base_url = get_base_cap_url(mEntry->mURL); - - if(LLWorld::getInstance()->isCapURLMapped(base_url)) - { - CapUrlMatches matches = LLWorld::getInstance()->getCapURLMatches(base_url); - mNames = matches.mCapNames; - for(std::set<LLViewerRegion*>::iterator iter = matches.mRegions.begin(); iter != matches.mRegions.end(); ++iter) - { - mRegionHosts.insert((*iter)->getHost()); - } - } - else - mNames.insert(mEntry->mURL); - } - else // not template - { - mNames.insert("SOMETHING ELSE"); - } -} - -LLEasyMessageLogEntry::~LLEasyMessageLogEntry() -{ - if(mResponseMsg) - delete mResponseMsg; -} -BOOL LLEasyMessageLogEntry::isOutgoing() -{ -#define LOCALHOST_ADDR 16777343 - return mEntry->mFromHost == LLHost(LOCALHOST_ADDR, gMessageSystem->getListenPort()); -#undef LOCALHOST_ADDR -} -std::string LLEasyMessageLogEntry::getName() -{ - std::string message_names; - std::set<std::string>::iterator iter = mNames.begin(); - std::set<std::string>::const_iterator begin = mNames.begin(); - std::set<std::string>::const_iterator end = mNames.end(); - - while(iter != end) - { - if(iter != begin) - message_names += ", "; - - message_names += (*iter); - ++iter; - } - - return message_names; -} - -void LLEasyMessageLogEntry::setResponseMessage(LogPayload entry) -{ - // we already had a response set, somehow. just get rid of it - if(mResponseMsg) - delete mResponseMsg; - - mResponseMsg = new LLEasyMessageLogEntry(entry); -} -std::string LLEasyMessageLogEntry::getFull(BOOL beautify, BOOL show_header) -{ - std::ostringstream full; - switch (mEntry->mType) - { - case LLMessageLogEntry::TEMPLATE: - { - LLMessageTemplate* temp = nullptr; - - if(mEasyMessageReader) - temp = mEasyMessageReader->decodeTemplateMessage(&(mEntry->mData[0]), mEntry->mDataSize, mEntry->mFromHost); - - if(temp) - { - full << (isOutgoing() ? "out " : "in "); - full << (boost::format("%s\n\n") % temp->mName); - if(show_header) - { - full << "[Header]\n"; - full << llformat("SequenceID = %u\n", mSequenceID); - full << llformat("LL_ZERO_CODE_FLAG = %s\n", (mFlags & LL_ZERO_CODE_FLAG) ? "True" : "False"); - full << llformat("LL_RELIABLE_FLAG = %s\n", (mFlags & LL_RELIABLE_FLAG) ? "True" : "False"); - full << llformat("LL_RESENT_FLAG = %s\n", (mFlags & LL_RESENT_FLAG) ? "True" : "False"); - full << llformat("LL_ACK_FLAG = %s\n\n", (mFlags & LL_ACK_FLAG) ? "True" : "False"); - } - LLMessageTemplate::message_block_map_t::iterator blocks_end = temp->mMemberBlocks.end(); - for (LLMessageTemplate::message_block_map_t::iterator blocks_iter = temp->mMemberBlocks.begin(); - blocks_iter != blocks_end; ++blocks_iter) - { - LLMessageBlock* block = (*blocks_iter); - const char* block_name = block->mName; - S32 num_blocks = mEasyMessageReader->getNumberOfBlocks(block_name); - for(S32 block_num = 0; block_num < num_blocks; block_num++) - { - full << llformat("[%s]\n", block->mName); - LLMessageBlock::message_variable_map_t::iterator var_end = block->mMemberVariables.end(); - for (LLMessageBlock::message_variable_map_t::iterator var_iter = block->mMemberVariables.begin(); - var_iter != var_end; ++var_iter) - { - LLMessageVariable* variable = (*var_iter); - const char* var_name = variable->getName(); - BOOL returned_hex; - std::string value = mEasyMessageReader->var2Str(block_name, block_num, variable, returned_hex); - if(returned_hex) - full << llformat(" %s =| ", var_name); - else - full << llformat(" %s = ", var_name); - - full << value << "\n"; - } - } - } // blocks_iter - } - else - { - full << (isOutgoing() ? "out" : "in") << "\n"; - for(S32 i = 0; i < mEntry->mDataSize; i++) - full << llformat("%02X ", mEntry->mData[i]); - } - break; - } - case LLMessageLogEntry::HTTP_REQUEST: - case LLMessageLogEntry::HTTP_RESPONSE: - { - if(mEntry->mType == LLMessageLogEntry::HTTP_REQUEST) - full << llformat("%s %s\n", httpMethodAsVerb(mEntry->mMethod).c_str(), mEntry->mURL.c_str()); - if(mEntry->mType == LLMessageLogEntry::HTTP_RESPONSE) - full << llformat("%d\n", mEntry->mStatusCode); - - if (mEntry->mHeaders.isMap()) - { - LLSD::map_const_iterator iter = mEntry->mHeaders.beginMap(); - LLSD::map_const_iterator end = mEntry->mHeaders.endMap(); - - for (; iter != end; ++iter) - { - full << iter->first << ": " << iter->second.asString() << "\n"; - } - } - full << "\n"; - - if(mEntry->mDataSize) - { - bool can_beautify = false; - if(beautify) - { - std::string content_type; - for(LLSD::map_iterator iter = mEntry->mHeaders.beginMap(); iter != mEntry->mHeaders.endMap(); ++iter) - { - if(boost::iequals(iter->first, "content-type")) - { - content_type = iter->second.asString(); - break; - } - } - - if(!content_type.empty()) - { - std::string parsed_content_type = content_type.substr(0, content_type.find_first_of(';')); - boost::algorithm::trim(parsed_content_type); // trim excess data - boost::algorithm::to_lower(parsed_content_type); // convert to lowercase - if(parsed_content_type == "application/llsd+xml" || parsed_content_type == "application/xml") - { - // Use libxml2 instead of expat for safety. - const int parse_opts = XML_PARSE_NONET | XML_PARSE_NOCDATA | XML_PARSE_NOXINCNODE | XML_PARSE_NOBLANKS; - xmlDocPtr doc = xmlReadMemory((char *)(mEntry->mData), mEntry->mDataSize, "noname.xml", nullptr, parse_opts); - if(doc) - { - xmlChar *xmlbuffer = nullptr; - int buffersize = 0; - xmlDocDumpFormatMemory(doc, &xmlbuffer, &buffersize, 1); - full << std::string((const char*)xmlbuffer, buffersize); - - xmlFree(xmlbuffer); - xmlFreeDoc(doc); - can_beautify = true; - } - else - { - LL_DEBUGS("EasyMessageReader") << "libxml2 failed to parse xml" << LL_ENDL; - } - } - else if (parsed_content_type == "text/html") - { - const int parse_opts = HTML_PARSE_NONET | HTML_PARSE_NOERROR | HTML_PARSE_NOIMPLIED | HTML_PARSE_NOBLANKS; - htmlDocPtr doc = htmlReadMemory((char *)(mEntry->mData), mEntry->mDataSize, "noname.html", nullptr, parse_opts); - if (doc) - { - xmlChar * htmlbuffer = nullptr; - int buffersize = 0; - htmlDocDumpMemoryFormat(doc, &htmlbuffer, &buffersize, 1); - full << std::string((const char*)htmlbuffer, buffersize); - - xmlFree(htmlbuffer); - xmlFreeDoc(doc); - can_beautify = true; - } - else - { - LL_DEBUGS("EasyMessageReader") << "libxml2 failed to parse html" << LL_ENDL; - } - } - } - } - if(!can_beautify) - full << mEntry->mData; - } - break; - } - // This shouldn't be able to happen. - case LLMessageLogEntry::NONE: - case LLMessageLogEntry::LOG_TYPE_NUM: - { - full << "FIXME"; - break; - } - } - return full.str(); -} - -std::string LLEasyMessageLogEntry::getResponseFull(BOOL beautify, BOOL show_header) -{ - if(!mResponseMsg) - return ""; - - return mResponseMsg->getFull(beautify, show_header); -} - LLEasyMessageReader::LLEasyMessageReader() : mTemplateMessageReader(gMessageSystem->mMessageNumbers) { diff --git a/indra/newview/lleasymessagereader.h b/indra/newview/lleasymessagereader.h index 2ab3796bff8f517edb7a94689b7cc4abc113e2ee..39a70b6781dce8cb5f70c532c44e7922b2c59dec 100644 --- a/indra/newview/lleasymessagereader.h +++ b/indra/newview/lleasymessagereader.h @@ -19,7 +19,6 @@ #define EASY_MESSAGE_READER_H #include "llmessagelog.h" -#include "linden_common.h" #include "message.h" #include "lltemplatemessagereader.h" #include "llmessagetemplate.h" @@ -44,37 +43,4 @@ private: U8 mRecvBuffer[MAX_BUFFER_SIZE]; }; -class LLEasyMessageLogEntry -{ -public: - LLEasyMessageLogEntry(LogPayload entry, LLEasyMessageReader* message_reader = nullptr); - LLEasyMessageLogEntry(LLEasyMessageReader* message_reader = nullptr); - ~LLEasyMessageLogEntry(); - - LogPayload operator()() { return mEntry; }; - - std::string getFull(BOOL beautify = FALSE, BOOL show_header = FALSE); - std::string getName(); - std::string getResponseFull(BOOL beautify = FALSE, BOOL show_header = FALSE); - BOOL isOutgoing(); - - void setResponseMessage(LogPayload entry); - - LLUUID mID; - U32 mSequenceID; - //depending on how the server is configured, two cap handlers - //may have the exact same URI, meaning there may be multiple possible - //cap names for each message. Ditto for possible region hosts. - std::set<std::string> mNames; - std::set<LLHost> mRegionHosts; - std::string mSummary; - U32 mFlags; - -private: - LogPayload mEntry; - - LLEasyMessageLogEntry* mResponseMsg; - LLEasyMessageReader* mEasyMessageReader; -}; - #endif diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 222bccb6b818b0b75612f2a6b2e47c07f552a31b..daaa8f952899305608e3231c56bb0451e0fb04b6 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -92,8 +92,8 @@ namespace Details LLEventPollImpl::LLEventPollImpl(const LLHost &sender) : mDone(false), mHttpRequest(), - mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mHttpOptions(), + mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mSenderIp(), mCounter(sNextCounter++) diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index c8b0180cf894448780ac94277d42c3b4402a980f..b0ee32e2b7fc520061018391e6e8087e414de03c 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -160,7 +160,7 @@ class LLFavoriteLandmarkButton : public LLButton { public: - BOOL handleToolTip(S32 x, S32 y, MASK mask) + BOOL handleToolTip(S32 x, S32 y, MASK mask) override { std::string region_name = mLandmarkInfoGetter.getName(); @@ -179,8 +179,8 @@ public: return TRUE; } - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) - { + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override + { LLFavoritesBarCtrl* fb = dynamic_cast<LLFavoritesBarCtrl*>(getParent()); if (fb) @@ -194,7 +194,7 @@ public: void setLandmarkID(const LLUUID& id){ mLandmarkInfoGetter.setLandmarkID(id); } const LLUUID& getLandmarkId() const { return mLandmarkInfoGetter.getLandmarkId(); } - void onMouseEnter(S32 x, S32 y, MASK mask) + void onMouseEnter(S32 x, S32 y, MASK mask) override { if (LLToolDragAndDrop::getInstance()->hasMouseCapture()) { @@ -224,7 +224,7 @@ private: class LLFavoriteLandmarkMenuItem : public LLMenuItemCallGL { public: - BOOL handleToolTip(S32 x, S32 y, MASK mask) + BOOL handleToolTip(S32 x, S32 y, MASK mask) override { std::string region_name = mLandmarkInfoGetter.getName(); if (!region_name.empty()) @@ -239,21 +239,21 @@ public: void setLandmarkID(const LLUUID& id){ mLandmarkInfoGetter.setLandmarkID(id); } - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override { if (mMouseDownSignal) (*mMouseDownSignal)(this, x, y, mask); return LLMenuItemCallGL::handleMouseDown(x, y, mask); } - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask) + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override { if (mMouseUpSignal) (*mMouseUpSignal)(this, x, y, mask); return LLMenuItemCallGL::handleMouseUp(x, y, mask); } - virtual BOOL handleHover(S32 x, S32 y, MASK mask) + BOOL handleHover(S32 x, S32 y, MASK mask) override { if (fb) { @@ -285,11 +285,11 @@ private: class LLFavoriteLandmarkToggleableMenu : public LLToggleableMenu { public: - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg) + std::string& tooltip_msg) override { *accept = ACCEPT_NO; return TRUE; @@ -314,7 +314,7 @@ class LLItemCopiedCallback : public LLInventoryCallback public: LLItemCopiedCallback(S32 sortField): mSortField(sortField) {} - virtual void fire(const LLUUID& inv_item) + void fire(const LLUUID& inv_item) override { LLViewerInventoryItem* item = gInventory.getItem(inv_item); @@ -374,16 +374,16 @@ LLFavoritesBarCtrl::Params::Params() LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) : LLUICtrl(p), - mFont(p.font.isProvided() ? p.font() : LLFontGL::getFontSansSerifSmall()), mOverflowMenuHandle(), mContextMenuHandle(), + mFont(p.font.isProvided() ? p.font() : LLFontGL::getFontSansSerifSmall()), + mUpdateDropDownItems(true), + mRestoreOverflowMenu(false), mImageDragIndication(p.image_drag_indication), mShowDragMarker(FALSE), - mLandingTab(NULL), - mLastTab(NULL), - mTabsHighlightEnabled(TRUE) - , mUpdateDropDownItems(true) -, mRestoreOverflowMenu(false) + mLandingTab(NULL) + , mLastTab(NULL) +, mTabsHighlightEnabled(TRUE) { // Register callback for menus with current registrar (will be parent panel's registrar) LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Favorites.DoToSelected", @@ -1568,16 +1568,18 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs() gInventory.collectDescendents(fav_id, cats, items, LLInventoryModel::EXCLUDE_TRASH); LLSD user_llsd; - for (LLInventoryModel::item_array_t::iterator it = items.begin(); it != items.end(); it++) + for (LLInventoryModel::item_array_t::const_iterator it = items.cbegin(); it != items.cend(); ++it) { LLSD value; value["name"] = (*it)->getName(); value["asset_id"] = (*it)->getAssetUUID(); - slurls_map_t::iterator slurl_iter = mSLURLs.find(value["asset_id"]); - if (slurl_iter != mSLURLs.end()) + slurls_map_t::const_iterator slurl_iter = mSLURLs.find(value["asset_id"]); + if (slurl_iter != mSLURLs.cend()) { - LL_DEBUGS("FavoritesBar") << "Saving favorite: idx=" << LLFavoritesOrderStorage::instance().getSortIndex((*it)->getUUID()) << ", SLURL=" << slurl_iter->second << ", value=" << value << LL_ENDL; + LL_DEBUGS("FavoritesBar") << "Saving favorite: idx=" << LLFavoritesOrderStorage::instance().getSortIndex((*it)->getUUID()) + << ", SLURL=" << slurl_iter->second + << ", value=" << value << LL_ENDL; value["slurl"] = slurl_iter->second; user_llsd[LLFavoritesOrderStorage::instance().getSortIndex((*it)->getUUID())] = value; } @@ -1665,7 +1667,7 @@ void LLFavoritesOrderStorage::onLandmarkLoaded(const LLUUID& asset_id, LLLandmar { LL_DEBUGS("FavoritesBar") << "requesting slurl for landmark " << asset_id << LL_ENDL; LLLandmarkActions::getSLURLfromPosGlobal(pos_global, - boost::bind(&LLFavoritesOrderStorage::storeFavoriteSLURL, this, asset_id, _1)); + boost::bind(&LLFavoritesOrderStorage::storeFavoriteSLURL, this, asset_id, _1)); } } } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 363b3429b0e3fb3c3df357992d49dd4780ff5e16..5abccdafbc41d226b12bf62ea1e416a56612a733 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -102,7 +102,7 @@ S32 LLFloaterLand::sLastTab = 0; class LLParcelSelectionObserver : public LLParcelObserver { public: - virtual void changed() { LLFloaterLand::refreshAll(); } + void changed() override { LLFloaterLand::refreshAll(); } }; // class needed to get full access to textbox inside checkbox, because LLCheckBoxCtrl::setLabel() has string as its argument. @@ -122,8 +122,8 @@ class LLPanelLandExperiences { public: LLPanelLandExperiences(LLSafeHandle<LLParcelSelection>& parcelp); - virtual BOOL postBuild(); - void refresh(); + BOOL postBuild() override; + void refresh() override; void experienceAdded(const LLUUID& id, U32 xp_type, U32 access_type); void experienceRemoved(const LLUUID& id, U32 access_type); @@ -1127,7 +1127,6 @@ void LLPanelLandGeneral::onClickStopSellLand() LLPanelLandObjects::LLPanelLandObjects(LLParcelSelectionHandle& parcel) : LLPanel(), - mParcel(parcel), mParcelObjectBonus(NULL), mSWTotalObjects(NULL), mObjectContribution(NULL), @@ -1149,7 +1148,8 @@ LLPanelLandObjects::LLPanelLandObjects(LLParcelSelectionHandle& parcel) mOwnerList(NULL), mFirstReply(TRUE), mSelectedCount(0), - mSelectedIsGroup(FALSE) + mSelectedIsGroup(FALSE), + mParcel(parcel) { } diff --git a/indra/newview/llfloaterlinkreplace.cpp b/indra/newview/llfloaterlinkreplace.cpp index 43de761712651c6ee2d55409ee014323315c2477..2cfa3eb784f1dacea793dbf71b44e00541357611 100644 --- a/indra/newview/llfloaterlinkreplace.cpp +++ b/indra/newview/llfloaterlinkreplace.cpp @@ -40,9 +40,9 @@ LLFloaterLinkReplace::LLFloaterLinkReplace(const LLSD& key) : LLFloater(key), LLEventTimer(gSavedSettings.getF32("LinkReplaceBatchPauseTime")), - mRemainingItems(0), mSourceUUID(LLUUID::null), mTargetUUID(LLUUID::null), + mRemainingItems(0), mBatchSize(gSavedSettings.getU32("LinkReplaceBatchSize")) { mEventTimer.stop(); diff --git a/indra/newview/llfloaterlinkreplace.h b/indra/newview/llfloaterlinkreplace.h index dd5c3012061fd89313b8b42afdf23182ff1b692e..e267541a5b9907e9be73bd3839e7619ff5dca3b8 100644 --- a/indra/newview/llfloaterlinkreplace.h +++ b/indra/newview/llfloaterlinkreplace.h @@ -56,17 +56,17 @@ public: return mDADSignal.connect(cb); } - virtual BOOL postBuild() + BOOL postBuild() override { setEnabled(FALSE); return LLLineEditor::postBuild(); } - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; LLUUID getItemID() const { return mItemID; } void setItem(LLInventoryItem* item); @@ -86,10 +86,10 @@ public: LLFloaterLinkReplace(const LLSD& key); virtual ~LLFloaterLinkReplace(); - BOOL postBuild(); - virtual void onOpen(const LLSD& key); + BOOL postBuild() override; + void onOpen(const LLSD& key) override; - virtual BOOL tick(); + BOOL tick() override; private: void checkEnableStart(); diff --git a/indra/newview/llfloatermessagelog.cpp b/indra/newview/llfloatermessagelog.cpp index c3205b3d64128070fc263b7a3de2932879102a49..368d87dde704c0142c9262d514a184f23d3fdf28 100644 --- a/indra/newview/llfloatermessagelog.cpp +++ b/indra/newview/llfloatermessagelog.cpp @@ -28,6 +28,7 @@ #include "lleasymessagereader.h" #include "llfloatermessagebuilder.h" #include "llfloaterreg.h" +#include "lleasymessagelogentry.h" #include "llmessagetemplate.h" #include "llnotificationsutil.h" #include "llviewermenu.h" @@ -102,9 +103,10 @@ LLFloaterMessageLog::LLFloaterMessageLog(const LLSD& key) , mMessagelogScrollListCtrl(nullptr) , mMessageLogFilter(DEFAULT_FILTER) , mInfoPaneMode(IPANE_NET) -, mBeautifyMessages(false) +, mBeautifyMessages(true) , mMessagesLogged(0) , mEasyMessageReader(new LLEasyMessageReader()) +, mStatusText(nullptr) { mCommitCallbackRegistrar.add("MessageLog.Filter.Action", boost::bind(&LLFloaterMessageLog::onClickFilterMenu, this, _2)); if(!sNetListMutex) @@ -140,6 +142,7 @@ LLFloaterMessageLog::~LLFloaterMessageLog() BOOL LLFloaterMessageLog::postBuild() { + mStatusText = getChild<LLTextBase>("log_status_text"); mMessagelogScrollListCtrl = getChild<LLScrollListCtrl>("message_log"); mMessagelogScrollListCtrl->setSortCallback(boost::bind(&LLFloaterMessageLog::sortMessageList, this, _1 ,_2, _3)); @@ -175,6 +178,26 @@ void LLFloaterMessageLog::onClose(bool app_quiting) if (!app_quiting) onClickClearLog(); } +void LLFloaterMessageLog::draw() +{ + if (mStatusText) + { + LLStringUtil::format_map_t map; + map["TOTAL"] = std::to_string(mMessagesLogged); + + if (mMessageLogFilter.empty()) + { + mStatusText->setText(getString("no_filter_status", map)); + } + else + { + map["MESSAGES"] = std::to_string(mFloaterMessageLogItems.size()); + mStatusText->setText(getString("filter_status", map)); + } + } + LLFloater::draw(); +} + void LLFloaterMessageLog::clearFloaterMessageItems(bool dying) { if(!dying) @@ -325,20 +348,20 @@ void LLFloaterMessageLog::refreshNetList() LLScrollListItem* scroll_itemp = scrollp->addElement(element); if(has_live_circuit) { - LLScrollListIcon* icon = (LLScrollListIcon*)scroll_itemp->getColumn(1); + LLScrollListIcon* icon = static_cast<LLScrollListIcon*>(scroll_itemp->getColumn(1)); icon->setValue("Stop_Off"); icon->setColor(LLColor4(1.0f,0.0f,0.0f,0.7f)); icon->setClickCallback(onClickCloseCircuit, itemp); } else { - LLScrollListIcon* icon = (LLScrollListIcon*)scroll_itemp->getColumn(1); + LLScrollListIcon* icon = static_cast<LLScrollListIcon*>(scroll_itemp->getColumn(1)); icon->setValue("Stop_Off"); icon->setColor(LLColor4(1.0f,1.0f,1.0f,0.5f)); icon->setClickCallback(nullptr, nullptr); } // Event queue isn't even supported yet... FIXME - LLScrollListIcon* icon = (LLScrollListIcon*)scroll_itemp->getColumn(2); + LLScrollListIcon* icon = static_cast<LLScrollListIcon*>(scroll_itemp->getColumn(2)); icon->setValue("Stop_Off"); icon->setColor(LLColor4(0.1f,0.1f,0.1f,0.7f)); icon->setClickCallback(nullptr, nullptr); @@ -361,7 +384,9 @@ void LLFloaterMessageLog::refreshNetInfo(BOOL force) const LLNetListItem* itemp = findNetListItem(selected_itemp->getUUID()); if(itemp) { - std::string info(llformat("%s, %d\n--------------------------------\n\n", itemp->mName.c_str(), itemp->mHandle)); + std::string info; + info.reserve(512); + (llformat("%s, %d\n--------------------------------\n\n", itemp->mName.c_str(), itemp->mHandle)); if(itemp->mCircuitData) { LLCircuitData* cdp = itemp->mCircuitData; @@ -384,8 +409,7 @@ void LLFloaterMessageLog::refreshNetInfo(BOOL force) info.append(llformat(" * Bytes in: %d\n", cdp->getBytesIn().value())); info.append(llformat(" * Endpoint ID: %s\n", cdp->getLocalEndPointID().asString().c_str())); info.append(llformat(" * Remote ID: %s\n", cdp->getRemoteID().asString().c_str())); - info.append(llformat(" * Remote session ID: %s\n", cdp->getRemoteSessionID().asString().c_str())); - info.append("\n"); + info.append(llformat(" * Remote session ID: %s\n\n", cdp->getRemoteSessionID().asString().c_str())); } getChild<LLTextBase>("net_info")->setText(info); @@ -427,8 +451,7 @@ void LLFloaterMessageLog::onLog(LogPayload& entry) sMessageListMutex->unlock(); floaterp->conditionalLog(entry); } - //this is a response, try to add it to the relevant request - else + else //this is a response, try to add it to the relevant request { floaterp->pairHTTPResponse(entry); } @@ -436,17 +459,11 @@ void LLFloaterMessageLog::onLog(LogPayload& entry) void LLFloaterMessageLog::conditionalLog(LogPayload entry) { - if(!mMessageLogFilter.empty()) - getChild<LLTextBase>("log_status_text")->setText(llformat("Showing %d messages of %d", - mFloaterMessageLogItems.size(), mMessagesLogged)); - else - getChild<LLTextBase>("log_status_text")->setText(llformat("Showing %d messages", mMessagesLogged)); - FloaterMessageItem item = std::make_shared<FloaterMessageItem::element_type>(entry, mEasyMessageReader); bool have_positive = false; - for(const std::string& msg_name : item->mNames) + for (const std::string& msg_name : item->mNames) { std::string find_name = msg_name; LLStringUtil::toLower(find_name); @@ -480,7 +497,7 @@ void LLFloaterMessageLog::conditionalLog(LogPayload entry) if((*item)()->mType == LLMessageLogEntry::HTTP_REQUEST) { LLMutexLock lock(sIncompleteHTTPConvoMutex); - mIncompleteHTTPConvos.insert(HTTPConvoMap::value_type((*item)()->mRequestID, item)); + mIncompleteHTTPConvos.insert(HTTPConvoMap::value_type((*item)()->mRequestId, item)); } std::string net_name; @@ -491,11 +508,11 @@ void LLFloaterMessageLog::conditionalLog(LogPayload entry) for (const auto& host : item->mRegionHosts) { std::string region_name = LLStringUtil::null; - for (LLNetListItem* item : sNetListItems) + for (LLNetListItem* list_item : sNetListItems) { - if (host == item->mCircuitData->getHost()) + if (host == list_item->mCircuitData->getHost()) { - region_name += item->mName; + region_name += list_item->mName; break; } } @@ -564,7 +581,7 @@ void LLFloaterMessageLog::conditionalLog(LogPayload entry) void LLFloaterMessageLog::pairHTTPResponse(LogPayload entry) { LLMutexLock lock(sIncompleteHTTPConvoMutex); - HTTPConvoMap::iterator iter = mIncompleteHTTPConvos.find(entry->mRequestID); + HTTPConvoMap::iterator iter = mIncompleteHTTPConvos.find(entry->mRequestId); if(iter != mIncompleteHTTPConvos.end()) { @@ -712,24 +729,11 @@ void LLFloaterMessageLog::startApplyingFilter(const std::string& filter, BOOL fo void LLFloaterMessageLog::stopApplyingFilter(bool quitting) { - if(!mMessageLogFilter.empty()) - { - if(!quitting) - { - getChild<LLTextBase>("log_status_text")->setText(llformat("Showing %d messages from %d", mFloaterMessageLogItems.size(), mMessagesLogged)); - } - } } void LLFloaterMessageLog::updateFilterStatus() { if (!mMessageLogFilter.empty()) return; - - //const S32 progress = mMessageLogFilterApply->getProgress(); - //const size_t packets = sMessageLogEntries.size(); - //const size_t matches = mFloaterMessageLogItems.size(); - //const std::string& text = llformat("Filtering ( %d / %d ), %d matches ...", progress, packets, matches); - //getChild<LLTextBase>("log_status_text")->setText(text); } void LLFloaterMessageLog::onCommitFilter() diff --git a/indra/newview/llfloatermessagelog.h b/indra/newview/llfloatermessagelog.h index 32ee034a1252de9caf73f855103789c98fafdc2e..6b9381c1f6a76223228157fbae6bbb98e112e183 100644 --- a/indra/newview/llfloatermessagelog.h +++ b/indra/newview/llfloatermessagelog.h @@ -28,6 +28,7 @@ struct LLNetListItem; class LLScrollListCtrl; +class LLTextBase; class LLEasyMessageLogEntry; class LLEasyMessageReader; class LLEasyMessageLogEntry; @@ -41,13 +42,14 @@ typedef boost::container::flat_map<U64, FloaterMessageItem> HTTPConvoMap; class LLMessageLogFilter { public: - LLMessageLogFilter() {} + LLMessageLogFilter() {} + LLMessageLogFilter(const std::string& filter); ~LLMessageLogFilter() {} - LLMessageLogFilter(const std::string& filter); + void set(const std::string& filter); - bool empty() { return mPositiveNames.empty() && mNegativeNames.empty(); } + bool empty() const { return mPositiveNames.empty() && mNegativeNames.empty(); } - std::string asString() {return mAsString;} + std::string asString() const {return mAsString;} //these should probably be unordered_sets boost::container::flat_set<std::string> mPositiveNames; @@ -62,10 +64,12 @@ class LLFloaterMessageLog : public LLFloater public: LLFloaterMessageLog(const LLSD& key); ~LLFloaterMessageLog(); - static void onLog(LogPayload& entry); + static void onLog(LogPayload& entry); + void onOpen(const LLSD& key) override; void onClose(bool app_quitting) override; + void draw() override; protected: BOOL postBuild() override; @@ -91,7 +95,7 @@ protected: void showSelectedMessage(); void showMessage(FloaterMessageItem item); - bool getBeautifyMessages() { return mBeautifyMessages; } + bool getBeautifyMessages() const { return mBeautifyMessages; } void onCommitNetList(LLUICtrl* ctrl); void onCommitMessageLog(LLUICtrl* ctrl); @@ -108,6 +112,9 @@ protected: LLScrollListCtrl* mMessagelogScrollListCtrl; +private: + LLTextBase* mStatusText; + public: void startApplyingFilter(const std::string& filter, BOOL force); @@ -138,7 +145,7 @@ protected: LLEasyMessageReader* mEasyMessageReader; - S32 sortMessageList(S32,const LLScrollListItem*,const LLScrollListItem*); + S32 sortMessageList(S32,const LLScrollListItem*, const LLScrollListItem*); void clearMessageLogEntries(); void clearFloaterMessageItems(bool dying = false); diff --git a/indra/newview/llfloateroutfitphotopreview.cpp b/indra/newview/llfloateroutfitphotopreview.cpp index 952f26d95ea2c9e99591ee542720a0e64fb140d6..1b14a7b52517833cc027acfc6185744d4f2a1458 100644 --- a/indra/newview/llfloateroutfitphotopreview.cpp +++ b/indra/newview/llfloateroutfitphotopreview.cpp @@ -62,10 +62,10 @@ const S32 CLIENT_RECT_VPAD = 4; LLFloaterOutfitPhotoPreview::LLFloaterOutfitPhotoPreview(const LLSD& key) : LLPreview(key), - mUpdateDimensions(TRUE), - mImage(NULL), mOutfitID(LLUUID()), + mImage(NULL), mImageOldBoostLevel(LLGLTexture::BOOST_NONE), + mUpdateDimensions(TRUE), mExceedLimits(FALSE) { updateImageID(); diff --git a/indra/newview/llfloaterpreviewtrash.h b/indra/newview/llfloaterpreviewtrash.h index 465c0c677fc6db4089171e2ea55110265c295052..61634d904cf748d4e8568017676fd74de882c338 100644 --- a/indra/newview/llfloaterpreviewtrash.h +++ b/indra/newview/llfloaterpreviewtrash.h @@ -39,7 +39,7 @@ public: LLFloaterPreviewTrash(const LLSD& key); ~LLFloaterPreviewTrash(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; protected: void onClickEmpty(); diff --git a/indra/newview/llfloaterregiondebugconsole.cpp b/indra/newview/llfloaterregiondebugconsole.cpp index 9eaaaad397eafaec6f653ae16f39842032670019..3fe054cac0b73bacd8331c4afe8c0375201072ec 100644 --- a/indra/newview/llfloaterregiondebugconsole.cpp +++ b/indra/newview/llfloaterregiondebugconsole.cpp @@ -79,7 +79,7 @@ namespace void post( LLHTTPNode::ResponsePtr reponse, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { LL_INFOS() << "Received response from the debug console: " << input << LL_ENDL; diff --git a/indra/newview/llfloatertexturepicker.cpp b/indra/newview/llfloatertexturepicker.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b7478aca656eabf23751473fbcf07a4ce0c83465 --- /dev/null +++ b/indra/newview/llfloatertexturepicker.cpp @@ -0,0 +1,948 @@ +/** +* @file llfloatertexturepicker.cpp +* @author Richard Nelson, James Cook +* @brief LLTextureCtrl class implementation including related functions +* +* $LicenseInfo:firstyear=2002&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 "llagent.h" +#include "lldraghandle.h" +#include "llfiltereditor.h" +#include "llfloaterreg.h" +#include "llfloatertexturepicker.h" +#include "llinventoryfunctions.h" +#include "llinventorypanel.h" +#include "llscrolllistctrl.h" +#include "lltoolmgr.h" +#include "lltoolpipette.h" +#include "lltrans.h" +#include "llviewercontrol.h" + +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; + +static const S32 LOCAL_TRACKING_ID_COLUMN = 1; + +LLFloaterTexturePicker::LLFloaterTexturePicker( + LLView* owner, + LLUUID image_asset_id, + LLUUID default_image_asset_id, + LLUUID transparent_image_asset_id, + LLUUID blank_image_asset_id, + BOOL tentative, + BOOL allow_no_texture, + const std::string& label, + PermissionMask immediate_filter_perm_mask, + PermissionMask dnd_filter_perm_mask, + PermissionMask non_immediate_filter_perm_mask, + BOOL can_apply_immediately, + LLUIImagePtr fallback_image) + : LLFloater(LLSD()), + mOwner(owner), + mImageAssetID(image_asset_id), + mFallbackImage(fallback_image), + mDefaultImageAssetID(default_image_asset_id), + mTransparentImageAssetID(transparent_image_asset_id), + mBlankImageAssetID(blank_image_asset_id), + mTentative(tentative), + mAllowNoTexture(allow_no_texture), + mOriginalImageAssetID(image_asset_id), + mLabel(label), + mTentativeLabel(nullptr), + mResolutionLabel(nullptr), + mActive(TRUE), + mFilterEdit(nullptr), + mImmediateFilterPermMask(immediate_filter_perm_mask), + mDnDFilterPermMask(dnd_filter_perm_mask), + mNonImmediateFilterPermMask(non_immediate_filter_perm_mask), + mContextConeOpacity(0.f), + mSelectedItemPinned(FALSE), + mCanApply(true), + mCanPreview(true), + mPreviewSettingChanged(false), + mOnFloaterCloseCallback(nullptr), + mOnFloaterCommitCallback(nullptr), + mSetImageAssetIDCallback(nullptr), + mOnUpdateImageStatsCallback(nullptr) +{ + buildFromFile("floater_texture_ctrl.xml"); + mCanApplyImmediately = can_apply_immediately; + setCanMinimize(FALSE); +} + +LLFloaterTexturePicker::~LLFloaterTexturePicker() +{ +} + +void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selection /*=true*/) +{ + if (mImageAssetID != image_id && mActive) + { + mNoCopyTextureSelected = FALSE; + mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? + mImageAssetID = image_id; + LLUUID item_id = findItemID(mImageAssetID, FALSE); + if (item_id.isNull()) + { + mInventoryPanel->getRootFolder()->clearSelection(); + } + else + { + LLInventoryItem* itemp = gInventory.getItem(image_id); + if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) + { + // no copy texture + getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE); + mNoCopyTextureSelected = TRUE; + } + } + + if (set_selection) + { + mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); + } + } +} + +void LLFloaterTexturePicker::setActive(BOOL active) +{ + if (!active && getChild<LLUICtrl>("Pipette")->getValue().asBoolean()) + { + stopUsingPipette(); + } + mActive = active; +} + +void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b) +{ + mCanApplyImmediately = b; + if (!mCanApplyImmediately) + { + getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE); + } + updateFilterPermMask(); +} + +void LLFloaterTexturePicker::stopUsingPipette() +{ + if (LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()) + { + LLToolMgr::getInstance()->clearTransientTool(); + } +} + +void LLFloaterTexturePicker::updateImageStats() +{ + if (mTexturep.notNull()) + { + //RN: have we received header data for this image? + if (mTexturep->getFullWidth() > 0 && mTexturep->getFullHeight() > 0) + { + std::string formatted_dims = llformat("%d x %d", mTexturep->getFullWidth(), mTexturep->getFullHeight()); + mResolutionLabel->setTextArg("[DIMENSIONS]", formatted_dims); + if (mOnUpdateImageStatsCallback != nullptr) + { + mOnUpdateImageStatsCallback(mTexturep); + } + } + else + { + mResolutionLabel->setTextArg("[DIMENSIONS]", std::string("[? x ?]")); + } + } + else + { + mResolutionLabel->setTextArg("[DIMENSIONS]", std::string("")); + } +} + +// virtual +BOOL LLFloaterTexturePicker::handleDragAndDrop( + S32 x, S32 y, MASK mask, + BOOL drop, + EDragAndDropType cargo_type, void *cargo_data, + EAcceptance *accept, + std::string& tooltip_msg) +{ + BOOL handled = FALSE; + + bool is_mesh = cargo_type == DAD_MESH; + + if ((cargo_type == DAD_TEXTURE) || is_mesh) + { + LLInventoryItem *item = (LLInventoryItem *)cargo_data; + + BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); + BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); + BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, + gAgent.getID()); + + PermissionMask item_perm_mask = 0; + if (copy) item_perm_mask |= PERM_COPY; + if (mod) item_perm_mask |= PERM_MODIFY; + if (xfer) item_perm_mask |= PERM_TRANSFER; + + //PermissionMask filter_perm_mask = getFilterPermMask(); Commented out due to no-copy texture loss. + PermissionMask filter_perm_mask = mDnDFilterPermMask; + if ((item_perm_mask & filter_perm_mask) == filter_perm_mask) + { + if (drop) + { + setImageID(item->getAssetUUID()); + commitIfImmediateSet(); + } + + *accept = ACCEPT_YES_SINGLE; + } + else + { + *accept = ACCEPT_NO; + } + } + else + { + *accept = ACCEPT_NO; + } + + handled = TRUE; + LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFloaterTexturePicker " << getName() << LL_ENDL; + + return handled; +} + +BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask) +{ + LLFolderView* root_folder = mInventoryPanel->getRootFolder(); + + if (root_folder && mFilterEdit) + { + if (mFilterEdit->hasFocus() + && (key == KEY_RETURN || key == KEY_DOWN) + && mask == MASK_NONE) + { + if (!root_folder->getCurSelectedItem()) + { + LLFolderViewItem* itemp = mInventoryPanel->getItemByID(gInventory.getRootFolderID()); + if (itemp) + { + root_folder->setSelection(itemp, FALSE, FALSE); + } + } + root_folder->scrollToShowSelection(); + + // move focus to inventory proper + mInventoryPanel->setFocus(TRUE); + + // treat this as a user selection of the first filtered result + commitIfImmediateSet(); + + return TRUE; + } + + if (mInventoryPanel->hasFocus() && key == KEY_UP) + { + mFilterEdit->focusFirstItem(TRUE); + } + } + + return LLFloater::handleKeyHere(key, mask); +} + +void LLFloaterTexturePicker::onClose(bool app_quitting) +{ + if (mOwner && mOnFloaterCloseCallback != nullptr) + { + mOnFloaterCloseCallback(); + } + stopUsingPipette(); +} + +// virtual +BOOL LLFloaterTexturePicker::postBuild() +{ + LLFloater::postBuild(); + + if (!mLabel.empty()) + { + std::string pick = getString("pick title"); + + setTitle(pick + mLabel); + } + mTentativeLabel = getChild<LLTextBox>("Multiple"); + + mResolutionLabel = getChild<LLTextBox>("unknown"); + + + childSetAction("Default", LLFloaterTexturePicker::onBtnSetToDefault, this); + childSetAction("None", LLFloaterTexturePicker::onBtnNone, this); + childSetAction("Blank", LLFloaterTexturePicker::onBtnBlank, this); + childSetAction("Transparent", LLFloaterTexturePicker::onBtnTransparent, this); // <alchemy/> + + + childSetCommitCallback("show_folders_check", onShowFolders, this); + getChildView("show_folders_check")->setVisible(FALSE); + + mFilterEdit = getChild<LLFilterEditor>("inventory search editor"); + mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2)); + + mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); + + if (mInventoryPanel) + { + U32 filter_types = 0x0; + filter_types |= 0x1 << LLInventoryType::IT_TEXTURE; + filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT; + + mInventoryPanel->setFilterTypes(filter_types); + //mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss. + mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask); + mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); + mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + + // Disable auto selecting first filtered item because it takes away + // selection from the item set by LLTextureCtrl owning this floater. + mInventoryPanel->getRootFolder()->setAutoSelectOverride(TRUE); + + // Commented out to scroll to currently selected texture. See EXT-5403. + // // store this filter as the default one + // mInventoryPanel->getRootFolder()->getFilter().markDefault(); + + // Commented out to stop opening all folders with textures + // mInventoryPanel->openDefaultFolderForType(LLFolderType::FT_TEXTURE); + + // don't put keyboard focus on selected item, because the selection callback + // will assume that this was user input + if (!mImageAssetID.isNull()) + { + mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); + } + } + + mModeSelector = getChild<LLRadioGroup>("mode_selection"); + mModeSelector->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onModeSelect, this)); + mModeSelector->setSelectedIndex(0, 0); + + childSetAction("l_add_btn", LLFloaterTexturePicker::onBtnAdd, this); + childSetAction("l_rem_btn", LLFloaterTexturePicker::onBtnRemove, this); + childSetAction("l_upl_btn", LLFloaterTexturePicker::onBtnUpload, this); + + mLocalScrollCtrl = getChild<LLScrollListCtrl>("l_name_list"); + mLocalScrollCtrl->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onLocalScrollCommit, this)); + LLLocalBitmapMgr::feedScrollList(mLocalScrollCtrl); + + getChild<LLLineEditor>("uuid_editor")->setCommitCallback(boost::bind(&onApplyUUID, this)); + getChild<LLButton>("apply_uuid_btn")->setClickedCallback(boost::bind(&onApplyUUID, this)); + + mNoCopyTextureSelected = FALSE; + + getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("TextureLivePreview")); + childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this); + + if (!mCanApplyImmediately) + { + getChildView("show_folders_check")->setEnabled(FALSE); + } + + getChild<LLUICtrl>("Pipette")->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onBtnPipette, this)); + childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel, this); + childSetAction("Select", LLFloaterTexturePicker::onBtnSelect, this); + + // update permission filter once UI is fully initialized + updateFilterPermMask(); + mSavedFolderState.setApply(FALSE); + + LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1)); + + return TRUE; +} + +// virtual +void LLFloaterTexturePicker::draw() +{ + if (mOwner) + { + // draw cone of context pointing back to texture swatch + LLRect owner_rect; + mOwner->localRectToOtherView(mOwner->getLocalRect(), &owner_rect, this); + LLRect local_rect = getLocalRect(); + if (gFocusMgr.childHasKeyboardFocus(this) && mOwner->isInVisibleChain() && mContextConeOpacity > 0.001f) + { + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + LLGLEnable(GL_CULL_FACE); + gGL.begin(LLRender::TRIANGLE_STRIP); + { + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); + gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + gGL.vertex2i(local_rect.mRight, local_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); + gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); + gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); + gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); + gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); + } + gGL.end(); + } + } + + if (gFocusMgr.childHasMouseCapture(getDragHandle())) + { + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); + } + else + { + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); + } + + updateImageStats(); + + // if we're inactive, gray out "apply immediate" checkbox + getChildView("show_folders_check")->setEnabled(mActive && mCanApplyImmediately && !mNoCopyTextureSelected); + getChildView("Select")->setEnabled(mActive && mCanApply); + getChildView("Pipette")->setEnabled(mActive); + getChild<LLUICtrl>("Pipette")->setValue(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); + + //BOOL allow_copy = FALSE; + if (mOwner) + { + mTexturep = nullptr; + if (mImageAssetID.notNull()) + { + mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID); + mTexturep->setBoostLevel(LLGLTexture::BOOST_PREVIEW); + } + + if (mTentativeLabel) + { + mTentativeLabel->setVisible(FALSE); + } + + getChildView("Default")->setEnabled(mImageAssetID != mDefaultImageAssetID || mTentative); + getChildView("Transparent")->setEnabled(mImageAssetID != mTransparentImageAssetID || mTentative); // <alchemy/> + getChildView("Blank")->setEnabled(mImageAssetID != mBlankImageAssetID || mTentative); + getChildView("None")->setEnabled(mAllowNoTexture && (!mImageAssetID.isNull() || mTentative)); + + LLFloater::draw(); + + if (isMinimized()) + { + return; + } + + // Border + LLRect border = getChildView("preview_widget")->getRect(); + gl_rect_2d(border, LLColor4::black, FALSE); + + + // Interior + LLRect interior = border; + interior.stretch(-1); + + // If the floater is focused, don't apply its alpha to the texture (STORM-677). + const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); + if (mTexturep) + { + if (mTexturep->getComponents() == 4) + { + gl_rect_2d_checkerboard(interior, alpha); + } + + gl_draw_scaled_image(interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha); + + // Pump the priority + mTexturep->addTextureStats((F32)(interior.getWidth() * interior.getHeight())); + } + else if (!mFallbackImage.isNull()) + { + mFallbackImage->draw(interior, UI_VERTEX_COLOR % alpha); + } + else + { + gl_rect_2d(interior, LLColor4::grey % alpha, TRUE); + + // Draw X + gl_draw_x(interior, LLColor4::black); + } + + // Draw Tentative Label over the image + if (mTentative && !mViewModel->isDirty()) + { + mTentativeLabel->setVisible(TRUE); + drawChild(mTentativeLabel); + } + + if (mSelectedItemPinned) return; + + LLFolderView* folder_view = mInventoryPanel->getRootFolder(); + if (!folder_view) return; + + LLFolderViewFilter& filter = static_cast<LLFolderViewModelInventory*>(folder_view->getFolderViewModel())->getFilter(); + + bool is_filter_active = folder_view->getViewModelItem()->getLastFilterGeneration() < filter.getCurrentGeneration() && + filter.isNotDefault(); + + // After inventory panel filter is applied we have to update + // constraint rect for the selected item because of folder view + // AutoSelectOverride set to TRUE. We force PinningSelectedItem + // flag to FALSE state and setting filter "dirty" to update + // scroll container to show selected item (see LLFolderView::doIdle()). + if (!is_filter_active && !mSelectedItemPinned) + { + folder_view->setPinningSelectedItem(mSelectedItemPinned); + folder_view->getViewModelItem()->dirtyFilter(); + mSelectedItemPinned = TRUE; + } + } +} + +const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library) +{ + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + LLAssetIDMatches asset_id_matches(asset_id); + gInventory.collectDescendentsIf(LLUUID::null, + cats, + items, + LLInventoryModel::INCLUDE_TRASH, + asset_id_matches); + + if (items.size()) + { + // search for copyable version first + for (S32 i = 0; i < items.size(); i++) + { + LLInventoryItem* itemp = items[i]; + LLPermissions item_permissions = itemp->getPermissions(); + if (item_permissions.allowCopyBy(gAgent.getID(), gAgent.getGroupID())) + { + if (!ignore_library || !gInventory.isObjectDescendentOf(itemp->getUUID(), gInventory.getLibraryRootFolderID())) + { + return itemp->getUUID(); + } + } + } + // otherwise just return first instance, unless copyable requested + if (copyable_only) + { + return LLUUID::null; + } + else + { + if (!ignore_library || !gInventory.isObjectDescendentOf(items[0]->getUUID(), gInventory.getLibraryRootFolderID())) + { + return items[0]->getUUID(); + } + } + } + + return LLUUID::null; +} + +PermissionMask LLFloaterTexturePicker::getFilterPermMask() +{ + bool apply_immediate = getChild<LLUICtrl>("apply_immediate_check")->getValue().asBoolean(); + return apply_immediate ? mImmediateFilterPermMask : mNonImmediateFilterPermMask; +} + +void LLFloaterTexturePicker::commitIfImmediateSet() +{ + if (!mNoCopyTextureSelected && mOnFloaterCommitCallback != nullptr && mCanApply) + { + mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CHANGE, LLUUID::null); + } +} + +void LLFloaterTexturePicker::commitCancel() +{ + if (!mNoCopyTextureSelected && mOnFloaterCommitCallback != nullptr && mCanApply) + { + mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CANCEL, LLUUID::null); + } +} + +// static +void LLFloaterTexturePicker::onBtnSetToDefault(void* userdata) +{ + LLFloaterTexturePicker* self = static_cast<LLFloaterTexturePicker*>(userdata); + self->setCanApply(true, true); + if (self->mOwner) + { + self->setImageID(self->getDefaultImageAssetID()); + } + self->commitIfImmediateSet(); +} + +// static +void LLFloaterTexturePicker::onBtnTransparent(void* userdata) +{ + LLFloaterTexturePicker* self = static_cast<LLFloaterTexturePicker*>(userdata); + self->setCanApply(true, true); + self->setImageID(self->getTransparentImageAssetID()); + self->commitIfImmediateSet(); +} + +// static +void LLFloaterTexturePicker::onBtnBlank(void* userdata) +{ + LLFloaterTexturePicker* self = static_cast<LLFloaterTexturePicker*>(userdata); + self->setCanApply(true, true); + self->setImageID(self->getBlankImageAssetID()); + self->commitIfImmediateSet(); +} + + +// static +void LLFloaterTexturePicker::onBtnNone(void* userdata) +{ + LLFloaterTexturePicker* self = static_cast<LLFloaterTexturePicker*>(userdata); + self->setImageID(LLUUID::null); + self->commitCancel(); +} + +// static +void LLFloaterTexturePicker::onBtnCancel(void* userdata) +{ + LLFloaterTexturePicker* self = static_cast<LLFloaterTexturePicker*>(userdata); + self->setImageID(self->mOriginalImageAssetID); + if (self->mOnFloaterCommitCallback != nullptr) + { + self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CANCEL, LLUUID::null); + } + self->mViewModel->resetDirty(); + self->closeFloater(); +} + +// static +void LLFloaterTexturePicker::onBtnSelect(void* userdata) +{ + LLFloaterTexturePicker* self = static_cast<LLFloaterTexturePicker*>(userdata); + LLUUID local_id = LLUUID::null; + if (self->mOwner) + { + if (self->mLocalScrollCtrl->getVisible() && !self->mLocalScrollCtrl->getAllSelected().empty()) + { + LLUUID temp_id = self->mLocalScrollCtrl->getFirstSelected()->getColumn(LOCAL_TRACKING_ID_COLUMN)->getValue().asUUID(); + local_id = LLLocalBitmapMgr::getWorldID(temp_id); + } + } + if (self->mOnFloaterCommitCallback != nullptr) + { + self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_SELECT, local_id); + } + self->closeFloater(); +} + +void LLFloaterTexturePicker::onBtnPipette() +{ + BOOL pipette_active = getChild<LLUICtrl>("Pipette")->getValue().asBoolean(); + pipette_active = !pipette_active; + if (pipette_active) + { + LLToolMgr::getInstance()->setTransientTool(LLToolPipette::getInstance()); + } + else + { + LLToolMgr::getInstance()->clearTransientTool(); + } +} + +// static +void LLFloaterTexturePicker::onApplyUUID(void* userdata) +{ + LLFloaterTexturePicker* self = static_cast<LLFloaterTexturePicker*>(userdata); + LLUUID id(self->getChild<LLLineEditor>("uuid_editor")->getText()); + if (id.notNull()) + { + self->setImageID(id); + self->commitIfImmediateSet(); + } +} + +void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action) +{ + if (items.size()) + { + LLFolderViewItem* first_item = items.front(); + LLInventoryItem* itemp = gInventory.getItem(static_cast<LLFolderViewModelItemInventory*>(first_item->getViewModelItem())->getUUID()); + mNoCopyTextureSelected = FALSE; + if (itemp) + { + if (mTextureSelectedCallback != nullptr) + { + mTextureSelectedCallback(itemp); + } + if (!itemp->getPermissions().allowCopyBy(gAgent.getID())) + { + mNoCopyTextureSelected = TRUE; + } + setImageID(itemp->getAssetUUID(), false); + mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? + + if (!mPreviewSettingChanged) + { + mCanPreview = gSavedSettings.getBOOL("TextureLivePreview"); + } + else + { + mPreviewSettingChanged = false; + } + + if (user_action && mCanPreview) + { + // only commit intentional selections, not implicit ones + commitIfImmediateSet(); + } + } + } +} + +void LLFloaterTexturePicker::onModeSelect() +{ + bool mode = (mModeSelector->getSelectedIndex() == 0); + + getChild<LLButton>("Default")->setVisible(mode); + getChild<LLButton>("Transparent")->setVisible(mode); // <alchemy/> + getChild<LLButton>("Blank")->setVisible(mode); + getChild<LLButton>("None")->setVisible(mode); + getChild<LLButton>("Pipette")->setVisible(mode); + getChild<LLFilterEditor>("inventory search editor")->setVisible(mode); + getChild<LLInventoryPanel>("inventory panel")->setVisible(mode); + getChild<LLLineEditor>("uuid_editor")->setVisible(mode); + getChild<LLButton>("apply_uuid_btn")->setVisible(mode); + + /*getChild<LLCheckBox>("show_folders_check")->setVisible(mode); + no idea under which conditions the above is even shown, needs testing. */ + + getChild<LLButton>("l_add_btn")->setVisible(!mode); + getChild<LLButton>("l_rem_btn")->setVisible(!mode); + getChild<LLButton>("l_upl_btn")->setVisible(!mode); + getChild<LLScrollListCtrl>("l_name_list")->setVisible(!mode); +} + +// static +void LLFloaterTexturePicker::onBtnAdd(void* userdata) +{ + if (LLLocalBitmapMgr::addUnit() == true) + { + LLFloaterTexturePicker* self = static_cast<LLFloaterTexturePicker*>(userdata); + LLLocalBitmapMgr::feedScrollList(self->mLocalScrollCtrl); + } +} + +// static +void LLFloaterTexturePicker::onBtnRemove(void* userdata) +{ + LLFloaterTexturePicker* self = static_cast<LLFloaterTexturePicker*>(userdata); + std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected(); + + if (!selected_items.empty()) + { + for (LLScrollListItem* list_item : selected_items) + { + if (list_item) + { + LLUUID tracking_id = list_item->getColumn(LOCAL_TRACKING_ID_COLUMN)->getValue().asUUID(); + LLLocalBitmapMgr::delUnit(tracking_id); + } + } + + self->getChild<LLButton>("l_rem_btn")->setEnabled(false); + self->getChild<LLButton>("l_upl_btn")->setEnabled(false); + LLLocalBitmapMgr::feedScrollList(self->mLocalScrollCtrl); + } + +} + +// static +void LLFloaterTexturePicker::onBtnUpload(void* userdata) +{ + LLFloaterTexturePicker* self = static_cast<LLFloaterTexturePicker*>(userdata); + std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected(); + + if (selected_items.empty()) + { + return; + } + + /* currently only allows uploading one by one, picks the first item from the selection list. (not the vector!) + in the future, it might be a good idea to check the vector size and if more than one units is selected - opt for multi-image upload. */ + + LLUUID tracking_id = LLUUID(self->mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN)); + std::string filename = LLLocalBitmapMgr::getFilename(tracking_id); + + if (!filename.empty()) + { + LLFloaterReg::showInstance("upload_image", LLSD(filename)); + } + +} + +void LLFloaterTexturePicker::onLocalScrollCommit() +{ + std::vector<LLScrollListItem*> selected_items = mLocalScrollCtrl->getAllSelected(); + bool has_selection = !selected_items.empty(); + + getChild<LLButton>("l_rem_btn")->setEnabled(has_selection); + getChild<LLButton>("l_upl_btn")->setEnabled(has_selection && (selected_items.size() < 2)); + /* since multiple-localbitmap upload is not implemented, upl button gets disabled if more than one is selected. */ + + if (has_selection) + { + LLUUID tracking_id = LLUUID(mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN)); + LLUUID inworld_id = LLLocalBitmapMgr::getWorldID(tracking_id); + if (mSetImageAssetIDCallback != nullptr) + { + mSetImageAssetIDCallback(inworld_id); + } + + if (childGetValue("apply_immediate_check").asBoolean()) + { + if (mOnFloaterCommitCallback != nullptr) + { + mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CHANGE, inworld_id); + } + } + } +} + +// static +void LLFloaterTexturePicker::onShowFolders(LLUICtrl* ctrl, void *user_data) +{ + LLCheckBoxCtrl* check_box = static_cast<LLCheckBoxCtrl*>(ctrl); + LLFloaterTexturePicker* picker = static_cast<LLFloaterTexturePicker*>(user_data); + + if (check_box->get()) + { + picker->mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + } + else + { + picker->mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NO_FOLDERS); + } +} + +// static +void LLFloaterTexturePicker::onApplyImmediateCheck(LLUICtrl* ctrl, void *user_data) +{ + LLFloaterTexturePicker* picker = static_cast<LLFloaterTexturePicker*>(user_data); + + LLCheckBoxCtrl* check_box = static_cast<LLCheckBoxCtrl*>(ctrl); + gSavedSettings.setBOOL("TextureLivePreview", check_box->get()); + + picker->updateFilterPermMask(); + picker->commitIfImmediateSet(); +} + +void LLFloaterTexturePicker::updateFilterPermMask() +{ + //mInventoryPanel->setFilterPermMask( getFilterPermMask() ); Commented out due to no-copy texture loss. +} + +void LLFloaterTexturePicker::setCanApply(bool can_preview, bool can_apply) +{ + getChildRef<LLUICtrl>("Select").setEnabled(can_apply); + getChildRef<LLUICtrl>("preview_disabled").setVisible(!can_preview); + getChildRef<LLUICtrl>("apply_immediate_check").setVisible(can_preview); + + mCanApply = can_apply; + mCanPreview = can_preview ? gSavedSettings.getBOOL("TextureLivePreview") : false; + mPreviewSettingChanged = true; +} + +void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string) +{ + std::string upper_case_search_string = search_string; + LLStringUtil::toUpper(upper_case_search_string); + + if (upper_case_search_string.empty()) + { + if (mInventoryPanel->getFilterSubString().empty()) + { + // current filter and new filter empty, do nothing + return; + } + + mSavedFolderState.setApply(TRUE); + mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState); + // add folder with current item to list of previously opened folders + LLOpenFoldersWithSelection opener; + mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener); + mInventoryPanel->getRootFolder()->scrollToShowSelection(); + + } + else if (mInventoryPanel->getFilterSubString().empty()) + { + // first letter in search term, save existing folder open state + if (!mInventoryPanel->getFilter().isNotDefault()) + { + mSavedFolderState.setApply(FALSE); + mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState); + } + } + + mInventoryPanel->setFilterSubString(search_string); +} + +void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled) +{ + mModeSelector->setIndexEnabled(1, enabled); +} + +void LLFloaterTexturePicker::onTextureSelect(const LLTextureEntry& te) +{ + LLUUID inventory_item_id = findItemID(te.getID(), TRUE); + if (inventory_item_id.notNull()) + { + LLToolPipette::getInstance()->setResult(TRUE, ""); + setImageID(te.getID()); + + mNoCopyTextureSelected = FALSE; + LLInventoryItem* itemp = gInventory.getItem(inventory_item_id); + + if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) + { + // no copy texture + mNoCopyTextureSelected = TRUE; + } + + commitIfImmediateSet(); + } + else + { + LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture")); + } +} diff --git a/indra/newview/llfloatertexturepicker.h b/indra/newview/llfloatertexturepicker.h new file mode 100644 index 0000000000000000000000000000000000000000..5d9df8c190439a8e40065b5ba747e314739722fd --- /dev/null +++ b/indra/newview/llfloatertexturepicker.h @@ -0,0 +1,174 @@ +/** +* @file llfloatertexturepicker.h +* @author Richard Nelson, James Cook +* @brief LLTextureCtrl class header file including related functions +* +* $LicenseInfo:firstyear=2002&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$ +*/ + +#ifndef LL_FLOATERTEXTUREPICKER_H +#define LL_FLOATERTEXTUREPICKER_H + +#include "llviewertexture.h" +#include "lltexturectrl.h" +#include "llfloater.h" + +class LLFilterEditor; + +typedef std::function<void(LLTextureCtrl::ETexturePickOp op, LLUUID id)> floater_commit_callback; +typedef std::function<void()> floater_close_callback; +typedef std::function<void(const LLUUID& asset_id)> set_image_asset_id_callback; +typedef std::function<void(LLPointer<LLViewerTexture> texture)> set_on_update_image_stats_callback; + +class LLFloaterTexturePicker : public LLFloater +{ +public: + LLFloaterTexturePicker( + LLView* owner, + LLUUID image_asset_id, + LLUUID default_image_asset_id, + LLUUID transparent_image_asset_id, + LLUUID blank_image_asset_id, + BOOL tentative, + BOOL allow_no_texture, + const std::string& label, + PermissionMask immediate_filter_perm_mask, + PermissionMask dnd_filter_perm_mask, + PermissionMask non_immediate_filter_perm_mask, + BOOL can_apply_immediately, + LLUIImagePtr fallback_image_name + ); + + virtual ~LLFloaterTexturePicker(); + + // LLView overrides + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, + BOOL drop, EDragAndDropType cargo_type, void *cargo_data, + EAcceptance *accept, + std::string& tooltip_msg) override; + void draw() override; + BOOL handleKeyHere(KEY key, MASK mask) override; + + // LLFloater overrides + BOOL postBuild() override; + void onClose(bool app_settings) override; + + // New functions + void setImageID(const LLUUID& image_asset_id, bool set_selection = true); + void updateImageStats(); + const LLUUID& getAssetID() const { return mImageAssetID; } + const LLUUID& findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library = FALSE); + void setCanApplyImmediately(BOOL b); + + void setActive(BOOL active); + + LLView* getOwner() const { return mOwner; } + void setOwner(LLView* owner) { mOwner = owner; } + void stopUsingPipette(); + PermissionMask getFilterPermMask(); + + void updateFilterPermMask(); + void commitIfImmediateSet(); + void commitCancel(); + + void onFilterEdit(const std::string& search_string); + + void setCanApply(bool can_preview, bool can_apply); + void setTextureSelectedCallback(const texture_selected_callback& cb) { mTextureSelectedCallback = cb; } + void setOnFloaterCloseCallback(const floater_close_callback& cb) { mOnFloaterCloseCallback = cb; } + void setOnFloaterCommitCallback(const floater_commit_callback& cb) { mOnFloaterCommitCallback = cb; } + void setSetImageAssetIDCallback(const set_image_asset_id_callback& cb) { mSetImageAssetIDCallback = cb; } + void setOnUpdateImageStatsCallback(const set_on_update_image_stats_callback& cb) { mOnUpdateImageStatsCallback = cb; } + const LLUUID& getDefaultImageAssetID() const { return mDefaultImageAssetID; } + const LLUUID& getTransparentImageAssetID() const { return mTransparentImageAssetID; } + const LLUUID& getBlankImageAssetID() const { return mBlankImageAssetID; } + + static void onBtnSetToDefault(void* userdata); + static void onBtnSelect(void* userdata); + static void onBtnCancel(void* userdata); + void onBtnPipette(); + static void onBtnTransparent(void* userdata); + static void onBtnBlank(void* userdata); + static void onBtnNone(void* userdata); + static void onApplyUUID(void* userdata); + void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); + static void onShowFolders(LLUICtrl* ctrl, void* userdata); + static void onApplyImmediateCheck(LLUICtrl* ctrl, void* userdata); + void onTextureSelect(const LLTextureEntry& te); + + void onModeSelect(); + static void onBtnAdd(void* userdata); + static void onBtnRemove(void* userdata); + static void onBtnUpload(void* userdata); + void onLocalScrollCommit(); + + void setLocalTextureEnabled(BOOL enabled); + +protected: + LLPointer<LLViewerTexture> mTexturep; + LLView* mOwner; + + LLUUID mImageAssetID; // Currently selected texture + LLUIImagePtr mFallbackImage; // What to show if currently selected texture is null. + LLUUID mDefaultImageAssetID; + LLUUID mTransparentImageAssetID; + LLUUID mBlankImageAssetID; + BOOL mTentative; + BOOL mAllowNoTexture; + LLUUID mSpecialCurrentImageAssetID; // Used when the asset id has no corresponding texture in the user's inventory. + LLUUID mOriginalImageAssetID; + + std::string mLabel; + + LLTextBox* mTentativeLabel; + LLTextBox* mResolutionLabel; + + std::string mPendingName; + BOOL mActive; + + LLFilterEditor* mFilterEdit; + LLInventoryPanel* mInventoryPanel; + PermissionMask mImmediateFilterPermMask; + PermissionMask mDnDFilterPermMask; + PermissionMask mNonImmediateFilterPermMask; + BOOL mCanApplyImmediately; + BOOL mNoCopyTextureSelected; + F32 mContextConeOpacity; + LLSaveFolderState mSavedFolderState; + BOOL mSelectedItemPinned; + + LLRadioGroup* mModeSelector; + LLScrollListCtrl* mLocalScrollCtrl; + +private: + bool mCanApply; + bool mCanPreview; + bool mPreviewSettingChanged; + + texture_selected_callback mTextureSelectedCallback; + floater_close_callback mOnFloaterCloseCallback; + floater_commit_callback mOnFloaterCommitCallback; + set_image_asset_id_callback mSetImageAssetIDCallback; + set_on_update_image_stats_callback mOnUpdateImageStatsCallback; +}; + +#endif // LL_FLOATERTEXTUREPICKER_H diff --git a/indra/newview/llfloatertexturezoom.cpp b/indra/newview/llfloatertexturezoom.cpp index 8f5e04343d13570d544ce62790cb91c0c743b08b..e847002d22df9cb889f8d0b09a14e8bf87081a8b 100644 --- a/indra/newview/llfloatertexturezoom.cpp +++ b/indra/newview/llfloatertexturezoom.cpp @@ -30,6 +30,7 @@ #include "llviewerinventory.h" #include "llviewertexture.h" #include "llviewertexturelist.h" // for MIPMAP_TRUE +#include "alviewermenu.h" LLFloaterTextureZoom::LLFloaterTextureZoom(const LLSD& key) : LLPreview(key) @@ -246,6 +247,18 @@ void LLFloaterTextureZoom::setObjectID(const LLUUID& object_id) } } +BOOL LLFloaterTextureZoom::handleMouseDown(S32 x, S32 y, MASK mask) +{ + BOOL handled = LLUICtrl::handleMouseDown(x, y, mask); + + if (mask & MASK_SHIFT) + { + ALViewerMenu::destroy_texture(mImageID); + handled = TRUE; + } + return handled; +} + BOOL LLFloaterTextureZoom::handleKeyHere(KEY key, MASK mask) { if (key == KEY_ESCAPE || key == KEY_RETURN) diff --git a/indra/newview/llfloatertexturezoom.h b/indra/newview/llfloatertexturezoom.h index 6e0120022e438db97e06106dd374026c0054f663..dfc0365f617482add19fbdb2c20335aef4d91b6a 100644 --- a/indra/newview/llfloatertexturezoom.h +++ b/indra/newview/llfloatertexturezoom.h @@ -38,6 +38,7 @@ public: /* virtual */ void loadAsset() override; /* virtual */ EAssetStatus getAssetStatus() override; /* virtual */ void setObjectID(const LLUUID& object_id) override; + /* virtual */ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override; /* virtual */ BOOL handleKeyHere(KEY key, MASK mask) override; /* virtual */ void onFocusLost() override; diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index 9d2e4102da70ceb0e2bdfbb43055762ddf4949ec..8fd1cc032c8da0f34537bb70495a3c4ca2e86e0d 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -224,7 +224,7 @@ void LLInspectObject::onOpen(const LLSD& data) // Mark this as a transient selection struct SetTransient : public LLSelectedNodeFunctor { - bool apply(LLSelectNode* node) + bool apply(LLSelectNode* node) override { node->setTransient(TRUE); return true; diff --git a/indra/newview/llinspectremoteobject.cpp b/indra/newview/llinspectremoteobject.cpp index 9143a9bd881532cead9dc8803354bcae1fe0aa78..096d9708abf0b516b49e5ed483b5948179dd89e1 100644 --- a/indra/newview/llinspectremoteobject.cpp +++ b/indra/newview/llinspectremoteobject.cpp @@ -54,8 +54,8 @@ public: LLInspectRemoteObject(const LLSD& object_id); virtual ~LLInspectRemoteObject() {}; - /*virtual*/ BOOL postBuild(void); - /*virtual*/ void onOpen(const LLSD& avatar_id); + /*virtual*/ BOOL postBuild(void) override; + /*virtual*/ void onOpen(const LLSD& avatar_id) override; void onClickMap(); void onClickBlock(); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e5c99a92e4e66c55d2fda6e06cec6b7ede312b54..7f0f4f60e20edf8de077092a88777908eae96f9c 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -143,7 +143,8 @@ public: LLRightClickInventoryFetchDescendentsObserver(const uuid_vec_t& ids) : LLInventoryFetchDescendentsObserver(ids) {} ~LLRightClickInventoryFetchDescendentsObserver() {} virtual void execute(bool clear_observer = false); - virtual void done() + + void done() override { execute(true); } @@ -165,7 +166,8 @@ public: // we've downloaded all the items, so repaint the dialog LLFolderBridge::staticFolderOptionsMenu(); } - virtual void done() + + void done() override { execute(true); } @@ -178,11 +180,11 @@ public: LLInvFVBridge::LLInvFVBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid) : - mUUID(uuid), + LLFolderViewModelItemInventory(inventory->getRootViewModel()), mRoot(root), + mUUID(uuid), mInvType(LLInventoryType::IT_NONE), - mIsLink(FALSE), - LLFolderViewModelItemInventory(inventory->getRootViewModel()) + mIsLink(FALSE) { mInventoryPanel = inventory->getInventoryPanelHandle(); const LLInventoryObject* obj = getInventoryObject(); @@ -2237,11 +2239,13 @@ class LLIsItemRemovable : public LLFolderViewFunctor { public: LLIsItemRemovable() : mPassed(TRUE) {} - virtual void doFolder(LLFolderViewFolder* folder) + + void doFolder(LLFolderViewFolder* folder) override { mPassed &= folder->getViewModelItem()->isItemRemovable(); } - virtual void doItem(LLFolderViewItem* item) + + void doItem(LLFolderViewItem* item) override { mPassed &= item->getViewModelItem()->isItemRemovable(); } @@ -3061,7 +3065,7 @@ public: LLInventoryCopyAndWearObserver(const LLUUID& cat_id, int count, bool folder_added=false, bool replace=false) : mCatID(cat_id), mContentsCount(count), mFolderAdded(folder_added), mReplace(replace){} virtual ~LLInventoryCopyAndWearObserver() {} - virtual void changed(U32 mask); + void changed(U32 mask) override; protected: LLUUID mCatID; @@ -5530,7 +5534,8 @@ class LLCallingCardObserver : public LLFriendObserver public: LLCallingCardObserver(LLCallingCardBridge* bridge) : mBridgep(bridge) {} virtual ~LLCallingCardObserver() { mBridgep = NULL; } - virtual void changed(U32 mask) + + void changed(U32 mask) override { mBridgep->refreshFolderViewItem(); if (mask & LLFriendObserver::ONLINE) @@ -7003,7 +7008,7 @@ class LLTextureBridgeAction: public LLInvFVBridgeAction { friend class LLInvFVBridgeAction; public: - virtual void doIt() + void doIt() override { if (getItem()) { @@ -7020,7 +7025,7 @@ class LLSoundBridgeAction: public LLInvFVBridgeAction { friend class LLInvFVBridgeAction; public: - virtual void doIt() + void doIt() override { LLViewerInventoryItem* item = getItem(); if (item) @@ -7038,7 +7043,7 @@ class LLLandmarkBridgeAction: public LLInvFVBridgeAction { friend class LLInvFVBridgeAction; public: - virtual void doIt() + void doIt() override { LLViewerInventoryItem* item = getItem(); if (item) @@ -7064,7 +7069,7 @@ class LLCallingCardBridgeAction: public LLInvFVBridgeAction { friend class LLInvFVBridgeAction; public: - virtual void doIt() + void doIt() override { LLViewerInventoryItem* item = getItem(); if (item && item->getCreatorUUID().notNull()) @@ -7084,7 +7089,7 @@ class LLNotecardBridgeAction { friend class LLInvFVBridgeAction; public: - virtual void doIt() + void doIt() override { LLViewerInventoryItem* item = getItem(); if (item) @@ -7102,7 +7107,7 @@ class LLGestureBridgeAction: public LLInvFVBridgeAction { friend class LLInvFVBridgeAction; public: - virtual void doIt() + void doIt() override { LLViewerInventoryItem* item = getItem(); if (item) @@ -7121,7 +7126,7 @@ class LLAnimationBridgeAction: public LLInvFVBridgeAction { friend class LLInvFVBridgeAction; public: - virtual void doIt() + void doIt() override { LLViewerInventoryItem* item = getItem(); if (item) @@ -7139,7 +7144,7 @@ class LLObjectBridgeAction: public LLInvFVBridgeAction { friend class LLInvFVBridgeAction; public: - virtual void doIt() + void doIt() override { /* LLFloaterReg::showInstance("properties", mUUID); @@ -7155,7 +7160,7 @@ class LLLSLTextBridgeAction: public LLInvFVBridgeAction { friend class LLInvFVBridgeAction; public: - virtual void doIt() + void doIt() override { LLViewerInventoryItem* item = getItem(); if (item) @@ -7173,7 +7178,7 @@ class LLWearableBridgeAction: public LLInvFVBridgeAction { friend class LLInvFVBridgeAction; public: - virtual void doIt() + void doIt() override { wearOnAvatar(); } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index e4babb99faff88606098f1d7c30ec8a87dc2e7bf..ca112b1bee1a2f4ad3fe2202150315d97d4e71e0 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -78,9 +78,9 @@ LLInventoryFilter::LLInventoryFilter(const Params& p) mCurrentGeneration(0), mFirstRequiredGeneration(0), mFirstSuccessGeneration(0), + mEmptyLookupMessage("InventoryNoMatchingItems"), mSearchType(SEARCHTYPE_NAME), - mFilterCreatorType(FILTERCREATOR_ALL), - mEmptyLookupMessage("InventoryNoMatchingItems") + mFilterCreatorType(FILTERCREATOR_ALL) { // copy mFilterOps into mDefaultFilterOps markDefault(); diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 2c2c4085ef3d98d1a2440a209913b1a2ef420a79..b713c3c1261e047e7d841c8bad232864a771390a 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -439,7 +439,7 @@ void copy_inventory_category(LLInventoryModel* model, class LLInventoryCollectAllItems : public LLInventoryCollectFunctor { public: - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override { return true; } @@ -1925,8 +1925,8 @@ bool LLFindWearables::operator()(LLInventoryCategory* cat, } LLFindWearablesEx::LLFindWearablesEx(bool is_worn, bool include_body_parts) -: mIsWorn(is_worn) -, mIncludeBodyParts(include_body_parts) +: mIncludeBodyParts(include_body_parts) +, mIsWorn(is_worn) {} bool LLFindWearablesEx::operator()(LLInventoryCategory* cat, LLInventoryItem* item) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 9a3ac8ab23938907a0a88e0c6402e39e18c6267b..88969923cd78cd4b07d27e4a03c5eeb42e871989 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -139,7 +139,6 @@ LLInventoryModel gInventory; // Default constructor LLInventoryModel::LLInventoryModel() : // These are now ordered, keep them that way. - mBacklinkMMap(), mIsAgentInvUsable(false), mRootFolderID(), mLibraryRootFolderID(), @@ -148,6 +147,7 @@ LLInventoryModel::LLInventoryModel() mItemMap(), mParentChildCategoryTree(), mParentChildItemTree(), + mBacklinkMMap(), mLastItem(nullptr), mIsNotifyObservers(FALSE), mModifyMask(LLInventoryObserver::ALL), diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index 9b36a437a0a6c660e410c7ebaf8ea7a641c05908..ba1ba95b5c04c38710b61d7d377969b7d3d6b7d0 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -63,8 +63,8 @@ public: mPos(pos) {} - /*virtual*/ bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) - { + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override + { if (!item || item->getType() != LLAssetType::AT_LANDMARK) return false; @@ -99,8 +99,8 @@ use_substring(if_use_substring) } public: - /*virtual*/ bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) - { + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override + { if (!item || item->getType() != LLAssetType::AT_LANDMARK) return false; @@ -142,8 +142,8 @@ private: public: LLFirstAgentParcelLandmark(): mFounded(false){} - /*virtual*/ bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) - { + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override + { if (mFounded || !item || item->getType() != LLAssetType::AT_LANDMARK) return false; @@ -193,7 +193,7 @@ LLInventoryModel::item_array_t LLLandmarkActions::fetchLandmarksByName(std::stri bool LLLandmarkActions::landmarkAlreadyExists() { // Determine whether there are landmarks pointing to the current global agent position. - return findLandmarkForAgentPos() != NULL; + return findLandmarkForAgentPos() != nullptr; } //static @@ -217,12 +217,7 @@ LLViewerInventoryItem* LLLandmarkActions::findLandmarkForGlobalPos(const LLVecto LLFetchlLandmarkByPos is_current_pos_landmark(pos); fetch_landmarks(cats, items, is_current_pos_landmark); - if(items.empty()) - { - return NULL; - } - - return items[0]; + return (items.empty()) ? nullptr : items[0]; } LLViewerInventoryItem* LLLandmarkActions::findLandmarkForAgentPos() @@ -289,13 +284,20 @@ void LLLandmarkActions::createLandmarkHere() createLandmarkHere(landmark_name, landmark_desc, folder_id); } +LLVector3d getRegionPosFromGlobalPos(const LLVector3d& global_pos, const LLSimInfo* siminfo) +{ + LLVector3d local_pos; + local_pos[0] = fmod(global_pos[0], siminfo ? siminfo->getSizeX() : 256); + local_pos[1] = fmod(global_pos[1], siminfo ? siminfo->getSizeY() : 256); + return local_pos; +} + void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb, bool escaped /* = true */) { - - std::string sim_name; - if (LLWorldMap::getInstance()->simNameFromPosGlobal(global_pos, sim_name)) + const LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromPosGlobal(global_pos); + if (siminfo) { - std::string slurl = LLSLURL(sim_name, global_pos).getSLURLString(); + std::string slurl = LLSLURL(siminfo->getName(), getRegionPosFromGlobalPos(global_pos, siminfo)).getSLURLString(); cb(slurl); } else @@ -341,10 +343,10 @@ void LLLandmarkActions::onRegionResponseSLURL(slurl_callback_t cb, { std::string sim_name; std::string slurl; - bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal(global_pos, sim_name); - if (gotSimName) + const LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromPosGlobal(global_pos); + if (siminfo) { - slurl = LLSLURL(sim_name, global_pos).getSLURLString(); + slurl = LLSLURL(siminfo->getName(), getRegionPosFromGlobalPos(global_pos, siminfo)).getSLURLString(); } else { diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index cc764b1152946f48185e89192af54beafd27b4da..f659a22b932191a2ab48d626b58d2f083b8cb64b 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -112,8 +112,8 @@ public: LLAddLandmarkObserver(LLLocationInputCtrl* input) : mInput(input) {} private: - /*virtual*/ void done() - { + /*virtual*/ void done() override + { const uuid_set_t& added = gInventory.getAddedIDs(); for (uuid_set_t::const_iterator it = added.begin(); it != added.end(); ++it) { @@ -145,8 +145,8 @@ public: LLRemoveLandmarkObserver(LLLocationInputCtrl* input) : mInput(input) {} private: - /*virtual*/ void changed(U32 mask) - { + /*virtual*/ void changed(U32 mask) override + { if (mask & (~(LLInventoryObserver::LABEL| LLInventoryObserver::INTERNAL| LLInventoryObserver::ADD| @@ -166,8 +166,8 @@ public: LLParcelChangeObserver(LLLocationInputCtrl* input) : mInput(input) {} private: - /*virtual*/ void changed() - { + /*virtual*/ void changed() override + { if (mInput) { mInput->refreshParcelIcons(); @@ -190,35 +190,35 @@ LLLocationInputCtrl::Params::Params() add_landmark_image_disabled("add_landmark_image_disabled"), add_landmark_image_hover("add_landmark_image_hover"), add_landmark_image_selected("add_landmark_image_selected"), - add_landmark_hpad("add_landmark_hpad", 0), + maturity_help_topic("maturity_help_topic"), icon_hpad("icon_hpad", 0), + add_landmark_hpad("add_landmark_hpad", 0), + maturity_button("maturity_button"), add_landmark_button("add_landmark_button"), for_sale_button("for_sale_button"), info_button("info_button"), - maturity_button("maturity_button"), voice_icon("voice_icon"), fly_icon("fly_icon"), push_icon("push_icon"), build_icon("build_icon"), scripts_icon("scripts_icon"), damage_icon("damage_icon"), - damage_text("damage_text"), see_avatars_icon("see_avatars_icon"), - maturity_help_topic("maturity_help_topic"), pathfinding_dirty_icon("pathfinding_dirty_icon"), pathfinding_disabled_icon("pathfinding_disabled_icon"), - lightshare_icon("lightshare_icon") + lightshare_icon("lightshare_icon"), + damage_text("damage_text") { } LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) : LLComboBox(p), - mIconHPad(p.icon_hpad), - mAddLandmarkHPad(p.add_landmark_hpad), mLocationContextMenu(NULL), mAddLandmarkBtn(NULL), mForSaleBtn(NULL), mInfoBtn(NULL), + mIconHPad(p.icon_hpad), + mAddLandmarkHPad(p.add_landmark_hpad), mRegionCrossingSlot(), mLightshareChangedSlot(), mNavMeshSlot(), diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index ca1898d22fe39b2c46e406ba6d43778494ac684b..dc3ff6e708c0e7ee3287dc1b5e111662d46ce5e7 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -2293,7 +2293,7 @@ BOOL LLManipTranslate::canAffectSelection() { struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* objectp) + bool apply(LLViewerObject* objectp) override { LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit(); return objectp->permMove() && !objectp->isPermanentEnforced() && diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index 6038d17a22d1b58bc60dd2690da68eb28c10415b..3db1fc12ad5556392302ee016f814c6a6f21e232 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -77,8 +77,8 @@ public: virtual ~LLMaterialHttpHandler(); protected: - virtual void onSuccess(LLCore::HttpResponse * response, const LLSD &content); - virtual void onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status); + void onSuccess(LLCore::HttpResponse * response, const LLSD &content) override; + void onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status) override; private: std::string mMethod; @@ -140,9 +140,9 @@ LLMaterialMgr::LLMaterialMgr(): { LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp()); - mHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest()); - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); + mHttpRequest = boost::make_shared<LLCore::HttpRequest>(); + mHttpHeaders = boost::make_shared<LLCore::HttpHeaders>(); + mHttpOptions = boost::make_shared<LLCore::HttpOptions>(); mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_MATERIALS); mMaterials.insert(std::pair<LLMaterialID, LLMaterialPtr>(LLMaterialID::null, LLMaterialPtr(NULL))); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index f5712d95ac6abbc742c3a1c8fb9f9e2cdbb93882..a883e3eca186c0d931e7650e17da7bd5c9aca44b 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -809,8 +809,8 @@ LLMeshRepoThread::LLMeshRepoThread() mHttpPolicyClass(LLCore::HttpRequest::DEFAULT_POLICY_ID), mHttpLegacyPolicyClass(LLCore::HttpRequest::DEFAULT_POLICY_ID), mHttpLargePolicyClass(LLCore::HttpRequest::DEFAULT_POLICY_ID), - mLegacyGetMeshVersion(0), - mHttpPriority(0) + mHttpPriority(0), + mLegacyGetMeshVersion(0) { LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp()); @@ -3272,9 +3272,9 @@ void LLMeshPhysicsShapeHandler::processData(LLCore::BufferArray * /* body */, S3 LLMeshRepository::LLMeshRepository() : mMeshMutex(nullptr), mMeshThreadCount(0), - mLegacyGetMeshVersion(0), mThread(nullptr), - mDecompThread(nullptr) + mDecompThread(nullptr), + mLegacyGetMeshVersion(0) { } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index ce0cf3ede763570d967b297138439913244a27cf..c72da078cfedb7fddc1ec1b92401595a4757b892 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -51,6 +51,7 @@ #include "llappviewer.h" // for gDisconnected #include "llcallingcard.h" // LLAvatarTracker #include "llfloaterworldmap.h" +#include "llparcel.h" #include "lltracker.h" #include "llsurface.h" #include "llviewercamera.h" @@ -59,6 +60,8 @@ #include "llviewertexturelist.h" #include "llviewermenu.h" #include "llviewerobjectlist.h" +#include "llviewerparcelmgr.h" +#include "llviewerparceloverlay.h" #include "llviewerregion.h" #include "llviewerwindow.h" #include "llworld.h" @@ -81,6 +84,8 @@ const F64 COARSEUPDATE_MAX_Z = 1020.0; LLNetMap::LLNetMap (const Params & p) : LLUICtrl (p), mUpdateNow(false), + mUpdateObjectImage(false), + mUpdateParcelImage(false), mBackgroundColor (p.bg_color()), mScale( MAP_SCALE_MID ), mPixelsPerMeter( MAP_SCALE_MID / REGION_WIDTH_METERS ), @@ -94,6 +99,9 @@ LLNetMap::LLNetMap (const Params & p) mObjectImageCenterGlobal( gAgentCamera.getCameraPositionGlobal() ), mObjectRawImagep(), mObjectImagep(), + mParcelImageCenterGlobal( gAgentCamera.getCameraPositionGlobal() ), + mParcelRawImagep(), + mParcelImagep(), mClosestAgentToCursor(), mClosestAgentAtLastRightClick(), mToolTipMsg(), @@ -112,6 +120,14 @@ LLNetMap::~LLNetMap() menu->die(); mPopupMenuHandle.markDead(); } + if (mParcelMgrConn.connected()) + { + mParcelMgrConn.disconnect(); + } + if (mParcelOverlayConn.connected()) + { + mParcelOverlayConn.disconnect(); + } } BOOL LLNetMap::postBuild() @@ -123,6 +139,10 @@ BOOL LLNetMap::postBuild() LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_mini_map.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mPopupMenuHandle = menu->getHandle(); + + mParcelMgrConn = LLViewerParcelMgr::instance().setCollisionUpdateCallback(boost::bind(&LLNetMap::refreshParcelOverlay, this)); + mParcelOverlayConn = LLViewerParcelOverlay::setUpdateCallback(boost::bind(&LLNetMap::refreshParcelOverlay, this)); + return TRUE; } @@ -148,6 +168,8 @@ void LLNetMap::setScale( F32 scale ) mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); gSavedSettings.setF32("MiniMapScale", mScale); + mUpdateObjectImage = true; + mUpdateParcelImage = true; mUpdateNow = true; } @@ -163,16 +185,20 @@ void LLNetMap::draw() static LLFrameTimer map_timer; static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white); + static LLUIColor map_chat_ring_color = LLUIColorTable::instance().getColor("MapChatRingColor", LLColor4::white); + static LLUIColor map_shout_ring_color = LLUIColorTable::instance().getColor("MapShoutRingColor", LLColor4::white); //static LLUIColor map_track_disabled_color = LLUIColorTable::instance().getColor("MapTrackDisabledColor", LLColor4::white); static LLUIColor map_frustum_color = LLUIColorTable::instance().getColor("MapFrustumColor", LLColor4::white); static LLUIColor map_frustum_rotating_color = LLUIColorTable::instance().getColor("MapFrustumRotatingColor", LLColor4::white); - // <alchemy> static LLUIColor map_line_color = LLUIColorTable::instance().getColor("MapLineColor", LLColor4::red); + static LLUIColor map_parcel_line_color = LLUIColorTable::instance().getColor("MapParcelBoundryLine", LLColor4::white); + static LLCachedControl<bool> use_world_map_image(gSavedSettings, "AlchemyMinimapTile", true); static LLCachedControl<bool> center_to_region(gSavedSettings, "AlchemyMinimapCenterRegion", false); static LLCachedControl<bool> enable_object_render(gSavedSettings, "AlchemyMinimapRenderObjects", true); static LLCachedControl<bool> render_guide_line(gSavedSettings, "AlchemyMinimapGuideLine", false); - // </alchemy> + static LLCachedControl<bool> map_chat_ring(gSavedSettings, "AlchemyMinimapChatRings", false); + static LLCachedControl<bool> minimap_parcel_boundries(gSavedSettings, "AlchemyMinimapParcelBoundries", false); const LLVector3d& globalpos = center_to_region ? curregionp->getCenterGlobal() : gAgentCamera.getCameraPositionGlobal(); const LLVector3& agentpos = center_to_region ? curregionp->getCenterAgent() : gAgentCamera.getCameraPositionAgent(); @@ -181,6 +207,10 @@ void LLNetMap::draw() { createObjectImage(); } + if (mParcelImagep.isNull()) + { + createParcelImage(); + } static LLUICachedControl<bool> auto_center("MiniMapAutoCenter", true); if (auto_center) @@ -332,11 +362,17 @@ void LLNetMap::draw() // <//alchemy> // Redraw object layer periodically - static LLCachedControl<F32> object_layer_update_time_setting(gSavedSettings, "AlchemyMinimapObjectUpdateInterval", 0.1f); - F32 object_layer_update_time = llclamp((F32)object_layer_update_time_setting, 0.01f, 60.f); - if (mUpdateNow || (map_timer.getElapsedTimeF32() > object_layer_update_time)) // <alchemy/> + LLVector3 pos_center = globalPosToView(gAgentCamera.getCameraPositionGlobal()); + pos_center.mV[VX] -= mCurPan.mV[VX]; + pos_center.mV[VY] -= mCurPan.mV[VY]; + pos_center.mV[VZ] = 0.f; + LLVector3d pos_center_global = viewPosToGlobal(llfloor(pos_center.mV[VX]), llfloor(pos_center.mV[VY])); + + static LLCachedControl<F32> object_layer_update_time_setting(gSavedSettings, "AlchemyMinimapObjectUpdateInterval", 0.1f); + F32 object_layer_update_time = llclamp(object_layer_update_time_setting(), 0.01f, 60.f); + if (mUpdateObjectImage || (map_timer.getElapsedTimeF32() > object_layer_update_time)) // <alchemy/> { - mUpdateNow = false; + mUpdateObjectImage = false; // Locate the centre of the object layer, accounting for panning LLVector3 new_center = globalPosToView(globalpos); @@ -359,7 +395,27 @@ void LLNetMap::draw() map_timer.reset(); } + if (minimap_parcel_boundries + && (mUpdateParcelImage || dist_vec_squared2D(mParcelImageCenterGlobal, pos_center_global) > 9.0f)) + { + mUpdateParcelImage = false; + mParcelImageCenterGlobal = pos_center_global; + + U8* texture_data = mParcelRawImagep->getData(); + memset(texture_data, 0, mParcelImagep->getWidth() * mParcelImagep->getHeight() * mParcelImagep->getComponents()); + // Process each region + for (LLWorld::region_list_t::const_iterator itr = LLWorld::getInstance()->getRegionList().begin(); + itr != LLWorld::getInstance()->getRegionList().end(); + ++itr) + { + LLViewerRegion* region = *itr; + LLColor4U overlay_color = region->isAlive() ? map_parcel_line_color.get() : LLColor4U(255, 128, 128, 255); + renderPropertyLinesForRegion(region, overlay_color); + } + + mParcelImagep->setSubImage(mParcelRawImagep, 0, 0, mParcelImagep->getWidth(), mParcelImagep->getHeight()); + } LLVector3 map_center_agent = gAgent.getPosAgentFromGlobal(mObjectImageCenterGlobal); LLVector3 camera_position = agentpos; map_center_agent -= camera_position; @@ -381,6 +437,31 @@ void LLNetMap::draw() gGL.vertex2f(image_half_width + map_center_agent.mV[VX], map_center_agent.mV[VY] - image_half_height); gGL.end(); + if (minimap_parcel_boundries) + { + map_center_agent = gAgent.getPosAgentFromGlobal(mParcelImageCenterGlobal) - camera_position; + map_center_agent.mV[VX] *= mScale / region_width; + map_center_agent.mV[VY] *= mScale / region_width; + + gGL.color4f(1.f, 1.f, 1.f, 1.f); + gGL.getTexUnit(0)->bind(mParcelImagep); + gGL.begin(LLRender::TRIANGLES); + gGL.texCoord2f(0.f, 1.f); + gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, image_half_height + map_center_agent.mV[VY]); + gGL.texCoord2f(0.f, 0.f); + gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, map_center_agent.mV[VY] - image_half_height); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex2f(image_half_width + map_center_agent.mV[VX], map_center_agent.mV[VY] - image_half_height); + + gGL.texCoord2f(0.f, 1.f); + gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, image_half_height + map_center_agent.mV[VY]); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex2f(image_half_width + map_center_agent.mV[VX], map_center_agent.mV[VY] - image_half_height); + gGL.texCoord2f(1.f, 1.f); + gGL.vertex2f(image_half_width + map_center_agent.mV[VX], image_half_height + map_center_agent.mV[VY]); + gGL.end(); + } + gGL.popUIMatrix(); // Mouse pointer in local coordinates @@ -511,10 +592,21 @@ void LLNetMap::draw() F32 ctr_x = center_to_region ? cam_pos.mV[VX] : (F32)center_sw_left; F32 ctr_y = center_to_region ? cam_pos.mV[VY] : (F32)center_sw_bottom; - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - const LLColor4& line_col = map_line_color.get(); + + if (map_chat_ring) + { + const F32 chat_radius = curregionp->getChatRange() * mPixelsPerMeter; + const F32 shout_radius = curregionp->getShoutRange() * mPixelsPerMeter; + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); + gGL.translatef(pos_map.mV[VX], pos_map.mV[VY], 0.f); + gl_ring(chat_radius, 1.2f, map_chat_ring_color, map_shout_ring_color, 128, FALSE); + gl_ring(shout_radius, 1.2f, map_chat_ring_color, map_shout_ring_color, 128, FALSE); + gGL.popMatrix(); + } + + const LLColor4& line_col = map_line_color.get(); if( rotate_map ) { gGL.color4fv((map_frustum_color()).mV); @@ -570,6 +662,7 @@ void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent) { LLUICtrl::reshape(width, height, called_from_parent); createObjectImage(); + createParcelImage(); } LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos) @@ -604,8 +697,7 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos) return pos_local; } -void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, - BOOL draw_arrow ) +void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, BOOL draw_arrow) { LLVector3 pos_local = globalPosToView(pos_global); if( (pos_local.mV[VX] < 0) || @@ -864,34 +956,151 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color, } } -void LLNetMap::createObjectImage() +void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* region, const LLColor4U& overlay_color) +{ + const S32 img_width = mParcelImagep->getWidth(); + const S32 img_height = mParcelImagep->getHeight(); + + const LLVector3 origin_local(region->getOriginGlobal() - mParcelImageCenterGlobal); + const S32 origin_x = ll_round(origin_local.mV[VX] * mObjectMapTPM + img_width / 2); + const S32 origin_y = ll_round(origin_local.mV[VY] * mObjectMapTPM + img_height / 2); + + U32* texture_data = reinterpret_cast<U32*>(mParcelRawImagep->getData()); + + // + // Draw the north and east region borders + // + const F32 real_width(region->getWidth()); + const S32 border_y = origin_y + ll_round(real_width * mObjectMapTPM); + if ( (border_y >= 0) && (border_y < img_height) ) + { + S32 cur_x = llclamp(origin_x, 0, img_width); + S32 end_x = llclamp(origin_x + ll_round(real_width * mObjectMapTPM), 0, img_width - 1); + for (; cur_x <= end_x; cur_x++) + texture_data[border_y * img_width + cur_x] = overlay_color.mAll; + } + const S32 border_x = origin_x + ll_round(real_width * mObjectMapTPM); + if ( (border_x >= 0) && (border_x < img_width) ) + { + S32 cur_y = llclamp(origin_y, 0, img_height); + S32 end_y = llclamp(origin_y + ll_round(real_width * mObjectMapTPM), 0, img_height - 1); + for (; cur_y <= end_y; cur_y++) + texture_data[cur_y * img_width + border_x] = overlay_color.mAll; + } + + // + // Render parcel lines + // + const F32 GRID_STEP = PARCEL_GRID_STEP_METERS; + const S32 GRIDS_PER_EDGE = real_width / GRID_STEP; + + const U8* ownership = region->getParcelOverlay()->getOwnership(); + const U8* collision = (region->getHandle() == LLViewerParcelMgr::instance().getCollisionRegionHandle()) ? LLViewerParcelMgr::instance().getCollisionBitmap() : NULL; + for (S32 idxRow = 0; idxRow < GRIDS_PER_EDGE; idxRow++) + { + for (S32 idxCol = 0; idxCol < GRIDS_PER_EDGE; idxCol++) + { + S32 overlay = ownership[idxRow * GRIDS_PER_EDGE + idxCol]; + S32 idx_collision = idxRow * GRIDS_PER_EDGE + idxCol; + bool for_sale = ((overlay & PARCEL_COLOR_MASK) == PARCEL_FOR_SALE); + bool auction = ((overlay & PARCEL_COLOR_MASK) == PARCEL_AUCTION); + bool collides = (collision) && (collision[idx_collision / 8] & (1 << (idx_collision % 8))); + if ( (!for_sale) && (!collides) && (!auction) && (0 == (overlay & (PARCEL_SOUTH_LINE | PARCEL_WEST_LINE))) ) + continue; + + const S32 pos_x = origin_x + ll_round(idxCol * GRID_STEP * mObjectMapTPM); + const S32 pos_y = origin_y + ll_round(idxRow * GRID_STEP * mObjectMapTPM); + + static LLCachedControl<bool> sShowForSaleParcels(gSavedSettings, "AlchemyMiniMapForSaleParcels", false); + static LLCachedControl<bool> sShowCollisionParcels(gSavedSettings, "AlchemyMiniMapCollisionParcels", false); + if ( ((sShowForSaleParcels) && (for_sale || auction)) || ((sShowCollisionParcels) && (collides)) ) + { + S32 cur_y = llclamp(pos_y, 0, img_height); + S32 end_y = llclamp(pos_y + ll_round(GRID_STEP * mObjectMapTPM), 0, img_height - 1); + for (; cur_y <= end_y; cur_y++) + { + S32 cur_x = llclamp(pos_x, 0, img_width); + S32 end_x = llclamp(pos_x + ll_round(GRID_STEP * mObjectMapTPM), 0, img_width - 1); + for (; cur_x <= end_x; cur_x++) + { + U32 texcolor = LLColor4U(255, 128, 128, 192).mAll; + if (for_sale) + { + texcolor = LLColor4U(255, 255, 128, 192).mAll; + } + else if (auction) + { + texcolor = LLColor4U(128, 0, 255, 102).mAll; + } + + texture_data[cur_y * img_width + cur_x] = texcolor; + } + } + } + if (overlay & PARCEL_SOUTH_LINE) + { + if ( (pos_y >= 0) && (pos_y < img_height) ) + { + S32 cur_x = llclamp(pos_x, 0, img_width); + S32 end_x = llclamp(pos_x + ll_round(GRID_STEP * mObjectMapTPM), 0, img_width - 1); + for (; cur_x <= end_x; cur_x++) + texture_data[pos_y * img_width + cur_x] = overlay_color.mAll; + } + } + if (overlay & PARCEL_WEST_LINE) + { + if ( (pos_x >= 0) && (pos_x < img_width) ) + { + S32 cur_y = llclamp(pos_y, 0, img_height); + S32 end_y = llclamp(pos_y + ll_round(GRID_STEP * mObjectMapTPM), 0, img_height - 1); + for (; cur_y <= end_y; cur_y++) + texture_data[cur_y * img_width + pos_x] = overlay_color.mAll; + } + } + } + } +} + +bool LLNetMap::createImage(LLPointer<LLImageRaw>& rawimagep) const { // Find the size of the side of a square that surrounds the circle that surrounds getRect(). // ... which is, the diagonal of the rect. - F32 width = (F32)getRect().getWidth(); - F32 height = (F32)getRect().getHeight(); + F32 width = getRect().getWidth(); + F32 height = getRect().getHeight(); S32 square_size = ll_round( sqrt(width*width + height*height) ); // Find the least power of two >= the minimum size. const S32 MIN_SIZE = 64; - const S32 MAX_SIZE = 256; + const S32 MAX_SIZE = 512; S32 img_size = MIN_SIZE; while( (img_size*2 < square_size ) && (img_size < MAX_SIZE) ) { img_size <<= 1; } - if( mObjectImagep.isNull() || - (mObjectImagep->getWidth() != img_size) || - (mObjectImagep->getHeight() != img_size) ) + if( rawimagep.isNull() || (rawimagep->getWidth() != img_size) || (rawimagep->getHeight() != img_size) ) { - mObjectRawImagep = new LLImageRaw(img_size, img_size, 4); - U8* data = mObjectRawImagep->getData(); - memset( data, 0, img_size * img_size * 4 ); - mObjectImagep = LLViewerTextureManager::getLocalTexture( mObjectRawImagep.get(), FALSE); + rawimagep = new LLImageRaw(img_size, img_size, 4); + U8* data = rawimagep->getData(); + memset(data, 0, img_size * img_size * 4); + return true; } - setScale(mScale); - mUpdateNow = true; + return false; +} + +void LLNetMap::createObjectImage() +{ + if (createImage(mObjectRawImagep)) + mObjectImagep = LLViewerTextureManager::getLocalTexture( mObjectRawImagep.get(), FALSE); + setScale(mScale); + mUpdateObjectImage = true; +} + +void LLNetMap::createParcelImage() +{ + if (createImage(mParcelRawImagep)) + mParcelImagep = LLViewerTextureManager::getLocalTexture( mParcelRawImagep.get(), FALSE); + mUpdateParcelImage = true; } BOOL LLNetMap::handleMouseDown( S32 x, S32 y, MASK mask ) @@ -1072,7 +1281,7 @@ void LLNetMap::handleZoom(const LLSD& userdata) } } -void LLNetMap::handleStopTracking (const LLSD& userdata) +void LLNetMap::handleStopTracking(const LLSD& userdata) { auto menu = static_cast<LLMenuGL*>(mPopupMenuHandle.get()); if (menu) diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 5471e40dd67df9035ad420b750b195eac1901967..cd1715e60188a4a0ae5f2094c14de26a0eff5f78 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -27,7 +27,6 @@ #ifndef LL_LLNETMAP_H #define LL_LLNETMAP_H -#include "llmath.h" #include "lluictrl.h" #include "v3math.h" #include "v3dmath.h" @@ -35,13 +34,12 @@ #include "llpointer.h" #include "llcoord.h" -#include <boost/unordered_map.hpp> - class LLColor4U; class LLImageRaw; class LLViewerTexture; class LLFloaterMap; class LLMenuGL; +class LLViewerRegion; class LLNetMap : public LLUICtrl { @@ -81,12 +79,14 @@ public: /*virtual*/ BOOL handleClick(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask ) override; + void refreshParcelOverlay() { mUpdateParcelImage = true; } + void setScale( F32 scale ); void setToolTipMsg(const std::string& msg) { mToolTipMsg = msg; } void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius ); private: - const LLVector3d& getObjectImageCenterGlobal() { return mObjectImageCenterGlobal; } + const LLVector3d& getObjectImageCenterGlobal() const { return mObjectImageCenterGlobal; } void renderPoint(const LLVector3 &pos, const LLColor4U &color, S32 diameter, S32 relative_height = 0); @@ -99,12 +99,18 @@ private: BOOL handleToolTipAgent(const LLUUID& avatar_id); static void showAvatarInspector(const LLUUID& avatar_id); + bool createImage(LLPointer<LLImageRaw>& rawimagep) const; void createObjectImage(); + void createParcelImage(); + void renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const LLColor4U& clrOverlay); + static bool outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y, S32 slop); private: bool mUpdateNow; + bool mUpdateObjectImage; + bool mUpdateParcelImage; LLUIColor mBackgroundColor; @@ -124,6 +130,13 @@ private: LLPointer<LLImageRaw> mObjectRawImagep; LLPointer<LLViewerTexture> mObjectImagep; + LLVector3d mParcelImageCenterGlobal; + LLPointer<LLImageRaw> mParcelRawImagep; + LLPointer<LLViewerTexture> mParcelImagep; + + boost::signals2::connection mParcelMgrConn; + boost::signals2::connection mParcelOverlayConn; + LLUUID mClosestAgentToCursor; LLUUID mClosestAgentAtLastRightClick; diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index c90c46ba1acae93f34e094c1d1a96f74dc67ff4a..fe170012ffc96d18db9cec10d518481809239416 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -31,7 +31,6 @@ #include "lloutfitgallery.h" // llcommon -#include "llcommonutils.h" #include "llvfile.h" #include "llaccordionctrltab.h" @@ -42,10 +41,10 @@ #include "llfloaterperms.h" #include "llfloaterreg.h" #include "llfloateroutfitsnapshot.h" +#include "llfloatertexturepicker.h" #include "llimagedimensionsinfo.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" -#include "lllocalbitmaps.h" #include "llnotificationsutil.h" #include "llpaneloutfitsinventory.h" #include "lltabcontainer.h" @@ -63,16 +62,15 @@ static LLPanelInjector<LLOutfitGallery> t_outfit_gallery("outfit_gallery"); LLOutfitGallery::LLOutfitGallery(const LLOutfitGallery::Params& p) : LLOutfitListBase(), - mTexturesObserver(NULL), - mOutfitsObserver(NULL), mScrollPanel(NULL), mGalleryPanel(NULL), - mGalleryCreated(false), - mRowCount(0), - mItemsAddedCount(0), mOutfitLinkPending(NULL), mOutfitRenamePending(NULL), mSnapshotFolderID(NULL), + mGalleryCreated(false), + mRowCount(0), + mItemsAddedCount(0), + mTextureSelected(NULL), mRowPanelHeight(p.row_panel_height), mVerticalGap(p.vertical_gap), mHorizontalGap(p.horizontal_gap), @@ -82,21 +80,22 @@ LLOutfitGallery::LLOutfitGallery(const LLOutfitGallery::Params& p) mItemsInRow(p.items_in_row), mRowPanWidthFactor(p.row_panel_width_factor), mGalleryWidthFactor(p.gallery_width_factor), - mTextureSelected(NULL) + mTexturesObserver(NULL), + mOutfitsObserver(NULL) { updateGalleryWidth(); } LLOutfitGallery::Params::Params() : row_panel_height("row_panel_height", 180), + row_panel_width_factor("row_panel_width_factor", 166), + gallery_width_factor("gallery_width_factor", 163), vertical_gap("vertical_gap", 10), horizontal_gap("horizontal_gap", 10), item_width("item_width", 150), item_height("item_height", 175), item_horizontal_gap("item_horizontal_gap", 16), - items_in_row("items_in_row", 3), - row_panel_width_factor("row_panel_width_factor", 166), - gallery_width_factor("gallery_width_factor", 163) + items_in_row("items_in_row", 3) { addSynonym(row_panel_height, "row_height"); } @@ -656,12 +655,12 @@ static LLDefaultChildRegistry::Register<LLOutfitGalleryItem> r("outfit_gallery_i LLOutfitGalleryItem::LLOutfitGalleryItem(const Params& p) : LLPanel(p), mTexturep(NULL), - mIconPreviewOutfit(nullptr), + mUUID(LLUUID()), + mIconPreviewOutfit(nullptr), mSelected(false), mWorn(false), mDefaultImage(true), - mOutfitName(""), - mUUID(LLUUID()) + mOutfitName("") { buildFromFile("panel_outfit_gallery_item.xml"); } diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 41ce0f0db9c9bde4b0026719c622e1896ead5df0..15c3104c0e1c9feacd5d364b0c6a8c668c4d5d3f 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -94,11 +94,11 @@ public: class LLPanelFace : public LLPanel { public: - virtual BOOL postBuild(); + BOOL postBuild() override; LLPanelFace(); virtual ~LLPanelFace(); - void refresh(); + void refresh() override; LLMaterialPtr createDefaultMaterial(LLMaterialPtr current_material) { @@ -229,9 +229,10 @@ private: LLMaterialEditFunctor< DataType, SetValueType, MaterialEditFunc > edit(data); struct LLSelectedTEEditMaterial : public LLSelectedTEMaterialFunctor { - LLSelectedTEEditMaterial(LLPanelFace* panel, LLMaterialEditFunctor< DataType, SetValueType, MaterialEditFunc >* editp) : _panel(panel), _edit(editp) {} + LLSelectedTEEditMaterial(LLPanelFace* panel, LLMaterialEditFunctor< DataType, SetValueType, MaterialEditFunc >* editp) : _edit(editp), _panel(panel) {} virtual ~LLSelectedTEEditMaterial() {}; - virtual LLMaterialPtr apply(LLViewerObject* object, S32 face, LLTextureEntry* tep, LLMaterialPtr& current_material) + + LLMaterialPtr apply(LLViewerObject* object, S32 face, LLTextureEntry* tep, LLMaterialPtr& current_material) override { if (_edit) { @@ -314,7 +315,7 @@ private: GetTEMaterialVal(DataType default_value) : _default(default_value) {} virtual ~GetTEMaterialVal() {} - DataType get(LLViewerObject* object, S32 face) + DataType get(LLViewerObject* object, S32 face) override { DataType ret = _default; LLMaterialPtr material_ptr; @@ -347,7 +348,8 @@ private: GetTEVal(DataType default_value) : _default(default_value) {} virtual ~GetTEVal() {} - DataType get(LLViewerObject* object, S32 face) { + DataType get(LLViewerObject* object, S32 face) override + { LLTextureEntry* tep = object ? object->getTE(face) : NULL; return tep ? ((tep->*(TEGetFunc))()) : _default; } diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index f1cf5e56191b7767666548b09adbffc244b553d6..843c90d6472c988048d93cce5ef9297dd47ea6d1 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -95,11 +95,11 @@ public: // // LLView functionality - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, - std::string& tooltip_msg); + std::string& tooltip_msg) override; void setPanel (LLPanelGroupNotices* panel) {mGroupNoticesPanel = panel;}; void setGroup (LLUUID group) {mGroupID = group;}; diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 2263848c92377b6cda5b40d460a9ffd43913f0cf..e555110bed932342aa47a0ca1c1b43cabe403cc1 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -429,9 +429,9 @@ void LLPanelGroupRoles::setGroupID(const LLUUID& id) LLPanelGroupSubTab::LLPanelGroupSubTab() : LLPanelGroupTab(), mFooter(NULL), + mSearchEditor(NULL), mActivated(false), - mHasGroupBanPower(false), - mSearchEditor(NULL) + mHasGroupBanPower(false) { } @@ -1938,6 +1938,7 @@ static LLPanelInjector<LLPanelGroupRolesSubTab> t_panel_group_roles_subtab("pane LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab() : LLPanelGroupSubTab(), + mFirstOpen(TRUE), mRolesList(NULL), mAssignedMembersList(NULL), mAllowedActionsList(NULL), @@ -1947,7 +1948,6 @@ LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab() mMemberVisibleCheck(NULL), mDeleteRoleButton(NULL), mCreateRoleButton(NULL), - mFirstOpen(TRUE), mHasRoleChange(FALSE) { } diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 93cf559537c680543f4ef1db043c91e918896af3..4501656715d447d82b29c31fbc89f8f99e5113f2 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -203,8 +203,8 @@ void LLPanelLogin::addFavoritesToStartLocation() // Clear the combo. auto combo = getChild<LLComboBox>("start_location_combo"); if (!combo) return; - int num_items = combo->getItemCount(); - for (int i = num_items - 1; i > 2; i--) + S32 num_items = combo->getItemCount(); + for (S32 i = num_items - 1; i > 2; i--) { combo->remove(i); } diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index b83847082389fe9af74c55643854e52a9490a70b..29f8613bc4a462eda397bad3f8f75e4b98688276 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -63,14 +63,14 @@ LLPreview::LLPreview(const LLSD& key) : LLFloater(key), mDirty(TRUE), - mItemUUID(key.has("itemid") ? key.get("itemid").asUUID() : key.asUUID()), // set later by setObjectID() + mSaveDialogShown(FALSE), // set later by setObjectID() + mItemUUID(key.has("itemid") ? key.get("itemid").asUUID() : key.asUUID()), mObjectUUID(), mCopyToInvBtn(nullptr ), mForceClose(FALSE), mUserResized(FALSE), mCloseAfterSave(FALSE), - mAssetStatus(PREVIEW_ASSET_UNLOADED), - mSaveDialogShown(FALSE) + mAssetStatus(PREVIEW_ASSET_UNLOADED) { mAuxItem = new LLInventoryItem; // don't necessarily steal focus on creation -- sometimes these guys pop up without user action diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 828568d681c3278806447de1c6f0b1e4593b3e0c..936f5e2bebb0c5ef81e3c26c8360134a85289652 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -69,7 +69,7 @@ public: LLInventoryGestureAvailable() {} protected: - virtual void done(); + void done() override; }; void LLInventoryGestureAvailable::done() @@ -1103,7 +1103,7 @@ void LLPreviewGesture::saveIfNeeded() const LLViewerRegion* region = gAgent.getRegion(); if (!region) { - LL_WARNS() << "Not connected to a region, cannot save notecard." << LL_ENDL; + LL_WARNS() << "Not connected to a region, cannot save gesture." << LL_ENDL; delete gesture; gesture = NULL; return; @@ -1125,13 +1125,18 @@ void LLPreviewGesture::saveIfNeeded() refresh(); item->setComplete(true); - uploadInfo = LLResourceUploadInfo::ptr_t(new LLBufferedAssetUploadInfo(mItemUUID, LLAssetType::AT_GESTURE, buffer.get(), - boost::bind(&LLPreviewGesture::finishInventoryUpload, _1, _2))); + uploadInfo = boost::static_pointer_cast<LLResourceUploadInfo>( + boost::make_shared<LLBufferedAssetUploadInfo>(mItemUUID, LLAssetType::AT_GESTURE, buffer.get(), + boost::bind( + &LLPreviewGesture::finishInventoryUpload, _1, + _2))); url = agent_url; } else if (!mObjectUUID.isNull() && !task_url.empty()) { - uploadInfo = LLResourceUploadInfo::ptr_t(new LLBufferedAssetUploadInfo(mObjectUUID, mItemUUID, LLAssetType::AT_GESTURE, buffer.get(), NULL)); + uploadInfo = boost::static_pointer_cast<LLResourceUploadInfo>( + boost::make_shared<LLBufferedAssetUploadInfo>(mObjectUUID, mItemUUID, LLAssetType::AT_GESTURE, + buffer.get(), nullptr)); url = task_url; } diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 73ae6b897f398ba17c0b0a21f5fd6513cccd0eec..d1debd4f5f2c1b71e8d715de87c792e5e009a7a0 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -131,16 +131,16 @@ public: void ignoreNextUpdate() { mIgnoreNextUpdate = true; } protected: - /*virtual*/ bool loadFile(); + /*virtual*/ bool loadFile() override; change_callback_t mOnChangeCallback; bool mIgnoreNextUpdate; }; LLLiveLSLFile::LLLiveLSLFile(std::string file_path, change_callback_t change_cb) -: mOnChangeCallback(change_cb) +: LLLiveFile(file_path, 1.0) +, mOnChangeCallback(change_cb) , mIgnoreNextUpdate(false) -, LLLiveFile(file_path, 1.0) { llassert(mOnChangeCallback); } @@ -367,6 +367,7 @@ LLScriptEdCore::LLScriptEdCore( S32 bottom_pad) : LLPanel(), + mLive(live), mSampleText(sample), mEditor( NULL ), mLoadCallback( load_callback ), @@ -377,12 +378,11 @@ LLScriptEdCore::LLScriptEdCore( mLastHelpToken(NULL), mLiveHelpHistorySize(0), mEnableSave(FALSE), - mLiveFile(NULL), - mLive(live), - mContainer(container), mHasScriptData(FALSE), + mLiveFile(NULL), mScriptRemoved(FALSE), - mSaveDialogShown(FALSE) + mSaveDialogShown(FALSE), + mContainer(container) { setFollows(FOLLOWS_ALL); setBorderVisible(FALSE); @@ -1839,13 +1839,13 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata) LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) : LLScriptEdContainer(key), + mIsNew(false), mAskedForRunningInfo(FALSE), mHaveRunningInfo(FALSE), mCloseAfterSave(FALSE), mPendingUploads(0), - mIsModifiable(FALSE), - mIsNew(false), - mIsSaving(FALSE) + mIsSaving(FALSE), + mIsModifiable(FALSE) { mFactoryMap["script ed panel"] = LLCallbackMap(LLLiveLSLEditor::createScriptEdPanel, this); } diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index da64d33f0b371d2169aefd2cf84e9a5d8b16fd65..8e2fb26cb99e43dda157a69691bf0c83978080a7 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -68,18 +68,18 @@ const F32 PREVIEW_TEXTURE_MIN_ASPECT = 0.005f; LLPreviewTexture::LLPreviewTexture(const LLSD& key) : LLPreview(key), + mImage(NULL), + mImageOldBoostLevel(LLGLTexture::BOOST_NONE), mLoadingFullImage( FALSE ), mShowKeepDiscard(FALSE), mCopyToInv(FALSE), + mPreviewToSave(FALSE), mIsCopyable(FALSE), mIsFullPerm(FALSE), mUpdateDimensions(TRUE), mLastHeight(0), mLastWidth(0), - mAspectRatio(0.f), - mPreviewToSave(FALSE), - mImage(NULL), - mImageOldBoostLevel(LLGLTexture::BOOST_NONE) + mAspectRatio(0.f) { updateImageID(); if (key.has("save_as")) diff --git a/indra/newview/llsechandler_basic.h b/indra/newview/llsechandler_basic.h index e0af5cc785d03893165c4516f1d9fa65f6ff31aa..93fc6c77ae9156046d93e185e24dbdd27f3a40ab 100644 --- a/indra/newview/llsechandler_basic.h +++ b/indra/newview/llsechandler_basic.h @@ -96,11 +96,11 @@ public: { if(incr) { - mIter++; + ++mIter; } else { - mIter--; + --mIter; } } // create a copy of the iterator implementation class, used by the iterator copy constructor diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 61eb159ae24097468c0f8db14b1ef29ecdcff9b9..3cc8b5a610641c30e0e018393fe2b6edf76f1661 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -241,7 +241,7 @@ void LLSelectMgr::updateEffects() //keep reference grid objects active struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { LLDrawable* drawable = object->mDrawable; if (drawable) @@ -265,7 +265,7 @@ void LLSelectMgr::overrideObjectUpdates() //override any position updates from simulator on objects being edited struct f : public LLSelectedNodeFunctor { - virtual bool apply(LLSelectNode* selectNode) + bool apply(LLSelectNode* selectNode) override { LLViewerObject* object = selectNode->getObject(); if (object && object->permMove() && !object->isPermanentEnforced()) @@ -641,7 +641,7 @@ bool LLSelectMgr::enableLinkObjects() { struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { LLViewerObject *root_object = (object == NULL) ? NULL : object->getRootEdit(); return object->permModify() && !object->isPermanentEnforced() && @@ -1524,7 +1524,7 @@ void LLSelectMgr::cleanup() struct LLSelectMgrSendFunctor : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -1599,7 +1599,7 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid) LLViewerInventoryItem* mItem; LLUUID mImageID; f(LLViewerInventoryItem* item, const LLUUID& id) : mItem(item), mImageID(id) {} - bool apply(LLViewerObject* objectp, S32 te) + bool apply(LLViewerObject* objectp, S32 te) override { if(objectp && !objectp->permModify()) { @@ -1649,7 +1649,8 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid) { LLViewerInventoryItem* mItem; g(LLViewerInventoryItem* item) : mItem(item) {} - virtual bool apply(LLViewerObject* object) + + bool apply(LLViewerObject* object) override { if (!mItem) { @@ -1679,7 +1680,7 @@ void LLSelectMgr::selectionSetColor(const LLColor4 &color) { LLColor4 mColor; f(const LLColor4& c) : mColor(c) {} - bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->permModify()) { @@ -1703,7 +1704,7 @@ void LLSelectMgr::selectionSetColorOnly(const LLColor4 &color) { LLColor4 mColor; f(const LLColor4& c) : mColor(c) {} - bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->permModify()) { @@ -1730,7 +1731,7 @@ void LLSelectMgr::selectionSetAlphaOnly(const F32 alpha) { F32 mAlpha; f(const F32& a) : mAlpha(a) {} - bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->permModify()) { @@ -1754,7 +1755,7 @@ void LLSelectMgr::selectionRevertColors() { LLObjectSelectionHandle mSelectedObjects; f(LLObjectSelectionHandle sel) : mSelectedObjects(sel) {} - bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->permModify()) { @@ -1781,7 +1782,7 @@ void LLSelectMgr::selectionRevertShinyColors() { LLObjectSelectionHandle mSelectedObjects; f(LLObjectSelectionHandle sel) : mSelectedObjects(sel) {} - bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->permModify()) { @@ -1815,7 +1816,7 @@ BOOL LLSelectMgr::selectionRevertTextures() { LLObjectSelectionHandle mSelectedObjects; f(LLObjectSelectionHandle sel) : mSelectedObjects(sel) {} - bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->permModify()) { @@ -1852,7 +1853,7 @@ void LLSelectMgr::selectionSetBumpmap(U8 bumpmap) { U8 mBump; f(const U8& b) : mBump(b) {} - bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->permModify()) { @@ -1874,7 +1875,7 @@ void LLSelectMgr::selectionSetTexGen(U8 texgen) { U8 mTexgen; f(const U8& t) : mTexgen(t) {} - bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->permModify()) { @@ -1897,7 +1898,7 @@ void LLSelectMgr::selectionSetShiny(U8 shiny) { U8 mShiny; f(const U8& t) : mShiny(t) {} - bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->permModify()) { @@ -1919,7 +1920,7 @@ void LLSelectMgr::selectionSetFullbright(U8 fullbright) { U8 mFullbright; f(const U8& t) : mFullbright(t) {} - bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->permModify()) { @@ -1935,7 +1936,8 @@ void LLSelectMgr::selectionSetFullbright(U8 fullbright) { U8 mFullbright; g(const U8& t) : mFullbright(t) {} - virtual bool apply(LLViewerObject* object) + + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -1968,7 +1970,7 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data) U8 mMediaFlags; const LLSD &mMediaData; f(const U8& t, const LLSD& d) : mMediaFlags(t), mMediaData(d) {} - bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->permModify()) { @@ -2012,7 +2014,7 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data) struct f2 : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -2040,7 +2042,7 @@ void LLSelectMgr::selectionSetGlow(F32 glow) { F32 mGlow; f1(F32 glow) : mGlow(glow) {}; - bool apply(LLViewerObject* object, S32 face) + bool apply(LLViewerObject* object, S32 face) override { if (object->permModify()) { @@ -2054,7 +2056,7 @@ void LLSelectMgr::selectionSetGlow(F32 glow) struct f2 : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -2073,7 +2075,7 @@ void LLSelectMgr::selectionSetMaterialParams(LLSelectedTEMaterialFunctor* materi LLMaterialPtr mMaterial; f1(LLSelectedTEMaterialFunctor* material_func) : _material_func(material_func) {} - bool apply(LLViewerObject* object, S32 face) + bool apply(LLViewerObject* object, S32 face) override { if (object && object->permModify() && _material_func) { @@ -2093,7 +2095,7 @@ void LLSelectMgr::selectionSetMaterialParams(LLSelectedTEMaterialFunctor* materi struct f2 : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -2109,7 +2111,7 @@ void LLSelectMgr::selectionRemoveMaterial() { struct f1 : public LLSelectedTEFunctor { - bool apply(LLViewerObject* object, S32 face) + bool apply(LLViewerObject* object, S32 face) override { if (object->permModify()) { @@ -2124,7 +2126,7 @@ void LLSelectMgr::selectionRemoveMaterial() struct f2 : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -2165,7 +2167,7 @@ BOOL LLSelectMgr::selectionGetGlow(F32 *glow) F32 lglow = 0.f; struct f1 : public LLSelectedTEGetFunctor<F32> { - F32 get(LLViewerObject* object, S32 face) + F32 get(LLViewerObject* object, S32 face) override { return object->getTE(face)->getGlow(); } @@ -2183,7 +2185,8 @@ void LLSelectMgr::selectionSetPhysicsType(U8 type) { U8 mType; f(const U8& t) : mType(t) {} - virtual bool apply(LLViewerObject* object) + + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -2202,7 +2205,8 @@ void LLSelectMgr::selectionSetFriction(F32 friction) { F32 mFriction; f(const F32& friction) : mFriction(friction) {} - virtual bool apply(LLViewerObject* object) + + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -2221,7 +2225,8 @@ void LLSelectMgr::selectionSetGravity(F32 gravity ) { F32 mGravity; f(const F32& gravity) : mGravity(gravity) {} - virtual bool apply(LLViewerObject* object) + + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -2240,7 +2245,8 @@ void LLSelectMgr::selectionSetDensity(F32 density ) { F32 mDensity; f(const F32& density ) : mDensity(density) {} - virtual bool apply(LLViewerObject* object) + + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -2259,7 +2265,8 @@ void LLSelectMgr::selectionSetRestitution(F32 restitution) { F32 mRestitution; f(const F32& restitution ) : mRestitution(restitution) {} - virtual bool apply(LLViewerObject* object) + + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -2282,7 +2289,8 @@ void LLSelectMgr::selectionSetMaterial(U8 material) { U8 mMaterial; f(const U8& t) : mMaterial(t) {} - virtual bool apply(LLViewerObject* object) + + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -2304,7 +2312,8 @@ BOOL LLSelectMgr::selectionAllPCode(LLPCode code) { LLPCode mCode; f(const LLPCode& t) : mCode(t) {} - virtual bool apply(LLViewerObject* object) + + bool apply(LLViewerObject* object) override { if (object->getPCode() != mCode) { @@ -2375,7 +2384,8 @@ BOOL LLSelectMgr::selectionGetClickAction(U8 *out_action) { U8 mAction; f(const U8& t) : mAction(t) {} - virtual bool apply(LLViewerObject* object) + + bool apply(LLViewerObject* object) override { if ( mAction != object->getClickAction()) { @@ -2394,7 +2404,8 @@ void LLSelectMgr::selectionSetClickAction(U8 action) { U8 mAction; f(const U8& t) : mAction(t) {} - virtual bool apply(LLViewerObject* object) + + bool apply(LLViewerObject* object) override { object->setClickAction(mAction); return true; @@ -2503,7 +2514,7 @@ void LLSelectMgr::selectionTexScaleAutofit(F32 repeats_per_meter) { F32 mRepeatsPerMeter; f(const F32& t) : mRepeatsPerMeter(t) {} - bool apply(LLViewerObject* object, S32 te) + bool apply(LLViewerObject* object, S32 te) override { if (object->permModify()) @@ -3242,7 +3253,7 @@ boost::signals2::connection LLSelectMgr::addSelectionUpdateCallback(const update struct LLSelectGetFirstCreator : public LLSelectGetFirstTest { protected: - virtual const LLUUID& getValueFromNode(LLSelectNode* node) + const LLUUID& getValueFromNode(LLSelectNode* node) override { return node->mPermissions->getCreator(); } @@ -3280,7 +3291,7 @@ BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name) struct LLSelectGetFirstOwner : public LLSelectGetFirstTest { protected: - virtual const LLUUID& getValueFromNode(LLSelectNode* node) + const LLUUID& getValueFromNode(LLSelectNode* node) override { // Don't use 'getOwnership' since we return a reference, not a copy. // Will return LLUUID::null if unowned (which is not allowed and should never happen.) @@ -3327,7 +3338,7 @@ BOOL LLSelectMgr::selectGetOwner(LLUUID& result_id, std::string& name) struct LLSelectGetFirstLastOwner : public LLSelectGetFirstTest { protected: - virtual const LLUUID& getValueFromNode(LLSelectNode* node) + const LLUUID& getValueFromNode(LLSelectNode* node) override { return node->mPermissions->getLastOwner(); } @@ -3364,7 +3375,7 @@ BOOL LLSelectMgr::selectGetLastOwner(LLUUID& result_id, std::string& name) struct LLSelectGetFirstGroup : public LLSelectGetFirstTest { protected: - virtual const LLUUID& getValueFromNode(LLSelectNode* node) + const LLUUID& getValueFromNode(LLSelectNode* node) override { return node->mPermissions->getGroup(); } @@ -3387,7 +3398,7 @@ BOOL LLSelectMgr::selectGetGroup(LLUUID& result_id) struct LLSelectGetFirstGroupOwner : public LLSelectGetFirstTest { protected: - virtual const LLUUID& getValueFromNode(LLSelectNode* node) + const LLUUID& getValueFromNode(LLSelectNode* node) override { if (node->mPermissions->isGroupOwned()) { @@ -4513,7 +4524,7 @@ void LLSelectMgr::sendDelink() { //on delink, any modifyable object should f() {} - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { if (object->permModify()) { @@ -4610,7 +4621,7 @@ void LLSelectMgr::selectionDump() { struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { object->dump(); return true; @@ -4623,7 +4634,7 @@ void LLSelectMgr::saveSelectedObjectColors() { struct f : public LLSelectedNodeFunctor { - virtual bool apply(LLSelectNode* node) + bool apply(LLSelectNode* node) override { node->saveColors(); return true; @@ -4636,7 +4647,7 @@ void LLSelectMgr::saveSelectedShinyColors() { struct f : public LLSelectedNodeFunctor { - virtual bool apply(LLSelectNode* node) + bool apply(LLSelectNode* node) override { node->saveShinyColors(); return true; @@ -4650,7 +4661,7 @@ void LLSelectMgr::saveSelectedObjectTextures() // invalidate current selection so we update saved textures struct f : public LLSelectedNodeFunctor { - virtual bool apply(LLSelectNode* node) + bool apply(LLSelectNode* node) override { node->mValid = FALSE; return true; @@ -4678,7 +4689,8 @@ void LLSelectMgr::saveSelectedObjectTransform(EActionType action_type) EActionType mActionType; LLSelectMgr* mManager; f(EActionType a, LLSelectMgr* p) : mActionType(a), mManager(p) {} - virtual bool apply(LLSelectNode* selectNode) + + bool apply(LLSelectNode* selectNode) override { LLViewerObject* object = selectNode->getObject(); if (!object) @@ -4738,7 +4750,8 @@ struct LLSelectMgrApplyFlags : public LLSelectedObjectFunctor LLSelectMgrApplyFlags(U32 flags, BOOL state) : mFlags(flags), mState(state) {} U32 mFlags; BOOL mState; - virtual bool apply(LLViewerObject* object) + + bool apply(LLViewerObject* object) override { if ( object->permModify()) { @@ -5015,7 +5028,7 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name, //clear update override data (allow next update through) struct f : public LLSelectedNodeFunctor { - virtual bool apply(LLSelectNode* node) + bool apply(LLSelectNode* node) override { node->mLastPositionLocal.setVec(0,0,0); node->mLastRotation = LLQuaternion(); @@ -5031,7 +5044,8 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name, { std::queue<LLSelectNode*>& nodes_to_send; push_all(std::queue<LLSelectNode*>& n) : nodes_to_send(n) {} - virtual bool apply(LLSelectNode* node) + + bool apply(LLSelectNode* node) override { if (node->getObject()) { @@ -5045,7 +5059,8 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name, std::queue<LLSelectNode*>& nodes_to_send; bool mRoots; push_some(std::queue<LLSelectNode*>& n, bool roots) : nodes_to_send(n), mRoots(roots) {} - virtual bool apply(LLSelectNode* node) + + bool apply(LLSelectNode* node) override { if (node->getObject()) { @@ -5294,7 +5309,8 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data { LLUUID mID; f(const LLUUID& id) : mID(id) {} - virtual bool apply(LLSelectNode* node) + + bool apply(LLSelectNode* node) override { return (node->getObject() && node->getObject()->mID == mID); } @@ -5438,7 +5454,8 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use { LLUUID mID; f(const LLUUID& id) : mID(id) {} - virtual bool apply(LLSelectNode* node) + + bool apply(LLSelectNode* node) override { return (node->getObject() && node->getObject()->mID == mID); } @@ -5516,7 +5533,7 @@ void LLSelectMgr::updateSilhouettes() { struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { object->setChanged(LLXform::SILHOUETTE); return true; @@ -5924,21 +5941,21 @@ void LLSelectMgr::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_ // Utility classes // LLSelectNode::LLSelectNode(LLViewerObject* object, BOOL glow) -: mObject(object), - mIndividualSelection(FALSE), +: mIndividualSelection(FALSE), mTransient(FALSE), mValid(FALSE), mPermissions(new LLPermissions()), - mInventorySerial(0), - mSilhouetteExists(FALSE), - mDuplicated(FALSE), - mTESelectMask(0), - mLastTESelected(0), mName(LLStringUtil::null), mDescription(LLStringUtil::null), + mInventorySerial(0), + mDuplicated(FALSE), mTouchName(LLStringUtil::null), mSitName(LLStringUtil::null), - mCreationDate(0) + mCreationDate(0), + mSilhouetteExists(FALSE), + mObject(object), + mTESelectMask(0), + mLastTESelected(0) { saveColors(); saveShinyColors(); @@ -6908,7 +6925,7 @@ void LLSelectMgr::validateSelection() { struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* object) + bool apply(LLViewerObject* object) override { if (!LLSelectMgr::getInstance()->canSelectObject(object)) { @@ -7628,7 +7645,7 @@ LLSelectNode* LLObjectSelection::getFirstMoveableNode(BOOL get_root_first) { struct f : public LLSelectedNodeFunctor { - bool apply(LLSelectNode* node) + bool apply(LLSelectNode* node) override { LLViewerObject* obj = node->getObject(); return obj && obj->permMove() && !obj->isPermanentEnforced(); @@ -7645,7 +7662,7 @@ LLViewerObject* LLObjectSelection::getFirstCopyableObject(BOOL get_parent) { struct f : public LLSelectedNodeFunctor { - bool apply(LLSelectNode* node) + bool apply(LLSelectNode* node) override { LLViewerObject* obj = node->getObject(); return obj && obj->permCopy() && !obj->isAttachment(); @@ -7664,7 +7681,7 @@ LLViewerObject* LLObjectSelection::getFirstDeleteableObject() struct f : public LLSelectedNodeFunctor { - bool apply(LLSelectNode* node) + bool apply(LLSelectNode* node) override { LLViewerObject* obj = node->getObject(); // you can delete an object if you are the owner @@ -7693,7 +7710,7 @@ LLViewerObject* LLObjectSelection::getFirstEditableObject(BOOL get_parent) { struct f : public LLSelectedNodeFunctor { - bool apply(LLSelectNode* node) + bool apply(LLSelectNode* node) override { LLViewerObject* obj = node->getObject(); return obj && obj->permModify(); @@ -7709,7 +7726,7 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent) { struct f : public LLSelectedNodeFunctor { - bool apply(LLSelectNode* node) + bool apply(LLSelectNode* node) override { LLViewerObject* obj = node->getObject(); return obj && obj->permMove() && !obj->isPermanentEnforced(); @@ -7725,7 +7742,7 @@ LLViewerObject* LLObjectSelection::getFirstUndoEnabledObject(BOOL get_parent) { struct f : public LLSelectedNodeFunctor { - bool apply(LLSelectNode* node) + bool apply(LLSelectNode* node) override { LLViewerObject* obj = node->getObject(); return obj && (obj->permModify() || (obj->permMove() && !obj->isPermanentEnforced())); diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 9b51e6c0f68ee550d8bc98825da1c143f71b579d..176b87c7d4fdd7409715413c4944af697c9096b1 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -75,16 +75,19 @@ std::set<LLSnapshotLivePreview*> LLSnapshotLivePreview::sList; LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Params& p) : LLView(p), - mColor(1.f, 0.f, 0.f, 0.5f), - mCurImageIndex(0), + mViewContainer(NULL), + mColor(1.f, 0.f, 0.f, 0.5f), + mThumbnailImage(NULL), + mThumbnailWidth(0) , + mThumbnailHeight(0) , + mThumbnailSubsampled(FALSE), + mBigThumbnailImage(NULL), + mCurImageIndex(0), mPreviewImage(NULL), - mThumbnailImage(NULL) , - mBigThumbnailImage(NULL) , - mThumbnailWidth(0), - mThumbnailHeight(0), - mThumbnailSubsampled(FALSE), mPreviewImageEncoded(NULL), mFormattedImage(NULL), + mAllowRenderUI(TRUE), + mAllowFullScreenPreview(TRUE), mShineCountdown(0), mFlashAlpha(0.f), mNeedsFlash(TRUE), @@ -94,13 +97,10 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Param mSnapshotFormat(LLSnapshotModel::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat"))), mSnapshotUpToDate(FALSE), mCameraPos(LLViewerCamera::getInstance()->getOrigin()), - mCameraRot(LLViewerCamera::getInstance()->getQuaternion()), - mSnapshotActive(FALSE), - mSnapshotBufferType(LLSnapshotModel::SNAPSHOT_TYPE_COLOR), - mFilterName(""), - mAllowRenderUI(TRUE), - mAllowFullScreenPreview(TRUE), - mViewContainer(NULL) + mCameraRot(LLViewerCamera::getInstance()->getQuaternion()), + mSnapshotActive(FALSE), + mSnapshotBufferType(LLSnapshotModel::SNAPSHOT_TYPE_COLOR), + mFilterName("") { setSnapshotQuality(gSavedSettings.getS32("SnapshotQuality")); mSnapshotDelayTimer.setTimerExpirySec(0.0f); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 62bdcea217836436d44770e947a3f53c593879e2..53291e8a814e312716b791f7e2ad4de1c4b220b2 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -448,7 +448,7 @@ class LLSpatialSetState : public OctreeTraveler public: U32 mState; LLSpatialSetState(U32 state) : mState(state) { } - virtual void visit(const OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->setState(mState); } + void visit(const OctreeNode* branch) override { ((LLSpatialGroup*) branch->getListener(0))->setState(mState); } }; class LLSpatialSetStateDiff : public LLSpatialSetState @@ -456,7 +456,7 @@ class LLSpatialSetStateDiff : public LLSpatialSetState public: LLSpatialSetStateDiff(U32 state) : LLSpatialSetState(state) { } - virtual void traverse(const OctreeNode* n) + void traverse(const OctreeNode* n) override { LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0); @@ -495,7 +495,7 @@ class LLSpatialClearState : public OctreeTraveler public: U32 mState; LLSpatialClearState(U32 state) : mState(state) { } - virtual void visit(const OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->clearState(mState); } + void visit(const OctreeNode* branch) override { ((LLSpatialGroup*) branch->getListener(0))->clearState(mState); } }; class LLSpatialClearStateDiff : public LLSpatialClearState @@ -503,7 +503,7 @@ class LLSpatialClearStateDiff : public LLSpatialClearState public: LLSpatialClearStateDiff(U32 state) : LLSpatialClearState(state) { } - virtual void traverse(const OctreeNode* n) + void traverse(const OctreeNode* n) override { LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0); @@ -822,7 +822,7 @@ void LLSpatialGroup::destroyGL(bool keep_occlusion) //============================================== LLSpatialPartition::LLSpatialPartition(U32 data_mask, BOOL render_by_group, U32 buffer_usage, LLViewerRegion* regionp) -: mRenderByGroup(render_by_group), mBridge(NULL) +: mBridge(NULL), mRenderByGroup(render_by_group) { mRegionp = regionp; mPartitionType = LLViewerRegion::PARTITION_NONE; @@ -931,7 +931,8 @@ public: const LLVector4a& mOffset; LLSpatialShift(const LLVector4a& offset) : mOffset(offset) { } - virtual void visit(const OctreeNode* branch) + + void visit(const OctreeNode* branch) override { ((LLSpatialGroup*) branch->getListener(0))->shift(mOffset); } @@ -948,7 +949,7 @@ class LLOctreeCull : public LLViewerOctreeCull public: LLOctreeCull(LLCamera* camera) : LLViewerOctreeCull(camera) {} - virtual bool earlyFail(LLViewerOctreeGroup* base_group) + bool earlyFail(LLViewerOctreeGroup* base_group) override { LLSpatialGroup* group = (LLSpatialGroup*)base_group; group->checkOcclusion(); @@ -963,8 +964,8 @@ public: return false; } - - virtual S32 frustumCheck(const LLViewerOctreeGroup* group) + + S32 frustumCheck(const LLViewerOctreeGroup* group) override { S32 res = AABBInFrustumNoFarClipGroupBounds(group); if (res != 0) @@ -974,7 +975,7 @@ public: return res; } - virtual S32 frustumCheckObjects(const LLViewerOctreeGroup* group) + S32 frustumCheckObjects(const LLViewerOctreeGroup* group) override { S32 res = AABBInFrustumNoFarClipObjectBounds(group); if (res != 0) @@ -984,7 +985,7 @@ public: return res; } - virtual void processGroup(LLViewerOctreeGroup* base_group) + void processGroup(LLViewerOctreeGroup* base_group) override { LLSpatialGroup* group = (LLSpatialGroup*)base_group; if (group->needsUpdate() || @@ -1002,12 +1003,12 @@ public: LLOctreeCullNoFarClip(LLCamera* camera) : LLOctreeCull(camera) { } - virtual S32 frustumCheck(const LLViewerOctreeGroup* group) + S32 frustumCheck(const LLViewerOctreeGroup* group) override { return AABBInFrustumNoFarClipGroupBounds(group); } - virtual S32 frustumCheckObjects(const LLViewerOctreeGroup* group) + S32 frustumCheckObjects(const LLViewerOctreeGroup* group) override { S32 res = AABBInFrustumNoFarClipObjectBounds(group); return res; @@ -1020,12 +1021,12 @@ public: LLOctreeCullShadow(LLCamera* camera) : LLOctreeCull(camera) { } - virtual S32 frustumCheck(const LLViewerOctreeGroup* group) + S32 frustumCheck(const LLViewerOctreeGroup* group) override { return AABBInFrustumGroupBounds(group); } - virtual S32 frustumCheckObjects(const LLViewerOctreeGroup* group) + S32 frustumCheckObjects(const LLViewerOctreeGroup* group) override { return AABBInFrustumObjectBounds(group); } @@ -1035,9 +1036,9 @@ class LLOctreeCullVisExtents: public LLOctreeCullShadow { public: LLOctreeCullVisExtents(LLCamera* camera, LLVector4a& min, LLVector4a& max) - : LLOctreeCullShadow(camera), mMin(min), mMax(max), mEmpty(TRUE) { } + : LLOctreeCullShadow(camera), mEmpty(TRUE), mMin(min), mMax(max) { } - virtual bool earlyFail(LLViewerOctreeGroup* base_group) + bool earlyFail(LLViewerOctreeGroup* base_group) override { LLSpatialGroup* group = (LLSpatialGroup*)base_group; @@ -1051,7 +1052,7 @@ public: return false; } - virtual void traverse(const OctreeNode* n) + void traverse(const OctreeNode* n) override { LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0); @@ -1078,7 +1079,7 @@ public: } } - virtual void processGroup(LLViewerOctreeGroup* base_group) + void processGroup(LLViewerOctreeGroup* base_group) override { LLSpatialGroup* group = (LLSpatialGroup*)base_group; @@ -1114,7 +1115,7 @@ public: LLOctreeCullDetectVisible(LLCamera* camera) : LLOctreeCullShadow(camera), mResult(FALSE) { } - virtual bool earlyFail(LLViewerOctreeGroup* base_group) + bool earlyFail(LLViewerOctreeGroup* base_group) override { LLSpatialGroup* group = (LLSpatialGroup*)base_group; @@ -1129,7 +1130,7 @@ public: return false; } - virtual void processGroup(LLViewerOctreeGroup* base_group) + void processGroup(LLViewerOctreeGroup* base_group) override { if (base_group->isVisible()) { @@ -1146,10 +1147,10 @@ public: LLOctreeSelect(LLCamera* camera, std::vector<LLDrawable*>* results) : LLOctreeCull(camera), mResults(results) { } - virtual bool earlyFail(LLViewerOctreeGroup* group) { return false; } - virtual void preprocess(LLViewerOctreeGroup* group) { } + bool earlyFail(LLViewerOctreeGroup* group) override { return false; } + void preprocess(LLViewerOctreeGroup* group) override { } - virtual void processGroup(LLViewerOctreeGroup* base_group) + void processGroup(LLViewerOctreeGroup* base_group) override { LLSpatialGroup* group = (LLSpatialGroup*)base_group; OctreeNode* branch = group->getOctreeNode(); @@ -1290,7 +1291,7 @@ class LLOctreeDirty : public OctreeTraveler public: LLOctreeDirty(bool no_rebuild) : mNoRebuild(no_rebuild){} - virtual void visit(const OctreeNode* state) + void visit(const OctreeNode* state) override { LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0); group->destroyGL(); @@ -2887,7 +2888,7 @@ public: } - void visit(const LLOctreeNode<LLVolumeTriangle>* branch) + void visit(const LLOctreeNode<LLVolumeTriangle>* branch) override { LLVolumeOctreeListener* vl = (LLVolumeOctreeListener*) branch->getListener(0); @@ -3118,8 +3119,8 @@ class LLOctreeRenderNonOccluded : public OctreeTraveler public: LLCamera* mCamera; LLOctreeRenderNonOccluded(LLCamera* camera): mCamera(camera) {} - - virtual void traverse(const OctreeNode* node) + + void traverse(const OctreeNode* node) override { LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); @@ -3164,7 +3165,7 @@ public: } } - virtual void visit(const OctreeNode* branch) + void visit(const OctreeNode* branch) override { LLSpatialGroup* group = (LLSpatialGroup*) branch->getListener(0); const LLVector4a* bounds = group->getBounds(); @@ -3326,8 +3327,8 @@ class LLOctreeRenderXRay : public OctreeTraveler public: LLCamera* mCamera; LLOctreeRenderXRay(LLCamera* camera): mCamera(camera) {} - - virtual void traverse(const OctreeNode* node) + + void traverse(const OctreeNode* node) override { LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); @@ -3361,7 +3362,7 @@ public: } } - virtual void visit(const OctreeNode* node) {} + void visit(const OctreeNode* node) override {} }; @@ -3370,8 +3371,8 @@ class LLOctreeRenderPhysicsShapes : public OctreeTraveler public: LLCamera* mCamera; LLOctreeRenderPhysicsShapes(LLCamera* camera): mCamera(camera) {} - - virtual void traverse(const OctreeNode* node) + + void traverse(const OctreeNode* node) override { LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); @@ -3394,7 +3395,7 @@ public: } } - virtual void visit(const OctreeNode* branch) + void visit(const OctreeNode* branch) override { } @@ -3405,8 +3406,8 @@ class LLOctreePushBBoxVerts : public OctreeTraveler public: LLCamera* mCamera; LLOctreePushBBoxVerts(LLCamera* camera): mCamera(camera) {} - - virtual void traverse(const OctreeNode* node) + + void traverse(const OctreeNode* node) override { LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); @@ -3422,7 +3423,7 @@ public: } } - virtual void visit(const OctreeNode* branch) + void visit(const OctreeNode* branch) override { LLSpatialGroup* group = (LLSpatialGroup*) branch->getListener(0); @@ -3463,7 +3464,7 @@ public: } } - virtual void traverse(const OctreeNode* node) + void traverse(const OctreeNode* node) override { LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); @@ -3488,9 +3489,9 @@ public: mInheritedMask[i] = temp[i]; } } - - virtual void visit(const OctreeNode* state) + + void visit(const OctreeNode* state) override { LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0); @@ -3679,8 +3680,8 @@ public: mPickRigged(pick_rigged) { } - - virtual void visit(const OctreeNode* branch) + + void visit(const OctreeNode* branch) override { for (OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i) { @@ -3835,10 +3836,10 @@ LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset, mDrawMode(LLRender::TRIANGLES), mMaterial(NULL), mShaderMask(0), - mSpecColor(1.0f, 1.0f, 1.0f, 0.5f), mBlendFuncSrc(LLRender::BF_SOURCE_ALPHA), mBlendFuncDst(LLRender::BF_ONE_MINUS_SOURCE_ALPHA), mHasGlow(FALSE), + mSpecColor(1.0f, 1.0f, 1.0f, 0.5f), mEnvIntensity(0.0f), mAlphaMaskCutoff(0.5f), mDiffuseAlphaMode(0) diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 692be204011dabccaefc4e0af3956625b8c6d163..6c00f6f2eae9e48e17972ee8f5fdd072fc09ab83 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -272,10 +272,10 @@ bool LLSpeakersDelayActionsStorage::isTimerStarted(const LLUUID& speaker_id) // LLSpeakerMgr::LLSpeakerMgr(LLVoiceChannel* channelp) : + mSpeakerListUpdated(false), mVoiceChannel(channelp), mVoiceModerated(false), - mModerateModeHandledFirstTime(false), - mSpeakerListUpdated(false) + mModerateModeHandledFirstTime(false) { mGetListTime.reset(); static LLUICachedControl<F32> remove_delay ("SpeakerParticipantRemoveDelay", 10.0); @@ -857,7 +857,7 @@ void LLIMSpeakerMgr::moderationActionCoro(std::string url, LLSD action) LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("moderationActionCoro", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = boost::make_shared<LLCore::HttpOptions>(); httpOpts->setWantHeaders(true); diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 84ea0414b95a5e2241e47b62adce5f13d9bbe20c..c1c65b9bbd2d21c05ac5b35677a614f24e5b024d 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -66,7 +66,7 @@ private: public: ReadResponder(LLTextureCache* cache, handle_t handle) : mCache(cache), mHandle(handle) {} ~ReadResponder() {} - void completed(S32 bytes) + void completed(S32 bytes) override { mCache->lockWorkers(); LLTextureCacheWorker* reader = mCache->getReader(mHandle); @@ -82,7 +82,7 @@ private: public: WriteResponder(LLTextureCache* cache, handle_t handle) : mCache(cache), mHandle(handle) {} ~WriteResponder() {} - void completed(S32 bytes) + void completed(S32 bytes) override { mCache->lockWorkers(); LLTextureCacheWorker* writer = mCache->getWriter(mHandle); @@ -99,9 +99,9 @@ public: S32 imagesize, // for writes LLTextureCache::Responder* responder) : LLWorkerClass(cache, "LLTextureCacheWorker"), - mID(id), mCache(cache), mPriority(priority), + mID(id), mReadData(NULL), mWriteData(data), mDataSize(datasize), @@ -126,7 +126,7 @@ public: virtual bool doRead() = 0; virtual bool doWrite() = 0; - virtual bool doWork(S32 param); // Called from LLWorkerThread::processRequest() + bool doWork(S32 param) override; // Called from LLWorkerThread::processRequest() handle_t read() { addWork(0, LLWorkerThread::PRIORITY_HIGH | mPriority); return mRequestHandle; } handle_t write() { addWork(1, LLWorkerThread::PRIORITY_HIGH | mPriority); return mRequestHandle; } @@ -138,9 +138,9 @@ public: } private: - virtual void startWork(S32 param); // called from addWork() (MAIN THREAD) - virtual void finishWork(S32 param, bool completed); // called from finishRequest() (WORK THREAD) - virtual void endWork(S32 param, bool aborted); // called from doWork() (MAIN THREAD) + void startWork(S32 param) override; // called from addWork() (MAIN THREAD) + void finishWork(S32 param, bool completed) override; // called from finishRequest() (WORK THREAD) + void endWork(S32 param, bool aborted) override; // called from doWork() (MAIN THREAD) protected: LLTextureCache* mCache; @@ -173,8 +173,8 @@ public: { } - virtual bool doRead(); - virtual bool doWrite(); + bool doRead() override; + bool doWrite() override; private: std::string mFileName; @@ -297,8 +297,8 @@ public: { } - virtual bool doRead(); - virtual bool doWrite(); + bool doRead() override; + bool doWrite() override; private: enum e_state @@ -821,12 +821,12 @@ LLTextureCache::LLTextureCache(bool threaded) mListMutex(), mFastCacheMutex(), mHeaderAPRFile(NULL), - mReadOnly(TRUE), //do not allow to change the texture cache until setReadOnly() is called. - mTexturesSizeTotal(0), - mDoPurge(false), + mFastCachePoolp(NULL), //do not allow to change the texture cache until setReadOnly() is called. + mReadOnly(TRUE), mFastCachep(NULL), - mFastCachePoolp(NULL), - mFastCachePadBuffer(NULL) + mFastCachePadBuffer(NULL), + mTexturesSizeTotal(0), + mDoPurge(false) { } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index de0bcf35f5b0d4c3ce2efdca5c995445e63c2bfe..d30a00cfcf76e722d094ece5ea5c7d9819bd9ae4 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -31,973 +31,33 @@ #include "lltexturectrl.h" -#include "llrender.h" -#include "llagent.h" -#include "llviewertexturelist.h" -#include "llcheckboxctrl.h" -#include "llcombobox.h" #include "llbutton.h" +#include "llcombobox.h" #include "lldraghandle.h" -#include "llfocusmgr.h" +#include "llerror.h" +#include "llfloaterreg.h" +#include "llui.h" + +#include "llagent.h" +#include "llappviewer.h" #include "llfolderviewmodel.h" +#include "llfloatertexturepicker.h" #include "llinventory.h" #include "llinventoryfunctions.h" #include "llinventorymodelbackgroundfetch.h" #include "llinventoryobserver.h" #include "llinventorypanel.h" -#include "lllineeditor.h" -#include "llui.h" -#include "llviewerinventory.h" #include "llpermissions.h" -#include "llsaleinfo.h" -#include "llassetstorage.h" -#include "lltextbox.h" -#include "llresizehandle.h" -#include "llscrollcontainer.h" -#include "lltoolmgr.h" -#include "lltoolpipette.h" -#include "llfiltereditor.h" #include "llwindow.h" -#include "lltool.h" #include "llviewerwindow.h" #include "llviewerobject.h" #include "llviewercontrol.h" -#include "llglheaders.h" +#include "llviewertexturelist.h" #include "lluictrlfactory.h" #include "lltrans.h" -#include "llradiogroup.h" -#include "llfloaterreg.h" -#include "lllocalbitmaps.h" -#include "llerror.h" - -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; - -static const S32 LOCAL_TRACKING_ID_COLUMN = 1; - -//static const char CURRENT_IMAGE_NAME[] = "Current Texture"; -//static const char WHITE_IMAGE_NAME[] = "Blank Texture"; -//static const char NO_IMAGE_NAME[] = "None"; - -LLFloaterTexturePicker::LLFloaterTexturePicker( - LLView* owner, - LLUUID image_asset_id, - LLUUID default_image_asset_id, - LLUUID transparent_image_asset_id, - LLUUID blank_image_asset_id, - BOOL tentative, - BOOL allow_no_texture, - const std::string& label, - PermissionMask immediate_filter_perm_mask, - PermissionMask dnd_filter_perm_mask, - PermissionMask non_immediate_filter_perm_mask, - BOOL can_apply_immediately, - LLUIImagePtr fallback_image) -: LLFloater(LLSD()), - mOwner( owner ), - mImageAssetID( image_asset_id ), - mOriginalImageAssetID(image_asset_id), - mFallbackImage(fallback_image), - mDefaultImageAssetID(default_image_asset_id), - mTransparentImageAssetID(transparent_image_asset_id), - mBlankImageAssetID(blank_image_asset_id), - mTentative(tentative), - mAllowNoTexture(allow_no_texture), - mLabel(label), - mTentativeLabel(nullptr), - mResolutionLabel(nullptr), - mActive( TRUE ), - mFilterEdit(nullptr), - mImmediateFilterPermMask(immediate_filter_perm_mask), - mDnDFilterPermMask(dnd_filter_perm_mask), - mNonImmediateFilterPermMask(non_immediate_filter_perm_mask), - mContextConeOpacity(0.f), - mSelectedItemPinned( FALSE ), - mCanApply(true), - mCanPreview(true), - mPreviewSettingChanged(false), - mOnFloaterCommitCallback(nullptr), - mOnFloaterCloseCallback(nullptr), - mSetImageAssetIDCallback(nullptr), - mOnUpdateImageStatsCallback(nullptr) -{ - buildFromFile("floater_texture_ctrl.xml"); - mCanApplyImmediately = can_apply_immediately; - setCanMinimize(FALSE); -} - -LLFloaterTexturePicker::~LLFloaterTexturePicker() -{ -} - -void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selection /*=true*/) -{ - if( mImageAssetID != image_id && mActive) - { - mNoCopyTextureSelected = FALSE; - mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? - mImageAssetID = image_id; - LLUUID item_id = findItemID(mImageAssetID, FALSE); - if (item_id.isNull()) - { - mInventoryPanel->getRootFolder()->clearSelection(); - } - else - { - LLInventoryItem* itemp = gInventory.getItem(image_id); - if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) - { - // no copy texture - getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE); - mNoCopyTextureSelected = TRUE; - } - } - - if (set_selection) - { - mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); - } - } -} - -void LLFloaterTexturePicker::setActive( BOOL active ) -{ - if (!active && getChild<LLUICtrl>("Pipette")->getValue().asBoolean()) - { - stopUsingPipette(); - } - mActive = active; -} - -void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b) -{ - mCanApplyImmediately = b; - if (!mCanApplyImmediately) - { - getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE); - } - updateFilterPermMask(); -} - -void LLFloaterTexturePicker::stopUsingPipette() -{ - if (LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()) - { - LLToolMgr::getInstance()->clearTransientTool(); - } -} - -void LLFloaterTexturePicker::updateImageStats() -{ - if (mTexturep.notNull()) - { - //RN: have we received header data for this image? - if (mTexturep->getFullWidth() > 0 && mTexturep->getFullHeight() > 0) - { - std::string formatted_dims = llformat("%d x %d", mTexturep->getFullWidth(),mTexturep->getFullHeight()); - mResolutionLabel->setTextArg("[DIMENSIONS]", formatted_dims); - if (mOnUpdateImageStatsCallback != nullptr) - { - mOnUpdateImageStatsCallback(mTexturep); - } - } - else - { - mResolutionLabel->setTextArg("[DIMENSIONS]", std::string("[? x ?]")); - } - } - else - { - mResolutionLabel->setTextArg("[DIMENSIONS]", std::string("")); - } -} - -// virtual -BOOL LLFloaterTexturePicker::handleDragAndDrop( - S32 x, S32 y, MASK mask, - BOOL drop, - EDragAndDropType cargo_type, void *cargo_data, - EAcceptance *accept, - std::string& tooltip_msg) -{ - BOOL handled = FALSE; - - bool is_mesh = cargo_type == DAD_MESH; - - if ((cargo_type == DAD_TEXTURE) || is_mesh) - { - LLInventoryItem *item = (LLInventoryItem *)cargo_data; - - BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); - BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); - BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, - gAgent.getID()); - - PermissionMask item_perm_mask = 0; - if (copy) item_perm_mask |= PERM_COPY; - if (mod) item_perm_mask |= PERM_MODIFY; - if (xfer) item_perm_mask |= PERM_TRANSFER; - - //PermissionMask filter_perm_mask = getFilterPermMask(); Commented out due to no-copy texture loss. - PermissionMask filter_perm_mask = mDnDFilterPermMask; - if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask ) - { - if (drop) - { - setImageID( item->getAssetUUID() ); - commitIfImmediateSet(); - } - - *accept = ACCEPT_YES_SINGLE; - } - else - { - *accept = ACCEPT_NO; - } - } - else - { - *accept = ACCEPT_NO; - } - - handled = TRUE; - LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFloaterTexturePicker " << getName() << LL_ENDL; - - return handled; -} - -BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask) -{ - LLFolderView* root_folder = mInventoryPanel->getRootFolder(); - - if (root_folder && mFilterEdit) - { - if (mFilterEdit->hasFocus() - && (key == KEY_RETURN || key == KEY_DOWN) - && mask == MASK_NONE) - { - if (!root_folder->getCurSelectedItem()) - { - LLFolderViewItem* itemp = mInventoryPanel->getItemByID(gInventory.getRootFolderID()); - if (itemp) - { - root_folder->setSelection(itemp, FALSE, FALSE); - } - } - root_folder->scrollToShowSelection(); - - // move focus to inventory proper - mInventoryPanel->setFocus(TRUE); - - // treat this as a user selection of the first filtered result - commitIfImmediateSet(); - - return TRUE; - } - - if (mInventoryPanel->hasFocus() && key == KEY_UP) - { - mFilterEdit->focusFirstItem(TRUE); - } - } - - return LLFloater::handleKeyHere(key, mask); -} - -void LLFloaterTexturePicker::onClose(bool app_quitting) -{ - if (mOwner && mOnFloaterCloseCallback != nullptr) - { - mOnFloaterCloseCallback(); - } - stopUsingPipette(); -} - -// virtual -BOOL LLFloaterTexturePicker::postBuild() -{ - LLFloater::postBuild(); - - if (!mLabel.empty()) - { - std::string pick = getString("pick title"); - - setTitle(pick + mLabel); - } - mTentativeLabel = getChild<LLTextBox>("Multiple"); - - mResolutionLabel = getChild<LLTextBox>("unknown"); - - - childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this); - childSetAction("None", LLFloaterTexturePicker::onBtnNone,this); - childSetAction("Blank", LLFloaterTexturePicker::onBtnBlank,this); - childSetAction("Transparent", LLFloaterTexturePicker::onBtnTransparent,this); // <alchemy/> - - - childSetCommitCallback("show_folders_check", onShowFolders, this); - getChildView("show_folders_check")->setVisible( FALSE); - - mFilterEdit = getChild<LLFilterEditor>("inventory search editor"); - mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2)); - - mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); - - if(mInventoryPanel) - { - U32 filter_types = 0x0; - filter_types |= 0x1 << LLInventoryType::IT_TEXTURE; - filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT; - - mInventoryPanel->setFilterTypes(filter_types); - //mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss. - mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask); - mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); - mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - - // Disable auto selecting first filtered item because it takes away - // selection from the item set by LLTextureCtrl owning this floater. - mInventoryPanel->getRootFolder()->setAutoSelectOverride(TRUE); - - // Commented out to scroll to currently selected texture. See EXT-5403. - // // store this filter as the default one - // mInventoryPanel->getRootFolder()->getFilter().markDefault(); - - // Commented out to stop opening all folders with textures - // mInventoryPanel->openDefaultFolderForType(LLFolderType::FT_TEXTURE); - - // don't put keyboard focus on selected item, because the selection callback - // will assume that this was user input - if(!mImageAssetID.isNull()) - { - mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); - } - } - - mModeSelector = getChild<LLRadioGroup>("mode_selection"); - mModeSelector->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onModeSelect, this)); - mModeSelector->setSelectedIndex(0, 0); - - childSetAction("l_add_btn", LLFloaterTexturePicker::onBtnAdd, this); - childSetAction("l_rem_btn", LLFloaterTexturePicker::onBtnRemove, this); - childSetAction("l_upl_btn", LLFloaterTexturePicker::onBtnUpload, this); - - mLocalScrollCtrl = getChild<LLScrollListCtrl>("l_name_list"); - mLocalScrollCtrl->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onLocalScrollCommit, this)); - LLLocalBitmapMgr::feedScrollList(mLocalScrollCtrl); - - getChild<LLLineEditor>("uuid_editor")->setCommitCallback(boost::bind(&onApplyUUID, this)); - getChild<LLButton>("apply_uuid_btn")->setClickedCallback(boost::bind(&onApplyUUID, this)); - - mNoCopyTextureSelected = FALSE; - - getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("TextureLivePreview")); - childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this); - - if (!mCanApplyImmediately) - { - getChildView("show_folders_check")->setEnabled(FALSE); - } - - getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this)); - childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this); - childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this); - - // update permission filter once UI is fully initialized - updateFilterPermMask(); - mSavedFolderState.setApply(FALSE); - - LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1)); - - return TRUE; -} - -// virtual -void LLFloaterTexturePicker::draw() -{ - if (mOwner) - { - // draw cone of context pointing back to texture swatch - LLRect owner_rect; - mOwner->localRectToOtherView(mOwner->getLocalRect(), &owner_rect, this); - LLRect local_rect = getLocalRect(); - if (gFocusMgr.childHasKeyboardFocus(this) && mOwner->isInVisibleChain() && mContextConeOpacity > 0.001f) - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLGLEnable(GL_CULL_FACE); - gGL.begin(LLRender::TRIANGLE_STRIP); - { - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); - } - gGL.end(); - } - } - - if (gFocusMgr.childHasMouseCapture(getDragHandle())) - { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); - } - else - { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); - } - - updateImageStats(); - - // if we're inactive, gray out "apply immediate" checkbox - getChildView("show_folders_check")->setEnabled(mActive && mCanApplyImmediately && !mNoCopyTextureSelected); - getChildView("Select")->setEnabled(mActive && mCanApply); - getChildView("Pipette")->setEnabled(mActive); - getChild<LLUICtrl>("Pipette")->setValue(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); - - //BOOL allow_copy = FALSE; - if( mOwner ) - { - mTexturep = nullptr; - if(mImageAssetID.notNull()) - { - mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID); - mTexturep->setBoostLevel(LLGLTexture::BOOST_PREVIEW); - } - - if (mTentativeLabel) - { - mTentativeLabel->setVisible( FALSE ); - } - - getChildView("Default")->setEnabled(mImageAssetID != mDefaultImageAssetID || mTentative); - getChildView("Transparent")->setEnabled(mImageAssetID != mTransparentImageAssetID || mTentative); // <alchemy/> - getChildView("Blank")->setEnabled(mImageAssetID != mBlankImageAssetID || mTentative); - getChildView("None")->setEnabled(mAllowNoTexture && (!mImageAssetID.isNull() || mTentative)); - - LLFloater::draw(); - - if( isMinimized() ) - { - return; - } - - // Border - LLRect border = getChildView("preview_widget")->getRect(); - gl_rect_2d( border, LLColor4::black, FALSE ); - - - // Interior - LLRect interior = border; - interior.stretch( -1 ); - - // If the floater is focused, don't apply its alpha to the texture (STORM-677). - const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); - if( mTexturep ) - { - if( mTexturep->getComponents() == 4 ) - { - gl_rect_2d_checkerboard( interior, alpha ); - } - - gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha ); - - // Pump the priority - mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) ); - } - else if (!mFallbackImage.isNull()) - { - mFallbackImage->draw(interior, UI_VERTEX_COLOR % alpha); - } - else - { - gl_rect_2d( interior, LLColor4::grey % alpha, TRUE ); - - // Draw X - gl_draw_x(interior, LLColor4::black ); - } - - // Draw Tentative Label over the image - if( mTentative && !mViewModel->isDirty() ) - { - mTentativeLabel->setVisible( TRUE ); - drawChild(mTentativeLabel); - } - - if (mSelectedItemPinned) return; - - LLFolderView* folder_view = mInventoryPanel->getRootFolder(); - if (!folder_view) return; - - LLFolderViewFilter& filter = static_cast<LLFolderViewModelInventory*>(folder_view->getFolderViewModel())->getFilter(); - - bool is_filter_active = folder_view->getViewModelItem()->getLastFilterGeneration() < filter.getCurrentGeneration() && - filter.isNotDefault(); - - // After inventory panel filter is applied we have to update - // constraint rect for the selected item because of folder view - // AutoSelectOverride set to TRUE. We force PinningSelectedItem - // flag to FALSE state and setting filter "dirty" to update - // scroll container to show selected item (see LLFolderView::doIdle()). - if (!is_filter_active && !mSelectedItemPinned) - { - folder_view->setPinningSelectedItem(mSelectedItemPinned); - folder_view->getViewModelItem()->dirtyFilter(); - mSelectedItemPinned = TRUE; - } - } -} - -const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library) -{ - LLViewerInventoryCategory::cat_array_t cats; - LLViewerInventoryItem::item_array_t items; - LLAssetIDMatches asset_id_matches(asset_id); - gInventory.collectDescendentsIf(LLUUID::null, - cats, - items, - LLInventoryModel::INCLUDE_TRASH, - asset_id_matches); - - if (items.size()) - { - // search for copyable version first - for (S32 i = 0; i < items.size(); i++) - { - LLInventoryItem* itemp = items[i]; - LLPermissions item_permissions = itemp->getPermissions(); - if (item_permissions.allowCopyBy(gAgent.getID(), gAgent.getGroupID())) - { - if(!ignore_library || !gInventory.isObjectDescendentOf(itemp->getUUID(),gInventory.getLibraryRootFolderID())) - { - return itemp->getUUID(); - } - } - } - // otherwise just return first instance, unless copyable requested - if (copyable_only) - { - return LLUUID::null; - } - else - { - if(!ignore_library || !gInventory.isObjectDescendentOf(items[0]->getUUID(),gInventory.getLibraryRootFolderID())) - { - return items[0]->getUUID(); - } - } - } - - return LLUUID::null; -} - -PermissionMask LLFloaterTexturePicker::getFilterPermMask() -{ - bool apply_immediate = getChild<LLUICtrl>("apply_immediate_check")->getValue().asBoolean(); - return apply_immediate ? mImmediateFilterPermMask : mNonImmediateFilterPermMask; -} - -void LLFloaterTexturePicker::commitIfImmediateSet() -{ - if (!mNoCopyTextureSelected && mOnFloaterCommitCallback != nullptr && mCanApply) - { - mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CHANGE, LLUUID::null); - } -} - -void LLFloaterTexturePicker::commitCancel() -{ - if (!mNoCopyTextureSelected && mOnFloaterCommitCallback != nullptr && mCanApply) - { - mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CANCEL, LLUUID::null); - } -} - -// static -void LLFloaterTexturePicker::onBtnSetToDefault(void* userdata) -{ - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - self->setCanApply(true, true); - if (self->mOwner) - { - self->setImageID( self->getDefaultImageAssetID() ); - } - self->commitIfImmediateSet(); -} - -// <alchemy> -// static -void LLFloaterTexturePicker::onBtnTransparent(void* userdata) -{ - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - self->setCanApply(true, true); - self->setImageID( self->getTransparentImageAssetID() ); - self->commitIfImmediateSet(); -} -// </alchemy> - -// static -void LLFloaterTexturePicker::onBtnBlank(void* userdata) -{ - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - self->setCanApply(true, true); - self->setImageID( self->getBlankImageAssetID() ); - self->commitIfImmediateSet(); -} - - -// static -void LLFloaterTexturePicker::onBtnNone(void* userdata) -{ - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - self->setImageID( LLUUID::null ); - self->commitCancel(); -} - -/* -// static -void LLFloaterTexturePicker::onBtnRevert(void* userdata) -{ - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - self->setImageID( self->mOriginalImageAssetID ); - // TODO: Change this to tell the owner to cancel. It needs to be - // smart enough to restore multi-texture selections. - self->mOwner->onFloaterCommit(); - self->mViewModel->resetDirty(); -}*/ - -// static -void LLFloaterTexturePicker::onBtnCancel(void* userdata) -{ - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - self->setImageID( self->mOriginalImageAssetID ); - if (self->mOnFloaterCommitCallback != nullptr) - { - self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CANCEL, LLUUID::null); - } - self->mViewModel->resetDirty(); - self->closeFloater(); -} - -// static -void LLFloaterTexturePicker::onBtnSelect(void* userdata) -{ - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - LLUUID local_id = LLUUID::null; - if (self->mOwner) - { - if (self->mLocalScrollCtrl->getVisible() && !self->mLocalScrollCtrl->getAllSelected().empty()) - { - LLUUID temp_id = self->mLocalScrollCtrl->getFirstSelected()->getColumn(LOCAL_TRACKING_ID_COLUMN)->getValue().asUUID(); - local_id = LLLocalBitmapMgr::getWorldID(temp_id); - } - } - if (self->mOnFloaterCommitCallback != nullptr) - { - self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_SELECT, local_id); - } - self->closeFloater(); -} - -void LLFloaterTexturePicker::onBtnPipette() -{ - BOOL pipette_active = getChild<LLUICtrl>("Pipette")->getValue().asBoolean(); - pipette_active = !pipette_active; - if (pipette_active) - { - LLToolMgr::getInstance()->setTransientTool(LLToolPipette::getInstance()); - } - else - { - LLToolMgr::getInstance()->clearTransientTool(); - } -} - -// static -void LLFloaterTexturePicker::onApplyUUID(void* userdata) -{ - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - LLUUID id(self->getChild<LLLineEditor>("uuid_editor")->getText()); - if (id.notNull()) - { - self->setImageID(id); - self->commitIfImmediateSet(); - } -} - -void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action) -{ - if (items.size()) - { - LLFolderViewItem* first_item = items.front(); - LLInventoryItem* itemp = gInventory.getItem(static_cast<LLFolderViewModelItemInventory*>(first_item->getViewModelItem())->getUUID()); - mNoCopyTextureSelected = FALSE; - if (itemp) - { - if (mTextureSelectedCallback != nullptr) - { - mTextureSelectedCallback(itemp); - } - if (!itemp->getPermissions().allowCopyBy(gAgent.getID())) - { - mNoCopyTextureSelected = TRUE; - } - setImageID(itemp->getAssetUUID(),false); - mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? - - if(!mPreviewSettingChanged) - { - mCanPreview = gSavedSettings.getBOOL("TextureLivePreview"); - } - else - { - mPreviewSettingChanged = false; - } - - if (user_action && mCanPreview) - { - // only commit intentional selections, not implicit ones - commitIfImmediateSet(); - } - } - } -} - -void LLFloaterTexturePicker::onModeSelect() -{ - bool mode = (mModeSelector->getSelectedIndex() == 0); - - getChild<LLButton>("Default")->setVisible(mode); - getChild<LLButton>("Transparent")->setVisible(mode); // <alchemy/> - getChild<LLButton>("Blank")->setVisible(mode); - getChild<LLButton>("None")->setVisible(mode); - getChild<LLButton>("Pipette")->setVisible(mode); - getChild<LLFilterEditor>("inventory search editor")->setVisible(mode); - getChild<LLInventoryPanel>("inventory panel")->setVisible(mode); - getChild<LLLineEditor>("uuid_editor")->setVisible(mode); - getChild<LLButton>("apply_uuid_btn")->setVisible(mode); - - /*getChild<LLCheckBox>("show_folders_check")->setVisible(mode); - no idea under which conditions the above is even shown, needs testing. */ - - getChild<LLButton>("l_add_btn")->setVisible(!mode); - getChild<LLButton>("l_rem_btn")->setVisible(!mode); - getChild<LLButton>("l_upl_btn")->setVisible(!mode); - getChild<LLScrollListCtrl>("l_name_list")->setVisible(!mode); -} - -// static -void LLFloaterTexturePicker::onBtnAdd(void* userdata) -{ - if (LLLocalBitmapMgr::addUnit() == true) - { - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - LLLocalBitmapMgr::feedScrollList(self->mLocalScrollCtrl); - } -} - -// static -void LLFloaterTexturePicker::onBtnRemove(void* userdata) -{ - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected(); - - if (!selected_items.empty()) - { - for(std::vector<LLScrollListItem*>::iterator iter = selected_items.begin(); - iter != selected_items.end(); iter++) - { - LLScrollListItem* list_item = *iter; - if (list_item) - { - LLUUID tracking_id = list_item->getColumn(LOCAL_TRACKING_ID_COLUMN)->getValue().asUUID(); - LLLocalBitmapMgr::delUnit(tracking_id); - } - } - - self->getChild<LLButton>("l_rem_btn")->setEnabled(false); - self->getChild<LLButton>("l_upl_btn")->setEnabled(false); - LLLocalBitmapMgr::feedScrollList(self->mLocalScrollCtrl); - } - -} - -// static -void LLFloaterTexturePicker::onBtnUpload(void* userdata) -{ - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected(); - - if (selected_items.empty()) - { - return; - } - - /* currently only allows uploading one by one, picks the first item from the selection list. (not the vector!) - in the future, it might be a good idea to check the vector size and if more than one units is selected - opt for multi-image upload. */ - - LLUUID tracking_id = (LLUUID)self->mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN); - std::string filename = LLLocalBitmapMgr::getFilename(tracking_id); - - if (!filename.empty()) - { - LLFloaterReg::showInstance("upload_image", LLSD(filename)); - } - -} - -void LLFloaterTexturePicker::onLocalScrollCommit() -{ - std::vector<LLScrollListItem*> selected_items = mLocalScrollCtrl->getAllSelected(); - bool has_selection = !selected_items.empty(); - - getChild<LLButton>("l_rem_btn")->setEnabled(has_selection); - getChild<LLButton>("l_upl_btn")->setEnabled(has_selection && (selected_items.size() < 2)); - /* since multiple-localbitmap upload is not implemented, upl button gets disabled if more than one is selected. */ - - if (has_selection) - { - LLUUID tracking_id = LLUUID(mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN)); - LLUUID inworld_id = LLLocalBitmapMgr::getWorldID(tracking_id); - if (mSetImageAssetIDCallback != nullptr) - { - mSetImageAssetIDCallback(inworld_id); - } - - if (childGetValue("apply_immediate_check").asBoolean()) - { - if (mOnFloaterCommitCallback != nullptr) - { - mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CHANGE, inworld_id); - } - } - } -} - -// static -void LLFloaterTexturePicker::onShowFolders(LLUICtrl* ctrl, void *user_data) -{ - LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl; - LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data; - - if (check_box->get()) - { - picker->mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - } - else - { - picker->mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NO_FOLDERS); - } -} - -// static -void LLFloaterTexturePicker::onApplyImmediateCheck(LLUICtrl* ctrl, void *user_data) -{ - LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data; - - LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl; - gSavedSettings.setBOOL("TextureLivePreview", check_box->get()); - - picker->updateFilterPermMask(); - picker->commitIfImmediateSet(); -} - -void LLFloaterTexturePicker::updateFilterPermMask() -{ - //mInventoryPanel->setFilterPermMask( getFilterPermMask() ); Commented out due to no-copy texture loss. -} - -void LLFloaterTexturePicker::setCanApply(bool can_preview, bool can_apply) -{ - getChildRef<LLUICtrl>("Select").setEnabled(can_apply); - getChildRef<LLUICtrl>("preview_disabled").setVisible(!can_preview); - getChildRef<LLUICtrl>("apply_immediate_check").setVisible(can_preview); - - mCanApply = can_apply; - mCanPreview = can_preview ? gSavedSettings.getBOOL("TextureLivePreview") : false; - mPreviewSettingChanged = true; -} - -void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string ) -{ - std::string upper_case_search_string = search_string; - LLStringUtil::toUpper(upper_case_search_string); - - if (upper_case_search_string.empty()) - { - if (mInventoryPanel->getFilterSubString().empty()) - { - // current filter and new filter empty, do nothing - return; - } - - mSavedFolderState.setApply(TRUE); - mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState); - // add folder with current item to list of previously opened folders - LLOpenFoldersWithSelection opener; - mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener); - mInventoryPanel->getRootFolder()->scrollToShowSelection(); - - } - else if (mInventoryPanel->getFilterSubString().empty()) - { - // first letter in search term, save existing folder open state - if (!mInventoryPanel->getFilter().isNotDefault()) - { - mSavedFolderState.setApply(FALSE); - mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState); - } - } - - mInventoryPanel->setFilterSubString(search_string); -} - -void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled) -{ - mModeSelector->setIndexEnabled(1,enabled); -} - -void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) -{ - LLUUID inventory_item_id = findItemID(te.getID(), TRUE); - if (inventory_item_id.notNull()) - { - LLToolPipette::getInstance()->setResult(TRUE, ""); - setImageID(te.getID()); - - mNoCopyTextureSelected = FALSE; - LLInventoryItem* itemp = gInventory.getItem(inventory_item_id); - - if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) - { - // no copy texture - mNoCopyTextureSelected = TRUE; - } - - commitIfImmediateSet(); - } - else - { - LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture")); - } -} +#include "alviewermenu.h" /////////////////////////////////////////////////////////////////////// // LLTextureCtrl @@ -1007,9 +67,13 @@ static LLDefaultChildRegistry::Register<LLTextureCtrl> r("texture_picker"); LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) : LLUICtrl(p), mOnCancelCallback(NULL), - mOnCloseCallback(NULL), mOnSelectCallback(NULL), + mOnCloseCallback(NULL), mBorderColor( p.border_color() ), + mImageAssetID(p.image_id), + mDefaultImageAssetID(p.default_image_id), + mFallbackImage(p.fallback_image), + mDefaultImageName(p.default_image_name), mAllowNoTexture( FALSE ), mImmediateFilterPermMask( PERM_NONE ), mNonImmediateFilterPermMask( PERM_NONE ), @@ -1017,10 +81,6 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) mNeedsRawImageData( FALSE ), mValid( TRUE ), mShowLoadingPlaceholder( TRUE ), - mImageAssetID(p.image_id), - mDefaultImageAssetID(p.default_image_id), - mDefaultImageName(p.default_image_name), - mFallbackImage(p.fallback_image), mPreview(!p.enabled) { @@ -1095,7 +155,7 @@ void LLTextureCtrl::setCaption(const std::string& caption) void LLTextureCtrl::setCanApplyImmediately(BOOL b) { mCanApplyImmediately = b; - LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); + LLFloaterTexturePicker* floaterp = static_cast<LLFloaterTexturePicker*>(mFloaterHandle.get()); if( floaterp ) { floaterp->setCanApplyImmediately(b); @@ -1122,7 +182,7 @@ void LLTextureCtrl::setVisible( BOOL visible ) void LLTextureCtrl::setEnabled( BOOL enabled ) { - LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); + LLFloaterTexturePicker* floaterp = static_cast<LLFloaterTexturePicker*>(mFloaterHandle.get()); if( enabled ) { std::string tooltip; @@ -1153,7 +213,7 @@ void LLTextureCtrl::setValid(BOOL valid ) mValid = valid; if (!valid) { - LLFloaterTexturePicker* pickerp = (LLFloaterTexturePicker*)mFloaterHandle.get(); + LLFloaterTexturePicker* pickerp = static_cast<LLFloaterTexturePicker*>(mFloaterHandle.get()); if (pickerp) { pickerp->setActive(FALSE); @@ -1233,7 +293,7 @@ void LLTextureCtrl::showPicker(BOOL take_focus) void LLTextureCtrl::closeDependentFloater() { - LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); + LLFloaterTexturePicker* floaterp = static_cast<LLFloaterTexturePicker*>(mFloaterHandle.get()); if( floaterp ) { floaterp->setOwner(nullptr); @@ -1245,7 +305,7 @@ void LLTextureCtrl::closeDependentFloater() class LLTextureFetchDescendentsObserver : public LLInventoryFetchDescendentsObserver { public: - virtual void done() + void done() override { // We need to find textures in all folders, so get the main // background download going. @@ -1268,7 +328,11 @@ BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask) if (!handled && mBorder->parentPointInView(x, y)) { - if (mPreview) + if (mask & MASK_SHIFT) + { + ALViewerMenu::destroy_texture(mImageAssetID); + } + else if (mPreview) { LLFloaterReg::showInstance("zoom_texture", LLSD(getValue()), TRUE); } @@ -1288,7 +352,7 @@ BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask) void LLTextureCtrl::onFloaterClose() { - LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); + LLFloaterTexturePicker* floaterp = static_cast<LLFloaterTexturePicker*>(mFloaterHandle.get()); if (floaterp) { @@ -1304,7 +368,7 @@ void LLTextureCtrl::onFloaterClose() void LLTextureCtrl::onFloaterCommit(ETexturePickOp op, LLUUID id) { - LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); + LLFloaterTexturePicker* floaterp = static_cast<LLFloaterTexturePicker*>(mFloaterHandle.get()); if( floaterp && getEnabled()) { @@ -1383,7 +447,7 @@ void LLTextureCtrl::setImageAssetID( const LLUUID& asset_id ) { mImageItemID.setNull(); mImageAssetID = asset_id; - LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); + LLFloaterTexturePicker* floaterp = static_cast<LLFloaterTexturePicker*>(mFloaterHandle.get()); if( floaterp && getEnabled() ) { floaterp->setImageID( asset_id ); diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 33ec5511fb530c54b95e1e9de12478d09e36e3a9..c920805e3322c1ef8fda6668d35942085b14b1fc 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -28,12 +28,9 @@ #ifndef LL_LLTEXTURECTRL_H #define LL_LLTEXTURECTRL_H -#include "llcoord.h" -#include "llfiltereditor.h" #include "llfloater.h" #include "llfolderview.h" #include "lllocalbitmaps.h" -#include "llstring.h" #include "lluictrl.h" #include "llpermissionsflags.h" #include "llradiogroup.h" @@ -45,7 +42,6 @@ #include "llwindow.h" class LLButton; -class LLFloaterTexturePicker; class LLInventoryItem; class LLViewerFetchedTexture; @@ -134,7 +130,7 @@ public: // LLTextureCtrl interface void showPicker(BOOL take_focus); - bool isPickerShown() { return !mFloaterHandle.isDead(); } + bool isPickerShown() const { return !mFloaterHandle.isDead(); } void setLabel(const std::string& label); void setLabelWidth(S32 label_width) {mLabelWidth =label_width;} const std::string& getLabel() const { return mLabel; } @@ -142,7 +138,7 @@ public: void setAllowNoTexture( BOOL b ) { mAllowNoTexture = b; } bool getAllowNoTexture() const { return mAllowNoTexture; } - const LLUUID& getImageItemID() { return mImageItemID; } + const LLUUID& getImageItemID() const { return mImageItemID; } virtual void setImageAssetName(const std::string& name); @@ -173,8 +169,8 @@ public: { mDnDFilterPermMask = mask; } void setNonImmediateFilterPermMask(PermissionMask mask) { mNonImmediateFilterPermMask = mask; } - PermissionMask getImmediateFilterPermMask() { return mImmediateFilterPermMask; } - PermissionMask getNonImmediateFilterPermMask() { return mNonImmediateFilterPermMask; } + PermissionMask getImmediateFilterPermMask() const { return mImmediateFilterPermMask; } + PermissionMask getNonImmediateFilterPermMask() const { return mNonImmediateFilterPermMask; } void closeDependentFloater(); @@ -201,7 +197,7 @@ public: void setShowLoadingPlaceholder(BOOL showLoadingPlaceholder); - LLViewerFetchedTexture* getTexture() { return mTexturep; } + LLViewerFetchedTexture* getTexture() const { return mTexturep; } private: BOOL allowDrop(LLInventoryItem* item); @@ -242,145 +238,4 @@ private: BOOL mPreview; }; -////////////////////////////////////////////////////////////////////////////////////////// -// LLFloaterTexturePicker -typedef std::function<void(LLTextureCtrl::ETexturePickOp op, LLUUID id)> floater_commit_callback; -typedef std::function<void()> floater_close_callback; -typedef std::function<void(const LLUUID& asset_id)> set_image_asset_id_callback; -typedef std::function<void(LLPointer<LLViewerTexture> texture)> set_on_update_image_stats_callback; - -class LLFloaterTexturePicker : public LLFloater -{ -public: - LLFloaterTexturePicker( - LLView* owner, - LLUUID image_asset_id, - LLUUID default_image_asset_id, - LLUUID transparent_image_asset_id, - LLUUID blank_image_asset_id, - BOOL tentative, - BOOL allow_no_texture, - const std::string& label, - PermissionMask immediate_filter_perm_mask, - PermissionMask dnd_filter_perm_mask, - PermissionMask non_immediate_filter_perm_mask, - BOOL can_apply_immediately, - LLUIImagePtr fallback_image_name - ); - - virtual ~LLFloaterTexturePicker(); - - // LLView overrides - /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, - BOOL drop, EDragAndDropType cargo_type, void *cargo_data, - EAcceptance *accept, - std::string& tooltip_msg) override; - /*virtual*/ void draw() override; - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask) override; - - // LLFloater overrides - /*virtual*/ BOOL postBuild() override; - /*virtual*/ void onClose(bool app_settings) override; - - // New functions - void setImageID(const LLUUID& image_asset_id, bool set_selection = true); - void updateImageStats(); - const LLUUID& getAssetID() { return mImageAssetID; } - const LLUUID& findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library = FALSE); - void setCanApplyImmediately(BOOL b); - - void setActive(BOOL active); - - LLView* getOwner() const { return mOwner; } - void setOwner(LLView* owner) { mOwner = owner; } - void stopUsingPipette(); - PermissionMask getFilterPermMask(); - - void updateFilterPermMask(); - void commitIfImmediateSet(); - void commitCancel(); - - void onFilterEdit(const std::string& search_string); - - void setCanApply(bool can_preview, bool can_apply); - void setTextureSelectedCallback(const texture_selected_callback& cb) { mTextureSelectedCallback = cb; } - void setOnFloaterCloseCallback(const floater_close_callback& cb) { mOnFloaterCloseCallback = cb; } - void setOnFloaterCommitCallback(const floater_commit_callback& cb) { mOnFloaterCommitCallback = cb; } - void setSetImageAssetIDCallback(const set_image_asset_id_callback& cb) { mSetImageAssetIDCallback = cb; } - void setOnUpdateImageStatsCallback(const set_on_update_image_stats_callback& cb) { mOnUpdateImageStatsCallback = cb; } - const LLUUID& getDefaultImageAssetID() { return mDefaultImageAssetID; } - const LLUUID& getTransparentImageAssetID() { return mTransparentImageAssetID; } - const LLUUID& getBlankImageAssetID() { return mBlankImageAssetID; } - - static void onBtnSetToDefault(void* userdata); - static void onBtnSelect(void* userdata); - static void onBtnCancel(void* userdata); - void onBtnPipette(); - //static void onBtnRevert( void* userdata ); - static void onBtnTransparent(void* userdata); - static void onBtnBlank(void* userdata); - static void onBtnNone(void* userdata); - static void onBtnClear(void* userdata); - static void onApplyUUID(void* userdata); - void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); - static void onShowFolders(LLUICtrl* ctrl, void* userdata); - static void onApplyImmediateCheck(LLUICtrl* ctrl, void* userdata); - void onTextureSelect(const LLTextureEntry& te); - - void onModeSelect(); - static void onBtnAdd(void* userdata); - static void onBtnRemove(void* userdata); - static void onBtnUpload(void* userdata); - void onLocalScrollCommit(); - - void setLocalTextureEnabled(BOOL enabled); - -protected: - LLPointer<LLViewerTexture> mTexturep; - LLView* mOwner; - - LLUUID mImageAssetID; // Currently selected texture - LLUIImagePtr mFallbackImage; // What to show if currently selected texture is null. - LLUUID mDefaultImageAssetID; - LLUUID mTransparentImageAssetID; - LLUUID mBlankImageAssetID; - BOOL mTentative; - BOOL mAllowNoTexture; - LLUUID mSpecialCurrentImageAssetID; // Used when the asset id has no corresponding texture in the user's inventory. - LLUUID mOriginalImageAssetID; - - std::string mLabel; - - LLTextBox* mTentativeLabel; - LLTextBox* mResolutionLabel; - - std::string mPendingName; - BOOL mActive; - - LLFilterEditor* mFilterEdit; - LLInventoryPanel* mInventoryPanel; - PermissionMask mImmediateFilterPermMask; - PermissionMask mDnDFilterPermMask; - PermissionMask mNonImmediateFilterPermMask; - BOOL mCanApplyImmediately; - BOOL mNoCopyTextureSelected; - F32 mContextConeOpacity; - LLSaveFolderState mSavedFolderState; - BOOL mSelectedItemPinned; - - LLRadioGroup* mModeSelector; - LLScrollListCtrl* mLocalScrollCtrl; - -private: - bool mCanApply; - bool mCanPreview; - bool mPreviewSettingChanged; - - texture_selected_callback mTextureSelectedCallback; - floater_close_callback mOnFloaterCloseCallback; - floater_commit_callback mOnFloaterCommitCallback; - set_image_asset_id_callback mSetImageAssetIDCallback; - set_on_update_image_stats_callback mOnUpdateImageStatsCallback; -}; - #endif // LL_LLTEXTURECTRL_H diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index aa964e21a503fa88168fe081b826722a692ae536..19a347dbfc713941e8dc3db06cd7ed60fa8ced08 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -307,7 +307,7 @@ private: } // Threads: Ttc - virtual void completed(bool success) + void completed(bool success) override { LLTextureFetchWorker* worker = mFetcher->getWorker(mID); if (worker) @@ -331,7 +331,7 @@ private: } // Threads: Ttc - virtual void completed(bool success) + void completed(bool success) override { LLTextureFetchWorker* worker = mFetcher->getWorker(mID); if (worker) @@ -355,7 +355,7 @@ private: } // Threads: Tid - virtual void completed(bool success, LLImageRaw* raw, LLImageRaw* aux) + void completed(bool success, LLImageRaw* raw, LLImageRaw* aux) override { LLTextureFetchWorker* worker = mFetcher->getWorker(mID); if (worker) @@ -388,13 +388,13 @@ private: public: // Threads: Ttf - /*virtual*/ bool doWork(S32 param); // Called from LLWorkerThread::processRequest() + /*virtual*/ bool doWork(S32 param) override; // Called from LLWorkerThread::processRequest() // Threads: Ttf - /*virtual*/ void finishWork(S32 param, bool completed); // called from finishRequest() (WORK THREAD) + /*virtual*/ void finishWork(S32 param, bool completed) override; // called from finishRequest() (WORK THREAD) // Threads: Tmain - /*virtual*/ bool deleteOK(); // called from update() + /*virtual*/ bool deleteOK() override; // called from update() ~LLTextureFetchWorker(); @@ -431,7 +431,7 @@ public: // Inherited from LLCore::HttpHandler // Threads: Ttf - virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) override; protected: LLTextureFetchWorker(LLTextureFetch* fetcher, FTType f_type, @@ -441,10 +441,10 @@ protected: private: // Threads: Tmain - /*virtual*/ void startWork(S32 param); // called from addWork() (MAIN THREAD) + /*virtual*/ void startWork(S32 param) override; // called from addWork() (MAIN THREAD) // Threads: Tmain - /*virtual*/ void endWork(S32 param, bool aborted); // called from doWork() (MAIN THREAD) + /*virtual*/ void endWork(S32 param, bool aborted) override; // called from doWork() (MAIN THREAD) // Locks: Mw void resetFormattedData(); @@ -777,7 +777,7 @@ public: virtual ~TFReqSetRegion() {} - virtual bool doWork(LLTextureFetch * fetcher); + bool doWork(LLTextureFetch * fetcher) override; public: const U64 mRegionHandle; @@ -826,7 +826,7 @@ public: virtual ~TFReqSendMetrics(); - virtual bool doWork(LLTextureFetch * fetcher); + bool doWork(LLTextureFetch * fetcher) override; public: const std::string mCapsURL; @@ -912,9 +912,9 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mDesiredSize(TEXTURE_CACHE_ENTRY_SIZE), mFileSize(0), mCachedSize(0), - mLoaded(FALSE), mSentRequest(UNSENT), mDecodeHandle(0), + mLoaded(FALSE), mDecoded(FALSE), mWritten(FALSE), mNeedsAux(FALSE), @@ -924,6 +924,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mCanUseHTTP(true), mRetryAttempt(0), mActiveCount(0), + mFetchRetryPolicy(10.0,3600.0,2.0,10), mWorkMutex(), mFirstPacket(0), mLastPacket(-1), @@ -939,8 +940,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mHttpHasResource(false), mCacheReadCount(0U), mCacheWriteCount(0U), - mResourceWaitCount(0U), - mFetchRetryPolicy(10.0,3600.0,2.0,10) + mResourceWaitCount(0U) { mCanUseNET = mUrl.empty() ; @@ -2541,6 +2541,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mTextureCache(cache), mImageDecodeThread(imagedecodethread), mTextureBandwidth(0), + mTextureInfoMainThread(false), mHTTPTextureBits(0), mTotalHTTPRequests(0), mQAMode(qa_mode), @@ -2555,23 +2556,22 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mTotalCacheWriteCount(0U), mTotalResourceWaitCount(0U), mFetchDebugger(NULL), - mFetchSource(LLTextureFetch::FROM_ALL), - mOriginFetchSource(LLTextureFetch::FROM_ALL), mFetcherLocked(FALSE), - mTextureInfoMainThread(false) + mFetchSource(LLTextureFetch::FROM_ALL), + mOriginFetchSource(LLTextureFetch::FROM_ALL) { mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); mTextureInfo.setLogging(true); LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp()); mHttpRequest = new LLCore::HttpRequest; - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); - mHttpOptionsWithHeaders = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpOptions = boost::make_shared<LLCore::HttpOptions>(); + mHttpOptionsWithHeaders = boost::make_shared<LLCore::HttpOptions>(); mHttpOptionsWithHeaders->setWantHeaders(true); - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpHeaders = boost::make_shared<LLCore::HttpHeaders>(); mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_IMAGE_X_J2C); mHttpPolicyClass = app_core_http.getPolicy(LLAppCoreHttp::AP_TEXTURE); - mHttpMetricsHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpMetricsHeaders = boost::make_shared<LLCore::HttpHeaders>(); mHttpMetricsHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); mHttpMetricsPolicyClass = app_core_http.getPolicy(LLAppCoreHttp::AP_REPORTING); mHttpHighWater = HTTP_NONPIPE_REQUESTS_HIGH_WATER; @@ -3959,7 +3959,7 @@ class AssetReportHandler : public LLCore::HttpHandler public: // Threads: Ttf - virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) + void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) override { LLCore::HttpStatus status(response->getStatus()); @@ -4130,7 +4130,8 @@ public: { setImage(image); } - virtual void completed(bool success) + + void completed(bool success) override { mDebugger->callbackCacheRead(mID, success, mFormattedImage, mImageSize, mImageLocal); } @@ -4146,7 +4147,8 @@ public: : mDebugger(debugger), mID(id) { } - virtual void completed(bool success) + + void completed(bool success) override { mDebugger->callbackCacheWrite(mID, success); } @@ -4162,7 +4164,8 @@ public: : mDebugger(debugger), mID(id) { } - virtual void completed(bool success, LLImageRaw* raw, LLImageRaw* aux) + + void completed(bool success, LLImageRaw* raw, LLImageRaw* aux) override { mDebugger->callbackDecoded(mID, success, raw, aux); } @@ -4235,7 +4238,7 @@ void LLTextureFetchDebugger::init() if (! mHttpHeaders) { - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpHeaders = boost::make_shared<LLCore::HttpHeaders>(); mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_IMAGE_X_J2C); } } diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index 4057a529e7b8438e061bbcf20ca7c0e8f2710bf1..6c6577906a74cc4a84b8c7e5ebe4dd69085ca8fc 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -512,7 +512,7 @@ void LLViewerAssetStorage::assetRequestCoro( LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("assetRequestCoro", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = boost::make_shared<LLCore::HttpOptions>(); LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts); diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index b639172024994c43c5960057121a9c304999d676..8fcf7c0957ebc4c47f023499211149dcaf493720 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -86,6 +86,8 @@ LLResourceUploadInfo::LLResourceUploadInfo(std::string name, std::string description, S32 compressionInfo, LLFolderType::EType destinationType, LLInventoryType::EType inventoryType, U32 nextOWnerPerms, U32 groupPerms, U32 everyonePerms, S32 expectedCost): + mTransactionId(), + mAssetType(LLAssetType::AT_NONE), mName(name), mDescription(description), mCompressionInfo(compressionInfo), @@ -95,8 +97,6 @@ LLResourceUploadInfo::LLResourceUploadInfo(std::string name, mGroupPerms(groupPerms), mEveryonePerms(everyonePerms), mExpectedUploadCost(expectedCost), - mTransactionId(), - mAssetType(LLAssetType::AT_NONE), mFolderId(LLUUID::null), mItemId(LLUUID::null), mAssetId(LLAssetID::null) @@ -105,7 +105,7 @@ LLResourceUploadInfo::LLResourceUploadInfo(std::string name, } LLResourceUploadInfo::LLResourceUploadInfo(LLAssetID assetId, LLAssetType::EType assetType, std::string name) : - mAssetId(assetId), + mTransactionId(), mAssetType(assetType), mName(name), mDescription(), @@ -116,9 +116,9 @@ LLResourceUploadInfo::LLResourceUploadInfo(LLAssetID assetId, LLAssetType::EType mGroupPerms(0), mEveryonePerms(0), mExpectedUploadCost(0), - mTransactionId(), mFolderId(LLUUID::null), - mItemId(LLUUID::null) + mItemId(LLUUID::null), + mAssetId(assetId) { } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index caf00a19484ad84d821bdfc9c3a0b1985ccbe076..354ab17f13faf34808eb59f0f943058c141c4992 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -232,7 +232,7 @@ public: LLInventoryHandler() : LLCommandHandler("inventory", UNTRUSTED_THROTTLE) { } bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) + LLMediaCtrl* web) override { if (params.size() < 1) { @@ -403,26 +403,26 @@ void LLViewerInventoryItem::updateServer(BOOL is_new) const if (AISAPI::isAvailable()) { - LLSD updates = asLLSD(); - // Replace asset_id and/or shadow_id with transaction_id (hash_id) - if (updates.has("asset_id")) - { - updates.erase("asset_id"); - if(getTransactionID().notNull()) + LLSD updates = asLLSD(); + // Replace asset_id and/or shadow_id with transaction_id (hash_id) + if (updates.has("asset_id")) { - updates["hash_id"] = getTransactionID(); + updates.erase("asset_id"); + if(getTransactionID().notNull()) + { + updates["hash_id"] = getTransactionID(); + } } - } - if (updates.has("shadow_id")) - { - updates.erase("shadow_id"); - if(getTransactionID().notNull()) + if (updates.has("shadow_id")) { - updates["hash_id"] = getTransactionID(); + updates.erase("shadow_id"); + if(getTransactionID().notNull()) + { + updates["hash_id"] = getTransactionID(); + } } - } - AISAPI::completion_t cr = boost::bind(&doInventoryCb, (LLPointer<LLInventoryCallback>)NULL, _1); - AISAPI::UpdateItem(getUUID(), updates, cr); + AISAPI::completion_t cr = boost::bind(&doInventoryCb, (LLPointer<LLInventoryCallback>)NULL, _1); + AISAPI::UpdateItem(getUUID(), updates, cr); } else { @@ -681,7 +681,7 @@ void LLViewerInventoryCategory::updateServer(BOOL is_new) const if (AISAPI::isAvailable()) { LLSD new_llsd = asLLSD(); - AISAPI::completion_t cr = boost::bind(&doInventoryCb, (LLPointer<LLInventoryCallback>)NULL, _1); + AISAPI::completion_t cr = boost::bind(&doInventoryCb, LLPointer<LLInventoryCallback>(NULL), _1); AISAPI::UpdateCategory(getUUID(), new_llsd, cr); } else @@ -1646,7 +1646,7 @@ public: mCB(cb) { } - /* virtual */ void fire(const LLUUID& item_id) {} + /* virtual */ void fire(const LLUUID& item_id) override {} ~LLRemoveCategoryOnDestroy() { LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(mID); @@ -2338,8 +2338,9 @@ class LLRegenerateLinkCollector : public LLInventoryCollectFunctor public: LLRegenerateLinkCollector(const LLViewerInventoryItem *target_item) : mTargetItem(target_item) {} virtual ~LLRegenerateLinkCollector() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item) + + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override { if (item) { diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 8b3c3ddc3a14db85b7f312e9a9b5fb6aa2ed6890..53902301ae7cd4d3fb4241af596428af2853097a 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -57,24 +57,24 @@ protected: mutable std::string mDisplayName; public: - virtual LLAssetType::EType getType() const; - virtual const LLUUID& getAssetUUID() const; + LLAssetType::EType getType() const override; + const LLUUID& getAssetUUID() const override; virtual const LLUUID& getProtectedAssetUUID() const; // returns LLUUID::null if current agent does not have permission to expose this asset's UUID to the user - virtual const std::string& getName() const; + const std::string& getName() const override; virtual S32 getSortField() const; //virtual void setSortField(S32 sortField); virtual void getSLURL(); //Caches SLURL for landmark. //*TODO: Find a better way to do it and remove this method from here. - virtual const LLPermissions& getPermissions() const; + const LLPermissions& getPermissions() const override; virtual const bool getIsFullPerm() const; // 'fullperm' in the popular sense: modify-ok & copy-ok & transfer-ok, no special god rules applied - virtual const LLUUID& getCreatorUUID() const; - virtual const std::string& getDescription() const; - virtual const LLSaleInfo& getSaleInfo() const; - virtual LLInventoryType::EType getInventoryType() const; + const LLUUID& getCreatorUUID() const override; + const std::string& getDescription() const override; + const LLSaleInfo& getSaleInfo() const override; + LLInventoryType::EType getInventoryType() const override; virtual bool isWearableType() const; virtual LLWearableType::EType getWearableType() const; - virtual U32 getFlags() const; - virtual time_t getCreationDate() const; - virtual U32 getCRC32() const; // really more of a checksum. + U32 getFlags() const override; + time_t getCreationDate() const override; + U32 getCRC32() const override; // really more of a checksum. static BOOL extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName); @@ -110,7 +110,7 @@ public: LLViewerInventoryItem(const LLInventoryItem* other); void copyViewerItem(const LLViewerInventoryItem* other); - /*virtual*/ void copyItem(const LLInventoryItem* other); + /*virtual*/ void copyItem(const LLInventoryItem* other) override; // construct a new clone of this item - it creates a new viewer // inventory item using the copy constructor, and returns it. @@ -118,15 +118,15 @@ public: void cloneViewerItem(LLPointer<LLViewerInventoryItem>& newitem) const; // virtual methods - virtual void updateParentOnServer(BOOL restamp) const; - virtual void updateServer(BOOL is_new) const; + void updateParentOnServer(BOOL restamp) const override; + void updateServer(BOOL is_new) const override; void fetchFromServer(void) const; - virtual void packMessage(LLMessageSystem* msg) const; - virtual BOOL unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); + void packMessage(LLMessageSystem* msg) const override; + BOOL unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0) override; virtual BOOL unpackMessage(const LLSD& item); - virtual BOOL importFile(LLFILE* fp); - virtual BOOL importLegacyStream(std::istream& input_stream); + BOOL importFile(LLFILE* fp) override; + BOOL importLegacyStream(std::istream& input_stream) override; // file handling on the viewer. These are not meant for anything // other than cacheing. @@ -196,10 +196,10 @@ public: LLViewerInventoryCategory(const LLViewerInventoryCategory* other); void copyViewerCategory(const LLViewerInventoryCategory* other); - virtual void updateParentOnServer(BOOL restamp_children) const; - virtual void updateServer(BOOL is_new) const; + void updateParentOnServer(BOOL restamp_children) const override; + void updateServer(BOOL is_new) const override; - virtual void packMessage(LLMessageSystem* msg) const; + void packMessage(LLMessageSystem* msg) const override; const LLUUID& getOwnerID() const { return mOwnerID; } @@ -226,7 +226,7 @@ public: bool importFileLocal(LLFILE* fp); void determineFolderType(); void changeType(LLFolderType::EType new_folder_type); - virtual void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); + void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0) override; virtual BOOL unpackMessage(const LLSD& category); // returns true if the category object will accept the incoming item @@ -266,7 +266,7 @@ public: void setTargetLandmarkId(const LLUUID& target_uuid) { mTargetLandmarkId = target_uuid; } private: - void fire(const LLUUID& inv_item); + void fire(const LLUUID& inv_item) override; LLUUID mTargetLandmarkId; }; @@ -292,8 +292,8 @@ public: } // virtual - void fire(const LLUUID& item_id) -{ + void fire(const LLUUID& item_id) override + { mFireFunc(item_id); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 0a38db16b1cc4216f83bd4ad231bc00fdefda8d1..32da8c51a862b09c2ded68a03cdceecbd032f4f5 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -321,7 +321,7 @@ class LLMenuParcelObserver : public LLParcelObserver public: LLMenuParcelObserver(); ~LLMenuParcelObserver(); - virtual void changed(); + void changed() override; }; static LLMenuParcelObserver* gMenuParcelObserver = NULL; @@ -539,7 +539,7 @@ void init_menus() class LLAdvancedToggleConsole : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string console_type = userdata.asString(); if ("texture" == console_type) @@ -568,7 +568,7 @@ class LLAdvancedToggleConsole : public view_listener_t }; class LLAdvancedCheckConsole : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string console_type = userdata.asString(); bool new_value = false; @@ -605,7 +605,7 @@ class LLAdvancedCheckConsole : public view_listener_t class LLAdvancedDumpInfoToConsole : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gDebugView->mDebugConsolep->setVisible(TRUE); std::string info_type = userdata.asString(); @@ -633,7 +633,7 @@ class LLAdvancedDumpInfoToConsole : public view_listener_t class LLAdvancedToggleHUDInfo : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string info_type = userdata.asString(); @@ -659,7 +659,7 @@ class LLAdvancedToggleHUDInfo : public view_listener_t class LLAdvancedCheckHUDInfo : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string info_type = userdata.asString(); bool new_value = false; @@ -690,7 +690,7 @@ class LLAdvancedCheckHUDInfo : public view_listener_t class LLAdvancedAgentFlyingInfo : public view_listener_t { - bool handleEvent(const LLSD&) + bool handleEvent(const LLSD&) override { return gAgent.getFlying(); } @@ -703,7 +703,7 @@ class LLAdvancedAgentFlyingInfo : public view_listener_t class LLAdvancedClearGroupCache : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLGroupMgr::debugClearAllGroups(NULL); return true; @@ -779,7 +779,7 @@ U32 render_type_from_string(std::string render_type) class LLAdvancedToggleRenderType : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { U32 render_type = render_type_from_string( userdata.asString() ); if ( render_type != 0 ) @@ -793,7 +793,7 @@ class LLAdvancedToggleRenderType : public view_listener_t class LLAdvancedCheckRenderType : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { U32 render_type = render_type_from_string( userdata.asString() ); bool new_value = false; @@ -854,7 +854,7 @@ U32 feature_from_string(std::string feature) class LLAdvancedToggleFeature : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { U32 feature = feature_from_string( userdata.asString() ); if ( feature != 0 ) @@ -867,8 +867,8 @@ class LLAdvancedToggleFeature : public view_listener_t class LLAdvancedCheckFeature : public view_listener_t { - bool handleEvent(const LLSD& userdata) -{ + bool handleEvent(const LLSD& userdata) override + { U32 feature = feature_from_string( userdata.asString() ); bool new_value = false; @@ -883,7 +883,7 @@ class LLAdvancedCheckFeature : public view_listener_t class LLAdvancedCheckDisplayTextureDensity : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string mode = userdata.asString(); if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY)) @@ -908,7 +908,7 @@ class LLAdvancedCheckDisplayTextureDensity : public view_listener_t class LLAdvancedSetDisplayTextureDensity : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string mode = userdata.asString(); if (mode == "none") @@ -1079,7 +1079,7 @@ U32 info_display_from_string(std::string info_display) class LLAdvancedToggleInfoDisplay : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { U32 info_display = info_display_from_string( userdata.asString() ); @@ -1097,7 +1097,7 @@ class LLAdvancedToggleInfoDisplay : public view_listener_t class LLAdvancedCheckInfoDisplay : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { U32 info_display = info_display_from_string( userdata.asString() ); bool new_value = false; @@ -1119,7 +1119,7 @@ class LLAdvancedCheckInfoDisplay : public view_listener_t class LLAdvancedToggleRandomizeFramerate : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gRandomizeFramerate = !(gRandomizeFramerate); return true; @@ -1128,7 +1128,7 @@ class LLAdvancedToggleRandomizeFramerate : public view_listener_t class LLAdvancedCheckRandomizeFramerate : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gRandomizeFramerate; return new_value; @@ -1142,7 +1142,7 @@ class LLAdvancedCheckRandomizeFramerate : public view_listener_t class LLAdvancedTogglePeriodicSlowFrame : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gPeriodicSlowFrame = !(gPeriodicSlowFrame); return true; @@ -1151,7 +1151,7 @@ class LLAdvancedTogglePeriodicSlowFrame : public view_listener_t class LLAdvancedCheckPeriodicSlowFrame : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gPeriodicSlowFrame; return new_value; @@ -1167,7 +1167,7 @@ class LLAdvancedCheckPeriodicSlowFrame : public view_listener_t class LLAdvancedToggleFrameTest : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLPipeline::sRenderFrameTest = !(LLPipeline::sRenderFrameTest); return true; @@ -1176,7 +1176,7 @@ class LLAdvancedToggleFrameTest : public view_listener_t class LLAdvancedCheckFrameTest : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLPipeline::sRenderFrameTest; return new_value; @@ -1191,7 +1191,7 @@ class LLAdvancedCheckFrameTest : public view_listener_t class LLAdvancedSelectedTextureInfo : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_selected_texture_info(NULL); return true; @@ -1204,7 +1204,7 @@ class LLAdvancedSelectedTextureInfo : public view_listener_t class LLAdvancedToggleWireframe : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gUseWireframe = !(gUseWireframe); gWindowResized = TRUE; @@ -1219,7 +1219,7 @@ class LLAdvancedToggleWireframe : public view_listener_t class LLAdvancedCheckWireframe : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gUseWireframe; return new_value; @@ -1233,7 +1233,7 @@ class LLAdvancedCheckWireframe : public view_listener_t class LLAdvancedDumpScriptedCamera : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_dump_followcam(NULL); return true; @@ -1249,8 +1249,8 @@ class LLAdvancedDumpScriptedCamera : public view_listener_t class LLAdvancedDumpRegionObjectCache : public view_listener_t { - bool handleEvent(const LLSD& userdata) -{ + bool handleEvent(const LLSD& userdata) override + { handle_dump_region_object_cache(NULL); return true; } @@ -1258,7 +1258,7 @@ class LLAdvancedDumpRegionObjectCache : public view_listener_t class LLAdvancedBuyCurrencyTest : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_buy_currency_test(NULL); return true; @@ -1273,7 +1273,7 @@ class LLAdvancedBuyCurrencyTest : public view_listener_t class LLAdvancedDumpSelectMgr : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { dump_select_mgr(NULL); return true; @@ -1289,7 +1289,7 @@ class LLAdvancedDumpSelectMgr : public view_listener_t class LLAdvancedDumpInventory : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { dump_inventory(NULL); return true; @@ -1305,7 +1305,7 @@ class LLAdvancedDumpInventory : public view_listener_t class LLAdvancedPrintSelectedObjectInfo : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { print_object_info(NULL); return true; @@ -1321,7 +1321,7 @@ class LLAdvancedPrintSelectedObjectInfo : public view_listener_t class LLAdvancedPrintAgentInfo : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { print_agent_nvpairs(NULL); return true; @@ -1335,7 +1335,7 @@ class LLAdvancedPrintAgentInfo : public view_listener_t class LLAdvancedToggleDebugClicks : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gDebugClicks = !(gDebugClicks); return true; @@ -1344,7 +1344,7 @@ class LLAdvancedToggleDebugClicks : public view_listener_t class LLAdvancedCheckDebugClicks : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gDebugClicks; return new_value; @@ -1360,7 +1360,7 @@ class LLAdvancedCheckDebugClicks : public view_listener_t class LLAdvancedToggleDebugViews : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLView::sDebugRects = !(LLView::sDebugRects); return true; @@ -1369,7 +1369,7 @@ class LLAdvancedToggleDebugViews : public view_listener_t class LLAdvancedCheckDebugViews : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLView::sDebugRects; return new_value; @@ -1385,7 +1385,7 @@ class LLAdvancedCheckDebugViews : public view_listener_t class LLAdvancedToggleXUINameTooltips : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { toggle_show_xui_names(NULL); return true; @@ -1394,7 +1394,7 @@ class LLAdvancedToggleXUINameTooltips : public view_listener_t class LLAdvancedCheckXUINameTooltips : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = check_show_xui_names(NULL); return new_value; @@ -1410,7 +1410,7 @@ class LLAdvancedCheckXUINameTooltips : public view_listener_t class LLAdvancedToggleDebugMouseEvents : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLView::sDebugMouseHandling = !(LLView::sDebugMouseHandling); return true; @@ -1419,7 +1419,7 @@ class LLAdvancedToggleDebugMouseEvents : public view_listener_t class LLAdvancedCheckDebugMouseEvents : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLView::sDebugMouseHandling; return new_value; @@ -1435,7 +1435,7 @@ class LLAdvancedCheckDebugMouseEvents : public view_listener_t class LLAdvancedToggleDebugKeys : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLView::sDebugKeys = !(LLView::sDebugKeys); return true; @@ -1444,7 +1444,7 @@ class LLAdvancedToggleDebugKeys : public view_listener_t class LLAdvancedCheckDebugKeys : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLView::sDebugKeys; return new_value; @@ -1460,7 +1460,7 @@ class LLAdvancedCheckDebugKeys : public view_listener_t class LLAdvancedToggleDebugWindowProc : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gDebugWindowProc = !(gDebugWindowProc); return true; @@ -1469,7 +1469,7 @@ class LLAdvancedToggleDebugWindowProc : public view_listener_t class LLAdvancedCheckDebugWindowProc : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gDebugWindowProc; return new_value; @@ -1480,7 +1480,7 @@ class LLAdvancedCheckDebugWindowProc : public view_listener_t class LLAdvancedSendTestIms : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLIMModel::instance().testMessages(); return true; @@ -1494,7 +1494,7 @@ class LLAdvancedSendTestIms : public view_listener_t class LLAdvancedGrabBakedTexture : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string texture_type = userdata.asString(); if ("iris" == texture_type) @@ -1528,8 +1528,8 @@ class LLAdvancedGrabBakedTexture : public view_listener_t class LLAdvancedEnableGrabBakedTexture : public view_listener_t { - bool handleEvent(const LLSD& userdata) -{ + bool handleEvent(const LLSD& userdata) override + { std::string texture_type = userdata.asString(); bool new_value = false; @@ -1569,7 +1569,7 @@ class LLAdvancedEnableGrabBakedTexture : public view_listener_t class LLAdvancedEnableAppearanceToXML : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); } @@ -1577,7 +1577,7 @@ class LLAdvancedEnableAppearanceToXML : public view_listener_t class LLAdvancedAppearanceToXML : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string emptyname; LLVOAvatar* avatar = @@ -1600,7 +1600,7 @@ class LLAdvancedAppearanceToXML : public view_listener_t class LLAdvancedToggleCharacterGeometry : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_god_request_avatar_geometry(NULL); return true; @@ -1614,7 +1614,7 @@ class LLAdvancedToggleCharacterGeometry : public view_listener_t class LLAdvancedTestMale : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_test_male(NULL); return true; @@ -1624,7 +1624,7 @@ class LLAdvancedTestMale : public view_listener_t class LLAdvancedTestFemale : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_test_female(NULL); return true; @@ -1633,7 +1633,7 @@ class LLAdvancedTestFemale : public view_listener_t class LLAdvancedForceParamsToDefault : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLAgent::clearVisualParams(NULL); return true; @@ -1658,7 +1658,7 @@ static void set_all_animation_time_factors(F32 time_factor) class LLAdvancedAnimTenFaster : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { //LL_INFOS() << "LLAdvancedAnimTenFaster" << LL_ENDL; F32 time_factor = LLMotionController::getCurrentTimeFactor(); @@ -1670,7 +1670,7 @@ class LLAdvancedAnimTenFaster : public view_listener_t class LLAdvancedAnimTenSlower : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { //LL_INFOS() << "LLAdvancedAnimTenSlower" << LL_ENDL; F32 time_factor = LLMotionController::getCurrentTimeFactor(); @@ -1682,7 +1682,7 @@ class LLAdvancedAnimTenSlower : public view_listener_t class LLAdvancedAnimResetAll : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { set_all_animation_time_factors(1.f); return true; @@ -1697,7 +1697,7 @@ class LLAdvancedAnimResetAll : public view_listener_t class LLAdvancedReloadVertexShader : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { reload_vertex_shader(NULL); return true; @@ -1713,7 +1713,7 @@ class LLAdvancedReloadVertexShader : public view_listener_t class LLAdvancedToggleAnimationInfo : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar::sShowAnimationDebug = !(LLVOAvatar::sShowAnimationDebug); return true; @@ -1722,7 +1722,7 @@ class LLAdvancedToggleAnimationInfo : public view_listener_t class LLAdvancedCheckAnimationInfo : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLVOAvatar::sShowAnimationDebug; return new_value; @@ -1737,7 +1737,7 @@ class LLAdvancedCheckAnimationInfo : public view_listener_t class LLAdvancedToggleShowLookAt : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool value = !gSavedSettings.getBOOL("AlchemyLookAtShow"); gSavedSettings.setBOOL("AlchemyLookAtShow", value); @@ -1747,7 +1747,7 @@ class LLAdvancedToggleShowLookAt : public view_listener_t class LLAdvancedCheckShowLookAt : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gSavedSettings.getBOOL("AlchemyLookAtShow"); return new_value; @@ -1763,7 +1763,7 @@ class LLAdvancedCheckShowLookAt : public view_listener_t class LLAdvancedToggleShowPointAt : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLHUDEffectPointAt::sDebugPointAt = !(LLHUDEffectPointAt::sDebugPointAt); return true; @@ -1772,7 +1772,7 @@ class LLAdvancedToggleShowPointAt : public view_listener_t class LLAdvancedCheckShowPointAt : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLHUDEffectPointAt::sDebugPointAt; return new_value; @@ -1788,7 +1788,7 @@ class LLAdvancedCheckShowPointAt : public view_listener_t class LLAdvancedToggleDebugJointUpdates : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar::sJointDebug = !(LLVOAvatar::sJointDebug); return true; @@ -1797,7 +1797,7 @@ class LLAdvancedToggleDebugJointUpdates : public view_listener_t class LLAdvancedCheckDebugJointUpdates : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLVOAvatar::sJointDebug; return new_value; @@ -1813,7 +1813,7 @@ class LLAdvancedCheckDebugJointUpdates : public view_listener_t class LLAdvancedToggleDisableLOD : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLViewerJoint::sDisableLOD = !(LLViewerJoint::sDisableLOD); return true; @@ -1822,7 +1822,7 @@ class LLAdvancedToggleDisableLOD : public view_listener_t class LLAdvancedCheckDisableLOD : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLViewerJoint::sDisableLOD; return new_value; @@ -1838,7 +1838,7 @@ class LLAdvancedCheckDisableLOD : public view_listener_t class LLAdvancedToggleDebugCharacterVis : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar::sDebugInvisible = !(LLVOAvatar::sDebugInvisible); return true; @@ -1847,7 +1847,7 @@ class LLAdvancedToggleDebugCharacterVis : public view_listener_t class LLAdvancedCheckDebugCharacterVis : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLVOAvatar::sDebugInvisible; return new_value; @@ -1862,7 +1862,7 @@ class LLAdvancedCheckDebugCharacterVis : public view_listener_t class LLAdvancedDumpAttachments : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_dump_attachments(NULL); return true; @@ -1878,7 +1878,7 @@ class LLAdvancedDumpAttachments : public view_listener_t class LLAdvancedRebakeTextures : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_rebake_textures(NULL); return true; @@ -1894,7 +1894,7 @@ class LLAdvancedRebakeTextures : public view_listener_t class LLAdvancedDebugAvatarTextures : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { #if LINDEN_RULES if (gAgent.isGodlike()) @@ -1913,7 +1913,7 @@ class LLAdvancedDebugAvatarTextures : public view_listener_t class LLAdvancedDumpAvatarLocalTextures : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { #ifndef LL_RELEASE_FOR_DOWNLOAD handle_dump_avatar_local_textures(NULL); @@ -1931,7 +1931,7 @@ class LLAdvancedDumpAvatarLocalTextures : public view_listener_t class LLAdvancedEnableMessageLog : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_viewer_enable_message_log(NULL); return true; @@ -1940,7 +1940,7 @@ class LLAdvancedEnableMessageLog : public view_listener_t class LLAdvancedDisableMessageLog : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_viewer_disable_message_log(NULL); return true; @@ -1954,7 +1954,7 @@ class LLAdvancedDisableMessageLog : public view_listener_t class LLAdvancedDropPacket : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gMessageSystem->mPacketRing.dropPackets(1); return true; @@ -1969,7 +1969,7 @@ class LLAdvancedDropPacket : public view_listener_t class LLAdvancedViewerEventRecorder : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string command = userdata.asString(); if ("start playback" == command) @@ -2007,7 +2007,7 @@ class LLAdvancedViewerEventRecorder : public view_listener_t class LLAdvancedAgentPilot : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string command = userdata.asString(); if ("start playback" == command) @@ -2041,7 +2041,7 @@ class LLAdvancedAgentPilot : public view_listener_t class LLAdvancedToggleAgentPilotLoop : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gAgentPilot.setLoop(!gAgentPilot.getLoop()); return true; @@ -2050,7 +2050,7 @@ class LLAdvancedToggleAgentPilotLoop : public view_listener_t class LLAdvancedCheckAgentPilotLoop : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gAgentPilot.getLoop(); return new_value; @@ -2065,7 +2065,7 @@ class LLAdvancedCheckAgentPilotLoop : public view_listener_t class LLAdvancedToggleShowObjectUpdates : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gShowObjectUpdates = !(gShowObjectUpdates); return true; @@ -2074,7 +2074,7 @@ class LLAdvancedToggleShowObjectUpdates : public view_listener_t class LLAdvancedCheckShowObjectUpdates : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gShowObjectUpdates; return new_value; @@ -2091,7 +2091,7 @@ class LLAdvancedCheckShowObjectUpdates : public view_listener_t class LLAdvancedCheckViewerUpdates : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLFloaterAboutUtil::checkUpdatesAndNotify(); return true; @@ -2106,7 +2106,7 @@ class LLAdvancedCheckViewerUpdates : public view_listener_t class LLAdvancedCompressImage : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_compress_image(NULL); return true; @@ -2121,7 +2121,7 @@ class LLAdvancedCompressImage : public view_listener_t class LLAdvancedShowDebugSettings : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLFloaterReg::showInstance("settings_debug",userdata); return true; @@ -2136,7 +2136,7 @@ class LLAdvancedShowDebugSettings : public view_listener_t class LLAdvancedEnableViewAdminOptions : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { // Don't enable in god mode since the admin menu is shown anyway. // Only enable if the user has set the appropriate debug setting. @@ -2147,7 +2147,7 @@ class LLAdvancedEnableViewAdminOptions : public view_listener_t class LLAdvancedToggleViewAdminOptions : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_admin_override_toggle(NULL); return true; @@ -2156,7 +2156,7 @@ class LLAdvancedToggleViewAdminOptions : public view_listener_t class LLAdvancedToggleVisualLeakDetector : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_visual_leak_detector_toggle(NULL); return true; @@ -2165,7 +2165,7 @@ class LLAdvancedToggleVisualLeakDetector : public view_listener_t class LLAdvancedCheckViewAdminOptions : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = check_admin_override(NULL) || gAgent.isGodlike(); return new_value; @@ -2177,7 +2177,7 @@ class LLAdvancedCheckViewAdminOptions : public view_listener_t ///////////////////////////////////// class LLAdvancedEnableObjectObjectOcclusion: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gGLManager.mHasOcclusionQuery; // && LLFeatureManager::getInstance()->isFeatureAvailable(userdata.asString()); @@ -2190,7 +2190,7 @@ class LLAdvancedEnableObjectObjectOcclusion: public view_listener_t ///////////////////////////////////// class LLAdvancedEnableRenderFBO: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gGLManager.mHasFramebufferObject; return new_value; @@ -2202,7 +2202,7 @@ class LLAdvancedEnableRenderFBO: public view_listener_t ///////////////////////////////////// class LLAdvancedEnableRenderDeferred: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gGLManager.mHasFramebufferObject && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_WINDLIGHT) > 1 && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) > 0; @@ -2215,7 +2215,7 @@ class LLAdvancedEnableRenderDeferred: public view_listener_t ///////////////////////////////////// class LLAdvancedEnableRenderDeferredOptions: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gGLManager.mHasFramebufferObject && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_WINDLIGHT) > 1 && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) > 0 && gSavedSettings.getBOOL("RenderDeferred"); @@ -2232,7 +2232,7 @@ class LLAdvancedEnableRenderDeferredOptions: public view_listener_t class LLAdvancedRequestAdminStatus : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_god_mode(NULL); return true; @@ -2241,7 +2241,7 @@ class LLAdvancedRequestAdminStatus : public view_listener_t class LLAdvancedLeaveAdminStatus : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_leave_god_mode(NULL); return true; @@ -2255,7 +2255,7 @@ class LLAdvancedLeaveAdminStatus : public view_listener_t class LLAdvancedForceErrorBreakpoint : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { force_error_breakpoint(NULL); return true; @@ -2264,7 +2264,7 @@ class LLAdvancedForceErrorBreakpoint : public view_listener_t class LLAdvancedForceErrorLlerror : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { force_error_llerror(NULL); return true; @@ -2272,7 +2272,7 @@ class LLAdvancedForceErrorLlerror : public view_listener_t }; class LLAdvancedForceErrorBadMemoryAccess : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { force_error_bad_memory_access(NULL); return true; @@ -2281,7 +2281,7 @@ class LLAdvancedForceErrorBadMemoryAccess : public view_listener_t class LLAdvancedForceErrorInfiniteLoop : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { force_error_infinite_loop(NULL); return true; @@ -2290,7 +2290,7 @@ class LLAdvancedForceErrorInfiniteLoop : public view_listener_t class LLAdvancedForceErrorSoftwareException : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { force_error_software_exception(NULL); return true; @@ -2299,7 +2299,7 @@ class LLAdvancedForceErrorSoftwareException : public view_listener_t class LLAdvancedForceErrorDriverCrash : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { force_error_driver_crash(NULL); return true; @@ -2308,7 +2308,7 @@ class LLAdvancedForceErrorDriverCrash : public view_listener_t class LLAdvancedForceErrorDisconnectViewer : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_disconnect_viewer(NULL); return true; @@ -2320,7 +2320,7 @@ class LLAdvancedForceErrorDisconnectViewer : public view_listener_t class LLAdvancedHandleToggleHackedGodmode : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_toggle_hacked_godmode(NULL); return true; @@ -2329,7 +2329,7 @@ class LLAdvancedHandleToggleHackedGodmode : public view_listener_t class LLAdvancedCheckToggleHackedGodmode : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { check_toggle_hacked_godmode(NULL); return true; @@ -2338,7 +2338,7 @@ class LLAdvancedCheckToggleHackedGodmode : public view_listener_t class LLAdvancedEnableToggleHackedGodmode : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = enable_toggle_hacked_godmode(NULL); return new_value; @@ -2359,7 +2359,7 @@ class LLAdvancedEnableToggleHackedGodmode : public view_listener_t class LLDevelopCheckLoggingLevel : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { U32 level = userdata.asInteger(); return (static_cast<LLError::ELevel>(level) == LLError::getDefaultLevel()); @@ -2368,7 +2368,7 @@ class LLDevelopCheckLoggingLevel : public view_listener_t class LLDevelopSetLoggingLevel : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { U32 level = userdata.asInteger(); LLError::setDefaultLevel(static_cast<LLError::ELevel>(level)); @@ -2378,7 +2378,7 @@ class LLDevelopSetLoggingLevel : public view_listener_t class LLDevelopTextureFetchDebugger : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return gSavedSettings.getBOOL("TextureFetchDebuggerEnabled"); } @@ -2391,7 +2391,7 @@ class LLDevelopTextureFetchDebugger : public view_listener_t // Admin > Object class LLAdminForceTakeCopy : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { force_take_copy(NULL); return true; @@ -2400,7 +2400,7 @@ class LLAdminForceTakeCopy : public view_listener_t class LLAdminHandleObjectOwnerSelf : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_object_owner_self(NULL); return true; @@ -2408,7 +2408,7 @@ class LLAdminHandleObjectOwnerSelf : public view_listener_t }; class LLAdminHandleObjectOwnerPermissive : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_object_owner_permissive(NULL); return true; @@ -2417,7 +2417,7 @@ class LLAdminHandleObjectOwnerPermissive : public view_listener_t class LLAdminHandleForceDelete : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_force_delete(NULL); return true; @@ -2426,7 +2426,7 @@ class LLAdminHandleForceDelete : public view_listener_t class LLAdminHandleObjectLock : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_object_lock(NULL); return true; @@ -2435,7 +2435,7 @@ class LLAdminHandleObjectLock : public view_listener_t class LLAdminHandleObjectAssetIDs: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_object_asset_ids(NULL); return true; @@ -2445,7 +2445,7 @@ class LLAdminHandleObjectAssetIDs: public view_listener_t //Admin >Parcel class LLAdminHandleForceParcelOwnerToMe: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_force_parcel_owner_to_me(NULL); return true; @@ -2453,7 +2453,7 @@ class LLAdminHandleForceParcelOwnerToMe: public view_listener_t }; class LLAdminHandleForceParcelToContent: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_force_parcel_to_content(NULL); return true; @@ -2461,7 +2461,7 @@ class LLAdminHandleForceParcelToContent: public view_listener_t }; class LLAdminHandleClaimPublicLand: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_claim_public_land(NULL); return true; @@ -2471,7 +2471,7 @@ class LLAdminHandleClaimPublicLand: public view_listener_t // Admin > Region class LLAdminHandleRegionDumpTempAssetData: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_region_dump_temp_asset_data(NULL); return true; @@ -2481,7 +2481,7 @@ class LLAdminHandleRegionDumpTempAssetData: public view_listener_t class LLAdminOnSaveState: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLPanelRegionTools::onSaveState(NULL); return true; @@ -2534,7 +2534,7 @@ void cleanup_menus() class LLObjectReportAbuse : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (objectp) @@ -2548,7 +2548,7 @@ class LLObjectReportAbuse : public view_listener_t // Enabled it you clicked an object class LLObjectEnableReportAbuse : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLSelectMgr::getInstance()->getSelection()->getObjectCount() != 0; return new_value; @@ -2661,7 +2661,7 @@ bool enable_object_open() class LLViewJoystickFlycam : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_toggle_flycam(); return true; @@ -2670,7 +2670,7 @@ class LLViewJoystickFlycam : public view_listener_t class LLViewCheckJoystickFlycam : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLViewerJoystick::getInstance()->getOverrideCamera(); return new_value; @@ -2684,7 +2684,7 @@ void handle_toggle_flycam() class LLObjectBuild : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if (gAgentCamera.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit() && gSavedSettings.getBOOL("EditCameraMovement") ) { @@ -2775,7 +2775,7 @@ void handle_object_inspect() //--------------------------------------------------------------------------- class LLLandBuild : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLViewerParcelMgr::getInstance()->deselectLand(); @@ -2807,7 +2807,7 @@ class LLLandBuild : public view_listener_t class LLLandBuyPass : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLPanelLandGeneral::onClickBuyPass((void *)FALSE); return true; @@ -2816,7 +2816,7 @@ class LLLandBuyPass : public view_listener_t class LLLandEnableBuyPass : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLPanelLandGeneral::enableBuyPass(NULL); return new_value; @@ -2906,7 +2906,7 @@ bool enable_object_select_in_pathfinding_characters() class LLSelfRemoveAllAttachments : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLAppearanceMgr::instance().removeAllAttachmentsFromAvatar(); return true; @@ -2915,7 +2915,7 @@ class LLSelfRemoveAllAttachments : public view_listener_t class LLSelfEnableRemoveAllAttachments : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = false; if (isAgentAvatarValid()) @@ -3005,7 +3005,7 @@ bool enable_object_unmute() // 0 = normal, 1 = always, 2 = never class LLAvatarCheckImpostorMode : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (!object) return false; @@ -3031,7 +3031,7 @@ class LLAvatarCheckImpostorMode : public view_listener_t // 0 = normal, 1 = always, 2 = never class LLAvatarSetImpostorMode : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (!object) return false; @@ -3063,7 +3063,7 @@ class LLAvatarSetImpostorMode : public view_listener_t class LLObjectMute : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (!object) return true; @@ -3150,7 +3150,7 @@ bool handle_go_to() class LLGoToObject : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return handle_go_to(); } @@ -3158,7 +3158,7 @@ class LLGoToObject : public view_listener_t class LLAvatarReportAbuse : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar) @@ -3195,7 +3195,7 @@ void handle_avatar_freeze(const LLSD& avatar_id) class LLAvatarVisibleDebug : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return gAgent.isGodlike(); } @@ -3203,7 +3203,7 @@ class LLAvatarVisibleDebug : public view_listener_t class LLAvatarDebug : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if( avatar ) @@ -3508,7 +3508,7 @@ void handle_dump_focus() class LLSelfStandUp : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gAgent.standUp(); return true; @@ -3522,7 +3522,7 @@ bool enable_standup_self() class LLSelfSitDown : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if (!gAgentAvatarp->isSitting()) { @@ -3543,8 +3543,8 @@ bool enable_sitdown_self() class LLCheckPanelPeopleTab : public view_listener_t { - bool handleEvent(const LLSD& userdata) - { + bool handleEvent(const LLSD& userdata) override + { std::string panel_name = userdata.asString(); LLPanel *panel = LLFloaterSidePanelContainer::getPanel("people", panel_name); @@ -3558,7 +3558,7 @@ class LLCheckPanelPeopleTab : public view_listener_t // Toggle one of "People" panel tabs in side tray. class LLTogglePanelPeopleTab : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string panel_name = userdata.asString(); @@ -3770,7 +3770,7 @@ bool LLHaveCallingcard::operator()(LLInventoryCategory* cat, // Enable a menu item when you don't have someone's card. class LLAvatarEnableAddFriend : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()); @@ -3805,7 +3805,7 @@ void request_friendship(const LLUUID& dest_id) class LLEditEnableCustomizeAvatar : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gAgentWearables.areWearablesLoaded(); return new_value; @@ -3814,7 +3814,7 @@ class LLEditEnableCustomizeAvatar : public view_listener_t class LLEnableEditShape : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return gAgentWearables.isWearableModifiable(LLWearableType::WT_SHAPE, 0); } @@ -3822,7 +3822,7 @@ class LLEnableEditShape : public view_listener_t class LLEnableEditPhysics : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { //return gAgentWearables.isWearableModifiable(LLWearableType::WT_SHAPE, 0); return TRUE; @@ -3891,7 +3891,7 @@ void near_sit_down_point(BOOL success, void *) class LLLandSit : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gAgent.standUp(); LLViewerParcelMgr::getInstance()->deselectLand(); @@ -3944,7 +3944,7 @@ void handle_reset_view() class LLViewResetView : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { handle_reset_view(); return true; @@ -3965,7 +3965,7 @@ void reset_view_final( BOOL proceed ) class LLViewLookAtLastChatter : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gAgentCamera.lookAtLastChat(); return true; @@ -3974,7 +3974,7 @@ class LLViewLookAtLastChatter : public view_listener_t class LLViewMouselook : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if (!gAgentCamera.cameraMouselook()) { @@ -3990,7 +3990,7 @@ class LLViewMouselook : public view_listener_t class LLViewDefaultUISize : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gSavedSettings.setF32("UIScaleFactor", 1.0f); gSavedSettings.setBOOL("UIAutoScale", FALSE); @@ -4001,7 +4001,7 @@ class LLViewDefaultUISize : public view_listener_t class LLViewToggleUI : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if(gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK) { @@ -4438,7 +4438,7 @@ public: LLObjectReturn() : mFirstRegion(NULL) {} private: - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; @@ -4481,7 +4481,7 @@ private: // over land you own. class LLObjectEnableReturn : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) { @@ -4759,7 +4759,7 @@ bool enable_how_to_visible(const LLSD& param) class LLToolsEnableBuyOrTake : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool is_buy = is_selection_buy_not_take(); bool new_value = is_buy ? enable_buy_object() : enable_take(); @@ -4920,7 +4920,7 @@ BOOL sitting_on_selection() class LLToolsSaveToObjectInventory : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if(node && (node->mValid) && (!node->mFromTaskID.isNull())) @@ -4934,7 +4934,7 @@ class LLToolsSaveToObjectInventory : public view_listener_t class LLToolsEnablePathfinding : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return (LLPathfindingManager::getInstance() != NULL) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion(); } @@ -4942,7 +4942,7 @@ class LLToolsEnablePathfinding : public view_listener_t class LLToolsEnablePathfindingView : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return (LLPathfindingManager::getInstance() != NULL) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLPathfindingManager::getInstance()->isPathfindingViewEnabled(); } @@ -4950,7 +4950,7 @@ class LLToolsEnablePathfindingView : public view_listener_t class LLToolsDoPathfindingRebakeRegion : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool hasPathfinding = (LLPathfindingManager::getInstance() != NULL); @@ -4965,7 +4965,7 @@ class LLToolsDoPathfindingRebakeRegion : public view_listener_t class LLToolsEnablePathfindingRebakeRegion : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool returnValue = false; @@ -4982,7 +4982,7 @@ class LLToolsEnablePathfindingRebakeRegion : public view_listener_t // Round the position of all root objects to the grid class LLToolsSnapObjectXY : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { F64 snap_size = (F64)gSavedSettings.getF32("GridResolution"); @@ -5029,7 +5029,7 @@ class LLToolsSnapObjectXY : public view_listener_t // Determine if the option to cycle between linked prims is shown class LLToolsEnableSelectNextPart : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = (!LLSelectMgr::getInstance()->getSelection()->isEmpty() && (gSavedSettings.getBOOL("EditLinkedParts") @@ -5043,7 +5043,7 @@ class LLToolsEnableSelectNextPart : public view_listener_t // resis. Need link position added to sim messages to address this. class LLToolsSelectNextPartFace : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool cycle_faces = LLToolFace::getInstance() == LLToolMgr::getInstance()->getCurrentTool(); bool cycle_linked = gSavedSettings.getBOOL("EditLinkedParts"); @@ -5197,7 +5197,7 @@ class LLToolsSelectNextPartFace : public view_listener_t class LLToolsStopAllAnimations : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gAgent.stopCurrentAnimations(); return true; @@ -5206,7 +5206,7 @@ class LLToolsStopAllAnimations : public view_listener_t class LLToolsReleaseKeys : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gAgent.forceReleaseControls(); @@ -5216,7 +5216,7 @@ class LLToolsReleaseKeys : public view_listener_t class LLToolsEnableReleaseKeys : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return gAgent.anyControlGrabbed(); } @@ -5225,7 +5225,7 @@ class LLToolsEnableReleaseKeys : public view_listener_t class LLEditEnableCut : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canCut(); return new_value; @@ -5234,7 +5234,7 @@ class LLEditEnableCut : public view_listener_t class LLEditCut : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if( LLEditMenuHandler::gEditMenuHandler ) { @@ -5246,7 +5246,7 @@ class LLEditCut : public view_listener_t class LLEditEnableCopy : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canCopy(); return new_value; @@ -5255,7 +5255,7 @@ class LLEditEnableCopy : public view_listener_t class LLEditCopy : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if( LLEditMenuHandler::gEditMenuHandler ) { @@ -5267,7 +5267,7 @@ class LLEditCopy : public view_listener_t class LLEditEnablePaste : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canPaste(); return new_value; @@ -5276,7 +5276,7 @@ class LLEditEnablePaste : public view_listener_t class LLEditPaste : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if( LLEditMenuHandler::gEditMenuHandler ) { @@ -5288,7 +5288,7 @@ class LLEditPaste : public view_listener_t class LLEditEnableDelete : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete(); return new_value; @@ -5297,7 +5297,7 @@ class LLEditEnableDelete : public view_listener_t class LLEditDelete : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { // If a text field can do a deletion, it gets precedence over deleting // an object in the world. @@ -5476,7 +5476,7 @@ void handle_force_delete(void*) class LLViewEnableJoystickFlycam : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = (gSavedSettings.getBOOL("JoystickEnabled") && gSavedSettings.getBOOL("JoystickFlycamEnabled")); return new_value; @@ -5485,7 +5485,7 @@ class LLViewEnableJoystickFlycam : public view_listener_t class LLViewEnableLastChatter : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { // *TODO: add check that last chatter is in range bool new_value = (gAgentCamera.cameraThirdPerson() && gAgent.getLastChatter().notNull()); @@ -5495,7 +5495,7 @@ class LLViewEnableLastChatter : public view_listener_t class LLEditEnableDeselect : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDeselect(); return new_value; @@ -5504,7 +5504,7 @@ class LLEditEnableDeselect : public view_listener_t class LLEditDeselect : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if( LLEditMenuHandler::gEditMenuHandler ) { @@ -5516,7 +5516,7 @@ class LLEditDeselect : public view_listener_t class LLEditEnableSelectAll : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canSelectAll(); return new_value; @@ -5526,7 +5526,7 @@ class LLEditEnableSelectAll : public view_listener_t class LLEditSelectAll : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if( LLEditMenuHandler::gEditMenuHandler ) { @@ -5539,7 +5539,7 @@ class LLEditSelectAll : public view_listener_t class LLEditEnableUndo : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canUndo(); return new_value; @@ -5548,7 +5548,7 @@ class LLEditEnableUndo : public view_listener_t class LLEditUndo : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canUndo() ) { @@ -5560,7 +5560,7 @@ class LLEditUndo : public view_listener_t class LLEditEnableRedo : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canRedo(); return new_value; @@ -5569,7 +5569,7 @@ class LLEditEnableRedo : public view_listener_t class LLEditRedo : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canRedo() ) { @@ -5684,7 +5684,7 @@ void toggle_debug_menus(void*) class LLCommunicateNearbyChat : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLFloaterIMContainer* im_box = LLFloaterIMContainer::getInstance(); bool nearby_visible = LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat")->isInVisibleChain(); @@ -5702,7 +5702,7 @@ class LLCommunicateNearbyChat : public view_listener_t class LLWorldSetHomeLocation : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { // we just send the message and let the server check for failure cases // server will echo back a "Home position set." alert if it succeeds @@ -5714,7 +5714,7 @@ class LLWorldSetHomeLocation : public view_listener_t class LLWorldTeleportHome : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gAgent.teleportHome(); return true; @@ -5723,7 +5723,7 @@ class LLWorldTeleportHome : public view_listener_t class LLWorldAlwaysRun : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { // as well as altering the default walk-vs-run state, // we also change the *current* walk-vs-run state. @@ -5750,7 +5750,7 @@ class LLWorldAlwaysRun : public view_listener_t class LLWorldCheckAlwaysRun : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gAgent.getAlwaysRun(); return new_value; @@ -5759,7 +5759,7 @@ class LLWorldCheckAlwaysRun : public view_listener_t class LLWorldSetAway : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if (gAgent.getAFK()) { @@ -5775,7 +5775,7 @@ class LLWorldSetAway : public view_listener_t class LLWorldSetDoNotDisturb : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if (gAgent.isDoNotDisturb()) { @@ -5792,7 +5792,7 @@ class LLWorldSetDoNotDisturb : public view_listener_t class LLWorldCreateLandmark : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); @@ -5802,7 +5802,7 @@ class LLWorldCreateLandmark : public view_listener_t class LLWorldPlaceProfile : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "agent")); @@ -5876,7 +5876,7 @@ void handle_zoom_to_object(LLUUID object_id) class LLAvatarInviteToGroup : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar) @@ -5889,7 +5889,7 @@ class LLAvatarInviteToGroup : public view_listener_t class LLAvatarAddFriend : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar && !LLAvatarActions::isFriend(avatar->getID())) @@ -5903,7 +5903,7 @@ class LLAvatarAddFriend : public view_listener_t class LLAvatarToggleMyProfile : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLFloater* instance = LLAvatarActions::getProfileFloater(gAgent.getID()); if (LLFloater::isMinimized(instance)) @@ -5929,7 +5929,7 @@ class LLAvatarToggleMyProfile : public view_listener_t class LLAvatarResetSkeleton: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar) @@ -5942,7 +5942,7 @@ class LLAvatarResetSkeleton: public view_listener_t class LLAvatarResetSkeletonAndAnimations : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); if (avatar) @@ -5955,7 +5955,7 @@ class LLAvatarResetSkeletonAndAnimations : public view_listener_t class LLAvatarAddContact : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar) @@ -6130,7 +6130,7 @@ void handle_buy_currency() class LLFloaterVisible : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string floater_name = userdata.asString(); bool new_value = false; @@ -6143,7 +6143,7 @@ class LLFloaterVisible : public view_listener_t class LLShowHelp : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string help_topic = userdata.asString(); LLViewerHelp* vhelp = LLViewerHelp::getInstance(); @@ -6154,7 +6154,7 @@ class LLShowHelp : public view_listener_t class LLToggleHelp : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLFloater* help_browser = (LLFloaterReg::findInstance("help_browser")); if (help_browser && help_browser->isInVisibleChain()) @@ -6173,7 +6173,7 @@ class LLToggleHelp : public view_listener_t class LLToggleSpeak : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVoiceClient::getInstance()->toggleUserPTTState(); return true; @@ -6181,7 +6181,7 @@ class LLToggleSpeak : public view_listener_t }; class LLShowSidetrayPanel : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string floater_name = userdata.asString(); @@ -6203,7 +6203,7 @@ class LLShowSidetrayPanel : public view_listener_t class LLSidetrayPanelVisible : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string floater_name = userdata.asString(); // Toggle the panel @@ -6232,7 +6232,7 @@ bool callback_show_url(const LLSD& notification, const LLSD& response) class LLPromptShowURL : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string param = userdata.asString(); std::string::size_type offset = param.find(','); @@ -6272,7 +6272,7 @@ bool callback_show_file(const LLSD& notification, const LLSD& response) class LLPromptShowFile : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string param = userdata.asString(); std::string::size_type offset = param.find(','); @@ -6295,7 +6295,7 @@ class LLPromptShowFile : public view_listener_t class LLShowAgentProfile : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLUUID agent_id; if (userdata.asString() == "agent") @@ -6326,7 +6326,7 @@ class LLShowAgentProfile : public view_listener_t class LLToggleAgentProfile : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLUUID agent_id; if (userdata.asString() == "agent") @@ -6364,7 +6364,7 @@ class LLToggleAgentProfile : public view_listener_t class LLLandEdit : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if (gAgentCamera.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) { @@ -6394,7 +6394,7 @@ class LLLandEdit : public view_listener_t class LLMuteParticle : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLUUID id = LLToolPie::getInstance()->getPick().mParticleOwnerID; @@ -6421,7 +6421,7 @@ class LLMuteParticle : public view_listener_t class LLWorldEnableBuyLand : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLViewerParcelMgr::getInstance()->canAgentBuyParcel( LLViewerParcelMgr::getInstance()->selectionEmpty() @@ -6455,7 +6455,7 @@ public: static void setObjectSelection(LLObjectSelectionHandle selection) { sObjectSelection = selection; } private: - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { setObjectSelection(LLSelectMgr::getInstance()->getSelection()); LLViewerObject* selectedObject = sObjectSelection->getFirstRootObject(); @@ -6607,7 +6607,7 @@ void callback_attachment_drop(const LLSD& notification, const LLSD& response) class LLAttachmentDrop : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLSD payload; LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); @@ -6630,7 +6630,7 @@ class LLAttachmentDrop : public view_listener_t // called from avatar pie menu class LLAttachmentDetachFromPoint : public view_listener_t { - bool handleEvent(const LLSD& user_data) + bool handleEvent(const LLSD& user_data) override { uuid_vec_t ids_to_remove; const LLViewerJointAttachment *attachment = get_if_there(gAgentAvatarp->mAttachmentPoints, user_data.asInteger(), (LLViewerJointAttachment*)NULL); @@ -6685,7 +6685,7 @@ static bool onEnableAttachmentLabel(LLUICtrl* ctrl, const LLSD& data) class LLAttachmentDetach : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { // Called when the user clicked on an object attached to them // and selected "Detach". @@ -6740,7 +6740,7 @@ public: virtual ~LLWornItemFetchedObserver() {} protected: - virtual void done() + void done() override { gMenuAttachmentSelf->buildDrawLabels(); gInventory.removeObserver(this); @@ -6751,7 +6751,7 @@ protected: // You can only drop items on parcels where you can build. class LLAttachmentEnableDrop : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { BOOL can_build = gAgent.isGodlike() || (LLViewerParcelMgr::getInstance()->allowAgentBuild()); @@ -6835,7 +6835,7 @@ BOOL enable_detach(const LLSD&) class LLAttachmentEnableDetach : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = enable_detach(); return new_value; @@ -6899,7 +6899,7 @@ BOOL object_is_wearable() class LLAttachmentPointFilled : public view_listener_t { - bool handleEvent(const LLSD& user_data) + bool handleEvent(const LLSD& user_data) override { bool enable = false; LLVOAvatar::attachment_map_t::iterator found_it = gAgentAvatarp->mAttachmentPoints.find(user_data.asInteger()); @@ -6913,7 +6913,7 @@ class LLAttachmentPointFilled : public view_listener_t class LLAvatarSendIM : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar) @@ -6926,7 +6926,7 @@ class LLAvatarSendIM : public view_listener_t class LLAvatarCall : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(avatar) @@ -6944,8 +6944,9 @@ namespace BOOL scripted; BOOL modifiable; LLFloaterScriptQueue* mQueue; - QueueObjects(LLFloaterScriptQueue* q) : mQueue(q), scripted(FALSE), modifiable(FALSE) {} - virtual bool apply(LLSelectNode* node) + QueueObjects(LLFloaterScriptQueue* q) : scripted(FALSE), modifiable(FALSE), mQueue(q) {} + + bool apply(LLSelectNode* node) override { LLViewerObject* obj = node->getObject(); if (!obj) @@ -7002,7 +7003,7 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& msg) class LLToolsSelectedScriptAction : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string action = userdata.asString(); bool mono = false; @@ -7197,7 +7198,7 @@ void handle_dump_attachments(void*) // these are used in the gl menus to set control values, generically. class LLToggleControl : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string control_name = userdata.asString(); BOOL checked = gSavedSettings.getBOOL( control_name ); @@ -7208,7 +7209,7 @@ class LLToggleControl : public view_listener_t class LLCheckControl : public view_listener_t { - bool handleEvent( const LLSD& userdata) + bool handleEvent( const LLSD& userdata) override { std::string callback_data = userdata.asString(); bool new_value = gSavedSettings.getBOOL(callback_data); @@ -7220,7 +7221,7 @@ class LLCheckControl : public view_listener_t class LLAdvancedCheckRenderShadowOption: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string control_name = userdata.asString(); S32 current_shadow_level = gSavedSettings.getS32(control_name); @@ -7237,7 +7238,7 @@ class LLAdvancedCheckRenderShadowOption: public view_listener_t class LLAdvancedClickRenderShadowOption: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string control_name = userdata.asString(); S32 current_shadow_level = gSavedSettings.getS32(control_name); @@ -7255,7 +7256,7 @@ class LLAdvancedClickRenderShadowOption: public view_listener_t class LLAdvancedClickRenderProfile: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gShaderProfileFrame = TRUE; return true; @@ -7266,7 +7267,7 @@ F32 gpu_benchmark(); class LLAdvancedClickRenderBenchmark: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gpu_benchmark(); return true; @@ -7285,7 +7286,7 @@ void menu_toggle_attached_particles(void* user_data) class LLAdvancedHandleAttachedLightParticles: public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string control_name = userdata.asString(); @@ -7308,7 +7309,7 @@ class LLAdvancedHandleAttachedLightParticles: public view_listener_t class LLSomethingSelected : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = !(LLSelectMgr::getInstance()->getSelection()->isEmpty()); return new_value; @@ -7317,7 +7318,7 @@ class LLSomethingSelected : public view_listener_t class LLSomethingSelectedNoHUD : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); bool new_value = !(selection->isEmpty()) && !(selection->getSelectType() == SELECT_TYPE_HUD); @@ -7332,7 +7333,7 @@ static bool is_editable_selected() class LLEditableSelected : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return is_editable_selected(); } @@ -7340,7 +7341,7 @@ class LLEditableSelected : public view_listener_t class LLEditableSelectedMono : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = false; LLViewerRegion* region = gAgent.getRegion(); @@ -7369,7 +7370,7 @@ bool enable_object_take_copy() { struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* obj) + bool apply(LLViewerObject* obj) override { return (!obj->permCopy() || obj->isAttachment()); } @@ -7391,8 +7392,8 @@ class LLHasAsset : public LLInventoryCollectFunctor public: LLHasAsset(const LLUUID& id) : mAssetID(id), mHasAsset(FALSE) {} virtual ~LLHasAsset() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); + bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) override; BOOL hasAsset() const { return mHasAsset; } protected: @@ -7428,7 +7429,7 @@ BOOL enable_save_into_task_inventory(void*) class LLToolsEnableSaveToObjectInventory : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = enable_save_into_task_inventory(NULL); return new_value; @@ -7437,7 +7438,7 @@ class LLToolsEnableSaveToObjectInventory : public view_listener_t class LLToggleHowTo : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLFloaterWebContent::Params p; std::string url = gSavedSettings.getString("HowToHelpURL"); @@ -7454,7 +7455,7 @@ class LLToggleHowTo : public view_listener_t class LLViewEnableMouselook : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { // You can't go directly from customize avatar to mouselook. // TODO: write code with appropriate dialogs to handle this transition. @@ -7465,7 +7466,7 @@ class LLViewEnableMouselook : public view_listener_t class LLToolsEnableToolNotPie : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = ( LLToolMgr::getInstance()->getBaseTool() != LLToolPie::getInstance() ); return new_value; @@ -7474,7 +7475,7 @@ class LLToolsEnableToolNotPie : public view_listener_t class LLWorldEnableCreateLandmark : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return !LLLandmarkActions::landmarkAlreadyExists(); } @@ -7482,7 +7483,7 @@ class LLWorldEnableCreateLandmark : public view_listener_t class LLWorldEnableSetHomeLocation : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gAgent.isGodlike() || (gAgent.getRegion() && gAgent.getRegion()->getAllowSetHome()); @@ -7492,7 +7493,7 @@ class LLWorldEnableSetHomeLocation : public view_listener_t class LLWorldEnableTeleportHome : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLViewerRegion* regionp = gAgent.getRegion(); bool agent_on_prelude = (regionp && regionp->isPrelude()); @@ -7534,7 +7535,7 @@ BOOL check_show_xui_names(void *) class LLToolsSelectOnlyMyObjects : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { BOOL cur_val = gSavedSettings.getBOOL("SelectOwnedOnly"); @@ -7546,7 +7547,7 @@ class LLToolsSelectOnlyMyObjects : public view_listener_t class LLToolsSelectOnlyMovableObjects : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { BOOL cur_val = gSavedSettings.getBOOL("SelectMovableOnly"); @@ -7558,7 +7559,7 @@ class LLToolsSelectOnlyMovableObjects : public view_listener_t class LLToolsSelectBySurrounding : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLSelectMgr::sRectSelectInclusive = !LLSelectMgr::sRectSelectInclusive; @@ -7569,7 +7570,7 @@ class LLToolsSelectBySurrounding : public view_listener_t class LLToolsShowHiddenSelection : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { // TomY TODO Merge these LLSelectMgr::sRenderHiddenSelections = !LLSelectMgr::sRenderHiddenSelections; @@ -7581,7 +7582,7 @@ class LLToolsShowHiddenSelection : public view_listener_t class LLToolsShowSelectionLightRadius : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { // TomY TODO merge these LLSelectMgr::sRenderLightRadius = !LLSelectMgr::sRenderLightRadius; @@ -7593,7 +7594,7 @@ class LLToolsShowSelectionLightRadius : public view_listener_t class LLToolsEditLinkedParts : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { BOOL select_individuals = !gSavedSettings.getBOOL("EditLinkedParts"); gSavedSettings.setBOOL( "EditLinkedParts", select_individuals ); @@ -7776,12 +7777,12 @@ void force_error_driver_crash(void *) class LLToolsUseSelectionForGrid : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLSelectMgr::getInstance()->clearGridObjects(); struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* objectp) + bool apply(LLViewerObject* objectp) override { LLSelectMgr::getInstance()->addGridObject(objectp); return true; @@ -7925,7 +7926,7 @@ BOOL get_visibility(void* user_data) // TomY TODO: Get rid of these? class LLViewShowHoverTips : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { gSavedSettings.setBOOL("ShowHoverTips", !gSavedSettings.getBOOL("ShowHoverTips")); return true; @@ -7934,7 +7935,7 @@ class LLViewShowHoverTips : public view_listener_t class LLViewCheckShowHoverTips : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = gSavedSettings.getBOOL("ShowHoverTips"); return new_value; @@ -7944,7 +7945,7 @@ class LLViewCheckShowHoverTips : public view_listener_t // TomY TODO: Get rid of these? class LLViewHighlightTransparent : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; return true; @@ -7953,7 +7954,7 @@ class LLViewHighlightTransparent : public view_listener_t class LLViewCheckHighlightTransparent : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLDrawPoolAlpha::sShowDebugAlpha; return new_value; @@ -7962,7 +7963,7 @@ class LLViewCheckHighlightTransparent : public view_listener_t class LLViewBeaconWidth : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string width = userdata.asString(); if(width == "1") @@ -7989,7 +7990,7 @@ class LLViewBeaconWidth : public view_listener_t class LLViewToggleBeacon : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string beacon = userdata.asString(); if (beacon == "scriptsbeacon") @@ -8063,7 +8064,7 @@ class LLViewToggleBeacon : public view_listener_t class LLViewCheckBeaconEnabled : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string beacon = userdata.asString(); bool new_value = false; @@ -8113,7 +8114,7 @@ class LLViewCheckBeaconEnabled : public view_listener_t class LLViewToggleRenderType : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string type = userdata.asString(); if (type == "hideparticles") @@ -8126,7 +8127,7 @@ class LLViewToggleRenderType : public view_listener_t class LLViewCheckRenderType : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string type = userdata.asString(); bool new_value = false; @@ -8140,7 +8141,7 @@ class LLViewCheckRenderType : public view_listener_t class LLViewStatusAway : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return (gAgent.isInitialized() && gAgent.getAFK()); } @@ -8148,7 +8149,7 @@ class LLViewStatusAway : public view_listener_t class LLViewStatusDoNotDisturb : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return (gAgent.isInitialized() && gAgent.isDoNotDisturb()); } @@ -8156,7 +8157,7 @@ class LLViewStatusDoNotDisturb : public view_listener_t class LLViewShowHUDAttachments : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLPipeline::sShowHUDAttachments = !LLPipeline::sShowHUDAttachments; return true; @@ -8165,7 +8166,7 @@ class LLViewShowHUDAttachments : public view_listener_t class LLViewCheckHUDAttachments : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool new_value = LLPipeline::sShowHUDAttachments; return new_value; @@ -8174,7 +8175,7 @@ class LLViewCheckHUDAttachments : public view_listener_t class LLEditEnableTakeOff : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string clothing = userdata.asString(); LLWearableType::EType type = LLWearableType::typeNameToType(clothing); @@ -8186,7 +8187,7 @@ class LLEditEnableTakeOff : public view_listener_t class LLEditTakeOff : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string clothing = userdata.asString(); if (clothing == "all") @@ -8211,7 +8212,7 @@ class LLEditTakeOff : public view_listener_t class LLToolsSelectTool : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string tool_name = userdata.asString(); if (tool_name == "focus") @@ -8250,7 +8251,7 @@ class LLToolsSelectTool : public view_listener_t /// WINDLIGHT callbacks class LLWorldEnvSettings : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string tod = userdata.asString(); @@ -8294,7 +8295,7 @@ class LLWorldEnvSettings : public view_listener_t class LLWorldEnableEnvSettings : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool result = false; std::string tod = userdata.asString(); @@ -8337,7 +8338,7 @@ class LLWorldEnableEnvSettings : public view_listener_t class LLWorldEnvPreset : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string item = userdata.asString(); @@ -8388,7 +8389,7 @@ class LLWorldEnvPreset : public view_listener_t class LLWorldEnableEnvPreset : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string item = userdata.asString(); @@ -8423,7 +8424,7 @@ class LLWorldEnableEnvPreset : public view_listener_t /// Post-Process callbacks class LLWorldPostProcess : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLFloaterReg::showInstance("env_post_process"); return true; @@ -8440,7 +8441,7 @@ class LLUploadCostCalculator : public view_listener_t { std::string mCostStr; - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string menu_name = userdata.asString(); calculateCost(); @@ -8470,7 +8471,7 @@ void handle_premium_voice_morphing_subscribe() class LLToggleUIHints : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool ui_hints_enabled = gSavedSettings.getBOOL("EnableUIHints"); // toggle @@ -8570,7 +8571,7 @@ void initialize_menus() public: // The "mult" parameter says whether "val" is a multiplier or used to set the value. LLZoomer(F32 val, bool mult=true) : mVal(val), mMult(mult) {} - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { F32 new_fov_rad = mMult ? LLViewerCamera::getInstance()->getDefaultFOV() * mVal : mVal; LLViewerCamera::getInstance()->setDefaultFOV(new_fov_rad); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 387c8b277733e4742ef4565879b0b7080bc4ee32..500ded3766be1e97088230b2f98c58b2b52b0e04 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -83,7 +83,7 @@ class LLFileEnableUpload : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return gStatusBar && LLGlobalEconomy::getInstance() && (gStatusBar->getBalance() >= LLGlobalEconomy::getInstance()->getPriceUpload()); } @@ -91,7 +91,7 @@ class LLFileEnableUpload : public view_listener_t class LLFileEnableUploadModel : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) LLFloaterReg::findInstance("upload_model"); if (fmp && fmp->isModelLoading()) @@ -105,7 +105,7 @@ class LLFileEnableUploadModel : public view_listener_t class LLMeshUploadVisible : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { return gMeshRepo.meshUploadEnabled(); } @@ -328,7 +328,7 @@ const std::string upload_pick(void* data) class LLFileUploadImage : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string filename = upload_pick((void *)LLFilePicker::FFLOAD_IMAGE); if (!filename.empty()) @@ -341,7 +341,7 @@ class LLFileUploadImage : public view_listener_t class LLFileUploadModel : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) LLFloaterReg::getInstance("upload_model"); if (fmp && !fmp->isModelLoading()) @@ -355,7 +355,7 @@ class LLFileUploadModel : public view_listener_t class LLFileUploadSound : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_WAV); if (!filename.empty()) @@ -368,7 +368,7 @@ class LLFileUploadSound : public view_listener_t class LLFileUploadAnim : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { const std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_ANIM); if (!filename.empty()) @@ -388,7 +388,7 @@ class LLFileUploadAnim : public view_listener_t class LLFileUploadBulk : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { if( gAgentCamera.cameraMouselook() ) { @@ -456,7 +456,7 @@ void upload_error(const std::string& error_message, const std::string& label, co class LLFileEnableCloseWindow : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool frontmost_fl_exists = (NULL != gFloaterView->getFrontmostClosableFloater()); bool frontmost_snapshot_fl_exists = (NULL != gSnapshotFloaterView->getFrontmostClosableFloater()); @@ -467,7 +467,7 @@ class LLFileEnableCloseWindow : public view_listener_t class LLFileCloseWindow : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool frontmost_fl_exists = (NULL != gFloaterView->getFrontmostClosableFloater()); LLFloater* snapshot_floater = gSnapshotFloaterView->getFrontmostClosableFloater(); @@ -491,7 +491,7 @@ class LLFileCloseWindow : public view_listener_t class LLFileEnableCloseAllWindows : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLFloaterSnapshot* floater_snapshot = LLFloaterSnapshot::findInstance(); LLFloaterOutfitSnapshot* floater_outfit_snapshot = LLFloaterOutfitSnapshot::findInstance(); @@ -504,7 +504,7 @@ class LLFileEnableCloseAllWindows : public view_listener_t class LLFileCloseAllWindows : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { bool app_quitting = false; gFloaterView->closeAllChildren(app_quitting); @@ -521,7 +521,7 @@ class LLFileCloseAllWindows : public view_listener_t class LLFileTakeSnapshotToDisk : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLPointer<LLImageRaw> raw = new LLImageRaw; @@ -570,7 +570,7 @@ class LLFileTakeSnapshotToDisk : public view_listener_t class LLFileQuit : public view_listener_t { - bool handleEvent(const LLSD& userdata) + bool handleEvent(const LLSD& userdata) override { LLAppViewer::instance()->userQuit(); return true; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index e3ce91ddb00e266be408ab5ea42d78bb34c0bd30..1c7f409d19bf35690479fb9127c3b3a35e17e761 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -217,9 +217,8 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco } LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp, BOOL is_global) -: LLTrace::MemTrackable<LLViewerObject>("LLViewerObject"), - LLPrimitive(), - mChildList(), +: LLPrimitive(), + LLTrace::MemTrackable<LLViewerObject>("LLViewerObject"), mID(id), mLocalID(0), mTotalCRC(0), @@ -242,6 +241,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mText(), mHudText(""), mHudTextColor(LLColor4::white), + mChildList(), mLastInterpUpdateSecs(0.f), mLastMessageUpdateSecs(0.f), mLatestRecvPacketID(0), @@ -6385,10 +6385,10 @@ LLVOAvatar* LLViewerObject::getAvatar() const class ObjectPhysicsProperties : public LLHTTPNode { public: - virtual void post( + void post( ResponsePtr responder, const LLSD& context, - const LLSD& input) const + const LLSD& input) const override { LLSD object_data = input["body"]["ObjectData"]; S32 num_entries = object_data.size(); @@ -6403,7 +6403,8 @@ public: { U32 mID; f(const U32& id) : mID(id) {} - virtual bool apply(LLSelectNode* node) + + bool apply(LLSelectNode* node) override { return (node->getObject() && node->getObject()->mLocalID == mID ); } diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 00ddee5f38ad87f0d5914483025de3326d5cafac..f401417c8a9e2dc13de7aa641e4fff2e906e47cf 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -326,8 +326,8 @@ LLViewerOctreeEntryData::~LLViewerOctreeEntryData() } LLViewerOctreeEntryData::LLViewerOctreeEntryData(LLViewerOctreeEntry::eEntryDataType_t data_type) - : mDataType(data_type), - mEntry(NULL) + : mEntry(NULL), + mDataType(data_type) { } @@ -463,9 +463,9 @@ LLViewerOctreeGroup::~LLViewerOctreeGroup() LLViewerOctreeGroup::LLViewerOctreeGroup(OctreeNode* node) : LLTrace::MemTrackable<LLViewerOctreeGroup, 16>("LLViewerOctreeGroup"), + mState(CLEAN), mOctreeNode(node), - mAnyVisible(0), - mState(CLEAN) + mAnyVisible(0) { LLVector4a tmp; tmp.splat(0.f); @@ -834,7 +834,8 @@ class LLSpatialSetOcclusionState : public OctreeTraveler public: U32 mState; LLSpatialSetOcclusionState(U32 state) : mState(state) { } - virtual void visit(const OctreeNode* branch) + + void visit(const OctreeNode* branch) override { LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)branch->getListener(0); if(group) @@ -849,7 +850,7 @@ class LLSpatialSetOcclusionStateDiff : public LLSpatialSetOcclusionState public: LLSpatialSetOcclusionStateDiff(U32 state) : LLSpatialSetOcclusionState(state) { } - virtual void traverse(const OctreeNode* n) + void traverse(const OctreeNode* n) override { LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*) n->getListener(0); @@ -983,7 +984,8 @@ public: U32 mState; LLSpatialClearOcclusionState(U32 state) : mState(state) { } - virtual void visit(const OctreeNode* branch) + + void visit(const OctreeNode* branch) override { LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)branch->getListener(0); if(group) @@ -998,7 +1000,7 @@ class LLSpatialClearOcclusionStateDiff : public LLSpatialClearOcclusionState public: LLSpatialClearOcclusionStateDiff(U32 state) : LLSpatialClearOcclusionState(state) { } - virtual void traverse(const OctreeNode* n) + void traverse(const OctreeNode* n) override { LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*) n->getListener(0); @@ -1326,10 +1328,10 @@ void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera, const LLVector4a* sh //class LLViewerOctreePartition definitions //----------------------------------------------------------------------------------- LLViewerOctreePartition::LLViewerOctreePartition() : - mRegionp(NULL), - mOcclusionEnabled(TRUE), - mDrawableType(0), - mPartitionType(0), + mPartitionType(0), + mDrawableType(0), + mRegionp(NULL), + mOcclusionEnabled(TRUE), mLODSeed(0), mLODPeriod(1) { diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index a311d8b8802e301c28a7c716ad07d00c06f32dab..b74aba777eec33c7f40b677bddbe99687e36aacf 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -121,6 +121,8 @@ LLViewerParcelMgr::LLViewerParcelMgr() mHoverWestSouth(), mHoverEastNorth(), mTeleportInProgressPosition(), + mCollisionRegionHandle(0), + mCollisionUpdateSignal(nullptr), mRenderCollision(FALSE), mRenderSelection(TRUE), mCollisionBanned(0), @@ -140,6 +142,9 @@ LLViewerParcelMgr::LLViewerParcelMgr() mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; resetSegments(mHighlightSegments); + mCollisionBitmap = new U8[getCollisionBitmapSize()]; + memset(mCollisionBitmap, 0, getCollisionBitmapSize()); + mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; resetSegments(mCollisionSegments); @@ -191,6 +196,9 @@ LLViewerParcelMgr::~LLViewerParcelMgr() delete[] mHighlightSegments; mHighlightSegments = NULL; + delete[] mCollisionBitmap; + mCollisionBitmap = NULL; + delete[] mCollisionSegments; mCollisionSegments = NULL; @@ -226,7 +234,7 @@ void LLViewerParcelMgr::dump() } -LLViewerRegion* LLViewerParcelMgr::getSelectionRegion() +LLViewerRegion* LLViewerParcelMgr::getSelectionRegion() const { return LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); } @@ -1753,13 +1761,22 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use / 8; U8* bitmap = new U8[ bitmap_size ]; msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); + msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, parcel_mgr.mCollisionBitmap, parcel_mgr.getCollisionBitmapSize()); + parcel_mgr.resetSegments(parcel_mgr.mCollisionSegments); parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mCollisionSegments ); + parcel_mgr.writeSegmentsFromBitmap(parcel_mgr.mCollisionBitmap, parcel_mgr.mCollisionSegments); + delete[] bitmap; bitmap = NULL; + LLViewerRegion* pRegion = LLWorld::getInstance()->getRegion(msg->getSender()); + parcel_mgr.mCollisionRegionHandle = (pRegion) ? pRegion->getHandle() : 0; + + if (parcel_mgr.mCollisionUpdateSignal) + (*parcel_mgr.mCollisionUpdateSignal)(pRegion); } else if (sequence_id == HOVERED_PARCEL_SEQ_ID) { @@ -2533,3 +2550,10 @@ void LLViewerParcelMgr::onTeleportFailed() { mTeleportFailedSignal(); } + +boost::signals2::connection LLViewerParcelMgr::setCollisionUpdateCallback(const collision_update_signal_t::slot_type& cb) +{ + if (!mCollisionUpdateSignal) + mCollisionUpdateSignal = new collision_update_signal_t(); + return mCollisionUpdateSignal->connect(cb); +} diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index e14ef06095c03a492c07f354b49bd8cbbbc527ab..98d553f081961acee5fa1b4d93acfb0cd2864941 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -87,7 +87,7 @@ public: F32 getSelectionWidth() const { return F32(mEastNorth.mdV[VX] - mWestSouth.mdV[VX]); } F32 getSelectionHeight() const { return F32(mEastNorth.mdV[VY] - mWestSouth.mdV[VY]); } BOOL getSelection(LLVector3d &min, LLVector3d &max) { min = mWestSouth; max = mEastNorth; return !selectionEmpty();} - LLViewerRegion* getSelectionRegion(); + LLViewerRegion* getSelectionRegion() const; F32 getDwelling() const { return mSelectedDwell;} void getDisplayInfo(S32* area, S32* claim, S32* rent, BOOL* for_sale, F32* dwell); @@ -163,6 +163,13 @@ public: LLParcel* getCollisionParcel() const; + const U8* getCollisionBitmap() const { return mCollisionBitmap; } + size_t getCollisionBitmapSize() const { return mParcelsPerEdge * mParcelsPerEdge / 8; } + U64 getCollisionRegionHandle() const { return mCollisionRegionHandle; } + + typedef boost::signals2::signal<void (const LLViewerRegion*)> collision_update_signal_t; + boost::signals2::connection setCollisionUpdateCallback(const collision_update_signal_t::slot_type & cb); + // Can this agent build on the parcel he is on? // Used for parcel property icons in nav bar. bool allowAgentBuild() const; @@ -359,6 +366,9 @@ private: // Watch for pending collisions with a parcel you can't access. // If it's coming, draw the parcel's boundaries. LLParcel* mCollisionParcel; + U8* mCollisionBitmap; + U64 mCollisionRegionHandle; + collision_update_signal_t* mCollisionUpdateSignal; U8* mCollisionSegments; BOOL mRenderCollision; BOOL mRenderSelection; diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 98249c8cd6e6ee34554370eaa4ebbf07f8e690b1..80107e88fa560a55929b4bf391249f124ad82294 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -54,6 +54,8 @@ const U8 OVERLAY_IMG_COMPONENTS = 4; +LLViewerParcelOverlay::update_signal_t* LLViewerParcelOverlay::mUpdateSignal = NULL; + LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters) : mRegion( region ), mParcelGridsPerEdge( S32( region_width_meters / PARCEL_GRID_STEP_METERS ) ), @@ -857,6 +859,8 @@ void LLViewerParcelOverlay::idleUpdate(bool force_update) { updateOverlayTexture(); updatePropertyLines(); + if (mUpdateSignal) + (*mUpdateSignal)(mRegion); mTimeSinceLastUpdate.reset(); } } @@ -1006,3 +1010,10 @@ S32 LLViewerParcelOverlay::renderPropertyLines () return drawn; } + +boost::signals2::connection LLViewerParcelOverlay::setUpdateCallback(const update_signal_t::slot_type& cb) +{ + if (!mUpdateSignal) + mUpdateSignal = new update_signal_t(); + return mUpdateSignal->connect(cb); +} diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h index 7cf08fd9266b47fe75f9d8deacc1daf701387485..24c28800d241e8319fc24a947b1a7b23705ba77b 100644 --- a/indra/newview/llviewerparceloverlay.h +++ b/indra/newview/llviewerparceloverlay.h @@ -66,6 +66,7 @@ public: BOOL isBuildCameraAllowed(const LLVector3& pos) const; F32 getOwnedRatio() const; + const U8* getOwnership() const { return mOwnership; } // Returns the number of vertices drawn S32 renderPropertyLines(); @@ -81,6 +82,9 @@ public: void idleUpdate(bool update_now = false); void updateGL() override; + typedef boost::signals2::signal<void (const LLViewerRegion*)> update_signal_t; + static boost::signals2::connection setUpdateCallback(const update_signal_t::slot_type & cb); + private: // This is in parcel rows and columns, not grid rows and columns // Stored in bottom three bits. @@ -120,6 +124,8 @@ private: S32 mVertexCount; F32* mVertexArray; U8* mColorArray; + + static update_signal_t* mUpdateSignal; }; #endif diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index f8885861d11211cd379d52d8403bd1acc024aaed..60c000f26674c9f87be68088898d1acb6826b6b7 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -3500,6 +3500,39 @@ std::string LLViewerRegion::getHGGridName() const return name; } +U32 LLViewerRegion::getChatRange() const +{ + U32 range = 20; + if (mSimulatorFeatures.has("OpenSimExtras") + && mSimulatorFeatures["OpenSimExtras"].has("say-range")) + { + range = mSimulatorFeatures["OpenSimExtras"]["say-range"].asInteger(); + } + return range; +} + +U32 LLViewerRegion::getShoutRange() const +{ + U32 range = 100; + if (mSimulatorFeatures.has("OpenSimExtras") + && mSimulatorFeatures["OpenSimExtras"].has("shout-range")) + { + range = mSimulatorFeatures["OpenSimExtras"]["shout-range"].asInteger(); + } + return range; +} + +U32 LLViewerRegion::getWhisperRange() const +{ + U32 range = 10; + if (mSimulatorFeatures.has("OpenSimExtras") + && mSimulatorFeatures["OpenSimExtras"].has("whisper-range")) + { + range = mSimulatorFeatures["OpenSimExtras"]["whisper-range"].asInteger(); + } + return range; +} + void LLViewerRegion::setGodnames() { mGodNames.clear(); diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 77ee2e3ad1f7b902d552cd6f3c92a32f9bcc643c..9a48ba6ade18cd82f4c347cfea4ce95d57e6d916 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -409,6 +409,13 @@ public: std::string getHGGrid() const; /// Grid name (0.8.1) std::string getHGGridName() const; + /// Chat Range (0.8.1) + U32 getChatRange() const; + /// Shout Range (0.8.1) + U32 getShoutRange() const; + /// Whisper Range (0.8.1) + U32 getWhisperRange() const; + /// "God names" surname and full account names map std::set<std::string> getGods() const { return mGodNames; }; //@} diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index 40de520f3e0cf8bd160f5182461ee11883aad89f..67f4b86ff9756651b6f5bdb66774622093aaa594 100644 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -58,9 +58,9 @@ LLBakedUploadData::LLBakedUploadData(const LLVOAvatarSelf* avatar, LLViewerTexLayerSet* layerset, const LLUUID& id, bool highest_res) : + mID(id), mAvatar(avatar), mTexLayerSet(layerset), - mID(id), mStartTime(LLFrameTimer::getTotalTime()), // Record starting time mIsHighestRes(highest_res) { @@ -79,9 +79,9 @@ LLViewerTexLayerSetBuffer::LLViewerTexLayerSetBuffer(LLTexLayerSet* const owner, // ORDER_LAST => must render these after the hints are created. LLTexLayerSetBuffer(owner), LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, TRUE ), - mUploadPending(FALSE), // Not used for any logic here, just to sync sending of updates - mNeedsUpload(FALSE), + mNeedsUpload(FALSE), // Not used for any logic here, just to sync sending of updates mNumLowresUploads(0), + mUploadPending(FALSE), mUploadFailCount(0), mNeedsUpdate(TRUE), mNumLowresUpdates(0) @@ -372,9 +372,9 @@ public: ALTexLayerUploader(LLUUID assetId, std::string texture, LLBakedUploadData* baked_upload_data); ~ALTexLayerUploader(); - virtual LLSD prepareUpload(); - virtual LLSD generatePostBody(); - virtual LLUUID finishUpload(LLSD &result); + LLSD prepareUpload() override; + LLSD generatePostBody() override; + LLUUID finishUpload(LLSD &result) override; private: LLBakedUploadData* mBakedUploadData; diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index d855e9e5e26233070eaf4f5a0213eeda2549f1e0..f6403b3f3306f7c13212394b341ab86eb0cf113f 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -73,7 +73,7 @@ class LLEmbeddedLandmarkCopied: public LLInventoryCallback public: LLEmbeddedLandmarkCopied(){} - void fire(const LLUUID& inv_item) + void fire(const LLUUID& inv_item) override { showInfo(inv_item); } @@ -133,7 +133,7 @@ public: void setEditor(LLViewerTextEditor* e) {mTextEditor = e;} // override - void fire(const LLUUID& inv_item) + void fire(const LLUUID& inv_item) override { if(!mTextEditor) { @@ -178,8 +178,8 @@ public: mToolTip = inv_item->getName() + '\n' + inv_item->getDescription(); } - /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const - { + /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const override + { if (num_chars == 0) { width = 0; @@ -193,8 +193,8 @@ public: return false; } - /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const - { + /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const override + { // always draw at beginning of line if (line_offset == 0) { @@ -214,8 +214,8 @@ public: } } } - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) - { + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) override + { LLRectf image_rect = draw_rect; image_rect.mRight = image_rect.mLeft + mImage->getWidth(); image_rect.mTop = image_rect.mBottom + mImage->getHeight(); @@ -236,15 +236,16 @@ public: return right_x; } - /*virtual*/ bool canEdit() const { return false; } + /*virtual*/ bool canEdit() const override { return false; } - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) - { + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override + { LLUI::getWindow()->setCursor(UI_CURSOR_HAND); return TRUE; } - virtual BOOL handleToolTip(S32 x, S32 y, MASK mask ) + + BOOL handleToolTip(S32 x, S32 y, MASK mask ) override { if (!mToolTip.empty()) { @@ -254,7 +255,7 @@ public: return FALSE; } - /*virtual*/ LLStyleConstSP getStyle() const { return mStyle; } + /*virtual*/ LLStyleConstSP getStyle() const override { return mStyle; } private: LLUIImagePtr mImage; @@ -603,7 +604,7 @@ public: mItem = item; } - virtual BOOL execute( LLTextBase* editor, S32* delta ) + BOOL execute( LLTextBase* editor, S32* delta ) override { LLViewerTextEditor* viewer_editor = (LLViewerTextEditor*)editor; // Take this opportunity to remove any unused embedded items from this editor @@ -617,21 +618,22 @@ public: } return FALSE; } - - virtual S32 undo( LLTextBase* editor ) + + S32 undo( LLTextBase* editor ) override { remove(editor, getPosition(), 1); return getPosition(); } - - virtual S32 redo( LLTextBase* editor ) + + S32 redo( LLTextBase* editor ) override { LLWString ws; ws += mExtCharValue; insert(editor, getPosition(), ws ); return getPosition() + 1; } - virtual BOOL hasExtCharValue( llwchar value ) const + + BOOL hasExtCharValue( llwchar value ) const override { return (value == mExtCharValue); } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 5853ee99233e7522fc5553f92547da5b7b681a1c..066d845f06f58766e81e2a9b1ce305d3269f1ba4 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -137,9 +137,9 @@ LLLoadedCallbackEntry::LLLoadedCallbackEntry(loaded_callback_func cb, mLastUsedDiscard(MAX_DISCARD_LEVEL+1), mDesiredDiscard(discard_level), mNeedsImageRaw(need_imageraw), + mPaused(pause), mUserData(userdata), - mSourceCallbackList(src_callback_list), - mPaused(pause) + mSourceCallbackList(src_callback_list) { if(mSourceCallbackList) { @@ -341,18 +341,18 @@ LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromHost(const // Create a bridge to the viewer texture manager. class LLViewerTextureManagerBridge : public LLTextureManagerBridge { - /*virtual*/ LLPointer<LLGLTexture> getLocalTexture(BOOL usemipmaps = TRUE, BOOL generate_gl_tex = TRUE) - { + /*virtual*/ LLPointer<LLGLTexture> getLocalTexture(BOOL usemipmaps = TRUE, BOOL generate_gl_tex = TRUE) override + { return LLViewerTextureManager::getLocalTexture(usemipmaps, generate_gl_tex); } - /*virtual*/ LLPointer<LLGLTexture> getLocalTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps, BOOL generate_gl_tex = TRUE) - { + /*virtual*/ LLPointer<LLGLTexture> getLocalTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps, BOOL generate_gl_tex = TRUE) override + { return LLViewerTextureManager::getLocalTexture(width, height, components, usemipmaps, generate_gl_tex); } - /*virtual*/ LLGLTexture* getFetchedTexture(const LLUUID &image_id) - { + /*virtual*/ LLGLTexture* getFetchedTexture(const LLUUID &image_id) override + { return LLViewerTextureManager::getFetchedTexture(image_id); } }; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 33c3e55021c47e4f2972f8bb768cb609d962d306..19887f638b9f0beb875a1fb2c915548401e8521c 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -94,10 +94,10 @@ LLTextureKey::LLTextureKey(LLUUID id, ETexListType tex_type) LLViewerTextureList::LLViewerTextureList() : mForceResetTextureStats(FALSE), + mInitialized(FALSE), mUpdateStats(FALSE), mMaxResidentTexMemInMegaBytes(0), - mMaxTotalTextureMemInMegaBytes(0), - mInitialized(FALSE) + mMaxTotalTextureMemInMegaBytes(0) { } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 441bf06d0cf79ad950f31872418b3f4dc3fab898..772db9fa51d057d35bba7e0eed1ca74d3ac86f4b 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -110,9 +110,9 @@ LLSD summarize_by_buckets(std::vector<LLSD> in_records, std::vector<std::string> struct LocalTextureData { LocalTextureData() : + mImage(NULL), mIsBakedReady(false), mDiscard(MAX_DISCARD_LEVEL+1), - mImage(NULL), mWearableID(IMG_DEFAULT_AVATAR), mTexEntry(NULL) {} @@ -152,9 +152,9 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp) : LLVOAvatar(id, pcode, regionp), - mScreenp(NULL), mLastRegionHandle(0), mRegionCrossingCount(0), + mScreenp(NULL), // Value outside legal range, so will always be a mismatch the // first time through. mLastHoverOffsetSent(LLVector3(0.0f, 0.0f, -999.0f)), @@ -2339,7 +2339,7 @@ void LLVOAvatarSelf::appearanceChangeMetricsCoro(std::string url) LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("appearanceChangeMetrics", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = boost::make_shared<LLCore::HttpOptions>(); S32 currentSequence = mMetricSequence; if (S32_MAX == ++mMetricSequence) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 6e14952dee4d4dd674303b2d2829ccfd1a1e562a..9c33cdf316254862ec0fb1f93929afa4783da145 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -116,12 +116,12 @@ public: { mObject->removeMDCImpl(); } - - virtual U8 getMediaDataCount() const - { return mObject->getNumTEs(); } - virtual LLSD getMediaDataLLSD(U8 index) const - { + U8 getMediaDataCount() const override + { return mObject->getNumTEs(); } + + LLSD getMediaDataLLSD(U8 index) const override + { LLSD result; LLTextureEntry *te = mObject->getTE(index); if (NULL != te) @@ -140,8 +140,9 @@ public: } return result; } - virtual bool isCurrentMediaUrl(U8 index, const std::string &url) const - { + + bool isCurrentMediaUrl(U8 index, const std::string &url) const override + { LLTextureEntry *te = mObject->getTE(index); if (te) { @@ -153,20 +154,20 @@ public: return url.empty(); } - virtual LLUUID getID() const - { return mObject->getID(); } + LLUUID getID() const override + { return mObject->getID(); } - virtual void mediaNavigateBounceBack(U8 index) - { mObject->mediaNavigateBounceBack(index); } - - virtual bool hasMedia() const - { return mObject->hasMedia(); } - - virtual void updateObjectMediaData(LLSD const &data, const std::string &version_string) - { mObject->updateObjectMediaData(data, version_string); } - - virtual F64 getMediaInterest() const - { + void mediaNavigateBounceBack(U8 index) override + { mObject->mediaNavigateBounceBack(index); } + + bool hasMedia() const override + { return mObject->hasMedia(); } + + void updateObjectMediaData(LLSD const &data, const std::string &version_string) override + { mObject->updateObjectMediaData(data, version_string); } + + F64 getMediaInterest() const override + { F64 interest = mObject->getTotalMediaInterest(); if (interest < (F64)0.0) { @@ -181,23 +182,23 @@ public: } return interest; } - - virtual bool isInterestingEnough() const - { + + bool isInterestingEnough() const override + { return LLViewerMedia::isInterestingEnough(mObject, getMediaInterest()); } - virtual std::string getCapabilityUrl(const std::string &name) const - { return mObject->getRegion()->getCapability(name); } - - virtual bool isDead() const - { return mObject->isDead(); } - - virtual U32 getMediaVersion() const - { return LLTextureEntry::getVersionFromMediaVersionString(mObject->getMediaURL()); } - - virtual bool isNew() const - { return mNew; } + std::string getCapabilityUrl(const std::string &name) const override + { return mObject->getRegion()->getCapability(name); } + + bool isDead() const override + { return mObject->isDead(); } + + U32 getMediaVersion() const override + { return LLTextureEntry::getVersionFromMediaVersionString(mObject->getMediaURL()); } + + bool isNew() const override + { return mNew; } private: LLPointer<LLVOVolume> mObject; diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 059a347487b14b727763ab64cee9ba10e56ad4f4..c926dd8608161fe236d1cdfdc61c325b40e54bc7 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -266,6 +266,15 @@ void LLXMLRPCTransaction::Handler::onCompleted(LLCore::HttpHandle handle, // the contents of a buffer array are potentially noncontiguous, so we // will need to copy them into an contiguous block of memory for XMLRPC. LLCore::BufferArray *body = response->getBody(); + if (!body) + { + mImpl->setStatus(LLXMLRPCTransaction::StatusXMLRPCError); + LL_WARNS() << "LLXMLRPCTransaction XMLRPC error:" + << "Response has no body! OpenSim grid admins screw the pooch again!" << LL_ENDL; + LL_WARNS() << "LLXMLRPCTransaction request URI: " + << mImpl->mURI << LL_ENDL; + return; + } auto bodydata = std::make_unique<char[]>(body->size()); body->read(0, bodydata.get(), body->size()); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index aa77055602cc585b714ccdcfa67becafc5d7bab0..75d9993818b1aa949de6c306a1d830a857a080b5 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -524,12 +524,21 @@ <color name="MapAvatarSelfColor" value="0.53125 0 0.498047 1" /> + <color + name="MapChatRingColor" + reference="White_10" /> + <color + name="MapShoutRingColor" + reference="White_10" /> <color name="MapFrustumColor" reference="White_10" /> <color name="MapFrustumRotatingColor" reference="White_10" /> + <color + name="MapParcelBoundryLine" + reference="White_10" /> <color name="MapTrackColor" reference="Red" /> diff --git a/indra/newview/skins/default/xui/en/floater_message_log.xml b/indra/newview/skins/default/xui/en/floater_message_log.xml index a9cf88a0fefcfda64f9d57b411dbfa7ce65eb8b8..36908173bed7fc19ccb6de520f360048407a4d9b 100644 --- a/indra/newview/skins/default/xui/en/floater_message_log.xml +++ b/indra/newview/skins/default/xui/en/floater_message_log.xml @@ -11,6 +11,14 @@ can_resize="true" can_minimize="true" save_rect="true"> + <floater.string + name="filter_status"> + Showing [MESSAGES] of [TOTAL] messages... + </floater.string> + <floater.string + name="no_filter_status"> + Showing [TOTAL] messages... + </floater.string> <layout_stack clip="false" follows="all" diff --git a/indra/newview/skins/default/xui/en/menu_mini_map.xml b/indra/newview/skins/default/xui/en/menu_mini_map.xml index 12f31cc7cd23bdb6ada293e14245124fccabd47c..a41dd8066e2213ec0198b4bd0112ced8a17977ec 100644 --- a/indra/newview/skins/default/xui/en/menu_mini_map.xml +++ b/indra/newview/skins/default/xui/en/menu_mini_map.xml @@ -92,6 +92,15 @@ <menu_item_check.on_click function="ToggleControl" parameter="AlchemyMinimapGuideLine" /> + </menu_item_check> + <menu_item_check + label="Chat Rings" + name="Chat Rings"> + <menu_item_check.on_check + control="AlchemyMinimapChatRings" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="AlchemyMinimapChatRings" /> </menu_item_check> <menu_item_separator /> <menu_item_call diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index d4baf610d67af7ec648f6183293514f2ecfda32a..7bd87aef8f46f129050bc84d2147a36e9f848068 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1451,6 +1451,9 @@ <menu_item_call.on_click function="File.UploadBulk" parameter="" /> + <menu_item_call.on_visible + function="Upload.CalculateCosts" + parameter="Bulk Upload" /> </menu_item_call> </menu> <menu_item_separator/> diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index e849a40d6b0f7c33ebe45d4d7c841a2569733069..ddc2e160b8bb279f777bfcdd6115ef80654281bb 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -555,7 +555,6 @@ class WindowsManifest(ViewerManifest): return [ "signtool.exe", "sign", "/v", "/n", self.args['signature'], - "/p", os.environ['VIEWER_SIGNING_PWD'], "/d","%s" % self.channel(), "/t","http://timestamp.comodoca.com/authenticode" ] + list(argv) @@ -564,11 +563,11 @@ class WindowsManifest(ViewerManifest): subprocess.check_call(self.sign_command(*argv)) def package_finish(self): - if 'signature' in self.args and 'VIEWER_SIGNING_PWD' in os.environ: + if 'signature' in self.args: try: self.sign(self.args['configuration']+"\\"+self.final_exe()) self.sign(self.args['configuration']+"\\AlchemyPlugin.exe") - self.sign(self.args['configuration']+"\\SLVoice.exe") + self.sign(self.args['configuration']+"\\voice\\SLVoice.exe") except: print "Couldn't sign binaries. Tried to sign %s" % self.args['configuration'] + "\\" + self.final_exe() @@ -639,7 +638,7 @@ class WindowsManifest(ViewerManifest): print >> sys.stderr, "Maximum nsis attempts exceeded; giving up" raise # self.remove(self.dst_path_of(tempfile)) - if 'signature' in self.args and 'VIEWER_SIGNING_PWD' in os.environ: + if 'signature' in self.args: try: self.sign(self.args['configuration'] + "\\" + substitution_strings['installer_file']) except: